@mhmo91/schmancy 0.9.16 → 0.9.18

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 (101) hide show
  1. package/custom-elements.json +111 -51
  2. package/dist/agent/schmancy.agent.js +288 -38
  3. package/dist/agent/schmancy.agent.js.map +1 -1
  4. package/dist/agent/schmancy.manifest.json +332 -25
  5. package/dist/breadcrumb.cjs.map +1 -1
  6. package/dist/breadcrumb.js.map +1 -1
  7. package/dist/card-BslSqOsf.cjs.map +1 -1
  8. package/dist/card-CEdgK9nb.js.map +1 -1
  9. package/dist/details-B8p62xmR.cjs.map +1 -1
  10. package/dist/details-CCW52lzz.js.map +1 -1
  11. package/dist/dialog.cjs.map +1 -1
  12. package/dist/dialog.js.map +1 -1
  13. package/dist/divider-CbEWg3G_.js.map +1 -1
  14. package/dist/divider-JyyFw_3J.cjs.map +1 -1
  15. package/dist/dropdown.cjs.map +1 -1
  16. package/dist/dropdown.js.map +1 -1
  17. package/dist/expand-BmwIPNjq.cjs.map +1 -1
  18. package/dist/expand-bFa_qVDT.js.map +1 -1
  19. package/dist/handover/agent-runtime-followups.md +1 -1
  20. package/dist/handover/agent-runtime-v1.md +3 -3
  21. package/dist/list-BpjKUOzM.js.map +1 -1
  22. package/dist/list-CMWHu6cV.cjs.map +1 -1
  23. package/dist/menu-BIBUgS1T.js.map +1 -1
  24. package/dist/menu-DS8Iz4fJ.cjs.map +1 -1
  25. package/dist/navigation-rail.cjs.map +1 -1
  26. package/dist/navigation-rail.js.map +1 -1
  27. package/dist/page.cjs.map +1 -1
  28. package/dist/page.js.map +1 -1
  29. package/dist/scroll-CdmXRXh2.js.map +1 -1
  30. package/dist/scroll-V1rAZ9fK.cjs.map +1 -1
  31. package/dist/sheet-DdlZhnDG.cjs.map +1 -1
  32. package/dist/sheet-LFVo5iN4.js.map +1 -1
  33. package/dist/src-C7niWYur.js.map +1 -1
  34. package/dist/src-I4M33WK2.cjs.map +1 -1
  35. package/dist/surface-0XM4DBaT.js.map +1 -1
  36. package/dist/surface-B6DA01kL.cjs.map +1 -1
  37. package/dist/theme-Cq_c9IO3.js.map +1 -1
  38. package/dist/theme-DU5yXaV-.cjs.map +1 -1
  39. package/dist/tree.cjs.map +1 -1
  40. package/dist/tree.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/breadcrumb/breadcrumb.ts +14 -4
  43. package/src/card/actions.ts +9 -0
  44. package/src/card/card.ts +18 -0
  45. package/src/card/content.ts +9 -0
  46. package/src/card/media.ts +6 -0
  47. package/src/details/details.ts +12 -0
  48. package/src/dialog/dialog.component.ts +9 -9
  49. package/src/divider/divider.ts +11 -0
  50. package/src/dropdown/dropdown-component.ts +13 -1
  51. package/src/dropdown/dropdown-content.ts +11 -3
  52. package/src/expand/expand-root.component.ts +12 -0
  53. package/src/expand/expand.component.ts +14 -0
  54. package/src/layout/scroll/scroll.ts +5 -1
  55. package/src/list/list-item.ts +10 -0
  56. package/src/list/list.ts +7 -8
  57. package/src/menu/menu-item.ts +13 -0
  58. package/src/menu/menu.ts +10 -22
  59. package/src/nav-drawer/appbar.ts +11 -0
  60. package/src/nav-drawer/content.ts +11 -0
  61. package/src/nav-drawer/drawer.ts +15 -0
  62. package/src/nav-drawer/navbar.ts +14 -0
  63. package/src/navigation-bar/navigation-bar-item.ts +3 -4
  64. package/src/navigation-bar/navigation-bar.ts +3 -9
  65. package/src/navigation-rail/navigation-rail-item.ts +3 -7
  66. package/src/navigation-rail/navigation-rail.ts +12 -8
  67. package/src/page/page.ts +8 -11
  68. package/src/sheet/sheet.ts +17 -0
  69. package/src/surface/surface.ts +4 -10
  70. package/src/theme/theme.component.ts +10 -15
  71. package/src/tree/tree.ts +12 -0
  72. package/types/src/breadcrumb/breadcrumb.d.ts +14 -4
  73. package/types/src/card/actions.d.ts +9 -0
  74. package/types/src/card/card.d.ts +18 -0
  75. package/types/src/card/content.d.ts +9 -0
  76. package/types/src/card/media.d.ts +6 -0
  77. package/types/src/details/details.d.ts +12 -0
  78. package/types/src/dialog/dialog.component.d.ts +9 -9
  79. package/types/src/divider/divider.d.ts +11 -0
  80. package/types/src/dropdown/dropdown-component.d.ts +13 -1
  81. package/types/src/dropdown/dropdown-content.d.ts +11 -3
  82. package/types/src/expand/expand-root.component.d.ts +12 -0
  83. package/types/src/expand/expand.component.d.ts +14 -0
  84. package/types/src/layout/scroll/scroll.d.ts +5 -1
  85. package/types/src/list/list-item.d.ts +10 -0
  86. package/types/src/list/list.d.ts +7 -8
  87. package/types/src/menu/menu-item.d.ts +13 -0
  88. package/types/src/menu/menu.d.ts +10 -22
  89. package/types/src/nav-drawer/appbar.d.ts +11 -0
  90. package/types/src/nav-drawer/content.d.ts +11 -0
  91. package/types/src/nav-drawer/drawer.d.ts +15 -0
  92. package/types/src/nav-drawer/navbar.d.ts +14 -0
  93. package/types/src/navigation-bar/navigation-bar-item.d.ts +3 -4
  94. package/types/src/navigation-bar/navigation-bar.d.ts +3 -9
  95. package/types/src/navigation-rail/navigation-rail-item.d.ts +3 -7
  96. package/types/src/navigation-rail/navigation-rail.d.ts +12 -8
  97. package/types/src/page/page.d.ts +8 -11
  98. package/types/src/sheet/sheet.d.ts +17 -0
  99. package/types/src/surface/surface.d.ts +4 -10
  100. package/types/src/theme/theme.component.d.ts +10 -15
  101. package/types/src/tree/tree.d.ts +12 -0
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-V1rAZ9fK.cjs","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * A custom scrollable container with enhanced features.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends TailwindElement(css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`) {\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":"oNAsFO,IAAA,EAAA,cAA6B,EAAA,EAAgB,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;4CAoCxC,EAAA,KAAA,UAsByC,OAAA,KAAA,SAkBrC,GAZlB,IAAA,UAAI,CACH,OAAO,KAkBR,SAAyB,EAAoC,EAAA,CACrC,OAAZ,GAAY,SACtB,MAAM,SAAS,CAAE,IAAK,EAAS,SAAU,EAAM,SAAW,OAAA,CAAA,CAChD,EACV,MAAM,SAAS,EAAA,CAEf,MAAM,SAAS,CAAE,IAAK,EAAG,KAAM,EAAG,SAAU,OAAA,CAAA,CAS9C,aAAoB,EAAc,EAA2B,OAAA,CAC5D,MAAM,SAAS,CAAE,KAAA,EAAM,SAAA,EAAA,CAAA,CAQxB,mBAAA,CACC,MAAM,mBAAA,CACN,KAAK,uBAAA,CACL,KAAK,qBAAA,CAEL,KAAK,aAAa,OAAQ,WAAA,CAO3B,uBAAA,CAEK,KAAK,YAAc,cACtB,KAAK,MAAM,YAAY,aAAc,SAAA,CACrC,KAAK,MAAM,YAAY,aAAc,OAAA,EAC3B,KAAK,YAAc,YAC7B,KAAK,MAAM,YAAY,aAAc,OAAA,CACrC,KAAK,MAAM,YAAY,aAAc,SAAA,GAGrC,KAAK,MAAM,YAAY,aAAc,OAAA,CACrC,KAAK,MAAM,YAAY,aAAc,OAAA,EAQvC,qBAAA,CAEC,0BAAA,CAEC,IAAM,EAAS,KAAK,cACpB,GAAI,EAAQ,CACX,IAAM,EAAe,iBAAiB,EAAA,CACjB,EAAa,UAAY,QAAU,EAAa,UAAY,cAWhF,KAAK,UAAU,OAA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AAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAUjC,CAAE,KAAM,OAAQ,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAYhC,CAAE,KAAM,OAAQ,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,YAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAkBhC,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA5Eb,kBAAA,CAAA,CAAkB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"scroll-V1rAZ9fK.cjs","names":[],"sources":["../src/layout/scroll/scroll.ts"],"sourcesContent":["import { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\nimport { debounceTime, filter, fromEvent, takeUntil } from 'rxjs'\n\n/**\n * Custom scroll event interface for the SchmancyScroll component.\n * Contains detailed information about the scroll state.\n */\nexport interface SchmancyScrollEvent\n\textends CustomEvent<{\n\t\t/** Current scroll position from the top */\n\t\tscrollTop: number\n\t\t/** Total scrollable height of the content */\n\t\tscrollHeight: number\n\t\t/** Visible height of the container */\n\t\tclientHeight: number\n\t\t/** Original scroll event */\n\t\te: Event\n\t\t/** Current scroll position from the left (for horizontal scrolling) */\n\t\tscrollLeft?: number\n\t\t/** Total scrollable width of the content (for horizontal scrolling) */\n\t\tscrollWidth?: number\n\t\t/** Visible width of the container (for horizontal scrolling) */\n\t\tclientWidth?: number\n\t}> {}\n\n/**\n * Command event interface for controlling SchmancyScroll components\n */\nexport interface SchmancyScrollCommandEvent\n\textends CustomEvent<{\n\t\t/** Target component name */\n\t\tname: string\n\t\t/** Command action to perform */\n\t\taction: 'scrollTo'\n\t\t/** Scroll position for scrollTo action */\n\t\ttop: number\n\t\t/** Horizontal scroll position for scrollTo action (optional) */\n\t\tleft?: number\n\t}> {}\n\n// Augment the HTMLElementEventMap to include our custom events\ndeclare global {\n\tinterface HTMLElementEventMap {\n\t\tscroll: SchmancyScrollEvent\n\t\t'schmancy-scroll-command': SchmancyScrollCommandEvent\n\t}\n}\n\n/**\n * Scrollable container with debounced scroll events, horizontal/vertical direction, optional hidden scrollbar, and programmatic scrollTo via command events or refs.\n *\n * @element schmancy-scroll\n * @summary Use anywhere you'd reach for `overflow: auto` but also need debounced scroll events (for sticky headers, scroll spies, virtualization triggers) or the ability to drive scroll from elsewhere in the app by dispatching a schmancy-scroll-command event.\n * @platform div - Styled scrollable `<div>`. Degrades to a plain scrollable div if the tag never registers — loses the debounced scroll event and the command-bus integration.\n *\n * @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)\n * @slot - Default slot for content to be scrolled\n * @csspart scroller - The inner scrollable div element\n *\n * @example\n * ```html\n * <schmancy-scroll hide name=\"main-content\">\n * <div>Scrollable content goes here</div>\n * </schmancy-scroll>\n * ```\n *\n * @example\n * ```html\n * <schmancy-scroll direction=\"horizontal\" hide name=\"image-carousel\">\n * <div class=\"flex\">\n * <img src=\"image1.jpg\" alt=\"Image 1\">\n * <img src=\"image2.jpg\" alt=\"Image 2\">\n * </div>\n * </schmancy-scroll>\n * ```\n *\n * @example Programmatic scroll with Lit ref\n * ```typescript\n * private scrollRef = createRef<HTMLElement>()\n *\n * // In template:\n * html`<schmancy-scroll ${ref(this.scrollRef)}>...</schmancy-scroll>`\n *\n * // Scroll to top (smooth — host has scroll-behavior: smooth):\n * this.scrollRef.value?.scrollTo({ top: 0 })\n * ```\n */\n@customElement('schmancy-scroll')\nexport class SchmancyScroll extends TailwindElement(css`\n\t:host {\n\t\t/* Flexible sizing for different layout contexts */\n\t\twidth: 100%;\n\t\tmin-height: 0; /* Allow flex shrinking */\n\t\tflex: 1; /* Grow in flex containers */\n\t\tbox-sizing: border-box; /* Ensures proper sizing */\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tscroll-behavior: smooth;\n\t\toverscroll-behavior-x: contain;\n\t\toverscroll-behavior-y: auto;\n\t}\n\t/* Fallback for non-flex contexts */\n\t:host(.explicit-height) {\n\t\theight: 100%;\n\t\tflex: none;\n\t}\n\t:host([hide]) {\n\t\t-ms-overflow-style: none; /* IE and Edge */\n\t\tscrollbar-width: none; /* Firefox */\n\t}\n\t:host([hide])::-webkit-scrollbar {\n\t\tdisplay: none; /* Chrome, Safari, and Opera */\n\t}\n`) {\n\t/**\n\t * Determines whether the scrollbar is hidden.\n\t *\n\t * When `hide` is true, the host element's scrollbars are hidden\n\t * in supported browsers using CSS.\n\t *\n\t * @attr hide\n\t * @example <schmancy-scroll hide></schmancy-scroll>\n\t */\n\t@property({ type: Boolean, reflect: true })\n\tpublic hide = false\n\n\t/**\n\t * Optional name identifier for the component.\n\t * Used for targeting this specific component with global events.\n\t *\n\t * @attr name\n\t * @example <schmancy-scroll name=\"main-content\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic name?: string\n\n\t/**\n\t * Direction of scrolling: vertical, horizontal, or both.\n\t * - vertical: Only allows vertical scrolling\n\t * - horizontal: Only allows horizontal scrolling\n\t * - both: Allows both horizontal and vertical scrolling (default)\n\t *\n\t * @attr direction\n\t * @example <schmancy-scroll direction=\"horizontal\"></schmancy-scroll>\n\t */\n\t@property({ type: String, reflect: true })\n\tpublic direction: 'vertical' | 'horizontal' | 'both' = 'both'\n\n\t/**\n\t * Reference to the scrollable element (the host element itself)\n\t * @public\n\t */\n\tget scroller(): HTMLElement {\n\t\treturn this\n\t}\n\n\t/**\n\t * Debounce time in milliseconds for the scroll event.\n\t * Higher values reduce the frequency of scroll events being dispatched.\n\t *\n\t * @attr debounce\n\t * @example <schmancy-scroll debounce=\"50\"></schmancy-scroll>\n\t */\n\t@property({ type: Number })\n\tpublic debounce = 10\n\n\t/**\n\t * Scrolls the container to the specified position\n\t * @param options - ScrollToOptions or a number representing the top position\n\t * @param top - For backward compatibility, if options is a number, this is treated as \"behavior\"\n\t */\n\tpublic override scrollTo(options?: ScrollToOptions | number, top?: number): void {\n\t\tif (typeof options === 'number') {\n\t\t\tsuper.scrollTo({ top: options, behavior: top ? 'smooth' : 'auto' })\n\t\t} else if (options) {\n\t\t\tsuper.scrollTo(options)\n\t\t} else {\n\t\t\tsuper.scrollTo({ top: 0, left: 0, behavior: 'auto' })\n\t\t}\n\t}\n\n\t/**\n\t * Scrolls the container horizontally to the specified position\n\t * @param left - The horizontal position to scroll to (in pixels)\n\t * @param behavior - The scroll behavior ('auto' or 'smooth')\n\t */\n\tpublic scrollToLeft(left: number, behavior: ScrollBehavior = 'auto'): void {\n\t\tsuper.scrollTo({ left, behavior })\n\t}\n\n\t/**\n\t * Called when the component is connected to the DOM\n\t * Applies scrolling styles directly to the host element\n\t * @protected\n\t */\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tthis.updateScrollingStyles()\n\t\tthis.updateLayoutContext()\n\t\t// Set the part attribute on the host element\n\t\tthis.setAttribute('part', 'scroller')\n\t}\n\n\t/**\n\t * Updates the overflow styles based on the direction property\n\t * @private\n\t */\n\tprivate updateScrollingStyles(): void {\n\t\t// Apply overflow styles based on direction\n\t\tif (this.direction === 'horizontal') {\n\t\t\tthis.style.setProperty('overflow-y', 'hidden')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t} else if (this.direction === 'vertical') {\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'hidden')\n\t\t} else {\n\t\t\t// both\n\t\t\tthis.style.setProperty('overflow-y', 'auto')\n\t\t\tthis.style.setProperty('overflow-x', 'auto')\n\t\t}\n\t}\n\n\t/**\n\t * Updates the layout context based on parent container type\n\t * @private\n\t */\n\tprivate updateLayoutContext(): void {\n\t\t// Use requestAnimationFrame to ensure DOM is fully rendered\n\t\trequestAnimationFrame(() => {\n\t\t\t// Check if parent is a flex container\n\t\t\tconst parent = this.parentElement\n\t\t\tif (parent) {\n\t\t\t\tconst parentStyles = getComputedStyle(parent)\n\t\t\t\tconst isFlexParent = parentStyles.display === 'flex' || parentStyles.display === 'inline-flex'\n\n\t\t\t\t// For debugging - remove in production\n\t\t\t\tconsole.debug('schmancy-scroll parent detection:', {\n\t\t\t\t\tparent: parent.tagName,\n\t\t\t\t\tdisplay: parentStyles.display,\n\t\t\t\t\tisFlexParent,\n\t\t\t\t})\n\n\t\t\t\t// Apply appropriate class based on parent layout\n\t\t\t\tif (isFlexParent) {\n\t\t\t\t\tthis.classList.remove('explicit-height')\n\t\t\t\t} else {\n\t\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Default to explicit height if no parent\n\t\t\t\tthis.classList.add('explicit-height')\n\t\t\t}\n\t\t})\n\t}\n\n\t/**\n\t * Called when properties change\n\t * @protected\n\t */\n\tprotected updated(changedProperties: Map<string | number | symbol, unknown>): void {\n\t\tsuper.updated(changedProperties)\n\t\t// Update styles if direction changes\n\t\tif (changedProperties.has('direction')) {\n\t\t\tthis.updateScrollingStyles()\n\t\t}\n\t\t// Always update layout context in case parent layout changed\n\t\tthis.updateLayoutContext()\n\t}\n\n\t/**\n\t * Called after the component's first update\n\t * Sets up the scroll event listener with debouncing\n\t * @protected\n\t */\n\tprotected firstUpdated(): void {\n\t\t// Set up scroll event listening with debounce\n\t\tfromEvent(this.scroller, 'scroll', {\n\t\t\tpassive: true,\n\t\t})\n\t\t\t.pipe(\n\t\t\t\tdebounceTime(this.debounce),\n\t\t\t\ttakeUntil(this.disconnecting), // Unsubscribe when the element is destroyed\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\t// Always include the original required properties for backward compatibility\n\t\t\t\tconst scrollTop = this.scroller.scrollTop\n\t\t\t\tconst scrollHeight = this.scroller.scrollHeight\n\t\t\t\tconst clientHeight = this.scroller.clientHeight\n\n\t\t\t\t// Include horizontal scroll information as optional properties\n\t\t\t\tconst scrollLeft = this.scroller.scrollLeft\n\t\t\t\tconst scrollWidth = this.scroller.scrollWidth\n\t\t\t\tconst clientWidth = this.scroller.clientWidth\n\n\t\t\t\tthis.dispatchEvent(\n\t\t\t\t\tnew CustomEvent('scroll', {\n\t\t\t\t\t\tdetail: {\n\t\t\t\t\t\t\t// Original required properties first\n\t\t\t\t\t\t\tscrollTop,\n\t\t\t\t\t\t\tscrollHeight,\n\t\t\t\t\t\t\tclientHeight,\n\t\t\t\t\t\t\te,\n\t\t\t\t\t\t\t// New optional properties last\n\t\t\t\t\t\t\tscrollLeft,\n\t\t\t\t\t\t\tscrollWidth,\n\t\t\t\t\t\t\tclientWidth,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tbubbles: true,\n\t\t\t\t\t\tcomposed: true,\n\t\t\t\t\t}) as SchmancyScrollEvent,\n\t\t\t\t)\n\t\t\t})\n\n\t\t// Set up global command event listener\n\t\tfromEvent<SchmancyScrollCommandEvent>(window, '@schmancy:scrollTo')\n\t\t\t.pipe(\n\t\t\t\t// Only process events targeting this component by name\n\t\t\t\tfilter(e => this.name !== undefined && e.detail.name === this.name),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe(e => {\n\t\t\t\tif (e.detail.action === 'scrollTo' && typeof e.detail.top === 'number') {\n\t\t\t\t\tconst options: ScrollToOptions = {\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\ttop: e.detail.top, // Required for backward compatibility\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add optional left position if provided\n\t\t\t\t\tif (typeof e.detail.left === 'number') {\n\t\t\t\t\t\toptions.left = e.detail.left\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.scrollTo(options)\n\t\t\t\t}\n\t\t\t})\n\t}\n\n\t/**\n\t * Renders the component template\n\t * @returns {TemplateResult} The template to render\n\t * @protected\n\t */\n\tprotected render() {\n\t\t// Only render the slot, all styling is applied to the host\n\t\treturn html`<slot></slot>`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-scroll': SchmancyScroll\n\t}\n}\n"],"mappings":"oNA0FO,IAAA,EAAA,cAA6B,EAAA,EAAgB,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;4CAoCxC,EAAA,KAAA,UAsByC,OAAA,KAAA,SAkBrC,GAZlB,IAAA,UAAI,CACH,OAAO,KAkBR,SAAyB,EAAoC,EAAA,CACrC,OAAZ,GAAY,SACtB,MAAM,SAAS,CAAE,IAAK,EAAS,SAAU,EAAM,SAAW,OAAA,CAAA,CAChD,EACV,MAAM,SAAS,EAAA,CAEf,MAAM,SAAS,CAAE,IAAK,EAAG,KAAM,EAAG,SAAU,OAAA,CAAA,CAS9C,aAAoB,EAAc,EAA2B,OAAA,CAC5D,MAAM,SAAS,CAAE,KAAA,EAAM,SAAA,EAAA,CAAA,CAQxB,mBAAA,CACC,MAAM,mBAAA,CACN,KAAK,uBAAA,CACL,KAAK,qBAAA,CAEL,KAAK,aAAa,OAAQ,WAAA,CAO3B,uBAAA,CAEK,KAAK,YAAc,cACtB,KAAK,MAAM,YAAY,aAAc,SAAA,CACrC,KAAK,MAAM,YAAY,aAAc,OAAA,EAC3B,KAAK,YAAc,YAC7B,KAAK,MAAM,YAAY,aAAc,OAAA,CACrC,KAAK,MAAM,YAAY,aAAc,SAAA,GAGrC,KAAK,MAAM,YAAY,aAAc,OAAA,CACrC,KAAK,MAAM,YAAY,aAAc,OAAA,EAQvC,qBAAA,CAEC,0BAAA,CAEC,IAAM,EAAS,KAAK,cACpB,GAAI,EAAQ,CACX,IAAM,EAAe,iBAAiB,EAAA,CACjB,EAAa,UAAY,QAAU,EAAa,UAAY,cAWhF,KAAK,UAA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AAS,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAUjC,CAAE,KAAM,OAAQ,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAYhC,CAAE,KAAM,OAAQ,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,YAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAkBhC,CAAE,KAAM,OAAA,CAAA,CAAA,CAAS,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eA5Eb,kBAAA,CAAA,CAAkB,EAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-DdlZhnDG.cjs","names":[],"sources":["../src/sheet/hook.ts","../src/sheet/sheet.ts"],"sourcesContent":["// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html, css } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\nimport { BLACKBIRD_EASING, DURATION_ENTER, DURATION_EXIT, DURATION_BACKDROP, EASE_OUT, EASE_IN } from '../utils/animation'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tz-index: var(--schmancy-overlay-z, 999);\n\t\tdisplay: none;\n\t}\n\t:host([open]) {\n\t\tdisplay: block;\n\t}\n\n\t/* Luminous edge glow on sheet panel */\n\t.content {\n\t\tbox-shadow: -8px 0 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t:host([position='bottom']) .content {\n\t\tbox-shadow: 0 -8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.content { box-shadow: var(--schmancy-sys-elevation-3); }\n\t}\n`) {\n\t// uid is inherited from $LitElement mixin - auto-generated or set via attribute\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\tduration: DURATION_BACKDROP,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_ENTER,\n\t\t\teasing: BLACKBIRD_EASING,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.98)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.98)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_IN,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `absolute inset-0 flex h-full`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] z-10'\n\n\t\tconst surfaceClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'h-full overflow-auto'\n\t\t\t\t: 'max-h-[90vh] overflow-auto'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=${surfaceClasses} type=\"solid\">\n\t\t\t\t\t\t<schmancy-area class=\"size-full overflow-auto\" name=${this.uid}>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"mappings":"6UCUe,IDQI,EAAkB,ECRtB,EAAA,cAA4B,EAAA,EAAY,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;4CAyBN,EAAA,KAAA,SAC0B,EAAA,EAAsB,KAAA,KAAA,QAAA,CAC7C,EAAA,KAAA,KAAA,CACH,EAAA,KAAA,cAAA,CACS,EAAA,KAAA,mBAEX,KAAA,KAAA,mBAyJnB,GAAA,CAC7B,EAAE,iBAAA,CACG,KAAK,MACT,EAAA,EAAM,QAAQ,KAAK,IAAA,EAxJrB,aACa,EAAoB,EAAA,CAC5B,GACH,KAAK,mBAAqB,SAAS,cACnC,KAAK,mBAAA,CAAmB,EAAA,CACxB,KAAK,WAAA,CACL,KAAK,OAAA,GAEL,KAAK,YAAA,CACL,KAAK,mBAAA,CAAmB,EAAA,CACxB,KAAK,oBAAoB,OAAA,CACzB,KAAK,mBAAqB,MAI5B,WAAA,CACC,GAAA,CAAK,KAAK,WAAA,CAAc,KAAK,UAAW,OAExC,KAAK,UAAU,QAAQ,CAAC,CAAE,QAAS,EAAA,CAAK,CAAE,QAAS,EAAA,CAAA,CAAM,CACxD,SAAA,IACA,OAAQ,EAAA,EACR,KAAM,WAAA,CAAA,CAGP,IAAM,EACL,KAAK,WAAa,EAAA,EAAsB,KACrC,CACA,CAAE,Q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AAA"}
1
+ {"version":3,"file":"sheet-DdlZhnDG.cjs","names":[],"sources":["../src/sheet/hook.ts","../src/sheet/sheet.ts"],"sourcesContent":["// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html, css } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\nimport { BLACKBIRD_EASING, DURATION_ENTER, DURATION_EXIT, DURATION_BACKDROP, EASE_OUT, EASE_IN } from '../utils/animation'\n\n/**\n * Side-docked or bottom-docked panel — a dialog variant that slides in from an edge. Driven imperatively by the `sheet` service; rarely instantiated directly.\n *\n * @element schmancy-sheet\n * @summary Prefer `sheet.open({ component, position })` over placing this element declaratively — the service handles stacking, focus, close on outside-click, ESC, and router integration.\n * @example\n * import { sheet, SchmancySheetPosition } from '@mhmo91/schmancy'\n * sheet.open({\n * component: new MyEditorElement(),\n * position: SchmancySheetPosition.Side,\n * title: 'Edit item',\n * })\n * @platform dialog close - Positioned-fixed panel with backdrop. Degrades to a `<dialog>` if the tag never registers — loses slide animation, keeps focus trap + dismiss.\n * @attr position - `'side' | 'bottom'`. Which edge the sheet docks to.\n * @attr open - Boolean; sheet is visible when true.\n * @fires close - When the sheet is dismissed (backdrop click, close button, ESC).\n */\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tz-index: var(--schmancy-overlay-z, 999);\n\t\tdisplay: none;\n\t}\n\t:host([open]) {\n\t\tdisplay: block;\n\t}\n\n\t/* Luminous edge glow on sheet panel */\n\t.content {\n\t\tbox-shadow: -8px 0 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t:host([position='bottom']) .content {\n\t\tbox-shadow: 0 -8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.content { box-shadow: var(--schmancy-sys-elevation-3); }\n\t}\n`) {\n\t// uid is inherited from $LitElement mixin - auto-generated or set via attribute\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\tduration: DURATION_BACKDROP,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_ENTER,\n\t\t\teasing: BLACKBIRD_EASING,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.98)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.98)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_IN,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `absolute inset-0 flex h-full`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] z-10'\n\n\t\tconst surfaceClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'h-full overflow-auto'\n\t\t\t\t: 'max-h-[90vh] overflow-auto'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=${surfaceClasses} type=\"solid\">\n\t\t\t\t\t\t<schmancy-area class=\"size-full overflow-auto\" name=${this.uid}>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"mappings":"6UC2Be,IDTI,EAAkB,ECStB,EAAA,cAA4B,EAAA,EAAY,EAAA,GAAG;;;;;;;;;;;;;;;;;;;;;;;4CAyBN,EAAA,KAAA,SAC0B,EAAA,EAAsB,KAAA,KAAA,QAAA,CAC7C,EAAA,KAAA,KAAA,CACH,EAAA,KAAA,cAAA,CACS,EAAA,KAAA,mBAEX,KAAA,KAAA,mBAyJnB,GAAA,CAC7B,EAAE,iBAAA,CACG,KAAK,MACT,EAAA,EAAM,QAAQ,KAAK,IAAA,EAxJrB,aACa,EAAoB,EAAA,CAC5B,GACH,KAAK,mBAAqB,SAAS,cACnC,KAAK,mBAAA,CAAmB,EAAA,CACxB,KAAK,WAAA,CACL,KAAK,OAAA,GAEL,KAAK,YAAA,CACL,KAAK,mBAAA,CAAmB,EAAA,CACxB,KAAK,oBAAoB,OAAA,CACzB,KAAK,mBAAqB,MAI5B,WAAA,CACC,GAAA,CAAK,KAAK,WAAA,CAAc,KAAK,UAAW,OAExC,KAAK,UAAU,QAAQ,CAAC,CAAE,QAAS,EAAA,CAAK,CAAE,QAAS,EAAA,CAAA,CAAM,CACxD,SAAA,IACA,OAAQ,EAAA,EACR,KAAM,WAAA,CAAA,CAGP,IAAM,EACL,KAAK,WAAa,EAAA,EAAsB,KACrC,CACA,CAAE,QAAS,EAAG,UAAW,+BAAA,CACzB,CAAE,QAAS,EAAG,UAAW,yBAAA,CAAA,CAEzB,CACA,CAAE,QAAS,EAAG,UAAW,+BAAA,CACzB,CAAE,QAAS,EAAG,UAAW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O,EAAA,UAAA,WAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UAChC,CAAE,KAAM,QAAS,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UACjC,CAAE,KAAM,QAAS,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,UACjC,CAAE,KAAM,QAAS,QAAA,CAAS,EAAA,CAAA,CAAA,CAAO,EAAA,UAAA,gBAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAGpC,WAAA,CAAA,CAAW,EAAA,UAAA,YAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OACX,WAAA,CAAA,CAAW,EAAA,UAAA,YAAA,IAAA,GAAA,CAAA,EAAA,EAAA,ED1CA,EC4Cd,QD3CI,EAAwB,IAAA,CAC/B,GAAA,CAAM,WAAE,GAAe,EAEvB,EAAU,OAAO,OAAO,CAAE,qBAAA,CAAsB,EAAA,CAAS,EAAA,CAEzD,EAAkB,WAAa,SAAU,EAAA,CAGxC,GAFA,EAAW,KAAK,KAAM,EAAA,CAElB,EAAa,IAAI,EAAA,CAAW,CAC/B,IAAM,EAAW,EAAa,IAAI,EAAA,CAC5B,EAAW,KAAK,GAElB,IAAa,IACX,GAAS,sBAAA,CAAwB,KAAK,YAC1C,KAAK,GAAM,KAAK,KAAM,EAAU,EAAA,MAAA,CC6B1B,EAAA,UAAA,eAAA,KAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eApCG,iBAAA,CAAA,CAAiB,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"sheet-LFVo5iN4.js","names":[],"sources":["../src/sheet/hook.ts","../src/sheet/sheet.ts"],"sourcesContent":["// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html, css } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\nimport { BLACKBIRD_EASING, DURATION_ENTER, DURATION_EXIT, DURATION_BACKDROP, EASE_OUT, EASE_IN } from '../utils/animation'\n\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tz-index: var(--schmancy-overlay-z, 999);\n\t\tdisplay: none;\n\t}\n\t:host([open]) {\n\t\tdisplay: block;\n\t}\n\n\t/* Luminous edge glow on sheet panel */\n\t.content {\n\t\tbox-shadow: -8px 0 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t:host([position='bottom']) .content {\n\t\tbox-shadow: 0 -8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.content { box-shadow: var(--schmancy-sys-elevation-3); }\n\t}\n`) {\n\t// uid is inherited from $LitElement mixin - auto-generated or set via attribute\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\tduration: DURATION_BACKDROP,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_ENTER,\n\t\t\teasing: BLACKBIRD_EASING,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.98)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.98)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_IN,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `absolute inset-0 flex h-full`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] z-10'\n\n\t\tconst surfaceClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'h-full overflow-auto'\n\t\t\t\t: 'max-h-[90vh] overflow-auto'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=${surfaceClasses} type=\"solid\">\n\t\t\t\t\t\t<schmancy-area class=\"size-full overflow-auto\" name=${this.uid}>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"mappings":";;;;;;;;;ACUe,IDQI,GAAkB,GCRtB,IAAA,cAA4B,EAAY,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;4BAyBN,GAAA,KAAA,WAC0B,EAAsB,MAAA,KAAA,UAAA,CAC7C,GAAA,KAAA,OAAA,CACH,GAAA,KAAA,gBAAA,CACS,GAAA,KAAA,qBAEX,MAAA,KAAA,sBAyJnB,MAAA;AAC7B,KAAE,iBAAA,EACG,KAAK,QACT,EAAM,QAAQ,KAAK,IAAA;;;C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AAK,cAC1C,KAAK,GAAM,KAAK,MAAM,GAAU,EAAA;;;GAAA,ECY1B,EAAA,WAAA,gBAAA,KAAA,EAAA,IAAA,EAAA,CApCX,EAAc,iBAAA,CAAA,EAAiB,EAAA"}
1
+ {"version":3,"file":"sheet-LFVo5iN4.js","names":[],"sources":["../src/sheet/hook.ts","../src/sheet/sheet.ts"],"sourcesContent":["// @watch decorator\n//\n// Runs when an observed property changes, e.g. @property or @state, but before the component updates.\n//\n// To wait for an update to complete after a change occurs, use `await this.updateComplete` in the handler. To start\n// watching after the initial update/render, use `{ waitUntilFirstUpdate: true }` or `this.hasUpdated` in the handler.\n//\n// Usage:\n//\n// @watch('propName')\n// handlePropChange(oldValue, newValue) {\n// ...\n// }\n//\ninterface WatchOptions {\n\twaitUntilFirstUpdate?: boolean\n}\n\nexport function on(propName: string, options?: WatchOptions) {\n\treturn (protoOrDescriptor: any, name: string): any => {\n\t\tconst { willUpdate } = protoOrDescriptor\n\n\t\toptions = Object.assign({ waitUntilFirstUpdate: false }, options) as WatchOptions\n\n\t\tprotoOrDescriptor.willUpdate = function (changedProps: Map<string, any>) {\n\t\t\twillUpdate.call(this, changedProps)\n\n\t\t\tif (changedProps.has(propName)) {\n\t\t\t\tconst oldValue = changedProps.get(propName)\n\t\t\t\tconst newValue = this[propName]\n\n\t\t\t\tif (oldValue !== newValue) {\n\t\t\t\t\tif (!options?.waitUntilFirstUpdate || this.hasUpdated) {\n\t\t\t\t\t\tthis[name].call(this, oldValue, newValue)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n","import { $LitElement } from '@mixins/index'\nimport { area } from '../area'\nimport { html, css } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, takeUntil, tap, filter } from 'rxjs'\nimport { on } from './hook'\nimport { SchmancySheetPosition, sheet } from './sheet.service'\nimport { BLACKBIRD_EASING, DURATION_ENTER, DURATION_EXIT, DURATION_BACKDROP, EASE_OUT, EASE_IN } from '../utils/animation'\n\n/**\n * Side-docked or bottom-docked panel — a dialog variant that slides in from an edge. Driven imperatively by the `sheet` service; rarely instantiated directly.\n *\n * @element schmancy-sheet\n * @summary Prefer `sheet.open({ component, position })` over placing this element declaratively — the service handles stacking, focus, close on outside-click, ESC, and router integration.\n * @example\n * import { sheet, SchmancySheetPosition } from '@mhmo91/schmancy'\n * sheet.open({\n * component: new MyEditorElement(),\n * position: SchmancySheetPosition.Side,\n * title: 'Edit item',\n * })\n * @platform dialog close - Positioned-fixed panel with backdrop. Degrades to a `<dialog>` if the tag never registers — loses slide animation, keeps focus trap + dismiss.\n * @attr position - `'side' | 'bottom'`. Which edge the sheet docks to.\n * @attr open - Boolean; sheet is visible when true.\n * @fires close - When the sheet is dismissed (backdrop click, close button, ESC).\n */\n@customElement('schmancy-sheet')\nexport default class SchmancySheet extends $LitElement(css`\n\t:host {\n\t\tposition: fixed;\n\t\tinset: 0;\n\t\tz-index: var(--schmancy-overlay-z, 999);\n\t\tdisplay: none;\n\t}\n\t:host([open]) {\n\t\tdisplay: block;\n\t}\n\n\t/* Luminous edge glow on sheet panel */\n\t.content {\n\t\tbox-shadow: -8px 0 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t:host([position='bottom']) .content {\n\t\tbox-shadow: 0 -8px 40px -8px color-mix(in srgb, var(--schmancy-sys-color-primary-default) 15%, transparent);\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.content { box-shadow: var(--schmancy-sys-elevation-3); }\n\t}\n`) {\n\t// uid is inherited from $LitElement mixin - auto-generated or set via attribute\n\t@property({ type: Boolean, reflect: true }) open = false\n\t@property({ type: String, reflect: true }) position: SchmancySheetPosition = SchmancySheetPosition.Side\n\t@property({ type: Boolean, reflect: true }) persist = false\n\t@property({ type: Boolean, reflect: true }) lock = false\n\t@property({ type: Boolean, reflect: true }) handleHistory = true\n\n\tprivate lastFocusedElement: HTMLElement | null = null\n\t@query('.overlay') private overlayEl!: HTMLDivElement\n\t@query('.content') private contentEl!: HTMLDivElement\n\n\t@on('open')\n\tonOpenChange(_oldValue: boolean, newValue: boolean) {\n\t\tif (newValue) {\n\t\t\tthis.lastFocusedElement = document.activeElement as HTMLElement\n\t\t\tthis.setBackgroundInert(true)\n\t\t\tthis.animateIn()\n\t\t\tthis.focus()\n\t\t} else {\n\t\t\tthis.animateOut()\n\t\t\tthis.setBackgroundInert(false)\n\t\t\tthis.lastFocusedElement?.focus()\n\t\t\tthis.lastFocusedElement = null\n\t\t}\n\t}\n\n\tprivate animateIn() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 0 }, { opacity: 1 }], {\n\t\t\tduration: DURATION_BACKDROP,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.95)' },\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_ENTER,\n\t\t\teasing: BLACKBIRD_EASING,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tprivate animateOut() {\n\t\tif (!this.overlayEl || !this.contentEl) return\n\n\t\tthis.overlayEl.animate([{ opacity: 1 }, { opacity: 0 }], {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_OUT,\n\t\t\tfill: 'forwards',\n\t\t})\n\n\t\tconst animation =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateX(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateX(100%) scale(0.98)' },\n\t\t\t\t\t]\n\t\t\t\t: [\n\t\t\t\t\t\t{ opacity: 1, transform: 'translateY(0) scale(1)' },\n\t\t\t\t\t\t{ opacity: 0, transform: 'translateY(100%) scale(0.98)' },\n\t\t\t\t\t]\n\n\t\tthis.contentEl.animate(animation, {\n\t\t\tduration: DURATION_EXIT,\n\t\t\teasing: EASE_IN,\n\t\t\tfill: 'forwards',\n\t\t})\n\t}\n\n\tconnectedCallback() {\n\t\tsuper.connectedCallback()\n\t\tthis.setupEventListeners()\n\t}\n\n\tdisconnectedCallback() {\n\t\tsuper.disconnectedCallback()\n\t\tthis.disconnecting.next(true)\n\t}\n\n\tprivate setupEventListeners() {\n\t\t// Handle browser back button\n\t\tconst popState$ = fromEvent<PopStateEvent>(window, 'popstate').pipe(\n\t\t\tfilter(() => this.handleHistory),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\t// Handle ESC key\n\t\tconst keyUp$ = fromEvent<KeyboardEvent>(this, 'keydown').pipe(\n\t\t\ttap(event => {\n\t\t\t\tif (event.key === 'Escape' && !this.lock && this.open) {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsheet.dismiss(this.uid)\n\t\t\t\t}\n\t\t\t}),\n\t\t)\n\n\t\t// Handle render events from sheet service\n\t\tconst render$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-render').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(e => {\n\t\t\t\tarea.push({\n\t\t\t\t\tarea: this.uid,\n\t\t\t\t\tcomponent: e.detail.component,\n\t\t\t\t\tprops: e.detail.props,\n\t\t\t\t\thistoryStrategy: 'silent',\n\t\t\t\t})\n\t\t\t}),\n\t\t)\n\n\t\t// Handle dismiss events from sheet service\n\t\tconst dismiss$ = fromEvent<CustomEvent>(window, 'schmancy-sheet-dismiss').pipe(\n\t\t\tfilter(e => e.detail.uid === this.uid),\n\t\t\ttap(() => {\n\t\t\t\tthis.closeSheet()\n\t\t\t}),\n\t\t)\n\n\t\tmerge(popState$, keyUp$, render$, dismiss$).pipe(takeUntil(this.disconnecting)).subscribe()\n\t}\n\n\tprivate setBackgroundInert(inert: boolean) {\n\t\tconst parent = this.parentElement\n\t\tif (!parent) return\n\n\t\tArray.from(parent.children).forEach(child => {\n\t\t\tif (child !== this && child instanceof HTMLElement) {\n\t\t\t\tchild.toggleAttribute('inert', inert)\n\t\t\t}\n\t\t})\n\t}\n\n\tcloseSheet() {\n\t\tthis.open = false\n\t\tthis.dispatchEvent(new CustomEvent('close'))\n\t}\n\n\toverride focus() {\n\t\t// delegatesFocus in shadowRootOptions handles automatic focus\n\t\t// Just focus first element with autofocus attribute if present\n\t\tconst element = this.querySelector('[autofocus]')\n\t\tif (element instanceof HTMLElement) {\n\t\t\telement.focus()\n\t\t}\n\t}\n\n\tprivate handleOverlayClick = (e: Event) => {\n\t\te.stopPropagation()\n\t\tif (!this.lock) {\n\t\t\tsheet.dismiss(this.uid)\n\t\t}\n\t}\n\n\trender() {\n\t\tconst sheetClasses = `absolute inset-0 flex h-full`\n\n\t\tconst overlayClasses = `overlay absolute inset-0 bg-surface-container/10 backdrop-blur-lg backdrop-saturate-150 ${this.lock ? '' : 'cursor-pointer'}`\n\n\t\tconst contentClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'content h-full min-w-[320px] max-w-[90vw] w-fit ml-auto z-10'\n\t\t\t\t: 'content w-full mt-auto rounded-t-2xl max-h-[90vh] z-10'\n\n\t\tconst surfaceClasses =\n\t\t\tthis.position === SchmancySheetPosition.Side\n\t\t\t\t? 'h-full overflow-auto'\n\t\t\t\t: 'max-h-[90vh] overflow-auto'\n\n\t\treturn html`\n\t\t\t<div class=${sheetClasses} role=\"dialog\" aria-hidden=${!this.open} aria-modal=${this.open} tabindex=\"0\">\n\t\t\t\t<div class=${overlayClasses} @click=${this.handleOverlayClick}></div>\n\t\t\t\t<div class=${contentClasses}>\n\t\t\t\t\t<schmancy-surface rounded=\"left\" fill=\"all\" id=\"body\" class=${surfaceClasses} type=\"solid\">\n\t\t\t\t\t\t<schmancy-area class=\"size-full overflow-auto\" name=${this.uid}>\n\t\t\t\t\t\t\t<slot></slot>\n\t\t\t\t\t\t</schmancy-area>\n\t\t\t\t\t</schmancy-surface>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-sheet': SchmancySheet\n\t}\n}\n"],"mappings":";;;;;;;;;AC2Be,IDTI,GAAkB,GCStB,IAAA,cAA4B,EAAY,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;4BAyBN,GAAA,KAAA,WAC0B,EAAsB,MAAA,KAAA,UAAA,CAC7C,GAAA,KAAA,OAAA,CACH,GAAA,KAAA,gBAAA,CACS,GAAA,KAAA,qBAEX,MAAA,KAAA,sBAyJnB,MAAA;AAC7B,KAAE,iBAAA,EACG,KAAK,QACT,EAAM,QAAQ,KAAK,IAAA;;;CAxJrB,aACa,GAAoB,GAAA;AAC5B,OACH,KAAK,qBAAqB,SAAS,eACnC,KAAK,mBAAA,CAAmB,EAAA,EACxB,KAAK,WAAA,EACL,KAAK,OAAA,KAEL,KAAK,YAAA,EACL,KAAK,mBAAA,CAAmB,EAAA,EACxB,KAAK,oBAAoB,OAAA,EACzB,KAAK,qBAAqB;;CAI5B,YAAA;AACC,MAAA,CAAK,KAAK,aAAA,CAAc,KAAK,UAAW;AAExC,OAAK,UAAU,QAAQ,CAAC,EAAE,SAAS,GAAA,EAAK,EAAE,SAAS,GAAA,CAAA,EAAM;GACxD,UAAA;GACA,QAAQ;GACR,MAAM;GAAA,CAAA;EAGP,IAAM,IACL,KAAK,aAAa,EAAsB,OACrC,CACA;GAAE,SAAS;GAAG,WAAW;GAAA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