@sken-ds/primitives 0.3.0 → 0.3.4

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sken-datatable-BtR-NwRN.js","names":["#host","#getStore","#selector","#compare","#lastSelected","#subscribedStore","#unsubscribe","#hasSelected","o","i","n","e","c","f","r","s","h","s","n","e","t","i","AsyncDirective","directive","s","s","t","t","createContext","ContextConsumer","ContextProvider","#tableController","#warnIfNoGetRowId","#uncontrolledPagination","#renderEmpty","#getTableController","#features","#fuzzyFilter","#uncontrolledSorting","#uncontrolledGlobalFilter"],"sources":["../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/flexRender.js","../../../node_modules/.pnpm/@tanstack+lit-store@0.14.0_lit@3.3.3/node_modules/@tanstack/lit-store/dist/tan-stack-store-selector.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/alien.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/atom.js","../../../node_modules/.pnpm/@tanstack+store@0.11.0/node_modules/@tanstack/store/dist/shallow.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directive-helpers.js","../../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/async-directive.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/subscribe-directive.js","../../../node_modules/.pnpm/@tanstack+table-core@9.0.0/node_modules/@tanstack/table-core/dist/core/reactivity/renderPhaseReactivity.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/reactivity.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/TableController.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/value-notifier.js","../../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/createTableHook.js","../../../node_modules/.pnpm/@tanstack+lit-table@9.0.0_@lit+context@1.1.6_lit@3.3.3/node_modules/@tanstack/lit-table/dist/index.js","../../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/remove-accents.js","../../../node_modules/.pnpm/@tanstack+match-sorter-utils@9.0.0/node_modules/@tanstack/match-sorter-utils/dist/index.js","../src/components/sken-datatable.ts"],"sourcesContent":["//#region src/flexRender.ts\n/**\n* Renders a Lit table template value with the provided context props.\n*\n* Use this lower-level helper for custom header, cell, or footer renderers when\n* you already have the render function and context. `FlexRender` is the\n* convenience wrapper for table cell/header/footer objects.\n*\n* @example\n* ```ts\n* flexRender(cell.column.columnDef.cell, cell.getContext())\n* ```\n*/\nfunction flexRender(Comp, props) {\n\tif (Comp === null || Comp === void 0) return null;\n\tif (typeof Comp === \"function\") return Comp(props);\n\treturn Comp;\n}\n/**\n* Simplified component wrapper of `flexRender`. Use this utility function to render headers, cells, or footers with custom markup.\n* Only one prop (`cell`, `header`, or `footer`) may be passed.\n* @example\n* ```ts\n* ${FlexRender({ cell })}\n* ${FlexRender({ header })}\n* ${FlexRender({ footer: header })}\n* ```\n*\n* This replaces calling `flexRender` directly like this:\n* ```ts\n* flexRender(cell.column.columnDef.cell, cell.getContext())\n* flexRender(header.column.columnDef.header, header.getContext())\n* flexRender(footer.column.columnDef.footer, footer.getContext())\n* ```\n*/\nfunction FlexRender(props) {\n\tif (\"cell\" in props && props.cell) {\n\t\tconst cell = props.cell;\n\t\tconst columnDef = cell.column.columnDef;\n\t\tconst groupingCell = cell;\n\t\tconst groupingColumnDef = columnDef;\n\t\tif (groupingCell.getIsAggregated?.()) return flexRender(groupingColumnDef.aggregatedCell ?? columnDef.cell, cell.getContext());\n\t\tif (groupingCell.getIsPlaceholder?.()) return null;\n\t\treturn flexRender(columnDef.cell, cell.getContext());\n\t}\n\tif (\"header\" in props && props.header) return flexRender(props.header.column.columnDef.header, props.header.getContext());\n\tif (\"footer\" in props && props.footer) return flexRender(props.footer.column.columnDef.footer, props.footer.getContext());\n\treturn null;\n}\n\n//#endregion\nexport { FlexRender, flexRender };","//#region src/tan-stack-store-selector.ts\nfunction defaultCompare(a, b) {\n\treturn a === b;\n}\nfunction defaultSelector(snapshot) {\n\treturn snapshot;\n}\n/**\n* Subscribes a Lit host to a TanStack Store and exposes a selected slice of its state.\n*\n* The host will only re-render when the selected value actually changes\n* (according to the configured `compare` function).\n*\n* @example\n* ```ts\n* class UserNameEl extends LitElement {\n* #name = new TanStackStoreSelector(\n* this,\n* () => userStore,\n* (snapshot) => snapshot.name,\n* )\n*\n* render() {\n* return html`<p>${this.#name.value}</p>`\n* }\n* }\n* ```\n*\n* @example\n* ```ts\n* class UserNameEl extends LitElement {\n* _ = new TanStackStoreAtom(\n* this,\n* () => userStore,\n* (snapshot) => snapshot.name,\n* )\n*\n* render() {\n* return html`<p>${userStore.state.name}</p>`\n* }\n* }\n* ```\n*\n*/\nvar TanStackStoreSelector = class {\n\t#host;\n\t#getStore;\n\t#selector;\n\t#compare;\n\t#unsubscribe;\n\t#subscribedStore;\n\t#hasSelected = false;\n\t#lastSelected;\n\tconstructor(host, getStore, selector = defaultSelector, options) {\n\t\tthis.#host = host;\n\t\tthis.#getStore = getStore;\n\t\tthis.#selector = selector;\n\t\tthis.#compare = options?.compare ?? defaultCompare;\n\t\thost.addController(this);\n\t}\n\tget value() {\n\t\treturn this.#lastSelected;\n\t}\n\thostUpdate() {\n\t\tconst store = this.#getStore();\n\t\tif (store === this.#subscribedStore) return;\n\t\tthis.#unsubscribe?.();\n\t\tthis.#subscribedStore = store;\n\t\tif (!store) {\n\t\t\tthis.#unsubscribe = void 0;\n\t\t\tthis.#hasSelected = false;\n\t\t\tthis.#lastSelected = void 0;\n\t\t\treturn;\n\t\t}\n\t\tthis.#lastSelected = this.#selector(store.get());\n\t\tthis.#hasSelected = true;\n\t\tthis.#unsubscribe = store.subscribe((value) => {\n\t\t\tconst next = this.#selector(value);\n\t\t\tif (this.#hasSelected && this.#compare(this.#lastSelected, next)) return;\n\t\t\tthis.#lastSelected = next;\n\t\t\tthis.#hasSelected = true;\n\t\t\tthis.#host.requestUpdate();\n\t\t}).unsubscribe;\n\t}\n\thostDisconnected() {\n\t\tthis.#unsubscribe?.();\n\t\tthis.#unsubscribe = void 0;\n\t\tthis.#subscribedStore = void 0;\n\t\tthis.#hasSelected = false;\n\t\tthis.#lastSelected = void 0;\n\t}\n};\n\n//#endregion\nexport { TanStackStoreSelector };\n//# sourceMappingURL=tan-stack-store-selector.js.map","//#region src/alien.ts\nlet ReactiveFlags = /* @__PURE__ */ function(ReactiveFlags) {\n\tReactiveFlags[ReactiveFlags[\"None\"] = 0] = \"None\";\n\tReactiveFlags[ReactiveFlags[\"Mutable\"] = 1] = \"Mutable\";\n\tReactiveFlags[ReactiveFlags[\"Watching\"] = 2] = \"Watching\";\n\tReactiveFlags[ReactiveFlags[\"RecursedCheck\"] = 4] = \"RecursedCheck\";\n\tReactiveFlags[ReactiveFlags[\"Recursed\"] = 8] = \"Recursed\";\n\tReactiveFlags[ReactiveFlags[\"Dirty\"] = 16] = \"Dirty\";\n\tReactiveFlags[ReactiveFlags[\"Pending\"] = 32] = \"Pending\";\n\treturn ReactiveFlags;\n}({});\n/* @__NO_SIDE_EFFECTS__ */\nfunction createReactiveSystem({ update, notify, unwatched }) {\n\treturn {\n\t\tlink,\n\t\tunlink,\n\t\tpropagate,\n\t\tcheckDirty,\n\t\tshallowPropagate\n\t};\n\tfunction link(dep, sub, version) {\n\t\tconst prevDep = sub.depsTail;\n\t\tif (prevDep !== void 0 && prevDep.dep === dep) return;\n\t\tconst nextDep = prevDep !== void 0 ? prevDep.nextDep : sub.deps;\n\t\tif (nextDep !== void 0 && nextDep.dep === dep) {\n\t\t\tnextDep.version = version;\n\t\t\tsub.depsTail = nextDep;\n\t\t\treturn;\n\t\t}\n\t\tconst prevSub = dep.subsTail;\n\t\tif (prevSub !== void 0 && prevSub.version === version && prevSub.sub === sub) return;\n\t\tconst newLink = sub.depsTail = dep.subsTail = {\n\t\t\tversion,\n\t\t\tdep,\n\t\t\tsub,\n\t\t\tprevDep,\n\t\t\tnextDep,\n\t\t\tprevSub,\n\t\t\tnextSub: void 0\n\t\t};\n\t\tif (nextDep !== void 0) nextDep.prevDep = newLink;\n\t\tif (prevDep !== void 0) prevDep.nextDep = newLink;\n\t\telse sub.deps = newLink;\n\t\tif (prevSub !== void 0) prevSub.nextSub = newLink;\n\t\telse dep.subs = newLink;\n\t}\n\tfunction unlink(link, sub = link.sub) {\n\t\tconst dep = link.dep;\n\t\tconst prevDep = link.prevDep;\n\t\tconst nextDep = link.nextDep;\n\t\tconst nextSub = link.nextSub;\n\t\tconst prevSub = link.prevSub;\n\t\tif (nextDep !== void 0) nextDep.prevDep = prevDep;\n\t\telse sub.depsTail = prevDep;\n\t\tif (prevDep !== void 0) prevDep.nextDep = nextDep;\n\t\telse sub.deps = nextDep;\n\t\tif (nextSub !== void 0) nextSub.prevSub = prevSub;\n\t\telse dep.subsTail = prevSub;\n\t\tif (prevSub !== void 0) prevSub.nextSub = nextSub;\n\t\telse if ((dep.subs = nextSub) === void 0) unwatched(dep);\n\t\treturn nextDep;\n\t}\n\tfunction propagate(link) {\n\t\tlet next = link.nextSub;\n\t\tlet stack;\n\t\ttop: do {\n\t\t\tconst sub = link.sub;\n\t\t\tlet flags = sub.flags;\n\t\t\tif (!(flags & (ReactiveFlags.RecursedCheck | ReactiveFlags.Recursed | ReactiveFlags.Dirty | ReactiveFlags.Pending))) sub.flags = flags | ReactiveFlags.Pending;\n\t\t\telse if (!(flags & (ReactiveFlags.RecursedCheck | ReactiveFlags.Recursed))) flags = ReactiveFlags.None;\n\t\t\telse if (!(flags & ReactiveFlags.RecursedCheck)) sub.flags = flags & ~ReactiveFlags.Recursed | ReactiveFlags.Pending;\n\t\t\telse if (!(flags & (ReactiveFlags.Dirty | ReactiveFlags.Pending)) && isValidLink(link, sub)) {\n\t\t\t\tsub.flags = flags | (ReactiveFlags.Recursed | ReactiveFlags.Pending);\n\t\t\t\tflags &= ReactiveFlags.Mutable;\n\t\t\t} else flags = ReactiveFlags.None;\n\t\t\tif (flags & ReactiveFlags.Watching) notify(sub);\n\t\t\tif (flags & ReactiveFlags.Mutable) {\n\t\t\t\tconst subSubs = sub.subs;\n\t\t\t\tif (subSubs !== void 0) {\n\t\t\t\t\tconst nextSub = (link = subSubs).nextSub;\n\t\t\t\t\tif (nextSub !== void 0) {\n\t\t\t\t\t\tstack = {\n\t\t\t\t\t\t\tvalue: next,\n\t\t\t\t\t\t\tprev: stack\n\t\t\t\t\t\t};\n\t\t\t\t\t\tnext = nextSub;\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ((link = next) !== void 0) {\n\t\t\t\tnext = link.nextSub;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\twhile (stack !== void 0) {\n\t\t\t\tlink = stack.value;\n\t\t\t\tstack = stack.prev;\n\t\t\t\tif (link !== void 0) {\n\t\t\t\t\tnext = link.nextSub;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t} while (true);\n\t}\n\tfunction checkDirty(link, sub) {\n\t\tlet stack;\n\t\tlet checkDepth = 0;\n\t\tlet dirty = false;\n\t\ttop: do {\n\t\t\tconst dep = link.dep;\n\t\t\tconst flags = dep.flags;\n\t\t\tif (sub.flags & ReactiveFlags.Dirty) dirty = true;\n\t\t\telse if ((flags & (ReactiveFlags.Mutable | ReactiveFlags.Dirty)) === (ReactiveFlags.Mutable | ReactiveFlags.Dirty)) {\n\t\t\t\tif (update(dep)) {\n\t\t\t\t\tconst subs = dep.subs;\n\t\t\t\t\tif (subs.nextSub !== void 0) shallowPropagate(subs);\n\t\t\t\t\tdirty = true;\n\t\t\t\t}\n\t\t\t} else if ((flags & (ReactiveFlags.Mutable | ReactiveFlags.Pending)) === (ReactiveFlags.Mutable | ReactiveFlags.Pending)) {\n\t\t\t\tif (link.nextSub !== void 0 || link.prevSub !== void 0) stack = {\n\t\t\t\t\tvalue: link,\n\t\t\t\t\tprev: stack\n\t\t\t\t};\n\t\t\t\tlink = dep.deps;\n\t\t\t\tsub = dep;\n\t\t\t\t++checkDepth;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!dirty) {\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (checkDepth--) {\n\t\t\t\tconst firstSub = sub.subs;\n\t\t\t\tconst hasMultipleSubs = firstSub.nextSub !== void 0;\n\t\t\t\tif (hasMultipleSubs) {\n\t\t\t\t\tlink = stack.value;\n\t\t\t\t\tstack = stack.prev;\n\t\t\t\t} else link = firstSub;\n\t\t\t\tif (dirty) {\n\t\t\t\t\tif (update(sub)) {\n\t\t\t\t\t\tif (hasMultipleSubs) shallowPropagate(firstSub);\n\t\t\t\t\t\tsub = link.sub;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tdirty = false;\n\t\t\t\t} else sub.flags &= ~ReactiveFlags.Pending;\n\t\t\t\tsub = link.sub;\n\t\t\t\tconst nextDep = link.nextDep;\n\t\t\t\tif (nextDep !== void 0) {\n\t\t\t\t\tlink = nextDep;\n\t\t\t\t\tcontinue top;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn dirty;\n\t\t} while (true);\n\t}\n\tfunction shallowPropagate(link) {\n\t\tdo {\n\t\t\tconst sub = link.sub;\n\t\t\tconst flags = sub.flags;\n\t\t\tif ((flags & (ReactiveFlags.Pending | ReactiveFlags.Dirty)) === ReactiveFlags.Pending) {\n\t\t\t\tsub.flags = flags | ReactiveFlags.Dirty;\n\t\t\t\tif ((flags & (ReactiveFlags.Watching | ReactiveFlags.RecursedCheck)) === ReactiveFlags.Watching) notify(sub);\n\t\t\t}\n\t\t} while ((link = link.nextSub) !== void 0);\n\t}\n\tfunction isValidLink(checkLink, sub) {\n\t\tlet link = sub.depsTail;\n\t\twhile (link !== void 0) {\n\t\t\tif (link === checkLink) return true;\n\t\t\tlink = link.prevDep;\n\t\t}\n\t\treturn false;\n\t}\n}\n\n//#endregion\nexport { ReactiveFlags, createReactiveSystem };\n//# sourceMappingURL=alien.js.map","import { ReactiveFlags, createReactiveSystem } from \"./alien.js\";\n\n//#region src/atom.ts\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n\tconst isObserver = typeof nextHandler === \"object\";\n\tconst self = isObserver ? nextHandler : void 0;\n\treturn {\n\t\tnext: (isObserver ? nextHandler.next : nextHandler)?.bind(self),\n\t\terror: (isObserver ? nextHandler.error : errorHandler)?.bind(self),\n\t\tcomplete: (isObserver ? nextHandler.complete : completionHandler)?.bind(self)\n\t};\n}\nconst queuedEffects = [];\nlet cycle = 0;\nconst { link, unlink, propagate, checkDirty, shallowPropagate } = /* @__PURE__ */ createReactiveSystem({\n\tupdate(atom) {\n\t\treturn atom._update();\n\t},\n\tnotify(effect) {\n\t\tqueuedEffects[queuedEffectsLength++] = effect;\n\t\teffect.flags &= ~ReactiveFlags.Watching;\n\t},\n\tunwatched(atom) {\n\t\tif (atom.depsTail !== void 0) {\n\t\t\tatom.depsTail = void 0;\n\t\t\tatom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n\t\t\tpurgeDeps(atom);\n\t\t}\n\t}\n});\nlet notifyIndex = 0;\nlet queuedEffectsLength = 0;\nlet activeSub;\nlet batchDepth = 0;\nfunction batch(fn) {\n\ttry {\n\t\t++batchDepth;\n\t\tfn();\n\t} finally {\n\t\tif (!--batchDepth) flush();\n\t}\n}\nfunction purgeDeps(sub) {\n\tconst depsTail = sub.depsTail;\n\tlet dep = depsTail !== void 0 ? depsTail.nextDep : sub.deps;\n\twhile (dep !== void 0) dep = unlink(dep, sub);\n}\nfunction flush() {\n\tif (batchDepth > 0) return;\n\twhile (notifyIndex < queuedEffectsLength) {\n\t\tconst effect = queuedEffects[notifyIndex];\n\t\tqueuedEffects[notifyIndex++] = void 0;\n\t\teffect.notify();\n\t}\n\tnotifyIndex = 0;\n\tqueuedEffectsLength = 0;\n}\nfunction createAsyncAtom(getValue, options) {\n\tconst ref = {};\n\tconst atom = createAtom(() => {\n\t\tgetValue().then((data) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"done\",\n\t\t\t\tdata\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t}, (error) => {\n\t\t\tconst internalAtom = ref.current;\n\t\t\tif (internalAtom._update({\n\t\t\t\tstatus: \"error\",\n\t\t\t\terror\n\t\t\t})) {\n\t\t\t\tconst subs = internalAtom.subs;\n\t\t\t\tif (subs !== void 0) {\n\t\t\t\t\tpropagate(subs);\n\t\t\t\t\tshallowPropagate(subs);\n\t\t\t\t\tflush();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { status: \"pending\" };\n\t}, options);\n\tref.current = atom;\n\treturn atom;\n}\nfunction createAtom(valueOrFn, options) {\n\tconst isComputed = typeof valueOrFn === \"function\";\n\tconst getter = valueOrFn;\n\tconst atom = {\n\t\t_snapshot: isComputed ? void 0 : valueOrFn,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tflags: isComputed ? ReactiveFlags.None : ReactiveFlags.Mutable,\n\t\tget() {\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t},\n\t\tsubscribe(observerOrFn) {\n\t\t\tconst obs = toObserver(observerOrFn);\n\t\t\tconst observed = { current: false };\n\t\t\tconst e = effect(() => {\n\t\t\t\tatom.get();\n\t\t\t\tif (!observed.current) observed.current = true;\n\t\t\t\telse obs.next?.(atom._snapshot);\n\t\t\t});\n\t\t\treturn { unsubscribe: () => {\n\t\t\t\te.stop();\n\t\t\t} };\n\t\t},\n\t\t_update(getValue) {\n\t\t\tconst prevSub = activeSub;\n\t\t\tconst compare = options?.compare ?? Object.is;\n\t\t\tif (isComputed) {\n\t\t\t\tactiveSub = atom;\n\t\t\t\t++cycle;\n\t\t\t\tatom.depsTail = void 0;\n\t\t\t} else if (getValue === void 0) return false;\n\t\t\tif (isComputed) atom.flags = ReactiveFlags.Mutable | ReactiveFlags.RecursedCheck;\n\t\t\ttry {\n\t\t\t\tconst oldValue = atom._snapshot;\n\t\t\t\tconst newValue = typeof getValue === \"function\" ? getValue(oldValue) : getValue === void 0 && isComputed ? getter(oldValue) : getValue;\n\t\t\t\tif (oldValue === void 0 || !compare(oldValue, newValue)) {\n\t\t\t\t\tatom._snapshot = newValue;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t} finally {\n\t\t\t\tactiveSub = prevSub;\n\t\t\t\tif (isComputed) atom.flags &= ~ReactiveFlags.RecursedCheck;\n\t\t\t\tpurgeDeps(atom);\n\t\t\t}\n\t\t}\n\t};\n\tif (isComputed) {\n\t\tatom.flags = ReactiveFlags.Mutable | ReactiveFlags.Dirty;\n\t\tatom.get = function() {\n\t\t\tconst flags = atom.flags;\n\t\t\tif (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(atom.deps, atom)) {\n\t\t\t\tif (atom._update()) {\n\t\t\t\t\tconst subs = atom.subs;\n\t\t\t\t\tif (subs !== void 0) shallowPropagate(subs);\n\t\t\t\t}\n\t\t\t} else if (flags & ReactiveFlags.Pending) atom.flags = flags & ~ReactiveFlags.Pending;\n\t\t\tif (activeSub !== void 0) link(atom, activeSub, cycle);\n\t\t\treturn atom._snapshot;\n\t\t};\n\t} else atom.set = function(valueOrFn) {\n\t\tif (atom._update(valueOrFn)) {\n\t\t\tconst subs = atom.subs;\n\t\t\tif (subs !== void 0) {\n\t\t\t\tpropagate(subs);\n\t\t\t\tshallowPropagate(subs);\n\t\t\t\tflush();\n\t\t\t}\n\t\t}\n\t};\n\treturn atom;\n}\nfunction effect(fn) {\n\tconst run = () => {\n\t\tconst prevSub = activeSub;\n\t\tactiveSub = effectObj;\n\t\t++cycle;\n\t\teffectObj.depsTail = void 0;\n\t\teffectObj.flags = ReactiveFlags.Watching | ReactiveFlags.RecursedCheck;\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tactiveSub = prevSub;\n\t\t\teffectObj.flags &= ~ReactiveFlags.RecursedCheck;\n\t\t\tpurgeDeps(effectObj);\n\t\t}\n\t};\n\tconst effectObj = {\n\t\tdeps: void 0,\n\t\tdepsTail: void 0,\n\t\tsubs: void 0,\n\t\tsubsTail: void 0,\n\t\tflags: ReactiveFlags.Watching | ReactiveFlags.RecursedCheck,\n\t\tnotify() {\n\t\t\tconst flags = this.flags;\n\t\t\tif (flags & ReactiveFlags.Dirty || flags & ReactiveFlags.Pending && checkDirty(this.deps, this)) run();\n\t\t\telse this.flags = ReactiveFlags.Watching;\n\t\t},\n\t\tstop() {\n\t\t\tthis.flags = ReactiveFlags.None;\n\t\t\tthis.depsTail = void 0;\n\t\t\tpurgeDeps(this);\n\t\t}\n\t};\n\trun();\n\treturn effectObj;\n}\n\n//#endregion\nexport { batch, createAsyncAtom, createAtom, flush, toObserver };\n//# sourceMappingURL=atom.js.map","//#region src/shallow.ts\nfunction shallow(objA, objB) {\n\tif (Object.is(objA, objB)) return true;\n\tif (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) return false;\n\tif (objA instanceof Map && objB instanceof Map) {\n\t\tif (objA.size !== objB.size) return false;\n\t\tfor (const [k, v] of objA) if (!objB.has(k) || !Object.is(v, objB.get(k))) return false;\n\t\treturn true;\n\t}\n\tif (objA instanceof Set && objB instanceof Set) {\n\t\tif (objA.size !== objB.size) return false;\n\t\tfor (const v of objA) if (!objB.has(v)) return false;\n\t\treturn true;\n\t}\n\tif (objA instanceof Date && objB instanceof Date) {\n\t\tif (objA.getTime() !== objB.getTime()) return false;\n\t\treturn true;\n\t}\n\tconst keysA = getOwnKeys(objA);\n\tif (keysA.length !== getOwnKeys(objB).length) return false;\n\tfor (let i = 0; i < keysA.length; i++) if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !Object.is(objA[keysA[i]], objB[keysA[i]])) return false;\n\treturn true;\n}\nfunction getOwnKeys(obj) {\n\treturn Object.keys(obj).concat(Object.getOwnPropertySymbols(obj));\n}\n\n//#endregion\nexport { shallow };\n//# sourceMappingURL=shallow.js.map","import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n","import{isSingleExpression as i}from\"./directive-helpers.js\";import{Directive as t,PartType as e}from\"./directive.js\";export{directive}from\"./directive.js\";\n/**\n * @license\n * Copyright 2017 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const s=(i,t)=>{const e=i._$AN;if(void 0===e)return!1;for(const i of e)i._$AO?.(t,!1),s(i,t);return!0},o=i=>{let t,e;do{if(void 0===(t=i._$AM))break;e=t._$AN,e.delete(i),i=t}while(0===e?.size)},r=i=>{for(let t;t=i._$AM;i=t){let e=t._$AN;if(void 0===e)t._$AN=e=new Set;else if(e.has(i))break;e.add(i),c(t)}};function h(i){void 0!==this._$AN?(o(this),this._$AM=i,r(this)):this._$AM=i}function n(i,t=!1,e=0){const r=this._$AH,h=this._$AN;if(void 0!==h&&0!==h.size)if(t)if(Array.isArray(r))for(let i=e;i<r.length;i++)s(r[i],!1),o(r[i]);else null!=r&&(s(r,!1),o(r));else s(this,i)}const c=i=>{i.type==e.CHILD&&(i._$AP??=n,i._$AQ??=h)};class f extends t{constructor(){super(...arguments),this._$AN=void 0}_$AT(i,t,e){super._$AT(i,t,e),r(this),this.isConnected=i._$AU}_$AO(i,t=!0){i!==this.isConnected&&(this.isConnected=i,i?this.reconnected?.():this.disconnected?.()),t&&(s(this,i),o(this))}setValue(t){if(i(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}export{f as AsyncDirective,t as Directive,e as PartType};\n//# sourceMappingURL=async-directive.js.map\n","import { TanStackStoreSelector } from \"@tanstack/lit-store\";\nimport { AsyncDirective, directive } from \"lit/async-directive.js\";\nimport { noChange } from \"lit\";\n\n//#region src/subscribe-directive.ts\n/**\n* A simple identity selector used when no specific selection is needed,\n* allowing the directive to subscribe to the entire state of the source.\n* @template T - The type of the state being passed through unchanged.\n*/\nconst identitySelector = (state) => state;\n/**\n* An asynchronous Lit directive that subscribes to a `@tanstack/lit-store`\n* source and triggers re-renders specifically for the template portion it wraps.\n* * It uses a \"fake\" `ReactiveControllerHost` to bridge the gap between\n* TanStack's standard controller requirements and the `AsyncDirective` lifecycle.\n*/\nvar SubscribeDirective = class extends AsyncDirective {\n\t/** The `TanStackStoreSelector` controller that manages the subscription to the store/atom */\n\tcontroller;\n\t/** The latest source and selector used to determine if a new subscription is needed on updates */\n\tlatestSource;\n\tlatestSelector;\n\tresolvedTemplate;\n\tinitialized = false;\n\trender(_source, _selectorOrTemplate, _template) {\n\t\t/** The actual rendering is handled in the {@link update} method to ensure that template is only evaluated if needed */\n\t\treturn noChange;\n\t}\n\tupdate(_part, args) {\n\t\tconst [source, selectorOrTemplate, template] = args;\n\t\tconst isIdentitySubscription = template === void 0;\n\t\tconst selector = isIdentitySubscription ? identitySelector : selectorOrTemplate;\n\t\tconst actualTemplate = isIdentitySubscription ? selectorOrTemplate : template;\n\t\tconst sourceChanged = this.latestSource !== source;\n\t\tconst selectorChanged = this.latestSelector !== selector;\n\t\tconst shouldReinitialize = !this.initialized || sourceChanged || selectorChanged;\n\t\tthis.resolvedTemplate = actualTemplate;\n\t\tif (shouldReinitialize) {\n\t\t\tif (this.initialized) {\n\t\t\t\tthis.controller?.hostDisconnected();\n\t\t\t\tthis.controller = void 0;\n\t\t\t}\n\t\t\tthis.latestSource = source;\n\t\t\tthis.latestSelector = selector;\n\t\t\tif (!this.controller) this.controller = new TanStackStoreSelector(this.createFakeHost(), () => this.latestSource, (state) => this.latestSelector?.(state));\n\t\t\tthis.controller.hostUpdate();\n\t\t\tthis.initialized = true;\n\t\t}\n\t\treturn this.resolvedTemplate?.(this.latestSelector(this.latestSource.get()));\n\t}\n\t/** Cleans up the controller subscription when the directive is removed from the DOM. */\n\tdisconnected() {\n\t\tthis.controller?.hostDisconnected();\n\t}\n\t/** Restores the controller subscription when the directive is re-attached to the DOM. */\n\treconnected() {\n\t\tthis.controller?.hostUpdate();\n\t\tif (this.resolvedTemplate && this.controller) this.setValue(this.resolvedTemplate(this.controller.value));\n\t}\n\t/**\n\t* Creates a mock `ReactiveControllerHost` allowing the `TanStackStoreSelector`\n\t* to plug into the `AsyncDirective`'s update cycle using `setValue()`.\n\t*/\n\tcreateFakeHost() {\n\t\treturn {\n\t\t\taddController: () => {},\n\t\t\tremoveController: () => {},\n\t\t\trequestUpdate: () => {\n\t\t\t\tif (this.resolvedTemplate && this.controller) this.setValue(this.resolvedTemplate(this.controller.value));\n\t\t\t},\n\t\t\tget updateComplete() {\n\t\t\t\treturn Promise.resolve(true);\n\t\t\t}\n\t\t};\n\t}\n};\n/**\n* A Lit directive that subscribes to a source (Store or Atom)\n* and efficiently updates only the wrapped template\n* when the state or selected slice changes.\n* @example\n* ```ts\n* // Without a selector (subscribes to entire state)\n* html`<div>${subscribe(myStore, (state) => html`<span>${state.count}</span>`)}</div>`\n* * // With a selector (only updates when `count` changes)\n* html`<div>${subscribe(myStore, state => state.count, (count) => html`<span>${count}</span>`)}</div>`\n* ```\n*/\nconst subscribe = directive(SubscribeDirective);\n\n//#endregion\nexport { SubscribeDirective, subscribe };","//#region src/core/reactivity/renderPhaseReactivity.ts\n/**\n* Creates reactivity bindings for render-phase adapters (React, Preact, Lit):\n* frameworks with plain, non-reactive options that are re-synchronized during\n* component render, where store notifications must not fire until the host\n* commits.\n*\n* Readonly atoms are exposed as live facades. `get()` re-evaluates the\n* resolver against the options of the render in progress — a normal computed\n* cannot know that plain `options.state` changed — and caches the result\n* through the configured comparator so external-store consumers (e.g. React's\n* `useSyncExternalStore`) see referentially stable snapshots. `subscribe()`\n* goes through a hidden computed that tracks the resolver's real atom\n* dependencies plus a commit version, so subscribers are invalidated by\n* actual reactive writes and by the adapter's post-commit publication.\n*\n* @example\n* ```ts\n* import { batch, createAtom } from '@tanstack/react-store'\n*\n* export const reactReactivity = () =>\n* renderPhaseReactivity({ createAtom, batch })\n* ```\n*/\nfunction renderPhaseReactivity(primitives) {\n\tconst { createAtom, batch } = primitives;\n\tconst commitAtom = createAtom(0);\n\treturn {\n\t\tcreateOptionsStore: false,\n\t\twrapExternalAtoms: false,\n\t\taddSubscription: () => {\n\t\t\tthrow new Error(\"Feature not supported in current reactivity implementation\");\n\t\t},\n\t\tunmount: () => {\n\t\t\tthrow new Error(\"Feature not supported in current reactivity implementation\");\n\t\t},\n\t\tschedule: primitives.schedule ?? ((fn) => queueMicrotask(fn)),\n\t\tbatch,\n\t\tuntrack: (fn) => fn(),\n\t\tcreateReadonlyAtom: (fn, atomOptions) => {\n\t\t\tconst compare = atomOptions?.compare ?? Object.is;\n\t\t\tlet hasSnapshot = false;\n\t\t\tlet snapshot;\n\t\t\tconst getSnapshot = () => {\n\t\t\t\tconst nextSnapshot = fn();\n\t\t\t\tif (!hasSnapshot || !compare(snapshot, nextSnapshot)) {\n\t\t\t\t\tsnapshot = nextSnapshot;\n\t\t\t\t\thasSnapshot = true;\n\t\t\t\t}\n\t\t\t\treturn snapshot;\n\t\t\t};\n\t\t\tconst reactiveAtom = createAtom(() => {\n\t\t\t\tcommitAtom.get();\n\t\t\t\treturn getSnapshot();\n\t\t\t}, { compare });\n\t\t\treturn {\n\t\t\t\tget: getSnapshot,\n\t\t\t\tsubscribe: reactiveAtom.subscribe.bind(reactiveAtom)\n\t\t\t};\n\t\t},\n\t\tcreateWritableAtom: (value, atomOptions) => {\n\t\t\treturn createAtom(value, { compare: atomOptions?.compare });\n\t\t},\n\t\tcommit: () => {\n\t\t\tcommitAtom.set((version) => version + 1);\n\t\t}\n\t};\n}\n/**\n* Creates a render-phase source with an explicit commit baseline.\n*\n* Render-phase adapters publish controlled state after the host framework\n* commits so isolated subscribers update, but the component that owns the\n* table already rendered that exact snapshot — forwarding the notification to\n* its root subscription would produce a redundant render. Unlike a last-read\n* filter, speculative reads do not change notification behavior: only\n* `markCommitted()` advances the baseline.\n*/\nfunction createRenderPhaseSource(source, compare = Object.is) {\n\tlet hasCommittedSnapshot = false;\n\tlet committedSnapshot;\n\treturn {\n\t\tget: source.get,\n\t\tmarkCommitted: (snapshot) => {\n\t\t\tcommittedSnapshot = snapshot;\n\t\t\thasCommittedSnapshot = true;\n\t\t},\n\t\tsubscribe: (listener) => source.subscribe((value) => {\n\t\t\tif (!hasCommittedSnapshot || !compare(committedSnapshot, value)) listener(value);\n\t\t})\n\t};\n}\n\n//#endregion\nexport { createRenderPhaseSource, renderPhaseReactivity };","import { renderPhaseReactivity } from \"@tanstack/table-core/reactivity\";\nimport { batch, createAtom } from \"@tanstack/lit-store\";\n\n//#region src/reactivity.ts\n/**\n* Creates the table-core reactivity bindings used by the Lit adapter.\n*\n* Lit calls `controller.table(options)` from the host's `render()`, so options\n* are plain values synchronized during the update cycle — writing a reactive\n* options store there would schedule a second update per interaction. The\n* render-phase preset supplies the live readonly-atom facades and the `commit`\n* hook; `TableController` publishes its captured controlled state from\n* `hostUpdated()`. Store primitives come from `@tanstack/lit-store` so all\n* atoms share one store instance with user-provided external atoms.\n*/\nfunction litReactivity() {\n\treturn renderPhaseReactivity({\n\t\tcreateAtom,\n\t\tbatch\n\t});\n}\n\n//#endregion\nexport { litReactivity };","import { FlexRender } from \"./flexRender.js\";\nimport { litReactivity } from \"./reactivity.js\";\nimport { subscribe } from \"./subscribe-directive.js\";\nimport { constructTable } from \"@tanstack/table-core\";\nimport { createRenderPhaseSource } from \"@tanstack/table-core/reactivity\";\nimport { table_publishExternalState, table_setOptions } from \"@tanstack/table-core/static-functions\";\nimport { shallow } from \"@tanstack/lit-store\";\n\n//#region src/TableController.ts\n/**\n* A Lit ReactiveController for TanStack Table integration.\n*\n* Uses `constructReactivityFeature` from table-core to properly integrate\n* with the TanStack Store reactivity system, matching the pattern used by\n* all other framework adapters (React, Vue, Solid, Svelte, Angular).\n*\n* @example\n* ```ts\n* @customElement('my-table')\n* class MyTable extends LitElement {\n* private tableController = new TableController<typeof features, Person>(this)\n*\n* protected render() {\n* const table = this.tableController.table(\n* {\n* features,\n* columns,\n* data,\n* },\n* (state) => ({ sorting: state.sorting }),\n* )\n* // use table in your template...\n* }\n* }\n* ```\n*/\nvar TableController = class {\n\thost;\n\t_table = null;\n\t_rootSource;\n\t_storeSubscription;\n\t_capturedState;\n\t_capturedSnapshot;\n\t_hasSelector = false;\n\t_latestSelector;\n\t_lastSelected;\n\tconstructor(host) {\n\t\t(this.host = host).addController(this);\n\t}\n\t/**\n\t* Returns the Lit-backed table instance for the current render pass.\n\t*\n\t* The first call constructs the table with Lit reactivity bindings and\n\t* subscribes the host to table state/options changes. Later calls merge new\n\t* options into the same table instance and expose selected state through\n\t* `table.state`.\n\t*\n\t* @example\n\t* ```ts\n\t* const table = this.tableController.table(\n\t* { features, columns, data },\n\t* (state) => ({ sorting: state.sorting }),\n\t* )\n\t* ```\n\t*/\n\ttable(tableOptions, selector) {\n\t\tif (!this._table) {\n\t\t\tconst mergedOptions = {\n\t\t\t\t...tableOptions,\n\t\t\t\tfeatures: {\n\t\t\t\t\tcoreReactivityFeature: litReactivity(),\n\t\t\t\t\t...tableOptions.features\n\t\t\t\t},\n\t\t\t\tmergeOptions: (defaultOptions, newOptions) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...defaultOptions,\n\t\t\t\t\t\t...newOptions\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._table = constructTable(mergedOptions);\n\t\t\tthis._rootSource = createRenderPhaseSource(this._table.store, shallow);\n\t\t\tthis._setupSubscriptions();\n\t\t}\n\t\ttable_setOptions(this._table, (prev) => ({\n\t\t\t...prev,\n\t\t\t...tableOptions\n\t\t}), { syncExternalState: false });\n\t\tthis._capturedState = this._table.options.state;\n\t\tconst renderSnapshot = this._rootSource.get();\n\t\tthis._capturedSnapshot = renderSnapshot;\n\t\tthis._hasSelector = selector !== void 0;\n\t\tthis._latestSelector = selector;\n\t\tthis._lastSelected = selector ? selector(renderSnapshot) : renderSnapshot;\n\t\treturn {\n\t\t\t...this._table,\n\t\t\tsubscribe,\n\t\t\tFlexRender,\n\t\t\tget state() {\n\t\t\t\treturn selector?.(renderSnapshot) ?? renderSnapshot;\n\t\t\t}\n\t\t};\n\t}\n\t_setupSubscriptions() {\n\t\tif (this._table && !this._storeSubscription) this._storeSubscription = this._rootSource.subscribe((state) => {\n\t\t\tif (this._hasSelector) {\n\t\t\t\tconst nextSelected = this._latestSelector(state);\n\t\t\t\tif (shallow(this._lastSelected, nextSelected)) return;\n\t\t\t\tthis._lastSelected = nextSelected;\n\t\t\t}\n\t\t\tthis.host.requestUpdate();\n\t\t});\n\t}\n\thostConnected() {\n\t\tthis._setupSubscriptions();\n\t\tif (this._table) this.host.requestUpdate();\n\t}\n\thostUpdated() {\n\t\tif (!this._table) return;\n\t\tthis._rootSource.markCommitted(this._capturedSnapshot);\n\t\ttable_publishExternalState(this._table, this._capturedState ?? null, shallow);\n\t}\n\thostDisconnected() {\n\t\tthis._storeSubscription?.unsubscribe();\n\t\tthis._storeSubscription = void 0;\n\t}\n};\n\n//#endregion\nexport { TableController };","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s extends Event{constructor(s,t,e,o){super(\"context-request\",{bubbles:!0,composed:!0}),this.context=s,this.contextTarget=t,this.callback=e,this.subscribe=o??!1}}export{s as ContextRequestEvent};\n//# sourceMappingURL=context-request-event.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nfunction n(n){return n}export{n as createContext};\n//# sourceMappingURL=create-context.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class s{constructor(t,s,i,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,s)=>{this.unsubscribe&&(this.unsubscribe!==s&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,s)),this.unsubscribe=s},this.host=t,void 0!==s.context){const t=s;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=s,this.callback=i,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}export{s as ContextConsumer};\n//# sourceMappingURL=context-consumer.js.map\n","/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\nclass s{get value(){return this.o}set value(s){this.setValue(s)}setValue(s,t=!1){const i=t||!Object.is(s,this.o);this.o=s,i&&this.updateObservers()}constructor(s){this.subscriptions=new Map,this.updateObservers=()=>{for(const[s,{disposer:t}]of this.subscriptions)s(this.o,t)},void 0!==s&&(this.value=s)}addCallback(s,t,i){if(!i)return void s(this.value);this.subscriptions.has(s)||this.subscriptions.set(s,{disposer:()=>{this.subscriptions.delete(s)},consumerHost:t});const{disposer:h}=this.subscriptions.get(s);s(this.value,h)}clearCallbacks(){this.subscriptions.clear()}}export{s as ValueNotifier};\n//# sourceMappingURL=value-notifier.js.map\n","import{ContextRequestEvent as t}from\"../context-request-event.js\";import{ValueNotifier as s}from\"../value-notifier.js\";\n/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */class e extends Event{constructor(t,s){super(\"context-provider\",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=s}}class i extends s{constructor(s,e,i){super(void 0!==e.context?e.initialValue:i),this.onContextRequest=t=>{if(t.context!==this.context)return;const s=t.contextTarget??t.composedPath()[0];s!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,s,t.subscribe))},this.onProviderRequest=s=>{if(s.context!==this.context)return;if((s.contextTarget??s.composedPath()[0])===this.host)return;const e=new Set;for(const[s,{consumerHost:i}]of this.subscriptions)e.has(s)||(e.add(s),i.dispatchEvent(new t(this.context,i,s,!0)));s.stopPropagation()},this.host=s,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener(\"context-request\",this.onContextRequest),this.host.addEventListener(\"context-provider\",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new e(this.context,this.host))}}export{i as ContextProvider,e as ContextProviderEvent};\n//# sourceMappingURL=context-provider.js.map\n","import { FlexRender, flexRender } from \"./flexRender.js\";\nimport { TableController } from \"./TableController.js\";\nimport { createColumnHelper } from \"@tanstack/table-core\";\nimport { ContextConsumer, ContextProvider, createContext } from \"@lit/context\";\n\n//#region src/createTableHook.ts\n/**\n* Creates a custom table hook with pre-bound components for composition.\n*\n* This is the table equivalent of TanStack Form's `createFormHook`. It allows you to:\n* - Define features, row models, and default options once, shared across all tables\n* - Register reusable table, cell, and header components\n* - Access table/cell/header instances via `@lit/context` in those components\n* - Get a `useAppTable` hook that returns an extended table with App wrapper functions\n* - Get a `createAppColumnHelper` function pre-bound to your features\n*\n* @example\n* ```ts\n* // hooks/table.ts\n* export const {\n* createAppColumnHelper,\n* useAppTable,\n* useTableContext,\n* useCellContext,\n* useHeaderContext,\n* } = createTableHook({\n* features: tableFeatures({\n* rowPaginationFeature,\n* rowSortingFeature,\n* columnFilteringFeature,\n* paginatedRowModel: createPaginatedRowModel(),\n* sortedRowModel: createSortedRowModel(),\n* filteredRowModel: createFilteredRowModel(),\n* sortFns,\n* filterFns,\n* }),\n* tableComponents: { PaginationControls, RowCount },\n* cellComponents: { TextCell, NumberCell },\n* headerComponents: { SortIndicator, ColumnFilter },\n* })\n*\n* // Create column helper with TFeatures already bound\n* const columnHelper = createAppColumnHelper<Person>()\n*\n* // my-table.ts\n* @customElement('my-table')\n* class MyTable extends LitElement {\n* private appTable = useAppTable(this, {\n* columns,\n* data: this.data,\n* })\n*\n* protected render() {\n* const table = this.appTable.table()\n*\n* return html`\n* <table>\n* <thead>\n* ${repeat(table.getHeaderGroups(), (hg) => hg.id, (hg) => html`\n* <tr>\n* ${hg.headers.map((h) => table.AppHeader(h, (header) => html`\n* <th>${header.FlexRender()}</th>\n* `))}\n* </tr>\n* `)}\n* </thead>\n* <tbody>\n* ${table.getRowModel().rows.map((row) => html`\n* <tr>\n* ${row.getAllCells().map((c) => table.AppCell(c, (cell) => html`\n* <td>${cell.FlexRender()}</td>\n* `))}\n* </tr>\n* `)}\n* </tbody>\n* </table>\n* `\n* }\n* }\n* ```\n*/\nfunction createTableHook({ tableComponents, cellComponents, headerComponents, ...defaultTableOptions }) {\n\tconst tableContext = createContext(Symbol(\"tanstack-table\"));\n\tconst cellContext = createContext(Symbol(\"tanstack-cell\"));\n\tconst headerContext = createContext(Symbol(\"tanstack-header\"));\n\t/**\n\t* Create a column helper pre-bound to the features and components configured in this table hook.\n\t* The cell, header, and footer contexts include pre-bound components (e.g., `cell.TextCell`).\n\t* @example\n\t* ```ts\n\t* const columnHelper = createAppColumnHelper<Person>()\n\t*\n\t* const columns = [\n\t* columnHelper.accessor('firstName', {\n\t* header: 'First Name',\n\t* cell: ({ cell }) => cell.FlexRender(), // cell has pre-bound components!\n\t* }),\n\t* columnHelper.accessor('age', {\n\t* header: 'Age',\n\t* cell: ({ cell }) => cell.NumberCell(),\n\t* }),\n\t* ]\n\t* ```\n\t*/\n\tfunction createAppColumnHelper() {\n\t\treturn createColumnHelper();\n\t}\n\t/**\n\t* Access the table instance from within a custom element that is a descendant\n\t* of the element using `useAppTable`.\n\t* Uses `@lit/context` ContextConsumer to retrieve the table from the nearest ancestor provider.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('pagination-controls')\n\t* class PaginationControls extends LitElement {\n\t* private _table = useTableContext(this)\n\t*\n\t* protected render() {\n\t* const table = this._table.value\n\t* if (!table) return html``\n\t* return html`\n\t* <button @click=${() => table.previousPage()}>Prev</button>\n\t* <button @click=${() => table.nextPage()}>Next</button>\n\t* `\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useTableContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: tableContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Access the cell instance from within a custom element that is a descendant\n\t* of an element providing cell context.\n\t* Uses `@lit/context` ContextConsumer to retrieve the cell.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('text-cell')\n\t* class TextCell extends LitElement {\n\t* private _cell = useCellContext(this)\n\t*\n\t* protected render() {\n\t* const cell = this._cell.value\n\t* if (!cell) return html``\n\t* return html`<span>${cell.getValue()}</span>`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useCellContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: cellContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Access the header instance from within a custom element that is a descendant\n\t* of an element providing header context.\n\t* Uses `@lit/context` ContextConsumer to retrieve the header.\n\t* TFeatures is already known from the createTableHook call.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('sort-indicator')\n\t* class SortIndicator extends LitElement {\n\t* private _header = useHeaderContext(this)\n\t*\n\t* protected render() {\n\t* const header = this._header.value\n\t* if (!header) return html``\n\t* const sorted = header.column.getIsSorted()\n\t* return html`${sorted === 'asc' ? '🔼' : sorted === 'desc' ? '🔽' : ''}`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useHeaderContext(host) {\n\t\treturn new ContextConsumer(host, {\n\t\t\tcontext: headerContext,\n\t\t\tsubscribe: true\n\t\t});\n\t}\n\t/**\n\t* Enhanced table hook that returns a controller-like object with a `table()` method.\n\t* The returned table has App wrapper functions and pre-bound tableComponents\n\t* attached directly to the table object.\n\t*\n\t* Default options from createTableHook are automatically merged with\n\t* the options passed here. Options passed here take precedence.\n\t*\n\t* TFeatures is already known from the createTableHook call; TData is inferred from the data prop.\n\t*\n\t* @example\n\t* ```ts\n\t* @customElement('my-table')\n\t* class MyTable extends LitElement {\n\t* private appTable = useAppTable(this, {\n\t* columns,\n\t* data: this.data,\n\t* })\n\t*\n\t* protected render() {\n\t* const table = this.appTable.table()\n\t* return html`...`\n\t* }\n\t* }\n\t* ```\n\t*/\n\tfunction useAppTable(host, tableOptions, selector) {\n\t\tconst controller = new TableController(host);\n\t\tconst provider = new ContextProvider(host, { context: tableContext });\n\t\treturn { table() {\n\t\t\tconst mergedOptions = {\n\t\t\t\t...defaultTableOptions,\n\t\t\t\t...tableOptions\n\t\t\t};\n\t\t\tconst table = controller.table(mergedOptions, selector);\n\t\t\tprovider.setValue(table);\n\t\t\tfunction AppCell(cell, renderFn) {\n\t\t\t\tconst cellFlexRender = () => FlexRender({ cell });\n\t\t\t\tconst boundCellComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(cellComponents ?? {})) boundCellComponents[key] = () => fn(cell);\n\t\t\t\treturn renderFn(Object.assign(cell, {\n\t\t\t\t\tFlexRender: cellFlexRender,\n\t\t\t\t\t...boundCellComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\tfunction AppHeader(header, renderFn) {\n\t\t\t\tconst headerFlexRender = () => flexRender(header.column.columnDef.header, header.getContext());\n\t\t\t\tconst boundHeaderComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(headerComponents ?? {})) boundHeaderComponents[key] = () => fn(header);\n\t\t\t\treturn renderFn(Object.assign(header, {\n\t\t\t\t\tFlexRender: headerFlexRender,\n\t\t\t\t\t...boundHeaderComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\tfunction AppFooter(header, renderFn) {\n\t\t\t\tconst footerFlexRender = () => flexRender(header.column.columnDef.footer, header.getContext());\n\t\t\t\tconst boundFooterComponents = {};\n\t\t\t\tfor (const [key, fn] of Object.entries(headerComponents ?? {})) boundFooterComponents[key] = () => fn(header);\n\t\t\t\treturn renderFn(Object.assign(header, {\n\t\t\t\t\tFlexRender: footerFlexRender,\n\t\t\t\t\t...boundFooterComponents\n\t\t\t\t}));\n\t\t\t}\n\t\t\treturn Object.assign(table, {\n\t\t\t\tAppCell,\n\t\t\t\tAppHeader,\n\t\t\t\tAppFooter,\n\t\t\t\tFlexRender,\n\t\t\t\t...tableComponents ?? {}\n\t\t\t});\n\t\t} };\n\t}\n\treturn {\n\t\tappFeatures: defaultTableOptions.features,\n\t\tcreateAppColumnHelper,\n\t\tuseAppTable,\n\t\tuseTableContext,\n\t\tuseCellContext,\n\t\tuseHeaderContext\n\t};\n}\n\n//#endregion\nexport { createTableHook };","import { FlexRender, flexRender } from \"./flexRender.js\";\nimport { SubscribeDirective, subscribe } from \"./subscribe-directive.js\";\nimport { TableController } from \"./TableController.js\";\nimport { createTableHook } from \"./createTableHook.js\";\n\nexport * from \"@tanstack/table-core\"\n\nexport { FlexRender, SubscribeDirective, TableController, createTableHook, flexRender, subscribe };","//#region src/remove-accents.ts\nconst characterMap = {\n\tÀ: \"A\",\n\tÁ: \"A\",\n\tÂ: \"A\",\n\tÃ: \"A\",\n\tÄ: \"A\",\n\tÅ: \"A\",\n\tẤ: \"A\",\n\tẮ: \"A\",\n\tẲ: \"A\",\n\tẴ: \"A\",\n\tẶ: \"A\",\n\tÆ: \"AE\",\n\tẦ: \"A\",\n\tẰ: \"A\",\n\tȂ: \"A\",\n\tÇ: \"C\",\n\tḈ: \"C\",\n\tÈ: \"E\",\n\tÉ: \"E\",\n\tÊ: \"E\",\n\tË: \"E\",\n\tẾ: \"E\",\n\tḖ: \"E\",\n\tỀ: \"E\",\n\tḔ: \"E\",\n\tḜ: \"E\",\n\tȆ: \"E\",\n\tÌ: \"I\",\n\tÍ: \"I\",\n\tÎ: \"I\",\n\tÏ: \"I\",\n\tḮ: \"I\",\n\tȊ: \"I\",\n\tÐ: \"D\",\n\tÑ: \"N\",\n\tÒ: \"O\",\n\tÓ: \"O\",\n\tÔ: \"O\",\n\tÕ: \"O\",\n\tÖ: \"O\",\n\tØ: \"O\",\n\tỐ: \"O\",\n\tṌ: \"O\",\n\tṒ: \"O\",\n\tȎ: \"O\",\n\tÙ: \"U\",\n\tÚ: \"U\",\n\tÛ: \"U\",\n\tÜ: \"U\",\n\tÝ: \"Y\",\n\tà: \"a\",\n\tá: \"a\",\n\tâ: \"a\",\n\tã: \"a\",\n\tä: \"a\",\n\tå: \"a\",\n\tấ: \"a\",\n\tắ: \"a\",\n\tẳ: \"a\",\n\tẵ: \"a\",\n\tặ: \"a\",\n\tæ: \"ae\",\n\tầ: \"a\",\n\tằ: \"a\",\n\tȃ: \"a\",\n\tç: \"c\",\n\tḉ: \"c\",\n\tè: \"e\",\n\té: \"e\",\n\tê: \"e\",\n\të: \"e\",\n\tế: \"e\",\n\tḗ: \"e\",\n\tề: \"e\",\n\tḕ: \"e\",\n\tḝ: \"e\",\n\tȇ: \"e\",\n\tì: \"i\",\n\tí: \"i\",\n\tî: \"i\",\n\tï: \"i\",\n\tḯ: \"i\",\n\tȋ: \"i\",\n\tð: \"d\",\n\tñ: \"n\",\n\tò: \"o\",\n\tó: \"o\",\n\tô: \"o\",\n\tõ: \"o\",\n\tö: \"o\",\n\tø: \"o\",\n\tố: \"o\",\n\tṍ: \"o\",\n\tṓ: \"o\",\n\tȏ: \"o\",\n\tù: \"u\",\n\tú: \"u\",\n\tû: \"u\",\n\tü: \"u\",\n\tý: \"y\",\n\tÿ: \"y\",\n\tĀ: \"A\",\n\tā: \"a\",\n\tĂ: \"A\",\n\tă: \"a\",\n\tĄ: \"A\",\n\tą: \"a\",\n\tĆ: \"C\",\n\tć: \"c\",\n\tĈ: \"C\",\n\tĉ: \"c\",\n\tĊ: \"C\",\n\tċ: \"c\",\n\tČ: \"C\",\n\tč: \"c\",\n\tC̆: \"C\",\n\tc̆: \"c\",\n\tĎ: \"D\",\n\tď: \"d\",\n\tĐ: \"D\",\n\tđ: \"d\",\n\tĒ: \"E\",\n\tē: \"e\",\n\tĔ: \"E\",\n\tĕ: \"e\",\n\tĖ: \"E\",\n\tė: \"e\",\n\tĘ: \"E\",\n\tę: \"e\",\n\tĚ: \"E\",\n\tě: \"e\",\n\tĜ: \"G\",\n\tǴ: \"G\",\n\tĝ: \"g\",\n\tǵ: \"g\",\n\tĞ: \"G\",\n\tğ: \"g\",\n\tĠ: \"G\",\n\tġ: \"g\",\n\tĢ: \"G\",\n\tģ: \"g\",\n\tĤ: \"H\",\n\tĥ: \"h\",\n\tĦ: \"H\",\n\tħ: \"h\",\n\tḪ: \"H\",\n\tḫ: \"h\",\n\tĨ: \"I\",\n\tĩ: \"i\",\n\tĪ: \"I\",\n\tī: \"i\",\n\tĬ: \"I\",\n\tĭ: \"i\",\n\tĮ: \"I\",\n\tį: \"i\",\n\tİ: \"I\",\n\tı: \"i\",\n\tIJ: \"IJ\",\n\tij: \"ij\",\n\tĴ: \"J\",\n\tĵ: \"j\",\n\tĶ: \"K\",\n\tķ: \"k\",\n\tḰ: \"K\",\n\tḱ: \"k\",\n\tK̆: \"K\",\n\tk̆: \"k\",\n\tĹ: \"L\",\n\tĺ: \"l\",\n\tĻ: \"L\",\n\tļ: \"l\",\n\tĽ: \"L\",\n\tľ: \"l\",\n\tĿ: \"L\",\n\tŀ: \"l\",\n\tŁ: \"l\",\n\tł: \"l\",\n\tḾ: \"M\",\n\tḿ: \"m\",\n\tM̆: \"M\",\n\tm̆: \"m\",\n\tŃ: \"N\",\n\tń: \"n\",\n\tŅ: \"N\",\n\tņ: \"n\",\n\tŇ: \"N\",\n\tň: \"n\",\n\tʼn: \"n\",\n\tN̆: \"N\",\n\tn̆: \"n\",\n\tŌ: \"O\",\n\tō: \"o\",\n\tŎ: \"O\",\n\tŏ: \"o\",\n\tŐ: \"O\",\n\tő: \"o\",\n\tŒ: \"OE\",\n\tœ: \"oe\",\n\tP̆: \"P\",\n\tp̆: \"p\",\n\tŔ: \"R\",\n\tŕ: \"r\",\n\tŖ: \"R\",\n\tŗ: \"r\",\n\tŘ: \"R\",\n\tř: \"r\",\n\tR̆: \"R\",\n\tr̆: \"r\",\n\tȒ: \"R\",\n\tȓ: \"r\",\n\tŚ: \"S\",\n\tś: \"s\",\n\tŜ: \"S\",\n\tŝ: \"s\",\n\tŞ: \"S\",\n\tȘ: \"S\",\n\tș: \"s\",\n\tş: \"s\",\n\tŠ: \"S\",\n\tš: \"s\",\n\tŢ: \"T\",\n\tţ: \"t\",\n\tț: \"t\",\n\tȚ: \"T\",\n\tŤ: \"T\",\n\tť: \"t\",\n\tŦ: \"T\",\n\tŧ: \"t\",\n\tT̆: \"T\",\n\tt̆: \"t\",\n\tŨ: \"U\",\n\tũ: \"u\",\n\tŪ: \"U\",\n\tū: \"u\",\n\tŬ: \"U\",\n\tŭ: \"u\",\n\tŮ: \"U\",\n\tů: \"u\",\n\tŰ: \"U\",\n\tű: \"u\",\n\tŲ: \"U\",\n\tų: \"u\",\n\tȖ: \"U\",\n\tȗ: \"u\",\n\tV̆: \"V\",\n\tv̆: \"v\",\n\tŴ: \"W\",\n\tŵ: \"w\",\n\tẂ: \"W\",\n\tẃ: \"w\",\n\tX̆: \"X\",\n\tx̆: \"x\",\n\tŶ: \"Y\",\n\tŷ: \"y\",\n\tŸ: \"Y\",\n\tY̆: \"Y\",\n\ty̆: \"y\",\n\tŹ: \"Z\",\n\tź: \"z\",\n\tŻ: \"Z\",\n\tż: \"z\",\n\tŽ: \"Z\",\n\tž: \"z\",\n\tſ: \"s\",\n\tƒ: \"f\",\n\tƠ: \"O\",\n\tơ: \"o\",\n\tƯ: \"U\",\n\tư: \"u\",\n\tǍ: \"A\",\n\tǎ: \"a\",\n\tǏ: \"I\",\n\tǐ: \"i\",\n\tǑ: \"O\",\n\tǒ: \"o\",\n\tǓ: \"U\",\n\tǔ: \"u\",\n\tǕ: \"U\",\n\tǖ: \"u\",\n\tǗ: \"U\",\n\tǘ: \"u\",\n\tǙ: \"U\",\n\tǚ: \"u\",\n\tǛ: \"U\",\n\tǜ: \"u\",\n\tỨ: \"U\",\n\tứ: \"u\",\n\tṸ: \"U\",\n\tṹ: \"u\",\n\tǺ: \"A\",\n\tǻ: \"a\",\n\tǼ: \"AE\",\n\tǽ: \"ae\",\n\tǾ: \"O\",\n\tǿ: \"o\",\n\tÞ: \"TH\",\n\tþ: \"th\",\n\tṔ: \"P\",\n\tṕ: \"p\",\n\tṤ: \"S\",\n\tṥ: \"s\",\n\tX́: \"X\",\n\tx́: \"x\",\n\tЃ: \"Г\",\n\tѓ: \"г\",\n\tЌ: \"К\",\n\tќ: \"к\",\n\tA̋: \"A\",\n\ta̋: \"a\",\n\tE̋: \"E\",\n\te̋: \"e\",\n\tI̋: \"I\",\n\ti̋: \"i\",\n\tǸ: \"N\",\n\tǹ: \"n\",\n\tỒ: \"O\",\n\tồ: \"o\",\n\tṐ: \"O\",\n\tṑ: \"o\",\n\tỪ: \"U\",\n\từ: \"u\",\n\tẀ: \"W\",\n\tẁ: \"w\",\n\tỲ: \"Y\",\n\tỳ: \"y\",\n\tȀ: \"A\",\n\tȁ: \"a\",\n\tȄ: \"E\",\n\tȅ: \"e\",\n\tȈ: \"I\",\n\tȉ: \"i\",\n\tȌ: \"O\",\n\tȍ: \"o\",\n\tȐ: \"R\",\n\tȑ: \"r\",\n\tȔ: \"U\",\n\tȕ: \"u\",\n\tB̌: \"B\",\n\tb̌: \"b\",\n\tČ̣: \"C\",\n\tč̣: \"c\",\n\tÊ̌: \"E\",\n\tê̌: \"e\",\n\tF̌: \"F\",\n\tf̌: \"f\",\n\tǦ: \"G\",\n\tǧ: \"g\",\n\tȞ: \"H\",\n\tȟ: \"h\",\n\tJ̌: \"J\",\n\tǰ: \"j\",\n\tǨ: \"K\",\n\tǩ: \"k\",\n\tM̌: \"M\",\n\tm̌: \"m\",\n\tP̌: \"P\",\n\tp̌: \"p\",\n\tQ̌: \"Q\",\n\tq̌: \"q\",\n\tŘ̩: \"R\",\n\tř̩: \"r\",\n\tṦ: \"S\",\n\tṧ: \"s\",\n\tV̌: \"V\",\n\tv̌: \"v\",\n\tW̌: \"W\",\n\tw̌: \"w\",\n\tX̌: \"X\",\n\tx̌: \"x\",\n\tY̌: \"Y\",\n\ty̌: \"y\",\n\tA̧: \"A\",\n\ta̧: \"a\",\n\tB̧: \"B\",\n\tb̧: \"b\",\n\tḐ: \"D\",\n\tḑ: \"d\",\n\tȨ: \"E\",\n\tȩ: \"e\",\n\tƐ̧: \"E\",\n\tɛ̧: \"e\",\n\tḨ: \"H\",\n\tḩ: \"h\",\n\tI̧: \"I\",\n\ti̧: \"i\",\n\tƗ̧: \"I\",\n\tɨ̧: \"i\",\n\tM̧: \"M\",\n\tm̧: \"m\",\n\tO̧: \"O\",\n\to̧: \"o\",\n\tQ̧: \"Q\",\n\tq̧: \"q\",\n\tU̧: \"U\",\n\tu̧: \"u\",\n\tX̧: \"X\",\n\tx̧: \"x\",\n\tZ̧: \"Z\",\n\tz̧: \"z\"\n};\nconst chars = Object.keys(characterMap).join(\"|\");\nconst allAccents = new RegExp(chars, \"g\");\nfunction removeAccents(str) {\n\treturn str.replace(allAccents, (match) => {\n\t\treturn characterMap[match];\n\t});\n}\n\n//#endregion\nexport { removeAccents };","import { removeAccents } from \"./remove-accents.js\";\n\n//#region src/index.ts\n/**\n* @name match-sorter\n* @license MIT license.\n* @copyright (c) 2099 Kent C. Dodds\n* @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)\n*/\nconst rankings = {\n\tCASE_SENSITIVE_EQUAL: 7,\n\tEQUAL: 6,\n\tSTARTS_WITH: 5,\n\tWORD_STARTS_WITH: 4,\n\tCONTAINS: 3,\n\tACRONYM: 2,\n\tMATCHES: 1,\n\tNO_MATCH: 0\n};\n/**\n* Gets the highest ranking value for the given item based on its values for the given keys\n* @param {*} item - the item to rank\n* @param {String} value - the value to rank against\n* @param {Object} options - options to control the ranking\n* @return {{rank: Number, accessorIndex: Number, accessorThreshold: Number}} - the highest ranking\n*/\nfunction rankItem(item, value, options) {\n\toptions = options || {};\n\toptions.threshold = options.threshold ?? rankings.MATCHES;\n\tif (!options.accessors) {\n\t\tconst rank = getMatchRanking(item, value, options);\n\t\treturn {\n\t\t\trankedValue: item,\n\t\t\trank,\n\t\t\taccessorIndex: -1,\n\t\t\taccessorThreshold: options.threshold,\n\t\t\tpassed: rank >= options.threshold\n\t\t};\n\t}\n\tconst valuesToRank = getAllValuesToRank(item, options.accessors);\n\tconst rankingInfo = {\n\t\trankedValue: item,\n\t\trank: rankings.NO_MATCH,\n\t\taccessorIndex: -1,\n\t\taccessorThreshold: options.threshold,\n\t\tpassed: false\n\t};\n\tfor (let i = 0; i < valuesToRank.length; i++) {\n\t\tconst rankValue = valuesToRank[i];\n\t\tlet newRank = getMatchRanking(rankValue.itemValue, value, options);\n\t\tconst { minRanking, maxRanking, threshold = options.threshold } = rankValue.attributes;\n\t\tif (newRank < minRanking && newRank >= rankings.MATCHES) newRank = minRanking;\n\t\telse if (newRank > maxRanking) newRank = maxRanking;\n\t\tnewRank = Math.min(newRank, maxRanking);\n\t\tif (newRank >= threshold && newRank > rankingInfo.rank) {\n\t\t\trankingInfo.rank = newRank;\n\t\t\trankingInfo.passed = true;\n\t\t\trankingInfo.accessorIndex = i;\n\t\t\trankingInfo.accessorThreshold = threshold;\n\t\t\trankingInfo.rankedValue = rankValue.itemValue;\n\t\t}\n\t}\n\treturn rankingInfo;\n}\n/**\n* Gives a rankings score based on how well the two strings match.\n* @param {String} testString - the string to test against\n* @param {String} stringToRank - the string to rank\n* @param {Object} options - options for the match (like keepDiacritics for comparison)\n* @returns {Number} the ranking for how well stringToRank matches testString\n*/\nfunction getMatchRanking(testString, stringToRank, options) {\n\ttestString = prepareValueForComparison(testString, options);\n\tstringToRank = prepareValueForComparison(stringToRank, options);\n\tif (stringToRank.length > testString.length) return rankings.NO_MATCH;\n\tif (testString === stringToRank) return rankings.CASE_SENSITIVE_EQUAL;\n\ttestString = testString.toLowerCase();\n\tstringToRank = stringToRank.toLowerCase();\n\tif (testString === stringToRank) return rankings.EQUAL;\n\tif (testString.startsWith(stringToRank)) return rankings.STARTS_WITH;\n\tif (testString.includes(` ${stringToRank}`)) return rankings.WORD_STARTS_WITH;\n\tif (testString.includes(stringToRank)) return rankings.CONTAINS;\n\telse if (stringToRank.length === 1) return rankings.NO_MATCH;\n\tif (getAcronym(testString).includes(stringToRank)) return rankings.ACRONYM;\n\treturn getClosenessRanking(testString, stringToRank);\n}\n/**\n* Generates an acronym for a string.\n*\n* @param {String} string the string for which to produce the acronym\n* @returns {String} the acronym\n*/\nfunction getAcronym(string) {\n\tlet acronym = \"\";\n\tstring.split(\" \").forEach((wordInString) => {\n\t\twordInString.split(\"-\").forEach((splitByHyphenWord) => {\n\t\t\tacronym += splitByHyphenWord.substr(0, 1);\n\t\t});\n\t});\n\treturn acronym;\n}\n/**\n* Returns a score based on how spread apart the\n* characters from the stringToRank are within the testString.\n* A number close to rankings.MATCHES represents a loose match. A number close\n* to rankings.MATCHES + 1 represents a tighter match.\n* @param {String} testString - the string to test against\n* @param {String} stringToRank - the string to rank\n* @returns {Number} the number between rankings.MATCHES and\n* rankings.MATCHES + 1 for how well stringToRank matches testString\n*/\nfunction getClosenessRanking(testString, stringToRank) {\n\tlet matchingInOrderCharCount = 0;\n\tlet charNumber = 0;\n\tfunction findMatchingCharacter(matchChar, string, index) {\n\t\tfor (let j = index, J = string.length; j < J; j++) if (string[j] === matchChar) {\n\t\t\tmatchingInOrderCharCount += 1;\n\t\t\treturn j + 1;\n\t\t}\n\t\treturn -1;\n\t}\n\tfunction getRanking(spread) {\n\t\tconst spreadPercentage = 1 / spread;\n\t\tconst inOrderPercentage = matchingInOrderCharCount / stringToRank.length;\n\t\treturn rankings.MATCHES + inOrderPercentage * spreadPercentage;\n\t}\n\tconst firstIndex = findMatchingCharacter(stringToRank[0], testString, 0);\n\tif (firstIndex < 0) return rankings.NO_MATCH;\n\tcharNumber = firstIndex;\n\tfor (let i = 1, I = stringToRank.length; i < I; i++) {\n\t\tconst matchChar = stringToRank[i];\n\t\tcharNumber = findMatchingCharacter(matchChar, testString, charNumber);\n\t\tif (!(charNumber > -1)) return rankings.NO_MATCH;\n\t}\n\treturn getRanking(charNumber - firstIndex);\n}\n/**\n* Sorts items that have a rank, index, and accessorIndex\n* @param {Object} a - the first item to sort\n* @param {Object} b - the second item to sort\n* @return {Number} -1 if a should come first, 1 if b should come first, 0 if equal\n*/\nfunction compareItems(a, b) {\n\treturn a.rank === b.rank ? 0 : a.rank > b.rank ? -1 : 1;\n}\n/**\n* Prepares value for comparison by stringifying it, removing diacritics (if specified)\n* @param {String} value - the value to clean\n* @param {Object} options - {keepDiacritics: whether to remove diacritics}\n* @return {String} the prepared value\n*/\nfunction prepareValueForComparison(value, { keepDiacritics }) {\n\tvalue = `${value}`;\n\tif (!keepDiacritics) value = removeAccents(value);\n\treturn value;\n}\n/**\n* Gets value for key in item at arbitrarily nested keypath\n* @param {Object} item - the item\n* @param {Object|Function} key - the potentially nested keypath or property callback\n* @return {Array} - an array containing the value(s) at the nested keypath\n*/\nfunction getItemValues(item, accessor) {\n\tlet accessorFn = accessor;\n\tif (typeof accessor === \"object\") accessorFn = accessor.accessor;\n\tconst value = accessorFn(item);\n\tif (value == null) return [];\n\tif (Array.isArray(value)) return value;\n\treturn [String(value)];\n}\n/**\n* Gets all the values for the given keys in the given item and returns an array of those values\n* @param item - the item from which the values will be retrieved\n* @param keys - the keys to use to retrieve the values\n* @return objects with {itemValue, attributes}\n*/\nfunction getAllValuesToRank(item, accessors) {\n\tconst allValues = [];\n\tfor (let j = 0, J = accessors.length; j < J; j++) {\n\t\tconst accessor = accessors[j];\n\t\tconst attributes = getAccessorAttributes(accessor);\n\t\tconst itemValues = getItemValues(item, accessor);\n\t\tfor (let i = 0, I = itemValues.length; i < I; i++) allValues.push({\n\t\t\titemValue: itemValues[i],\n\t\t\tattributes\n\t\t});\n\t}\n\treturn allValues;\n}\nconst defaultKeyAttributes = {\n\tmaxRanking: Infinity,\n\tminRanking: -Infinity\n};\n/**\n* Gets all the attributes for the given accessor\n* @param accessor - the accessor from which the attributes will be retrieved\n* @return object containing the accessor's attributes\n*/\nfunction getAccessorAttributes(accessor) {\n\tif (typeof accessor === \"function\") return defaultKeyAttributes;\n\treturn {\n\t\t...defaultKeyAttributes,\n\t\t...accessor\n\t};\n}\n\n//#endregion\nexport { compareItems, rankItem, rankings };","// ── <sken-datatable> — framework-ready data table (M1 shell) ─────────\n//\n// M1 status: ALPHA. The component renders a table from `rows` + `columns`\n// props. Sorting, filtering, and pagination arrive in M1.x/M2 — see the\n// research report at /tmp/sken-datatable-research.md and the roadmap.\n//\n// Substrate: `@tanstack/lit-table` (Lit ReactiveController + headless\n// TanStack Table). This primitive owns ONLY the visual layer; the consumer\n// owns data fetching, sorting state, pagination state, server-side work.\n// Nord DS is the reference architecture (see §1 of the research report).\n//\n// API contract (M1):\n// - `rows`: Array<RowData> — JS property, NOT attribute (arrays can't be\n// serialized as HTML attributes without lossy JSON round-trips).\n// - `columns`: Array<ColumnDef> — JS property, same reason.\n// - `getRowId`: required for row identity (selection, expansion, server-side\n// filtering all depend on it). We throw a dev-mode console error if\n// missing — but DON'T throw in prod (M1 doesn't have a state machine that\n// requires it, only M1.x selection/expansion will).\n// - `loading`: boolean — shows a skeleton overlay.\n// - `empty`: string | undefined — text shown when rows is empty.\n// - Slot `empty` (optional): custom empty content. Overrides `empty` prop.\n//\n// Theme: tokens come from the light DOM via `var(--sken-*)`. CSS Custom\n// Properties cross the shadow boundary by spec — no adoptStyleSheets\n// bridge needed.\n\nimport { LitElement, html, css, nothing, type TemplateResult } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport {\n TableController,\n tableFeatures,\n createSortedRowModel,\n createPaginatedRowModel,\n createFilteredRowModel,\n rowSortingFeature,\n globalFilteringFeature,\n rowPaginationFeature,\n columnFilteringFeature,\n type ColumnDef,\n type RowData,\n type SortingState,\n type TableFeatures,\n} from '@tanstack/lit-table'\n// Side-effect namespace import to defeat Rollup tree-shaking.\n// `@tanstack/table-core` declares \"sideEffects\": false, so a\n// direct named import + a void call is dead-code-eliminated\n// by Rollup. Importing the namespace forces Rollup to keep the\n// module in the bundle (the namespace binding is observable\n// to the bundler even if the named imports are not used). The\n// named import then resolves to the same function and is used\n// at the call site below.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport * as _tableCoreStaticNS from '@tanstack/table-core/static-functions'\nimport { table_publishExternalState } from '@tanstack/table-core/static-functions'\nimport { rankItem } from '@tanstack/match-sorter-utils'\n\n/**\n * Sken-specific column def. We re-export the relevant TanStack shape so\n * the contract doesn't leak `import type` to consumers.\n */\nexport type SkenColumnDef<TData extends RowData> = ColumnDef<TableFeatures, TData>\n\n/**\n * Options that are required at construction time but can be passed as\n * either a property (preferred) or constructor arg.\n */\nexport interface SkenDataTableOptions<TData extends RowData> {\n rows: TData[]\n columns: SkenColumnDef<TData>[]\n getRowId: (row: TData, index: number) => string\n loading?: boolean\n empty?: string\n}\n\n@customElement('sken-datatable')\nexport class SkenDataTable<TData extends RowData> extends LitElement {\n /**\n * The rows to display. JS property, NOT attribute.\n * @example el.rows = [{ id: 1, name: 'Alice' }]\n */\n @property({ attribute: false }) rows: TData[] = []\n\n /**\n * Column definitions. JS property, NOT attribute.\n * @example el.columns = [{ accessorKey: 'name', header: 'Name' }]\n */\n @property({ attribute: false }) columns: SkenColumnDef<TData>[] = []\n\n /**\n * Required for row identity. Pass a function that returns a stable\n * unique id per row.\n * @example el.getRowId = (row) => row.id\n */\n @property({ attribute: false }) getRowId: ((row: TData, index: number) => string) | undefined =\n undefined\n\n /** Shows a skeleton overlay when true. */\n @property({ reflect: true, type: Boolean }) loading = false\n\n /** Text shown when `rows` is empty. Use the `empty` slot for richer content. */\n @property() empty: string | undefined = undefined\n\n /**\n * Current sorting state. JS property, NOT attribute.\n * Pass `undefined` (or omit) for uncontrolled mode — the primitive\n * keeps the state internally and the table reflects clicks on\n * sortable headers. Pass an array for controlled mode — the consumer\n * owns the state and reacts to `sken-sort-change` events.\n */\n @property({ attribute: false }) sorting: SortingState | undefined = undefined\n\n /**\n * Current global filter value. JS property, NOT attribute.\n * Pass `undefined` (or omit) for uncontrolled mode (state is kept\n * inside the primitive). Pass a string for controlled mode.\n */\n @property({ attribute: false }) globalFilter: string | undefined = undefined\n\n /**\n * Placeholder for the auto-generated filter input. The primitive\n * renders a built-in `<input>` above the table when this is set\n * (default). Pass `false` to hide it (consumer renders their own via\n * the `filter` slot). Pass a string to use as placeholder.\n */\n @property() filterPlaceholder: string = 'Filter…'\n\n /**\n * Current pagination state. JS property, NOT attribute.\n * Pass `undefined` for uncontrolled mode (default pageSize = 10,\n * pageIndex = 0). Pass an object for controlled mode.\n */\n @property({ attribute: false }) pagination: { pageIndex: number; pageSize: number } | undefined =\n undefined\n\n /** Default page size when uncontrolled. Default: 10. */\n @property({ attribute: 'default-page-size', type: Number }) defaultPageSize: number = 10\n\n /**\n * Internal state: the TanStack table instance, owned by `TableController`.\n * Re-renders on any state change. We keep a private field instead of\n * recomputing per render to avoid re-allocating on every Lit update.\n */\n // Internal state for uncontrolled mode. When the consumer passes\n // `undefined` for `sorting` / `globalFilter` / `pagination`, we keep\n // the state here as plain fields. We trigger Lit re-renders\n // explicitly in the `on*Change` callbacks via `this.requestUpdate()`\n // (the change callback fires outside Lit's reactive context, so the\n // `@state` decorator doesn't pick it up across the `controller.table`\n // call boundary).\n #uncontrolledSorting: SortingState = []\n #uncontrolledGlobalFilter: string = ''\n #uncontrolledPagination: { pageIndex: number; pageSize: number } = {\n pageIndex: 0,\n pageSize: 10,\n }\n\n // The full feature set we use, built with the v9 `tableFeatures()`\n // factory. Per the v9 migration SKILL: each `create*RowModel`\n // factory is a sibling of its feature in the same object, not\n // nested under the feature key.\n #features = tableFeatures({\n rowSortingFeature,\n sortedRowModel: createSortedRowModel(),\n columnFilteringFeature,\n filteredRowModel: createFilteredRowModel(),\n globalFilteringFeature,\n rowPaginationFeature,\n paginatedRowModel: createPaginatedRowModel(),\n })\n\n // We initialise the TableController lazily on first connection. The\n // field-initializer approach breaks when the host element is created\n // via `document.createElement` in a non-Lit context (some test runners\n // do that), because `this.host` is undefined at field-init time.\n //\n // The `Features` type is computed from `tableFeatures({...})`'s\n // return type. We can't use `typeof this.#features` in a field\n // initializer (no `this` available), so the `as` cast on the\n // constructor call covers the same ground at the use site.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #tableController: TableController<any, TData> | undefined = undefined\n\n #getTableController() {\n if (this.#tableController === undefined) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this.#tableController = new TableController<any, TData>(this)\n }\n return this.#tableController\n }\n\n /**\n * Fuzzy global filter: ranks each row against the filter value\n * using `@tanstack/match-sorter-utils`. Returns true if the row\n * \"passes\" the rank threshold (any character sequence match).\n *\n * Note: `rankItem` ranks strings (or values returned by an\n * `accessors` fn), not plain objects — passing the row directly\n * coerces it to `\"[object Object]\"` and never matches. We flatten\n * the row to a space-joined string of its values, which is the\n * standard TanStack v8 + match-sorter-utils recipe (see the\n * TanStack docs: `globalFilterFn: (row, _id, value) =>\n * rankItem(Object.values(row.original).join(' '), value).passed`).\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n #fuzzyFilter = (row: any, _columnId: string, filterValue: unknown): boolean => {\n const flat = Object.values(row.original ?? {})\n .map((v) => (v === null || v === undefined ? '' : String(v)))\n .join(' ')\n const itemRank = rankItem(flat, String(filterValue ?? ''))\n return itemRank.passed\n }\n\n /**\n * Dev-mode warning if `getRowId` is missing. We don't throw in prod\n * because M1 doesn't need it; M1.x (selection/expansion) will.\n */\n #warnIfNoGetRowId(): void {\n if (this.getRowId === undefined && globalThis.console !== undefined) {\n globalThis.console.warn(\n '[sken-datatable] Missing `getRowId`. This is required in M1.x once ' +\n 'row selection, expansion, or server-side filtering are added. ' +\n 'See ADR-0006 §4 and the research report §1.'\n )\n }\n }\n\n override connectedCallback(): void {\n super.connectedCallback()\n this.#warnIfNoGetRowId()\n // Initialise uncontrolled pagination with the configured\n // `defaultPageSize`. Field initializers can't read `this` so we\n // do it here on first connection.\n if (this.#uncontrolledPagination.pageSize === 10 && this.defaultPageSize !== 10) {\n this.#uncontrolledPagination = {\n pageIndex: 0,\n pageSize: this.defaultPageSize,\n }\n }\n }\n\n override render(): TemplateResult {\n if (this.loading) {\n // Loading state. The primitive provides the container\n // (role=\"status\" + aria-busy=\"true\") and a styled slot for\n // the actual spinner. The datatable does NOT pull in the\n // <sken-icon> primitive itself — that's the consumer's job\n // (ADR-0011: the icon family is Sken-owned, but the\n // datatable is not the place to depend on it). The CSS\n // animation below uses ::slotted(sken-icon) so the consumer\n // can drop in <sken-icon name=\"spinner\"> and get the spin\n // for free.\n return html`\n <div class=\"loading\" role=\"status\" aria-busy=\"true\">\n <slot name=\"loading\"></slot>\n </div>\n `\n }\n\n if (this.rows.length === 0) {\n return this.#renderEmpty()\n }\n\n // Controlled vs uncontrolled pattern. The primitive ALWAYS\n // passes a fully-populated `state` object to TanStack. For\n // controlled slices, the value comes from the consumer's prop;\n // for uncontrolled slices, the value comes from the primitive's\n // State plumbing (v9 + Lit + TableController):\n //\n // For controlled slices (consumer provides a value), we pass\n // it in both `state` and `initialState` so the row model\n // reflects the consumer's value on the same render that\n // receives the new props.\n //\n // For uncontrolled slices, we pass `initialState` ONLY when\n // the slice is non-empty. The reason: in v9, including\n // `sorting: []` in `state` or `initialState` makes\n // `atoms.sorting.get()` return null and breaks the\n // `getSortedRowModel` pipeline. The safe path is to omit the\n // key entirely and let TanStack initialise the atom lazily\n // on the first state mutation (click on a sortable header).\n const state: Record<string, unknown> = {}\n const initialState: Record<string, unknown> = {}\n if (this.sorting !== undefined && this.sorting.length > 0) {\n state.sorting = this.sorting\n initialState.sorting = this.sorting\n }\n if (this.globalFilter !== undefined && this.globalFilter.length > 0) {\n state.globalFilter = this.globalFilter\n initialState.globalFilter = this.globalFilter\n }\n if (this.pagination !== undefined) {\n state.pagination = this.pagination\n initialState.pagination = this.pagination\n } else {\n // Pagination always has a default (pageIndex 0, pageSize\n // defaultPageSize). It's safe to seed unconditionally because\n // the pagination atom accepts an object — unlike sorting\n // which fails on an empty array.\n initialState.pagination = this.#uncontrolledPagination\n }\n\n // The `as` cast is required because TanStack's `TableOptions<TFeatures, TData>`\n // narrows TFeatures from the `features` field, but we pass the full\n // core + stock features object. Runtime is correct; the cast just\n // bypasses the over-strict feature inference.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const table = this.#getTableController().table({\n data: this.rows,\n columns: this.columns,\n getRowId: this.getRowId ?? ((_row, index) => String(index)),\n features: this.#features,\n globalFilterFn: this.#fuzzyFilter,\n state,\n initialState,\n onSortingChange: (updater: unknown) => {\n const current = this.sorting ?? this.#uncontrolledSorting\n const nextSorting =\n typeof updater === 'function'\n ? (updater as (old: SortingState) => SortingState)(current)\n : (updater as SortingState)\n if (this.sorting === undefined) {\n this.#uncontrolledSorting = nextSorting\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<SortingState>('sken-sort-change', {\n detail: nextSorting,\n bubbles: true,\n composed: true,\n })\n )\n },\n onGlobalFilterChange: (updater: unknown) => {\n const current = this.globalFilter ?? this.#uncontrolledGlobalFilter\n const nextFilter =\n typeof updater === 'function'\n ? (updater as (old: string) => string)(current)\n : (updater as string)\n if (this.globalFilter === undefined) {\n this.#uncontrolledGlobalFilter = nextFilter\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<string>('sken-global-filter-change', {\n detail: nextFilter,\n bubbles: true,\n composed: true,\n })\n )\n },\n onPaginationChange: (updater: unknown) => {\n const current = this.pagination ?? this.#uncontrolledPagination\n const next =\n typeof updater === 'function'\n ? (updater as (old: typeof current) => typeof current)(current)\n : (updater as typeof current)\n if (this.pagination === undefined) {\n this.#uncontrolledPagination = next\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<typeof current>('sken-pagination-change', {\n detail: next,\n bubbles: true,\n composed: true,\n })\n )\n },\n } as any)\n\n // TanStack's `TableController` deliberately defers the external `state`\n // → internal store sync to `hostUpdated()` (after Lit has patched the\n // DOM). That's the right move for React/Solid (the store commit is\n // async) but the wrong one for our render path: we read\n // `table.getRowModel()` here, and that read needs the sorted /\n // filtered / paginated model to be live *in this render* — not one\n // commit later. Without this, every controlled sort/filter/page\n // action lags a render and tests + the browser probe see the\n // pre-sync state. We re-publish the captured state before reading\n // the row model; the controller's own `hostUpdated` call later is a\n // safe no-op (the compare function is `===`, the values match).\n //\n // TanStack v9's `TableController.table_setOptions(..., { syncExternalState: false })`\n // defers the external `state` to internal store sync to\n // `hostUpdated()` (after Lit has patched the DOM). The render\n // reads `table.getRowModel()` with the OLD snapshot, so the\n // first render with `state.sorting = [{id, desc}]` does not\n // reflect the sort. Fix: call `table_publishExternalState` from\n // `@tanstack/table-core/static-functions` (subpath, not\n // re-exported from the main index) in `render()` right after\n // building the `table` and before the first `getHeaderGroups()`\n // / `getRowModel()`. The controller's own `hostUpdated` call\n // later is a safe no-op (the compare function is `===`, the\n // values match).\n //\n // **Tree-shake guard**: `@tanstack/table-core` declares\n // `\"sideEffects\": false` in its package.json. Rollup treats\n // every import from that package as pure, and `table_publishExternalState`\n // returns `void` — so an isolated expression-statement call is\n // tree-shaken away in the production bundle. The symptom is\n // silent: tests pass (happy-dom happens to flush in a way that\n // hides the lag), the bundle drops ~150 bytes, and the browser\n // stops reflecting controlled sort/filter/page. We defeat\n // the tree-shake by assigning the call's return value to a\n // module-level `Reflect`-style sink — Rollup treats\n // `Reflect.set` as side-effectful and keeps the call. The cast\n // through `any` covers the `TFeatures` mismatch (the public\n // type is open).\n // Use the namespace import (not the named one) to call the\n // function. The named import is still here for type-only\n // reasons, but the actual call goes through the namespace\n // binding — which Rollup cannot tree-shake because the\n // namespace import is a side-effect anchor (any other code\n // path that reads `_tableCoreStaticNS` would force the\n // module to stay; here the IIFE reads the namespace and so\n // the call survives the bundler).\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ;(_tableCoreStaticNS as any).table_publishExternalState(table as any, state, (a: unknown, b: unknown) => a === b)\n\n return html`\n <div class=\"filter-bar\">\n <slot name=\"filter\">\n <input\n class=\"filter-input\"\n type=\"search\"\n placeholder=${this.filterPlaceholder}\n aria-label=\"Filter rows\"\n .value=${this.globalFilter ?? this.#uncontrolledGlobalFilter}\n @input=${(e: Event) => {\n const input = e.target as HTMLInputElement\n if (this.globalFilter === undefined) {\n this.#uncontrolledGlobalFilter = input.value\n this.requestUpdate()\n }\n this.dispatchEvent(\n new CustomEvent<string>('sken-global-filter-change', {\n detail: input.value,\n bubbles: true,\n composed: true,\n })\n )\n }}\n />\n </slot>\n </div>\n <table>\n <thead>\n ${table.getHeaderGroups().map((headerGroup: unknown) => {\n const group = headerGroup as unknown as {\n id: string\n headers: ReadonlyArray<{\n id: string\n column: {\n id: string\n columnDef: { header?: unknown; enableSorting?: boolean }\n getCanSort: () => boolean\n getIsSorted: () => false | 'asc' | 'desc'\n getToggleSortingHandler: () => undefined | ((e: unknown) => void)\n }\n }>\n }\n return html`\n <tr>\n ${group.headers.map((header) => {\n const headerRenderable = header.column.columnDef.header\n const headerText =\n typeof headerRenderable === 'string' ? headerRenderable : header.column.id\n const canSort = header.column.getCanSort()\n const isSorted = header.column.getIsSorted()\n const sortIndicator =\n isSorted === 'asc' ? '▲' : isSorted === 'desc' ? '▼' : ''\n const handler = header.column.getToggleSortingHandler()\n return html`\n <th\n scope=\"col\"\n part=\"header-cell\"\n data-column-id=${header.column.id}\n class=${canSort ? 'sortable' : ''}\n aria-sort=${isSorted === 'asc'\n ? 'ascending'\n : isSorted === 'desc'\n ? 'descending'\n : 'none'}\n @click=${canSort && handler ? handler : null}\n >\n <span class=\"header-text\">${headerText}</span>\n ${canSort\n ? html`<span\n class=\"sort-indicator\"\n data-state=${isSorted || 'none'}\n aria-hidden=\"true\"\n >${sortIndicator}</span\n >`\n : nothing}\n </th>\n `\n })}\n </tr>\n `\n })}\n </thead>\n <tbody>\n ${table.getRowModel().rows.map((row: unknown) => {\n const r = row as unknown as {\n id: string\n getAllCells: () => ReadonlyArray<{\n id: string\n column: { id: string }\n getValue: () => unknown\n }>\n }\n return html`\n <tr part=\"row\" data-row-id=${r.id}>\n ${r.getAllCells().map((cell) => {\n const cellValue = cell.getValue()\n return html`\n <td part=\"cell\" data-column-id=${cell.column.id}>\n ${cellValue === null || cellValue === undefined\n ? nothing\n : String(cellValue)}\n </td>\n `\n })}\n </tr>\n `\n })}\n </tbody>\n </table>\n\n <div class=\"pagination-bar\" part=\"pagination\">\n <slot name=\"pagination\">\n ${(() => {\n const t = table as unknown as {\n state: { pagination: { pageIndex: number; pageSize: number } }\n getPageCount: () => number\n getCanPreviousPage: () => boolean\n getCanNextPage: () => boolean\n previousPage: () => void\n nextPage: () => void\n setPageIndex: (i: number) => void\n }\n const { pageIndex, pageSize } = t.state.pagination\n const pageCount = t.getPageCount()\n return html`\n <button\n type=\"button\"\n class=\"page-btn\"\n ?disabled=${!t.getCanPreviousPage()}\n @click=${() => t.previousPage()}\n aria-label=\"Previous page\"\n >\n ← Prev\n </button>\n <span class=\"page-info\">\n Page ${pageIndex + 1} of ${Math.max(pageCount, 1)}\n </span>\n <button\n type=\"button\"\n class=\"page-btn\"\n ?disabled=${!t.getCanNextPage()}\n @click=${() => t.nextPage()}\n aria-label=\"Next page\"\n >\n Next →\n </button>\n <span class=\"page-size-info\">${pageSize} per page</span>\n `\n })()}\n </slot>\n </div>\n `\n }\n\n #renderEmpty(): TemplateResult {\n return html`\n <div class=\"empty\" role=\"status\">\n <slot name=\"empty\">${this.empty ?? 'No rows'}</slot>\n </div>\n `\n }\n\n static styles = css`\n :host {\n display: block;\n inline-size: 100%;\n font-family: var(--sken-family-sans);\n color: var(--sken-foreground);\n }\n\n table {\n inline-size: 100%;\n border-collapse: collapse;\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n overflow: hidden;\n }\n\n thead {\n background: var(--sken-muted);\n }\n\n th,\n td {\n padding-block: var(--sken-2);\n padding-inline: var(--sken-3);\n text-align: start;\n border-block-end: 1px solid var(--sken-border);\n }\n\n th {\n font-weight: var(--sken-weight-semibold);\n color: var(--sken-foreground);\n }\n\n th.sortable {\n cursor: pointer;\n user-select: none;\n }\n\n th.sortable:hover {\n background: var(--sken-muted);\n }\n\n th .header-text {\n margin-inline-end: 0.25rem;\n }\n\n th .sort-indicator {\n display: inline-block;\n min-inline-size: 0.75rem;\n color: var(--sken-muted-foreground);\n font-size: 0.75em;\n }\n\n th .sort-indicator[data-state='asc'],\n th .sort-indicator[data-state='desc'] {\n color: var(--sken-primary);\n }\n\n tbody tr:last-child td {\n border-block-end: none;\n }\n\n tbody tr:hover {\n background: var(--sken-muted);\n }\n\n .empty {\n padding-block: var(--sken-4);\n padding-inline: var(--sken-3);\n text-align: center;\n color: var(--sken-muted-foreground);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n }\n\n .loading {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-block: var(--sken-6);\n min-block-size: 12rem;\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n color: var(--sken-muted-foreground);\n }\n\n /* The loading region renders a loading slot. The consumer\n supplies the spinner (typically a sken-icon with name\n spinner, which animates itself per its name) and the\n datatable provides the layout + accessible status region.\n The keyframe is owned by the icon package, not here,\n because the rotation is part of what spinner means: a\n static spinner would be a different icon. */\n\n .filter-bar {\n margin-block-end: 0.75rem;\n }\n\n .filter-input {\n box-sizing: border-box;\n inline-size: 100%;\n max-inline-size: 20rem;\n padding-block: var(--sken-2);\n padding-inline: var(--sken-3);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-md);\n background: var(--sken-background);\n color: var(--sken-foreground);\n font-family: var(--sken-family-sans);\n font-size: var(--sken-size-md);\n }\n\n .filter-input::placeholder {\n color: var(--sken-muted-foreground);\n }\n\n .filter-input:focus-visible {\n outline: 2px solid var(--sken-primary);\n outline-offset: 1px;\n }\n\n .pagination-bar {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n margin-block-start: 0.75rem;\n font-size: 0.875rem;\n color: var(--sken-muted-foreground);\n }\n\n .page-btn {\n padding-block: var(--sken-1);\n padding-inline: var(--sken-3);\n border: 1px solid var(--sken-border);\n border-radius: var(--sken-sm);\n background: var(--sken-background);\n color: var(--sken-foreground);\n font-family: inherit;\n font-size: inherit;\n cursor: pointer;\n }\n\n .page-btn:hover:not(:disabled) {\n background: var(--sken-muted);\n }\n\n .page-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .page-info {\n color: var(--sken-foreground);\n }\n `\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sken-datatable': SkenDataTable<RowData>\n }\n}\n"],"x_google_ignoreList":[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,SAAS,EAAW,GAAM,GAAO;CAGhC,OAFI,KAAS,OAAgC,OACzC,OAAO,KAAS,aAAmB,EAAK,CAAK,IAC1C;AACR;AAkBA,SAAS,EAAW,GAAO;CAC1B,IAAI,UAAU,KAAS,EAAM,MAAM;EAClC,IAAM,IAAO,EAAM,MACb,IAAY,EAAK,OAAO,WACxB,IAAe,GACf,IAAoB;EAG1B,OAFI,EAAa,kBAAkB,IAAU,EAAW,EAAkB,kBAAkB,EAAU,MAAM,EAAK,WAAW,CAAC,IACzH,EAAa,mBAAmB,IAAU,OACvC,EAAW,EAAU,MAAM,EAA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,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,IAAI;CACJ,IAAI;CACJ,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG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,GAST,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAO7B,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,gBAAA,KAAA,CAAA,GAQ7B,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,qBAAA,KAAA,CAAA,GAOT,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAI7B,EAAA,CAAA,EAAS;CAAE,WAAW;CAAqB,MAAM;AAAO,CAAC,CAAA,GAAA,EAAA,WAAA,mBAAA,KAAA,CAAA,GA7D3D,IAAA,EAAA,CAAA,EAAc,gBAAgB,CAAA,GAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./sken-datatable-BtR-NwRN.js";
2
+ export { e as SkenDataTable };
@@ -0,0 +1,42 @@
1
+ import { t as e } from "./decorate-D4FKzyDw.js";
2
+ import { LitElement as t, html as n } from "lit";
3
+ import { customElement as r, property as i } from "lit/decorators.js";
4
+ //#region src/components/sken-date-picker.ts
5
+ var a = class extends t {
6
+ constructor(...e) {
7
+ super(...e), this.value = null, this.label = "", this.helperText = "", this.placeholder = "", this.disabled = !1, this.format = "yyyy-MM-dd", this.onIxValueChange = (e) => {
8
+ let t = e.detail, n = t == null || t === "" ? null : t;
9
+ n !== this.value && (this.value = n, this.dispatchEvent(new CustomEvent("sken-change", {
10
+ detail: { value: n },
11
+ bubbles: !0,
12
+ composed: !0
13
+ })));
14
+ };
15
+ }
16
+ createRenderRoot() {
17
+ return this;
18
+ }
19
+ render() {
20
+ return n`
21
+ <ix-date-input
22
+ .value=${this.value ?? ""}
23
+ format=${this.format}
24
+ ?disabled=${this.disabled}
25
+ placeholder=${this.placeholder}
26
+ min-date=${this.minDate ?? ""}
27
+ max-date=${this.maxDate ?? ""}
28
+ locale=${this.locale ?? ""}
29
+ data-testid="sken-date-picker"
30
+ @valueChange=${this.onIxValueChange}
31
+ >
32
+ ${this.label ? n`<ix-label>${this.label}</ix-label>` : null}
33
+ ${this.helperText ? n`<ix-typography slot="end">${this.helperText}</ix-typography>` : null}
34
+ </ix-date-input>
35
+ `;
36
+ }
37
+ };
38
+ e([i({ attribute: !1 })], a.prototype, "value", void 0), e([i()], a.prototype, "label", void 0), e([i({ attribute: "helper-text" })], a.prototype, "helperText", void 0), e([i()], a.prototype, "placeholder", void 0), e([i({ type: Boolean })], a.prototype, "disabled", void 0), e([i()], a.prototype, "format", void 0), e([i({ attribute: "min-date" })], a.prototype, "minDate", void 0), e([i({ attribute: "max-date" })], a.prototype, "maxDate", void 0), e([i()], a.prototype, "locale", void 0), a = e([r("sken-date-picker")], a);
39
+ //#endregion
40
+ export { a as SkenDatePicker };
41
+
42
+ //# sourceMappingURL=sken-date-picker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sken-date-picker.js","names":[],"sources":["../src/components/sken-date-picker.ts"],"sourcesContent":["/**\n * `<sken-date-picker>` — Sken contract implementation backed by\n * Siemens iX 5's `<ix-date-input>`.\n *\n * The Sken contract (`SkenDatePickerProps`, `SkenDatePickerEmits`,\n * `skenDatePickerAria`) lives in `@sken-ds/contracts`. This component\n * is a thin Lit 3 wrapper that:\n *\n * 1. Accepts the Sken contract props on a `<sken-date-picker>`\n * custom element registered via `@customElement`.\n * 2. Renders a single `<ix-date-input>` with the Sken-shaped\n * `value` mapped to iX's `value` prop, the Sken `label`\n * rendered as an `<ix-label>` child, and the Sken\n * `helperText` rendered as an `<ix-typography>` child in\n * the `end` slot.\n * 3. Translates iX's `valueChange` event into Sken's\n * `sken-change` CustomEvent whose `detail.value` is the new\n * ISO 8601 date string or `null`.\n *\n * Subpath: import from `@sken-ds/primitives/sken-date-picker` to\n * register the custom element.\n *\n * Consumer boot sequence (same as `<sken-combobox>`):\n *\n * 1. `import '@siemens/ix/dist/siemens-ix/siemens-ix.css'`\n * 2. `defineCustomElements(window)` for both `@siemens/ix/loader`\n * and `@siemens/ix-icons/loader`, BEFORE any\n * `<sken-date-picker>` renders (Stencil does not re-hydrate).\n * 3. `import '@sken-ds/primitives/ix-bridge.css'` once at app boot\n * so the date-picker popover (`<ix-date-time-card>`,\n * `<ix-date-picker>`) renders in Sken colours instead of\n * iX classic light values. The consumer is responsible for\n * setting `data-theme` on a common ancestor.\n */\nimport { LitElement, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport type { SkenDatePickerProps } from '@sken-ds/contracts'\n\n@customElement('sken-date-picker')\nexport class SkenDatePicker\n extends LitElement\n implements\n Pick<\n SkenDatePickerProps,\n | 'value'\n | 'label'\n | 'helperText'\n | 'placeholder'\n | 'disabled'\n | 'format'\n | 'minDate'\n | 'maxDate'\n | 'locale'\n >\n{\n /** Controlled value (ISO 8601 `yyyy-MM-dd`). `null` means no selection. */\n @property({ attribute: false })\n value: string | null = null\n\n /** Visible label rendered above the input. */\n @property() label = ''\n\n /** Helper text rendered below the input. */\n @property({ attribute: 'helper-text' })\n helperText = ''\n\n /** Placeholder shown when the input is empty. */\n @property() placeholder = ''\n\n /** Disabled state. @default false */\n @property({ type: Boolean })\n disabled = false\n\n /** Display format. Luxon-style tokens. @default \"yyyy-MM-dd\" */\n @property() format = 'yyyy-MM-dd'\n\n /** Earliest selectable date (ISO 8601 `yyyy-MM-dd`). */\n @property({ attribute: 'min-date' })\n minDate?: string\n\n /** Latest selectable date (ISO 8601 `yyyy-MM-dd`). */\n @property({ attribute: 'max-date' })\n maxDate?: string\n\n /** BCP 47 locale tag. */\n @property() locale?: string\n\n /**\n * Translate iX's `valueChange` event into Sken's `sken-change`\n * CustomEvent. iX 5 emits `valueChange` with `detail` set to\n * a `string | undefined` directly (not an object). We pass\n * the value through as-is so the consumer gets the same\n * string format they passed in; an empty value maps to\n * `null` so the Sken contract stays `string | null`.\n */\n private onIxValueChange = (e: Event) => {\n const detail = (e as CustomEvent<string | undefined>).detail\n const next = detail == null || detail === '' ? null : detail\n if (next === this.value) return\n this.value = next\n this.dispatchEvent(\n new CustomEvent<{ value: string | null }>('sken-change', {\n detail: { value: next },\n bubbles: true,\n composed: true,\n }),\n )\n }\n\n // Light DOM so Sken tokens (CSS custom properties) cascade\n // from the document root into the iX shadow tree. The re-skin\n // mapping (`--ix-*` → Sken tokens) lives in\n // `@sken-ds/primitives/ix-bridge.css`, which the consumer\n // imports once at app boot.\n protected override createRenderRoot(): HTMLElement {\n return this as unknown as HTMLElement\n }\n\n protected override render() {\n return html`\n <ix-date-input\n .value=${this.value ?? ''}\n format=${this.format}\n ?disabled=${this.disabled}\n placeholder=${this.placeholder}\n min-date=${this.minDate ?? ''}\n max-date=${this.maxDate ?? ''}\n locale=${this.locale ?? ''}\n data-testid=\"sken-date-picker\"\n @valueChange=${this.onIxValueChange}\n >\n ${this.label ? html`<ix-label>${this.label}</ix-label>` : null}\n ${this.helperText\n ? html`<ix-typography slot=\"end\">${this.helperText}</ix-typography>`\n : null}\n </ix-date-input>\n `\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sken-date-picker': SkenDatePicker\n }\n}\n"],"mappings":";;;;AAwCO,IAAM,IAAN,cACG,EAcV;;EAyC6B,aAtCJ,KAAA,QAAA,MAGH,KAAA,QAAA,IAIP,KAAA,aAAA,IAGa,KAAA,cAAA,IAIf,KAAA,WAAA,IAGU,KAAA,SAAA,cAqBM,KAAA,mBAAA,MAAa;GACtC,IAAM,IAAU,EAAsC,QAChD,IAAO,KAAU,QAAQ,MAAW,KAAK,OAAO;GAClD,MAAS,KAAK,UAClB,KAAK,QAAQ,GACb,KAAK,cACH,IAAI,YAAsC,eAAe;IACvD,QAAQ,EAAE,OAAO,EAAK;IACtB,SAAS;IACT,UAAU;GACZ,CAAC,CACH;EACF;;CAOA,mBAAmD;EACjD,OAAO;CACT;CAEA,SAA4B;EAC1B,OAAO,CAAI;;iBAEE,KAAK,SAAS,GAAG;iBACjB,KAAK,OAAO;oBACT,KAAK,SAAS;sBACZ,KAAK,YAAY;mBACpB,KAAK,WAAW,GAAG;mBACnB,KAAK,WAAW,GAAG;iBACrB,KAAK,UAAU,GAAG;;uBAEZ,KAAK,gBAAgB;;UAElC,KAAK,QAAQ,CAAI,aAAa,KAAK,MAAM,eAAe,KAAK;UAC7D,KAAK,aACH,CAAI,6BAA6B,KAAK,WAAW,oBACjD,KAAK;;;CAGf;AACF;AAlFG,EAAA,CAAA,EAAS,EAAE,WAAW,GAAM,CAAC,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAI7B,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,SAAA,KAAA,CAAA,GAGT,EAAA,CAAA,EAAS,EAAE,WAAW,cAAc,CAAC,CAAA,GAAA,EAAA,WAAA,cAAA,KAAA,CAAA,GAIrC,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,eAAA,KAAA,CAAA,GAGT,EAAA,CAAA,EAAS,EAAE,MAAM,QAAQ,CAAC,CAAA,GAAA,EAAA,WAAA,YAAA,KAAA,CAAA,GAI1B,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GAGT,EAAA,CAAA,EAAS,EAAE,WAAW,WAAW,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAIlC,EAAA,CAAA,EAAS,EAAE,WAAW,WAAW,CAAC,CAAA,GAAA,EAAA,WAAA,WAAA,KAAA,CAAA,GAIlC,EAAA,CAAA,EAAS,CAAA,GAAA,EAAA,WAAA,UAAA,KAAA,CAAA,GA/CX,IAAA,EAAA,CAAA,EAAc,kBAAkB,CAAA,GAAA,CAAA"}
@@ -0,0 +1,243 @@
1
+ import { t as e } from "./decorate-D4FKzyDw.js";
2
+ import { i as t, n, r, t as i } from "./directive-BcLtPdVO.js";
3
+ import { LitElement as a, css as o, html as s, nothing as c } from "lit";
4
+ import { customElement as l, property as u, query as d } from "lit/decorators.js";
5
+ //#region ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/directives/class-map.js
6
+ var f = i(class extends n {
7
+ constructor(e) {
8
+ if (super(e), e.type !== r.ATTRIBUTE || e.name !== "class" || e.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");
9
+ }
10
+ render(e) {
11
+ return " " + Object.keys(e).filter((t) => e[t]).join(" ") + " ";
12
+ }
13
+ update(e, [n]) {
14
+ if (this.st === void 0) {
15
+ this.st = /* @__PURE__ */ new Set(), e.strings !== void 0 && (this.nt = new Set(e.strings.join(" ").split(/\s/).filter((e) => e !== "")));
16
+ for (let e in n) n[e] && !this.nt?.has(e) && this.st.add(e);
17
+ return this.render(n);
18
+ }
19
+ let r = e.element.classList;
20
+ for (let e of this.st) e in n || (r.remove(e), this.st.delete(e));
21
+ for (let e in n) {
22
+ let t = !!n[e];
23
+ t === this.st.has(e) || this.nt?.has(e) || (t ? (r.add(e), this.st.add(e)) : (r.remove(e), this.st.delete(e)));
24
+ }
25
+ return t;
26
+ }
27
+ }), p = class extends a {
28
+ constructor(...e) {
29
+ super(...e), this.open = !1, this.size = "md", this.dismissable = "dismissable", this.ariaLabel = null, this.ariaDescribedBy = null, this.#e = null, this.#t = null, this.#n = !1, this.#r = !1, this.#a = (e) => {
30
+ if (this.dismissable === "persistent") {
31
+ e.preventDefault();
32
+ return;
33
+ }
34
+ this.#l("sken-close", "escape");
35
+ }, this.#o = () => {
36
+ this.#l("sken-closed");
37
+ }, this.#s = (e) => {
38
+ e.target === this._dialog && this.dismissable !== "persistent" && this.#l("sken-close", "backdrop");
39
+ }, this.#c = () => {
40
+ this.#l("sken-close", "close-button");
41
+ }, this.#u = (e) => {
42
+ let t = e.target;
43
+ this.#r = t.assignedNodes({ flatten: !0 }).length > 0, this.requestUpdate();
44
+ };
45
+ }
46
+ #e;
47
+ #t;
48
+ #n;
49
+ #r;
50
+ static {
51
+ this.styles = o`
52
+ :host {
53
+ display: contents;
54
+ }
55
+
56
+ dialog {
57
+ /* Reset native styles. */
58
+ padding: 0;
59
+ border: none;
60
+ background: transparent;
61
+ color: inherit;
62
+ max-width: none;
63
+ max-height: none;
64
+ margin: auto;
65
+ outline: none;
66
+ }
67
+
68
+ /* Open animation (entry). The browser fires the open attribute
69
+ on showModal(); with transition-behavior: allow-discrete we
70
+ can animate the top-layer entry. Falls back to no animation
71
+ in browsers without support. */
72
+ dialog[open] {
73
+ animation: sken-dialog-enter 150ms ease-out;
74
+ }
75
+ @keyframes sken-dialog-enter {
76
+ from {
77
+ opacity: 0;
78
+ transform: scale(0.96);
79
+ }
80
+ to {
81
+ opacity: 1;
82
+ transform: scale(1);
83
+ }
84
+ }
85
+
86
+ /* Backdrop. Native ::backdrop is a pseudo-element on the
87
+ <dialog> when shown via showModal(). */
88
+ dialog::backdrop {
89
+ background: rgba(15, 18, 24, 0.55);
90
+ animation: sken-dialog-backdrop-enter 150ms ease-out;
91
+ }
92
+ @keyframes sken-dialog-backdrop-enter {
93
+ from { opacity: 0; }
94
+ to { opacity: 1; }
95
+ }
96
+
97
+ .panel {
98
+ background: var(--sken-color-surface, #ffffff);
99
+ color: var(--sken-color-text, #1a1a1a);
100
+ border-radius: 12px;
101
+ box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.25);
102
+ display: flex;
103
+ flex-direction: column;
104
+ max-height: 90vh;
105
+ max-width: 90vw;
106
+ overflow: hidden;
107
+ font-family: var(--sken-font-sans, system-ui, sans-serif);
108
+ }
109
+
110
+ .panel.sm { width: 400px; }
111
+ .panel.md { width: 560px; }
112
+ .panel.lg { width: 800px; }
113
+
114
+ header {
115
+ display: flex;
116
+ align-items: flex-start;
117
+ justify-content: space-between;
118
+ gap: 16px;
119
+ padding: 20px 24px 8px;
120
+ }
121
+
122
+ header ::slotted([slot='title']) {
123
+ font-size: 18px;
124
+ font-weight: 600;
125
+ line-height: 1.3;
126
+ margin: 0;
127
+ }
128
+
129
+ .body {
130
+ padding: 8px 24px 16px;
131
+ overflow-y: auto;
132
+ flex: 1;
133
+ }
134
+
135
+ footer {
136
+ display: flex;
137
+ align-items: center;
138
+ justify-content: flex-end;
139
+ gap: 8px;
140
+ padding: 12px 24px 20px;
141
+ }
142
+
143
+ /* Only render the footer divider if there is content. */
144
+ footer:not(:has(*)) {
145
+ display: none;
146
+ }
147
+
148
+ .close-button {
149
+ appearance: none;
150
+ background: transparent;
151
+ border: none;
152
+ cursor: pointer;
153
+ width: 32px;
154
+ height: 32px;
155
+ display: inline-flex;
156
+ align-items: center;
157
+ justify-content: center;
158
+ border-radius: 6px;
159
+ color: inherit;
160
+ opacity: 0.6;
161
+ transition: opacity 100ms, background 100ms;
162
+ flex-shrink: 0;
163
+ }
164
+ .close-button:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
165
+ .close-button:focus-visible {
166
+ outline: 2px solid var(--sken-color-focus, #2e6fc6);
167
+ outline-offset: 1px;
168
+ }
169
+ `;
170
+ }
171
+ connectedCallback() {
172
+ super.connectedCallback(), this.#e = this.parentNode, this.#t = this.nextSibling;
173
+ }
174
+ disconnectedCallback() {
175
+ super.disconnectedCallback(), this.#n && this.#e && (this.#t && this.#t.parentNode === this.#e ? this.#e.insertBefore(this, this.#t) : this.#e.appendChild(this), this.#n = !1);
176
+ }
177
+ updated(e) {
178
+ e.has("open") && this._dialog && (this.open ? this.#i() : this._dialog.open && this._dialog.close());
179
+ }
180
+ #i() {
181
+ this.#n === !1 && this.parentNode !== document.body && (document.body.appendChild(this), this.#n = !0), this._dialog.open || (this._dialog.showModal(), this.#l("sken-opened"), queueMicrotask(() => {
182
+ this.dismissable === "dismissable" && this._closeButton ? this._closeButton.focus() : this._dialog.querySelector("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])")?.focus();
183
+ }));
184
+ }
185
+ closeDialog(e = "close-button") {
186
+ this.#l("sken-close", e);
187
+ }
188
+ #a;
189
+ #o;
190
+ #s;
191
+ #c;
192
+ #l(e, t) {
193
+ this.dispatchEvent(new CustomEvent(e, {
194
+ detail: t,
195
+ bubbles: !0,
196
+ composed: !0
197
+ }));
198
+ }
199
+ render() {
200
+ let e = {
201
+ panel: !0,
202
+ [this.size]: !0
203
+ }, t = this.#r || this.dismissable === "dismissable", n = this.ariaLabel ?? "";
204
+ return s`
205
+ <dialog
206
+ aria-label=${n || c}
207
+ aria-describedby=${this.ariaDescribedBy || c}
208
+ @cancel=${this.#a}
209
+ @close=${this.#o}
210
+ @click=${this.#s}
211
+ >
212
+ <div class=${f(e)}>
213
+ ${t ? s`<header>
214
+ <slot name="title" @slotchange=${this.#u}></slot>
215
+ ${this.dismissable === "dismissable" ? s`<button
216
+ class="close-button"
217
+ type="button"
218
+ aria-label="Close dialog"
219
+ @click=${this.#c}
220
+ >
221
+
222
+ </button>` : c}
223
+ </header>` : c}
224
+ <div class="body">
225
+ <slot></slot>
226
+ </div>
227
+ <footer>
228
+ <slot name="actions"></slot>
229
+ </footer>
230
+ </div>
231
+ </dialog>
232
+ `;
233
+ }
234
+ #u;
235
+ };
236
+ e([u({
237
+ reflect: !0,
238
+ type: Boolean
239
+ })], p.prototype, "open", void 0), e([u({ reflect: !0 })], p.prototype, "size", void 0), e([u({ reflect: !0 })], p.prototype, "dismissable", void 0), e([u({ attribute: "aria-label" })], p.prototype, "ariaLabel", void 0), e([u({ attribute: "aria-describedby" })], p.prototype, "ariaDescribedBy", void 0), e([d("dialog")], p.prototype, "_dialog", void 0), e([d(".close-button")], p.prototype, "_closeButton", void 0), p = e([l("sken-dialog")], p);
240
+ //#endregion
241
+ export { p as t };
242
+
243
+ //# sourceMappingURL=sken-dialog-hRtML2jW.js.map