@politiet/sheriff-web-components 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +1 -1
- package/dist/mixins/sds-popover-target-mixin.d.ts +1 -1
- package/dist/mixins/sds-popover-target-mixin.d.ts.map +1 -1
- package/dist/mixins/sds-popover-target-mixin.js.map +1 -1
- package/dist/sds-button/sds-button.component.d.ts +1 -1
- package/dist/sds-button/sds-button.component.d.ts.map +1 -1
- package/dist/sds-button/sds-button.component.js.map +1 -1
- package/dist/sds-popover/assets/popover-styles.d.ts.map +1 -1
- package/dist/sds-popover/assets/popover-styles.js +1 -1
- package/dist/sds-popover/assets/popover-styles.js.map +1 -1
- package/dist/shared/assets/positioning.js +1 -1
- package/dist/sheriff-web-components.js +22 -22
- package/package.json +1 -1
- package/web-types.json +5 -9
- package/dist/playwright-util/custom-matchers.d.ts +0 -7
- package/dist/playwright-util/custom-matchers.d.ts.map +0 -1
- package/dist/playwright-util/custom-matchers.js +0 -21
- package/dist/playwright-util/custom-matchers.js.map +0 -1
- package/dist/playwright-util/form.d.ts +0 -3
- package/dist/playwright-util/form.d.ts.map +0 -1
- package/dist/playwright-util/form.js +0 -44
- package/dist/playwright-util/form.js.map +0 -1
- package/dist/sds-button/sds-button.spec.d.ts +0 -2
- package/dist/sds-button/sds-button.spec.d.ts.map +0 -1
- package/dist/sds-button/sds-button.spec.js +0 -182
- package/dist/sds-button/sds-button.spec.js.map +0 -1
- package/dist/sds-checkbox/sds-checkbox.spec.d.ts +0 -2
- package/dist/sds-checkbox/sds-checkbox.spec.d.ts.map +0 -1
- package/dist/sds-checkbox/sds-checkbox.spec.js +0 -74
- package/dist/sds-checkbox/sds-checkbox.spec.js.map +0 -1
- package/dist/sds-dialog/sds-dialog.spec.d.ts +0 -2
- package/dist/sds-dialog/sds-dialog.spec.d.ts.map +0 -1
- package/dist/sds-dialog/sds-dialog.spec.js +0 -64
- package/dist/sds-dialog/sds-dialog.spec.js.map +0 -1
- package/dist/sds-radio/sds-radio.spec.d.ts +0 -2
- package/dist/sds-radio/sds-radio.spec.d.ts.map +0 -1
- package/dist/sds-radio/sds-radio.spec.js +0 -71
- package/dist/sds-radio/sds-radio.spec.js.map +0 -1
- package/dist/sds-textfield/sds-textfield.spec.d.ts +0 -2
- package/dist/sds-textfield/sds-textfield.spec.d.ts.map +0 -1
- package/dist/sds-textfield/sds-textfield.spec.js +0 -137
- package/dist/sds-textfield/sds-textfield.spec.js.map +0 -1
- package/dist/sds-tooltip/sds-tooltip.spec.d.ts +0 -2
- package/dist/sds-tooltip/sds-tooltip.spec.d.ts.map +0 -1
- package/dist/sds-tooltip/sds-tooltip.spec.js +0 -35
- package/dist/sds-tooltip/sds-tooltip.spec.js.map +0 -1
package/custom-elements.json
CHANGED
|
@@ -6646,7 +6646,7 @@
|
|
|
6646
6646
|
"type": {
|
|
6647
6647
|
"text": "string"
|
|
6648
6648
|
},
|
|
6649
|
-
"default": "':host{--_ds-floating:top;--_ds-floating-arrow-size:0;--_ds-floating-arrow-visibility:inherit;animation:ds-fade-in .15s ease-in-out forwards;inset:0 auto auto 0;margin:0;overflow:visible;position:absolute}:host:before{background:inherit;border:inherit;border-left-color:transparent;border-top-color:transparent;box-sizing:border-box;content:\"\";height:var(--_ds-floating-arrow-size);left:var(--_ds-floating-arrow-x,50%);position:absolute;rotate:45deg;top:var(--_ds-floating-arrow-y,100%);translate:-50% -50%;visibility:var(--_ds-floating-arrow-visibility);width:var(--_ds-floating-arrow-size)}:host[data-overscroll=contain]{--_ds-floating-overscroll:contain;overflow:auto;overscroll-behavior:contain}:host{--_ds-floating:var(--dsc-popover-placement);--_ds-floating-arrow-size:var(--dsc-popover-arrow-size);--dsc-popover-background:var(--ds-color-surface-default);--dsc-popover-border-width:var(--ds-border-width-default);--dsc-popover-border-style:solid;--dsc-popover-border-color:var(--ds-color-border-default);--dsc-popover-color:var(--ds-color-text-default);--dsc-popover-arrow-size:var(--ds-size-3);--dsc-popover-border-radius:var(--ds-border-radius-md);--dsc-popover-max-width:300px;--dsc-popover-padding:var(--ds-size-3) var(--ds-size-4);--dsc-popover-box-shadow:var(--ds-shadow-md);--dsc-popover-placement:top;background:var(--dsc-popover-background);border-color:var(--dsc-popover-border-color);border-radius:var(--dsc-popover-border-radius);border-style:var(--dsc-popover-border-style);border-width:var(--dsc-popover-border-width);box-shadow:var(--dsc-popover-box-shadow);box-sizing:border-box;color:var(--dsc-popover-color);max-width:var(--dsc-popover-max-width);padding:var(--dsc-popover-padding);&[data-floating|=top]:before{rotate:45deg;top:100%}&[data-floating|=right]:before{left:0;rotate:135deg}&[data-floating|=bottom]:before{rotate:-135deg;top:0}&[data-floating|=left]:before{left:100%;rotate:-45deg}}:host[data-variant=default]{--dsc-popover-background:var(--ds-color-surface-default)}:host[data-variant=tinted]{--dsc-popover-background:var(--ds-color-surface-tinted)}[data-popover=inline]{all:unset;cursor:pointer;font-size:inherit
|
|
6649
|
+
"default": "':host{--_ds-floating:top;--_ds-floating-arrow-size:0;--_ds-floating-arrow-visibility:inherit;animation:ds-fade-in .15s ease-in-out forwards;inset:0 auto auto 0;margin:0;overflow:visible;position:absolute}:host:before{background:inherit;border:inherit;border-left-color:transparent;border-top-color:transparent;box-sizing:border-box;content:\"\";height:var(--_ds-floating-arrow-size);left:var(--_ds-floating-arrow-x,50%);position:absolute;rotate:45deg;top:var(--_ds-floating-arrow-y,100%);translate:-50% -50%;visibility:var(--_ds-floating-arrow-visibility);width:var(--_ds-floating-arrow-size)}:host[data-overscroll=contain]{--_ds-floating-overscroll:contain;overflow:auto;overscroll-behavior:contain}:host{--_ds-floating:var(--dsc-popover-placement);--_ds-floating-arrow-size:var(--dsc-popover-arrow-size);--dsc-popover-background:var(--ds-color-surface-default);--dsc-popover-border-width:var(--ds-border-width-default);--dsc-popover-border-style:solid;--dsc-popover-border-color:var(--ds-color-border-default);--dsc-popover-color:var(--ds-color-text-default);--dsc-popover-arrow-size:var(--ds-size-3);--dsc-popover-border-radius:var(--ds-border-radius-md);--dsc-popover-max-width:300px;--dsc-popover-padding:var(--ds-size-3) var(--ds-size-4);--dsc-popover-box-shadow:var(--ds-shadow-md);--dsc-popover-placement:top;background:var(--dsc-popover-background);border-color:var(--dsc-popover-border-color);border-radius:var(--dsc-popover-border-radius);border-style:var(--dsc-popover-border-style);border-width:var(--dsc-popover-border-width);box-shadow:var(--dsc-popover-box-shadow);box-sizing:border-box;color:var(--dsc-popover-color);max-width:var(--dsc-popover-max-width);padding:var(--dsc-popover-padding);&[data-floating|=top]:before{rotate:45deg;top:100%}&[data-floating|=right]:before{left:0;rotate:135deg}&[data-floating|=bottom]:before{rotate:-135deg;top:0}&[data-floating|=left]:before{left:100%;rotate:-45deg}}:host[data-variant=default]{--dsc-popover-background:var(--ds-color-surface-default)}:host[data-variant=tinted]{--dsc-popover-background:var(--ds-color-surface-tinted)}[data-popover=inline]{all:unset;cursor:pointer;font-size:inherit;text-decoration:underline dotted;text-underline-offset:.27em}[data-popover=inline]:not([hidden]){display:inline}[data-popover=inline]:focus-visible{box-shadow:var(--_ds--focus,var(--dsc-focus-boxShadow));outline:var(--_ds--focus,var(--dsc-focus-outline));outline-offset:var(--_ds--focus,var(--ds-border-width-focus))}[data-popover=inline]:focus-visible *{--_ds--focus: }'"
|
|
6650
6650
|
}
|
|
6651
6651
|
],
|
|
6652
6652
|
"exports": [
|
|
@@ -2,7 +2,7 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
import { Constructable } from './types';
|
|
3
3
|
export interface SDSPopoverTargetMixinInterface {
|
|
4
4
|
popoverTarget?: string;
|
|
5
|
-
popoverTargetAction?:
|
|
5
|
+
popoverTargetAction?: 'hide' | 'show' | 'toggle';
|
|
6
6
|
}
|
|
7
7
|
export declare function SDSPopoverTargetMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSPopoverTargetMixinInterface> & T;
|
|
8
8
|
//# sourceMappingURL=sds-popover-target-mixin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-popover-target-mixin.d.ts","sourceRoot":"","sources":["../../src/mixins/sds-popover-target-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,8BAA8B;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-popover-target-mixin.d.ts","sourceRoot":"","sources":["../../src/mixins/sds-popover-target-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,8BAA8B;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;CACjD;AAED,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,aAAa,CAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAC,GAAG,aAAa,CAAC,8BAA8B,CAAC,GAAG,CAAC,CA8E3I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-popover-target-mixin.js","sourceRoot":"","sources":["../../src/mixins/sds-popover-target-mixin.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAQ7C,MAAM,UAAU,qBAAqB,CAAsC,UAAa;IACvF,MAAM,gBAAiB,SAAQ,UAAU;QAO/B,OAAO,CAAC,OAAuB;YACvC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YAEvB,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,EAAE,CAAC;gBACx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,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAC;YAC5C,CAAC;QACF,CAAC;KACD;IAzEwD;QAAvD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;2DAAiE;IAC1D;QAA7D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC;iEAA6E;IA0E3I,OAAO,gBAAgB,CAAC;AACzB,CAAC","sourcesContent":["import { LitElement, PropertyValues } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { Constructable } from './types';\n\nexport interface SDSPopoverTargetMixinInterface {\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: 'hide' | 'show' | 'toggle';\n}\n\nexport function SDSPopoverTargetMixin<T extends Constructable<LitElement>>(superClass: T): Constructable<SDSPopoverTargetMixinInterface> & T {\n\tclass SDSPopoverTarget extends superClass {\n\t\t@property({ type: String, attribute: 'popovertarget' }) popoverTarget?: SDSPopoverTargetMixinInterface['popoverTarget'];\n\t\t@property({ type: String, attribute: 'popovertargetaction' }) popoverTargetAction?: SDSPopoverTargetMixinInterface['popoverTargetAction'];\n\n\t\tprivate _popoverElement?: Element;\n\t\tprivate _popoverToggleHandler?: EventListener;\n\n\t\toverride updated(changed: PropertyValues) {\n\t\t\tsuper.updated(changed);\n\n\t\t\tif (changed.has('popoverTarget') || changed.has('popoverTargetAction')) {\n\t\t\t\tthis._updatePopoverTarget();\n\t\t\t}\n\t\t}\n\n\t\toverride disconnectedCallback() {\n\t\t\tsuper.disconnectedCallback();\n\t\t\tthis._cleanupPopoverListener();\n\t\t}\n\n\t\tprivate _cleanupPopoverListener() {\n\t\t\tif (this._popoverToggleHandler && this._popoverElement) {\n\t\t\t\tthis._popoverElement.removeEventListener('toggle', this._popoverToggleHandler);\n\t\t\t\tthis._popoverToggleHandler = undefined;\n\t\t\t\tthis._popoverElement = undefined;\n\t\t\t}\n\t\t}\n\n\t\tprivate _updatePopoverTarget() {\n\t\t\tconst button = this.shadowRoot?.querySelector<HTMLButtonElement>('#control');\n\t\t\tif (!button) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._cleanupPopoverListener();\n\n\t\t\tif (this.popoverTarget) {\n\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\tconst targetElement = root.getElementById?.(this.popoverTarget) ?? document.getElementById(this.popoverTarget);\n\n\t\t\t\tif (targetElement) {\n\t\t\t\t\tbutton.popoverTargetElement = targetElement;\n\t\t\t\t\tthis._popoverElement = targetElement;\n\n\t\t\t\t\tconst targetRole = targetElement.getAttribute('role');\n\n\t\t\t\t\tif (targetRole === 'tooltip') {\n\t\t\t\t\t\tbutton.setAttribute('aria-describedby', this.popoverTarget);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Auto-toggle aria-expanded when the popover opens/closes\n\t\t\t\t\t\tthis._popoverToggleHandler = (e: Event) => {\n\t\t\t\t\t\t\tconst expanded = (e as ToggleEvent).newState === 'open';\n\t\t\t\t\t\t\tbutton.setAttribute('aria-expanded', String(expanded));\n\t\t\t\t\t\t};\n\t\t\t\t\t\ttargetElement.addEventListener('toggle', this._popoverToggleHandler);\n\n\t\t\t\t\t\tbutton.setAttribute('aria-haspopup', targetRole || 'dialog');\n\t\t\t\t\t\tbutton.setAttribute('aria-expanded', 'false');\n\t\t\t\t\t\tbutton.setAttribute('aria-controls', this.popoverTarget);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.popoverTargetAction) {\n\t\t\t\t\tbutton.popoverTargetAction = this.popoverTargetAction;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbutton.popoverTargetElement = null;\n\t\t\t\tbutton.popoverTargetAction = '';\n\t\t\t\tbutton.removeAttribute('aria-haspopup');\n\t\t\t\tbutton.removeAttribute('aria-expanded');\n\t\t\t\tbutton.removeAttribute('aria-controls');\n\t\t\t\tbutton.removeAttribute('aria-describedby');\n\t\t\t}\n\t\t}\n\t}\n\n\treturn SDSPopoverTarget;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sds-button.component.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAIhE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAInD,KAAK,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;AAChD,KAAK,aAAa,GAAG,YAAY,GAAG,UAAU,CAAC;AAC/C,KAAK,UAAU,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxF,KAAK,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAE3D,MAAM,WAAW,cAAc;IAC9B,OAAO,CAAC,EAAE,OAAO,GAAG,eAAe,GAAG,YAAY,CAAC;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"sds-button.component.d.ts","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAiB,MAAM,KAAK,CAAC;AAIhE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAInD,KAAK,UA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Q,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAuB;AACtB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAA0B;AAC1B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAyB;AACxB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAsB;AACrB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAA6B;AAC5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAoB;AACnB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAoC;AACnC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAuC;AAE9D;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAA6B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDS_SIZES, SDS_VARIANTS } from '../types';\nimport { styles } from './sds-button.styles';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSDialogTargetMixin, SDSPopoverTargetMixin } from '../mixins';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = SDS_VARIANTS | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\ntype TargetTypes = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface SDSButtonProps {\n\tcommand?: 'close' | 'request-close' | 'show-modal';\n\tcommandFor?: string;\n\tdisabled?: boolean;\n\tform?: string;\n\thref?: string;\n\ticon?: boolean;\n\tloading?: boolean;\n\tname?: string;\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: string;\n\tsize?: ButtonSize;\n\ttarget?: TargetTypes;\n\ttype?: ButtonType;\n\tvalue?: string;\n\tvariant?: ButtonVariant;\n}\n\nexport class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)))) {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\tstatic override shadowRootOptions: ShadowRootInit = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: Boolean, reflect: true }) icon: boolean = false;\n\t@property({ type: Boolean, reflect: true }) loading: boolean = false;\n\t@property({ type: String, reflect: true }) form?: string;\n\t@property({ type: String, reflect: true }) href?: string;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) size: ButtonSize = 'lg';\n\t@property({ type: String, reflect: true }) target?: TargetTypes;\n\t@property({ type: String, reflect: true }) type: ButtonType = 'button';\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) variant: ButtonVariant = 'primary';\n\t@property({ type: String, reflect: true }) label: string | undefined = undefined;\n\n\t@query('#control') control!: HTMLButtonElement;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\tsuper.updated(changed);\n\n\t\t// Cast critical variant to danger palette to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.setAttribute('data-palette', 'danger');\n\t\t}\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\t// For popover triggers, let the browser handle the toggle natively.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.popoverTarget) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// For dialog commands, emulate the native commandfor/command behavior on the host.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.effectiveCommandFor && this.effectiveCommand) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.runDialogCommand();\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst shouldSubmit = this.dispatchSheriffEvent('submit');\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.requestSubmit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.requestSubmit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst shouldReset = this.dispatchSheriffEvent('reset');\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t}\n\t};\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--as-link': !!this.href,\n\t\t};\n\n\t\tif (this.href) {\n\t\t\treturn html` <a id=\"link\" class=\"${classMap(buttonClasses)}\" href=\"${this.href}\" target=\"${ifDefined(this.target)}\">\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</a>`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t\taria-label=\"${ifDefined(this.label)}\"\n\t\t\t>\n\t\t\t\t${this.loading ? html`<sds-loader slot=\"before\" ?contrast=\"${this.variant !== 'primary'}\"></sds-loader>` : nothing} ${this.loading ? nothing : html`<slot name=\"before\"></slot>`}\n\t\t\t\t<slot></slot>\n\t\t\t\t${this.loading ? nothing : html`<slot name=\"after\"></slot>`}\n\t\t\t</button>\n\t\t`;\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"sds-button.component.js","sourceRoot":"","sources":["../../src/sds-button/sds-button.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAkB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAyB9H,MAAM,OAAO,kBAAmB,SAAQ,oBAAoB,CAAC,qBAAqB,CAAC,2BAA2B,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IA0BpJ;QACC,KAAK,EAAE,CAAC;QAhBmC,aAAQ,GAAY,KAAK,CAAC;QAC1B,SAAI,GAAY,KAAK,CAAC;QACtB,YAAO,GAAY,KAAK,CAAC;QAI1B,SAAI,GAAe,IAAI,CAAC;QAExB,SAAI,GAAe,QAAQ,CAAC;QAC5B,UAAK,GAAW,EAAE,CAAC;QACnB,YAAO,GAAkB,SAAS,CAAC;QACnC,UAAK,GAAuB,SAAS,CAAC;QAkBhE,iBAAY,GAAG,CAAC,KAAiB,EAAE,EAAE;YACrD,oEAAoE;YACpE,+EAA+E;YAC/E,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;gBACxB,KAAK,CAAC,wBAAwB,EAAE,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpB,IAAI,CAAC,oBAAoB,CAAC,OAAO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AE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAe;AACd;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAAyB;AACxB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kDAAsB;AACrB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDAA6B;AAC5B;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAoB;AACnB;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mDAAoC;AACnC;IAA1C,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDAAuC;AAE9D;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAA6B","sourcesContent":["import { LitElement, PropertyValues, html, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { SDS_SIZES, SDS_VARIANTS } from '../types';\nimport { styles } from './sds-button.styles';\nimport { SDSEventDispatcherMixin, SDSDelegateInteractionMixin, SDSDialogTargetMixin, SDSPopoverTargetMixin } from '../mixins';\n\ntype ButtonType = 'button' | 'submit' | 'reset';\ntype ButtonVariant = SDS_VARIANTS | 'critical';\ntype ButtonSize = 'large' | 'medium' | 'small' | Extract<SDS_SIZES, 'lg' | 'md' | 'sm'>;\ntype TargetTypes = '_self' | '_blank' | '_parent' | '_top';\n\nexport interface SDSButtonProps {\n\tcommand?: 'close' | 'request-close' | 'show-modal';\n\tcommandFor?: string;\n\tdisabled?: boolean;\n\tform?: string;\n\thref?: string;\n\ticon?: boolean;\n\tloading?: boolean;\n\tname?: string;\n\tpopoverTarget?: string;\n\tpopoverTargetAction?: 'hide' | 'show' | 'toggle';\n\tsize?: ButtonSize;\n\ttarget?: TargetTypes;\n\ttype?: ButtonType;\n\tvalue?: string;\n\tvariant?: ButtonVariant;\n}\n\nexport class SDSButtonComponent extends SDSDialogTargetMixin(SDSPopoverTargetMixin(SDSDelegateInteractionMixin(SDSEventDispatcherMixin(LitElement)))) {\n\tstatic override styles = [styles];\n\n\tstatic formAssociated = true;\n\tpublic readonly internals: ElementInternals;\n\n\tstatic override shadowRootOptions: ShadowRootInit = {\n\t\t...LitElement.shadowRootOptions,\n\t\tdelegatesFocus: true,\n\t};\n\n\t@property({ type: Boolean, reflect: true }) disabled: boolean = false;\n\t@property({ type: Boolean, reflect: true }) icon: boolean = false;\n\t@property({ type: Boolean, reflect: true }) loading: boolean = false;\n\t@property({ type: String, reflect: true }) form?: string;\n\t@property({ type: String, reflect: true }) href?: string;\n\t@property({ type: String, reflect: true }) name?: string;\n\t@property({ type: String, reflect: true }) size: ButtonSize = 'lg';\n\t@property({ type: String, reflect: true }) target?: TargetTypes;\n\t@property({ type: String, reflect: true }) type: ButtonType = 'button';\n\t@property({ type: String, reflect: true }) value: string = '';\n\t@property({ type: String, reflect: true }) variant: ButtonVariant = 'primary';\n\t@property({ type: String, reflect: true }) label: string | undefined = undefined;\n\n\t@query('#control') control!: HTMLButtonElement;\n\n\tconstructor() {\n\t\tsuper();\n\t\tthis.internals = this.attachInternals();\n\t}\n\n\toverride updated(changed: PropertyValues) {\n\t\tsuper.updated(changed);\n\n\t\t// Cast critical variant to danger palette to prevent breaking changes\n\t\tif (changed.has('variant') && this.variant === 'critical') {\n\t\t\tthis.setAttribute('data-palette', 'danger');\n\t\t}\n\t}\n\n\tprivate readonly _handleClick = (event: MouseEvent) => {\n\t\t// For popover triggers, let the browser handle the toggle natively.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.popoverTarget) {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// For dialog commands, emulate the native commandfor/command behavior on the host.\n\t\t// Stop propagation and re-dispatch a composed click for listeners on the host.\n\t\tif (this.effectiveCommandFor && this.effectiveCommand) {\n\t\t\tevent.preventDefault();\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tif (!this.disabled) {\n\t\t\t\tthis.runDialogCommand();\n\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\t\tevent.stopImmediatePropagation();\n\n\t\tif (!this.disabled) {\n\t\t\tswitch (this.type) {\n\t\t\t\tcase 'submit': {\n\t\t\t\t\tconst shouldSubmit = this.dispatchSheriffEvent('submit');\n\n\t\t\t\t\tif (shouldSubmit) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.requestSubmit();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.requestSubmit();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tcase 'reset': {\n\t\t\t\t\tconst shouldReset = this.dispatchSheriffEvent('reset');\n\n\t\t\t\t\tif (shouldReset) {\n\t\t\t\t\t\tif (this.form) {\n\t\t\t\t\t\t\tconst root = this.getRootNode() as Document | ShadowRoot;\n\t\t\t\t\t\t\tconst formElement: HTMLFormElement | null = root.querySelector(`form#${this.form}`);\n\t\t\t\t\t\t\tformElement?.reset();\n\t\t\t\t\t\t} else if (this.internals.form) {\n\t\t\t\t\t\t\tthis.internals.form.reset();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.dispatchSheriffEvent('click');\n\t\t\t}\n\t\t}\n\t};\n\n\toverride render() {\n\t\tconst buttonClasses = {\n\t\t\t'sds-button': true,\n\t\t\t'sds-button--as-link': !!this.href,\n\t\t};\n\n\t\tif (this.href) {\n\t\t\treturn html` <a id=\"link\" class=\"${classMap(buttonClasses)}\" href=\"${this.href}\" target=\"${ifDefined(this.target)}\">\n\t\t\t\t<slot name=\"before\"></slot>\n\t\t\t\t<slot></slot>\n\t\t\t\t<slot name=\"after\"></slot>\n\t\t\t</a>`;\n\t\t}\n\n\t\treturn html`\n\t\t\t<button\n\t\t\t\tid=\"control\"\n\t\t\t\tform=\"${ifDefined(this.form)}\"\n\t\t\t\tclass=\"${classMap(buttonClasses)}\"\n\t\t\t\ttype=\"${this.type}\"\n\t\t\t\tname=\"${ifDefined(this.name)}\"\n\t\t\t\tvalue=\"${ifDefined(this.value)}\"\n\t\t\t\t?disabled=\"${this.disabled}\"\n\t\t\t\t@click=\"${this._handleClick}\"\n\t\t\t\taria-label=\"${ifDefined(this.label)}\"\n\t\t\t>\n\t\t\t\t${this.loading ? html`<sds-loader slot=\"before\" ?contrast=\"${this.variant !== 'primary'}\"></sds-loader>` : nothing} ${this.loading ? nothing : html`<slot name=\"before\"></slot>`}\n\t\t\t\t<slot></slot>\n\t\t\t\t${this.loading ? nothing : html`<slot name=\"after\"></slot>`}\n\t\t\t</button>\n\t\t`;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-styles.d.ts","sourceRoot":"","sources":["../../../src/sds-popover/assets/popover-styles.ts"],"names":[],"mappings":"AAAA,QAAA,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"popover-styles.d.ts","sourceRoot":"","sources":["../../../src/sds-popover/assets/popover-styles.ts"],"names":[],"mappings":"AAAA,QAAA,IAAI,CAAC,QAA29E,CAAC;AAAA,OAAM,EAAC,CAAC,IAAI,OAAO,EAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var o = ':host{--_ds-floating:top;--_ds-floating-arrow-size:0;--_ds-floating-arrow-visibility:inherit;animation:ds-fade-in .15s ease-in-out forwards;inset:0 auto auto 0;margin:0;overflow:visible;position:absolute}:host:before{background:inherit;border:inherit;border-left-color:transparent;border-top-color:transparent;box-sizing:border-box;content:"";height:var(--_ds-floating-arrow-size);left:var(--_ds-floating-arrow-x,50%);position:absolute;rotate:45deg;top:var(--_ds-floating-arrow-y,100%);translate:-50% -50%;visibility:var(--_ds-floating-arrow-visibility);width:var(--_ds-floating-arrow-size)}:host[data-overscroll=contain]{--_ds-floating-overscroll:contain;overflow:auto;overscroll-behavior:contain}:host{--_ds-floating:var(--dsc-popover-placement);--_ds-floating-arrow-size:var(--dsc-popover-arrow-size);--dsc-popover-background:var(--ds-color-surface-default);--dsc-popover-border-width:var(--ds-border-width-default);--dsc-popover-border-style:solid;--dsc-popover-border-color:var(--ds-color-border-default);--dsc-popover-color:var(--ds-color-text-default);--dsc-popover-arrow-size:var(--ds-size-3);--dsc-popover-border-radius:var(--ds-border-radius-md);--dsc-popover-max-width:300px;--dsc-popover-padding:var(--ds-size-3) var(--ds-size-4);--dsc-popover-box-shadow:var(--ds-shadow-md);--dsc-popover-placement:top;background:var(--dsc-popover-background);border-color:var(--dsc-popover-border-color);border-radius:var(--dsc-popover-border-radius);border-style:var(--dsc-popover-border-style);border-width:var(--dsc-popover-border-width);box-shadow:var(--dsc-popover-box-shadow);box-sizing:border-box;color:var(--dsc-popover-color);max-width:var(--dsc-popover-max-width);padding:var(--dsc-popover-padding);&[data-floating|=top]:before{rotate:45deg;top:100%}&[data-floating|=right]:before{left:0;rotate:135deg}&[data-floating|=bottom]:before{rotate:-135deg;top:0}&[data-floating|=left]:before{left:100%;rotate:-45deg}}:host[data-variant=default]{--dsc-popover-background:var(--ds-color-surface-default)}:host[data-variant=tinted]{--dsc-popover-background:var(--ds-color-surface-tinted)}[data-popover=inline]{all:unset;cursor:pointer;font-size:inherit
|
|
1
|
+
var o = ':host{--_ds-floating:top;--_ds-floating-arrow-size:0;--_ds-floating-arrow-visibility:inherit;animation:ds-fade-in .15s ease-in-out forwards;inset:0 auto auto 0;margin:0;overflow:visible;position:absolute}:host:before{background:inherit;border:inherit;border-left-color:transparent;border-top-color:transparent;box-sizing:border-box;content:"";height:var(--_ds-floating-arrow-size);left:var(--_ds-floating-arrow-x,50%);position:absolute;rotate:45deg;top:var(--_ds-floating-arrow-y,100%);translate:-50% -50%;visibility:var(--_ds-floating-arrow-visibility);width:var(--_ds-floating-arrow-size)}:host[data-overscroll=contain]{--_ds-floating-overscroll:contain;overflow:auto;overscroll-behavior:contain}:host{--_ds-floating:var(--dsc-popover-placement);--_ds-floating-arrow-size:var(--dsc-popover-arrow-size);--dsc-popover-background:var(--ds-color-surface-default);--dsc-popover-border-width:var(--ds-border-width-default);--dsc-popover-border-style:solid;--dsc-popover-border-color:var(--ds-color-border-default);--dsc-popover-color:var(--ds-color-text-default);--dsc-popover-arrow-size:var(--ds-size-3);--dsc-popover-border-radius:var(--ds-border-radius-md);--dsc-popover-max-width:300px;--dsc-popover-padding:var(--ds-size-3) var(--ds-size-4);--dsc-popover-box-shadow:var(--ds-shadow-md);--dsc-popover-placement:top;background:var(--dsc-popover-background);border-color:var(--dsc-popover-border-color);border-radius:var(--dsc-popover-border-radius);border-style:var(--dsc-popover-border-style);border-width:var(--dsc-popover-border-width);box-shadow:var(--dsc-popover-box-shadow);box-sizing:border-box;color:var(--dsc-popover-color);max-width:var(--dsc-popover-max-width);padding:var(--dsc-popover-padding);&[data-floating|=top]:before{rotate:45deg;top:100%}&[data-floating|=right]:before{left:0;rotate:135deg}&[data-floating|=bottom]:before{rotate:-135deg;top:0}&[data-floating|=left]:before{left:100%;rotate:-45deg}}:host[data-variant=default]{--dsc-popover-background:var(--ds-color-surface-default)}:host[data-variant=tinted]{--dsc-popover-background:var(--ds-color-surface-tinted)}[data-popover=inline]{all:unset;cursor:pointer;font-size:inherit;text-decoration:underline dotted;text-underline-offset:.27em}[data-popover=inline]:not([hidden]){display:inline}[data-popover=inline]:focus-visible{box-shadow:var(--_ds--focus,var(--dsc-focus-boxShadow));outline:var(--_ds--focus,var(--dsc-focus-outline));outline-offset:var(--_ds--focus,var(--ds-border-width-focus))}[data-popover=inline]:focus-visible *{--_ds--focus: }';
|
|
2
2
|
export { o as default };
|
|
3
3
|
//# sourceMappingURL=popover-styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover-styles.js","sourceRoot":"","sources":["../../../src/sds-popover/assets/popover-styles.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAC,
|
|
1
|
+
{"version":3,"file":"popover-styles.js","sourceRoot":"","sources":["../../../src/sds-popover/assets/popover-styles.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAC,09EAA09E,CAAC;AAAA,OAAM,EAAC,CAAC,IAAI,OAAO,EAAC,CAAC","sourcesContent":["var o=':host{--_ds-floating:top;--_ds-floating-arrow-size:0;--_ds-floating-arrow-visibility:inherit;animation:ds-fade-in .15s ease-in-out forwards;inset:0 auto auto 0;margin:0;overflow:visible;position:absolute}:host:before{background:inherit;border:inherit;border-left-color:transparent;border-top-color:transparent;box-sizing:border-box;content:\"\";height:var(--_ds-floating-arrow-size);left:var(--_ds-floating-arrow-x,50%);position:absolute;rotate:45deg;top:var(--_ds-floating-arrow-y,100%);translate:-50% -50%;visibility:var(--_ds-floating-arrow-visibility);width:var(--_ds-floating-arrow-size)}:host[data-overscroll=contain]{--_ds-floating-overscroll:contain;overflow:auto;overscroll-behavior:contain}:host{--_ds-floating:var(--dsc-popover-placement);--_ds-floating-arrow-size:var(--dsc-popover-arrow-size);--dsc-popover-background:var(--ds-color-surface-default);--dsc-popover-border-width:var(--ds-border-width-default);--dsc-popover-border-style:solid;--dsc-popover-border-color:var(--ds-color-border-default);--dsc-popover-color:var(--ds-color-text-default);--dsc-popover-arrow-size:var(--ds-size-3);--dsc-popover-border-radius:var(--ds-border-radius-md);--dsc-popover-max-width:300px;--dsc-popover-padding:var(--ds-size-3) var(--ds-size-4);--dsc-popover-box-shadow:var(--ds-shadow-md);--dsc-popover-placement:top;background:var(--dsc-popover-background);border-color:var(--dsc-popover-border-color);border-radius:var(--dsc-popover-border-radius);border-style:var(--dsc-popover-border-style);border-width:var(--dsc-popover-border-width);box-shadow:var(--dsc-popover-box-shadow);box-sizing:border-box;color:var(--dsc-popover-color);max-width:var(--dsc-popover-max-width);padding:var(--dsc-popover-padding);&[data-floating|=top]:before{rotate:45deg;top:100%}&[data-floating|=right]:before{left:0;rotate:135deg}&[data-floating|=bottom]:before{rotate:-135deg;top:0}&[data-floating|=left]:before{left:100%;rotate:-45deg}}:host[data-variant=default]{--dsc-popover-background:var(--ds-color-surface-default)}:host[data-variant=tinted]{--dsc-popover-background:var(--ds-color-surface-tinted)}[data-popover=inline]{all:unset;cursor:pointer;font-size:inherit;text-decoration:underline dotted;text-underline-offset:.27em}[data-popover=inline]:not([hidden]){display:inline}[data-popover=inline]:focus-visible{box-shadow:var(--_ds--focus,var(--dsc-focus-boxShadow));outline:var(--_ds--focus,var(--dsc-focus-outline));outline-offset:var(--_ds--focus,var(--ds-border-width-focus))}[data-popover=inline]:focus-visible *{--_ds--focus: }';export{o as default};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={passive:!0,capture:!0},e=(t,e,n)=>void 0===n?t.getAttribute(e)??null:(null===n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),n=(t,...e)=>{let[n,...i]=e;for(let e of n.split(" "))t.addEventListener(e,...i);return()=>o(t,...e)},o=(t,...e)=>{let[n,...o]=e;for(let e of n.split(" "))t.removeEventListener(e,...o)};Date.now().toString(36),Math.random().toString(36).slice(2,5);const i=Math.min,r=Math.max,l=Math.round,s=Math.floor,a=t=>({x:t,y:t}),c={left:"right",right:"left",bottom:"top",top:"bottom"},f={start:"end",end:"start"};function u(t,e,n){return r(t,i(e,n))}function d(t,e){return"function"==typeof t?t(e):t}function h(t){return t.split("-")[0]}function m(t){return t.split("-")[1]}function p(t){return"x"===t?"y":"x"}function g(t){return"y"===t?"height":"width"}const y=new Set(["top","bottom"]);function w(t){return y.has(h(t))?"y":"x"}function x(t){return p(w(t))}function v(t){return t.replace(/start|end/g,t=>f[t])}const b=["left","right"],R=["right","left"],A=["top","bottom"],L=["bottom","top"];function T(t,e,n,o){const i=m(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?R:b:e?b:R;case"left":case"right":return e?A:L;default:return[]}}(h(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(v)))),r}function S(t){return t.replace(/left|right|bottom|top/g,t=>c[t])}function E(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function C(t,e,n){let{reference:o,floating:i}=t;const r=w(e),l=x(e),s=g(l),a=h(e),c="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[s]/2-i[s]/2;let p;switch(a){case"top":p={x:f,y:o.y-i.height};break;case"bottom":p={x:f,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:u};break;case"left":p={x:o.x-i.width,y:u};break;default:p={x:o.x,y:o.y}}switch(m(e)){case"start":p[l]-=d*(n&&c?-1:1);break;case"end":p[l]+=d*(n&&c?-1:1)}return p}async function D(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:m=0}=d(e,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(m),g=s[h?"floating"===u?"reference":"floating":u],y=E(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:a})),w="floating"===u?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},b=E(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:x,strategy:a}):w);return{top:(y.top-b.top+p.top)/v.y,bottom:(b.bottom-y.bottom+p.bottom)/v.y,left:(y.left-b.left+p.left)/v.x,right:(b.right-y.right+p.right)/v.x}}const O=new Set(["left","top"]);function P(){return"undefined"!=typeof window}function H(t){return W(t)?(t.nodeName||"").toLowerCase():"#document"}function F(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function M(t){var e;return null==(e=(W(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function W(t){return!!P()&&(t instanceof Node||t instanceof F(t).Node)}function k(t){return!!P()&&(t instanceof Element||t instanceof F(t).Element)}function B(t){return!!P()&&(t instanceof HTMLElement||t instanceof F(t).HTMLElement)}function $(t){return!(!P()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof F(t).ShadowRoot)}const V=new Set(["inline","contents"]);function _(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=U(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!V.has(i)}const z=new Set(["table","td","th"]);function N(t){return z.has(H(t))}const q=[":popover-open",":modal"];function I(t){return q.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const j=["transform","translate","scale","rotate","perspective"],X=["transform","translate","scale","rotate","perspective","filter"],Y=["paint","layout","strict","content"];function G(t){const e=J(),n=k(t)?U(t):t;return j.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||X.some(t=>(n.willChange||"").includes(t))||Y.some(t=>(n.contain||"").includes(t))}function J(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const K=new Set(["html","body","#document"]);function Q(t){return K.has(H(t))}function U(t){return F(t).getComputedStyle(t)}function Z(t){return k(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function tt(t){if("html"===H(t))return t;const e=t.assignedSlot||t.parentNode||$(t)&&t.host||M(t);return $(e)?e.host:e}function et(t){const e=tt(t);return Q(e)?t.ownerDocument?t.ownerDocument.body:t.body:B(e)&&_(e)?e:et(e)}function nt(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=et(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=F(i);if(r){const t=ot(l);return e.concat(l,l.visualViewport||[],_(i)?i:[],t&&n?nt(t):[])}return e.concat(i,nt(i,[],n))}function ot(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function it(t){const e=U(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=B(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,a=l(n)!==r||l(o)!==s;return a&&(n=r,o=s),{width:n,height:o,$:a}}function rt(t){return k(t)?t:t.contextElement}function lt(t){const e=rt(t);if(!B(e))return a(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=it(e);let s=(r?l(n.width):n.width)/o,c=(r?l(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),c&&Number.isFinite(c)||(c=1),{x:s,y:c}}const st=a(0);function at(t){const e=F(t);return J()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:st}function ct(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=rt(t);let l=a(1);e&&(o?k(o)&&(l=lt(o)):l=lt(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==F(t))&&e}(r,n,o)?at(r):a(0);let c=(i.left+s.x)/l.x,f=(i.top+s.y)/l.y,u=i.width/l.x,d=i.height/l.y;if(r){const t=F(r),e=o&&k(o)?F(o):o;let n=t,i=ot(n);for(;i&&o&&e!==n;){const t=lt(i),e=i.getBoundingClientRect(),o=U(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,f*=t.y,u*=t.x,d*=t.y,c+=r,f+=l,n=F(i),i=ot(n)}}return E({width:u,height:d,x:c,y:f})}function ft(t,e){const n=Z(t).scrollLeft;return e?e.left+n:ct(M(t)).left+n}function ut(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-ft(t,n),y:n.top+e.scrollTop}}const dt=new Set(["absolute","fixed"]);function ht(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=F(t),o=M(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const t=J();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,a=i.offsetTop)}const c=ft(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(r-=l)}else c<=25&&(r+=c);return{width:r,height:l,x:s,y:a}}(t,n);else if("document"===e)o=function(t){const e=M(t),n=Z(t),o=t.ownerDocument.body,i=r(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=r(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ft(t);const a=-n.scrollTop;return"rtl"===U(o).direction&&(s+=r(e.clientWidth,o.clientWidth)-i),{width:i,height:l,x:s,y:a}}(M(t));else if(k(e))o=function(t,e){const n=ct(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=B(t)?lt(t):a(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=at(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return E(o)}function mt(t,e){const n=tt(t);return!(n===e||!k(n)||Q(n))&&("fixed"===U(n).position||mt(n,e))}function pt(t,e,n){const o=B(e),i=M(e),r="fixed"===n,l=ct(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const c=a(0);function f(){c.x=ft(i)}if(o||!o&&!r)if(("body"!==H(e)||_(i))&&(s=Z(e)),o){const t=ct(e,!0,r,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&f();r&&!o&&i&&f();const u=!i||o||r?a(0):ut(i,s);return{x:l.left+s.scrollLeft-c.x-u.x,y:l.top+s.scrollTop-c.y-u.y,width:l.width,height:l.height}}function gt(t){return"static"===U(t).position}function yt(t,e){if(!B(t)||"fixed"===U(t).position)return null;if(e)return e(t);let n=t.offsetParent;return M(t)===n&&(n=n.ownerDocument.body),n}function wt(t,e){const n=F(t);if(I(t))return n;if(!B(t)){let e=tt(t);for(;e&&!Q(e);){if(k(e)&&!gt(e))return e;e=tt(e)}return n}let o=yt(t,e);for(;o&&N(o)&>(o);)o=yt(o,e);return o&&Q(o)&>(o)&&!G(o)?n:o||function(t){let e=tt(t);for(;B(e)&&!Q(e);){if(G(e))return e;if(I(e))return null;e=tt(e)}return null}(t)||n}const xt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=M(o),s=!!e&&I(e.floating);if(o===l||s&&r)return n;let c={scrollLeft:0,scrollTop:0},f=a(1);const u=a(0),d=B(o);if((d||!d&&!r)&&(("body"!==H(o)||_(l))&&(c=Z(o)),B(o))){const t=ct(o);f=lt(o),u.x=t.x+o.clientLeft,u.y=t.y+o.clientTop}const h=!l||d||r?a(0):ut(l,c);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-c.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-c.scrollTop*f.y+u.y+h.y}},getDocumentElement:M,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:l}=t;const s=[..."clippingAncestors"===n?I(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=nt(t,[],!1).filter(t=>k(t)&&"body"!==H(t)),i=null;const r="fixed"===U(t).position;let l=r?tt(t):t;for(;k(l)&&!Q(l);){const e=U(l),n=G(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&dt.has(i.position)||_(l)&&!n&&mt(t,l))?o=o.filter(t=>t!==l):i=e,l=tt(l)}return e.set(t,o),o}(e,this._c):[].concat(n),o],a=s[0],c=s.reduce((t,n)=>{const o=ht(e,n,l);return t.top=r(o.top,t.top),t.right=i(o.right,t.right),t.bottom=i(o.bottom,t.bottom),t.left=r(o.left,t.left),t},ht(e,a,l));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:wt,getElementRects:async function(t){const e=this.getOffsetParent||wt,n=this.getDimensions,o=await n(t.floating);return{reference:pt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=it(t);return{width:e,height:n}},getScale:lt,isElement:k,isRTL:function(t){return"rtl"===U(t).direction}};function vt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function bt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:a=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:f="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,d=rt(t),h=l||a?[...d?nt(d):[],...nt(e)]:[];h.forEach(t=>{l&&t.addEventListener("scroll",n,{passive:!0}),a&&t.addEventListener("resize",n)});const m=d&&f?function(t,e){let n,o=null;const l=M(t);function a(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function c(f,u){void 0===f&&(f=!1),void 0===u&&(u=1),a();const d=t.getBoundingClientRect(),{left:h,top:m,width:p,height:g}=d;if(f||e(),!p||!g)return;const y={rootMargin:-s(m)+"px "+-s(l.clientWidth-(h+p))+"px "+-s(l.clientHeight-(m+g))+"px "+-s(h)+"px",threshold:r(0,i(1,u))||1};let w=!0;function x(e){const o=e[0].intersectionRatio;if(o!==u){if(!w)return c();o?c(!1,o):n=setTimeout(()=>{c(!1,1e-7)},1e3)}1!==o||vt(d,t.getBoundingClientRect())||c(),w=!1}try{o=new IntersectionObserver(x,{...y,root:l.ownerDocument})}catch(t){o=new IntersectionObserver(x,y)}o.observe(t)}(!0),a}(d,n):null;let p,g=-1,y=null;c&&(y=new ResizeObserver(t=>{let[o]=t;o&&o.target===d&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var t;null==(t=y)||t.observe(e)})),n()}),d&&!u&&y.observe(d),y.observe(e));let w=u?ct(t):null;return u&&function e(){const o=ct(t);w&&!vt(w,o)&&n();w=o,p=requestAnimationFrame(e)}(),n(),()=>{var t;h.forEach(t=>{l&&t.removeEventListener("scroll",n),a&&t.removeEventListener("resize",n)}),null==m||m(),null==(t=y)||t.disconnect(),y=null,u&&cancelAnimationFrame(p)}}const Rt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=h(n),s=m(n),a="y"===w(n),c=O.has(l)?-1:1,f=r&&a?-1:1,u=d(e,t);let{mainAxis:p,crossAxis:g,alignmentAxis:y}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof y&&(g="end"===s?-1*y:y),a?{x:g*f,y:p*c}:{x:p*c,y:g*f}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},At=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:l=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=d(t,e),f={x:n,y:o},m=await r.detectOverflow(e,c),g=w(h(i)),y=p(g);let x=f[y],v=f[g];if(l){const t="y"===y?"bottom":"right";x=u(x+m["y"===y?"top":"left"],x,x-m[t])}if(s){const t="y"===g?"bottom":"right";v=u(v+m["y"===g?"top":"left"],v,v-m[t])}const b=a.fn({...e,[y]:x,[g]:v});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[y]:l,[g]:s}}}}}},Lt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:R=!0,...A}=d(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=h(i),E=w(s),C=h(s)===s,D=await(null==a.isRTL?void 0:a.isRTL(c.floating)),O=p||(C||!R?[S(s)]:function(t){const e=S(t);return[v(t),e,v(e)]}(s)),P="none"!==b;!p&&P&&O.push(...T(s,R,b,D));const H=[s,...O],F=await a.detectOverflow(e,A),M=[];let W=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&M.push(F[L]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=m(t),i=x(t),r=g(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=S(l)),[l,S(l)]}(i,l,D);M.push(F[t[0]],F[t[1]])}if(W=[...W,{placement:i,overflows:M}],!M.every(t=>t<=0)){var k,B;const t=((null==(k=r.flip)?void 0:k.index)||0)+1,e=H[t];if(e){if(!("alignment"===u&&E!==w(e))||W.every(t=>w(t.placement)!==E||t.overflows[0]>0))return{data:{index:t,overflows:W},reset:{placement:e}}}let n=null==(B=W.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:B.placement;if(!n)switch(y){case"bestFit":{var $;const t=null==($=W.filter(t=>{if(P){const e=w(t.placement);return e===E||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:$[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},Tt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:l,rects:s,platform:a,elements:c}=e,{apply:f=()=>{},...u}=d(t,e),p=await a.detectOverflow(e,u),g=h(l),y=m(l),x="y"===w(l),{width:v,height:b}=s.floating;let R,A;"top"===g||"bottom"===g?(R=g,A=y===(await(null==a.isRTL?void 0:a.isRTL(c.floating))?"start":"end")?"left":"right"):(A=g,R="end"===y?"top":"bottom");const L=b-p.top-p.bottom,T=v-p.left-p.right,S=i(b-p[R],L),E=i(v-p[A],T),C=!e.middlewareData.shift;let D=S,O=E;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(O=T),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(D=L),C&&!y){const t=r(p.left,0),e=r(p.right,0),n=r(p.top,0),o=r(p.bottom,0);x?O=v-2*(0!==t||0!==e?t+e:r(p.left,p.right)):D=b-2*(0!==n||0!==o?n+o:r(p.top,p.bottom))}await f({...e,availableWidth:O,availableHeight:D});const P=await a.getDimensions(c.floating);return v!==P.width||b!==P.height?{reset:{rects:!0}}:{}}}},St=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=e,{offset:s=0,mainAxis:a=!0,crossAxis:c=!0}=d(t,e),f={x:n,y:o},u=w(i),m=p(u);let g=f[m],y=f[u];const x=d(s,e),v="number"==typeof x?{mainAxis:x,crossAxis:0}:{mainAxis:0,crossAxis:0,...x};if(a){const t="y"===m?"height":"width",e=r.reference[m]-r.floating[t]+v.mainAxis,n=r.reference[m]+r.reference[t]-v.mainAxis;g<e?g=e:g>n&&(g=n)}if(c){var b,R;const t="y"===m?"width":"height",e=O.has(h(i)),n=r.reference[u]-r.floating[t]+(e&&(null==(b=l.offset)?void 0:b[u])||0)+(e?0:v.crossAxis),o=r.reference[u]+r.reference[t]+(e?0:(null==(R=l.offset)?void 0:R[u])||0)-(e?v.crossAxis:0);y<n?y=n:y>o&&(y=o)}return{[m]:g,[u]:y}}}},Et=(t,e,n)=>{const o=new Map,i={platform:xt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=C(c,o,a),d=o,h={},m=0;for(let n=0;n<s.length;n++){var p;const{name:r,fn:g}=s[n],{x:y,y:w,data:x,reset:v}=await g({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:h,rects:c,platform:{...l,detectOverflow:null!=(p=l.detectOverflow)?p:D},elements:{reference:t,floating:e}});f=null!=y?y:f,u=null!=w?w:u,h={...h,[r]:{...h[r],...x}},v&&m<=50&&(m++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(c=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):v.rects),({x:f,y:u}=C(c,d,a))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:h}})(t,e,{...i,platform:r})},Ct="data-placement",Dt="data-autoplacement",Ot=new Map;function Pt(t){let{newState:n,oldState:o,target:i,source:r=t.detail}=t,l=i instanceof HTMLElement&&Mt(i,"--_ds-floating");if(!l)return;if("closed"===n)return Ot.get(i)?.();if(!r){let t=i.getRootNode(),e=`[popovertarget="${i.id}"],[commandfor="${i.id}"]`;r=i.id&&t?.querySelector?.(e)||void 0}if(!r||r===i||o&&o===n)return;let s=Mt(i,"--_ds-floating-overscroll"),a=e(i,Ct)||e(r,Ct)||l,c=e(i,Dt)||e(r,Dt),f=parseFloat(getComputedStyle(i,"::before").height)||0,u=a.match(/left|right/gi)?"Height":"Width",d=r[`offset${u}`]/2+f;if("none"===a)return;let h={strategy:"absolute",placement:a,middleware:[Rt(f||0),At({padding:10,limiter:St({offset:{mainAxis:d}})}),Wt(),..."false"===c?[]:[Lt({padding:10,crossAxis:!1})],...s?[Tt({apply({availableHeight:t}){"fit"===s&&(i.style.width=`${r.clientWidth}px`),i.style.maxHeight=`${Math.max(50,t-20)}px`}})]:[]]},m=bt(r,i,async()=>{if(!r?.isConnected)return Ot.get(i)?.();let{x:t,y:e}=await Et(r,i,h);i.style.translate=`${t}px ${e}px`});Ot.set(i,()=>Ot.delete(i)&&m())}let Ht;const Ft=({type:t})=>{if("mousedown"===t&&(Ht=!1),"scroll"===t&&!1===Ht&&(Ht=!0),"mouseup"===t&&Ht)for(let[t]of Ot)t.showPopover()};((t,e)=>{typeof window<"u"&&typeof document<"u"&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(t)?.map(t=>t()),window._dsHotReloadCleanup?.set(t,e()))})("popover",()=>[n(document,"mousedown scroll mouseup",Ft,!0),n(document,"toggle ds-toggle-source",Pt,t)]);const Mt=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),Wt=()=>({name:"arrowPseudo",fn(t){let n=t.elements.floating,o=t.rects.reference,i=`${Math.round(o.width/2+o.x-t.x)}px`,r=`${Math.round(o.height/2+o.y-t.y)}px`;return n.style.setProperty("--_ds-floating-arrow-x",i),n.style.setProperty("--_ds-floating-arrow-y",r),e(n,"data-floating",t.placement),t}});
|
|
1
|
+
const t={passive:!0,capture:!0},e=(t,e,n)=>void 0===n?t.getAttribute(e)??null:(null===n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n),null),n=(t,e)=>getComputedStyle(t).getPropertyValue(e).trim(),o=(t,...e)=>{let[n,...o]=e;for(let e of n.split(" "))t.addEventListener(e,...o);return()=>i(t,...e)},i=(t,...e)=>{let[n,...o]=e;for(let e of n.split(" "))t.removeEventListener(e,...o)},r=(t,e)=>{typeof window<"u"&&typeof document<"u"&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(t)?.map(t=>t()),window._dsHotReloadCleanup?.set(t,e()))};let l;const s=()=>{"complete"===document.readyState&&(l||(l=((t,n)=>{let o=document.createElement(t);if(n)for(let[t,i]of Object.entries(n))e(o,t,i);return o})("div",{"aria-live":"assertive"}),l.style.overflow="hidden",l.style.position="fixed",l.style.whiteSpace="nowrap",l.style.width="1px"),l.isConnected||document.body.appendChild(l))};r("announce",()=>[o(document,"focus mouseover",s,t)]);const c=Math.min,a=Math.max,f=Math.round,u=Math.floor,d=t=>({x:t,y:t}),h={left:"right",right:"left",bottom:"top",top:"bottom"};function p(t,e,n){return a(t,c(e,n))}function m(t,e){return"function"==typeof t?t(e):t}function g(t){return t.split("-")[0]}function y(t){return t.split("-")[1]}function w(t){return"x"===t?"y":"x"}function x(t){return"y"===t?"height":"width"}function v(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function b(t){return w(v(t))}function R(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const A=["left","right"],L=["right","left"],T=["top","bottom"],C=["bottom","top"];function E(t,e,n,o){const i=y(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?L:A:e?A:L;case"left":case"right":return e?T:C;default:return[]}}(g(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(R)))),r}function S(t){const e=g(t);return h[e]+t.slice(e.length)}function D(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function O(t,e,n){let{reference:o,floating:i}=t;const r=v(e),l=b(e),s=x(l),c=g(e),a="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,d=o[s]/2-i[s]/2;let h;switch(c){case"top":h={x:f,y:o.y-i.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:u};break;case"left":h={x:o.x-i.width,y:u};break;default:h={x:o.x,y:o.y}}switch(y(e)){case"start":h[l]-=d*(n&&a?-1:1);break;case"end":h[l]+=d*(n&&a?-1:1)}return h}async function P(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:h=0}=m(e,t),p=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(h),g=s[d?"floating"===u?"reference":"floating":u],y=D(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(g)))||n?g:g.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:a,rootBoundary:f,strategy:c})),w="floating"===u?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,x=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),v=await(null==r.isElement?void 0:r.isElement(x))&&await(null==r.getScale?void 0:r.getScale(x))||{x:1,y:1},b=D(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-b.top+p.top)/v.y,bottom:(b.bottom-y.bottom+p.bottom)/v.y,left:(y.left-b.left+p.left)/v.x,right:(b.right-y.right+p.right)/v.x}}const H=new Set(["left","top"]);function F(){return"undefined"!=typeof window}function M(t){return k(t)?(t.nodeName||"").toLowerCase():"#document"}function W(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function $(t){var e;return null==(e=(k(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function k(t){return!!F()&&(t instanceof Node||t instanceof W(t).Node)}function B(t){return!!F()&&(t instanceof Element||t instanceof W(t).Element)}function V(t){return!!F()&&(t instanceof HTMLElement||t instanceof W(t).HTMLElement)}function _(t){return!(!F()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof W(t).ShadowRoot)}function z(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=Q(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function N(t){return/^(table|td|th)$/.test(M(t))}function j(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const q=/transform|translate|scale|rotate|perspective|filter/,I=/paint|layout|strict|content/,X=t=>!!t&&"none"!==t;let Y;function G(t){const e=B(t)?Q(t):t;return X(e.transform)||X(e.translate)||X(e.scale)||X(e.rotate)||X(e.perspective)||!J()&&(X(e.backdropFilter)||X(e.filter))||q.test(e.willChange||"")||I.test(e.contain||"")}function J(){return null==Y&&(Y="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Y}function K(t){return/^(html|body|#document)$/.test(M(t))}function Q(t){return W(t).getComputedStyle(t)}function U(t){return B(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Z(t){if("html"===M(t))return t;const e=t.assignedSlot||t.parentNode||_(t)&&t.host||$(t);return _(e)?e.host:e}function tt(t){const e=Z(t);return K(e)?t.ownerDocument?t.ownerDocument.body:t.body:V(e)&&z(e)?e:tt(e)}function et(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=tt(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=W(i);if(r){const t=nt(l);return e.concat(l,l.visualViewport||[],z(i)?i:[],t&&n?et(t):[])}return e.concat(i,et(i,[],n))}function nt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ot(t){const e=Q(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=V(t),r=i?t.offsetWidth:n,l=i?t.offsetHeight:o,s=f(n)!==r||f(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function it(t){return B(t)?t:t.contextElement}function rt(t){const e=it(t);if(!V(e))return d(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ot(e);let l=(r?f(n.width):n.width)/o,s=(r?f(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const lt=d(0);function st(t){const e=W(t);return J()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:lt}function ct(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=it(t);let l=d(1);e&&(o?B(o)&&(l=rt(o)):l=rt(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==W(t))&&e}(r,n,o)?st(r):d(0);let c=(i.left+s.x)/l.x,a=(i.top+s.y)/l.y,f=i.width/l.x,u=i.height/l.y;if(r){const t=W(r),e=o&&B(o)?W(o):o;let n=t,i=nt(n);for(;i&&o&&e!==n;){const t=rt(i),e=i.getBoundingClientRect(),o=Q(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;c*=t.x,a*=t.y,f*=t.x,u*=t.y,c+=r,a+=l,n=W(i),i=nt(n)}}return D({width:f,height:u,x:c,y:a})}function at(t,e){const n=U(t).scrollLeft;return e?e.left+n:ct($(t)).left+n}function ft(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-at(t,n),y:n.top+e.scrollTop}}function ut(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=W(t),o=$(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,c=0;if(i){r=i.width,l=i.height;const t=J();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,c=i.offsetTop)}const a=at(o);if(a<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(r-=l)}else a<=25&&(r+=a);return{width:r,height:l,x:s,y:c}}(t,n);else if("document"===e)o=function(t){const e=$(t),n=U(t),o=t.ownerDocument.body,i=a(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=a(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+at(t);const s=-n.scrollTop;return"rtl"===Q(o).direction&&(l+=a(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}($(t));else if(B(e))o=function(t,e){const n=ct(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=V(t)?rt(t):d(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=st(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return D(o)}function dt(t,e){const n=Z(t);return!(n===e||!B(n)||K(n))&&("fixed"===Q(n).position||dt(n,e))}function ht(t,e,n){const o=V(e),i=$(e),r="fixed"===n,l=ct(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const c=d(0);function a(){c.x=at(i)}if(o||!o&&!r)if(("body"!==M(e)||z(i))&&(s=U(e)),o){const t=ct(e,!0,r,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else i&&a();r&&!o&&i&&a();const f=!i||o||r?d(0):ft(i,s);return{x:l.left+s.scrollLeft-c.x-f.x,y:l.top+s.scrollTop-c.y-f.y,width:l.width,height:l.height}}function pt(t){return"static"===Q(t).position}function mt(t,e){if(!V(t)||"fixed"===Q(t).position)return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function gt(t,e){const n=W(t);if(j(t))return n;if(!V(t)){let e=Z(t);for(;e&&!K(e);){if(B(e)&&!pt(e))return e;e=Z(e)}return n}let o=mt(t,e);for(;o&&N(o)&&pt(o);)o=mt(o,e);return o&&K(o)&&pt(o)&&!G(o)?n:o||function(t){let e=Z(t);for(;V(e)&&!K(e);){if(G(e))return e;if(j(e))return null;e=Z(e)}return null}(t)||n}const yt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=$(o),s=!!e&&j(e.floating);if(o===l||s&&r)return n;let c={scrollLeft:0,scrollTop:0},a=d(1);const f=d(0),u=V(o);if((u||!u&&!r)&&(("body"!==M(o)||z(l))&&(c=U(o)),u)){const t=ct(o);a=rt(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const h=!l||u||r?d(0):ft(l,c);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+f.x+h.x,y:n.y*a.y-c.scrollTop*a.y+f.y+h.y}},getDocumentElement:$,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?j(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=et(t,[],!1).filter(t=>B(t)&&"body"!==M(t)),i=null;const r="fixed"===Q(t).position;let l=r?Z(t):t;for(;B(l)&&!K(l);){const e=Q(l),n=G(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||z(l)&&!n&&dt(t,l))?o=o.filter(t=>t!==l):i=e,l=Z(l)}return e.set(t,o),o}(e,this._c):[].concat(n),o],l=ut(e,r[0],i);let s=l.top,f=l.right,u=l.bottom,d=l.left;for(let t=1;t<r.length;t++){const n=ut(e,r[t],i);s=a(n.top,s),f=c(n.right,f),u=c(n.bottom,u),d=a(n.left,d)}return{width:f-d,height:u-s,x:d,y:s}},getOffsetParent:gt,getElementRects:async function(t){const e=this.getOffsetParent||gt,n=this.getDimensions,o=await n(t.floating);return{reference:ht(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ot(t);return{width:e,height:n}},getScale:rt,isElement:B,isRTL:function(t){return"rtl"===Q(t).direction}};function wt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function xt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:f=!1}=o,d=it(t),h=i||r?[...d?et(d):[],...e?et(e):[]]:[];h.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const p=d&&s?function(t,e){let n,o=null;const i=$(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(s,f){void 0===s&&(s=!1),void 0===f&&(f=1),r();const d=t.getBoundingClientRect(),{left:h,top:p,width:m,height:g}=d;if(s||e(),!m||!g)return;const y={rootMargin:-u(p)+"px "+-u(i.clientWidth-(h+m))+"px "+-u(i.clientHeight-(p+g))+"px "+-u(h)+"px",threshold:a(0,c(1,f))||1};let w=!0;function x(e){const o=e[0].intersectionRatio;if(o!==f){if(!w)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||wt(d,t.getBoundingClientRect())||l(),w=!1}try{o=new IntersectionObserver(x,{...y,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(x,y)}o.observe(t)}(!0),r}(d,n):null;let m,g=-1,y=null;l&&(y=new ResizeObserver(t=>{let[o]=t;o&&o.target===d&&y&&e&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var t;null==(t=y)||t.observe(e)})),n()}),d&&!f&&y.observe(d),e&&y.observe(e));let w=f?ct(t):null;return f&&function e(){const o=ct(t);w&&!wt(w,o)&&n();w=o,m=requestAnimationFrame(e)}(),n(),()=>{var t;h.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==p||p(),null==(t=y)||t.disconnect(),y=null,f&&cancelAnimationFrame(m)}}const vt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=e,c=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=g(n),s=y(n),c="y"===v(n),a=H.has(l)?-1:1,f=r&&c?-1:1,u=m(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),c?{x:h*f,y:d*a}:{x:d*a,y:h*f}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+c.x,y:r+c.y,data:{...c,placement:l}}}}},bt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:l=!0,crossAxis:s=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...a}=m(t,e),f={x:n,y:o},u=await r.detectOverflow(e,a),d=v(g(i)),h=w(d);let y=f[h],x=f[d];if(l){const t="y"===h?"bottom":"right";y=p(y+u["y"===h?"top":"left"],y,y-u[t])}if(s){const t="y"===d?"bottom":"right";x=p(x+u["y"===d?"top":"left"],x,x-u[t])}const b=c.fn({...e,[h]:y,[d]:x});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[h]:l,[d]:s}}}}}},Rt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:w=!0,...A}=m(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const L=g(i),T=v(s),C=g(s)===s,D=await(null==c.isRTL?void 0:c.isRTL(a.floating)),O=d||(C||!w?[S(s)]:function(t){const e=S(t);return[R(t),e,R(e)]}(s)),P="none"!==p;!d&&P&&O.push(...E(s,w,p,D));const H=[s,...O],F=await c.detectOverflow(e,A),M=[];let W=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&M.push(F[L]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=y(t),i=b(t),r=x(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=S(l)),[l,S(l)]}(i,l,D);M.push(F[t[0]],F[t[1]])}if(W=[...W,{placement:i,overflows:M}],!M.every(t=>t<=0)){var $,k;const t=((null==($=r.flip)?void 0:$.index)||0)+1,e=H[t];if(e){if(!("alignment"===u&&T!==v(e))||W.every(t=>v(t.placement)!==T||t.overflows[0]>0))return{data:{index:t,overflows:W},reset:{placement:e}}}let n=null==(k=W.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:k.placement;if(!n)switch(h){case"bestFit":{var B;const t=null==(B=W.filter(t=>{if(P){const e=v(t.placement);return e===T||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:B[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},At=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;const{placement:i,rects:r,platform:l,elements:s}=e,{apply:f=()=>{},...u}=m(t,e),d=await l.detectOverflow(e,u),h=g(i),p=y(i),w="y"===v(i),{width:x,height:b}=r.floating;let R,A;"top"===h||"bottom"===h?(R=h,A=p===(await(null==l.isRTL?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(A=h,R="end"===p?"top":"bottom");const L=b-d.top-d.bottom,T=x-d.left-d.right,C=c(b-d[R],L),E=c(x-d[A],T),S=!e.middlewareData.shift;let D=C,O=E;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(O=T),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(D=L),S&&!p){const t=a(d.left,0),e=a(d.right,0),n=a(d.top,0),o=a(d.bottom,0);w?O=x-2*(0!==t||0!==e?t+e:a(d.left,d.right)):D=b-2*(0!==n||0!==o?n+o:a(d.top,d.bottom))}await f({...e,availableWidth:O,availableHeight:D});const P=await l.getDimensions(s.floating);return x!==P.width||b!==P.height?{reset:{rects:!0}}:{}}}},Lt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:l}=e,{offset:s=0,mainAxis:c=!0,crossAxis:a=!0}=m(t,e),f={x:n,y:o},u=v(i),d=w(u);let h=f[d],p=f[u];const y=m(s,e),x="number"==typeof y?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(c){const t="y"===d?"height":"width",e=r.reference[d]-r.floating[t]+x.mainAxis,n=r.reference[d]+r.reference[t]-x.mainAxis;h<e?h=e:h>n&&(h=n)}if(a){var b,R;const t="y"===d?"width":"height",e=H.has(g(i)),n=r.reference[u]-r.floating[t]+(e&&(null==(b=l.offset)?void 0:b[u])||0)+(e?0:x.crossAxis),o=r.reference[u]+r.reference[t]+(e?0:(null==(R=l.offset)?void 0:R[u])||0)-(e?x.crossAxis:0);p<n?p=n:p>o&&(p=o)}return{[d]:h,[u]:p}}}},Tt=(t,e,n)=>{const o=new Map,i={platform:yt,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=l.detectOverflow?l:{...l,detectOverflow:P},c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=O(a,o,c),d=o,h=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:g,fn:y}=m,{x:w,y:x,data:v,reset:b}=await y({x:f,y:u,initialPlacement:o,placement:d,strategy:i,middlewareData:p,rects:a,platform:s,elements:{reference:t,floating:e}});f=null!=w?w:f,u=null!=x?x:u,p[g]={...p[g],...v},b&&h<50&&(h++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(a=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=O(a,d,c))),n=-1)}return{x:f,y:u,placement:d,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})},Ct="data-placement",Et="data-autoplacement",St=new Map;function Dt(t){let{newState:o,oldState:i,target:r,source:l=t.detail}=t,s=r instanceof HTMLElement&&null!==e(r,"popover")&&n(r,"--_ds-floating");if(!s)return;if("closed"===o)return St.get(r)?.();if(!l){let t=r.getRootNode(),e=`[popovertarget="${r.id}"],[commandfor="${r.id}"]`;l=r.id&&t?.querySelector?.(e)||void 0}if(!l||l===r||i&&i===o)return;let c=n(r,"--_ds-floating-overscroll"),a=e(r,Ct)||e(l,Ct)||s,f=e(r,Et)||e(l,Et),u=parseFloat(getComputedStyle(r,"::before").height)||0,d=a.match(/left|right/gi)?"Height":"Width",h=l[`offset${d}`]/2+u;if("none"===a)return;let p={strategy:"absolute",placement:a,middleware:[vt(u||0),bt({padding:10,limiter:Lt({offset:{mainAxis:h}})}),Ht(),..."false"===f?[]:[Rt({padding:10,crossAxis:!1})],...c?[At({apply({availableHeight:t}){"fit"===c&&(r.style.width=`${l.clientWidth}px`),r.style.maxHeight=`${Math.max(50,t-20)}px`}})]:[]]},m=xt(l,r,async()=>{if(!l?.isConnected)return St.get(r)?.();let{x:t,y:e}=await Tt(l,r,p);r.style.translate=`${t}px ${e}px`});St.set(r,()=>St.delete(r)&&m())}let Ot;const Pt=({type:t})=>{if("mousedown"===t&&(Ot=!1),"scroll"===t&&!1===Ot&&(Ot=!0),"mouseup"===t&&Ot)for(let[t]of St)t.showPopover()};r("popover",()=>[o(document,"mousedown scroll mouseup",Pt,!0),o(document,"toggle ds-toggle-source",Dt,t)]);const Ht=()=>({name:"arrowPseudo",fn(t){let n=t.elements.floating,o=t.rects.reference,i=`${Math.round(o.width/2+o.x-t.x)}px`,r=`${Math.round(o.height/2+o.y-t.y)}px`;return n.style.setProperty("--_ds-floating-arrow-x",i),n.style.setProperty("--_ds-floating-arrow-y",r),e(n,"data-floating",t.placement),t}});
|