@mhmo91/schmancy 0.4.46 → 0.4.48

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.
Files changed (57) hide show
  1. package/ai/dialog.md +160 -124
  2. package/dist/ai/dialog.md +160 -124
  3. package/dist/{avatar-By_6fdSR.cjs → avatar-CagKP9HD.cjs} +2 -2
  4. package/dist/{avatar-By_6fdSR.cjs.map → avatar-CagKP9HD.cjs.map} +1 -1
  5. package/dist/{avatar-DZ45SZ_3.js → avatar-DBcrNPzz.js} +7 -7
  6. package/dist/{avatar-DZ45SZ_3.js.map → avatar-DBcrNPzz.js.map} +1 -1
  7. package/dist/badge.cjs +1 -1
  8. package/dist/badge.js +1 -1
  9. package/dist/button.cjs +1 -1
  10. package/dist/button.js +1 -1
  11. package/dist/content-drawer.cjs +1 -1
  12. package/dist/content-drawer.js +1 -1
  13. package/dist/{date-range-CVkBXQxc.cjs → date-range-Cf9ldt-N.cjs} +2 -2
  14. package/dist/{date-range-CVkBXQxc.cjs.map → date-range-Cf9ldt-N.cjs.map} +1 -1
  15. package/dist/{date-range-Cnrrl6_Q.js → date-range-DPZXGoEA.js} +2 -2
  16. package/dist/{date-range-Cnrrl6_Q.js.map → date-range-DPZXGoEA.js.map} +1 -1
  17. package/dist/date-range.cjs +1 -1
  18. package/dist/date-range.js +1 -1
  19. package/dist/{dialog-content-MhUhElif.js → dialog-content-CT6Y3ZLb.js} +2 -2
  20. package/dist/{dialog-content-MhUhElif.js.map → dialog-content-CT6Y3ZLb.js.map} +1 -1
  21. package/dist/{dialog-content-Dm9ywkp4.cjs → dialog-content-tiwbeegi.cjs} +2 -2
  22. package/dist/{dialog-content-Dm9ywkp4.cjs.map → dialog-content-tiwbeegi.cjs.map} +1 -1
  23. package/dist/{dialog-service-iRGqMSDe.cjs → dialog-service-DUDhcx9X.cjs} +2 -2
  24. package/dist/{dialog-service-iRGqMSDe.cjs.map → dialog-service-DUDhcx9X.cjs.map} +1 -1
  25. package/dist/{dialog-service-LvOr2E3k.js → dialog-service-Dm7HJGjx.js} +2 -2
  26. package/dist/{dialog-service-LvOr2E3k.js.map → dialog-service-Dm7HJGjx.js.map} +1 -1
  27. package/dist/dialog.cjs +1 -1
  28. package/dist/dialog.js +2 -2
  29. package/dist/{icon-button-BW5ofOL5.js → icon-button-BGvSPuE-.js} +1 -2
  30. package/dist/icon-button-BGvSPuE-.js.map +1 -0
  31. package/dist/{icon-button-9V68mzcL.cjs → icon-button-DbvjV5zJ.cjs} +1 -2
  32. package/dist/icon-button-DbvjV5zJ.cjs.map +1 -0
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +7 -7
  35. package/dist/nav-drawer.cjs +1 -1
  36. package/dist/nav-drawer.js +1 -1
  37. package/dist/{sheet-DMP3Pfe5.js → sheet-Cw2qLdzN.js} +4 -4
  38. package/dist/sheet-Cw2qLdzN.js.map +1 -0
  39. package/dist/sheet-eCDoMdHF.cjs +52 -0
  40. package/dist/sheet-eCDoMdHF.cjs.map +1 -0
  41. package/dist/sheet.cjs +1 -1
  42. package/dist/sheet.js +1 -1
  43. package/dist/teleport.cjs +1 -1
  44. package/dist/teleport.js +1 -1
  45. package/dist/theme.cjs +1 -1
  46. package/dist/{theme.component-Bl4uy-_0.js → theme.component-ColRTbY5.js} +122 -122
  47. package/dist/{theme.component-Bl4uy-_0.js.map → theme.component-ColRTbY5.js.map} +1 -1
  48. package/dist/theme.component-RtV3l-Ns.cjs +3 -0
  49. package/dist/{theme.component-Dnf9PdX8.cjs.map → theme.component-RtV3l-Ns.cjs.map} +1 -1
  50. package/dist/theme.js +1 -1
  51. package/package.json +1 -1
  52. package/dist/icon-button-9V68mzcL.cjs.map +0 -1
  53. package/dist/icon-button-BW5ofOL5.js.map +0 -1
  54. package/dist/sheet-DMP3Pfe5.js.map +0 -1
  55. package/dist/sheet-Dsx7bpof.cjs +0 -52
  56. package/dist/sheet-Dsx7bpof.cjs.map +0 -1
  57. package/dist/theme.component-Dnf9PdX8.cjs +0 -3
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-service-iRGqMSDe.cjs","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_s","$dialog","ask","danger","component","simple"],"mappings":"kGACaA,EAAyB,uBACzBC,EAAkB,kBCsClBC,EAAN,MAAMA,CAAAA,CA0BJ,aAAAC,CAZRC,KAAQC,cAAiC,CAAA,EAGzCD,KAAQE,iBAA0B,CAAA,EAGlCF,KAAQG,cAAgB,IAAIC,UAG5BJ,KAAQK,eAAiB,IAAID,UAI5BJ,KAAKM,wBAAAA,EACLN,KAAKO,wBAAAA,CACN,CAKA,oBAAcC,CAIb,OAHKV,EAAcW,WAClBX,EAAcW,SAAW,IAAIX,GAEvBA,EAAcW,QACtB,CAKQ,yBAAAH,CACPN,KAAKG,cACHO,KACAC,EAAAA,aACCC,EAAAA,SAAS,CACRC,YAAgCC,OAAQjB,CAAAA,EAAiBa,KACxDK,YAAUC,EAAAA,MAAM,GAAA,CAAA,EAChBC,EAAAA,IAAIC,GAAKA,EAAEC,MAAAA,EACXC,EAAAA,eAAAA,MAAe,CAAA,EAEhBC,EAAAA,GAAGC,CAAAA,EAAQZ,KACVa,EAAAA,IAAI,IAAA,CACH,MAAMC,EAAMF,EAAOG,OAAS,UACzB,kBAAkBC,KAAKC,IAAAA,CAAAA,IAASC,KA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dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_s","$dialog","ask","danger","component","simple"],"mappings":"kGACaA,EAAyB,uBACzBC,EAAkB,kBCsClBC,EAAN,MAAMA,CAAAA,CA0BJ,aAAAC,CAZRC,KAAQC,cAAiC,CAAA,EAGzCD,KAAQE,iBAA0B,CAAA,EAGlCF,KAAQG,cAAgB,IAAIC,UAG5BJ,KAAQK,eAAiB,IAAID,UAI5BJ,KAAKM,wBAAAA,EACLN,KAAKO,wBAAAA,CACN,CAKA,oBAAcC,CAIb,OAHKV,EAAcW,WAClBX,EAAcW,SAAW,IAAIX,GAEvBA,EAAcW,QACtB,CAKQ,yBAAAH,CACPN,KAAKG,cACHO,KACAC,EAAAA,aACCC,EAAAA,SAAS,CACRC,YAAgCC,OAAQjB,CAAAA,EAAiBa,KACxDK,YAAUC,EAAAA,MAAM,GAAA,CAAA,EAChBC,EAAAA,IAAIC,GAAKA,EAAEC,MAAAA,EACXC,EAAAA,eAAAA,MAAe,CAAA,EAEhBC,EAAAA,GAAGC,CAAAA,EAAQZ,KACVa,EAAAA,IAAI,IAAA,CACH,MAAMC,EAAMF,EAAOG,OAAS,UACzB,kBAAkBC,KAAKC,IAAAA,CAAAA,IAASC,KAAKC,SAASC,SAAS,EAAA,EAAIC,UAAU,EAAG,CAAA,CAAA,GACxE,UAAUL,KAAKC,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EAAAA,EAG3B,CAGA,GAAIxB,KAAKC,cAAcoG,OAAS,EAAG,CAElC,MACM7E,EADSxB,KAAKC,cAAcD,KAAKC,cAAcoG,OAAS,CAAA,EAC3CC,aAAa,OAEhC,GAAI9E,EAEH,OADAxB,KAAKK,eAAe8F,KAAK3E,KAG3B,CAEA,MAAA,EACD,CAMO,IAAI8B,EAAiBiD,EAAAA,CAC3B,OAAOvG,KAAKwG,QAAQ,CACnBlD,UACAmB,SAAU8B,CAAAA,CAAAA,CAEZ,CAMO,OAAO9D,EAAAA,CACb,OAAOzC,KAAKwG,QAAQ,CAAA,GAChB/D,EACHgB,QAAS,QAAA,CAAA,CAEX,CAKQ,qBAAAiB,CACP,MAAO,CACN+B,EAAG3F,OAAO4F,WAAa,EACvBC,EAAG7F,OAAO8F,YAAc,CAAA,CAE1B,CAAA,EAjbA5G,EAAekG,gBAA0C,CACxD9C,MAAAA,OACAC,SAAAA,OACAE,YAAAA,OACAC,WAAAA,OACAC,QAAS,UACTE,MAAO,OAAA,EAVF,IAAM7D,EAAN+G,EA4bA,MAAMC,EAAU,CAKtBN,QAAU/D,GACF3C,EAAcU,YAAAA,EAAcgG,QAAQ/D,GAO5CsE,IAAK,CAACzD,EAAiBiD,IACfzG,EAAcU,YAAAA,EAAcuG,IAAIzD,EAASiD,CAAAA,EAOjDS,OAASvE,GACD3C,EAAcU,YAAAA,EAAcwG,OAAOvE,CAAAA,EAO3CwE,UAAW,CACVnD,EACArB,IAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,EAASrB,CAAAA,EAQvDyE,OAAQ,CACPpD,EACArB,IAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,EAASrB,CAAAA,EAOvD2D,QAAS,IACDtG,EAAcU,YAAAA,EAAc4F,QAAAA,CAAAA"}
@@ -1,6 +1,6 @@
1
1
  import { render as p } from "lit";
2
2
  import { Subject as w, switchMap as m, forkJoin as C, fromEvent as h, of as d, takeUntil as u, timer as f, map as g, defaultIfEmpty as v, tap as l, take as E } from "rxjs";
3
- import { T as y, a as x } from "./theme.component-Bl4uy-_0.js";
3
+ import { T as y, a as x } from "./theme.component-ColRTbY5.js";
4
4
  const b = "are-you-there-dialog", D = "yes-dialog-here", r = class r {
5
5
  constructor() {
6
6
  this.activeDialogs = [], this.activeRawDialogs = [], this.dialogSubject = new w(), this.dismissSubject = new w(), this.setupDialogOpeningLogic(), this.setupDialogDismissLogic();
@@ -129,4 +129,4 @@ export {
129
129
  b as a,
130
130
  D as b
131
131
  };
132
- //# sourceMappingURL=dialog-service-LvOr2E3k.js.map
132
+ //# sourceMappingURL=dialog-service-Dm7HJGjx.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-service-LvOr2E3k.js","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_w","$dialog","ask","danger","component","simple"],"mappings":";;;AACO,MAAMA,IAAyB,wBACzBC,IAAkB,mBCsClBC,IAAN,MAAMA,EAAAA;AAAAA,EA0BJ,cAAAC;AAZRC,SAAQC,gBAAiC,CAAA,GAGzCD,KAAQE,mBAA0B,CAAA,GAGlCF,KAAQG,gBAAgB,IAAIC,KAG5BJ,KAAQK,iBAAiB,IAAID,KAI5BJ,KAAKM,wBAAAA,GACLN,KAAKO,wBAAAA;AAAAA,EACN;AAAA,EAKA,OAAA,cAAcC;AAIb,WAHKV,E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QACAC,YAAAA,QACAC,SAAS,WACTE,OAAO;AAVF,IAAM7D,IAAN+G;AA4bA,MAAMC,IAAU,EAKtBN,SAAU/D,CAAAA,MACF3C,EAAcU,YAAAA,EAAcgG,QAAQ/D,CAAAA,GAO5CsE,KAAK,CAACzD,GAAiBiD,MACfzG,EAAcU,YAAAA,EAAcuG,IAAIzD,GAASiD,CAAAA,GAOjDS,QAASvE,CAAAA,MACD3C,EAAcU,YAAAA,EAAcwG,OAAOvE,IAO3CwE,WAAW,CACVnD,GACArB,MAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,GAASrB,CAAAA,GAQvDyE,QAAQ,CACPpD,GACArB,MAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,GAASrB,CAAAA,GAOvD2D,SAAS,MACDtG,EAAcU,YAAAA,EAAc4F,QAAAA,EAAAA;"}
1
+ {"version":3,"file":"dialog-service-Dm7HJGjx.js","sources":["../src/dialog/dialog-events.ts","../src/dialog/dialog-service.ts"],"sourcesContent":["// Dialog discovery event constants\r\nexport const DialogWhereAreYouRicky = 'are-you-there-dialog'\r\nexport const DialogHereMorty = 'yes-dialog-here'\r\n\r\n// Event interfaces\r\nexport interface DialogWhereAreYouRickyEvent extends CustomEvent {\r\n detail: {\r\n uid: string\r\n }\r\n}\r\n\r\nexport interface DialogHereMortyEvent extends CustomEvent {\r\n detail: {\r\n dialog: any // Will be schmancy-dialog instance\r\n theme?: any // Will be schmancy-theme instance\r\n }\r\n}","import { render, TemplateResult } from 'lit'\nimport { defaultIfEmpty, forkJoin, fromEvent, map, of, Subject, switchMap, takeUntil, tap, timer, take } from 'rxjs'\nimport { ConfirmDialog } from './dailog'\nimport { DialogHereMorty, DialogHereMortyEvent, DialogWhereAreYouRicky } from './dialog-events'\nimport { ThemeWhereAreYou, ThemeHereIAm, ThemeHereIAmEvent } from '../theme/theme.component'\n\n/**\n * Dialog service options interface with component support\n */\nexport interface DialogOptions {\n\ttitle?: string\n\tsubtitle?: string\n\tmessage?: string\n\tconfirmText?: string\n\tcancelText?: string\n\tvariant?: 'default' | 'danger'\n\tconfirmColor?: 'primary' | 'error' | 'warning' | 'success' // Button color for confirm action\n\tposition?: { x: number; y: number } | MouseEvent | TouchEvent\n\n\t// New options for component rendering\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\twidth?: string\n\tonConfirm?: () => void\n\tonCancel?: () => void\n\thideActions?: boolean // Set to true to hide all buttons and title\n\ttargetContainer?: HTMLElement // Container to append dialog to (defaults to document.body)\n}\n\ninterface DialogTarget {\n\toptions: DialogOptions\n\ttype: 'confirm' | 'component'\n\tcontent?: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult)\n\tresolve?: (value: boolean) => void\n\treject?: (reason?: any) => void\n}\n\n/**\n * Dialog service for centralized dialog management.\n * Provides a simple API for showing dialogs with optional custom components.\n */\nexport class DialogService {\n\tprivate static instance: DialogService\n\n\t// Default dialog options\n\tprivate static DEFAULT_OPTIONS: Partial<DialogOptions> = {\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tconfirmText: undefined,\n\t\tcancelText: undefined,\n\t\tvariant: 'default',\n\t\twidth: '360px',\n\t}\n\n\t// Track active dialogs to handle dismissing the most recent one\n\tprivate activeDialogs: ConfirmDialog[] = []\n\t\n\t// Track component dialogs (schmancy-dialog instances)\n\tprivate activeRawDialogs: any[] = []\n\t\n\t// Subject for dialog opening requests\n\tprivate dialogSubject = new Subject<DialogTarget>()\n\t\n\t// Subject for dialog dismissal requests\n\tprivate dismissSubject = new Subject<string>()\n\n\t// Private constructor for singleton pattern\n\tprivate constructor() {\n\t\tthis.setupDialogOpeningLogic()\n\t\tthis.setupDialogDismissLogic()\n\t}\n\n\t/**\n\t * Get the singleton instance\n\t */\n\tpublic static getInstance(): DialogService {\n\t\tif (!DialogService.instance) {\n\t\t\tDialogService.instance = new DialogService()\n\t\t}\n\t\treturn DialogService.instance\n\t}\n\t\n\t/**\n\t * Sets up the main dialog opening logic using RxJS pipes\n\t */\n\tprivate setupDialogOpeningLogic() {\n\t\tthis.dialogSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(target =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(target).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\tconst uid = target.type === 'confirm' \n\t\t\t\t\t\t\t\t\t? `confirm-dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\t: `dialog-${Date.now()}-${Math.random().toString(36).substring(2, 9)}`\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, {\n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// Store uid in target for later use\n\t\t\t\t\t\t\t\t;(target as any).uid = uid\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\tswitchMap(([response, target]) => {\n\t\t\t\t\tlet dialog: ConfirmDialog | any\n\t\t\t\t\tlet targetContainer: HTMLElement\n\t\t\t\t\t\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Use existing dialog\n\t\t\t\t\t\tdialog = response.dialog\n\t\t\t\t\t\ttargetContainer = dialog.parentElement as HTMLElement\n\t\t\t\t\t\treturn of({ dialog, target, targetContainer })\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Determine container - use responding theme or fallback\n\t\t\t\t\t\tif (response?.theme) {\n\t\t\t\t\t\t\ttargetContainer = response.theme as HTMLElement\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else if (target.options.targetContainer) {\n\t\t\t\t\t\t\ttargetContainer = target.options.targetContainer\n\t\t\t\t\t\t\treturn of({ dialog: null, target, targetContainer })\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Use the same theme discovery pattern as sheet service\n\t\t\t\t\t\t\twindow.dispatchEvent(new CustomEvent(ThemeWhereAreYou))\n\t\t\t\t\t\t\treturn fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n\t\t\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\t\tmap(e => e.detail.theme),\n\t\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t\t\tmap(theme => ({\n\t\t\t\t\t\t\t\t\tdialog: null,\n\t\t\t\t\t\t\t\t\ttarget,\n\t\t\t\t\t\t\t\t\ttargetContainer: theme || document.body\n\t\t\t\t\t\t\t\t}))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\t// Create appropriate dialog type\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tdialog = document.createElement('confirm-dialog') as ConfirmDialog\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdialog = document.createElement('schmancy-dialog')\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdialog.setAttribute('uid', (target as any).uid)\n\t\t\t\t\t\ttargetContainer.appendChild(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\tmap(({ dialog, target, targetContainer }) => {\n\t\t\t\t\t// Return the actual dialog element that was created\n\t\t\t\t\tif (!dialog) {\n\t\t\t\t\t\tdialog = targetContainer.querySelector(`[uid=\"${(target as any).uid}\"]`)\n\t\t\t\t\t}\n\t\t\t\t\treturn { dialog, target, targetContainer }\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t// Configure confirm dialog\n\t\t\t\t\t\tconst confirmDialog = dialog as ConfirmDialog\n\t\t\t\t\t\tconst options = target.options\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (options.title) confirmDialog.title = options.title\n\t\t\t\t\t\tif (options.subtitle) confirmDialog.subtitle = options.subtitle\n\t\t\t\t\t\tif (options.message) confirmDialog.message = options.message\n\t\t\t\t\t\tif (options.confirmText) confirmDialog.confirmText = options.confirmText\n\t\t\t\t\t\tif (options.cancelText) confirmDialog.cancelText = options.cancelText\n\t\t\t\t\t\tif (options.variant) confirmDialog.variant = options.variant\n\t\t\t\t\t\tif (options.confirmColor) confirmDialog.confirmColor = options.confirmColor\n\t\t\t\t\t\tif (options.width) confirmDialog.style.setProperty('--dialog-width', options.width)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Handle custom content if provided\n\t\t\t\t\t\tif (options.content) {\n\t\t\t\t\t\t\tconst contentContainer = document.createElement('div')\n\t\t\t\t\t\t\tcontentContainer.slot = 'content'\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (typeof options.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = options.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tcontentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, contentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (options.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tcontentContainer.appendChild(options.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(options.content, contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tconfirmDialog.appendChild(contentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active dialogs\n\t\t\t\t\t\tthis.activeDialogs.push(confirmDialog)\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Configure component dialog\n\t\t\t\t\t\tif (target.content) {\n\t\t\t\t\t\t\tconst directContentContainer = document.createElement('div')\n\t\t\t\t\t\t\tdirectContentContainer.style.height = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.style.width = '100%'\n\t\t\t\t\t\t\tdirectContentContainer.classList.add('schmancy-dialog-content-container')\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Render the content directly\n\t\t\t\t\t\t\tif (typeof target.content === 'function') {\n\t\t\t\t\t\t\t\tconst result = target.content()\n\t\t\t\t\t\t\t\tif (result instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(result)\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\trender(result, directContentContainer)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else if (target.content instanceof HTMLElement) {\n\t\t\t\t\t\t\t\tdirectContentContainer.appendChild(target.content)\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\trender(target.content, directContentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdialog.appendChild(directContentContainer)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Set width from options\n\t\t\t\t\t\tif (target.options.width) {\n\t\t\t\t\t\t\tdialog.style.setProperty('--dialog-width', target.options.width)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add to active raw dialogs\n\t\t\t\t\t\tthis.activeRawDialogs.push(dialog)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t\ttap(({ dialog, target }) => {\n\t\t\t\t\t// Show dialog and handle promise resolution\n\t\t\t\t\tconst position = target.options.position || this.getCenteredPosition()\n\t\t\t\t\t\n\t\t\t\t\tdialog.show(position).then((result: boolean) => {\n\t\t\t\t\t\tif (target.resolve) {\n\t\t\t\t\t\t\ttarget.resolve(result)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Cleanup\n\t\t\t\t\t\tif (target.type === 'confirm') {\n\t\t\t\t\t\t\tconst index = this.activeDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentEl = dialog.querySelector('[slot=\"content\"]')\n\t\t\t\t\t\t\tif (contentEl) {\n\t\t\t\t\t\t\t\tdialog.removeChild(contentEl)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst index = this.activeRawDialogs.indexOf(dialog)\n\t\t\t\t\t\t\tif (index !== -1) {\n\t\t\t\t\t\t\t\tthis.activeRawDialogs.splice(index, 1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Clean up content\n\t\t\t\t\t\t\tconst contentContainer = dialog.querySelector('.schmancy-dialog-content-container')\n\t\t\t\t\t\t\tif (contentContainer && contentContainer.parentNode) {\n\t\t\t\t\t\t\t\tcontentContainer.parentNode.removeChild(contentContainer)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM\n\t\t\t\t\t\tif (dialog.parentElement) {\n\t\t\t\t\t\t\tdialog.parentElement.removeChild(dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}).catch((error: any) => {\n\t\t\t\t\t\tif (target.reject) {\n\t\t\t\t\t\t\ttarget.reject(error)\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\t\n\t\t\t\t\t// Set up event listeners for callbacks\n\t\t\t\t\tif (target.options.onConfirm) {\n\t\t\t\t\t\tconst onConfirm = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onConfirm!()\n\t\t\t\t\t\t\tdialog.removeEventListener('confirm', onConfirm)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('confirm', onConfirm)\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif (target.options.onCancel) {\n\t\t\t\t\t\tconst onCancel = (_e: Event) => {\n\t\t\t\t\t\t\ttarget.options.onCancel!()\n\t\t\t\t\t\t\tdialog.removeEventListener('cancel', onCancel)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdialog.addEventListener('cancel', onCancel)\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\t\n\t/**\n\t * Sets up the dialog dismissal logic\n\t */\n\tprivate setupDialogDismissLogic() {\n\t\tthis.dismissSubject\n\t\t\t.pipe(\n\t\t\t\tswitchMap(uid =>\n\t\t\t\t\tforkJoin([\n\t\t\t\t\t\tfromEvent<DialogHereMortyEvent>(window, DialogHereMorty).pipe(\n\t\t\t\t\t\t\ttakeUntil(timer(100)),\n\t\t\t\t\t\t\tmap(e => e.detail),\n\t\t\t\t\t\t\tdefaultIfEmpty(undefined),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tof(uid).pipe(\n\t\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\t\t\t\tnew CustomEvent(DialogWhereAreYouRicky, { \n\t\t\t\t\t\t\t\t\t\tdetail: { uid },\n\t\t\t\t\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t),\n\t\t\t\t\t]),\n\t\t\t\t),\n\t\t\t\ttap(([response]) => {\n\t\t\t\t\tif (response?.dialog) {\n\t\t\t\t\t\t// Hide the dialog\n\t\t\t\t\t\tresponse.dialog.hide(false)\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove from tracking arrays\n\t\t\t\t\t\tconst confirmIndex = this.activeDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (confirmIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeDialogs.splice(confirmIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tconst rawIndex = this.activeRawDialogs.indexOf(response.dialog)\n\t\t\t\t\t\tif (rawIndex !== -1) {\n\t\t\t\t\t\t\tthis.activeRawDialogs.splice(rawIndex, 1)\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Remove dialog from DOM immediately\n\t\t\t\t\t\tif (response.dialog.parentElement) {\n\t\t\t\t\t\t\tresponse.dialog.parentElement.removeChild(response.dialog)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic confirm(options: DialogOptions): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Apply default options\n\t\t\tconst completeOptions = {\n\t\t\t\t...DialogService.DEFAULT_OPTIONS,\n\t\t\t\t...options,\n\t\t\t}\n\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!completeOptions.position) {\n\t\t\t\tcompleteOptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: completeOptions,\n\t\t\t\ttype: 'confirm',\n\t\t\t\tcontent: completeOptions.content,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Show a dialog with custom component content\n\t * Always renders content directly without any headers or action buttons\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tpublic component(\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions: Omit<DialogOptions, 'content' | 'message'> = {},\n\t): Promise<boolean> {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// If no position is provided, center the dialog\n\t\t\tif (!options.position) {\n\t\t\t\toptions.position = this.getCenteredPosition()\n\t\t\t}\n\n\t\t\t// Create dialog target and emit to subject\n\t\t\tconst target: DialogTarget = {\n\t\t\t\toptions: options as DialogOptions,\n\t\t\t\ttype: 'component',\n\t\t\t\tcontent,\n\t\t\t\tresolve,\n\t\t\t\treject,\n\t\t\t}\n\n\t\t\tthis.dialogSubject.next(target)\n\t\t})\n\t}\n\n\t/**\n\t * Dismiss the most recently opened dialog (either confirm or component type)\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tpublic dismiss(): boolean {\n\t\t// Try component dialog first (they're more likely to be on top)\n\t\tif (this.activeRawDialogs.length > 0) {\n\t\t\t// Get the most recently opened raw dialog (last in the array)\n\t\t\tconst dialog = this.activeRawDialogs[this.activeRawDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Fall back to confirm dialogs\n\t\tif (this.activeDialogs.length > 0) {\n\t\t\t// Get the most recently opened dialog (last in the array)\n\t\t\tconst dialog = this.activeDialogs[this.activeDialogs.length - 1]\n\t\t\tconst uid = dialog.getAttribute('uid')\n\t\t\t\n\t\t\tif (uid) {\n\t\t\t\tthis.dismissSubject.next(uid)\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\n\t\treturn false\n\t}\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic ask(message: string, event?: MouseEvent | TouchEvent): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\tmessage,\n\t\t\tposition: event,\n\t\t})\n\t}\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tpublic danger(options: Omit<DialogOptions, 'variant'>): Promise<boolean> {\n\t\treturn this.confirm({\n\t\t\t...options,\n\t\t\tvariant: 'danger',\n\t\t})\n\t}\n\n\t/**\n\t * Get a centered position for the dialog\n\t */\n\tprivate getCenteredPosition(): { x: number; y: number } {\n\t\treturn {\n\t\t\tx: window.innerWidth / 2,\n\t\t\ty: window.innerHeight / 2,\n\t\t}\n\t}\n\n}\n\n/**\n * Global dialog utility - provides a quick way to show dialogs\n */\nexport const $dialog = {\n\t/**\n\t * Show a confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tconfirm: (options: DialogOptions): Promise<boolean> => {\n\t\treturn DialogService.getInstance().confirm(options)\n\t},\n\n\t/**\n\t * Show a simple confirmation dialog with just a message\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\task: (message: string, event?: MouseEvent | TouchEvent): Promise<boolean> => {\n\t\treturn DialogService.getInstance().ask(message, event)\n\t},\n\n\t/**\n\t * Show a danger confirmation dialog\n\t * @returns Promise that resolves to true (confirm) or false (cancel)\n\t */\n\tdanger: (options: Omit<DialogOptions, 'variant'>): Promise<boolean> => {\n\t\treturn DialogService.getInstance().danger(options)\n\t},\n\n\t/**\n\t * Show a dialog with custom component content\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tcomponent: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Show a simple dialog without title or actions, just content\n\t * This is an alias for component() since all component dialogs are now simple by design\n\t * @returns Promise that resolves when dialog is closed\n\t */\n\tsimple: (\n\t\tcontent: TemplateResult | HTMLElement | (() => HTMLElement | TemplateResult),\n\t\toptions?: Omit<DialogOptions, 'content' | 'message' | 'title' | 'confirmText' | 'cancelText'>,\n\t): Promise<boolean> => {\n\t\treturn DialogService.getInstance().component(content, options)\n\t},\n\n\t/**\n\t * Dismiss the most recently opened dialog\n\t * @returns true if a dialog was dismissed, false if no dialogs were open\n\t */\n\tdismiss: (): boolean => {\n\t\treturn DialogService.getInstance().dismiss()\n\t},\n}\n\nexport default DialogService"],"names":["DialogWhereAreYouRicky","DialogHereMorty","DialogService","constructor","this","activeDialogs","activeRawDialogs","dialogSubject","Subject","dismissSubject","setupDialogOpeningLogic","setupDialogDismissLogic","getInstance","instance","pipe","switchMap","forkJoin","fromEvent","window","takeUntil","timer","map","e","detail","defaultIfEmpty","of","target","tap","uid","type","Date","now","Math","random","toString","substring","dispatchEvent","CustomEvent","bubbles","composed","response","dialog","targetContainer","parentElement","theme","options","ThemeWhereAreYou","ThemeHereIAm","take","document","body","createElement","setAttribute","appendChild","querySelector","confirmDialog","title","subtitle","message","confirmText","cancelText","variant","confirmColor","width","style","setProperty","content","contentContainer","slot","result","HTMLElement","render","push","directContentContainer","height","classList","add","position","getCenteredPosition","show","then","resolve","index","indexOf","splice","contentEl","removeChild","parentNode","catch","error","reject","onConfirm","_e","removeEventListener","addEventListener","onCancel","subscribe","hide","confirmIndex","rawIndex","Promise","completeOptions","DEFAULT_OPTIONS","next","dismiss","length","getAttribute","event","confirm","x","innerWidth","y","innerHeight","_w","$dialog","ask","danger","component","simple"],"mappings":";;;AACO,MAAMA,IAAyB,wBACzBC,IAAkB,mBCsClBC,IAAN,MAAMA,EAAAA;AAAAA,EA0BJ,cAAAC;AAZRC,SAAQC,gBAAiC,CAAA,GAGzCD,KAAQE,mBAA0B,CAAA,GAGlCF,KAAQG,gBAAgB,IAAIC,KAG5BJ,K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,GACvBC,GAAG7F,OAAO8F,cAAc,EAAA;AAAA,EAE1B;;AAjbA5G,EAAekG,kBAA0C,EACxD9C,OAAAA,QACAC,UAAAA,QACAE,aAAAA,QACAC,YAAAA,QACAC,SAAS,WACTE,OAAO;AAVF,IAAM7D,IAAN+G;AA4bA,MAAMC,IAAU,EAKtBN,SAAU/D,CAAAA,MACF3C,EAAcU,YAAAA,EAAcgG,QAAQ/D,CAAAA,GAO5CsE,KAAK,CAACzD,GAAiBiD,MACfzG,EAAcU,YAAAA,EAAcuG,IAAIzD,GAASiD,CAAAA,GAOjDS,QAASvE,CAAAA,MACD3C,EAAcU,YAAAA,EAAcwG,OAAOvE,IAO3CwE,WAAW,CACVnD,GACArB,MAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,GAASrB,CAAAA,GAQvDyE,QAAQ,CACPpD,GACArB,MAEO3C,EAAcU,YAAAA,EAAcyG,UAAUnD,GAASrB,CAAAA,GAOvD2D,SAAS,MACDtG,EAAcU,YAAAA,EAAc4F,QAAAA,EAAAA;"}
package/dist/dialog.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-Dm9ywkp4.cjs"),i=require("./dialog-service-iRGqMSDe.cjs");Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>e.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>e.SchmancyDialogContent}),exports.$dialog=i.$dialog,exports.DialogService=i.DialogService;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./dialog-content-tiwbeegi.cjs"),i=require("./dialog-service-DUDhcx9X.cjs");Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>e.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>e.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>e.SchmancyDialogContent}),exports.$dialog=i.$dialog,exports.DialogService=i.DialogService;
2
2
  //# sourceMappingURL=dialog.cjs.map
package/dist/dialog.js CHANGED
@@ -1,5 +1,5 @@
1
- import { C as i, S as r, a as c } from "./dialog-content-MhUhElif.js";
2
- import { $ as g, D as l } from "./dialog-service-LvOr2E3k.js";
1
+ import { C as i, S as r, a as c } from "./dialog-content-CT6Y3ZLb.js";
2
+ import { $ as g, D as l } from "./dialog-service-Dm7HJGjx.js";
3
3
  export {
4
4
  g as $dialog,
5
5
  i as ConfirmDialog,
@@ -14,7 +14,6 @@ var $ = Object.defineProperty, w = Object.getOwnPropertyDescriptor, l = (t, e, p
14
14
  let s = class extends v(x`
15
15
  :host {
16
16
  display: block;
17
- width: fit-content;
18
17
  }
19
18
  `) {
20
19
  constructor() {
@@ -156,4 +155,4 @@ export {
156
155
  s as S,
157
156
  r as a
158
157
  };
159
- //# sourceMappingURL=icon-button-BW5ofOL5.js.map
158
+ //# sourceMappingURL=icon-button-BGvSPuE-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-button-BGvSPuE-.js","sources":["../src/button/button.ts","../src/button/icon-button.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\n\nexport interface SchmancyButtonEventMap {\n\tSchmancyFocus: CustomEvent<void>\n\tSchmancyBlur: CustomEvent<void>\n}\n\nexport type ButtonVariant = 'elevated' | 'filled' | 'filled tonal' | 'outlined' | 'text'\n\n/**\n * A button component.\n * @element schmancy-button\n * @slot - The default slot.\n * @slot prefix - The prefix slot.\n * @slot suffix - The suffix slot.\n */\n@customElement('schmancy-button')\nexport class SchmancyButton extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\tprivate _ariaLabel!: string\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t * @public\n\t */\n\t@property()\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this._ariaLabel\n\t\tthis._ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this._ariaLabel\n\t}\n\n\t@queryAssignedElements({\n\t\tslot: 'prefix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate prefixImgs!: HTMLImageElement[]\n\n\t@queryAssignedElements({\n\t\tslot: 'suffix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate suffixImgs!: HTMLImageElement[]\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tprotected get imgClasses(): string[] {\n\t\treturn ['max-h-[24px]', 'max-w-[24px]', 'object-contain']\n\t}\n\n\tfirstUpdated() {\n\t\t// Add image classes and ensure decorative images have an empty alt.\n\t\tthis.prefixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t\tthis.suffixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate _preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\trender() {\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 py-[8px] px-[16px] transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(this.variant === 'outlined' ||\n\t\t\t\t\tthis.variant === 'text' ||\n\t\t\t\t\tthis.variant === 'filled' ||\n\t\t\t\t\tthis.variant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && this.variant === 'elevated',\n\t\t\t'w-full tex-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': this.variant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-solid border-outline': this.variant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': this.variant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': this.variant === 'filled tonal',\n\t\t\t'text-primary-default': this.variant === 'text',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'absolute inset-0 hover:opacity-[0.08] z-0 rounded-full': true,\n\t\t\t'hover:bg-primary-on': this.variant === 'filled',\n\t\t\t'hover:bg-primary-default': this.variant === 'outlined' || this.variant === 'elevated' || this.variant === 'text',\n\t\t\t'hover:bg-secondary-container': this.variant === 'filled tonal',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this._preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-button': SchmancyButton\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html, LitElement, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { ButtonVariant } from './button'\n\n/**\n * An icon button component.\n * @element schmancy-icon-button\n * @slot - The default slot.\n */\n@customElement('schmancy-icon-button')\nexport class SchmnacyIconButton extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\tprivate _ariaLabel!: string\n\n\t/**\n\t * The size of the icon.\n\t * @attr\n\t * @default 'md'\n\t */\n\t@property({ type: String })\n\tpublic size: 'sm' | 'md' | 'lg' = 'md'\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t */\n\t@property()\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t// Manage aria-label manually so that we can always use our internal property.\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this._ariaLabel\n\t\tthis._ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this._ariaLabel\n\t}\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate _preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n\t\t// Add any first-update logic here if needed.\n\t}\n\n\trender() {\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(this.variant === 'outlined' ||\n\t\t\t\t\tthis.variant === 'text' ||\n\t\t\t\t\tthis.variant === 'filled' ||\n\t\t\t\t\tthis.variant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && this.variant === 'elevated',\n\t\t\t'w-full text-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': this.variant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-outline': this.variant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': this.variant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': this.variant === 'filled tonal',\n\t\t\t'text-primary-default': this.variant === 'text',\n\t\t\t'px-[6px] py-[6px]': this.size === 'sm',\n\t\t\t'px-[8px] py-[8px]': this.size === 'md',\n\t\t\t'px-[12px] py-[12px]': this.size === 'lg',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'hover:opacity-[0.08] rounded-full z-0': true,\n\t\t\t'hover:bg-primary-on': this.variant === 'filled',\n\t\t\t'hover:bg-primary-default': this.variant === 'outlined' || this.variant === 'elevated' || this.variant === 'text',\n\t\t\t'hover:bg-secondary-container': this.variant === 'filled tonal',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this._preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<schmancy-icon size=${this.size === 'sm' ? '18px' : this.size === 'md' ? '24px' : '32px'}>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-icon>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<schmancy-icon size=${this.size === 'sm' ? '18px' : this.size === 'md' ? '24px' : '32px'}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-icon>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon-button': SchmnacyIconButton\n\t}\n}\n"],"names":["SchmancyButton","$LitElement","css","constructor","super","arguments","this","variant","width","type","disabled","value","oldVal","_ariaLabel","hasAttribute","removeAttribute","requestUpdate","ariaLabel","options","nativeElement","focus","blur","imgClasses","prefixImgs","forEach","img","classList","add","setAttribute","suffixImgs","click","dispatchEvent","Event","bubbles","composed","event","preventDefault","stopPropagation","render","classes","stateLayerClasses","href","html","ifDefined","classMap","_preventDefault","when","shadowRootOptions","LitElement","mode","delegatesFocus","__decorateClass","query","prototype","property","reflect","String","Boolean","attribute","queryAssignedElements","slot","flatten","selector","customElement","SchmnacyIconButton","size","_changedProperties"],"mappings":";;;;;;;;;;;;;AAqBO,IAAMA,IAAN,cAA6BC,EAAYC;AAAAA;AAAAA;AAAAA;AAAAA;EAAzC,cAAAC;AAAAC,aAAAC,SAAAA,GAuBNC,KAAOC,UAAyB,QAUhCD,KAAOE,QAAyB,QAQhCF,KAAOG,OAAsC,UAe7CH,KAAOI,WAAAA;AAAAA,EAAW;AAAA,EAElB,IAAA,UAA8BC,GAAAA;AAC7B,UAAMC,IAASN,KAAKO;AACpBP,SAAKO,aAAaF,GAEdL,KAAKQ,aAAa,YAAA,KACrBR,KAAKS,gBAAgB,YAAA,GAEtBT,KAAKU,cAAc,aAAaJ,CAAAA;AAAAA,EACjC;AAAA,EAGA,gBAAoBK;AACnB,WAAOX,KAAKO;AAAAA,E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ADNG,EAAS,EAAEC,SAAAA,IAAe9C,MAAM+C,OAAAA,CAAAA,CAAAA,GA9CrBQ,EA+CLX,WAAA,QAAA,CAAA,GAQAF,EAAA,CADNG,EAAAA,CAAAA,GAtDWU,EAuDLX,WAAA,QAAA,IAOAF,EAAA,CADNG,EAAS,EAAE7C,MAAMgD,SAASF,SAAAA,GAAS,CAAA,CAAA,GA7DxBS,EA8DLX,WAAA,YAAA,IAcaF,EAAA,CADnBG,EAAS,EAAEI,WAAW,kBA3EXM,EA4EQX,WAAA,aAAA,CAAA,GA5ERW,IAANb,EAAA,CADNY,EAAc,sBAAA,CAAA,GACFC,CAAAA;"}
@@ -1,7 +1,6 @@
1
1
  "use strict";require("rxjs"),require("lit/directives/class-map.js"),require("lit/directives/style-map.js");const u=require("./litElement.mixin-B01R2oT7.cjs");require("./tailwind.mixin-DVKI3qb9.cjs");const i=require("lit/decorators.js"),s=require("lit"),n=require("lit/directives/if-defined.js"),p=require("lit/directives/when.js");var b=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(t,e,h,o)=>{for(var d,a=o>1?void 0:o?f(e,h):e,c=t.length-1;c>=0;c--)(d=t[c])&&(a=(o?d(e,h,a):d(a))||a);return o&&a&&b(e,h,a),a};exports.SchmancyButton=class extends u.$LitElement(s.css`
2
2
  :host {
3
3
  display: block;
4
- width: fit-content;
5
4
  }
6
5
  `){constructor(){super(...arguments),this.variant="text",this.width="auto",this.type="button",this.disabled=!1}set ariaLabel(t){const e=this._ariaLabel;this._ariaLabel=t,this.hasAttribute("aria-label")&&this.removeAttribute("aria-label"),this.requestUpdate("ariaLabel",e)}get ariaLabel(){return this._ariaLabel}focus(t){this.nativeElement.focus(t)}blur(){this.nativeElement.blur()}get imgClasses(){return["max-h-[24px]","max-w-[24px]","object-contain"]}firstUpdated(){this.prefixImgs?.forEach(t=>{t.classList.add(...this.imgClasses),t.hasAttribute("alt")||t.setAttribute("alt","")}),this.suffixImgs?.forEach(t=>{t.classList.add(...this.imgClasses),t.hasAttribute("alt")||t.setAttribute("alt","")})}click(){this.dispatchEvent(new Event("click",{bubbles:!0,composed:!0}))}_preventDefault(t){t.preventDefault(),t.stopPropagation()}render(){const t={"z-0 py-[8px] px-[16px] transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden":!0,"cursor-pointer":!this.disabled,"opacity-[0.38]":this.disabled,"hover:shadow-xs":!this.disabled&&(this.variant==="outlined"||this.variant==="text"||this.variant==="filled"||this.variant==="filled tonal"),"hover:shadow-sm":!this.disabled&&this.variant==="elevated","w-full tex-center":this.width==="full","bg-surface-low text-primary-default shadow-xs":this.variant==="elevated","bg-transparent text-primary-default border-1 border-solid border-outline":this.variant==="outlined","bg-primary-default text-primary-on":this.variant==="filled","bg-secondary-container text-secondary-onContainer":this.variant==="filled tonal","text-primary-default":this.variant==="text"},e={"absolute inset-0 hover:opacity-[0.08] z-0 rounded-full":!0,"hover:bg-primary-on":this.variant==="filled","hover:bg-primary-default":this.variant==="outlined"||this.variant==="elevated"||this.variant==="text","hover:bg-secondary-container":this.variant==="filled tonal"};return this.href?s.html`
7
6
  <a
@@ -66,4 +65,4 @@
66
65
  </schmancy-icon>
67
66
  </button>
68
67
  `}},exports.SchmnacyIconButton.shadowRootOptions={...s.LitElement.shadowRootOptions,mode:"open",delegatesFocus:!0},l([i.query('[part="base"]',!0)],exports.SchmnacyIconButton.prototype,"nativeElement",2),l([i.property({type:String})],exports.SchmnacyIconButton.prototype,"size",2),l([i.property({reflect:!0,type:String})],exports.SchmnacyIconButton.prototype,"variant",2),l([i.property()],exports.SchmnacyIconButton.prototype,"width",2),l([i.property({reflect:!0,type:String})],exports.SchmnacyIconButton.prototype,"type",2),l([i.property()],exports.SchmnacyIconButton.prototype,"href",2),l([i.property({type:Boolean,reflect:!0})],exports.SchmnacyIconButton.prototype,"disabled",2),l([i.property({attribute:"aria-label"})],exports.SchmnacyIconButton.prototype,"ariaLabel",1),exports.SchmnacyIconButton=l([i.customElement("schmancy-icon-button")],exports.SchmnacyIconButton);
69
- //# sourceMappingURL=icon-button-9V68mzcL.cjs.map
68
+ //# sourceMappingURL=icon-button-DbvjV5zJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icon-button-DbvjV5zJ.cjs","sources":["../src/button/button.ts","../src/button/icon-button.ts"],"sourcesContent":["import { $LitElement } from '@mixins/index'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, queryAssignedElements } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\n\nexport interface SchmancyButtonEventMap {\n\tSchmancyFocus: CustomEvent<void>\n\tSchmancyBlur: CustomEvent<void>\n}\n\nexport type ButtonVariant = 'elevated' | 'filled' | 'filled tonal' | 'outlined' | 'text'\n\n/**\n * A button component.\n * @element schmancy-button\n * @slot - The default slot.\n * @slot prefix - The prefix slot.\n * @slot suffix - The suffix slot.\n */\n@customElement('schmancy-button')\nexport class SchmancyButton extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\tprivate _ariaLabel!: string\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t * @public\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t * @public\n\t */\n\t@property()\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this._ariaLabel\n\t\tthis._ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this._ariaLabel\n\t}\n\n\t@queryAssignedElements({\n\t\tslot: 'prefix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate prefixImgs!: HTMLImageElement[]\n\n\t@queryAssignedElements({\n\t\tslot: 'suffix',\n\t\tflatten: true,\n\t\tselector: 'img',\n\t})\n\tprivate suffixImgs!: HTMLImageElement[]\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tprotected get imgClasses(): string[] {\n\t\treturn ['max-h-[24px]', 'max-w-[24px]', 'object-contain']\n\t}\n\n\tfirstUpdated() {\n\t\t// Add image classes and ensure decorative images have an empty alt.\n\t\tthis.prefixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t\tthis.suffixImgs?.forEach(img => {\n\t\t\timg.classList.add(...this.imgClasses)\n\t\t\tif (!img.hasAttribute('alt')) {\n\t\t\t\timg.setAttribute('alt', '')\n\t\t\t}\n\t\t})\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate _preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\trender() {\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 py-[8px] px-[16px] transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(this.variant === 'outlined' ||\n\t\t\t\t\tthis.variant === 'text' ||\n\t\t\t\t\tthis.variant === 'filled' ||\n\t\t\t\t\tthis.variant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && this.variant === 'elevated',\n\t\t\t'w-full tex-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': this.variant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-solid border-outline': this.variant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': this.variant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': this.variant === 'filled tonal',\n\t\t\t'text-primary-default': this.variant === 'text',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'absolute inset-0 hover:opacity-[0.08] z-0 rounded-full': true,\n\t\t\t'hover:bg-primary-on': this.variant === 'filled',\n\t\t\t'hover:bg-primary-default': this.variant === 'outlined' || this.variant === 'elevated' || this.variant === 'text',\n\t\t\t'hover:bg-secondary-container': this.variant === 'filled tonal',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this._preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<slot name=\"prefix\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"suffix\"></slot>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-button': SchmancyButton\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { css, html, LitElement, PropertyValueMap } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { ifDefined } from 'lit/directives/if-defined.js'\nimport { when } from 'lit/directives/when.js'\nimport { ButtonVariant } from './button'\n\n/**\n * An icon button component.\n * @element schmancy-icon-button\n * @slot - The default slot.\n */\n@customElement('schmancy-icon-button')\nexport class SchmnacyIconButton extends $LitElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\tprotected static shadowRootOptions = {\n\t\t...LitElement.shadowRootOptions,\n\t\tmode: 'open',\n\t\tdelegatesFocus: true,\n\t}\n\n\t@query('[part=\"base\"]', true)\n\tprivate nativeElement!: HTMLElement\n\n\tprivate _ariaLabel!: string\n\n\t/**\n\t * The size of the icon.\n\t * @attr\n\t * @default 'md'\n\t */\n\t@property({ type: String })\n\tpublic size: 'sm' | 'md' | 'lg' = 'md'\n\n\t/**\n\t * The variant of the button.\n\t * @attr\n\t * @default 'text'\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic variant: ButtonVariant = 'text'\n\n\t/**\n\t * The width of the button.\n\t * @attr\n\t * @type {'full' | 'auto'}\n\t * @default 'auto'\n\t */\n\t@property()\n\tpublic width: 'full' | 'auto' = 'auto'\n\n\t/**\n\t * The type of the button.\n\t * Defaults to 'button' (preventing accidental form submissions).\n\t * @attr\n\t */\n\t@property({ reflect: true, type: String })\n\tpublic type: 'button' | 'reset' | 'submit' = 'button'\n\n\t/**\n\t * The URL the button points to.\n\t * If provided, the component will render as an anchor element.\n\t * @attr\n\t */\n\t@property()\n\tpublic href?: string\n\n\t/**\n\t * Determines whether the button is disabled.\n\t * @attr\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic disabled = false\n\n\t// Manage aria-label manually so that we can always use our internal property.\n\tpublic override set ariaLabel(value: string) {\n\t\tconst oldVal = this._ariaLabel\n\t\tthis._ariaLabel = value\n\n\t\tif (this.hasAttribute('aria-label')) {\n\t\t\tthis.removeAttribute('aria-label')\n\t\t}\n\t\tthis.requestUpdate('ariaLabel', oldVal)\n\t}\n\n\t@property({ attribute: 'aria-label' })\n\tpublic override get ariaLabel() {\n\t\treturn this._ariaLabel\n\t}\n\n\t/** Sets focus in the button. */\n\tpublic override focus(options?: FocusOptions) {\n\t\tthis.nativeElement.focus(options)\n\t}\n\n\t/** Removes focus from the button. */\n\tpublic override blur() {\n\t\tthis.nativeElement.blur()\n\t}\n\n\tclick(): void {\n\t\tthis.dispatchEvent(new Event('click', { bubbles: true, composed: true }))\n\t}\n\n\t// Prevent default behavior when the component is disabled.\n\tprivate _preventDefault(event: Event) {\n\t\tevent.preventDefault()\n\t\tevent.stopPropagation()\n\t}\n\n\tprotected firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void {\n\t\t// Add any first-update logic here if needed.\n\t}\n\n\trender() {\n\t\t// Compute classes for the interactive element.\n\t\tconst classes = {\n\t\t\t'z-0 h-full transition-all duration-200 relative rounded-full inline-flex justify-center items-center gap-[8px] outline-secondary-default focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-offset-2 outline-hidden':\n\t\t\t\ttrue,\n\t\t\t'opacity-[0.38]': this.disabled,\n\t\t\t'cursor-pointer': !this.disabled,\n\t\t\t'hover:shadow-xs':\n\t\t\t\t!this.disabled &&\n\t\t\t\t(this.variant === 'outlined' ||\n\t\t\t\t\tthis.variant === 'text' ||\n\t\t\t\t\tthis.variant === 'filled' ||\n\t\t\t\t\tthis.variant === 'filled tonal'),\n\t\t\t'hover:shadow-sm': !this.disabled && this.variant === 'elevated',\n\t\t\t'w-full text-center': this.width === 'full',\n\t\t\t'bg-surface-low text-primary-default shadow-xs': this.variant === 'elevated',\n\t\t\t'bg-transparent text-primary-default border-1 border-outline': this.variant === 'outlined',\n\t\t\t'bg-primary-default text-primary-on': this.variant === 'filled',\n\t\t\t'bg-secondary-container text-secondary-onContainer': this.variant === 'filled tonal',\n\t\t\t'text-primary-default': this.variant === 'text',\n\t\t\t'px-[6px] py-[6px]': this.size === 'sm',\n\t\t\t'px-[8px] py-[8px]': this.size === 'md',\n\t\t\t'px-[12px] py-[12px]': this.size === 'lg',\n\t\t}\n\n\t\tconst stateLayerClasses = {\n\t\t\t'hover:opacity-[0.08] rounded-full z-0': true,\n\t\t\t'hover:bg-primary-on': this.variant === 'filled',\n\t\t\t'hover:bg-primary-default': this.variant === 'outlined' || this.variant === 'elevated' || this.variant === 'text',\n\t\t\t'hover:bg-secondary-container': this.variant === 'filled tonal',\n\t\t}\n\n\t\t// If href is provided, render an anchor element.\n\t\tif (this.href) {\n\t\t\treturn html`\n\t\t\t\t<a\n\t\t\t\t\tpart=\"base\"\n\t\t\t\t\thref=${ifDefined(this.disabled ? undefined : this.href)}\n\t\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\t\ttabindex=${this.disabled ? '-1' : '0'}\n\t\t\t\t\taria-disabled=${this.disabled}\n\t\t\t\t\t@click=${this.disabled ? this._preventDefault : undefined}\n\t\t\t\t>\n\t\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t\t<schmancy-icon size=${this.size === 'sm' ? '18px' : this.size === 'md' ? '24px' : '32px'}>\n\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t</schmancy-icon>\n\t\t\t\t</a>\n\t\t\t`\n\t\t}\n\n\t\t// Otherwise, render a native button element.\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tpart=\"base\"\n\t\t\t\taria-label=${ifDefined(this.ariaLabel)}\n\t\t\t\t?disabled=${this.disabled}\n\t\t\t\tclass=\"${this.classMap(classes)}\"\n\t\t\t\ttype=${ifDefined(this.type)}\n\t\t\t\ttabindex=${ifDefined(this.disabled ? '-1' : undefined)}\n\t\t\t>\n\t\t\t\t${when(!this.disabled, () => html`<div class=\"absolute inset-0 ${this.classMap(stateLayerClasses)}\"></div>`)}\n\t\t\t\t<schmancy-icon size=${this.size === 'sm' ? '18px' : this.size === 'md' ? '24px' : '32px'}>\n\t\t\t\t\t<slot></slot>\n\t\t\t\t</schmancy-icon>\n\t\t\t</button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-icon-button': SchmnacyIconButton\n\t}\n}\n"],"names":["SchmancyButton","$LitElement","css","constructor","super","arguments","this","variant","width","type","disabled","value","oldVal","_ariaLabel","hasAttribute","removeAttribute","requestUpdate","ariaLabel","options","nativeElement","focus","blur","imgClasses","prefixImgs","forEach","img","classList","add","setAttribute","suffixImgs","click","dispatchEvent","Event","bubbles","composed","event","preventDefault","stopPropagation","render","classes","stateLayerClasses","href","html","ifDefined","classMap","_preventDefault","when","shadowRootOptions","LitElement","mode","delegatesFocus","__decorateClass","query","prototype","property","reflect","String","Boolean","attribute","queryAssignedElements","slot","flatten","selector","customElement","SchmnacyIconButton","size","_changedProperties"],"mappings":"2gBAqBaA,QAAAA,eAAN,cAA6BC,EAAAA,YAAYC,EAAAA;AAAAA;AAAAA;AAAAA;AAAAA,GAAzC,aAAAC,CAAAC,SAAAC,SAAAA,EAuBNC,KAAOC,QAAyB,OAUhCD,KAAOE,MAAyB,OAQhCF,KAAOG,KAAsC,SAe7CH,KAAOI,SAAAA,EAAW,CAElB,IAAA,UAA8BC,EAAAA,CAC7B,MAAMC,EAASN,KAAKO,WACpBP,KAAKO,WAAaF,EAEdL,KAAKQ,aAAa,YAAA,GACrBR,KAAKS,gBAAgB,YAAA,EAEtBT,KAAKU,cAAc,YAAaJ,CAAAA,CACjC,CAGA,eAAoBK,CACnB,OAAOX,KAAKO,UACb,CAiBgB,MAAMK,EAAAA,CACrBZ,KAAKa,cAAcC,MAAMF,CAAAA,CAC1B,CAGgB,MAAAG,CACff,KAAKa,cAAcE,KAAAA,CACpB,CAEA,IAAA,YAAcC,CACb,MAAO,CAAC,eAAgB,eAAgB,iBACzC,CAEA,eAEChB,KAAKiB,YAAYC,QAAQC,GAAAA,CACxBA,EAAIC,UAAUC,IAAAA,GAAOrB,KAAKgB,UAAAA,EACrBG,EAAIX,aAAa,KAAA,GACrBW,EAAIG,aAAa,MAAO,MAG1BtB,KAAKuB,YAAYL,QAAQC,GAAAA,CACxBA,EAAIC,UAAUC,OAAOrB,KAAKgB,UAAAA,EACrBG,EAAIX,aAAa,KAAA,GACrBW,EAAIG,aAAa,MAAO,EAAA,CAAA,CAAA,CAG3B,CAEA,OAAAE,CACCxB,KAAKyB,cAAc,IAAIC,MAAM,QAAS,CAAEC,WAAeC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-text-CtXY3MHV.cjs");const c=require("./area.component-DQ_erV9e.cjs"),t=require("./utils-C9nzOWpR.cjs");require("./autocomplete-PHnzqAII.cjs");const r=require("./avatar-By_6fdSR.cjs"),w=require("./boat-B_xZilsk.cjs");require("./spinner-CV62BBoF.cjs");const b=require("./icon-button-9V68mzcL.cjs");require("./media-CIuTybvD.cjs");const T=require("./checkbox-BAuVXvYL.cjs");require("./chips-Dg2otqDI.cjs");const I=require("./circular-progress-DZUJU-z3.cjs"),y=require("./code-preview-CYHNaPek.cjs"),M=require("./payment-card-form-ccF9dfGC.cjs"),d=require("./date-range-CVkBXQxc.cjs"),R=require("./date-range-inline-Czq1wHs1.cjs"),g=require("./delay-FgtrEHdo.cjs"),l=require("./dialog-content-Dm9ywkp4.cjs"),p=require("./dialog-service-iRGqMSDe.cjs"),u=require("./ripple-C2BHbhcS.cjs");require("./divider-2yg9r1tF.cjs");const s=require("./dropdown-content-DJ4CA3ug.cjs"),f=require("./timezone-UBBApQoU.cjs");require("./form-Dpokur4M.cjs"),require("./icon-mhchC8Qw.cjs");const C=require("./input-DzNoI9qU.cjs"),o=require("./flex-DWnX0ZPR.cjs"),h=require("./list-DRbkWHho.cjs");require("./menu-DEbZxoXr.cjs");const i=require("./notification-service-B6nHqzq5.cjs");require("./option-BPmOG_Hw.cjs"),require("./progress-BqZ7yHQe.cjs");const O=require("./radio-button-WmbuT_YW.cjs"),A=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const N=require("./select-CPnSionr.cjs"),m=require("./sheet-Dsx7bpof.cjs"),P=require("./slider-DBNoXRWS.cjs"),S=require("./schmancy-steps-container-CjAsrjKf.cjs"),a=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-DB8RFC1y.cjs"),j=require("./surface-ClfeUI6q.cjs"),D=require("./table-Rqnb4AJl.cjs");require("./tabs-compatibility-B1bE7hSG.cjs"),require("./textarea-Dlnyyrbq.cjs");const n=require("./theme.component-Dnf9PdX8.cjs"),v=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-Cao8AH8r.cjs");const q=require("./tooltip-WpE4e-fO.cjs"),x=require("./tree-Dn0t7MUR.cjs"),E=require("./types.cjs"),B=require("./typewriter-DwLZUKKQ.cjs"),H=require("./typography-BhCrqK_b.cjs"),F=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=c.FINDING_MORTIES,exports.HERE_RICKY=c.HERE_RICKY,exports.HISTORY_STRATEGY=c.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>c.SchmancyArea}),exports.area=c.area,exports.routerHistory=c.routerHistory,exports.buildQueryString=t.buildQueryString,exports.compareActiveRoutes=t.compareActiveRoutes,exports.compareCustomElementConstructors=t.compareCustomElementConstructors,exports.compareRouteActions=t.compareRouteActions,exports.createRouteCacheKey=t.createRouteCacheKey,exports.debounce=t.debounce,exports.decodeRouteState=t.decodeRouteState,exports.deepMerge=t.deepMerge,exports.encodeRouteState=t.encodeRouteState,exports.extractQueryParams=t.extractQueryParams,exports.getTagName=t.getTagName,exports.isObject=t.isObject,exports.normalizeTagName=t.normalizeTagName,exports.sanitizeRouteState=t.sanitizeRouteState,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"ScBadgeV2",{enumerable:!0,get:()=>r.ScBadgeV2}),Object.defineProperty(exports,"SchmancyAvatar",{enumerable:!0,get:()=>r.SchmancyAvatar}),Object.defineProperty(exports,"SchmancyBadgeV2",{enumerable:!0,get:()=>r.SchmancyBadgeV2}),Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>r.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=r.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>r.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=r.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=r.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>r.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=r.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=r.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>r.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=r.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=r.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>r.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>r.SchmancyTeleportation}),exports.WhereAreYouRicky=r.WhereAreYouRicky,exports.schmancyContentDrawer=r.schmancyContentDrawer,exports.schmancyNavDrawer=r.schmancyNavDrawer,exports.teleport=r.teleport,Object.defineProperty(exports,"SchmancyBoat",{enumerable:!0,get:()=>w.SchmancyBoat}),Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>b.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>b.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>T.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyCircularProgress",{enumerable:!0,get:()=>I.SchmancyCircularProgress}),Object.defineProperty(exports,"SchmancyCode",{enumerable:!0,get:()=>y.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodeHighlight",{enumerable:!0,get:()=>y.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodePreview",{enumerable:!0,get:()=>y.SchmancyCodePreview}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>M.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>d.SchmancyDateRange}),exports.validateInitialDateRange=d.validateInitialDateRange,Object.defineProperty(exports,"SchmancyDateRangeInline",{enumerable:!0,get:()=>R.SchmancyDateRangeInline}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>g.SchmancyDelay}),exports.delayContext=g.delayContext,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>l.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>l.SchmancyDialogContent}),exports.$dialog=p.$dialog,exports.DialogService=p.DialogService,exports.color=u.color,exports.fullHeight=u.fullHeight,exports.ripple=u.ripple,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>f.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>f.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyInput",{enumerable:!0,get:()=>C.SchmancyInput}),Object.defineProperty(exports,"SchmancyInputCompat",{enumerable:!0,get:()=>C.SchmancyInputCompat}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>o.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>o.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>o.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>o.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>h.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>h.SchmancyListItem}),exports.SchmancyListTypeContext=h.SchmancyListTypeContext,exports.$notify=i.$notify,exports.NotificationAudioService=i.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>i.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>i.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioButton",{enumerable:!0,get:()=>O.RadioButton}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>O.RadioGroup}),exports.mutationObserver=A.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>N.SchmancySelect}),exports.SchmancySheetPosition=m.SchmancySheetPosition,exports.SheetHereMorty=m.SheetHereMorty,exports.SheetWhereAreYouRicky=m.SheetWhereAreYouRicky,exports.sheet=m.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>P.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>P.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>S.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>S.SchmancyStepsContainer}),exports.StepsController=S.StepsController,exports.stepsContext=S.stepsContext,exports.BaseStore=a.BaseStore,exports.IndexedDBStorageManager=a.IndexedDBStorageManager,exports.LocalStorageManager=a.LocalStorageManager,exports.MemoryStorageManager=a.MemoryStorageManager,exports.SchmancyArrayStore=a.SchmancyArrayStore,exports.SchmancyStoreObject=a.SchmancyStoreObject,exports.SessionStorageManager=a.SessionStorageManager,exports.StoreError=a.StoreError,exports.createStorageManager=a.createStorageManager,exports.compareValues=e.compareValues,exports.createArrayContext=e.createArrayContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createOptimizedSelector=e.createOptimizedSelector,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.createTestArrayContext=e.createTestArrayContext,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.isArray=e.isArray,exports.isDate=e.isDate,exports.isIterable=e.isIterable,exports.isMap=e.isMap,exports.isNil=e.isNil,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isSet=e.isSet,exports.isString=e.isString,exports.select=e.select,exports.selectItem=e.selectItem,Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>j.SchmancySurface}),exports.SchmancySurfaceTypeContext=j.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>D.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>D.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>n.SchmancyThemeComponent}),exports.ThemeHereIAm=n.ThemeHereIAm,exports.ThemeWhereAreYou=n.ThemeWhereAreYou,exports.formateTheme=n.formateTheme,exports.tailwindStyles=n.tailwindStyles,exports.SchmancyTheme=v.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>q.SchmancyTooltip}),exports.tooltip=q.tooltip,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>x.SchmancyTree}),exports.SchmancyEvents=E.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>B.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>H.SchmancyTypography}),exports.intersection$=F.intersection$;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("./animated-text-CtXY3MHV.cjs");const c=require("./area.component-DQ_erV9e.cjs"),t=require("./utils-C9nzOWpR.cjs");require("./autocomplete-PHnzqAII.cjs");const r=require("./avatar-CagKP9HD.cjs"),w=require("./boat-B_xZilsk.cjs");require("./spinner-CV62BBoF.cjs");const b=require("./icon-button-DbvjV5zJ.cjs");require("./media-CIuTybvD.cjs");const T=require("./checkbox-BAuVXvYL.cjs");require("./chips-Dg2otqDI.cjs");const I=require("./circular-progress-DZUJU-z3.cjs"),y=require("./code-preview-CYHNaPek.cjs"),M=require("./payment-card-form-ccF9dfGC.cjs"),d=require("./date-range-Cf9ldt-N.cjs"),R=require("./date-range-inline-Czq1wHs1.cjs"),g=require("./delay-FgtrEHdo.cjs"),l=require("./dialog-content-tiwbeegi.cjs"),p=require("./dialog-service-DUDhcx9X.cjs"),u=require("./ripple-C2BHbhcS.cjs");require("./divider-2yg9r1tF.cjs");const s=require("./dropdown-content-DJ4CA3ug.cjs"),f=require("./timezone-UBBApQoU.cjs");require("./form-Dpokur4M.cjs"),require("./icon-mhchC8Qw.cjs");const C=require("./input-DzNoI9qU.cjs"),o=require("./flex-DWnX0ZPR.cjs"),h=require("./list-DRbkWHho.cjs");require("./menu-DEbZxoXr.cjs");const i=require("./notification-service-B6nHqzq5.cjs");require("./option-BPmOG_Hw.cjs"),require("./progress-BqZ7yHQe.cjs");const O=require("./radio-button-WmbuT_YW.cjs"),A=require("./rxjs-utils.cjs");require("rxjs"),require("./index-DyJ0oDpR.cjs");const N=require("./select-CPnSionr.cjs"),m=require("./sheet-eCDoMdHF.cjs"),P=require("./slider-DBNoXRWS.cjs"),S=require("./schmancy-steps-container-CjAsrjKf.cjs"),a=require("./context-object-K_1gDFu-.cjs"),e=require("./selector-hook-DB8RFC1y.cjs"),j=require("./surface-ClfeUI6q.cjs"),D=require("./table-Rqnb4AJl.cjs");require("./tabs-compatibility-B1bE7hSG.cjs"),require("./textarea-Dlnyyrbq.cjs");const n=require("./theme.component-RtV3l-Ns.cjs"),v=require("./theme.interface-Xg5Zi46a.cjs");require("./theme-button-Cao8AH8r.cjs");const q=require("./tooltip-WpE4e-fO.cjs"),x=require("./tree-Dn0t7MUR.cjs"),E=require("./types.cjs"),B=require("./typewriter-DwLZUKKQ.cjs"),H=require("./typography-BhCrqK_b.cjs"),F=require("./intersection-CVvaDv96.cjs");exports.FINDING_MORTIES=c.FINDING_MORTIES,exports.HERE_RICKY=c.HERE_RICKY,exports.HISTORY_STRATEGY=c.HISTORY_STRATEGY,Object.defineProperty(exports,"SchmancyArea",{enumerable:!0,get:()=>c.SchmancyArea}),exports.area=c.area,exports.routerHistory=c.routerHistory,exports.buildQueryString=t.buildQueryString,exports.compareActiveRoutes=t.compareActiveRoutes,exports.compareCustomElementConstructors=t.compareCustomElementConstructors,exports.compareRouteActions=t.compareRouteActions,exports.createRouteCacheKey=t.createRouteCacheKey,exports.debounce=t.debounce,exports.decodeRouteState=t.decodeRouteState,exports.deepMerge=t.deepMerge,exports.encodeRouteState=t.encodeRouteState,exports.extractQueryParams=t.extractQueryParams,exports.getTagName=t.getTagName,exports.isObject=t.isObject,exports.normalizeTagName=t.normalizeTagName,exports.sanitizeRouteState=t.sanitizeRouteState,exports.$drawer=r.$drawer,exports.HereMorty=r.HereMorty,Object.defineProperty(exports,"ScBadgeV2",{enumerable:!0,get:()=>r.ScBadgeV2}),Object.defineProperty(exports,"SchmancyAvatar",{enumerable:!0,get:()=>r.SchmancyAvatar}),Object.defineProperty(exports,"SchmancyBadgeV2",{enumerable:!0,get:()=>r.SchmancyBadgeV2}),Object.defineProperty(exports,"SchmancyContentDrawer",{enumerable:!0,get:()=>r.SchmancyContentDrawer}),exports.SchmancyContentDrawerID=r.SchmancyContentDrawerID,Object.defineProperty(exports,"SchmancyContentDrawerMain",{enumerable:!0,get:()=>r.SchmancyContentDrawerMain}),exports.SchmancyContentDrawerMaxHeight=r.SchmancyContentDrawerMaxHeight,exports.SchmancyContentDrawerMinWidth=r.SchmancyContentDrawerMinWidth,Object.defineProperty(exports,"SchmancyContentDrawerSheet",{enumerable:!0,get:()=>r.SchmancyContentDrawerSheet}),exports.SchmancyContentDrawerSheetMode=r.SchmancyContentDrawerSheetMode,exports.SchmancyContentDrawerSheetState=r.SchmancyContentDrawerSheetState,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>r.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=r.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=r.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>r.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>r.SchmancyNavigationDrawerSidebar}),Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>r.SchmancyTeleportation}),exports.WhereAreYouRicky=r.WhereAreYouRicky,exports.schmancyContentDrawer=r.schmancyContentDrawer,exports.schmancyNavDrawer=r.schmancyNavDrawer,exports.teleport=r.teleport,Object.defineProperty(exports,"SchmancyBoat",{enumerable:!0,get:()=>w.SchmancyBoat}),Object.defineProperty(exports,"SchmancyButton",{enumerable:!0,get:()=>b.SchmancyButton}),Object.defineProperty(exports,"SchmnacyIconButton",{enumerable:!0,get:()=>b.SchmnacyIconButton}),Object.defineProperty(exports,"SchmancyCheckbox",{enumerable:!0,get:()=>T.SchmancyCheckbox}),Object.defineProperty(exports,"SchmancyCircularProgress",{enumerable:!0,get:()=>I.SchmancyCircularProgress}),Object.defineProperty(exports,"SchmancyCode",{enumerable:!0,get:()=>y.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodeHighlight",{enumerable:!0,get:()=>y.SchmancyCode}),Object.defineProperty(exports,"SchmancyCodePreview",{enumerable:!0,get:()=>y.SchmancyCodePreview}),Object.defineProperty(exports,"SchmancyPaymentCardForm",{enumerable:!0,get:()=>M.SchmancyPaymentCardForm}),Object.defineProperty(exports,"SchmancyDateRange",{enumerable:!0,get:()=>d.SchmancyDateRange}),exports.validateInitialDateRange=d.validateInitialDateRange,Object.defineProperty(exports,"SchmancyDateRangeInline",{enumerable:!0,get:()=>R.SchmancyDateRangeInline}),Object.defineProperty(exports,"SchmancyDelay",{enumerable:!0,get:()=>g.SchmancyDelay}),exports.delayContext=g.delayContext,Object.defineProperty(exports,"ConfirmDialog",{enumerable:!0,get:()=>l.ConfirmDialog}),Object.defineProperty(exports,"SchmancyDialog",{enumerable:!0,get:()=>l.SchmancyDialog}),Object.defineProperty(exports,"SchmancyDialogContent",{enumerable:!0,get:()=>l.SchmancyDialogContent}),exports.$dialog=p.$dialog,exports.DialogService=p.DialogService,exports.color=u.color,exports.fullHeight=u.fullHeight,exports.ripple=u.ripple,Object.defineProperty(exports,"SchmancyDropdown",{enumerable:!0,get:()=>s.SchmancyDropdown}),Object.defineProperty(exports,"SchmancyDropdownContent",{enumerable:!0,get:()=>s.SchmancyDropdownContent}),Object.defineProperty(exports,"SchmancyCountriesSelect",{enumerable:!0,get:()=>f.SchmancyCountriesSelect}),Object.defineProperty(exports,"SchmancyTimezonesSelect",{enumerable:!0,get:()=>f.SchmancyTimezonesSelect}),Object.defineProperty(exports,"SchmancyInput",{enumerable:!0,get:()=>C.SchmancyInput}),Object.defineProperty(exports,"SchmancyInputCompat",{enumerable:!0,get:()=>C.SchmancyInputCompat}),Object.defineProperty(exports,"SchmancyFlex",{enumerable:!0,get:()=>o.SchmancyFlex}),Object.defineProperty(exports,"SchmancyFlexV2",{enumerable:!0,get:()=>o.SchmancyFlexV2}),Object.defineProperty(exports,"SchmancyGrid",{enumerable:!0,get:()=>o.SchmancyGrid}),Object.defineProperty(exports,"SchmancyScroll",{enumerable:!0,get:()=>o.SchmancyScroll}),Object.defineProperty(exports,"List",{enumerable:!0,get:()=>h.List}),Object.defineProperty(exports,"SchmancyListItem",{enumerable:!0,get:()=>h.SchmancyListItem}),exports.SchmancyListTypeContext=h.SchmancyListTypeContext,exports.$notify=i.$notify,exports.NotificationAudioService=i.NotificationAudioService,Object.defineProperty(exports,"SchmancyNotification",{enumerable:!0,get:()=>i.SchmancyNotification}),Object.defineProperty(exports,"SchmancyNotificationContainer",{enumerable:!0,get:()=>i.SchmancyNotificationContainer}),Object.defineProperty(exports,"RadioButton",{enumerable:!0,get:()=>O.RadioButton}),Object.defineProperty(exports,"RadioGroup",{enumerable:!0,get:()=>O.RadioGroup}),exports.mutationObserver=A.mutationObserver,Object.defineProperty(exports,"SchmancySelect",{enumerable:!0,get:()=>N.SchmancySelect}),exports.SchmancySheetPosition=m.SchmancySheetPosition,exports.SheetHereMorty=m.SheetHereMorty,exports.SheetWhereAreYouRicky=m.SheetWhereAreYouRicky,exports.sheet=m.sheet,Object.defineProperty(exports,"SchmancySlide",{enumerable:!0,get:()=>P.SchmancySlide}),Object.defineProperty(exports,"SchmancySlider",{enumerable:!0,get:()=>P.SchmancySlider}),Object.defineProperty(exports,"SchmancyStep",{enumerable:!0,get:()=>S.SchmancyStep}),Object.defineProperty(exports,"SchmancyStepsContainer",{enumerable:!0,get:()=>S.SchmancyStepsContainer}),exports.StepsController=S.StepsController,exports.stepsContext=S.stepsContext,exports.BaseStore=a.BaseStore,exports.IndexedDBStorageManager=a.IndexedDBStorageManager,exports.LocalStorageManager=a.LocalStorageManager,exports.MemoryStorageManager=a.MemoryStorageManager,exports.SchmancyArrayStore=a.SchmancyArrayStore,exports.SchmancyStoreObject=a.SchmancyStoreObject,exports.SessionStorageManager=a.SessionStorageManager,exports.StoreError=a.StoreError,exports.createStorageManager=a.createStorageManager,exports.compareValues=e.compareValues,exports.createArrayContext=e.createArrayContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createOptimizedSelector=e.createOptimizedSelector,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.createTestArrayContext=e.createTestArrayContext,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.isArray=e.isArray,exports.isDate=e.isDate,exports.isIterable=e.isIterable,exports.isMap=e.isMap,exports.isNil=e.isNil,exports.isNumber=e.isNumber,exports.isPlainObject=e.isPlainObject,exports.isSet=e.isSet,exports.isString=e.isString,exports.select=e.select,exports.selectItem=e.selectItem,Object.defineProperty(exports,"SchmancySurface",{enumerable:!0,get:()=>j.SchmancySurface}),exports.SchmancySurfaceTypeContext=j.SchmancySurfaceTypeContext,Object.defineProperty(exports,"SchmancyDataTable",{enumerable:!0,get:()=>D.SchmancyDataTable}),Object.defineProperty(exports,"SchmancyTableRow",{enumerable:!0,get:()=>D.SchmancyTableRow}),Object.defineProperty(exports,"SchmancyThemeComponent",{enumerable:!0,get:()=>n.SchmancyThemeComponent}),exports.ThemeHereIAm=n.ThemeHereIAm,exports.ThemeWhereAreYou=n.ThemeWhereAreYou,exports.formateTheme=n.formateTheme,exports.tailwindStyles=n.tailwindStyles,exports.SchmancyTheme=v.SchmancyTheme,Object.defineProperty(exports,"SchmancyTooltip",{enumerable:!0,get:()=>q.SchmancyTooltip}),exports.tooltip=q.tooltip,Object.defineProperty(exports,"SchmancyTree",{enumerable:!0,get:()=>x.SchmancyTree}),exports.SchmancyEvents=E.SchmancyEvents,Object.defineProperty(exports,"TypewriterElement",{enumerable:!0,get:()=>B.TypewriterElement}),Object.defineProperty(exports,"SchmancyTypography",{enumerable:!0,get:()=>H.SchmancyTypography}),exports.intersection$=F.intersection$;
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.js CHANGED
@@ -2,21 +2,21 @@ import "./animated-text-D26Fv13t.js";
2
2
  import { F as d, H as g, b as u, S as D, a as w, r as T } from "./area.component-BCcq9Nb7.js";
3
3
  import { l as I, h as M, c as R, f as A, j as v, a as N, b as H, d as B, e as E, k as F, g as O, i as $, n as j, s as k } from "./utils-03Coa8AW.js";
4
4
  import "./autocomplete-CHObbMzK.js";
5
- import { $ as P, H as Y, a as z, r as G, S as V, g as W, d as K, h as _, e as q, f as Q, i as J, b as U, c as X, k as Z, m as aa, n as ea, o as ra, l as ta, p as oa, q as sa, W as ca, s as na, j as ma, t as Sa } from "./avatar-DZ45SZ_3.js";
5
+ import { $ as P, H as Y, a as z, r as G, S as V, g as W, d as K, h as _, e as q, f as Q, i as J, b as U, c as X, k as Z, m as aa, n as ea, o as ra, l as ta, p as oa, q as sa, W as ca, s as na, j as ma, t as Sa } from "./avatar-DBcrNPzz.js";
6
6
  import { S as ya } from "./boat-C_BvtlNQ.js";
7
7
  import "./spinner-CbA-FXRK.js";
8
- import { S as pa, a as la } from "./icon-button-BW5ofOL5.js";
8
+ import { S as pa, a as la } from "./icon-button-BGvSPuE-.js";
9
9
  import "./media-BO-aZBTp.js";
10
10
  import { S as xa } from "./checkbox-BSYgpRsc.js";
11
11
  import "./chips-Dn8RpKCE.js";
12
12
  import { S as da } from "./circular-progress-B1RjFzcp.js";
13
13
  import { S as ua, S as Da, a as wa } from "./code-preview-JlSLKkKg.js";
14
14
  import { S as ba } from "./payment-card-form-Cs5bP5Di.js";
15
- import { S as Ma, v as Ra } from "./date-range-Cnrrl6_Q.js";
15
+ import { S as Ma, v as Ra } from "./date-range-DPZXGoEA.js";
16
16
  import { S as va } from "./date-range-inline-B_K4YPtB.js";
17
17
  import { S as Ha, d as Ba } from "./delay-D415_oVH.js";
18
- import { C as Fa, S as Oa, a as $a } from "./dialog-content-MhUhElif.js";
19
- import { $ as ka, D as La } from "./dialog-service-LvOr2E3k.js";
18
+ import { C as Fa, S as Oa, a as $a } from "./dialog-content-CT6Y3ZLb.js";
19
+ import { $ as ka, D as La } from "./dialog-service-Dm7HJGjx.js";
20
20
  import { c as Ya, f as za, r as Ga } from "./ripple-BumgqsDT.js";
21
21
  import "./divider-Dn26vIou.js";
22
22
  import { S as Wa, a as Ka } from "./dropdown-content-DOnGrBxV.js";
@@ -35,7 +35,7 @@ import { mutationObserver as Ce } from "./rxjs-utils.js";
35
35
  import "rxjs";
36
36
  import "./index-CuY8m6ta.js";
37
37
  import { S as ge } from "./select-rwocpGs2.js";
38
- import { S as De, b as we, a as Te, s as be } from "./sheet-DMP3Pfe5.js";
38
+ import { S as De, b as we, a as Te, s as be } from "./sheet-Cw2qLdzN.js";
39
39
  import { S as Me, a as Re } from "./slider-C7Z1bPq7.js";
40
40
  import { S as ve, a as Ne, b as He, s as Be } from "./schmancy-steps-container-CoARMXfB.js";
41
41
  import { B as Fe, I as Oe, L as $e, M as je, S as ke, a as Le, b as Pe, d as Ye, c as ze } from "./context-object-CDDP4bTk.js";
@@ -44,7 +44,7 @@ import { a as br, S as Ir } from "./surface-By8o7nWa.js";
44
44
  import { a as Rr, S as Ar } from "./table-CvMo5lOi.js";
45
45
  import "./tabs-compatibility-DsOH4PSw.js";
46
46
  import "./textarea-DM3lgEUp.js";
47
- import { S as Nr, a as Hr, T as Br, f as Er, t as Fr } from "./theme.component-Bl4uy-_0.js";
47
+ import { S as Nr, a as Hr, T as Br, f as Er, t as Fr } from "./theme.component-ColRTbY5.js";
48
48
  import { S as $r } from "./theme.interface-C5Kj6WjD.js";
49
49
  import "./theme-button-C4JWRMiC.js";
50
50
  import { S as kr, t as Lr } from "./tooltip-nwQwCEgl.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-By_6fdSR.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-CagKP9HD.cjs");exports.$drawer=e.$drawer,Object.defineProperty(exports,"SchmancyDrawerAppbar",{enumerable:!0,get:()=>e.SchmancyDrawerAppbar}),exports.SchmancyDrawerNavbarMode=e.SchmancyDrawerNavbarMode,exports.SchmancyDrawerNavbarState=e.SchmancyDrawerNavbarState,Object.defineProperty(exports,"SchmancyNavigationDrawer",{enumerable:!0,get:()=>e.SchmancyNavigationDrawer}),Object.defineProperty(exports,"SchmancyNavigationDrawerContent",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerContent}),Object.defineProperty(exports,"SchmancyNavigationDrawerSidebar",{enumerable:!0,get:()=>e.SchmancyNavigationDrawerSidebar}),exports.schmancyNavDrawer=e.schmancyNavDrawer;
2
2
  //# sourceMappingURL=nav-drawer.cjs.map
@@ -1,4 +1,4 @@
1
- import { $ as c, k as e, m as n, n as m, o as s, l as o, p as t, j as w } from "./avatar-DZ45SZ_3.js";
1
+ import { $ as c, k as e, m as n, n as m, o as s, l as o, p as t, j as w } from "./avatar-DBcrNPzz.js";
2
2
  export {
3
3
  c as $drawer,
4
4
  e as SchmancyDrawerAppbar,