snice 7.0.3 → 7.1.0
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/.agents/skills/snice/SKILL.md +4 -0
- package/.agents/skills/snice/references/core-kitchen-sink.ts +39 -1
- package/README.md +59 -14
- package/adapters/react/SniceProvider.js +2 -2
- package/adapters/react/SniceRouter.js +2 -2
- package/adapters/react/matchRoute.js +2 -2
- package/adapters/react/useRequestHandler.js +2 -2
- package/bin/analyzer-contracts.js +6 -1
- package/bin/postinstall.js +59 -0
- package/bin/project-analyzer.js +466 -5
- package/bin/snice.js +3 -0
- package/dist/app-context.d.ts +11 -0
- package/dist/cdn/accordion/snice-accordion.js +2 -2
- package/dist/cdn/action-bar/snice-action-bar.js +2 -2
- package/dist/cdn/activity-feed/snice-activity-feed.js +2 -2
- package/dist/cdn/alert/snice-alert.js +2 -2
- package/dist/cdn/app-tiles/snice-app-tiles.js +2 -2
- package/dist/cdn/approval-flow/snice-approval-flow.js +2 -2
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +2 -2
- package/dist/cdn/availability/snice-availability.js +2 -2
- package/dist/cdn/avatar/snice-avatar.js +2 -2
- package/dist/cdn/avatar-group/snice-avatar-group.js +2 -2
- package/dist/cdn/badge/snice-badge.js +2 -2
- package/dist/cdn/banner/snice-banner.js +2 -2
- package/dist/cdn/binpack/snice-binpack.js +2 -2
- package/dist/cdn/book/snice-book.js +2 -2
- package/dist/cdn/booking/snice-booking.js +2 -2
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +2 -2
- package/dist/cdn/button/snice-button.js +2 -2
- package/dist/cdn/calendar/snice-calendar.js +2 -2
- package/dist/cdn/camera/snice-camera.js +2 -2
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +2 -2
- package/dist/cdn/candlestick/snice-candlestick.js +2 -2
- package/dist/cdn/card/snice-card.js +2 -2
- package/dist/cdn/carousel/snice-carousel.js +2 -2
- package/dist/cdn/cart/snice-cart.js +2 -2
- package/dist/cdn/chart/snice-chart.js +2 -2
- package/dist/cdn/chat/snice-chat.js +2 -2
- package/dist/cdn/checkbox/snice-checkbox.js +2 -2
- package/dist/cdn/chip/snice-chip.js +2 -2
- package/dist/cdn/code-block/snice-code-block.js +2 -2
- package/dist/cdn/color-display/snice-color-display.js +2 -2
- package/dist/cdn/color-picker/snice-color-picker.js +2 -2
- package/dist/cdn/command-palette/snice-command-palette.js +2 -2
- package/dist/cdn/comments/snice-comments.js +2 -2
- package/dist/cdn/countdown/snice-countdown.js +2 -2
- package/dist/cdn/cropper/snice-cropper.js +2 -2
- package/dist/cdn/data-card/snice-data-card.js +2 -2
- package/dist/cdn/date-picker/snice-date-picker.js +2 -2
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +2 -2
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +2 -2
- package/dist/cdn/diff/snice-diff.js +2 -2
- package/dist/cdn/divider/snice-divider.js +2 -2
- package/dist/cdn/doc/snice-doc.js +2 -2
- package/dist/cdn/draw/snice-draw.js +2 -2
- package/dist/cdn/drawer/snice-drawer.js +2 -2
- package/dist/cdn/empty-state/snice-empty-state.js +2 -2
- package/dist/cdn/estimate/snice-estimate.js +2 -2
- package/dist/cdn/file-gallery/snice-file-gallery.js +2 -2
- package/dist/cdn/file-upload/snice-file-upload.js +2 -2
- package/dist/cdn/flip-card/snice-flip-card.js +2 -2
- package/dist/cdn/flow/snice-flow.js +2 -2
- package/dist/cdn/form-layout/snice-form-layout.js +2 -2
- package/dist/cdn/funnel/snice-funnel.js +2 -2
- package/dist/cdn/gantt/snice-gantt.js +2 -2
- package/dist/cdn/gauge/snice-gauge.js +2 -2
- package/dist/cdn/grid/snice-grid.js +2 -2
- package/dist/cdn/heatmap/snice-heatmap.js +2 -2
- package/dist/cdn/image/snice-image.js +2 -2
- package/dist/cdn/input/snice-input.js +2 -2
- package/dist/cdn/invoice/snice-invoice.js +2 -2
- package/dist/cdn/kanban/snice-kanban.js +2 -2
- package/dist/cdn/key-value/snice-key-value.js +2 -2
- package/dist/cdn/kpi/snice-kpi.js +2 -2
- package/dist/cdn/layout/README.md +17 -2
- package/dist/cdn/layout/snice-layout.js +1656 -11
- package/dist/cdn/layout/snice-layout.js.map +1 -1
- package/dist/cdn/layout/snice-layout.min.js +379 -2
- package/dist/cdn/layout/snice-layout.min.js.map +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +2 -2
- package/dist/cdn/link/snice-link.js +2 -2
- package/dist/cdn/link-preview/snice-link-preview.js +2 -2
- package/dist/cdn/list/snice-list.js +2 -2
- package/dist/cdn/location/snice-location.js +2 -2
- package/dist/cdn/login/snice-login.js +2 -2
- package/dist/cdn/map/snice-map.js +2 -2
- package/dist/cdn/markdown/snice-markdown.js +2 -2
- package/dist/cdn/masonry/snice-masonry.js +2 -2
- package/dist/cdn/menu/snice-menu.js +2 -2
- package/dist/cdn/message-strip/snice-message-strip.js +2 -2
- package/dist/cdn/modal/snice-modal.js +2 -2
- package/dist/cdn/music-player/snice-music-player.js +2 -2
- package/dist/cdn/nav/snice-nav.js +2 -2
- package/dist/cdn/network-graph/snice-network-graph.js +2 -2
- package/dist/cdn/notification-center/snice-notification-center.js +2 -2
- package/dist/cdn/order-tracker/snice-order-tracker.js +2 -2
- package/dist/cdn/org-chart/snice-org-chart.js +2 -2
- package/dist/cdn/pagination/snice-pagination.js +2 -2
- package/dist/cdn/paint/snice-paint.js +2 -2
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +2 -2
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +2 -2
- package/dist/cdn/podcast-player/snice-podcast-player.js +2 -2
- package/dist/cdn/popover/snice-popover.js +2 -2
- package/dist/cdn/pricing-table/snice-pricing-table.js +2 -2
- package/dist/cdn/product-card/snice-product-card.js +2 -2
- package/dist/cdn/progress/snice-progress.js +2 -2
- package/dist/cdn/progress-ring/snice-progress-ring.js +2 -2
- package/dist/cdn/qr-code/snice-qr-code.js +2 -2
- package/dist/cdn/qr-reader/snice-qr-reader.js +2 -2
- package/dist/cdn/radio/snice-radio.js +2 -2
- package/dist/cdn/range-slider/snice-range-slider.js +2 -2
- package/dist/cdn/rating/snice-rating.js +2 -2
- package/dist/cdn/receipt/snice-receipt.js +2 -2
- package/dist/cdn/recipe/snice-recipe.js +2 -2
- package/dist/cdn/runtime/README.md +2 -2
- package/dist/cdn/runtime/snice-runtime.esm.js +3732 -3343
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +3727 -3335
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +2 -2
- package/dist/cdn/segmented-control/snice-segmented-control.js +2 -2
- package/dist/cdn/select/snice-select.js +2 -2
- package/dist/cdn/skeleton/snice-skeleton.js +2 -2
- package/dist/cdn/slider/snice-slider.js +2 -2
- package/dist/cdn/sortable/snice-sortable.js +2 -2
- package/dist/cdn/sparkline/snice-sparkline.js +2 -2
- package/dist/cdn/spinner/snice-spinner.js +2 -2
- package/dist/cdn/split-button/snice-split-button.js +2 -2
- package/dist/cdn/split-pane/snice-split-pane.js +2 -2
- package/dist/cdn/spotlight/snice-spotlight.js +2 -2
- package/dist/cdn/stat-group/snice-stat-group.js +2 -2
- package/dist/cdn/step-input/snice-step-input.js +2 -2
- package/dist/cdn/stepper/snice-stepper.js +2 -2
- package/dist/cdn/switch/snice-switch.js +2 -2
- package/dist/cdn/table/README.md +6 -2
- package/dist/cdn/table/snice-table.esm.js +347 -54
- package/dist/cdn/table/snice-table.esm.js.map +1 -1
- package/dist/cdn/table/snice-table.esm.min.js +105 -44
- package/dist/cdn/table/snice-table.esm.min.js.map +1 -1
- package/dist/cdn/table/snice-table.js +348 -57
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +153 -92
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +2 -2
- package/dist/cdn/tag/snice-tag.js +2 -2
- package/dist/cdn/tag-input/snice-tag-input.js +2 -2
- package/dist/cdn/terminal/snice-terminal.js +2 -2
- package/dist/cdn/testimonial/snice-testimonial.js +2 -2
- package/dist/cdn/textarea/snice-textarea.js +2 -2
- package/dist/cdn/time-picker/snice-time-picker.js +2 -2
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +2 -2
- package/dist/cdn/timeline/snice-timeline.js +2 -2
- package/dist/cdn/timer/snice-timer.js +2 -2
- package/dist/cdn/toast/snice-toast.js +2 -2
- package/dist/cdn/tooltip/snice-tooltip.js +2 -2
- package/dist/cdn/tree/snice-tree.js +2 -2
- package/dist/cdn/treemap/snice-treemap.js +2 -2
- package/dist/cdn/user-card/snice-user-card.js +2 -2
- package/dist/cdn/video-player/snice-video-player.js +2 -2
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +2 -2
- package/dist/cdn/waterfall/snice-waterfall.js +2 -2
- package/dist/cdn/weather/snice-weather.js +2 -2
- package/dist/cdn/work-order/snice-work-order.js +2 -2
- package/dist/context-provider.d.ts +16 -0
- package/dist/daemon-target.d.ts +10 -0
- package/dist/daemon.d.ts +10 -0
- package/dist/index.cjs +3721 -3329
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.esm.js +3719 -3330
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +3721 -3329
- package/dist/index.iife.js.map +1 -1
- package/dist/keyboard-filter.d.ts +25 -0
- package/dist/on.d.ts +1 -1
- package/dist/parts.d.ts +0 -17
- package/dist/react/SniceProvider.js +2 -2
- package/dist/react/SniceRouter.js +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/matchRoute.js +2 -2
- package/dist/react/useRequestHandler.js +2 -2
- package/dist/request-response.d.ts +9 -1
- package/dist/symbols.cjs +11 -2
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.d.ts +3 -0
- package/dist/symbols.esm.js +9 -3
- package/dist/symbols.esm.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/transitions.cjs +2 -2
- package/dist/transitions.esm.js +2 -2
- package/dist/types/app-context.d.ts +9 -58
- package/dist/types/daemon.d.ts +8 -0
- package/dist/types/dispatch-options.d.ts +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/on-options.d.ts +5 -0
- package/dist/types/request-options.d.ts +2 -0
- package/dist/types/respond-options.d.ts +2 -0
- package/docs/ai/DEVELOPMENT.md +15 -1
- package/docs/ai/README.md +5 -1
- package/docs/ai/api.md +13 -4
- package/docs/ai/architecture.md +50 -1
- package/docs/ai/cli.md +9 -0
- package/docs/ai/daemons.md +80 -0
- package/docs/ai/decorators.md +6 -4
- package/docs/ai/events.md +6 -0
- package/docs/ai/patterns.md +45 -1
- package/docs/ai/request-response.md +26 -9
- package/docs/ai/routing.md +16 -1
- package/docs/cli.md +7 -0
- package/docs/daemons.md +200 -0
- package/docs/events.md +19 -2
- package/docs/request-response.md +20 -13
- package/docs/routing.md +25 -1
- package/package.json +6 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as n,render as l,styles as r,ready as o,reconnect as c,watch as d,dispatch as h,dispose as u,css as m,queryAll as p,request as g,isSafeUrl as b,on as f,SimpleArray as v}from"snice";function y(e,t,i,a,s,n){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,o=a.kind,c="getter"===o?"get":"setter"===o?"set":"value",d=!t&&e?a.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,a.name):{}),u=!1,m=i.length-1;m>=0;m--){var p={};for(var g in a)p[g]="access"===g?{}:a[g];for(var g in a.access)p.access[g]=a.access[g];p.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(l(e||null))};var b=(0,i[m])("accessor"===o?{get:h.get,set:h.set}:h[c],p);if("accessor"===o){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(r=l(b.get))&&(h.get=r),(r=l(b.set))&&(h.set=r),(r=l(b.init))&&s.unshift(r)}else(r=l(b))&&("field"===o?s.unshift(r):h[c]=r)}d&&Object.defineProperty(d,a.name,h),u=!0}function w(e,t,i){for(var a=arguments.length>2,s=0;s<t.length;s++)i=a?t[s].call(e,i):t[s].call(e);return a?i:void 0}"function"==typeof SuppressedError&&SuppressedError;const k='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 18 18 6M6 6l12 12"/></svg>',x='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m19.5 8.25-7.5 7.5-7.5-7.5"/></svg>',C='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m8.25 4.5 7.5 7.5-7.5 7.5"/></svg>',S='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>',E='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"/></svg>',D='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m7.5-7.5h-15"/></svg>',A='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19.5v-15m0 0-6.75 6.75M12 4.5l6.75 6.75"/></svg>',R='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m0 0 6.75-6.75M12 19.5l-6.75-6.75"/></svg>',M='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>',z='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"/></svg>',F='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.511-5.511-3.181"/></svg>',$='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"/></svg>',I='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg>',T='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"/><path d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',L='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/></svg>',V='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"/></svg>',B='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/><path d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"/></svg>',O='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/></svg>',j={"info-circle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/></svg>',"check-circle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd"/></svg>',"exclamation-triangle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/></svg>',"x-circle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd"/></svg>',"x-mark":k,"chevron-down":x,"chevron-up":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 15.75 7.5-7.5 7.5 7.5"/></svg>',"chevron-right":C,"chevron-left":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.75 19.5 8.25 12l7.5-7.5"/></svg>',check:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 12.75 6 6 9-13.5"/></svg>',"magnifying-glass":S,search:S,"bars-3":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/></svg>',photo:E,"ellipsis-horizontal":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"/></svg>',trash:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>',plus:D,camera:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.822 1.316Z"/><path d="M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"/></svg>',pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/></svg>',"arrow-up":A,"arrow-down":R,"arrow-right":M,"arrow-trending-up":z,"arrow-trending-down":F,star:'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006Z" clip-rule="evenodd"/></svg>',"star-outline":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"/></svg>',circle:'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="12" cy="12" r="8"/></svg>',"paper-clip":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"/></svg>',"paper-airplane":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"/></svg>',"arrow-down-tray":I,"arrow-up-tray":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"/></svg>',"chat-bubble":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"/></svg>',"rocket-launch":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/></svg>',key:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"/></svg>',"arrows-right-left":O,"arrows-pointing-out":L,"eye-slash":V,"map-pin":B,fire:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.362 5.214A8.252 8.252 0 0 1 12 21 8.25 8.25 0 0 1 6.038 7.047 8.287 8.287 0 0 0 9 9.601a8.983 8.983 0 0 1 3.361-6.867 8.21 8.21 0 0 0 3 2.48Z"/><path d="M12 18a3.75 3.75 0 0 0 .495-7.468 5.99 5.99 0 0 0-1.925 3.547 5.975 5.975 0 0 1-2.133-1.001A3.75 3.75 0 0 0 12 18Z"/></svg>',"cog-6-tooth":T,settings:T,envelope:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"/></svg>',"light-bulb":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"/></svg>',users:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"/></svg>',heart:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"/></svg>',home:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"/></svg>',"chart-bar":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"/></svg>',scissors:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.848 8.25l1.536.887M7.848 8.25a3 3 0 1 1-5.196-3 3 3 0 0 1 5.196 3Zm1.536.887a2.165 2.165 0 0 1 1.083 1.839c.005.351.054.695.14 1.024M9.384 9.137l2.077 1.199M7.848 15.75l1.536-.887m-1.536.887a3 3 0 1 1-5.196 3 3 3 0 0 1 5.196-3Zm1.536-.887a2.165 2.165 0 0 0 1.083-1.838c.005-.352.054-.695.14-1.025m-1.223 2.863 2.077-1.199m0-3.328a4.323 4.323 0 0 1 2.068-1.379l5.325-1.628a4.5 4.5 0 0 1 2.48-.044l.803.215-7.794 4.5m-2.882-.375a4.33 4.33 0 0 0 .655 3.736m2.227-3.361 7.794 4.5-.802.215a4.5 4.5 0 0 1-2.48-.043l-5.326-1.629a4.324 4.324 0 0 1-2.068-1.379m0 0-2.077 1.199"/></svg>',user:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"/></svg>',clipboard:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"/></svg>',"bug-ant":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"/></svg>',"calendar-days":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"/></svg>',sparkles:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"/></svg>',"bell-alert":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0M3.124 7.5A8.969 8.969 0 0 1 5.292 3m13.416 0a8.969 8.969 0 0 1 2.168 4.5"/></svg>',cube:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"/></svg>',banknotes:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',cake:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 8.25v-1.5m0 1.5c-1.355 0-2.697.056-4.024.166C6.845 8.51 6 9.473 6 10.608v2.513m6-4.871c1.355 0 2.697.056 4.024.166C17.155 8.51 18 9.473 18 10.608v2.513M15 8.25v-1.5m-6 1.5v-1.5m12 9.75-1.5.75a3.354 3.354 0 0 1-3 0 3.354 3.354 0 0 0-3 0 3.354 3.354 0 0 1-3 0 3.354 3.354 0 0 0-3 0 3.354 3.354 0 0 1-3 0L3 16.5m15-3.379a48.474 48.474 0 0 0-6-.371c-2.032 0-4.034.126-6 .371m12 0c.39.049.777.102 1.163.16 1.07.16 1.837 1.094 1.837 2.175v5.169c0 .621-.504 1.125-1.125 1.125H4.125A1.125 1.125 0 0 1 3 20.625v-5.17c0-1.08.768-2.014 1.837-2.174A47.78 47.78 0 0 1 6 13.12"/></svg>',"paint-brush":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"/></svg>',gift:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 11.25v8.25a1.5 1.5 0 0 1-1.5 1.5H4.5a1.5 1.5 0 0 1-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 1 0 9.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1 1 14.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"/></svg>',folder:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/></svg>',"document-text":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/></svg>',bell:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/></svg>',link:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"/></svg>',phone:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"/></svg>',"computer-desktop":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/></svg>',"musical-note":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 10.5-3m0 6.553v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 1 1-.99-3.467l2.31-.66a2.25 2.25 0 0 0 1.632-2.163Zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 0 1-.99-3.467l2.31-.66A2.25 2.25 0 0 0 9 15.553Z"/></svg>',"lock-closed":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"/></svg>',"table-cells":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m8.625 1.125c0 .621-.504 1.125-1.125 1.125h-7.5"/></svg>',minus:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg>'},P={toAttribute:e=>"string"==typeof e?e:null};function N(i,a="icon"){if(!i)return e``;const{kind:s,value:n}=function(e){if(e.startsWith("img://"))return{kind:"img",value:e.slice(6)};if(e.startsWith("text://"))return{kind:"text",value:e.slice(7)};const t=/^(https?:\/\/|\/|\.\/|\.\.\/|data:)/.test(e),i=/^[^:]*\w\.(svg|png|jpe?g|jfif|pjp|gif|webp|avif|jxl|ico|cur|bmp|tiff?|heic|heif|apng)(\?.*)?$/i.test(e);return t||i?{kind:"img",value:e}:j[e]?{kind:"registry",value:e}:{kind:"text",value:e}}(i);return"img"===s?e`<img class="${a}" src="${n}" alt="" part="icon" />`:"registry"===s?e`<span class="${a}" part="icon">${t(j[n])}</span>`:/^[a-z][a-z0-9_]*$/.test(n)?e`<span class="${a} snice-icon-ligature" style="font-family:var(--snice-icon-font,'Material Symbols Outlined'),sans-serif" part="icon">${n}</span>`:e`<span class="${a}" part="icon">${n}</span>`}const H=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"];function q(e){return H.some(t=>Boolean(e[t]))}function _(e,t,i,a){e&&"function"==typeof e.setValidity&&(q(t)?a?e.setValidity(t,i,a):e.setValidity(t,i):e.setValidity({}))}function G(e,t){if(t?.form)return t.form;const i=e.getAttribute("form");if(null!==i){const t=e.getRootNode();return"querySelectorAll"in t?Array.from(t.querySelectorAll("form[id]")).find(e=>e instanceof HTMLFormElement&&e.id===i)??null:null}return e.closest("form")}const K=new WeakMap;function W(e){return e.replace(/\s+/gu," ").trim()}function U(e,t){return e===t||e.nodeType===Node.ELEMENT_NODE&&e.contains(t)}function Z(e,t){const i=e.getRootNode();return"getElementById"in i?i.getElementById(t):null}function Y(e,t){if(e===t)return"";if(e.nodeType===Node.TEXT_NODE)return e.nodeValue||"";if(e.nodeType!==Node.ELEMENT_NODE)return"";const i=e;return i.hidden||"true"===i.getAttribute("aria-hidden")||["script","style","template"].includes(i.localName)?"":"br"===i.localName?" ":"img"===i.localName?i.getAttribute("alt")||"":Array.from(i.childNodes).map(e=>Y(e,t)).join(" ")}function J(e,t){const i=e.getAttribute("aria-labelledby");if(i){const a=i.split(/\s+/u).map(t=>Z(e,t)).filter(t=>Boolean(t)&&t!==e).map(e=>Y(e,t)),s=W(a.join(" "));if(s)return s}return e.hasAttribute("aria-label")?W(e.getAttribute("aria-label")||""):W(Y(e,t))||W(e.getAttribute("title")||"")}class Q{constructor(e,t,i,a,s){this.host=e,this.getInternals=t,this.getTarget=i,this.getFallbackName=a,this.syncRelatedNames=s,this.connected=!1,this.currentLabels=[],this.currentNamingNodes=[],this.referencedIds=new Set,this.handleHostActivation=e=>{if(e.composedPath()[0]!==this.host)return;if(this.currentLabels=this.resolveLabels(),0===this.currentLabels.length)return;const t=this.getTarget();t?t.focus():e.preventDefault()},this.handleLabelActivation=e=>{const t=e.composedPath(),i=e.target;if(i===this.host||i instanceof Node&&this.host.contains(i))return;const a=e.currentTarget;if(t.some(e=>e instanceof HTMLElement&&e!==a&&e.matches('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [role="button"], [role="link"]')))return;const s=this.getTarget();s?(s.focus(),setTimeout(()=>{const e=this.getTarget();this.connected&&e?.isConnected&&this.currentLabels.includes(a)&&e.focus()},0)):e.preventDefault()}}get labels(){const e=this.host.getRootNode();if(this.host.id&&"querySelectorAll"in e)try{const t=CSS.escape(this.host.id),i=CSS.escape(this.host.localName);return e.querySelectorAll(`label[for="${t}"], label:not([for]):has(${i}#${t})`)}catch{}return this.getInternals()?.labels??null}get accessibleName(){const e=this.resolveLabels();return W(e.length>0?e.map(e=>J(e,this.host)).join(" "):this.getFallbackName())}connect(){this.connected||(this.connected=!0,this.host.addEventListener("click",this.handleHostActivation),this.bindRegistry(),this.sync())}disconnect(){this.connected&&(this.connected=!1,this.host.removeEventListener("click",this.handleHostActivation),this.unbindLabelActivation(),this.releaseRegistry(),this.currentLabels=[],this.currentNamingNodes=[],this.referencedIds.clear())}sync(){if(this.connected&&this.bindRegistry(),this.unbindLabelActivation(),this.currentLabels=this.resolveLabels(),this.connected)for(const e of this.currentLabels)e.addEventListener("click",this.handleLabelActivation);this.currentNamingNodes=[...this.currentLabels],this.referencedIds.clear();for(const e of this.currentLabels)for(const t of(e.getAttribute("aria-labelledby")||"").split(/\s+/u).filter(Boolean)){this.referencedIds.add(t);const i=Z(e,t);i&&i!==e&&this.currentNamingNodes.push(i)}const e=W(this.currentLabels.length>0?this.currentLabels.map(e=>J(e,this.host)).join(" "):this.getFallbackName());this.getTarget()?.setAttribute("aria-label",e),this.syncRelatedNames?.(e)}isAffectedBy(e){if("attributes"===e.type){if(e.target===this.host&&"id"===e.attributeName)return!0;const t=e.target;return"label"===t.localName&&"for"===e.attributeName?this.currentLabels.includes(t)||Boolean(this.host.id)&&t.htmlFor===this.host.id:!("id"!==e.attributeName||!this.referencedIds.has(t.id))||this.currentNamingNodes.some(e=>e===t||e.contains(t))}return!!this.currentNamingNodes.some(t=>t===e.target||t.contains(e.target))||"childList"===e.type&&[...e.addedNodes,...e.removedNodes].some(e=>{if(U(e,this.host)||U(this.host,e))return!0;if(this.currentNamingNodes.some(t=>U(e,t)))return!0;if(e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e;return!!("label"===t.localName?[t]:Array.from(t.querySelectorAll("label"))).some(e=>e.hasAttribute("for")?Boolean(this.host.id)&&e.htmlFor===this.host.id:e.contains(this.host))||[t,...Array.from(t.querySelectorAll("[id]"))].some(e=>this.referencedIds.has(e.id))})}unbindLabelActivation(){for(const e of this.currentLabels)e.removeEventListener("click",this.handleLabelActivation)}bindRegistry(){const e=function(e){const t=e.getRootNode();return t.nodeType===Node.DOCUMENT_NODE||"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:null}(this.host);e!==this.registryRoot&&(this.releaseRegistry(),e&&(this.registryRoot=e,this.registry=function(e){const t=e.nodeType===Node.DOCUMENT_NODE?e.documentElement:e;if(!t||"undefined"==typeof MutationObserver)return null;const i=K.get(e);if(i)return i;const a=new Set,s=new MutationObserver(e=>{for(const t of a)e.some(e=>t.isAffectedBy(e))&&t.sync()});s.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["for","id","aria-label","aria-labelledby","aria-hidden","hidden","alt","title"]});const n={associations:a,observer:s};return K.set(e,n),n}(e)||void 0,this.registry?.associations.add(this)))}releaseRegistry(){this.registry?.associations.delete(this),this.registry&&0===this.registry.associations.size&&this.registryRoot&&(this.registry.observer.disconnect(),K.delete(this.registryRoot)),this.registry=void 0,this.registryRoot=void 0}resolveLabels(){const e=this.host.getRootNode();return"querySelectorAll"in e?Array.from(e.querySelectorAll("label")).filter(e=>e.hasAttribute("for")?Boolean(this.host.id)&&e.htmlFor===this.host.id:e.contains(this.host)):Array.from(this.getInternals()?.labels||[])}}(()=>{let t,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z,F,$,I,T,L,V,B,O,j,P,K,W,U,Z,Y,J,X,ee,te,ie,ae,se,ne,le,re,oe,ce,de,he,ue,me,pe,ge,be,fe,ve,ye,we,ke,xe,Ce,Se,Ee,De,Ae,Re=[i("snice-input",{formAssociated:!0,delegatesFocus:!0})],Me=[],ze=HTMLElement,Fe=[],$e=[],Ie=[],Te=[],Le=[],Ve=[],Be=[],Oe=[],je=[],Pe=[],Ne=[],He=[],qe=[],_e=[],Ge=[],Ke=[],We=[],Ue=[],Ze=[],Ye=[],Je=[],Qe=[],Xe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],mt=[],pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],Ft=[],$t=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[],_t=[],Gt=[];(class extends ze{static{p=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(ze[Symbol.metadata]??null):void 0;g=[a()],b=[a()],f=[a()],v=[s({attribute:"value"})],k=[s({})],x=[s({})],C=[s({})],S=[s({})],E=[s({})],D=[s({attribute:"helper-text"})],A=[s({attribute:"error-text"})],R=[s({type:Boolean})],M=[s({type:Boolean})],z=[s({type:Boolean})],F=[s({type:Boolean})],$=[s({type:Boolean})],I=[s({type:Boolean})],T=[s({type:Boolean})],L=[s({})],V=[s({})],B=[s({})],O=[s({})],j=[s({type:Number})],P=[s({type:Number})],K=[s({})],W=[s({})],U=[s({})],Z=[s({attribute:"label-align"})],Y=[s({type:Boolean})],J=[s({attribute:"prefix-icon"})],X=[s({attribute:"suffix-icon"})],ee=[n(".input")],te=[n(".clear-button")],ie=[n(".password-toggle")],ae=[l()],se=[r()],ne=[o()],le=[c()],re=[d("valueState")],oe=[d("invalid")],ce=[d("disabled","loading","formDisabled")],de=[d("readonly")],he=[d("defaultValue")],ue=[d("placeholder")],me=[d("min")],pe=[d("max")],ge=[d("step")],be=[d("maxlength")],fe=[d("minlength")],ve=[d("pattern")],ye=[d("type")],we=[d("required")],ke=[d("label")],xe=[h("input-input",{bubbles:!0,composed:!0})],Ce=[h("input-change",{bubbles:!0,composed:!0})],Se=[h("input-focus",{bubbles:!0,composed:!0})],Ee=[h("input-blur",{bubbles:!0,composed:!0})],De=[h("input-clear",{bubbles:!0,composed:!0})],Ae=[u()],y(this,null,ae,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,Fe),y(this,null,se,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,Fe),y(this,null,ne,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,Fe),y(this,null,le,{kind:"method",name:"onReconnect",static:!1,private:!1,access:{has:e=>"onReconnect"in e,get:e=>e.onReconnect},metadata:e},null,Fe),y(this,null,re,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:e},null,Fe),y(this,null,oe,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:e},null,Fe),y(this,null,ce,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:e},null,Fe),y(this,null,de,{kind:"method",name:"handleReadonlyChange",static:!1,private:!1,access:{has:e=>"handleReadonlyChange"in e,get:e=>e.handleReadonlyChange},metadata:e},null,Fe),y(this,null,he,{kind:"method",name:"handleDefaultValueChange",static:!1,private:!1,access:{has:e=>"handleDefaultValueChange"in e,get:e=>e.handleDefaultValueChange},metadata:e},null,Fe),y(this,null,ue,{kind:"method",name:"handlePlaceholderChange",static:!1,private:!1,access:{has:e=>"handlePlaceholderChange"in e,get:e=>e.handlePlaceholderChange},metadata:e},null,Fe),y(this,null,me,{kind:"method",name:"handleMinChange",static:!1,private:!1,access:{has:e=>"handleMinChange"in e,get:e=>e.handleMinChange},metadata:e},null,Fe),y(this,null,pe,{kind:"method",name:"handleMaxChange",static:!1,private:!1,access:{has:e=>"handleMaxChange"in e,get:e=>e.handleMaxChange},metadata:e},null,Fe),y(this,null,ge,{kind:"method",name:"handleStepChange",static:!1,private:!1,access:{has:e=>"handleStepChange"in e,get:e=>e.handleStepChange},metadata:e},null,Fe),y(this,null,be,{kind:"method",name:"handleMaxLengthChange",static:!1,private:!1,access:{has:e=>"handleMaxLengthChange"in e,get:e=>e.handleMaxLengthChange},metadata:e},null,Fe),y(this,null,fe,{kind:"method",name:"handleMinLengthChange",static:!1,private:!1,access:{has:e=>"handleMinLengthChange"in e,get:e=>e.handleMinLengthChange},metadata:e},null,Fe),y(this,null,ve,{kind:"method",name:"handlePatternChange",static:!1,private:!1,access:{has:e=>"handlePatternChange"in e,get:e=>e.handlePatternChange},metadata:e},null,Fe),y(this,null,ye,{kind:"method",name:"handleTypeChange",static:!1,private:!1,access:{has:e=>"handleTypeChange"in e,get:e=>e.handleTypeChange},metadata:e},null,Fe),y(this,null,we,{kind:"method",name:"handleRequiredChange",static:!1,private:!1,access:{has:e=>"handleRequiredChange"in e,get:e=>e.handleRequiredChange},metadata:e},null,Fe),y(this,null,ke,{kind:"method",name:"handleLabelChange",static:!1,private:!1,access:{has:e=>"handleLabelChange"in e,get:e=>e.handleLabelChange},metadata:e},null,Fe),y(this,null,xe,{kind:"method",name:"dispatchInputEvent",static:!1,private:!1,access:{has:e=>"dispatchInputEvent"in e,get:e=>e.dispatchInputEvent},metadata:e},null,Fe),y(this,null,Ce,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:e},null,Fe),y(this,null,Se,{kind:"method",name:"dispatchFocusEvent",static:!1,private:!1,access:{has:e=>"dispatchFocusEvent"in e,get:e=>e.dispatchFocusEvent},metadata:e},null,Fe),y(this,null,Ee,{kind:"method",name:"dispatchBlurEvent",static:!1,private:!1,access:{has:e=>"dispatchBlurEvent"in e,get:e=>e.dispatchBlurEvent},metadata:e},null,Fe),y(this,null,De,{kind:"method",name:"dispatchClearEvent",static:!1,private:!1,access:{has:e=>"dispatchClearEvent"in e,get:e=>e.dispatchClearEvent},metadata:e},null,Fe),y(this,null,Ae,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,Fe),y(null,null,g,{kind:"field",name:"valueState",static:!1,private:!1,access:{has:e=>"valueState"in e,get:e=>e.valueState,set:(e,t)=>{e.valueState=t}},metadata:e},$e,Ie),y(null,null,b,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},Te,Le),y(null,null,f,{kind:"field",name:"constraintInvalid",static:!1,private:!1,access:{has:e=>"constraintInvalid"in e,get:e=>e.constraintInvalid,set:(e,t)=>{e.constraintInvalid=t}},metadata:e},Ve,Be),y(null,null,v,{kind:"field",name:"defaultValue",static:!1,private:!1,access:{has:e=>"defaultValue"in e,get:e=>e.defaultValue,set:(e,t)=>{e.defaultValue=t}},metadata:e},Oe,je),y(null,null,k,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},Pe,Ne),y(null,null,x,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},He,qe),y(null,null,C,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},_e,Ge),y(null,null,S,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:e},Ke,We),y(null,null,E,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},Ue,Ze),y(null,null,D,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:e},Ye,Je),y(null,null,A,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:e},Qe,Xe),y(null,null,R,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},et,tt),y(null,null,M,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:e},it,at),y(null,null,z,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},st,nt),y(null,null,F,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:e},lt,rt),y(null,null,$,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:e},ot,ct),y(null,null,I,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:e},dt,ht),y(null,null,T,{kind:"field",name:"password",static:!1,private:!1,access:{has:e=>"password"in e,get:e=>e.password,set:(e,t)=>{e.password=t}},metadata:e},ut,mt),y(null,null,L,{kind:"field",name:"min",static:!1,private:!1,access:{has:e=>"min"in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:e},pt,gt),y(null,null,V,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:e},bt,ft),y(null,null,B,{kind:"field",name:"step",static:!1,private:!1,access:{has:e=>"step"in e,get:e=>e.step,set:(e,t)=>{e.step=t}},metadata:e},vt,yt),y(null,null,O,{kind:"field",name:"pattern",static:!1,private:!1,access:{has:e=>"pattern"in e,get:e=>e.pattern,set:(e,t)=>{e.pattern=t}},metadata:e},wt,kt),y(null,null,j,{kind:"field",name:"maxlength",static:!1,private:!1,access:{has:e=>"maxlength"in e,get:e=>e.maxlength,set:(e,t)=>{e.maxlength=t}},metadata:e},xt,Ct),y(null,null,P,{kind:"field",name:"minlength",static:!1,private:!1,access:{has:e=>"minlength"in e,get:e=>e.minlength,set:(e,t)=>{e.minlength=t}},metadata:e},St,Et),y(null,null,K,{kind:"field",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:e},Dt,At),y(null,null,W,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:e},Rt,Mt),y(null,null,U,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},zt,Ft),y(null,null,Z,{kind:"field",name:"labelAlign",static:!1,private:!1,access:{has:e=>"labelAlign"in e,get:e=>e.labelAlign,set:(e,t)=>{e.labelAlign=t}},metadata:e},$t,It),y(null,null,Y,{kind:"field",name:"stretch",static:!1,private:!1,access:{has:e=>"stretch"in e,get:e=>e.stretch,set:(e,t)=>{e.stretch=t}},metadata:e},Tt,Lt),y(null,null,J,{kind:"field",name:"prefixIcon",static:!1,private:!1,access:{has:e=>"prefixIcon"in e,get:e=>e.prefixIcon,set:(e,t)=>{e.prefixIcon=t}},metadata:e},Vt,Bt),y(null,null,X,{kind:"field",name:"suffixIcon",static:!1,private:!1,access:{has:e=>"suffixIcon"in e,get:e=>e.suffixIcon,set:(e,t)=>{e.suffixIcon=t}},metadata:e},Ot,jt),y(null,null,ee,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:e},Pt,Nt),y(null,null,te,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:e},Ht,qt),y(null,null,ie,{kind:"field",name:"passwordToggle",static:!1,private:!1,access:{has:e=>"passwordToggle"in e,get:e=>e.passwordToggle,set:(e,t)=>{e.passwordToggle=t}},metadata:e},_t,Gt),y(null,t={value:p},Re,{kind:"class",name:p.name,metadata:e},null,Me),p=t.value,e&&Object.defineProperty(p,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(p,Me)}constructor(){super(),this.internals=w(this,Fe),this.dirtyValue=!1,this.userEditedValue=!1,this.valueState=w(this,$e,""),this.formDisabled=(w(this,Ie),w(this,Te,!1)),this.constraintInvalid=(w(this,Le),w(this,Ve,!1)),this.customValidationMessage=(w(this,Be),""),this.defaultValue=w(this,Oe,""),this.type=(w(this,je),w(this,Pe,"text")),this.size=(w(this,Ne),w(this,He,"medium")),this.variant=(w(this,qe),w(this,_e,"outlined")),this.placeholder=(w(this,Ge),w(this,Ke,"")),this.label=(w(this,We),w(this,Ue,"")),this.helperText=(w(this,Ze),w(this,Ye,"")),this.errorText=(w(this,Je),w(this,Qe,"")),this.disabled=(w(this,Xe),w(this,et,!1)),this.readonly=(w(this,tt),w(this,it,!1)),this.loading=(w(this,at),w(this,st,!1)),this.required=(w(this,nt),w(this,lt,!1)),this.invalid=(w(this,rt),w(this,ot,!1)),this.clearable=(w(this,ct),w(this,dt,!1)),this.password=(w(this,ht),w(this,ut,!1)),this.min=(w(this,mt),w(this,pt,"")),this.max=(w(this,gt),w(this,bt,"")),this.step=(w(this,ft),w(this,vt,"")),this.pattern=(w(this,yt),w(this,wt,"")),this.maxlength=(w(this,kt),w(this,xt,-1)),this.minlength=(w(this,Ct),w(this,St,-1)),this.autocomplete=(w(this,Et),w(this,Dt,"")),this.name=(w(this,At),w(this,Rt,"")),this.align=(w(this,Mt),w(this,zt,"")),this.labelAlign=(w(this,Ft),w(this,$t,"left")),this.stretch=(w(this,It),w(this,Tt,!1)),this.prefixIcon=(w(this,Lt),w(this,Vt,"")),this.suffixIcon=(w(this,Bt),w(this,Ot,"")),this.input=(w(this,jt),w(this,Pt,void 0)),this.clearButton=(w(this,Nt),w(this,Ht,void 0)),this.passwordToggle=(w(this,qt),w(this,_t,void 0)),this.showPassword=(w(this,Gt),!1),this.inputId=`snice-input-${Math.random().toString(36).slice(2,10)}`,this.descId=`${this.inputId}-desc`,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals()),this.labelAssociation=new Q(this,()=>this.internals,()=>this.interactionDisabled?void 0:this.input,()=>this.label||"Input")}get value(){return this.valueState}set value(e){this.setValue(e,!0)}formAssociatedCallback(){this.syncFormState()}formResetCallback(){this.dirtyValue=!1,this.applyDefaultValue()}formDisabledCallback(e){this.formDisabled=e,this.syncValidity()}formStateRestoreCallback(e){"string"==typeof e&&this.setValue(e,!0)}get interactionDisabled(){return this.disabled||this.formDisabled||this.loading}render(){const t=this.invalid||this.constraintInvalid,i=this.labelAssociation.accessibleName,a=["input",`input--${this.size}`,`input--${this.variant}`,t?"input--invalid":"",this.loading?"input--loading":"",this.prefixIcon?"input--with-prefix-icon":"",this.suffixIcon||"password"===this.type&&this.password||this.loading?"input--with-suffix-icon":"",this.clearable?"input--clearable":""].filter(Boolean).join(" "),s=["label",this.required?"label--required":""].filter(Boolean).join(" "),n=["clear-button",this.suffixIcon||"password"===this.type&&this.password?"clear-button--with-suffix":""].filter(Boolean).join(" ");return e`
|
|
1
|
+
import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as n,render as l,styles as r,ready as o,reconnect as c,watch as d,dispatch as h,dispose as u,css as m,queryAll as p,request as g,isSafeUrl as b,on as f,SimpleArray as v}from"snice";function y(e,t,i,a,s,n){function l(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var r,o=a.kind,c="getter"===o?"get":"setter"===o?"set":"value",d=!t&&e?a.static?e:e.prototype:null,h=t||(d?Object.getOwnPropertyDescriptor(d,a.name):{}),u=!1,m=i.length-1;m>=0;m--){var p={};for(var g in a)p[g]="access"===g?{}:a[g];for(var g in a.access)p.access[g]=a.access[g];p.addInitializer=function(e){if(u)throw new TypeError("Cannot add initializers after decoration has completed");n.push(l(e||null))};var b=(0,i[m])("accessor"===o?{get:h.get,set:h.set}:h[c],p);if("accessor"===o){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(r=l(b.get))&&(h.get=r),(r=l(b.set))&&(h.set=r),(r=l(b.init))&&s.unshift(r)}else(r=l(b))&&("field"===o?s.unshift(r):h[c]=r)}d&&Object.defineProperty(d,a.name,h),u=!0}function w(e,t,i){for(var a=arguments.length>2,s=0;s<t.length;s++)i=a?t[s].call(e,i):t[s].call(e);return a?i:void 0}"function"==typeof SuppressedError&&SuppressedError;const k='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 18 18 6M6 6l12 12"/></svg>',x='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m19.5 8.25-7.5 7.5-7.5-7.5"/></svg>',C='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 15.75 7.5-7.5 7.5 7.5"/></svg>',S='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m8.25 4.5 7.5 7.5-7.5 7.5"/></svg>',E='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>',D='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"/></svg>',A='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m7.5-7.5h-15"/></svg>',R='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 19.5v-15m0 0-6.75 6.75M12 4.5l6.75 6.75"/></svg>',M='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 4.5v15m0 0 6.75-6.75M12 19.5l-6.75-6.75"/></svg>',z='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4.5 12h15m0 0-6.75-6.75M19.5 12l-6.75 6.75"/></svg>',$='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"/></svg>',F='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.511-5.511-3.181"/></svg>',I='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"/></svg>',T='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg>',L='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"/><path d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',V='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"/></svg>',B='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"/></svg>',O='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/><path d="M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"/></svg>',j='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"/></svg>',P={"info-circle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm8.706-1.442c1.146-.573 2.437.463 2.126 1.706l-.709 2.836.042-.02a.75.75 0 0 1 .67 1.34l-.04.022c-1.147.573-2.438-.463-2.127-1.706l.71-2.836-.042.02a.75.75 0 1 1-.671-1.34l.041-.022ZM12 9a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/></svg>',"check-circle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z" clip-rule="evenodd"/></svg>',"exclamation-triangle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003ZM12 8.25a.75.75 0 0 1 .75.75v3.75a.75.75 0 0 1-1.5 0V9a.75.75 0 0 1 .75-.75Zm0 8.25a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z" clip-rule="evenodd"/></svg>',"x-circle":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z" clip-rule="evenodd"/></svg>',"x-mark":k,"chevron-down":x,"chevron-up":C,"chevron-right":S,"chevron-left":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.75 19.5 8.25 12l7.5-7.5"/></svg>',check:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m4.5 12.75 6 6 9-13.5"/></svg>',"magnifying-glass":E,search:E,"bars-3":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"/></svg>',photo:D,"ellipsis-horizontal":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM12.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0ZM18.75 12a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"/></svg>',trash:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"/></svg>',plus:A,camera:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.822 1.316Z"/><path d="M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z"/></svg>',pencil:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"/></svg>',"arrow-up":R,"arrow-down":M,"arrow-right":z,"arrow-trending-up":$,"arrow-trending-down":F,star:'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.007 5.404.433c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.433 2.082-5.006Z" clip-rule="evenodd"/></svg>',"star-outline":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"/></svg>',circle:'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="12" cy="12" r="8"/></svg>',"paper-clip":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"/></svg>',"paper-airplane":'<svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"/></svg>',"arrow-down-tray":T,"arrow-up-tray":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"/></svg>',"chat-bubble":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"/></svg>',"rocket-launch":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"/></svg>',key:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"/></svg>',"arrows-right-left":j,"arrows-pointing-out":V,"eye-slash":B,"map-pin":O,fire:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.362 5.214A8.252 8.252 0 0 1 12 21 8.25 8.25 0 0 1 6.038 7.047 8.287 8.287 0 0 0 9 9.601a8.983 8.983 0 0 1 3.361-6.867 8.21 8.21 0 0 0 3 2.48Z"/><path d="M12 18a3.75 3.75 0 0 0 .495-7.468 5.99 5.99 0 0 0-1.925 3.547 5.975 5.975 0 0 1-2.133-1.001A3.75 3.75 0 0 0 12 18Z"/></svg>',"cog-6-tooth":L,settings:L,envelope:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"/></svg>',"light-bulb":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"/></svg>',users:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"/></svg>',heart:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z"/></svg>',home:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"/></svg>',"chart-bar":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"/></svg>',scissors:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.848 8.25l1.536.887M7.848 8.25a3 3 0 1 1-5.196-3 3 3 0 0 1 5.196 3Zm1.536.887a2.165 2.165 0 0 1 1.083 1.839c.005.351.054.695.14 1.024M9.384 9.137l2.077 1.199M7.848 15.75l1.536-.887m-1.536.887a3 3 0 1 1-5.196 3 3 3 0 0 1 5.196-3Zm1.536-.887a2.165 2.165 0 0 0 1.083-1.838c.005-.352.054-.695.14-1.025m-1.223 2.863 2.077-1.199m0-3.328a4.323 4.323 0 0 1 2.068-1.379l5.325-1.628a4.5 4.5 0 0 1 2.48-.044l.803.215-7.794 4.5m-2.882-.375a4.33 4.33 0 0 0 .655 3.736m2.227-3.361 7.794 4.5-.802.215a4.5 4.5 0 0 1-2.48-.043l-5.326-1.629a4.324 4.324 0 0 1-2.068-1.379m0 0-2.077 1.199"/></svg>',user:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"/></svg>',clipboard:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"/></svg>',"bug-ant":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"/></svg>',"calendar-days":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"/></svg>',sparkles:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"/></svg>',"bell-alert":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0M3.124 7.5A8.969 8.969 0 0 1 5.292 3m13.416 0a8.969 8.969 0 0 1 2.168 4.5"/></svg>',cube:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"/></svg>',banknotes:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"/></svg>',cake:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 8.25v-1.5m0 1.5c-1.355 0-2.697.056-4.024.166C6.845 8.51 6 9.473 6 10.608v2.513m6-4.871c1.355 0 2.697.056 4.024.166C17.155 8.51 18 9.473 18 10.608v2.513M15 8.25v-1.5m-6 1.5v-1.5m12 9.75-1.5.75a3.354 3.354 0 0 1-3 0 3.354 3.354 0 0 0-3 0 3.354 3.354 0 0 1-3 0 3.354 3.354 0 0 0-3 0 3.354 3.354 0 0 1-3 0L3 16.5m15-3.379a48.474 48.474 0 0 0-6-.371c-2.032 0-4.034.126-6 .371m12 0c.39.049.777.102 1.163.16 1.07.16 1.837 1.094 1.837 2.175v5.169c0 .621-.504 1.125-1.125 1.125H4.125A1.125 1.125 0 0 1 3 20.625v-5.17c0-1.08.768-2.014 1.837-2.174A47.78 47.78 0 0 1 6 13.12"/></svg>',"paint-brush":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"/></svg>',gift:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 11.25v8.25a1.5 1.5 0 0 1-1.5 1.5H4.5a1.5 1.5 0 0 1-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 1 0 9.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1 1 14.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"/></svg>',folder:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"/></svg>',"document-text":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"/></svg>',bell:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"/></svg>',link:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"/></svg>',phone:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"/></svg>',"computer-desktop":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"/></svg>',"musical-note":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 10.5-3m0 6.553v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 1 1-.99-3.467l2.31-.66a2.25 2.25 0 0 0 1.632-2.163Zm0 0V2.25L9 5.25v10.303m0 0v3.75a2.25 2.25 0 0 1-1.632 2.163l-1.32.377a1.803 1.803 0 0 1-.99-3.467l2.31-.66A2.25 2.25 0 0 0 9 15.553Z"/></svg>',"lock-closed":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"/></svg>',"table-cells":'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3.375 19.5h17.25m-17.25 0a1.125 1.125 0 0 1-1.125-1.125M3.375 19.5h7.5c.621 0 1.125-.504 1.125-1.125m-9.75 0V5.625m0 12.75v-1.5c0-.621.504-1.125 1.125-1.125m18.375 2.625V5.625m0 12.75c0 .621-.504 1.125-1.125 1.125m1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125m0 3.75h-7.5A1.125 1.125 0 0 1 12 18.375m9.75-12.75c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125m19.5 0v1.5c0 .621-.504 1.125-1.125 1.125M2.25 5.625v1.5c0 .621.504 1.125 1.125 1.125m0 0h17.25m-17.25 0h7.5c.621 0 1.125.504 1.125 1.125M3.375 8.25c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125m17.25-3.75h-7.5c-.621 0-1.125.504-1.125 1.125m8.625-1.125c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125M12 10.875v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 10.875c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125M13.125 12h7.5m-7.5 0c-.621 0-1.125.504-1.125 1.125M20.625 12c.621 0 1.125.504 1.125 1.125v1.5c0 .621-.504 1.125-1.125 1.125m-17.25 0h7.5M12 14.625v-1.5m0 1.5c0 .621-.504 1.125-1.125 1.125M12 14.625c0 .621.504 1.125 1.125 1.125m-2.25 0c.621 0 1.125.504 1.125 1.125m0 1.5v-1.5m0 0c0-.621.504-1.125 1.125-1.125m8.625 1.125c0 .621-.504 1.125-1.125 1.125h-7.5"/></svg>',minus:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/></svg>'},N={toAttribute:e=>"string"==typeof e?e:null};function H(i,a="icon"){if(!i)return e``;const{kind:s,value:n}=function(e){if(e.startsWith("img://"))return{kind:"img",value:e.slice(6)};if(e.startsWith("text://"))return{kind:"text",value:e.slice(7)};const t=/^(https?:\/\/|\/|\.\/|\.\.\/|data:)/.test(e),i=/^[^:]*\w\.(svg|png|jpe?g|jfif|pjp|gif|webp|avif|jxl|ico|cur|bmp|tiff?|heic|heif|apng)(\?.*)?$/i.test(e);return t||i?{kind:"img",value:e}:P[e]?{kind:"registry",value:e}:{kind:"text",value:e}}(i);return"img"===s?e`<img class="${a}" src="${n}" alt="" part="icon" />`:"registry"===s?e`<span class="${a}" part="icon">${t(P[n])}</span>`:/^[a-z][a-z0-9_]*$/.test(n)?e`<span class="${a} snice-icon-ligature" style="font-family:var(--snice-icon-font,'Material Symbols Outlined'),sans-serif" part="icon">${n}</span>`:e`<span class="${a}" part="icon">${n}</span>`}const q=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"];function _(e){return q.some(t=>Boolean(e[t]))}function G(e,t,i,a){e&&"function"==typeof e.setValidity&&(_(t)?a?e.setValidity(t,i,a):e.setValidity(t,i):e.setValidity({}))}function K(e,t){if(t?.form)return t.form;const i=e.getAttribute("form");if(null!==i){const t=e.getRootNode();return"querySelectorAll"in t?Array.from(t.querySelectorAll("form[id]")).find(e=>e instanceof HTMLFormElement&&e.id===i)??null:null}return e.closest("form")}const W=new WeakMap;function U(e){return e.replace(/\s+/gu," ").trim()}function Z(e,t){return e===t||e.nodeType===Node.ELEMENT_NODE&&e.contains(t)}function Y(e,t){const i=e.getRootNode();return"getElementById"in i?i.getElementById(t):null}function J(e,t){if(e===t)return"";if(e.nodeType===Node.TEXT_NODE)return e.nodeValue||"";if(e.nodeType!==Node.ELEMENT_NODE)return"";const i=e;return i.hidden||"true"===i.getAttribute("aria-hidden")||["script","style","template"].includes(i.localName)?"":"br"===i.localName?" ":"img"===i.localName?i.getAttribute("alt")||"":Array.from(i.childNodes).map(e=>J(e,t)).join(" ")}function Q(e,t){const i=e.getAttribute("aria-labelledby");if(i){const a=i.split(/\s+/u).map(t=>Y(e,t)).filter(t=>Boolean(t)&&t!==e).map(e=>J(e,t)),s=U(a.join(" "));if(s)return s}return e.hasAttribute("aria-label")?U(e.getAttribute("aria-label")||""):U(J(e,t))||U(e.getAttribute("title")||"")}class X{constructor(e,t,i,a,s){this.host=e,this.getInternals=t,this.getTarget=i,this.getFallbackName=a,this.syncRelatedNames=s,this.connected=!1,this.currentLabels=[],this.currentNamingNodes=[],this.referencedIds=new Set,this.handleHostActivation=e=>{if(e.composedPath()[0]!==this.host)return;if(this.currentLabels=this.resolveLabels(),0===this.currentLabels.length)return;const t=this.getTarget();t?t.focus():e.preventDefault()},this.handleLabelActivation=e=>{const t=e.composedPath(),i=e.target;if(i===this.host||i instanceof Node&&this.host.contains(i))return;const a=e.currentTarget;if(t.some(e=>e instanceof HTMLElement&&e!==a&&e.matches('a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), [role="button"], [role="link"]')))return;const s=this.getTarget();s?(s.focus(),setTimeout(()=>{const e=this.getTarget();this.connected&&e?.isConnected&&this.currentLabels.includes(a)&&e.focus()},0)):e.preventDefault()}}get labels(){const e=this.host.getRootNode();if(this.host.id&&"querySelectorAll"in e)try{const t=CSS.escape(this.host.id),i=CSS.escape(this.host.localName);return e.querySelectorAll(`label[for="${t}"], label:not([for]):has(${i}#${t})`)}catch{}return this.getInternals()?.labels??null}get accessibleName(){const e=this.resolveLabels();return U(e.length>0?e.map(e=>Q(e,this.host)).join(" "):this.getFallbackName())}connect(){this.connected||(this.connected=!0,this.host.addEventListener("click",this.handleHostActivation),this.bindRegistry(),this.sync())}disconnect(){this.connected&&(this.connected=!1,this.host.removeEventListener("click",this.handleHostActivation),this.unbindLabelActivation(),this.releaseRegistry(),this.currentLabels=[],this.currentNamingNodes=[],this.referencedIds.clear())}sync(){if(this.connected&&this.bindRegistry(),this.unbindLabelActivation(),this.currentLabels=this.resolveLabels(),this.connected)for(const e of this.currentLabels)e.addEventListener("click",this.handleLabelActivation);this.currentNamingNodes=[...this.currentLabels],this.referencedIds.clear();for(const e of this.currentLabels)for(const t of(e.getAttribute("aria-labelledby")||"").split(/\s+/u).filter(Boolean)){this.referencedIds.add(t);const i=Y(e,t);i&&i!==e&&this.currentNamingNodes.push(i)}const e=U(this.currentLabels.length>0?this.currentLabels.map(e=>Q(e,this.host)).join(" "):this.getFallbackName());this.getTarget()?.setAttribute("aria-label",e),this.syncRelatedNames?.(e)}isAffectedBy(e){if("attributes"===e.type){if(e.target===this.host&&"id"===e.attributeName)return!0;const t=e.target;return"label"===t.localName&&"for"===e.attributeName?this.currentLabels.includes(t)||Boolean(this.host.id)&&t.htmlFor===this.host.id:!("id"!==e.attributeName||!this.referencedIds.has(t.id))||this.currentNamingNodes.some(e=>e===t||e.contains(t))}return!!this.currentNamingNodes.some(t=>t===e.target||t.contains(e.target))||"childList"===e.type&&[...e.addedNodes,...e.removedNodes].some(e=>{if(Z(e,this.host)||Z(this.host,e))return!0;if(this.currentNamingNodes.some(t=>Z(e,t)))return!0;if(e.nodeType!==Node.ELEMENT_NODE)return!1;const t=e;return!!("label"===t.localName?[t]:Array.from(t.querySelectorAll("label"))).some(e=>e.hasAttribute("for")?Boolean(this.host.id)&&e.htmlFor===this.host.id:e.contains(this.host))||[t,...Array.from(t.querySelectorAll("[id]"))].some(e=>this.referencedIds.has(e.id))})}unbindLabelActivation(){for(const e of this.currentLabels)e.removeEventListener("click",this.handleLabelActivation)}bindRegistry(){const e=function(e){const t=e.getRootNode();return t.nodeType===Node.DOCUMENT_NODE||"undefined"!=typeof ShadowRoot&&t instanceof ShadowRoot?t:null}(this.host);e!==this.registryRoot&&(this.releaseRegistry(),e&&(this.registryRoot=e,this.registry=function(e){const t=e.nodeType===Node.DOCUMENT_NODE?e.documentElement:e;if(!t||"undefined"==typeof MutationObserver)return null;const i=W.get(e);if(i)return i;const a=new Set,s=new MutationObserver(e=>{for(const t of a)e.some(e=>t.isAffectedBy(e))&&t.sync()});s.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["for","id","aria-label","aria-labelledby","aria-hidden","hidden","alt","title"]});const n={associations:a,observer:s};return W.set(e,n),n}(e)||void 0,this.registry?.associations.add(this)))}releaseRegistry(){this.registry?.associations.delete(this),this.registry&&0===this.registry.associations.size&&this.registryRoot&&(this.registry.observer.disconnect(),W.delete(this.registryRoot)),this.registry=void 0,this.registryRoot=void 0}resolveLabels(){const e=this.host.getRootNode();return"querySelectorAll"in e?Array.from(e.querySelectorAll("label")).filter(e=>e.hasAttribute("for")?Boolean(this.host.id)&&e.htmlFor===this.host.id:e.contains(this.host)):Array.from(this.getInternals()?.labels||[])}}(()=>{let t,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B,O,j,P,N,W,U,Z,Y,J,Q,ee,te,ie,ae,se,ne,le,re,oe,ce,de,he,ue,me,pe,ge,be,fe,ve,ye,we,ke,xe,Ce,Se,Ee,De,Ae,Re=[i("snice-input",{formAssociated:!0,delegatesFocus:!0})],Me=[],ze=HTMLElement,$e=[],Fe=[],Ie=[],Te=[],Le=[],Ve=[],Be=[],Oe=[],je=[],Pe=[],Ne=[],He=[],qe=[],_e=[],Ge=[],Ke=[],We=[],Ue=[],Ze=[],Ye=[],Je=[],Qe=[],Xe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],mt=[],pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],$t=[],Ft=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[],_t=[],Gt=[];(class extends ze{static{p=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(ze[Symbol.metadata]??null):void 0;g=[a()],b=[a()],f=[a()],v=[s({attribute:"value"})],k=[s({})],x=[s({})],C=[s({})],S=[s({})],E=[s({})],D=[s({attribute:"helper-text"})],A=[s({attribute:"error-text"})],R=[s({type:Boolean})],M=[s({type:Boolean})],z=[s({type:Boolean})],$=[s({type:Boolean})],F=[s({type:Boolean})],I=[s({type:Boolean})],T=[s({type:Boolean})],L=[s({})],V=[s({})],B=[s({})],O=[s({})],j=[s({type:Number})],P=[s({type:Number})],N=[s({})],W=[s({})],U=[s({})],Z=[s({attribute:"label-align"})],Y=[s({type:Boolean})],J=[s({attribute:"prefix-icon"})],Q=[s({attribute:"suffix-icon"})],ee=[n(".input")],te=[n(".clear-button")],ie=[n(".password-toggle")],ae=[l()],se=[r()],ne=[o()],le=[c()],re=[d("valueState")],oe=[d("invalid")],ce=[d("disabled","loading","formDisabled")],de=[d("readonly")],he=[d("defaultValue")],ue=[d("placeholder")],me=[d("min")],pe=[d("max")],ge=[d("step")],be=[d("maxlength")],fe=[d("minlength")],ve=[d("pattern")],ye=[d("type")],we=[d("required")],ke=[d("label")],xe=[h("input-input",{bubbles:!0,composed:!0})],Ce=[h("input-change",{bubbles:!0,composed:!0})],Se=[h("input-focus",{bubbles:!0,composed:!0})],Ee=[h("input-blur",{bubbles:!0,composed:!0})],De=[h("input-clear",{bubbles:!0,composed:!0})],Ae=[u()],y(this,null,ae,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,$e),y(this,null,se,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,$e),y(this,null,ne,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,$e),y(this,null,le,{kind:"method",name:"onReconnect",static:!1,private:!1,access:{has:e=>"onReconnect"in e,get:e=>e.onReconnect},metadata:e},null,$e),y(this,null,re,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:e},null,$e),y(this,null,oe,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:e},null,$e),y(this,null,ce,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:e},null,$e),y(this,null,de,{kind:"method",name:"handleReadonlyChange",static:!1,private:!1,access:{has:e=>"handleReadonlyChange"in e,get:e=>e.handleReadonlyChange},metadata:e},null,$e),y(this,null,he,{kind:"method",name:"handleDefaultValueChange",static:!1,private:!1,access:{has:e=>"handleDefaultValueChange"in e,get:e=>e.handleDefaultValueChange},metadata:e},null,$e),y(this,null,ue,{kind:"method",name:"handlePlaceholderChange",static:!1,private:!1,access:{has:e=>"handlePlaceholderChange"in e,get:e=>e.handlePlaceholderChange},metadata:e},null,$e),y(this,null,me,{kind:"method",name:"handleMinChange",static:!1,private:!1,access:{has:e=>"handleMinChange"in e,get:e=>e.handleMinChange},metadata:e},null,$e),y(this,null,pe,{kind:"method",name:"handleMaxChange",static:!1,private:!1,access:{has:e=>"handleMaxChange"in e,get:e=>e.handleMaxChange},metadata:e},null,$e),y(this,null,ge,{kind:"method",name:"handleStepChange",static:!1,private:!1,access:{has:e=>"handleStepChange"in e,get:e=>e.handleStepChange},metadata:e},null,$e),y(this,null,be,{kind:"method",name:"handleMaxLengthChange",static:!1,private:!1,access:{has:e=>"handleMaxLengthChange"in e,get:e=>e.handleMaxLengthChange},metadata:e},null,$e),y(this,null,fe,{kind:"method",name:"handleMinLengthChange",static:!1,private:!1,access:{has:e=>"handleMinLengthChange"in e,get:e=>e.handleMinLengthChange},metadata:e},null,$e),y(this,null,ve,{kind:"method",name:"handlePatternChange",static:!1,private:!1,access:{has:e=>"handlePatternChange"in e,get:e=>e.handlePatternChange},metadata:e},null,$e),y(this,null,ye,{kind:"method",name:"handleTypeChange",static:!1,private:!1,access:{has:e=>"handleTypeChange"in e,get:e=>e.handleTypeChange},metadata:e},null,$e),y(this,null,we,{kind:"method",name:"handleRequiredChange",static:!1,private:!1,access:{has:e=>"handleRequiredChange"in e,get:e=>e.handleRequiredChange},metadata:e},null,$e),y(this,null,ke,{kind:"method",name:"handleLabelChange",static:!1,private:!1,access:{has:e=>"handleLabelChange"in e,get:e=>e.handleLabelChange},metadata:e},null,$e),y(this,null,xe,{kind:"method",name:"dispatchInputEvent",static:!1,private:!1,access:{has:e=>"dispatchInputEvent"in e,get:e=>e.dispatchInputEvent},metadata:e},null,$e),y(this,null,Ce,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:e},null,$e),y(this,null,Se,{kind:"method",name:"dispatchFocusEvent",static:!1,private:!1,access:{has:e=>"dispatchFocusEvent"in e,get:e=>e.dispatchFocusEvent},metadata:e},null,$e),y(this,null,Ee,{kind:"method",name:"dispatchBlurEvent",static:!1,private:!1,access:{has:e=>"dispatchBlurEvent"in e,get:e=>e.dispatchBlurEvent},metadata:e},null,$e),y(this,null,De,{kind:"method",name:"dispatchClearEvent",static:!1,private:!1,access:{has:e=>"dispatchClearEvent"in e,get:e=>e.dispatchClearEvent},metadata:e},null,$e),y(this,null,Ae,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,$e),y(null,null,g,{kind:"field",name:"valueState",static:!1,private:!1,access:{has:e=>"valueState"in e,get:e=>e.valueState,set:(e,t)=>{e.valueState=t}},metadata:e},Fe,Ie),y(null,null,b,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},Te,Le),y(null,null,f,{kind:"field",name:"constraintInvalid",static:!1,private:!1,access:{has:e=>"constraintInvalid"in e,get:e=>e.constraintInvalid,set:(e,t)=>{e.constraintInvalid=t}},metadata:e},Ve,Be),y(null,null,v,{kind:"field",name:"defaultValue",static:!1,private:!1,access:{has:e=>"defaultValue"in e,get:e=>e.defaultValue,set:(e,t)=>{e.defaultValue=t}},metadata:e},Oe,je),y(null,null,k,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},Pe,Ne),y(null,null,x,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},He,qe),y(null,null,C,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},_e,Ge),y(null,null,S,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:e},Ke,We),y(null,null,E,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},Ue,Ze),y(null,null,D,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:e},Ye,Je),y(null,null,A,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:e},Qe,Xe),y(null,null,R,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},et,tt),y(null,null,M,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:e},it,at),y(null,null,z,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},st,nt),y(null,null,$,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:e},lt,rt),y(null,null,F,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:e},ot,ct),y(null,null,I,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:e},dt,ht),y(null,null,T,{kind:"field",name:"password",static:!1,private:!1,access:{has:e=>"password"in e,get:e=>e.password,set:(e,t)=>{e.password=t}},metadata:e},ut,mt),y(null,null,L,{kind:"field",name:"min",static:!1,private:!1,access:{has:e=>"min"in e,get:e=>e.min,set:(e,t)=>{e.min=t}},metadata:e},pt,gt),y(null,null,V,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:e},bt,ft),y(null,null,B,{kind:"field",name:"step",static:!1,private:!1,access:{has:e=>"step"in e,get:e=>e.step,set:(e,t)=>{e.step=t}},metadata:e},vt,yt),y(null,null,O,{kind:"field",name:"pattern",static:!1,private:!1,access:{has:e=>"pattern"in e,get:e=>e.pattern,set:(e,t)=>{e.pattern=t}},metadata:e},wt,kt),y(null,null,j,{kind:"field",name:"maxlength",static:!1,private:!1,access:{has:e=>"maxlength"in e,get:e=>e.maxlength,set:(e,t)=>{e.maxlength=t}},metadata:e},xt,Ct),y(null,null,P,{kind:"field",name:"minlength",static:!1,private:!1,access:{has:e=>"minlength"in e,get:e=>e.minlength,set:(e,t)=>{e.minlength=t}},metadata:e},St,Et),y(null,null,N,{kind:"field",name:"autocomplete",static:!1,private:!1,access:{has:e=>"autocomplete"in e,get:e=>e.autocomplete,set:(e,t)=>{e.autocomplete=t}},metadata:e},Dt,At),y(null,null,W,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:e},Rt,Mt),y(null,null,U,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},zt,$t),y(null,null,Z,{kind:"field",name:"labelAlign",static:!1,private:!1,access:{has:e=>"labelAlign"in e,get:e=>e.labelAlign,set:(e,t)=>{e.labelAlign=t}},metadata:e},Ft,It),y(null,null,Y,{kind:"field",name:"stretch",static:!1,private:!1,access:{has:e=>"stretch"in e,get:e=>e.stretch,set:(e,t)=>{e.stretch=t}},metadata:e},Tt,Lt),y(null,null,J,{kind:"field",name:"prefixIcon",static:!1,private:!1,access:{has:e=>"prefixIcon"in e,get:e=>e.prefixIcon,set:(e,t)=>{e.prefixIcon=t}},metadata:e},Vt,Bt),y(null,null,Q,{kind:"field",name:"suffixIcon",static:!1,private:!1,access:{has:e=>"suffixIcon"in e,get:e=>e.suffixIcon,set:(e,t)=>{e.suffixIcon=t}},metadata:e},Ot,jt),y(null,null,ee,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:e},Pt,Nt),y(null,null,te,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:e},Ht,qt),y(null,null,ie,{kind:"field",name:"passwordToggle",static:!1,private:!1,access:{has:e=>"passwordToggle"in e,get:e=>e.passwordToggle,set:(e,t)=>{e.passwordToggle=t}},metadata:e},_t,Gt),y(null,t={value:p},Re,{kind:"class",name:p.name,metadata:e},null,Me),p=t.value,e&&Object.defineProperty(p,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(p,Me)}constructor(){super(),this.internals=w(this,$e),this.dirtyValue=!1,this.userEditedValue=!1,this.valueState=w(this,Fe,""),this.formDisabled=(w(this,Ie),w(this,Te,!1)),this.constraintInvalid=(w(this,Le),w(this,Ve,!1)),this.customValidationMessage=(w(this,Be),""),this.defaultValue=w(this,Oe,""),this.type=(w(this,je),w(this,Pe,"text")),this.size=(w(this,Ne),w(this,He,"medium")),this.variant=(w(this,qe),w(this,_e,"outlined")),this.placeholder=(w(this,Ge),w(this,Ke,"")),this.label=(w(this,We),w(this,Ue,"")),this.helperText=(w(this,Ze),w(this,Ye,"")),this.errorText=(w(this,Je),w(this,Qe,"")),this.disabled=(w(this,Xe),w(this,et,!1)),this.readonly=(w(this,tt),w(this,it,!1)),this.loading=(w(this,at),w(this,st,!1)),this.required=(w(this,nt),w(this,lt,!1)),this.invalid=(w(this,rt),w(this,ot,!1)),this.clearable=(w(this,ct),w(this,dt,!1)),this.password=(w(this,ht),w(this,ut,!1)),this.min=(w(this,mt),w(this,pt,"")),this.max=(w(this,gt),w(this,bt,"")),this.step=(w(this,ft),w(this,vt,"")),this.pattern=(w(this,yt),w(this,wt,"")),this.maxlength=(w(this,kt),w(this,xt,-1)),this.minlength=(w(this,Ct),w(this,St,-1)),this.autocomplete=(w(this,Et),w(this,Dt,"")),this.name=(w(this,At),w(this,Rt,"")),this.align=(w(this,Mt),w(this,zt,"")),this.labelAlign=(w(this,$t),w(this,Ft,"left")),this.stretch=(w(this,It),w(this,Tt,!1)),this.prefixIcon=(w(this,Lt),w(this,Vt,"")),this.suffixIcon=(w(this,Bt),w(this,Ot,"")),this.input=(w(this,jt),w(this,Pt,void 0)),this.clearButton=(w(this,Nt),w(this,Ht,void 0)),this.passwordToggle=(w(this,qt),w(this,_t,void 0)),this.showPassword=(w(this,Gt),!1),this.inputId=`snice-input-${Math.random().toString(36).slice(2,10)}`,this.descId=`${this.inputId}-desc`,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals()),this.labelAssociation=new X(this,()=>this.internals,()=>this.interactionDisabled?void 0:this.input,()=>this.label||"Input")}get value(){return this.valueState}set value(e){this.setValue(e,!0)}formAssociatedCallback(){this.syncFormState()}formResetCallback(){this.dirtyValue=!1,this.applyDefaultValue()}formDisabledCallback(e){this.formDisabled=e,this.syncValidity()}formStateRestoreCallback(e){"string"==typeof e&&this.setValue(e,!0)}get interactionDisabled(){return this.disabled||this.formDisabled||this.loading}render(){const t=this.invalid||this.constraintInvalid,i=this.labelAssociation.accessibleName,a=["input",`input--${this.size}`,`input--${this.variant}`,t?"input--invalid":"",this.loading?"input--loading":"",this.prefixIcon?"input--with-prefix-icon":"",this.suffixIcon||"password"===this.type&&this.password||this.loading?"input--with-suffix-icon":"",this.clearable?"input--clearable":""].filter(Boolean).join(" "),s=["label",this.required?"label--required":""].filter(Boolean).join(" "),n=["clear-button",this.suffixIcon||"password"===this.type&&this.password?"clear-button--with-suffix":""].filter(Boolean).join(" ");return e`
|
|
2
2
|
<div class="input-wrapper" part="wrapper">
|
|
3
3
|
<if ${this.label}>
|
|
4
4
|
<label class="${s}" part="label" for="${this.inputId}">
|
|
@@ -10,7 +10,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
10
10
|
<span class="icon-slot icon-slot--prefix" part="prefix-icon">
|
|
11
11
|
<slot name="prefix-icon">
|
|
12
12
|
<if ${this.prefixIcon}>
|
|
13
|
-
${
|
|
13
|
+
${H(this.prefixIcon,"icon icon--prefix")}
|
|
14
14
|
</if>
|
|
15
15
|
</slot>
|
|
16
16
|
</span>
|
|
@@ -83,7 +83,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
83
83
|
<span class="icon-slot icon-slot--suffix" part="suffix-icon">
|
|
84
84
|
<slot name="suffix-icon">
|
|
85
85
|
<if ${this.suffixIcon}>
|
|
86
|
-
${
|
|
86
|
+
${H(this.suffixIcon,"icon icon--suffix")}
|
|
87
87
|
</if>
|
|
88
88
|
</slot>
|
|
89
89
|
</span>
|
|
@@ -101,7 +101,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
101
101
|
</default>
|
|
102
102
|
</case>
|
|
103
103
|
</div>
|
|
104
|
-
`}styles(){return m`${":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);color-scheme:light dark}.input-wrapper{position:relative;width:100%;max-width:100%;height:100%;box-sizing:border-box}:host([align]) .input-wrapper{display:flex;flex-direction:column}:host([align=top]) .input-wrapper{justify-content:flex-start}:host([align=center]) .input-wrapper{justify-content:center}:host([align=bottom]) .input-wrapper{justify-content:flex-end}.input-container{position:relative;display:flex;align-items:center;width:100%;max-width:100%;box-sizing:border-box;transition:all var(--snice-transition-fast, 150ms) ease}:host([stretch]) .input-wrapper{display:flex;flex-direction:column}:host([stretch]) .input-container{flex:1}:host([stretch]) .input{height:100%}.input{flex:1;min-width:0;box-sizing:border-box;font-family:inherit;font-size:var(--snice-font-size-md, 1rem);background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease);outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.input:hover:not(:focus):not(:disabled){border-color:var(--snice-color-border-hover,rgb(204 204 204))}.input:disabled{background:var(--snice-color-surface-container-low,rgb(250 250 250));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.input--outlined{background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226))}.input--filled{background:var(--snice-color-surface-container-low,rgb(250 250 250));border:1px solid transparent;border-bottom-color:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem) var(--snice-border-radius-md,.25rem) 0 0}.input--filled:focus-visible{background:var(--snice-color-surface-hover,rgb(245 245 245));border-bottom-color:var(--snice-color-primary,rgb(37 99 235))}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:0;padding-left:0;padding-right:0;box-shadow:none}.input-container:has(.input--underlined){position:relative}.input-container:has(.input--underlined)::after{content:'';position:absolute;left:50%;right:50%;bottom:-1px;height:2px;background:var(--snice-color-primary,rgb(37 99 235));transition:left .2s var(--snice-ease-out, ease),right .2s var(--snice-ease-out, ease);pointer-events:none}.input-container:has(.input--underlined:focus-visible)::after{left:0;right:0}.input--underlined:focus-visible{border-bottom-color:var(--snice-color-border,rgb(226 226 226));box-shadow:none}.input--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.input--invalid:focus-visible{border-color:var(--snice-color-danger,rgb(220 38 38));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-color-danger-alpha,rgb(220 38 38 / .4)),var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05))}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.5rem}.input--clearable,.input--with-suffix-icon{padding-right:2.5rem}.input--with-suffix-icon.input--clearable{padding-right:4rem}.label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}:host([label-align=center]) .label{text-align:center}:host([label-align=right]) .label{text-align:right}.label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs, .75rem)}.helper-text{color:var(--snice-color-text-secondary,rgb(82 82 82))}.error-text{color:var(--snice-color-danger,rgb(220 38 38))}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;opacity:.7}.icon-slot:empty{display:none}.icon-slot--prefix{left:.625rem}.icon-slot--suffix{right:.625rem}.icon{display:flex;align-items:center;justify-content:center;overflow:hidden;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.5rem;height:1.5rem}.icon-slot ::slotted(img){width:1.5rem;height:1.5rem;object-fit:contain}.clear-button{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input-container:hover .clear-button--visible,.input:focus-visible~.clear-button--visible{opacity:1;visibility:visible}.clear-button--with-suffix{right:2rem}.password-toggle{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease}.password-toggle:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button,.input[type=search]::-webkit-search-decoration,.input[type=search]::-webkit-search-results-button,.input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.input-container:focus-within{z-index:1}.input--loading{cursor:wait}.spinner{position:absolute;right:.75rem;width:1em;height:1em;pointer-events:none}.input--with-suffix-icon .spinner{right:2.5rem}.spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}init(){if(Object.prototype.hasOwnProperty.call(this,"value")){const e=this.value;delete this.value,this.value=String(e??"")}else this.dirtyValue||this.applyDefaultValue();if(this.syncFormValue(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}this.input&&this.invalid&&(this.input.setAttribute("aria-invalid","true"),this.input.classList.add("input--invalid")),this.input&&("number"===this.type&&(this.min&&(this.input.min=this.min),this.max&&(this.input.max=this.max),this.step&&(this.input.step=this.step)),this.maxlength>0&&(this.input.maxLength=this.maxlength),this.minlength>0&&(this.input.minLength=this.minlength),this.pattern&&(this.input.pattern=this.pattern),this.placeholder&&(this.input.placeholder=this.placeholder),this.value&&(this.input.value=this.value),this.input.disabled=this.interactionDisabled,this.input.readOnly=this.readonly,this.input.required=this.required),this.syncValidity(),this.labelAssociation.connect()}onReconnect(){this.labelAssociation.connect()}applyDefaultValue(){this.setValue(this.defaultValue,!1)}setValue(e,t,i=!1){t&&(this.dirtyValue=!0),this.userEditedValue=i,this.valueState=String(e??""),this.syncFormState()}syncFormValue(){this.internals?.setFormValue(this.value,this.value)}syncFormState(){this.syncFormValue(),this.syncValidity()}syncValidity(){const e=this.input;if(!e){const e=this.interactionDisabled||this.readonly?{}:{customError:Boolean(this.customValidationMessage),valueMissing:this.required&&!this.value},t=q(e);return this.constraintInvalid=t,void _(this.internals,e,this.customValidationMessage||(t?"Please enter a valid value.":""))}e.value!==this.value&&(e.value=this.value),e.type="password"===this.type&&this.showPassword?"text":this.type,e.disabled=this.interactionDisabled,e.readOnly=this.readonly,e.required=this.required,this.min?e.min=this.min:e.removeAttribute("min"),this.max?e.max=this.max:e.removeAttribute("max"),this.step?e.step=this.step:e.removeAttribute("step"),this.pattern?e.pattern=this.pattern:e.removeAttribute("pattern"),this.maxlength>0?e.maxLength=this.maxlength:e.removeAttribute("maxlength"),this.minlength>0?e.minLength=this.minlength:e.removeAttribute("minlength"),e.setCustomValidity(this.customValidationMessage);const t=this.interactionDisabled||this.readonly,i=["text","search","url","tel","email","password"].includes(this.type),a=["number","date","time","datetime-local"].includes(this.type)&&""!==this.value&&""===e.value,s=t?{}:function(e,t={}){const i={};for(const t of H)i[t]=e[t];return Object.assign(i,t)}(e.validity,{badInput:e.validity.badInput||a,tooLong:i&&this.userEditedValue&&this.maxlength>0&&this.value.length>this.maxlength,tooShort:i&&this.userEditedValue&&this.minlength>0&&this.value.length>0&&this.value.length<this.minlength}),n=q(s),l=this.customValidationMessage||e.validationMessage||(n?"Please enter a valid value.":"");this.constraintInvalid=n;const r=this.invalid||n;e.setAttribute("aria-invalid",String(r)),e.classList.toggle("input--invalid",r),_(this.internals,s,l,e)}handleInput(e){this.setValue(e.target.value,!0,!0),this.dispatchInputEvent()}handleChange(e){this.setValue(e.target.value,!0,!0),this.dispatchChangeEvent()}handleFocus(e){this.dispatchFocusEvent()}handleBlur(e){this.dispatchBlurEvent()}handleClear(e){this.clear()}handlePasswordToggle(e){if(this.showPassword=!this.showPassword,this.input&&(this.input.type=this.showPassword?"text":"password"),this.passwordToggle){const e=this.passwordToggle.querySelector(".password-icon--hidden"),t=this.passwordToggle.querySelector(".password-icon--visible");e&&t&&(e.style.display=this.showPassword?"none":"",t.style.display=this.showPassword?"":"none",this.passwordToggle.setAttribute("aria-label",this.showPassword?"Hide password":"Show password"))}}handleValueChange(){if(this.input&&this.input.value!==this.value&&(this.input.value=this.value),this.syncFormState(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleInvalidChange(){if(this.input){const e=this.invalid||this.constraintInvalid;this.input.setAttribute("aria-invalid",String(e)),this.input.classList.toggle("input--invalid",e)}}handleDisabledChange(){if(this.input&&(this.input.disabled=this.interactionDisabled),this.syncValidity(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleReadonlyChange(){if(this.input&&(this.input.readOnly=this.readonly),this.syncValidity(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleDefaultValueChange(){this.dirtyValue||this.applyDefaultValue()}handlePlaceholderChange(){this.input&&(this.input.placeholder=this.placeholder)}handleMinChange(){this.input&&"number"===this.type&&(this.min?this.input.min=this.min:this.input.removeAttribute("min")),this.syncValidity()}handleMaxChange(){this.input&&"number"===this.type&&(this.max?this.input.max=this.max:this.input.removeAttribute("max")),this.syncValidity()}handleStepChange(){this.input&&"number"===this.type&&(this.step?this.input.step=this.step:this.input.removeAttribute("step")),this.syncValidity()}handleMaxLengthChange(){this.input&&(this.maxlength>0?this.input.maxLength=this.maxlength:this.input.removeAttribute("maxlength")),this.syncValidity()}handleMinLengthChange(){this.input&&(this.minlength>0?this.input.minLength=this.minlength:this.input.removeAttribute("minlength")),this.syncValidity()}handlePatternChange(){this.input&&(this.pattern?this.input.pattern=this.pattern:this.input.removeAttribute("pattern")),this.syncValidity()}handleTypeChange(){this.input&&"password"!==this.type&&(this.input.type=this.type),this.syncValidity()}handleRequiredChange(){this.input&&(this.input.required=this.required),this.syncValidity()}handleLabelChange(){const e=this.shadowRoot?.querySelector(".label");if(e){e.textContent=this.label;const t=e.parentElement;t&&(t.style.display=this.label?"":"none")}this.labelAssociation.sync()}dispatchInputEvent(){return{value:this.value,input:this}}dispatchChangeEvent(){return{value:this.value,input:this}}dispatchFocusEvent(){return{input:this}}dispatchBlurEvent(){return{input:this}}dispatchClearEvent(){return{input:this}}focus(){this.input?.focus()}blur(){this.input?.blur()}select(){this.input?.select()}clear(){this.value="",this.input&&(this.input.value=""),this.dispatchClearEvent(),this.dispatchInputEvent(),this.dispatchChangeEvent(),this.focus()}get form(){return G(this,this.internals)}get validity(){return this.internals?.validity??this.input.validity}get validationMessage(){return this.internals?.validationMessage??this.input?.validationMessage??""}get willValidate(){return!this.interactionDisabled&&!this.readonly&&(this.internals?.willValidate??this.input?.willValidate??!1)}get labels(){return this.labelAssociation.labels}checkValidity(){return this.syncValidity(),this.internals?.checkValidity()??this.input?.checkValidity()??!0}reportValidity(){return this.syncValidity(),this.internals?.reportValidity()??this.input?.reportValidity()??!0}setCustomValidity(e){this.customValidationMessage=String(e),this.syncValidity()}cleanup(){this.labelAssociation.disconnect()}})})(),(()=>{let t,a,n,c,d,h,u,p,g,b,f=[i("snice-option")],v=[],k=HTMLElement,x=[],C=[],S=[],E=[],D=[],A=[],R=[],M=[],z=[],F=[],$=[];(class extends k{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[s({})],c=[s({})],d=[s({type:Boolean})],h=[s({type:Boolean})],u=[s({})],p=[l()],g=[r()],b=[o()],y(this,null,p,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,x),y(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,x),y(this,null,b,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,x),y(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},C,S),y(null,null,c,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},E,D),y(null,null,d,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},A,R),y(null,null,h,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:e},M,z),y(null,null,u,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},F,$),y(null,t={value:a},f,{kind:"class",name:a.name,metadata:e},null,v),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,v)}render(){return e``}styles(){return m`:host { display: none; }`}init(){!this.label&&this.textContent&&(this.label=this.textContent.trim()),!this.value&&this.label&&(this.value=this.label)}get optionData(){return{value:this.value,label:this.label||this.textContent?.trim()||this.value,disabled:this.disabled,selected:this.selected,icon:this.icon}}constructor(){super(...arguments),this.value=(w(this,x),w(this,C,"")),this.label=(w(this,S),w(this,E,"")),this.disabled=(w(this,D),w(this,A,!1)),this.selected=(w(this,R),w(this,M,!1)),this.icon=(w(this,z),w(this,F,"")),w(this,$)}})})(),(()=>{let t,b,f,v,k,x,C,S,E,D,A,R,M,z,F,$,I,T,L,V,B,O,j,P,N,H,K,W,U,Z,Y,J,X,ee,te,ie,ae,se,ne,le,re,oe,ce,de,he,ue,me,pe,ge,be,fe,ve,ye,we,ke,xe=[i("snice-select",{formAssociated:!0,delegatesFocus:!0})],Ce=[],Se=HTMLElement,Ee=[],De=[],Ae=[],Re=[],Me=[],ze=[],Fe=[],$e=[],Ie=[],Te=[],Le=[],Ve=[],Be=[],Oe=[],je=[],Pe=[],Ne=[],He=[],qe=[],_e=[],Ge=[],Ke=[],We=[],Ue=[],Ze=[],Ye=[],Je=[],Qe=[],Xe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],mt=[],pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],Ft=[],$t=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[];(class extends Se{static{b=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(Se[Symbol.metadata]??null):void 0;f=[a()],v=[a()],k=[a()],x=[s({attribute:"value"})],C=[s({type:Boolean})],S=[s({type:Boolean})],E=[s({type:Boolean})],D=[s({type:Boolean})],A=[s({type:Boolean})],R=[s({type:Boolean})],M=[s({type:Boolean})],z=[s({type:Boolean})],F=[s({type:Boolean,attribute:"allow-free-text"})],$=[s({type:Boolean})],I=[s({type:Boolean})],T=[s({type:Number,attribute:"search-debounce"})],L=[s({type:Boolean})],V=[s({})],B=[s({})],O=[s({})],j=[s({attribute:"helper-text"})],P=[s({attribute:"error-text"})],N=[s({})],H=[s({attribute:"max-height"})],K=[s({type:Array,attribute:!1})],W=[n(".select-trigger")],U=[n(".select-dropdown")],Z=[n(".select-value")],Y=[n(".select-label")],J=[n(".select-search-input")],X=[n(".select-options")],ee=[n(".select-clear")],te=[n(".select-arrow")],ie=[n(".select-search")],ae=[n(".select-editable-input")],se=[p(".select-option")],ne=[g("select/search")],le=[l()],re=[r()],oe=[o()],ce=[c()],de=[u()],he=[d("valueState")],ue=[d("defaultValue")],me=[d("options")],pe=[d("disabled","loading","formDisabled")],ge=[d("required","readonly","multiple")],be=[d("editable")],fe=[d("invalid")],ve=[d("open")],ye=[h("select-change",{bubbles:!0,composed:!0})],we=[h("select-open",{bubbles:!0,composed:!0})],ke=[h("select-close",{bubbles:!0,composed:!0})],y(this,null,ne,{kind:"method",name:"performRemoteSearch",static:!1,private:!1,access:{has:e=>"performRemoteSearch"in e,get:e=>e.performRemoteSearch},metadata:e},null,Ee),y(this,null,le,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,Ee),y(this,null,re,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,Ee),y(this,null,oe,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,Ee),y(this,null,ce,{kind:"method",name:"onReconnect",static:!1,private:!1,access:{has:e=>"onReconnect"in e,get:e=>e.onReconnect},metadata:e},null,Ee),y(this,null,de,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,Ee),y(this,null,he,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:e},null,Ee),y(this,null,ue,{kind:"method",name:"handleDefaultValueChange",static:!1,private:!1,access:{has:e=>"handleDefaultValueChange"in e,get:e=>e.handleDefaultValueChange},metadata:e},null,Ee),y(this,null,me,{kind:"method",name:"handleOptionsPropertyChange",static:!1,private:!1,access:{has:e=>"handleOptionsPropertyChange"in e,get:e=>e.handleOptionsPropertyChange},metadata:e},null,Ee),y(this,null,pe,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:e},null,Ee),y(this,null,ge,{kind:"method",name:"handleValidationConfigurationChange",static:!1,private:!1,access:{has:e=>"handleValidationConfigurationChange"in e,get:e=>e.handleValidationConfigurationChange},metadata:e},null,Ee),y(this,null,be,{kind:"method",name:"handleValidationAnchorChange",static:!1,private:!1,access:{has:e=>"handleValidationAnchorChange"in e,get:e=>e.handleValidationAnchorChange},metadata:e},null,Ee),y(this,null,fe,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:e},null,Ee),y(this,null,ve,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:e},null,Ee),y(this,null,ye,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:e},null,Ee),y(this,null,we,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:e},null,Ee),y(this,null,ke,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:e},null,Ee),y(null,null,f,{kind:"field",name:"valueState",static:!1,private:!1,access:{has:e=>"valueState"in e,get:e=>e.valueState,set:(e,t)=>{e.valueState=t}},metadata:e},De,Ae),y(null,null,v,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},Re,Me),y(null,null,k,{kind:"field",name:"constraintInvalid",static:!1,private:!1,access:{has:e=>"constraintInvalid"in e,get:e=>e.constraintInvalid,set:(e,t)=>{e.constraintInvalid=t}},metadata:e},ze,Fe),y(null,null,x,{kind:"field",name:"defaultValue",static:!1,private:!1,access:{has:e=>"defaultValue"in e,get:e=>e.defaultValue,set:(e,t)=>{e.defaultValue=t}},metadata:e},$e,Ie),y(null,null,C,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},Te,Le),y(null,null,S,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:e},Ve,Be),y(null,null,E,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:e},Oe,je),y(null,null,D,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:e},Pe,Ne),y(null,null,A,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},He,qe),y(null,null,R,{kind:"field",name:"multiple",static:!1,private:!1,access:{has:e=>"multiple"in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:e},_e,Ge),y(null,null,M,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:e},Ke,We),y(null,null,z,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:e},Ue,Ze),y(null,null,F,{kind:"field",name:"allowFreeText",static:!1,private:!1,access:{has:e=>"allowFreeText"in e,get:e=>e.allowFreeText,set:(e,t)=>{e.allowFreeText=t}},metadata:e},Ye,Je),y(null,null,$,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:e},Qe,Xe),y(null,null,I,{kind:"field",name:"remote",static:!1,private:!1,access:{has:e=>"remote"in e,get:e=>e.remote,set:(e,t)=>{e.remote=t}},metadata:e},et,tt),y(null,null,T,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:e},it,at),y(null,null,L,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:e},st,nt),y(null,null,V,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},lt,rt),y(null,null,B,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:e},ot,ct),y(null,null,O,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},dt,ht),y(null,null,j,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:e},ut,mt),y(null,null,P,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:e},pt,gt),y(null,null,N,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:e},bt,ft),y(null,null,H,{kind:"field",name:"maxHeight",static:!1,private:!1,access:{has:e=>"maxHeight"in e,get:e=>e.maxHeight,set:(e,t)=>{e.maxHeight=t}},metadata:e},vt,yt),y(null,null,K,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:e},wt,kt),y(null,null,W,{kind:"field",name:"trigger",static:!1,private:!1,access:{has:e=>"trigger"in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:e},xt,Ct),y(null,null,U,{kind:"field",name:"dropdown",static:!1,private:!1,access:{has:e=>"dropdown"in e,get:e=>e.dropdown,set:(e,t)=>{e.dropdown=t}},metadata:e},St,Et),y(null,null,Z,{kind:"field",name:"valueDisplay",static:!1,private:!1,access:{has:e=>"valueDisplay"in e,get:e=>e.valueDisplay,set:(e,t)=>{e.valueDisplay=t}},metadata:e},Dt,At),y(null,null,Y,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:e},Rt,Mt),y(null,null,J,{kind:"field",name:"searchInput",static:!1,private:!1,access:{has:e=>"searchInput"in e,get:e=>e.searchInput,set:(e,t)=>{e.searchInput=t}},metadata:e},zt,Ft),y(null,null,X,{kind:"field",name:"optionsList",static:!1,private:!1,access:{has:e=>"optionsList"in e,get:e=>e.optionsList,set:(e,t)=>{e.optionsList=t}},metadata:e},$t,It),y(null,null,ee,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:e},Tt,Lt),y(null,null,te,{kind:"field",name:"arrow",static:!1,private:!1,access:{has:e=>"arrow"in e,get:e=>e.arrow,set:(e,t)=>{e.arrow=t}},metadata:e},Vt,Bt),y(null,null,ie,{kind:"field",name:"searchContainer",static:!1,private:!1,access:{has:e=>"searchContainer"in e,get:e=>e.searchContainer,set:(e,t)=>{e.searchContainer=t}},metadata:e},Ot,jt),y(null,null,ae,{kind:"field",name:"editableInput",static:!1,private:!1,access:{has:e=>"editableInput"in e,get:e=>e.editableInput,set:(e,t)=>{e.editableInput=t}},metadata:e},Pt,Nt),y(null,null,se,{kind:"field",name:"optionElements",static:!1,private:!1,access:{has:e=>"optionElements"in e,get:e=>e.optionElements,set:(e,t)=>{e.optionElements=t}},metadata:e},Ht,qt),y(null,t={value:b},xe,{kind:"class",name:b.name,metadata:e},null,Ce),b=t.value,e&&Object.defineProperty(b,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(b,Ce)}constructor(){super(),this.internals=w(this,Ee),this.dirtyValue=!1,this.valueState=w(this,De,""),this.formDisabled=(w(this,Ae),w(this,Re,!1)),this.constraintInvalid=(w(this,Me),w(this,ze,!1)),this.customValidationMessage=(w(this,Fe),""),this.defaultValue=w(this,$e,""),this.disabled=(w(this,Ie),w(this,Te,!1)),this.required=(w(this,Le),w(this,Ve,!1)),this.invalid=(w(this,Be),w(this,Oe,!1)),this.readonly=(w(this,je),w(this,Pe,!1)),this.loading=(w(this,Ne),w(this,He,!1)),this.multiple=(w(this,qe),w(this,_e,!1)),this.searchable=(w(this,Ge),w(this,Ke,!1)),this.clearable=(w(this,We),w(this,Ue,!1)),this.allowFreeText=(w(this,Ze),w(this,Ye,!1)),this.editable=(w(this,Je),w(this,Qe,!1)),this.remote=(w(this,Xe),w(this,et,!1)),this.searchDebounce=(w(this,tt),w(this,it,300)),this.open=(w(this,at),w(this,st,!1)),this.size=(w(this,nt),w(this,lt,"medium")),this.name=(w(this,rt),w(this,ot,"")),this.label=(w(this,ct),w(this,dt,"")),this.helperText=(w(this,ht),w(this,ut,"")),this.errorText=(w(this,mt),w(this,pt,"")),this.placeholder=(w(this,gt),w(this,bt,"Select an option")),this.descId=(w(this,ft),`snice-select-desc-${Math.random().toString(36).slice(2,10)}`),this.maxHeight=w(this,vt,"200px"),this.options=(w(this,yt),w(this,wt,[])),this.childOptions=(w(this,kt),[]),this.trigger=w(this,xt,void 0),this.dropdown=(w(this,Ct),w(this,St,void 0)),this.valueDisplay=(w(this,Et),w(this,Dt,void 0)),this.labelElement=(w(this,At),w(this,Rt,void 0)),this.searchInput=(w(this,Mt),w(this,zt,void 0)),this.optionsList=(w(this,Ft),w(this,$t,void 0)),this.clearButton=(w(this,It),w(this,Tt,void 0)),this.arrow=(w(this,Lt),w(this,Vt,void 0)),this.searchContainer=(w(this,Bt),w(this,Ot,void 0)),this.editableInput=(w(this,jt),w(this,Pt,void 0)),this.optionElements=(w(this,Nt),w(this,Ht,void 0)),this.filteredOptions=(w(this,qt),[]),this.selectedValues=new Set,this.focusedIndex=-1,this.editableInputValue="",this.remoteSearchTimeout=0,this.remoteSearching=!1,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals()),this.labelAssociation=new Q(this,()=>this.internals,()=>this.editable?this.editableInput:this.trigger,()=>this.label||"Select")}get value(){return this.valueState}set value(e){this.setValue(e,!0)}formAssociatedCallback(){this.syncFormState()}formResetCallback(){this.dirtyValue=!1,this.applyDefaultValue(),this.resetTransientState()}formDisabledCallback(e){this.formDisabled=e,e&&this.isOpen&&this.closeDropdown(),this.syncValidity()}formStateRestoreCallback(e){"string"==typeof e&&(this.setValue(e,!0),this.resetTransientState())}get isOpen(){return this.open}get interactionDisabled(){return this.disabled||this.formDisabled||this.loading}get mergedOptions(){if(this.childOptions.length>0&&this.options.length>0){const e=new Set(this.childOptions.map(e=>e.value));return[...this.childOptions,...this.options.filter(t=>!e.has(t.value))]}return this.childOptions.length>0?this.childOptions:this.options}async*performRemoteSearch(e){this.remoteSearching=!0,this.updateDropdownContent();try{const t={query:e,select:this},i=await(yield t);this.remoteSearching=!1,this.filteredOptions=i||[],this.focusedIndex=-1,this.updateDropdownContent()}catch{this.remoteSearching=!1,this.filteredOptions=[],this.updateDropdownContent()}}scheduleRemoteSearch(e){clearTimeout(this.remoteSearchTimeout),this.remoteSearchTimeout=window.setTimeout(()=>{this.performRemoteSearch(e)},this.searchDebounce)}render(){const t=this.invalid||this.constraintInvalid,i=this.labelAssociation.accessibleName;return e`
|
|
104
|
+
`}styles(){return m`${":host{display:inline-block;width:100%;max-width:100%;box-sizing:border-box;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);color-scheme:light dark}.input-wrapper{position:relative;width:100%;max-width:100%;height:100%;box-sizing:border-box}:host([align]) .input-wrapper{display:flex;flex-direction:column}:host([align=top]) .input-wrapper{justify-content:flex-start}:host([align=center]) .input-wrapper{justify-content:center}:host([align=bottom]) .input-wrapper{justify-content:flex-end}.input-container{position:relative;display:flex;align-items:center;width:100%;max-width:100%;box-sizing:border-box;transition:all var(--snice-transition-fast, 150ms) ease}:host([stretch]) .input-wrapper{display:flex;flex-direction:column}:host([stretch]) .input-container{flex:1}:host([stretch]) .input{height:100%}.input{flex:1;min-width:0;box-sizing:border-box;font-family:inherit;font-size:var(--snice-font-size-md, 1rem);background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, ease);outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.input:hover:not(:focus):not(:disabled){border-color:var(--snice-color-border-hover,rgb(204 204 204))}.input:disabled{background:var(--snice-color-surface-container-low,rgb(250 250 250));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.input--small{padding:.375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.input--medium{padding:.5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.input--large{padding:.625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.input--outlined{background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226))}.input--filled{background:var(--snice-color-surface-container-low,rgb(250 250 250));border:1px solid transparent;border-bottom-color:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem) var(--snice-border-radius-md,.25rem) 0 0}.input--filled:focus-visible{background:var(--snice-color-surface-hover,rgb(245 245 245));border-bottom-color:var(--snice-color-primary,rgb(37 99 235))}.input--underlined{background:0 0;border:none;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:0;padding-left:0;padding-right:0;box-shadow:none}.input-container:has(.input--underlined){position:relative}.input-container:has(.input--underlined)::after{content:'';position:absolute;left:50%;right:50%;bottom:-1px;height:2px;background:var(--snice-color-primary,rgb(37 99 235));transition:left .2s var(--snice-ease-out, ease),right .2s var(--snice-ease-out, ease);pointer-events:none}.input-container:has(.input--underlined:focus-visible)::after{left:0;right:0}.input--underlined:focus-visible{border-bottom-color:var(--snice-color-border,rgb(226 226 226));box-shadow:none}.input--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.input--invalid:focus-visible{border-color:var(--snice-color-danger,rgb(220 38 38));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-color-danger-alpha,rgb(220 38 38 / .4)),var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05))}.input::-webkit-calendar-picker-indicator{cursor:pointer;opacity:.7}.input::-webkit-calendar-picker-indicator:hover{opacity:1}.input--with-prefix-icon{padding-left:2.5rem}.input--clearable,.input--with-suffix-icon{padding-right:2.5rem}.input--with-suffix-icon.input--clearable{padding-right:4rem}.label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}:host([label-align=center]) .label{text-align:center}:host([label-align=right]) .label{text-align:right}.label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.error-text,.helper-text{display:block;margin-top:.25rem;font-size:var(--snice-font-size-xs, .75rem)}.helper-text{color:var(--snice-color-text-secondary,rgb(82 82 82))}.error-text{color:var(--snice-color-danger,rgb(220 38 38))}.icon-slot{position:absolute;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;opacity:.7}.icon-slot:empty{display:none}.icon-slot--prefix{left:.625rem}.icon-slot--suffix{right:.625rem}.icon{display:flex;align-items:center;justify-content:center;overflow:hidden;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;font-size:1.25rem;line-height:1}.icon-slot ::slotted(svg){width:1.5rem;height:1.5rem}.icon-slot ::slotted(img){width:1.5rem;height:1.5rem;object-fit:contain}.clear-button{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;opacity:0;visibility:hidden}.clear-button:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input-container:hover .clear-button--visible,.input:focus-visible~.clear-button--visible{opacity:1;visibility:visible}.clear-button--with-suffix{right:2rem}.password-toggle{position:absolute;right:.5rem;display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;padding:.25rem;background:0 0;border:none;border-radius:var(--snice-border-radius-sm,.125rem);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease}.password-toggle:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.input[type=number]::-webkit-inner-spin-button,.input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.input[type=number]{-moz-appearance:textfield}.input[type=search]::-webkit-search-cancel-button,.input[type=search]::-webkit-search-decoration,.input[type=search]::-webkit-search-results-button,.input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none}.input-container:focus-within{z-index:1}.input--loading{cursor:wait}.spinner{position:absolute;right:.75rem;width:1em;height:1em;pointer-events:none}.input--with-suffix-icon .spinner{right:2.5rem}.spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}init(){if(Object.prototype.hasOwnProperty.call(this,"value")){const e=this.value;delete this.value,this.value=String(e??"")}else this.dirtyValue||this.applyDefaultValue();if(this.syncFormValue(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}this.input&&this.invalid&&(this.input.setAttribute("aria-invalid","true"),this.input.classList.add("input--invalid")),this.input&&("number"===this.type&&(this.min&&(this.input.min=this.min),this.max&&(this.input.max=this.max),this.step&&(this.input.step=this.step)),this.maxlength>0&&(this.input.maxLength=this.maxlength),this.minlength>0&&(this.input.minLength=this.minlength),this.pattern&&(this.input.pattern=this.pattern),this.placeholder&&(this.input.placeholder=this.placeholder),this.value&&(this.input.value=this.value),this.input.disabled=this.interactionDisabled,this.input.readOnly=this.readonly,this.input.required=this.required),this.syncValidity(),this.labelAssociation.connect()}onReconnect(){this.labelAssociation.connect()}applyDefaultValue(){this.setValue(this.defaultValue,!1)}setValue(e,t,i=!1){t&&(this.dirtyValue=!0),this.userEditedValue=i,this.valueState=String(e??""),this.syncFormState()}syncFormValue(){this.internals?.setFormValue(this.value,this.value)}syncFormState(){this.syncFormValue(),this.syncValidity()}syncValidity(){const e=this.input;if(!e){const e=this.interactionDisabled||this.readonly?{}:{customError:Boolean(this.customValidationMessage),valueMissing:this.required&&!this.value},t=_(e);return this.constraintInvalid=t,void G(this.internals,e,this.customValidationMessage||(t?"Please enter a valid value.":""))}e.value!==this.value&&(e.value=this.value),e.type="password"===this.type&&this.showPassword?"text":this.type,e.disabled=this.interactionDisabled,e.readOnly=this.readonly,e.required=this.required,this.min?e.min=this.min:e.removeAttribute("min"),this.max?e.max=this.max:e.removeAttribute("max"),this.step?e.step=this.step:e.removeAttribute("step"),this.pattern?e.pattern=this.pattern:e.removeAttribute("pattern"),this.maxlength>0?e.maxLength=this.maxlength:e.removeAttribute("maxlength"),this.minlength>0?e.minLength=this.minlength:e.removeAttribute("minlength"),e.setCustomValidity(this.customValidationMessage);const t=this.interactionDisabled||this.readonly,i=["text","search","url","tel","email","password"].includes(this.type),a=["number","date","time","datetime-local"].includes(this.type)&&""!==this.value&&""===e.value,s=t?{}:function(e,t={}){const i={};for(const t of q)i[t]=e[t];return Object.assign(i,t)}(e.validity,{badInput:e.validity.badInput||a,tooLong:i&&this.userEditedValue&&this.maxlength>0&&this.value.length>this.maxlength,tooShort:i&&this.userEditedValue&&this.minlength>0&&this.value.length>0&&this.value.length<this.minlength}),n=_(s),l=this.customValidationMessage||e.validationMessage||(n?"Please enter a valid value.":"");this.constraintInvalid=n;const r=this.invalid||n;e.setAttribute("aria-invalid",String(r)),e.classList.toggle("input--invalid",r),G(this.internals,s,l,e)}handleInput(e){this.setValue(e.target.value,!0,!0),this.dispatchInputEvent()}handleChange(e){this.setValue(e.target.value,!0,!0),this.dispatchChangeEvent()}handleFocus(e){this.dispatchFocusEvent()}handleBlur(e){this.dispatchBlurEvent()}handleClear(e){this.clear()}handlePasswordToggle(e){if(this.showPassword=!this.showPassword,this.input&&(this.input.type=this.showPassword?"text":"password"),this.passwordToggle){const e=this.passwordToggle.querySelector(".password-icon--hidden"),t=this.passwordToggle.querySelector(".password-icon--visible");e&&t&&(e.style.display=this.showPassword?"none":"",t.style.display=this.showPassword?"":"none",this.passwordToggle.setAttribute("aria-label",this.showPassword?"Hide password":"Show password"))}}handleValueChange(){if(this.input&&this.input.value!==this.value&&(this.input.value=this.value),this.syncFormState(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleInvalidChange(){if(this.input){const e=this.invalid||this.constraintInvalid;this.input.setAttribute("aria-invalid",String(e)),this.input.classList.toggle("input--invalid",e)}}handleDisabledChange(){if(this.input&&(this.input.disabled=this.interactionDisabled),this.syncValidity(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleReadonlyChange(){if(this.input&&(this.input.readOnly=this.readonly),this.syncValidity(),this.clearButton&&this.clearable){const e=this.value&&!this.interactionDisabled&&!this.readonly;this.clearButton.style.display=e?"":"none",this.clearButton.classList.toggle("clear-button--visible",!!e)}}handleDefaultValueChange(){this.dirtyValue||this.applyDefaultValue()}handlePlaceholderChange(){this.input&&(this.input.placeholder=this.placeholder)}handleMinChange(){this.input&&"number"===this.type&&(this.min?this.input.min=this.min:this.input.removeAttribute("min")),this.syncValidity()}handleMaxChange(){this.input&&"number"===this.type&&(this.max?this.input.max=this.max:this.input.removeAttribute("max")),this.syncValidity()}handleStepChange(){this.input&&"number"===this.type&&(this.step?this.input.step=this.step:this.input.removeAttribute("step")),this.syncValidity()}handleMaxLengthChange(){this.input&&(this.maxlength>0?this.input.maxLength=this.maxlength:this.input.removeAttribute("maxlength")),this.syncValidity()}handleMinLengthChange(){this.input&&(this.minlength>0?this.input.minLength=this.minlength:this.input.removeAttribute("minlength")),this.syncValidity()}handlePatternChange(){this.input&&(this.pattern?this.input.pattern=this.pattern:this.input.removeAttribute("pattern")),this.syncValidity()}handleTypeChange(){this.input&&"password"!==this.type&&(this.input.type=this.type),this.syncValidity()}handleRequiredChange(){this.input&&(this.input.required=this.required),this.syncValidity()}handleLabelChange(){const e=this.shadowRoot?.querySelector(".label");if(e){e.textContent=this.label;const t=e.parentElement;t&&(t.style.display=this.label?"":"none")}this.labelAssociation.sync()}dispatchInputEvent(){return{value:this.value,input:this}}dispatchChangeEvent(){return{value:this.value,input:this}}dispatchFocusEvent(){return{input:this}}dispatchBlurEvent(){return{input:this}}dispatchClearEvent(){return{input:this}}focus(){this.input?.focus()}blur(){this.input?.blur()}select(){this.input?.select()}clear(){this.value="",this.input&&(this.input.value=""),this.dispatchClearEvent(),this.dispatchInputEvent(),this.dispatchChangeEvent(),this.focus()}get form(){return K(this,this.internals)}get validity(){return this.internals?.validity??this.input.validity}get validationMessage(){return this.internals?.validationMessage??this.input?.validationMessage??""}get willValidate(){return!this.interactionDisabled&&!this.readonly&&(this.internals?.willValidate??this.input?.willValidate??!1)}get labels(){return this.labelAssociation.labels}checkValidity(){return this.syncValidity(),this.internals?.checkValidity()??this.input?.checkValidity()??!0}reportValidity(){return this.syncValidity(),this.internals?.reportValidity()??this.input?.reportValidity()??!0}setCustomValidity(e){this.customValidationMessage=String(e),this.syncValidity()}cleanup(){this.labelAssociation.disconnect()}})})(),(()=>{let t,a,n,c,d,h,u,p,g,b,f=[i("snice-option")],v=[],k=HTMLElement,x=[],C=[],S=[],E=[],D=[],A=[],R=[],M=[],z=[],$=[],F=[];(class extends k{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(k[Symbol.metadata]??null):void 0;n=[s({})],c=[s({})],d=[s({type:Boolean})],h=[s({type:Boolean})],u=[s({})],p=[l()],g=[r()],b=[o()],y(this,null,p,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,x),y(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,x),y(this,null,b,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,x),y(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},C,S),y(null,null,c,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},E,D),y(null,null,d,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},A,R),y(null,null,h,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:e},M,z),y(null,null,u,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},$,F),y(null,t={value:a},f,{kind:"class",name:a.name,metadata:e},null,v),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,v)}render(){return e``}styles(){return m`:host { display: none; }`}init(){!this.label&&this.textContent&&(this.label=this.textContent.trim()),!this.value&&this.label&&(this.value=this.label)}get optionData(){return{value:this.value,label:this.label||this.textContent?.trim()||this.value,disabled:this.disabled,selected:this.selected,icon:this.icon}}constructor(){super(...arguments),this.value=(w(this,x),w(this,C,"")),this.label=(w(this,S),w(this,E,"")),this.disabled=(w(this,D),w(this,A,!1)),this.selected=(w(this,R),w(this,M,!1)),this.icon=(w(this,z),w(this,$,"")),w(this,F)}})})(),(()=>{let t,b,f,v,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B,O,j,P,N,H,q,W,U,Z,Y,J,Q,ee,te,ie,ae,se,ne,le,re,oe,ce,de,he,ue,me,pe,ge,be,fe,ve,ye,we,ke,xe=[i("snice-select",{formAssociated:!0,delegatesFocus:!0})],Ce=[],Se=HTMLElement,Ee=[],De=[],Ae=[],Re=[],Me=[],ze=[],$e=[],Fe=[],Ie=[],Te=[],Le=[],Ve=[],Be=[],Oe=[],je=[],Pe=[],Ne=[],He=[],qe=[],_e=[],Ge=[],Ke=[],We=[],Ue=[],Ze=[],Ye=[],Je=[],Qe=[],Xe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],mt=[],pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],$t=[],Ft=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[];(class extends Se{static{b=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(Se[Symbol.metadata]??null):void 0;f=[a()],v=[a()],k=[a()],x=[s({attribute:"value"})],C=[s({type:Boolean})],S=[s({type:Boolean})],E=[s({type:Boolean})],D=[s({type:Boolean})],A=[s({type:Boolean})],R=[s({type:Boolean})],M=[s({type:Boolean})],z=[s({type:Boolean})],$=[s({type:Boolean,attribute:"allow-free-text"})],F=[s({type:Boolean})],I=[s({type:Boolean})],T=[s({type:Number,attribute:"search-debounce"})],L=[s({type:Boolean})],V=[s({})],B=[s({})],O=[s({})],j=[s({attribute:"helper-text"})],P=[s({attribute:"error-text"})],N=[s({})],H=[s({attribute:"max-height"})],q=[s({type:Array,attribute:!1})],W=[n(".select-trigger")],U=[n(".select-dropdown")],Z=[n(".select-value")],Y=[n(".select-label")],J=[n(".select-search-input")],Q=[n(".select-options")],ee=[n(".select-clear")],te=[n(".select-arrow")],ie=[n(".select-search")],ae=[n(".select-editable-input")],se=[p(".select-option")],ne=[g("select/search")],le=[l()],re=[r()],oe=[o()],ce=[c()],de=[u()],he=[d("valueState")],ue=[d("defaultValue")],me=[d("options")],pe=[d("disabled","loading","formDisabled")],ge=[d("required","readonly","multiple")],be=[d("editable")],fe=[d("invalid")],ve=[d("open")],ye=[h("select-change",{bubbles:!0,composed:!0})],we=[h("select-open",{bubbles:!0,composed:!0})],ke=[h("select-close",{bubbles:!0,composed:!0})],y(this,null,ne,{kind:"method",name:"performRemoteSearch",static:!1,private:!1,access:{has:e=>"performRemoteSearch"in e,get:e=>e.performRemoteSearch},metadata:e},null,Ee),y(this,null,le,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,Ee),y(this,null,re,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,Ee),y(this,null,oe,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,Ee),y(this,null,ce,{kind:"method",name:"onReconnect",static:!1,private:!1,access:{has:e=>"onReconnect"in e,get:e=>e.onReconnect},metadata:e},null,Ee),y(this,null,de,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,Ee),y(this,null,he,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:e},null,Ee),y(this,null,ue,{kind:"method",name:"handleDefaultValueChange",static:!1,private:!1,access:{has:e=>"handleDefaultValueChange"in e,get:e=>e.handleDefaultValueChange},metadata:e},null,Ee),y(this,null,me,{kind:"method",name:"handleOptionsPropertyChange",static:!1,private:!1,access:{has:e=>"handleOptionsPropertyChange"in e,get:e=>e.handleOptionsPropertyChange},metadata:e},null,Ee),y(this,null,pe,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:e},null,Ee),y(this,null,ge,{kind:"method",name:"handleValidationConfigurationChange",static:!1,private:!1,access:{has:e=>"handleValidationConfigurationChange"in e,get:e=>e.handleValidationConfigurationChange},metadata:e},null,Ee),y(this,null,be,{kind:"method",name:"handleValidationAnchorChange",static:!1,private:!1,access:{has:e=>"handleValidationAnchorChange"in e,get:e=>e.handleValidationAnchorChange},metadata:e},null,Ee),y(this,null,fe,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:e},null,Ee),y(this,null,ve,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:e},null,Ee),y(this,null,ye,{kind:"method",name:"dispatchChangeEvent",static:!1,private:!1,access:{has:e=>"dispatchChangeEvent"in e,get:e=>e.dispatchChangeEvent},metadata:e},null,Ee),y(this,null,we,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:e},null,Ee),y(this,null,ke,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:e},null,Ee),y(null,null,f,{kind:"field",name:"valueState",static:!1,private:!1,access:{has:e=>"valueState"in e,get:e=>e.valueState,set:(e,t)=>{e.valueState=t}},metadata:e},De,Ae),y(null,null,v,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},Re,Me),y(null,null,k,{kind:"field",name:"constraintInvalid",static:!1,private:!1,access:{has:e=>"constraintInvalid"in e,get:e=>e.constraintInvalid,set:(e,t)=>{e.constraintInvalid=t}},metadata:e},ze,$e),y(null,null,x,{kind:"field",name:"defaultValue",static:!1,private:!1,access:{has:e=>"defaultValue"in e,get:e=>e.defaultValue,set:(e,t)=>{e.defaultValue=t}},metadata:e},Fe,Ie),y(null,null,C,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},Te,Le),y(null,null,S,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:e},Ve,Be),y(null,null,E,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:e},Oe,je),y(null,null,D,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:e},Pe,Ne),y(null,null,A,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},He,qe),y(null,null,R,{kind:"field",name:"multiple",static:!1,private:!1,access:{has:e=>"multiple"in e,get:e=>e.multiple,set:(e,t)=>{e.multiple=t}},metadata:e},_e,Ge),y(null,null,M,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:e},Ke,We),y(null,null,z,{kind:"field",name:"clearable",static:!1,private:!1,access:{has:e=>"clearable"in e,get:e=>e.clearable,set:(e,t)=>{e.clearable=t}},metadata:e},Ue,Ze),y(null,null,$,{kind:"field",name:"allowFreeText",static:!1,private:!1,access:{has:e=>"allowFreeText"in e,get:e=>e.allowFreeText,set:(e,t)=>{e.allowFreeText=t}},metadata:e},Ye,Je),y(null,null,F,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:e},Qe,Xe),y(null,null,I,{kind:"field",name:"remote",static:!1,private:!1,access:{has:e=>"remote"in e,get:e=>e.remote,set:(e,t)=>{e.remote=t}},metadata:e},et,tt),y(null,null,T,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:e},it,at),y(null,null,L,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:e},st,nt),y(null,null,V,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},lt,rt),y(null,null,B,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:e},ot,ct),y(null,null,O,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},dt,ht),y(null,null,j,{kind:"field",name:"helperText",static:!1,private:!1,access:{has:e=>"helperText"in e,get:e=>e.helperText,set:(e,t)=>{e.helperText=t}},metadata:e},ut,mt),y(null,null,P,{kind:"field",name:"errorText",static:!1,private:!1,access:{has:e=>"errorText"in e,get:e=>e.errorText,set:(e,t)=>{e.errorText=t}},metadata:e},pt,gt),y(null,null,N,{kind:"field",name:"placeholder",static:!1,private:!1,access:{has:e=>"placeholder"in e,get:e=>e.placeholder,set:(e,t)=>{e.placeholder=t}},metadata:e},bt,ft),y(null,null,H,{kind:"field",name:"maxHeight",static:!1,private:!1,access:{has:e=>"maxHeight"in e,get:e=>e.maxHeight,set:(e,t)=>{e.maxHeight=t}},metadata:e},vt,yt),y(null,null,q,{kind:"field",name:"options",static:!1,private:!1,access:{has:e=>"options"in e,get:e=>e.options,set:(e,t)=>{e.options=t}},metadata:e},wt,kt),y(null,null,W,{kind:"field",name:"trigger",static:!1,private:!1,access:{has:e=>"trigger"in e,get:e=>e.trigger,set:(e,t)=>{e.trigger=t}},metadata:e},xt,Ct),y(null,null,U,{kind:"field",name:"dropdown",static:!1,private:!1,access:{has:e=>"dropdown"in e,get:e=>e.dropdown,set:(e,t)=>{e.dropdown=t}},metadata:e},St,Et),y(null,null,Z,{kind:"field",name:"valueDisplay",static:!1,private:!1,access:{has:e=>"valueDisplay"in e,get:e=>e.valueDisplay,set:(e,t)=>{e.valueDisplay=t}},metadata:e},Dt,At),y(null,null,Y,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:e},Rt,Mt),y(null,null,J,{kind:"field",name:"searchInput",static:!1,private:!1,access:{has:e=>"searchInput"in e,get:e=>e.searchInput,set:(e,t)=>{e.searchInput=t}},metadata:e},zt,$t),y(null,null,Q,{kind:"field",name:"optionsList",static:!1,private:!1,access:{has:e=>"optionsList"in e,get:e=>e.optionsList,set:(e,t)=>{e.optionsList=t}},metadata:e},Ft,It),y(null,null,ee,{kind:"field",name:"clearButton",static:!1,private:!1,access:{has:e=>"clearButton"in e,get:e=>e.clearButton,set:(e,t)=>{e.clearButton=t}},metadata:e},Tt,Lt),y(null,null,te,{kind:"field",name:"arrow",static:!1,private:!1,access:{has:e=>"arrow"in e,get:e=>e.arrow,set:(e,t)=>{e.arrow=t}},metadata:e},Vt,Bt),y(null,null,ie,{kind:"field",name:"searchContainer",static:!1,private:!1,access:{has:e=>"searchContainer"in e,get:e=>e.searchContainer,set:(e,t)=>{e.searchContainer=t}},metadata:e},Ot,jt),y(null,null,ae,{kind:"field",name:"editableInput",static:!1,private:!1,access:{has:e=>"editableInput"in e,get:e=>e.editableInput,set:(e,t)=>{e.editableInput=t}},metadata:e},Pt,Nt),y(null,null,se,{kind:"field",name:"optionElements",static:!1,private:!1,access:{has:e=>"optionElements"in e,get:e=>e.optionElements,set:(e,t)=>{e.optionElements=t}},metadata:e},Ht,qt),y(null,t={value:b},xe,{kind:"class",name:b.name,metadata:e},null,Ce),b=t.value,e&&Object.defineProperty(b,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(b,Ce)}constructor(){super(),this.internals=w(this,Ee),this.dirtyValue=!1,this.valueState=w(this,De,""),this.formDisabled=(w(this,Ae),w(this,Re,!1)),this.constraintInvalid=(w(this,Me),w(this,ze,!1)),this.customValidationMessage=(w(this,$e),""),this.defaultValue=w(this,Fe,""),this.disabled=(w(this,Ie),w(this,Te,!1)),this.required=(w(this,Le),w(this,Ve,!1)),this.invalid=(w(this,Be),w(this,Oe,!1)),this.readonly=(w(this,je),w(this,Pe,!1)),this.loading=(w(this,Ne),w(this,He,!1)),this.multiple=(w(this,qe),w(this,_e,!1)),this.searchable=(w(this,Ge),w(this,Ke,!1)),this.clearable=(w(this,We),w(this,Ue,!1)),this.allowFreeText=(w(this,Ze),w(this,Ye,!1)),this.editable=(w(this,Je),w(this,Qe,!1)),this.remote=(w(this,Xe),w(this,et,!1)),this.searchDebounce=(w(this,tt),w(this,it,300)),this.open=(w(this,at),w(this,st,!1)),this.size=(w(this,nt),w(this,lt,"medium")),this.name=(w(this,rt),w(this,ot,"")),this.label=(w(this,ct),w(this,dt,"")),this.helperText=(w(this,ht),w(this,ut,"")),this.errorText=(w(this,mt),w(this,pt,"")),this.placeholder=(w(this,gt),w(this,bt,"Select an option")),this.descId=(w(this,ft),`snice-select-desc-${Math.random().toString(36).slice(2,10)}`),this.maxHeight=w(this,vt,"200px"),this.options=(w(this,yt),w(this,wt,[])),this.childOptions=(w(this,kt),[]),this.trigger=w(this,xt,void 0),this.dropdown=(w(this,Ct),w(this,St,void 0)),this.valueDisplay=(w(this,Et),w(this,Dt,void 0)),this.labelElement=(w(this,At),w(this,Rt,void 0)),this.searchInput=(w(this,Mt),w(this,zt,void 0)),this.optionsList=(w(this,$t),w(this,Ft,void 0)),this.clearButton=(w(this,It),w(this,Tt,void 0)),this.arrow=(w(this,Lt),w(this,Vt,void 0)),this.searchContainer=(w(this,Bt),w(this,Ot,void 0)),this.editableInput=(w(this,jt),w(this,Pt,void 0)),this.optionElements=(w(this,Nt),w(this,Ht,void 0)),this.filteredOptions=(w(this,qt),[]),this.selectedValues=new Set,this.focusedIndex=-1,this.editableInputValue="",this.remoteSearchTimeout=0,this.remoteSearching=!1,"function"==typeof this.attachInternals&&(this.internals=this.attachInternals()),this.labelAssociation=new X(this,()=>this.internals,()=>this.editable?this.editableInput:this.trigger,()=>this.label||"Select")}get value(){return this.valueState}set value(e){this.setValue(e,!0)}formAssociatedCallback(){this.syncFormState()}formResetCallback(){this.dirtyValue=!1,this.applyDefaultValue(),this.resetTransientState()}formDisabledCallback(e){this.formDisabled=e,e&&this.isOpen&&this.closeDropdown(),this.syncValidity()}formStateRestoreCallback(e){"string"==typeof e&&(this.setValue(e,!0),this.resetTransientState())}get isOpen(){return this.open}get interactionDisabled(){return this.disabled||this.formDisabled||this.loading}get mergedOptions(){if(this.childOptions.length>0&&this.options.length>0){const e=new Set(this.childOptions.map(e=>e.value));return[...this.childOptions,...this.options.filter(t=>!e.has(t.value))]}return this.childOptions.length>0?this.childOptions:this.options}async*performRemoteSearch(e){this.remoteSearching=!0,this.updateDropdownContent();try{const t={query:e,select:this},i=await(yield t);this.remoteSearching=!1,this.filteredOptions=i||[],this.focusedIndex=-1,this.updateDropdownContent()}catch{this.remoteSearching=!1,this.filteredOptions=[],this.updateDropdownContent()}}scheduleRemoteSearch(e){clearTimeout(this.remoteSearchTimeout),this.remoteSearchTimeout=window.setTimeout(()=>{this.performRemoteSearch(e)},this.searchDebounce)}render(){const t=this.invalid||this.constraintInvalid,i=this.labelAssociation.accessibleName;return e`
|
|
105
105
|
<div class="select-wrapper">
|
|
106
106
|
<label class="${`select-label select-label--${this.size} ${this.required?"select-label--required":""}`}" part="label" ?hidden="${!this.label}" @click="${()=>this.focus()}">
|
|
107
107
|
${this.label}
|
|
@@ -210,14 +210,14 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
210
210
|
<default></default>
|
|
211
211
|
</case>
|
|
212
212
|
</div>
|
|
213
|
-
`}createIcon(e,t){const i=document.createElement("img");return i.className=e,i.setAttribute("src",t||""),i.setAttribute("alt",""),i.hidden=!t,i}renderOptions(){const e=document.createDocumentFragment();if(this.remoteSearching){const t=document.createElement("div");t.className="select-loading-indicator";const i=document.createElement("span");i.className="select-loading-spinner";const a=document.createElement("span");return a.textContent="Searching...",t.append(i,a),e.append(t),e}const t=this.searchable||this.editable||this.remote?this.filteredOptions:this.mergedOptions;if(0===t.length){const t=document.createElement("div");t.className="select-no-options";const i=document.createElement("span");i.className="select-no-options-text",i.dataset.search="true",i.hidden=!(this.searchable||this.editable||this.remote)||this.filteredOptions.length>0,i.textContent="No matches found";const a=document.createElement("span");return a.className="select-no-options-text",a.dataset.search="false",a.hidden=(this.searchable||this.editable||this.remote)&&0===this.filteredOptions.length,a.textContent="No options available",t.append(i,a),e.append(t),e}return t.forEach((t,i)=>{const a=this.multiple?this.selectedValues.has(t.value):t.value===this.value,s=document.createElement("div");s.className="select-option",s.classList.toggle("select-option--selected",a),s.classList.toggle("select-option--disabled",Boolean(t.disabled)),s.classList.toggle("select-option--focused",i===this.focusedIndex),s.classList.toggle("select-option--has-icon",Boolean(t.icon)),s.setAttribute("data-value",t.value),s.setAttribute("role","option"),s.setAttribute("aria-selected",String(a)),s.setAttribute("aria-disabled",String(t.disabled)),s.setAttribute("part","option");const n=document.createElement("span");n.className="select-option-check",n.setAttribute("aria-hidden","true"),n.hidden=!this.multiple;const l=document.createElement("span");l.className="select-option-check-mark",l.hidden=!a,l.textContent="✓",n.append(l);const r=document.createElement("span");r.className="select-option-label",r.textContent=t.label,s.append(n,this.createIcon("select-option-icon",t.icon),r),e.append(s)}),e}styles(){return m`${":host{display:inline-block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);position:relative;width:100%;max-width:18.75rem}[hidden]{display:none!important}img[src=\"\"]{display:none}.select-wrapper{position:relative;width:100%}.select-label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}.select-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.select-error-text,.select-helper-text{display:block;margin-top:var(--snice-spacing-2xs,.25rem);font-size:var(--snice-font-size-xs, .75rem);font-weight:var(--snice-font-weight-normal,400);line-height:var(--snice-line-height-normal, 1.5)}.select-helper-text{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-error-text{color:var(--snice-color-danger,rgb(220 38 38))}.select-trigger{box-sizing:border-box;min-width:0;width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text,rgb(23 23 23))}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:var(--snice-select-min-height,2.5rem)}.select-trigger--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.select-placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value--single{display:flex;align-items:center;gap:.5rem}.select-value-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-value--multiple{display:flex;gap:.25rem;flex-wrap:wrap}.select-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-xs, .75rem)}.select-tag-icon{width:.75rem;height:.75rem;object-fit:contain;flex-shrink:0}.select-tag-remove{cursor:pointer;padding:0;background:0 0;border:none;color:inherit;font-size:.75rem;line-height:1}.select-tag-remove:hover{opacity:.7}.select-icons{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem;pointer-events:none;z-index:1}.select-clear{padding:.125rem;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary,rgb(82 82 82));display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm,.125rem);pointer-events:auto}.select-clear:hover{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.select-arrow{transition:transform var(--snice-transition-fast, 150ms) ease;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:.25rem;left:0;right:0;background:var(--snice-color-surface-container-high,rgb(252 251 249));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);box-shadow:var(--snice-shadow-lg,0 10px 15px -3px rgb(0 0 0 / .1),0 4px 6px -4px rgb(0 0 0 / .1));z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast, 150ms) ease,transform var(--snice-transition-fast, 150ms) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:.5rem;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));flex-shrink:0}.select-search-input{width:100%;padding:.375rem .625rem;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-sm, .875rem);font-family:inherit;color:var(--snice-color-text,rgb(23 23 23));box-sizing:border-box}.select-search-input:focus-visible{outline:0;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-options{max-height:12.5rem;overflow-y:auto;overflow-x:hidden;padding:.25rem;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border,rgb(226 226 226)) var(--snice-color-surface-container-low,rgb(245 245 245))}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:var(--snice-border-radius-md,.25rem);margin:.25rem 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);border:2px solid var(--snice-color-surface,rgb(255 255 255))}.select-option{padding:.5rem .75rem;cursor:pointer;border-radius:var(--snice-border-radius-sm,.125rem);transition:background var(--snice-transition-fast, 150ms) ease;display:flex;align-items:center;gap:.5rem}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-surface-container-low,rgb(245 245 245))}.select-option--selected{background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500)}.select-option--focused{background:var(--snice-color-surface-container-low,rgb(245 245 245));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-option-check{width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:1rem;text-align:center;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-native{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.select-options::-webkit-scrollbar{width:6px}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:.875rem;height:.875rem;margin-right:.25rem}.select-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.select-freetext-input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:inherit;color:var(--snice-color-text,rgb(23 23 23));padding:0;min-width:0;width:100%}.select-freetext-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-editable-container{position:relative;display:flex;align-items:center;width:100%}.select-editable-input{width:100%;box-sizing:border-box;font-family:inherit;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:all var(--snice-transition-fast, 150ms) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.select-editable-input--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-editable-input--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.select-editable-input--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-editable-input:hover:not(:disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-editable-input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.select-editable-input--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-editable-input--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.select-editable-input:disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.select-editable-input:read-only{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-editable-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.select-editable-arrow{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;transition:transform var(--snice-transition-fast, 150ms) ease}.select-editable-arrow--open{transform:translateY(-50%) rotate(180deg)}.select-loading-indicator{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1rem;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-loading-spinner{display:inline-block;width:1rem;height:1rem;flex-shrink:0}.select-loading-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid var(--snice-color-border,rgb(226 226 226));border-top-color:var(--snice-color-primary,rgb(37 99 235));border-radius:50%;animation:.6s linear infinite spin}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}init(){if(this.readOptionsFromChildren(),Object.prototype.hasOwnProperty.call(this,"value")){const e=this.value;delete this.value,this.value=String(e??"")}else this.dirtyValue||this.applyDefaultValue();this.multiple&&this.value&&(this.selectedValues=new Set(this.value.split(",").map(e=>e.trim()))),this.filteredOptions=[...this.mergedOptions],this.syncFormState(),this.editable?(this.syncEditableInputToValue(),this.updateEditableState()):(this.updateTriggerState(),this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownState(),this.updateDropdownContent(),this.observeChildren(),this.setupGlobalListeners(),this.labelAssociation.connect()}applyDefaultValue(){this.setValue(this.defaultValue,!1)}setValue(e,t){t&&(this.dirtyValue=!0),this.valueState=String(e??""),this.syncRenderedValue(),this.syncFormState()}syncRenderedValue(){this.multiple&&(this.selectedValues=new Set(this.value?this.value.split(",").map(e=>e.trim()):[])),this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton())}resetTransientState(){clearTimeout(this.remoteSearchTimeout),this.open=!1,this.focusedIndex=-1,this.filteredOptions=[...this.mergedOptions],this.searchInput&&(this.searchInput.value=""),this.syncRenderedValue(),this.updateDropdownContent()}syncFormValue(){this.internals?.setFormValue(this.value,this.value)}get validationProxy(){return this.validationInput||(this.validationInput=document.createElement("input")),this.validationInput}syncFormState(){this.syncFormValue(),this.syncValidity()}syncValidity(){const e=this.interactionDisabled||this.readonly,t=!e&&this.required&&(this.multiple?0===this.selectedValues.size:""===this.value),i=e?{}:{customError:Boolean(this.customValidationMessage),valueMissing:t},a=q(i),s=this.customValidationMessage||(t?"Please select an option.":"")||(a?"Please select a valid option.":"");this.constraintInvalid=a;const n=this.invalid||a,l=this.editable?this.editableInput:this.trigger;this.validationProxy.setCustomValidity(a?s:""),this.trigger?.setAttribute("aria-invalid",String(n)),this.trigger?.classList.toggle("select-trigger--invalid",n),this.editableInput?.setAttribute("aria-invalid",String(n)),this.editableInput?.classList.toggle("select-editable-input--invalid",n),_(this.internals,i,s,l)}onReconnect(){this.setupGlobalListeners(),this.observeChildren(),this.labelAssociation.connect()}cleanup(){this.removeGlobalListeners(),this.childObserver?.disconnect(),this.labelAssociation.disconnect()}setupGlobalListeners(){this.outsideClickHandler=e=>{if(!this.isOpen)return;const t=e.composedPath(),i=Array.from(this.labels||[]).some(e=>t.includes(e));t.includes(this)||i||(this.editable&&this.commitEditableValue(),this.closeDropdown())},this.globalKeyHandler=e=>{if(!this.isOpen||this.editable)return;const t=e.composedPath()[0]===this.searchInput;switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":case" ":if(" "===e.key&&t)return;if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}},document.addEventListener("click",this.outsideClickHandler),document.addEventListener("keydown",this.globalKeyHandler)}removeGlobalListeners(){this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.globalKeyHandler&&document.removeEventListener("keydown",this.globalKeyHandler)}observeChildren(){const e=new MutationObserver(e=>{this.handleChildrenChange(e)});e.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),this.childObserver=e}handleChildrenChange(e){e.some(e=>"childList"===e.type||!("attributes"!==e.type||!["value","label","disabled","selected"].includes(e.attributeName))&&"SNICE-OPTION"===e.target.nodeName)&&(this.readOptionsFromChildren(),this.filteredOptions=[...this.mergedOptions],this.editable||(this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownContent())}readOptionsFromChildren(){const e=Array.from(this.querySelectorAll("snice-option"));this.childOptions=e.map(e=>e.optionData?e.optionData:{value:e.getAttribute("value")||"",label:e.getAttribute("label")||e.textContent?.trim()||"",disabled:e.hasAttribute("disabled"),selected:e.hasAttribute("selected")})}handleEditableInput(e){this.editableInputValue=e.target.value,this.filterEditableOptions(this.editableInputValue),this.isOpen||this.openDropdown()}handleEditableFocus(){this.isOpen||this.readonly||this.openDropdown()}handleEditableBlur(e){setTimeout(()=>{this.isOpen&&(this.commitEditableValue(),this.closeDropdown())},200)}handleEditableClick(){this.isOpen||this.interactionDisabled||this.readonly||this.openDropdown()}handleEditableArrowClick(e){e.preventDefault(),e.stopPropagation(),this.interactionDisabled||this.readonly||(this.isOpen?this.closeDropdown():(this.openDropdown(),this.editableInput?.focus()))}handleEditableKeydown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this.isOpen?this.focusNextOption():this.openDropdown();break;case"ArrowUp":e.preventDefault(),this.isOpen&&this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.isOpen&&this.focusedIndex>=0){const e=this.filteredOptions[this.focusedIndex];e&&!e.disabled&&this.handleEditableOptionSelect(e)}else this.isOpen&&(this.commitEditableValue(),this.closeDropdown());break;case"Escape":this.isOpen&&(this.closeDropdown(),this.syncEditableInputToValue());break;case"Tab":this.isOpen&&(this.commitEditableValue(),this.closeDropdown())}}handleEditableOptionSelect(e){this.value=e.value,this.editableInputValue=e.label,this.editableInput&&(this.editableInput.value=e.label),this.closeDropdown(),this.dispatchChangeEvent(e),this.editableInput?.focus()}commitEditableValue(){if(!this.editableInput)return;const e=this.editableInput.value.trim(),t=this.mergedOptions.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(this.value=t.value,this.editableInputValue=t.label,this.editableInput.value=t.label,this.dispatchChangeEvent(t)):this.allowFreeText&&e?(this.value=e,this.editableInputValue=e,this.dispatchChangeEvent()):this.syncEditableInputToValue()}filterEditableOptions(e){if(this.remote)return void this.scheduleRemoteSearch(e);const t=this.mergedOptions;if(e){const i=e.toLowerCase();this.filteredOptions=t.filter(e=>e.label.toLowerCase().includes(i))}else this.filteredOptions=[...t];this.focusedIndex=-1,this.updateDropdownContent()}syncEditableInputToValue(){if(this.editableInput)if(this.value){const e=this.mergedOptions.find(e=>e.value===this.value);e?(this.editableInput.value=e.label,this.editableInputValue=e.label):this.allowFreeText?(this.editableInput.value=this.value,this.editableInputValue=this.value):(this.editableInput.value="",this.editableInputValue="")}else this.editableInput.value="",this.editableInputValue=""}updateEditableState(){if(!this.editableInput)return;this.editableInput.setAttribute("aria-expanded",String(this.isOpen)),this.editableInput.classList.toggle("select-editable-input--open",this.isOpen);const e=this.invalid||this.constraintInvalid;this.editableInput.setAttribute("aria-invalid",String(e)),this.editableInput.classList.toggle("select-editable-input--invalid",e)}handleDropdownMousedown(e){this.editable&&e.preventDefault()}handleTriggerOpen(e){["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)&&(e.preventDefault(),this.isOpen||this.openDropdown())}handleSearchKeydown(e){switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}}focusNextOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);e[this.focusedIndex]?.disabled;)this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);this.updateOptionFocus()}}focusPreviousOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);e[this.focusedIndex]?.disabled;)this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);this.updateOptionFocus()}}updateOptionFocus(){if(this.optionElements){this.optionElements.forEach((e,t)=>{e.classList.toggle("select-option--focused",t===this.focusedIndex)});const e=this.optionElements?.[this.focusedIndex];e&&e.scrollIntoView({block:"nearest"})}}handleClearClick(e){this.interactionDisabled||this.readonly||(e.preventDefault(),e.stopPropagation(),this.clear())}handleTriggerClick(e){e.target.closest(".select-clear")||(e.stopPropagation(),this.interactionDisabled||this.readonly||this.toggleDropdown())}handleOptionsClick(e){if(this.interactionDisabled||this.readonly)return;const t=e.target;if(t.closest(".select-tag-remove")){e.stopPropagation();const i=t.closest(".select-tag-remove").getAttribute("data-value");return void(i&&this.multiple&&(this.selectedValues.delete(i),this.value=Array.from(this.selectedValues).join(","),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()))}const i=t.closest(".select-option");if(!i)return;e.stopPropagation();const a=i.getAttribute("data-value");if(!a)return;const s=this.mergedOptions.find(e=>e.value===a);s&&!s.disabled&&(this.editable?this.handleEditableOptionSelect(s):this.handleOptionSelect(s))}handleSearchInput(e){const t=e.target.value;if(this.remote)return void this.scheduleRemoteSearch(t);const i=t.toLowerCase();this.filteredOptions=i?this.mergedOptions.filter(e=>e.label.toLowerCase().includes(i)):[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent()}handleOptionSelect(e){this.multiple?(this.selectedValues.has(e.value)?this.selectedValues.delete(e.value):this.selectedValues.add(e.value),this.value=Array.from(this.selectedValues).join(","),this.updateDropdownContent()):(this.value=e.value,this.closeDropdown()),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent(e)}handleValueChange(){this.syncRenderedValue(),this.syncFormState()}handleDefaultValueChange(){this.dirtyValue||this.applyDefaultValue()}handleOptionsPropertyChange(){this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent(),this.editable&&this.syncEditableInputToValue()}handleDisabledChange(){this.editable||(this.updateTriggerState(),this.updateClearButton()),this.interactionDisabled&&this.isOpen&&!this.remote&&this.closeDropdown(),this.syncValidity()}handleValidationConfigurationChange(){this.syncRenderedValue(),this.syncValidity()}handleValidationAnchorChange(){queueMicrotask(()=>{this.rendered.then(()=>{this.isConnected&&(this.syncRenderedValue(),this.syncValidity(),this.labelAssociation.sync())})})}handleInvalidChange(){const e=this.invalid||this.constraintInvalid;this.trigger?.setAttribute("aria-invalid",String(e)),this.trigger?.classList.toggle("select-trigger--invalid",e),this.editableInput?.setAttribute("aria-invalid",String(e)),this.editableInput?.classList.toggle("select-editable-input--invalid",e)}handleOpenChange(){this.updateDropdownState(),this.editable?(this.updateEditableState(),this.isOpen&&(this.remote?this.scheduleRemoteSearch(this.editableInput?.value||""):(this.filteredOptions=[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent())),this.isOpen||(this.focusedIndex=-1)):(this.updateTriggerState(),this.isOpen&&this.searchable&&this.searchInput&&setTimeout(()=>this.searchInput?.focus(),100),this.isOpen&&this.remote&&this.searchable&&this.scheduleRemoteSearch(this.searchInput?.value||""),this.isOpen||(this.focusedIndex=-1,this.searchInput&&(this.searchInput.value="",this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent())))}updateValueDisplay(){if(!this.valueDisplay)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);if(this.multiple&&e.length>0){const t=document.createElement("div");t.className="select-value--multiple",e.forEach(e=>{const i=document.createElement("span");i.className="select-tag";const a=document.createElement("span");a.className="select-tag-remove",a.setAttribute("data-value",e.value),a.setAttribute("aria-label",`Remove ${e.label}`),a.hidden=this.interactionDisabled||this.readonly,a.textContent="×",i.append(this.createIcon("select-tag-icon",e.icon),document.createTextNode(e.label),a),t.append(i)}),this.valueDisplay.replaceChildren(t)}else if(e.length>0){const t=e[0],i=document.createElement("div");i.className="select-value--single";const a=document.createElement("span");a.textContent=t.label,i.append(this.createIcon("select-value-icon",t.icon),a),this.valueDisplay.replaceChildren(i)}else{const e=document.createElement("span");e.className="select-placeholder",e.textContent=this.placeholder,this.valueDisplay.replaceChildren(e)}}updateClearButton(){if(!this.clearButton)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);this.clearButton.style.display=this.clearable&&e.length>0&&!this.interactionDisabled&&!this.readonly?"":"none"}updateDropdownContent(){this.optionsList&&this.optionsList.replaceChildren(this.renderOptions())}dispatchChangeEvent(e){return{value:this.multiple?Array.from(this.selectedValues):this.value,option:e,select:this}}dispatchOpenEvent(){return{select:this}}dispatchCloseEvent(){return{select:this}}focus(){this.editable?this.editableInput?.focus():this.trigger?.focus()}get type(){return this.multiple?"select-multiple":"select-one"}get form(){return G(this,this.internals)}get validity(){return this.internals?.validity??this.validationProxy.validity}get validationMessage(){return this.internals?.validationMessage??this.validationProxy.validationMessage}get willValidate(){return!this.interactionDisabled&&!this.readonly&&(this.internals?.willValidate??!0)}get labels(){return this.labelAssociation.labels}blur(){this.editable?this.editableInput?.blur():this.trigger?.blur(),this.isOpen&&this.closeDropdown()}checkValidity(){return this.syncValidity(),this.internals?.checkValidity()??this.validationProxy.checkValidity()}reportValidity(){return this.syncValidity(),this.internals?.reportValidity()??this.validationProxy.reportValidity()}setCustomValidity(e){this.customValidationMessage=String(e),this.syncValidity()}clear(){this.multiple?(this.selectedValues.clear(),this.value=""):this.value="",this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton()),this.dispatchChangeEvent()}openDropdown(){this.isOpen||this.interactionDisabled||this.readonly||(this.open=!0,this.dispatchOpenEvent())}closeDropdown(){this.isOpen&&(this.open=!1,this.dispatchCloseEvent())}toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()}selectOption(e){const t=this.mergedOptions.find(t=>t.value===e);t&&!t.disabled&&(this.editable?this.handleEditableOptionSelect(t):this.handleOptionSelect(t))}updateTriggerState(){if(!this.trigger)return;this.trigger.classList.toggle("select-trigger--open",this.isOpen),this.trigger.classList.toggle("select-trigger--disabled",this.interactionDisabled),this.trigger.classList.toggle("select-trigger--readonly",this.readonly);const e=this.invalid||this.constraintInvalid;this.trigger.classList.toggle("select-trigger--invalid",e),this.trigger.setAttribute("aria-invalid",String(e)),this.trigger.classList.toggle("select-trigger--loading",this.loading),this.trigger.setAttribute("aria-expanded",String(this.isOpen)),this.trigger.disabled=this.interactionDisabled}updateDropdownState(){this.dropdown&&(this.dropdown.classList.toggle("select-dropdown--open",this.isOpen),this.arrow&&this.arrow.classList.toggle("select-arrow--open",this.isOpen))}})})(),(()=>{let t,o,c,d,h,u,p,g,f,v,k,x,C,S,E,D,A,R,M,z,F,$,I,T,L=[i("snice-button",{formAssociated:!0,delegatesFocus:!0})],V=[],B=HTMLElement,O=[],j=[],H=[],q=[],_=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[],ke=[],xe=[],Ce=[],Se=[],Ee=[],De=[],Ae=[];(class extends B{static{o=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(B[Symbol.metadata]??null):void 0;c=[a()],d=[s({})],h=[s({})],u=[s({})],p=[s({type:Boolean})],g=[s({type:Boolean})],f=[s({type:Boolean})],v=[s({type:Boolean})],k=[s({type:Boolean})],x=[s({type:String,converter:P})],C=[s({type:String})],S=[s({type:String})],E=[s({type:String})],D=[s({attribute:"icon-placement"})],A=[s({attribute:"justify-text"})],R=[n('[slot="icon"]',{light:!0})],M=[n(".button")],z=[n(".spinner")],F=[n(".label")],$=[n(".icon")],I=[l()],T=[r()],y(this,null,I,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,O),y(this,null,T,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,O),y(null,null,c,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},j,H),y(null,null,d,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},q,_),y(null,null,h,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},K,W),y(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},U,Z),y(null,null,p,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},Y,J),y(null,null,g,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},Q,X),y(null,null,f,{kind:"field",name:"outline",static:!1,private:!1,access:{has:e=>"outline"in e,get:e=>e.outline,set:(e,t)=>{e.outline=t}},metadata:e},ee,te),y(null,null,v,{kind:"field",name:"pill",static:!1,private:!1,access:{has:e=>"pill"in e,get:e=>e.pill,set:(e,t)=>{e.pill=t}},metadata:e},ie,ae),y(null,null,k,{kind:"field",name:"circle",static:!1,private:!1,access:{has:e=>"circle"in e,get:e=>e.circle,set:(e,t)=>{e.circle=t}},metadata:e},se,ne),y(null,null,x,{kind:"field",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:e},le,re),y(null,null,C,{kind:"field",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:e},oe,ce),y(null,null,S,{kind:"field",name:"download",static:!1,private:!1,access:{has:e=>"download"in e,get:e=>e.download,set:(e,t)=>{e.download=t}},metadata:e},de,he),y(null,null,E,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},ue,me),y(null,null,D,{kind:"field",name:"iconPlacement",static:!1,private:!1,access:{has:e=>"iconPlacement"in e,get:e=>e.iconPlacement,set:(e,t)=>{e.iconPlacement=t}},metadata:e},pe,ge),y(null,null,A,{kind:"field",name:"justifyText",static:!1,private:!1,access:{has:e=>"justifyText"in e,get:e=>e.justifyText,set:(e,t)=>{e.justifyText=t}},metadata:e},be,fe),y(null,null,R,{kind:"field",name:"iconSlotChild",static:!1,private:!1,access:{has:e=>"iconSlotChild"in e,get:e=>e.iconSlotChild,set:(e,t)=>{e.iconSlotChild=t}},metadata:e},ve,ye),y(null,null,M,{kind:"field",name:"button",static:!1,private:!1,access:{has:e=>"button"in e,get:e=>e.button,set:(e,t)=>{e.button=t}},metadata:e},we,ke),y(null,null,z,{kind:"field",name:"spinner",static:!1,private:!1,access:{has:e=>"spinner"in e,get:e=>e.spinner,set:(e,t)=>{e.spinner=t}},metadata:e},xe,Ce),y(null,null,F,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},Se,Ee),y(null,null,$,{kind:"field",name:"iconElement",static:!1,private:!1,access:{has:e=>"iconElement"in e,get:e=>e.iconElement,set:(e,t)=>{e.iconElement=t}},metadata:e},De,Ae),y(null,t={value:o},L,{kind:"class",name:o.name,metadata:e},null,V),o=t.value,e&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(o,V)}constructor(){super(),this.internals=w(this,O),this.formDisabled=w(this,j,!1),this.variant=(w(this,H),w(this,q,"default")),this.size=(w(this,_),w(this,K,"medium")),this.type=(w(this,W),w(this,U,"button")),this.disabled=(w(this,Z),w(this,Y,!1)),this.loading=(w(this,J),w(this,Q,!1)),this.outline=(w(this,X),w(this,ee,!1)),this.pill=(w(this,te),w(this,ie,!1)),this.circle=(w(this,ae),w(this,se,!1)),this.href=(w(this,ne),w(this,le,"")),this.target=(w(this,re),w(this,oe,"")),this.download=(w(this,ce),w(this,de,"")),this.icon=(w(this,he),w(this,ue,"")),this.iconPlacement=(w(this,me),w(this,pe,"start")),this.justifyText=(w(this,ge),w(this,be,"center")),this.iconSlotChild=(w(this,fe),w(this,ve,void 0)),this.button=(w(this,ye),w(this,we,void 0)),this.spinner=(w(this,ke),w(this,xe,void 0)),this.label=(w(this,Ce),w(this,Se,void 0)),this.iconElement=(w(this,Ee),w(this,De,void 0)),w(this,Ae),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}get hasIconSlot(){return!!this.iconSlotChild}get effectiveDisabled(){return this.disabled||this.formDisabled}get interactionDisabled(){return this.effectiveDisabled||this.loading}render(){const t=this.effectiveDisabled,i=this.icon||this.hasIconSlot,a=i&&"start"===this.iconPlacement,s=i&&"end"===this.iconPlacement,n=["button",`button--${this.variant||"default"}`,`button--${this.size||"medium"}`,this.outline?"button--outline":"",this.pill?"button--pill":"",this.circle?"button--circle":"",this.loading?"button--loading":"",t?"button--disabled":"",i?"button--has-icon":"",i?`button--icon-${this.iconPlacement}`:""].filter(Boolean).join(" ");return e`
|
|
213
|
+
`}createIcon(e,t){const i=document.createElement("img");return i.className=e,i.setAttribute("src",t||""),i.setAttribute("alt",""),i.hidden=!t,i}renderOptions(){const e=document.createDocumentFragment();if(this.remoteSearching){const t=document.createElement("div");t.className="select-loading-indicator";const i=document.createElement("span");i.className="select-loading-spinner";const a=document.createElement("span");return a.textContent="Searching...",t.append(i,a),e.append(t),e}const t=this.searchable||this.editable||this.remote?this.filteredOptions:this.mergedOptions;if(0===t.length){const t=document.createElement("div");t.className="select-no-options";const i=document.createElement("span");i.className="select-no-options-text",i.dataset.search="true",i.hidden=!(this.searchable||this.editable||this.remote)||this.filteredOptions.length>0,i.textContent="No matches found";const a=document.createElement("span");return a.className="select-no-options-text",a.dataset.search="false",a.hidden=(this.searchable||this.editable||this.remote)&&0===this.filteredOptions.length,a.textContent="No options available",t.append(i,a),e.append(t),e}return t.forEach((t,i)=>{const a=this.multiple?this.selectedValues.has(t.value):t.value===this.value,s=document.createElement("div");s.className="select-option",s.classList.toggle("select-option--selected",a),s.classList.toggle("select-option--disabled",Boolean(t.disabled)),s.classList.toggle("select-option--focused",i===this.focusedIndex),s.classList.toggle("select-option--has-icon",Boolean(t.icon)),s.setAttribute("data-value",t.value),s.setAttribute("role","option"),s.setAttribute("aria-selected",String(a)),s.setAttribute("aria-disabled",String(t.disabled)),s.setAttribute("part","option");const n=document.createElement("span");n.className="select-option-check",n.setAttribute("aria-hidden","true"),n.hidden=!this.multiple;const l=document.createElement("span");l.className="select-option-check-mark",l.hidden=!a,l.textContent="✓",n.append(l);const r=document.createElement("span");r.className="select-option-label",r.textContent=t.label,s.append(n,this.createIcon("select-option-icon",t.icon),r),e.append(s)}),e}styles(){return m`${":host{display:inline-block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);position:relative;width:100%;max-width:18.75rem}[hidden]{display:none!important}img[src=\"\"]{display:none}.select-wrapper{position:relative;width:100%}.select-label{display:block;margin-bottom:.25rem;font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);line-height:var(--snice-line-height-normal, 1.5);color:var(--snice-color-text,rgb(23 23 23));text-align:left}.select-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.select-error-text,.select-helper-text{display:block;margin-top:var(--snice-spacing-2xs,.25rem);font-size:var(--snice-font-size-xs, .75rem);font-weight:var(--snice-font-weight-normal,400);line-height:var(--snice-line-height-normal, 1.5)}.select-helper-text{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-error-text{color:var(--snice-color-danger,rgb(220 38 38))}.select-trigger{box-sizing:border-box;min-width:0;width:100%;display:flex;align-items:center;justify-content:space-between;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);cursor:pointer;transition:all var(--snice-transition-fast, 150ms) ease;position:relative;text-align:left;font-family:inherit;color:var(--snice-color-text,rgb(23 23 23))}.select-trigger--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-trigger--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:var(--snice-select-min-height,2.5rem)}.select-trigger--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-trigger:hover:not(.select-trigger--disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger:focus-visible{outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-trigger--disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:not-allowed;opacity:.6}.select-trigger--readonly{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-trigger--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.select-placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-value{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-value--single{display:flex;align-items:center;gap:.5rem}.select-value-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-value--multiple{display:flex;gap:.25rem;flex-wrap:wrap}.select-tag{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .375rem;background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-xs, .75rem)}.select-tag-icon{width:.75rem;height:.75rem;object-fit:contain;flex-shrink:0}.select-tag-remove{cursor:pointer;padding:0;background:0 0;border:none;color:inherit;font-size:.75rem;line-height:1}.select-tag-remove:hover{opacity:.7}.select-icons{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;gap:.25rem;pointer-events:none;z-index:1}.select-clear{padding:.125rem;background:0 0;border:none;cursor:pointer;color:var(--snice-color-text-secondary,rgb(82 82 82));display:flex;align-items:center;justify-content:center;border-radius:var(--snice-border-radius-sm,.125rem);pointer-events:auto}.select-clear:hover{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text,rgb(23 23 23))}.select-arrow{transition:transform var(--snice-transition-fast, 150ms) ease;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none}.select-arrow--open{transform:rotate(180deg)}.select-dropdown{position:absolute;top:100%;margin-top:.25rem;left:0;right:0;background:var(--snice-color-surface-container-high,rgb(252 251 249));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);box-shadow:var(--snice-shadow-lg,0 10px 15px -3px rgb(0 0 0 / .1),0 4px 6px -4px rgb(0 0 0 / .1));z-index:1000;opacity:0;transform:translateY(-8px) scaleY(.95);transform-origin:top;pointer-events:none;transition:opacity var(--snice-transition-fast, 150ms) ease,transform var(--snice-transition-fast, 150ms) ease;display:flex;flex-direction:column;overflow:hidden}.select-dropdown--open{opacity:1;transform:translateY(0) scaleY(1);pointer-events:auto}.select-search{padding:.5rem;border-bottom:1px solid var(--snice-color-border,rgb(226 226 226));flex-shrink:0}.select-search-input{width:100%;padding:.375rem .625rem;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);font-size:var(--snice-font-size-sm, .875rem);font-family:inherit;color:var(--snice-color-text,rgb(23 23 23));box-sizing:border-box}.select-search-input:focus-visible{outline:0;border-color:var(--snice-color-primary,rgb(37 99 235))}.select-options{max-height:12.5rem;overflow-y:auto;overflow-x:hidden;padding:.25rem;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:var(--snice-color-border,rgb(226 226 226)) var(--snice-color-surface-container-low,rgb(245 245 245))}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:var(--snice-border-radius-md,.25rem);margin:.25rem 0}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);border:2px solid var(--snice-color-surface,rgb(255 255 255))}.select-option{padding:.5rem .75rem;cursor:pointer;border-radius:var(--snice-border-radius-sm,.125rem);transition:background var(--snice-transition-fast, 150ms) ease;display:flex;align-items:center;gap:.5rem}.select-option:hover:not(.select-option--disabled){background:var(--snice-color-surface-container-low,rgb(245 245 245))}.select-option--selected{background:var(--snice-color-primary-subtle,rgb(219 234 254));color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500)}.select-option--focused{background:var(--snice-color-surface-container-low,rgb(245 245 245));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:-2px}.select-option--disabled{opacity:.5;cursor:not-allowed}.select-option-icon{width:1rem;height:1rem;object-fit:contain;flex-shrink:0}.select-option-check{width:1rem;height:1rem;display:flex;align-items:center;justify-content:center;flex-shrink:0}.select-option-label{flex:1}.select-no-options{padding:1rem;text-align:center;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-native{position:absolute;opacity:0;pointer-events:none;width:0;height:0}.select-options::-webkit-scrollbar{width:6px}.select-options::-webkit-scrollbar-track{background:var(--snice-color-surface-container-low,rgb(245 245 245));border-radius:3px}.select-options::-webkit-scrollbar-thumb{background:var(--snice-color-border,rgb(226 226 226));border-radius:3px}.select-options::-webkit-scrollbar-thumb:hover{background:var(--snice-color-border-hover,rgb(180 180 180))}.select-trigger--loading{cursor:wait;opacity:.7}.select-spinner{display:inline-block;width:.875rem;height:.875rem;margin-right:.25rem}.select-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.select-freetext-input{flex:1;border:none;outline:0;background:0 0;font-family:inherit;font-size:inherit;color:var(--snice-color-text,rgb(23 23 23));padding:0;min-width:0;width:100%}.select-freetext-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82))}.select-editable-container{position:relative;display:flex;align-items:center;width:100%}.select-editable-input{width:100%;box-sizing:border-box;font-family:inherit;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));color:var(--snice-color-text,rgb(23 23 23));border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-md,.25rem);transition:all var(--snice-transition-fast, 150ms) ease;outline:0;-webkit-appearance:none;-moz-appearance:none;appearance:none}.select-editable-input--small{padding:.375rem 2rem .375rem .625rem;font-size:var(--snice-font-size-sm, .875rem);min-height:2rem}.select-editable-input--medium{padding:.5rem 2.25rem .5rem .75rem;font-size:var(--snice-font-size-md, 1rem);min-height:2.5rem}.select-editable-input--large{padding:.625rem 2.5rem .625rem .875rem;font-size:var(--snice-font-size-lg, 1.125rem);min-height:3rem}.select-editable-input:hover:not(:disabled){border-color:var(--snice-color-border-hover,rgb(180 180 180))}.select-editable-input:focus-visible{border-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.select-editable-input--open{border-color:var(--snice-color-primary,rgb(37 99 235))}.select-editable-input--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.select-editable-input:disabled{background:var(--snice-color-surface-container-low,rgb(245 245 245));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed;opacity:.6}.select-editable-input:read-only{background:var(--snice-color-surface-container-low,rgb(245 245 245));cursor:default}.select-editable-input::placeholder{color:var(--snice-color-text-secondary,rgb(82 82 82));opacity:.7}.select-editable-arrow{position:absolute;right:.5rem;top:50%;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;color:var(--snice-color-text-secondary,rgb(82 82 82));pointer-events:none;transition:transform var(--snice-transition-fast, 150ms) ease}.select-editable-arrow--open{transform:translateY(-50%) rotate(180deg)}.select-loading-indicator{display:flex;align-items:center;justify-content:center;gap:.5rem;padding:.75rem 1rem;color:var(--snice-color-text-secondary,rgb(82 82 82));font-size:var(--snice-font-size-sm, .875rem)}.select-loading-spinner{display:inline-block;width:1rem;height:1rem;flex-shrink:0}.select-loading-spinner::after{content:'';display:block;width:100%;height:100%;border:2px solid var(--snice-color-border,rgb(226 226 226));border-top-color:var(--snice-color-primary,rgb(37 99 235));border-radius:50%;animation:.6s linear infinite spin}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}init(){if(this.readOptionsFromChildren(),Object.prototype.hasOwnProperty.call(this,"value")){const e=this.value;delete this.value,this.value=String(e??"")}else this.dirtyValue||this.applyDefaultValue();this.multiple&&this.value&&(this.selectedValues=new Set(this.value.split(",").map(e=>e.trim()))),this.filteredOptions=[...this.mergedOptions],this.syncFormState(),this.editable?(this.syncEditableInputToValue(),this.updateEditableState()):(this.updateTriggerState(),this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownState(),this.updateDropdownContent(),this.observeChildren(),this.setupGlobalListeners(),this.labelAssociation.connect()}applyDefaultValue(){this.setValue(this.defaultValue,!1)}setValue(e,t){t&&(this.dirtyValue=!0),this.valueState=String(e??""),this.syncRenderedValue(),this.syncFormState()}syncRenderedValue(){this.multiple&&(this.selectedValues=new Set(this.value?this.value.split(",").map(e=>e.trim()):[])),this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton())}resetTransientState(){clearTimeout(this.remoteSearchTimeout),this.open=!1,this.focusedIndex=-1,this.filteredOptions=[...this.mergedOptions],this.searchInput&&(this.searchInput.value=""),this.syncRenderedValue(),this.updateDropdownContent()}syncFormValue(){this.internals?.setFormValue(this.value,this.value)}get validationProxy(){return this.validationInput||(this.validationInput=document.createElement("input")),this.validationInput}syncFormState(){this.syncFormValue(),this.syncValidity()}syncValidity(){const e=this.interactionDisabled||this.readonly,t=!e&&this.required&&(this.multiple?0===this.selectedValues.size:""===this.value),i=e?{}:{customError:Boolean(this.customValidationMessage),valueMissing:t},a=_(i),s=this.customValidationMessage||(t?"Please select an option.":"")||(a?"Please select a valid option.":"");this.constraintInvalid=a;const n=this.invalid||a,l=this.editable?this.editableInput:this.trigger;this.validationProxy.setCustomValidity(a?s:""),this.trigger?.setAttribute("aria-invalid",String(n)),this.trigger?.classList.toggle("select-trigger--invalid",n),this.editableInput?.setAttribute("aria-invalid",String(n)),this.editableInput?.classList.toggle("select-editable-input--invalid",n),G(this.internals,i,s,l)}onReconnect(){this.setupGlobalListeners(),this.observeChildren(),this.labelAssociation.connect()}cleanup(){this.removeGlobalListeners(),this.childObserver?.disconnect(),this.labelAssociation.disconnect()}setupGlobalListeners(){this.outsideClickHandler=e=>{if(!this.isOpen)return;const t=e.composedPath(),i=Array.from(this.labels||[]).some(e=>t.includes(e));t.includes(this)||i||(this.editable&&this.commitEditableValue(),this.closeDropdown())},this.globalKeyHandler=e=>{if(!this.isOpen||this.editable)return;const t=e.composedPath()[0]===this.searchInput;switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":case" ":if(" "===e.key&&t)return;if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}},document.addEventListener("click",this.outsideClickHandler),document.addEventListener("keydown",this.globalKeyHandler)}removeGlobalListeners(){this.outsideClickHandler&&document.removeEventListener("click",this.outsideClickHandler),this.globalKeyHandler&&document.removeEventListener("keydown",this.globalKeyHandler)}observeChildren(){const e=new MutationObserver(e=>{this.handleChildrenChange(e)});e.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value","label","disabled","selected"]}),this.childObserver=e}handleChildrenChange(e){e.some(e=>"childList"===e.type||!("attributes"!==e.type||!["value","label","disabled","selected"].includes(e.attributeName))&&"SNICE-OPTION"===e.target.nodeName)&&(this.readOptionsFromChildren(),this.filteredOptions=[...this.mergedOptions],this.editable||(this.updateValueDisplay(),this.updateClearButton()),this.updateDropdownContent())}readOptionsFromChildren(){const e=Array.from(this.querySelectorAll("snice-option"));this.childOptions=e.map(e=>e.optionData?e.optionData:{value:e.getAttribute("value")||"",label:e.getAttribute("label")||e.textContent?.trim()||"",disabled:e.hasAttribute("disabled"),selected:e.hasAttribute("selected")})}handleEditableInput(e){this.editableInputValue=e.target.value,this.filterEditableOptions(this.editableInputValue),this.isOpen||this.openDropdown()}handleEditableFocus(){this.isOpen||this.readonly||this.openDropdown()}handleEditableBlur(e){setTimeout(()=>{this.isOpen&&(this.commitEditableValue(),this.closeDropdown())},200)}handleEditableClick(){this.isOpen||this.interactionDisabled||this.readonly||this.openDropdown()}handleEditableArrowClick(e){e.preventDefault(),e.stopPropagation(),this.interactionDisabled||this.readonly||(this.isOpen?this.closeDropdown():(this.openDropdown(),this.editableInput?.focus()))}handleEditableKeydown(e){switch(e.key){case"ArrowDown":e.preventDefault(),this.isOpen?this.focusNextOption():this.openDropdown();break;case"ArrowUp":e.preventDefault(),this.isOpen&&this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.isOpen&&this.focusedIndex>=0){const e=this.filteredOptions[this.focusedIndex];e&&!e.disabled&&this.handleEditableOptionSelect(e)}else this.isOpen&&(this.commitEditableValue(),this.closeDropdown());break;case"Escape":this.isOpen&&(this.closeDropdown(),this.syncEditableInputToValue());break;case"Tab":this.isOpen&&(this.commitEditableValue(),this.closeDropdown())}}handleEditableOptionSelect(e){this.value=e.value,this.editableInputValue=e.label,this.editableInput&&(this.editableInput.value=e.label),this.closeDropdown(),this.dispatchChangeEvent(e),this.editableInput?.focus()}commitEditableValue(){if(!this.editableInput)return;const e=this.editableInput.value.trim(),t=this.mergedOptions.find(t=>t.label.toLowerCase()===e.toLowerCase());t?(this.value=t.value,this.editableInputValue=t.label,this.editableInput.value=t.label,this.dispatchChangeEvent(t)):this.allowFreeText&&e?(this.value=e,this.editableInputValue=e,this.dispatchChangeEvent()):this.syncEditableInputToValue()}filterEditableOptions(e){if(this.remote)return void this.scheduleRemoteSearch(e);const t=this.mergedOptions;if(e){const i=e.toLowerCase();this.filteredOptions=t.filter(e=>e.label.toLowerCase().includes(i))}else this.filteredOptions=[...t];this.focusedIndex=-1,this.updateDropdownContent()}syncEditableInputToValue(){if(this.editableInput)if(this.value){const e=this.mergedOptions.find(e=>e.value===this.value);e?(this.editableInput.value=e.label,this.editableInputValue=e.label):this.allowFreeText?(this.editableInput.value=this.value,this.editableInputValue=this.value):(this.editableInput.value="",this.editableInputValue="")}else this.editableInput.value="",this.editableInputValue=""}updateEditableState(){if(!this.editableInput)return;this.editableInput.setAttribute("aria-expanded",String(this.isOpen)),this.editableInput.classList.toggle("select-editable-input--open",this.isOpen);const e=this.invalid||this.constraintInvalid;this.editableInput.setAttribute("aria-invalid",String(e)),this.editableInput.classList.toggle("select-editable-input--invalid",e)}handleDropdownMousedown(e){this.editable&&e.preventDefault()}handleTriggerOpen(e){["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)&&(e.preventDefault(),this.isOpen||this.openDropdown())}handleSearchKeydown(e){switch(e.key){case"Escape":this.closeDropdown(),this.trigger?.focus();break;case"ArrowDown":e.preventDefault(),this.focusNextOption();break;case"ArrowUp":e.preventDefault(),this.focusPreviousOption();break;case"Enter":if(e.preventDefault(),this.focusedIndex>=0){const e=(this.searchable?this.filteredOptions:this.mergedOptions)[this.focusedIndex];e&&!e.disabled&&this.handleOptionSelect(e)}}}focusNextOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);e[this.focusedIndex]?.disabled;)this.focusedIndex++,this.focusedIndex>=e.length&&(this.focusedIndex=0);this.updateOptionFocus()}}focusPreviousOption(){const e=this.searchable||this.editable?this.filteredOptions:this.mergedOptions;if(0!==e.filter(e=>!e.disabled).length){for(this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);e[this.focusedIndex]?.disabled;)this.focusedIndex--,this.focusedIndex<0&&(this.focusedIndex=e.length-1);this.updateOptionFocus()}}updateOptionFocus(){if(this.optionElements){this.optionElements.forEach((e,t)=>{e.classList.toggle("select-option--focused",t===this.focusedIndex)});const e=this.optionElements?.[this.focusedIndex];e&&e.scrollIntoView({block:"nearest"})}}handleClearClick(e){this.interactionDisabled||this.readonly||(e.preventDefault(),e.stopPropagation(),this.clear())}handleTriggerClick(e){e.target.closest(".select-clear")||(e.stopPropagation(),this.interactionDisabled||this.readonly||this.toggleDropdown())}handleOptionsClick(e){if(this.interactionDisabled||this.readonly)return;const t=e.target;if(t.closest(".select-tag-remove")){e.stopPropagation();const i=t.closest(".select-tag-remove").getAttribute("data-value");return void(i&&this.multiple&&(this.selectedValues.delete(i),this.value=Array.from(this.selectedValues).join(","),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent()))}const i=t.closest(".select-option");if(!i)return;e.stopPropagation();const a=i.getAttribute("data-value");if(!a)return;const s=this.mergedOptions.find(e=>e.value===a);s&&!s.disabled&&(this.editable?this.handleEditableOptionSelect(s):this.handleOptionSelect(s))}handleSearchInput(e){const t=e.target.value;if(this.remote)return void this.scheduleRemoteSearch(t);const i=t.toLowerCase();this.filteredOptions=i?this.mergedOptions.filter(e=>e.label.toLowerCase().includes(i)):[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent()}handleOptionSelect(e){this.multiple?(this.selectedValues.has(e.value)?this.selectedValues.delete(e.value):this.selectedValues.add(e.value),this.value=Array.from(this.selectedValues).join(","),this.updateDropdownContent()):(this.value=e.value,this.closeDropdown()),this.updateValueDisplay(),this.updateClearButton(),this.dispatchChangeEvent(e)}handleValueChange(){this.syncRenderedValue(),this.syncFormState()}handleDefaultValueChange(){this.dirtyValue||this.applyDefaultValue()}handleOptionsPropertyChange(){this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent(),this.editable&&this.syncEditableInputToValue()}handleDisabledChange(){this.editable||(this.updateTriggerState(),this.updateClearButton()),this.interactionDisabled&&this.isOpen&&!this.remote&&this.closeDropdown(),this.syncValidity()}handleValidationConfigurationChange(){this.syncRenderedValue(),this.syncValidity()}handleValidationAnchorChange(){queueMicrotask(()=>{this.rendered.then(()=>{this.isConnected&&(this.syncRenderedValue(),this.syncValidity(),this.labelAssociation.sync())})})}handleInvalidChange(){const e=this.invalid||this.constraintInvalid;this.trigger?.setAttribute("aria-invalid",String(e)),this.trigger?.classList.toggle("select-trigger--invalid",e),this.editableInput?.setAttribute("aria-invalid",String(e)),this.editableInput?.classList.toggle("select-editable-input--invalid",e)}handleOpenChange(){this.updateDropdownState(),this.editable?(this.updateEditableState(),this.isOpen&&(this.remote?this.scheduleRemoteSearch(this.editableInput?.value||""):(this.filteredOptions=[...this.mergedOptions],this.focusedIndex=-1,this.updateDropdownContent())),this.isOpen||(this.focusedIndex=-1)):(this.updateTriggerState(),this.isOpen&&this.searchable&&this.searchInput&&setTimeout(()=>this.searchInput?.focus(),100),this.isOpen&&this.remote&&this.searchable&&this.scheduleRemoteSearch(this.searchInput?.value||""),this.isOpen||(this.focusedIndex=-1,this.searchInput&&(this.searchInput.value="",this.filteredOptions=[...this.mergedOptions],this.updateDropdownContent())))}updateValueDisplay(){if(!this.valueDisplay)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);if(this.multiple&&e.length>0){const t=document.createElement("div");t.className="select-value--multiple",e.forEach(e=>{const i=document.createElement("span");i.className="select-tag";const a=document.createElement("span");a.className="select-tag-remove",a.setAttribute("data-value",e.value),a.setAttribute("aria-label",`Remove ${e.label}`),a.hidden=this.interactionDisabled||this.readonly,a.textContent="×",i.append(this.createIcon("select-tag-icon",e.icon),document.createTextNode(e.label),a),t.append(i)}),this.valueDisplay.replaceChildren(t)}else if(e.length>0){const t=e[0],i=document.createElement("div");i.className="select-value--single";const a=document.createElement("span");a.textContent=t.label,i.append(this.createIcon("select-value-icon",t.icon),a),this.valueDisplay.replaceChildren(i)}else{const e=document.createElement("span");e.className="select-placeholder",e.textContent=this.placeholder,this.valueDisplay.replaceChildren(e)}}updateClearButton(){if(!this.clearButton)return;const e=this.mergedOptions.filter(e=>this.multiple?this.selectedValues.has(e.value):e.value===this.value);this.clearButton.style.display=this.clearable&&e.length>0&&!this.interactionDisabled&&!this.readonly?"":"none"}updateDropdownContent(){this.optionsList&&this.optionsList.replaceChildren(this.renderOptions())}dispatchChangeEvent(e){return{value:this.multiple?Array.from(this.selectedValues):this.value,option:e,select:this}}dispatchOpenEvent(){return{select:this}}dispatchCloseEvent(){return{select:this}}focus(){this.editable?this.editableInput?.focus():this.trigger?.focus()}get type(){return this.multiple?"select-multiple":"select-one"}get form(){return K(this,this.internals)}get validity(){return this.internals?.validity??this.validationProxy.validity}get validationMessage(){return this.internals?.validationMessage??this.validationProxy.validationMessage}get willValidate(){return!this.interactionDisabled&&!this.readonly&&(this.internals?.willValidate??!0)}get labels(){return this.labelAssociation.labels}blur(){this.editable?this.editableInput?.blur():this.trigger?.blur(),this.isOpen&&this.closeDropdown()}checkValidity(){return this.syncValidity(),this.internals?.checkValidity()??this.validationProxy.checkValidity()}reportValidity(){return this.syncValidity(),this.internals?.reportValidity()??this.validationProxy.reportValidity()}setCustomValidity(e){this.customValidationMessage=String(e),this.syncValidity()}clear(){this.multiple?(this.selectedValues.clear(),this.value=""):this.value="",this.editable?this.syncEditableInputToValue():(this.updateValueDisplay(),this.updateClearButton()),this.dispatchChangeEvent()}openDropdown(){this.isOpen||this.interactionDisabled||this.readonly||(this.open=!0,this.dispatchOpenEvent())}closeDropdown(){this.isOpen&&(this.open=!1,this.dispatchCloseEvent())}toggleDropdown(){this.isOpen?this.closeDropdown():this.openDropdown()}selectOption(e){const t=this.mergedOptions.find(t=>t.value===e);t&&!t.disabled&&(this.editable?this.handleEditableOptionSelect(t):this.handleOptionSelect(t))}updateTriggerState(){if(!this.trigger)return;this.trigger.classList.toggle("select-trigger--open",this.isOpen),this.trigger.classList.toggle("select-trigger--disabled",this.interactionDisabled),this.trigger.classList.toggle("select-trigger--readonly",this.readonly);const e=this.invalid||this.constraintInvalid;this.trigger.classList.toggle("select-trigger--invalid",e),this.trigger.setAttribute("aria-invalid",String(e)),this.trigger.classList.toggle("select-trigger--loading",this.loading),this.trigger.setAttribute("aria-expanded",String(this.isOpen)),this.trigger.disabled=this.interactionDisabled}updateDropdownState(){this.dropdown&&(this.dropdown.classList.toggle("select-dropdown--open",this.isOpen),this.arrow&&this.arrow.classList.toggle("select-arrow--open",this.isOpen))}})})(),(()=>{let t,o,c,d,h,u,p,g,f,v,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L=[i("snice-button",{formAssociated:!0,delegatesFocus:!0})],V=[],B=HTMLElement,O=[],j=[],P=[],q=[],_=[],G=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[],ke=[],xe=[],Ce=[],Se=[],Ee=[],De=[],Ae=[];(class extends B{static{o=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(B[Symbol.metadata]??null):void 0;c=[a()],d=[s({})],h=[s({})],u=[s({})],p=[s({type:Boolean})],g=[s({type:Boolean})],f=[s({type:Boolean})],v=[s({type:Boolean})],k=[s({type:Boolean})],x=[s({type:String,converter:N})],C=[s({type:String})],S=[s({type:String})],E=[s({type:String})],D=[s({attribute:"icon-placement"})],A=[s({attribute:"justify-text"})],R=[n('[slot="icon"]',{light:!0})],M=[n(".button")],z=[n(".spinner")],$=[n(".label")],F=[n(".icon")],I=[l()],T=[r()],y(this,null,I,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,O),y(this,null,T,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,O),y(null,null,c,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},j,P),y(null,null,d,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},q,_),y(null,null,h,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},G,W),y(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},U,Z),y(null,null,p,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},Y,J),y(null,null,g,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},Q,X),y(null,null,f,{kind:"field",name:"outline",static:!1,private:!1,access:{has:e=>"outline"in e,get:e=>e.outline,set:(e,t)=>{e.outline=t}},metadata:e},ee,te),y(null,null,v,{kind:"field",name:"pill",static:!1,private:!1,access:{has:e=>"pill"in e,get:e=>e.pill,set:(e,t)=>{e.pill=t}},metadata:e},ie,ae),y(null,null,k,{kind:"field",name:"circle",static:!1,private:!1,access:{has:e=>"circle"in e,get:e=>e.circle,set:(e,t)=>{e.circle=t}},metadata:e},se,ne),y(null,null,x,{kind:"field",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:e},le,re),y(null,null,C,{kind:"field",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:e},oe,ce),y(null,null,S,{kind:"field",name:"download",static:!1,private:!1,access:{has:e=>"download"in e,get:e=>e.download,set:(e,t)=>{e.download=t}},metadata:e},de,he),y(null,null,E,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},ue,me),y(null,null,D,{kind:"field",name:"iconPlacement",static:!1,private:!1,access:{has:e=>"iconPlacement"in e,get:e=>e.iconPlacement,set:(e,t)=>{e.iconPlacement=t}},metadata:e},pe,ge),y(null,null,A,{kind:"field",name:"justifyText",static:!1,private:!1,access:{has:e=>"justifyText"in e,get:e=>e.justifyText,set:(e,t)=>{e.justifyText=t}},metadata:e},be,fe),y(null,null,R,{kind:"field",name:"iconSlotChild",static:!1,private:!1,access:{has:e=>"iconSlotChild"in e,get:e=>e.iconSlotChild,set:(e,t)=>{e.iconSlotChild=t}},metadata:e},ve,ye),y(null,null,M,{kind:"field",name:"button",static:!1,private:!1,access:{has:e=>"button"in e,get:e=>e.button,set:(e,t)=>{e.button=t}},metadata:e},we,ke),y(null,null,z,{kind:"field",name:"spinner",static:!1,private:!1,access:{has:e=>"spinner"in e,get:e=>e.spinner,set:(e,t)=>{e.spinner=t}},metadata:e},xe,Ce),y(null,null,$,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},Se,Ee),y(null,null,F,{kind:"field",name:"iconElement",static:!1,private:!1,access:{has:e=>"iconElement"in e,get:e=>e.iconElement,set:(e,t)=>{e.iconElement=t}},metadata:e},De,Ae),y(null,t={value:o},L,{kind:"class",name:o.name,metadata:e},null,V),o=t.value,e&&Object.defineProperty(o,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(o,V)}constructor(){super(),this.internals=w(this,O),this.formDisabled=w(this,j,!1),this.variant=(w(this,P),w(this,q,"default")),this.size=(w(this,_),w(this,G,"medium")),this.type=(w(this,W),w(this,U,"button")),this.disabled=(w(this,Z),w(this,Y,!1)),this.loading=(w(this,J),w(this,Q,!1)),this.outline=(w(this,X),w(this,ee,!1)),this.pill=(w(this,te),w(this,ie,!1)),this.circle=(w(this,ae),w(this,se,!1)),this.href=(w(this,ne),w(this,le,"")),this.target=(w(this,re),w(this,oe,"")),this.download=(w(this,ce),w(this,de,"")),this.icon=(w(this,he),w(this,ue,"")),this.iconPlacement=(w(this,me),w(this,pe,"start")),this.justifyText=(w(this,ge),w(this,be,"center")),this.iconSlotChild=(w(this,fe),w(this,ve,void 0)),this.button=(w(this,ye),w(this,we,void 0)),this.spinner=(w(this,ke),w(this,xe,void 0)),this.label=(w(this,Ce),w(this,Se,void 0)),this.iconElement=(w(this,Ee),w(this,De,void 0)),w(this,Ae),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}get hasIconSlot(){return!!this.iconSlotChild}get effectiveDisabled(){return this.disabled||this.formDisabled}get interactionDisabled(){return this.effectiveDisabled||this.loading}render(){const t=this.effectiveDisabled,i=this.icon||this.hasIconSlot,a=i&&"start"===this.iconPlacement,s=i&&"end"===this.iconPlacement,n=["button",`button--${this.variant||"default"}`,`button--${this.size||"medium"}`,this.outline?"button--outline":"",this.pill?"button--pill":"",this.circle?"button--circle":"",this.loading?"button--loading":"",t?"button--disabled":"",i?"button--has-icon":"",i?`button--icon-${this.iconPlacement}`:""].filter(Boolean).join(" ");return e`
|
|
214
214
|
<button class="${n}" type="${this.type}" ?disabled="${t}" aria-busy="${this.loading}" part="base" @click="${e=>this.handleInternalClick(e)}">
|
|
215
215
|
<span class="spinner" part="spinner"></span>
|
|
216
216
|
<if ${a}>
|
|
217
217
|
<span class="icon-slot" part="icon">
|
|
218
218
|
<slot name="icon">
|
|
219
219
|
<if ${this.icon}>
|
|
220
|
-
${
|
|
220
|
+
${H(this.icon,"icon")}
|
|
221
221
|
</if>
|
|
222
222
|
</slot>
|
|
223
223
|
</span>
|
|
@@ -229,13 +229,13 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
229
229
|
<span class="icon-slot" part="icon">
|
|
230
230
|
<slot name="icon">
|
|
231
231
|
<if ${this.icon}>
|
|
232
|
-
${
|
|
232
|
+
${H(this.icon,"icon")}
|
|
233
233
|
</if>
|
|
234
234
|
</slot>
|
|
235
235
|
</span>
|
|
236
236
|
</if>
|
|
237
237
|
</button>
|
|
238
|
-
`}handleInternalClick(e){if(this.interactionDisabled)return e.preventDefault(),void e.stopPropagation();if(""!==this.href){const t="string"==typeof this.href?this.href.trim():"";if(!t||!b(t))return e.preventDefault(),void e.stopPropagation();if(this.download){const e=document.createElement("a");e.href=t,e.download=this.download,e.click()}else this.target?window.open(t,this.target,"noopener"):window.location.href=t}else{const e=this.internals?.form||this.closest("form");if(e)switch(this.type){case"submit":e.requestSubmit();break;case"reset":e.reset()}}this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}formDisabledCallback(e){this.formDisabled=e}styles(){return m`${":host{display:inline-block;position:relative;width:auto;cursor:pointer}:host([disabled]){cursor:not-allowed}:host([justify-text=start]) .button{justify-content:flex-start}:host([justify-text=end]) .button{justify-content:flex-end}:host([justify-text=center]) .button{justify-content:center}.button{display:inline-flex;align-items:center;justify-content:center;width:100%;border:1px solid;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-weight:var(--snice-font-weight-medium,500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03));transition:color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),transform 180ms var(--snice-ease-spring, cubic-bezier(.34,1.56,.64,1));cursor:inherit;position:relative}.button::before{content:'';position:absolute;inset:0;border-radius:inherit;background:var(--snice-gradient-convex,none);pointer-events:none}.button:active:not(.button--disabled){transition:color 50ms var(--snice-ease-out, ease),background-color 50ms var(--snice-ease-out, ease),border-color 50ms var(--snice-ease-out, ease),box-shadow 50ms var(--snice-ease-out, ease),transform 80ms var(--snice-ease-out, ease);transform:translateY(0) scale(.97)}.button:focus-visible{outline:0;box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.button--disabled{opacity:.5;cursor:not-allowed;box-shadow:none}.button--small{font-size:var(--snice-font-size-sm, .875rem);height:2rem;padding:0 var(--snice-spacing-sm,.75rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--medium{font-size:var(--snice-font-size-md, 1rem);height:2.5rem;padding:0 var(--snice-spacing-md,1rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--large{font-size:var(--snice-font-size-lg, 1.125rem);height:3rem;padding:0 var(--snice-spacing-lg,1.5rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--default{background-color:var(--snice-color-surface,rgb(255 255 255));color:var(--snice-color-text,rgb(23 23 23));border-color:var(--snice-color-border,rgb(226 226 226))}.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--default:active:not(.button--disabled){background-color:var(--snice-color-surface-container,rgb(248 248 248));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--primary{background-color:var(--snice-color-primary,rgb(37 99 235));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-primary,rgb(37 99 235))}.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--primary:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--success{background-color:var(--snice-color-success,rgb(22 163 74));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-success,rgb(22 163 74))}.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-hover,rgb(21 128 61));border-color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--success:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--warning{background-color:var(--snice-color-warning,rgb(202 138 4));color:var(--button-warning-text,rgb(69 26 3));border-color:var(--snice-color-warning,rgb(202 138 4))}.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-hover,rgb(161 98 7));border-color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--warning:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--danger{background-color:var(--snice-color-danger,rgb(220 38 38));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-danger,rgb(220 38 38))}.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-hover,rgb(185 28 28));border-color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--danger:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--text{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235));border-color:transparent;box-shadow:none}.button--text::before{display:none}.button--text:hover:not(.button--disabled){background-color:var(--snice-color-primary-alpha,rgb(37 99 235 / .1));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--text:active:not(.button--disabled){background-color:var(--snice-color-primary-alpha-strong,rgb(37 99 235 / .15));box-shadow:none;transform:none}.button--outline{box-shadow:none}.button--outline::before{display:none}.button--outline.button--default{background-color:transparent;color:var(--snice-color-text,rgb(23 23 23))}.button--outline.button--primary{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235))}.button--outline.button--success{background-color:transparent;color:var(--snice-color-success,rgb(22 163 74))}.button--outline.button--warning{background-color:transparent;color:var(--snice-color-warning,rgb(202 138 4))}.button--outline.button--danger{background-color:transparent;color:var(--snice-color-danger,rgb(220 38 38))}.button--outline.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-hover,rgb(245 245 245));box-shadow:none;transform:none}.button--outline.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-subtle,rgb(239 246 255));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--outline.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-subtle,rgb(220 252 231));color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:none;transform:none}.button--outline.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-subtle,rgb(254 249 195));color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:none;transform:none}.button--outline.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-subtle,rgb(254 226 226));color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:none;transform:none}.button--outline:active:not(.button--disabled){background-color:var(--snice-color-primary-subtle-hover,var(--snice-color-surface-active,rgb(235 235 235)));box-shadow:none;transform:none}.button--pill{border-radius:var(--snice-border-radius-pill,9999px)}.button--circle{border-radius:var(--snice-border-radius-circle,50%);width:var(--size);padding:0}.button--small.button--circle{--size:2rem}.button--medium.button--circle{--size:2.5rem}.button--large.button--circle{--size:3rem}.button--loading{position:relative;cursor:wait}.button--loading .label{visibility:hidden}.spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1em;height:1em}.button--loading .spinner{display:block}.spinner::after{content:'';display:block;width:100%;height:100%;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.icon-slot{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon-slot:empty{display:none}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon img{width:100%;height:100%;object-fit:contain}.icon svg{width:100%;height:100%}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:1.25em;line-height:1}.icon-slot ::slotted(svg){width:1.25em;height:1.25em}.icon-slot ::slotted(img){width:1.25em;height:1.25em;object-fit:contain}.button--icon-start .icon,.button--icon-start .icon-slot{margin-right:.5em}.button--icon-end .icon,.button--icon-end .icon-slot{margin-left:.5em}.button--circle .icon,.button--circle .icon-slot{margin:0;transform:none;width:auto;height:auto}.button--circle .icon-slot ::slotted(*){font-size:1.25em;line-height:1;display:flex;align-items:center;justify-content:center}.button--circle .icon-slot ::slotted(svg){width:1.25em;height:1.25em}@media (prefers-reduced-motion:reduce){.icon-slot,.spinner,button,button:active{transition-duration:0s!important;animation-duration:0s!important}button:active{transform:none}}"}`}setLoading(e){this.loading=e}setDisabled(e){this.disabled=e}setVariant(e){this.variant=e}focus(e){this.effectiveDisabled||this.button?.focus(e)}blur(){this.button?.blur()}click(){this.effectiveDisabled||this.button?.click()}get form(){return G(this,this.internals)}get labels(){return this.internals?.labels??null}})})(),(()=>{let t,c,u,p,g,b,v,k,x,C,S,E,D,A,R,M,z,F,$,I,T,L,V,B,O,j,P,N,H,q,_,G,K=[i("snice-checkbox",{formAssociated:!0,delegatesFocus:!0})],W=[],U=HTMLElement,Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[],ke=[],xe=[],Ce=[],Se=[],Ee=[],De=[],Ae=[],Re=[],Me=[];(class extends U{static{c=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(U[Symbol.metadata]??null):void 0;u=[a()],p=[a()],g=[a()],b=[s({type:Boolean,attribute:"checked"})],v=[s({type:Boolean})],k=[s({type:Boolean})],x=[s({type:Boolean})],C=[s({type:Boolean})],S=[s({type:Boolean})],E=[s({})],D=[s({})],A=[s({})],R=[s({})],M=[n(".checkbox-input")],z=[n(".checkbox")],F=[n(".checkbox-label")],$=[n(".checkbox-wrapper")],I=[l()],T=[o()],L=[f("click")],V=[d("defaultChecked")],B=[d("checkedState",{immediate:!1})],O=[d("indeterminate",{immediate:!1})],j=[d("value",{immediate:!1})],P=[d("required",{immediate:!1})],N=[d("name",{immediate:!1})],H=[d("disabled","loading","formDisabled",{immediate:!1})],q=[d("invalid",{immediate:!1})],_=[h("checkbox-change",{bubbles:!0,composed:!0})],G=[r()],y(this,null,I,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,Z),y(this,null,T,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,Z),y(this,null,L,{kind:"method",name:"handleHostActivationClick",static:!1,private:!1,access:{has:e=>"handleHostActivationClick"in e,get:e=>e.handleHostActivationClick},metadata:e},null,Z),y(this,null,V,{kind:"method",name:"handleDefaultCheckedChange",static:!1,private:!1,access:{has:e=>"handleDefaultCheckedChange"in e,get:e=>e.handleDefaultCheckedChange},metadata:e},null,Z),y(this,null,B,{kind:"method",name:"handleCheckedChange",static:!1,private:!1,access:{has:e=>"handleCheckedChange"in e,get:e=>e.handleCheckedChange},metadata:e},null,Z),y(this,null,O,{kind:"method",name:"handleIndeterminateChange",static:!1,private:!1,access:{has:e=>"handleIndeterminateChange"in e,get:e=>e.handleIndeterminateChange},metadata:e},null,Z),y(this,null,j,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:e},null,Z),y(this,null,P,{kind:"method",name:"handleRequiredChange",static:!1,private:!1,access:{has:e=>"handleRequiredChange"in e,get:e=>e.handleRequiredChange},metadata:e},null,Z),y(this,null,N,{kind:"method",name:"handleNameChange",static:!1,private:!1,access:{has:e=>"handleNameChange"in e,get:e=>e.handleNameChange},metadata:e},null,Z),y(this,null,H,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:e},null,Z),y(this,null,q,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:e},null,Z),y(this,null,_,{kind:"method",name:"dispatchCheckboxChange",static:!1,private:!1,access:{has:e=>"dispatchCheckboxChange"in e,get:e=>e.dispatchCheckboxChange},metadata:e},null,Z),y(this,null,G,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,Z),y(null,null,u,{kind:"field",name:"checkedState",static:!1,private:!1,access:{has:e=>"checkedState"in e,get:e=>e.checkedState,set:(e,t)=>{e.checkedState=t}},metadata:e},Y,J),y(null,null,p,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},Q,X),y(null,null,g,{kind:"field",name:"constraintInvalid",static:!1,private:!1,access:{has:e=>"constraintInvalid"in e,get:e=>e.constraintInvalid,set:(e,t)=>{e.constraintInvalid=t}},metadata:e},ee,te),y(null,null,b,{kind:"field",name:"defaultChecked",static:!1,private:!1,access:{has:e=>"defaultChecked"in e,get:e=>e.defaultChecked,set:(e,t)=>{e.defaultChecked=t}},metadata:e},ie,ae),y(null,null,v,{kind:"field",name:"indeterminate",static:!1,private:!1,access:{has:e=>"indeterminate"in e,get:e=>e.indeterminate,set:(e,t)=>{e.indeterminate=t}},metadata:e},se,ne),y(null,null,k,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},le,re),y(null,null,x,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},oe,ce),y(null,null,C,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:e},de,he),y(null,null,S,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:e},ue,me),y(null,null,E,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},pe,ge),y(null,null,D,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:e},be,fe),y(null,null,A,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},ve,ye),y(null,null,R,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},we,ke),y(null,null,M,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:e},xe,Ce),y(null,null,z,{kind:"field",name:"checkbox",static:!1,private:!1,access:{has:e=>"checkbox"in e,get:e=>e.checkbox,set:(e,t)=>{e.checkbox=t}},metadata:e},Se,Ee),y(null,null,F,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:e},De,Ae),y(null,null,$,{kind:"field",name:"wrapper",static:!1,private:!1,access:{has:e=>"wrapper"in e,get:e=>e.wrapper,set:(e,t)=>{e.wrapper=t}},metadata:e},Re,Me),y(null,t={value:c},K,{kind:"class",name:c.name,metadata:e},null,W),c=t.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,W)}constructor(){super(),this.internals=w(this,Z),this.dirtyCheckedness=!1,this.pendingUserChange=!1,this.forwardingHostActivation=!1,this.customValidationMessage="",this.checkedState=w(this,Y,!1),this.formDisabled=(w(this,J),w(this,Q,!1)),this.constraintInvalid=(w(this,X),w(this,ee,!1)),this.defaultChecked=(w(this,te),w(this,ie,!1)),this.indeterminate=(w(this,ae),w(this,se,!1)),this.disabled=(w(this,ne),w(this,le,!1)),this.loading=(w(this,re),w(this,oe,!1)),this.required=(w(this,ce),w(this,de,!1)),this.invalid=(w(this,he),w(this,ue,!1)),this.size=(w(this,me),w(this,pe,"medium")),this.name=(w(this,ge),w(this,be,"")),this.value=(w(this,fe),w(this,ve,"on")),this.label=(w(this,ye),w(this,we,"")),this.input=(w(this,ke),w(this,xe,void 0)),this.checkbox=(w(this,Ce),w(this,Se,void 0)),this.labelElement=(w(this,Ee),w(this,De,void 0)),this.wrapper=(w(this,Ae),w(this,Re,void 0)),w(this,Me),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}get checked(){return this.checkedState}set checked(e){this.setCheckedness(Boolean(e),!0)}render(){const t=this.disabled||this.formDisabled||this.loading,i=this.invalid||this.constraintInvalid;return e`
|
|
238
|
+
`}handleInternalClick(e){if(this.interactionDisabled)return e.preventDefault(),void e.stopPropagation();if(""!==this.href){const t="string"==typeof this.href?this.href.trim():"";if(!t||!b(t))return e.preventDefault(),void e.stopPropagation();if(this.download){const e=document.createElement("a");e.href=t,e.download=this.download,e.click()}else this.target?window.open(t,this.target,"noopener"):window.location.href=t}else{const e=this.internals?.form||this.closest("form");if(e)switch(this.type){case"submit":e.requestSubmit();break;case"reset":e.reset()}}this.dispatchEvent(new CustomEvent("button-click",{bubbles:!0,composed:!0,detail:{originalEvent:e}}))}formDisabledCallback(e){this.formDisabled=e}styles(){return m`${":host{display:inline-block;position:relative;width:auto;cursor:pointer}:host([disabled]){cursor:not-allowed}:host([justify-text=start]) .button{justify-content:flex-start}:host([justify-text=end]) .button{justify-content:flex-end}:host([justify-text=center]) .button{justify-content:center}.button{display:inline-flex;align-items:center;justify-content:center;width:100%;border:1px solid;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-weight:var(--snice-font-weight-medium,500);text-decoration:none;user-select:none;white-space:nowrap;vertical-align:middle;padding:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03));transition:color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),background-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),border-color var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),box-shadow var(--snice-transition-fast, 150ms) var(--snice-ease-out, cubic-bezier(.22,1,.36,1)),transform 180ms var(--snice-ease-spring, cubic-bezier(.34,1.56,.64,1));cursor:inherit;position:relative}.button::before{content:'';position:absolute;inset:0;border-radius:inherit;background:var(--snice-gradient-convex,none);pointer-events:none}.button:active:not(.button--disabled){transition:color 50ms var(--snice-ease-out, ease),background-color 50ms var(--snice-ease-out, ease),border-color 50ms var(--snice-ease-out, ease),box-shadow 50ms var(--snice-ease-out, ease),transform 80ms var(--snice-ease-out, ease);transform:translateY(0) scale(.97)}.button:focus-visible{outline:0;box-shadow:0 0 0 var(--snice-focus-ring-width,2px) var(--snice-focus-ring-color,rgb(59 130 246 / .5))}.button--disabled{opacity:.5;cursor:not-allowed;box-shadow:none}.button--small{font-size:var(--snice-font-size-sm, .875rem);height:2rem;padding:0 var(--snice-spacing-sm,.75rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--medium{font-size:var(--snice-font-size-md, 1rem);height:2.5rem;padding:0 var(--snice-spacing-md,1rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--large{font-size:var(--snice-font-size-lg, 1.125rem);height:3rem;padding:0 var(--snice-spacing-lg,1.5rem);border-radius:var(--snice-border-radius-md,.25rem)}.button--default{background-color:var(--snice-color-surface,rgb(255 255 255));color:var(--snice-color-text,rgb(23 23 23));border-color:var(--snice-color-border,rgb(226 226 226))}.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--default:active:not(.button--disabled){background-color:var(--snice-color-surface-container,rgb(248 248 248));border-color:var(--snice-color-border-hover,rgb(204 204 204));box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--primary{background-color:var(--snice-color-primary,rgb(37 99 235));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-primary,rgb(37 99 235))}.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--primary:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--success{background-color:var(--snice-color-success,rgb(22 163 74));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-success,rgb(22 163 74))}.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-hover,rgb(21 128 61));border-color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--success:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--warning{background-color:var(--snice-color-warning,rgb(202 138 4));color:var(--button-warning-text,rgb(69 26 3));border-color:var(--snice-color-warning,rgb(202 138 4))}.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-hover,rgb(161 98 7));border-color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--warning:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-warning,rgb(202 138 4)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--danger{background-color:var(--snice-color-danger,rgb(220 38 38));color:var(--snice-color-text-inverse,rgb(250 250 250));border-color:var(--snice-color-danger,rgb(220 38 38))}.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-hover,rgb(185 28 28));border-color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05));transform:translateY(-1px)}.button--danger:active:not(.button--disabled){background-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);border-color:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 85%,#fff);box-shadow:var(--snice-shadow-inset-sm,inset 0 1px 2px rgb(0 0 0 / .05));transform:translateY(0) scale(.97)}.button--text{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235));border-color:transparent;box-shadow:none}.button--text::before{display:none}.button--text:hover:not(.button--disabled){background-color:var(--snice-color-primary-alpha,rgb(37 99 235 / .1));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--text:active:not(.button--disabled){background-color:var(--snice-color-primary-alpha-strong,rgb(37 99 235 / .15));box-shadow:none;transform:none}.button--outline{box-shadow:none}.button--outline::before{display:none}.button--outline.button--default{background-color:transparent;color:var(--snice-color-text,rgb(23 23 23))}.button--outline.button--primary{background-color:transparent;color:var(--snice-color-primary,rgb(37 99 235))}.button--outline.button--success{background-color:transparent;color:var(--snice-color-success,rgb(22 163 74))}.button--outline.button--warning{background-color:transparent;color:var(--snice-color-warning,rgb(202 138 4))}.button--outline.button--danger{background-color:transparent;color:var(--snice-color-danger,rgb(220 38 38))}.button--outline.button--default:hover:not(.button--disabled){background-color:var(--snice-color-surface-hover,rgb(245 245 245));box-shadow:none;transform:none}.button--outline.button--primary:hover:not(.button--disabled){background-color:var(--snice-color-primary-subtle,rgb(239 246 255));color:var(--snice-color-primary-hover,rgb(29 78 216));box-shadow:none;transform:none}.button--outline.button--success:hover:not(.button--disabled){background-color:var(--snice-color-success-subtle,rgb(220 252 231));color:var(--snice-color-success-hover,rgb(21 128 61));box-shadow:none;transform:none}.button--outline.button--warning:hover:not(.button--disabled){background-color:var(--snice-color-warning-subtle,rgb(254 249 195));color:var(--snice-color-warning-hover,rgb(161 98 7));box-shadow:none;transform:none}.button--outline.button--danger:hover:not(.button--disabled){background-color:var(--snice-color-danger-subtle,rgb(254 226 226));color:var(--snice-color-danger-hover,rgb(185 28 28));box-shadow:none;transform:none}.button--outline:active:not(.button--disabled){background-color:var(--snice-color-primary-subtle-hover,var(--snice-color-surface-active,rgb(235 235 235)));box-shadow:none;transform:none}.button--pill{border-radius:var(--snice-border-radius-pill,9999px)}.button--circle{border-radius:var(--snice-border-radius-circle,50%);width:var(--size);padding:0}.button--small.button--circle{--size:2rem}.button--medium.button--circle{--size:2.5rem}.button--large.button--circle{--size:3rem}.button--loading{position:relative;cursor:wait}.button--loading .label{visibility:hidden}.spinner{display:none;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:1em;height:1em}.button--loading .spinner{display:block}.spinner::after{content:'';display:block;width:100%;height:100%;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.icon-slot{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon-slot:empty{display:none}.icon{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:1.25em;height:1.25em;line-height:1}.icon img{width:100%;height:100%;object-fit:contain}.icon svg{width:100%;height:100%}.icon-slot ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:1.25em;line-height:1}.icon-slot ::slotted(svg){width:1.25em;height:1.25em}.icon-slot ::slotted(img){width:1.25em;height:1.25em;object-fit:contain}.button--icon-start .icon,.button--icon-start .icon-slot{margin-right:.5em}.button--icon-end .icon,.button--icon-end .icon-slot{margin-left:.5em}.button--circle .icon,.button--circle .icon-slot{margin:0;transform:none;width:auto;height:auto}.button--circle .icon-slot ::slotted(*){font-size:1.25em;line-height:1;display:flex;align-items:center;justify-content:center}.button--circle .icon-slot ::slotted(svg){width:1.25em;height:1.25em}@media (prefers-reduced-motion:reduce){.icon-slot,.spinner,button,button:active{transition-duration:0s!important;animation-duration:0s!important}button:active{transform:none}}"}`}setLoading(e){this.loading=e}setDisabled(e){this.disabled=e}setVariant(e){this.variant=e}focus(e){this.effectiveDisabled||this.button?.focus(e)}blur(){this.button?.blur()}click(){this.effectiveDisabled||this.button?.click()}get form(){return K(this,this.internals)}get labels(){return this.internals?.labels??null}})})(),(()=>{let t,c,u,p,g,b,v,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B,O,j,P,N,H,q,_,G,K=[i("snice-checkbox",{formAssociated:!0,delegatesFocus:!0})],W=[],U=HTMLElement,Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[],ke=[],xe=[],Ce=[],Se=[],Ee=[],De=[],Ae=[],Re=[],Me=[];(class extends U{static{c=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(U[Symbol.metadata]??null):void 0;u=[a()],p=[a()],g=[a()],b=[s({type:Boolean,attribute:"checked"})],v=[s({type:Boolean})],k=[s({type:Boolean})],x=[s({type:Boolean})],C=[s({type:Boolean})],S=[s({type:Boolean})],E=[s({})],D=[s({})],A=[s({})],R=[s({})],M=[n(".checkbox-input")],z=[n(".checkbox")],$=[n(".checkbox-label")],F=[n(".checkbox-wrapper")],I=[l()],T=[o()],L=[f("click")],V=[d("defaultChecked")],B=[d("checkedState",{immediate:!1})],O=[d("indeterminate",{immediate:!1})],j=[d("value",{immediate:!1})],P=[d("required",{immediate:!1})],N=[d("name",{immediate:!1})],H=[d("disabled","loading","formDisabled",{immediate:!1})],q=[d("invalid",{immediate:!1})],_=[h("checkbox-change",{bubbles:!0,composed:!0})],G=[r()],y(this,null,I,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,Z),y(this,null,T,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,Z),y(this,null,L,{kind:"method",name:"handleHostActivationClick",static:!1,private:!1,access:{has:e=>"handleHostActivationClick"in e,get:e=>e.handleHostActivationClick},metadata:e},null,Z),y(this,null,V,{kind:"method",name:"handleDefaultCheckedChange",static:!1,private:!1,access:{has:e=>"handleDefaultCheckedChange"in e,get:e=>e.handleDefaultCheckedChange},metadata:e},null,Z),y(this,null,B,{kind:"method",name:"handleCheckedChange",static:!1,private:!1,access:{has:e=>"handleCheckedChange"in e,get:e=>e.handleCheckedChange},metadata:e},null,Z),y(this,null,O,{kind:"method",name:"handleIndeterminateChange",static:!1,private:!1,access:{has:e=>"handleIndeterminateChange"in e,get:e=>e.handleIndeterminateChange},metadata:e},null,Z),y(this,null,j,{kind:"method",name:"handleValueChange",static:!1,private:!1,access:{has:e=>"handleValueChange"in e,get:e=>e.handleValueChange},metadata:e},null,Z),y(this,null,P,{kind:"method",name:"handleRequiredChange",static:!1,private:!1,access:{has:e=>"handleRequiredChange"in e,get:e=>e.handleRequiredChange},metadata:e},null,Z),y(this,null,N,{kind:"method",name:"handleNameChange",static:!1,private:!1,access:{has:e=>"handleNameChange"in e,get:e=>e.handleNameChange},metadata:e},null,Z),y(this,null,H,{kind:"method",name:"handleDisabledChange",static:!1,private:!1,access:{has:e=>"handleDisabledChange"in e,get:e=>e.handleDisabledChange},metadata:e},null,Z),y(this,null,q,{kind:"method",name:"handleInvalidChange",static:!1,private:!1,access:{has:e=>"handleInvalidChange"in e,get:e=>e.handleInvalidChange},metadata:e},null,Z),y(this,null,_,{kind:"method",name:"dispatchCheckboxChange",static:!1,private:!1,access:{has:e=>"dispatchCheckboxChange"in e,get:e=>e.dispatchCheckboxChange},metadata:e},null,Z),y(this,null,G,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,Z),y(null,null,u,{kind:"field",name:"checkedState",static:!1,private:!1,access:{has:e=>"checkedState"in e,get:e=>e.checkedState,set:(e,t)=>{e.checkedState=t}},metadata:e},Y,J),y(null,null,p,{kind:"field",name:"formDisabled",static:!1,private:!1,access:{has:e=>"formDisabled"in e,get:e=>e.formDisabled,set:(e,t)=>{e.formDisabled=t}},metadata:e},Q,X),y(null,null,g,{kind:"field",name:"constraintInvalid",static:!1,private:!1,access:{has:e=>"constraintInvalid"in e,get:e=>e.constraintInvalid,set:(e,t)=>{e.constraintInvalid=t}},metadata:e},ee,te),y(null,null,b,{kind:"field",name:"defaultChecked",static:!1,private:!1,access:{has:e=>"defaultChecked"in e,get:e=>e.defaultChecked,set:(e,t)=>{e.defaultChecked=t}},metadata:e},ie,ae),y(null,null,v,{kind:"field",name:"indeterminate",static:!1,private:!1,access:{has:e=>"indeterminate"in e,get:e=>e.indeterminate,set:(e,t)=>{e.indeterminate=t}},metadata:e},se,ne),y(null,null,k,{kind:"field",name:"disabled",static:!1,private:!1,access:{has:e=>"disabled"in e,get:e=>e.disabled,set:(e,t)=>{e.disabled=t}},metadata:e},le,re),y(null,null,x,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},oe,ce),y(null,null,C,{kind:"field",name:"required",static:!1,private:!1,access:{has:e=>"required"in e,get:e=>e.required,set:(e,t)=>{e.required=t}},metadata:e},de,he),y(null,null,S,{kind:"field",name:"invalid",static:!1,private:!1,access:{has:e=>"invalid"in e,get:e=>e.invalid,set:(e,t)=>{e.invalid=t}},metadata:e},ue,me),y(null,null,E,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},pe,ge),y(null,null,D,{kind:"field",name:"name",static:!1,private:!1,access:{has:e=>"name"in e,get:e=>e.name,set:(e,t)=>{e.name=t}},metadata:e},be,fe),y(null,null,A,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},ve,ye),y(null,null,R,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},we,ke),y(null,null,M,{kind:"field",name:"input",static:!1,private:!1,access:{has:e=>"input"in e,get:e=>e.input,set:(e,t)=>{e.input=t}},metadata:e},xe,Ce),y(null,null,z,{kind:"field",name:"checkbox",static:!1,private:!1,access:{has:e=>"checkbox"in e,get:e=>e.checkbox,set:(e,t)=>{e.checkbox=t}},metadata:e},Se,Ee),y(null,null,$,{kind:"field",name:"labelElement",static:!1,private:!1,access:{has:e=>"labelElement"in e,get:e=>e.labelElement,set:(e,t)=>{e.labelElement=t}},metadata:e},De,Ae),y(null,null,F,{kind:"field",name:"wrapper",static:!1,private:!1,access:{has:e=>"wrapper"in e,get:e=>e.wrapper,set:(e,t)=>{e.wrapper=t}},metadata:e},Re,Me),y(null,t={value:c},K,{kind:"class",name:c.name,metadata:e},null,W),c=t.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,W)}constructor(){super(),this.internals=w(this,Z),this.dirtyCheckedness=!1,this.pendingUserChange=!1,this.forwardingHostActivation=!1,this.customValidationMessage="",this.checkedState=w(this,Y,!1),this.formDisabled=(w(this,J),w(this,Q,!1)),this.constraintInvalid=(w(this,X),w(this,ee,!1)),this.defaultChecked=(w(this,te),w(this,ie,!1)),this.indeterminate=(w(this,ae),w(this,se,!1)),this.disabled=(w(this,ne),w(this,le,!1)),this.loading=(w(this,re),w(this,oe,!1)),this.required=(w(this,ce),w(this,de,!1)),this.invalid=(w(this,he),w(this,ue,!1)),this.size=(w(this,me),w(this,pe,"medium")),this.name=(w(this,ge),w(this,be,"")),this.value=(w(this,fe),w(this,ve,"on")),this.label=(w(this,ye),w(this,we,"")),this.input=(w(this,ke),w(this,xe,void 0)),this.checkbox=(w(this,Ce),w(this,Se,void 0)),this.labelElement=(w(this,Ee),w(this,De,void 0)),this.wrapper=(w(this,Ae),w(this,Re,void 0)),w(this,Me),"function"==typeof this.attachInternals&&(this.internals=this.attachInternals())}get checked(){return this.checkedState}set checked(e){this.setCheckedness(Boolean(e),!0)}render(){const t=this.disabled||this.formDisabled||this.loading,i=this.invalid||this.constraintInvalid;return e`
|
|
239
239
|
<label class="${`checkbox-wrapper${t?" checkbox-wrapper--disabled":""}${this.loading?" checkbox-wrapper--loading":""}`}">
|
|
240
240
|
<input
|
|
241
241
|
type="checkbox"
|
|
@@ -275,7 +275,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
275
275
|
</span>
|
|
276
276
|
</if>
|
|
277
277
|
</label>
|
|
278
|
-
`}init(){if(Object.prototype.hasOwnProperty.call(this,"checked")){const e=Boolean(this.checked);delete this.checked,this.checked=e}this.syncNativeInput(),this.syncFormState()}formAssociatedCallback(){this.syncFormState()}formResetCallback(){this.dirtyCheckedness=!1,this.setCheckedness(this.defaultChecked,!1),this.syncFormState()}formDisabledCallback(e){this.formDisabled=e}formStateRestoreCallback(e){"string"==typeof e&&("checked"===e?this.setCheckedness(!0,!0):"unchecked"===e&&this.setCheckedness(!1,!0),this.syncFormState())}handleInternalInput(e){const t=e.currentTarget,i=t.checked!==this.checked||t.indeterminate!==this.indeterminate;this.pendingUserChange=i,i&&(this.setCheckedness(t.checked,!0),this.indeterminate=t.indeterminate)}handleInternalClick(e){this.forwardingHostActivation&&e.stopPropagation()}handleInternalChange(){this.pendingUserChange&&(this.pendingUserChange=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchCheckboxChange())}handleHostActivationClick(e){e.composedPath()[0]===this&&(this.disabled||this.formDisabled||this.loading||(this.input?.focus(),queueMicrotask(()=>{if(!(e.defaultPrevented||this.disabled||this.formDisabled||this.loading)){this.forwardingHostActivation=!0;try{this.input?.click()}finally{this.forwardingHostActivation=!1}}})))}handleDefaultCheckedChange(){this.dirtyCheckedness||this.setCheckedness(this.defaultChecked,!1)}handleCheckedChange(){this.input&&(this.input.checked=this.checked),this.syncFormState()}handleIndeterminateChange(){this.input&&(this.input.indeterminate=this.indeterminate)}handleValueChange(){this.input&&(this.input.value=this.formValue),this.syncFormState()}handleRequiredChange(){this.input&&(this.input.required=this.required),this.syncValidity()}handleNameChange(){this.input&&(this.input.name=this.name)}handleDisabledChange(){this.input&&(this.input.disabled=this.disabled||this.formDisabled||this.loading),this.syncValidity()}handleInvalidChange(){const e=this.invalid||this.constraintInvalid;this.input?.setAttribute("aria-invalid",String(e)),this.checkbox?.classList.toggle("checkbox--invalid",e)}setCheckedness(e,t){t&&(this.dirtyCheckedness=!0),this.checkedState=e}get formValue(){return String(this.value??"")}syncNativeInput(){this.input&&(this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.input.disabled=this.disabled||this.formDisabled||this.loading,this.input.required=this.required,this.input.name=this.name,this.input.value=this.formValue,this.input.setCustomValidity(this.customValidationMessage))}syncFormState(){this.internals&&this.internals.setFormValue(this.checked?this.formValue:null,this.checked?"checked":"unchecked"),this.syncValidity()}syncValidity(){this.input&&(this.input.checked=this.checked,this.input.required=this.required,this.input.setCustomValidity(this.customValidationMessage));const e=this.disabled||this.formDisabled,t=this.required&&!this.checked,i=this.customValidationMessage.length>0,a=t||i,s=this.customValidationMessage||this.input?.validationMessage||"Please check this box.";this.constraintInvalid=!e&&a;const n=this.invalid||this.constraintInvalid;this.input?.setAttribute("aria-invalid",String(n)),this.checkbox?.classList.toggle("checkbox--invalid",n),this.internals&&(a?this.input?this.internals.setValidity({valueMissing:t,customError:i},s,this.input):this.internals.setValidity({valueMissing:t,customError:i},s):this.internals.setValidity({}))}dispatchCheckboxChange(){return{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}}styles(){return m`${":host{display:inline-flex;align-items:center;align-self:flex-end;min-height:2.5rem;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}:host([size=small]){min-height:2rem;align-self:center}:host([size=large]){min-height:3rem;align-self:center}:host([compact]){min-height:0;align-self:center}.checkbox-wrapper{display:inline-flex;align-items:center;position:relative;cursor:pointer;user-select:none;min-height:1.25rem}.checkbox-wrapper--disabled{cursor:not-allowed;opacity:.6}.checkbox-input{position:absolute;opacity:0;left:0;top:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1;pointer-events:all}.checkbox{position:relative;display:inline-flex;align-items:center;justify-content:center;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:2px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);transition:all var(--snice-transition-fast, 150ms) ease}.checkbox--small{width:1rem;height:1rem}.checkbox--medium{width:1.25rem;height:1.25rem}.checkbox--large{width:1.5rem;height:1.5rem}.checkbox-input:checked~.checkbox{background:var(--snice-color-primary,rgb(37 99 235));border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-input:focus-visible~.checkbox{box-shadow:0 0 0 3px var(--snice-focus-ring-color,rgb(59 130 246 / .5));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px}.checkbox-input:disabled~.checkbox{background:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border,rgb(226 226 226))}.checkbox-input:disabled:checked~.checkbox{background:var(--snice-color-text-secondary,rgb(82 82 82));border-color:var(--snice-color-text-secondary,rgb(82 82 82))}.checkbox--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-input:checked~.checkbox--invalid{background:var(--snice-color-danger,rgb(220 38 38));border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-icon{position:absolute;display:none;color:var(--snice-color-text-inverse,rgb(250 250 250))}.checkbox-input:checked~.checkbox .checkbox-icon--check{display:block}.checkbox--indeterminate .checkbox-icon--check{display:none!important}.checkbox--indeterminate .checkbox-icon--indeterminate{display:block!important}.checkbox--small .checkbox-icon{width:.75rem;height:.75rem}.checkbox--medium .checkbox-icon{width:.875rem;height:.875rem}.checkbox--large .checkbox-icon{width:1.125rem;height:1.125rem}.checkbox-label{margin-left:.5rem;color:var(--snice-color-text,rgb(23 23 23));cursor:pointer}.checkbox-label--small{font-size:var(--snice-font-size-sm, .875rem)}.checkbox-label--medium{font-size:var(--snice-font-size-md, 1rem)}.checkbox-label--large{font-size:var(--snice-font-size-lg, 1.125rem)}.checkbox-wrapper--disabled .checkbox-label{color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed}.checkbox-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox{border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox-input:checked~.checkbox{background:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216))}.checkbox-wrapper--loading{cursor:wait;opacity:.7}.checkbox--loading{cursor:wait}.checkbox-spinner{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;pointer-events:none}.checkbox-spinner::after{content:'';display:block;width:.75em;height:.75em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}focus(){this.input?.focus()}blur(){this.input?.blur()}click(){this.disabled||this.formDisabled||this.loading||this.input?.click()}toggle(){this.click()}setIndeterminate(){this.indeterminate=!0}get type(){return"checkbox"}get form(){return this.internals?.form??null}get validity(){return this.internals?.validity??this.input.validity}get validationMessage(){return this.internals?.validationMessage??this.input?.validationMessage??""}get willValidate(){return!this.disabled&&!this.formDisabled&&(this.internals?.willValidate??this.input?.willValidate??!1)}get labels(){return this.internals?.labels??this.input?.labels??null}checkValidity(){return this.syncValidity(),this.internals?.checkValidity()??this.input?.checkValidity()??!0}reportValidity(){return this.syncValidity(),this.internals?.reportValidity()??this.input?.reportValidity()??!0}setCustomValidity(e){this.customValidationMessage=String(e),this.syncValidity()}})})(),(()=>{let a,c,p,g,b,f,v,x,C,S,E,D,A,R,M,z,F,$,I,T,L,V,B,O=[i("snice-modal")],j=[],P=HTMLElement,N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[];(class extends P{static{c=this}constructor(){super(...arguments),this.open=(w(this,N),w(this,H,!1)),this.size=(w(this,q),w(this,_,"medium")),this.noBackdropDismiss=(w(this,G),w(this,K,!1)),this.noEscapeDismiss=(w(this,W),w(this,U,!1)),this.noFocusTrap=(w(this,Z),w(this,Y,!1)),this.noCloseButton=(w(this,J),w(this,Q,!1)),this.noHeader=(w(this,X),w(this,ee,!1)),this.noFooter=(w(this,te),w(this,ie,!1)),this.hasFooterContent=(w(this,ae),w(this,se,!1)),this.hasHeaderContent=(w(this,ne),w(this,le,!1)),this.label=(w(this,re),w(this,oe,"")),this.modal=(w(this,ce),w(this,de,void 0)),this.panel=(w(this,he),w(this,ue,void 0)),this.backdrop=(w(this,me),w(this,pe,void 0)),this.previousFocus=(w(this,ge),null),this.lockedBodyScroll=!1,this.headerId=`snice-modal-header-${Math.random().toString(36).slice(2,10)}`}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(P[Symbol.metadata]??null):void 0;p=[s({type:Boolean})],g=[s({})],b=[s({type:Boolean,attribute:"no-backdrop-dismiss"})],f=[s({type:Boolean,attribute:"no-escape-dismiss"})],v=[s({type:Boolean,attribute:"no-focus-trap"})],x=[s({type:Boolean,attribute:"no-close-button"})],C=[s({type:Boolean,attribute:"no-header"})],S=[s({type:Boolean,attribute:"no-footer"})],E=[s({attribute:!1})],D=[s({attribute:!1})],A=[s({})],R=[n(".modal")],M=[n(".modal__panel")],z=[n(".modal__backdrop")],F=[l()],$=[r()],I=[o()],T=[u()],L=[d("open")],V=[h("modal-open",{bubbles:!0,composed:!0})],B=[h("modal-close",{bubbles:!0,composed:!0})],y(this,null,F,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,N),y(this,null,$,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,N),y(this,null,I,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,N),y(this,null,T,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,N),y(this,null,L,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:e},null,N),y(this,null,V,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:e},null,N),y(this,null,B,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:e},null,N),y(null,null,p,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:e},H,q),y(null,null,g,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},_,G),y(null,null,b,{kind:"field",name:"noBackdropDismiss",static:!1,private:!1,access:{has:e=>"noBackdropDismiss"in e,get:e=>e.noBackdropDismiss,set:(e,t)=>{e.noBackdropDismiss=t}},metadata:e},K,W),y(null,null,f,{kind:"field",name:"noEscapeDismiss",static:!1,private:!1,access:{has:e=>"noEscapeDismiss"in e,get:e=>e.noEscapeDismiss,set:(e,t)=>{e.noEscapeDismiss=t}},metadata:e},U,Z),y(null,null,v,{kind:"field",name:"noFocusTrap",static:!1,private:!1,access:{has:e=>"noFocusTrap"in e,get:e=>e.noFocusTrap,set:(e,t)=>{e.noFocusTrap=t}},metadata:e},Y,J),y(null,null,x,{kind:"field",name:"noCloseButton",static:!1,private:!1,access:{has:e=>"noCloseButton"in e,get:e=>e.noCloseButton,set:(e,t)=>{e.noCloseButton=t}},metadata:e},Q,X),y(null,null,C,{kind:"field",name:"noHeader",static:!1,private:!1,access:{has:e=>"noHeader"in e,get:e=>e.noHeader,set:(e,t)=>{e.noHeader=t}},metadata:e},ee,te),y(null,null,S,{kind:"field",name:"noFooter",static:!1,private:!1,access:{has:e=>"noFooter"in e,get:e=>e.noFooter,set:(e,t)=>{e.noFooter=t}},metadata:e},ie,ae),y(null,null,E,{kind:"field",name:"hasFooterContent",static:!1,private:!1,access:{has:e=>"hasFooterContent"in e,get:e=>e.hasFooterContent,set:(e,t)=>{e.hasFooterContent=t}},metadata:e},se,ne),y(null,null,D,{kind:"field",name:"hasHeaderContent",static:!1,private:!1,access:{has:e=>"hasHeaderContent"in e,get:e=>e.hasHeaderContent,set:(e,t)=>{e.hasHeaderContent=t}},metadata:e},le,re),y(null,null,A,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},oe,ce),y(null,null,R,{kind:"field",name:"modal",static:!1,private:!1,access:{has:e=>"modal"in e,get:e=>e.modal,set:(e,t)=>{e.modal=t}},metadata:e},de,he),y(null,null,M,{kind:"field",name:"panel",static:!1,private:!1,access:{has:e=>"panel"in e,get:e=>e.panel,set:(e,t)=>{e.panel=t}},metadata:e},ue,me),y(null,null,z,{kind:"field",name:"backdrop",static:!1,private:!1,access:{has:e=>"backdrop"in e,get:e=>e.backdrop,set:(e,t)=>{e.backdrop=t}},metadata:e},pe,ge),y(null,a={value:c},O,{kind:"class",name:c.name,metadata:e},null,j),c=a.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,j)}render(){return e`
|
|
278
|
+
`}init(){if(Object.prototype.hasOwnProperty.call(this,"checked")){const e=Boolean(this.checked);delete this.checked,this.checked=e}this.syncNativeInput(),this.syncFormState()}formAssociatedCallback(){this.syncFormState()}formResetCallback(){this.dirtyCheckedness=!1,this.setCheckedness(this.defaultChecked,!1),this.syncFormState()}formDisabledCallback(e){this.formDisabled=e}formStateRestoreCallback(e){"string"==typeof e&&("checked"===e?this.setCheckedness(!0,!0):"unchecked"===e&&this.setCheckedness(!1,!0),this.syncFormState())}handleInternalInput(e){const t=e.currentTarget,i=t.checked!==this.checked||t.indeterminate!==this.indeterminate;this.pendingUserChange=i,i&&(this.setCheckedness(t.checked,!0),this.indeterminate=t.indeterminate)}handleInternalClick(e){this.forwardingHostActivation&&e.stopPropagation()}handleInternalChange(){this.pendingUserChange&&(this.pendingUserChange=!1,this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchCheckboxChange())}handleHostActivationClick(e){e.composedPath()[0]===this&&(this.disabled||this.formDisabled||this.loading||(this.input?.focus(),queueMicrotask(()=>{if(!(e.defaultPrevented||this.disabled||this.formDisabled||this.loading)){this.forwardingHostActivation=!0;try{this.input?.click()}finally{this.forwardingHostActivation=!1}}})))}handleDefaultCheckedChange(){this.dirtyCheckedness||this.setCheckedness(this.defaultChecked,!1)}handleCheckedChange(){this.input&&(this.input.checked=this.checked),this.syncFormState()}handleIndeterminateChange(){this.input&&(this.input.indeterminate=this.indeterminate)}handleValueChange(){this.input&&(this.input.value=this.formValue),this.syncFormState()}handleRequiredChange(){this.input&&(this.input.required=this.required),this.syncValidity()}handleNameChange(){this.input&&(this.input.name=this.name)}handleDisabledChange(){this.input&&(this.input.disabled=this.disabled||this.formDisabled||this.loading),this.syncValidity()}handleInvalidChange(){const e=this.invalid||this.constraintInvalid;this.input?.setAttribute("aria-invalid",String(e)),this.checkbox?.classList.toggle("checkbox--invalid",e)}setCheckedness(e,t){t&&(this.dirtyCheckedness=!0),this.checkedState=e}get formValue(){return String(this.value??"")}syncNativeInput(){this.input&&(this.input.checked=this.checked,this.input.indeterminate=this.indeterminate,this.input.disabled=this.disabled||this.formDisabled||this.loading,this.input.required=this.required,this.input.name=this.name,this.input.value=this.formValue,this.input.setCustomValidity(this.customValidationMessage))}syncFormState(){this.internals&&this.internals.setFormValue(this.checked?this.formValue:null,this.checked?"checked":"unchecked"),this.syncValidity()}syncValidity(){this.input&&(this.input.checked=this.checked,this.input.required=this.required,this.input.setCustomValidity(this.customValidationMessage));const e=this.disabled||this.formDisabled,t=this.required&&!this.checked,i=this.customValidationMessage.length>0,a=t||i,s=this.customValidationMessage||this.input?.validationMessage||"Please check this box.";this.constraintInvalid=!e&&a;const n=this.invalid||this.constraintInvalid;this.input?.setAttribute("aria-invalid",String(n)),this.checkbox?.classList.toggle("checkbox--invalid",n),this.internals&&(a?this.input?this.internals.setValidity({valueMissing:t,customError:i},s,this.input):this.internals.setValidity({valueMissing:t,customError:i},s):this.internals.setValidity({}))}dispatchCheckboxChange(){return{checked:this.checked,indeterminate:this.indeterminate,checkbox:this}}styles(){return m`${":host{display:inline-flex;align-items:center;align-self:flex-end;min-height:2.5rem;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}:host([size=small]){min-height:2rem;align-self:center}:host([size=large]){min-height:3rem;align-self:center}:host([compact]){min-height:0;align-self:center}.checkbox-wrapper{display:inline-flex;align-items:center;position:relative;cursor:pointer;user-select:none;min-height:1.25rem}.checkbox-wrapper--disabled{cursor:not-allowed;opacity:.6}.checkbox-input{position:absolute;opacity:0;left:0;top:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1;pointer-events:all}.checkbox{position:relative;display:inline-flex;align-items:center;justify-content:center;background:var(--snice-color-surface-container-lowest,rgb(248 247 245));border:2px solid var(--snice-color-border,rgb(226 226 226));border-radius:var(--snice-border-radius-sm,.125rem);transition:all var(--snice-transition-fast, 150ms) ease}.checkbox--small{width:1rem;height:1rem}.checkbox--medium{width:1.25rem;height:1.25rem}.checkbox--large{width:1.5rem;height:1.5rem}.checkbox-input:checked~.checkbox{background:var(--snice-color-primary,rgb(37 99 235));border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-input:focus-visible~.checkbox{box-shadow:0 0 0 3px var(--snice-focus-ring-color,rgb(59 130 246 / .5));outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px}.checkbox-input:disabled~.checkbox{background:var(--snice-color-surface-container-low,rgb(250 250 250));border-color:var(--snice-color-border,rgb(226 226 226))}.checkbox-input:disabled:checked~.checkbox{background:var(--snice-color-text-secondary,rgb(82 82 82));border-color:var(--snice-color-text-secondary,rgb(82 82 82))}.checkbox--invalid{border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-input:checked~.checkbox--invalid{background:var(--snice-color-danger,rgb(220 38 38));border-color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-icon{position:absolute;display:none;color:var(--snice-color-text-inverse,rgb(250 250 250))}.checkbox-input:checked~.checkbox .checkbox-icon--check{display:block}.checkbox--indeterminate .checkbox-icon--check{display:none!important}.checkbox--indeterminate .checkbox-icon--indeterminate{display:block!important}.checkbox--small .checkbox-icon{width:.75rem;height:.75rem}.checkbox--medium .checkbox-icon{width:.875rem;height:.875rem}.checkbox--large .checkbox-icon{width:1.125rem;height:1.125rem}.checkbox-label{margin-left:.5rem;color:var(--snice-color-text,rgb(23 23 23));cursor:pointer}.checkbox-label--small{font-size:var(--snice-font-size-sm, .875rem)}.checkbox-label--medium{font-size:var(--snice-font-size-md, 1rem)}.checkbox-label--large{font-size:var(--snice-font-size-lg, 1.125rem)}.checkbox-wrapper--disabled .checkbox-label{color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:not-allowed}.checkbox-label--required::after{content:' *';color:var(--snice-color-danger,rgb(220 38 38))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox{border-color:var(--snice-color-primary,rgb(37 99 235))}.checkbox-wrapper:not(.checkbox-wrapper--disabled):hover .checkbox-input:checked~.checkbox{background:var(--snice-color-primary-hover,rgb(29 78 216));border-color:var(--snice-color-primary-hover,rgb(29 78 216))}.checkbox-wrapper--loading{cursor:wait;opacity:.7}.checkbox--loading{cursor:wait}.checkbox-spinner{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;width:100%;height:100%;pointer-events:none}.checkbox-spinner::after{content:'';display:block;width:.75em;height:.75em;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:.6s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}focus(){this.input?.focus()}blur(){this.input?.blur()}click(){this.disabled||this.formDisabled||this.loading||this.input?.click()}toggle(){this.click()}setIndeterminate(){this.indeterminate=!0}get type(){return"checkbox"}get form(){return this.internals?.form??null}get validity(){return this.internals?.validity??this.input.validity}get validationMessage(){return this.internals?.validationMessage??this.input?.validationMessage??""}get willValidate(){return!this.disabled&&!this.formDisabled&&(this.internals?.willValidate??this.input?.willValidate??!1)}get labels(){return this.internals?.labels??this.input?.labels??null}checkValidity(){return this.syncValidity(),this.internals?.checkValidity()??this.input?.checkValidity()??!0}reportValidity(){return this.syncValidity(),this.internals?.reportValidity()??this.input?.reportValidity()??!0}setCustomValidity(e){this.customValidationMessage=String(e),this.syncValidity()}})})(),(()=>{let a,c,p,g,b,f,v,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B,O=[i("snice-modal")],j=[],P=HTMLElement,N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[],se=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[];(class extends P{static{c=this}constructor(){super(...arguments),this.open=(w(this,N),w(this,H,!1)),this.size=(w(this,q),w(this,_,"medium")),this.noBackdropDismiss=(w(this,G),w(this,K,!1)),this.noEscapeDismiss=(w(this,W),w(this,U,!1)),this.noFocusTrap=(w(this,Z),w(this,Y,!1)),this.noCloseButton=(w(this,J),w(this,Q,!1)),this.noHeader=(w(this,X),w(this,ee,!1)),this.noFooter=(w(this,te),w(this,ie,!1)),this.hasFooterContent=(w(this,ae),w(this,se,!1)),this.hasHeaderContent=(w(this,ne),w(this,le,!1)),this.label=(w(this,re),w(this,oe,"")),this.modal=(w(this,ce),w(this,de,void 0)),this.panel=(w(this,he),w(this,ue,void 0)),this.backdrop=(w(this,me),w(this,pe,void 0)),this.previousFocus=(w(this,ge),null),this.lockedBodyScroll=!1,this.headerId=`snice-modal-header-${Math.random().toString(36).slice(2,10)}`}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(P[Symbol.metadata]??null):void 0;p=[s({type:Boolean})],g=[s({})],b=[s({type:Boolean,attribute:"no-backdrop-dismiss"})],f=[s({type:Boolean,attribute:"no-escape-dismiss"})],v=[s({type:Boolean,attribute:"no-focus-trap"})],x=[s({type:Boolean,attribute:"no-close-button"})],C=[s({type:Boolean,attribute:"no-header"})],S=[s({type:Boolean,attribute:"no-footer"})],E=[s({attribute:!1})],D=[s({attribute:!1})],A=[s({})],R=[n(".modal")],M=[n(".modal__panel")],z=[n(".modal__backdrop")],$=[l()],F=[r()],I=[o()],T=[u()],L=[d("open")],V=[h("modal-open",{bubbles:!0,composed:!0})],B=[h("modal-close",{bubbles:!0,composed:!0})],y(this,null,$,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,N),y(this,null,F,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,N),y(this,null,I,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,N),y(this,null,T,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,N),y(this,null,L,{kind:"method",name:"handleOpenChange",static:!1,private:!1,access:{has:e=>"handleOpenChange"in e,get:e=>e.handleOpenChange},metadata:e},null,N),y(this,null,V,{kind:"method",name:"dispatchOpenEvent",static:!1,private:!1,access:{has:e=>"dispatchOpenEvent"in e,get:e=>e.dispatchOpenEvent},metadata:e},null,N),y(this,null,B,{kind:"method",name:"dispatchCloseEvent",static:!1,private:!1,access:{has:e=>"dispatchCloseEvent"in e,get:e=>e.dispatchCloseEvent},metadata:e},null,N),y(null,null,p,{kind:"field",name:"open",static:!1,private:!1,access:{has:e=>"open"in e,get:e=>e.open,set:(e,t)=>{e.open=t}},metadata:e},H,q),y(null,null,g,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},_,G),y(null,null,b,{kind:"field",name:"noBackdropDismiss",static:!1,private:!1,access:{has:e=>"noBackdropDismiss"in e,get:e=>e.noBackdropDismiss,set:(e,t)=>{e.noBackdropDismiss=t}},metadata:e},K,W),y(null,null,f,{kind:"field",name:"noEscapeDismiss",static:!1,private:!1,access:{has:e=>"noEscapeDismiss"in e,get:e=>e.noEscapeDismiss,set:(e,t)=>{e.noEscapeDismiss=t}},metadata:e},U,Z),y(null,null,v,{kind:"field",name:"noFocusTrap",static:!1,private:!1,access:{has:e=>"noFocusTrap"in e,get:e=>e.noFocusTrap,set:(e,t)=>{e.noFocusTrap=t}},metadata:e},Y,J),y(null,null,x,{kind:"field",name:"noCloseButton",static:!1,private:!1,access:{has:e=>"noCloseButton"in e,get:e=>e.noCloseButton,set:(e,t)=>{e.noCloseButton=t}},metadata:e},Q,X),y(null,null,C,{kind:"field",name:"noHeader",static:!1,private:!1,access:{has:e=>"noHeader"in e,get:e=>e.noHeader,set:(e,t)=>{e.noHeader=t}},metadata:e},ee,te),y(null,null,S,{kind:"field",name:"noFooter",static:!1,private:!1,access:{has:e=>"noFooter"in e,get:e=>e.noFooter,set:(e,t)=>{e.noFooter=t}},metadata:e},ie,ae),y(null,null,E,{kind:"field",name:"hasFooterContent",static:!1,private:!1,access:{has:e=>"hasFooterContent"in e,get:e=>e.hasFooterContent,set:(e,t)=>{e.hasFooterContent=t}},metadata:e},se,ne),y(null,null,D,{kind:"field",name:"hasHeaderContent",static:!1,private:!1,access:{has:e=>"hasHeaderContent"in e,get:e=>e.hasHeaderContent,set:(e,t)=>{e.hasHeaderContent=t}},metadata:e},le,re),y(null,null,A,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},oe,ce),y(null,null,R,{kind:"field",name:"modal",static:!1,private:!1,access:{has:e=>"modal"in e,get:e=>e.modal,set:(e,t)=>{e.modal=t}},metadata:e},de,he),y(null,null,M,{kind:"field",name:"panel",static:!1,private:!1,access:{has:e=>"panel"in e,get:e=>e.panel,set:(e,t)=>{e.panel=t}},metadata:e},ue,me),y(null,null,z,{kind:"field",name:"backdrop",static:!1,private:!1,access:{has:e=>"backdrop"in e,get:e=>e.backdrop,set:(e,t)=>{e.backdrop=t}},metadata:e},pe,ge),y(null,a={value:c},O,{kind:"class",name:c.name,metadata:e},null,j),c=a.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,j)}render(){return e`
|
|
279
279
|
<div class="${"modal"+(this.open?" modal--open":"")}"
|
|
280
280
|
role="dialog"
|
|
281
281
|
aria-modal="true"
|
|
@@ -307,11 +307,11 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
307
307
|
</if>
|
|
308
308
|
</div>
|
|
309
309
|
</div>
|
|
310
|
-
`}styles(){return m`${":host{--modal-z-index:1000;--modal-backdrop-bg:var(--snice-modal-backdrop, rgb(0 0 0 / 0.6));--modal-backdrop-blur:6px;--modal-panel-bg:var(--snice-color-surface-container-highest, var(--snice-color-surface, rgb(255 255 255)));--modal-panel-shadow:var(--snice-shadow-2xl, 0 25px 50px -12px rgb(0 0 0 / 0.25));--modal-border-radius:var(--snice-border-radius-lg, 8px);--modal-padding:var(--snice-spacing-lg, 1.5rem);--modal-transition-duration:200ms}.modal{position:fixed;top:0;left:0;right:0;bottom:0;z-index:var(--modal-z-index);display:flex;align-items:center;justify-content:center;padding:var(--modal-padding);pointer-events:none;opacity:0;visibility:hidden}.modal--open{pointer-events:auto;opacity:1;visibility:visible}.modal__backdrop{position:absolute;top:0;left:0;right:0;bottom:0;background:var(--modal-backdrop-bg);backdrop-filter:blur(var(--modal-backdrop-blur));-webkit-backdrop-filter:blur(var(--modal-backdrop-blur));opacity:0;transition:opacity 180ms var(--snice-ease-out, ease)}.modal--open .modal__backdrop{opacity:1}.modal__panel{position:relative;background:var(--modal-panel-bg);border-radius:var(--modal-border-radius);box-shadow:var(--modal-panel-shadow);display:flex;flex-direction:column;max-height:calc(100vh - 2 * var(--modal-padding));opacity:0;transform:scale(.96) translateY(1rem);transition:opacity 260ms var(--snice-ease-out, ease) 80ms,transform 320ms var(--snice-ease-spring, cubic-bezier(.34,1.56,.64,1)) 80ms;z-index:1}.modal--open .modal__panel{opacity:1;transform:scale(1) translateY(0)}.modal--open .modal__panel>*{animation:snice-modal-content-in 240ms var(--snice-ease-out,ease) backwards}.modal--open .modal__header{animation-delay:140ms}.modal--open .modal__body{animation-delay:180ms}.modal--open .modal__footer{animation-delay:220ms}@keyframes snice-modal-content-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.modal__panel--small{width:100%;max-width:25rem}.modal__panel--medium{width:100%;max-width:37.5rem}.modal__panel--large{width:100%;max-width:56.25rem}.modal__panel--fullscreen{width:calc(100vw - 2 * var(--modal-padding));height:calc(100vh - 2 * var(--modal-padding));max-width:none}.modal__header{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);display:flex;align-items:center;justify-content:space-between;padding:var(--modal-padding);padding-bottom:var(--snice-spacing-sm,.5rem)}.modal__header--empty{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);display:none}::slotted([slot=header]){flex:1;margin:0;font-size:var(--snice-font-size-lg, 1.125rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23))}.modal__close{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;margin-left:auto;background:0 0;border:none;border-radius:var(--snice-border-radius-md,6px);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:background-color var(--snice-transition-fast, 150ms) ease,color var(--snice-transition-fast, 150ms) ease}.modal__close:hover{background:var(--snice-color-surface-hover,rgb(241 241 241));color:var(--snice-color-text,rgb(23 23 23))}.modal__close:focus-visible{outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px}.modal__close svg{width:1.125rem;height:1.125rem}.modal__body{flex:1;padding:var(--modal-padding);overflow-y:auto;color:var(--snice-color-text,rgb(23 23 23))}.modal__footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--snice-spacing-sm,.5rem);padding:var(--modal-padding);padding-top:var(--snice-spacing-sm,.5rem)}.modal__footer--empty{display:none}.modal__header--empty+.modal__body{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);padding-top:var(--modal-padding)}.modal__body:has(+ .modal__footer--empty){padding-bottom:var(--modal-padding)}@keyframes slideUp{from{opacity:0;transform:translateY(6.25rem)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@media (max-width:640px){.modal{padding:0}.modal__panel:not(.modal__panel--fullscreen){width:100%;height:100%;max-width:none;max-height:none;border-radius:0}}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}init(){this.open&&this.showModal(),this.syncFooterState(),this.shadowRoot?.addEventListener("slotchange",()=>this.syncFooterState())}syncFooterState(){this.hasFooterContent=!!this.querySelector('[slot="footer"]'),this.hasHeaderContent=!!this.querySelector('[slot="header"]')}cleanup(){this.lockedBodyScroll&&(document.body.style.overflow="",this.lockedBodyScroll=!1)}handleOpenChange(e){void 0!==e&&(this.open?this.showModal():this.hideModal())}handleBackdropClick(e){e.target.classList.contains("modal__backdrop")&&(this.noBackdropDismiss||this.close())}handleCloseClick(e){e.stopPropagation(),this.close()}handleKeydown(e){this.open&&("Escape"!==e.key||this.noEscapeDismiss||(e.stopPropagation(),this.close()),"Tab"!==e.key||this.noFocusTrap||this.trapFocus(e))}showModal(){this.previousFocus=document.activeElement,document.body.style.overflow="hidden",this.lockedBodyScroll=!0,requestAnimationFrame(()=>{const e=this.panel?.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e?e.focus():this.panel?.focus()}),this.dispatchOpenEvent()}hideModal(){this.lockedBodyScroll&&(document.body.style.overflow="",this.lockedBodyScroll=!1),this.previousFocus&&(this.previousFocus.isConnected&&this.previousFocus.focus(),this.previousFocus=null),this.dispatchCloseEvent()}trapFocus(e){if(!this.panel)return;const t='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',i=[...Array.from(this.panel.querySelectorAll(t)),...Array.from(this.querySelectorAll(t))].filter(e=>!e.disabled);if(0===i.length)return;const a=i[0],s=i[i.length-1],n=this.shadowRoot?.activeElement??document.activeElement;e.shiftKey?n===a&&(s?.focus(),e.preventDefault()):n===s&&(a?.focus(),e.preventDefault())}dispatchOpenEvent(){return{modal:this}}dispatchCloseEvent(){return{modal:this}}show(){this.open=!0}close(){this.open=!1}})})(),(()=>{let t,a,n,o,c,d,u,p,g,b,f,v=[i("snice-empty-state")],k=[],x=HTMLElement,C=[],S=[],E=[],D=[],A=[],R=[],M=[],z=[],F=[]
|
|
310
|
+
`}styles(){return m`${":host{--modal-z-index:1000;--modal-backdrop-bg:var(--snice-modal-backdrop, rgb(0 0 0 / 0.6));--modal-backdrop-blur:6px;--modal-panel-bg:var(--snice-color-surface-container-highest, var(--snice-color-surface, rgb(255 255 255)));--modal-panel-shadow:var(--snice-shadow-2xl, 0 25px 50px -12px rgb(0 0 0 / 0.25));--modal-border-radius:var(--snice-border-radius-lg, 8px);--modal-padding:var(--snice-spacing-lg, 1.5rem);--modal-transition-duration:200ms}.modal{position:fixed;top:0;left:0;right:0;bottom:0;z-index:var(--modal-z-index);display:flex;align-items:center;justify-content:center;padding:var(--modal-padding);pointer-events:none;opacity:0;visibility:hidden}.modal--open{pointer-events:auto;opacity:1;visibility:visible}.modal__backdrop{position:absolute;top:0;left:0;right:0;bottom:0;background:var(--modal-backdrop-bg);backdrop-filter:blur(var(--modal-backdrop-blur));-webkit-backdrop-filter:blur(var(--modal-backdrop-blur));opacity:0;transition:opacity 180ms var(--snice-ease-out, ease)}.modal--open .modal__backdrop{opacity:1}.modal__panel{position:relative;background:var(--modal-panel-bg);border-radius:var(--modal-border-radius);box-shadow:var(--modal-panel-shadow);display:flex;flex-direction:column;max-height:calc(100vh - 2 * var(--modal-padding));opacity:0;transform:scale(.96) translateY(1rem);transition:opacity 260ms var(--snice-ease-out, ease) 80ms,transform 320ms var(--snice-ease-spring, cubic-bezier(.34,1.56,.64,1)) 80ms;z-index:1}.modal--open .modal__panel{opacity:1;transform:scale(1) translateY(0)}.modal--open .modal__panel>*{animation:snice-modal-content-in 240ms var(--snice-ease-out,ease) backwards}.modal--open .modal__header{animation-delay:140ms}.modal--open .modal__body{animation-delay:180ms}.modal--open .modal__footer{animation-delay:220ms}@keyframes snice-modal-content-in{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}.modal__panel--small{width:100%;max-width:25rem}.modal__panel--medium{width:100%;max-width:37.5rem}.modal__panel--large{width:100%;max-width:56.25rem}.modal__panel--fullscreen{width:calc(100vw - 2 * var(--modal-padding));height:calc(100vh - 2 * var(--modal-padding));max-width:none}.modal__header{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);display:flex;align-items:center;justify-content:space-between;padding:var(--modal-padding);padding-bottom:var(--snice-spacing-sm,.5rem)}.modal__header--empty{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);display:none}::slotted([slot=header]){flex:1;margin:0;font-size:var(--snice-font-size-lg, 1.125rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23))}.modal__close{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0;margin-left:auto;background:0 0;border:none;border-radius:var(--snice-border-radius-md,6px);color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;transition:background-color var(--snice-transition-fast, 150ms) ease,color var(--snice-transition-fast, 150ms) ease}.modal__close:hover{background:var(--snice-color-surface-hover,rgb(241 241 241));color:var(--snice-color-text,rgb(23 23 23))}.modal__close:focus-visible{outline:2px solid var(--snice-color-primary,rgb(37 99 235));outline-offset:2px}.modal__close svg{width:1.125rem;height:1.125rem}.modal__body{flex:1;padding:var(--modal-padding);overflow-y:auto;color:var(--snice-color-text,rgb(23 23 23))}.modal__footer{display:flex;align-items:center;justify-content:flex-end;gap:var(--snice-spacing-sm,.5rem);padding:var(--modal-padding);padding-top:var(--snice-spacing-sm,.5rem)}.modal__footer--empty{display:none}.modal__header--empty+.modal__body{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);padding-top:var(--modal-padding)}.modal__body:has(+ .modal__footer--empty){padding-bottom:var(--modal-padding)}@keyframes slideUp{from{opacity:0;transform:translateY(6.25rem)}to{opacity:1;transform:translateY(0)}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}@media (max-width:640px){.modal{padding:0}.modal__panel:not(.modal__panel--fullscreen){width:100%;height:100%;max-width:none;max-height:none;border-radius:0}}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}init(){this.open&&this.showModal(),this.syncFooterState(),this.shadowRoot?.addEventListener("slotchange",()=>this.syncFooterState())}syncFooterState(){this.hasFooterContent=!!this.querySelector('[slot="footer"]'),this.hasHeaderContent=!!this.querySelector('[slot="header"]')}cleanup(){this.lockedBodyScroll&&(document.body.style.overflow="",this.lockedBodyScroll=!1)}handleOpenChange(e){void 0!==e&&(this.open?this.showModal():this.hideModal())}handleBackdropClick(e){e.target.classList.contains("modal__backdrop")&&(this.noBackdropDismiss||this.close())}handleCloseClick(e){e.stopPropagation(),this.close()}handleKeydown(e){this.open&&("Escape"!==e.key||this.noEscapeDismiss||(e.stopPropagation(),this.close()),"Tab"!==e.key||this.noFocusTrap||this.trapFocus(e))}showModal(){this.previousFocus=document.activeElement,document.body.style.overflow="hidden",this.lockedBodyScroll=!0,requestAnimationFrame(()=>{const e=this.panel?.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e?e.focus():this.panel?.focus()}),this.dispatchOpenEvent()}hideModal(){this.lockedBodyScroll&&(document.body.style.overflow="",this.lockedBodyScroll=!1),this.previousFocus&&(this.previousFocus.isConnected&&this.previousFocus.focus(),this.previousFocus=null),this.dispatchCloseEvent()}trapFocus(e){if(!this.panel)return;const t='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',i=[...Array.from(this.panel.querySelectorAll(t)),...Array.from(this.querySelectorAll(t))].filter(e=>!e.disabled);if(0===i.length)return;const a=i[0],s=i[i.length-1],n=this.shadowRoot?.activeElement??document.activeElement;e.shiftKey?n===a&&(s?.focus(),e.preventDefault()):n===s&&(a?.focus(),e.preventDefault())}dispatchOpenEvent(){return{modal:this}}dispatchCloseEvent(){return{modal:this}}show(){this.open=!0}close(){this.open=!1}})})(),(()=>{let t,a,n,o,c,d,u,p,g,b,f,v=[i("snice-empty-state")],k=[],x=HTMLElement,C=[],S=[],E=[],D=[],A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[];(class extends x{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(x[Symbol.metadata]??null):void 0;n=[s({})],o=[s({})],c=[s({})],d=[s({})],u=[s({attribute:"action-text"})],p=[s({attribute:"action-href"})],g=[l()],b=[r()],f=[h("empty-state-action",{bubbles:!0,composed:!0})],y(this,null,g,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,C),y(this,null,b,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,C),y(this,null,f,{kind:"method",name:"dispatchActionEvent",static:!1,private:!1,access:{has:e=>"dispatchActionEvent"in e,get:e=>e.dispatchActionEvent},metadata:e},null,C),y(null,null,n,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},S,E),y(null,null,o,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},D,A),y(null,null,c,{kind:"field",name:"title",static:!1,private:!1,access:{has:e=>"title"in e,get:e=>e.title,set:(e,t)=>{e.title=t}},metadata:e},R,M),y(null,null,d,{kind:"field",name:"description",static:!1,private:!1,access:{has:e=>"description"in e,get:e=>e.description,set:(e,t)=>{e.description=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"actionText",static:!1,private:!1,access:{has:e=>"actionText"in e,get:e=>e.actionText,set:(e,t)=>{e.actionText=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"actionHref",static:!1,private:!1,access:{has:e=>"actionHref"in e,get:e=>e.actionHref,set:(e,t)=>{e.actionHref=t}},metadata:e},T,L),y(null,t={value:a},v,{kind:"class",name:a.name,metadata:e},null,k),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,k)}render(){const t=["empty-state",`empty-state--${this.size}`].filter(Boolean).join(" ");return e`
|
|
311
311
|
<div class="${t}" part="container">
|
|
312
312
|
<div class="empty-state__icon-wrapper" part="icon">
|
|
313
313
|
<slot name="icon">
|
|
314
|
-
${
|
|
314
|
+
${H(this.icon,"empty-state__icon")}
|
|
315
315
|
</slot>
|
|
316
316
|
</div>
|
|
317
317
|
<h3 class="empty-state__title" part="title">${this.title}</h3>
|
|
@@ -340,34 +340,34 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
340
340
|
</if>
|
|
341
341
|
<div class="empty-state__extra"><slot></slot></div>
|
|
342
342
|
</div>
|
|
343
|
-
`}styles(){return m`${":host{display:block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem);color:var(--snice-color-text-secondary,rgb(82 82 82));animation:snice-empty-in 360ms var(--snice-ease-out,ease) backwards}@keyframes snice-empty-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.empty-state--small{padding:var(--snice-spacing-xl,2rem) var(--snice-spacing-lg,1.5rem)}.empty-state--medium{padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem)}.empty-state--large{padding:var(--snice-spacing-3xl,4rem) var(--snice-spacing-2xl,2.5rem)}.empty-state__icon-wrapper{display:flex;align-items:center;justify-content:center;margin-bottom:var(--snice-spacing-lg,1.5rem);position:relative;width:calc(var(--snice-font-size-4xl,4rem) * 1.8);height:calc(var(--snice-font-size-4xl,4rem) * 1.8)}.empty-state__icon-wrapper::before{content:'';position:absolute;inset:0;border-radius:50%;border:1px dashed color-mix(in srgb,var(--snice-color-border,#ddd) 70%,transparent);animation:18s linear infinite snice-empty-halo}@keyframes snice-empty-halo{to{transform:rotate(360deg)}}.empty-state__icon{font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon svg{width:1em;height:1em;display:block}.empty-state__icon-wrapper ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem)}.empty-state__icon-wrapper ::slotted(img){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem);object-fit:contain}.empty-state--small .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-md,1rem);width:calc(var(--snice-font-size-3xl,3rem) * 1.8);height:calc(var(--snice-font-size-3xl,3rem) * 1.8)}.empty-state--small .empty-state__icon{font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(img),.empty-state--small .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-3xl,3rem);height:var(--snice-font-size-3xl,3rem)}.empty-state--large .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-xl,2rem);width:calc(var(--snice-font-size-3xl,5rem) * 1.8);height:calc(var(--snice-font-size-3xl,5rem) * 1.8)}.empty-state--large .empty-state__icon{font-size:var(--snice-font-size-3xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-3xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(img),.empty-state--large .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-3xl,5rem);height:var(--snice-font-size-3xl,5rem)}.empty-state__title{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-size:var(--snice-heading-lg, 1.25rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23));margin:0 0 var(--snice-spacing-xs,.5rem) 0}.empty-state--small .empty-state__title{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-size:var(--snice-heading-md, 1.125rem);margin-bottom:var(--snice-spacing-2xs,.375rem)}.empty-state--large .empty-state__title{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-size:var(--snice-heading-xl, 1.5rem);margin-bottom:var(--snice-spacing-sm,.75rem)}.empty-state__description{font-size:var(--snice-font-size-sm, .875rem);color:var(--snice-color-text-secondary,rgb(82 82 82));margin:0 0 var(--snice-spacing-lg,1.5rem) 0;max-width:32rem;line-height:var(--snice-line-height-normal, 1.5)}.empty-state--small .empty-state__description{font-size:var(--snice-font-size-xs, .8125rem);margin-bottom:var(--snice-spacing-md,1rem)}.empty-state--large .empty-state__description{font-size:var(--snice-font-size-md, 1rem);margin-bottom:var(--snice-spacing-xl,2rem)}.empty-state__action{display:inline-flex;align-items:center;justify-content:center;padding:var(--snice-spacing-xs,.5rem) var(--snice-spacing-md,1rem);font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);color:var(--snice-color-text-inverse,rgb(250 250 250));background:var(--snice-color-primary,rgb(37 99 235));border:none;border-radius:var(--snice-border-radius-md,.375rem);text-decoration:none;cursor:pointer;transition:background var(--snice-transition-fast, 150ms)}.empty-state__action:hover{background:var(--snice-color-primary-hover,rgb(29 78 216))}.empty-state--small .empty-state__action{padding:var(--snice-spacing-2xs,.375rem) var(--snice-spacing-sm,.75rem);font-size:var(--snice-font-size-xs, .8125rem)}.empty-state--large .empty-state__action{padding:var(--snice-spacing-sm,.625rem) var(--snice-spacing-lg,1.25rem);font-size:var(--snice-font-size-md, 1rem)}.empty-state__extra ::slotted(*){margin-top:var(--snice-spacing-md,1rem)}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}handleActionClick(e){this.actionHref||e.preventDefault(),this.dispatchActionEvent()}dispatchActionEvent(){return{emptyState:this}}constructor(){super(...arguments),this.size=(w(this,C),w(this,S,"medium")),this.icon=(w(this,E),w(this,D,"📭")),this.title=(w(this,A),w(this,R,"No data")),this.description=(w(this,M),w(this,z,"")),this.actionText=(w(this,F),w(this,$,"")),this.actionHref=(w(this,I),w(this,T,"")),w(this,L)}})})();var X=":host{display:block;width:100%;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text,rgb(23 23 23))}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word}:host([align=left]){text-align:left}:host([align=center]){text-align:center}:host([align=right]){text-align:right}:host([type=accounting]),:host([type=currency]),:host([type=fraction]),:host([type=number]),:host([type=percent]),:host([type=scientific]){font-variant-numeric:tabular-nums;text-align:right}:host([type=date]){font-variant-numeric:tabular-nums}:host([type=boolean]){text-align:center;font-size:1rem}.boolean--true{color:var(--snice-color-success,rgb(22 163 74))}.boolean--false{color:var(--snice-color-danger,rgb(220 38 38))}:host([type=rating]){text-align:center}:host([type=sparkline]){text-align:center}.cell-content--text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-content--text[data-multiline=true]{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.cell-content--date,.cell-content--number{font-feature-settings:'tnum'}:host([type=boolean]) .cell-content{display:flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:flex;align-items:center;justify-content:center;gap:.125rem;container-type:inline-size}:host([type=rating]) snice-rating{--rating-size:clamp(0.55rem, 16cqi, 1rem)}.cell-content--progress{width:100%;min-width:4rem}.cell-content--sparkline{display:flex;align-items:center;justify-content:center;min-width:3rem}:host(.positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.warning){color:var(--snice-color-warning,rgb(234 179 8));background-color:rgb(254 249 195 / .3)}:host(.danger){color:var(--snice-color-danger,rgb(220 38 38));background-color:rgb(254 226 226 / .3)}:host(.success){color:var(--snice-color-success,rgb(22 163 74));background-color:rgb(220 252 231 / .3)}:host(.info){color:var(--snice-color-primary,rgb(37 99 235));background-color:rgb(219 234 254 / .3)}:host(.date--today){font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-primary,rgb(37 99 235))}:host(.date--past){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.date--future){color:var(--snice-color-success,rgb(22 163 74))}:host(.number--negative.number--negative-red){color:var(--snice-color-danger,rgb(220 38 38))}:host(.number--positive.number--highlighted){color:var(--snice-color-success,rgb(22 163 74));font-weight:var(--snice-font-weight-semibold,600)}:host(.number--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([truncate]) .cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([wrap]) .cell-content{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}:host(:not([value])) .cell-content,:host([value=\"\"]) .cell-content{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.loading){position:relative;overflow:hidden}:host(.loading) .cell-content{opacity:.6}:host(.loading)::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,var(--snice-color-surface,rgb(255 255 255 / .6)),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:-2px}.cell-content button,.cell-content input,.cell-content select{font-size:inherit;line-height:inherit}.cell-content a{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none}.cell-content a:hover{text-decoration:underline}@media (max-width:768px){:host{font-size:.75rem;line-height:1rem}:host([type=boolean]){font-size:.875rem}}@media (prefers-reduced-motion:reduce){:host(.loading)::after{animation:none}}@media (prefers-contrast:high){:host(.positive){background-color:rgb(220 252 231 / .3)}:host(.negative){background-color:rgb(254 226 226 / .3)}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";const ee=["backgroundColor","color","fontWeight","fontStyle","fontSize","textDecoration"],te=new WeakMap,ie=new WeakMap;function ae(e,t=!1){if(te.has(e))return;let i=null,a=!1;const s=()=>{if(!a){a=!0,i?.disconnect();try{const i=e.column;for(const t of ie.get(e)||[])e.classList.remove(t);ie.set(e,[]);for(const t of ee)e.style[t]="";if(e.removeAttribute("title"),!i)return;const a=t=>{if(t)for(const i of ee){const a=t[i];a&&(e.style[i]=a)}};a(i.style);for(const t of i.conditionalFormats||[])if(t.condition(e.value,e.rowData)){a(t.style),t.className&&(e.classList.add(t.className),ie.set(e,[t.className]));break}if(i.tooltip&&(e.title="function"==typeof i.tooltip?i.tooltip(e.value,e.rowData):null==e.value?"":String(e.value)),t||i.valueFormatter){const a=t&&i.formatter||i.valueFormatter,s=e.shadowRoot?.querySelector('[part~="content"]');if(a&&s){const t=String(a(e.value,e.rowData)??"");(s.textContent!==t||s.childElementCount>0)&&(s.textContent=t)}}}finally{a=!1,i&&e.shadowRoot&&i.observe(e.shadowRoot,{childList:!0,subtree:!0,characterData:!0})}}};i=new MutationObserver(s),e.shadowRoot&&i.observe(e.shadowRoot,{childList:!0,subtree:!0,characterData:!0}),te.set(e,i),queueMicrotask(s)}function se(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S=[i("snice-cell")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],F=[],$=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s()],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[l()],v=[r()],k=[o()],x=[d("align")],C=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,A),y(this,null,C,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,A),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},z,F),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},$,I),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){return e`
|
|
343
|
+
`}styles(){return m`${":host{display:block;font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif)}.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem);color:var(--snice-color-text-secondary,rgb(82 82 82));animation:snice-empty-in 360ms var(--snice-ease-out,ease) backwards}@keyframes snice-empty-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}.empty-state--small{padding:var(--snice-spacing-xl,2rem) var(--snice-spacing-lg,1.5rem)}.empty-state--medium{padding:var(--snice-spacing-2xl,3rem) var(--snice-spacing-xl,2rem)}.empty-state--large{padding:var(--snice-spacing-3xl,4rem) var(--snice-spacing-2xl,2.5rem)}.empty-state__icon-wrapper{display:flex;align-items:center;justify-content:center;margin-bottom:var(--snice-spacing-lg,1.5rem);position:relative;width:calc(var(--snice-font-size-4xl,4rem) * 1.8);height:calc(var(--snice-font-size-4xl,4rem) * 1.8)}.empty-state__icon-wrapper::before{content:'';position:absolute;inset:0;border-radius:50%;border:1px dashed color-mix(in srgb,var(--snice-color-border,#ddd) 70%,transparent);animation:18s linear infinite snice-empty-halo}@keyframes snice-empty-halo{to{transform:rotate(360deg)}}.empty-state__icon{font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon svg{width:1em;height:1em;display:block}.empty-state__icon-wrapper ::slotted(*){display:flex;align-items:center;justify-content:center;font-size:var(--snice-font-size-4xl, 4rem);opacity:.5;line-height:1}.empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem)}.empty-state__icon-wrapper ::slotted(img){width:var(--snice-font-size-4xl,4rem);height:var(--snice-font-size-4xl,4rem);object-fit:contain}.empty-state--small .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-md,1rem);width:calc(var(--snice-font-size-3xl,3rem) * 1.8);height:calc(var(--snice-font-size-3xl,3rem) * 1.8)}.empty-state--small .empty-state__icon{font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-3xl, 3rem)}.empty-state--small .empty-state__icon-wrapper ::slotted(img),.empty-state--small .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-3xl,3rem);height:var(--snice-font-size-3xl,3rem)}.empty-state--large .empty-state__icon-wrapper{margin-bottom:var(--snice-spacing-xl,2rem);width:calc(var(--snice-font-size-3xl,5rem) * 1.8);height:calc(var(--snice-font-size-3xl,5rem) * 1.8)}.empty-state--large .empty-state__icon{font-size:var(--snice-font-size-3xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(*){font-size:var(--snice-font-size-3xl, 5rem)}.empty-state--large .empty-state__icon-wrapper ::slotted(img),.empty-state--large .empty-state__icon-wrapper ::slotted(svg){width:var(--snice-font-size-3xl,5rem);height:var(--snice-font-size-3xl,5rem)}.empty-state__title{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-size:var(--snice-heading-lg, 1.25rem);font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-text,rgb(23 23 23));margin:0 0 var(--snice-spacing-xs,.5rem) 0}.empty-state--small .empty-state__title{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-size:var(--snice-heading-md, 1.125rem);margin-bottom:var(--snice-spacing-2xs,.375rem)}.empty-state--large .empty-state__title{font-family:var(--snice-font-family-display, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);font-size:var(--snice-heading-xl, 1.5rem);margin-bottom:var(--snice-spacing-sm,.75rem)}.empty-state__description{font-size:var(--snice-font-size-sm, .875rem);color:var(--snice-color-text-secondary,rgb(82 82 82));margin:0 0 var(--snice-spacing-lg,1.5rem) 0;max-width:32rem;line-height:var(--snice-line-height-normal, 1.5)}.empty-state--small .empty-state__description{font-size:var(--snice-font-size-xs, .8125rem);margin-bottom:var(--snice-spacing-md,1rem)}.empty-state--large .empty-state__description{font-size:var(--snice-font-size-md, 1rem);margin-bottom:var(--snice-spacing-xl,2rem)}.empty-state__action{display:inline-flex;align-items:center;justify-content:center;padding:var(--snice-spacing-xs,.5rem) var(--snice-spacing-md,1rem);font-size:var(--snice-font-size-sm, .875rem);font-weight:var(--snice-font-weight-medium,500);color:var(--snice-color-text-inverse,rgb(250 250 250));background:var(--snice-color-primary,rgb(37 99 235));border:none;border-radius:var(--snice-border-radius-md,.375rem);text-decoration:none;cursor:pointer;transition:background var(--snice-transition-fast, 150ms)}.empty-state__action:hover{background:var(--snice-color-primary-hover,rgb(29 78 216))}.empty-state--small .empty-state__action{padding:var(--snice-spacing-2xs,.375rem) var(--snice-spacing-sm,.75rem);font-size:var(--snice-font-size-xs, .8125rem)}.empty-state--large .empty-state__action{padding:var(--snice-spacing-sm,.625rem) var(--snice-spacing-lg,1.25rem);font-size:var(--snice-font-size-md, 1rem)}.empty-state__extra ::slotted(*){margin-top:var(--snice-spacing-md,1rem)}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}handleActionClick(e){this.actionHref||e.preventDefault(),this.dispatchActionEvent()}dispatchActionEvent(){return{emptyState:this}}constructor(){super(...arguments),this.size=(w(this,C),w(this,S,"medium")),this.icon=(w(this,E),w(this,D,"📭")),this.title=(w(this,A),w(this,R,"No data")),this.description=(w(this,M),w(this,z,"")),this.actionText=(w(this,$),w(this,F,"")),this.actionHref=(w(this,I),w(this,T,"")),w(this,L)}})})();var ee=":host{display:block;width:100%;font-size:.875rem;line-height:1.25rem;color:var(--snice-color-text,rgb(23 23 23))}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word}:host([align=left]){text-align:left}:host([align=center]){text-align:center}:host([align=right]){text-align:right}:host([type=accounting]),:host([type=currency]),:host([type=fraction]),:host([type=number]),:host([type=percent]),:host([type=scientific]){font-variant-numeric:tabular-nums;text-align:right}:host([type=date]){font-variant-numeric:tabular-nums}:host([type=boolean]){text-align:center;font-size:1rem}.boolean--true{color:var(--snice-color-success,rgb(22 163 74))}.boolean--false{color:var(--snice-color-danger,rgb(220 38 38))}:host([type=rating]){text-align:center}:host([type=sparkline]){text-align:center}.cell-content--text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cell-content--text[data-multiline=true]{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}.cell-content--date,.cell-content--number{font-feature-settings:'tnum'}:host([type=boolean]) .cell-content{display:flex;align-items:center;justify-content:center}:host([type=rating]) .cell-content{display:flex;align-items:center;justify-content:center;gap:.125rem;container-type:inline-size}:host([type=rating]) snice-rating{--rating-size:clamp(0.55rem, 16cqi, 1rem)}.cell-content--progress{width:100%;min-width:4rem}.cell-content--sparkline{display:flex;align-items:center;justify-content:center;min-width:3rem}:host(.positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.warning){color:var(--snice-color-warning,rgb(234 179 8));background-color:rgb(254 249 195 / .3)}:host(.danger){color:var(--snice-color-danger,rgb(220 38 38));background-color:rgb(254 226 226 / .3)}:host(.success){color:var(--snice-color-success,rgb(22 163 74));background-color:rgb(220 252 231 / .3)}:host(.info){color:var(--snice-color-primary,rgb(37 99 235));background-color:rgb(219 234 254 / .3)}:host(.date--today){font-weight:var(--snice-font-weight-semibold,600);color:var(--snice-color-primary,rgb(37 99 235))}:host(.date--past){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.date--future){color:var(--snice-color-success,rgb(22 163 74))}:host(.number--negative.number--negative-red){color:var(--snice-color-danger,rgb(220 38 38))}:host(.number--positive.number--highlighted){color:var(--snice-color-success,rgb(22 163 74));font-weight:var(--snice-font-weight-semibold,600)}:host(.number--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([truncate]) .cell-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([wrap]) .cell-content{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}:host(:not([value])) .cell-content,:host([value=\"\"]) .cell-content{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.loading){position:relative;overflow:hidden}:host(.loading) .cell-content{opacity:.6}:host(.loading)::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;background:linear-gradient(90deg,transparent,var(--snice-color-surface,rgb(255 255 255 / .6)),transparent);animation:1.5s infinite cell-shimmer}@keyframes cell-shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}:host(:focus-within){outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:-2px}.cell-content button,.cell-content input,.cell-content select{font-size:inherit;line-height:inherit}.cell-content a{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none}.cell-content a:hover{text-decoration:underline}@media (max-width:768px){:host{font-size:.75rem;line-height:1rem}:host([type=boolean]){font-size:.875rem}}@media (prefers-reduced-motion:reduce){:host(.loading)::after{animation:none}}@media (prefers-contrast:high){:host(.positive){background-color:rgb(220 252 231 / .3)}:host(.negative){background-color:rgb(254 226 226 / .3)}.cell-content a{text-decoration:underline}}@media print{:host{font-size:.75rem}:host(.loading)::after{display:none}.cell-content a{text-decoration:underline}}";const te=["backgroundColor","color","fontWeight","fontStyle","fontSize","textDecoration"],ie=new WeakMap,ae=new WeakMap;function se(e,t=!1){if(ie.has(e))return;let i=null,a=!1;const s=()=>{if(!a){a=!0,i?.disconnect();try{const i=e.column;for(const t of ae.get(e)||[])e.classList.remove(t);ae.set(e,[]);for(const t of te)e.style[t]="";if(e.removeAttribute("title"),!i)return;const a=t=>{if(t)for(const i of te){const a=t[i];a&&(e.style[i]=a)}};a(i.style);for(const t of i.conditionalFormats||[])if(t.condition(e.value,e.rowData)){a(t.style),t.className&&(e.classList.add(t.className),ae.set(e,[t.className]));break}if(i.tooltip&&(e.title="function"==typeof i.tooltip?i.tooltip(e.value,e.rowData):null==e.value?"":String(e.value)),t||i.valueFormatter){const a=t&&i.formatter||i.valueFormatter,s=e.shadowRoot?.querySelector('[part~="content"]');if(a&&s){const t=String(a(e.value,e.rowData)??"");(s.textContent!==t||s.childElementCount>0)&&(s.textContent=t)}}}finally{a=!1,i&&e.shadowRoot&&i.observe(e.shadowRoot,{childList:!0,subtree:!0,characterData:!0})}}};i=new MutationObserver(s),e.shadowRoot&&i.observe(e.shadowRoot,{childList:!0,subtree:!0,characterData:!0}),ie.set(e,i),queueMicrotask(s)}function ne(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S=[i("snice-cell")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s()],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[l()],v=[r()],k=[o()],x=[d("align")],C=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,A),y(this,null,C,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,A),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){return e`
|
|
344
344
|
<div class="cell-content" part="content">
|
|
345
345
|
${this.formatValue()}
|
|
346
346
|
</div>
|
|
347
|
-
`}styles(){return m`${X}`}init(){ae(this),this.applyAlignment(),this.applyConditionalFormatting()}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.formatValue()),this.applyConditionalFormatting()}applyAlignment(){this.style.textAlign=this.align}applyConditionalFormatting(){if(this.column){for(const e of["backgroundColor","color","fontWeight","fontStyle","fontSize","textDecoration"])this.style[e]="";this.applyAlignment(),this.column.style&&this.applyStyle(this.column.style);for(const e of this.column.conditionalFormats||[])if(e.condition(this.value,this.rowData)){e.style&&this.applyStyle(e.style),e.className&&this.classList.add(e.className);break}}}applyStyle(e){e.backgroundColor&&(this.style.backgroundColor=e.backgroundColor),e.color&&(this.style.color=e.color),e.fontWeight&&(this.style.fontWeight=e.fontWeight),e.fontStyle&&(this.style.fontStyle=e.fontStyle),e.fontSize&&(this.style.fontSize=e.fontSize),e.textDecoration&&(this.style.textDecoration=e.textDecoration)}formatValue(){if(null==this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);if(this.column.valueFormatter)return this.column.valueFormatter(this.value,this.rowData);switch(this.type){case"text":return this.formatText();case"number":return this.formatNumber();case"currency":return this.formatCurrency();case"percent":return this.formatPercent();case"accounting":return this.formatAccounting();case"scientific":return this.formatScientific();case"fraction":return this.formatFraction();case"date":return this.formatDate();case"boolean":return this.formatBoolean();case"rating":return this.formatRating();case"progress":return this.formatProgress();case"sparkline":return this.formatSparkline();case"duration":return this.formatDuration();case"filesize":return this.formatFilesize();default:return String(this.value)}}formatText(){return String(this.value)}formatNumber(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);let i=t.toFixed(e.decimals??0);if(e.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}return t<0&&"parentheses"===e.negativeStyle&&(i=`(${i.replace("-","")})`),e.prefix&&(i=e.prefix+i),e.suffix&&(i+=e.suffix),i}formatCurrency(){const e=this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:e.decimals??2,maximumFractionDigits:e.decimals??2}).format(t)}formatPercent(){const e=this.column.percentageFormat||this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):`${t.toFixed(e.decimals??2)}%`}formatAccounting(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);let i=Math.abs(t).toFixed(e.decimals??2);if(e.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}return i=t<0?`(${i})`:` ${i} `,i}formatScientific(){const e=this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):t.toExponential(e.decimals??2)}formatFraction(){const e=Number(this.value);if(!Number.isFinite(e))return String(this.value);const t=e<0?-1:1,i=Math.abs(e);let a=0,s=1,n=1,l=0,r=i;for(let e=0;e<32;e++){const e=Math.floor(r),t=e*s+a,o=e*l+n;if(o>1e4)break;if(a=s,s=t,n=l,l=o,Math.abs(i-s/l)<=1e-6)break;const c=r-e;if(c<=Number.EPSILON)break;r=1/c}return`${t*s}/${l||1}`}formatDate(){const e=this.column.dateFormat||{},t=new Date(this.value);if(isNaN(t.getTime()))return String(this.value);if(e.customFormat)return e.customFormat.replace("YYYY",t.getFullYear().toString()).replace("MM",(t.getMonth()+1).toString().padStart(2,"0")).replace("DD",t.getDate().toString().padStart(2,"0"));const i={};switch(e.format){case"short":default:i.dateStyle="short";break;case"medium":i.dateStyle="medium";break;case"long":i.dateStyle="long";break;case"full":i.dateStyle="full"}return new Intl.DateTimeFormat(e.locale||"en-US",i).format(t)}formatBoolean(){const e=this.column.booleanFormat||{},t=Boolean(this.value);return e.useSymbols?t?e.trueSymbol||"✓":e.falseSymbol||"✗":t?e.trueValue||"true":e.falseValue||"false"}formatRating(){const e=this.column.ratingFormat||{},t=Number(this.value),i=e.max||5,a=e.symbol||"★",s=e.emptySymbol||"☆";if(isNaN(t))return String(this.value);let n="";const l=e.color||getComputedStyle(this).getPropertyValue("--snice-color-warning").trim(),r=getComputedStyle(this).getPropertyValue("--snice-color-border").trim();for(let e=0;e<i;e++)n+=e<t?`<span style="color: ${l}">${a}</span>`:`<span style="color: ${r}">${s}</span>`;return n}formatProgress(){const e=this.column.progressFormat||{},t=Number(this.value),i=Math.min(100,Math.max(0,t/(e.max||100)*100));if(isNaN(t))return String(this.value);const a=e.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),s=e.backgroundColor||getComputedStyle(this).getPropertyValue("--snice-color-border").trim();let n=`\n <div style="\n width: 100%; \n height: ${e.height||"1rem"}; \n background-color: ${s}; \n border-radius: 0.25rem; \n overflow: hidden;\n position: relative;\n ">\n <div style="\n width: ${i}%; \n height: 100%; \n background-color: ${a}; \n transition: width 0.3s ease;\n "></div>\n `;return e.showPercentage&&(n+=`\n <span style="\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.75rem;\n font-weight: bold;\n color: ${i>50?getComputedStyle(this).getPropertyValue("--snice-color-text-inverse").trim():getComputedStyle(this).getPropertyValue("--snice-color-text").trim()};\n ">${Math.round(i)}%</span>\n `),n+="</div>",n}formatSparkline(){const e=this.column.sparklineFormat||{},t=Array.isArray(this.value)?this.value:[];if(0===t.length)return"";const i=e.width||60,a=e.height||20,s=e.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),n=e.type||"line",l=Math.max(...t),r=Math.min(...t),o=l-r||1;if("line"===n){const e=t.map((e,s)=>`${s/(t.length-1)*i},${a-(e-r)/o*a}`).join(" ");return`\n <svg width="${i}" height="${a}" style="display: block;">\n <polyline \n points="${e}" \n fill="none" \n stroke="${s}" \n stroke-width="2"\n />\n </svg>\n `}if("bar"===n){const e=i/t.length,n=t.map((t,i)=>{const n=(t-r)/o*a;return`<rect x="${i*e}" y="${a-n}" width="${e-1}" height="${n}" fill="${s}" />`}).join("");return`\n <svg width="${i}" height="${a}" style="display: block;">\n ${n}\n </svg>\n `}return String(this.value)}formatDuration(){const e=Number(this.value);if(isNaN(e))return String(this.value);const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=e%60;return t>0?`${t}:${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${i}:${a.toString().padStart(2,"0")}`}formatFilesize(){const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let i=e,a=0;for(;i>=1024&&a<t.length-1;)i/=1024,a++;return`${i.toFixed(0===a?0:1)} ${t[a]}`}constructor(){super(...arguments),this.align=(w(this,A),w(this,R,"left")),this.type=(w(this,M),w(this,z,"text")),this.value=(w(this,F),w(this,$,"")),this.column=(w(this,I),w(this,T,{key:"",label:"",type:"text",align:"left"})),this.rowData=(w(this,L),w(this,V,null)),this.contentElement=(w(this,B),w(this,O,void 0)),w(this,j)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S,E,D=[i("snice-cell-text")],A=[],R=HTMLElement,M=[],z=[],F=[],$=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[];(class extends R{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(R[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[s({type:Boolean})],v=[s({type:Number,attribute:"max-lines"})],k=[l()],x=[r()],C=[o()],S=[d("align")],E=[d("value","column")],y(this,null,k,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,M),y(this,null,x,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,M),y(this,null,C,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,M),y(this,null,S,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,M),y(this,null,E,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,M),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},z,F),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},$,I),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},T,L),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},V,B),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},O,j),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},P,N),y(null,null,f,{kind:"field",name:"multiline",static:!1,private:!1,access:{has:e=>"multiline"in e,get:e=>e.multiline,set:(e,t)=>{e.multiline=t}},metadata:e},H,q),y(null,null,v,{kind:"field",name:"maxLines",static:!1,private:!1,access:{has:e=>"maxLines"in e,get:e=>e.maxLines,set:(e,t)=>{e.maxLines=t}},metadata:e},_,G),y(null,t={value:a},D,{kind:"class",name:a.name,metadata:e},null,A),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,A)}render(){const t=this.formatTextContent(),i=this.getTextStyles();return e`
|
|
347
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment(),this.applyConditionalFormatting()}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.formatValue()),this.applyConditionalFormatting()}applyAlignment(){this.style.textAlign=this.align}applyConditionalFormatting(){if(this.column){for(const e of["backgroundColor","color","fontWeight","fontStyle","fontSize","textDecoration"])this.style[e]="";this.applyAlignment(),this.column.style&&this.applyStyle(this.column.style);for(const e of this.column.conditionalFormats||[])if(e.condition(this.value,this.rowData)){e.style&&this.applyStyle(e.style),e.className&&this.classList.add(e.className);break}}}applyStyle(e){e.backgroundColor&&(this.style.backgroundColor=e.backgroundColor),e.color&&(this.style.color=e.color),e.fontWeight&&(this.style.fontWeight=e.fontWeight),e.fontStyle&&(this.style.fontStyle=e.fontStyle),e.fontSize&&(this.style.fontSize=e.fontSize),e.textDecoration&&(this.style.textDecoration=e.textDecoration)}formatValue(){if(null==this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);if(this.column.valueFormatter)return this.column.valueFormatter(this.value,this.rowData);switch(this.type){case"text":return this.formatText();case"number":return this.formatNumber();case"currency":return this.formatCurrency();case"percent":return this.formatPercent();case"accounting":return this.formatAccounting();case"scientific":return this.formatScientific();case"fraction":return this.formatFraction();case"date":return this.formatDate();case"boolean":return this.formatBoolean();case"rating":return this.formatRating();case"progress":return this.formatProgress();case"sparkline":return this.formatSparkline();case"duration":return this.formatDuration();case"filesize":return this.formatFilesize();default:return String(this.value)}}formatText(){return String(this.value)}formatNumber(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);let i=t.toFixed(e.decimals??0);if(e.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}return t<0&&"parentheses"===e.negativeStyle&&(i=`(${i.replace("-","")})`),e.prefix&&(i=e.prefix+i),e.suffix&&(i+=e.suffix),i}formatCurrency(){const e=this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:e.decimals??2,maximumFractionDigits:e.decimals??2}).format(t)}formatPercent(){const e=this.column.percentageFormat||this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):`${t.toFixed(e.decimals??2)}%`}formatAccounting(){const e=this.column.numberFormat||{},t=Number(this.value);if(isNaN(t))return String(this.value);let i=Math.abs(t).toFixed(e.decimals??2);if(e.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}return i=t<0?`(${i})`:` ${i} `,i}formatScientific(){const e=this.column.numberFormat||{},t=Number(this.value);return isNaN(t)?String(this.value):t.toExponential(e.decimals??2)}formatFraction(){const e=Number(this.value);if(!Number.isFinite(e))return String(this.value);const t=e<0?-1:1,i=Math.abs(e);let a=0,s=1,n=1,l=0,r=i;for(let e=0;e<32;e++){const e=Math.floor(r),t=e*s+a,o=e*l+n;if(o>1e4)break;if(a=s,s=t,n=l,l=o,Math.abs(i-s/l)<=1e-6)break;const c=r-e;if(c<=Number.EPSILON)break;r=1/c}return`${t*s}/${l||1}`}formatDate(){const e=this.column.dateFormat||{},t=new Date(this.value);if(isNaN(t.getTime()))return String(this.value);if(e.customFormat)return e.customFormat.replace("YYYY",t.getFullYear().toString()).replace("MM",(t.getMonth()+1).toString().padStart(2,"0")).replace("DD",t.getDate().toString().padStart(2,"0"));const i={};switch(e.format){case"short":default:i.dateStyle="short";break;case"medium":i.dateStyle="medium";break;case"long":i.dateStyle="long";break;case"full":i.dateStyle="full"}return new Intl.DateTimeFormat(e.locale||"en-US",i).format(t)}formatBoolean(){const e=this.column.booleanFormat||{},t=Boolean(this.value);return e.useSymbols?t?e.trueSymbol||"✓":e.falseSymbol||"✗":t?e.trueValue||"true":e.falseValue||"false"}formatRating(){const e=this.column.ratingFormat||{},t=Number(this.value),i=e.max||5,a=e.symbol||"★",s=e.emptySymbol||"☆";if(isNaN(t))return String(this.value);let n="";const l=e.color||getComputedStyle(this).getPropertyValue("--snice-color-warning").trim(),r=getComputedStyle(this).getPropertyValue("--snice-color-border").trim();for(let e=0;e<i;e++)n+=e<t?`<span style="color: ${l}">${a}</span>`:`<span style="color: ${r}">${s}</span>`;return n}formatProgress(){const e=this.column.progressFormat||{},t=Number(this.value),i=Math.min(100,Math.max(0,t/(e.max||100)*100));if(isNaN(t))return String(this.value);const a=e.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),s=e.backgroundColor||getComputedStyle(this).getPropertyValue("--snice-color-border").trim();let n=`\n <div style="\n width: 100%; \n height: ${e.height||"1rem"}; \n background-color: ${s}; \n border-radius: 0.25rem; \n overflow: hidden;\n position: relative;\n ">\n <div style="\n width: ${i}%; \n height: 100%; \n background-color: ${a}; \n transition: width 0.3s ease;\n "></div>\n `;return e.showPercentage&&(n+=`\n <span style="\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n font-size: 0.75rem;\n font-weight: bold;\n color: ${i>50?getComputedStyle(this).getPropertyValue("--snice-color-text-inverse").trim():getComputedStyle(this).getPropertyValue("--snice-color-text").trim()};\n ">${Math.round(i)}%</span>\n `),n+="</div>",n}formatSparkline(){const e=this.column.sparklineFormat||{},t=Array.isArray(this.value)?this.value:[];if(0===t.length)return"";const i=e.width||60,a=e.height||20,s=e.color||getComputedStyle(this).getPropertyValue("--snice-color-primary").trim(),n=e.type||"line",l=Math.max(...t),r=Math.min(...t),o=l-r||1;if("line"===n){const e=t.map((e,s)=>`${s/(t.length-1)*i},${a-(e-r)/o*a}`).join(" ");return`\n <svg width="${i}" height="${a}" style="display: block;">\n <polyline \n points="${e}" \n fill="none" \n stroke="${s}" \n stroke-width="2"\n />\n </svg>\n `}if("bar"===n){const e=i/t.length,n=t.map((t,i)=>{const n=(t-r)/o*a;return`<rect x="${i*e}" y="${a-n}" width="${e-1}" height="${n}" fill="${s}" />`}).join("");return`\n <svg width="${i}" height="${a}" style="display: block;">\n ${n}\n </svg>\n `}return String(this.value)}formatDuration(){const e=Number(this.value);if(isNaN(e))return String(this.value);const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=e%60;return t>0?`${t}:${i.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`:`${i}:${a.toString().padStart(2,"0")}`}formatFilesize(){const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let i=e,a=0;for(;i>=1024&&a<t.length-1;)i/=1024,a++;return`${i.toFixed(0===a?0:1)} ${t[a]}`}constructor(){super(...arguments),this.align=(w(this,A),w(this,R,"left")),this.type=(w(this,M),w(this,z,"text")),this.value=(w(this,$),w(this,F,"")),this.column=(w(this,I),w(this,T,{key:"",label:"",type:"text",align:"left"})),this.rowData=(w(this,L),w(this,V,null)),this.contentElement=(w(this,B),w(this,O,void 0)),w(this,j)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S,E,D=[i("snice-cell-text")],A=[],R=HTMLElement,M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[];(class extends R{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(R[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[s({type:Boolean})],v=[s({type:Number,attribute:"max-lines"})],k=[l()],x=[r()],C=[o()],S=[d("align")],E=[d("value","column")],y(this,null,k,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,M),y(this,null,x,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,M),y(this,null,C,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,M),y(this,null,S,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,M),y(this,null,E,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,M),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},z,$),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},F,I),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},T,L),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},V,B),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},O,j),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},P,N),y(null,null,f,{kind:"field",name:"multiline",static:!1,private:!1,access:{has:e=>"multiline"in e,get:e=>e.multiline,set:(e,t)=>{e.multiline=t}},metadata:e},H,q),y(null,null,v,{kind:"field",name:"maxLines",static:!1,private:!1,access:{has:e=>"maxLines"in e,get:e=>e.maxLines,set:(e,t)=>{e.maxLines=t}},metadata:e},_,G),y(null,t={value:a},D,{kind:"class",name:a.name,metadata:e},null,A),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,A)}render(){const t=this.formatTextContent(),i=this.getTextStyles();return e`
|
|
348
348
|
<div class="cell-content cell-content--text" part="content" style="${i}">
|
|
349
349
|
${t}
|
|
350
350
|
</div>
|
|
351
|
-
`}styles(){return m`${
|
|
351
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatTextContent(),t=this.getTextStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatTextContent(){if(null==this.value)return"";let e=String(this.value);return this.column.formatter&&(e=this.column.formatter(this.value,this.rowData)),this.multiline&&(e=e.replace(/\n/g,"<br>")),e}getTextStyles(){let e=[];return this.multiline?(this.column.wrap&&(e.push("white-space: pre-wrap"),e.push("word-wrap: break-word")),this.maxLines&&(e.push("display: -webkit-box"),e.push("-webkit-box-orient: vertical"),e.push(`-webkit-line-clamp: ${this.maxLines}`),e.push("overflow: hidden"))):(e.push("white-space: nowrap"),this.column.ellipsis&&(e.push("overflow: hidden"),e.push("text-overflow: ellipsis"))),e.join("; ")}constructor(){super(...arguments),this.align=(w(this,M),w(this,z,"left")),this.type=(w(this,$),w(this,F,"text")),this.value=(w(this,I),w(this,T,"")),this.column=(w(this,L),w(this,V,{key:"",label:"",type:"text",align:"left"})),this.rowData=(w(this,B),w(this,O,null)),this.contentElement=(w(this,j),w(this,P,void 0)),this.multiline=(w(this,N),w(this,H,!1)),this.maxLines=(w(this,q),w(this,_,void 0)),w(this,G)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z=[i("snice-cell-number")],$=[],F=HTMLElement,I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],te=[],ie=[],ae=[],ne=[];(class extends F{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(F[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[s({type:Number})],v=[s({type:Boolean,attribute:"thousands-separator"})],k=[s({})],x=[s({})],C=[s({attribute:"negative-style"})],S=[s({type:Boolean})],E=[l()],D=[r()],A=[o()],R=[d("align")],M=[d("value","column")],y(this,null,E,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,I),y(this,null,D,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,I),y(this,null,A,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,I),y(this,null,R,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,I),y(this,null,M,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,I),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},T,L),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},V,B),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},O,j),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},P,N),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},H,q),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},_,G),y(null,null,f,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:e},K,W),y(null,null,v,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:e},U,Z),y(null,null,k,{kind:"field",name:"prefix",static:!1,private:!1,access:{has:e=>"prefix"in e,get:e=>e.prefix,set:(e,t)=>{e.prefix=t}},metadata:e},Y,J),y(null,null,x,{kind:"field",name:"suffix",static:!1,private:!1,access:{has:e=>"suffix"in e,get:e=>e.suffix,set:(e,t)=>{e.suffix=t}},metadata:e},Q,X),y(null,null,C,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:e},te,ie),y(null,null,S,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:e=>"highlight"in e,get:e=>e.highlight,set:(e,t)=>{e.highlight=t}},metadata:e},ae,ne),y(null,t={value:a},z,{kind:"class",name:a.name,metadata:e},null,$),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,$)}render(){const t=this.formatNumberValue(),i=this.getNumberStyles();return e`
|
|
352
352
|
<div class="cell-content cell-content--number" part="content" style="${i}">
|
|
353
353
|
${t}
|
|
354
354
|
</div>
|
|
355
|
-
`}styles(){return m`${
|
|
355
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatNumberValue(),t=this.getNumberStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatNumberValue(){if(null==this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.numberFormat||{decimals:this.decimals,thousandsSeparator:this.thousandsSeparator,prefix:this.prefix,suffix:this.suffix,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);let i=t.toFixed(e.decimals??this.decimals);if(e.thousandsSeparator??this.thousandsSeparator){const e=i.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i=e.join(".")}if(t<0){const t=e.negativeStyle??this.negativeStyle;"parentheses"===t?i=`(${i.replace("-","")})`:"red"===t&&(i=i.replace("-",""))}const a=e.prefix??this.prefix,s=e.suffix??this.suffix;return a&&(i=a+i),s&&(i+=s),i}getNumberStyles(){const e=Number(this.value);return this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0?(this.classList.add("number--negative"),"red"===(this.column.numberFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")):e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero"),"text-align: right"}constructor(){super(...arguments),this.align=(w(this,I),w(this,T,"right")),this.type=(w(this,L),w(this,V,"number")),this.value=(w(this,B),w(this,O,"")),this.column=(w(this,j),w(this,P,{key:"",label:"",type:"number",align:"right"})),this.rowData=(w(this,N),w(this,H,null)),this.contentElement=(w(this,q),w(this,_,void 0)),this.decimals=(w(this,G),w(this,K,0)),this.thousandsSeparator=(w(this,W),w(this,U,!1)),this.prefix=(w(this,Z),w(this,Y,"")),this.suffix=(w(this,J),w(this,Q,"")),this.negativeStyle=(w(this,X),w(this,te,"minus")),this.highlight=(w(this,ie),w(this,ae,!1)),w(this,ne)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A,R,M=[i("snice-cell-date")],z=[],$=HTMLElement,F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],te=[];(class extends ${static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create($[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[s({attribute:"date-format"})],v=[s({attribute:"custom-format"})],k=[s({})],x=[s({type:Boolean,attribute:"relative-time"})],C=[s({type:Boolean,attribute:"show-time"})],S=[l()],E=[r()],D=[o()],A=[d("align")],R=[d("value","column")],y(this,null,S,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,F),y(this,null,E,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,F),y(this,null,D,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,F),y(this,null,A,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,F),y(this,null,R,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,F),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},I,T),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},L,V),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},B,O),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},j,P),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},N,H),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},q,_),y(null,null,f,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:e},G,K),y(null,null,v,{kind:"field",name:"customFormat",static:!1,private:!1,access:{has:e=>"customFormat"in e,get:e=>e.customFormat,set:(e,t)=>{e.customFormat=t}},metadata:e},W,U),y(null,null,k,{kind:"field",name:"locale",static:!1,private:!1,access:{has:e=>"locale"in e,get:e=>e.locale,set:(e,t)=>{e.locale=t}},metadata:e},Z,Y),y(null,null,x,{kind:"field",name:"relativeTime",static:!1,private:!1,access:{has:e=>"relativeTime"in e,get:e=>e.relativeTime,set:(e,t)=>{e.relativeTime=t}},metadata:e},J,Q),y(null,null,C,{kind:"field",name:"showTime",static:!1,private:!1,access:{has:e=>"showTime"in e,get:e=>e.showTime,set:(e,t)=>{e.showTime=t}},metadata:e},X,te),y(null,t={value:a},M,{kind:"class",name:a.name,metadata:e},null,z),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,z)}render(){const t=this.formatDateValue(),i=this.getDateStyles();return e`
|
|
356
356
|
<div class="cell-content cell-content--date" part="content" style="${i}">
|
|
357
357
|
${t}
|
|
358
358
|
</div>
|
|
359
|
-
`}styles(){return m`${
|
|
359
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatDateValue(),t=this.getDateStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatDateValue(){if(null==this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=new Date(this.value);if(isNaN(e.getTime()))return String(this.value);if(this.relativeTime)return this.formatRelativeTime(e);const t=this.column.dateFormat||{format:this.dateFormat,customFormat:this.customFormat,locale:this.locale};if(t.customFormat||this.customFormat)return this.formatCustomDate(e,t.customFormat||this.customFormat);const i={};switch(t.format??this.dateFormat){case"short":i.dateStyle="short";break;case"medium":i.dateStyle="medium";break;case"long":i.dateStyle="long";break;case"full":i.dateStyle="full"}return this.showTime&&(i.timeStyle="short"),new Intl.DateTimeFormat(t.locale??this.locale,i).format(e)}formatCustomDate(e,t){const i={YYYY:e.getFullYear().toString(),YY:e.getFullYear().toString().slice(-2),MM:(e.getMonth()+1).toString().padStart(2,"0"),M:(e.getMonth()+1).toString(),DD:e.getDate().toString().padStart(2,"0"),D:e.getDate().toString(),HH:e.getHours().toString().padStart(2,"0"),H:e.getHours().toString(),mm:e.getMinutes().toString().padStart(2,"0"),m:e.getMinutes().toString(),ss:e.getSeconds().toString().padStart(2,"0"),s:e.getSeconds().toString()};let a=t;for(const[e,t]of Object.entries(i))a=a.replace(new RegExp(e,"g"),t);return a}formatRelativeTime(e){const t=(new Date).getTime()-e.getTime(),i=Math.floor(t/1e3),a=Math.floor(i/60),s=Math.floor(a/60),n=Math.floor(s/24);return i<60?"Just now":a<60?`${a} minute${1===a?"":"s"} ago`:s<24?`${s} hour${1===s?"":"s"} ago`:n<7?`${n} day${1===n?"":"s"} ago`:new Intl.DateTimeFormat(this.locale,{dateStyle:"short"}).format(e)}getDateStyles(){const e=new Date(this.value),t=new Date,i=e.toDateString()===t.toDateString(),a=e<t,s=e>t;return this.classList.remove("date--today","date--past","date--future"),i?this.classList.add("date--today"):a?this.classList.add("date--past"):s&&this.classList.add("date--future"),""}constructor(){super(...arguments),this.align=(w(this,F),w(this,I,"left")),this.type=(w(this,T),w(this,L,"date")),this.value=(w(this,V),w(this,B,"")),this.column=(w(this,O),w(this,j,{key:"",label:"",type:"date",align:"left"})),this.rowData=(w(this,P),w(this,N,null)),this.contentElement=(w(this,H),w(this,q,void 0)),this.dateFormat=(w(this,_),w(this,G,"short")),this.customFormat=(w(this,K),w(this,W,void 0)),this.locale=(w(this,U),w(this,Z,"en-US")),this.relativeTime=(w(this,Y),w(this,J,!1)),this.showTime=(w(this,Q),w(this,X,!1)),w(this,te)}})})(),(()=>{let a,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z=[i("snice-cell-boolean")],$=[],F=HTMLElement,I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],te=[],ie=[];(class extends F{static{c=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(F[Symbol.metadata]??null):void 0;h=[s({})],u=[s({})],p=[s({})],g=[s({type:Object,attribute:!1})],b=[s({type:Object,attribute:!1})],f=[n(".cell-content")],v=[s({attribute:"true-value"})],k=[s({attribute:"false-value"})],x=[s({type:Boolean,attribute:"use-symbols"})],C=[s({attribute:"true-symbol"})],S=[s({attribute:"false-symbol"})],E=[l()],D=[r()],A=[o()],R=[d("align")],M=[d("value","column")],y(this,null,E,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,I),y(this,null,D,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,I),y(this,null,A,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,I),y(this,null,R,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,I),y(this,null,M,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,I),y(null,null,h,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},T,L),y(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},V,B),y(null,null,p,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},O,j),y(null,null,g,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},P,N),y(null,null,b,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},H,q),y(null,null,f,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},_,G),y(null,null,v,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:e},K,W),y(null,null,k,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:e},U,Z),y(null,null,x,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:e},Y,J),y(null,null,C,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:e},Q,X),y(null,null,S,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:e},te,ie),y(null,a={value:c},z,{kind:"class",name:c.name,metadata:e},null,$),c=a.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,$)}render(){const i=this.formatBooleanContent();return e`
|
|
360
360
|
<div class="cell-content cell-content--boolean" part="content">
|
|
361
361
|
${t(i)}
|
|
362
362
|
</div>
|
|
363
|
-
`}styles(){return m`${
|
|
363
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatBooleanContent();this.contentElement.innerHTML=e}}formatBooleanContent(){if(null==this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.booleanFormat||{trueValue:this.trueValue,falseValue:this.falseValue,useSymbols:this.useSymbols,trueSymbol:this.trueSymbol,falseSymbol:this.falseSymbol},t=Boolean(this.value);if(e.useSymbols??this.useSymbols){const i=e.trueSymbol??this.trueSymbol,a=e.falseSymbol??this.falseSymbol,s=t?"boolean--true":"boolean--false";return t&&"svg"===i?`<span class="${s}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"><polyline points="3.5 8.5 6.5 11.5 12.5 4.5"/></svg></span>`:t||"svg"!==a?`<span class="${s}">${t?i:a}</span>`:`<span class="${s}"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="square"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span>`}return`<span class="${t?"boolean--true":"boolean--false"}">${t?e.trueValue??this.trueValue:e.falseValue??this.falseValue}</span>`}constructor(){super(...arguments),this.align=(w(this,I),w(this,T,"center")),this.type=(w(this,L),w(this,V,"boolean")),this.value=(w(this,B),w(this,O,!1)),this.column=(w(this,j),w(this,P,{key:"",label:"",type:"boolean",align:"center"})),this.rowData=(w(this,N),w(this,H,null)),this.contentElement=(w(this,q),w(this,_,void 0)),this.trueValue=(w(this,G),w(this,K,"true")),this.falseValue=(w(this,W),w(this,U,"false")),this.useSymbols=(w(this,Z),w(this,Y,!0)),this.trueSymbol=(w(this,J),w(this,Q,"svg")),this.falseSymbol=(w(this,X),w(this,te,"svg")),w(this,ie)}})})(),(()=>{let t,a,n,o,c,d,u,p,g,b,f,v,k=[i("snice-rating")],x=[],C=HTMLElement,S=[],E=[],D=[],A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[];(class extends C{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(C[Symbol.metadata]??null):void 0;n=[s({type:Number})],o=[s({type:Number})],c=[s()],d=[s({attribute:"empty-icon"})],u=[s()],p=[s({type:Boolean})],g=[s()],b=[h("rating-change",{bubbles:!0,composed:!0})],f=[l()],v=[r()],y(this,null,b,{kind:"method",name:"emitRatingChange",static:!1,private:!1,access:{has:e=>"emitRatingChange"in e,get:e=>e.emitRatingChange},metadata:e},null,S),y(this,null,f,{kind:"method",name:"template",static:!1,private:!1,access:{has:e=>"template"in e,get:e=>e.template},metadata:e},null,S),y(this,null,v,{kind:"method",name:"componentStyles",static:!1,private:!1,access:{has:e=>"componentStyles"in e,get:e=>e.componentStyles},metadata:e},null,S),y(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},E,D),y(null,null,o,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:e},A,R),y(null,null,c,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},M,z),y(null,null,d,{kind:"field",name:"emptyIcon",static:!1,private:!1,access:{has:e=>"emptyIcon"in e,get:e=>e.emptyIcon,set:(e,t)=>{e.emptyIcon=t}},metadata:e},$,F),y(null,null,u,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},I,T),y(null,null,p,{kind:"field",name:"readonly",static:!1,private:!1,access:{has:e=>"readonly"in e,get:e=>e.readonly,set:(e,t)=>{e.readonly=t}},metadata:e},L,V),y(null,null,g,{kind:"field",name:"precision",static:!1,private:!1,access:{has:e=>"precision"in e,get:e=>e.precision,set:(e,t)=>{e.precision=t}},metadata:e},B,O),y(null,t={value:a},k,{kind:"class",name:a.name,metadata:e},null,x),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,x)}emitRatingChange(){return{value:this.value}}handleClick(e,t){if(!this.readonly){if("half"===this.precision){const i=t.currentTarget.getBoundingClientRect();this.value=t.clientX-i.left<i.width/2?e+.5:e+1}else this.value=e+1;this.emitRatingChange()}}handleKeydown(e){if(this.readonly)return;const t="half"===this.precision?.5:1;"ArrowRight"===e.key||"ArrowUp"===e.key?(e.preventDefault(),this.value=Math.min(this.max,this.value+t),this.emitRatingChange()):"ArrowLeft"!==e.key&&"ArrowDown"!==e.key||(e.preventDefault(),this.value=Math.max(0,this.value-t),this.emitRatingChange())}getStarFill(e){const t=this.value-e;return t>=1?100:t<=0?0:Math.round(100*t)}template(){const t=Array.from({length:this.max},(t,i)=>{const a=this.getStarFill(i);return e`
|
|
364
364
|
<span part="star" class="star"
|
|
365
365
|
role="radio"
|
|
366
366
|
aria-checked="${a>0?"true":"false"}"
|
|
367
367
|
aria-label="${`${i+1} of ${this.max}`}"
|
|
368
368
|
@click=${e=>this.handleClick(i,e)}>
|
|
369
|
-
<span class="star-empty">${
|
|
370
|
-
<span class="star-full" style="clip-path: inset(0 ${100-a}% 0 0)">${
|
|
369
|
+
<span class="star-empty">${H(this.emptyIcon||this.icon,"star-glyph")}</span>
|
|
370
|
+
<span class="star-full" style="clip-path: inset(0 ${100-a}% 0 0)">${H(this.icon,"star-glyph")}</span>
|
|
371
371
|
</span>
|
|
372
372
|
`});return e`
|
|
373
373
|
<div part="base" class="rating"
|
|
@@ -377,11 +377,11 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
377
377
|
@keydown=${this.handleKeydown}>
|
|
378
378
|
${t}
|
|
379
379
|
</div>
|
|
380
|
-
`}componentStyles(){return m`${":host{display:inline-flex;align-items:center;gap:var(--snice-spacing-2xs,.25rem);font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);--rating-color:rgb(245 158 11);--rating-color-empty:var(--snice-color-text-tertiary, rgb(115 115 115));--rating-size:1.5rem}:host([size=small]){--rating-size:1rem;gap:var(--snice-spacing-3xs,.125rem)}:host([size=large]){--rating-size:2rem;gap:var(--snice-spacing-xs,.5rem)}.rating{display:inline-flex;align-items:center;gap:inherit}.star{position:relative;width:var(--rating-size);height:var(--rating-size);font-size:var(--rating-size);line-height:1;cursor:pointer;user-select:none;transition:transform var(--snice-transition-fast, 150ms) ease}:host([readonly]) .star{cursor:default}.star:not(:host([readonly]) .star):hover{transform:scale(1.2)}.star-empty,.star-full{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.star-empty{color:var(--rating-color-empty)}.star-full{color:var(--rating-color)}:host(:focus-visible){outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(59 130 246 / .5));outline-offset:var(--snice-focus-ring-offset,2px);border-radius:var(--snice-border-radius-md,.25rem)}.star-glyph{display:inline-flex}.star-glyph svg{width:1em;height:1em;display:block}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}constructor(){super(...arguments),this.value=(w(this,S),w(this,E,0)),this.max=(w(this,D),w(this,A,5)),this.icon=(w(this,R),w(this,M,"star")),this.emptyIcon=(w(this,z),w(this
|
|
380
|
+
`}componentStyles(){return m`${":host{display:inline-flex;align-items:center;gap:var(--snice-spacing-2xs,.25rem);font-family:var(--snice-font-family, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif);--rating-color:rgb(245 158 11);--rating-color-empty:var(--snice-color-text-tertiary, rgb(115 115 115));--rating-size:1.5rem}:host([size=small]){--rating-size:1rem;gap:var(--snice-spacing-3xs,.125rem)}:host([size=large]){--rating-size:2rem;gap:var(--snice-spacing-xs,.5rem)}.rating{display:inline-flex;align-items:center;gap:inherit}.star{position:relative;width:var(--rating-size);height:var(--rating-size);font-size:var(--rating-size);line-height:1;cursor:pointer;user-select:none;transition:transform var(--snice-transition-fast, 150ms) ease}:host([readonly]) .star{cursor:default}.star:not(:host([readonly]) .star):hover{transform:scale(1.2)}.star-empty,.star-full{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center}.star-empty{color:var(--rating-color-empty)}.star-full{color:var(--rating-color)}:host(:focus-visible){outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(59 130 246 / .5));outline-offset:var(--snice-focus-ring-offset,2px);border-radius:var(--snice-border-radius-md,.25rem)}.star-glyph{display:inline-flex}.star-glyph svg{width:1em;height:1em;display:block}@media (prefers-reduced-motion:reduce){*{transition-duration:0s!important;animation-duration:0s!important}}"}`}constructor(){super(...arguments),this.value=(w(this,S),w(this,E,0)),this.max=(w(this,D),w(this,A,5)),this.icon=(w(this,R),w(this,M,"star")),this.emptyIcon=(w(this,z),w(this,$,"")),this.size=(w(this,F),w(this,I,"medium")),this.readonly=(w(this,T),w(this,L,!1)),this.precision=(w(this,V),w(this,B,"full")),w(this,O)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S=[i("snice-cell-rating")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[l()],v=[r()],k=[o()],x=[d("align")],C=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,A),y(this,null,C,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,A),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){return e`
|
|
381
381
|
<div class="cell-content cell-content--rating" part="content">
|
|
382
382
|
<!-- Rating component will be created here -->
|
|
383
383
|
</div>
|
|
384
|
-
`}styles(){return m`${
|
|
384
|
+
`}styles(){return m`${ee}`}init(){se(this,!0),this.applyAlignment(),this.createRatingElement()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.createRatingElement()}createRatingElement(){if(!this.contentElement)return;this.contentElement.innerHTML="";const e=document.createElement("snice-rating");e.value=Number(this.value)||0;const t=this.column.ratingFormat||{};e.max=t.max??5,t.symbol&&(e.icon=t.symbol),t.emptySymbol&&(e.emptyIcon=t.emptySymbol),e.size="small",e.readonly=!0,e.precision="half",t.color&&e.style.setProperty("--rating-color",t.color),this.contentElement.appendChild(e)}constructor(){super(...arguments),this.align=(w(this,A),w(this,R,"center")),this.type=(w(this,M),w(this,z,"rating")),this.value=(w(this,$),w(this,F,0)),this.column=(w(this,I),w(this,T,{key:"",label:"",type:"rating",align:"center"})),this.rowData=(w(this,L),w(this,V,null)),this.contentElement=(w(this,B),w(this,O,void 0)),w(this,j)}})})(),(()=>{let t,a,n,o,c,d,h,u,p,g,b=[i("snice-table-progress")],f=[],v=HTMLElement,k=[],x=[],C=[],S=[],E=[],D=[],A=[],R=[],M=[],z=[],$=[],F=[],I=[];(class extends v{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(v[Symbol.metadata]??null):void 0;n=[s({type:Number})],o=[s({type:Number})],c=[s()],d=[s()],h=[s()],u=[s({type:Boolean})],p=[l()],g=[r()],y(this,null,p,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,k),y(this,null,g,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,k),y(null,null,n,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},x,C),y(null,null,o,{kind:"field",name:"max",static:!1,private:!1,access:{has:e=>"max"in e,get:e=>e.max,set:(e,t)=>{e.max=t}},metadata:e},S,E),y(null,null,c,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:e},D,A),y(null,null,d,{kind:"field",name:"backgroundColor",static:!1,private:!1,access:{has:e=>"backgroundColor"in e,get:e=>e.backgroundColor,set:(e,t)=>{e.backgroundColor=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height,set:(e,t)=>{e.height=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:e=>"showPercentage"in e,get:e=>e.showPercentage,set:(e,t)=>{e.showPercentage=t}},metadata:e},F,I),y(null,t={value:a},b,{kind:"class",name:a.name,metadata:e},null,f),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,f)}render(){const t=Math.min(100,this.value/this.max*100);return e`
|
|
385
385
|
<div class="progress-container">
|
|
386
386
|
<div class="progress-bar" style="width: ${t}%"></div>
|
|
387
387
|
</div>
|
|
@@ -415,43 +415,43 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
415
415
|
color: #6b7280;
|
|
416
416
|
min-width: 2.1875rem; /* 35px */
|
|
417
417
|
}
|
|
418
|
-
`}constructor(){super(...arguments),this.value=(w(this,k),w(this,x,0)),this.max=(w(this,C),w(this,S,100)),this.color=(w(this,E),w(this,D,"#3b82f6")),this.backgroundColor=(w(this,A),w(this,R,"#e5e7eb")),this.height=(w(this,M),w(this,z,"0.5rem")),this.showPercentage=(w(this
|
|
418
|
+
`}constructor(){super(...arguments),this.value=(w(this,k),w(this,x,0)),this.max=(w(this,C),w(this,S,100)),this.color=(w(this,E),w(this,D,"#3b82f6")),this.backgroundColor=(w(this,A),w(this,R,"#e5e7eb")),this.height=(w(this,M),w(this,z,"0.5rem")),this.showPercentage=(w(this,$),w(this,F,!1)),w(this,I)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S=[i("snice-cell-progress")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({type:Object})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[l()],v=[r()],k=[o()],x=[d("align")],C=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,A),y(this,null,C,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,A),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){return e`
|
|
419
419
|
<div class="cell-content cell-content--progress" part="content">
|
|
420
420
|
<!-- Progress component will be created here -->
|
|
421
421
|
</div>
|
|
422
|
-
`}styles(){return m`${
|
|
422
|
+
`}styles(){return m`${ee}`}init(){se(this,!0),this.applyAlignment(),this.createProgressElement()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.createProgressElement()}createProgressElement(){if(!this.contentElement)return;let e;this.contentElement.innerHTML="";let t=null;if(this.value&&"object"==typeof this.value)e=Number(this.value.value)||0,t=this.value.color||null;else if("string"==typeof this.value&&this.value.startsWith("{"))try{const i=JSON.parse(this.value);e=Number(i.value)||0,t=i.color||null}catch{e=Number(this.value)||0}else e=Number(this.value)||0;const i=document.createElement("snice-table-progress");i.value=e;const a=this.column.progressFormat||{},s=a.max??100;if(i.max=s,i.backgroundColor=a.backgroundColor??getComputedStyle(this).getPropertyValue("--snice-color-border").trim(),i.height=a.height??"0.5rem",i.showPercentage=a.showPercentage??!1,t)i.color=t;else if(a.colorize){const t=e/s*100;i.color=t>=70?"#22c55e":t>=40?"#eab308":"#ef4444"}else i.color=a.color??getComputedStyle(this).getPropertyValue("--snice-color-primary").trim();this.contentElement.appendChild(i)}constructor(){super(...arguments),this.align=(w(this,A),w(this,R,"left")),this.type=(w(this,M),w(this,z,"progress")),this.value=(w(this,$),w(this,F,0)),this.column=(w(this,I),w(this,T,{key:"",label:"",type:"progress",align:"left"})),this.rowData=(w(this,L),w(this,V,null)),this.contentElement=(w(this,B),w(this,O,void 0)),w(this,j)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S=[i("snice-cell-duration")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[l()],v=[r()],k=[o()],x=[d("align")],C=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,A),y(this,null,C,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,A),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){const t=this.formatDuration();return e`
|
|
423
423
|
<div class="cell-content cell-content--duration" part="content">
|
|
424
424
|
${t}
|
|
425
425
|
</div>
|
|
426
|
-
`}styles(){return m`${
|
|
426
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatDuration();this.contentElement.innerHTML=e}}formatDuration(){if(null==this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=Number(this.value);if(isNaN(e))return String(this.value);const t=Math.floor(e/3600),i=Math.floor(e%3600/60),a=Math.floor(e%60);return t>0?`${t}h ${i}m ${a}s`:i>0?`${i}m ${a}s`:`${a}s`}constructor(){super(...arguments),this.align=(w(this,A),w(this,R,"right")),this.type=(w(this,M),w(this,z,"duration")),this.value=(w(this,$),w(this,F,0)),this.column=(w(this,I),w(this,T,{key:"",label:"",type:"duration",align:"right"})),this.rowData=(w(this,L),w(this,V,null)),this.contentElement=(w(this,B),w(this,O,void 0)),w(this,j)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S=[i("snice-cell-filesize")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;c=[s({})],h=[s({})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[l()],v=[r()],k=[o()],x=[d("align")],C=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,A),y(this,null,C,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,A),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},R,M),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){const t=this.formatFileSize();return e`
|
|
427
427
|
<div class="cell-content cell-content--filesize" part="content">
|
|
428
428
|
${t}
|
|
429
429
|
</div>
|
|
430
|
-
`}styles(){return m`${
|
|
430
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatFileSize();this.contentElement.innerHTML=e}}formatFileSize(){if(null==this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=Number(this.value);if(isNaN(e))return String(this.value);const t=["B","KB","MB","GB","TB"];let i=e,a=0;for(;i>=1024&&a<t.length-1;)i/=1024,a++;return`${i.toFixed(1)} ${t[a]}`}constructor(){super(...arguments),this.align=(w(this,A),w(this,R,"right")),this.type=(w(this,M),w(this,z,"filesize")),this.value=(w(this,$),w(this,F,0)),this.column=(w(this,I),w(this,T,{key:"",label:"",type:"filesize",align:"right"})),this.rowData=(w(this,L),w(this,V,null)),this.contentElement=(w(this,B),w(this,O,void 0)),w(this,j)}})})(),(()=>{let a,c,h,u,p,g,b,f,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B=[i("snice-cell-sparkline")],O=[],j=HTMLElement,P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],te=[],ie=[],ae=[],ne=[],le=[],re=[],oe=[],ce=[],de=[],he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[];(class extends j{static{c=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(j[Symbol.metadata]??null):void 0;h=[s({})],u=[s({})],p=[s({})],g=[s({type:Object,attribute:!1})],b=[s({type:Object,attribute:!1})],f=[n(".cell-content")],k=[s({attribute:"chart-type"})],x=[s({})],C=[s({type:Number})],S=[s({type:Number})],E=[s({type:Boolean,attribute:"show-dots"})],D=[s({type:Boolean,attribute:"show-baseline"})],A=[s({type:Number,attribute:"stroke-width"})],R=[s({type:Number,attribute:"min-value"})],M=[s({type:Number,attribute:"max-value"})],z=[s({type:v})],$=[l()],F=[r()],I=[o()],T=[d("align")],L=[d("value","data","column")],V=[d("value","data","chartType","color","width","height","showDots","showBaseline","strokeWidth","minValue","maxValue")],y(this,null,$,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,P),y(this,null,F,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,P),y(this,null,I,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,P),y(this,null,T,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,P),y(this,null,L,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,P),y(this,null,V,{kind:"method",name:"updateSparkline",static:!1,private:!1,access:{has:e=>"updateSparkline"in e,get:e=>e.updateSparkline},metadata:e},null,P),y(null,null,h,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},N,H),y(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},q,_),y(null,null,p,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},G,K),y(null,null,g,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},W,U),y(null,null,b,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},Z,Y),y(null,null,f,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},J,Q),y(null,null,k,{kind:"field",name:"chartType",static:!1,private:!1,access:{has:e=>"chartType"in e,get:e=>e.chartType,set:(e,t)=>{e.chartType=t}},metadata:e},X,te),y(null,null,x,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:e},ie,ae),y(null,null,C,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:e},ne,le),y(null,null,S,{kind:"field",name:"height",static:!1,private:!1,access:{has:e=>"height"in e,get:e=>e.height,set:(e,t)=>{e.height=t}},metadata:e},re,oe),y(null,null,E,{kind:"field",name:"showDots",static:!1,private:!1,access:{has:e=>"showDots"in e,get:e=>e.showDots,set:(e,t)=>{e.showDots=t}},metadata:e},ce,de),y(null,null,D,{kind:"field",name:"showBaseline",static:!1,private:!1,access:{has:e=>"showBaseline"in e,get:e=>e.showBaseline,set:(e,t)=>{e.showBaseline=t}},metadata:e},he,ue),y(null,null,A,{kind:"field",name:"strokeWidth",static:!1,private:!1,access:{has:e=>"strokeWidth"in e,get:e=>e.strokeWidth,set:(e,t)=>{e.strokeWidth=t}},metadata:e},me,pe),y(null,null,R,{kind:"field",name:"minValue",static:!1,private:!1,access:{has:e=>"minValue"in e,get:e=>e.minValue,set:(e,t)=>{e.minValue=t}},metadata:e},ge,be),y(null,null,M,{kind:"field",name:"maxValue",static:!1,private:!1,access:{has:e=>"maxValue"in e,get:e=>e.maxValue,set:(e,t)=>{e.maxValue=t}},metadata:e},fe,ve),y(null,null,z,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:e},ye,we),y(null,a={value:c},B,{kind:"class",name:c.name,metadata:e},null,O),c=a.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,O)}render(){return e`
|
|
431
431
|
<div class="cell-content cell-content--sparkline" part="content">
|
|
432
432
|
${t(this.renderSparkline())}
|
|
433
433
|
</div>
|
|
434
|
-
`}styles(){return m`${
|
|
434
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment(),this.updateSparkline()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}updateSparkline(){this.contentElement&&(this.contentElement.innerHTML=this.renderSparkline())}renderSparkline(){if(null==this.value&&(!this.data||0===this.data.length))return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.parseData();if(0===e.length)return`<span style="color: ${getComputedStyle(this).getPropertyValue("--snice-color-text-secondary").trim()}; font-style: italic;">No data</span>`;const t=this.column.sparklineFormat||{type:this.chartType,color:this.color,width:this.width,height:this.height},i=t.width??this.width,a=t.height??this.height;let s=null;if(this.value&&"object"==typeof this.value&&!Array.isArray(this.value))s=this.value.color||null;else if("string"==typeof this.value&&this.value.startsWith("{"))try{s=JSON.parse(this.value).color||null}catch{}return this.createCanvas(e,i,a,s??t.color??this.color,t.type??this.chartType,{showDots:t.showDots??this.showDots,showBaseline:t.showBaseline??this.showBaseline,strokeWidth:t.strokeWidth??this.strokeWidth,minValue:t.minValue??this.minValue,maxValue:t.maxValue??this.maxValue})}parseData(){if(this.data&&Array.isArray(this.data)&&this.data.length>0)return this.data.map(e=>Number(e)).filter(e=>!isNaN(e));if(Array.isArray(this.value))return this.value.map(e=>Number(e)).filter(e=>!isNaN(e));if(this.value&&"object"==typeof this.value&&!Array.isArray(this.value)&&Array.isArray(this.value.values))return this.value.values.map(e=>Number(e)).filter(e=>!isNaN(e));if("string"==typeof this.value){if(this.value.startsWith("{"))try{const e=JSON.parse(this.value);if(e&&Array.isArray(e.values))return e.values.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}if(this.value.startsWith("[")&&this.value.endsWith("]"))try{const e=JSON.parse(this.value);if(Array.isArray(e))return e.map(e=>Number(e)).filter(e=>!isNaN(e))}catch{}try{return this.value.split(",").map(e=>Number(e.trim())).filter(e=>!isNaN(e))}catch{return[]}}return[]}createCanvas(e,t,i,a,s,n){if(0===e.length)return"";const l=document.createElement("canvas");l.width=t,l.height=i;const r=l.getContext("2d");if(!r)return'<div style="color: red;">Canvas not supported</div>';const o=t-4,c=i-4,d=n.minValue??Math.min(...e),h=n.maxValue??Math.max(...e),u=h-d||1;r.clearRect(0,0,t,i);let m=a;if(a.startsWith("var(")){const e=a.match(/var\(([^)]+)\)/);e&&(m=getComputedStyle(this).getPropertyValue(e[1].split(",")[0].trim()).trim()||"#3b82f6")}r.strokeStyle=m,r.fillStyle=m,r.lineWidth=n.strokeWidth,r.lineCap="round",r.lineJoin="round";const p=2+c-(Math.min(h,Math.max(d,0))-d)/u*c;if(n.showBaseline&&(r.save(),r.globalAlpha=.35,r.lineWidth=1,r.beginPath(),r.moveTo(2,p),r.lineTo(t-2,p),r.stroke(),r.restore()),"line"===s||"area"===s){const t=e.map((t,i)=>[1===e.length?2+o/2:2+i/(e.length-1)*o,2+c-(t-d)/u*c]);"area"===s&&(r.beginPath(),r.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>r.lineTo(e,t)),r.lineTo(t[t.length-1][0],i-2),r.lineTo(t[0][0],i-2),r.closePath(),r.globalAlpha=.3,r.fill(),r.globalAlpha=1),r.beginPath(),r.moveTo(t[0][0],t[0][1]),t.forEach(([e,t])=>r.lineTo(e,t)),r.stroke(),n.showDots&&t.forEach(([e,t])=>{r.beginPath(),r.arc(e,t,1.5,0,2*Math.PI),r.fill()})}else if("bar"===s){const t=o/e.length*.8,i=o/e.length*.2;e.forEach((e,a)=>{const s=2+c-(e-d)/u*c,n=Math.abs(p-s),l=2+a*(t+i),o=Math.min(p,s);r.fillRect(l,o,t,n)})}try{return`<img src="${l.toDataURL("image/png")}" width="${t}" height="${i}" alt="Sparkline chart" style="display: block; vertical-align: middle;">`}catch(e){return console.error("Error creating canvas image:",e),'<div style="color: red;">Canvas error</div>'}}constructor(){super(...arguments),this.align=(w(this,P),w(this,N,"left")),this.type=(w(this,H),w(this,q,"sparkline")),this.value=(w(this,_),w(this,G,"")),this.column=(w(this,K),w(this,W,{key:"",label:"",type:"sparkline",align:"left"})),this.rowData=(w(this,U),w(this,Z,null)),this.contentElement=(w(this,Y),w(this,J,void 0)),this.chartType=(w(this,Q),w(this,X,"line")),this.color=(w(this,te),w(this,ie,"var(--snice-color-primary)")),this.width=(w(this,ae),w(this,ne,80)),this.height=(w(this,le),w(this,re,24)),this.showDots=(w(this,oe),w(this,ce,!1)),this.showBaseline=(w(this,de),w(this,he,!1)),this.strokeWidth=(w(this,ue),w(this,me,1.5)),this.minValue=(w(this,pe),w(this,ge,void 0)),this.maxValue=(w(this,be),w(this,fe,void 0)),this.data=(w(this,ve),w(this,ye,[])),w(this,we)}})})(),(()=>{let a,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A,R,M=[i("snice-cell-percentage")],I=[],T=HTMLElement,L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[];(class extends T{static{c=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(T[Symbol.metadata]??null):void 0;h=[s({type:String})],u=[s({type:String})],p=[s({})],g=[s({type:Object,attribute:!1})],b=[s({type:Object,attribute:!1})],f=[n(".cell-content")],v=[s({type:Number})],k=[s({type:Boolean})],x=[s({type:Number})],C=[s({type:Boolean})],S=[l()],E=[r()],D=[o()],A=[d("align")],R=[d("value","column","showTrend","trendValue","decimals","colorize")],y(this,null,S,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,L),y(this,null,E,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,L),y(this,null,D,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,L),y(this,null,A,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,L),y(this,null,R,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,L),y(null,null,h,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},V,B),y(null,null,u,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},O,j),y(null,null,p,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},P,N),y(null,null,g,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},H,q),y(null,null,b,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},_,G),y(null,null,f,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},K,W),y(null,null,v,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:e},U,Z),y(null,null,k,{kind:"field",name:"showTrend",static:!1,private:!1,access:{has:e=>"showTrend"in e,get:e=>e.showTrend,set:(e,t)=>{e.showTrend=t}},metadata:e},Y,J),y(null,null,x,{kind:"field",name:"trendValue",static:!1,private:!1,access:{has:e=>"trendValue"in e,get:e=>e.trendValue,set:(e,t)=>{e.trendValue=t}},metadata:e},Q,X),y(null,null,C,{kind:"field",name:"colorize",static:!1,private:!1,access:{has:e=>"colorize"in e,get:e=>e.colorize,set:(e,t)=>{e.colorize=t}},metadata:e},ee,te),y(null,a={value:c},M,{kind:"class",name:c.name,metadata:e},null,I),c=a.value,e&&Object.defineProperty(c,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(c,I)}render(){const i=this.formatPercentageValue(),a=this.getTrendArrow(),s=this.getPercentageStyles();return e`
|
|
435
435
|
<div class="cell-content cell-content--percentage" part="content" style="${s}">
|
|
436
436
|
${i}
|
|
437
437
|
${this.shouldShowTrend()&&a?t(`<span class="percentage-trend">${a}</span>`):""}
|
|
438
438
|
</div>
|
|
439
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;flex:1;font-size:.875rem;line-height:1.25rem;font-variant-numeric:tabular-nums}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word;display:flex;align-items:center;justify-content:flex-end;gap:.375rem}.cell-content--percentage{font-feature-settings:'tnum'}.percentage-trend{display:inline-flex;align-items:center;font-size:1rem;margin-left:.25rem}.percentage-trend svg{width:.875rem;height:.875rem}:host(.percentage--positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.percentage--trend-up) .percentage-trend{color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--trend-down) .percentage-trend{color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--trend-neutral) .percentage-trend{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.percentage-trend{font-size:.875rem}}@media print{:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem}.percentage-trend{font-size:.875rem}}"}`}init(){
|
|
439
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;flex:1;font-size:.875rem;line-height:1.25rem;font-variant-numeric:tabular-nums}.cell-content{width:100%;min-height:1.25rem;word-wrap:break-word;display:flex;align-items:center;justify-content:flex-end;gap:.375rem}.cell-content--percentage{font-feature-settings:'tnum'}.percentage-trend{display:inline-flex;align-items:center;font-size:1rem;margin-left:.25rem}.percentage-trend svg{width:.875rem;height:.875rem}:host(.percentage--positive){color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--negative){color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--zero){color:var(--snice-color-text-secondary,rgb(82 82 82))}:host(.percentage--trend-up) .percentage-trend{color:var(--snice-color-success,rgb(22 163 74))}:host(.percentage--trend-down) .percentage-trend{color:var(--snice-color-danger,rgb(220 38 38))}:host(.percentage--trend-neutral) .percentage-trend{color:var(--snice-color-text-secondary,rgb(82 82 82))}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.percentage-trend{font-size:.875rem}}@media print{:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem}.percentage-trend{font-size:.875rem}}"}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatPercentageValue(),t=this.getTrendArrow(),i=this.getPercentageStyles(),a=this.shouldShowTrend()&&t?`<span class="percentage-trend">${t}</span>`:"";this.contentElement.innerHTML=e+a,this.contentElement.setAttribute("style",i)}}formatPercentageValue(){if(null==this.value||""===this.value)return"";if(this.column?.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column?.percentageFormat||{decimals:this.decimals,showTrend:this.showTrend,trendValue:this.trendValue,colorize:this.colorize},t=Number(this.value);return isNaN(t)?String(this.value):`${t.toFixed(e.decimals??this.decimals)}%`}getTrendArrow(){const e=this.column?.percentageFormat?.trendValue??this.trendValue;return null==e?"":e>0?$:e<0?F:z}shouldShowTrend(){return this.column?.percentageFormat?.showTrend??this.showTrend}getPercentageStyles(){const e=Number(this.value),t=this.column?.percentageFormat?.colorize??this.colorize;this.classList.remove("percentage--positive","percentage--negative","percentage--zero"),t&&(e>0?this.classList.add("percentage--positive"):e<0?this.classList.add("percentage--negative"):0===e&&this.classList.add("percentage--zero"));const i=this.column?.percentageFormat?.trendValue??this.trendValue;return this.classList.remove("percentage--trend-up","percentage--trend-down","percentage--trend-neutral"),null!=i&&this.classList.add(i>0?"percentage--trend-up":i<0?"percentage--trend-down":"percentage--trend-neutral"),"text-align: right"}constructor(){super(...arguments),this.align=(w(this,L),w(this,V,"right")),this.type=(w(this,B),w(this,O,"percentage")),this.value=(w(this,j),w(this,P,"")),this.column=(w(this,N),w(this,H,null)),this.rowData=(w(this,q),w(this,_,null)),this.contentElement=(w(this,G),w(this,K,void 0)),this.decimals=(w(this,W),w(this,U,2)),this.showTrend=(w(this,Z),w(this,Y,!1)),this.trendValue=(w(this,J),w(this,Q,null)),this.colorize=(w(this,X),w(this,ee,!0)),w(this,te)}})})(),(()=>{let t,a,n,c,h,u,p,g,b,f,v,k,x,C=[i("snice-cell-tag")],S=[],E=HTMLElement,D=[],A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[];(class extends E{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(E[Symbol.metadata]??null):void 0;n=[s({type:Array,attribute:!1})],c=[s({type:String})],h=[s({type:String})],u=[s({type:Object,attribute:!1})],p=[s({type:Object,attribute:!1})],g=[s({type:String})],b=[s({type:String})],f=[l()],v=[r()],k=[o()],x=[d("value","column")],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,D),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,D),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,D),y(this,null,x,{kind:"method",name:"extractTagsFromColumn",static:!1,private:!1,access:{has:e=>"extractTagsFromColumn"in e,get:e=>e.extractTagsFromColumn},metadata:e},null,D),y(null,null,n,{kind:"field",name:"tags",static:!1,private:!1,access:{has:e=>"tags"in e,get:e=>e.tags,set:(e,t)=>{e.tags=t}},metadata:e},A,R),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},M,z),y(null,null,h,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},$,F),y(null,null,u,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},I,T),y(null,null,p,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},L,V),y(null,null,g,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},B,O),y(null,null,b,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},j,P),y(null,t={value:a},C,{kind:"class",name:a.name,metadata:e},null,S),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,S)}render(){const t=this.tags.length>0?this.tags:this.parseValue();return e`
|
|
440
440
|
<div class="cell-content cell-content--tag" part="content">
|
|
441
441
|
<div class="tags-container">
|
|
442
442
|
${t.map(e=>this.renderTag(e))}
|
|
443
443
|
</div>
|
|
444
444
|
</div>
|
|
445
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;font-size:.875rem;line-height:1.25rem}:host([in-table]){min-height:0;height:auto;min-width:0}.cell-content{width:100%}.tags-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;align-items:center}.tag{display:inline-flex;align-items:center;padding:.125rem .5rem;border-radius:.75rem;font-size:.75rem;font-weight:var(--snice-font-weight-medium,500);line-height:1.25;white-space:nowrap}.tag--default{background:var(--snice-color-surface-container,rgb(242 242 242));color:var(--snice-color-text,rgb(23 23 23))}.tag--primary{background:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-primary,rgb(37 99 235))}.tag--success{background:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-success,rgb(22 163 74))}.tag--danger{background:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-danger,rgb(220 38 38))}.tag--warning{background:color-mix(in srgb,var(--snice-color-warning,rgb(161 98 7)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-warning,rgb(161 98 7))}.tag--info{background:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-primary,rgb(37 99 235))}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}"}`}init(){
|
|
445
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;font-size:.875rem;line-height:1.25rem}:host([in-table]){min-height:0;height:auto;min-width:0}.cell-content{width:100%}.tags-container{display:inline-flex;flex-wrap:wrap;gap:.25rem;align-items:center}.tag{display:inline-flex;align-items:center;padding:.125rem .5rem;border-radius:.75rem;font-size:.75rem;font-weight:var(--snice-font-weight-medium,500);line-height:1.25;white-space:nowrap}.tag--default{background:var(--snice-color-surface-container,rgb(242 242 242));color:var(--snice-color-text,rgb(23 23 23))}.tag--primary{background:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-primary,rgb(37 99 235))}.tag--success{background:color-mix(in srgb,var(--snice-color-success,rgb(22 163 74)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-success,rgb(22 163 74))}.tag--danger{background:color-mix(in srgb,var(--snice-color-danger,rgb(220 38 38)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-danger,rgb(220 38 38))}.tag--warning{background:color-mix(in srgb,var(--snice-color-warning,rgb(161 98 7)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-warning,rgb(161 98 7))}.tag--info{background:color-mix(in srgb,var(--snice-color-primary,rgb(37 99 235)) 12%,var(--snice-color-surface,rgb(255 255 255)));color:var(--snice-color-primary,rgb(37 99 235))}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}"}`}init(){se(this,!0),this.extractTagsFromColumn()}extractTagsFromColumn(){this.column?.tagFormat&&(this.variant=this.column.tagFormat.variant||"default")}parseValue(){if(!this.value)return[];if(Array.isArray(this.value))return this.value;if("string"==typeof this.value){try{const e=JSON.parse(this.value);if(Array.isArray(e))return e}catch{}return this.value.split(",").map(e=>e.trim()).filter(e=>e)}return[String(this.value)]}renderTag(t){return e`
|
|
446
446
|
<span class="tag tag--${this.variant}" part="tag">
|
|
447
447
|
${t}
|
|
448
448
|
</span>
|
|
449
|
-
`}constructor(){super(...arguments),this.tags=(w(this,D),w(this,A,[])),this.value=(w(this,R),w(this,M,"")),this.variant=(w(this,z),w(this
|
|
449
|
+
`}constructor(){super(...arguments),this.tags=(w(this,D),w(this,A,[])),this.value=(w(this,R),w(this,M,"")),this.variant=(w(this,z),w(this,$,"default")),this.column=(w(this,F),w(this,I,null)),this.rowData=(w(this,T),w(this,L,null)),this.align=(w(this,V),w(this,B,"left")),this.type=(w(this,O),w(this,j,"tag")),w(this,P)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E,D=[i("snice-cell-status")],A=[],R=HTMLElement,M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[];(class extends R{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(R[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:String})],p=[s({type:Boolean})],g=[s({type:String})],b=[s({type:Object,attribute:!1})],f=[s({type:Object,attribute:!1})],v=[s({type:String})],k=[s({type:String})],x=[l()],C=[r()],S=[o()],E=[d("value","column")],y(this,null,x,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,M),y(this,null,C,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,M),y(this,null,S,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,M),y(this,null,E,{kind:"method",name:"updateStatusAttributes",static:!1,private:!1,access:{has:e=>"updateStatusAttributes"in e,get:e=>e.updateStatusAttributes},metadata:e},null,M),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},z,$),y(null,null,h,{kind:"field",name:"status",static:!1,private:!1,access:{has:e=>"status"in e,get:e=>e.status,set:(e,t)=>{e.status=t}},metadata:e},F,I),y(null,null,u,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},T,L),y(null,null,p,{kind:"field",name:"showDot",static:!1,private:!1,access:{has:e=>"showDot"in e,get:e=>e.showDot,set:(e,t)=>{e.showDot=t}},metadata:e},V,B),y(null,null,g,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},O,j),y(null,null,b,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},P,N),y(null,null,f,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},H,q),y(null,null,v,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},_,G),y(null,null,k,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},K,W),y(null,a={value:n},D,{kind:"class",name:n.name,metadata:e},null,A),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,A)}render(){const i=this.status||this.value,a=this.label||i,s=this.getStatusVariant(i);return e`
|
|
450
450
|
<div class="cell-content cell-content--status" part="content">
|
|
451
451
|
${t(this.showDot?`<span class="status-dot status-dot--${s}"></span>`:"")}
|
|
452
452
|
<span class="status-label status-label--${s}">${a}</span>
|
|
453
453
|
</div>
|
|
454
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.status-dot{width:.5rem;height:.5rem;border-radius:50%;flex-shrink:0;position:relative}.status-dot--online{background-color:var(--snice-color-success,rgb(22 163 74));box-shadow:0 0 0 2px rgb(22 163 74 / .2)}.status-dot--offline{background-color:rgb(156 163 175);box-shadow:0 0 0 2px rgb(107 114 128 / .2)}.status-dot--busy{background-color:var(--snice-color-danger,rgb(220 38 38));box-shadow:0 0 0 2px rgb(220 38 38 / .2)}.status-dot--away{background-color:var(--snice-color-warning,rgb(234 179 8));box-shadow:0 0 0 2px rgb(234 179 8 / .2)}.status-dot--custom{background-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 2px rgb(37 99 235 / .2)}.status-dot--online::after{content:'';position:absolute;top:-2px;left:-2px;right:-2px;bottom:-2px;border-radius:50%;border:2px solid var(--snice-color-success,rgb(22 163 74));animation:2s ease-in-out infinite status-pulse;opacity:0}@keyframes status-pulse{0%{transform:scale(1);opacity:1}100%{transform:scale(1.5);opacity:0}}.status-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-label--online{color:var(--snice-color-success,rgb(22 163 74))}.status-label--offline{color:var(--snice-color-text-secondary,rgb(82 82 82))}.status-label--busy{color:var(--snice-color-danger,rgb(220 38 38))}.status-label--away{color:var(--snice-color-warning,rgb(234 179 8))}.status-label--custom{color:var(--snice-color-text,rgb(23 23 23))}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.status-dot{width:.375rem;height:.375rem}}@media (prefers-reduced-motion:reduce){.status-dot--online::after{animation:none}}@media print{.status-dot{border:1px solid var(--snice-color-text,rgb(23 23 23))}.status-dot--online{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-success,rgb(22 163 74))}.status-dot--offline{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-neutral,rgb(107 114 128))}.status-dot--busy{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-danger,rgb(220 38 38))}.status-dot--away{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-warning,rgb(234 179 8))}}"}`}init(){
|
|
454
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.status-dot{width:.5rem;height:.5rem;border-radius:50%;flex-shrink:0;position:relative}.status-dot--online{background-color:var(--snice-color-success,rgb(22 163 74));box-shadow:0 0 0 2px rgb(22 163 74 / .2)}.status-dot--offline{background-color:rgb(156 163 175);box-shadow:0 0 0 2px rgb(107 114 128 / .2)}.status-dot--busy{background-color:var(--snice-color-danger,rgb(220 38 38));box-shadow:0 0 0 2px rgb(220 38 38 / .2)}.status-dot--away{background-color:var(--snice-color-warning,rgb(234 179 8));box-shadow:0 0 0 2px rgb(234 179 8 / .2)}.status-dot--custom{background-color:var(--snice-color-primary,rgb(37 99 235));box-shadow:0 0 0 2px rgb(37 99 235 / .2)}.status-dot--online::after{content:'';position:absolute;top:-2px;left:-2px;right:-2px;bottom:-2px;border-radius:50%;border:2px solid var(--snice-color-success,rgb(22 163 74));animation:2s ease-in-out infinite status-pulse;opacity:0}@keyframes status-pulse{0%{transform:scale(1);opacity:1}100%{transform:scale(1.5);opacity:0}}.status-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.status-label--online{color:var(--snice-color-success,rgb(22 163 74))}.status-label--offline{color:var(--snice-color-text-secondary,rgb(82 82 82))}.status-label--busy{color:var(--snice-color-danger,rgb(220 38 38))}.status-label--away{color:var(--snice-color-warning,rgb(234 179 8))}.status-label--custom{color:var(--snice-color-text,rgb(23 23 23))}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.status-dot{width:.375rem;height:.375rem}}@media (prefers-reduced-motion:reduce){.status-dot--online::after{animation:none}}@media print{.status-dot{border:1px solid var(--snice-color-text,rgb(23 23 23))}.status-dot--online{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-success,rgb(22 163 74))}.status-dot--offline{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-neutral,rgb(107 114 128))}.status-dot--busy{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-danger,rgb(220 38 38))}.status-dot--away{background-color:var(--snice-color-surface,rgb(255 255 255));border-color:var(--snice-color-warning,rgb(234 179 8))}}"}`}init(){se(this,!0),this.updateStatusAttributes()}updateStatusAttributes(){if(this.column?.statusFormat){const e=this.column.statusFormat;this.status=e.status||this.value,this.label=e.label||this.value,this.showDot=e.showDot??!0,this.variant=e.variant||"custom"}}getStatusVariant(e){if("custom"!==this.variant)return this.variant;const t=e.toLowerCase();return"online"===t||"active"===t||"available"===t?"online":"offline"===t||"inactive"===t||"unavailable"===t?"offline":"busy"===t||"dnd"===t||"do not disturb"===t?"busy":"away"===t||"idle"===t?"away":"custom"}constructor(){super(...arguments),this.value=(w(this,M),w(this,z,"")),this.status=(w(this,$),w(this,F,"")),this.label=(w(this,I),w(this,T,"")),this.showDot=(w(this,L),w(this,V,!0)),this.variant=(w(this,B),w(this,O,"custom")),this.column=(w(this,j),w(this,P,null)),this.rowData=(w(this,N),w(this,H,null)),this.align=(w(this,q),w(this,_,"left")),this.type=(w(this,G),w(this,K,"status")),w(this,W)}})})(),(()=>{let t,a,n,c,u,p,g,b,f,v,k,x,C,S=[i("snice-cell-actions")],E=[],D=HTMLElement,A=[],R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[];(class extends D{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(D[Symbol.metadata]??null):void 0;n=[s({type:Array,attribute:!1})],c=[s({type:Object,attribute:!1})],u=[s({type:Object,attribute:!1})],p=[s({type:String})],g=[s({type:String})],b=[s({type:String})],f=[l()],v=[r()],k=[o()],x=[d("column")],C=[h("cell-action",{bubbles:!0,composed:!0})],y(this,null,f,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,A),y(this,null,v,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,A),y(this,null,k,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,A),y(this,null,x,{kind:"method",name:"extractActionsFromColumn",static:!1,private:!1,access:{has:e=>"extractActionsFromColumn"in e,get:e=>e.extractActionsFromColumn},metadata:e},null,A),y(this,null,C,{kind:"method",name:"dispatchAction",static:!1,private:!1,access:{has:e=>"dispatchAction"in e,get:e=>e.dispatchAction},metadata:e},null,A),y(null,null,n,{kind:"field",name:"actions",static:!1,private:!1,access:{has:e=>"actions"in e,get:e=>e.actions,set:(e,t)=>{e.actions=t}},metadata:e},R,M),y(null,null,c,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},z,$),y(null,null,u,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},F,I),y(null,null,p,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},T,L),y(null,null,g,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},V,B),y(null,null,b,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},O,j),y(null,t={value:a},S,{kind:"class",name:a.name,metadata:e},null,E),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,E)}render(){return 0===this.actions.length?e`
|
|
455
455
|
<div class="cell-content cell-content--actions" part="content">
|
|
456
456
|
<div class="actions-container"></div>
|
|
457
457
|
</div>
|
|
@@ -461,7 +461,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
461
461
|
${this.actions.map(e=>this.renderActionButton(e))}
|
|
462
462
|
</div>
|
|
463
463
|
</div>
|
|
464
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.actions-container{display:inline-flex;gap:.5rem;align-items:center}.action-button{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;border:1px solid transparent;border-radius:.25rem;background:0 0;cursor:pointer;transition:.2s;font-size:.875rem;line-height:1}.action-button:hover{background:var(--snice-color-surface-hover,rgb(243 244 246))}.action-button:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px}.action-button:active{transform:scale(.95)}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button:disabled:hover{background:0 0}.action-button--primary{color:var(--snice-color-primary,rgb(37 99 235))}.action-button--primary:hover:not(:disabled){background:rgb(37 99 235 / .1)}.action-button--secondary{color:var(--snice-color-text,rgb(23 23 23))}.action-button--danger{color:var(--snice-color-danger,rgb(220 38 38))}.action-button--danger:hover:not(:disabled){background:rgb(220 38 38 / .1)}.action-button--success{color:var(--snice-color-success,rgb(22 163 74))}.action-button--success:hover:not(:disabled){background:rgb(22 163 74 / .1)}.action-icon{display:inline-flex;align-items:center;font-size:1rem}img.action-icon{width:1rem;height:1rem;object-fit:contain}.action-icon svg{width:1rem;height:1rem}.action-label{font-weight:var(--snice-font-weight-medium,500)}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}@media (max-width:768px){.action-button{padding:.25rem}.action-label{display:none}}@media print{.actions-container{display:none}}"}`}init(){
|
|
464
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.actions-container{display:inline-flex;gap:.5rem;align-items:center}.action-button{display:inline-flex;align-items:center;gap:.25rem;padding:.25rem .5rem;border:1px solid transparent;border-radius:.25rem;background:0 0;cursor:pointer;transition:.2s;font-size:.875rem;line-height:1}.action-button:hover{background:var(--snice-color-surface-hover,rgb(243 244 246))}.action-button:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px}.action-button:active{transform:scale(.95)}.action-button:disabled{opacity:.5;cursor:not-allowed}.action-button:disabled:hover{background:0 0}.action-button--primary{color:var(--snice-color-primary,rgb(37 99 235))}.action-button--primary:hover:not(:disabled){background:rgb(37 99 235 / .1)}.action-button--secondary{color:var(--snice-color-text,rgb(23 23 23))}.action-button--danger{color:var(--snice-color-danger,rgb(220 38 38))}.action-button--danger:hover:not(:disabled){background:rgb(220 38 38 / .1)}.action-button--success{color:var(--snice-color-success,rgb(22 163 74))}.action-button--success:hover:not(:disabled){background:rgb(22 163 74 / .1)}.action-icon{display:inline-flex;align-items:center;font-size:1rem}img.action-icon{width:1rem;height:1rem;object-fit:contain}.action-icon svg{width:1rem;height:1rem}.action-label{font-weight:var(--snice-font-weight-medium,500)}:host([align=left]){justify-content:flex-start}:host([align=center]){justify-content:center}:host([align=right]){justify-content:flex-end}@media (max-width:768px){.action-button{padding:.25rem}.action-label{display:none}}@media print{.actions-container{display:none}}"}`}init(){se(this,!0),this.extractActionsFromColumn()}extractActionsFromColumn(){this.column?.actionsFormat?.actions&&(this.actions=this.column.actionsFormat.actions)}renderActionButton(t){const i=t.icon||"",a=t.label||"",s=t.variant||"secondary",n=t.disabled||!1,l=i?H(i,"action-icon"):"";return e`
|
|
465
465
|
<button
|
|
466
466
|
class="action-button action-button--${s}"
|
|
467
467
|
part="action-button"
|
|
@@ -472,7 +472,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
472
472
|
${l}
|
|
473
473
|
${a?e`<span class="action-label">${a}</span>`:""}
|
|
474
474
|
</button>
|
|
475
|
-
`}handleActionClick(e,t){e.stopPropagation(),this.dispatchAction(t)}dispatchAction(e){return{action:e,rowData:this.rowData,column:this.column}}constructor(){super(...arguments),this.actions=(w(this,A),w(this,R,[])),this.column=(w(this,M),w(this,z,null)),this.rowData=(w(this
|
|
475
|
+
`}handleActionClick(e,t){e.stopPropagation(),this.dispatchAction(t)}dispatchAction(e){return{action:e,rowData:this.rowData,column:this.column}}constructor(){super(...arguments),this.actions=(w(this,A),w(this,R,[])),this.column=(w(this,M),w(this,z,null)),this.rowData=(w(this,$),w(this,F,null)),this.value=(w(this,I),w(this,T,"")),this.align=(w(this,L),w(this,V,"left")),this.type=(w(this,B),w(this,O,"actions")),w(this,j)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A=[i("snice-cell-link")],R=[],M=HTMLElement,z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[];(class extends M{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(M[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:String})],p=[s({type:Boolean,attribute:"external"})],g=[s({type:String})],b=[s({type:String})],f=[s({type:Object,attribute:!1})],v=[s({type:Object,attribute:!1})],k=[s({type:String})],x=[s({type:String})],C=[l()],S=[r()],E=[o()],D=[d("value","column")],y(this,null,C,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,z),y(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,z),y(this,null,E,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,z),y(this,null,D,{kind:"method",name:"updateCellAttributes",static:!1,private:!1,access:{has:e=>"updateCellAttributes"in e,get:e=>e.updateCellAttributes},metadata:e},null,z),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},$,F),y(null,null,h,{kind:"field",name:"href",static:!1,private:!1,access:{has:e=>"href"in e,get:e=>e.href,set:(e,t)=>{e.href=t}},metadata:e},I,T),y(null,null,u,{kind:"field",name:"target",static:!1,private:!1,access:{has:e=>"target"in e,get:e=>e.target,set:(e,t)=>{e.target=t}},metadata:e},L,V),y(null,null,p,{kind:"field",name:"external",static:!1,private:!1,access:{has:e=>"external"in e,get:e=>e.external,set:(e,t)=>{e.external=t}},metadata:e},B,O),y(null,null,g,{kind:"field",name:"icon",static:!1,private:!1,access:{has:e=>"icon"in e,get:e=>e.icon,set:(e,t)=>{e.icon=t}},metadata:e},j,P),y(null,null,b,{kind:"field",name:"text",static:!1,private:!1,access:{has:e=>"text"in e,get:e=>e.text,set:(e,t)=>{e.text=t}},metadata:e},N,q),y(null,null,f,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},_,G),y(null,null,v,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},K,W),y(null,null,k,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},U,Z),y(null,null,x,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},Y,J),y(null,a={value:n},A,{kind:"class",name:n.name,metadata:e},null,R),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,R)}render(){const i=this.href||this.value,a=this.text||this.value,s=this.external||"_blank"===this.target||i.startsWith("http"),n=this.icon?H(this.icon,"link-icon"):"";return e`
|
|
476
476
|
<div class="cell-content cell-content--link" part="content">
|
|
477
477
|
<a
|
|
478
478
|
href="${i}"
|
|
@@ -486,7 +486,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
486
486
|
${t(s?'<span class="external-icon">↗</span>':"")}
|
|
487
487
|
</a>
|
|
488
488
|
</div>
|
|
489
|
-
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.cell-link{display:inline-flex;align-items:center;gap:.25rem;color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s}.cell-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.cell-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.cell-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.link-icon{display:inline-flex;align-items:center;font-size:1rem}img.link-icon{width:1rem;height:1rem;object-fit:contain}.link-icon svg{width:1rem;height:1rem}.link-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.external-icon{display:inline-flex;align-items:center;font-size:.75rem;opacity:.7}:host([align=left]){text-align:left;justify-content:flex-start}:host([align=center]){text-align:center;justify-content:center}:host([align=right]){text-align:right;justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}}@media print{.cell-link{text-decoration:underline}.cell-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}}'}`}init(){
|
|
489
|
+
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem}.cell-link{display:inline-flex;align-items:center;gap:.25rem;color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s}.cell-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.cell-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.cell-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.link-icon{display:inline-flex;align-items:center;font-size:1rem}img.link-icon{width:1rem;height:1rem;object-fit:contain}.link-icon svg{width:1rem;height:1rem}.link-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.external-icon{display:inline-flex;align-items:center;font-size:.75rem;opacity:.7}:host([align=left]){text-align:left;justify-content:flex-start}:host([align=center]){text-align:center;justify-content:center}:host([align=right]){text-align:right;justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}}@media print{.cell-link{text-decoration:underline}.cell-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}}'}`}init(){se(this,!0),this.updateCellAttributes()}updateCellAttributes(){if(this.column?.linkFormat){const e=this.column.linkFormat;this.href=e.href||this.value,this.target=e.target||"_self",this.external=e.external||!1,this.icon=e.icon||"",this.text=e.text||this.value}}constructor(){super(...arguments),this.value=(w(this,z),w(this,$,"")),this.href=(w(this,F),w(this,I,"")),this.target=(w(this,T),w(this,L,"_self")),this.external=(w(this,V),w(this,B,!1)),this.icon=(w(this,O),w(this,j,"")),this.text=(w(this,P),w(this,N,"")),this.column=(w(this,q),w(this,_,null)),this.rowData=(w(this,G),w(this,K,null)),this.align=(w(this,W),w(this,U,"left")),this.type=(w(this,Z),w(this,Y,"link")),w(this,J)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E=[i("snice-cell-email")],D=[],A=HTMLElement,R=[],M=[],z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[];(class extends A{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(A[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:String})],p=[s({type:Boolean})],g=[s({type:Object,attribute:!1})],b=[s({type:Object,attribute:!1})],f=[s({type:String})],v=[s({type:String})],k=[l()],x=[r()],C=[o()],S=[d("value","column")],y(this,null,k,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,R),y(this,null,x,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,R),y(this,null,C,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,R),y(this,null,S,{kind:"method",name:"updateEmailAttributes",static:!1,private:!1,access:{has:e=>"updateEmailAttributes"in e,get:e=>e.updateEmailAttributes},metadata:e},null,R),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},M,z),y(null,null,h,{kind:"field",name:"email",static:!1,private:!1,access:{has:e=>"email"in e,get:e=>e.email,set:(e,t)=>{e.email=t}},metadata:e},$,F),y(null,null,u,{kind:"field",name:"displayText",static:!1,private:!1,access:{has:e=>"displayText"in e,get:e=>e.displayText,set:(e,t)=>{e.displayText=t}},metadata:e},I,T),y(null,null,p,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:e=>"showIcon"in e,get:e=>e.showIcon,set:(e,t)=>{e.showIcon=t}},metadata:e},L,V),y(null,null,g,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},B,O),y(null,null,b,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},j,P),y(null,null,f,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},N,H),y(null,null,v,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},q,_),y(null,a={value:n},E,{kind:"class",name:n.name,metadata:e},null,D),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,D)}render(){const i=this.email||this.value,a=this.displayText||i;return i?e`
|
|
490
490
|
<div class="cell-content cell-content--email" part="content">
|
|
491
491
|
${t(this.showIcon?'<span class="email-icon">✉</span>':"")}
|
|
492
492
|
<a href="mailto:${i}" class="email-link" part="link">
|
|
@@ -497,7 +497,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
497
497
|
<div class="cell-content cell-content--email" part="content">
|
|
498
498
|
<span class="email-empty"></span>
|
|
499
499
|
</div>
|
|
500
|
-
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.email-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.email-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.email-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.email-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.email-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.email-icon{font-size:.75rem}}@media print{.email-link{text-decoration:underline}.email-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.email-icon{display:none}}'}`}init(){
|
|
500
|
+
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.email-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.email-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.email-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.email-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.email-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.email-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.email-icon{font-size:.75rem}}@media print{.email-link{text-decoration:underline}.email-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.email-icon{display:none}}'}`}init(){se(this,!0),this.updateEmailAttributes()}updateEmailAttributes(){if(this.column?.emailFormat){const e=this.column.emailFormat;this.email=e.email||this.value,this.displayText=e.displayText||"",this.showIcon=e.showIcon??!0}}constructor(){super(...arguments),this.value=(w(this,R),w(this,M,"")),this.email=(w(this,z),w(this,$,"")),this.displayText=(w(this,F),w(this,I,"")),this.showIcon=(w(this,T),w(this,L,!0)),this.column=(w(this,V),w(this,B,null)),this.rowData=(w(this,O),w(this,j,null)),this.align=(w(this,P),w(this,N,"left")),this.type=(w(this,H),w(this,q,"email")),w(this,_)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A=[i("snice-cell-phone")],R=[],M=HTMLElement,z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[];(class extends M{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(M[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:String})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:String})],f=[s({type:Object,attribute:!1})],v=[s({type:Object,attribute:!1})],k=[s({type:String})],x=[s({type:String})],C=[l()],S=[r()],E=[o()],D=[d("value","column")],y(this,null,C,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,z),y(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,z),y(this,null,E,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,z),y(this,null,D,{kind:"method",name:"updatePhoneAttributes",static:!1,private:!1,access:{has:e=>"updatePhoneAttributes"in e,get:e=>e.updatePhoneAttributes},metadata:e},null,z),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},$,F),y(null,null,h,{kind:"field",name:"phone",static:!1,private:!1,access:{has:e=>"phone"in e,get:e=>e.phone,set:(e,t)=>{e.phone=t}},metadata:e},I,T),y(null,null,u,{kind:"field",name:"displayText",static:!1,private:!1,access:{has:e=>"displayText"in e,get:e=>e.displayText,set:(e,t)=>{e.displayText=t}},metadata:e},L,V),y(null,null,p,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:e=>"showIcon"in e,get:e=>e.showIcon,set:(e,t)=>{e.showIcon=t}},metadata:e},B,O),y(null,null,g,{kind:"field",name:"format",static:!1,private:!1,access:{has:e=>"format"in e,get:e=>e.format,set:(e,t)=>{e.format=t}},metadata:e},j,P),y(null,null,b,{kind:"field",name:"country",static:!1,private:!1,access:{has:e=>"country"in e,get:e=>e.country,set:(e,t)=>{e.country=t}},metadata:e},N,H),y(null,null,f,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},q,_),y(null,null,v,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},G,K),y(null,null,k,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},W,U),y(null,null,x,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},Z,Y),y(null,a={value:n},A,{kind:"class",name:n.name,metadata:e},null,R),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,R)}render(){const i=this.phone||this.value,a=this.displayText||(this.format?this.formatPhoneNumber(i):i);return i?e`
|
|
501
501
|
<div class="cell-content cell-content--phone" part="content">
|
|
502
502
|
${t(this.showIcon?'<span class="phone-icon">📞</span>':"")}
|
|
503
503
|
<a href="tel:${i}" class="phone-link" part="link">
|
|
@@ -508,12 +508,12 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
508
508
|
<div class="cell-content cell-content--phone" part="content">
|
|
509
509
|
<span class="phone-empty"></span>
|
|
510
510
|
</div>
|
|
511
|
-
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.phone-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.phone-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.phone-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.phone-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.phone-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.phone-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.phone-icon{font-size:.75rem}}@media print{.phone-link{text-decoration:underline}.phone-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.phone-icon{display:none}}'}`}init(){
|
|
511
|
+
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.phone-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.phone-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-variant-numeric:tabular-nums}.phone-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.phone-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.phone-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.phone-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.phone-icon{font-size:.75rem}}@media print{.phone-link{text-decoration:underline}.phone-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.phone-icon{display:none}}'}`}init(){se(this,!0),this.updatePhoneAttributes()}updatePhoneAttributes(){if(this.column?.phoneFormat){const e=this.column.phoneFormat;this.phone=e.phone||this.value,this.displayText=e.displayText||"",this.showIcon=e.showIcon??!0,this.format=e.format??!0,this.country=e.country||"US"}}formatPhoneNumber(e){const t=e.replace(/\D/g,"");return"US"===this.country&&10===t.length?`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`:"US"===this.country&&11===t.length&&"1"===t[0]?`+1 (${t.slice(1,4)}) ${t.slice(4,7)}-${t.slice(7)}`:e}constructor(){super(...arguments),this.value=(w(this,z),w(this,$,"")),this.phone=(w(this,F),w(this,I,"")),this.displayText=(w(this,T),w(this,L,"")),this.showIcon=(w(this,V),w(this,B,!0)),this.format=(w(this,O),w(this,j,!0)),this.country=(w(this,P),w(this,N,"US")),this.column=(w(this,H),w(this,q,null)),this.rowData=(w(this,_),w(this,G,null)),this.align=(w(this,K),w(this,W,"left")),this.type=(w(this,U),w(this,Z,"phone")),w(this,Y)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A=[i("snice-cell-color")],R=[],M=HTMLElement,z=[],$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[];(class extends M{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(M[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:Boolean})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:String})],f=[s({type:Object,attribute:!1})],v=[s({type:Object,attribute:!1})],k=[s({type:String})],x=[s({type:String})],C=[l()],S=[r()],E=[o()],D=[d("value","column")],y(this,null,C,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,z),y(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,z),y(this,null,E,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,z),y(this,null,D,{kind:"method",name:"updateColorAttributes",static:!1,private:!1,access:{has:e=>"updateColorAttributes"in e,get:e=>e.updateColorAttributes},metadata:e},null,z),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},$,F),y(null,null,h,{kind:"field",name:"color",static:!1,private:!1,access:{has:e=>"color"in e,get:e=>e.color,set:(e,t)=>{e.color=t}},metadata:e},I,T),y(null,null,u,{kind:"field",name:"showSwatch",static:!1,private:!1,access:{has:e=>"showSwatch"in e,get:e=>e.showSwatch,set:(e,t)=>{e.showSwatch=t}},metadata:e},L,V),y(null,null,p,{kind:"field",name:"showHex",static:!1,private:!1,access:{has:e=>"showHex"in e,get:e=>e.showHex,set:(e,t)=>{e.showHex=t}},metadata:e},B,O),y(null,null,g,{kind:"field",name:"showRgb",static:!1,private:!1,access:{has:e=>"showRgb"in e,get:e=>e.showRgb,set:(e,t)=>{e.showRgb=t}},metadata:e},j,P),y(null,null,b,{kind:"field",name:"swatchSize",static:!1,private:!1,access:{has:e=>"swatchSize"in e,get:e=>e.swatchSize,set:(e,t)=>{e.swatchSize=t}},metadata:e},N,H),y(null,null,f,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},q,_),y(null,null,v,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},G,K),y(null,null,k,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},W,U),y(null,null,x,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},Z,Y),y(null,a={value:n},A,{kind:"class",name:n.name,metadata:e},null,R),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,R)}render(){const i=this.color||this.value,a=this.showSwatch?`<span class="color-swatch color-swatch--${this.swatchSize}" style="background-color: ${i};"></span>`:"",s=this.getDisplayText(i);return e`
|
|
512
512
|
<div class="cell-content cell-content--color" part="content">
|
|
513
513
|
${t(a)}
|
|
514
514
|
${s?e`<span class="color-text">${s}</span>`:""}
|
|
515
515
|
</div>
|
|
516
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.color-swatch{border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:.25rem;flex-shrink:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03))}.color-swatch--small{width:1rem;height:1rem}.color-swatch--medium{width:1.5rem;height:1.5rem}.color-swatch--large{width:2rem;height:2rem}.color-text{font-family:monospace;font-size:.875rem;color:var(--snice-color-text,rgb(23 23 23));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.color-swatch--small{width:.875rem;height:.875rem}.color-swatch--medium{width:1.25rem;height:1.25rem}.color-swatch--large{width:1.75rem;height:1.75rem}.color-text{font-size:.75rem}}@media print{.color-swatch{border:2px solid var(--snice-color-text,rgb(23 23 23))}.color-text{font-size:.75rem}}"}`}init(){
|
|
516
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.5rem}.color-swatch{border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:.25rem;flex-shrink:0;box-shadow:var(--snice-shadow-xs,0 1px 2px 0 rgb(0 0 0 / .03))}.color-swatch--small{width:1rem;height:1rem}.color-swatch--medium{width:1.5rem;height:1.5rem}.color-swatch--large{width:2rem;height:2rem}.color-text{font-family:monospace;font-size:.875rem;color:var(--snice-color-text,rgb(23 23 23));overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.color-swatch--small{width:.875rem;height:.875rem}.color-swatch--medium{width:1.25rem;height:1.25rem}.color-swatch--large{width:1.75rem;height:1.75rem}.color-text{font-size:.75rem}}@media print{.color-swatch{border:2px solid var(--snice-color-text,rgb(23 23 23))}.color-text{font-size:.75rem}}"}`}init(){se(this,!0),this.updateColorAttributes()}updateColorAttributes(){if(this.column?.colorFormat){const e=this.column.colorFormat;this.color=e.color||this.value,this.showSwatch=e.showSwatch??!0,this.showHex=e.showHex??!0,this.showRgb=e.showRgb??!1,this.swatchSize=e.swatchSize||e.size||"medium"}}getDisplayText(e){const t=this.column?.colorFormat?.displayFormat;if("name"===t)return this.value||e;if("rgb"===t){const t=this.hexToRgb(e);return t?`rgb(${t.r}, ${t.g}, ${t.b})`:e}if("hsl"===t){const t=this.hexToRgb(e);if(!t)return e;const{h:i,s:a,l:s}=this.rgbToHsl(t.r,t.g,t.b);return`hsl(${i}, ${a}%, ${s}%)`}if("hex"===t)return e;if(this.showRgb&&e.startsWith("#")){const t=this.hexToRgb(e);return t?`rgb(${t.r}, ${t.g}, ${t.b})`:e}return this.showHex?e:""}hexToRgb(e){const t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}rgbToHsl(e,t,i){const a=e/255,s=t/255,n=i/255,l=Math.max(a,s,n),r=Math.min(a,s,n),o=l-r;let c=0;o&&(c=l===a?(s-n)/o%6:l===s?(n-a)/o+2:(a-s)/o+4,c*=60,c<0&&(c+=360));const d=(l+r)/2,h=0===o?0:o/(1-Math.abs(2*d-1));return{h:Math.round(c),s:Math.round(100*h),l:Math.round(100*d)}}constructor(){super(...arguments),this.value=(w(this,z),w(this,$,"")),this.color=(w(this,F),w(this,I,"")),this.showSwatch=(w(this,T),w(this,L,!0)),this.showHex=(w(this,V),w(this,B,!0)),this.showRgb=(w(this,O),w(this,j,!1)),this.swatchSize=(w(this,P),w(this,N,"medium")),this.column=(w(this,H),w(this,q,null)),this.rowData=(w(this,_),w(this,G,null)),this.align=(w(this,K),w(this,W,"left")),this.type=(w(this,U),w(this,Z,"color")),w(this,Y)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A,R=[i("snice-cell-location")],M=[],z=HTMLElement,$=[],F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[];(class extends z{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(z[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:String})],p=[s({type:String})],g=[s({type:Boolean})],b=[s({type:String})],f=[s({type:Boolean})],v=[s({type:Object,attribute:!1})],k=[s({type:Object,attribute:!1})],x=[s({type:String})],C=[s({type:String})],S=[l()],E=[r()],D=[o()],A=[d("value","column")],y(this,null,S,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,$),y(this,null,E,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,$),y(this,null,D,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,$),y(this,null,A,{kind:"method",name:"updateLocationAttributes",static:!1,private:!1,access:{has:e=>"updateLocationAttributes"in e,get:e=>e.updateLocationAttributes},metadata:e},null,$),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},F,I),y(null,null,h,{kind:"field",name:"address",static:!1,private:!1,access:{has:e=>"address"in e,get:e=>e.address,set:(e,t)=>{e.address=t}},metadata:e},T,L),y(null,null,u,{kind:"field",name:"latitude",static:!1,private:!1,access:{has:e=>"latitude"in e,get:e=>e.latitude,set:(e,t)=>{e.latitude=t}},metadata:e},V,B),y(null,null,p,{kind:"field",name:"longitude",static:!1,private:!1,access:{has:e=>"longitude"in e,get:e=>e.longitude,set:(e,t)=>{e.longitude=t}},metadata:e},O,j),y(null,null,g,{kind:"field",name:"showMapLink",static:!1,private:!1,access:{has:e=>"showMapLink"in e,get:e=>e.showMapLink,set:(e,t)=>{e.showMapLink=t}},metadata:e},P,N),y(null,null,b,{kind:"field",name:"mapProvider",static:!1,private:!1,access:{has:e=>"mapProvider"in e,get:e=>e.mapProvider,set:(e,t)=>{e.mapProvider=t}},metadata:e},H,q),y(null,null,f,{kind:"field",name:"showIcon",static:!1,private:!1,access:{has:e=>"showIcon"in e,get:e=>e.showIcon,set:(e,t)=>{e.showIcon=t}},metadata:e},_,G),y(null,null,v,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},K,W),y(null,null,k,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},U,Z),y(null,null,x,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},Y,J),y(null,null,C,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},Q,X),y(null,a={value:n},R,{kind:"class",name:n.name,metadata:e},null,M),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,M)}render(){const i=this.address||this.value,a=this.showIcon?'<span class="location-icon">📍</span>':"",s=this.getMapLink();if(!i&&!this.latitude&&!this.longitude)return e`
|
|
517
517
|
<div class="cell-content cell-content--location" part="content">
|
|
518
518
|
<span class="location-empty"></span>
|
|
519
519
|
</div>
|
|
@@ -524,22 +524,22 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
524
524
|
${n}
|
|
525
525
|
</a>`:e`<span class="location-text">${n}</span>`}
|
|
526
526
|
</div>
|
|
527
|
-
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.location-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.location-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.location-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.location-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.location-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--snice-color-text,rgb(23 23 23))}.location-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.location-icon{font-size:.75rem}}@media print{.location-link{text-decoration:underline}.location-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.location-icon{display:none}}'}`}init(){
|
|
527
|
+
`}styles(){return m`${':host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center;gap:.375rem}.location-icon{display:inline-flex;align-items:center;font-size:.875rem;opacity:.7;flex-shrink:0}.location-link{color:var(--snice-color-primary,rgb(37 99 235));text-decoration:none;transition:color .2s;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.location-link:hover{color:var(--snice-color-primary-hover,rgb(29 78 216));text-decoration:underline}.location-link:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px;border-radius:var(--snice-border-radius-sm,.125rem)}.location-link:visited{color:var(--snice-color-text-secondary,rgb(107 114 128))}.location-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--snice-color-text,rgb(23 23 23))}.location-empty{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.location-icon{font-size:.75rem}}@media print{.location-link{text-decoration:underline}.location-link::after{content:" (" attr(href) ")";font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82))}.location-icon{display:none}}'}`}init(){se(this,!0),this.updateLocationAttributes()}updateLocationAttributes(){if(this.column?.locationFormat){const e=this.column.locationFormat;this.address=e.address||this.value;const t=e.latitude??e.lat,i=e.longitude??e.lng;this.latitude=null!=t?String(t):"",this.longitude=null!=i?String(i):"",this.showMapLink=e.showMapLink??!0,this.mapProvider=e.mapProvider||"google",this.showIcon=e.showIcon??!0}}getMapLink(){if(!this.showMapLink)return"";const e=this.address||this.value,t=this.latitude,i=this.longitude;switch(this.mapProvider){case"google":return t&&i?`https://www.google.com/maps?q=${t},${i}`:e?`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(e)}`:"";case"openstreetmap":return t&&i?`https://www.openstreetmap.org/?mlat=${t}&mlon=${i}&zoom=15`:e?`https://www.openstreetmap.org/search?query=${encodeURIComponent(e)}`:"";case"apple":return t&&i?`https://maps.apple.com/?ll=${t},${i}`:e?`https://maps.apple.com/?address=${encodeURIComponent(e)}`:"";default:return""}}constructor(){super(...arguments),this.value=(w(this,$),w(this,F,"")),this.address=(w(this,I),w(this,T,"")),this.latitude=(w(this,L),w(this,V,"")),this.longitude=(w(this,B),w(this,O,"")),this.showMapLink=(w(this,j),w(this,P,!0)),this.mapProvider=(w(this,N),w(this,H,"google")),this.showIcon=(w(this,q),w(this,_,!0)),this.column=(w(this,G),w(this,K,null)),this.rowData=(w(this,W),w(this,U,null)),this.align=(w(this,Z),w(this,Y,"left")),this.type=(w(this,J),w(this,Q,"location")),w(this,X)}})})(),(()=>{let a,n,c,h,u,p,g,b,v,k,C,E,D,A,R,M=[i("snice-cell-json")],z=[],$=HTMLElement,F=[],I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[];(class extends ${static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create($[Symbol.metadata]??null):void 0;c=[s({type:Object})],h=[s({type:Boolean})],u=[s({type:Number})],p=[s({type:Boolean})],g=[s({type:Object,attribute:!1})],b=[s({type:Object,attribute:!1})],v=[s({type:String})],k=[s({type:String})],C=[l()],E=[r()],D=[o()],A=[d("value","column")],R=[f("click",".json-toggle")],y(this,null,C,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,F),y(this,null,E,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,F),y(this,null,D,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,F),y(this,null,A,{kind:"method",name:"updateJsonAttributes",static:!1,private:!1,access:{has:e=>"updateJsonAttributes"in e,get:e=>e.updateJsonAttributes},metadata:e},null,F),y(this,null,R,{kind:"method",name:"handleToggle",static:!1,private:!1,access:{has:e=>"handleToggle"in e,get:e=>e.handleToggle},metadata:e},null,F),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},I,T),y(null,null,h,{kind:"field",name:"collapsed",static:!1,private:!1,access:{has:e=>"collapsed"in e,get:e=>e.collapsed,set:(e,t)=>{e.collapsed=t}},metadata:e},L,V),y(null,null,u,{kind:"field",name:"maxDepth",static:!1,private:!1,access:{has:e=>"maxDepth"in e,get:e=>e.maxDepth,set:(e,t)=>{e.maxDepth=t}},metadata:e},B,O),y(null,null,p,{kind:"field",name:"showToggle",static:!1,private:!1,access:{has:e=>"showToggle"in e,get:e=>e.showToggle,set:(e,t)=>{e.showToggle=t}},metadata:e},j,P),y(null,null,g,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},N,H),y(null,null,b,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},q,_),y(null,null,v,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},G,K),y(null,null,k,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},W,U),y(null,a={value:n},M,{kind:"class",name:n.name,metadata:e},null,z),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,z)}render(){const i="string"==typeof this.value?this.tryParseJson(this.value):this.value;if(null==i)return e`
|
|
528
528
|
<div class="cell-content cell-content--json" part="content">
|
|
529
529
|
<span class="json-empty">null</span>
|
|
530
530
|
</div>
|
|
531
|
-
`;const a=this.showToggle?`<button class="json-toggle" part="toggle" aria-label="${this.collapsed?"Expand":"Collapse"}">${this.collapsed?
|
|
531
|
+
`;const a=this.showToggle?`<button class="json-toggle" part="toggle" aria-label="${this.collapsed?"Expand":"Collapse"}">${this.collapsed?S:x}</button>`:"",s=this.collapsed?this.renderCollapsed(i):this.renderExpanded(i);return e`
|
|
532
532
|
<div class="cell-content cell-content--json" part="content">
|
|
533
533
|
${t(a)}
|
|
534
534
|
<div class="json-viewer ${this.collapsed?"json-viewer--collapsed":"json-viewer--expanded"}">
|
|
535
535
|
${t(s)}
|
|
536
536
|
</div>
|
|
537
537
|
</div>
|
|
538
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:auto;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0}.json-toggle{background:0 0;border:none;color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;padding:.125rem .25rem;font-size:.75rem;line-height:1;border-radius:.25rem;transition:background-color .2s;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}.json-toggle svg{width:.75rem;height:.75rem}.json-toggle:hover{background-color:var(--snice-color-surface-hover,rgb(245 245 245))}.json-toggle:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px}.json-viewer{font-family:'Courier New',Consolas,monospace;font-size:.8125rem;overflow:hidden;flex:1}.json-viewer--collapsed{white-space:nowrap;text-overflow:ellipsis}.json-viewer--expanded{white-space:pre-wrap;word-break:break-word}.json-preview{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}.json-object{padding-left:1rem}.json-line{margin:.125rem 0}.json-key{color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500);margin-right:.25rem}.json-string{color:var(--snice-color-success,rgb(22 163 74))}.json-number{color:var(--snice-color-primary,rgb(59 130 246))}.json-boolean{color:var(--snice-color-warning,rgb(234 179 8))}.json-empty,.json-null,.json-undefined{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.json-viewer{font-size:.75rem}.json-toggle{font-size:.625rem}}@media print{.json-toggle{display:none}.json-viewer--collapsed{white-space:normal}.json-viewer{font-size:.625rem}}"}`}init(){
|
|
538
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;height:auto;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:flex-start;gap:.5rem;padding:.25rem 0}.json-toggle{background:0 0;border:none;color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;padding:.125rem .25rem;font-size:.75rem;line-height:1;border-radius:.25rem;transition:background-color .2s;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}.json-toggle svg{width:.75rem;height:.75rem}.json-toggle:hover{background-color:var(--snice-color-surface-hover,rgb(245 245 245))}.json-toggle:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:2px}.json-viewer{font-family:'Courier New',Consolas,monospace;font-size:.8125rem;overflow:hidden;flex:1}.json-viewer--collapsed{white-space:nowrap;text-overflow:ellipsis}.json-viewer--expanded{white-space:pre-wrap;word-break:break-word}.json-preview{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}.json-object{padding-left:1rem}.json-line{margin:.125rem 0}.json-key{color:var(--snice-color-primary,rgb(37 99 235));font-weight:var(--snice-font-weight-medium,500);margin-right:.25rem}.json-string{color:var(--snice-color-success,rgb(22 163 74))}.json-number{color:var(--snice-color-primary,rgb(59 130 246))}.json-boolean{color:var(--snice-color-warning,rgb(234 179 8))}.json-empty,.json-null,.json-undefined{color:var(--snice-color-text-secondary,rgb(82 82 82));font-style:italic}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}@media (max-width:768px){:host{color:var(--snice-color-text,rgb(23 23 23));font-size:.75rem;line-height:1rem}.json-viewer{font-size:.75rem}.json-toggle{font-size:.625rem}}@media print{.json-toggle{display:none}.json-viewer--collapsed{white-space:normal}.json-viewer{font-size:.625rem}}"}`}init(){se(this,!0),this.updateJsonAttributes()}updateJsonAttributes(){if(this.column?.jsonFormat){const e=this.column.jsonFormat;this.collapsed=e.collapsed??(void 0===e.expanded||!e.expanded),this.maxDepth=e.maxDepth??3,this.showToggle=e.showToggle??!0}}handleToggle(){this.collapsed=!this.collapsed}tryParseJson(e){try{return JSON.parse(e)}catch{return e}}renderCollapsed(e){return"object"==typeof e&&null!==e?Array.isArray(e)?`<span class="json-preview">[${e.length} items]</span>`:`<span class="json-preview">{${Object.keys(e).length} keys}</span>`:this.renderValue(e)}renderExpanded(e,t=0){return t>=this.maxDepth?this.renderCollapsed(e):"object"==typeof e&&null!==e?Array.isArray(e)?`<div class="json-object">[${e.map((e,i)=>`<div class="json-line"><span class="json-key">${i}:</span> ${this.renderExpanded(e,t+1)}</div>`).join("")}]</div>`:`<div class="json-object">{${Object.entries(e).map(([e,i])=>{const a=this.renderExpanded(i,t+1);return`<div class="json-line"><span class="json-key">${ne(e)}:</span> ${a}</div>`}).join("")}}</div>`:this.renderValue(e)}renderValue(e){return null===e?'<span class="json-null">null</span>':void 0===e?'<span class="json-undefined">undefined</span>':"boolean"==typeof e?`<span class="json-boolean">${e}</span>`:"number"==typeof e?`<span class="json-number">${e}</span>`:"string"==typeof e?`<span class="json-string">"${ne(e)}"</span>`:ne(String(e))}constructor(){super(...arguments),this.value=(w(this,F),w(this,I,null)),this.collapsed=(w(this,T),w(this,L,!0)),this.maxDepth=(w(this,V),w(this,B,3)),this.showToggle=(w(this,O),w(this,j,!0)),this.column=(w(this,P),w(this,N,null)),this.rowData=(w(this,H),w(this,q,null)),this.align=(w(this,_),w(this,G,"left")),this.type=(w(this,K),w(this,W,"json")),w(this,U)}})})(),(()=>{let t,a,c,h,u,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z,$=[i("snice-cell-currency")],F=[],I=HTMLElement,T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],te=[],ie=[],ae=[],ne=[],le=[],re=[],oe=[];(class extends I{static{a=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(I[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({})],p=[s({type:Object,attribute:!1})],g=[s({type:Object,attribute:!1})],b=[n(".cell-content")],f=[s({type:Number})],v=[s({type:Boolean,attribute:"thousands-separator"})],k=[s({type:String})],x=[s({type:String})],C=[s({type:String})],S=[s({type:String,attribute:"negative-style"})],E=[s({type:Boolean})],D=[l()],A=[r()],R=[o()],M=[d("align")],z=[d("value","column")],y(this,null,D,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,T),y(this,null,A,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,T),y(this,null,R,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,T),y(this,null,M,{kind:"method",name:"updateAlignment",static:!1,private:!1,access:{has:e=>"updateAlignment"in e,get:e=>e.updateAlignment},metadata:e},null,T),y(this,null,z,{kind:"method",name:"updateContent",static:!1,private:!1,access:{has:e=>"updateContent"in e,get:e=>e.updateContent},metadata:e},null,T),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},L,V),y(null,null,h,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},B,O),y(null,null,u,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},j,P),y(null,null,p,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},N,H),y(null,null,g,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},q,_),y(null,null,b,{kind:"field",name:"contentElement",static:!1,private:!1,access:{has:e=>"contentElement"in e,get:e=>e.contentElement,set:(e,t)=>{e.contentElement=t}},metadata:e},G,K),y(null,null,f,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:e},W,U),y(null,null,v,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:e},Z,Y),y(null,null,k,{kind:"field",name:"currency",static:!1,private:!1,access:{has:e=>"currency"in e,get:e=>e.currency,set:(e,t)=>{e.currency=t}},metadata:e},J,Q),y(null,null,x,{kind:"field",name:"currencyDisplay",static:!1,private:!1,access:{has:e=>"currencyDisplay"in e,get:e=>e.currencyDisplay,set:(e,t)=>{e.currencyDisplay=t}},metadata:e},X,te),y(null,null,C,{kind:"field",name:"locale",static:!1,private:!1,access:{has:e=>"locale"in e,get:e=>e.locale,set:(e,t)=>{e.locale=t}},metadata:e},ie,ae),y(null,null,S,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:e},ne,le),y(null,null,E,{kind:"field",name:"highlight",static:!1,private:!1,access:{has:e=>"highlight"in e,get:e=>e.highlight,set:(e,t)=>{e.highlight=t}},metadata:e},re,oe),y(null,t={value:a},$,{kind:"class",name:a.name,metadata:e},null,F),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,F)}render(){const t=this.formatCurrencyValue(),i=this.getCurrencyStyles();return e`
|
|
539
539
|
<div class="cell-content cell-content--number" part="content" style="${i}">
|
|
540
540
|
${t}
|
|
541
541
|
</div>
|
|
542
|
-
`}styles(){return m`${
|
|
542
|
+
`}styles(){return m`${ee}`}init(){se(this),this.applyAlignment()}applyAlignment(){this.style.textAlign=this.align}updateAlignment(){this.applyAlignment()}updateContent(){if(this.contentElement){const e=this.formatCurrencyValue(),t=this.getCurrencyStyles();this.contentElement.innerHTML=e,this.contentElement.setAttribute("style",t)}}formatCurrencyValue(){if(null==this.value||""===this.value)return"";if(this.column.formatter)return this.column.formatter(this.value,this.rowData);const e=this.column.currencyFormat||{decimals:this.decimals,currency:this.currency,currencyDisplay:this.currencyDisplay,locale:this.locale,negativeStyle:this.negativeStyle},t=Number(this.value);if(isNaN(t))return String(this.value);try{let i=new Intl.NumberFormat(e.locale||this.locale,{style:"currency",currency:e.currency||this.currency,currencyDisplay:e.currencyDisplay||e.display||this.currencyDisplay,useGrouping:e.thousandsSeparator??this.thousandsSeparator,minimumFractionDigits:e.decimals??this.decimals,maximumFractionDigits:e.decimals??this.decimals}).format(Math.abs(t));return t<0&&(i="parentheses"===(e.negativeStyle??this.negativeStyle)?`(${i})`:`-${i}`),i}catch(i){let a=t.toFixed(e.decimals??this.decimals);if(e.thousandsSeparator??this.thousandsSeparator){const e=a.split(".");e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),a=e.join(".")}return`$${a}`}}getCurrencyStyles(){const e=Number(this.value);return this.classList.remove("number--negative","number--positive","number--zero","number--highlighted"),e<0?(this.classList.add("number--negative"),"red"===(this.column.currencyFormat?.negativeStyle??this.negativeStyle)&&this.classList.add("number--negative-red")):e>0?(this.classList.add("number--positive"),this.highlight&&this.classList.add("number--highlighted")):0===e&&this.classList.add("number--zero"),"text-align: right"}constructor(){super(...arguments),this.align=(w(this,T),w(this,L,"right")),this.type=(w(this,V),w(this,B,"currency")),this.value=(w(this,O),w(this,j,"")),this.column=(w(this,P),w(this,N,{key:"",label:"",type:"currency",align:"right"})),this.rowData=(w(this,H),w(this,q,null)),this.contentElement=(w(this,_),w(this,G,void 0)),this.decimals=(w(this,K),w(this,W,2)),this.thousandsSeparator=(w(this,U),w(this,Z,!0)),this.currency=(w(this,Y),w(this,J,"USD")),this.currencyDisplay=(w(this,Q),w(this,X,"symbol")),this.locale=(w(this,te),w(this,ie,"en-US")),this.negativeStyle=(w(this,ae),w(this,ne,"red")),this.highlight=(w(this,le),w(this,re,!1)),w(this,oe)}})})(),(()=>{let a,n,c,h,u,p,g,b,f,v,k,x,C,S,E,A,R,M,z=[i("snice-cell-image")],$=[],F=HTMLElement,I=[],T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[],X=[],ee=[],te=[],ie=[],ae=[];(class extends F{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(F[Symbol.metadata]??null):void 0;c=[s({type:String})],h=[s({type:String})],u=[s({type:String})],p=[s({type:String})],g=[s({type:String})],b=[s({type:String})],f=[s({type:Boolean})],v=[s({type:Object,attribute:!1})],k=[s({type:Object,attribute:!1})],x=[s({type:String})],C=[s({type:String})],S=[s({type:Boolean})],E=[l()],A=[r()],R=[o()],M=[d("value","column")],y(this,null,E,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,I),y(this,null,A,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,I),y(this,null,R,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,I),y(this,null,M,{kind:"method",name:"updateImageAttributes",static:!1,private:!1,access:{has:e=>"updateImageAttributes"in e,get:e=>e.updateImageAttributes},metadata:e},null,I),y(null,null,c,{kind:"field",name:"value",static:!1,private:!1,access:{has:e=>"value"in e,get:e=>e.value,set:(e,t)=>{e.value=t}},metadata:e},T,L),y(null,null,h,{kind:"field",name:"src",static:!1,private:!1,access:{has:e=>"src"in e,get:e=>e.src,set:(e,t)=>{e.src=t}},metadata:e},V,B),y(null,null,u,{kind:"field",name:"alt",static:!1,private:!1,access:{has:e=>"alt"in e,get:e=>e.alt,set:(e,t)=>{e.alt=t}},metadata:e},O,j),y(null,null,p,{kind:"field",name:"fallback",static:!1,private:!1,access:{has:e=>"fallback"in e,get:e=>e.fallback,set:(e,t)=>{e.fallback=t}},metadata:e},P,N),y(null,null,g,{kind:"field",name:"variant",static:!1,private:!1,access:{has:e=>"variant"in e,get:e=>e.variant,set:(e,t)=>{e.variant=t}},metadata:e},H,q),y(null,null,b,{kind:"field",name:"size",static:!1,private:!1,access:{has:e=>"size"in e,get:e=>e.size,set:(e,t)=>{e.size=t}},metadata:e},_,G),y(null,null,f,{kind:"field",name:"lazy",static:!1,private:!1,access:{has:e=>"lazy"in e,get:e=>e.lazy,set:(e,t)=>{e.lazy=t}},metadata:e},K,W),y(null,null,v,{kind:"field",name:"column",static:!1,private:!1,access:{has:e=>"column"in e,get:e=>e.column,set:(e,t)=>{e.column=t}},metadata:e},U,Z),y(null,null,k,{kind:"field",name:"rowData",static:!1,private:!1,access:{has:e=>"rowData"in e,get:e=>e.rowData,set:(e,t)=>{e.rowData=t}},metadata:e},Y,J),y(null,null,x,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},Q,X),y(null,null,C,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},ee,te),y(null,null,S,{kind:"field",name:"imageError",static:!1,private:!1,access:{has:e=>"imageError"in e,get:e=>e.imageError,set:(e,t)=>{e.imageError=t}},metadata:e},ie,ae),y(null,a={value:n},z,{kind:"class",name:n.name,metadata:e},null,$),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,$)}render(){const i=this.src||this.value,a=this.alt||"Image",s=`cell-image image--${this.variant} image--${this.size}`;return this.imageError&&this.fallback?e`
|
|
543
543
|
<div class="cell-content cell-content--image" part="content">
|
|
544
544
|
<img src="${this.fallback}" alt="${a}" class="${s}" />
|
|
545
545
|
</div>
|
|
@@ -550,10 +550,10 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
550
550
|
`:e`
|
|
551
551
|
<div class="cell-content cell-content--image" part="content">
|
|
552
552
|
<div class="${s} cell-image--placeholder">
|
|
553
|
-
<span class="cell-image__placeholder-icon" aria-hidden="true">${t(
|
|
553
|
+
<span class="cell-image__placeholder-icon" aria-hidden="true">${t(D)}</span>
|
|
554
554
|
</div>
|
|
555
555
|
</div>
|
|
556
|
-
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center}.cell-image{display:block;object-fit:cover;background-color:rgb(243 244 246)}.image--small{width:1.5rem;height:1.5rem}.image--medium{width:2rem;height:2rem}.image--large{width:3rem;height:3rem}.image--rounded{border-radius:.25rem}.image--square{border-radius:0}.image--circle{border-radius:50%}.cell-image--placeholder{background:linear-gradient(135deg,rgb(229 231 235) 0,rgb(209 213 219) 100%);border:1px solid rgb(209 213 219);position:relative}.cell-image__placeholder-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-flex;align-items:center;justify-content:center;color:var(--snice-color-text-tertiary,rgb(115 115 115));opacity:.55}.cell-image__placeholder-icon svg{width:50%;max-width:1.25rem;height:auto}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}:host(.loading) .cell-image{opacity:.6;animation:1.5s ease-in-out infinite image-pulse}@keyframes image-pulse{0%,100%{opacity:.6}50%{opacity:.3}}@media (max-width:768px){.image--small{width:1.25rem;height:1.25rem}.image--medium{width:1.75rem;height:1.75rem}.image--large{width:2.5rem;height:2.5rem}}@media (prefers-reduced-motion:reduce){:host(.loading) .cell-image{animation:none}}@media print{.cell-image{max-width:2rem;max-height:2rem}}"}`}init(){ae(this,!0),this.updateImageAttributes()}updateImageAttributes(){if(this.column?.imageFormat){const e=this.column.imageFormat;this.src=e.src||this.value,this.alt=e.alt||"",this.fallback=e.fallback||"",this.variant=e.variant||e.shape||"rounded",this.size=e.size||"medium",this.lazy=e.lazy??!0}}handleImageError(){this.imageError=!0}constructor(){super(...arguments),this.value=(w(this,I),w(this,T,"")),this.src=(w(this,L),w(this,V,"")),this.alt=(w(this,B),w(this,O,"")),this.fallback=(w(this,j),w(this,P,"")),this.variant=(w(this,N),w(this,H,"rounded")),this.size=(w(this,q),w(this,_,"medium")),this.lazy=(w(this,G),w(this,K,!0)),this.column=(w(this,W),w(this,U,null)),this.rowData=(w(this,Z),w(this,Y,null)),this.align=(w(this,J),w(this,Q,"center")),this.type=(w(this,X),w(this,ee,"image")),this.imageError=(w(this,te),w(this,ie,!1)),w(this,se)}})})(),(()=>{let t,a,n,r,o,c,h,u,m,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z,F,$,I,T,L,V,B,O,j,P,N,H,q,_,G,K,W,U,Z,Y,J,Q,X,ee,te,ie,ae,se,ne,le,re,oe=[i("snice-column")],ce=[],de=HTMLElement,he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[],ke=[],xe=[],Ce=[],Se=[],Ee=[],De=[],Ae=[],Re=[],Me=[],ze=[],Fe=[],$e=[],Ie=[],Te=[],Le=[],Ve=[],Be=[],Oe=[],je=[],Pe=[],Ne=[],He=[],qe=[],_e=[],Ge=[],Ke=[],We=[],Ue=[],Ze=[],Ye=[],Je=[],Qe=[],Xe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],mt=[],pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],Ft=[],$t=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[];(class extends de{static{a=this}constructor(){super(...arguments),this.key=(w(this,he),w(this,ue,"")),this.label=(w(this,me),w(this,pe,"")),this.type=(w(this,ge),w(this,be,"text")),this.align=(w(this,fe),w(this,ve,"left")),this.width=(w(this,ye),w(this,we,"")),this.sortable=(w(this,ke),w(this,xe,!0)),this.filterable=(w(this,Ce),w(this,Se,!0)),this.wrap=(w(this,Ee),w(this,De,!1)),this.ellipsis=(w(this,Ae),w(this,Re,!0)),this.tooltip=(w(this,Me),w(this,ze,!1)),this.aggregateType=(w(this,Fe),w(this,$e,"")),this.aggregateFunction=w(this,Ie),this.decimals=w(this,Te,void 0),this.thousandsSeparator=(w(this,Le),w(this,Ve,void 0)),this.numberPrefix=(w(this,Be),w(this,Oe,void 0)),this.numberSuffix=(w(this,je),w(this,Pe,void 0)),this.negativeStyle=(w(this,Ne),w(this,He,void 0)),this.dateFormat=(w(this,qe),w(this,_e,void 0)),this.customDateFormat=(w(this,Ge),w(this,Ke,void 0)),this.dateLocale=(w(this,We),w(this,Ue,void 0)),this.trueValue=(w(this,Ze),w(this,Ye,void 0)),this.falseValue=(w(this,Je),w(this,Qe,void 0)),this.useSymbols=(w(this,Xe),w(this,et,void 0)),this.trueSymbol=(w(this,tt),w(this,it,void 0)),this.falseSymbol=(w(this,at),w(this,st,void 0)),this.ratingMax=(w(this,nt),w(this,lt,void 0)),this.ratingSymbol=(w(this,rt),w(this,ot,void 0)),this.ratingEmptySymbol=(w(this,ct),w(this,dt,void 0)),this.ratingColor=(w(this,ht),w(this,ut,void 0)),this.progressMax=(w(this,mt),w(this,pt,void 0)),this.showPercentage=(w(this,gt),w(this,bt,void 0)),this.progressColor=(w(this,ft),w(this,vt,void 0)),this.progressBgColor=(w(this,yt),w(this,wt,void 0)),this.progressHeight=(w(this,kt),w(this,xt,void 0)),this.sparklineType=(w(this,Ct),w(this,St,void 0)),this.sparklineColor=(w(this,Et),w(this,Dt,void 0)),this.sparklineWidth=(w(this,At),w(this,Rt,void 0)),this.sparklineHeight=(w(this,Mt),w(this,zt,void 0)),this.cellBgColor=(w(this,Ft),w(this,$t,void 0)),this.cellColor=(w(this,It),w(this,Tt,void 0)),this.cellFontWeight=(w(this,Lt),w(this,Vt,void 0)),this.cellFontStyle=(w(this,Bt),w(this,Ot,void 0)),this.cellFontSize=(w(this,jt),w(this,Pt,void 0)),this.cellTextDecoration=(w(this,Nt),w(this,Ht,void 0)),this.formatter=w(this,qt),this.conditionalFormats=[]}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(de[Symbol.metadata]??null):void 0;n=[s({})],r=[s({})],o=[s({})],c=[s({})],h=[s({})],u=[s({type:Boolean})],m=[s({type:Boolean})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:Boolean})],f=[s({attribute:"aggregate"})],v=[s({type:Number,attribute:"decimals"})],k=[s({type:Boolean,attribute:"thousands-separator"})],x=[s({attribute:"number-prefix"})],C=[s({attribute:"number-suffix"})],S=[s({attribute:"negative-style"})],E=[s({attribute:"date-format"})],D=[s({attribute:"custom-date-format"})],A=[s({attribute:"date-locale"})],R=[s({attribute:"true-value"})],M=[s({attribute:"false-value"})],z=[s({type:Boolean,attribute:"use-symbols"})],F=[s({attribute:"true-symbol"})],$=[s({attribute:"false-symbol"})],I=[s({type:Number,attribute:"rating-max"})],T=[s({attribute:"rating-symbol"})],L=[s({attribute:"rating-empty-symbol"})],V=[s({attribute:"rating-color"})],B=[s({type:Number,attribute:"progress-max"})],O=[s({type:Boolean,attribute:"show-percentage"})],j=[s({attribute:"progress-color"})],P=[s({attribute:"progress-bg-color"})],N=[s({attribute:"progress-height"})],H=[s({attribute:"sparkline-type"})],q=[s({attribute:"sparkline-color"})],_=[s({type:Number,attribute:"sparkline-width"})],G=[s({type:Number,attribute:"sparkline-height"})],K=[s({attribute:"cell-bg-color"})],W=[s({attribute:"cell-color"})],U=[s({attribute:"cell-font-weight"})],Z=[s({attribute:"cell-font-style"})],Y=[s({attribute:"cell-font-size"})],J=[s({attribute:"cell-text-decoration"})],Q=[l()],X=[d("key","label","type","align","width","sortable","filterable","wrap","ellipsis","tooltip")],ee=[d("aggregateType")],te=[d("decimals","thousandsSeparator","numberPrefix","numberSuffix","negativeStyle")],ie=[d("dateFormat","customDateFormat","dateLocale")],ae=[d("trueValue","falseValue","useSymbols","trueSymbol","falseSymbol")],se=[d("ratingMax","ratingSymbol","ratingEmptySymbol","ratingColor")],ne=[d("progressMax","showPercentage","progressColor","progressBgColor","progressHeight")],le=[d("sparklineType","sparklineColor","sparklineWidth","sparklineHeight")],re=[d("cellBgColor","cellColor","cellFontWeight","cellFontStyle","cellFontSize","cellTextDecoration")],y(this,null,Q,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,he),y(this,null,X,{kind:"method",name:"handleBasicPropsChange",static:!1,private:!1,access:{has:e=>"handleBasicPropsChange"in e,get:e=>e.handleBasicPropsChange},metadata:e},null,he),y(this,null,ee,{kind:"method",name:"handleAggregateChange",static:!1,private:!1,access:{has:e=>"handleAggregateChange"in e,get:e=>e.handleAggregateChange},metadata:e},null,he),y(this,null,te,{kind:"method",name:"handleNumberFormatChange",static:!1,private:!1,access:{has:e=>"handleNumberFormatChange"in e,get:e=>e.handleNumberFormatChange},metadata:e},null,he),y(this,null,ie,{kind:"method",name:"handleDateFormatChange",static:!1,private:!1,access:{has:e=>"handleDateFormatChange"in e,get:e=>e.handleDateFormatChange},metadata:e},null,he),y(this,null,ae,{kind:"method",name:"handleBooleanFormatChange",static:!1,private:!1,access:{has:e=>"handleBooleanFormatChange"in e,get:e=>e.handleBooleanFormatChange},metadata:e},null,he),y(this,null,se,{kind:"method",name:"handleRatingFormatChange",static:!1,private:!1,access:{has:e=>"handleRatingFormatChange"in e,get:e=>e.handleRatingFormatChange},metadata:e},null,he),y(this,null,ne,{kind:"method",name:"handleProgressFormatChange",static:!1,private:!1,access:{has:e=>"handleProgressFormatChange"in e,get:e=>e.handleProgressFormatChange},metadata:e},null,he),y(this,null,le,{kind:"method",name:"handleSparklineFormatChange",static:!1,private:!1,access:{has:e=>"handleSparklineFormatChange"in e,get:e=>e.handleSparklineFormatChange},metadata:e},null,he),y(this,null,re,{kind:"method",name:"handleStyleChange",static:!1,private:!1,access:{has:e=>"handleStyleChange"in e,get:e=>e.handleStyleChange},metadata:e},null,he),y(null,null,n,{kind:"field",name:"key",static:!1,private:!1,access:{has:e=>"key"in e,get:e=>e.key,set:(e,t)=>{e.key=t}},metadata:e},ue,me),y(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},pe,ge),y(null,null,o,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},be,fe),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},ve,ye),y(null,null,h,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:e},we,ke),y(null,null,u,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:e},xe,Ce),y(null,null,m,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:e},Se,Ee),y(null,null,p,{kind:"field",name:"wrap",static:!1,private:!1,access:{has:e=>"wrap"in e,get:e=>e.wrap,set:(e,t)=>{e.wrap=t}},metadata:e},De,Ae),y(null,null,g,{kind:"field",name:"ellipsis",static:!1,private:!1,access:{has:e=>"ellipsis"in e,get:e=>e.ellipsis,set:(e,t)=>{e.ellipsis=t}},metadata:e},Re,Me),y(null,null,b,{kind:"field",name:"tooltip",static:!1,private:!1,access:{has:e=>"tooltip"in e,get:e=>e.tooltip,set:(e,t)=>{e.tooltip=t}},metadata:e},ze,Fe),y(null,null,f,{kind:"field",name:"aggregateType",static:!1,private:!1,access:{has:e=>"aggregateType"in e,get:e=>e.aggregateType,set:(e,t)=>{e.aggregateType=t}},metadata:e},$e,Ie),y(null,null,v,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:e},Te,Le),y(null,null,k,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:e},Ve,Be),y(null,null,x,{kind:"field",name:"numberPrefix",static:!1,private:!1,access:{has:e=>"numberPrefix"in e,get:e=>e.numberPrefix,set:(e,t)=>{e.numberPrefix=t}},metadata:e},Oe,je),y(null,null,C,{kind:"field",name:"numberSuffix",static:!1,private:!1,access:{has:e=>"numberSuffix"in e,get:e=>e.numberSuffix,set:(e,t)=>{e.numberSuffix=t}},metadata:e},Pe,Ne),y(null,null,S,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:e},He,qe),y(null,null,E,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:e},_e,Ge),y(null,null,D,{kind:"field",name:"customDateFormat",static:!1,private:!1,access:{has:e=>"customDateFormat"in e,get:e=>e.customDateFormat,set:(e,t)=>{e.customDateFormat=t}},metadata:e},Ke,We),y(null,null,A,{kind:"field",name:"dateLocale",static:!1,private:!1,access:{has:e=>"dateLocale"in e,get:e=>e.dateLocale,set:(e,t)=>{e.dateLocale=t}},metadata:e},Ue,Ze),y(null,null,R,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:e},Ye,Je),y(null,null,M,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:e},Qe,Xe),y(null,null,z,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:e},et,tt),y(null,null,F,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:e},it,at),y(null,null,$,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:e},st,nt),y(null,null,I,{kind:"field",name:"ratingMax",static:!1,private:!1,access:{has:e=>"ratingMax"in e,get:e=>e.ratingMax,set:(e,t)=>{e.ratingMax=t}},metadata:e},lt,rt),y(null,null,T,{kind:"field",name:"ratingSymbol",static:!1,private:!1,access:{has:e=>"ratingSymbol"in e,get:e=>e.ratingSymbol,set:(e,t)=>{e.ratingSymbol=t}},metadata:e},ot,ct),y(null,null,L,{kind:"field",name:"ratingEmptySymbol",static:!1,private:!1,access:{has:e=>"ratingEmptySymbol"in e,get:e=>e.ratingEmptySymbol,set:(e,t)=>{e.ratingEmptySymbol=t}},metadata:e},dt,ht),y(null,null,V,{kind:"field",name:"ratingColor",static:!1,private:!1,access:{has:e=>"ratingColor"in e,get:e=>e.ratingColor,set:(e,t)=>{e.ratingColor=t}},metadata:e},ut,mt),y(null,null,B,{kind:"field",name:"progressMax",static:!1,private:!1,access:{has:e=>"progressMax"in e,get:e=>e.progressMax,set:(e,t)=>{e.progressMax=t}},metadata:e},pt,gt),y(null,null,O,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:e=>"showPercentage"in e,get:e=>e.showPercentage,set:(e,t)=>{e.showPercentage=t}},metadata:e},bt,ft),y(null,null,j,{kind:"field",name:"progressColor",static:!1,private:!1,access:{has:e=>"progressColor"in e,get:e=>e.progressColor,set:(e,t)=>{e.progressColor=t}},metadata:e},vt,yt),y(null,null,P,{kind:"field",name:"progressBgColor",static:!1,private:!1,access:{has:e=>"progressBgColor"in e,get:e=>e.progressBgColor,set:(e,t)=>{e.progressBgColor=t}},metadata:e},wt,kt),y(null,null,N,{kind:"field",name:"progressHeight",static:!1,private:!1,access:{has:e=>"progressHeight"in e,get:e=>e.progressHeight,set:(e,t)=>{e.progressHeight=t}},metadata:e},xt,Ct),y(null,null,H,{kind:"field",name:"sparklineType",static:!1,private:!1,access:{has:e=>"sparklineType"in e,get:e=>e.sparklineType,set:(e,t)=>{e.sparklineType=t}},metadata:e},St,Et),y(null,null,q,{kind:"field",name:"sparklineColor",static:!1,private:!1,access:{has:e=>"sparklineColor"in e,get:e=>e.sparklineColor,set:(e,t)=>{e.sparklineColor=t}},metadata:e},Dt,At),y(null,null,_,{kind:"field",name:"sparklineWidth",static:!1,private:!1,access:{has:e=>"sparklineWidth"in e,get:e=>e.sparklineWidth,set:(e,t)=>{e.sparklineWidth=t}},metadata:e},Rt,Mt),y(null,null,G,{kind:"field",name:"sparklineHeight",static:!1,private:!1,access:{has:e=>"sparklineHeight"in e,get:e=>e.sparklineHeight,set:(e,t)=>{e.sparklineHeight=t}},metadata:e},zt,Ft),y(null,null,K,{kind:"field",name:"cellBgColor",static:!1,private:!1,access:{has:e=>"cellBgColor"in e,get:e=>e.cellBgColor,set:(e,t)=>{e.cellBgColor=t}},metadata:e},$t,It),y(null,null,W,{kind:"field",name:"cellColor",static:!1,private:!1,access:{has:e=>"cellColor"in e,get:e=>e.cellColor,set:(e,t)=>{e.cellColor=t}},metadata:e},Tt,Lt),y(null,null,U,{kind:"field",name:"cellFontWeight",static:!1,private:!1,access:{has:e=>"cellFontWeight"in e,get:e=>e.cellFontWeight,set:(e,t)=>{e.cellFontWeight=t}},metadata:e},Vt,Bt),y(null,null,Z,{kind:"field",name:"cellFontStyle",static:!1,private:!1,access:{has:e=>"cellFontStyle"in e,get:e=>e.cellFontStyle,set:(e,t)=>{e.cellFontStyle=t}},metadata:e},Ot,jt),y(null,null,Y,{kind:"field",name:"cellFontSize",static:!1,private:!1,access:{has:e=>"cellFontSize"in e,get:e=>e.cellFontSize,set:(e,t)=>{e.cellFontSize=t}},metadata:e},Pt,Nt),y(null,null,J,{kind:"field",name:"cellTextDecoration",static:!1,private:!1,access:{has:e=>"cellTextDecoration"in e,get:e=>e.cellTextDecoration,set:(e,t)=>{e.cellTextDecoration=t}},metadata:e},Ht,qt),y(null,t={value:a},oe,{kind:"class",name:a.name,metadata:e},null,ce),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,ce)}get aggregate(){return this.aggregateFunction??(this.aggregateType||void 0)}set aggregate(e){const t=this.aggregate;if("function"==typeof e)return this.aggregateFunction=e,void(""!==this.aggregateType?this.aggregateType="":t!==e&&this.notifyTableOfChange());this.aggregateFunction=void 0;const i=e??"";this.aggregateType!==i?this.aggregateType=i:t!==this.aggregate&&this.notifyTableOfChange()}render(){return e`<slot></slot>`}setFormatter(e){this.formatter=e,this.notifyTableOfChange()}addConditionalFormat(e){this.conditionalFormats.push(e),this.notifyTableOfChange()}removeConditionalFormat(e){this.conditionalFormats.splice(e,1),this.notifyTableOfChange()}clearConditionalFormats(){this.conditionalFormats=[],this.notifyTableOfChange()}getColumnDefinition(){const e={key:this.key,label:this.label,type:this.type,align:this.align,width:this.width,sortable:this.sortable,filterable:this.filterable,wrap:this.wrap,ellipsis:this.ellipsis,tooltip:this.tooltip,formatter:this.formatter,conditionalFormats:this.conditionalFormats};if(this.aggregate&&(e.aggregate=this.aggregate),"number"===this.type||"currency"===this.type||"percent"===this.type||"accounting"===this.type||"scientific"===this.type||"fraction"===this.type){const t={};void 0!==this.decimals&&(t.decimals=this.decimals),void 0!==this.thousandsSeparator&&(t.thousandsSeparator=this.thousandsSeparator),this.numberPrefix&&(t.prefix=this.numberPrefix),this.numberSuffix&&(t.suffix=this.numberSuffix),this.negativeStyle&&(t.negativeStyle=this.negativeStyle),Object.keys(t).length>0&&(e.numberFormat=t)}if("date"===this.type){const t={};this.dateFormat&&(t.format=this.dateFormat),this.customDateFormat&&(t.customFormat=this.customDateFormat),this.dateLocale&&(t.locale=this.dateLocale),Object.keys(t).length>0&&(e.dateFormat=t)}if("boolean"===this.type){const t={};this.trueValue&&(t.trueValue=this.trueValue),this.falseValue&&(t.falseValue=this.falseValue),void 0!==this.useSymbols&&(t.useSymbols=this.useSymbols),this.trueSymbol&&(t.trueSymbol=this.trueSymbol),this.falseSymbol&&(t.falseSymbol=this.falseSymbol),Object.keys(t).length>0&&(e.booleanFormat=t)}if("rating"===this.type){const t={};void 0!==this.ratingMax&&(t.max=this.ratingMax),this.ratingSymbol&&(t.symbol=this.ratingSymbol),this.ratingEmptySymbol&&(t.emptySymbol=this.ratingEmptySymbol),this.ratingColor&&(t.color=this.ratingColor),Object.keys(t).length>0&&(e.ratingFormat=t)}if("progress"===this.type){const t={};void 0!==this.progressMax&&(t.max=this.progressMax),void 0!==this.showPercentage&&(t.showPercentage=this.showPercentage),this.progressColor&&(t.color=this.progressColor),this.progressBgColor&&(t.backgroundColor=this.progressBgColor),this.progressHeight&&(t.height=this.progressHeight),Object.keys(t).length>0&&(e.progressFormat=t)}if("sparkline"===this.type){const t={};this.sparklineType&&(t.type=this.sparklineType),this.sparklineColor&&(t.color=this.sparklineColor),void 0!==this.sparklineWidth&&(t.width=this.sparklineWidth),void 0!==this.sparklineHeight&&(t.height=this.sparklineHeight),Object.keys(t).length>0&&(e.sparklineFormat=t)}const t={};return this.cellBgColor&&(t.backgroundColor=this.cellBgColor),this.cellColor&&(t.color=this.cellColor),this.cellFontWeight&&(t.fontWeight=this.cellFontWeight),this.cellFontStyle&&(t.fontStyle=this.cellFontStyle),this.cellFontSize&&(t.fontSize=this.cellFontSize),this.cellTextDecoration&&(t.textDecoration=this.cellTextDecoration),Object.keys(t).length>0&&(e.style=t),e}handleBasicPropsChange(){this.notifyTableOfChange()}handleAggregateChange(){this.aggregateType&&(this.aggregateFunction=void 0),this.notifyTableOfChange()}handleNumberFormatChange(){"number"!==this.type&&"currency"!==this.type&&"percent"!==this.type&&"accounting"!==this.type&&"scientific"!==this.type&&"fraction"!==this.type||this.notifyTableOfChange()}handleDateFormatChange(){"date"===this.type&&this.notifyTableOfChange()}handleBooleanFormatChange(){"boolean"===this.type&&this.notifyTableOfChange()}handleRatingFormatChange(){"rating"===this.type&&this.notifyTableOfChange()}handleProgressFormatChange(){"progress"===this.type&&this.notifyTableOfChange()}handleSparklineFormatChange(){"sparkline"===this.type&&this.notifyTableOfChange()}handleStyleChange(){this.notifyTableOfChange()}notifyTableOfChange(){this.dispatchEvent(new CustomEvent("column-changed",{detail:{column:this.getColumnDefinition()},bubbles:!0,composed:!0}))}})})(),(()=>{let a,n,c,u,p,g,b,v,k,x,C,S,E,D,A,R,M,z,F,$,I=[i("snice-row")],T=[],L=HTMLElement,V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[];(class extends L{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(L[Symbol.metadata]??null):void 0;c=[s({type:Boolean})],u=[s({type:Boolean})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:Boolean,attribute:!1})],v=[s({type:Object,attribute:!1})],k=[s({type:Number})],x=[s({type:Array,attribute:!1})],C=[l()],S=[r()],E=[o()],D=[d("selected")],A=[d("hoverable","clickable","selectable","selectionDisabled")],R=[d("data","columns")],M=[f("mouseenter")],z=[h("row-click",{bubbles:!0,composed:!0})],F=[h("row-select",{bubbles:!0,composed:!0})],$=[h("row-hover",{bubbles:!0,composed:!0})],y(this,null,C,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,V),y(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,V),y(this,null,E,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,V),y(this,null,D,{kind:"method",name:"updateSelection",static:!1,private:!1,access:{has:e=>"updateSelection"in e,get:e=>e.updateSelection},metadata:e},null,V),y(this,null,A,{kind:"method",name:"updateRowAttributes",static:!1,private:!1,access:{has:e=>"updateRowAttributes"in e,get:e=>e.updateRowAttributes},metadata:e},null,V),y(this,null,R,{kind:"method",name:"updateCells",static:!1,private:!1,access:{has:e=>"updateCells"in e,get:e=>e.updateCells},metadata:e},null,V),y(this,null,M,{kind:"method",name:"handleRowHover",static:!1,private:!1,access:{has:e=>"handleRowHover"in e,get:e=>e.handleRowHover},metadata:e},null,V),y(this,null,z,{kind:"method",name:"dispatchRowClick",static:!1,private:!1,access:{has:e=>"dispatchRowClick"in e,get:e=>e.dispatchRowClick},metadata:e},null,V),y(this,null,F,{kind:"method",name:"dispatchRowSelect",static:!1,private:!1,access:{has:e=>"dispatchRowSelect"in e,get:e=>e.dispatchRowSelect},metadata:e},null,V),y(this,null,$,{kind:"method",name:"dispatchRowHover",static:!1,private:!1,access:{has:e=>"dispatchRowHover"in e,get:e=>e.dispatchRowHover},metadata:e},null,V),y(null,null,c,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:e},B,O),y(null,null,u,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:e},j,P),y(null,null,p,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:e},N,H),y(null,null,g,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:e},q,_),y(null,null,b,{kind:"field",name:"selectionDisabled",static:!1,private:!1,access:{has:e=>"selectionDisabled"in e,get:e=>e.selectionDisabled,set:(e,t)=>{e.selectionDisabled=t}},metadata:e},G,K),y(null,null,v,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:e},W,U),y(null,null,k,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:e},Z,Y),y(null,null,x,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:e},J,Q),y(null,a={value:n},I,{kind:"class",name:n.name,metadata:e},null,T),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,T)}extractDataFromAttributes(){const e={};return this.getAttributeNames().filter(e=>e.startsWith("data-")&&"data-column-index"!==e).forEach(t=>{const i=t.slice(5),a=this.getAttribute(t);null!==a&&(e[i]=a)}),e}render(){return e`
|
|
556
|
+
`}styles(){return m`${":host{color:var(--snice-color-text,rgb(23 23 23));display:flex;align-items:center;min-height:2.5rem;min-width:6.25rem;flex:1;font-size:.875rem;line-height:1.25rem}.cell-content{width:100%;min-width:6.25rem;min-height:1.25rem;display:flex;align-items:center}.cell-image{display:block;object-fit:cover;background-color:rgb(243 244 246)}.image--small{width:1.5rem;height:1.5rem}.image--medium{width:2rem;height:2rem}.image--large{width:3rem;height:3rem}.image--rounded{border-radius:.25rem}.image--square{border-radius:0}.image--circle{border-radius:50%}.cell-image--placeholder{background:linear-gradient(135deg,rgb(229 231 235) 0,rgb(209 213 219) 100%);border:1px solid rgb(209 213 219);position:relative}.cell-image__placeholder-icon{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:inline-flex;align-items:center;justify-content:center;color:var(--snice-color-text-tertiary,rgb(115 115 115));opacity:.55}.cell-image__placeholder-icon svg{width:50%;max-width:1.25rem;height:auto}:host([align=left]) .cell-content{justify-content:flex-start}:host([align=center]) .cell-content{justify-content:center}:host([align=right]) .cell-content{justify-content:flex-end}:host(.loading) .cell-image{opacity:.6;animation:1.5s ease-in-out infinite image-pulse}@keyframes image-pulse{0%,100%{opacity:.6}50%{opacity:.3}}@media (max-width:768px){.image--small{width:1.25rem;height:1.25rem}.image--medium{width:1.75rem;height:1.75rem}.image--large{width:2.5rem;height:2.5rem}}@media (prefers-reduced-motion:reduce){:host(.loading) .cell-image{animation:none}}@media print{.cell-image{max-width:2rem;max-height:2rem}}"}`}init(){se(this,!0),this.updateImageAttributes()}updateImageAttributes(){if(this.column?.imageFormat){const e=this.column.imageFormat;this.src=e.src||this.value,this.alt=e.alt||"",this.fallback=e.fallback||"",this.variant=e.variant||e.shape||"rounded",this.size=e.size||"medium",this.lazy=e.lazy??!0}}handleImageError(){this.imageError=!0}constructor(){super(...arguments),this.value=(w(this,I),w(this,T,"")),this.src=(w(this,L),w(this,V,"")),this.alt=(w(this,B),w(this,O,"")),this.fallback=(w(this,j),w(this,P,"")),this.variant=(w(this,N),w(this,H,"rounded")),this.size=(w(this,q),w(this,_,"medium")),this.lazy=(w(this,G),w(this,K,!0)),this.column=(w(this,W),w(this,U,null)),this.rowData=(w(this,Z),w(this,Y,null)),this.align=(w(this,J),w(this,Q,"center")),this.type=(w(this,X),w(this,ee,"image")),this.imageError=(w(this,te),w(this,ie,!1)),w(this,ae)}})})(),(()=>{let t,a,n,r,o,c,h,u,m,p,g,b,f,v,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B,O,j,P,N,H,q,_,G,K,W,U,Z,Y,J,Q,X,ee,te,ie,ae,se,ne,le,re,oe=[i("snice-column")],ce=[],de=HTMLElement,he=[],ue=[],me=[],pe=[],ge=[],be=[],fe=[],ve=[],ye=[],we=[],ke=[],xe=[],Ce=[],Se=[],Ee=[],De=[],Ae=[],Re=[],Me=[],ze=[],$e=[],Fe=[],Ie=[],Te=[],Le=[],Ve=[],Be=[],Oe=[],je=[],Pe=[],Ne=[],He=[],qe=[],_e=[],Ge=[],Ke=[],We=[],Ue=[],Ze=[],Ye=[],Je=[],Qe=[],Xe=[],et=[],tt=[],it=[],at=[],st=[],nt=[],lt=[],rt=[],ot=[],ct=[],dt=[],ht=[],ut=[],mt=[],pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],$t=[],Ft=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[];(class extends de{static{a=this}constructor(){super(...arguments),this.key=(w(this,he),w(this,ue,"")),this.label=(w(this,me),w(this,pe,"")),this.type=(w(this,ge),w(this,be,"text")),this.align=(w(this,fe),w(this,ve,"left")),this.width=(w(this,ye),w(this,we,"")),this.sortable=(w(this,ke),w(this,xe,!0)),this.filterable=(w(this,Ce),w(this,Se,!0)),this.wrap=(w(this,Ee),w(this,De,!1)),this.ellipsis=(w(this,Ae),w(this,Re,!0)),this.tooltip=(w(this,Me),w(this,ze,!1)),this.aggregateType=(w(this,$e),w(this,Fe,"")),this.aggregateFunction=w(this,Ie),this.decimals=w(this,Te,void 0),this.thousandsSeparator=(w(this,Le),w(this,Ve,void 0)),this.numberPrefix=(w(this,Be),w(this,Oe,void 0)),this.numberSuffix=(w(this,je),w(this,Pe,void 0)),this.negativeStyle=(w(this,Ne),w(this,He,void 0)),this.dateFormat=(w(this,qe),w(this,_e,void 0)),this.customDateFormat=(w(this,Ge),w(this,Ke,void 0)),this.dateLocale=(w(this,We),w(this,Ue,void 0)),this.trueValue=(w(this,Ze),w(this,Ye,void 0)),this.falseValue=(w(this,Je),w(this,Qe,void 0)),this.useSymbols=(w(this,Xe),w(this,et,void 0)),this.trueSymbol=(w(this,tt),w(this,it,void 0)),this.falseSymbol=(w(this,at),w(this,st,void 0)),this.ratingMax=(w(this,nt),w(this,lt,void 0)),this.ratingSymbol=(w(this,rt),w(this,ot,void 0)),this.ratingEmptySymbol=(w(this,ct),w(this,dt,void 0)),this.ratingColor=(w(this,ht),w(this,ut,void 0)),this.progressMax=(w(this,mt),w(this,pt,void 0)),this.showPercentage=(w(this,gt),w(this,bt,void 0)),this.progressColor=(w(this,ft),w(this,vt,void 0)),this.progressBgColor=(w(this,yt),w(this,wt,void 0)),this.progressHeight=(w(this,kt),w(this,xt,void 0)),this.sparklineType=(w(this,Ct),w(this,St,void 0)),this.sparklineColor=(w(this,Et),w(this,Dt,void 0)),this.sparklineWidth=(w(this,At),w(this,Rt,void 0)),this.sparklineHeight=(w(this,Mt),w(this,zt,void 0)),this.cellBgColor=(w(this,$t),w(this,Ft,void 0)),this.cellColor=(w(this,It),w(this,Tt,void 0)),this.cellFontWeight=(w(this,Lt),w(this,Vt,void 0)),this.cellFontStyle=(w(this,Bt),w(this,Ot,void 0)),this.cellFontSize=(w(this,jt),w(this,Pt,void 0)),this.cellTextDecoration=(w(this,Nt),w(this,Ht,void 0)),this.formatter=w(this,qt),this.conditionalFormats=[]}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(de[Symbol.metadata]??null):void 0;n=[s({})],r=[s({})],o=[s({})],c=[s({})],h=[s({})],u=[s({type:Boolean})],m=[s({type:Boolean})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:Boolean})],f=[s({attribute:"aggregate"})],v=[s({type:Number,attribute:"decimals"})],k=[s({type:Boolean,attribute:"thousands-separator"})],x=[s({attribute:"number-prefix"})],C=[s({attribute:"number-suffix"})],S=[s({attribute:"negative-style"})],E=[s({attribute:"date-format"})],D=[s({attribute:"custom-date-format"})],A=[s({attribute:"date-locale"})],R=[s({attribute:"true-value"})],M=[s({attribute:"false-value"})],z=[s({type:Boolean,attribute:"use-symbols"})],$=[s({attribute:"true-symbol"})],F=[s({attribute:"false-symbol"})],I=[s({type:Number,attribute:"rating-max"})],T=[s({attribute:"rating-symbol"})],L=[s({attribute:"rating-empty-symbol"})],V=[s({attribute:"rating-color"})],B=[s({type:Number,attribute:"progress-max"})],O=[s({type:Boolean,attribute:"show-percentage"})],j=[s({attribute:"progress-color"})],P=[s({attribute:"progress-bg-color"})],N=[s({attribute:"progress-height"})],H=[s({attribute:"sparkline-type"})],q=[s({attribute:"sparkline-color"})],_=[s({type:Number,attribute:"sparkline-width"})],G=[s({type:Number,attribute:"sparkline-height"})],K=[s({attribute:"cell-bg-color"})],W=[s({attribute:"cell-color"})],U=[s({attribute:"cell-font-weight"})],Z=[s({attribute:"cell-font-style"})],Y=[s({attribute:"cell-font-size"})],J=[s({attribute:"cell-text-decoration"})],Q=[l()],X=[d("key","label","type","align","width","sortable","filterable","wrap","ellipsis","tooltip")],ee=[d("aggregateType")],te=[d("decimals","thousandsSeparator","numberPrefix","numberSuffix","negativeStyle")],ie=[d("dateFormat","customDateFormat","dateLocale")],ae=[d("trueValue","falseValue","useSymbols","trueSymbol","falseSymbol")],se=[d("ratingMax","ratingSymbol","ratingEmptySymbol","ratingColor")],ne=[d("progressMax","showPercentage","progressColor","progressBgColor","progressHeight")],le=[d("sparklineType","sparklineColor","sparklineWidth","sparklineHeight")],re=[d("cellBgColor","cellColor","cellFontWeight","cellFontStyle","cellFontSize","cellTextDecoration")],y(this,null,Q,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,he),y(this,null,X,{kind:"method",name:"handleBasicPropsChange",static:!1,private:!1,access:{has:e=>"handleBasicPropsChange"in e,get:e=>e.handleBasicPropsChange},metadata:e},null,he),y(this,null,ee,{kind:"method",name:"handleAggregateChange",static:!1,private:!1,access:{has:e=>"handleAggregateChange"in e,get:e=>e.handleAggregateChange},metadata:e},null,he),y(this,null,te,{kind:"method",name:"handleNumberFormatChange",static:!1,private:!1,access:{has:e=>"handleNumberFormatChange"in e,get:e=>e.handleNumberFormatChange},metadata:e},null,he),y(this,null,ie,{kind:"method",name:"handleDateFormatChange",static:!1,private:!1,access:{has:e=>"handleDateFormatChange"in e,get:e=>e.handleDateFormatChange},metadata:e},null,he),y(this,null,ae,{kind:"method",name:"handleBooleanFormatChange",static:!1,private:!1,access:{has:e=>"handleBooleanFormatChange"in e,get:e=>e.handleBooleanFormatChange},metadata:e},null,he),y(this,null,se,{kind:"method",name:"handleRatingFormatChange",static:!1,private:!1,access:{has:e=>"handleRatingFormatChange"in e,get:e=>e.handleRatingFormatChange},metadata:e},null,he),y(this,null,ne,{kind:"method",name:"handleProgressFormatChange",static:!1,private:!1,access:{has:e=>"handleProgressFormatChange"in e,get:e=>e.handleProgressFormatChange},metadata:e},null,he),y(this,null,le,{kind:"method",name:"handleSparklineFormatChange",static:!1,private:!1,access:{has:e=>"handleSparklineFormatChange"in e,get:e=>e.handleSparklineFormatChange},metadata:e},null,he),y(this,null,re,{kind:"method",name:"handleStyleChange",static:!1,private:!1,access:{has:e=>"handleStyleChange"in e,get:e=>e.handleStyleChange},metadata:e},null,he),y(null,null,n,{kind:"field",name:"key",static:!1,private:!1,access:{has:e=>"key"in e,get:e=>e.key,set:(e,t)=>{e.key=t}},metadata:e},ue,me),y(null,null,r,{kind:"field",name:"label",static:!1,private:!1,access:{has:e=>"label"in e,get:e=>e.label,set:(e,t)=>{e.label=t}},metadata:e},pe,ge),y(null,null,o,{kind:"field",name:"type",static:!1,private:!1,access:{has:e=>"type"in e,get:e=>e.type,set:(e,t)=>{e.type=t}},metadata:e},be,fe),y(null,null,c,{kind:"field",name:"align",static:!1,private:!1,access:{has:e=>"align"in e,get:e=>e.align,set:(e,t)=>{e.align=t}},metadata:e},ve,ye),y(null,null,h,{kind:"field",name:"width",static:!1,private:!1,access:{has:e=>"width"in e,get:e=>e.width,set:(e,t)=>{e.width=t}},metadata:e},we,ke),y(null,null,u,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:e},xe,Ce),y(null,null,m,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:e},Se,Ee),y(null,null,p,{kind:"field",name:"wrap",static:!1,private:!1,access:{has:e=>"wrap"in e,get:e=>e.wrap,set:(e,t)=>{e.wrap=t}},metadata:e},De,Ae),y(null,null,g,{kind:"field",name:"ellipsis",static:!1,private:!1,access:{has:e=>"ellipsis"in e,get:e=>e.ellipsis,set:(e,t)=>{e.ellipsis=t}},metadata:e},Re,Me),y(null,null,b,{kind:"field",name:"tooltip",static:!1,private:!1,access:{has:e=>"tooltip"in e,get:e=>e.tooltip,set:(e,t)=>{e.tooltip=t}},metadata:e},ze,$e),y(null,null,f,{kind:"field",name:"aggregateType",static:!1,private:!1,access:{has:e=>"aggregateType"in e,get:e=>e.aggregateType,set:(e,t)=>{e.aggregateType=t}},metadata:e},Fe,Ie),y(null,null,v,{kind:"field",name:"decimals",static:!1,private:!1,access:{has:e=>"decimals"in e,get:e=>e.decimals,set:(e,t)=>{e.decimals=t}},metadata:e},Te,Le),y(null,null,k,{kind:"field",name:"thousandsSeparator",static:!1,private:!1,access:{has:e=>"thousandsSeparator"in e,get:e=>e.thousandsSeparator,set:(e,t)=>{e.thousandsSeparator=t}},metadata:e},Ve,Be),y(null,null,x,{kind:"field",name:"numberPrefix",static:!1,private:!1,access:{has:e=>"numberPrefix"in e,get:e=>e.numberPrefix,set:(e,t)=>{e.numberPrefix=t}},metadata:e},Oe,je),y(null,null,C,{kind:"field",name:"numberSuffix",static:!1,private:!1,access:{has:e=>"numberSuffix"in e,get:e=>e.numberSuffix,set:(e,t)=>{e.numberSuffix=t}},metadata:e},Pe,Ne),y(null,null,S,{kind:"field",name:"negativeStyle",static:!1,private:!1,access:{has:e=>"negativeStyle"in e,get:e=>e.negativeStyle,set:(e,t)=>{e.negativeStyle=t}},metadata:e},He,qe),y(null,null,E,{kind:"field",name:"dateFormat",static:!1,private:!1,access:{has:e=>"dateFormat"in e,get:e=>e.dateFormat,set:(e,t)=>{e.dateFormat=t}},metadata:e},_e,Ge),y(null,null,D,{kind:"field",name:"customDateFormat",static:!1,private:!1,access:{has:e=>"customDateFormat"in e,get:e=>e.customDateFormat,set:(e,t)=>{e.customDateFormat=t}},metadata:e},Ke,We),y(null,null,A,{kind:"field",name:"dateLocale",static:!1,private:!1,access:{has:e=>"dateLocale"in e,get:e=>e.dateLocale,set:(e,t)=>{e.dateLocale=t}},metadata:e},Ue,Ze),y(null,null,R,{kind:"field",name:"trueValue",static:!1,private:!1,access:{has:e=>"trueValue"in e,get:e=>e.trueValue,set:(e,t)=>{e.trueValue=t}},metadata:e},Ye,Je),y(null,null,M,{kind:"field",name:"falseValue",static:!1,private:!1,access:{has:e=>"falseValue"in e,get:e=>e.falseValue,set:(e,t)=>{e.falseValue=t}},metadata:e},Qe,Xe),y(null,null,z,{kind:"field",name:"useSymbols",static:!1,private:!1,access:{has:e=>"useSymbols"in e,get:e=>e.useSymbols,set:(e,t)=>{e.useSymbols=t}},metadata:e},et,tt),y(null,null,$,{kind:"field",name:"trueSymbol",static:!1,private:!1,access:{has:e=>"trueSymbol"in e,get:e=>e.trueSymbol,set:(e,t)=>{e.trueSymbol=t}},metadata:e},it,at),y(null,null,F,{kind:"field",name:"falseSymbol",static:!1,private:!1,access:{has:e=>"falseSymbol"in e,get:e=>e.falseSymbol,set:(e,t)=>{e.falseSymbol=t}},metadata:e},st,nt),y(null,null,I,{kind:"field",name:"ratingMax",static:!1,private:!1,access:{has:e=>"ratingMax"in e,get:e=>e.ratingMax,set:(e,t)=>{e.ratingMax=t}},metadata:e},lt,rt),y(null,null,T,{kind:"field",name:"ratingSymbol",static:!1,private:!1,access:{has:e=>"ratingSymbol"in e,get:e=>e.ratingSymbol,set:(e,t)=>{e.ratingSymbol=t}},metadata:e},ot,ct),y(null,null,L,{kind:"field",name:"ratingEmptySymbol",static:!1,private:!1,access:{has:e=>"ratingEmptySymbol"in e,get:e=>e.ratingEmptySymbol,set:(e,t)=>{e.ratingEmptySymbol=t}},metadata:e},dt,ht),y(null,null,V,{kind:"field",name:"ratingColor",static:!1,private:!1,access:{has:e=>"ratingColor"in e,get:e=>e.ratingColor,set:(e,t)=>{e.ratingColor=t}},metadata:e},ut,mt),y(null,null,B,{kind:"field",name:"progressMax",static:!1,private:!1,access:{has:e=>"progressMax"in e,get:e=>e.progressMax,set:(e,t)=>{e.progressMax=t}},metadata:e},pt,gt),y(null,null,O,{kind:"field",name:"showPercentage",static:!1,private:!1,access:{has:e=>"showPercentage"in e,get:e=>e.showPercentage,set:(e,t)=>{e.showPercentage=t}},metadata:e},bt,ft),y(null,null,j,{kind:"field",name:"progressColor",static:!1,private:!1,access:{has:e=>"progressColor"in e,get:e=>e.progressColor,set:(e,t)=>{e.progressColor=t}},metadata:e},vt,yt),y(null,null,P,{kind:"field",name:"progressBgColor",static:!1,private:!1,access:{has:e=>"progressBgColor"in e,get:e=>e.progressBgColor,set:(e,t)=>{e.progressBgColor=t}},metadata:e},wt,kt),y(null,null,N,{kind:"field",name:"progressHeight",static:!1,private:!1,access:{has:e=>"progressHeight"in e,get:e=>e.progressHeight,set:(e,t)=>{e.progressHeight=t}},metadata:e},xt,Ct),y(null,null,H,{kind:"field",name:"sparklineType",static:!1,private:!1,access:{has:e=>"sparklineType"in e,get:e=>e.sparklineType,set:(e,t)=>{e.sparklineType=t}},metadata:e},St,Et),y(null,null,q,{kind:"field",name:"sparklineColor",static:!1,private:!1,access:{has:e=>"sparklineColor"in e,get:e=>e.sparklineColor,set:(e,t)=>{e.sparklineColor=t}},metadata:e},Dt,At),y(null,null,_,{kind:"field",name:"sparklineWidth",static:!1,private:!1,access:{has:e=>"sparklineWidth"in e,get:e=>e.sparklineWidth,set:(e,t)=>{e.sparklineWidth=t}},metadata:e},Rt,Mt),y(null,null,G,{kind:"field",name:"sparklineHeight",static:!1,private:!1,access:{has:e=>"sparklineHeight"in e,get:e=>e.sparklineHeight,set:(e,t)=>{e.sparklineHeight=t}},metadata:e},zt,$t),y(null,null,K,{kind:"field",name:"cellBgColor",static:!1,private:!1,access:{has:e=>"cellBgColor"in e,get:e=>e.cellBgColor,set:(e,t)=>{e.cellBgColor=t}},metadata:e},Ft,It),y(null,null,W,{kind:"field",name:"cellColor",static:!1,private:!1,access:{has:e=>"cellColor"in e,get:e=>e.cellColor,set:(e,t)=>{e.cellColor=t}},metadata:e},Tt,Lt),y(null,null,U,{kind:"field",name:"cellFontWeight",static:!1,private:!1,access:{has:e=>"cellFontWeight"in e,get:e=>e.cellFontWeight,set:(e,t)=>{e.cellFontWeight=t}},metadata:e},Vt,Bt),y(null,null,Z,{kind:"field",name:"cellFontStyle",static:!1,private:!1,access:{has:e=>"cellFontStyle"in e,get:e=>e.cellFontStyle,set:(e,t)=>{e.cellFontStyle=t}},metadata:e},Ot,jt),y(null,null,Y,{kind:"field",name:"cellFontSize",static:!1,private:!1,access:{has:e=>"cellFontSize"in e,get:e=>e.cellFontSize,set:(e,t)=>{e.cellFontSize=t}},metadata:e},Pt,Nt),y(null,null,J,{kind:"field",name:"cellTextDecoration",static:!1,private:!1,access:{has:e=>"cellTextDecoration"in e,get:e=>e.cellTextDecoration,set:(e,t)=>{e.cellTextDecoration=t}},metadata:e},Ht,qt),y(null,t={value:a},oe,{kind:"class",name:a.name,metadata:e},null,ce),a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(a,ce)}get aggregate(){return this.aggregateFunction??(this.aggregateType||void 0)}set aggregate(e){const t=this.aggregate;if("function"==typeof e)return this.aggregateFunction=e,void(""!==this.aggregateType?this.aggregateType="":t!==e&&this.notifyTableOfChange());this.aggregateFunction=void 0;const i=e??"";this.aggregateType!==i?this.aggregateType=i:t!==this.aggregate&&this.notifyTableOfChange()}render(){return e`<slot></slot>`}setFormatter(e){this.formatter=e,this.notifyTableOfChange()}addConditionalFormat(e){this.conditionalFormats.push(e),this.notifyTableOfChange()}removeConditionalFormat(e){this.conditionalFormats.splice(e,1),this.notifyTableOfChange()}clearConditionalFormats(){this.conditionalFormats=[],this.notifyTableOfChange()}getColumnDefinition(){const e={key:this.key,label:this.label,type:this.type,align:this.align,width:this.width,sortable:this.sortable,filterable:this.filterable,wrap:this.wrap,ellipsis:this.ellipsis,tooltip:this.tooltip,formatter:this.formatter,conditionalFormats:this.conditionalFormats};if(this.aggregate&&(e.aggregate=this.aggregate),"number"===this.type||"currency"===this.type||"percent"===this.type||"accounting"===this.type||"scientific"===this.type||"fraction"===this.type){const t={};void 0!==this.decimals&&(t.decimals=this.decimals),void 0!==this.thousandsSeparator&&(t.thousandsSeparator=this.thousandsSeparator),this.numberPrefix&&(t.prefix=this.numberPrefix),this.numberSuffix&&(t.suffix=this.numberSuffix),this.negativeStyle&&(t.negativeStyle=this.negativeStyle),Object.keys(t).length>0&&(e.numberFormat=t)}if("date"===this.type){const t={};this.dateFormat&&(t.format=this.dateFormat),this.customDateFormat&&(t.customFormat=this.customDateFormat),this.dateLocale&&(t.locale=this.dateLocale),Object.keys(t).length>0&&(e.dateFormat=t)}if("boolean"===this.type){const t={};this.trueValue&&(t.trueValue=this.trueValue),this.falseValue&&(t.falseValue=this.falseValue),void 0!==this.useSymbols&&(t.useSymbols=this.useSymbols),this.trueSymbol&&(t.trueSymbol=this.trueSymbol),this.falseSymbol&&(t.falseSymbol=this.falseSymbol),Object.keys(t).length>0&&(e.booleanFormat=t)}if("rating"===this.type){const t={};void 0!==this.ratingMax&&(t.max=this.ratingMax),this.ratingSymbol&&(t.symbol=this.ratingSymbol),this.ratingEmptySymbol&&(t.emptySymbol=this.ratingEmptySymbol),this.ratingColor&&(t.color=this.ratingColor),Object.keys(t).length>0&&(e.ratingFormat=t)}if("progress"===this.type){const t={};void 0!==this.progressMax&&(t.max=this.progressMax),void 0!==this.showPercentage&&(t.showPercentage=this.showPercentage),this.progressColor&&(t.color=this.progressColor),this.progressBgColor&&(t.backgroundColor=this.progressBgColor),this.progressHeight&&(t.height=this.progressHeight),Object.keys(t).length>0&&(e.progressFormat=t)}if("sparkline"===this.type){const t={};this.sparklineType&&(t.type=this.sparklineType),this.sparklineColor&&(t.color=this.sparklineColor),void 0!==this.sparklineWidth&&(t.width=this.sparklineWidth),void 0!==this.sparklineHeight&&(t.height=this.sparklineHeight),Object.keys(t).length>0&&(e.sparklineFormat=t)}const t={};return this.cellBgColor&&(t.backgroundColor=this.cellBgColor),this.cellColor&&(t.color=this.cellColor),this.cellFontWeight&&(t.fontWeight=this.cellFontWeight),this.cellFontStyle&&(t.fontStyle=this.cellFontStyle),this.cellFontSize&&(t.fontSize=this.cellFontSize),this.cellTextDecoration&&(t.textDecoration=this.cellTextDecoration),Object.keys(t).length>0&&(e.style=t),e}handleBasicPropsChange(){this.notifyTableOfChange()}handleAggregateChange(){this.aggregateType&&(this.aggregateFunction=void 0),this.notifyTableOfChange()}handleNumberFormatChange(){"number"!==this.type&&"currency"!==this.type&&"percent"!==this.type&&"accounting"!==this.type&&"scientific"!==this.type&&"fraction"!==this.type||this.notifyTableOfChange()}handleDateFormatChange(){"date"===this.type&&this.notifyTableOfChange()}handleBooleanFormatChange(){"boolean"===this.type&&this.notifyTableOfChange()}handleRatingFormatChange(){"rating"===this.type&&this.notifyTableOfChange()}handleProgressFormatChange(){"progress"===this.type&&this.notifyTableOfChange()}handleSparklineFormatChange(){"sparkline"===this.type&&this.notifyTableOfChange()}handleStyleChange(){this.notifyTableOfChange()}notifyTableOfChange(){this.dispatchEvent(new CustomEvent("column-changed",{detail:{column:this.getColumnDefinition()},bubbles:!0,composed:!0}))}})})(),(()=>{let a,n,c,u,p,g,b,v,k,x,C,S,E,D,A,R,M,z,$,F,I=[i("snice-row")],T=[],L=HTMLElement,V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[],Z=[],Y=[],J=[],Q=[];(class extends L{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(L[Symbol.metadata]??null):void 0;c=[s({type:Boolean})],u=[s({type:Boolean})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:Boolean,attribute:!1})],v=[s({type:Object,attribute:!1})],k=[s({type:Number})],x=[s({type:Array,attribute:!1})],C=[l()],S=[r()],E=[o()],D=[d("selected")],A=[d("hoverable","clickable","selectable","selectionDisabled")],R=[d("data","columns")],M=[f("mouseenter")],z=[h("row-click",{bubbles:!0,composed:!0})],$=[h("row-select",{bubbles:!0,composed:!0})],F=[h("row-hover",{bubbles:!0,composed:!0})],y(this,null,C,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,V),y(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,V),y(this,null,E,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,V),y(this,null,D,{kind:"method",name:"updateSelection",static:!1,private:!1,access:{has:e=>"updateSelection"in e,get:e=>e.updateSelection},metadata:e},null,V),y(this,null,A,{kind:"method",name:"updateRowAttributes",static:!1,private:!1,access:{has:e=>"updateRowAttributes"in e,get:e=>e.updateRowAttributes},metadata:e},null,V),y(this,null,R,{kind:"method",name:"updateCells",static:!1,private:!1,access:{has:e=>"updateCells"in e,get:e=>e.updateCells},metadata:e},null,V),y(this,null,M,{kind:"method",name:"handleRowHover",static:!1,private:!1,access:{has:e=>"handleRowHover"in e,get:e=>e.handleRowHover},metadata:e},null,V),y(this,null,z,{kind:"method",name:"dispatchRowClick",static:!1,private:!1,access:{has:e=>"dispatchRowClick"in e,get:e=>e.dispatchRowClick},metadata:e},null,V),y(this,null,$,{kind:"method",name:"dispatchRowSelect",static:!1,private:!1,access:{has:e=>"dispatchRowSelect"in e,get:e=>e.dispatchRowSelect},metadata:e},null,V),y(this,null,F,{kind:"method",name:"dispatchRowHover",static:!1,private:!1,access:{has:e=>"dispatchRowHover"in e,get:e=>e.dispatchRowHover},metadata:e},null,V),y(null,null,c,{kind:"field",name:"selected",static:!1,private:!1,access:{has:e=>"selected"in e,get:e=>e.selected,set:(e,t)=>{e.selected=t}},metadata:e},B,O),y(null,null,u,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:e},j,P),y(null,null,p,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:e},N,H),y(null,null,g,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:e},q,_),y(null,null,b,{kind:"field",name:"selectionDisabled",static:!1,private:!1,access:{has:e=>"selectionDisabled"in e,get:e=>e.selectionDisabled,set:(e,t)=>{e.selectionDisabled=t}},metadata:e},G,K),y(null,null,v,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:e},W,U),y(null,null,k,{kind:"field",name:"index",static:!1,private:!1,access:{has:e=>"index"in e,get:e=>e.index,set:(e,t)=>{e.index=t}},metadata:e},Z,Y),y(null,null,x,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:e},J,Q),y(null,a={value:n},I,{kind:"class",name:n.name,metadata:e},null,T),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,T)}extractDataFromAttributes(){const e={};return this.getAttributeNames().filter(e=>e.startsWith("data-")&&"data-column-index"!==e).forEach(t=>{const i=t.slice(5),a=this.getAttribute(t);null!==a&&(e[i]=a)}),e}render(){return e`
|
|
557
557
|
<div class="row-container" part="container" @click=${e=>this.handleRowClick(e)} @keydown=${e=>this.handleKeyDown(e)}>
|
|
558
558
|
<if ${this.selectable}>
|
|
559
559
|
${this.renderCheckbox()}
|
|
@@ -582,7 +582,7 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
582
582
|
<div class="cell cell--${i.type}" part="cell" style="${this.getCellStyles(i)}">
|
|
583
583
|
${t(`<${s}\n type="${i.type}"\n align="${i.align||this.getDefaultAlign(i.type)}"\n data-column-index="${a}"\n ></${s}>`)}
|
|
584
584
|
</div>
|
|
585
|
-
`}getDefaultAlign(e){return["number","currency","percent","percentage","duration","filesize","accounting","scientific","fraction"].includes(e||"")?"right":["boolean","rating","image"].includes(e||"")?"center":"left"}applyCellPresentation(e,t,i){if(!e)return;const a=t=>{t&&Object.assign(e.style,t)};a(t.style);for(const s of t.conditionalFormats||[])if(s.condition(i,this.data)){a(s.style),s.className&&e.classList.add(s.className);break}t.tooltip&&(e.title="function"==typeof t.tooltip?t.tooltip(i,this.data):null==i?"":String(i))}getCellComponent(e){switch(e){case"text":return"snice-cell-text";case"number":case"accounting":case"scientific":case"fraction":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"sparkline":return"snice-cell-sparkline";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"link":case"url":return"snice-cell-link";case"actions":return"snice-cell-actions";case"tag":case"tags":case"badge":case"badges":return"snice-cell-tag";case"image":case"avatar":case"thumbnail":return"snice-cell-image";case"email":return"snice-cell-email";case"phone":case"tel":case"telephone":return"snice-cell-phone";case"status":return"snice-cell-status";case"color":return"snice-cell-color";case"json":case"object":return"snice-cell-json";case"currency":case"money":return"snice-cell-currency";case"percent":case"percentage":return"snice-cell-percentage";case"location":case"address":case"coordinates":return"snice-cell-location";default:return"snice-cell"}}getCellStyles(e){let t=[];return e.width&&(t.push(`width: ${e.width}`),t.push(`min-width: ${e.width}`),t.push(`max-width: ${e.width}`)),e.align&&t.push(`text-align: ${e.align}`),t.join("; ")}escapeHtml(e){if(null==e)return"";const t=String(e),i=document.createElement("div");return i.textContent=t,i.innerHTML}toggleSelection(){this.selected=!this.selected,this.dispatchRowSelect()}dispatchRowClick(){return{data:this.data,index:this.index,element:this}}dispatchRowSelect(){return{selected:this.selected,data:this.data,index:this.index,element:this}}dispatchRowHover(){return{data:this.data,index:this.index,element:this}}select(){!this.selectionDisabled&&this.selectable&&(this.selected=!0,this.dispatchRowSelect())}deselect(){this.selected=!1,this.dispatchRowSelect()}focusRow(){super.focus(),this.scrollIntoView({behavior:"smooth",block:"nearest"})}getCellValue(e){return this.data[e]}setCellValue(e,t){this.data={...this.data,[e]:t},this.updateCells()}getCellElement(e){const t=this.columns.find(t=>t.key===e);if(!t)return null;const i=this.columns.indexOf(t);return this.shadowRoot?.querySelector(`[data-column-index="${i}"]`)||null}highlight(e=2e3){this.classList.add("row--highlighted"),setTimeout(()=>{this.classList.remove("row--highlighted")},e)}constructor(){super(...arguments),this.selected=(w(this,V),w(this,B,!1)),this.hoverable=(w(this,O),w(this,j,!0)),this.clickable=(w(this,P),w(this,N,!1)),this.selectable=(w(this,H),w(this,q,!1)),this.selectionDisabled=(w(this,_),w(this,G,!1)),this.data=(w(this,K),w(this,W,{})),this.index=(w(this,U),w(this,Z,0)),this.columns=(w(this,Y),w(this,J,[])),w(this,Q)}})})();class ne{constructor(){this.rafId=0,this.lastStartIndex=-1,this.lastEndIndex=-1,this.enabled=!1,this.offsets=[],this.offsetsTotalRows=-1,this.topSpacer=document.createElement("tr"),this.topSpacer.className="virtual-spacer virtual-spacer--top",this.topSpacer.style.display="table-row",this.bottomSpacer=document.createElement("tr"),this.bottomSpacer.className="virtual-spacer virtual-spacer--bottom",this.bottomSpacer.style.display="table-row",this.contentContainer=document.createElement("tbody"),this.options={},this.scrollHandler=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>this.update())}}attach(e){this.options=e,this.enabled=!0,this.lastStartIndex=-1,this.lastEndIndex=-1,this.invalidateOffsets(),this.options.scrollContainer.addEventListener("scroll",this.scrollHandler,{passive:!0}),window.addEventListener("resize",this.scrollHandler,{passive:!0}),this.update()}detach(){this.enabled=!1,this.options.scrollContainer?.removeEventListener("scroll",this.scrollHandler),window.removeEventListener("resize",this.scrollHandler),cancelAnimationFrame(this.rafId)}setTotalRows(e){this.options.totalRows=e,this.invalidateOffsets(),this.lastStartIndex=-1,this.update()}refresh(){this.invalidateOffsets(),this.lastStartIndex=-1,this.lastEndIndex=-1,this.update()}update(){if(!this.enabled||!this.options.scrollContainer)return;const{bufferPx:e,totalRows:t,scrollContainer:i,renderRange:a}=this.options,s=i.scrollTop,n=this.buildOffsets(t),l=t>0?Math.max(1,n[1]-n[0]):1,r=Math.max(l,i.clientHeight),o=n[t]||0,c=Math.max(0,o-r),d=Math.min(Math.max(0,s),c);s!==d&&(i.scrollTop=d);const h=Math.max(0,d-e),u=Math.min(o,d+r+e),m=this.findRowAtOffset(n,h),p=Math.min(t,this.findFirstOffsetAtOrAfter(n,u));if(m===this.lastStartIndex&&p===this.lastEndIndex)return;this.lastStartIndex=m,this.lastEndIndex=p;const g=n[m]||0,b=Math.max(0,o-(n[p]||o));this.topSpacer.style.height=`${g}px`,this.bottomSpacer.style.height=`${b}px`;const f=a(m,p),v=this.options.scrollContainer.querySelector("tbody");if(v){v.innerHTML="";const e=this.options.renderPinnedTop?.();if(e&&v.appendChild(e),g>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${g}px`,e.style.padding="0",e.style.border="none",this.topSpacer.innerHTML="",this.topSpacer.appendChild(e),v.appendChild(this.topSpacer)}if(v.appendChild(f),b>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${b}px`,e.style.padding="0",e.style.border="none",this.bottomSpacer.innerHTML="",this.bottomSpacer.appendChild(e),v.appendChild(this.bottomSpacer)}const t=this.options.renderPinnedBottom?.();t&&v.appendChild(t),this.options.afterRender?.()}}getVisibleRange(){return{start:this.lastStartIndex,end:this.lastEndIndex}}scrollToRow(e){if(!this.options.scrollContainer)return;const t=this.offsetForIndex(e);this.options.scrollContainer.scrollTop=t}scrollToIndex(e){this.options.scrollContainer&&(this.options.scrollContainer.scrollTop=this.offsetForIndex(e),this.refresh())}getScrollPosition(){const e=this.options.scrollContainer;return{top:e?.scrollTop??0,left:e?.scrollLeft??0}}isEnabled(){return this.enabled}heightForIndex(e){const t="function"==typeof this.options.rowHeight?this.options.rowHeight(e):this.options.rowHeight;return Number.isFinite(t)&&t>0?t:1}buildOffsets(e){if(this.offsetsTotalRows===e&&this.offsets.length===e+1)return this.offsets;this.offsets=new Array(e+1),this.offsets[0]=0;for(let t=0;t<e;t++)this.offsets[t+1]=this.offsets[t]+this.heightForIndex(t);return this.offsetsTotalRows=e,this.offsets}invalidateOffsets(){this.offsets=[],this.offsetsTotalRows=-1}offsetForIndex(e){const t=Math.max(0,Math.min(e,this.options.totalRows));return this.buildOffsets(this.options.totalRows)[t]||0}findRowAtOffset(e,t){const i=e.length-1;if(i<=0)return 0;let a=0,s=i;for(;a<s;){const i=Math.floor((a+s)/2);e[i+1]<=t?a=i+1:s=i}return Math.min(i,a)}findFirstOffsetAtOrAfter(e,t){let i=0,a=e.length-1;for(;i<a;){const s=Math.floor((i+a)/2);e[s]<t?i=s+1:a=s}return i}}class le{constructor(){this.states=new Map,this.groups=[],this.resizeStartX=0,this.resizeStartWidth=0,this.resizingKey=null,this.resizeOverlay=null,this.tableElement=null}initialize(e,t){this.tableElement=t,e.forEach((e,t)=>{const i=this.states.get(e.key);this.states.set(e.key,{key:e.key,width:i?.width??this.parseWidth(e.width)??150,flex:e.flex,minWidth:e.minWidth??50,maxWidth:e.maxWidth??1/0,visible:i?.visible??!0,pinned:i?.pinned??(e.pinned||!1),order:i?.order??t,resizable:!1!==e.resizable,reorderable:!1!==e.reorderable,hideable:!1!==e.hideable,pinnable:!1!==e.pinnable})})}parseWidth(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}getVisibleColumns(){return Array.from(this.states.values()).filter(e=>e.visible).sort((e,t)=>e.order-t.order)}getAllStates(){return Array.from(this.states.values()).sort((e,t)=>e.order-t.order)}getPinnedLeft(){return this.getVisibleColumns().filter(e=>"left"===e.pinned)}getPinnedRight(){return this.getVisibleColumns().filter(e=>"right"===e.pinned)}getUnpinned(){return this.getVisibleColumns().filter(e=>!e.pinned)}computeFlexWidths(e){const t=this.getVisibleColumns(),i=new Map;let a=0;const s=[];for(const e of t)e.flex&&e.flex>0?s.push(e):(a+=e.width,i.set(e.key,e.width));const n=Math.max(0,e-a),l=s.reduce((e,t)=>e+(t.flex||1),0);for(const e of s){const t=Math.max(e.minWidth,Math.min(e.maxWidth,(e.flex||1)/l*n));i.set(e.key,t)}return i}applyWidths(e,t){e.querySelectorAll("th[data-key]").forEach(e=>{const i=e.getAttribute("data-key");i&&t.has(i)&&(e.style.width=`${t.get(i)}px`)})}startResize(e,t){const i=this.states.get(e);if(!i||!i.resizable)return;this.resizingKey=e,this.resizeStartX=t,this.resizeStartWidth=i.width,this.resizeOverlay=document.createElement("div"),this.resizeOverlay.style.cssText="position:fixed;inset:0;z-index:99999;cursor:col-resize;",document.body.appendChild(this.resizeOverlay);const a=t=>{t.preventDefault();const a=Math.max(i.minWidth,Math.min(i.maxWidth,this.resizeStartWidth+(t.clientX-this.resizeStartX)));i.width=a,i.flex=void 0;const s=this.tableElement?.shadowRoot;if(s){const t=s.querySelector(`th[data-key="${e}"]`);t&&(t.style.width=`${a}px`),s.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>e.style.width=`${a}px`)}this.tableElement?.dispatchEvent(new CustomEvent("column-resize",{detail:{key:e,width:a},bubbles:!0,composed:!0}))},s=()=>{this.resizingKey=null,this.resizeOverlay?.remove(),this.resizeOverlay=null,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),this.tableElement?.dispatchEvent(new CustomEvent("column-resize-end",{detail:{key:e,width:i.width},bubbles:!0,composed:!0}))};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)}autoSizeColumn(e,t){const i=this.states.get(e);if(!i)return;const a=this.tableElement?.shadowRoot?.querySelector(`th[data-key="${e}"]`);let s=a?a.scrollWidth:0;t.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>{s=Math.max(s,e.scrollWidth)}),i.width=Math.max(i.minWidth,Math.min(i.maxWidth,s+16)),i.flex=void 0}autoSizeAll(e){for(const t of this.states.keys())this.autoSizeColumn(t,e)}setColumnVisible(e,t){const i=this.states.get(e);i&&i.hideable&&(i.visible=t)}showAllColumns(){for(const e of this.states.values())e.visible=!0}hideAllColumns(){for(const e of this.states.values())e.hideable&&(e.visible=!1)}getVisibilityModel(){const e={};for(const[t,i]of this.states)e[t]=i.visible;return e}moveColumn(e,t){const i=this.states.get(e);if(!i||!i.reorderable||i.pinned)return;const a=this.getVisibleColumns(),s=a.findIndex(t=>t.key===e);-1!==s&&s!==t&&(a.splice(s,1),a.splice(t,0,i),a.forEach((e,t)=>{e.order=t}))}pinColumn(e,t){const i=this.states.get(e);i&&i.pinnable&&(i.pinned=t)}unpinColumn(e){const t=this.states.get(e);t&&(t.pinned=!1)}setColumnGroups(e){this.groups=e}getColumnGroups(){return this.groups}renderGroupHeaders(e=this.getVisibleColumns().map(e=>e.key)){if(0===this.groups.length)return"";const t=new Map;for(const e of this.groups)for(const i of e.children)t.set(i,e);const i=[];for(const a of e){if(!this.states.get(a)?.visible)continue;const e=t.get(a)??null,s=i[i.length-1];s&&s.group===e?s.span++:i.push({group:e,span:1})}return i.map(({group:e,span:t})=>e?`<th colspan="${t}" class="column-group-header ${e.headerClass||""}">${e.label}</th>`:`<th colspan="${t}" class="column-group-header column-group-header--ungrouped" aria-hidden="true"></th>`).join("")}isResizing(){return null!==this.resizingKey}getState(e){return this.states.get(e)}getPinnedLeftOffsets(){const e=new Map;let t=0;for(const i of this.getPinnedLeft())e.set(i.key,t),t+=i.width;return e}getPinnedRightOffsets(){const e=new Map,t=this.getPinnedRight();let i=0;for(let a=t.length-1;a>=0;a--)e.set(t[a].key,i),i+=t[a].width;return e}}const re=[{value:"contains",label:"contains",requiresValue:!0},{value:"notContains",label:"does not contain",requiresValue:!0},{value:"equals",label:"equals",requiresValue:!0},{value:"notEquals",label:"does not equal",requiresValue:!0},{value:"startsWith",label:"starts with",requiresValue:!0},{value:"endsWith",label:"ends with",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],oe=[{value:"eq",label:"=",requiresValue:!0},{value:"neq",label:"≠",requiresValue:!0},{value:"gt",label:">",requiresValue:!0},{value:"gte",label:"≥",requiresValue:!0},{value:"lt",label:"<",requiresValue:!0},{value:"lte",label:"≤",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],ce=[{value:"is",label:"is",requiresValue:!0},{value:"isNot",label:"is not",requiresValue:!0},{value:"before",label:"before",requiresValue:!0},{value:"onOrBefore",label:"on or before",requiresValue:!0},{value:"after",label:"after",requiresValue:!0},{value:"onOrAfter",label:"on or after",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],de=[{value:"isTrue",label:"is true",requiresValue:!1},{value:"isFalse",label:"is false",requiresValue:!1}];class he{constructor(){this.model={filters:[],logic:"and"},this.headerFilters=new Map}getOperatorsForType(e){switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return oe;case"date":return ce;case"boolean":return de;default:return re}}setFilterModel(e){this.model=e}getFilterModel(){return{...this.model}}setColumnFilter(e,t,i){const a=this.model.filters.findIndex(t=>t.column===e);a>=0?this.model.filters[a]={column:e,operator:t,value:i}:this.model.filters.push({column:e,operator:t,value:i})}removeColumnFilter(e){this.model.filters=this.model.filters.filter(t=>t.column!==e)}clearAllFilters(){this.model.filters=[],this.model.quickFilter=void 0,this.model.logic="and",this.headerFilters.clear()}setQuickFilter(e){this.model.quickFilter=e||void 0}setHeaderFilter(e,t){t?this.headerFilters.set(e,t):this.headerFilters.delete(e)}getHeaderFilter(e){return this.headerFilters.get(e)||""}setFilterLogic(e){this.model.logic=e}hasActiveFilters(){return this.model.filters.length>0||!!this.model.quickFilter||this.headerFilters.size>0}hasColumnFilter(e){return this.model.filters.some(t=>t.column===e)||this.headerFilters.has(e)}getActiveFilterCount(){return this.model.filters.length+this.headerFilters.size+(this.model.quickFilter?1:0)}applyFilters(e,t){let i=e;this.model.filters.length>0&&(i=i.filter(e=>{const t=this.model.filters.map(t=>this.evaluateFilter(t,e));return"and"===this.model.logic?t.every(Boolean):t.some(Boolean)}));for(const[e,t]of this.headerFilters){const a=t.toLowerCase();i=i.filter(t=>{const i=t[e];return null!=i&&String(i).toLowerCase().includes(a)})}if(this.model.quickFilter){const e=this.model.quickFilter.toLowerCase().split(/\s+/).filter(Boolean),a=t.map(e=>e.key),s=this.model.quickFilterLogic||"and";i=i.filter(t=>{const i=e=>a.some(i=>{const a=t[i];return null!=a&&String(a).toLowerCase().includes(e)});return"and"===s?e.every(i):e.some(i)})}return i}evaluateFilter(e,t){const i=t[e.column],a=e.value;switch(e.operator){case"contains":return null!=i&&String(i).toLowerCase().includes(String(a).toLowerCase());case"notContains":return null==i||!String(i).toLowerCase().includes(String(a).toLowerCase());case"equals":return String(i??"").toLowerCase()===String(a).toLowerCase();case"notEquals":return String(i??"").toLowerCase()!==String(a).toLowerCase();case"startsWith":return null!=i&&String(i).toLowerCase().startsWith(String(a).toLowerCase());case"endsWith":return null!=i&&String(i).toLowerCase().endsWith(String(a).toLowerCase());case"isEmpty":return null==i||""===i;case"isNotEmpty":return null!=i&&""!==i;case"eq":return Number(i)===Number(a);case"neq":return Number(i)!==Number(a);case"gt":return Number(i)>Number(a);case"gte":return Number(i)>=Number(a);case"lt":return Number(i)<Number(a);case"lte":return Number(i)<=Number(a);case"is":return new Date(i).toDateString()===new Date(a).toDateString();case"isNot":return new Date(i).toDateString()!==new Date(a).toDateString();case"before":return new Date(i)<new Date(a);case"onOrBefore":return new Date(i)<=new Date(a);case"after":return new Date(i)>new Date(a);case"onOrAfter":return new Date(i)>=new Date(a);case"isTrue":return!0===i||"true"===i||1===i;case"isFalse":return!1===i||"false"===i||0===i||null==i;default:return!0}}toServerParams(){return{filters:this.model.filters,filterLogic:this.model.logic,quickFilter:this.model.quickFilter,headerFilters:Object.fromEntries(this.headerFilters)}}}class ue{constructor(){this.cellState=null,this.rowState=null,this.pipelines=new Map,this.validators=new Map,this.editableColumns=new Set,this.editabilityCheck=null,this.tableElement=null,this.mode="cell"}attach(e){this.tableElement=e}setEditableColumns(e){this.editableColumns=new Set(e)}setEditabilityCheck(e){this.editabilityCheck=e}setEditMode(e){this.mode=e}setPipeline(e,t){this.pipelines.set(e,t)}setValidation(e,t){this.validators.set(e,t)}isCellEditable(e,t){return!!this.editableColumns.has(t)&&(!this.editabilityCheck||this.editabilityCheck(e,t))}getDisplayValue(e,t,i){const a=this.pipelines.get(e);let s=t;return a?.valueGetter&&(s=a.valueGetter(s,i)),a?.valueFormatter?a.valueFormatter(s,i):null==s?"":String(s)}getSortValue(e,t,i){const a=this.pipelines.get(e);return a?.valueGetter?a.valueGetter(t,i):t}getEditorType(e){switch(e){case"number":case"currency":case"rating":case"progress":return"number";case"date":return"date";case"boolean":return"boolean";case"select":return"select";default:return"text"}}startCellEdit(e,t,i,a,s){return this.isCellEditable(a,t)?(this.cellState?.isEditing&&this.cancelCellEdit(),this.cellState={rowIndex:e,columnKey:t,rowData:a,originalValue:i,currentValue:i,editorType:this.getEditorType(s||""),error:null,isEditing:!0},this.cellState):null}updateCellValue(e){this.cellState&&(this.cellState.currentValue=e,this.cellState.error=null)}async commitCellEdit(){if(!this.cellState?.isEditing)return null;const{columnKey:e,currentValue:t,rowIndex:i,rowData:a}=this.cellState,s=this.pipelines.get(e);let n=t;s?.valueParser&&(n=s.valueParser(String(t),a));const l=this.validators.get(e);if(l){const e=await l.validate(n,a);if(e)return this.cellState.error=e,e}if(s?.valueSetter){const t=s.valueSetter(n,a);t&&"object"==typeof t&&!Array.isArray(t)?(Object.assign(a,t),n=a[e]):void 0!==t&&(n=t)}return this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-commit",{detail:{rowIndex:i,columnKey:e,oldValue:this.cellState.originalValue,newValue:n},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null,null}cancelCellEdit(){this.cellState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-cancel",{detail:{rowIndex:this.cellState.rowIndex,columnKey:this.cellState.columnKey},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null)}getCellEditState(){return this.cellState}startRowEdit(e,t){return this.rowState?.isEditing&&this.cancelRowEdit(),this.rowState={rowIndex:e,originalRow:{...t},editedRow:{...t},errors:new Map,isEditing:!0},this.rowState}updateRowField(e,t){this.rowState&&(this.rowState.editedRow[e]=t,this.rowState.errors.delete(e))}async commitRowEdit(){if(!this.rowState?.isEditing)return null;const e=new Map,t={...this.rowState.editedRow};for(const[e,i]of this.pipelines)i.valueParser&&e in t&&(t[e]=i.valueParser(String(t[e]),t));for(const i of this.editableColumns){const a=this.validators.get(i);if(a){const s=t[i],n=await a.validate(s,t);n&&e.set(i,n)}}if(e.size>0)return this.rowState.errors=e,e;let i={...t};for(const[e,t]of this.pipelines)if(t.valueSetter&&e in i){const a=t.valueSetter(i[e],i);a&&"object"==typeof a&&!Array.isArray(a)?i={...i,...a}:void 0!==a&&(i[e]=a)}return this.tableElement?.dispatchEvent(new CustomEvent("row-edit-commit",{detail:{rowIndex:this.rowState.rowIndex,oldRow:this.rowState.originalRow,newRow:i},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null,null}cancelRowEdit(){this.rowState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("row-edit-cancel",{detail:{rowIndex:this.rowState.rowIndex},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null)}getRowEditState(){return this.rowState}isEditing(){return(this.cellState?.isEditing||this.rowState?.isEditing)??!1}createEditor(e,t,i){switch(e){case"number":{const e=document.createElement("input");return e.type="number",e.value=null==t?"":String(t),e.className="table-editor-input",e}case"date":{const e=document.createElement("input");return e.type="date",e.value=t||"",e.className="table-editor-input",e}case"boolean":{const e=document.createElement("input");return e.type="checkbox",e.checked=!!t,e.className="table-editor-checkbox",e}case"select":{const e=document.createElement("select");return e.className="table-editor-select",(i?.selectOptions||[]).forEach(i=>{const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.value===String(t)&&(a.selected=!0),e.appendChild(a)}),e}default:{const e=document.createElement("input");return e.type="text",e.value=null==t?"":String(t),e.className="table-editor-input",e}}}}class me{constructor(){this.focusedRow=-1,this.hasUserInteracted=!1,this.focusedCol=0,this.attached=!1,this.options={},this.keyHandler=e=>this.handleKeyDown(e)}attach(e){this.options=e;const t=e.shadowRoot;t&&(t.addEventListener("keydown",this.keyHandler),this.attached=!0,this.syncGridRole(),this.applyARIA())}detach(){this.options.shadowRoot?.removeEventListener("keydown",this.keyHandler),this.attached=!1}syncGridRole(){const e=this.getTable();e&&(e.setAttribute("role","grid"),e.setAttribute("tabindex","0"),e.setAttribute("aria-rowcount",String(this.ariaRowCount+1)),e.setAttribute("aria-colcount",String(this.totalColCount)))}refresh(){this.attached&&(this.syncGridRole(),this.applyARIA())}getTable(){return this.options.shadowRoot?.querySelector("table")??null}resolveBound(e){return"function"==typeof e?e():e??0}get totalRowCount(){return this.resolveBound(this.options.totalRows)}get totalColCount(){return this.resolveBound(this.options.totalColumns)}get ariaRowCount(){return this.resolveBound(this.options.ariaRows??this.options.totalRows)}get ariaRowOffset(){return Math.max(0,this.resolveBound(this.options.ariaRowOffset))}getBodyRow(e){if(this.options.getRowElement)return this.options.getRowElement(e);const t=this.getTable();return t?t.querySelector(`tbody tr[data-index="${e}"]`):null}applyARIA(){const e=this.getTable();if(!e)return;e.setAttribute("aria-rowcount",String(this.ariaRowCount+1)),e.setAttribute("aria-colcount",String(this.totalColCount));const t=e.querySelector("thead tr.column-header-row")??e.querySelector("thead tr:not(.column-group-row):not(.header-filter-row)");t&&(t.setAttribute("role","row"),t.setAttribute("aria-rowindex","1"),t.querySelectorAll("th").forEach((e,t)=>{if(e.setAttribute("role","columnheader"),e.setAttribute("aria-colindex",String(t+1)),e.classList.contains("sortable")){const t=e.querySelector(".sort-indicator.active");if(t){const i=t.textContent?.trim()||"";i.includes("▲")?e.setAttribute("aria-sort","ascending"):i.includes("▼")&&e.setAttribute("aria-sort","descending")}else e.setAttribute("aria-sort","none")}})),e.querySelectorAll("tbody tr:not(.virtual-spacer)").forEach((e,t)=>{e.setAttribute("role","row"),e.setAttribute("aria-rowindex",String(this.ariaRowOffset+t+2)),"true"===e.getAttribute("data-selected")?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected"),e.querySelectorAll("td").forEach((e,t)=>{e.setAttribute("role","gridcell"),e.setAttribute("aria-colindex",String(t+1))})}),this.updateFocusIndicator()}setFocus(e,t){this.focusedRow=e,this.focusedCol=t,this.updateFocusIndicator()}getFocus(){return{row:this.focusedRow,col:this.focusedCol}}updateFocusIndicator(){if(!this.hasUserInteracted)return;const e=this.getTable();if(!e)return;e.querySelectorAll("[data-grid-focus]").forEach(e=>{e.removeAttribute("data-grid-focus"),e.removeAttribute("tabindex")});let t=null;if(-1===this.focusedRow)t=e.querySelectorAll("thead th")[this.focusedCol];else{let e=this.getBodyRow(this.focusedRow);e||(this.options.ensureRowVisible?.(this.focusedRow),e=this.getBodyRow(this.focusedRow)),e&&(t=e.querySelectorAll("td")[this.focusedCol])}t&&(t.setAttribute("data-grid-focus","true"),t.setAttribute("tabindex","0"))}handleKeyDown(e){if(this.options.isEditing())return;if(e.composedPath().some(e=>e instanceof Element&&e.matches('button, a, input, select, textarea, [contenteditable="true"], snice-button, snice-checkbox, snice-input, snice-select')))return;this.hasUserInteracted=!0;const t=this.totalRowCount,i=this.totalColCount;switch(e.key){case"ArrowDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowUp":e.preventDefault(),this.focusedRow=Math.max(-1,this.focusedRow-1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowRight":e.preventDefault(),this.focusedCol=Math.min(i-1,this.focusedCol+1),this.updateFocusIndicator();break;case"ArrowLeft":e.preventDefault(),this.focusedCol=Math.max(0,this.focusedCol-1),this.updateFocusIndicator();break;case"Home":e.preventDefault(),e.ctrlKey?(this.focusedRow=-1,this.focusedCol=0):this.focusedCol=0,this.updateFocusIndicator(),this.scrollIntoView();break;case"End":e.preventDefault(),e.ctrlKey?(this.focusedRow=t-1,this.focusedCol=i-1):this.focusedCol=i-1,this.updateFocusIndicator(),this.scrollIntoView();break;case"PageDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+10),this.updateFocusIndicator(),this.scrollIntoView();break;case"PageUp":e.preventDefault(),this.focusedRow=Math.max(0,this.focusedRow-10),this.updateFocusIndicator(),this.scrollIntoView();break;case" ":this.focusedRow>=0&&(e.preventDefault(),this.options.onSelectionToggle?.(this.focusedRow));break;case"Enter":if(this.focusedRow>=0&&this.focusedCol>=0){e.preventDefault();const t=this.getBodyRow(this.focusedRow),i=t?.querySelectorAll("td"),a=i?.[this.focusedCol],s=a?.getAttribute("data-key")||"";this.options.onCellActivate?.(this.focusedRow,s)}break;case"a":(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.options.onSelectAll?.())}}scrollIntoView(){const e=this.getTable();if(!e)return;const t=e.querySelector("[data-grid-focus]");t&&("function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"}),"function"==typeof t.focus&&t.focus({preventScroll:!0}))}isAttached(){return this.attached}}class pe{exportCSV(e,t,i={}){const{delimiter:a=",",filename:s="export.csv",includeHeaders:n=!0,columns:l,utf8BOM:r=!0}=i;let o=t.filter(e=>!1!==e.exportable);l&&(o=o.filter(e=>l.includes(e.key)));const c=[];n&&c.push(o.map(e=>this.escapeCSV(e.label,a)).join(a));for(const t of e){const e=o.map(e=>{const i=t[e.key];return this.escapeCSV(null==i?"":String(i),a)});c.push(e.join(a))}const d=c.join("\n"),h=new Blob([(r?"\ufeff":"")+d],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(h),m=document.createElement("a");m.href=u,m.download=s,m.style.display="none",document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(u)}print(e,t={}){const{hideFooter:i=!1,hideToolbar:a=!1,includeCheckboxes:s=!1,pageStyles:n=""}=t,l=e.shadowRoot;if(!l)return;const r=l.querySelector("table");if(!r)return;const o=r.cloneNode(!0),c=Array.from(r.querySelectorAll("snice-cell, [in-table], snice-checkbox")),d=Array.from(o.querySelectorAll("snice-cell, [in-table], snice-checkbox"));c.forEach((e,t)=>{const i=d[t];if(!i)return;if("snice-checkbox"===e.localName)return void i.replaceWith(document.createTextNode(e.checked?"☑":"☐"));const a=e.shadowRoot?.querySelector('[part~="content"]');i.replaceWith(document.createTextNode((a?.textContent||e.textContent||"").trim()))}),s||o.querySelectorAll(".select-column").forEach(e=>e.remove());const h=(e,t)=>{const i=l.querySelector(e);if(!i)return"";const a=i.cloneNode(!0);a.querySelectorAll("style").forEach(e=>e.remove()),a.querySelectorAll("button").forEach(e=>{e.textContent?.trim()||(e.textContent=e.getAttribute("aria-label")||"")});const s=a.textContent?.replace(/\s+/g," ").trim();return s?`<div class="${t}">${this.escapeHTML(s)}</div>`:""},u=a?"":h(".table-controls-container","print-toolbar"),m=i?"":h(".table-pagination-container","print-footer"),p=window.open("","_blank");p&&(p.document.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <title>Print</title>\n <style>\n body { font-family: system-ui, -apple-system, sans-serif; margin: 1rem; }\n table { width: 100%; border-collapse: collapse; }\n th, td { padding: 8px 12px; border: 1px solid #ddd; text-align: left; }\n th { background: #f5f5f5; font-weight: 600; }\n .print-toolbar, .print-footer { margin: 0 0 0.75rem; color: #444; }\n .print-footer { margin: 0.75rem 0 0; }\n @media print {\n body { margin: 0; }\n table { page-break-inside: auto; }\n tr { page-break-inside: avoid; }\n }\n ${n}\n </style>\n </head>\n <body>\n ${u}\n ${o.outerHTML}\n ${m}\n </body>\n </html>\n `),p.document.close(),p.onload=()=>{p.print(),p.close()})}async copyToClipboard(e,t,i={}){const{delimiter:a="\t",useFormatted:s=!0}=i;if(0===e.length)return!1;const n=e.map(e=>t.map(t=>{const i=e[t.key];return s?this.formatValue(i,e,t):this.rawValue(i)}).join(a)).join("\n");try{return await navigator.clipboard.writeText(n),!0}catch{const e=document.createElement("textarea");e.value=n,e.style.cssText="position:fixed;left:-9999px;",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}}escapeCSV(e,t){return e.includes(t)||e.includes('"')||e.includes("\n")||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}rawValue(e){if(null==e)return"";if("object"==typeof e)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}formatValue(e,t,i){const a=i.formatter||i.valueFormatter;if(a)return String(a(e,t)??"");if(null==e)return"";const s=Number(e);switch(i.type){case"number":case"accounting":{if(!Number.isFinite(s))return this.rawValue(e);const t=i.numberFormat||{},a=t.decimals??("accounting"===i.type?2:0),n=new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a,useGrouping:t.thousandsSeparator??!1}).format(Math.abs(s));let l=s<0&&("parentheses"===t.negativeStyle||"accounting"===i.type)?`(${n})`:`${s<0?"-":""}${n}`;return t.prefix&&(l=t.prefix+l),t.suffix&&(l+=t.suffix),l}case"currency":{if(!Number.isFinite(s))return this.rawValue(e);const t=i.currencyFormat||{},a=t.decimals??2,n=new Intl.NumberFormat(t.locale||"en-US",{style:"currency",currency:t.currency||"USD",currencyDisplay:t.currencyDisplay||t.display||"symbol",useGrouping:t.thousandsSeparator??!0,minimumFractionDigits:a,maximumFractionDigits:a}).format(Math.abs(s));return s>=0?n:"parentheses"===t.negativeStyle?`(${n})`:`-${n}`}case"percent":case"percentage":return Number.isFinite(s)?`${s.toFixed(i.percentageFormat?.decimals??2)}%`:this.rawValue(e);case"date":{const t=new Date(e);if(Number.isNaN(t.getTime()))return this.rawValue(e);const a=i.dateFormat||{},s="custom"===a.format?void 0:a.format||"short";return new Intl.DateTimeFormat(a.locale||"en-US",s?{dateStyle:s}:{}).format(t)}case"boolean":{const t=i.booleanFormat||{};return!0===e||String(e)===String(t.trueValue??"true")?t.trueSymbol||t.trueValue||"true":t.falseSymbol||t.falseValue||"false"}case"scientific":return Number.isFinite(s)?s.toExponential(i.numberFormat?.decimals??2):this.rawValue(e);default:return this.rawValue(e)}}escapeHTML(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}class ge{constructor(){this.expandedRows=new Set,this.options=null,this.tableElement=null,this.contentCache=new Map,this.rowByIndex=new Map,this.measuredHeights=new Map,this.onHeightChange=null}attach(e,t){this.tableElement=e,this.options=t,this.contentCache.clear(),this.rowByIndex.clear(),this.measuredHeights.clear()}prepare(e){if(!this.options)return;this.rowByIndex=new Map(e.map((e,t)=>[t,e]));const t=new Set(e);for(const e of this.contentCache.keys())t.has(e)||this.contentCache.delete(e);for(const e of this.measuredHeights.keys())t.has(e)||this.measuredHeights.delete(e);!1===this.options.lazy&&e.forEach((e,t)=>this.getContent(e,t))}isExpanded(e){return this.expandedRows.has(e)}toggle(e){this.expandedRows.has(e)?this.collapse(e):this.expand(e)}expand(e){this.expandedRows.add(e),this.tableElement?.dispatchEvent(new CustomEvent("row-expand",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}collapse(e){if(this.expandedRows.delete(e),!1!==this.options?.lazy){const t=this.rowByIndex.get(e);void 0!==t&&(this.contentCache.delete(t),this.measuredHeights.delete(t))}this.tableElement?.dispatchEvent(new CustomEvent("row-collapse",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}expandAll(e){for(let t=0;t<e;t++)this.expandedRows.add(t)}collapseAll(){this.expandedRows.clear(),!1!==this.options?.lazy&&(this.contentCache.clear(),this.measuredHeights.clear())}getExpandedRows(){return new Set(this.expandedRows)}setExpandedRows(e){const t=new Set(e);if(!1!==this.options?.lazy)for(const e of this.expandedRows){if(t.has(e))continue;const i=this.rowByIndex.get(e);void 0!==i&&(this.contentCache.delete(i),this.measuredHeights.delete(i))}this.expandedRows=t}createToggleButton(e){const t=this.isExpanded(e),i=document.createElement("button");i.type="button",i.className="detail-toggle"+(t?" detail-toggle--expanded":""),i.setAttribute("aria-expanded",String(t)),i.setAttribute("aria-label",t?"Collapse row":"Expand row");const a=t?this.options?.collapseIcon:this.options?.expandIcon;return a?a.trim().startsWith("<")?i.innerHTML=a:i.textContent=a:i.innerHTML='<svg class="detail-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e),this.tableElement?.dispatchEvent(new CustomEvent("detail-toggle",{detail:{rowIndex:e,expanded:this.isExpanded(e)},bubbles:!0,composed:!0}))}),i}createDetailRow(e,t,i){if(!this.options||!this.isExpanded(t))return null;const a=document.createElement("tr");a.className="detail-row",a.setAttribute("data-detail-for",String(t));const s=document.createElement("td");s.colSpan=i,s.className="detail-cell",s.style.padding="0",s.style.border="none";const n=document.createElement("div");n.className="detail-content";const l=document.createElement("div");l.className="detail-content-inner";const r=this.getContent(e,t);return"string"==typeof r?l.innerHTML=r:r instanceof HTMLElement&&l.appendChild(r),n.appendChild(l),s.appendChild(n),requestAnimationFrame(()=>{const t=this.options?.detailHeight,i=void 0===t||"auto"===t?`${l.scrollHeight}px`:"number"==typeof t?`${t}px`:t;void 0!==t&&"auto"!==t&&(l.style.height=i,l.style.overflow="auto"),n.style.setProperty("--detail-max-height",i),n.classList.add("detail-content--open");const a=l.getBoundingClientRect().height||l.scrollHeight,s=this.measuredHeights.get(e);a>0&&a!==s&&(this.measuredHeights.set(e,a),this.onHeightChange?.())}),a.appendChild(s),a}isEnabled(){return null!==this.options}getFixedAdditionalHeight(e){if(!this.isExpanded(e))return 0;const t=this.options?.detailHeight;if("number"==typeof t)return Math.max(0,t);if("string"==typeof t&&/^\d+(?:\.\d+)?px$/.test(t.trim()))return Math.max(0,Number.parseFloat(t));const i=this.rowByIndex.get(e);return void 0===i?0:this.measuredHeights.get(i)||0}getContent(e,t){return this.options?(this.rowByIndex.set(t,e),this.contentCache.has(e)||this.contentCache.set(e,this.options.getDetailContent(e,t)),this.contentCache.get(e)):""}}class be{constructor(){this.container=null,this.options={},this.tableElement=null,this.filterEngine=null,this.filterPanel=null,this.filterPanelOpen=!1,this.filters=[],this.logic="and",this.pendingDebounces=[],this.sortPanel=null,this.sortPanelOpen=!1,this.onSearch=null,this.onSortColumn=null,this.onSetSortModel=null,this.onFilterColumn=null,this.onRemoveFilter=null,this.onClearFilters=null,this.onSetFilterModel=null,this.onExportCSV=null,this.onFullscreen=null}attach(e,t,i={}){this.tableElement=e,this.container=t,this.options=i,this.render()}setFilterEngine(e){this.filterEngine=e}render(){if(!this.container)return;this.container.innerHTML="";const e=document.createElement("div");e.className="tt-wrap",e.appendChild(this.styleTag());const t=document.createElement("div");if(t.className="table-toolbar",t.setAttribute("part","toolbar"),!1!==this.options.showSearch){const e=document.createElement("snice-input");let i;e.type="search",e.placeholder=this.options.searchPlaceholder||"Search...",e.size="small",e.prefixIcon="search",e.clearable=!0,e.className="toolbar-search",e.addEventListener("input",()=>{clearTimeout(i),i=window.setTimeout(()=>this.onSearch?.(e.value),300)}),t.appendChild(e)}const i=document.createElement("div");if(i.className="toolbar-actions",this.options.showSort){const e=this.mkBtn("Sort",O);e.classList.add("toolbar-sort"),e.addEventListener("click",()=>this.toggleSortPanel()),i.appendChild(e)}if(this.options.showFilter){const e=this.mkBtn("Filter",$);e.classList.add("toolbar-filter"),e.addEventListener("click",()=>{this.filterPanelOpen?this.closeFilterPanel():this.openFilterModal()}),i.appendChild(e)}if(this.options.showExport){const e=this.mkBtn("Export CSV",I);e.addEventListener("click",()=>this.onExportCSV?.()),i.appendChild(e)}const a=this.mkBtn("Fullscreen",L);a.addEventListener("click",()=>this.onFullscreen?.()),i.appendChild(a),t.appendChild(i),e.appendChild(t),this.filterPanel=document.createElement("div"),this.filterPanel.className="tt-filter-panel",this.filterPanel.hidden=!this.filterPanelOpen,e.appendChild(this.filterPanel),this.sortPanel=document.createElement("div"),this.sortPanel.className="tt-sort-panel",this.sortPanel.hidden=!this.sortPanelOpen,e.appendChild(this.sortPanel),this.container.appendChild(e),this.filterPanelOpen&&this.renderFilterPanel(),this.sortPanelOpen&&this.renderSortPanel()}openFilterModal(e){this.closeSortPanel();const t=this.ensureEngine();if(!this.filterPanelOpen){const e=t.getFilterModel();this.filters=e.filters.map(e=>({...e})),this.logic=e.logic||"and"}if(e){const i=(this.tableElement?.columns||[]).find(t=>t.key===e),a=t.getOperatorsForType(i?.type||"text");i&&a[0]&&!this.filters.some(t=>t.column===e)&&this.filters.push({column:e,operator:a[0].value,value:""})}this.filterPanelOpen||(this.filterPanelOpen=!0,this.filterPanel&&(this.filterPanel.hidden=!1)),this.renderFilterPanel()}closeFilterPanel(){this.cancelPendingDebounces(),this.filterPanelOpen=!1,this.filterPanel&&(this.filterPanel.hidden=!0)}toggleSortPanel(){this.sortPanelOpen?this.closeSortPanel():(this.closeFilterPanel(),this.sortPanelOpen=!0,this.sortPanel&&(this.sortPanel.hidden=!1),this.renderSortPanel())}closeSortPanel(){this.sortPanelOpen=!1,this.sortPanel&&(this.sortPanel.hidden=!0)}renderSortPanel(){if(!this.sortPanel)return;const e=(this.tableElement?.columns||[]).filter(e=>!1!==e.sortable);let t=(this.tableElement?.currentSort||[]).map(e=>({...e}));this.sortPanel.innerHTML="",this.sortPanel.appendChild(this.styleTag());const i=document.createElement("div");i.className="tt-filter-inner";const a=document.createElement("button");a.type="button",a.className="tt-filter-corner-close",a.setAttribute("aria-label","Close sort panel"),a.innerHTML=k,a.addEventListener("click",()=>this.closeSortPanel()),i.appendChild(a);const s=document.createElement("div");s.className="tt-filter-rows",i.appendChild(s);const n=()=>this.onSetSortModel?.(t.map(e=>({...e}))),l=()=>this.renderSortPanel();if(0===t.length){const e=document.createElement("div");e.className="tt-filter-empty",e.textContent="No sorting applied",s.appendChild(e)}else t.forEach((i,a)=>{const r=document.createElement("div");r.className="tt-filter-row tt-sort-row";const o=document.createElement("button");o.type="button",o.className="tt-filter-x",o.setAttribute("aria-label","Remove sort"),o.innerHTML=k,o.addEventListener("click",()=>{t.splice(a,1),n(),l()}),r.appendChild(o);const c=document.createElement("snice-select");c.size="small";const d=new Set(t.filter((e,t)=>t!==a).map(e=>e.column));c.options=e.filter(e=>e.key===i.column||!d.has(e.key)).map(e=>({value:e.key,label:e.label||e.key})),c.value=i.column,c.style.width="12rem",c.addEventListener("change",()=>{i.column=c.value,n()}),r.appendChild(c);const h=document.createElement("snice-select");h.size="small",h.options=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}],h.value=i.direction,h.style.width="9rem",h.addEventListener("change",()=>{i.direction=h.value,n()}),r.appendChild(h),s.appendChild(r)});const r=document.createElement("div");r.className="tt-filter-footer";const o=document.createElement("button");if(o.type="button",o.className="tt-filter-add",o.innerHTML=`${D}<span>Add sort</span>`,o.addEventListener("click",()=>{const i=new Set(t.map(e=>e.column)),a=e.find(e=>!i.has(e.key));a&&(t.push({column:a.key,direction:"asc"}),n(),l())}),o.disabled=t.length>=e.length,r.appendChild(o),t.length>0){const e=document.createElement("button");e.type="button",e.className="tt-filter-clear",e.textContent="Clear all",e.addEventListener("click",()=>{t=[],n(),l()}),r.appendChild(e)}i.appendChild(r),this.sortPanel.appendChild(i)}ensureEngine(){return this.filterEngine||(this.filterEngine=new he),this.filterEngine}cancelPendingDebounces(){for(const e of this.pendingDebounces)clearTimeout(e);this.pendingDebounces=[]}renderFilterPanel(){if(!this.filterPanel)return;this.cancelPendingDebounces();const e=this.ensureEngine(),t=this.tableElement?.columns||[];if(0===this.filters.length){const t=e.getFilterModel();this.filters=[...t.filters],this.logic=t.logic||"and"}this.filterPanel.innerHTML="",this.filterPanel.appendChild(this.styleTag());const i=document.createElement("div");i.className="tt-filter-inner";const a=document.createElement("button");a.type="button",a.className="tt-filter-corner-close",a.setAttribute("aria-label","Close filter panel"),a.setAttribute("title","Close"),a.innerHTML=k,a.addEventListener("click",()=>this.closeFilterPanel()),i.appendChild(a);const s=document.createElement("div");s.className="tt-filter-rows",i.appendChild(s);const n=()=>{const i=this.filters.filter(i=>{const a=t.find(e=>e.key===i.column),s=e.getOperatorsForType(a?.type||"text").find(e=>e.value===i.operator);return!!s&&(!1===s.requiresValue||null!==i.value&&""!==i.value)});this.onSetFilterModel?.(i,this.logic)},l=(i,a)=>{const s=document.createElement("div");s.className="tt-filter-row";const l=document.createElement("button");l.type="button",l.className="tt-filter-x",l.setAttribute("aria-label","Remove filter"),l.innerHTML=k,l.addEventListener("click",()=>{this.filters.splice(a,1),0===this.filters.length?this.onClearFilters?.():n(),this.renderFilterPanel()}),s.appendChild(l);const r=document.createElement("snice-select");r.size="small",r.searchable=t.length>8,r.maxHeight="200px",r.options=t.map(e=>({value:e.key,label:e.label||e.key})),r.value=i.column,r.style.width="11rem",s.appendChild(r);const o=document.createElement("snice-select");o.size="small",o.maxHeight="200px",o.style.width="8rem",s.appendChild(o);const c=document.createElement("span");c.className="tt-filter-val-wrap";const d=document.createElement("snice-input");d.size="small",d.placeholder="Value",d.style.width="11rem",null!=i.value&&(d.value=String(i.value)),c.appendChild(d),s.appendChild(c);const h=()=>{const a=t.find(e=>e.key===r.value),s=a?.type||"text",n=e.getOperatorsForType(s);o.options=n.map(e=>({value:e.value,label:e.label})),o.value=n.some(e=>e.value===i.operator)?i.operator:"",d.type=(e=>{switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return"number";case"date":return"date";default:return"text"}})(s),u()},u=()=>{const i=t.find(e=>e.key===r.value),a=e.getOperatorsForType(i?.type||"text").find(e=>e.value===o.value);c.style.display=!1===a?.requiresValue?"none":""};let m;return r.addEventListener("change",()=>{i.column=r.value,h(),n()}),o.addEventListener("change",()=>{i.operator=o.value,u(),n()}),d.addEventListener("input",()=>{clearTimeout(m),m=window.setTimeout(()=>{this.pendingDebounces=this.pendingDebounces.filter(e=>e!==m),i.value=d.value,n()},250),this.pendingDebounces.push(m)}),d.addEventListener("keydown",e=>{"Enter"===e.key&&(i.value=d.value,n())}),h(),s};if(this.filters.length>1){const e=document.createElement("div");e.className="tt-filter-logicbar";const t=document.createElement("span");t.className="tt-filter-logicbar-label",t.textContent="Match";const a=document.createElement("snice-select");a.size="small",a.options=[{value:"and",label:"All filters (AND)"},{value:"or",label:"Any filter (OR)"}],a.value=this.logic,a.style.width="11rem",a.addEventListener("change",()=>{this.logic=a.value,n()}),e.appendChild(t),e.appendChild(a),i.insertBefore(e,s)}if(0===this.filters.length){const e=document.createElement("div");e.className="tt-filter-empty",e.textContent="No filters applied",s.appendChild(e)}else this.filters.forEach((e,t)=>s.appendChild(l(e,t)));const r=document.createElement("div");r.className="tt-filter-footer";const o=document.createElement("button");if(o.type="button",o.className="tt-filter-add",o.innerHTML=`${D}<span>Add filter</span>`,o.addEventListener("click",()=>{const i=t[0];if(!i)return;const a=e.getOperatorsForType(i.type||"text");a[0]&&(this.filters.push({column:i.key,operator:a[0].value,value:""}),this.renderFilterPanel())}),r.appendChild(o),this.filters.length>0){const e=document.createElement("button");e.type="button",e.className="tt-filter-clear",e.textContent="Clear all",e.addEventListener("click",()=>{this.cancelPendingDebounces(),this.filters=[],this.logic="and",this.onClearFilters?.(),this.renderFilterPanel()}),r.appendChild(e)}i.appendChild(r),this.filterPanel.appendChild(i)}mkBtn(e,t){const i=document.createElement("button");return i.className="toolbar-btn",i.setAttribute("aria-label",e),i.setAttribute("title",e),i.innerHTML=t,i}styleTag(){const e=document.createElement("style");return e.textContent=fe,e}setActiveFilterCount(e){}isAttached(){return null!==this.container}}const fe="\n .tt-wrap { display: flex; flex-direction: column; }\n\n .tt-filter-panel {\n border-bottom: 1px solid var(--snice-color-border, rgb(226 226 226));\n background: var(--snice-color-surface-container-low, rgb(250 250 250));\n }\n .tt-sort-panel {\n border-bottom: 1px solid var(--snice-color-border, rgb(226 226 226));\n background: var(--snice-color-surface-container-low, rgb(250 250 250));\n }\n .tt-filter-inner {\n padding: 0.75rem 0.875rem;\n padding-right: 2.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n position: relative;\n }\n .tt-filter-corner-close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n width: 1.75rem;\n height: 1.75rem;\n border: none;\n background: none;\n cursor: pointer;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n line-height: 0;\n z-index: 1;\n }\n .tt-filter-corner-close:hover {\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n color: var(--snice-color-text, rgb(23 23 23));\n }\n .tt-filter-corner-close svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-logicbar {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n .tt-filter-logicbar-label {\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--snice-color-text-secondary, rgb(82 82 82));\n flex: 0 0 auto;\n }\n .tt-filter-rows {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n .tt-filter-empty {\n padding: 0.625rem 0.5rem;\n font-size: 0.8125rem;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n font-style: italic;\n }\n .tt-filter-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n }\n .tt-filter-x {\n border: none;\n background: none;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n cursor: pointer;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n line-height: 0;\n }\n .tt-filter-x svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-x:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n .tt-filter-val-wrap { display: inline-flex; flex: 1 1 auto; min-width: 0; }\n .tt-filter-val-wrap snice-input { width: 100%; }\n .tt-filter-footer {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n margin-top: 0.125rem;\n }\n .tt-filter-add,\n .tt-filter-clear {\n border: none;\n background: none;\n font-family: inherit;\n font-size: 0.8125rem;\n cursor: pointer;\n padding: 0.375rem 0.625rem;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n line-height: 1;\n }\n .tt-filter-add svg,\n .tt-filter-clear svg {\n width: 0.875rem;\n height: 0.875rem;\n }\n .tt-filter-add { color: var(--snice-color-primary, rgb(37 99 235)); font-weight: 500; }\n .tt-filter-add:hover { background: var(--snice-color-primary-subtle, rgb(219 234 254 / 0.4)); }\n .tt-filter-clear { color: var(--snice-color-text-tertiary, rgb(115 115 115)); margin-left: auto; }\n .tt-filter-clear:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n";class ve{constructor(){this.options=null,this.expandedKeys=new Set,this.flatRows=[],this.enabled=!1,this.defaultDepth=0}attach(e){this.options=e,this.enabled=!0,void 0!==e.defaultExpansionDepth&&e.defaultExpansionDepth>=0&&(this.defaultDepth=e.defaultExpansionDepth)}isEnabled(){return this.enabled}processData(e){if(!this.options)return[];const t=new Map;for(const i of e){const e=this.options.getPath(i),a=e.join("/");t.set(a,{data:i,children:new Set,depth:e.length-1,isGap:!1});for(let i=1;i<e.length;i++){const a=e.slice(0,i),s=a.join("/");t.has(s)||t.set(s,{data:{[this.options.groupColumn||"name"]:a[a.length-1]},children:new Set,depth:i-1,isGap:!0})}if(e.length>1){const i=e.slice(0,-1).join("/"),s=t.get(i);s&&s.children.add(a)}}const i=[];for(const[e,a]of t)0===a.depth&&i.push(e);if(i.sort(),0===this.expandedKeys.size&&this.defaultDepth>0)for(const[e,i]of t)i.depth<this.defaultDepth&&i.children.size>0&&this.expandedKeys.add(e);this.flatRows=[];const a=e=>{const i=t.get(e);if(!i)return;const s=i.children.size>0,n=this.expandedKeys.has(e);if(this.flatRows.push({path:e.split("/"),data:i.data,depth:i.depth,hasChildren:s,expanded:n,key:e,isGap:i.isGap}),n){const e=Array.from(i.children).sort();for(const t of e)a(t)}};for(const e of i)a(e);return this.flatRows}getFlatRows(){return this.flatRows}toggle(e){this.expandedKeys.has(e)?this.expandedKeys.delete(e):this.expandedKeys.add(e)}expand(e){this.expandedKeys.add(e)}collapse(e){this.expandedKeys.delete(e)}expandAll(e){if(this.options)for(const t of e){const e=this.options.getPath(t);for(let t=1;t<=e.length;t++)this.expandedKeys.add(e.slice(0,t).join("/"))}}collapseAll(){this.expandedKeys.clear()}isExpanded(e){return this.expandedKeys.has(e)}createToggle(e){const t=document.createElement("span");if(t.className="tree-indent",t.style.paddingLeft=1.5*e.depth+"rem",e.hasChildren){const i=document.createElement("button");i.type="button",i.className="tree-toggle"+(e.expanded?" tree-toggle--expanded":""),i.innerHTML='<svg class="tree-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.setAttribute("aria-expanded",String(e.expanded)),i.setAttribute("aria-label",(e.expanded?"Collapse":"Expand")+" row"),i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e.key),i.dispatchEvent(new CustomEvent("tree-toggle",{detail:{key:e.key,expanded:this.isExpanded(e.key)},bubbles:!0,composed:!0}))}),t.appendChild(i)}else{const e=document.createElement("span");e.className="tree-spacer",t.appendChild(e)}return t}getGroupColumn(){return this.options?.groupColumn||""}}function ye(e,t,i){if("function"==typeof e)return e(t,i);if("count"===e)return i.length;const a=[];for(const e of t)if(null!=e&&"boolean"!=typeof e&&("string"!=typeof e||""!==e.trim()))try{const t=Number(e);Number.isFinite(t)&&a.push(t)}catch{}switch(e){case"sum":return a.reduce((e,t)=>e+t,0);case"avg":return a.length?a.reduce((e,t)=>e+t,0)/a.length:0;case"min":return a.length?a.reduce((e,t)=>t<e?t:e,a[0]):null;case"max":return a.length?a.reduce((e,t)=>t>e?t:e,a[0]):null;default:return null}}class we{constructor(){this.groupByKeys=[],this.defaultExpanded=!0,this.aggregators=[],this.collapsedOverrides=new Set,this.expandedOverrides=new Set,this.flatItems=[],this.objectValueIds=new WeakMap,this.symbolValueIds=new Map,this.nextValueId=1}configure(e){this.groupByKeys=(e.groupBy??[]).filter(Boolean),this.defaultExpanded=!1!==e.defaultExpanded}setColumns(e){const t=e.filter(e=>null!=e.aggregate).map(e=>({key:e.key,aggregate:e.aggregate,valueGetter:e.valueGetter})),i=t.length!==this.aggregators.length||t.some((e,t)=>{const i=this.aggregators[t];return i?.key!==e.key||i.aggregate!==e.aggregate||i.valueGetter!==e.valueGetter});return this.aggregators=t,i}hasGrouping(){return this.groupByKeys.length>0}hasAggregation(){return this.aggregators.length>0}isEnabled(){return this.hasGrouping()||this.hasAggregation()}getGroupByKeys(){return this.groupByKeys}computeAggregates(e){const t={};for(const i of this.aggregators){const a=e.map(e=>{const t=e?.[i.key];return i.valueGetter?i.valueGetter(t,e):t});t[i.key]=ye(i.aggregate,a,e)}return t}valueKey(e){if(null===e)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return`string:${encodeURIComponent(e)}`;case"number":return Number.isNaN(e)?"number:NaN":`number:${Object.is(e,-0)?"0":String(e)}`;case"boolean":return"boolean:"+(e?"1":"0");case"bigint":return`bigint:${String(e)}`;case"symbol":{let t=this.symbolValueIds.get(e);return void 0===t&&(t=this.nextValueId++,this.symbolValueIds.set(e,t)),`symbol:${t}`}case"object":case"function":{const t=e;let i=this.objectValueIds.get(t);return void 0===i&&(i=this.nextValueId++,this.objectValueIds.set(t,i)),`object:${i}`}default:return`${typeof e}:${encodeURIComponent(String(e))}`}}processData(e){if(!this.isEnabled()||0===e.length)return this.flatItems=[],this.flatItems;const t=[];if(this.hasGrouping())this.buildGroups(e,0,"",t);else for(const i of e)t.push({type:"row",key:i,depth:0,data:i});return this.hasAggregation()&&t.push({type:"aggregate",key:"agg:table",depth:0,scope:"table",aggregates:this.computeAggregates(e),rows:e}),this.flatItems=t,t}buildGroups(e,t,i,a){const s=this.groupByKeys[t],n=new Map;for(const t of e){const e=t[s],i=n.get(e);i?i.push(t):n.set(e,[t])}const l=Array.from(n.keys()).sort((e,t)=>String(e??"").localeCompare(String(t??""),void 0,{numeric:!0})||this.valueKey(e).localeCompare(this.valueKey(t))),r=t===this.groupByKeys.length-1;for(const e of l){const l=n.get(e),o=`${encodeURIComponent(s)}=${this.valueKey(e)}`,c=i?`${i}|${o}`:o,d=`group:${c}`,h=this.isExpanded(d);if(a.push({type:"group",key:d,depth:t,groupKey:s,value:e,count:l.length,expanded:h,hasChildren:!0,rows:l}),h){if(r)for(const e of l)a.push({type:"row",key:e,depth:t+1,data:e});else this.buildGroups(l,t+1,c,a);this.hasAggregation()&&a.push({type:"aggregate",key:`agg:${d}`,depth:t+1,scope:"group",aggregates:this.computeAggregates(l),rows:l,groupKey:d,groupValue:e,groupColumn:s})}}}getFlatItems(){return this.flatItems}isExpanded(e){return this.defaultExpanded?!this.collapsedOverrides.has(e):this.expandedOverrides.has(e)}toggle(e){this.isExpanded(e)?this.collapse(e):this.expand(e)}expand(e){this.collapsedOverrides.delete(e),this.defaultExpanded||this.expandedOverrides.add(e)}collapse(e){this.expandedOverrides.delete(e),this.defaultExpanded&&this.collapsedOverrides.add(e)}expandAll(){if(this.collapsedOverrides.clear(),!this.defaultExpanded)for(const e of this.flatItems)"group"===e.type&&this.expandedOverrides.add(e.key)}collapseAll(){if(this.expandedOverrides.clear(),this.defaultExpanded)for(const e of this.flatItems)"group"===e.type&&this.collapsedOverrides.add(e.key)}createToggle(e){const t=document.createElement("span");t.className="tree-indent",t.style.paddingLeft=1.5*e.depth+"rem";const i=document.createElement("button");i.type="button",i.className="tree-toggle"+(e.expanded?" tree-toggle--expanded":""),i.setAttribute("data-group-key",e.key),i.innerHTML='<svg class="tree-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.setAttribute("aria-expanded",String(e.expanded));const a=null==e.value||""===e.value?"blank":String(e.value);return i.setAttribute("aria-label",`${e.expanded?"Collapse":"Expand"} ${a} group, ${e.count} rows`),t.appendChild(i),t}}class ke{constructor(){this.menuEl=null,this.activeColumn=null,this.tableElement=null,this.outsideClickHandler=null,this.onSortAsc=null,this.onSortDesc=null,this.onFilter=null,this.onHide=null,this.onPinLeft=null,this.onPinRight=null,this.onUnpin=null,this.onAutoSize=null}attach(e){this.tableElement=e}show(e,t,i,a){this.hide(),this.activeColumn=e;const s=document.createElement("div");s.className="table-column-menu",s.style.left=`${t}px`,s.style.top=`${i}px`;const n=[];!1!==a?.sortable&&(n.push({label:"Sort Ascending",icon:A,action:"sort-asc"}),n.push({label:"Sort Descending",icon:R,action:"sort-desc"}),n.push({label:"",action:"",separator:!0})),!1!==a?.filterable&&n.push({label:"Filter...",icon:$,action:"filter"}),!1!==a?.hideable&&n.push({label:"Hide Column",icon:V,action:"hide"}),!1!==a?.pinnable&&(a?.pinned?n.push({label:"Unpin",icon:k,action:"unpin"}):(n.push({label:"Pin Left",icon:B,action:"pin-left"}),n.push({label:"Pin Right",icon:B,action:"pin-right"}))),n.push({label:"",action:"",separator:!0}),n.push({label:"Auto-size",icon:O,action:"autosize"});for(const e of n){if(e.separator){const e=document.createElement("div");e.className="column-menu-separator",s.appendChild(e);continue}const t=document.createElement("button");t.type="button",t.className="column-menu-item",t.innerHTML=`${e.icon?`<span class="column-menu-icon">${e.icon}</span>`:""}<span>${e.label}</span>`,t.addEventListener("click",()=>{this.handleAction(e.action),this.hide()}),e.disabled&&(t.disabled=!0),s.appendChild(t)}const l=this.tableElement?.shadowRoot;l?l.appendChild(s):document.body.appendChild(s),this.menuEl=s,setTimeout(()=>{this.outsideClickHandler=e=>{e.composedPath().includes(s)||this.hide()},document.addEventListener("click",this.outsideClickHandler,{capture:!0})},0);const r=e=>{"Escape"===e.key&&(this.hide(),document.removeEventListener("keydown",r))};document.addEventListener("keydown",r)}handleAction(e){if(this.activeColumn)switch(e){case"sort-asc":this.onSortAsc?.(this.activeColumn);break;case"sort-desc":this.onSortDesc?.(this.activeColumn);break;case"filter":this.onFilter?.(this.activeColumn);break;case"hide":this.onHide?.(this.activeColumn);break;case"pin-left":this.onPinLeft?.(this.activeColumn);break;case"pin-right":this.onPinRight?.(this.activeColumn);break;case"unpin":this.onUnpin?.(this.activeColumn);break;case"autosize":this.onAutoSize?.(this.activeColumn)}}hide(){this.menuEl&&(this.menuEl.remove(),this.menuEl=null),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,{capture:!0}),this.outsideClickHandler=null),this.activeColumn=null}isOpen(){return null!==this.menuEl}}class xe{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceIndex=-1,this.dropTargetIndex=-1,this.dropIndicator=null}attach(e){this.tableElement=e,this.enabled=!0}detach(){this.removeDropIndicator(),this.tableElement=null,this.dragSourceIndex=-1,this.dropTargetIndex=-1,this.enabled=!1}isEnabled(){return this.enabled}makeRowDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceIndex=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",String(t))}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.removeDropIndicator(),this.dragSourceIndex=-1}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",this.dropTargetIndex=t,this.showDropIndicator(e)}),e.addEventListener("dragleave",()=>{this.removeDropIndicator()}),e.addEventListener("drop",e=>{e.preventDefault(),this.removeDropIndicator(),-1!==this.dragSourceIndex&&this.dragSourceIndex!==t&&this.tableElement?.dispatchEvent(new CustomEvent("row-reorder",{detail:{fromIndex:this.dragSourceIndex,toIndex:t},bubbles:!0,composed:!0})),this.dragSourceIndex=-1}))}createDragHandle(){const e=document.createElement("td");return e.className="drag-handle-cell",e.textContent="⠗",e.setAttribute("aria-label","Drag to reorder"),e}showDropIndicator(e){this.removeDropIndicator(),this.dropIndicator=document.createElement("div"),this.dropIndicator.className="drop-indicator";const t=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();i&&(this.dropIndicator.style.top=(this.dropTargetIndex>this.dragSourceIndex?t.bottom-i.top:t.top-i.top)+"px",e.parentElement.style.position="relative",e.parentElement.appendChild(this.dropIndicator))}removeDropIndicator(){this.dropIndicator?.remove(),this.dropIndicator=null}}class Ce{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceKey=null}attach(e){this.tableElement=e,this.enabled=!0}detach(){this.tableElement=null,this.dragSourceKey=null,this.enabled=!1}isEnabled(){return this.enabled}makeHeaderDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceKey=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",t)}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.dragSourceKey=null}),e.addEventListener("dragover",i=>{this.dragSourceKey&&this.dragSourceKey!==t&&(i.preventDefault(),i.dataTransfer.dropEffect="move",e.style.borderLeft="2px solid var(--snice-color-primary, rgb(37 99 235))")}),e.addEventListener("dragleave",()=>{e.style.borderLeft=""}),e.addEventListener("drop",i=>{i.preventDefault(),e.style.borderLeft="",this.dragSourceKey&&this.dragSourceKey!==t&&this.tableElement?.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:this.dragSourceKey,toKey:t},bubbles:!0,composed:!0})),this.dragSourceKey=null}))}}let Se=(()=>{let t,a,c,p,b,v,k,x,C,S,E,D,A,R,M,z,F,$,I,T,L,V,B,O,j,P,N,H,q,_,G,K,W,U,Z,Y,J,Q,X,ee,te,ie,ae,se,re,oe,ce,de,fe,ye,Se,Ee,De,Ae,Re,Me,ze,Fe,$e,Ie,Te,Le,Ve,Be,Oe,je,Pe,Ne,He,qe,_e,Ge,Ke,We,Ue,Ze,Ye,Je,Qe,Xe,et,tt,it,at,st,nt,lt,rt,ot,ct,dt,ht=[i("snice-table")],ut=[],mt=HTMLElement,pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],Ft=[],$t=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[],_t=[],Gt=[],Kt=[],Wt=[],Ut=[],Zt=[],Yt=[],Jt=[],Qt=[],Xt=[],ei=[],ti=[],ii=[],ai=[],si=[],ni=[],li=[],ri=[],oi=[],ci=[],di=[],hi=[],ui=[],mi=[],pi=[],gi=[],bi=[],fi=[],vi=[],yi=[],wi=[],ki=[],xi=[],Ci=[],Si=[],Ei=[],Di=[],Ai=[],Ri=[],Mi=[],zi=[],Fi=[],$i=[],Ii=[],Ti=[],Li=[],Vi=[],Bi=[],Oi=[],ji=[],Pi=[],Ni=[],Hi=[],qi=[],_i=[],Gi=[],Ki=[];var Wi=class extends mt{static{a=this}constructor(){super(...arguments),this.striped=(w(this,pt),w(this,gt,!1)),this.searchable=(w(this,bt),w(this,ft,!1)),this.filterable=(w(this,vt),w(this,yt,!1)),this.sortable=(w(this,wt),w(this,kt,!1)),this.selectable=(w(this,xt),w(this,Ct,!1)),this.hoverable=(w(this,St),w(this,Et,!0)),this.clickable=(w(this,Dt),w(this,At,!1)),this.list=(w(this,Rt),w(this,Mt,!1)),this.pagination=(w(this,zt),w(this,Ft,!1)),this.paginationMode=(w(this,$t),w(this,It,"client")),this.pageSize=(w(this,Tt),w(this,Lt,10)),this.currentPage=(w(this,Vt),w(this,Bt,1)),this.totalItems=(w(this,Ot),w(this,jt,0)),this.pageSizes=(w(this,Pt),w(this,Nt,[10,25,50,100])),this.searchDebounce=(w(this,Ht),w(this,qt,500)),this.columns=(w(this,_t),w(this,Gt,[])),this.data=(w(this,Kt),w(this,Wt,[])),this.mode=(w(this,Ut),w(this,Zt,"local")),this.currentSort=(w(this,Yt),w(this,Jt,[])),this.searchText=(w(this,Qt),""),this.selector=w(this,Xt,""),this.selectorOptions=(w(this,ei),w(this,ti,[])),this.loading=(w(this,ii),w(this,ai,!1)),this.loadError=(w(this,si),null),this.virtualize=w(this,ni,!1),this.rowHeight=(w(this,li),w(this,ri,48)),this.virtualBuffer=(w(this,oi),w(this,ci,200)),this.columnResize=(w(this,di),w(this,hi,!1)),this.editable=(w(this,ui),w(this,mi,!1)),this.editMode=(w(this,pi),w(this,gi,"cell")),this.density=(w(this,bi),w(this,fi,"standard")),this.headerFilters=(w(this,vi),w(this,yi,!1)),this.quickFilter=(w(this,wi),w(this,ki,!1)),this.rowReorder=(w(this,xi),w(this,Ci,!1)),this.columnReorder=(w(this,Si),w(this,Ei,!1)),this.columnMenu=(w(this,Di),w(this,Ai,!1)),this.lazyLoad=(w(this,Ri),w(this,Mi,!1)),this.lazyLoadThreshold=(w(this,zi),w(this,Fi,200)),this.selectedRows=(w(this,$i),w(this,Ii,[])),this.selectionMode=(w(this,Ti),w(this,Li,"multiple")),this.selectionAnchor=(w(this,Vi),null),this.groupBy=w(this,Bi,""),this.groupDefaults=(w(this,Oi),w(this,ji,{})),this.groupingCache=(w(this,Pi),null),this.virtualizer=new ne,this.columnManager=new le,this.filterEngine=new he,this.editor=new ue,this.keyboard=new me,this.exporter=new pe,this.masterDetail=new ge,this.toolbar=new be,this.treeData=new ve,this.grouping=new we,this.columnMenuManager=new ke,this.rowDnD=new xe,this.columnDnD=new Ce,this.pinnedTopRows=[],this.pinnedBottomRows=[],this.toolbarOptions=null,this.lazyLoadHandler=null,this.lazyLoadContainer=null,this.rowHeightCallback=null,this.virtualRowsSnapshot=[],this.table=w(this,Ni,void 0),this.thead=(w(this,Hi),w(this,qi,void 0)),this.tbody=(w(this,_i),w(this,Gi,void 0)),this.unsortedData=(w(this,Ki),[]),this.dataRequestTimeout=null,this.rowIndexMap=new Map,this.rowIndexDataRef=null,this.filteredCache=null,this.dataRequestSeq=0,this.renderedRows=new Map,this.settingSortedData=!1,this.settingDataImperative=!1,this.renderQueued=!1,this.pendingHeaderRender=!1,this.pendingBodyRender=!1,this.rendererIds=new WeakMap,this.rendererIdSeq=0,this.fsExitHandler=null,this.toggleFullscreen=async()=>{if(this.classList.contains("table-fullscreen")){if(this.classList.remove("table-fullscreen"),document.fullscreenElement===this)try{await document.exitFullscreen()}catch{}this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null)}else{this.classList.add("table-fullscreen");try{"function"==typeof this.requestFullscreen&&await this.requestFullscreen()}catch{}this.fsExitHandler=()=>{document.fullscreenElement!==this&&(this.classList.remove("table-fullscreen"),this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null))},document.addEventListener("fullscreenchange",this.fsExitHandler)}},this.handleKeydown=e=>{if("Enter"!==e.key&&" "!==e.key)return;const t=e.target.closest("th.sortable");if(!t)return;const i=t.getAttribute("data-key");i&&(e.preventDefault(),this.toggleSort(i,!0))},this.handleClick=e=>{const t=e.target,i=t.closest("th.sortable");if(i){const e=i.getAttribute("data-key");return void(e&&this.toggleSort(e,!0))}const a=t.closest("tbody tr");if(a){if(a.classList.contains("group-header-row")){if(t.closest("snice-checkbox.group-select"))return;const e=a.getAttribute("data-group-key"),i=e?this.getGroupingItems().find(t=>"group"===t.type&&t.key===e):void 0;return void(i&&this.toggleGroup(i))}if(!a.hasAttribute("data-index"))return;if(t.matches('input[type="checkbox"], button, a, .interactive, snice-checkbox, snice-button, snice-input, snice-select'))return;const i=parseInt(a.getAttribute("data-index")||"0"),s=this.data[i];this.selectable&&this.applyRowSelection(i,{additive:e.ctrlKey||e.metaKey,range:e.shiftKey}),this.clickable&&this.dispatchRowClicked(s,i)}},this.handleChange=e=>{const t=e.target;if(t.matches("snice-checkbox.row-select")){const e=t,i=parseInt(e.getAttribute("data-row-index")||"0");if("none"===this.selectionMode)return;return this.selectabilityCheck&&!this.selectabilityCheck(this.data[i],i)?void(e.checked=this.selectedRows.includes(i)):("single"===this.selectionMode?this.selectedRows=e.checked?[i]:[]:e.checked?this.selectedRows.includes(i)||(this.selectedRows=[...this.selectedRows,i]):this.selectedRows=this.selectedRows.filter(e=>e!==i),this.selectionAnchor=this.data[i],this.dispatchRowSelectionChanged(i,e.checked),void this.dispatchSelectionChanged())}if(t.matches("snice-checkbox.group-select")){const e=t;if("multiple"!==this.selectionMode)return;const i=e.getAttribute("data-group-key"),a=this.getGroupingItems().find(e=>"group"===e.type&&e.key===i);if(!a)return;const s=this.getSelectableGroupIndices(a);if(e.checked)this.selectedRows=Array.from(new Set([...this.selectedRows,...s]));else{const e=new Set(s);this.selectedRows=this.selectedRows.filter(t=>!e.has(t))}return void this.dispatchSelectionChanged()}if(t.matches("snice-checkbox.select-all")){const e=t;if("multiple"!==this.selectionMode)return;this.selectedRows=e.checked?this.getSelectableIndices(this.getFilteredData()):[],this.dispatchSelectAllChanged(e.checked),this.dispatchSelectionChanged()}},this.onAttached=()=>{"remote"===this.mode&&(this.getTableConfig(),this.getTableData())},this.searchDebounceTimeout=null,this.handleSearchInput=e=>{this.searchText=e.target.value,this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout(()=>{"remote"===this.mode?this.getTableData():this.setQuickFilter(this.searchText)},this.searchDebounce)},this.handleQuickFilterInput=e=>{const t=e.target;this.filterInputDebounceTimeout&&clearTimeout(this.filterInputDebounceTimeout),this.filterInputDebounceTimeout=setTimeout(()=>{this.filterInputDebounceTimeout=null,this.setQuickFilter(t.value||"")},Wi.FILTER_INPUT_DEBOUNCE_MS)},this.selectorDebounceTimeout=null,this.handleSelectorChange=e=>{this.selector=Array.isArray(e.detail.value)?e.detail.value.join(","):e.detail.value,this.selectorDebounceTimeout&&clearTimeout(this.selectorDebounceTimeout),this.selectorDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},150)},this.filterInputDebounceTimeout=null,this.handleSlottedRowSelect=e=>{const t=e.detail?.element,i=this.getSlottedSelectionRows(),a=i.indexOf(t);if(!(a<0))return!this.hasSelectionColumn()||this.selectabilityCheck&&!this.selectabilityCheck(t.data,a)?(t.selected=!1,void this.syncSlottedSelectionState()):("single"===this.selectionMode&&t.selected&&i.forEach((e,t)=>{t!==a&&(e.selected=!1)}),this.selectedRows=i.map((e,t)=>e.selected?t:-1).filter(e=>e>=0),this.selectionAnchor=t.data,this.dispatchRowSelectionChanged(a,t.selected),void this.dispatchSelectionChanged())},this.selectabilityCheck=null,this.listViewRenderer=null}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(mt[Symbol.metadata]??null):void 0;c=[s({type:Boolean,attribute:"striped"})],p=[s({type:Boolean,attribute:"searchable"})],b=[s({type:Boolean,attribute:"filterable"})],v=[s({type:Boolean,attribute:"sortable"})],k=[s({type:Boolean,attribute:"selectable"})],x=[s({type:Boolean,attribute:"hoverable"})],C=[s({type:Boolean,attribute:"clickable"})],S=[s({type:Boolean,attribute:"list"})],E=[s({type:Boolean,attribute:"pagination"})],D=[s({attribute:"pagination-mode"})],A=[s({type:Number,attribute:"page-size"})],R=[s({type:Number,attribute:"current-page"})],M=[s({type:Number,attribute:"total-items"})],z=[s({type:Array,attribute:!1})],F=[s({type:Number,attribute:"search-debounce"})],$=[s({attribute:!1})],I=[s({attribute:!1})],T=[s()],L=[s({type:Array,attribute:!1})],V=[s({type:String,attribute:"selector"})],B=[s({type:Array,attribute:!1})],O=[s({type:Boolean,attribute:"loading"})],j=[s({type:Boolean,attribute:"virtualize"})],P=[s({type:Number,attribute:"row-height"})],N=[s({type:Number,attribute:"virtual-buffer"})],H=[s({type:Boolean,attribute:"column-resize"})],q=[s({type:Boolean,attribute:"editable"})],_=[s({attribute:"edit-mode"})],G=[s({attribute:"density"})],K=[s({type:Boolean,attribute:"header-filters"})],W=[s({type:Boolean,attribute:"quick-filter"})],U=[s({type:Boolean,attribute:"row-reorder"})],Z=[s({type:Boolean,attribute:"column-reorder"})],Y=[s({type:Boolean,attribute:"column-menu"})],J=[s({type:Boolean,attribute:"lazy-load"})],Q=[s({type:Number,attribute:"lazy-load-threshold"})],X=[s({type:Array,attribute:!1})],ee=[s({attribute:"selection-mode"})],te=[s({attribute:!1})],ie=[s({attribute:!1})],ae=[n("table")],se=[n("thead")],re=[n("tbody")],oe=[g("table/config")],ce=[g("table/data")],de=[r()],fe=[l()],ye=[o()],Se=[f("column-changed")],Ee=[d("selectorOptions")],De=[d("sortable")],Ae=[d("selectable")],Re=[d("columns",{immediate:!1})],Me=[d("groupBy","groupDefaults",{immediate:!1})],ze=[d("data",{immediate:!1})],Fe=[d("loading")],$e=[d("selectedRows")],Ie=[d("selectionMode",{immediate:!1})],Te=[d("currentSort")],Le=[d("searchable","filterable","quickFilter")],Ve=[d("currentSort",{immediate:!1})],Be=[d("currentPage",{immediate:!1})],Oe=[d("pageSize",{immediate:!1})],je=[d("density",{immediate:!1})],Pe=[d("list",{immediate:!1})],Ne=[d("editable",{immediate:!1})],He=[d("editMode",{immediate:!1})],qe=[d("virtualize",{immediate:!1})],_e=[d("rowHeight",{immediate:!1})],Ge=[d("columnResize",{immediate:!1})],Ke=[d("headerFilters",{immediate:!1})],We=[d("rowReorder",{immediate:!1})],Ue=[d("columnReorder",{immediate:!1})],Ze=[d("lazyLoad","lazyLoadThreshold",{immediate:!1})],Ye=[d("columnMenu",{immediate:!1})],Je=[h("page-change",{bubbles:!0,composed:!0})],Qe=[h("table-row-selection-changed",{bubbles:!0,composed:!0})],Xe=[h("row-clicked",{bubbles:!0,composed:!0})],et=[h("table-load-error",{bubbles:!0,composed:!0})],tt=[h("table-select-all-changed",{bubbles:!0,composed:!0})],it=[h("selection-changed",{bubbles:!0,composed:!0})],at=[h("sort-change",{bubbles:!0,composed:!0})],st=[h("filter-change",{bubbles:!0,composed:!0})],nt=[h("column-visibility-change",{bubbles:!0,composed:!0})],lt=[h("column-pin-change",{bubbles:!0,composed:!0})],rt=[h("column-order-change",{bubbles:!0,composed:!0})],ot=[h("density-change",{bubbles:!0,composed:!0})],ct=[u()],dt=[h("group-toggle",{bubbles:!0,composed:!0})],y(this,null,oe,{kind:"method",name:"getTableConfig",static:!1,private:!1,access:{has:e=>"getTableConfig"in e,get:e=>e.getTableConfig},metadata:e},null,pt),y(this,null,ce,{kind:"method",name:"getTableData",static:!1,private:!1,access:{has:e=>"getTableData"in e,get:e=>e.getTableData},metadata:e},null,pt),y(this,null,de,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,pt),y(this,null,fe,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,pt),y(this,null,ye,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:e},null,pt),y(this,null,Se,{kind:"method",name:"handleDeclarativeColumnChange",static:!1,private:!1,access:{has:e=>"handleDeclarativeColumnChange"in e,get:e=>e.handleDeclarativeColumnChange},metadata:e},null,pt),y(this,null,Ee,{kind:"method",name:"handleSelectorOptionsChange",static:!1,private:!1,access:{has:e=>"handleSelectorOptionsChange"in e,get:e=>e.handleSelectorOptionsChange},metadata:e},null,pt),y(this,null,De,{kind:"method",name:"handleSortableChange",static:!1,private:!1,access:{has:e=>"handleSortableChange"in e,get:e=>e.handleSortableChange},metadata:e},null,pt),y(this,null,Ae,{kind:"method",name:"handleSelectableChange",static:!1,private:!1,access:{has:e=>"handleSelectableChange"in e,get:e=>e.handleSelectableChange},metadata:e},null,pt),y(this,null,Re,{kind:"method",name:"handleColumnsAssignment",static:!1,private:!1,access:{has:e=>"handleColumnsAssignment"in e,get:e=>e.handleColumnsAssignment},metadata:e},null,pt),y(this,null,Me,{kind:"method",name:"handleGroupByChange",static:!1,private:!1,access:{has:e=>"handleGroupByChange"in e,get:e=>e.handleGroupByChange},metadata:e},null,pt),y(this,null,ze,{kind:"method",name:"handleDataAssignment",static:!1,private:!1,access:{has:e=>"handleDataAssignment"in e,get:e=>e.handleDataAssignment},metadata:e},null,pt),y(this,null,Fe,{kind:"method",name:"handleDataChange",static:!1,private:!1,access:{has:e=>"handleDataChange"in e,get:e=>e.handleDataChange},metadata:e},null,pt),y(this,null,$e,{kind:"method",name:"handleSelectedRowsChange",static:!1,private:!1,access:{has:e=>"handleSelectedRowsChange"in e,get:e=>e.handleSelectedRowsChange},metadata:e},null,pt),y(this,null,Ie,{kind:"method",name:"handleSelectionModeChange",static:!1,private:!1,access:{has:e=>"handleSelectionModeChange"in e,get:e=>e.handleSelectionModeChange},metadata:e},null,pt),y(this,null,Te,{kind:"method",name:"handleSortChange",static:!1,private:!1,access:{has:e=>"handleSortChange"in e,get:e=>e.handleSortChange},metadata:e},null,pt),y(this,null,Le,{kind:"method",name:"handleControlsChange",static:!1,private:!1,access:{has:e=>"handleControlsChange"in e,get:e=>e.handleControlsChange},metadata:e},null,pt),y(this,null,Ve,{kind:"method",name:"handleControlledSort",static:!1,private:!1,access:{has:e=>"handleControlledSort"in e,get:e=>e.handleControlledSort},metadata:e},null,pt),y(this,null,Be,{kind:"method",name:"handleCurrentPageChange",static:!1,private:!1,access:{has:e=>"handleCurrentPageChange"in e,get:e=>e.handleCurrentPageChange},metadata:e},null,pt),y(this,null,Oe,{kind:"method",name:"handlePageSizeChange",static:!1,private:!1,access:{has:e=>"handlePageSizeChange"in e,get:e=>e.handlePageSizeChange},metadata:e},null,pt),y(this,null,je,{kind:"method",name:"handleDensityChange",static:!1,private:!1,access:{has:e=>"handleDensityChange"in e,get:e=>e.handleDensityChange},metadata:e},null,pt),y(this,null,Pe,{kind:"method",name:"handleListChange",static:!1,private:!1,access:{has:e=>"handleListChange"in e,get:e=>e.handleListChange},metadata:e},null,pt),y(this,null,Ne,{kind:"method",name:"handleEditableChange",static:!1,private:!1,access:{has:e=>"handleEditableChange"in e,get:e=>e.handleEditableChange},metadata:e},null,pt),y(this,null,He,{kind:"method",name:"handleEditModeChange",static:!1,private:!1,access:{has:e=>"handleEditModeChange"in e,get:e=>e.handleEditModeChange},metadata:e},null,pt),y(this,null,qe,{kind:"method",name:"handleVirtualizeChange",static:!1,private:!1,access:{has:e=>"handleVirtualizeChange"in e,get:e=>e.handleVirtualizeChange},metadata:e},null,pt),y(this,null,_e,{kind:"method",name:"handleRowHeightChange",static:!1,private:!1,access:{has:e=>"handleRowHeightChange"in e,get:e=>e.handleRowHeightChange},metadata:e},null,pt),y(this,null,Ge,{kind:"method",name:"handleColumnResizeChange",static:!1,private:!1,access:{has:e=>"handleColumnResizeChange"in e,get:e=>e.handleColumnResizeChange},metadata:e},null,pt),y(this,null,Ke,{kind:"method",name:"handleHeaderFiltersChange",static:!1,private:!1,access:{has:e=>"handleHeaderFiltersChange"in e,get:e=>e.handleHeaderFiltersChange},metadata:e},null,pt),y(this,null,We,{kind:"method",name:"handleRowReorderChange",static:!1,private:!1,access:{has:e=>"handleRowReorderChange"in e,get:e=>e.handleRowReorderChange},metadata:e},null,pt),y(this,null,Ue,{kind:"method",name:"handleColumnReorderChange",static:!1,private:!1,access:{has:e=>"handleColumnReorderChange"in e,get:e=>e.handleColumnReorderChange},metadata:e},null,pt),y(this,null,Ze,{kind:"method",name:"handleLazyLoadChange",static:!1,private:!1,access:{has:e=>"handleLazyLoadChange"in e,get:e=>e.handleLazyLoadChange},metadata:e},null,pt),y(this,null,Ye,{kind:"method",name:"handleColumnMenuChange",static:!1,private:!1,access:{has:e=>"handleColumnMenuChange"in e,get:e=>e.handleColumnMenuChange},metadata:e},null,pt),y(this,null,Je,{kind:"method",name:"dispatchPageChange",static:!1,private:!1,access:{has:e=>"dispatchPageChange"in e,get:e=>e.dispatchPageChange},metadata:e},null,pt),y(this,null,Qe,{kind:"method",name:"dispatchRowSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchRowSelectionChanged"in e,get:e=>e.dispatchRowSelectionChanged},metadata:e},null,pt),y(this,null,Xe,{kind:"method",name:"dispatchRowClicked",static:!1,private:!1,access:{has:e=>"dispatchRowClicked"in e,get:e=>e.dispatchRowClicked},metadata:e},null,pt),y(this,null,et,{kind:"method",name:"dispatchLoadError",static:!1,private:!1,access:{has:e=>"dispatchLoadError"in e,get:e=>e.dispatchLoadError},metadata:e},null,pt),y(this,null,tt,{kind:"method",name:"dispatchSelectAllChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectAllChanged"in e,get:e=>e.dispatchSelectAllChanged},metadata:e},null,pt),y(this,null,it,{kind:"method",name:"dispatchSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectionChanged"in e,get:e=>e.dispatchSelectionChanged},metadata:e},null,pt),y(this,null,at,{kind:"method",name:"dispatchSortChange",static:!1,private:!1,access:{has:e=>"dispatchSortChange"in e,get:e=>e.dispatchSortChange},metadata:e},null,pt),y(this,null,st,{kind:"method",name:"dispatchFilterChange",static:!1,private:!1,access:{has:e=>"dispatchFilterChange"in e,get:e=>e.dispatchFilterChange},metadata:e},null,pt),y(this,null,nt,{kind:"method",name:"dispatchColumnVisibilityChange",static:!1,private:!1,access:{has:e=>"dispatchColumnVisibilityChange"in e,get:e=>e.dispatchColumnVisibilityChange},metadata:e},null,pt),y(this,null,lt,{kind:"method",name:"dispatchColumnPinChange",static:!1,private:!1,access:{has:e=>"dispatchColumnPinChange"in e,get:e=>e.dispatchColumnPinChange},metadata:e},null,pt),y(this,null,rt,{kind:"method",name:"dispatchColumnOrderChange",static:!1,private:!1,access:{has:e=>"dispatchColumnOrderChange"in e,get:e=>e.dispatchColumnOrderChange},metadata:e},null,pt),y(this,null,ot,{kind:"method",name:"dispatchDensityChange",static:!1,private:!1,access:{has:e=>"dispatchDensityChange"in e,get:e=>e.dispatchDensityChange},metadata:e},null,pt),y(this,null,ct,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,pt),y(this,null,dt,{kind:"method",name:"dispatchGroupToggle",static:!1,private:!1,access:{has:e=>"dispatchGroupToggle"in e,get:e=>e.dispatchGroupToggle},metadata:e},null,pt),y(null,null,c,{kind:"field",name:"striped",static:!1,private:!1,access:{has:e=>"striped"in e,get:e=>e.striped,set:(e,t)=>{e.striped=t}},metadata:e},gt,bt),y(null,null,p,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:e},ft,vt),y(null,null,b,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:e},yt,wt),y(null,null,v,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:e},kt,xt),y(null,null,k,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:e},Ct,St),y(null,null,x,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:e},Et,Dt),y(null,null,C,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:e},At,Rt),y(null,null,S,{kind:"field",name:"list",static:!1,private:!1,access:{has:e=>"list"in e,get:e=>e.list,set:(e,t)=>{e.list=t}},metadata:e},Mt,zt),y(null,null,E,{kind:"field",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:e},Ft,$t),y(null,null,D,{kind:"field",name:"paginationMode",static:!1,private:!1,access:{has:e=>"paginationMode"in e,get:e=>e.paginationMode,set:(e,t)=>{e.paginationMode=t}},metadata:e},It,Tt),y(null,null,A,{kind:"field",name:"pageSize",static:!1,private:!1,access:{has:e=>"pageSize"in e,get:e=>e.pageSize,set:(e,t)=>{e.pageSize=t}},metadata:e},Lt,Vt),y(null,null,R,{kind:"field",name:"currentPage",static:!1,private:!1,access:{has:e=>"currentPage"in e,get:e=>e.currentPage,set:(e,t)=>{e.currentPage=t}},metadata:e},Bt,Ot),y(null,null,M,{kind:"field",name:"totalItems",static:!1,private:!1,access:{has:e=>"totalItems"in e,get:e=>e.totalItems,set:(e,t)=>{e.totalItems=t}},metadata:e},jt,Pt),y(null,null,z,{kind:"field",name:"pageSizes",static:!1,private:!1,access:{has:e=>"pageSizes"in e,get:e=>e.pageSizes,set:(e,t)=>{e.pageSizes=t}},metadata:e},Nt,Ht),y(null,null,F,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:e},qt,_t),y(null,null,$,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:e},Gt,Kt),y(null,null,I,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:e},Wt,Ut),y(null,null,T,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:e},Zt,Yt),y(null,null,L,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:e=>"currentSort"in e,get:e=>e.currentSort,set:(e,t)=>{e.currentSort=t}},metadata:e},Jt,Qt),y(null,null,V,{kind:"field",name:"selector",static:!1,private:!1,access:{has:e=>"selector"in e,get:e=>e.selector,set:(e,t)=>{e.selector=t}},metadata:e},Xt,ei),y(null,null,B,{kind:"field",name:"selectorOptions",static:!1,private:!1,access:{has:e=>"selectorOptions"in e,get:e=>e.selectorOptions,set:(e,t)=>{e.selectorOptions=t}},metadata:e},ti,ii),y(null,null,O,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},ai,si),y(null,null,j,{kind:"field",name:"virtualize",static:!1,private:!1,access:{has:e=>"virtualize"in e,get:e=>e.virtualize,set:(e,t)=>{e.virtualize=t}},metadata:e},ni,li),y(null,null,P,{kind:"field",name:"rowHeight",static:!1,private:!1,access:{has:e=>"rowHeight"in e,get:e=>e.rowHeight,set:(e,t)=>{e.rowHeight=t}},metadata:e},ri,oi),y(null,null,N,{kind:"field",name:"virtualBuffer",static:!1,private:!1,access:{has:e=>"virtualBuffer"in e,get:e=>e.virtualBuffer,set:(e,t)=>{e.virtualBuffer=t}},metadata:e},ci,di),y(null,null,H,{kind:"field",name:"columnResize",static:!1,private:!1,access:{has:e=>"columnResize"in e,get:e=>e.columnResize,set:(e,t)=>{e.columnResize=t}},metadata:e},hi,ui),y(null,null,q,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:e},mi,pi),y(null,null,_,{kind:"field",name:"editMode",static:!1,private:!1,access:{has:e=>"editMode"in e,get:e=>e.editMode,set:(e,t)=>{e.editMode=t}},metadata:e},gi,bi),y(null,null,G,{kind:"field",name:"density",static:!1,private:!1,access:{has:e=>"density"in e,get:e=>e.density,set:(e,t)=>{e.density=t}},metadata:e},fi,vi),y(null,null,K,{kind:"field",name:"headerFilters",static:!1,private:!1,access:{has:e=>"headerFilters"in e,get:e=>e.headerFilters,set:(e,t)=>{e.headerFilters=t}},metadata:e},yi,wi),y(null,null,W,{kind:"field",name:"quickFilter",static:!1,private:!1,access:{has:e=>"quickFilter"in e,get:e=>e.quickFilter,set:(e,t)=>{e.quickFilter=t}},metadata:e},ki,xi),y(null,null,U,{kind:"field",name:"rowReorder",static:!1,private:!1,access:{has:e=>"rowReorder"in e,get:e=>e.rowReorder,set:(e,t)=>{e.rowReorder=t}},metadata:e},Ci,Si),y(null,null,Z,{kind:"field",name:"columnReorder",static:!1,private:!1,access:{has:e=>"columnReorder"in e,get:e=>e.columnReorder,set:(e,t)=>{e.columnReorder=t}},metadata:e},Ei,Di),y(null,null,Y,{kind:"field",name:"columnMenu",static:!1,private:!1,access:{has:e=>"columnMenu"in e,get:e=>e.columnMenu,set:(e,t)=>{e.columnMenu=t}},metadata:e},Ai,Ri),y(null,null,J,{kind:"field",name:"lazyLoad",static:!1,private:!1,access:{has:e=>"lazyLoad"in e,get:e=>e.lazyLoad,set:(e,t)=>{e.lazyLoad=t}},metadata:e},Mi,zi),y(null,null,Q,{kind:"field",name:"lazyLoadThreshold",static:!1,private:!1,access:{has:e=>"lazyLoadThreshold"in e,get:e=>e.lazyLoadThreshold,set:(e,t)=>{e.lazyLoadThreshold=t}},metadata:e},Fi,$i),y(null,null,X,{kind:"field",name:"selectedRows",static:!1,private:!1,access:{has:e=>"selectedRows"in e,get:e=>e.selectedRows,set:(e,t)=>{e.selectedRows=t}},metadata:e},Ii,Ti),y(null,null,ee,{kind:"field",name:"selectionMode",static:!1,private:!1,access:{has:e=>"selectionMode"in e,get:e=>e.selectionMode,set:(e,t)=>{e.selectionMode=t}},metadata:e},Li,Vi),y(null,null,te,{kind:"field",name:"groupBy",static:!1,private:!1,access:{has:e=>"groupBy"in e,get:e=>e.groupBy,set:(e,t)=>{e.groupBy=t}},metadata:e},Bi,Oi),y(null,null,ie,{kind:"field",name:"groupDefaults",static:!1,private:!1,access:{has:e=>"groupDefaults"in e,get:e=>e.groupDefaults,set:(e,t)=>{e.groupDefaults=t}},metadata:e},ji,Pi),y(null,null,ae,{kind:"field",name:"table",static:!1,private:!1,access:{has:e=>"table"in e,get:e=>e.table,set:(e,t)=>{e.table=t}},metadata:e},Ni,Hi),y(null,null,se,{kind:"field",name:"thead",static:!1,private:!1,access:{has:e=>"thead"in e,get:e=>e.thead,set:(e,t)=>{e.thead=t}},metadata:e},qi,_i),y(null,null,re,{kind:"field",name:"tbody",static:!1,private:!1,access:{has:e=>"tbody"in e,get:e=>e.tbody,set:(e,t)=>{e.tbody=t}},metadata:e},Gi,Ki),y(null,t={value:a},ht,{kind:"class",name:a.name,metadata:e},null,ut),Wi=a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}setColumns(e){this.columns=e}setData(e){this.settingDataImperative=!0,this.data=e,this.settingDataImperative=!1}async*getTableConfig(){const e=await(yield{});return this.columns=e.columns||[],this.selectorOptions=e.selectorOptions||[],await new Promise(e=>requestAnimationFrame(e)),this.renderHeader(),this.renderControls(),e}async*getTableData(){const e=++this.dataRequestSeq;this.loading=!0,this.selectedRows=[];try{const t={search:this.searchText,sort:this.currentSort,filter:this.filterEngine.getFilterModel(),selector:this.selector};this.pagination&&(t.page=this.currentPage,t.pageSize=this.pageSize);const i=await(yield t);if(e!==this.dataRequestSeq)return;if(this.data=i.data||[],this.rebuildRowIndex(),void 0!==i.totalItems&&(this.totalItems=i.totalItems),this.loadError=null,this.classList.remove("table--error"),this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),e!==this.dataRequestSeq)return;return this.renderBody(),i}catch(t){if(e!==this.dataRequestSeq)return;console.error("Error loading table data:",t),this.loadError=t instanceof Error?t.message:String(t),this.classList.add("table--error"),this.dispatchLoadError(t),this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),this.renderBody()}}scheduleRender(e){"header"!==e&&"both"!==e||(this.pendingHeaderRender=!0),"body"!==e&&"both"!==e||(this.pendingBodyRender=!0),this.renderQueued||(this.renderQueued=!0,queueMicrotask(()=>{queueMicrotask(()=>{this.renderQueued=!1;const e=this.pendingHeaderRender,t=this.pendingBodyRender;this.pendingHeaderRender=!1,this.pendingBodyRender=!1,e&&this.renderHeader(),t&&this.renderBody()})}))}debouncedDataRequest(){this.loading||(this.loading=!0),this.dataRequestTimeout&&clearTimeout(this.dataRequestTimeout),this.dataRequestTimeout=setTimeout(()=>{this.getTableData(),this.dataRequestTimeout=null},150)}styles(){return m`
|
|
585
|
+
`}getDefaultAlign(e){return["number","currency","percent","percentage","duration","filesize","accounting","scientific","fraction"].includes(e||"")?"right":["boolean","rating","image"].includes(e||"")?"center":"left"}applyCellPresentation(e,t,i){if(!e)return;const a=t=>{t&&Object.assign(e.style,t)};a(t.style);for(const s of t.conditionalFormats||[])if(s.condition(i,this.data)){a(s.style),s.className&&e.classList.add(s.className);break}t.tooltip&&(e.title="function"==typeof t.tooltip?t.tooltip(i,this.data):null==i?"":String(i))}getCellComponent(e){switch(e){case"text":return"snice-cell-text";case"number":case"accounting":case"scientific":case"fraction":return"snice-cell-number";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"sparkline":return"snice-cell-sparkline";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"link":case"url":return"snice-cell-link";case"actions":return"snice-cell-actions";case"tag":case"tags":case"badge":case"badges":return"snice-cell-tag";case"image":case"avatar":case"thumbnail":return"snice-cell-image";case"email":return"snice-cell-email";case"phone":case"tel":case"telephone":return"snice-cell-phone";case"status":return"snice-cell-status";case"color":return"snice-cell-color";case"json":case"object":return"snice-cell-json";case"currency":case"money":return"snice-cell-currency";case"percent":case"percentage":return"snice-cell-percentage";case"location":case"address":case"coordinates":return"snice-cell-location";default:return"snice-cell"}}getCellStyles(e){let t=[];return e.width&&(t.push(`width: ${e.width}`),t.push(`min-width: ${e.width}`),t.push(`max-width: ${e.width}`)),e.align&&t.push(`text-align: ${e.align}`),t.join("; ")}escapeHtml(e){if(null==e)return"";const t=String(e),i=document.createElement("div");return i.textContent=t,i.innerHTML}toggleSelection(){this.selected=!this.selected,this.dispatchRowSelect()}dispatchRowClick(){return{data:this.data,index:this.index,element:this}}dispatchRowSelect(){return{selected:this.selected,data:this.data,index:this.index,element:this}}dispatchRowHover(){return{data:this.data,index:this.index,element:this}}select(){!this.selectionDisabled&&this.selectable&&(this.selected=!0,this.dispatchRowSelect())}deselect(){this.selected=!1,this.dispatchRowSelect()}focusRow(){super.focus(),this.scrollIntoView({behavior:"smooth",block:"nearest"})}getCellValue(e){return this.data[e]}setCellValue(e,t){this.data={...this.data,[e]:t},this.updateCells()}getCellElement(e){const t=this.columns.find(t=>t.key===e);if(!t)return null;const i=this.columns.indexOf(t);return this.shadowRoot?.querySelector(`[data-column-index="${i}"]`)||null}highlight(e=2e3){this.classList.add("row--highlighted"),setTimeout(()=>{this.classList.remove("row--highlighted")},e)}constructor(){super(...arguments),this.selected=(w(this,V),w(this,B,!1)),this.hoverable=(w(this,O),w(this,j,!0)),this.clickable=(w(this,P),w(this,N,!1)),this.selectable=(w(this,H),w(this,q,!1)),this.selectionDisabled=(w(this,_),w(this,G,!1)),this.data=(w(this,K),w(this,W,{})),this.index=(w(this,U),w(this,Z,0)),this.columns=(w(this,Y),w(this,J,[])),w(this,Q)}})})();class le{constructor(){this.rafId=0,this.lastStartIndex=-1,this.lastEndIndex=-1,this.enabled=!1,this.offsets=[],this.offsetsTotalRows=-1,this.topSpacer=document.createElement("tr"),this.topSpacer.className="virtual-spacer virtual-spacer--top",this.topSpacer.style.display="table-row",this.bottomSpacer=document.createElement("tr"),this.bottomSpacer.className="virtual-spacer virtual-spacer--bottom",this.bottomSpacer.style.display="table-row",this.contentContainer=document.createElement("tbody"),this.options={},this.scrollHandler=()=>{this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>this.update())}}attach(e){this.options=e,this.enabled=!0,this.lastStartIndex=-1,this.lastEndIndex=-1,this.invalidateOffsets(),this.options.scrollContainer.addEventListener("scroll",this.scrollHandler,{passive:!0}),window.addEventListener("resize",this.scrollHandler,{passive:!0}),this.update()}detach(){this.enabled=!1,this.options.scrollContainer?.removeEventListener("scroll",this.scrollHandler),window.removeEventListener("resize",this.scrollHandler),cancelAnimationFrame(this.rafId)}setTotalRows(e){this.options.totalRows=e,this.invalidateOffsets(),this.lastStartIndex=-1,this.update()}refresh(){this.invalidateOffsets(),this.lastStartIndex=-1,this.lastEndIndex=-1,this.update()}update(){if(!this.enabled||!this.options.scrollContainer)return;const{bufferPx:e,totalRows:t,scrollContainer:i,renderRange:a}=this.options,s=i.scrollTop,n=this.buildOffsets(t),l=t>0?Math.max(1,n[1]-n[0]):1,r=Math.max(l,i.clientHeight),o=n[t]||0,c=Math.max(0,o-r),d=Math.min(Math.max(0,s),c);s!==d&&(i.scrollTop=d);const h=Math.max(0,d-e),u=Math.min(o,d+r+e),m=this.findRowAtOffset(n,h),p=Math.min(t,this.findFirstOffsetAtOrAfter(n,u));if(m===this.lastStartIndex&&p===this.lastEndIndex)return;this.lastStartIndex=m,this.lastEndIndex=p;const g=n[m]||0,b=Math.max(0,o-(n[p]||o));this.topSpacer.style.height=`${g}px`,this.bottomSpacer.style.height=`${b}px`;const f=a(m,p),v=this.options.scrollContainer.querySelector("tbody");if(v){v.innerHTML="";const e=this.options.renderPinnedTop?.();if(e&&v.appendChild(e),g>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${g}px`,e.style.padding="0",e.style.border="none",this.topSpacer.innerHTML="",this.topSpacer.appendChild(e),v.appendChild(this.topSpacer)}if(v.appendChild(f),b>0){const e=document.createElement("td");e.colSpan=999,e.style.height=`${b}px`,e.style.padding="0",e.style.border="none",this.bottomSpacer.innerHTML="",this.bottomSpacer.appendChild(e),v.appendChild(this.bottomSpacer)}const t=this.options.renderPinnedBottom?.();t&&v.appendChild(t),this.options.afterRender?.()}}getVisibleRange(){return{start:this.lastStartIndex,end:this.lastEndIndex}}scrollToRow(e){if(!this.options.scrollContainer)return;const t=this.offsetForIndex(e);this.options.scrollContainer.scrollTop=t}scrollToIndex(e){this.options.scrollContainer&&(this.options.scrollContainer.scrollTop=this.offsetForIndex(e),this.refresh())}getScrollPosition(){const e=this.options.scrollContainer;return{top:e?.scrollTop??0,left:e?.scrollLeft??0}}isEnabled(){return this.enabled}heightForIndex(e){const t="function"==typeof this.options.rowHeight?this.options.rowHeight(e):this.options.rowHeight;return Number.isFinite(t)&&t>0?t:1}buildOffsets(e){if(this.offsetsTotalRows===e&&this.offsets.length===e+1)return this.offsets;this.offsets=new Array(e+1),this.offsets[0]=0;for(let t=0;t<e;t++)this.offsets[t+1]=this.offsets[t]+this.heightForIndex(t);return this.offsetsTotalRows=e,this.offsets}invalidateOffsets(){this.offsets=[],this.offsetsTotalRows=-1}offsetForIndex(e){const t=Math.max(0,Math.min(e,this.options.totalRows));return this.buildOffsets(this.options.totalRows)[t]||0}findRowAtOffset(e,t){const i=e.length-1;if(i<=0)return 0;let a=0,s=i;for(;a<s;){const i=Math.floor((a+s)/2);e[i+1]<=t?a=i+1:s=i}return Math.min(i,a)}findFirstOffsetAtOrAfter(e,t){let i=0,a=e.length-1;for(;i<a;){const s=Math.floor((i+a)/2);e[s]<t?i=s+1:a=s}return i}}class re{constructor(){this.states=new Map,this.groups=[],this.resizeStartX=0,this.resizeStartWidth=0,this.resizingKey=null,this.resizeOverlay=null,this.tableElement=null}initialize(e,t){this.tableElement=t,e.forEach((e,t)=>{const i=this.states.get(e.key);this.states.set(e.key,{key:e.key,width:i?.width??this.parseWidth(e.width)??150,flex:e.flex,minWidth:e.minWidth??50,maxWidth:e.maxWidth??1/0,visible:i?.visible??!0,pinned:i?.pinned??(e.pinned||!1),order:i?.order??t,resizable:!1!==e.resizable,reorderable:!1!==e.reorderable,hideable:!1!==e.hideable,pinnable:!1!==e.pinnable})})}parseWidth(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}getVisibleColumns(){return Array.from(this.states.values()).filter(e=>e.visible).sort((e,t)=>e.order-t.order)}getAllStates(){return Array.from(this.states.values()).sort((e,t)=>e.order-t.order)}getPinnedLeft(){return this.getVisibleColumns().filter(e=>"left"===e.pinned)}getPinnedRight(){return this.getVisibleColumns().filter(e=>"right"===e.pinned)}getUnpinned(){return this.getVisibleColumns().filter(e=>!e.pinned)}computeFlexWidths(e){const t=this.getVisibleColumns(),i=new Map;let a=0;const s=[];for(const e of t)e.flex&&e.flex>0?s.push(e):(a+=e.width,i.set(e.key,e.width));const n=Math.max(0,e-a),l=s.reduce((e,t)=>e+(t.flex||1),0);for(const e of s){const t=Math.max(e.minWidth,Math.min(e.maxWidth,(e.flex||1)/l*n));i.set(e.key,t)}return i}applyWidths(e,t){e.querySelectorAll("th[data-key]").forEach(e=>{const i=e.getAttribute("data-key");i&&t.has(i)&&(e.style.width=`${t.get(i)}px`)})}startResize(e,t){const i=this.states.get(e);if(!i||!i.resizable)return;this.resizingKey=e,this.resizeStartX=t,this.resizeStartWidth=i.width,this.resizeOverlay=document.createElement("div"),this.resizeOverlay.style.cssText="position:fixed;inset:0;z-index:99999;cursor:col-resize;",document.body.appendChild(this.resizeOverlay);const a=t=>{t.preventDefault();const a=Math.max(i.minWidth,Math.min(i.maxWidth,this.resizeStartWidth+(t.clientX-this.resizeStartX)));i.width=a,i.flex=void 0;const s=this.tableElement?.shadowRoot;if(s){const t=s.querySelector(`th[data-key="${e}"]`);t&&(t.style.width=`${a}px`),s.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>e.style.width=`${a}px`)}this.tableElement?.dispatchEvent(new CustomEvent("column-resize",{detail:{key:e,width:a},bubbles:!0,composed:!0}))},s=()=>{this.resizingKey=null,this.resizeOverlay?.remove(),this.resizeOverlay=null,document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),this.tableElement?.dispatchEvent(new CustomEvent("column-resize-end",{detail:{key:e,width:i.width},bubbles:!0,composed:!0}))};document.addEventListener("mousemove",a),document.addEventListener("mouseup",s)}autoSizeColumn(e,t){const i=this.states.get(e);if(!i)return;const a=this.tableElement?.shadowRoot?.querySelector(`th[data-key="${e}"]`);let s=a?a.scrollWidth:0;t.querySelectorAll(`td[data-key="${e}"]`).forEach(e=>{s=Math.max(s,e.scrollWidth)}),i.width=Math.max(i.minWidth,Math.min(i.maxWidth,s+16)),i.flex=void 0}autoSizeAll(e){for(const t of this.states.keys())this.autoSizeColumn(t,e)}setColumnVisible(e,t){const i=this.states.get(e);i&&i.hideable&&(i.visible=t)}showAllColumns(){for(const e of this.states.values())e.visible=!0}hideAllColumns(){for(const e of this.states.values())e.hideable&&(e.visible=!1)}getVisibilityModel(){const e={};for(const[t,i]of this.states)e[t]=i.visible;return e}moveColumn(e,t){const i=this.states.get(e);if(!i||!i.reorderable||i.pinned)return;const a=this.getVisibleColumns(),s=a.findIndex(t=>t.key===e);-1!==s&&s!==t&&(a.splice(s,1),a.splice(t,0,i),a.forEach((e,t)=>{e.order=t}))}pinColumn(e,t){const i=this.states.get(e);i&&i.pinnable&&(i.pinned=t)}unpinColumn(e){const t=this.states.get(e);t&&(t.pinned=!1)}setColumnGroups(e){this.groups=e}getColumnGroups(){return this.groups}renderGroupHeaders(e=this.getVisibleColumns().map(e=>e.key)){if(0===this.groups.length)return"";const t=new Map;for(const e of this.groups)for(const i of e.children)t.set(i,e);const i=[];for(const a of e){if(!this.states.get(a)?.visible)continue;const e=t.get(a)??null,s=i[i.length-1];s&&s.group===e?s.span++:i.push({group:e,span:1})}return i.map(({group:e,span:t})=>e?`<th colspan="${t}" class="column-group-header ${e.headerClass||""}">${e.label}</th>`:`<th colspan="${t}" class="column-group-header column-group-header--ungrouped" aria-hidden="true"></th>`).join("")}isResizing(){return null!==this.resizingKey}getState(e){return this.states.get(e)}getPinnedLeftOffsets(){const e=new Map;let t=0;for(const i of this.getPinnedLeft())e.set(i.key,t),t+=i.width;return e}getPinnedRightOffsets(){const e=new Map,t=this.getPinnedRight();let i=0;for(let a=t.length-1;a>=0;a--)e.set(t[a].key,i),i+=t[a].width;return e}}const oe=[{value:"contains",label:"contains",requiresValue:!0},{value:"notContains",label:"does not contain",requiresValue:!0},{value:"equals",label:"equals",requiresValue:!0},{value:"notEquals",label:"does not equal",requiresValue:!0},{value:"startsWith",label:"starts with",requiresValue:!0},{value:"endsWith",label:"ends with",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],ce=[{value:"eq",label:"=",requiresValue:!0},{value:"neq",label:"≠",requiresValue:!0},{value:"gt",label:">",requiresValue:!0},{value:"gte",label:"≥",requiresValue:!0},{value:"lt",label:"<",requiresValue:!0},{value:"lte",label:"≤",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],de=[{value:"is",label:"is",requiresValue:!0},{value:"isNot",label:"is not",requiresValue:!0},{value:"before",label:"before",requiresValue:!0},{value:"onOrBefore",label:"on or before",requiresValue:!0},{value:"after",label:"after",requiresValue:!0},{value:"onOrAfter",label:"on or after",requiresValue:!0},{value:"isEmpty",label:"is empty",requiresValue:!1},{value:"isNotEmpty",label:"is not empty",requiresValue:!1}],he=[{value:"isTrue",label:"is true",requiresValue:!1},{value:"isFalse",label:"is false",requiresValue:!1}];class ue{constructor(){this.model={filters:[],logic:"and"},this.headerFilters=new Map}getOperatorsForType(e){switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return ce;case"date":return de;case"boolean":return he;default:return oe}}setFilterModel(e){this.model=e}getFilterModel(){return{...this.model}}setColumnFilter(e,t,i){const a=this.model.filters.findIndex(t=>t.column===e);a>=0?this.model.filters[a]={column:e,operator:t,value:i}:this.model.filters.push({column:e,operator:t,value:i})}removeColumnFilter(e){this.model.filters=this.model.filters.filter(t=>t.column!==e)}clearAllFilters(){this.model.filters=[],this.model.quickFilter=void 0,this.model.logic="and",this.headerFilters.clear()}setQuickFilter(e){this.model.quickFilter=e||void 0}setHeaderFilter(e,t){t?this.headerFilters.set(e,t):this.headerFilters.delete(e)}getHeaderFilter(e){return this.headerFilters.get(e)||""}setFilterLogic(e){this.model.logic=e}hasActiveFilters(){return this.model.filters.length>0||!!this.model.quickFilter||this.headerFilters.size>0}hasColumnFilter(e){return this.model.filters.some(t=>t.column===e)||this.headerFilters.has(e)}getActiveFilterCount(){return this.model.filters.length+this.headerFilters.size+(this.model.quickFilter?1:0)}applyFilters(e,t){let i=e;this.model.filters.length>0&&(i=i.filter(e=>{const t=this.model.filters.map(t=>this.evaluateFilter(t,e));return"and"===this.model.logic?t.every(Boolean):t.some(Boolean)}));for(const[e,t]of this.headerFilters){const a=t.toLowerCase();i=i.filter(t=>{const i=t[e];return null!=i&&String(i).toLowerCase().includes(a)})}if(this.model.quickFilter){const e=this.model.quickFilter.toLowerCase().split(/\s+/).filter(Boolean),a=t.map(e=>e.key),s=this.model.quickFilterLogic||"and";i=i.filter(t=>{const i=e=>a.some(i=>{const a=t[i];return null!=a&&String(a).toLowerCase().includes(e)});return"and"===s?e.every(i):e.some(i)})}return i}evaluateFilter(e,t){const i=t[e.column],a=e.value;switch(e.operator){case"contains":return null!=i&&String(i).toLowerCase().includes(String(a).toLowerCase());case"notContains":return null==i||!String(i).toLowerCase().includes(String(a).toLowerCase());case"equals":return String(i??"").toLowerCase()===String(a).toLowerCase();case"notEquals":return String(i??"").toLowerCase()!==String(a).toLowerCase();case"startsWith":return null!=i&&String(i).toLowerCase().startsWith(String(a).toLowerCase());case"endsWith":return null!=i&&String(i).toLowerCase().endsWith(String(a).toLowerCase());case"isEmpty":return null==i||""===i;case"isNotEmpty":return null!=i&&""!==i;case"eq":return Number(i)===Number(a);case"neq":return Number(i)!==Number(a);case"gt":return Number(i)>Number(a);case"gte":return Number(i)>=Number(a);case"lt":return Number(i)<Number(a);case"lte":return Number(i)<=Number(a);case"is":return new Date(i).toDateString()===new Date(a).toDateString();case"isNot":return new Date(i).toDateString()!==new Date(a).toDateString();case"before":return new Date(i)<new Date(a);case"onOrBefore":return new Date(i)<=new Date(a);case"after":return new Date(i)>new Date(a);case"onOrAfter":return new Date(i)>=new Date(a);case"isTrue":return!0===i||"true"===i||1===i;case"isFalse":return!1===i||"false"===i||0===i||null==i;default:return!0}}toServerParams(){return{filters:this.model.filters,filterLogic:this.model.logic,quickFilter:this.model.quickFilter,headerFilters:Object.fromEntries(this.headerFilters)}}}class me{constructor(){this.cellState=null,this.rowState=null,this.pipelines=new Map,this.validators=new Map,this.editableColumns=new Set,this.editabilityCheck=null,this.tableElement=null,this.mode="cell"}attach(e){this.tableElement=e}setEditableColumns(e){this.editableColumns=new Set(e)}setEditabilityCheck(e){this.editabilityCheck=e}setEditMode(e){this.mode=e}setPipeline(e,t){this.pipelines.set(e,t)}setValidation(e,t){this.validators.set(e,t)}isCellEditable(e,t){return!!this.editableColumns.has(t)&&(!this.editabilityCheck||this.editabilityCheck(e,t))}getDisplayValue(e,t,i){const a=this.pipelines.get(e);let s=t;return a?.valueGetter&&(s=a.valueGetter(s,i)),a?.valueFormatter?a.valueFormatter(s,i):null==s?"":String(s)}getSortValue(e,t,i){const a=this.pipelines.get(e);return a?.valueGetter?a.valueGetter(t,i):t}getEditorType(e){switch(e){case"number":case"currency":case"rating":case"progress":return"number";case"date":return"date";case"boolean":return"boolean";case"select":return"select";default:return"text"}}startCellEdit(e,t,i,a,s){return this.isCellEditable(a,t)?(this.cellState?.isEditing&&this.cancelCellEdit(),this.cellState={rowIndex:e,columnKey:t,rowData:a,originalValue:i,currentValue:i,editorType:this.getEditorType(s||""),error:null,isEditing:!0},this.cellState):null}updateCellValue(e){this.cellState&&(this.cellState.currentValue=e,this.cellState.error=null)}async commitCellEdit(){if(!this.cellState?.isEditing)return null;const{columnKey:e,currentValue:t,rowIndex:i,rowData:a}=this.cellState,s=this.pipelines.get(e);let n=t;s?.valueParser&&(n=s.valueParser(String(t),a));const l=this.validators.get(e);if(l){const e=await l.validate(n,a);if(e)return this.cellState.error=e,e}if(s?.valueSetter){const t=s.valueSetter(n,a);t&&"object"==typeof t&&!Array.isArray(t)?(Object.assign(a,t),n=a[e]):void 0!==t&&(n=t)}return this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-commit",{detail:{rowIndex:i,columnKey:e,oldValue:this.cellState.originalValue,newValue:n},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null,null}cancelCellEdit(){this.cellState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("cell-edit-cancel",{detail:{rowIndex:this.cellState.rowIndex,columnKey:this.cellState.columnKey},bubbles:!0,composed:!0})),this.cellState.isEditing=!1,this.cellState=null)}getCellEditState(){return this.cellState}startRowEdit(e,t){return this.rowState?.isEditing&&this.cancelRowEdit(),this.rowState={rowIndex:e,originalRow:{...t},editedRow:{...t},errors:new Map,isEditing:!0},this.rowState}updateRowField(e,t){this.rowState&&(this.rowState.editedRow[e]=t,this.rowState.errors.delete(e))}async commitRowEdit(){if(!this.rowState?.isEditing)return null;const e=new Map,t={...this.rowState.editedRow};for(const[e,i]of this.pipelines)i.valueParser&&e in t&&(t[e]=i.valueParser(String(t[e]),t));for(const i of this.editableColumns){const a=this.validators.get(i);if(a){const s=t[i],n=await a.validate(s,t);n&&e.set(i,n)}}if(e.size>0)return this.rowState.errors=e,e;let i={...t};for(const[e,t]of this.pipelines)if(t.valueSetter&&e in i){const a=t.valueSetter(i[e],i);a&&"object"==typeof a&&!Array.isArray(a)?i={...i,...a}:void 0!==a&&(i[e]=a)}return this.tableElement?.dispatchEvent(new CustomEvent("row-edit-commit",{detail:{rowIndex:this.rowState.rowIndex,oldRow:this.rowState.originalRow,newRow:i},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null,null}cancelRowEdit(){this.rowState?.isEditing&&(this.tableElement?.dispatchEvent(new CustomEvent("row-edit-cancel",{detail:{rowIndex:this.rowState.rowIndex},bubbles:!0,composed:!0})),this.rowState.isEditing=!1,this.rowState=null)}getRowEditState(){return this.rowState}isEditing(){return(this.cellState?.isEditing||this.rowState?.isEditing)??!1}createEditor(e,t,i){switch(e){case"number":{const e=document.createElement("input");return e.type="number",e.value=null==t?"":String(t),e.className="table-editor-input",e}case"date":{const e=document.createElement("input");return e.type="date",e.value=t||"",e.className="table-editor-input",e}case"boolean":{const e=document.createElement("input");return e.type="checkbox",e.checked=!!t,e.className="table-editor-checkbox",e}case"select":{const e=document.createElement("select");return e.className="table-editor-select",(i?.selectOptions||[]).forEach(i=>{const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.value===String(t)&&(a.selected=!0),e.appendChild(a)}),e}default:{const e=document.createElement("input");return e.type="text",e.value=null==t?"":String(t),e.className="table-editor-input",e}}}}class pe{constructor(){this.focusedRow=-1,this.hasUserInteracted=!1,this.focusedCol=0,this.attached=!1,this.options={},this.keyHandler=e=>this.handleKeyDown(e)}attach(e){this.options=e;const t=e.shadowRoot;t&&(t.addEventListener("keydown",this.keyHandler),this.attached=!0,this.syncGridRole(),this.applyARIA())}detach(){this.options.shadowRoot?.removeEventListener("keydown",this.keyHandler),this.attached=!1}syncGridRole(){const e=this.getTable();e&&(e.setAttribute("role","grid"),e.setAttribute("tabindex","0"),e.setAttribute("aria-rowcount",String(this.ariaRowCount+1)),e.setAttribute("aria-colcount",String(this.totalColCount)))}refresh(){this.attached&&(this.syncGridRole(),this.applyARIA())}getTable(){return this.options.shadowRoot?.querySelector("table")??null}resolveBound(e){return"function"==typeof e?e():e??0}get totalRowCount(){return this.resolveBound(this.options.totalRows)}get totalColCount(){return this.resolveBound(this.options.totalColumns)}get ariaRowCount(){return this.resolveBound(this.options.ariaRows??this.options.totalRows)}get ariaRowOffset(){return Math.max(0,this.resolveBound(this.options.ariaRowOffset))}getBodyRow(e){if(this.options.getRowElement)return this.options.getRowElement(e);const t=this.getTable();return t?t.querySelector(`tbody tr[data-index="${e}"]`):null}applyARIA(){const e=this.getTable();if(!e)return;e.setAttribute("aria-rowcount",String(this.ariaRowCount+1)),e.setAttribute("aria-colcount",String(this.totalColCount));const t=e.querySelector("thead tr.column-header-row")??e.querySelector("thead tr:not(.column-group-row):not(.header-filter-row)");t&&(t.setAttribute("role","row"),t.setAttribute("aria-rowindex","1"),t.querySelectorAll("th").forEach((e,t)=>{if(e.setAttribute("role","columnheader"),e.setAttribute("aria-colindex",String(t+1)),e.classList.contains("sortable")){const t=e.querySelector(".sort-indicator.active");if(t){const i=t.textContent?.trim()||"";i.includes("▲")?e.setAttribute("aria-sort","ascending"):i.includes("▼")&&e.setAttribute("aria-sort","descending")}else e.setAttribute("aria-sort","none")}})),e.querySelectorAll("tbody tr:not(.virtual-spacer)").forEach((e,t)=>{e.setAttribute("role","row"),e.setAttribute("aria-rowindex",String(this.ariaRowOffset+t+2)),"true"===e.getAttribute("data-selected")?e.setAttribute("aria-selected","true"):e.removeAttribute("aria-selected"),e.querySelectorAll("td").forEach((e,t)=>{e.setAttribute("role","gridcell"),e.setAttribute("aria-colindex",String(t+1))})}),this.updateFocusIndicator()}setFocus(e,t){this.focusedRow=e,this.focusedCol=t,this.updateFocusIndicator()}getFocus(){return{row:this.focusedRow,col:this.focusedCol}}updateFocusIndicator(){if(!this.hasUserInteracted)return;const e=this.getTable();if(!e)return;e.querySelectorAll("[data-grid-focus]").forEach(e=>{e.removeAttribute("data-grid-focus"),e.removeAttribute("tabindex")});let t=null;if(-1===this.focusedRow)t=e.querySelectorAll("thead th")[this.focusedCol];else{let e=this.getBodyRow(this.focusedRow);e||(this.options.ensureRowVisible?.(this.focusedRow),e=this.getBodyRow(this.focusedRow)),e&&(t=e.querySelectorAll("td")[this.focusedCol])}t&&(t.setAttribute("data-grid-focus","true"),t.setAttribute("tabindex","0"))}handleKeyDown(e){if(this.options.isEditing())return;if(e.composedPath().some(e=>e instanceof Element&&e.matches('button, a, input, select, textarea, [contenteditable="true"], snice-button, snice-checkbox, snice-input, snice-select')))return;this.hasUserInteracted=!0;const t=this.totalRowCount,i=this.totalColCount;switch(e.key){case"ArrowDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowUp":e.preventDefault(),this.focusedRow=Math.max(-1,this.focusedRow-1),this.updateFocusIndicator(),this.scrollIntoView();break;case"ArrowRight":e.preventDefault(),this.focusedCol=Math.min(i-1,this.focusedCol+1),this.updateFocusIndicator();break;case"ArrowLeft":e.preventDefault(),this.focusedCol=Math.max(0,this.focusedCol-1),this.updateFocusIndicator();break;case"Home":e.preventDefault(),e.ctrlKey?(this.focusedRow=-1,this.focusedCol=0):this.focusedCol=0,this.updateFocusIndicator(),this.scrollIntoView();break;case"End":e.preventDefault(),e.ctrlKey?(this.focusedRow=t-1,this.focusedCol=i-1):this.focusedCol=i-1,this.updateFocusIndicator(),this.scrollIntoView();break;case"PageDown":e.preventDefault(),this.focusedRow=Math.min(t-1,this.focusedRow+10),this.updateFocusIndicator(),this.scrollIntoView();break;case"PageUp":e.preventDefault(),this.focusedRow=Math.max(0,this.focusedRow-10),this.updateFocusIndicator(),this.scrollIntoView();break;case" ":this.focusedRow>=0&&(e.preventDefault(),this.options.onSelectionToggle?.(this.focusedRow));break;case"Enter":if(this.focusedRow>=0&&this.focusedCol>=0){e.preventDefault();const t=this.getBodyRow(this.focusedRow),i=t?.querySelectorAll("td"),a=i?.[this.focusedCol],s=a?.getAttribute("data-key")||"";this.options.onCellActivate?.(this.focusedRow,s)}break;case"a":(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.options.onSelectAll?.())}}scrollIntoView(){const e=this.getTable();if(!e)return;const t=e.querySelector("[data-grid-focus]");t&&("function"==typeof t.scrollIntoView&&t.scrollIntoView({block:"nearest",inline:"nearest"}),"function"==typeof t.focus&&t.focus({preventScroll:!0}))}isAttached(){return this.attached}}class ge{exportCSV(e,t,i={}){const{delimiter:a=",",filename:s="export.csv",includeHeaders:n=!0,columns:l,utf8BOM:r=!0}=i;let o=t.filter(e=>!1!==e.exportable);l&&(o=o.filter(e=>l.includes(e.key)));const c=[];n&&c.push(o.map(e=>this.escapeCSV(e.label,a)).join(a));for(const t of e){const e=o.map(e=>{const i=t[e.key];return this.escapeCSV(null==i?"":String(i),a)});c.push(e.join(a))}const d=c.join("\n"),h=new Blob([(r?"\ufeff":"")+d],{type:"text/csv;charset=utf-8;"}),u=URL.createObjectURL(h),m=document.createElement("a");m.href=u,m.download=s,m.style.display="none",document.body.appendChild(m),m.click(),document.body.removeChild(m),URL.revokeObjectURL(u)}print(e,t={}){const{hideFooter:i=!1,hideToolbar:a=!1,includeCheckboxes:s=!1,pageStyles:n=""}=t,l=e.shadowRoot;if(!l)return;const r=l.querySelector("table");if(!r)return;const o=r.cloneNode(!0),c=Array.from(r.querySelectorAll("snice-cell, [in-table], snice-checkbox")),d=Array.from(o.querySelectorAll("snice-cell, [in-table], snice-checkbox"));c.forEach((e,t)=>{const i=d[t];if(!i)return;if("snice-checkbox"===e.localName)return void i.replaceWith(document.createTextNode(e.checked?"☑":"☐"));const a=e.shadowRoot?.querySelector('[part~="content"]');i.replaceWith(document.createTextNode((a?.textContent||e.textContent||"").trim()))}),s||o.querySelectorAll(".select-column").forEach(e=>e.remove());const h=(e,t)=>{const i=l.querySelector(e);if(!i)return"";const a=i.cloneNode(!0);a.querySelectorAll("style").forEach(e=>e.remove()),a.querySelectorAll("button").forEach(e=>{e.textContent?.trim()||(e.textContent=e.getAttribute("aria-label")||"")});const s=a.textContent?.replace(/\s+/g," ").trim();return s?`<div class="${t}">${this.escapeHTML(s)}</div>`:""},u=a?"":h(".table-controls-container","print-toolbar"),m=i?"":h(".table-pagination-container","print-footer"),p=window.open("","_blank");p&&(p.document.write(`\n <!DOCTYPE html>\n <html>\n <head>\n <title>Print</title>\n <style>\n body { font-family: system-ui, -apple-system, sans-serif; margin: 1rem; }\n table { width: 100%; border-collapse: collapse; }\n th, td { padding: 8px 12px; border: 1px solid #ddd; text-align: left; }\n th { background: #f5f5f5; font-weight: 600; }\n .print-toolbar, .print-footer { margin: 0 0 0.75rem; color: #444; }\n .print-footer { margin: 0.75rem 0 0; }\n @media print {\n body { margin: 0; }\n table { page-break-inside: auto; }\n tr { page-break-inside: avoid; }\n }\n ${n}\n </style>\n </head>\n <body>\n ${u}\n ${o.outerHTML}\n ${m}\n </body>\n </html>\n `),p.document.close(),p.onload=()=>{p.print(),p.close()})}async copyToClipboard(e,t,i={}){const{delimiter:a="\t",useFormatted:s=!0}=i;if(0===e.length)return!1;const n=e.map(e=>t.map(t=>{const i=e[t.key];return s?this.formatValue(i,e,t):this.rawValue(i)}).join(a)).join("\n");try{return await navigator.clipboard.writeText(n),!0}catch{const e=document.createElement("textarea");e.value=n,e.style.cssText="position:fixed;left:-9999px;",document.body.appendChild(e),e.select();const t=document.execCommand("copy");return document.body.removeChild(e),t}}escapeCSV(e,t){return e.includes(t)||e.includes('"')||e.includes("\n")||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}rawValue(e){if(null==e)return"";if("object"==typeof e)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}formatValue(e,t,i){const a=i.formatter||i.valueFormatter;if(a)return String(a(e,t)??"");if(null==e)return"";const s=Number(e);switch(i.type){case"number":case"accounting":{if(!Number.isFinite(s))return this.rawValue(e);const t=i.numberFormat||{},a=t.decimals??("accounting"===i.type?2:0),n=new Intl.NumberFormat("en-US",{minimumFractionDigits:a,maximumFractionDigits:a,useGrouping:t.thousandsSeparator??!1}).format(Math.abs(s));let l=s<0&&("parentheses"===t.negativeStyle||"accounting"===i.type)?`(${n})`:`${s<0?"-":""}${n}`;return t.prefix&&(l=t.prefix+l),t.suffix&&(l+=t.suffix),l}case"currency":{if(!Number.isFinite(s))return this.rawValue(e);const t=i.currencyFormat||{},a=t.decimals??2,n=new Intl.NumberFormat(t.locale||"en-US",{style:"currency",currency:t.currency||"USD",currencyDisplay:t.currencyDisplay||t.display||"symbol",useGrouping:t.thousandsSeparator??!0,minimumFractionDigits:a,maximumFractionDigits:a}).format(Math.abs(s));return s>=0?n:"parentheses"===t.negativeStyle?`(${n})`:`-${n}`}case"percent":case"percentage":return Number.isFinite(s)?`${s.toFixed(i.percentageFormat?.decimals??2)}%`:this.rawValue(e);case"date":{const t=new Date(e);if(Number.isNaN(t.getTime()))return this.rawValue(e);const a=i.dateFormat||{},s="custom"===a.format?void 0:a.format||"short";return new Intl.DateTimeFormat(a.locale||"en-US",s?{dateStyle:s}:{}).format(t)}case"boolean":{const t=i.booleanFormat||{};return!0===e||String(e)===String(t.trueValue??"true")?t.trueSymbol||t.trueValue||"true":t.falseSymbol||t.falseValue||"false"}case"scientific":return Number.isFinite(s)?s.toExponential(i.numberFormat?.decimals??2):this.rawValue(e);default:return this.rawValue(e)}}escapeHTML(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}}class be{constructor(){this.expandedRows=new Set,this.options=null,this.tableElement=null,this.contentCache=new Map,this.rowByIndex=new Map,this.measuredHeights=new Map,this.onHeightChange=null}attach(e,t){this.tableElement=e,this.options=t,this.contentCache.clear(),this.rowByIndex.clear(),this.measuredHeights.clear()}prepare(e){if(!this.options)return;this.rowByIndex=new Map(e.map((e,t)=>[t,e]));const t=new Set(e);for(const e of this.contentCache.keys())t.has(e)||this.contentCache.delete(e);for(const e of this.measuredHeights.keys())t.has(e)||this.measuredHeights.delete(e);!1===this.options.lazy&&e.forEach((e,t)=>this.getContent(e,t))}isExpanded(e){return this.expandedRows.has(e)}toggle(e){this.expandedRows.has(e)?this.collapse(e):this.expand(e)}expand(e){this.expandedRows.add(e),this.tableElement?.dispatchEvent(new CustomEvent("row-expand",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}collapse(e){if(this.expandedRows.delete(e),!1!==this.options?.lazy){const t=this.rowByIndex.get(e);void 0!==t&&(this.contentCache.delete(t),this.measuredHeights.delete(t))}this.tableElement?.dispatchEvent(new CustomEvent("row-collapse",{detail:{rowIndex:e},bubbles:!0,composed:!0}))}expandAll(e){for(let t=0;t<e;t++)this.expandedRows.add(t)}collapseAll(){this.expandedRows.clear(),!1!==this.options?.lazy&&(this.contentCache.clear(),this.measuredHeights.clear())}getExpandedRows(){return new Set(this.expandedRows)}setExpandedRows(e){const t=new Set(e);if(!1!==this.options?.lazy)for(const e of this.expandedRows){if(t.has(e))continue;const i=this.rowByIndex.get(e);void 0!==i&&(this.contentCache.delete(i),this.measuredHeights.delete(i))}this.expandedRows=t}createToggleButton(e){const t=this.isExpanded(e),i=document.createElement("button");i.type="button",i.className="detail-toggle"+(t?" detail-toggle--expanded":""),i.setAttribute("aria-expanded",String(t)),i.setAttribute("aria-label",t?"Collapse row":"Expand row");const a=t?this.options?.collapseIcon:this.options?.expandIcon;return a?a.trim().startsWith("<")?i.innerHTML=a:i.textContent=a:i.innerHTML='<svg class="detail-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e),this.tableElement?.dispatchEvent(new CustomEvent("detail-toggle",{detail:{rowIndex:e,expanded:this.isExpanded(e)},bubbles:!0,composed:!0}))}),i}createDetailRow(e,t,i){if(!this.options||!this.isExpanded(t))return null;const a=document.createElement("tr");a.className="detail-row",a.setAttribute("data-detail-for",String(t));const s=document.createElement("td");s.colSpan=i,s.className="detail-cell",s.style.padding="0",s.style.border="none";const n=document.createElement("div");n.className="detail-content";const l=document.createElement("div");l.className="detail-content-inner";const r=this.getContent(e,t);return"string"==typeof r?l.innerHTML=r:r instanceof HTMLElement&&l.appendChild(r),n.appendChild(l),s.appendChild(n),requestAnimationFrame(()=>{const t=this.options?.detailHeight,i=void 0===t||"auto"===t?`${l.scrollHeight}px`:"number"==typeof t?`${t}px`:t;void 0!==t&&"auto"!==t&&(l.style.height=i,l.style.overflow="auto"),n.style.setProperty("--detail-max-height",i),n.classList.add("detail-content--open");const a=l.getBoundingClientRect().height||l.scrollHeight,s=this.measuredHeights.get(e);a>0&&a!==s&&(this.measuredHeights.set(e,a),this.onHeightChange?.())}),a.appendChild(s),a}isEnabled(){return null!==this.options}getFixedAdditionalHeight(e){if(!this.isExpanded(e))return 0;const t=this.options?.detailHeight;if("number"==typeof t)return Math.max(0,t);if("string"==typeof t&&/^\d+(?:\.\d+)?px$/.test(t.trim()))return Math.max(0,Number.parseFloat(t));const i=this.rowByIndex.get(e);return void 0===i?0:this.measuredHeights.get(i)||0}getContent(e,t){return this.options?(this.rowByIndex.set(t,e),this.contentCache.has(e)||this.contentCache.set(e,this.options.getDetailContent(e,t)),this.contentCache.get(e)):""}}class fe{constructor(){this.container=null,this.options={},this.tableElement=null,this.filterEngine=null,this.filterPanel=null,this.filterPanelOpen=!1,this.filters=[],this.logic="and",this.pendingDebounces=[],this.sortPanel=null,this.sortPanelOpen=!1,this.onSearch=null,this.onSortColumn=null,this.onSetSortModel=null,this.onFilterColumn=null,this.onRemoveFilter=null,this.onClearFilters=null,this.onSetFilterModel=null,this.onExportCSV=null,this.onFullscreen=null}attach(e,t,i={}){this.tableElement=e,this.container=t,this.options=i,this.render()}setFilterEngine(e){this.filterEngine=e}render(){if(!this.container)return;this.container.innerHTML="";const e=document.createElement("div");e.className="tt-wrap",e.appendChild(this.styleTag());const t=document.createElement("div");if(t.className="table-toolbar",t.setAttribute("part","toolbar"),!1!==this.options.showSearch){const e=document.createElement("snice-input");let i;e.type="search",e.placeholder=this.options.searchPlaceholder||"Search...",e.size="small",e.prefixIcon="search",e.clearable=!0,e.className="toolbar-search",e.addEventListener("input",()=>{clearTimeout(i),i=window.setTimeout(()=>this.onSearch?.(e.value),300)}),t.appendChild(e)}const i=document.createElement("div");if(i.className="toolbar-actions",this.options.showSort){const e=this.mkBtn("Sort",j);e.classList.add("toolbar-sort"),e.addEventListener("click",()=>this.toggleSortPanel()),i.appendChild(e)}if(this.options.showFilter){const e=this.mkBtn("Filter",I);e.classList.add("toolbar-filter"),e.addEventListener("click",()=>{this.filterPanelOpen?this.closeFilterPanel():this.openFilterModal()}),i.appendChild(e)}if(this.options.showExport){const e=this.mkBtn("Export CSV",T);e.addEventListener("click",()=>this.onExportCSV?.()),i.appendChild(e)}const a=this.mkBtn("Fullscreen",V);a.addEventListener("click",()=>this.onFullscreen?.()),i.appendChild(a),t.appendChild(i),e.appendChild(t),this.filterPanel=document.createElement("div"),this.filterPanel.className="tt-filter-panel",this.filterPanel.hidden=!this.filterPanelOpen,e.appendChild(this.filterPanel),this.sortPanel=document.createElement("div"),this.sortPanel.className="tt-sort-panel",this.sortPanel.hidden=!this.sortPanelOpen,e.appendChild(this.sortPanel),this.container.appendChild(e),this.filterPanelOpen&&this.renderFilterPanel(),this.sortPanelOpen&&this.renderSortPanel()}openFilterModal(e){this.closeSortPanel();const t=this.ensureEngine();if(!this.filterPanelOpen){const e=t.getFilterModel();this.filters=e.filters.map(e=>({...e})),this.logic=e.logic||"and"}if(e){const i=(this.tableElement?.columns||[]).find(t=>t.key===e),a=t.getOperatorsForType(i?.type||"text");i&&a[0]&&!this.filters.some(t=>t.column===e)&&this.filters.push({column:e,operator:a[0].value,value:""})}this.filterPanelOpen||(this.filterPanelOpen=!0,this.filterPanel&&(this.filterPanel.hidden=!1)),this.renderFilterPanel()}closeFilterPanel(){this.cancelPendingDebounces(),this.filterPanelOpen=!1,this.filterPanel&&(this.filterPanel.hidden=!0)}toggleSortPanel(){this.sortPanelOpen?this.closeSortPanel():(this.closeFilterPanel(),this.sortPanelOpen=!0,this.sortPanel&&(this.sortPanel.hidden=!1),this.renderSortPanel())}closeSortPanel(){this.sortPanelOpen=!1,this.sortPanel&&(this.sortPanel.hidden=!0)}renderSortPanel(){if(!this.sortPanel)return;const e=(this.tableElement?.columns||[]).filter(e=>!1!==e.sortable);let t=(this.tableElement?.currentSort||[]).map(e=>({...e}));this.sortPanel.innerHTML="",this.sortPanel.appendChild(this.styleTag());const i=document.createElement("div");i.className="tt-filter-inner";const a=document.createElement("button");a.type="button",a.className="tt-filter-corner-close",a.setAttribute("aria-label","Close sort panel"),a.innerHTML=k,a.addEventListener("click",()=>this.closeSortPanel()),i.appendChild(a);const s=document.createElement("div");s.className="tt-filter-rows",i.appendChild(s);const n=()=>this.onSetSortModel?.(t.map(e=>({...e}))),l=()=>this.renderSortPanel();if(0===t.length){const e=document.createElement("div");e.className="tt-filter-empty",e.textContent="No sorting applied",s.appendChild(e)}else t.forEach((i,a)=>{const r=document.createElement("div");r.className="tt-filter-row tt-sort-row";const o=document.createElement("button");o.type="button",o.className="tt-filter-x",o.setAttribute("aria-label","Remove sort"),o.innerHTML=k,o.addEventListener("click",()=>{t.splice(a,1),n(),l()}),r.appendChild(o);const c=document.createElement("snice-select");c.size="small";const d=new Set(t.filter((e,t)=>t!==a).map(e=>e.column));c.options=e.filter(e=>e.key===i.column||!d.has(e.key)).map(e=>({value:e.key,label:e.label||e.key})),c.value=i.column,c.style.width="12rem",c.addEventListener("change",()=>{i.column=c.value,n()}),r.appendChild(c);const h=document.createElement("snice-select");h.size="small",h.options=[{value:"asc",label:"Ascending"},{value:"desc",label:"Descending"}],h.value=i.direction,h.style.width="9rem",h.addEventListener("change",()=>{i.direction=h.value,n()}),r.appendChild(h),s.appendChild(r)});const r=document.createElement("div");r.className="tt-filter-footer";const o=document.createElement("button");if(o.type="button",o.className="tt-filter-add",o.innerHTML=`${A}<span>Add sort</span>`,o.addEventListener("click",()=>{const i=new Set(t.map(e=>e.column)),a=e.find(e=>!i.has(e.key));a&&(t.push({column:a.key,direction:"asc"}),n(),l())}),o.disabled=t.length>=e.length,r.appendChild(o),t.length>0){const e=document.createElement("button");e.type="button",e.className="tt-filter-clear",e.textContent="Clear all",e.addEventListener("click",()=>{t=[],n(),l()}),r.appendChild(e)}i.appendChild(r),this.sortPanel.appendChild(i)}ensureEngine(){return this.filterEngine||(this.filterEngine=new ue),this.filterEngine}cancelPendingDebounces(){for(const e of this.pendingDebounces)clearTimeout(e);this.pendingDebounces=[]}renderFilterPanel(){if(!this.filterPanel)return;this.cancelPendingDebounces();const e=this.ensureEngine(),t=this.tableElement?.columns||[];if(0===this.filters.length){const t=e.getFilterModel();this.filters=[...t.filters],this.logic=t.logic||"and"}this.filterPanel.innerHTML="",this.filterPanel.appendChild(this.styleTag());const i=document.createElement("div");i.className="tt-filter-inner";const a=document.createElement("button");a.type="button",a.className="tt-filter-corner-close",a.setAttribute("aria-label","Close filter panel"),a.setAttribute("title","Close"),a.innerHTML=k,a.addEventListener("click",()=>this.closeFilterPanel()),i.appendChild(a);const s=document.createElement("div");s.className="tt-filter-rows",i.appendChild(s);const n=()=>{const i=this.filters.filter(i=>{const a=t.find(e=>e.key===i.column),s=e.getOperatorsForType(a?.type||"text").find(e=>e.value===i.operator);return!!s&&(!1===s.requiresValue||null!==i.value&&""!==i.value)});this.onSetFilterModel?.(i,this.logic)},l=(i,a)=>{const s=document.createElement("div");s.className="tt-filter-row";const l=document.createElement("button");l.type="button",l.className="tt-filter-x",l.setAttribute("aria-label","Remove filter"),l.innerHTML=k,l.addEventListener("click",()=>{this.filters.splice(a,1),0===this.filters.length?this.onClearFilters?.():n(),this.renderFilterPanel()}),s.appendChild(l);const r=document.createElement("snice-select");r.size="small",r.searchable=t.length>8,r.maxHeight="200px",r.options=t.map(e=>({value:e.key,label:e.label||e.key})),r.value=i.column,r.style.width="11rem",s.appendChild(r);const o=document.createElement("snice-select");o.size="small",o.maxHeight="200px",o.style.width="8rem",s.appendChild(o);const c=document.createElement("span");c.className="tt-filter-val-wrap";const d=document.createElement("snice-input");d.size="small",d.placeholder="Value",d.style.width="11rem",null!=i.value&&(d.value=String(i.value)),c.appendChild(d),s.appendChild(c);const h=()=>{const a=t.find(e=>e.key===r.value),s=a?.type||"text",n=e.getOperatorsForType(s);o.options=n.map(e=>({value:e.value,label:e.label})),o.value=n.some(e=>e.value===i.operator)?i.operator:"",d.type=(e=>{switch(e){case"number":case"currency":case"rating":case"progress":case"filesize":case"duration":case"percent":case"percentage":return"number";case"date":return"date";default:return"text"}})(s),u()},u=()=>{const i=t.find(e=>e.key===r.value),a=e.getOperatorsForType(i?.type||"text").find(e=>e.value===o.value);c.style.display=!1===a?.requiresValue?"none":""};let m;return r.addEventListener("change",()=>{i.column=r.value,h(),n()}),o.addEventListener("change",()=>{i.operator=o.value,u(),n()}),d.addEventListener("input",()=>{clearTimeout(m),m=window.setTimeout(()=>{this.pendingDebounces=this.pendingDebounces.filter(e=>e!==m),i.value=d.value,n()},250),this.pendingDebounces.push(m)}),d.addEventListener("keydown",e=>{"Enter"===e.key&&(i.value=d.value,n())}),h(),s};if(this.filters.length>1){const e=document.createElement("div");e.className="tt-filter-logicbar";const t=document.createElement("span");t.className="tt-filter-logicbar-label",t.textContent="Match";const a=document.createElement("snice-select");a.size="small",a.options=[{value:"and",label:"All filters (AND)"},{value:"or",label:"Any filter (OR)"}],a.value=this.logic,a.style.width="11rem",a.addEventListener("change",()=>{this.logic=a.value,n()}),e.appendChild(t),e.appendChild(a),i.insertBefore(e,s)}if(0===this.filters.length){const e=document.createElement("div");e.className="tt-filter-empty",e.textContent="No filters applied",s.appendChild(e)}else this.filters.forEach((e,t)=>s.appendChild(l(e,t)));const r=document.createElement("div");r.className="tt-filter-footer";const o=document.createElement("button");if(o.type="button",o.className="tt-filter-add",o.innerHTML=`${A}<span>Add filter</span>`,o.addEventListener("click",()=>{const i=t[0];if(!i)return;const a=e.getOperatorsForType(i.type||"text");a[0]&&(this.filters.push({column:i.key,operator:a[0].value,value:""}),this.renderFilterPanel())}),r.appendChild(o),this.filters.length>0){const e=document.createElement("button");e.type="button",e.className="tt-filter-clear",e.textContent="Clear all",e.addEventListener("click",()=>{this.cancelPendingDebounces(),this.filters=[],this.logic="and",this.onClearFilters?.(),this.renderFilterPanel()}),r.appendChild(e)}i.appendChild(r),this.filterPanel.appendChild(i)}mkBtn(e,t){const i=document.createElement("button");return i.className="toolbar-btn",i.setAttribute("aria-label",e),i.setAttribute("title",e),i.innerHTML=t,i}styleTag(){const e=document.createElement("style");return e.textContent=ve,e}setActiveFilterCount(e){}isAttached(){return null!==this.container}}const ve="\n .tt-wrap { display: flex; flex-direction: column; }\n\n .tt-filter-panel {\n border-bottom: 1px solid var(--snice-color-border, rgb(226 226 226));\n background: var(--snice-color-surface-container-low, rgb(250 250 250));\n }\n .tt-sort-panel {\n border-bottom: 1px solid var(--snice-color-border, rgb(226 226 226));\n background: var(--snice-color-surface-container-low, rgb(250 250 250));\n }\n .tt-filter-inner {\n padding: 0.75rem 0.875rem;\n padding-right: 2.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n position: relative;\n }\n .tt-filter-corner-close {\n position: absolute;\n top: 0.5rem;\n right: 0.5rem;\n width: 1.75rem;\n height: 1.75rem;\n border: none;\n background: none;\n cursor: pointer;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n line-height: 0;\n z-index: 1;\n }\n .tt-filter-corner-close:hover {\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n color: var(--snice-color-text, rgb(23 23 23));\n }\n .tt-filter-corner-close svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-logicbar {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n .tt-filter-logicbar-label {\n font-size: 0.75rem;\n font-weight: 500;\n color: var(--snice-color-text-secondary, rgb(82 82 82));\n flex: 0 0 auto;\n }\n .tt-filter-rows {\n display: flex;\n flex-direction: column;\n gap: 0.375rem;\n }\n .tt-filter-empty {\n padding: 0.625rem 0.5rem;\n font-size: 0.8125rem;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n font-style: italic;\n }\n .tt-filter-row {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n flex-wrap: nowrap;\n }\n .tt-filter-x {\n border: none;\n background: none;\n color: var(--snice-color-text-tertiary, rgb(115 115 115));\n cursor: pointer;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n flex: 0 0 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n line-height: 0;\n }\n .tt-filter-x svg {\n width: 1rem;\n height: 1rem;\n }\n .tt-filter-x:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n .tt-filter-val-wrap { display: inline-flex; flex: 1 1 auto; min-width: 0; }\n .tt-filter-val-wrap snice-input { width: 100%; }\n .tt-filter-footer {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n margin-top: 0.125rem;\n }\n .tt-filter-add,\n .tt-filter-clear {\n border: none;\n background: none;\n font-family: inherit;\n font-size: 0.8125rem;\n cursor: pointer;\n padding: 0.375rem 0.625rem;\n border-radius: var(--snice-border-radius-md, 0.25rem);\n display: inline-flex;\n align-items: center;\n gap: 0.375rem;\n line-height: 1;\n }\n .tt-filter-add svg,\n .tt-filter-clear svg {\n width: 0.875rem;\n height: 0.875rem;\n }\n .tt-filter-add { color: var(--snice-color-primary, rgb(37 99 235)); font-weight: 500; }\n .tt-filter-add:hover { background: var(--snice-color-primary-subtle, rgb(219 234 254 / 0.4)); }\n .tt-filter-clear { color: var(--snice-color-text-tertiary, rgb(115 115 115)); margin-left: auto; }\n .tt-filter-clear:hover {\n color: var(--snice-color-danger, rgb(220 38 38));\n background: var(--snice-color-surface-hover, rgb(245 245 245));\n }\n";class ye{constructor(){this.options=null,this.expandedKeys=new Set,this.flatRows=[],this.enabled=!1,this.defaultDepth=0}attach(e){this.options=e,this.enabled=!0,void 0!==e.defaultExpansionDepth&&e.defaultExpansionDepth>=0&&(this.defaultDepth=e.defaultExpansionDepth)}isEnabled(){return this.enabled}processData(e){if(!this.options)return[];const t=new Map;for(const i of e){const e=this.options.getPath(i),a=e.join("/");t.set(a,{data:i,children:new Set,depth:e.length-1,isGap:!1});for(let i=1;i<e.length;i++){const a=e.slice(0,i),s=a.join("/");t.has(s)||t.set(s,{data:{[this.options.groupColumn||"name"]:a[a.length-1]},children:new Set,depth:i-1,isGap:!0})}if(e.length>1){const i=e.slice(0,-1).join("/"),s=t.get(i);s&&s.children.add(a)}}const i=[];for(const[e,a]of t)0===a.depth&&i.push(e);if(i.sort(),0===this.expandedKeys.size&&this.defaultDepth>0)for(const[e,i]of t)i.depth<this.defaultDepth&&i.children.size>0&&this.expandedKeys.add(e);this.flatRows=[];const a=e=>{const i=t.get(e);if(!i)return;const s=i.children.size>0,n=this.expandedKeys.has(e);if(this.flatRows.push({path:e.split("/"),data:i.data,depth:i.depth,hasChildren:s,expanded:n,key:e,isGap:i.isGap}),n){const e=Array.from(i.children).sort();for(const t of e)a(t)}};for(const e of i)a(e);return this.flatRows}getFlatRows(){return this.flatRows}toggle(e){this.expandedKeys.has(e)?this.expandedKeys.delete(e):this.expandedKeys.add(e)}expand(e){this.expandedKeys.add(e)}collapse(e){this.expandedKeys.delete(e)}expandAll(e){if(this.options)for(const t of e){const e=this.options.getPath(t);for(let t=1;t<=e.length;t++)this.expandedKeys.add(e.slice(0,t).join("/"))}}collapseAll(){this.expandedKeys.clear()}isExpanded(e){return this.expandedKeys.has(e)}createToggle(e){const t=document.createElement("span");if(t.className="tree-indent",t.style.paddingLeft=1.5*e.depth+"rem",e.hasChildren){const i=document.createElement("button");i.type="button",i.className="tree-toggle"+(e.expanded?" tree-toggle--expanded":""),i.innerHTML='<svg class="tree-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.setAttribute("aria-expanded",String(e.expanded)),i.setAttribute("aria-label",(e.expanded?"Collapse":"Expand")+" row"),i.addEventListener("click",t=>{t.stopPropagation(),this.toggle(e.key),i.dispatchEvent(new CustomEvent("tree-toggle",{detail:{key:e.key,expanded:this.isExpanded(e.key)},bubbles:!0,composed:!0}))}),t.appendChild(i)}else{const e=document.createElement("span");e.className="tree-spacer",t.appendChild(e)}return t}getGroupColumn(){return this.options?.groupColumn||""}}function we(e,t,i){if("function"==typeof e)return e(t,i);if("count"===e)return i.length;const a=[];for(const e of t)if(null!=e&&"boolean"!=typeof e&&("string"!=typeof e||""!==e.trim()))try{const t=Number(e);Number.isFinite(t)&&a.push(t)}catch{}switch(e){case"sum":return a.reduce((e,t)=>e+t,0);case"avg":return a.length?a.reduce((e,t)=>e+t,0)/a.length:0;case"min":return a.length?a.reduce((e,t)=>t<e?t:e,a[0]):null;case"max":return a.length?a.reduce((e,t)=>t>e?t:e,a[0]):null;default:return null}}class ke{constructor(){this.groupByKeys=[],this.defaultExpanded=!0,this.aggregators=[],this.collapsedOverrides=new Set,this.expandedOverrides=new Set,this.flatItems=[],this.objectValueIds=new WeakMap,this.symbolValueIds=new Map,this.nextValueId=1}configure(e){this.groupByKeys=(e.groupBy??[]).filter(Boolean),this.defaultExpanded=!1!==e.defaultExpanded}setColumns(e){const t=e.filter(e=>null!=e.aggregate).map(e=>({key:e.key,aggregate:e.aggregate,valueGetter:e.valueGetter})),i=t.length!==this.aggregators.length||t.some((e,t)=>{const i=this.aggregators[t];return i?.key!==e.key||i.aggregate!==e.aggregate||i.valueGetter!==e.valueGetter});return this.aggregators=t,i}hasGrouping(){return this.groupByKeys.length>0}hasAggregation(){return this.aggregators.length>0}isEnabled(){return this.hasGrouping()||this.hasAggregation()}getGroupByKeys(){return this.groupByKeys}computeAggregates(e){const t={};for(const i of this.aggregators){const a=e.map(e=>{const t=e?.[i.key];return i.valueGetter?i.valueGetter(t,e):t});t[i.key]=we(i.aggregate,a,e)}return t}valueKey(e){if(null===e)return"null";switch(typeof e){case"undefined":return"undefined";case"string":return`string:${encodeURIComponent(e)}`;case"number":return Number.isNaN(e)?"number:NaN":`number:${Object.is(e,-0)?"0":String(e)}`;case"boolean":return"boolean:"+(e?"1":"0");case"bigint":return`bigint:${String(e)}`;case"symbol":{let t=this.symbolValueIds.get(e);return void 0===t&&(t=this.nextValueId++,this.symbolValueIds.set(e,t)),`symbol:${t}`}case"object":case"function":{const t=e;let i=this.objectValueIds.get(t);return void 0===i&&(i=this.nextValueId++,this.objectValueIds.set(t,i)),`object:${i}`}default:return`${typeof e}:${encodeURIComponent(String(e))}`}}processData(e){if(!this.isEnabled()||0===e.length)return this.flatItems=[],this.flatItems;const t=[];if(this.hasGrouping())this.buildGroups(e,0,"",t);else for(const i of e)t.push({type:"row",key:i,depth:0,data:i});return this.hasAggregation()&&t.push({type:"aggregate",key:"agg:table",depth:0,scope:"table",aggregates:this.computeAggregates(e),rows:e}),this.flatItems=t,t}buildGroups(e,t,i,a){const s=this.groupByKeys[t],n=new Map;for(const t of e){const e=t[s],i=n.get(e);i?i.push(t):n.set(e,[t])}const l=Array.from(n.keys()).sort((e,t)=>String(e??"").localeCompare(String(t??""),void 0,{numeric:!0})||this.valueKey(e).localeCompare(this.valueKey(t))),r=t===this.groupByKeys.length-1;for(const e of l){const l=n.get(e),o=`${encodeURIComponent(s)}=${this.valueKey(e)}`,c=i?`${i}|${o}`:o,d=`group:${c}`,h=this.isExpanded(d);if(a.push({type:"group",key:d,depth:t,groupKey:s,value:e,count:l.length,expanded:h,hasChildren:!0,rows:l}),h){if(r)for(const e of l)a.push({type:"row",key:e,depth:t+1,data:e});else this.buildGroups(l,t+1,c,a);this.hasAggregation()&&a.push({type:"aggregate",key:`agg:${d}`,depth:t+1,scope:"group",aggregates:this.computeAggregates(l),rows:l,groupKey:d,groupValue:e,groupColumn:s})}}}getFlatItems(){return this.flatItems}isExpanded(e){return this.defaultExpanded?!this.collapsedOverrides.has(e):this.expandedOverrides.has(e)}toggle(e){this.isExpanded(e)?this.collapse(e):this.expand(e)}expand(e){this.collapsedOverrides.delete(e),this.defaultExpanded||this.expandedOverrides.add(e)}collapse(e){this.expandedOverrides.delete(e),this.defaultExpanded&&this.collapsedOverrides.add(e)}expandAll(){if(this.collapsedOverrides.clear(),!this.defaultExpanded)for(const e of this.flatItems)"group"===e.type&&this.expandedOverrides.add(e.key)}collapseAll(){if(this.expandedOverrides.clear(),this.defaultExpanded)for(const e of this.flatItems)"group"===e.type&&this.collapsedOverrides.add(e.key)}createToggle(e){const t=document.createElement("span");t.className="tree-indent",t.style.paddingLeft=1.5*e.depth+"rem";const i=document.createElement("button");i.type="button",i.className="tree-toggle"+(e.expanded?" tree-toggle--expanded":""),i.setAttribute("data-group-key",e.key),i.innerHTML='<svg class="tree-toggle-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>',i.setAttribute("aria-expanded",String(e.expanded));const a=null==e.value||""===e.value?"blank":String(e.value);return i.setAttribute("aria-label",`${e.expanded?"Collapse":"Expand"} ${a} group, ${e.count} rows`),t.appendChild(i),t}}class xe{constructor(){this.menuEl=null,this.activeColumn=null,this.tableElement=null,this.outsideClickHandler=null,this.onSortAsc=null,this.onSortDesc=null,this.onFilter=null,this.onHide=null,this.onPinLeft=null,this.onPinRight=null,this.onUnpin=null,this.onAutoSize=null}attach(e){this.tableElement=e}show(e,t,i,a){this.hide(),this.activeColumn=e;const s=document.createElement("div");s.className="table-column-menu",s.style.left=`${t}px`,s.style.top=`${i}px`;const n=[];!1!==a?.sortable&&(n.push({label:"Sort Ascending",icon:R,action:"sort-asc"}),n.push({label:"Sort Descending",icon:M,action:"sort-desc"}),n.push({label:"",action:"",separator:!0})),!1!==a?.filterable&&n.push({label:"Filter...",icon:I,action:"filter"}),!1!==a?.hideable&&n.push({label:"Hide Column",icon:B,action:"hide"}),!1!==a?.pinnable&&(a?.pinned?n.push({label:"Unpin",icon:k,action:"unpin"}):(n.push({label:"Pin Left",icon:O,action:"pin-left"}),n.push({label:"Pin Right",icon:O,action:"pin-right"}))),n.push({label:"",action:"",separator:!0}),n.push({label:"Auto-size",icon:j,action:"autosize"});for(const e of n){if(e.separator){const e=document.createElement("div");e.className="column-menu-separator",s.appendChild(e);continue}const t=document.createElement("button");t.type="button",t.className="column-menu-item",t.innerHTML=`${e.icon?`<span class="column-menu-icon">${e.icon}</span>`:""}<span>${e.label}</span>`,t.addEventListener("click",()=>{this.handleAction(e.action),this.hide()}),e.disabled&&(t.disabled=!0),s.appendChild(t)}const l=this.tableElement?.shadowRoot;l?l.appendChild(s):document.body.appendChild(s),this.menuEl=s,setTimeout(()=>{this.outsideClickHandler=e=>{e.composedPath().includes(s)||this.hide()},document.addEventListener("click",this.outsideClickHandler,{capture:!0})},0);const r=e=>{"Escape"===e.key&&(this.hide(),document.removeEventListener("keydown",r))};document.addEventListener("keydown",r)}handleAction(e){if(this.activeColumn)switch(e){case"sort-asc":this.onSortAsc?.(this.activeColumn);break;case"sort-desc":this.onSortDesc?.(this.activeColumn);break;case"filter":this.onFilter?.(this.activeColumn);break;case"hide":this.onHide?.(this.activeColumn);break;case"pin-left":this.onPinLeft?.(this.activeColumn);break;case"pin-right":this.onPinRight?.(this.activeColumn);break;case"unpin":this.onUnpin?.(this.activeColumn);break;case"autosize":this.onAutoSize?.(this.activeColumn)}}hide(){this.menuEl&&(this.menuEl.remove(),this.menuEl=null),this.outsideClickHandler&&(document.removeEventListener("click",this.outsideClickHandler,{capture:!0}),this.outsideClickHandler=null),this.activeColumn=null}isOpen(){return null!==this.menuEl}}class Ce{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceIndex=-1,this.dropTargetIndex=-1,this.dropIndicator=null}attach(e){this.tableElement=e,this.enabled=!0}detach(){this.removeDropIndicator(),this.tableElement=null,this.dragSourceIndex=-1,this.dropTargetIndex=-1,this.enabled=!1}isEnabled(){return this.enabled}makeRowDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceIndex=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",String(t))}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.removeDropIndicator(),this.dragSourceIndex=-1}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",this.dropTargetIndex=t,this.showDropIndicator(e)}),e.addEventListener("dragleave",()=>{this.removeDropIndicator()}),e.addEventListener("drop",e=>{e.preventDefault(),this.removeDropIndicator(),-1!==this.dragSourceIndex&&this.dragSourceIndex!==t&&this.tableElement?.dispatchEvent(new CustomEvent("row-reorder",{detail:{fromIndex:this.dragSourceIndex,toIndex:t},bubbles:!0,composed:!0})),this.dragSourceIndex=-1}))}createDragHandle(){const e=document.createElement("td");return e.className="drag-handle-cell",e.textContent="⠗",e.setAttribute("aria-label","Drag to reorder"),e}showDropIndicator(e){this.removeDropIndicator(),this.dropIndicator=document.createElement("div"),this.dropIndicator.className="drop-indicator";const t=e.getBoundingClientRect(),i=e.parentElement?.getBoundingClientRect();i&&(this.dropIndicator.style.top=(this.dropTargetIndex>this.dragSourceIndex?t.bottom-i.top:t.top-i.top)+"px",e.parentElement.style.position="relative",e.parentElement.appendChild(this.dropIndicator))}removeDropIndicator(){this.dropIndicator?.remove(),this.dropIndicator=null}}class Se{constructor(){this.enabled=!1,this.tableElement=null,this.dragSourceKey=null}attach(e){this.tableElement=e,this.enabled=!0}detach(){this.tableElement=null,this.dragSourceKey=null,this.enabled=!1}isEnabled(){return this.enabled}makeHeaderDraggable(e,t,i=!0){i&&(e.draggable=!0,e.addEventListener("dragstart",i=>{this.dragSourceKey=t,e.style.opacity="0.5",i.dataTransfer.effectAllowed="move",i.dataTransfer.setData("text/plain",t)}),e.addEventListener("dragend",()=>{e.style.opacity="1",this.dragSourceKey=null}),e.addEventListener("dragover",i=>{this.dragSourceKey&&this.dragSourceKey!==t&&(i.preventDefault(),i.dataTransfer.dropEffect="move",e.style.borderLeft="2px solid var(--snice-color-primary, rgb(37 99 235))")}),e.addEventListener("dragleave",()=>{e.style.borderLeft=""}),e.addEventListener("drop",i=>{i.preventDefault(),e.style.borderLeft="",this.dragSourceKey&&this.dragSourceKey!==t&&this.tableElement?.dispatchEvent(new CustomEvent("column-reorder",{detail:{fromKey:this.dragSourceKey,toKey:t},bubbles:!0,composed:!0})),this.dragSourceKey=null}))}}(()=>{let t,a,c,p,b,v,k,x,C,S,E,D,A,R,M,z,$,F,I,T,L,V,B,O,j,P,N,H,q,_,G,K,W,U,Z,Y,J,Q,X,ee,te,ie,ae,se,ne,oe,ce,de,he,ve,we,Ee,De,Ae,Re,Me,ze,$e,Fe,Ie,Te,Le,Ve,Be,Oe,je,Pe,Ne,He,qe,_e,Ge,Ke,We,Ue,Ze,Ye,Je,Qe,Xe,et,tt,it,at,st,nt,lt,rt,ot,ct,dt,ht=[i("snice-table")],ut=[],mt=HTMLElement,pt=[],gt=[],bt=[],ft=[],vt=[],yt=[],wt=[],kt=[],xt=[],Ct=[],St=[],Et=[],Dt=[],At=[],Rt=[],Mt=[],zt=[],$t=[],Ft=[],It=[],Tt=[],Lt=[],Vt=[],Bt=[],Ot=[],jt=[],Pt=[],Nt=[],Ht=[],qt=[],_t=[],Gt=[],Kt=[],Wt=[],Ut=[],Zt=[],Yt=[],Jt=[],Qt=[],Xt=[],ei=[],ti=[],ii=[],ai=[],si=[],ni=[],li=[],ri=[],oi=[],ci=[],di=[],hi=[],ui=[],mi=[],pi=[],gi=[],bi=[],fi=[],vi=[],yi=[],wi=[],ki=[],xi=[],Ci=[],Si=[],Ei=[],Di=[],Ai=[],Ri=[],Mi=[],zi=[],$i=[],Fi=[],Ii=[],Ti=[],Li=[],Vi=[],Bi=[],Oi=[],ji=[],Pi=[],Ni=[],Hi=[],qi=[],_i=[],Gi=[],Ki=[];var Wi=class extends mt{static{a=this}constructor(){super(...arguments),this.striped=(w(this,pt),w(this,gt,!1)),this.searchable=(w(this,bt),w(this,ft,!1)),this.filterable=(w(this,vt),w(this,yt,!1)),this.sortable=(w(this,wt),w(this,kt,!1)),this.selectable=(w(this,xt),w(this,Ct,!1)),this.hoverable=(w(this,St),w(this,Et,!0)),this.clickable=(w(this,Dt),w(this,At,!1)),this.list=(w(this,Rt),w(this,Mt,!1)),this.pagination=(w(this,zt),w(this,$t,!1)),this.paginationMode=(w(this,Ft),w(this,It,"client")),this.pageSize=(w(this,Tt),w(this,Lt,10)),this.currentPage=(w(this,Vt),w(this,Bt,1)),this.totalItems=(w(this,Ot),w(this,jt,0)),this.pageSizes=(w(this,Pt),w(this,Nt,[10,25,50,100])),this.searchDebounce=(w(this,Ht),w(this,qt,500)),this.columns=(w(this,_t),w(this,Gt,[])),this.data=(w(this,Kt),w(this,Wt,[])),this.mode=(w(this,Ut),w(this,Zt,"local")),this.currentSort=(w(this,Yt),w(this,Jt,[])),this.searchText=(w(this,Qt),""),this.selector=w(this,Xt,""),this.selectorOptions=(w(this,ei),w(this,ti,[])),this.loading=(w(this,ii),w(this,ai,!1)),this.loadError=(w(this,si),null),this.virtualize=w(this,ni,!1),this.rowHeight=(w(this,li),w(this,ri,48)),this.virtualBuffer=(w(this,oi),w(this,ci,200)),this.columnResize=(w(this,di),w(this,hi,!1)),this.editable=(w(this,ui),w(this,mi,!1)),this.editMode=(w(this,pi),w(this,gi,"cell")),this.density=(w(this,bi),w(this,fi,"standard")),this.headerFilters=(w(this,vi),w(this,yi,!1)),this.quickFilter=(w(this,wi),w(this,ki,!1)),this.rowReorder=(w(this,xi),w(this,Ci,!1)),this.columnReorder=(w(this,Si),w(this,Ei,!1)),this.columnMenu=(w(this,Di),w(this,Ai,!1)),this.lazyLoad=(w(this,Ri),w(this,Mi,!1)),this.lazyLoadThreshold=(w(this,zi),w(this,$i,200)),this.selectedRows=(w(this,Fi),w(this,Ii,[])),this.selectionMode=(w(this,Ti),w(this,Li,"multiple")),this.selectionAnchor=(w(this,Vi),null),this.groupBy=w(this,Bi,""),this.groupDefaults=(w(this,Oi),w(this,ji,{})),this.groupingCache=(w(this,Pi),null),this.virtualizer=new le,this.columnManager=new re,this.filterEngine=new ue,this.editor=new me,this.keyboard=new pe,this.exporter=new ge,this.masterDetail=new be,this.toolbar=new fe,this.treeData=new ye,this.grouping=new ke,this.columnMenuManager=new xe,this.rowDnD=new Ce,this.columnDnD=new Se,this.pinnedTopRows=[],this.pinnedBottomRows=[],this.toolbarOptions=null,this.lazyLoadHandler=null,this.lazyLoadContainer=null,this.rowHeightCallback=null,this.virtualRowsSnapshot=[],this.table=w(this,Ni,void 0),this.thead=(w(this,Hi),w(this,qi,void 0)),this.tbody=(w(this,_i),w(this,Gi,void 0)),this.unsortedData=(w(this,Ki),[]),this.dataRequestTimeout=null,this.rowIndexMap=new Map,this.rowIndexDataRef=null,this.filteredCache=null,this.dataRequestSeq=0,this.renderedRows=new Map,this.settingSortedData=!1,this.settingDataImperative=!1,this.renderQueued=!1,this.pendingHeaderRender=!1,this.pendingBodyRender=!1,this.rendererIds=new WeakMap,this.rendererIdSeq=0,this.fsExitHandler=null,this.toggleFullscreen=async()=>{if(this.classList.contains("table-fullscreen")){if(this.classList.remove("table-fullscreen"),document.fullscreenElement===this)try{await document.exitFullscreen()}catch{}this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null)}else{this.classList.add("table-fullscreen");try{"function"==typeof this.requestFullscreen&&await this.requestFullscreen()}catch{}this.fsExitHandler=()=>{document.fullscreenElement!==this&&(this.classList.remove("table-fullscreen"),this.fsExitHandler&&(document.removeEventListener("fullscreenchange",this.fsExitHandler),this.fsExitHandler=null))},document.addEventListener("fullscreenchange",this.fsExitHandler)}},this.handleKeydown=e=>{if("Enter"!==e.key&&" "!==e.key)return;const t=e.target.closest("th.sortable");if(!t)return;const i=t.getAttribute("data-key");i&&(e.preventDefault(),this.toggleSort(i,!0))},this.handleClick=e=>{const t=e.target,i=t.closest("th.sortable");if(i){const e=i.getAttribute("data-key");return void(e&&this.toggleSort(e,!0))}const a=t.closest("tbody tr");if(a){if(a.classList.contains("group-header-row")){if(t.closest("snice-checkbox.group-select"))return;const e=a.getAttribute("data-group-key"),i=e?this.getGroupingItems().find(t=>"group"===t.type&&t.key===e):void 0;return void(i&&this.toggleGroup(i))}if(!a.hasAttribute("data-index"))return;if(t.matches('input[type="checkbox"], button, a, .interactive, snice-checkbox, snice-button, snice-input, snice-select'))return;const i=parseInt(a.getAttribute("data-index")||"0"),s=this.data[i];this.selectable&&this.applyRowSelection(i,{additive:e.ctrlKey||e.metaKey,range:e.shiftKey}),this.clickable&&this.dispatchRowClicked(s,i)}},this.handleChange=e=>{const t=e.target;if(t.matches("snice-checkbox.row-select")){const e=t,i=parseInt(e.getAttribute("data-row-index")||"0");if("none"===this.selectionMode)return;return this.selectabilityCheck&&!this.selectabilityCheck(this.data[i],i)?void(e.checked=this.selectedRows.includes(i)):("single"===this.selectionMode?this.selectedRows=e.checked?[i]:[]:e.checked?this.selectedRows.includes(i)||(this.selectedRows=[...this.selectedRows,i]):this.selectedRows=this.selectedRows.filter(e=>e!==i),this.selectionAnchor=this.data[i],this.dispatchRowSelectionChanged(i,e.checked),void this.dispatchSelectionChanged())}if(t.matches("snice-checkbox.group-select")){const e=t;if("multiple"!==this.selectionMode)return;const i=e.getAttribute("data-group-key"),a=this.getGroupingItems().find(e=>"group"===e.type&&e.key===i);if(!a)return;const s=this.getSelectableGroupIndices(a);if(e.checked)this.selectedRows=Array.from(new Set([...this.selectedRows,...s]));else{const e=new Set(s);this.selectedRows=this.selectedRows.filter(t=>!e.has(t))}return void this.dispatchSelectionChanged()}if(t.matches("snice-checkbox.select-all")){const e=t;if("multiple"!==this.selectionMode)return;this.selectedRows=e.checked?this.getSelectableIndices(this.getFilteredData()):[],this.dispatchSelectAllChanged(e.checked),this.dispatchSelectionChanged()}},this.onAttached=()=>{"remote"===this.mode&&(this.getTableConfig(),this.getTableData())},this.searchDebounceTimeout=null,this.handleSearchInput=e=>{this.searchText=e.target.value,this.searchDebounceTimeout&&clearTimeout(this.searchDebounceTimeout),this.searchDebounceTimeout=setTimeout(()=>{"remote"===this.mode?this.getTableData():this.setQuickFilter(this.searchText)},this.searchDebounce)},this.handleQuickFilterInput=e=>{const t=e.target;this.filterInputDebounceTimeout&&clearTimeout(this.filterInputDebounceTimeout),this.filterInputDebounceTimeout=setTimeout(()=>{this.filterInputDebounceTimeout=null,this.setQuickFilter(t.value||"")},Wi.FILTER_INPUT_DEBOUNCE_MS)},this.selectorDebounceTimeout=null,this.handleSelectorChange=e=>{this.selector=Array.isArray(e.detail.value)?e.detail.value.join(","):e.detail.value,this.selectorDebounceTimeout&&clearTimeout(this.selectorDebounceTimeout),this.selectorDebounceTimeout=setTimeout(()=>{this.debouncedDataRequest()},150)},this.filterInputDebounceTimeout=null,this.handleSlottedRowSelect=e=>{const t=e.detail?.element,i=this.getSlottedSelectionRows(),a=i.indexOf(t);if(!(a<0))return!this.hasSelectionColumn()||this.selectabilityCheck&&!this.selectabilityCheck(t.data,a)?(t.selected=!1,void this.syncSlottedSelectionState()):("single"===this.selectionMode&&t.selected&&i.forEach((e,t)=>{t!==a&&(e.selected=!1)}),this.selectedRows=i.map((e,t)=>e.selected?t:-1).filter(e=>e>=0),this.selectionAnchor=t.data,this.dispatchRowSelectionChanged(a,t.selected),void this.dispatchSelectionChanged())},this.selectabilityCheck=null,this.listViewRenderer=null}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(mt[Symbol.metadata]??null):void 0;c=[s({type:Boolean,attribute:"striped"})],p=[s({type:Boolean,attribute:"searchable"})],b=[s({type:Boolean,attribute:"filterable"})],v=[s({type:Boolean,attribute:"sortable"})],k=[s({type:Boolean,attribute:"selectable"})],x=[s({type:Boolean,attribute:"hoverable"})],C=[s({type:Boolean,attribute:"clickable"})],S=[s({type:Boolean,attribute:"list"})],E=[s({type:Boolean,attribute:"pagination"})],D=[s({attribute:"pagination-mode"})],A=[s({type:Number,attribute:"page-size"})],R=[s({type:Number,attribute:"current-page"})],M=[s({type:Number,attribute:"total-items"})],z=[s({type:Array,attribute:!1})],$=[s({type:Number,attribute:"search-debounce"})],F=[s({attribute:!1})],I=[s({attribute:!1})],T=[s()],L=[s({type:Array,attribute:!1})],V=[s({type:String,attribute:"selector"})],B=[s({type:Array,attribute:!1})],O=[s({type:Boolean,attribute:"loading"})],j=[s({type:Boolean,attribute:"virtualize"})],P=[s({type:Number,attribute:"row-height"})],N=[s({type:Number,attribute:"virtual-buffer"})],H=[s({type:Boolean,attribute:"column-resize"})],q=[s({type:Boolean,attribute:"editable"})],_=[s({attribute:"edit-mode"})],G=[s({attribute:"density"})],K=[s({type:Boolean,attribute:"header-filters"})],W=[s({type:Boolean,attribute:"quick-filter"})],U=[s({type:Boolean,attribute:"row-reorder"})],Z=[s({type:Boolean,attribute:"column-reorder"})],Y=[s({type:Boolean,attribute:"column-menu"})],J=[s({type:Boolean,attribute:"lazy-load"})],Q=[s({type:Number,attribute:"lazy-load-threshold"})],X=[s({type:Array,attribute:!1})],ee=[s({attribute:"selection-mode"})],te=[s({attribute:!1})],ie=[s({attribute:!1})],ae=[n("table")],se=[n("thead")],ne=[n("tbody")],oe=[g("table/config")],ce=[g("table/data")],de=[r()],he=[l()],ve=[o()],we=[f("column-changed")],Ee=[d("selectorOptions")],De=[d("sortable")],Ae=[d("selectable")],Re=[d("columns",{immediate:!1})],Me=[d("groupBy","groupDefaults",{immediate:!1})],ze=[d("data",{immediate:!1})],$e=[d("loading")],Fe=[d("selectedRows")],Ie=[d("selectionMode",{immediate:!1})],Te=[d("currentSort")],Le=[d("searchable","filterable","quickFilter")],Ve=[d("currentSort",{immediate:!1})],Be=[d("currentPage",{immediate:!1})],Oe=[d("pageSize",{immediate:!1})],je=[d("density",{immediate:!1})],Pe=[d("list",{immediate:!1})],Ne=[d("editable",{immediate:!1})],He=[d("editMode",{immediate:!1})],qe=[d("virtualize",{immediate:!1})],_e=[d("rowHeight",{immediate:!1})],Ge=[d("columnResize",{immediate:!1})],Ke=[d("headerFilters",{immediate:!1})],We=[d("rowReorder",{immediate:!1})],Ue=[d("columnReorder",{immediate:!1})],Ze=[d("lazyLoad","lazyLoadThreshold",{immediate:!1})],Ye=[d("columnMenu",{immediate:!1})],Je=[h("page-change",{bubbles:!0,composed:!0})],Qe=[h("table-row-selection-changed",{bubbles:!0,composed:!0})],Xe=[h("row-clicked",{bubbles:!0,composed:!0})],et=[h("table-load-error",{bubbles:!0,composed:!0})],tt=[h("table-select-all-changed",{bubbles:!0,composed:!0})],it=[h("selection-changed",{bubbles:!0,composed:!0})],at=[h("sort-change",{bubbles:!0,composed:!0})],st=[h("filter-change",{bubbles:!0,composed:!0})],nt=[h("column-visibility-change",{bubbles:!0,composed:!0})],lt=[h("column-pin-change",{bubbles:!0,composed:!0})],rt=[h("column-order-change",{bubbles:!0,composed:!0})],ot=[h("density-change",{bubbles:!0,composed:!0})],ct=[u()],dt=[h("group-toggle",{bubbles:!0,composed:!0})],y(this,null,oe,{kind:"method",name:"getTableConfig",static:!1,private:!1,access:{has:e=>"getTableConfig"in e,get:e=>e.getTableConfig},metadata:e},null,pt),y(this,null,ce,{kind:"method",name:"getTableData",static:!1,private:!1,access:{has:e=>"getTableData"in e,get:e=>e.getTableData},metadata:e},null,pt),y(this,null,de,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,pt),y(this,null,he,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,pt),y(this,null,ve,{kind:"method",name:"initialize",static:!1,private:!1,access:{has:e=>"initialize"in e,get:e=>e.initialize},metadata:e},null,pt),y(this,null,we,{kind:"method",name:"handleDeclarativeColumnChange",static:!1,private:!1,access:{has:e=>"handleDeclarativeColumnChange"in e,get:e=>e.handleDeclarativeColumnChange},metadata:e},null,pt),y(this,null,Ee,{kind:"method",name:"handleSelectorOptionsChange",static:!1,private:!1,access:{has:e=>"handleSelectorOptionsChange"in e,get:e=>e.handleSelectorOptionsChange},metadata:e},null,pt),y(this,null,De,{kind:"method",name:"handleSortableChange",static:!1,private:!1,access:{has:e=>"handleSortableChange"in e,get:e=>e.handleSortableChange},metadata:e},null,pt),y(this,null,Ae,{kind:"method",name:"handleSelectableChange",static:!1,private:!1,access:{has:e=>"handleSelectableChange"in e,get:e=>e.handleSelectableChange},metadata:e},null,pt),y(this,null,Re,{kind:"method",name:"handleColumnsAssignment",static:!1,private:!1,access:{has:e=>"handleColumnsAssignment"in e,get:e=>e.handleColumnsAssignment},metadata:e},null,pt),y(this,null,Me,{kind:"method",name:"handleGroupByChange",static:!1,private:!1,access:{has:e=>"handleGroupByChange"in e,get:e=>e.handleGroupByChange},metadata:e},null,pt),y(this,null,ze,{kind:"method",name:"handleDataAssignment",static:!1,private:!1,access:{has:e=>"handleDataAssignment"in e,get:e=>e.handleDataAssignment},metadata:e},null,pt),y(this,null,$e,{kind:"method",name:"handleDataChange",static:!1,private:!1,access:{has:e=>"handleDataChange"in e,get:e=>e.handleDataChange},metadata:e},null,pt),y(this,null,Fe,{kind:"method",name:"handleSelectedRowsChange",static:!1,private:!1,access:{has:e=>"handleSelectedRowsChange"in e,get:e=>e.handleSelectedRowsChange},metadata:e},null,pt),y(this,null,Ie,{kind:"method",name:"handleSelectionModeChange",static:!1,private:!1,access:{has:e=>"handleSelectionModeChange"in e,get:e=>e.handleSelectionModeChange},metadata:e},null,pt),y(this,null,Te,{kind:"method",name:"handleSortChange",static:!1,private:!1,access:{has:e=>"handleSortChange"in e,get:e=>e.handleSortChange},metadata:e},null,pt),y(this,null,Le,{kind:"method",name:"handleControlsChange",static:!1,private:!1,access:{has:e=>"handleControlsChange"in e,get:e=>e.handleControlsChange},metadata:e},null,pt),y(this,null,Ve,{kind:"method",name:"handleControlledSort",static:!1,private:!1,access:{has:e=>"handleControlledSort"in e,get:e=>e.handleControlledSort},metadata:e},null,pt),y(this,null,Be,{kind:"method",name:"handleCurrentPageChange",static:!1,private:!1,access:{has:e=>"handleCurrentPageChange"in e,get:e=>e.handleCurrentPageChange},metadata:e},null,pt),y(this,null,Oe,{kind:"method",name:"handlePageSizeChange",static:!1,private:!1,access:{has:e=>"handlePageSizeChange"in e,get:e=>e.handlePageSizeChange},metadata:e},null,pt),y(this,null,je,{kind:"method",name:"handleDensityChange",static:!1,private:!1,access:{has:e=>"handleDensityChange"in e,get:e=>e.handleDensityChange},metadata:e},null,pt),y(this,null,Pe,{kind:"method",name:"handleListChange",static:!1,private:!1,access:{has:e=>"handleListChange"in e,get:e=>e.handleListChange},metadata:e},null,pt),y(this,null,Ne,{kind:"method",name:"handleEditableChange",static:!1,private:!1,access:{has:e=>"handleEditableChange"in e,get:e=>e.handleEditableChange},metadata:e},null,pt),y(this,null,He,{kind:"method",name:"handleEditModeChange",static:!1,private:!1,access:{has:e=>"handleEditModeChange"in e,get:e=>e.handleEditModeChange},metadata:e},null,pt),y(this,null,qe,{kind:"method",name:"handleVirtualizeChange",static:!1,private:!1,access:{has:e=>"handleVirtualizeChange"in e,get:e=>e.handleVirtualizeChange},metadata:e},null,pt),y(this,null,_e,{kind:"method",name:"handleRowHeightChange",static:!1,private:!1,access:{has:e=>"handleRowHeightChange"in e,get:e=>e.handleRowHeightChange},metadata:e},null,pt),y(this,null,Ge,{kind:"method",name:"handleColumnResizeChange",static:!1,private:!1,access:{has:e=>"handleColumnResizeChange"in e,get:e=>e.handleColumnResizeChange},metadata:e},null,pt),y(this,null,Ke,{kind:"method",name:"handleHeaderFiltersChange",static:!1,private:!1,access:{has:e=>"handleHeaderFiltersChange"in e,get:e=>e.handleHeaderFiltersChange},metadata:e},null,pt),y(this,null,We,{kind:"method",name:"handleRowReorderChange",static:!1,private:!1,access:{has:e=>"handleRowReorderChange"in e,get:e=>e.handleRowReorderChange},metadata:e},null,pt),y(this,null,Ue,{kind:"method",name:"handleColumnReorderChange",static:!1,private:!1,access:{has:e=>"handleColumnReorderChange"in e,get:e=>e.handleColumnReorderChange},metadata:e},null,pt),y(this,null,Ze,{kind:"method",name:"handleLazyLoadChange",static:!1,private:!1,access:{has:e=>"handleLazyLoadChange"in e,get:e=>e.handleLazyLoadChange},metadata:e},null,pt),y(this,null,Ye,{kind:"method",name:"handleColumnMenuChange",static:!1,private:!1,access:{has:e=>"handleColumnMenuChange"in e,get:e=>e.handleColumnMenuChange},metadata:e},null,pt),y(this,null,Je,{kind:"method",name:"dispatchPageChange",static:!1,private:!1,access:{has:e=>"dispatchPageChange"in e,get:e=>e.dispatchPageChange},metadata:e},null,pt),y(this,null,Qe,{kind:"method",name:"dispatchRowSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchRowSelectionChanged"in e,get:e=>e.dispatchRowSelectionChanged},metadata:e},null,pt),y(this,null,Xe,{kind:"method",name:"dispatchRowClicked",static:!1,private:!1,access:{has:e=>"dispatchRowClicked"in e,get:e=>e.dispatchRowClicked},metadata:e},null,pt),y(this,null,et,{kind:"method",name:"dispatchLoadError",static:!1,private:!1,access:{has:e=>"dispatchLoadError"in e,get:e=>e.dispatchLoadError},metadata:e},null,pt),y(this,null,tt,{kind:"method",name:"dispatchSelectAllChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectAllChanged"in e,get:e=>e.dispatchSelectAllChanged},metadata:e},null,pt),y(this,null,it,{kind:"method",name:"dispatchSelectionChanged",static:!1,private:!1,access:{has:e=>"dispatchSelectionChanged"in e,get:e=>e.dispatchSelectionChanged},metadata:e},null,pt),y(this,null,at,{kind:"method",name:"dispatchSortChange",static:!1,private:!1,access:{has:e=>"dispatchSortChange"in e,get:e=>e.dispatchSortChange},metadata:e},null,pt),y(this,null,st,{kind:"method",name:"dispatchFilterChange",static:!1,private:!1,access:{has:e=>"dispatchFilterChange"in e,get:e=>e.dispatchFilterChange},metadata:e},null,pt),y(this,null,nt,{kind:"method",name:"dispatchColumnVisibilityChange",static:!1,private:!1,access:{has:e=>"dispatchColumnVisibilityChange"in e,get:e=>e.dispatchColumnVisibilityChange},metadata:e},null,pt),y(this,null,lt,{kind:"method",name:"dispatchColumnPinChange",static:!1,private:!1,access:{has:e=>"dispatchColumnPinChange"in e,get:e=>e.dispatchColumnPinChange},metadata:e},null,pt),y(this,null,rt,{kind:"method",name:"dispatchColumnOrderChange",static:!1,private:!1,access:{has:e=>"dispatchColumnOrderChange"in e,get:e=>e.dispatchColumnOrderChange},metadata:e},null,pt),y(this,null,ot,{kind:"method",name:"dispatchDensityChange",static:!1,private:!1,access:{has:e=>"dispatchDensityChange"in e,get:e=>e.dispatchDensityChange},metadata:e},null,pt),y(this,null,ct,{kind:"method",name:"cleanup",static:!1,private:!1,access:{has:e=>"cleanup"in e,get:e=>e.cleanup},metadata:e},null,pt),y(this,null,dt,{kind:"method",name:"dispatchGroupToggle",static:!1,private:!1,access:{has:e=>"dispatchGroupToggle"in e,get:e=>e.dispatchGroupToggle},metadata:e},null,pt),y(null,null,c,{kind:"field",name:"striped",static:!1,private:!1,access:{has:e=>"striped"in e,get:e=>e.striped,set:(e,t)=>{e.striped=t}},metadata:e},gt,bt),y(null,null,p,{kind:"field",name:"searchable",static:!1,private:!1,access:{has:e=>"searchable"in e,get:e=>e.searchable,set:(e,t)=>{e.searchable=t}},metadata:e},ft,vt),y(null,null,b,{kind:"field",name:"filterable",static:!1,private:!1,access:{has:e=>"filterable"in e,get:e=>e.filterable,set:(e,t)=>{e.filterable=t}},metadata:e},yt,wt),y(null,null,v,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:e},kt,xt),y(null,null,k,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:e},Ct,St),y(null,null,x,{kind:"field",name:"hoverable",static:!1,private:!1,access:{has:e=>"hoverable"in e,get:e=>e.hoverable,set:(e,t)=>{e.hoverable=t}},metadata:e},Et,Dt),y(null,null,C,{kind:"field",name:"clickable",static:!1,private:!1,access:{has:e=>"clickable"in e,get:e=>e.clickable,set:(e,t)=>{e.clickable=t}},metadata:e},At,Rt),y(null,null,S,{kind:"field",name:"list",static:!1,private:!1,access:{has:e=>"list"in e,get:e=>e.list,set:(e,t)=>{e.list=t}},metadata:e},Mt,zt),y(null,null,E,{kind:"field",name:"pagination",static:!1,private:!1,access:{has:e=>"pagination"in e,get:e=>e.pagination,set:(e,t)=>{e.pagination=t}},metadata:e},$t,Ft),y(null,null,D,{kind:"field",name:"paginationMode",static:!1,private:!1,access:{has:e=>"paginationMode"in e,get:e=>e.paginationMode,set:(e,t)=>{e.paginationMode=t}},metadata:e},It,Tt),y(null,null,A,{kind:"field",name:"pageSize",static:!1,private:!1,access:{has:e=>"pageSize"in e,get:e=>e.pageSize,set:(e,t)=>{e.pageSize=t}},metadata:e},Lt,Vt),y(null,null,R,{kind:"field",name:"currentPage",static:!1,private:!1,access:{has:e=>"currentPage"in e,get:e=>e.currentPage,set:(e,t)=>{e.currentPage=t}},metadata:e},Bt,Ot),y(null,null,M,{kind:"field",name:"totalItems",static:!1,private:!1,access:{has:e=>"totalItems"in e,get:e=>e.totalItems,set:(e,t)=>{e.totalItems=t}},metadata:e},jt,Pt),y(null,null,z,{kind:"field",name:"pageSizes",static:!1,private:!1,access:{has:e=>"pageSizes"in e,get:e=>e.pageSizes,set:(e,t)=>{e.pageSizes=t}},metadata:e},Nt,Ht),y(null,null,$,{kind:"field",name:"searchDebounce",static:!1,private:!1,access:{has:e=>"searchDebounce"in e,get:e=>e.searchDebounce,set:(e,t)=>{e.searchDebounce=t}},metadata:e},qt,_t),y(null,null,F,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:e},Gt,Kt),y(null,null,I,{kind:"field",name:"data",static:!1,private:!1,access:{has:e=>"data"in e,get:e=>e.data,set:(e,t)=>{e.data=t}},metadata:e},Wt,Ut),y(null,null,T,{kind:"field",name:"mode",static:!1,private:!1,access:{has:e=>"mode"in e,get:e=>e.mode,set:(e,t)=>{e.mode=t}},metadata:e},Zt,Yt),y(null,null,L,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:e=>"currentSort"in e,get:e=>e.currentSort,set:(e,t)=>{e.currentSort=t}},metadata:e},Jt,Qt),y(null,null,V,{kind:"field",name:"selector",static:!1,private:!1,access:{has:e=>"selector"in e,get:e=>e.selector,set:(e,t)=>{e.selector=t}},metadata:e},Xt,ei),y(null,null,B,{kind:"field",name:"selectorOptions",static:!1,private:!1,access:{has:e=>"selectorOptions"in e,get:e=>e.selectorOptions,set:(e,t)=>{e.selectorOptions=t}},metadata:e},ti,ii),y(null,null,O,{kind:"field",name:"loading",static:!1,private:!1,access:{has:e=>"loading"in e,get:e=>e.loading,set:(e,t)=>{e.loading=t}},metadata:e},ai,si),y(null,null,j,{kind:"field",name:"virtualize",static:!1,private:!1,access:{has:e=>"virtualize"in e,get:e=>e.virtualize,set:(e,t)=>{e.virtualize=t}},metadata:e},ni,li),y(null,null,P,{kind:"field",name:"rowHeight",static:!1,private:!1,access:{has:e=>"rowHeight"in e,get:e=>e.rowHeight,set:(e,t)=>{e.rowHeight=t}},metadata:e},ri,oi),y(null,null,N,{kind:"field",name:"virtualBuffer",static:!1,private:!1,access:{has:e=>"virtualBuffer"in e,get:e=>e.virtualBuffer,set:(e,t)=>{e.virtualBuffer=t}},metadata:e},ci,di),y(null,null,H,{kind:"field",name:"columnResize",static:!1,private:!1,access:{has:e=>"columnResize"in e,get:e=>e.columnResize,set:(e,t)=>{e.columnResize=t}},metadata:e},hi,ui),y(null,null,q,{kind:"field",name:"editable",static:!1,private:!1,access:{has:e=>"editable"in e,get:e=>e.editable,set:(e,t)=>{e.editable=t}},metadata:e},mi,pi),y(null,null,_,{kind:"field",name:"editMode",static:!1,private:!1,access:{has:e=>"editMode"in e,get:e=>e.editMode,set:(e,t)=>{e.editMode=t}},metadata:e},gi,bi),y(null,null,G,{kind:"field",name:"density",static:!1,private:!1,access:{has:e=>"density"in e,get:e=>e.density,set:(e,t)=>{e.density=t}},metadata:e},fi,vi),y(null,null,K,{kind:"field",name:"headerFilters",static:!1,private:!1,access:{has:e=>"headerFilters"in e,get:e=>e.headerFilters,set:(e,t)=>{e.headerFilters=t}},metadata:e},yi,wi),y(null,null,W,{kind:"field",name:"quickFilter",static:!1,private:!1,access:{has:e=>"quickFilter"in e,get:e=>e.quickFilter,set:(e,t)=>{e.quickFilter=t}},metadata:e},ki,xi),y(null,null,U,{kind:"field",name:"rowReorder",static:!1,private:!1,access:{has:e=>"rowReorder"in e,get:e=>e.rowReorder,set:(e,t)=>{e.rowReorder=t}},metadata:e},Ci,Si),y(null,null,Z,{kind:"field",name:"columnReorder",static:!1,private:!1,access:{has:e=>"columnReorder"in e,get:e=>e.columnReorder,set:(e,t)=>{e.columnReorder=t}},metadata:e},Ei,Di),y(null,null,Y,{kind:"field",name:"columnMenu",static:!1,private:!1,access:{has:e=>"columnMenu"in e,get:e=>e.columnMenu,set:(e,t)=>{e.columnMenu=t}},metadata:e},Ai,Ri),y(null,null,J,{kind:"field",name:"lazyLoad",static:!1,private:!1,access:{has:e=>"lazyLoad"in e,get:e=>e.lazyLoad,set:(e,t)=>{e.lazyLoad=t}},metadata:e},Mi,zi),y(null,null,Q,{kind:"field",name:"lazyLoadThreshold",static:!1,private:!1,access:{has:e=>"lazyLoadThreshold"in e,get:e=>e.lazyLoadThreshold,set:(e,t)=>{e.lazyLoadThreshold=t}},metadata:e},$i,Fi),y(null,null,X,{kind:"field",name:"selectedRows",static:!1,private:!1,access:{has:e=>"selectedRows"in e,get:e=>e.selectedRows,set:(e,t)=>{e.selectedRows=t}},metadata:e},Ii,Ti),y(null,null,ee,{kind:"field",name:"selectionMode",static:!1,private:!1,access:{has:e=>"selectionMode"in e,get:e=>e.selectionMode,set:(e,t)=>{e.selectionMode=t}},metadata:e},Li,Vi),y(null,null,te,{kind:"field",name:"groupBy",static:!1,private:!1,access:{has:e=>"groupBy"in e,get:e=>e.groupBy,set:(e,t)=>{e.groupBy=t}},metadata:e},Bi,Oi),y(null,null,ie,{kind:"field",name:"groupDefaults",static:!1,private:!1,access:{has:e=>"groupDefaults"in e,get:e=>e.groupDefaults,set:(e,t)=>{e.groupDefaults=t}},metadata:e},ji,Pi),y(null,null,ae,{kind:"field",name:"table",static:!1,private:!1,access:{has:e=>"table"in e,get:e=>e.table,set:(e,t)=>{e.table=t}},metadata:e},Ni,Hi),y(null,null,se,{kind:"field",name:"thead",static:!1,private:!1,access:{has:e=>"thead"in e,get:e=>e.thead,set:(e,t)=>{e.thead=t}},metadata:e},qi,_i),y(null,null,ne,{kind:"field",name:"tbody",static:!1,private:!1,access:{has:e=>"tbody"in e,get:e=>e.tbody,set:(e,t)=>{e.tbody=t}},metadata:e},Gi,Ki),y(null,t={value:a},ht,{kind:"class",name:a.name,metadata:e},null,ut),Wi=a=t.value,e&&Object.defineProperty(a,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e})}setColumns(e){this.columns=e}setData(e){this.settingDataImperative=!0,this.data=e,this.settingDataImperative=!1}async*getTableConfig(){const e=await(yield{});return this.columns=e.columns||[],this.selectorOptions=e.selectorOptions||[],await new Promise(e=>requestAnimationFrame(e)),this.renderHeader(),this.renderControls(),e}async*getTableData(){const e=++this.dataRequestSeq;this.loading=!0,this.selectedRows=[];try{const t={search:this.searchText,sort:this.currentSort,filter:this.filterEngine.getFilterModel(),selector:this.selector};this.pagination&&(t.page=this.currentPage,t.pageSize=this.pageSize);const i=await(yield t);if(e!==this.dataRequestSeq)return;if(this.data=i.data||[],this.rebuildRowIndex(),void 0!==i.totalItems&&(this.totalItems=i.totalItems),this.loadError=null,this.classList.remove("table--error"),this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),e!==this.dataRequestSeq)return;return this.renderBody(),i}catch(t){if(e!==this.dataRequestSeq)return;console.error("Error loading table data:",t),this.loadError=t instanceof Error?t.message:String(t),this.classList.add("table--error"),this.dispatchLoadError(t),this.loading=!1,await new Promise(e=>requestAnimationFrame(e)),this.renderBody()}}scheduleRender(e){"header"!==e&&"both"!==e||(this.pendingHeaderRender=!0),"body"!==e&&"both"!==e||(this.pendingBodyRender=!0),this.renderQueued||(this.renderQueued=!0,queueMicrotask(()=>{queueMicrotask(()=>{this.renderQueued=!1;const e=this.pendingHeaderRender,t=this.pendingBodyRender;this.pendingHeaderRender=!1,this.pendingBodyRender=!1,e&&this.renderHeader(),t&&this.renderBody()})}))}debouncedDataRequest(){this.loading||(this.loading=!0),this.dataRequestTimeout&&clearTimeout(this.dataRequestTimeout),this.dataRequestTimeout=setTimeout(()=>{this.getTableData(),this.dataRequestTimeout=null},150)}styles(){return m`
|
|
586
586
|
:host {
|
|
587
587
|
display: block;
|
|
588
588
|
position: relative;
|
|
@@ -1624,5 +1624,66 @@ import{html as e,unsafeHTML as t,element as i,state as a,property as s,query as
|
|
|
1624
1624
|
</div>
|
|
1625
1625
|
<div class="table-pagination-container"></div>
|
|
1626
1626
|
</div>
|
|
1627
|
-
`}renderControls(){const e=this.shadowRoot?.querySelector(".table-controls-container");if(!e)return;if(this.toolbarOptions)return void this.setToolbar(this.toolbarOptions);if(!(this.searchable||this.filterable||this.quickFilter))return void(e.innerHTML="");e.innerHTML="";const t=document.createElement("div");if(t.className="table-controls",t.setAttribute("part","controls"),this.quickFilter){const e=document.createElement("snice-input");e.className="quick-filter-input",e.type="search",e.placeholder="Quick filter...",e.size="small",e.clearable=!0,e.style.width="16rem",e.style.maxWidth="16rem",e.value=this.filterEngine.getFilterModel().quickFilter||"",e.addEventListener("input",this.handleQuickFilterInput),t.appendChild(e)}else if(this.searchable){const e=document.createElement("snice-input");e.className="search-input",e.setAttribute("type","search"),e.setAttribute("placeholder","Search..."),e.setAttribute("size","small"),e.style.width="16rem",e.style.maxWidth="16rem",e.style.flex="0 0 auto",e.addEventListener("input",this.handleSearchInput),t.appendChild(e)}if(this.filterable){const e=document.createElement("snice-select");e.className="selector-input",e.setAttribute("multiple",""),e.setAttribute("searchable",""),e.setAttribute("clearable",""),e.setAttribute("placeholder","Filter..."),e.setAttribute("size","medium"),this.selectorOptions.forEach(t=>{const i=document.createElement("snice-option");i.setAttribute("value",t.value),i.textContent=t.label,e.appendChild(i)}),t.appendChild(e)}e.appendChild(t)}async initialize(){this.addEventListener("controller-attached",this.onAttached),this.addEventListener("select-change",this.handleSelectorChange),this.addEventListener("row-select",this.handleSlottedRowSelect),this.addEventListener("detail-toggle",()=>this.renderBody()),this.addEventListener("cell-edit-commit",e=>{const{rowIndex:t,columnKey:i,newValue:a}=e.detail,s=this.data[t];s&&(s[i]=a),this.invalidateFilteredCache(),s&&this.invalidateRenderedRow(s)}),this.addEventListener("row-edit-commit",e=>{const{rowIndex:t,newRow:i}=e.detail;this.data[t]&&(this.data[t]=i),this.rebuildRowIndex()}),await customElements.whenDefined("snice-column"),await customElements.whenDefined("snice-row"),await this.processSlottedContent(),await this.rendered,this.syncGrouping(),this.renderControls(),this.initializeModules(),this.initColumnMenu(),this.rowReorder&&this.rowDnD.attach(this),this.columnReorder&&this.columnDnD.attach(this),this.renderHeader(),this.renderBody(),this.virtualize&&requestAnimationFrame(()=>{this.virtualizer.isEnabled()||this.setupVirtualization()}),this.lazyLoad&&requestAnimationFrame(()=>this.setupLazyLoading()),this.addEventListener("row-reorder",e=>{const{fromIndex:t,toIndex:i}=e.detail;if(!Number.isInteger(t)||!Number.isInteger(i)||t<0||i<0||t>=this.data.length||i>=this.data.length)return;if(t===i)return;const a=this.selectedRows.map(e=>this.data[e]).filter(e=>void 0!==e),s=Array.from(this.masterDetail.getExpandedRows()).map(e=>this.data[e]).filter(e=>void 0!==e),n=this.data.splice(t,1)[0],l=this.data[i>t?i-1:i];if(n&&l&&this.grouping.hasGrouping())for(const e of this.grouping.getGroupByKeys())n[e]=l[e];this.data.splice(i,0,n),this.data=[...this.data],this.selectedRows=a.map(e=>this.indexOfRow(e)).filter(e=>e>=0),this.masterDetail.setExpandedRows(s.map(e=>this.indexOfRow(e)).filter(e=>e>=0))}),this.addEventListener("column-reorder",e=>{const{fromKey:t,toKey:i}=e.detail,a=this.columns.findIndex(e=>e.key===t),s=this.columnManager.getVisibleColumns().findIndex(e=>e.key===i);a>=0&&s>=0&&(this.columnManager.moveColumn(t,s),this.renderHeader(),this.renderBody())}),this.addEventListener("tree-toggle",()=>this.renderBody())}async processSlottedContent(){const e=Array.from(this.querySelectorAll('snice-column[slot="columns"]')),t=Array.from(this.querySelectorAll('snice-row[slot="rows"]'));await Promise.all(t.map(e=>e.ready)),e.length>0&&(this.columns=e.map(e=>e.getColumnDefinition())),t.forEach((e,t)=>{e.columns=this.columns,e.index=t,e.hoverable=this.hoverable,e.clickable=this.clickable}),this.syncSlottedSelectionState(),this.shouldModelSlottedRows()&&this.syncSlottedRowsIntoData(),e.length>0&&!this.shouldModelSlottedRows()&&requestAnimationFrame(()=>this.renderSlottedHeader())}shouldModelSlottedRows(){return(Array.isArray(this.groupBy)?this.groupBy:this.groupBy?[this.groupBy]:[]).some(Boolean)||this.columns.some(e=>null!=e.aggregate)}syncSlottedRowsIntoData(){const e=Array.from(this.querySelectorAll('snice-row[slot="rows"]'));if(0===e.length)return;const t=e.map(e=>{if(e.data&&Object.keys(e.data).length>0)return e.data;const t=e.getAttribute("data");if(t)try{return JSON.parse(t)}catch{}return e.data??{}});this.data=t}renderSlottedHeader(){const e=this.shadowRoot?.querySelector("#slotted-header");if(e&&0!==this.columns.length){e.replaceChildren();for(const t of this.columns){const i=document.createElement("div");i.className="header-cell",i.textContent=t.label??t.key,e.appendChild(i)}}}handleDeclarativeColumnChange(){const e=Array.from(this.querySelectorAll('snice-column[slot="columns"]'));0!==e.length&&(this.columns=e.map(e=>e.getColumnDefinition()),Array.from(this.querySelectorAll('snice-row[slot="rows"]')).forEach(e=>{e.columns=this.columns}),requestAnimationFrame(()=>{this.shouldModelSlottedRows()||this.renderSlottedHeader(),this.renderControls()}))}handleSelectorOptionsChange(){0===this.selectorOptions.length?this.classList.add("selector-options-empty"):this.classList.remove("selector-options-empty")}handleSortableChange(){this.renderHeader()}handleSelectableChange(){this.render(),queueMicrotask(()=>this.syncSlottedSelectionState())}handleColumnsAssignment(){this.renderedRows=new Map,this.columns.length>0&&this.columnManager.initialize(this.columns,this),this.grouping.setColumns(this.columns),this.invalidateGroupingCache();const e=!!this.querySelector('snice-row[slot="rows"]'),t=this.shouldModelSlottedRows();e&&this.virtualizer.isEnabled()&&!!this.shadowRoot?.querySelector("table")!==t&&this.virtualizer.detach(),t&&this.syncSlottedRowsIntoData(),e&&requestAnimationFrame(()=>{t||this.renderSlottedHeader(),this.renderControls(),this.toolbarOptions&&this.setToolbar(this.toolbarOptions),this.lazyLoad&&this.setupLazyLoading()}),this.scheduleRender("both")}handleGroupByChange(){this.syncGrouping();const e=!!this.querySelector('snice-row[slot="rows"]'),t=this.shouldModelSlottedRows();e&&this.virtualizer.isEnabled()&&!!this.shadowRoot?.querySelector("table")!==t&&this.virtualizer.detach(),t&&this.syncSlottedRowsIntoData(),e&&requestAnimationFrame(()=>{t||this.renderSlottedHeader(),this.renderControls(),this.toolbarOptions&&this.setToolbar(this.toolbarOptions),this.lazyLoad&&this.setupLazyLoading()}),this.scheduleRender(e?"both":"body")}syncGrouping(){const e=Array.isArray(this.groupBy)?this.groupBy.filter(Boolean):this.groupBy?[this.groupBy]:[];this.grouping.configure({groupBy:e,defaultExpanded:!1!==this.groupDefaults?.expanded}),this.grouping.setColumns(this.columns),this.invalidateGroupingCache()}handleDataAssignment(){this.settingSortedData||(this.unsortedData=[...this.data],this.rebuildRowIndex(),this.masterDetail.prepare(this.data),this.settingDataImperative||this.scheduleRender("body"))}handleDataChange(){this.renderBody()}handleSelectedRowsChange(e,t){const i=new Set(e??[]),a=new Set(t??this.selectedRows??[]),s=new Set;for(const e of i)a.has(e)||s.add(e);for(const e of a)i.has(e)||s.add(e);for(const e of s)this.updateRowSelectionStateFor(e,a.has(e));this.updateSelectAllState(),this.updateGroupSelectionStates()}handleSelectionModeChange(){"none"===this.selectionMode?(this.selectedRows=[],this.selectionAnchor=null):"single"===this.selectionMode&&this.selectedRows.length>1&&(this.selectedRows=this.selectedRows.slice(0,1),this.selectionAnchor=this.data[this.selectedRows[0]]??null),this.syncSlottedSelectionState(),this.scheduleRender("both")}handleSortChange(){this.renderHeader()}handleControlsChange(){this.renderControls(),this.quickFilter&&this.scheduleRender("body")}handleControlledSort(){"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()}handleCurrentPageChange(){"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.scheduleRender("body")}handlePageSizeChange(){this.currentPage=1,"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.scheduleRender("body")}handleDensityChange(){this.scheduleRender("body"),this.dispatchDensityChange()}handleListChange(){this.renderedRows=new Map,this.scheduleRender("body")}handleEditableChange(){this.editable&&this.setupEditor(),this.scheduleRender("body")}handleEditModeChange(){this.editable&&this.editor.setEditMode(this.editMode),this.scheduleRender("body")}handleVirtualizeChange(){this.virtualize||this.virtualizer.detach(),this.scheduleRender("body")}handleRowHeightChange(){this.scheduleRender("body")}handleColumnResizeChange(){this.scheduleRender("header")}handleHeaderFiltersChange(){this.scheduleRender("header")}handleRowReorderChange(){this.rowReorder?this.rowDnD.attach(this):this.rowDnD.detach(),this.scheduleRender("both")}handleColumnReorderChange(){this.columnReorder?this.columnDnD.attach(this):this.columnDnD.detach(),this.scheduleRender("header")}handleLazyLoadChange(){this.lazyLoad?queueMicrotask(()=>this.setupLazyLoading()):(this.lazyLoadHandler&&this.lazyLoadContainer?.removeEventListener("scroll",this.lazyLoadHandler),this.lazyLoadHandler=null,this.lazyLoadContainer=null)}handleColumnMenuChange(){this.columnMenu&&this.initColumnMenu(),this.scheduleRender("header")}getVisibleColumnDefinitions(){if(0===this.columnManager.getAllStates().length)return this.columns;const e=[...this.columnManager.getPinnedLeft(),...this.columnManager.getUnpinned(),...this.columnManager.getPinnedRight()],t=new Map(this.columns.map(e=>[e.key,e]));return e.map(e=>t.get(e.key)).filter(e=>!!e)}renderHeader(){if(!this.thead)return;const e=document.createElement("tr");if(e.className="column-header-row",this.rowReorder&&this.rowDnD.isEnabled()){const t=document.createElement("th");t.setAttribute("scope","col"),t.className="drag-handle-cell",e.appendChild(t)}if(this.masterDetail.isEnabled()){const t=document.createElement("th");t.setAttribute("scope","col"),t.className="detail-toggle-cell",e.appendChild(t)}if(this.hasSelectionColumn()){const t=document.createElement("th");if(t.setAttribute("scope","col"),t.className="select-column","multiple"===this.selectionMode){const e=this.getSelectableIndices(this.getFilteredData()),i=e.filter(e=>this.selectedRows.includes(e)),a=i.length>0&&i.length<e.length;t.innerHTML=`<snice-checkbox class="select-all" size="small" compact ${i.length===e.length&&e.length>0?"checked":""}></snice-checkbox>`,setTimeout(()=>{const e=t.querySelector(".select-all");e&&(e.indeterminate=a)},0)}else t.setAttribute("aria-label","Select one row");e.appendChild(t)}const t=this.getVisibleColumnDefinitions();if(t.forEach(t=>{const i=document.createElement("th");if(i.setAttribute("data-key",t.key),i.setAttribute("scope","col"),this.sortable&&!1!==t.sortable){const e=this.currentSort.find(e=>e.column===t.key);i.setAttribute("aria-sort","asc"===e?.direction?"ascending":"desc"===e?.direction?"descending":"none")}const a=this.columnManager.getState(t.key);if(a)if(i.style.width=`${a.width}px`,"left"===a.pinned){const e=this.columnManager.getPinnedLeftOffsets();i.classList.add("pinned-cell"),i.style.position="sticky",i.style.left=`${e.get(t.key)??0}px`,i.style.zIndex="2"}else if("right"===a.pinned){const e=this.columnManager.getPinnedRightOffsets();i.classList.add("pinned-cell"),i.style.position="sticky",i.style.right=`${e.get(t.key)??0}px`,i.style.zIndex="2"}if(this.sortable&&!1!==t.sortable?(i.classList.add("sortable"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",`Sort by ${t.label}`),i.innerHTML=this.renderSortableHeader(t)):i.textContent=t.label,this.filterEngine.hasColumnFilter(t.key)&&i.classList.add("filtered"),this.columnResize&&!1!==t.resizable){const e=document.createElement("span");e.className="resize-handle",e.addEventListener("mousedown",e=>{e.stopPropagation(),this.columnManager.startResize(t.key,e.clientX)}),e.addEventListener("dblclick",e=>{e.stopPropagation(),this.tbody&&(this.columnManager.autoSizeColumn(t.key,this.tbody),this.renderHeader(),this.renderBody())}),i.appendChild(e)}this.columnMenu&&i.addEventListener("contextmenu",e=>{e.preventDefault();const i=this.columnManager.getState(t.key);this.columnMenuManager.show(t.key,e.clientX,e.clientY,{sortable:this.sortable&&!1!==t.sortable,filterable:!1!==t.filterable,hideable:i?.hideable,pinnable:i?.pinnable,pinned:i?.pinned})}),this.columnReorder&&this.columnDnD.isEnabled()&&this.columnDnD.makeHeaderDraggable(i,t.key,!1!==t.reorderable&&!a?.pinned),e.appendChild(i)}),this.thead.innerHTML="",this.columnManager.getColumnGroups().length>0){const e=document.createElement("tr");e.className="column-group-row";const i=[this.rowReorder&&this.rowDnD.isEnabled()?"drag-handle-cell":"",this.masterDetail.isEnabled()?"detail-toggle-cell":"",this.hasSelectionColumn()?"select-column":""].filter(Boolean);for(const t of i){const i=document.createElement("th");i.className=t,i.setAttribute("aria-hidden","true"),e.appendChild(i)}const a=document.createElement("template");a.innerHTML=this.columnManager.renderGroupHeaders(t.map(e=>e.key)),e.appendChild(a.content),this.thead.appendChild(e)}if(this.thead.appendChild(e),this.headerFilters){const e=document.createElement("tr");if(e.className="header-filter-row",this.rowReorder&&this.rowDnD.isEnabled()){const t=document.createElement("td");t.className="drag-handle-cell",e.appendChild(t)}if(this.masterDetail.isEnabled()){const t=document.createElement("td");t.className="detail-toggle-cell",e.appendChild(t)}if(this.hasSelectionColumn()){const t=document.createElement("td");t.className="select-column",e.appendChild(t)}t.forEach(t=>{const i=document.createElement("td"),a=document.createElement("snice-input");a.size="small",a.placeholder=`Filter ${t.label}...`,a.setAttribute("data-column",t.key),a.value=this.filterEngine.getHeaderFilter(t.key),a.style.cssText="width:100%;--snice-color-border:transparent;--snice-border-radius-md:0;",a.addEventListener("input",()=>{this.filterEngine.setHeaderFilter(t.key,a.value),this.debouncedApplyClientFilters()}),i.appendChild(a),e.appendChild(i)}),this.thead.appendChild(e)}}renderSortableHeader(e){const t=this.currentSort.find(t=>t.column===e.key),i=this.currentSort.findIndex(t=>t.column===e.key),a='<svg width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1 5l4-4 4 4"/></svg>',s='<svg width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1 1l4 4 4-4"/></svg>';let n=`<span style="display:flex;flex-direction:column;gap:0;opacity:0.3">${a}${s}</span>`,l="";t&&("asc"===t.direction?n=a:"desc"===t.direction&&(n=s),this.currentSort.length>1&&(l=`<span class="sort-order">${i+1}</span>`));const r=["sort-indicator",t?"active":""].filter(Boolean).join(" ");return`\n <div class="sort-header">\n <span>${e.label}</span>\n <div class="${r}">\n ${n}\n ${l}\n </div>\n </div>\n `}renderBody(){if(!this.tbody)return;if(this.columns.length>0&&this.columnManager.initialize(this.columns,this),this.grouping.setColumns(this.columns)&&this.invalidateGroupingCache(),this.pagination&&"client"===this.paginationMode&&(this.usesGroupingDisplayModel()?this.totalItems=this.getGroupingItems().length:this.treeData.isEnabled()&&(this.totalItems=this.getTreeDisplayRows(!1).length)),this.virtualize&&!this.virtualizer.isEnabled()&&this.setupVirtualization(),this.virtualize&&this.virtualizer.isEnabled())return this.virtualRowsSnapshot=this.getVirtualRows(),this.virtualizer.setTotalRows(this.virtualRowsSnapshot.length),void(this.pagination&&this.renderPagination());if(0===this.data.length&&this.columns.length>0){this.tbody.innerHTML="",this.renderedRows=new Map;const e=(this.hasSelectionColumn()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),t=this.columns.length+e;if(this.loading){const e=document.createElement("tr"),i=document.createElement("td");return i.colSpan=t,i.className="no-data",i.innerHTML='<snice-progress variant="circular" indeterminate size="small"></snice-progress>',e.appendChild(i),void this.tbody.appendChild(e)}if(this.loadError){const e=document.createElement("tr"),i=document.createElement("td");i.colSpan=t,i.className="no-data";const a=document.createElement("div");return a.className="table-error-message",a.textContent=`⚠️ ${this.loadError}`,i.appendChild(a),e.appendChild(i),void this.tbody.appendChild(e)}{const e=document.createElement("tr"),i=document.createElement("td");i.colSpan=t,i.className="no-data";const a=this.querySelector('[slot="empty-state"]');if(a)i.appendChild(a.cloneNode(!0));else{const e=document.createElement("snice-empty-state");e.setAttribute("size","small"),e.setAttribute("icon","📭"),e.setAttribute("title","No data"),e.setAttribute("description","No records to display."),i.appendChild(e)}return e.appendChild(i),void this.tbody.appendChild(e)}}const e=this.getFilteredData();let t=e;if(this.pagination&&"client"===this.paginationMode&&!this.usesGroupingDisplayModel()&&!this.treeData.isEnabled()){this.totalItems=e.length;const i=(this.currentPage-1)*this.pageSize;t=e.slice(i,i+this.pageSize)}const i=(this.hasSelectionColumn()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),a=(this.columnManager.getAllStates().length>0?this.columnManager.getVisibleColumns().length:this.columns.length)+i,s=this.computeStructuralSig(),n=[];if(this.pinnedTopRows.forEach((e,t)=>{n.push({key:`__pinned_top_${t}`,sig:"pinned",alwaysRebuild:!0,create:()=>{const t=this.createRow(e,-1);return t.classList.add("pinned-row","pinned-row--top"),t}})}),this.usesGroupingDisplayModel()){const e=this.getDisplayedGroupingItems();for(const t of e)if("group"===t.type)n.push({key:t.key,sig:`${s}|grp:${t.key}:${t.expanded?1:0}:${t.count}`,alwaysRebuild:!0,create:()=>this.createGroupRow(t,a)});else if("aggregate"===t.type)n.push({key:t.key,sig:`${s}|agg:${t.key}`,alwaysRebuild:!0,create:()=>this.createAggregateRow(t,a)});else{const e=this.indexOfRow(t.data),i=this.isRowEditing(e);n.push({key:t.data,sig:this.rowSignature(t.data,e,s)+(i?"|edit":""),alwaysRebuild:i,restampIndex:e,create:()=>this.createRow(t.data,e)}),this.masterDetail.isEnabled()&&this.masterDetail.isExpanded(e)&&n.push({key:`__detail_${e}`,sig:"detail",alwaysRebuild:!0,create:()=>this.masterDetail.createDetailRow(t.data,e,a)??document.createElement("tr")})}}else this.treeData.isEnabled()?this.getTreeDisplayRows(!0).forEach(({data:e,index:t,treeRow:i,groupItem:l})=>{if("aggregate"===l?.type)return void n.push({key:l.key,sig:`${s}|agg:${l.key}`,alwaysRebuild:!0,create:()=>this.createAggregateRow(l,a)});if(!i)return;const r=this.isRowEditing(t);n.push({key:e,sig:this.rowSignature(e,t,s,i)+(r?"|edit":""),alwaysRebuild:r,restampIndex:t,create:()=>this.createRow(e,t,i)})}):t.forEach(e=>{const t=this.indexOfRow(e),i=this.isRowEditing(t);n.push({key:e,sig:this.rowSignature(e,t,s)+(i?"|edit":""),alwaysRebuild:i,restampIndex:t,create:()=>this.createRow(e,t)}),this.masterDetail.isEnabled()&&this.masterDetail.isExpanded(t)&&n.push({key:`__detail_${t}`,sig:"detail",alwaysRebuild:!0,create:()=>this.masterDetail.createDetailRow(e,t,a)??document.createElement("tr")})});this.pinnedBottomRows.forEach((e,t)=>{n.push({key:`__pinned_bottom_${t}`,sig:"pinned",alwaysRebuild:!0,create:()=>{const t=this.createRow(e,-1);return t.classList.add("pinned-row","pinned-row--bottom"),t}})}),this.reconcileRows(n),this.keyboard.refresh(),this.pagination&&this.renderPagination()}reconcileRows(e){const t=this.tbody;if(!t)return;const i=new Map,a=[],s=new Set;for(const t of e){const e=this.renderedRows.get(t.key);let n;!e||s.has(e.el)||t.alwaysRebuild||e.sig!==t.sig?n=t.create():(n=e.el,void 0!==t.restampIndex&&this.restampRowIndex(n,t.restampIndex)),s.add(n),a.push(n),i.has(t.key)||i.set(t.key,{el:n,sig:t.sig})}const n=new Set(a);for(const e of Array.from(t.children))n.has(e)||e.remove();let l=t.firstChild;for(const e of a)if(e===l)l=e.nextSibling;else{const i=document.createDocumentFragment();i.appendChild(e),t.insertBefore(i,l)}this.renderedRows=i}rendererIdFor(e){if("function"!=typeof e)return"";let t=this.rendererIds.get(e);return void 0===t&&(t=++this.rendererIdSeq,this.rendererIds.set(e,t)),String(t)}computeStructuralSig(){const e=this.getVisibleColumnDefinitions().map(e=>{const t=this.columnManager.getState(e.key),i=this.rendererIdFor(e.renderCell);return`${e.key}:${t?.width??""}:${t?.pinned??""}:rc${i}`});return[e.join(","),`pl=${Array.from(this.columnManager.getPinnedLeftOffsets().values()).join("/")}`,`pr=${Array.from(this.columnManager.getPinnedRightOffsets().values()).join("/")}`,`sel=${this.selectable?this.selectionMode:"off"}`,`selectable=${this.rendererIdFor(this.selectabilityCheck)}`,"md="+(this.masterDetail.isEnabled()?1:0),"rr="+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),`rh=${this.rowHeight}`,`d=${this.density}`,`tree=${this.treeData.isEnabled()?this.treeData.getGroupColumn():""}`].join("|")}rowSignature(e,t,i,a){const s=[i];return a&&s.push(`t:${a.depth}:${a.expanded?1:0}:${a.hasChildren?1:0}`),this.rowHeightCallback&&s.push(`h:${this.rowHeightCallback(e,t)}`),this.masterDetail.isEnabled()&&s.push("detail:"+(this.masterDetail.isExpanded(t)?1:0)),(this.rowReorder&&this.rowDnD.isEnabled()||this.masterDetail.isEnabled())&&s.push(`i:${t}`),s.join("|")}isRowEditing(e){if(!this.editable)return!1;if("row"===this.editMode){const t=this.editor.getRowEditState();return!(!t?.isEditing||t.rowIndex!==e)}const t=this.editor.getCellEditState();return!(!t?.isEditing||t.rowIndex!==e)}restampRowIndex(e,t){e.setAttribute("data-index",String(t));const i=this.selectedRows.includes(t);e.setAttribute("data-selected",String(i));const a=e.querySelector("snice-checkbox.row-select");if(a){a.setAttribute("data-row-index",String(t)),a.checked=i;const e=!(!this.selectabilityCheck||this.selectabilityCheck(this.data[t],t));a.disabled=e,a.toggleAttribute("disabled",e)}}invalidateRenderedRow(e){this.renderedRows.delete(e)}paginationTotal(){return"client"!==this.paginationMode?this.totalItems:this.usesGroupingDisplayModel()?this.getGroupingItems().length:this.treeData.isEnabled()?this.getTreeDisplayRows(!1).length:this.data.length}get totalPages(){const e=this.paginationTotal();return Math.max(1,Math.ceil(e/this.pageSize))}goToPage(e){const t=Math.max(1,Math.min(e,this.totalPages));t!==this.currentPage&&(this.currentPage=t,"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.renderBody(),this.dispatchPageChange())}setPageSize(e){this.pageSize=e,this.currentPage=1,"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.renderBody(),this.dispatchPageChange()}dispatchPageChange(){return{page:this.currentPage,pageSize:this.pageSize,totalPages:this.totalPages,totalItems:this.paginationTotal()}}renderPagination(){const e=this.shadowRoot?.querySelector(".table-pagination-container");if(!e)return;if(!this.pagination)return void(e.innerHTML="");const t=this.paginationTotal(),i=this.totalPages,a=Math.min((this.currentPage-1)*this.pageSize+1,t),s=Math.min(this.currentPage*this.pageSize,t),n=[];if(i<=7)for(let e=1;e<=i;e++)n.push(this.pageButton(e));else{n.push(this.pageButton(1)),this.currentPage>3&&n.push('<span class="pagination__ellipsis">…</span>');const e=Math.max(2,this.currentPage-1),t=Math.min(i-1,this.currentPage+1);for(let i=e;i<=t;i++)n.push(this.pageButton(i));this.currentPage<i-2&&n.push('<span class="pagination__ellipsis">…</span>'),n.push(this.pageButton(i))}e.innerHTML="";const l=document.createElement("div");l.className="pagination",l.setAttribute("part","pagination");const r=document.createElement("div");r.className="pagination__info",r.textContent=`Showing ${a}–${s} of ${t}`,l.appendChild(r);const o=document.createElement("div");o.className="pagination__controls",o.innerHTML=`\n <button class="pagination__btn pagination__first" ${this.currentPage<=1?"disabled":""} data-page="1" aria-label="First page">⟨⟨</button>\n <button class="pagination__btn pagination__prev" ${this.currentPage<=1?"disabled":""} data-page="${this.currentPage-1}" aria-label="Previous page">⟨</button>\n ${n.join("")}\n <button class="pagination__btn pagination__next" ${this.currentPage>=i?"disabled":""} data-page="${this.currentPage+1}" aria-label="Next page">⟩</button>\n <button class="pagination__btn pagination__last" ${this.currentPage>=i?"disabled":""} data-page="${i}" aria-label="Last page">⟩⟩</button>\n `,l.appendChild(o);const c=document.createElement("div");c.className="pagination__size";const d=document.createElement("label");d.textContent="Rows per page:",c.appendChild(d);const h=document.createElement("snice-select");h.size="small",h.className="pagination__size-select";const u=this.pageSizes.includes(this.pageSize)?this.pageSizes:[...this.pageSizes,this.pageSize].sort((e,t)=>e-t);for(const e of u){const t=document.createElement("snice-option");t.setAttribute("value",String(e)),t.textContent=String(e),e===this.pageSize&&t.setAttribute("selected",""),h.appendChild(t)}h.value=String(this.pageSize),c.appendChild(h),l.appendChild(c),e.appendChild(l),o.querySelectorAll("[data-page]").forEach(e=>{e.addEventListener("click",()=>{const t=parseInt(e.getAttribute("data-page"));this.goToPage(t)})}),h.addEventListener("select-change",e=>{this.setPageSize(parseInt(e.detail.value))})}pageButton(e){return`<button class="pagination__btn pagination__page${e===this.currentPage?" pagination__btn--active":""}" data-page="${e}">${e}</button>`}createCellElement(e,t,i){if("function"==typeof e.renderCell){const a=e.renderCell(t,i,e);if(a instanceof HTMLElement)return a;const s=document.createElement("span");return s.className="custom-cell",s.textContent=null==a?"":String(a),s}const a=this.getCellTagName(e.type),s=document.createElement(a);switch(s.setAttribute("type",e.type||"text"),e.align&&s.setAttribute("align",e.align),s.setAttribute("in-table","true"),"sparkline"===e.type&&null!==t&&"object"==typeof t?(s.setAttribute("value",JSON.stringify(t)),Array.isArray(t)&&(s.data=t)):s.value=t??"",null!==t&&"object"==typeof t||s.setAttribute("value",String(t??"")),s.column=e,s.rowData=i??null,e.type){case"number":case"currency":if(void 0!==e.decimals&&s.setAttribute("decimals",String(e.decimals)),e.thousandsSeparator&&s.setAttribute("thousands-separator","true"),e.prefix&&s.setAttribute("prefix",e.prefix),e.suffix&&s.setAttribute("suffix",e.suffix),"currency"===e.type){const t=e.currencyFormat;t&&(t.currency&&s.setAttribute("currency",t.currency),t.locale&&s.setAttribute("locale",t.locale),(t.display||t.currencyDisplay)&&s.setAttribute("currencydisplay",t.currencyDisplay||t.display),void 0!==t.decimals&&s.setAttribute("decimals",String(t.decimals)),!1===t.thousandsSeparator&&(s.thousandsSeparator=!1))}break;case"date":e.dateFormat&&s.setAttribute("date-format",e.dateFormat);break;case"boolean":e.useSymbols&&s.setAttribute("use-symbols","true"),e.trueSymbol&&s.setAttribute("true-symbol",e.trueSymbol),e.falseSymbol&&s.setAttribute("false-symbol",e.falseSymbol),e.trueValue&&s.setAttribute("true-value",e.trueValue),e.falseValue&&s.setAttribute("false-value",e.falseValue);break;case"sparkline":{const t=e.sparklineFormat;t&&(t.color&&s.setAttribute("color",t.color),t.type&&s.setAttribute("chart-type",t.type),t.width&&s.setAttribute("width",String(t.width)),t.height&&s.setAttribute("height",String(t.height)));break}case"rating":{const t=e.ratingFormat;t&&(t.max&&s.setAttribute("max",String(t.max)),t.color&&s.setAttribute("color",t.color));break}case"progress":{const t=e.progressFormat;t&&(t.max&&s.setAttribute("max",String(t.max)),t.color&&s.setAttribute("color",t.color),t.showPercentage&&s.setAttribute("show-percentage","true"));break}case"percentage":case"percent":{const t=e.percentageFormat;t&&(void 0!==t.decimals&&s.setAttribute("decimals",String(t.decimals)),t.colorize&&s.setAttribute("colorize","true"));break}case"status":{const t=e.statusFormat;t&&(t.variant&&s.setAttribute("variant",t.variant),t.showDot&&s.setAttribute("show-dot","true"));break}case"link":{const t=e.linkFormat;t&&(t.target&&s.setAttribute("target",t.target),t.external&&s.setAttribute("external","true"));break}case"image":{const t=e.imageFormat;t&&(t.shape&&s.setAttribute("shape",t.shape),t.size&&s.setAttribute("size",t.size));break}case"color":{const t=e.colorFormat;t&&(!1!==t.showSwatch&&s.setAttribute("show-swatch","true"),t.displayFormat&&s.setAttribute("display-format",t.displayFormat));break}case"email":{const t=e.emailFormat;t&&t.showIcon&&s.setAttribute("show-icon","true");break}case"phone":{const t=e.phoneFormat;t&&(t.showIcon&&s.setAttribute("show-icon","true"),t.format&&s.setAttribute("format","true"));break}}return s}getCellTagName(e){switch(e){case"text":return"snice-cell-text";case"number":return"snice-cell-number";case"currency":return"snice-cell-currency";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"sparkline":return"snice-cell-sparkline";case"image":return"snice-cell-image";case"percentage":case"percent":return"snice-cell-percentage";case"tag":return"snice-cell-tag";case"status":return"snice-cell-status";case"actions":return"snice-cell-actions";case"link":return"snice-cell-link";case"email":return"snice-cell-email";case"phone":return"snice-cell-phone";case"color":return"snice-cell-color";case"location":return"snice-cell-location";case"json":return"snice-cell-json";default:return"snice-cell"}}updateRowSelectionState(){this.tbody&&this.tbody.querySelectorAll("tr").forEach((e,t)=>{const i=this.selectedRows.includes(t);e.setAttribute("data-selected",String(i));const a=e.querySelector("snice-checkbox.row-select");a&&(a.checked=i)})}updateRowSelectionStateFor(e,t){if(!this.tbody)return;const i=this.tbody.querySelector(`tr[data-index="${e}"]`);if(!i)return;i.setAttribute("data-selected",String(t));const a=i.querySelector("snice-checkbox.row-select");a&&(a.checked=t)}updateSelectAllState(){const e=this.thead?.querySelector("snice-checkbox.select-all");if(!e)return;const t=this.getSelectableIndices(this.getFilteredData()),i=t.filter(e=>this.selectedRows.includes(e)),a=i.length>0&&i.length<t.length;e.checked=i.length===t.length&&t.length>0,e.indeterminate=a}toggleSort(e,t=!1){if(t){const t=this.currentSort.findIndex(t=>t.column===e);this.currentSort=-1===t?[...this.currentSort,{column:e,direction:"asc"}]:"asc"===this.currentSort[t].direction?this.currentSort.map((e,i)=>i===t?{...e,direction:"desc"}:e):this.currentSort.filter(t=>t.column!==e)}else{const t=this.currentSort.find(t=>t.column===e);this.currentSort=t?"asc"===t.direction?[{column:e,direction:"desc"}]:[]:[{column:e,direction:"asc"}]}this.renderHeader(),this.dispatchSortChange(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()}sortLocalData(){this.unsortedData.length||(this.unsortedData=[...this.data]),this.settingSortedData=!0,this.data=0===this.currentSort.length?[...this.unsortedData]:[...this.unsortedData].sort((e,t)=>{for(const{column:i,direction:a}of this.currentSort){const s=this.columns.find(e=>e.key===i),n=s?.sortComparator;if(n){const s=n(e[i],t[i],a);if(0!==s)return s}else{const n=s?.valueGetter?s.valueGetter(e[i],e):e[i]??"",l=s?.valueGetter?s.valueGetter(t[i],t):t[i]??"",r=String(n).localeCompare(String(l),void 0,{numeric:!0});if(0!==r)return"asc"===a?r:-r}}return 0}),this.settingSortedData=!1,this.rebuildRowIndex(),this.scheduleRender("body")}dispatchRowSelectionChanged(e,t){return{selectedRows:this.selectedRows,rowIndex:e,selected:t}}dispatchRowClicked(e,t){return{rowData:e,rowIndex:t}}dispatchLoadError(e){return{error:e}}dispatchSelectAllChanged(e){return{selectedRows:this.selectedRows,allSelected:e}}dispatchSelectionChanged(){return{selectedRows:this.selectedRows,rows:this.getSelectedData()}}dispatchSortChange(){return{sort:this.currentSort}}dispatchFilterChange(){return{filters:this.filterEngine.getFilterModel()}}dispatchColumnVisibilityChange(e,t){return{key:e,visible:t,visibility:this.columnManager.getVisibilityModel()}}dispatchColumnPinChange(e,t){return{key:e,pinned:t}}dispatchColumnOrderChange(e,t){return{key:e,toIndex:t}}dispatchDensityChange(){return{density:this.density}}initializeModules(){this.columnManager.initialize(this.columns,this),this.setupEditor(),this.shadowRoot&&this.keyboard.attach({shadowRoot:this.shadowRoot,totalRows:()=>this.getKeyboardRows().length,ariaRows:()=>this.usesGroupingDisplayModel()?this.getDisplayedGroupingItems().length:this.treeData.isEnabled()?this.getTreeDisplayRows(!0).length:this.getKeyboardRows().length,ariaRowOffset:()=>this.virtualize&&this.virtualizer.isEnabled()?Math.max(0,this.virtualizer.getVisibleRange().start):0,totalColumns:()=>this.getKeyboardColumnCount(),tabMode:"all",isEditing:()=>this.editor.isEditing(),getRowElement:e=>this.getKeyboardRowElement(e),ensureRowVisible:e=>this.ensureKeyboardRowRendered(e),onCellActivate:(e,t)=>{const i=this.getKeyboardDataIndex(e);this.editable&&i>=0&&t&&this.startEdit(i,t)},onSelectionToggle:e=>{const t=this.getKeyboardDataIndex(e);this.selectable&&t>=0&&this.toggleRowSelection(t)},onSelectAll:()=>{this.selectable&&this.selectAllRows()}})}cleanup(){this.virtualizer.detach(),this.keyboard.detach(),this.lazyLoadHandler&&this.lazyLoadContainer?.removeEventListener("scroll",this.lazyLoadHandler),this.lazyLoadHandler=null,this.lazyLoadContainer=null,this.rowDnD.detach(),this.columnDnD.detach()}getScrollContainer(){return this.shadowRoot?.querySelector(".table-frame")??this.shadowRoot?.querySelector(".snice-table")}setupVirtualization(){if(!this.virtualize||!this.shadowRoot||!this.tbody)return;const e=this.getScrollContainer();e&&(this.virtualRowsSnapshot=this.getVirtualRows(),this.virtualizer.attach({rowHeight:e=>this.getVirtualRowHeight(e),bufferPx:this.virtualBuffer,totalRows:this.virtualRowsSnapshot.length,scrollContainer:e,renderRange:(e,t)=>this.renderRowRange(e,t),renderPinnedTop:()=>this.renderPinnedRows(this.pinnedTopRows,"top"),renderPinnedBottom:()=>this.renderPinnedRows(this.pinnedBottomRows,"bottom"),afterRender:()=>this.keyboard.refresh()}))}getVirtualRowHeight(e){const t=this.virtualRowsSnapshot[e];if(!t||t.groupItem&&"row"!==t.groupItem.type)return this.rowHeight;const i=t.groupItem?this.indexOfRow(t.data):t.index;return(this.rowHeightCallback?this.rowHeightCallback(t.data,i):this.rowHeight)+this.masterDetail.getFixedAdditionalHeight(i)}getVirtualRows(){const e=this.getFilteredData();return this.usesGroupingDisplayModel()?this.getDisplayedGroupingItems().map((e,t)=>({data:"row"===e.type?e.data:void 0,index:t,groupItem:e})):this.treeData.isEnabled()?this.getTreeDisplayRows(!0):e.map(e=>({data:e,index:this.indexOfRow(e)}))}renderRowRange(e,t){const i=document.createDocumentFragment(),a=this.virtualRowsSnapshot.length>0?this.virtualRowsSnapshot:this.getVirtualRows(),s=(this.hasSelectionColumn()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),n=(this.columnManager.getAllStates().length>0?this.columnManager.getVisibleColumns().length:this.columns.length)+s,l=this.computeStructuralSig(),r=new Map,o=new Set;for(let s=e;s<t&&s<a.length;s++){const{data:e,index:t,treeRow:c,groupItem:d}=a[s];if(d&&"row"!==d.type){const e="group"===d.type?this.createGroupRow(d,n):this.createAggregateRow(d,n);o.add(e),r.has(d.key)||r.set(d.key,{el:e,sig:"grouprow"}),i.appendChild(e);continue}const h=d?this.indexOfRow(e):t,u=this.isRowEditing(h),m=this.rowSignature(e,h,l,c)+(u?"|edit":""),p=this.renderedRows.get(e);let g;if(!p||o.has(p.el)||u||p.sig!==m?g=this.createRow(e,h,c):(g=p.el,this.restampRowIndex(g,h)),o.add(g),r.has(e)||r.set(e,{el:g,sig:m}),i.appendChild(g),!c&&this.masterDetail.isEnabled()&&this.masterDetail.isExpanded(h)){const t=this.masterDetail.createDetailRow(e,h,n);t&&i.appendChild(t)}}return this.renderedRows=r,i}renderPinnedRows(e,t){const i=document.createDocumentFragment();for(const a of e){const e=this.createRow(a,-1);e.classList.add("pinned-row","top"===t?"pinned-row--top":"pinned-row--bottom"),i.appendChild(e)}return i}scrollToRow(e){if(this.usesGroupingDisplayModel()||this.treeData.isEnabled()){const t=this.data[e],i=this.getVirtualRows().findIndex(e=>e.data===t);return void(i>=0&&this.virtualizer.scrollToIndex(i))}this.virtualizer.scrollToRow(e)}getKeyboardColumnCount(){const e=this.shadowRoot?.querySelectorAll("thead tr.column-header-row > th").length??0;return e>0?e:(this.columnManager.getAllStates().length>0?this.columnManager.getVisibleColumns().length:this.columns.length)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.hasSelectionColumn()?1:0)}getKeyboardRows(){if(this.usesGroupingDisplayModel())return this.getDisplayedGroupingItems().filter(e=>"row"===e.type).map(e=>e.data);if(this.treeData.isEnabled())return this.getTreeDisplayRows(!0).filter(e=>!!e.treeRow).map(e=>e.data);let e=this.getFilteredData();if(this.pagination&&"client"===this.paginationMode){const t=(this.currentPage-1)*this.pageSize;e=e.slice(t,t+this.pageSize)}return e}getKeyboardDataIndex(e){const t=this.getKeyboardRows()[e];return void 0===t?-1:this.indexOfRow(t)}getKeyboardRowElement(e){const t=this.getKeyboardDataIndex(e);return t<0?null:this.tbody?.querySelector(`tr[data-index="${t}"]`)}ensureKeyboardRowRendered(e){if(!this.virtualize||!this.virtualizer.isEnabled())return;if(this.getKeyboardRowElement(e))return;const t=this.getKeyboardRows()[e];if(void 0===t)return;const i=this.getVirtualRows().findIndex(e=>e.data===t);i>=0&&this.virtualizer.scrollToIndex(i)}getScrollPosition(){return this.virtualizer.getScrollPosition()}setColumnFilter(e,t,i){this.filterEngine.setColumnFilter(e,t,i),this.applyClientFilters()}removeColumnFilter(e){this.filterEngine.removeColumnFilter(e),this.applyClientFilters()}setQuickFilter(e){this.filterEngine.setQuickFilter(e),this.applyClientFilters()}setFilterModel(e){this.filterEngine.setFilterModel(e),this.applyClientFilters()}getFilterModel(){return this.filterEngine.getFilterModel()}clearAllFilters(){this.filterEngine.clearAllFilters(),this.applyClientFilters()}getFilteredData(){if(this.ensureRowIndex(),this.filteredCache)return this.filteredCache;const e=this.filterEngine.hasActiveFilters()?this.filterEngine.applyFilters(this.data,this.columns):this.data;return this.filteredCache=e,e}rebuildRowIndex(){this.rowIndexMap.clear();const e=this.data;for(let t=0;t<e.length;t++)this.rowIndexMap.has(e[t])||this.rowIndexMap.set(e[t],t);this.rowIndexDataRef=e,this.filteredCache=null,this.groupingCache=null}ensureRowIndex(){this.rowIndexDataRef!==this.data&&this.rebuildRowIndex()}indexOfRow(e){this.ensureRowIndex();const t=this.rowIndexMap.get(e);return void 0===t?-1:t}invalidateFilteredCache(){this.filteredCache=null,this.groupingCache=null}invalidateGroupingCache(){this.groupingCache=null}getGroupingItems(){return this.grouping.setColumns(this.columns)&&this.invalidateGroupingCache(),this.groupingCache||(this.groupingCache=this.grouping.processData(this.getFilteredData())),this.groupingCache}usesGroupingDisplayModel(){return this.grouping.hasGrouping()||this.grouping.hasAggregation()&&!this.treeData.isEnabled()}getDisplayedGroupingItems(){const e=this.getGroupingItems();if(!this.pagination||"client"!==this.paginationMode)return e;const t=Math.max(1,Math.ceil(e.length/this.pageSize)),i=Math.max(1,Math.min(this.currentPage,t));i!==this.currentPage&&(this.currentPage=i);const a=(i-1)*this.pageSize;return e.slice(a,a+this.pageSize)}getTreeDisplayRows(e){const t=this.treeData.processData(this.getFilteredData()).map(e=>({data:e.data,index:this.indexOfRow(e.data),treeRow:e}));if(this.grouping.hasAggregation()){const e=this.getGroupingItems().find(e=>"aggregate"===e.type&&"table"===e.scope);e&&t.push({data:void 0,index:-1,groupItem:e})}if(!e||!this.pagination||"client"!==this.paginationMode)return t;const i=Math.max(1,Math.ceil(t.length/this.pageSize)),a=Math.max(1,Math.min(this.currentPage,i));a!==this.currentPage&&(this.currentPage=a);const s=(a-1)*this.pageSize;return t.slice(s,s+this.pageSize)}applyClientFilters(){this.invalidateFilteredCache(),this.dispatchFilterChange(),"remote"===this.mode?this.debouncedDataRequest():this.renderBody()}static{this.FILTER_INPUT_DEBOUNCE_MS=150}debouncedApplyClientFilters(){this.filterInputDebounceTimeout&&clearTimeout(this.filterInputDebounceTimeout),this.filterInputDebounceTimeout=setTimeout(()=>{this.filterInputDebounceTimeout=null,this.applyClientFilters()},Wi.FILTER_INPUT_DEBOUNCE_MS)}setColumnVisible(e,t){this.columnManager.setColumnVisible(e,t),this.renderHeader(),this.renderBody(),this.dispatchColumnVisibilityChange(e,t)}showAllColumns(){this.columnManager.showAllColumns(),this.renderHeader(),this.renderBody()}hideAllColumns(){this.columnManager.hideAllColumns(),this.renderHeader(),this.renderBody()}getColumnVisibility(){return this.columnManager.getVisibilityModel()}pinColumn(e,t){this.columnManager.pinColumn(e,t),this.renderHeader(),this.renderBody(),this.dispatchColumnPinChange(e,t)}unpinColumn(e){this.columnManager.unpinColumn(e),this.renderHeader(),this.renderBody(),this.dispatchColumnPinChange(e,!1)}autoSizeColumn(e){this.tbody&&(this.columnManager.autoSizeColumn(e,this.tbody),this.renderHeader())}autoSizeAllColumns(){this.tbody&&(this.columnManager.autoSizeAll(this.tbody),this.renderHeader())}moveColumn(e,t){this.columnManager.moveColumn(e,t),this.renderHeader(),this.renderBody(),this.dispatchColumnOrderChange(e,t)}setupEditor(){if(!this.editable)return;this.editor.attach(this),this.editor.setEditMode(this.editMode);const e=this.columns.filter(e=>!1!==e.editable).map(e=>e.key);this.editor.setEditableColumns(e);for(const e of this.columns)(e.valueGetter||e.valueFormatter||e.valueParser||e.valueSetter)&&this.editor.setPipeline(e.key,{valueGetter:e.valueGetter,valueFormatter:e.valueFormatter,valueParser:e.valueParser,valueSetter:e.valueSetter})}startEdit(e,t){if(!this.editable)return;const i=this.data[e];if(i){if(this.setupEditor(),"row"===this.editMode)this.editor.startRowEdit(e,i);else{const a=this.columns.find(e=>e.key===t);this.editor.startCellEdit(e,t,i[t],i,a?.editorType??a?.type)}this.renderBody(),this.focusActiveEditor()}}focusActiveEditor(){const e=this.tbody?.querySelector(".table-editor-input, .table-editor-checkbox, .table-editor-select");if(e&&(e.focus(),e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type)))try{e.select()}catch{}}async commitEdit(){if("row"===this.editMode){const e=await this.editor.commitRowEdit();return this.renderBody(),e?"Validation errors":null}{const e=await this.editor.commitCellEdit();return this.renderBody(),e}}cancelEdit(){"row"===this.editMode?this.editor.cancelRowEdit():this.editor.cancelCellEdit(),this.renderBody()}exportCSV(e){const t=this.getFilteredData(),i=e?.selectedOnly?this.getSelectedRowsIn(t):t;this.exporter.exportCSV(i,this.columns,e)}printTable(e){this.exporter.print(this,e)}async copyToClipboard(e){const t=this.getFilteredData(),i=this.selectedRows.length>0?this.getSelectedRowsIn(t):t;return this.exporter.copyToClipboard(i,this.columns,e)}getSelectedRowsIn(e){const t=new Set(this.getSelectedData());return e.filter(e=>t.has(e))}hasSelectionColumn(){return this.selectable&&"none"!==this.selectionMode}getSlottedSelectionRows(){return this.shouldModelSlottedRows()?[]:Array.from(this.querySelectorAll('snice-row[slot="rows"]'))}getSelectionSourceRows(){const e=this.getSlottedSelectionRows();return e.length>0?e.map(e=>e.data):this.data}syncSlottedSelectionState(){const e=this.getSlottedSelectionRows();if(0===e.length)return;const t=this.hasSelectionColumn();let i=!1;e.forEach((e,a)=>{const s=!(!t||!this.selectabilityCheck||this.selectabilityCheck(e.data,a));e.index=a,e.selectable=t,e.selectionDisabled=s,!t||s?e.selected=!1:"single"===this.selectionMode&&e.selected&&(i?e.selected=!1:i=!0)}),this.selectedRows=e.map((e,t)=>e.selected&&!e.selectionDisabled?t:-1).filter(e=>e>=0)}getSelectableIndices(e){const t=[];for(const i of e){const e=this.indexOfRow(i);e<0||this.selectabilityCheck&&!this.selectabilityCheck(i,e)||t.push(e)}return t}applyRowSelection(e,t){if("none"===this.selectionMode)return;if(this.selectabilityCheck&&!this.selectabilityCheck(this.data[e],e))return;const i=this.data[e];if("single"===this.selectionMode)return this.selectedRows=[e],this.selectionAnchor=i,this.dispatchRowSelectionChanged(e,!0),void this.dispatchSelectionChanged();if(t.range&&null!=this.selectionAnchor)return this.selectRange(this.selectionAnchor,i),this.dispatchRowSelectionChanged(e,this.selectedRows.includes(e)),void this.dispatchSelectionChanged();const a=this.selectedRows.includes(e);this.selectedRows=a?this.selectedRows.filter(t=>t!==e):[...this.selectedRows,e],this.selectionAnchor=i,this.dispatchRowSelectionChanged(e,!a),this.dispatchSelectionChanged()}selectRange(e,t){const i=this.getFilteredData();let a=i.indexOf(e);const s=i.indexOf(t);if(-1===s)return;-1===a&&(a=s);const n=Math.min(a,s),l=Math.max(a,s),r=[];for(let e=n;e<=l;e++){const t=this.indexOfRow(i[e]);t<0||this.selectabilityCheck&&!this.selectabilityCheck(i[e],t)||r.push(t)}this.selectedRows=r}toggleRowSelection(e){this.applyRowSelection(e,{additive:!0,range:!1})}selectAllRows(){if("multiple"!==this.selectionMode)return;const e=this.getSelectableIndices(this.getFilteredData()),t=e.every(e=>this.selectedRows.includes(e));if(t)this.selectedRows=this.selectedRows.filter(t=>!e.includes(t));else{const t=new Set([...this.selectedRows,...e]);this.selectedRows=Array.from(t)}this.dispatchSelectAllChanged(t),this.dispatchSelectionChanged()}setDetailPanel(e){this.masterDetail.attach(this,e),this.masterDetail.onHeightChange=()=>{this.virtualize&&this.virtualizer.isEnabled()&&(this.virtualRowsSnapshot=this.getVirtualRows(),this.virtualizer.setTotalRows(this.virtualRowsSnapshot.length))},this.masterDetail.prepare(this.data),this.renderHeader(),this.renderBody()}expandRow(e){this.masterDetail.expand(e),this.renderBody()}collapseRow(e){this.masterDetail.collapse(e),this.renderBody()}toggleRowExpansion(e){this.masterDetail.toggle(e),this.renderBody()}expandAllRows(){this.masterDetail.expandAll(this.data.length),this.renderBody()}collapseAllRows(){this.masterDetail.collapseAll(),this.renderBody()}setToolbar(e){this.toolbarOptions=e;const t=this.shadowRoot?.querySelector(".table-controls-container");t&&(this.toolbar.attach(this,t,e),this.toolbar.setFilterEngine(this.filterEngine),this.toolbar.onSearch=e=>this.setQuickFilter(e),this.toolbar.onSortColumn=(e,t)=>{this.currentSort=[{column:e,direction:t}],this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.toolbar.onSetSortModel=e=>{this.currentSort=e,this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.toolbar.onFilterColumn=(e,t,i)=>{this.setColumnFilter(e,t,i)},this.toolbar.onRemoveFilter=e=>{this.removeColumnFilter(e)},this.toolbar.onSetFilterModel=(e,t)=>{this.filterEngine.clearAllFilters(),this.filterEngine.setFilterLogic(t);for(const t of e)this.filterEngine.setColumnFilter(t.column,t.operator,t.value);this.applyClientFilters()},this.toolbar.onClearFilters=()=>{this.clearAllFilters()},this.toolbar.onExportCSV=()=>this.exportCSV(),this.toolbar.onFullscreen=()=>this.toggleFullscreen())}setTreeData(e){this.treeData.attach(e),this.renderBody()}expandTreeNode(e){this.treeData.expand(e),this.renderBody()}collapseTreeNode(e){this.treeData.collapse(e),this.renderBody()}toggleTreeNode(e){this.treeData.toggle(e),this.renderBody()}expandAllTreeNodes(){this.treeData.expandAll(this.data),this.renderBody()}collapseAllTreeNodes(){this.treeData.collapseAll(),this.renderBody()}setColumnGroups(e){this.columnManager.setColumnGroups(e),this.renderHeader()}initColumnMenu(){this.columnMenu&&(this.columnMenuManager.attach(this),this.columnMenuManager.onSortAsc=e=>{this.currentSort=[{column:e,direction:"asc"}],this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.columnMenuManager.onSortDesc=e=>{this.currentSort=[{column:e,direction:"desc"}],this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.columnMenuManager.onFilter=e=>{this.toolbar.openFilterModal(e)},this.columnMenuManager.onHide=e=>this.setColumnVisible(e,!1),this.columnMenuManager.onPinLeft=e=>this.pinColumn(e,"left"),this.columnMenuManager.onPinRight=e=>this.pinColumn(e,"right"),this.columnMenuManager.onUnpin=e=>this.unpinColumn(e),this.columnMenuManager.onAutoSize=e=>this.autoSizeColumn(e))}pinRowTop(e){this.pinnedTopRows.push(e),this.renderBody()}pinRowBottom(e){this.pinnedBottomRows.push(e),this.renderBody()}unpinRow(e){this.pinnedTopRows=this.pinnedTopRows.filter(t=>t!==e),this.pinnedBottomRows=this.pinnedBottomRows.filter(t=>t!==e),this.renderBody()}clearPinnedRows(){this.pinnedTopRows=[],this.pinnedBottomRows=[],this.renderBody()}setRowHeight(e){this.rowHeight=e,this.renderBody()}setRowHeightCallback(e){this.rowHeightCallback=e,this.renderBody()}setSortComparator(e,t){const i=this.columns.find(t=>t.key===e);i&&(i.sortComparator=t)}setSelectabilityCheck(e){this.selectabilityCheck=e;const t=this.getSelectionSourceRows();this.selectedRows=this.selectedRows.filter(i=>{const a=t[i];return!!a&&e(a,i)}),this.syncSlottedSelectionState(),this.scheduleRender("both")}setCellEditableCheck(e){this.editor.setEditabilityCheck(e)}getSelectedData(){const e=this.getSelectionSourceRows();return this.selectedRows.map(t=>e[t]).filter(Boolean)}setupLazyLoading(){if(!this.lazyLoad)return;const e=this.getScrollContainer();e&&(this.lazyLoadHandler&&this.lazyLoadContainer?.removeEventListener("scroll",this.lazyLoadHandler),this.lazyLoadHandler=()=>{const{scrollTop:t,scrollHeight:i,clientHeight:a}=e;i-t-a<this.lazyLoadThreshold&&this.dispatchEvent(new CustomEvent("lazy-load",{detail:{currentCount:this.data.length},bubbles:!0,composed:!0}))},e.addEventListener("scroll",this.lazyLoadHandler,{passive:!0}),this.lazyLoadContainer=e)}scrollToColumn(e){const t=this.shadowRoot?.querySelector(`th[data-key="${e}"]`);t?.scrollIntoView({inline:"nearest",block:"nearest"})}setListViewRenderer(e){this.listViewRenderer=e,this.list&&(this.renderedRows=new Map,this.renderBody())}createRow(e,t,i){const a=document.createElement("tr");a.setAttribute("data-index",String(t)),this.rowHeightCallback?a.style.height=`${this.rowHeightCallback(e,t)}px`:48!==this.rowHeight&&(a.style.height=`${this.rowHeight}px`);const s=this.selectedRows.includes(t);if(a.setAttribute("data-selected",String(s)),this.rowReorder&&this.rowDnD.isEnabled()&&(a.appendChild(this.rowDnD.createDragHandle()),this.rowDnD.makeRowDraggable(a,t)),this.masterDetail.isEnabled()){const e=document.createElement("td");e.className="detail-toggle-cell",e.appendChild(this.masterDetail.createToggleButton(t)),a.appendChild(e)}if(this.hasSelectionColumn()){const i=document.createElement("td");i.className="select-column";const n=!(!this.selectabilityCheck||this.selectabilityCheck(e,t));i.innerHTML=`<snice-checkbox class="row-select" size="small" compact ${s?"checked":""} ${n?"disabled":""} data-row-index="${t}"></snice-checkbox>`,i.querySelector("snice-checkbox").disabled=n,a.appendChild(i)}const n=this.getVisibleColumnDefinitions();if(this.list&&this.listViewRenderer){const i=document.createElement("td");i.className="list-view-cell",i.colSpan=Math.max(1,n.length);const s=this.listViewRenderer(e,t);return s instanceof HTMLElement?i.appendChild(s):i.textContent=null==s?"":String(s),a.appendChild(i),a}let l=0;return n.forEach((s,n)=>{if(l>0)return void l--;const r=document.createElement("td");r.setAttribute("data-key",s.key);const o=e[s.key];this.applyCellPresentation(r,s,o,e);const c=s.colSpan;if(c){const t="function"==typeof c?c(o,e):c;t>1&&(r.colSpan=t,l=t-1)}const d=this.maybeCreateCellEditor(s,e,o,t);if(d)r.classList.add("editing"),r.appendChild(d);else if(i&&s.key===this.treeData.getGroupColumn()){const e=this.treeData.createToggle(i);r.appendChild(e);const t=document.createElement("span");t.textContent=null==o?"":String(o),i.hasChildren&&(t.style.cursor="pointer",t.addEventListener("click",e=>{e.stopPropagation(),this.treeData.toggle(i.key),this.renderBody()})),r.appendChild(t)}else r.appendChild(this.createCellElement(s,o,e));const h=this.columnManager.getState(s.key);if(h)if(r.style.width=`${h.width}px`,"left"===h.pinned){const e=this.columnManager.getPinnedLeftOffsets();r.classList.add("pinned-cell"),r.style.position="sticky",r.style.left=`${e.get(s.key)??0}px`,r.style.zIndex="1"}else if("right"===h.pinned){const e=this.columnManager.getPinnedRightOffsets();r.classList.add("pinned-cell"),r.style.position="sticky",r.style.right=`${e.get(s.key)??0}px`,r.style.zIndex="1"}a.appendChild(r)}),a}applyCellPresentation(e,t,i,a){const s=t=>{t&&(t.backgroundColor&&(e.style.backgroundColor=t.backgroundColor),t.color&&(e.style.color=t.color),t.fontWeight&&(e.style.fontWeight=t.fontWeight),t.fontStyle&&(e.style.fontStyle=t.fontStyle),t.fontSize&&(e.style.fontSize=t.fontSize),t.textDecoration&&(e.style.textDecoration=t.textDecoration))};s(t.style);for(const n of t.conditionalFormats||[])if(n.condition(i,a)){s(n.style),n.className&&e.classList.add(n.className);break}t.tooltip&&(e.title="function"==typeof t.tooltip?t.tooltip(i,a):null==i?"":String(i))}createGroupRow(e,t){const i=document.createElement("tr");i.className="group-header-row",i.setAttribute("data-group-key",e.key),i.setAttribute("data-depth",String(e.depth)),i.setAttribute("aria-label",`${null==e.value||""===e.value?"Blank":String(e.value)} group, ${e.count} rows`);const a=document.createElement("td");if(a.colSpan=t,a.className="group-header-cell",this.selectable&&"multiple"===this.selectionMode){const t=this.groupSelectionState(e),i=document.createElement("span");i.className="group-select-wrap";const s=document.createElement("snice-checkbox");s.className="group-select",s.setAttribute("size","small"),s.setAttribute("compact",""),s.setAttribute("data-group-key",e.key),s.setAttribute("aria-label",`Select all rows in ${null==e.value||""===e.value?"blank":String(e.value)} group`),s.checked="all"===t,s.indeterminate="some"===t,s.disabled=0===this.getSelectableGroupIndices(e).length,i.appendChild(s),a.appendChild(i)}const s=this.grouping.createToggle(e);a.appendChild(s);const n=document.createElement("span");n.className="group-header-label",n.textContent=null==e.value?"":String(e.value),a.appendChild(n);const l=document.createElement("span");return l.className="group-header-count",l.textContent=String(e.count),a.appendChild(l),i.appendChild(a),i}createAggregateRow(e,t){const i=document.createElement("tr");i.className="group-aggregate-row",i.setAttribute("data-agg-scope",e.scope),i.setAttribute("data-depth",String(e.depth)),e.groupKey&&i.setAttribute("data-group-key",e.groupKey);const a=null==e.groupValue||""===e.groupValue?"Blank":String(e.groupValue),s="table"===e.scope?"Total":`${e.groupColumn?`${e.groupColumn}: `:""}${a} subtotal`;if(i.setAttribute("aria-label",s),this.rowReorder&&this.rowDnD.isEnabled()){const e=document.createElement("td");e.className="drag-handle-cell",i.appendChild(e)}if(this.masterDetail.isEnabled()){const e=document.createElement("td");e.className="detail-toggle-cell",i.appendChild(e)}if(this.hasSelectionColumn()){const e=document.createElement("td");e.className="select-column",i.appendChild(e)}const n=this.getVisibleColumnDefinitions(),l=n.find(t=>!Object.prototype.hasOwnProperty.call(e.aggregates,t.key))?null:n[0]?.key;let r=!1;return n.forEach(t=>{const a=document.createElement("td");a.setAttribute("data-key",t.key),a.className="aggregate-cell";const n=Object.prototype.hasOwnProperty.call(e.aggregates,t.key);if(!n&&!r||n&&t.key===l){r=!0;const t=document.createElement("span");t.className="aggregate-label"+(n?" aggregate-label--inline":""),t.textContent=s,"group"===e.scope&&e.depth>0&&(t.style.paddingLeft=1.5*e.depth+"rem"),a.appendChild(t)}if(n){const i=e.aggregates[t.key];a.setAttribute("data-agg-value",String(i));const s=t.renderCell||!t.formatter&&t.valueFormatter?{...t,renderCell:void 0,formatter:t.formatter??t.valueFormatter}:t;a.appendChild(this.createCellElement(s,i))}const o=this.columnManager.getState(t.key);if(o)if(a.style.width=`${o.width}px`,"left"===o.pinned){const e=this.columnManager.getPinnedLeftOffsets();a.classList.add("pinned-cell"),a.style.position="sticky",a.style.left=`${e.get(t.key)??0}px`,a.style.zIndex="1"}else if("right"===o.pinned){const e=this.columnManager.getPinnedRightOffsets();a.classList.add("pinned-cell"),a.style.position="sticky",a.style.right=`${e.get(t.key)??0}px`,a.style.zIndex="1"}i.appendChild(a)}),i}groupSelectionState(e){const t=this.getSelectableGroupIndices(e);if(0===t.length)return"none";const i=t.filter(e=>this.selectedRows.includes(e)).length;return 0===i?"none":i===t.length?"all":"some"}getSelectableGroupIndices(e){const t=[];for(const i of e.rows){const e=this.indexOfRow(i);e<0||this.selectabilityCheck&&!this.selectabilityCheck(i,e)||t.push(e)}return t}toggleGroup(e){this.grouping.toggle(e.key),this.invalidateGroupingCache(),this.dispatchGroupToggle(e.key,e.value,this.grouping.isExpanded(e.key)),this.renderBody()}updateGroupSelectionStates(){if(!this.tbody||!this.grouping.hasGrouping()||!this.selectable)return;const e=this.getGroupingItems().filter(e=>"group"===e.type);if(0===e.length)return;const t=new Map(e.map(e=>[e.key,e]));this.tbody.querySelectorAll("tr.group-header-row").forEach(e=>{const i=e.getAttribute("data-group-key"),a=i?t.get(i):void 0;if(!a)return;const s=e.querySelector("snice-checkbox.group-select");if(!s)return;const n=this.groupSelectionState(a);s.checked="all"===n,s.indeterminate="some"===n})}dispatchGroupToggle(e,t,i){return{key:e,value:t,expanded:i}}maybeCreateCellEditor(e,t,i,a){if(!this.editable)return null;let s,n=!1,l=i;if("row"===this.editMode){const i=this.editor.getRowEditState();i?.isEditing&&i.rowIndex===a&&this.editor.isCellEditable(t,e.key)&&(n=!0,l=i.editedRow[e.key]),s=this.resolveEditorType(e)}else{const t=this.editor.getCellEditState();t?.isEditing&&t.rowIndex===a&&t.columnKey===e.key&&(n=!0,l=t.currentValue),s=t?.editorType??this.resolveEditorType(e)}if(!n)return null;if("function"==typeof e.renderEditor)return e.renderEditor(l,t,e,t=>{"row"===this.editMode?this.editor.updateRowField(e.key,t):this.editor.updateCellValue(t),this.commitEdit()},()=>this.cancelEdit());const r=this.editor.createEditor(s,l,e.selectOptions?{selectOptions:e.selectOptions}:void 0);return this.wireEditorElement(r,e),r}resolveEditorType(e){return e.editorType?e.editorType:this.editor.getEditorType(e.type||"text")}wireEditorElement(e,t){const i=e instanceof HTMLInputElement&&"checkbox"===e.type,a=()=>{const a=i?e.checked:e.value;"row"===this.editMode?this.editor.updateRowField(t.key,a):this.editor.updateCellValue(a)};e.addEventListener("input",a),e.addEventListener("change",a),e.addEventListener("keydown",e=>{"Enter"===e.key?(e.preventDefault(),a(),this.commitEdit()):"Escape"===e.key&&(e.preventDefault(),this.cancelEdit())}),e.addEventListener("blur",()=>{"row"!==this.editMode&&this.editor.isEditing()&&(a(),this.commitEdit())})}static{w(a,ut)}};return Wi=a})();export{Se as SniceTable};
|
|
1627
|
+
`}renderControls(){const e=this.shadowRoot?.querySelector(".table-controls-container");if(!e)return;if(this.toolbarOptions)return void this.setToolbar(this.toolbarOptions);if(!(this.searchable||this.filterable||this.quickFilter))return void(e.innerHTML="");e.innerHTML="";const t=document.createElement("div");if(t.className="table-controls",t.setAttribute("part","controls"),this.quickFilter){const e=document.createElement("snice-input");e.className="quick-filter-input",e.type="search",e.placeholder="Quick filter...",e.size="small",e.clearable=!0,e.style.width="16rem",e.style.maxWidth="16rem",e.value=this.filterEngine.getFilterModel().quickFilter||"",e.addEventListener("input",this.handleQuickFilterInput),t.appendChild(e)}else if(this.searchable){const e=document.createElement("snice-input");e.className="search-input",e.setAttribute("type","search"),e.setAttribute("placeholder","Search..."),e.setAttribute("size","small"),e.style.width="16rem",e.style.maxWidth="16rem",e.style.flex="0 0 auto",e.addEventListener("input",this.handleSearchInput),t.appendChild(e)}if(this.filterable){const e=document.createElement("snice-select");e.className="selector-input",e.setAttribute("multiple",""),e.setAttribute("searchable",""),e.setAttribute("clearable",""),e.setAttribute("placeholder","Filter..."),e.setAttribute("size","medium"),this.selectorOptions.forEach(t=>{const i=document.createElement("snice-option");i.setAttribute("value",t.value),i.textContent=t.label,e.appendChild(i)}),t.appendChild(e)}e.appendChild(t)}async initialize(){this.addEventListener("controller-attached",this.onAttached),this.addEventListener("select-change",this.handleSelectorChange),this.addEventListener("row-select",this.handleSlottedRowSelect),this.addEventListener("detail-toggle",()=>this.renderBody()),this.addEventListener("cell-edit-commit",e=>{const{rowIndex:t,columnKey:i,newValue:a}=e.detail,s=this.data[t];s&&(s[i]=a),this.invalidateFilteredCache(),s&&this.invalidateRenderedRow(s)}),this.addEventListener("row-edit-commit",e=>{const{rowIndex:t,newRow:i}=e.detail;this.data[t]&&(this.data[t]=i),this.rebuildRowIndex()}),await customElements.whenDefined("snice-column"),await customElements.whenDefined("snice-row"),await this.processSlottedContent(),await this.rendered,this.syncGrouping(),this.renderControls(),this.initializeModules(),this.initColumnMenu(),this.rowReorder&&this.rowDnD.attach(this),this.columnReorder&&this.columnDnD.attach(this),this.renderHeader(),this.renderBody(),this.virtualize&&requestAnimationFrame(()=>{this.virtualizer.isEnabled()||this.setupVirtualization()}),this.lazyLoad&&requestAnimationFrame(()=>this.setupLazyLoading()),this.addEventListener("row-reorder",e=>{const{fromIndex:t,toIndex:i}=e.detail;if(!Number.isInteger(t)||!Number.isInteger(i)||t<0||i<0||t>=this.data.length||i>=this.data.length)return;if(t===i)return;const a=this.selectedRows.map(e=>this.data[e]).filter(e=>void 0!==e),s=Array.from(this.masterDetail.getExpandedRows()).map(e=>this.data[e]).filter(e=>void 0!==e),n=this.data.splice(t,1)[0],l=this.data[i>t?i-1:i];if(n&&l&&this.grouping.hasGrouping())for(const e of this.grouping.getGroupByKeys())n[e]=l[e];this.data.splice(i,0,n),this.data=[...this.data],this.selectedRows=a.map(e=>this.indexOfRow(e)).filter(e=>e>=0),this.masterDetail.setExpandedRows(s.map(e=>this.indexOfRow(e)).filter(e=>e>=0))}),this.addEventListener("column-reorder",e=>{const{fromKey:t,toKey:i}=e.detail,a=this.columns.findIndex(e=>e.key===t),s=this.columnManager.getVisibleColumns().findIndex(e=>e.key===i);a>=0&&s>=0&&(this.columnManager.moveColumn(t,s),this.renderHeader(),this.renderBody())}),this.addEventListener("tree-toggle",()=>this.renderBody())}async processSlottedContent(){const e=Array.from(this.querySelectorAll('snice-column[slot="columns"]')),t=Array.from(this.querySelectorAll('snice-row[slot="rows"]'));await Promise.all(t.map(e=>e.ready)),e.length>0&&(this.columns=e.map(e=>e.getColumnDefinition())),t.forEach((e,t)=>{e.columns=this.columns,e.index=t,e.hoverable=this.hoverable,e.clickable=this.clickable}),this.syncSlottedSelectionState(),this.shouldModelSlottedRows()&&this.syncSlottedRowsIntoData(),e.length>0&&!this.shouldModelSlottedRows()&&requestAnimationFrame(()=>this.renderSlottedHeader())}shouldModelSlottedRows(){return(Array.isArray(this.groupBy)?this.groupBy:this.groupBy?[this.groupBy]:[]).some(Boolean)||this.columns.some(e=>null!=e.aggregate)}syncSlottedRowsIntoData(){const e=Array.from(this.querySelectorAll('snice-row[slot="rows"]'));if(0===e.length)return;const t=e.map(e=>{if(e.data&&Object.keys(e.data).length>0)return e.data;const t=e.getAttribute("data");if(t)try{return JSON.parse(t)}catch{}return e.data??{}});this.data=t}renderSlottedHeader(){const e=this.shadowRoot?.querySelector("#slotted-header");if(e&&0!==this.columns.length){e.replaceChildren();for(const t of this.columns){const i=document.createElement("div");i.className="header-cell",i.textContent=t.label??t.key,e.appendChild(i)}}}handleDeclarativeColumnChange(){const e=Array.from(this.querySelectorAll('snice-column[slot="columns"]'));0!==e.length&&(this.columns=e.map(e=>e.getColumnDefinition()),Array.from(this.querySelectorAll('snice-row[slot="rows"]')).forEach(e=>{e.columns=this.columns}),requestAnimationFrame(()=>{this.shouldModelSlottedRows()||this.renderSlottedHeader(),this.renderControls()}))}handleSelectorOptionsChange(){0===this.selectorOptions.length?this.classList.add("selector-options-empty"):this.classList.remove("selector-options-empty")}handleSortableChange(){this.renderHeader()}handleSelectableChange(){this.render(),queueMicrotask(()=>this.syncSlottedSelectionState())}handleColumnsAssignment(){this.renderedRows=new Map,this.columns.length>0&&this.columnManager.initialize(this.columns,this),this.grouping.setColumns(this.columns),this.invalidateGroupingCache();const e=!!this.querySelector('snice-row[slot="rows"]'),t=this.shouldModelSlottedRows();e&&this.virtualizer.isEnabled()&&!!this.shadowRoot?.querySelector("table")!==t&&this.virtualizer.detach(),t&&this.syncSlottedRowsIntoData(),e&&requestAnimationFrame(()=>{t||this.renderSlottedHeader(),this.renderControls(),this.toolbarOptions&&this.setToolbar(this.toolbarOptions),this.lazyLoad&&this.setupLazyLoading()}),this.scheduleRender("both")}handleGroupByChange(){this.syncGrouping();const e=!!this.querySelector('snice-row[slot="rows"]'),t=this.shouldModelSlottedRows();e&&this.virtualizer.isEnabled()&&!!this.shadowRoot?.querySelector("table")!==t&&this.virtualizer.detach(),t&&this.syncSlottedRowsIntoData(),e&&requestAnimationFrame(()=>{t||this.renderSlottedHeader(),this.renderControls(),this.toolbarOptions&&this.setToolbar(this.toolbarOptions),this.lazyLoad&&this.setupLazyLoading()}),this.scheduleRender(e?"both":"body")}syncGrouping(){const e=Array.isArray(this.groupBy)?this.groupBy.filter(Boolean):this.groupBy?[this.groupBy]:[];this.grouping.configure({groupBy:e,defaultExpanded:!1!==this.groupDefaults?.expanded}),this.grouping.setColumns(this.columns),this.invalidateGroupingCache()}handleDataAssignment(){this.settingSortedData||(this.unsortedData=[...this.data],this.rebuildRowIndex(),this.masterDetail.prepare(this.data),this.settingDataImperative||this.scheduleRender("body"))}handleDataChange(){this.renderBody()}handleSelectedRowsChange(e,t){const i=new Set(e??[]),a=new Set(t??this.selectedRows??[]),s=new Set;for(const e of i)a.has(e)||s.add(e);for(const e of a)i.has(e)||s.add(e);for(const e of s)this.updateRowSelectionStateFor(e,a.has(e));this.updateSelectAllState(),this.updateGroupSelectionStates()}handleSelectionModeChange(){"none"===this.selectionMode?(this.selectedRows=[],this.selectionAnchor=null):"single"===this.selectionMode&&this.selectedRows.length>1&&(this.selectedRows=this.selectedRows.slice(0,1),this.selectionAnchor=this.data[this.selectedRows[0]]??null),this.syncSlottedSelectionState(),this.scheduleRender("both")}handleSortChange(){this.renderHeader()}handleControlsChange(){this.renderControls(),this.quickFilter&&this.scheduleRender("body")}handleControlledSort(){"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()}handleCurrentPageChange(){"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.scheduleRender("body")}handlePageSizeChange(){this.currentPage=1,"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.scheduleRender("body")}handleDensityChange(){this.scheduleRender("body"),this.dispatchDensityChange()}handleListChange(){this.renderedRows=new Map,this.scheduleRender("body")}handleEditableChange(){this.editable&&this.setupEditor(),this.scheduleRender("body")}handleEditModeChange(){this.editable&&this.editor.setEditMode(this.editMode),this.scheduleRender("body")}handleVirtualizeChange(){this.virtualize||this.virtualizer.detach(),this.scheduleRender("body")}handleRowHeightChange(){this.scheduleRender("body")}handleColumnResizeChange(){this.scheduleRender("header")}handleHeaderFiltersChange(){this.scheduleRender("header")}handleRowReorderChange(){this.rowReorder?this.rowDnD.attach(this):this.rowDnD.detach(),this.scheduleRender("both")}handleColumnReorderChange(){this.columnReorder?this.columnDnD.attach(this):this.columnDnD.detach(),this.scheduleRender("header")}handleLazyLoadChange(){this.lazyLoad?queueMicrotask(()=>this.setupLazyLoading()):(this.lazyLoadHandler&&this.lazyLoadContainer?.removeEventListener("scroll",this.lazyLoadHandler),this.lazyLoadHandler=null,this.lazyLoadContainer=null)}handleColumnMenuChange(){this.columnMenu&&this.initColumnMenu(),this.scheduleRender("header")}getVisibleColumnDefinitions(){if(0===this.columnManager.getAllStates().length)return this.columns;const e=[...this.columnManager.getPinnedLeft(),...this.columnManager.getUnpinned(),...this.columnManager.getPinnedRight()],t=new Map(this.columns.map(e=>[e.key,e]));return e.map(e=>t.get(e.key)).filter(e=>!!e)}renderHeader(){if(!this.thead)return;const e=document.createElement("tr");if(e.className="column-header-row",this.rowReorder&&this.rowDnD.isEnabled()){const t=document.createElement("th");t.setAttribute("scope","col"),t.className="drag-handle-cell",e.appendChild(t)}if(this.masterDetail.isEnabled()){const t=document.createElement("th");t.setAttribute("scope","col"),t.className="detail-toggle-cell",e.appendChild(t)}if(this.hasSelectionColumn()){const t=document.createElement("th");if(t.setAttribute("scope","col"),t.className="select-column","multiple"===this.selectionMode){const e=this.getSelectableIndices(this.getFilteredData()),i=e.filter(e=>this.selectedRows.includes(e)),a=i.length>0&&i.length<e.length;t.innerHTML=`<snice-checkbox class="select-all" size="small" compact ${i.length===e.length&&e.length>0?"checked":""}></snice-checkbox>`,setTimeout(()=>{const e=t.querySelector(".select-all");e&&(e.indeterminate=a)},0)}else t.setAttribute("aria-label","Select one row");e.appendChild(t)}const t=this.getVisibleColumnDefinitions();if(t.forEach(t=>{const i=document.createElement("th");if(i.setAttribute("data-key",t.key),i.setAttribute("scope","col"),this.sortable&&!1!==t.sortable){const e=this.currentSort.find(e=>e.column===t.key);i.setAttribute("aria-sort","asc"===e?.direction?"ascending":"desc"===e?.direction?"descending":"none")}const a=this.columnManager.getState(t.key);if(a)if(i.style.width=`${a.width}px`,"left"===a.pinned){const e=this.columnManager.getPinnedLeftOffsets();i.classList.add("pinned-cell"),i.style.position="sticky",i.style.left=`${e.get(t.key)??0}px`,i.style.zIndex="2"}else if("right"===a.pinned){const e=this.columnManager.getPinnedRightOffsets();i.classList.add("pinned-cell"),i.style.position="sticky",i.style.right=`${e.get(t.key)??0}px`,i.style.zIndex="2"}if(this.sortable&&!1!==t.sortable?(i.classList.add("sortable"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-label",`Sort by ${t.label}`),i.innerHTML=this.renderSortableHeader(t)):i.textContent=t.label,this.filterEngine.hasColumnFilter(t.key)&&i.classList.add("filtered"),this.columnResize&&!1!==t.resizable){const e=document.createElement("span");e.className="resize-handle",e.addEventListener("mousedown",e=>{e.stopPropagation(),this.columnManager.startResize(t.key,e.clientX)}),e.addEventListener("dblclick",e=>{e.stopPropagation(),this.tbody&&(this.columnManager.autoSizeColumn(t.key,this.tbody),this.renderHeader(),this.renderBody())}),i.appendChild(e)}this.columnMenu&&i.addEventListener("contextmenu",e=>{e.preventDefault();const i=this.columnManager.getState(t.key);this.columnMenuManager.show(t.key,e.clientX,e.clientY,{sortable:this.sortable&&!1!==t.sortable,filterable:!1!==t.filterable,hideable:i?.hideable,pinnable:i?.pinnable,pinned:i?.pinned})}),this.columnReorder&&this.columnDnD.isEnabled()&&this.columnDnD.makeHeaderDraggable(i,t.key,!1!==t.reorderable&&!a?.pinned),e.appendChild(i)}),this.thead.innerHTML="",this.columnManager.getColumnGroups().length>0){const e=document.createElement("tr");e.className="column-group-row";const i=[this.rowReorder&&this.rowDnD.isEnabled()?"drag-handle-cell":"",this.masterDetail.isEnabled()?"detail-toggle-cell":"",this.hasSelectionColumn()?"select-column":""].filter(Boolean);for(const t of i){const i=document.createElement("th");i.className=t,i.setAttribute("aria-hidden","true"),e.appendChild(i)}const a=document.createElement("template");a.innerHTML=this.columnManager.renderGroupHeaders(t.map(e=>e.key)),e.appendChild(a.content),this.thead.appendChild(e)}if(this.thead.appendChild(e),this.headerFilters){const e=document.createElement("tr");if(e.className="header-filter-row",this.rowReorder&&this.rowDnD.isEnabled()){const t=document.createElement("td");t.className="drag-handle-cell",e.appendChild(t)}if(this.masterDetail.isEnabled()){const t=document.createElement("td");t.className="detail-toggle-cell",e.appendChild(t)}if(this.hasSelectionColumn()){const t=document.createElement("td");t.className="select-column",e.appendChild(t)}t.forEach(t=>{const i=document.createElement("td"),a=document.createElement("snice-input");a.size="small",a.placeholder=`Filter ${t.label}...`,a.setAttribute("data-column",t.key),a.value=this.filterEngine.getHeaderFilter(t.key),a.style.cssText="width:100%;--snice-color-border:transparent;--snice-border-radius-md:0;",a.addEventListener("input",()=>{this.filterEngine.setHeaderFilter(t.key,a.value),this.debouncedApplyClientFilters()}),i.appendChild(a),e.appendChild(i)}),this.thead.appendChild(e)}}renderSortableHeader(e){const t=this.currentSort.find(t=>t.column===e.key),i=this.currentSort.findIndex(t=>t.column===e.key),a='<svg width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1 5l4-4 4 4"/></svg>',s='<svg width="10" height="6" viewBox="0 0 10 6" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M1 1l4 4 4-4"/></svg>';let n=`<span style="display:flex;flex-direction:column;gap:0;opacity:0.3">${a}${s}</span>`,l="";t&&("asc"===t.direction?n=a:"desc"===t.direction&&(n=s),this.currentSort.length>1&&(l=`<span class="sort-order">${i+1}</span>`));const r=["sort-indicator",t?"active":""].filter(Boolean).join(" ");return`\n <div class="sort-header">\n <span>${e.label}</span>\n <div class="${r}">\n ${n}\n ${l}\n </div>\n </div>\n `}renderBody(){if(!this.tbody)return;if(this.columns.length>0&&this.columnManager.initialize(this.columns,this),this.grouping.setColumns(this.columns)&&this.invalidateGroupingCache(),this.pagination&&"client"===this.paginationMode&&(this.usesGroupingDisplayModel()?this.totalItems=this.getGroupingItems().length:this.treeData.isEnabled()&&(this.totalItems=this.getTreeDisplayRows(!1).length)),this.virtualize&&!this.virtualizer.isEnabled()&&this.setupVirtualization(),this.virtualize&&this.virtualizer.isEnabled())return this.virtualRowsSnapshot=this.getVirtualRows(),this.virtualizer.setTotalRows(this.virtualRowsSnapshot.length),void(this.pagination&&this.renderPagination());if(0===this.data.length&&this.columns.length>0){this.tbody.innerHTML="",this.renderedRows=new Map;const e=(this.hasSelectionColumn()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),t=this.columns.length+e;if(this.loading){const e=document.createElement("tr"),i=document.createElement("td");return i.colSpan=t,i.className="no-data",i.innerHTML='<snice-progress variant="circular" indeterminate size="small"></snice-progress>',e.appendChild(i),void this.tbody.appendChild(e)}if(this.loadError){const e=document.createElement("tr"),i=document.createElement("td");i.colSpan=t,i.className="no-data";const a=document.createElement("div");return a.className="table-error-message",a.textContent=`⚠️ ${this.loadError}`,i.appendChild(a),e.appendChild(i),void this.tbody.appendChild(e)}{const e=document.createElement("tr"),i=document.createElement("td");i.colSpan=t,i.className="no-data";const a=this.querySelector('[slot="empty-state"]');if(a)i.appendChild(a.cloneNode(!0));else{const e=document.createElement("snice-empty-state");e.setAttribute("size","small"),e.setAttribute("icon","📭"),e.setAttribute("title","No data"),e.setAttribute("description","No records to display."),i.appendChild(e)}return e.appendChild(i),void this.tbody.appendChild(e)}}const e=this.getFilteredData();let t=e;if(this.pagination&&"client"===this.paginationMode&&!this.usesGroupingDisplayModel()&&!this.treeData.isEnabled()){this.totalItems=e.length;const i=(this.currentPage-1)*this.pageSize;t=e.slice(i,i+this.pageSize)}const i=(this.hasSelectionColumn()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),a=(this.columnManager.getAllStates().length>0?this.columnManager.getVisibleColumns().length:this.columns.length)+i,s=this.computeStructuralSig(),n=[];if(this.pinnedTopRows.forEach((e,t)=>{n.push({key:`__pinned_top_${t}`,sig:"pinned",alwaysRebuild:!0,create:()=>{const t=this.createRow(e,-1);return t.classList.add("pinned-row","pinned-row--top"),t}})}),this.usesGroupingDisplayModel()){const e=this.getDisplayedGroupingItems();for(const t of e)if("group"===t.type)n.push({key:t.key,sig:`${s}|grp:${t.key}:${t.expanded?1:0}:${t.count}`,alwaysRebuild:!0,create:()=>this.createGroupRow(t,a)});else if("aggregate"===t.type)n.push({key:t.key,sig:`${s}|agg:${t.key}`,alwaysRebuild:!0,create:()=>this.createAggregateRow(t,a)});else{const e=this.indexOfRow(t.data),i=this.isRowEditing(e);n.push({key:t.data,sig:this.rowSignature(t.data,e,s)+(i?"|edit":""),alwaysRebuild:i,restampIndex:e,create:()=>this.createRow(t.data,e)}),this.masterDetail.isEnabled()&&this.masterDetail.isExpanded(e)&&n.push({key:`__detail_${e}`,sig:"detail",alwaysRebuild:!0,create:()=>this.masterDetail.createDetailRow(t.data,e,a)??document.createElement("tr")})}}else this.treeData.isEnabled()?this.getTreeDisplayRows(!0).forEach(({data:e,index:t,treeRow:i,groupItem:l})=>{if("aggregate"===l?.type)return void n.push({key:l.key,sig:`${s}|agg:${l.key}`,alwaysRebuild:!0,create:()=>this.createAggregateRow(l,a)});if(!i)return;const r=this.isRowEditing(t);n.push({key:e,sig:this.rowSignature(e,t,s,i)+(r?"|edit":""),alwaysRebuild:r,restampIndex:t,create:()=>this.createRow(e,t,i)})}):t.forEach(e=>{const t=this.indexOfRow(e),i=this.isRowEditing(t);n.push({key:e,sig:this.rowSignature(e,t,s)+(i?"|edit":""),alwaysRebuild:i,restampIndex:t,create:()=>this.createRow(e,t)}),this.masterDetail.isEnabled()&&this.masterDetail.isExpanded(t)&&n.push({key:`__detail_${t}`,sig:"detail",alwaysRebuild:!0,create:()=>this.masterDetail.createDetailRow(e,t,a)??document.createElement("tr")})});this.pinnedBottomRows.forEach((e,t)=>{n.push({key:`__pinned_bottom_${t}`,sig:"pinned",alwaysRebuild:!0,create:()=>{const t=this.createRow(e,-1);return t.classList.add("pinned-row","pinned-row--bottom"),t}})}),this.reconcileRows(n),this.keyboard.refresh(),this.pagination&&this.renderPagination()}reconcileRows(e){const t=this.tbody;if(!t)return;const i=new Map,a=[],s=new Set;for(const t of e){const e=this.renderedRows.get(t.key);let n;!e||s.has(e.el)||t.alwaysRebuild||e.sig!==t.sig?n=t.create():(n=e.el,void 0!==t.restampIndex&&this.restampRowIndex(n,t.restampIndex)),s.add(n),a.push(n),i.has(t.key)||i.set(t.key,{el:n,sig:t.sig})}const n=new Set(a);for(const e of Array.from(t.children))n.has(e)||e.remove();let l=t.firstChild;for(const e of a)if(e===l)l=e.nextSibling;else{const i=document.createDocumentFragment();i.appendChild(e),t.insertBefore(i,l)}this.renderedRows=i}rendererIdFor(e){if("function"!=typeof e)return"";let t=this.rendererIds.get(e);return void 0===t&&(t=++this.rendererIdSeq,this.rendererIds.set(e,t)),String(t)}computeStructuralSig(){const e=this.getVisibleColumnDefinitions().map(e=>{const t=this.columnManager.getState(e.key),i=this.rendererIdFor(e.renderCell);return`${e.key}:${t?.width??""}:${t?.pinned??""}:rc${i}`});return[e.join(","),`pl=${Array.from(this.columnManager.getPinnedLeftOffsets().values()).join("/")}`,`pr=${Array.from(this.columnManager.getPinnedRightOffsets().values()).join("/")}`,`sel=${this.selectable?this.selectionMode:"off"}`,`selectable=${this.rendererIdFor(this.selectabilityCheck)}`,"md="+(this.masterDetail.isEnabled()?1:0),"rr="+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),`rh=${this.rowHeight}`,`d=${this.density}`,`tree=${this.treeData.isEnabled()?this.treeData.getGroupColumn():""}`].join("|")}rowSignature(e,t,i,a){const s=[i];return a&&s.push(`t:${a.depth}:${a.expanded?1:0}:${a.hasChildren?1:0}`),this.rowHeightCallback&&s.push(`h:${this.rowHeightCallback(e,t)}`),this.masterDetail.isEnabled()&&s.push("detail:"+(this.masterDetail.isExpanded(t)?1:0)),(this.rowReorder&&this.rowDnD.isEnabled()||this.masterDetail.isEnabled())&&s.push(`i:${t}`),s.join("|")}isRowEditing(e){if(!this.editable)return!1;if("row"===this.editMode){const t=this.editor.getRowEditState();return!(!t?.isEditing||t.rowIndex!==e)}const t=this.editor.getCellEditState();return!(!t?.isEditing||t.rowIndex!==e)}restampRowIndex(e,t){e.setAttribute("data-index",String(t));const i=this.selectedRows.includes(t);e.setAttribute("data-selected",String(i));const a=e.querySelector("snice-checkbox.row-select");if(a){a.setAttribute("data-row-index",String(t)),a.checked=i;const e=!(!this.selectabilityCheck||this.selectabilityCheck(this.data[t],t));a.disabled=e,a.toggleAttribute("disabled",e)}}invalidateRenderedRow(e){this.renderedRows.delete(e)}paginationTotal(){return"client"!==this.paginationMode?this.totalItems:this.usesGroupingDisplayModel()?this.getGroupingItems().length:this.treeData.isEnabled()?this.getTreeDisplayRows(!1).length:this.data.length}get totalPages(){const e=this.paginationTotal();return Math.max(1,Math.ceil(e/this.pageSize))}goToPage(e){const t=Math.max(1,Math.min(e,this.totalPages));t!==this.currentPage&&(this.currentPage=t,"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.renderBody(),this.dispatchPageChange())}setPageSize(e){this.pageSize=e,this.currentPage=1,"server"===this.paginationMode&&"remote"===this.mode?this.debouncedDataRequest():this.renderBody(),this.dispatchPageChange()}dispatchPageChange(){return{page:this.currentPage,pageSize:this.pageSize,totalPages:this.totalPages,totalItems:this.paginationTotal()}}renderPagination(){const e=this.shadowRoot?.querySelector(".table-pagination-container");if(!e)return;if(!this.pagination)return void(e.innerHTML="");const t=this.paginationTotal(),i=this.totalPages,a=Math.min((this.currentPage-1)*this.pageSize+1,t),s=Math.min(this.currentPage*this.pageSize,t),n=[];if(i<=7)for(let e=1;e<=i;e++)n.push(this.pageButton(e));else{n.push(this.pageButton(1)),this.currentPage>3&&n.push('<span class="pagination__ellipsis">…</span>');const e=Math.max(2,this.currentPage-1),t=Math.min(i-1,this.currentPage+1);for(let i=e;i<=t;i++)n.push(this.pageButton(i));this.currentPage<i-2&&n.push('<span class="pagination__ellipsis">…</span>'),n.push(this.pageButton(i))}e.innerHTML="";const l=document.createElement("div");l.className="pagination",l.setAttribute("part","pagination");const r=document.createElement("div");r.className="pagination__info",r.textContent=`Showing ${a}–${s} of ${t}`,l.appendChild(r);const o=document.createElement("div");o.className="pagination__controls",o.innerHTML=`\n <button class="pagination__btn pagination__first" ${this.currentPage<=1?"disabled":""} data-page="1" aria-label="First page">⟨⟨</button>\n <button class="pagination__btn pagination__prev" ${this.currentPage<=1?"disabled":""} data-page="${this.currentPage-1}" aria-label="Previous page">⟨</button>\n ${n.join("")}\n <button class="pagination__btn pagination__next" ${this.currentPage>=i?"disabled":""} data-page="${this.currentPage+1}" aria-label="Next page">⟩</button>\n <button class="pagination__btn pagination__last" ${this.currentPage>=i?"disabled":""} data-page="${i}" aria-label="Last page">⟩⟩</button>\n `,l.appendChild(o);const c=document.createElement("div");c.className="pagination__size";const d=document.createElement("label");d.textContent="Rows per page:",c.appendChild(d);const h=document.createElement("snice-select");h.size="small",h.className="pagination__size-select";const u=this.pageSizes.includes(this.pageSize)?this.pageSizes:[...this.pageSizes,this.pageSize].sort((e,t)=>e-t);for(const e of u){const t=document.createElement("snice-option");t.setAttribute("value",String(e)),t.textContent=String(e),e===this.pageSize&&t.setAttribute("selected",""),h.appendChild(t)}h.value=String(this.pageSize),c.appendChild(h),l.appendChild(c),e.appendChild(l),o.querySelectorAll("[data-page]").forEach(e=>{e.addEventListener("click",()=>{const t=parseInt(e.getAttribute("data-page"));this.goToPage(t)})}),h.addEventListener("select-change",e=>{this.setPageSize(parseInt(e.detail.value))})}pageButton(e){return`<button class="pagination__btn pagination__page${e===this.currentPage?" pagination__btn--active":""}" data-page="${e}">${e}</button>`}createCellElement(e,t,i){if("function"==typeof e.renderCell){const a=e.renderCell(t,i,e);if(a instanceof HTMLElement)return a;const s=document.createElement("span");return s.className="custom-cell",s.textContent=null==a?"":String(a),s}const a=this.getCellTagName(e.type),s=document.createElement(a);switch(s.setAttribute("type",e.type||"text"),e.align&&s.setAttribute("align",e.align),s.setAttribute("in-table","true"),"sparkline"===e.type&&null!==t&&"object"==typeof t?(s.setAttribute("value",JSON.stringify(t)),Array.isArray(t)&&(s.data=t)):s.value=t??"",null!==t&&"object"==typeof t||s.setAttribute("value",String(t??"")),s.column=e,s.rowData=i??null,e.type){case"number":case"currency":if(void 0!==e.decimals&&s.setAttribute("decimals",String(e.decimals)),e.thousandsSeparator&&s.setAttribute("thousands-separator","true"),e.prefix&&s.setAttribute("prefix",e.prefix),e.suffix&&s.setAttribute("suffix",e.suffix),"currency"===e.type){const t=e.currencyFormat;t&&(t.currency&&s.setAttribute("currency",t.currency),t.locale&&s.setAttribute("locale",t.locale),(t.display||t.currencyDisplay)&&s.setAttribute("currencydisplay",t.currencyDisplay||t.display),void 0!==t.decimals&&s.setAttribute("decimals",String(t.decimals)),!1===t.thousandsSeparator&&(s.thousandsSeparator=!1))}break;case"date":e.dateFormat&&s.setAttribute("date-format",e.dateFormat);break;case"boolean":e.useSymbols&&s.setAttribute("use-symbols","true"),e.trueSymbol&&s.setAttribute("true-symbol",e.trueSymbol),e.falseSymbol&&s.setAttribute("false-symbol",e.falseSymbol),e.trueValue&&s.setAttribute("true-value",e.trueValue),e.falseValue&&s.setAttribute("false-value",e.falseValue);break;case"sparkline":{const t=e.sparklineFormat;t&&(t.color&&s.setAttribute("color",t.color),t.type&&s.setAttribute("chart-type",t.type),t.width&&s.setAttribute("width",String(t.width)),t.height&&s.setAttribute("height",String(t.height)));break}case"rating":{const t=e.ratingFormat;t&&(t.max&&s.setAttribute("max",String(t.max)),t.color&&s.setAttribute("color",t.color));break}case"progress":{const t=e.progressFormat;t&&(t.max&&s.setAttribute("max",String(t.max)),t.color&&s.setAttribute("color",t.color),t.showPercentage&&s.setAttribute("show-percentage","true"));break}case"percentage":case"percent":{const t=e.percentageFormat;t&&(void 0!==t.decimals&&s.setAttribute("decimals",String(t.decimals)),t.colorize&&s.setAttribute("colorize","true"));break}case"status":{const t=e.statusFormat;t&&(t.variant&&s.setAttribute("variant",t.variant),t.showDot&&s.setAttribute("show-dot","true"));break}case"link":{const t=e.linkFormat;t&&(t.target&&s.setAttribute("target",t.target),t.external&&s.setAttribute("external","true"));break}case"image":{const t=e.imageFormat;t&&(t.shape&&s.setAttribute("shape",t.shape),t.size&&s.setAttribute("size",t.size));break}case"color":{const t=e.colorFormat;t&&(!1!==t.showSwatch&&s.setAttribute("show-swatch","true"),t.displayFormat&&s.setAttribute("display-format",t.displayFormat));break}case"email":{const t=e.emailFormat;t&&t.showIcon&&s.setAttribute("show-icon","true");break}case"phone":{const t=e.phoneFormat;t&&(t.showIcon&&s.setAttribute("show-icon","true"),t.format&&s.setAttribute("format","true"));break}}return s}getCellTagName(e){switch(e){case"text":return"snice-cell-text";case"number":return"snice-cell-number";case"currency":return"snice-cell-currency";case"date":return"snice-cell-date";case"boolean":return"snice-cell-boolean";case"rating":return"snice-cell-rating";case"progress":return"snice-cell-progress";case"duration":return"snice-cell-duration";case"filesize":return"snice-cell-filesize";case"sparkline":return"snice-cell-sparkline";case"image":return"snice-cell-image";case"percentage":case"percent":return"snice-cell-percentage";case"tag":return"snice-cell-tag";case"status":return"snice-cell-status";case"actions":return"snice-cell-actions";case"link":return"snice-cell-link";case"email":return"snice-cell-email";case"phone":return"snice-cell-phone";case"color":return"snice-cell-color";case"location":return"snice-cell-location";case"json":return"snice-cell-json";default:return"snice-cell"}}updateRowSelectionState(){this.tbody&&this.tbody.querySelectorAll("tr").forEach((e,t)=>{const i=this.selectedRows.includes(t);e.setAttribute("data-selected",String(i));const a=e.querySelector("snice-checkbox.row-select");a&&(a.checked=i)})}updateRowSelectionStateFor(e,t){if(!this.tbody)return;const i=this.tbody.querySelector(`tr[data-index="${e}"]`);if(!i)return;i.setAttribute("data-selected",String(t));const a=i.querySelector("snice-checkbox.row-select");a&&(a.checked=t)}updateSelectAllState(){const e=this.thead?.querySelector("snice-checkbox.select-all");if(!e)return;const t=this.getSelectableIndices(this.getFilteredData()),i=t.filter(e=>this.selectedRows.includes(e)),a=i.length>0&&i.length<t.length;e.checked=i.length===t.length&&t.length>0,e.indeterminate=a}toggleSort(e,t=!1){if(t){const t=this.currentSort.findIndex(t=>t.column===e);this.currentSort=-1===t?[...this.currentSort,{column:e,direction:"asc"}]:"asc"===this.currentSort[t].direction?this.currentSort.map((e,i)=>i===t?{...e,direction:"desc"}:e):this.currentSort.filter(t=>t.column!==e)}else{const t=this.currentSort.find(t=>t.column===e);this.currentSort=t?"asc"===t.direction?[{column:e,direction:"desc"}]:[]:[{column:e,direction:"asc"}]}this.renderHeader(),this.dispatchSortChange(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()}sortLocalData(){this.unsortedData.length||(this.unsortedData=[...this.data]),this.settingSortedData=!0,this.data=0===this.currentSort.length?[...this.unsortedData]:[...this.unsortedData].sort((e,t)=>{for(const{column:i,direction:a}of this.currentSort){const s=this.columns.find(e=>e.key===i),n=s?.sortComparator;if(n){const s=n(e[i],t[i],a);if(0!==s)return s}else{const n=s?.valueGetter?s.valueGetter(e[i],e):e[i]??"",l=s?.valueGetter?s.valueGetter(t[i],t):t[i]??"",r=String(n).localeCompare(String(l),void 0,{numeric:!0});if(0!==r)return"asc"===a?r:-r}}return 0}),this.settingSortedData=!1,this.rebuildRowIndex(),this.scheduleRender("body")}dispatchRowSelectionChanged(e,t){return{selectedRows:this.selectedRows,rowIndex:e,selected:t}}dispatchRowClicked(e,t){return{rowData:e,rowIndex:t}}dispatchLoadError(e){return{error:e}}dispatchSelectAllChanged(e){return{selectedRows:this.selectedRows,allSelected:e}}dispatchSelectionChanged(){return{selectedRows:this.selectedRows,rows:this.getSelectedData()}}dispatchSortChange(){return{sort:this.currentSort}}dispatchFilterChange(){return{filters:this.filterEngine.getFilterModel()}}dispatchColumnVisibilityChange(e,t){return{key:e,visible:t,visibility:this.columnManager.getVisibilityModel()}}dispatchColumnPinChange(e,t){return{key:e,pinned:t}}dispatchColumnOrderChange(e,t){return{key:e,toIndex:t}}dispatchDensityChange(){return{density:this.density}}initializeModules(){this.columnManager.initialize(this.columns,this),this.setupEditor(),this.shadowRoot&&this.keyboard.attach({shadowRoot:this.shadowRoot,totalRows:()=>this.getKeyboardRows().length,ariaRows:()=>this.usesGroupingDisplayModel()?this.getDisplayedGroupingItems().length:this.treeData.isEnabled()?this.getTreeDisplayRows(!0).length:this.getKeyboardRows().length,ariaRowOffset:()=>this.virtualize&&this.virtualizer.isEnabled()?Math.max(0,this.virtualizer.getVisibleRange().start):0,totalColumns:()=>this.getKeyboardColumnCount(),tabMode:"all",isEditing:()=>this.editor.isEditing(),getRowElement:e=>this.getKeyboardRowElement(e),ensureRowVisible:e=>this.ensureKeyboardRowRendered(e),onCellActivate:(e,t)=>{const i=this.getKeyboardDataIndex(e);this.editable&&i>=0&&t&&this.startEdit(i,t)},onSelectionToggle:e=>{const t=this.getKeyboardDataIndex(e);this.selectable&&t>=0&&this.toggleRowSelection(t)},onSelectAll:()=>{this.selectable&&this.selectAllRows()}})}cleanup(){this.virtualizer.detach(),this.keyboard.detach(),this.lazyLoadHandler&&this.lazyLoadContainer?.removeEventListener("scroll",this.lazyLoadHandler),this.lazyLoadHandler=null,this.lazyLoadContainer=null,this.rowDnD.detach(),this.columnDnD.detach()}getScrollContainer(){return this.shadowRoot?.querySelector(".table-frame")??this.shadowRoot?.querySelector(".snice-table")}setupVirtualization(){if(!this.virtualize||!this.shadowRoot||!this.tbody)return;const e=this.getScrollContainer();e&&(this.virtualRowsSnapshot=this.getVirtualRows(),this.virtualizer.attach({rowHeight:e=>this.getVirtualRowHeight(e),bufferPx:this.virtualBuffer,totalRows:this.virtualRowsSnapshot.length,scrollContainer:e,renderRange:(e,t)=>this.renderRowRange(e,t),renderPinnedTop:()=>this.renderPinnedRows(this.pinnedTopRows,"top"),renderPinnedBottom:()=>this.renderPinnedRows(this.pinnedBottomRows,"bottom"),afterRender:()=>this.keyboard.refresh()}))}getVirtualRowHeight(e){const t=this.virtualRowsSnapshot[e];if(!t||t.groupItem&&"row"!==t.groupItem.type)return this.rowHeight;const i=t.groupItem?this.indexOfRow(t.data):t.index;return(this.rowHeightCallback?this.rowHeightCallback(t.data,i):this.rowHeight)+this.masterDetail.getFixedAdditionalHeight(i)}getVirtualRows(){const e=this.getFilteredData();return this.usesGroupingDisplayModel()?this.getDisplayedGroupingItems().map((e,t)=>({data:"row"===e.type?e.data:void 0,index:t,groupItem:e})):this.treeData.isEnabled()?this.getTreeDisplayRows(!0):e.map(e=>({data:e,index:this.indexOfRow(e)}))}renderRowRange(e,t){const i=document.createDocumentFragment(),a=this.virtualRowsSnapshot.length>0?this.virtualRowsSnapshot:this.getVirtualRows(),s=(this.hasSelectionColumn()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0),n=(this.columnManager.getAllStates().length>0?this.columnManager.getVisibleColumns().length:this.columns.length)+s,l=this.computeStructuralSig(),r=new Map,o=new Set;for(let s=e;s<t&&s<a.length;s++){const{data:e,index:t,treeRow:c,groupItem:d}=a[s];if(d&&"row"!==d.type){const e="group"===d.type?this.createGroupRow(d,n):this.createAggregateRow(d,n);o.add(e),r.has(d.key)||r.set(d.key,{el:e,sig:"grouprow"}),i.appendChild(e);continue}const h=d?this.indexOfRow(e):t,u=this.isRowEditing(h),m=this.rowSignature(e,h,l,c)+(u?"|edit":""),p=this.renderedRows.get(e);let g;if(!p||o.has(p.el)||u||p.sig!==m?g=this.createRow(e,h,c):(g=p.el,this.restampRowIndex(g,h)),o.add(g),r.has(e)||r.set(e,{el:g,sig:m}),i.appendChild(g),!c&&this.masterDetail.isEnabled()&&this.masterDetail.isExpanded(h)){const t=this.masterDetail.createDetailRow(e,h,n);t&&i.appendChild(t)}}return this.renderedRows=r,i}renderPinnedRows(e,t){const i=document.createDocumentFragment();for(const a of e){const e=this.createRow(a,-1);e.classList.add("pinned-row","top"===t?"pinned-row--top":"pinned-row--bottom"),i.appendChild(e)}return i}scrollToRow(e){if(this.usesGroupingDisplayModel()||this.treeData.isEnabled()){const t=this.data[e],i=this.getVirtualRows().findIndex(e=>e.data===t);return void(i>=0&&this.virtualizer.scrollToIndex(i))}this.virtualizer.scrollToRow(e)}getKeyboardColumnCount(){const e=this.shadowRoot?.querySelectorAll("thead tr.column-header-row > th").length??0;return e>0?e:(this.columnManager.getAllStates().length>0?this.columnManager.getVisibleColumns().length:this.columns.length)+(this.rowReorder&&this.rowDnD.isEnabled()?1:0)+(this.masterDetail.isEnabled()?1:0)+(this.hasSelectionColumn()?1:0)}getKeyboardRows(){if(this.usesGroupingDisplayModel())return this.getDisplayedGroupingItems().filter(e=>"row"===e.type).map(e=>e.data);if(this.treeData.isEnabled())return this.getTreeDisplayRows(!0).filter(e=>!!e.treeRow).map(e=>e.data);let e=this.getFilteredData();if(this.pagination&&"client"===this.paginationMode){const t=(this.currentPage-1)*this.pageSize;e=e.slice(t,t+this.pageSize)}return e}getKeyboardDataIndex(e){const t=this.getKeyboardRows()[e];return void 0===t?-1:this.indexOfRow(t)}getKeyboardRowElement(e){const t=this.getKeyboardDataIndex(e);return t<0?null:this.tbody?.querySelector(`tr[data-index="${t}"]`)}ensureKeyboardRowRendered(e){if(!this.virtualize||!this.virtualizer.isEnabled())return;if(this.getKeyboardRowElement(e))return;const t=this.getKeyboardRows()[e];if(void 0===t)return;const i=this.getVirtualRows().findIndex(e=>e.data===t);i>=0&&this.virtualizer.scrollToIndex(i)}getScrollPosition(){return this.virtualizer.getScrollPosition()}setColumnFilter(e,t,i){this.filterEngine.setColumnFilter(e,t,i),this.applyClientFilters()}removeColumnFilter(e){this.filterEngine.removeColumnFilter(e),this.applyClientFilters()}setQuickFilter(e){this.filterEngine.setQuickFilter(e),this.applyClientFilters()}setFilterModel(e){this.filterEngine.setFilterModel(e),this.applyClientFilters()}getFilterModel(){return this.filterEngine.getFilterModel()}clearAllFilters(){this.filterEngine.clearAllFilters(),this.applyClientFilters()}getFilteredData(){if(this.ensureRowIndex(),this.filteredCache)return this.filteredCache;const e=this.filterEngine.hasActiveFilters()?this.filterEngine.applyFilters(this.data,this.columns):this.data;return this.filteredCache=e,e}rebuildRowIndex(){this.rowIndexMap.clear();const e=this.data;for(let t=0;t<e.length;t++)this.rowIndexMap.has(e[t])||this.rowIndexMap.set(e[t],t);this.rowIndexDataRef=e,this.filteredCache=null,this.groupingCache=null}ensureRowIndex(){this.rowIndexDataRef!==this.data&&this.rebuildRowIndex()}indexOfRow(e){this.ensureRowIndex();const t=this.rowIndexMap.get(e);return void 0===t?-1:t}invalidateFilteredCache(){this.filteredCache=null,this.groupingCache=null}invalidateGroupingCache(){this.groupingCache=null}getGroupingItems(){return this.grouping.setColumns(this.columns)&&this.invalidateGroupingCache(),this.groupingCache||(this.groupingCache=this.grouping.processData(this.getFilteredData())),this.groupingCache}usesGroupingDisplayModel(){return this.grouping.hasGrouping()||this.grouping.hasAggregation()&&!this.treeData.isEnabled()}getDisplayedGroupingItems(){const e=this.getGroupingItems();if(!this.pagination||"client"!==this.paginationMode)return e;const t=Math.max(1,Math.ceil(e.length/this.pageSize)),i=Math.max(1,Math.min(this.currentPage,t));i!==this.currentPage&&(this.currentPage=i);const a=(i-1)*this.pageSize;return e.slice(a,a+this.pageSize)}getTreeDisplayRows(e){const t=this.treeData.processData(this.getFilteredData()).map(e=>({data:e.data,index:this.indexOfRow(e.data),treeRow:e}));if(this.grouping.hasAggregation()){const e=this.getGroupingItems().find(e=>"aggregate"===e.type&&"table"===e.scope);e&&t.push({data:void 0,index:-1,groupItem:e})}if(!e||!this.pagination||"client"!==this.paginationMode)return t;const i=Math.max(1,Math.ceil(t.length/this.pageSize)),a=Math.max(1,Math.min(this.currentPage,i));a!==this.currentPage&&(this.currentPage=a);const s=(a-1)*this.pageSize;return t.slice(s,s+this.pageSize)}applyClientFilters(){this.invalidateFilteredCache(),this.dispatchFilterChange(),"remote"===this.mode?this.debouncedDataRequest():this.renderBody()}static{this.FILTER_INPUT_DEBOUNCE_MS=150}debouncedApplyClientFilters(){this.filterInputDebounceTimeout&&clearTimeout(this.filterInputDebounceTimeout),this.filterInputDebounceTimeout=setTimeout(()=>{this.filterInputDebounceTimeout=null,this.applyClientFilters()},Wi.FILTER_INPUT_DEBOUNCE_MS)}setColumnVisible(e,t){this.columnManager.setColumnVisible(e,t),this.renderHeader(),this.renderBody(),this.dispatchColumnVisibilityChange(e,t)}showAllColumns(){this.columnManager.showAllColumns(),this.renderHeader(),this.renderBody()}hideAllColumns(){this.columnManager.hideAllColumns(),this.renderHeader(),this.renderBody()}getColumnVisibility(){return this.columnManager.getVisibilityModel()}pinColumn(e,t){this.columnManager.pinColumn(e,t),this.renderHeader(),this.renderBody(),this.dispatchColumnPinChange(e,t)}unpinColumn(e){this.columnManager.unpinColumn(e),this.renderHeader(),this.renderBody(),this.dispatchColumnPinChange(e,!1)}autoSizeColumn(e){this.tbody&&(this.columnManager.autoSizeColumn(e,this.tbody),this.renderHeader())}autoSizeAllColumns(){this.tbody&&(this.columnManager.autoSizeAll(this.tbody),this.renderHeader())}moveColumn(e,t){this.columnManager.moveColumn(e,t),this.renderHeader(),this.renderBody(),this.dispatchColumnOrderChange(e,t)}setupEditor(){if(!this.editable)return;this.editor.attach(this),this.editor.setEditMode(this.editMode);const e=this.columns.filter(e=>!1!==e.editable).map(e=>e.key);this.editor.setEditableColumns(e);for(const e of this.columns)(e.valueGetter||e.valueFormatter||e.valueParser||e.valueSetter)&&this.editor.setPipeline(e.key,{valueGetter:e.valueGetter,valueFormatter:e.valueFormatter,valueParser:e.valueParser,valueSetter:e.valueSetter})}startEdit(e,t){if(!this.editable)return;const i=this.data[e];if(i){if(this.setupEditor(),"row"===this.editMode)this.editor.startRowEdit(e,i);else{const a=this.columns.find(e=>e.key===t);this.editor.startCellEdit(e,t,i[t],i,a?.editorType??a?.type)}this.renderBody(),this.focusActiveEditor()}}focusActiveEditor(){const e=this.tbody?.querySelector(".table-editor-input, .table-editor-checkbox, .table-editor-select");if(e&&(e.focus(),e instanceof HTMLInputElement&&("text"===e.type||"number"===e.type)))try{e.select()}catch{}}async commitEdit(){if("row"===this.editMode){const e=await this.editor.commitRowEdit();return this.renderBody(),e?"Validation errors":null}{const e=await this.editor.commitCellEdit();return this.renderBody(),e}}cancelEdit(){"row"===this.editMode?this.editor.cancelRowEdit():this.editor.cancelCellEdit(),this.renderBody()}exportCSV(e){const t=this.getFilteredData(),i=e?.selectedOnly?this.getSelectedRowsIn(t):t;this.exporter.exportCSV(i,this.columns,e)}printTable(e){this.exporter.print(this,e)}async copyToClipboard(e){const t=this.getFilteredData(),i=this.selectedRows.length>0?this.getSelectedRowsIn(t):t;return this.exporter.copyToClipboard(i,this.columns,e)}getSelectedRowsIn(e){const t=new Set(this.getSelectedData());return e.filter(e=>t.has(e))}hasSelectionColumn(){return this.selectable&&"none"!==this.selectionMode}getSlottedSelectionRows(){return this.shouldModelSlottedRows()?[]:Array.from(this.querySelectorAll('snice-row[slot="rows"]'))}getSelectionSourceRows(){const e=this.getSlottedSelectionRows();return e.length>0?e.map(e=>e.data):this.data}syncSlottedSelectionState(){const e=this.getSlottedSelectionRows();if(0===e.length)return;const t=this.hasSelectionColumn();let i=!1;e.forEach((e,a)=>{const s=!(!t||!this.selectabilityCheck||this.selectabilityCheck(e.data,a));e.index=a,e.selectable=t,e.selectionDisabled=s,!t||s?e.selected=!1:"single"===this.selectionMode&&e.selected&&(i?e.selected=!1:i=!0)}),this.selectedRows=e.map((e,t)=>e.selected&&!e.selectionDisabled?t:-1).filter(e=>e>=0)}getSelectableIndices(e){const t=[];for(const i of e){const e=this.indexOfRow(i);e<0||this.selectabilityCheck&&!this.selectabilityCheck(i,e)||t.push(e)}return t}applyRowSelection(e,t){if("none"===this.selectionMode)return;if(this.selectabilityCheck&&!this.selectabilityCheck(this.data[e],e))return;const i=this.data[e];if("single"===this.selectionMode)return this.selectedRows=[e],this.selectionAnchor=i,this.dispatchRowSelectionChanged(e,!0),void this.dispatchSelectionChanged();if(t.range&&null!=this.selectionAnchor)return this.selectRange(this.selectionAnchor,i),this.dispatchRowSelectionChanged(e,this.selectedRows.includes(e)),void this.dispatchSelectionChanged();const a=this.selectedRows.includes(e);this.selectedRows=a?this.selectedRows.filter(t=>t!==e):[...this.selectedRows,e],this.selectionAnchor=i,this.dispatchRowSelectionChanged(e,!a),this.dispatchSelectionChanged()}selectRange(e,t){const i=this.getFilteredData();let a=i.indexOf(e);const s=i.indexOf(t);if(-1===s)return;-1===a&&(a=s);const n=Math.min(a,s),l=Math.max(a,s),r=[];for(let e=n;e<=l;e++){const t=this.indexOfRow(i[e]);t<0||this.selectabilityCheck&&!this.selectabilityCheck(i[e],t)||r.push(t)}this.selectedRows=r}toggleRowSelection(e){this.applyRowSelection(e,{additive:!0,range:!1})}selectAllRows(){if("multiple"!==this.selectionMode)return;const e=this.getSelectableIndices(this.getFilteredData()),t=e.every(e=>this.selectedRows.includes(e));if(t)this.selectedRows=this.selectedRows.filter(t=>!e.includes(t));else{const t=new Set([...this.selectedRows,...e]);this.selectedRows=Array.from(t)}this.dispatchSelectAllChanged(t),this.dispatchSelectionChanged()}setDetailPanel(e){this.masterDetail.attach(this,e),this.masterDetail.onHeightChange=()=>{this.virtualize&&this.virtualizer.isEnabled()&&(this.virtualRowsSnapshot=this.getVirtualRows(),this.virtualizer.setTotalRows(this.virtualRowsSnapshot.length))},this.masterDetail.prepare(this.data),this.renderHeader(),this.renderBody()}expandRow(e){this.masterDetail.expand(e),this.renderBody()}collapseRow(e){this.masterDetail.collapse(e),this.renderBody()}toggleRowExpansion(e){this.masterDetail.toggle(e),this.renderBody()}expandAllRows(){this.masterDetail.expandAll(this.data.length),this.renderBody()}collapseAllRows(){this.masterDetail.collapseAll(),this.renderBody()}setToolbar(e){this.toolbarOptions=e;const t=this.shadowRoot?.querySelector(".table-controls-container");t&&(this.toolbar.attach(this,t,e),this.toolbar.setFilterEngine(this.filterEngine),this.toolbar.onSearch=e=>this.setQuickFilter(e),this.toolbar.onSortColumn=(e,t)=>{this.currentSort=[{column:e,direction:t}],this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.toolbar.onSetSortModel=e=>{this.currentSort=e,this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.toolbar.onFilterColumn=(e,t,i)=>{this.setColumnFilter(e,t,i)},this.toolbar.onRemoveFilter=e=>{this.removeColumnFilter(e)},this.toolbar.onSetFilterModel=(e,t)=>{this.filterEngine.clearAllFilters(),this.filterEngine.setFilterLogic(t);for(const t of e)this.filterEngine.setColumnFilter(t.column,t.operator,t.value);this.applyClientFilters()},this.toolbar.onClearFilters=()=>{this.clearAllFilters()},this.toolbar.onExportCSV=()=>this.exportCSV(),this.toolbar.onFullscreen=()=>this.toggleFullscreen())}setTreeData(e){this.treeData.attach(e),this.renderBody()}expandTreeNode(e){this.treeData.expand(e),this.renderBody()}collapseTreeNode(e){this.treeData.collapse(e),this.renderBody()}toggleTreeNode(e){this.treeData.toggle(e),this.renderBody()}expandAllTreeNodes(){this.treeData.expandAll(this.data),this.renderBody()}collapseAllTreeNodes(){this.treeData.collapseAll(),this.renderBody()}setColumnGroups(e){this.columnManager.setColumnGroups(e),this.renderHeader()}initColumnMenu(){this.columnMenu&&(this.columnMenuManager.attach(this),this.columnMenuManager.onSortAsc=e=>{this.currentSort=[{column:e,direction:"asc"}],this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.columnMenuManager.onSortDesc=e=>{this.currentSort=[{column:e,direction:"desc"}],this.dispatchSortChange(),this.renderHeader(),"remote"===this.mode?this.debouncedDataRequest():this.sortLocalData()},this.columnMenuManager.onFilter=e=>{this.toolbar.openFilterModal(e)},this.columnMenuManager.onHide=e=>this.setColumnVisible(e,!1),this.columnMenuManager.onPinLeft=e=>this.pinColumn(e,"left"),this.columnMenuManager.onPinRight=e=>this.pinColumn(e,"right"),this.columnMenuManager.onUnpin=e=>this.unpinColumn(e),this.columnMenuManager.onAutoSize=e=>this.autoSizeColumn(e))}pinRowTop(e){this.pinnedTopRows.push(e),this.renderBody()}pinRowBottom(e){this.pinnedBottomRows.push(e),this.renderBody()}unpinRow(e){this.pinnedTopRows=this.pinnedTopRows.filter(t=>t!==e),this.pinnedBottomRows=this.pinnedBottomRows.filter(t=>t!==e),this.renderBody()}clearPinnedRows(){this.pinnedTopRows=[],this.pinnedBottomRows=[],this.renderBody()}setRowHeight(e){this.rowHeight=e,this.renderBody()}setRowHeightCallback(e){this.rowHeightCallback=e,this.renderBody()}setSortComparator(e,t){const i=this.columns.find(t=>t.key===e);i&&(i.sortComparator=t)}setSelectabilityCheck(e){this.selectabilityCheck=e;const t=this.getSelectionSourceRows();this.selectedRows=this.selectedRows.filter(i=>{const a=t[i];return!!a&&e(a,i)}),this.syncSlottedSelectionState(),this.scheduleRender("both")}setCellEditableCheck(e){this.editor.setEditabilityCheck(e)}getSelectedData(){const e=this.getSelectionSourceRows();return this.selectedRows.map(t=>e[t]).filter(Boolean)}setupLazyLoading(){if(!this.lazyLoad)return;const e=this.getScrollContainer();e&&(this.lazyLoadHandler&&this.lazyLoadContainer?.removeEventListener("scroll",this.lazyLoadHandler),this.lazyLoadHandler=()=>{const{scrollTop:t,scrollHeight:i,clientHeight:a}=e;i-t-a<this.lazyLoadThreshold&&this.dispatchEvent(new CustomEvent("lazy-load",{detail:{currentCount:this.data.length},bubbles:!0,composed:!0}))},e.addEventListener("scroll",this.lazyLoadHandler,{passive:!0}),this.lazyLoadContainer=e)}scrollToColumn(e){const t=this.shadowRoot?.querySelector(`th[data-key="${e}"]`);t?.scrollIntoView({inline:"nearest",block:"nearest"})}setListViewRenderer(e){this.listViewRenderer=e,this.list&&(this.renderedRows=new Map,this.renderBody())}createRow(e,t,i){const a=document.createElement("tr");a.setAttribute("data-index",String(t)),this.rowHeightCallback?a.style.height=`${this.rowHeightCallback(e,t)}px`:48!==this.rowHeight&&(a.style.height=`${this.rowHeight}px`);const s=this.selectedRows.includes(t);if(a.setAttribute("data-selected",String(s)),this.rowReorder&&this.rowDnD.isEnabled()&&(a.appendChild(this.rowDnD.createDragHandle()),this.rowDnD.makeRowDraggable(a,t)),this.masterDetail.isEnabled()){const e=document.createElement("td");e.className="detail-toggle-cell",e.appendChild(this.masterDetail.createToggleButton(t)),a.appendChild(e)}if(this.hasSelectionColumn()){const i=document.createElement("td");i.className="select-column";const n=!(!this.selectabilityCheck||this.selectabilityCheck(e,t));i.innerHTML=`<snice-checkbox class="row-select" size="small" compact ${s?"checked":""} ${n?"disabled":""} data-row-index="${t}"></snice-checkbox>`,i.querySelector("snice-checkbox").disabled=n,a.appendChild(i)}const n=this.getVisibleColumnDefinitions();if(this.list&&this.listViewRenderer){const i=document.createElement("td");i.className="list-view-cell",i.colSpan=Math.max(1,n.length);const s=this.listViewRenderer(e,t);return s instanceof HTMLElement?i.appendChild(s):i.textContent=null==s?"":String(s),a.appendChild(i),a}let l=0;return n.forEach((s,n)=>{if(l>0)return void l--;const r=document.createElement("td");r.setAttribute("data-key",s.key);const o=e[s.key];this.applyCellPresentation(r,s,o,e);const c=s.colSpan;if(c){const t="function"==typeof c?c(o,e):c;t>1&&(r.colSpan=t,l=t-1)}const d=this.maybeCreateCellEditor(s,e,o,t);if(d)r.classList.add("editing"),r.appendChild(d);else if(i&&s.key===this.treeData.getGroupColumn()){const e=this.treeData.createToggle(i);r.appendChild(e);const t=document.createElement("span");t.textContent=null==o?"":String(o),i.hasChildren&&(t.style.cursor="pointer",t.addEventListener("click",e=>{e.stopPropagation(),this.treeData.toggle(i.key),this.renderBody()})),r.appendChild(t)}else r.appendChild(this.createCellElement(s,o,e));const h=this.columnManager.getState(s.key);if(h)if(r.style.width=`${h.width}px`,"left"===h.pinned){const e=this.columnManager.getPinnedLeftOffsets();r.classList.add("pinned-cell"),r.style.position="sticky",r.style.left=`${e.get(s.key)??0}px`,r.style.zIndex="1"}else if("right"===h.pinned){const e=this.columnManager.getPinnedRightOffsets();r.classList.add("pinned-cell"),r.style.position="sticky",r.style.right=`${e.get(s.key)??0}px`,r.style.zIndex="1"}a.appendChild(r)}),a}applyCellPresentation(e,t,i,a){const s=t=>{t&&(t.backgroundColor&&(e.style.backgroundColor=t.backgroundColor),t.color&&(e.style.color=t.color),t.fontWeight&&(e.style.fontWeight=t.fontWeight),t.fontStyle&&(e.style.fontStyle=t.fontStyle),t.fontSize&&(e.style.fontSize=t.fontSize),t.textDecoration&&(e.style.textDecoration=t.textDecoration))};s(t.style);for(const n of t.conditionalFormats||[])if(n.condition(i,a)){s(n.style),n.className&&e.classList.add(n.className);break}t.tooltip&&(e.title="function"==typeof t.tooltip?t.tooltip(i,a):null==i?"":String(i))}createGroupRow(e,t){const i=document.createElement("tr");i.className="group-header-row",i.setAttribute("data-group-key",e.key),i.setAttribute("data-depth",String(e.depth)),i.setAttribute("aria-label",`${null==e.value||""===e.value?"Blank":String(e.value)} group, ${e.count} rows`);const a=document.createElement("td");if(a.colSpan=t,a.className="group-header-cell",this.selectable&&"multiple"===this.selectionMode){const t=this.groupSelectionState(e),i=document.createElement("span");i.className="group-select-wrap";const s=document.createElement("snice-checkbox");s.className="group-select",s.setAttribute("size","small"),s.setAttribute("compact",""),s.setAttribute("data-group-key",e.key),s.setAttribute("aria-label",`Select all rows in ${null==e.value||""===e.value?"blank":String(e.value)} group`),s.checked="all"===t,s.indeterminate="some"===t,s.disabled=0===this.getSelectableGroupIndices(e).length,i.appendChild(s),a.appendChild(i)}const s=this.grouping.createToggle(e);a.appendChild(s);const n=document.createElement("span");n.className="group-header-label",n.textContent=null==e.value?"":String(e.value),a.appendChild(n);const l=document.createElement("span");return l.className="group-header-count",l.textContent=String(e.count),a.appendChild(l),i.appendChild(a),i}createAggregateRow(e,t){const i=document.createElement("tr");i.className="group-aggregate-row",i.setAttribute("data-agg-scope",e.scope),i.setAttribute("data-depth",String(e.depth)),e.groupKey&&i.setAttribute("data-group-key",e.groupKey);const a=null==e.groupValue||""===e.groupValue?"Blank":String(e.groupValue),s="table"===e.scope?"Total":`${e.groupColumn?`${e.groupColumn}: `:""}${a} subtotal`;if(i.setAttribute("aria-label",s),this.rowReorder&&this.rowDnD.isEnabled()){const e=document.createElement("td");e.className="drag-handle-cell",i.appendChild(e)}if(this.masterDetail.isEnabled()){const e=document.createElement("td");e.className="detail-toggle-cell",i.appendChild(e)}if(this.hasSelectionColumn()){const e=document.createElement("td");e.className="select-column",i.appendChild(e)}const n=this.getVisibleColumnDefinitions(),l=n.find(t=>!Object.prototype.hasOwnProperty.call(e.aggregates,t.key))?null:n[0]?.key;let r=!1;return n.forEach(t=>{const a=document.createElement("td");a.setAttribute("data-key",t.key),a.className="aggregate-cell";const n=Object.prototype.hasOwnProperty.call(e.aggregates,t.key);if(!n&&!r||n&&t.key===l){r=!0;const t=document.createElement("span");t.className="aggregate-label"+(n?" aggregate-label--inline":""),t.textContent=s,"group"===e.scope&&e.depth>0&&(t.style.paddingLeft=1.5*e.depth+"rem"),a.appendChild(t)}if(n){const i=e.aggregates[t.key];a.setAttribute("data-agg-value",String(i));const s=t.renderCell||!t.formatter&&t.valueFormatter?{...t,renderCell:void 0,formatter:t.formatter??t.valueFormatter}:t;a.appendChild(this.createCellElement(s,i))}const o=this.columnManager.getState(t.key);if(o)if(a.style.width=`${o.width}px`,"left"===o.pinned){const e=this.columnManager.getPinnedLeftOffsets();a.classList.add("pinned-cell"),a.style.position="sticky",a.style.left=`${e.get(t.key)??0}px`,a.style.zIndex="1"}else if("right"===o.pinned){const e=this.columnManager.getPinnedRightOffsets();a.classList.add("pinned-cell"),a.style.position="sticky",a.style.right=`${e.get(t.key)??0}px`,a.style.zIndex="1"}i.appendChild(a)}),i}groupSelectionState(e){const t=this.getSelectableGroupIndices(e);if(0===t.length)return"none";const i=t.filter(e=>this.selectedRows.includes(e)).length;return 0===i?"none":i===t.length?"all":"some"}getSelectableGroupIndices(e){const t=[];for(const i of e.rows){const e=this.indexOfRow(i);e<0||this.selectabilityCheck&&!this.selectabilityCheck(i,e)||t.push(e)}return t}toggleGroup(e){this.grouping.toggle(e.key),this.invalidateGroupingCache(),this.dispatchGroupToggle(e.key,e.value,this.grouping.isExpanded(e.key)),this.renderBody()}updateGroupSelectionStates(){if(!this.tbody||!this.grouping.hasGrouping()||!this.selectable)return;const e=this.getGroupingItems().filter(e=>"group"===e.type);if(0===e.length)return;const t=new Map(e.map(e=>[e.key,e]));this.tbody.querySelectorAll("tr.group-header-row").forEach(e=>{const i=e.getAttribute("data-group-key"),a=i?t.get(i):void 0;if(!a)return;const s=e.querySelector("snice-checkbox.group-select");if(!s)return;const n=this.groupSelectionState(a);s.checked="all"===n,s.indeterminate="some"===n})}dispatchGroupToggle(e,t,i){return{key:e,value:t,expanded:i}}maybeCreateCellEditor(e,t,i,a){if(!this.editable)return null;let s,n=!1,l=i;if("row"===this.editMode){const i=this.editor.getRowEditState();i?.isEditing&&i.rowIndex===a&&this.editor.isCellEditable(t,e.key)&&(n=!0,l=i.editedRow[e.key]),s=this.resolveEditorType(e)}else{const t=this.editor.getCellEditState();t?.isEditing&&t.rowIndex===a&&t.columnKey===e.key&&(n=!0,l=t.currentValue),s=t?.editorType??this.resolveEditorType(e)}if(!n)return null;if("function"==typeof e.renderEditor)return e.renderEditor(l,t,e,t=>{"row"===this.editMode?this.editor.updateRowField(e.key,t):this.editor.updateCellValue(t),this.commitEdit()},()=>this.cancelEdit());const r=this.editor.createEditor(s,l,e.selectOptions?{selectOptions:e.selectOptions}:void 0);return this.wireEditorElement(r,e),r}resolveEditorType(e){return e.editorType?e.editorType:this.editor.getEditorType(e.type||"text")}wireEditorElement(e,t){const i=e instanceof HTMLInputElement&&"checkbox"===e.type,a=()=>{const a=i?e.checked:e.value;"row"===this.editMode?this.editor.updateRowField(t.key,a):this.editor.updateCellValue(a)};e.addEventListener("input",a),e.addEventListener("change",a),e.addEventListener("keydown",e=>{"Enter"===e.key?(e.preventDefault(),a(),this.commitEdit()):"Escape"===e.key&&(e.preventDefault(),this.cancelEdit())}),e.addEventListener("blur",()=>{"row"!==this.editMode&&this.editor.isEditing()&&(a(),this.commitEdit())})}static{w(a,ut)}};Wi=a})(),(()=>{let a,n,c,u,p,g,b,f,v,k,S,E,D,A,R,M,z,$=[i("snice-header")],F=[],I=HTMLElement,T=[],L=[],V=[],B=[],O=[],j=[],P=[],N=[],H=[],q=[],_=[],G=[],K=[],W=[],U=[];(class extends I{static{n=this}static{const e="function"==typeof Symbol&&Symbol.metadata?Object.create(I[Symbol.metadata]??null):void 0;c=[s({type:Boolean})],u=[s({type:Array,attribute:!1})],p=[s({type:Boolean})],g=[s({type:Boolean})],b=[s({type:Object,attribute:!1})],f=[s({type:Boolean,attribute:"all-selected"})],v=[s({type:Boolean,attribute:"some-selected"})],k=[l()],S=[r()],E=[o()],D=[d("sticky","selectable","sortable")],A=[d("allSelected","someSelected")],R=[h("header-sort",{bubbles:!0,composed:!0})],M=[h("header-select-all",{bubbles:!0,composed:!0})],z=[h("header-filter",{bubbles:!0,composed:!0})],y(this,null,k,{kind:"method",name:"render",static:!1,private:!1,access:{has:e=>"render"in e,get:e=>e.render},metadata:e},null,T),y(this,null,S,{kind:"method",name:"styles",static:!1,private:!1,access:{has:e=>"styles"in e,get:e=>e.styles},metadata:e},null,T),y(this,null,E,{kind:"method",name:"init",static:!1,private:!1,access:{has:e=>"init"in e,get:e=>e.init},metadata:e},null,T),y(this,null,D,{kind:"method",name:"updateHeaderAttributes",static:!1,private:!1,access:{has:e=>"updateHeaderAttributes"in e,get:e=>e.updateHeaderAttributes},metadata:e},null,T),y(this,null,A,{kind:"method",name:"updateSelectAllCheckbox",static:!1,private:!1,access:{has:e=>"updateSelectAllCheckbox"in e,get:e=>e.updateSelectAllCheckbox},metadata:e},null,T),y(this,null,R,{kind:"method",name:"dispatchSort",static:!1,private:!1,access:{has:e=>"dispatchSort"in e,get:e=>e.dispatchSort},metadata:e},null,T),y(this,null,M,{kind:"method",name:"dispatchSelectAll",static:!1,private:!1,access:{has:e=>"dispatchSelectAll"in e,get:e=>e.dispatchSelectAll},metadata:e},null,T),y(this,null,z,{kind:"method",name:"dispatchFilter",static:!1,private:!1,access:{has:e=>"dispatchFilter"in e,get:e=>e.dispatchFilter},metadata:e},null,T),y(null,null,c,{kind:"field",name:"sticky",static:!1,private:!1,access:{has:e=>"sticky"in e,get:e=>e.sticky,set:(e,t)=>{e.sticky=t}},metadata:e},L,V),y(null,null,u,{kind:"field",name:"columns",static:!1,private:!1,access:{has:e=>"columns"in e,get:e=>e.columns,set:(e,t)=>{e.columns=t}},metadata:e},B,O),y(null,null,p,{kind:"field",name:"selectable",static:!1,private:!1,access:{has:e=>"selectable"in e,get:e=>e.selectable,set:(e,t)=>{e.selectable=t}},metadata:e},j,P),y(null,null,g,{kind:"field",name:"sortable",static:!1,private:!1,access:{has:e=>"sortable"in e,get:e=>e.sortable,set:(e,t)=>{e.sortable=t}},metadata:e},N,H),y(null,null,b,{kind:"field",name:"currentSort",static:!1,private:!1,access:{has:e=>"currentSort"in e,get:e=>e.currentSort,set:(e,t)=>{e.currentSort=t}},metadata:e},q,_),y(null,null,f,{kind:"field",name:"allSelected",static:!1,private:!1,access:{has:e=>"allSelected"in e,get:e=>e.allSelected,set:(e,t)=>{e.allSelected=t}},metadata:e},G,K),y(null,null,v,{kind:"field",name:"someSelected",static:!1,private:!1,access:{has:e=>"someSelected"in e,get:e=>e.someSelected,set:(e,t)=>{e.someSelected=t}},metadata:e},W,U),y(null,a={value:n},$,{kind:"class",name:n.name,metadata:e},null,F),n=a.value,e&&Object.defineProperty(n,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:e}),w(n,F)}render(){return e`
|
|
1628
|
+
<div class="header-container" part="container">
|
|
1629
|
+
<if ${this.selectable}>
|
|
1630
|
+
${this.renderSelectAllCheckbox()}
|
|
1631
|
+
</if>
|
|
1632
|
+
${this.renderHeaderCells()}
|
|
1633
|
+
</div>
|
|
1634
|
+
`}styles(){return m`${".header-container{display:flex;align-items:center;background:var(--snice-color-surface-container-low,rgb(245 245 245));border-bottom:1px solid var(--snice-color-border-subtle,var(--snice-color-border,rgb(226 226 226)));font-weight:var(--snice-font-weight-semibold,600);font-size:var(--snice-font-size-sm, .875rem);line-height:var(--snice-line-height-dense, 1.25);color:var(--snice-color-text,rgb(23 23 23))}.cells-container{display:flex;flex:1;color:var(--snice-color-text,rgb(23 23 23))}.header-cell{display:flex;align-items:center;justify-content:space-between;padding:var(--snice-spacing-sm,.75rem) var(--snice-spacing-md,1rem);border-right:1px solid var(--snice-color-border,rgb(226 226 226));min-height:var(--snice-spacing-2xl,3rem);position:relative;background:var(--snice-color-surface-container-low,rgb(245 245 245));transition:background-color var(--snice-transition-fast, 150ms) ease;color:var(--snice-color-text,rgb(23 23 23))}.header-cell:last-child{border-right:none}.header-cell--checkbox{width:var(--snice-spacing-2xl,3rem);min-width:var(--snice-spacing-2xl,3rem);max-width:var(--snice-spacing-2xl,3rem);padding:var(--snice-spacing-sm,.75rem);justify-content:center}.select-all-checkbox{width:1rem;height:1rem;cursor:pointer;margin:0;display:block;accent-color:var(--snice-color-primary,rgb(37 99 235))}.select-all-checkbox:indeterminate{opacity:.6}.header-cell-content{display:flex;align-items:center;gap:.5rem;flex:1;min-width:0}.header-cell-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-cell[data-sortable=true]{cursor:pointer;user-select:none}.header-cell[data-sortable=true]:hover{background-color:var(--snice-color-overlay-hover,rgb(0 0 0 / .04))}.header-cell[data-sortable=true]:focus-visible{outline:0;box-shadow:inset 0 0 0 2px var(--snice-color-primary,rgb(37 99 235))}.sort-indicator{display:inline-flex;align-items:center;justify-content:center;font-size:.75rem;color:var(--snice-color-text-secondary,rgb(82 82 82));transition:color .15s,transform .15s;line-height:1;min-width:.75rem}.sort-indicator svg{width:.875rem;height:.875rem}.sort-indicator--neutral{opacity:.5}.sort-indicator--ascending,.sort-indicator--descending{color:var(--snice-color-primary,rgb(37 99 235));opacity:1}.header-cell[data-sortable=true]:hover .sort-indicator--neutral{opacity:.8}.filter-button{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem;border:1px solid var(--snice-color-border,rgb(226 226 226));border-radius:.25rem;background:var(--snice-color-surface,rgb(255 255 255));color:var(--snice-color-text-secondary,rgb(82 82 82));cursor:pointer;font-size:.75rem;transition:.15s}.filter-button:hover{background:var(--snice-color-surface-hover,rgb(245 245 245));border-color:var(--snice-color-border,rgb(226 226 226));color:var(--snice-color-text,rgb(23 23 23))}.filter-button:focus-visible{outline:var(--snice-focus-ring-width,2px) solid var(--snice-focus-ring-color,rgb(37 99 235 / .5));outline-offset:-2px}.header-cell--currency,.header-cell--number,.header-cell--percent{text-align:right}.header-cell--date{min-width:8rem}.header-cell--boolean{min-width:4rem;text-align:center}.header-cell--rating{min-width:6rem;text-align:center}.header-cell--progress{min-width:8rem}.header-cell--sparkline{min-width:6rem;text-align:center}:host(.header--sticky) .header-container{position:sticky;top:0;z-index:10;box-shadow:var(--snice-shadow-sm,0 1px 2px 0 rgb(0 0 0 / .05))}:host(.header--selectable) .header-cell--checkbox{display:flex}:host(:not(.header--selectable)) .header-cell--checkbox{display:none}.header-cell--highlighted{background-color:var(--snice-color-warning-subtle,rgb(254 249 195))!important;animation:2s ease-out highlight-fade}@keyframes highlight-fade{0%{background-color:var(--snice-color-warning,rgb(234 179 8));opacity:.3}100%{background-color:var(--snice-color-warning-subtle,rgb(254 249 195));opacity:1}}@media (max-width:768px){.header-cell{padding:.5rem .75rem;font-size:.75rem;min-height:2.5rem}.header-cell-label{font-size:.75rem}.sort-indicator{font-size:.625rem}.filter-button{width:1.25rem;height:1.25rem;font-size:.625rem}}@media (prefers-reduced-motion:reduce){.filter-button,.header-cell,.sort-indicator{transition:none}.header-cell--highlighted{animation:none;background-color:var(--snice-color-warning-subtle,rgb(254 249 195))!important}}@media (prefers-contrast:high){.header-cell{border-right:2px solid}.header-container{border-bottom:3px solid}.filter-button{border:2px solid}}"}`}init(){this.updateHeaderAttributes()}updateHeaderAttributes(){this.classList.toggle("header--sticky",this.sticky),this.classList.toggle("header--selectable",this.selectable),this.classList.toggle("header--sortable",this.sortable)}updateSelectAllCheckbox(){const e=this.shadowRoot?.querySelector(".select-all-checkbox");e&&(e.checked=this.allSelected,e.indeterminate=this.someSelected&&!this.allSelected)}handleClick(e){const t=e.target.closest('.header-cell[data-sortable="true"]');if(!t)return;const i=t.dataset.columnKey;i&&this.sortable&&this.dispatchSort(i)}handleChange(e){const t=e.target;t.matches(".select-all-checkbox")&&this.dispatchSelectAll(t.checked)}handleKeyDown(e){const t=e.target.closest('.header-cell[data-sortable="true"]');if(t&&("Enter"===e.key||" "===e.key)){e.preventDefault();const i=t.dataset.columnKey;i&&this.sortable&&this.dispatchSort(i)}}renderSelectAllCheckbox(){return e`
|
|
1635
|
+
<div class="header-cell header-cell--checkbox" part="checkbox-cell">
|
|
1636
|
+
<input
|
|
1637
|
+
type="checkbox"
|
|
1638
|
+
class="select-all-checkbox"
|
|
1639
|
+
?checked=${this.allSelected}
|
|
1640
|
+
title="Select all rows"
|
|
1641
|
+
tabindex="0"
|
|
1642
|
+
@change=${e=>this.handleChange(e)}
|
|
1643
|
+
/>
|
|
1644
|
+
</div>
|
|
1645
|
+
`}renderHeaderCells(){return this.columns.length?e`
|
|
1646
|
+
<div class="cells-container" @click=${e=>this.handleClick(e)} @keydown=${e=>this.handleKeyDown(e)}>
|
|
1647
|
+
${this.columns.map((e,t)=>this.renderHeaderCell(e,t))}
|
|
1648
|
+
</div>
|
|
1649
|
+
`:e``}renderHeaderCell(t,i){const a=this.sortable&&!1!==t.sortable,s=this.currentSort.column===t.key,n=s?this.currentSort.direction:null;return e`
|
|
1650
|
+
<div
|
|
1651
|
+
class="header-cell header-cell--${t.type||"text"}"
|
|
1652
|
+
part="cell"
|
|
1653
|
+
data-column-key="${t.key}"
|
|
1654
|
+
data-column-index="${i}"
|
|
1655
|
+
data-sortable="${a}"
|
|
1656
|
+
style="${this.getHeaderCellStyles(t)}"
|
|
1657
|
+
role="${a?"button":""}"
|
|
1658
|
+
tabindex="${a?"0":""}"
|
|
1659
|
+
aria-label="${a?`Sort by ${t.label}`:""}"
|
|
1660
|
+
aria-sort="${s?this.getAriaSortValue(n):""}"
|
|
1661
|
+
>
|
|
1662
|
+
<div class="header-cell-content">
|
|
1663
|
+
<span class="header-cell-label">${t.label}</span>
|
|
1664
|
+
<if ${a}>
|
|
1665
|
+
${this.renderSortIndicator(n)}
|
|
1666
|
+
</if>
|
|
1667
|
+
</div>
|
|
1668
|
+
<if ${t.filterable}>
|
|
1669
|
+
${this.renderFilterButton(t)}
|
|
1670
|
+
</if>
|
|
1671
|
+
</div>
|
|
1672
|
+
`}renderSortIndicator(i){let a='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m8 9 4-4 4 4M8 15l4 4 4-4"/></svg>',s="neutral";return"asc"===i?(a=C,s="ascending"):"desc"===i&&(a=x,s="descending"),e`
|
|
1673
|
+
<span
|
|
1674
|
+
class="sort-indicator sort-indicator--${s}"
|
|
1675
|
+
part="sort-indicator"
|
|
1676
|
+
aria-hidden="true"
|
|
1677
|
+
>${t(a)}</span>
|
|
1678
|
+
`}renderFilterButton(t){return e`
|
|
1679
|
+
<button
|
|
1680
|
+
class="filter-button"
|
|
1681
|
+
part="filter-button"
|
|
1682
|
+
data-column-key="${t.key}"
|
|
1683
|
+
title="Filter ${t.label}"
|
|
1684
|
+
tabindex="-1"
|
|
1685
|
+
>
|
|
1686
|
+
🔽
|
|
1687
|
+
</button>
|
|
1688
|
+
`}getHeaderCellStyles(e){let t=[];return e.width&&(t.push(`width: ${e.width}`),t.push(`min-width: ${e.width}`),t.push(`max-width: ${e.width}`)),e.align&&t.push(`text-align: ${e.align}`),t.join("; ")}getAriaSortValue(e){switch(e){case"asc":return"ascending";case"desc":return"descending";default:return"none"}}dispatchSort(e){return{column:e}}dispatchSelectAll(e){return{checked:e}}dispatchFilter(e){return{column:e}}setSortState(e,t){this.currentSort={column:e,direction:t}}setSelectionState(e,t=!1){this.allSelected=e,this.someSelected=t&&!e}getColumnElement(e){return this.shadowRoot?.querySelector(`[data-column-key="${e}"]`)||null}updateColumns(e){this.columns=e}highlightColumn(e,t=2e3){const i=this.getColumnElement(e);i&&(i.classList.add("header-cell--highlighted"),setTimeout(()=>{i.classList.remove("header-cell--highlighted")},t))}constructor(){super(...arguments),this.sticky=(w(this,T),w(this,L,!1)),this.columns=(w(this,V),w(this,B,[])),this.selectable=(w(this,O),w(this,j,!1)),this.sortable=(w(this,P),w(this,N,!1)),this.currentSort=(w(this,H),w(this,q,{column:"",direction:null})),this.allSelected=(w(this,_),w(this,G,!1)),this.someSelected=(w(this,K),w(this,W,!1)),w(this,U)}})})();
|
|
1628
1689
|
//# sourceMappingURL=snice-table.esm.min.js.map
|