@mhmo91/schmancy 0.2.128 → 0.2.130

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/autocomplete-CVTRldW1.cjs +58 -0
  2. package/dist/autocomplete-CVTRldW1.cjs.map +1 -0
  3. package/dist/{autocomplete-Bbi68nzP.js → autocomplete-DzBhZOVS.js} +68 -67
  4. package/dist/autocomplete-DzBhZOVS.js.map +1 -0
  5. package/dist/autocomplete.cjs +1 -1
  6. package/dist/autocomplete.js +1 -1
  7. package/dist/card.cjs +1 -1
  8. package/dist/card.js +1 -1
  9. package/dist/content-drawer.cjs +1 -1
  10. package/dist/content-drawer.js +1 -1
  11. package/dist/{context-object-CD26Iary.js → context-object-BDXZ5EKJ.js} +6 -6
  12. package/dist/context-object-BDXZ5EKJ.js.map +1 -0
  13. package/dist/context-object-BIywslrO.cjs +2 -0
  14. package/dist/context-object-BIywslrO.cjs.map +1 -0
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.js +4 -4
  17. package/dist/nav-drawer.cjs +1 -1
  18. package/dist/nav-drawer.js +1 -1
  19. package/dist/{selector-hook-9dSW11-1.js → selector-hook-C6VCezv7.js} +111 -112
  20. package/dist/selector-hook-C6VCezv7.js.map +1 -0
  21. package/dist/selector-hook-DDaYMsHs.cjs +2 -0
  22. package/dist/selector-hook-DDaYMsHs.cjs.map +1 -0
  23. package/dist/store.cjs +1 -1
  24. package/dist/store.js +2 -2
  25. package/dist/teleport.cjs +1 -1
  26. package/dist/{teleport.component-CplIV2h1.cjs → teleport.component-72oIW654.cjs} +2 -2
  27. package/dist/{teleport.component-CplIV2h1.cjs.map → teleport.component-72oIW654.cjs.map} +1 -1
  28. package/dist/{teleport.component-CBNKUZwe.js → teleport.component-vWzkjwaD.js} +3 -3
  29. package/dist/{teleport.component-CBNKUZwe.js.map → teleport.component-vWzkjwaD.js.map} +1 -1
  30. package/dist/teleport.js +1 -1
  31. package/package.json +11 -3
  32. package/types/src/autocomplete/autocomplete.d.ts +4 -2
  33. package/types/src/store/context-collection.d.ts +0 -3
  34. package/dist/autocomplete-Bbi68nzP.js.map +0 -1
  35. package/dist/autocomplete-DEUfHcCH.cjs +0 -57
  36. package/dist/autocomplete-DEUfHcCH.cjs.map +0 -1
  37. package/dist/context-object-CD26Iary.js.map +0 -1
  38. package/dist/context-object-D81PeS3j.cjs +0 -2
  39. package/dist/context-object-D81PeS3j.cjs.map +0 -1
  40. package/dist/selector-hook-9dSW11-1.js.map +0 -1
  41. package/dist/selector-hook-CH-z8W2d.cjs +0 -2
  42. package/dist/selector-hook-CH-z8W2d.cjs.map +0 -1
@@ -1,58 +1,58 @@
1
- import { b as v, d as z, S as M } from "./context-object-CD26Iary.js";
1
+ import { b as v, d as z, S as M } from "./context-object-BDXZ5EKJ.js";
2
2
  import { property as x } from "lit/decorators.js";
3
3
  import { map as k, distinctUntilChanged as S, shareReplay as A, combineLatest as O, Subject as E } from "rxjs";
4
4
  import { takeUntil as q } from "rxjs/operators";
5
- function W(n, e, t) {
5
+ function W(r, e, t) {
6
6
  if (e === "indexeddb") throw new v("IndexedDB storage is not supported for plain objects", null, { storage: e, key: t });
7
- const r = M.getInstance(e, t, n);
7
+ const n = M.getInstance(e, t, r);
8
8
  var s;
9
- return typeof (s = r.value) == "object" && s !== null && Object.keys(s).length === 0 && r.$.next(n), r;
9
+ return typeof (s = n.value) == "object" && s !== null && Object.keys(s).length === 0 && n.$.next(r), n;
10
10
  }
11
- function j(n, e, t) {
12
- if (n == null) throw new v("Initial data cannot be null or undefined", null, { storage: e, key: t });
13
- if (n instanceof Map) return function(r, s, i) {
14
- const l = z.getInstance(s, i, r);
15
- return l.value.size || l.$.next(new Map(r)), l;
16
- }(n, e, t);
17
- if (typeof n == "object") return W(n, e, t);
18
- throw new v("Initial data must be an object or a Map", null, { storage: e, key: t, dataType: typeof n });
11
+ function j(r, e, t) {
12
+ if (r == null) throw new v("Initial data cannot be null or undefined", null, { storage: e, key: t });
13
+ if (r instanceof Map) return function(n, s, i) {
14
+ const l = z.getInstance(s, i, n);
15
+ return l.value.size || l.$.next(new Map(n)), l;
16
+ }(r, e, t);
17
+ if (typeof r == "object") return W(r, e, t);
18
+ throw new v("Initial data must be an object or a Map", null, { storage: e, key: t, dataType: typeof r });
19
19
  }
20
- function N(n, e, t = "local") {
21
- return j(n, t, e);
20
+ function N(r, e, t = "local") {
21
+ return j(r, t, e);
22
22
  }
23
- function P(n, e, t = "local") {
24
- return j(Array.isArray(n) ? new Map(n.map((r, s) => [String(s), r])) : n, t, e);
23
+ function P(r, e, t = "local") {
24
+ return j(Array.isArray(r) ? new Map(r.map((n, s) => [String(s), n])) : r, t, e);
25
25
  }
26
- const $ = (n, e) => {
27
- if (!e) return n;
26
+ const $ = (r, e) => {
27
+ if (!e) return r;
28
28
  const t = e.split(".");
29
- let r = n;
29
+ let n = r;
30
30
  for (const s of t) {
31
- if (r == null) return;
32
- r = r[s];
31
+ if (n == null) return;
32
+ n = n[s];
33
33
  }
34
- return r;
35
- }, L = (n) => {
36
- if (!n || n.length < 2) return [];
34
+ return n;
35
+ }, L = (r) => {
36
+ if (!r || r.length < 2) return [];
37
37
  const e = [];
38
- for (let t = 0; t < n.length - 1; t++) e.push(n.substring(t, t + 2).toLowerCase());
38
+ for (let t = 0; t < r.length - 1; t++) e.push(r.substring(t, t + 2).toLowerCase());
39
39
  return e;
40
- }, U = (n, e) => {
41
- if (!n || !e) return 0;
42
- const t = n.toLowerCase().trim(), r = e.toLowerCase().trim();
43
- if (t === r) return 1;
44
- const s = t.includes(r) ? 1 : 0, i = ((c, a) => {
40
+ }, U = (r, e) => {
41
+ if (!r || !e) return 0;
42
+ const t = r.toLowerCase().trim(), n = e.toLowerCase().trim();
43
+ if (t === n) return 1;
44
+ const s = t.includes(n) ? 1 : 0, i = ((c, a) => {
45
45
  if (!c) return !0;
46
46
  if (!a) return !1;
47
47
  let u = 0, o = 0;
48
48
  for (; u < c.length && o < a.length; ) c[u].toLowerCase() === a[o].toLowerCase() && u++, o++;
49
49
  return u === c.length;
50
- })(r, t) ? 0.8 : 0, l = ((c, a) => {
50
+ })(n, t) ? 0.8 : 0, l = ((c, a) => {
51
51
  if (!c) return !0;
52
52
  if (!a) return !1;
53
53
  const u = (y) => y.toLowerCase().split("").reduce((w, g) => (w[g] = (w[g] || 0) + 1, w), {}), o = u(c), h = u(a);
54
54
  return Object.keys(o).every((y) => (h[y] || 0) >= o[y]);
55
- })(r, t) ? 0.7 : 0, f = ((c, a) => {
55
+ })(n, t) ? 0.7 : 0, f = ((c, a) => {
56
56
  if (!c || !a || c.length < 2 || a.length < 2) return 0;
57
57
  const u = L(c), o = L(a);
58
58
  if (u.length === 0 || o.length === 0) return 0;
@@ -63,19 +63,19 @@ const $ = (n, e) => {
63
63
  break;
64
64
  }
65
65
  return 2 * h / (u.length + o.length);
66
- })(t, r), p = Math.max(t.length, r.length), b = p ? 1 - ((c, a) => {
66
+ })(t, n), p = Math.max(t.length, n.length), b = p ? 1 - ((c, a) => {
67
67
  if (c === a) return 0;
68
68
  const u = Array(a.length + 1).fill(null).map((o, h) => [h]);
69
69
  for (let o = 0; o <= c.length; o++) u[0][o] = o;
70
70
  for (let o = 1; o <= a.length; o++) for (let h = 1; h <= c.length; h++) a.charAt(o - 1) === c.charAt(h - 1) ? u[o][h] = u[o - 1][h - 1] : u[o][h] = Math.min(u[o - 1][h] + 1, u[o][h - 1] + 1, u[o - 1][h - 1] + 1);
71
71
  return u[a.length][c.length];
72
- })(t, r) / p : 0;
72
+ })(t, n) / p : 0;
73
73
  return Math.max(s, i, l, f, b);
74
- }, _ = (n) => n == null ? "" : String(n), m = (n) => Array.isArray(n);
75
- function B(n, e, t) {
74
+ }, _ = (r) => r == null ? "" : String(r), m = (r) => Array.isArray(r);
75
+ function B(r, e, t) {
76
76
  if (e == null && t == null) return !0;
77
- if (e == null || t == null) return n === "==" ? e === t : n === "!=" && e !== t;
78
- switch (n) {
77
+ if (e == null || t == null) return r === "==" ? e === t : r === "!=" && e !== t;
78
+ switch (r) {
79
79
  case "==":
80
80
  return e === t;
81
81
  case "!=":
@@ -104,11 +104,10 @@ function B(n, e, t) {
104
104
  return !1;
105
105
  }
106
106
  }
107
- function D(n, e, t = 0.3) {
108
- let r, s, i, l = !1;
109
- if (Array.isArray(e) ? [r, s, i, l = !1] = e : (r = e.key, s = e.operator, i = e.value, l = e.strict || !1), !l && (i === "" || i == null || m(i) && i.length === 0)) return { valid: !0, score: 1 };
110
- const f = $(n, r);
111
- if (l) return f !== i ? { valid: !1, score: 0 } : { valid: !0, score: 1 };
107
+ function D(r, e, t = 0.3) {
108
+ let n, s, i, l = !1;
109
+ if (Array.isArray(e) ? [n, s, i, l = !1] = e : (n = e.key, s = e.operator, i = e.value, l = e.strict || !1), !l && (i === "" || i == null || m(i) && i.length === 0)) return { valid: !0, score: 1 };
110
+ const f = $(r, n);
112
111
  if (s === "any") {
113
112
  if (typeof f != "string" || typeof i != "string") return { valid: !1, score: 0 };
114
113
  const p = U(f, i);
@@ -119,10 +118,10 @@ function D(n, e, t = 0.3) {
119
118
  return { valid: p, score: p ? 1 : 0 };
120
119
  }
121
120
  }
122
- function I(n, e = [], t = 0.3) {
123
- if (!e.length) return Array.from(n.values());
124
- const r = [];
125
- for (const [s, i] of n.entries()) {
121
+ function I(r, e = [], t = 0.3) {
122
+ if (!e.length) return Array.from(r.values());
123
+ const n = [];
124
+ for (const [s, i] of r.entries()) {
126
125
  let l = 0, f = 0, p = !0;
127
126
  for (const b of e) {
128
127
  const c = D(i, b, t);
@@ -132,99 +131,99 @@ function I(n, e = [], t = 0.3) {
132
131
  }
133
132
  l += c.score, f++;
134
133
  }
135
- p && r.push({ item: i, score: f > 0 ? l / f : 1 });
134
+ p && n.push({ item: i, score: f > 0 ? l / f : 1 });
136
135
  }
137
- return r.sort((s, i) => i.score - s.score), r.map((s) => s.item);
136
+ return n.sort((s, i) => i.score - s.score), n.map((s) => s.item);
138
137
  }
139
- function T(n, e = [], t = 0.3) {
140
- const r = /* @__PURE__ */ new Map();
141
- return n.forEach((s, i) => r.set(String(i), s)), I(r, e, t);
138
+ function T(r, e = [], t = 0.3) {
139
+ const n = /* @__PURE__ */ new Map();
140
+ return r.forEach((s, i) => n.set(String(i), s)), I(n, e, t);
142
141
  }
143
142
  const Q = I, V = T;
144
- function C(n, e) {
145
- if (n === e) return !0;
146
- if (n instanceof Map && e instanceof Map) {
147
- if (n.size !== e.size) return !1;
148
- for (const [t, r] of n) if (!e.has(t) || !C(r, e.get(t))) return !1;
143
+ function C(r, e) {
144
+ if (r === e) return !0;
145
+ if (r instanceof Map && e instanceof Map) {
146
+ if (r.size !== e.size) return !1;
147
+ for (const [t, n] of r) if (!e.has(t) || !C(n, e.get(t))) return !1;
149
148
  return !0;
150
149
  }
151
- if (n instanceof Set && e instanceof Set) {
152
- if (n.size !== e.size) return !1;
153
- for (const t of n) if (!e.has(t)) return !1;
150
+ if (r instanceof Set && e instanceof Set) {
151
+ if (r.size !== e.size) return !1;
152
+ for (const t of r) if (!e.has(t)) return !1;
154
153
  return !0;
155
154
  }
156
- if (typeof n == "object" && n !== null && typeof e == "object" && e !== null) {
157
- const t = Object.keys(n), r = Object.keys(e);
158
- if (t.length !== r.length) return !1;
159
- for (const s of t) if (!C(n[s], e[s])) return !1;
155
+ if (typeof r == "object" && r !== null && typeof e == "object" && e !== null) {
156
+ const t = Object.keys(r), n = Object.keys(e);
157
+ if (t.length !== n.length) return !1;
158
+ for (const s of t) if (!C(r[s], e[s])) return !1;
160
159
  return !0;
161
160
  }
162
161
  return !1;
163
162
  }
164
- function F(n, e) {
165
- return n.$.pipe(k(e), S(C), A(1));
163
+ function F(r, e) {
164
+ return r.$.pipe(k(e), S(C), A(1));
166
165
  }
167
- function d(n, e) {
168
- return n.$.pipe(k(e), S(C), A(1));
166
+ function d(r, e) {
167
+ return r.$.pipe(k(e), S(C), A(1));
169
168
  }
170
- function X(n) {
171
- return d(n, (e) => Array.from(e.values()));
169
+ function X(r) {
170
+ return d(r, (e) => Array.from(e.values()));
172
171
  }
173
- function Y(n, e) {
174
- return d(n, (t) => {
175
- const r = [];
172
+ function Y(r, e) {
173
+ return d(r, (t) => {
174
+ const n = [];
176
175
  return t.forEach((s, i) => {
177
- e(s, i) && r.push(s);
178
- }), r;
176
+ e(s, i) && n.push(s);
177
+ }), n;
179
178
  });
180
179
  }
181
- function Z(n, e) {
182
- return d(n, (t) => t.get(e));
180
+ function Z(r, e) {
181
+ return d(r, (t) => t.get(e));
183
182
  }
184
- function ee(n, e) {
185
- return d(n, (t) => {
183
+ function ee(r, e) {
184
+ return d(r, (t) => {
186
185
  if (!e) return t.size;
187
- let r = 0;
186
+ let n = 0;
188
187
  return t.forEach((s, i) => {
189
- e(s, i) && r++;
190
- }), r;
188
+ e(s, i) && n++;
189
+ }), n;
191
190
  });
192
191
  }
193
- function te(n, e) {
194
- return O(n).pipe(k((t) => e(...t)), S(C), A(1));
192
+ function te(r, e) {
193
+ return O(r).pipe(k((t) => e(...t)), S(C), A(1));
195
194
  }
196
- function ne(n) {
197
- return d(n, (e) => Array.from(e.keys()));
195
+ function re(r) {
196
+ return d(r, (e) => Array.from(e.keys()));
198
197
  }
199
- function re(n) {
200
- return d(n, (e) => Array.from(e.entries()));
198
+ function ne(r) {
199
+ return d(r, (e) => Array.from(e.entries()));
201
200
  }
202
- function se(n, e) {
203
- return d(n, (t) => {
204
- const r = [];
201
+ function se(r, e) {
202
+ return d(r, (t) => {
203
+ const n = [];
205
204
  return t.forEach((s, i) => {
206
- r.push(e(s, i));
207
- }), r;
205
+ n.push(e(s, i));
206
+ }), n;
208
207
  });
209
208
  }
210
- function oe(n, e) {
211
- return d(n, (t) => Array.from(t.values()).sort(e));
209
+ function oe(r, e) {
210
+ return d(r, (t) => Array.from(t.values()).sort(e));
212
211
  }
213
- function ie(n, e) {
214
- return d(n, (t) => {
215
- for (const [r, s] of t.entries()) if (e(s, r)) return s;
212
+ function ie(r, e) {
213
+ return d(r, (t) => {
214
+ for (const [n, s] of t.entries()) if (e(s, n)) return s;
216
215
  });
217
216
  }
218
- function G(n, e = (r) => r, t = {}) {
219
- return function(r, s, i) {
220
- x({ attribute: !1, type: Object })(r, s);
221
- const l = r.connectedCallback, f = r.disconnectedCallback;
222
- r.connectedCallback = function() {
217
+ function G(r, e = (n) => n, t = {}) {
218
+ return function(n, s, i) {
219
+ x({ attribute: !1, type: Object })(n, s);
220
+ const l = n.connectedCallback, f = n.disconnectedCallback;
221
+ n.connectedCallback = function() {
223
222
  var c;
224
223
  this._selectorCleanup && !this._selectorCleanup.closed || (this._selectorCleanup = new E()), this._selectorSubscriptions || (this._selectorSubscriptions = /* @__PURE__ */ new Map()), this._selectorInitialized || (this._selectorInitialized = /* @__PURE__ */ new Set());
225
224
  const p = function(a) {
226
225
  return "set" in a && typeof a.set == "function" && a.value instanceof Map;
227
- }(n) ? d(n, e) : F(n, e);
226
+ }(r) ? d(r, e) : F(r, e);
228
227
  t.required || this._selectorInitialized.has(s) || (l == null || l.call(this), this._selectorInitialized.add(s)), this._selectorSubscriptions.has(s) && ((c = this._selectorSubscriptions.get(s)) == null || c.unsubscribe());
229
228
  const b = p.pipe(q(this._selectorCleanup)).subscribe({ next: (a) => {
230
229
  var o;
@@ -233,17 +232,17 @@ function G(n, e = (r) => r, t = {}) {
233
232
  }, error: (a) => {
234
233
  } });
235
234
  this._selectorSubscriptions.set(s, b);
236
- }, r.disconnectedCallback = function() {
235
+ }, n.disconnectedCallback = function() {
237
236
  f == null || f.call(this), this._selectorCleanup && (this._selectorCleanup.next(), this._selectorCleanup.complete()), this._selectorSubscriptions && (this._selectorSubscriptions.forEach((p) => p.unsubscribe()), this._selectorSubscriptions.clear());
238
237
  };
239
238
  };
240
239
  }
241
- function ae(n, e, t = {}) {
242
- return function(r, s, i) {
243
- G(n, (l) => {
240
+ function ae(r, e, t = {}) {
241
+ return function(n, s, i) {
242
+ G(r, (l) => {
244
243
  const f = e(this);
245
244
  return f ? l.get(f) : void 0;
246
- }, t)(r, s);
245
+ }, t)(n, s);
247
246
  };
248
247
  }
249
248
  export {
@@ -264,11 +263,11 @@ export {
264
263
  Z as o,
265
264
  ee as p,
266
265
  te as q,
267
- ne as r,
266
+ re as r,
268
267
  G as s,
269
- re as t,
268
+ ne as t,
270
269
  se as u,
271
270
  oe as v,
272
271
  ie as w
273
272
  };
274
- //# sourceMappingURL=selector-hook-9dSW11-1.js.map
273
+ //# sourceMappingURL=selector-hook-C6VCezv7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector-hook-C6VCezv7.js","sources":["../src/store/context-create.ts","../src/store/filter-directive.ts","../src/store/selectors.ts","../src/store/selector-hook.ts"],"sourcesContent":["// src/store/context-create.ts\nimport SchmancyCollectionStore from './context-collection'\nimport { SchmancyStoreObject } from './context-object'\nimport { ICollectionStore, IStore, StorageType, StoreError } from './types'\n\n/**\n * Type guard to check if an object is empty\n */\nfunction isEmptyObject(obj: unknown): boolean {\n\tif (typeof obj !== 'object' || obj === null) {\n\t\treturn false\n\t}\n\treturn Object.keys(obj).length === 0\n}\n\n/**\n * Type guard to check if object is an iterable collection\n */\n// function isCollection(obj: unknown): obj is Iterable<unknown> {\n// \t// Must be non-null and of type 'object'\n// \tif (obj == null || typeof obj !== 'object') {\n// \t\treturn false\n// \t}\n\n// \t// Exclude plain objects\n// \tconst proto = Object.getPrototypeOf(obj)\n// \tif (proto === Object.prototype || proto === null) {\n// \t\treturn false\n// \t}\n\n// \t// Check for Symbol.iterator method\n// \treturn typeof obj[Symbol.iterator] === 'function'\n// }\n\n/**\n * Type guard for Map objects\n */\nfunction isMap<K, V>(value: unknown): value is Map<K, V> {\n\treturn value instanceof Map\n}\n\n/**\n * Creates a regular object store\n */\nfunction createObjectStore<T extends Record<string, any>>(\n\tinitialData: T,\n\tstorage: StorageType,\n\tkey: string,\n): IStore<T> & SchmancyStoreObject<T> {\n\t// Validate storage type\n\tif (storage === 'indexeddb') {\n\t\tthrow new StoreError('IndexedDB storage is not supported for plain objects', null, { storage, key })\n\t}\n\n\t// Create the store instance\n\tconst store = SchmancyStoreObject.getInstance<T>(storage, key, initialData)\n\n\t// Initialize with provided data if store is empty\n\tif (isEmptyObject(store.value)) {\n\t\tstore.$.next(initialData)\n\t}\n\n\treturn store\n}\n\n/**\n * Creates a collection store\n */\nfunction createCollectionStore<V>(\n\tinitialData: Map<string, V>,\n\tstorage: StorageType,\n\tkey: string,\n): ICollectionStore<V> & SchmancyCollectionStore<V> {\n\t// Create the store instance\n\tconst store = SchmancyCollectionStore.getInstance(storage, key, initialData)\n\n\t// Initialize with provided data if store is empty\n\tif (!store.value.size) {\n\t\tstore.$.next(new Map(initialData))\n\t}\n\n\treturn store\n}\n\n/**\n * Creates a context for managing state with better type safety\n * Overload for object stores\n */\nexport function createContext<T extends Record<string, any>>(\n\tinitialData: T,\n\tstorage: StorageType,\n\tkey: string,\n): IStore<T> & SchmancyStoreObject<T>\n\n/**\n * Creates a context for managing state with better type safety\n * Overload for collection stores\n */\nexport function createContext<V>(\n\tinitialData: Map<string, V>,\n\tstorage: StorageType,\n\tkey: string,\n): ICollectionStore<V> & SchmancyCollectionStore<V>\n\n/**\n * Implementation of the createContext function\n */\nexport function createContext<T extends Record<string, any> | Map<string, any>>(\n\tinitialData: T | Map<string, any>,\n\tstorage: StorageType,\n\tkey: string,\n): (IStore<T> & SchmancyStoreObject<T>) | (ICollectionStore<any> & SchmancyCollectionStore<any>) {\n\t// Validate input\n\tif (initialData === null || initialData === undefined) {\n\t\tthrow new StoreError('Initial data cannot be null or undefined', null, { storage, key })\n\t}\n\n\t// Determine store type based on input data\n\tif (isMap(initialData)) {\n\t\treturn createCollectionStore(initialData as Map<string, any>, storage, key)\n\t} else if (typeof initialData === 'object') {\n\t\treturn createObjectStore(initialData, storage, key)\n\t} else {\n\t\tthrow new StoreError('Initial data must be an object or a Map', null, {\n\t\t\tstorage,\n\t\t\tkey,\n\t\t\tdataType: typeof initialData,\n\t\t})\n\t}\n}\n\n/**\n * Creates a context with type inference, simplifying common patterns\n */\nexport function createObjectContext<T extends Record<string, any>>(\n\tinitialData: T,\n\tkey: string,\n\tstorage: StorageType = 'local',\n): IStore<T> & SchmancyStoreObject<T> {\n\treturn createContext(initialData, storage, key)\n}\n\n/**\n * Creates a collection context with type inference\n */\nexport function createCollectionContext<V>(\n\tinitialData: Map<string, V> | V[],\n\tkey: string,\n\tstorage: StorageType = 'local',\n): ICollectionStore<V> & SchmancyCollectionStore<V> {\n\t// Convert array to Map if needed\n\tconst dataMap = Array.isArray(initialData)\n\t\t? new Map(initialData.map((item, index) => [String(index), item]))\n\t\t: initialData\n\n\treturn createContext<V>(dataMap, storage, key)\n}\n","// src/store/filter-directive.ts\n\n/** Supported comparison operators with TypeScript literal types */\nexport type ComparisonOperator =\n\t| '=='\n\t| '!='\n\t| '>'\n\t| '<'\n\t| '>='\n\t| '<='\n\t| 'includes'\n\t| 'notIncludes'\n\t| 'startsWith'\n\t| 'endsWith'\n\t| 'in'\n\t| 'notIn'\n\t| 'any' // fuzzy search operator\n\n/**\n * Type-safe condition tuple\n */\nexport type ConditionTuple = [field: string, op: ComparisonOperator, expected: unknown, strict?: boolean]\n\n/**\n * Type-safe condition object\n */\nexport interface ConditionObject {\n\tkey: string\n\toperator: ComparisonOperator\n\tvalue: unknown\n\tstrict?: boolean\n}\n\n/**\n * Unified query condition type\n */\nexport type QueryCondition = ConditionTuple | ConditionObject\n\n/**\n * Filter result with item and score\n */\nexport interface ScoredItem<T> {\n\titem: T\n\tscore: number\n}\n\n/**\n * Get a nested value from an object using a dot-separated path.\n * Checks explicitly for null/undefined so falsy values like 0 or false are preserved.\n */\nexport const getFieldValue = <T = any>(item: Record<string, any>, path: string): T => {\n\tif (!path) return item as unknown as T\n\n\tconst parts = path.split('.')\n\tlet value: any = item\n\n\tfor (const part of parts) {\n\t\tif (value == null) return undefined as unknown as T\n\t\tvalue = value[part]\n\t}\n\n\treturn value as T\n}\n\n/**\n * Compute the Levenshtein distance between two strings.\n */\nconst levenshtein = (a: string, b: string): number => {\n\tif (a === b) return 0\n\n\tconst matrix: number[][] = Array(b.length + 1)\n\t\t.fill(null)\n\t\t.map((_, i) => [i])\n\n\t// initialize the first row\n\tfor (let j = 0; j <= a.length; j++) {\n\t\tmatrix[0][j] = j\n\t}\n\n\tfor (let i = 1; i <= b.length; i++) {\n\t\tfor (let j = 1; j <= a.length; j++) {\n\t\t\tif (b.charAt(i - 1) === a.charAt(j - 1)) {\n\t\t\t\tmatrix[i][j] = matrix[i - 1][j - 1]\n\t\t\t} else {\n\t\t\t\tmatrix[i][j] = Math.min(\n\t\t\t\t\tmatrix[i - 1][j] + 1, // deletion\n\t\t\t\t\tmatrix[i][j - 1] + 1, // insertion\n\t\t\t\t\tmatrix[i - 1][j - 1] + 1, // substitution\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn matrix[b.length][a.length]\n}\n\n/**\n * Check if string `sub` is a subsequence of string `str`.\n * All characters in `sub` must appear in order in `str` (they need not be contiguous).\n */\nconst isSubsequence = (sub: string, str: string): boolean => {\n\tif (!sub) return true\n\tif (!str) return false\n\n\tlet i = 0,\n\t\tj = 0\n\twhile (i < sub.length && j < str.length) {\n\t\tif (sub[i].toLowerCase() === str[j].toLowerCase()) i++\n\t\tj++\n\t}\n\treturn i === sub.length\n}\n\n/**\n * Check if every character (with frequency) in the query exists in the target.\n * For example, \"aovc\" matches \"avocados\".\n */\nconst anagramMatch = (query: string, target: string): boolean => {\n\tif (!query) return true\n\tif (!target) return false\n\n\tconst countChars = (s: string): Record<string, number> =>\n\t\ts\n\t\t\t.toLowerCase()\n\t\t\t.split('')\n\t\t\t.reduce(\n\t\t\t\t(acc, char) => {\n\t\t\t\t\tacc[char] = (acc[char] || 0) + 1\n\t\t\t\t\treturn acc\n\t\t\t\t},\n\t\t\t\t{} as Record<string, number>,\n\t\t\t)\n\n\tconst queryCount = countChars(query)\n\tconst targetCount = countChars(target)\n\treturn Object.keys(queryCount).every(char => (targetCount[char] || 0) >= queryCount[char])\n}\n\n/**\n * Generate bigrams for a string.\n */\nconst getBigrams = (s: string): string[] => {\n\tif (!s || s.length < 2) return []\n\n\tconst bigrams: string[] = []\n\tfor (let i = 0; i < s.length - 1; i++) {\n\t\tbigrams.push(s.substring(i, i + 2).toLowerCase())\n\t}\n\treturn bigrams\n}\n\n/**\n * Compute Dice's coefficient for two strings based on bigrams.\n * Returns a value between 0 (no similarity) and 1 (perfect match).\n */\nconst diceCoefficient = (s1: string, s2: string): number => {\n\tif (!s1 || !s2 || s1.length < 2 || s2.length < 2) return 0\n\n\tconst bigrams1 = getBigrams(s1)\n\tconst bigrams2 = getBigrams(s2)\n\n\tif (bigrams1.length === 0 || bigrams2.length === 0) return 0\n\n\tlet intersection = 0\n\tconst used = new Array(bigrams2.length).fill(false)\n\n\tfor (const bigram of bigrams1) {\n\t\tfor (let i = 0; i < bigrams2.length; i++) {\n\t\t\tif (!used[i] && bigrams2[i] === bigram) {\n\t\t\t\tintersection++\n\t\t\t\tused[i] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (2 * intersection) / (bigrams1.length + bigrams2.length)\n}\n\n/**\n * Compute a fuzzy similarity score between two strings.\n * The score is computed by taking the maximum of several methods:\n * - Direct substring match (score 1)\n * - Subsequence check (score 0.8)\n * - Anagram subset match (score 0.7)\n * - Dice coefficient\n * - Normalized Levenshtein similarity\n */\nconst computeFuzzyScore = (actual: string, expected: string): number => {\n\tif (!actual || !expected) return 0\n\n\tconst a = actual.toLowerCase().trim()\n\tconst b = expected.toLowerCase().trim()\n\n\tif (a === b) return 1\n\n\tconst substringScore = a.includes(b) ? 1 : 0\n\tconst subsequenceScore = isSubsequence(b, a) ? 0.8 : 0\n\tconst anagramScore = anagramMatch(b, a) ? 0.7 : 0\n\tconst diceScore = diceCoefficient(a, b)\n\n\tconst maxLen = Math.max(a.length, b.length)\n\tconst levenshteinScore = maxLen ? 1 - levenshtein(a, b) / maxLen : 0\n\n\treturn Math.max(substringScore, subsequenceScore, anagramScore, diceScore, levenshteinScore)\n}\n\n/**\n * Safely coerce value to string if possible, or return empty string\n */\nconst safeString = (value: unknown): string => {\n\tif (value == null) return ''\n\treturn String(value)\n}\n\n/**\n * Type guard for arrays\n */\nconst isArray = (value: unknown): value is Array<unknown> => {\n\treturn Array.isArray(value)\n}\n\n/**\n * Compare two values based on a comparison operator.\n * For non-fuzzy operators, this returns a boolean.\n */\nexport function compareValues(op: ComparisonOperator, actual: unknown, expected: unknown): boolean {\n\t// Handle null/undefined cases\n\tif (actual == null && expected == null) return true\n\tif (actual == null || expected == null) {\n\t\t// For equality operators, null == null but null != non-null\n\t\tif (op === '==') return actual === expected\n\t\tif (op === '!=') return actual !== expected\n\t\t// Other operators should return false for null/undefined values\n\t\treturn false\n\t}\n\n\tswitch (op) {\n\t\tcase '==':\n\t\t\treturn actual === expected\n\t\tcase '!=':\n\t\t\treturn actual !== expected\n\t\tcase '>':\n\t\t\treturn (actual as number) > (expected as number)\n\t\tcase '<':\n\t\t\treturn (actual as number) < (expected as number)\n\t\tcase '>=':\n\t\t\treturn (actual as number) >= (expected as number)\n\t\tcase '<=':\n\t\t\treturn (actual as number) <= (expected as number)\n\t\tcase 'includes': {\n\t\t\tif (typeof actual === 'string') {\n\t\t\t\treturn safeString(actual).toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t} else if (isArray(actual)) {\n\t\t\t\treturn actual.includes(expected)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIncludes': {\n\t\t\tif (typeof actual === 'string') {\n\t\t\t\treturn !safeString(actual).toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t} else if (isArray(actual)) {\n\t\t\t\treturn !actual.includes(expected)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tcase 'startsWith': {\n\t\t\tif (typeof actual === 'string' && typeof expected === 'string') {\n\t\t\t\treturn actual.toLowerCase().startsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'endsWith': {\n\t\t\tif (typeof actual === 'string' && typeof expected === 'string') {\n\t\t\t\treturn actual.toLowerCase().endsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'in': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn expected.includes(actual)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIn': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn !expected.includes(actual)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tdefault: {\n\t\t\tconsole.warn(`Operator \"${op}\" is not supported in strict comparison.`)\n\t\t\treturn false\n\t\t}\n\t}\n}\n\n/**\n * Apply a query condition to an item and return score\n */\nfunction applyQueryCondition<T extends Record<string, any>>(\n\titem: T,\n\tquery: QueryCondition,\n\tfuzzyThreshold: number = 0.3,\n): { valid: boolean; score: number } {\n\tlet field: string,\n\t\top: ComparisonOperator,\n\t\texpected: unknown,\n\t\tstrict = false\n\n\tif (Array.isArray(query)) {\n\t\t;[field, op, expected, strict = false] = query\n\t} else {\n\t\tfield = query.key\n\t\top = query.operator\n\t\texpected = query.value\n\t\tstrict = query.strict || false\n\t}\n\n\t// Skip empty filters for non-strict queries\n\tif (!strict && (expected === '' || expected == null || (isArray(expected) && expected.length === 0))) {\n\t\treturn { valid: true, score: 1 }\n\t}\n\n\tconst actual = getFieldValue(item, field)\n\n\t// REMOVE THIS BLOCK - This is the problematic code\n\t// If strict mode is enabled, enforce exact equality\n\t// if (strict) {\n\t// \tif (actual !== expected) {\n\t// \t\treturn { valid: false, score: 0 }\n\t// \t}\n\t// \treturn { valid: true, score: 1 }\n\t// }\n\n\tif (op === 'any') {\n\t\t// Fuzzy search requires both values to be strings\n\t\tif (typeof actual !== 'string' || typeof expected !== 'string') {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\tconst score = computeFuzzyScore(actual, expected)\n\t\tif (score < fuzzyThreshold) {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\treturn { valid: true, score }\n\t} else {\n\t\t// For non-fuzzy operators, check condition\n\t\tconst matches = compareValues(op, actual, expected)\n\t\treturn {\n\t\t\tvalid: matches,\n\t\t\tscore: matches ? 1 : 0,\n\t\t}\n\t}\n}\n\n/**\n * Filter a Map of items given an array of query conditions.\n * For each query condition:\n * - If the expected value is empty/null/undefined, it is treated as a match.\n * - For non-fuzzy operators, the condition must strictly match.\n * - For the \"any\" operator, a fuzzy similarity score is computed.\n * Items with a fuzzy score below a given threshold (e.g., 0.3) are excluded.\n *\n * The overall item score is the average of the scores from all conditions.\n * The results are sorted in descending order of relevance.\n *\n * @param items - A Map containing items to filter.\n * @param queries - An array of query conditions to apply.\n * @param fuzzyThreshold - Minimum score required for fuzzy matches (default: 0.3)\n * @returns An array of items that match all query conditions, sorted by relevance.\n */\nexport function filterMapItems<T extends Record<string, any>>(\n\titems: Map<string, T>,\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// If no queries, return all items unsorted\n\tif (!queries.length) {\n\t\treturn Array.from(items.values())\n\t}\n\n\t// Score and filter each item\n\tconst scoredItems: ScoredItem<T>[] = []\n\n\tfor (const [_, item] of items.entries()) {\n\t\tlet totalScore = 0\n\t\tlet matchCount = 0\n\t\tlet valid = true\n\n\t\tfor (const query of queries) {\n\t\t\tconst result = applyQueryCondition(item, query, fuzzyThreshold)\n\n\t\t\tif (!result.valid) {\n\t\t\t\tvalid = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\ttotalScore += result.score\n\t\t\tmatchCount++\n\t\t}\n\n\t\tif (valid) {\n\t\t\tscoredItems.push({\n\t\t\t\titem,\n\t\t\t\tscore: matchCount > 0 ? totalScore / matchCount : 1,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Sort by descending score\n\tscoredItems.sort((a, b) => b.score - a.score)\n\n\treturn scoredItems.map(x => x.item)\n}\n\n/**\n * Filter an array of items using query conditions\n */\nexport function filterArrayItems<T extends Record<string, any>>(\n\titems: T[],\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// Create temporary map with numeric indices as keys\n\tconst map = new Map<string, T>()\n\titems.forEach((item, index) => map.set(String(index), item))\n\n\treturn filterMapItems(map, queries, fuzzyThreshold)\n}\n\n// Export a simpler alias for filterMapItems\nexport const filterMap = filterMapItems\n\n// Export an alias for filterArrayItems\nexport const filterArray = filterArrayItems\n","// src/store/selectors.ts\nimport { Observable, combineLatest, distinctUntilChanged, map, shareReplay } from 'rxjs'\nimport { IStore, ICollectionStore } from './types'\n\n/**\n * Deep equality comparison for maps and complex objects\n * More efficient than JSON.stringify for large objects\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n\tif (a === b) return true\n\n\tif (a instanceof Map && b instanceof Map) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const [key, value] of a) {\n\t\t\tif (!b.has(key) || !deepEqual(value, b.get(key))) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (a instanceof Set && b instanceof Set) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const item of a) {\n\t\t\tif (!b.has(item)) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {\n\t\tconst keysA = Object.keys(a)\n\t\tconst keysB = Object.keys(b)\n\n\t\tif (keysA.length !== keysB.length) return false\n\n\t\tfor (const key of keysA) {\n\t\t\t// @ts-ignore: Index signature\n\t\t\tif (!deepEqual(a[key], b[key])) return false\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Creates a selector that derives a value from store state\n *\n * @param store The store to observe\n * @param selectorFn Function that transforms the state\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createSelector<T, R>(store: IStore<T>, selectorFn: (state: T) => R): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector for collection stores that derives a value from the collection\n *\n * @param store The collection store to observe\n * @param selectorFn Function that transforms the collection\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createCollectionSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tselectorFn: (state: Map<string, T>) => R,\n): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector that returns all items from a collection as an array\n *\n * @param store The collection store\n * @returns An observable of all items as an array\n */\nexport function createItemsSelector<T>(store: ICollectionStore<T>): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.values()))\n}\n\n/**\n * Creates a selector that filters items from a collection\n *\n * @param store The collection store\n * @param filterFn Function that returns true for items to include\n * @returns An observable of filtered items as an array\n */\nexport function createFilterSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn: (item: T, key: string) => boolean,\n): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\tconst result: T[] = []\n\t\tcollection.forEach((item, key) => {\n\t\t\tif (filterFn(item, key)) {\n\t\t\t\tresult.push(item)\n\t\t\t}\n\t\t})\n\t\treturn result\n\t})\n}\n\n/**\n * Creates a selector that retrieves a single item from a collection\n *\n * @param store The collection store\n * @param itemKey The key of the item to select\n * @returns An observable of the selected item that emits when the item changes\n */\nexport function createItemSelector<T>(store: ICollectionStore<T>, itemKey: string): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => collection.get(itemKey))\n}\n\n/**\n * Creates a selector that counts items in a collection, optionally filtered\n *\n * @param store The collection store\n * @param filterFn Optional function to filter which items to count\n * @returns An observable of the count\n */\nexport function createCountSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn?: (item: T, key: string) => boolean,\n): Observable<number> {\n\treturn createCollectionSelector(store, collection => {\n\t\tif (!filterFn) return collection.size\n\n\t\tlet count = 0\n\t\tcollection.forEach((item, key) => {\n\t\t\tif (filterFn(item, key)) count++\n\t\t})\n\t\treturn count\n\t})\n}\n\n/**\n * Creates a compound selector that depends on multiple other selectors\n *\n * @param selectors Array of source selectors\n * @param combinerFn Function that combines all selector results\n * @returns An observable of the combined result\n */\nexport function createCompoundSelector<T extends unknown[], R>(\n\tselectors: { [K in keyof T]: Observable<T[K]> },\n\tcombinerFn: (...values: T) => R,\n): Observable<R> {\n\treturn combineLatest(selectors).pipe(\n\t\tmap(values => combinerFn(...(values as T))),\n\t\tdistinctUntilChanged<R>(deepEqual),\n\t\tshareReplay(1),\n\t)\n}\n\n/**\n * Creates a selector that returns all keys from a collection\n */\nexport function createKeysSelector<T>(store: ICollectionStore<T>): Observable<string[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.keys()))\n}\n\n/**\n * Creates a selector that returns entries (key-value pairs) from a collection\n */\nexport function createEntriesSelector<T>(store: ICollectionStore<T>): Observable<[string, T][]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.entries()))\n}\n\n/**\n * Creates a selector that maps collection values through a transform function\n */\nexport function createMapSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tmapFn: (item: T, key: string) => R,\n): Observable<R[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\tconst result: R[] = []\n\t\tcollection.forEach((item, key) => {\n\t\t\tresult.push(mapFn(item, key))\n\t\t})\n\t\treturn result\n\t})\n}\n\n/**\n * Creates a selector that sorts collection items\n */\nexport function createSortSelector<T>(store: ICollectionStore<T>, compareFn: (a: T, b: T) => number): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\treturn Array.from(collection.values()).sort(compareFn)\n\t})\n}\n\n/**\n * Creates a selector that finds the first item matching a predicate\n */\nexport function createFindSelector<T>(\n\tstore: ICollectionStore<T>,\n\tpredicate: (item: T, key: string) => boolean,\n): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => {\n\t\tfor (const [key, item] of collection.entries()) {\n\t\t\tif (predicate(item, key)) {\n\t\t\t\treturn item\n\t\t\t}\n\t\t}\n\t\treturn undefined\n\t})\n}\n","// src/store/selector-hook.ts\nimport { property as litProperty } from 'lit/decorators.js'\nimport { Observable, Subject, Subscription } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { createCollectionSelector, createSelector } from './selectors'\nimport { ICollectionStore, IStore } from './types'\n\n/**\n * Component lifecycle interface\n */\ninterface ComponentWithLifecycle {\n\t// Lifecycle hooks\n\tisConnected: boolean\n\tdisconnectedCallback?: () => void\n\tconnectedCallback?: () => void\n\trequestUpdate?: () => void\n\n\t// Internal properties\n\t_selectorCleanup?: Subject<void>\n\t_selectorSubscriptions?: Map<string, Subscription>\n\t_selectorInitialized?: Set<string>\n\n\t// Value storage\n\t[key: string]: any\n}\n\n/**\n * Property descriptor interface\n */\ntype PropertyDescriptor<T> = {\n\tget?: () => T\n\tset?: (value: T) => void\n\tvalue?: T\n\tconfigurable?: boolean\n\tenumerable?: boolean\n\twritable?: boolean\n}\n\n/**\n * Options for selecting from a store\n */\ninterface SelectOptions {\n\t/** If true, will wait for selector to emit a non-null value before calling connectedCallback */\n\trequired?: boolean\n\n\t/** If true, will only update the component and not set the property value */\n\tupdateOnly?: boolean\n\n\t/** If true, will use structuredClone to deeply clone values (prevents mutations) */\n\tdeepClone?: boolean\n\n\t/** Custom equality function to determine when to update */\n\tequals?: (a: any, b: any) => boolean\n}\n\n/**\n * Type guard to check if a store is a collection store\n */\nfunction isCollectionStore<T>(store: IStore<any> | ICollectionStore<T>): store is ICollectionStore<T> {\n\treturn 'set' in store && typeof store.set === 'function' && store.value instanceof Map\n}\n\n/**\n * Selector decorator that connects a component property to a store selector\n *\n * @param store The store to select from\n * @param selectorFn Optional function to transform the store state\n * @param options Additional options for the selector\n */\nexport function select<T, R>(\n\tstore: IStore<T> | ICollectionStore<T>,\n\tselectorFn: (state: any) => R = (state: R) => state,\n\toptions: SelectOptions = {},\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<R>) {\n\t\t// Register as a Lit property\n\t\tlitProperty({ attribute: false, type: Object })(proto, propName)\n\n\t\t// Store original lifecycle methods\n\t\tconst originalConnectedCallback = proto.connectedCallback\n\t\tconst originalDisconnectedCallback = proto.disconnectedCallback\n\n\t\t// Override connectedCallback to set up subscription\n\t\tproto.connectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Initialize tracking properties if needed\n\t\t\tif (!this._selectorCleanup || this._selectorCleanup.closed) {\n\t\t\t\tthis._selectorCleanup = new Subject<void>()\n\t\t\t}\n\n\t\t\tif (!this._selectorSubscriptions) {\n\t\t\t\tthis._selectorSubscriptions = new Map()\n\t\t\t}\n\n\t\t\tif (!this._selectorInitialized) {\n\t\t\t\tthis._selectorInitialized = new Set()\n\t\t\t}\n\n\t\t\t// Create the appropriate selector\n\t\t\tconst selector: Observable<R> = isCollectionStore(store)\n\t\t\t\t? createCollectionSelector(store, selectorFn)\n\t\t\t\t: createSelector(store as IStore<T>, selectorFn)\n\n\t\t\t// Call original connectedCallback immediately if not waiting for data\n\t\t\tif (!options.required && !this._selectorInitialized.has(propName)) {\n\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\tthis._selectorInitialized.add(propName)\n\t\t\t}\n\n\t\t\t// Clean up any existing subscription\n\t\t\tif (this._selectorSubscriptions.has(propName)) {\n\t\t\t\tthis._selectorSubscriptions.get(propName)?.unsubscribe()\n\t\t\t}\n\n\t\t\t// Create new subscription\n\t\t\tconst subscription = selector.pipe(takeUntil(this._selectorCleanup)).subscribe({\n\t\t\t\tnext: (value: R) => {\n\t\t\t\t\t// Handle value updates\n\t\t\t\t\tconst newValue = options.deepClone ? structuredClone(value) : value\n\n\t\t\t\t\tif (!options.updateOnly) {\n\t\t\t\t\t\tthis[propName] = newValue\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.requestUpdate?.()\n\n\t\t\t\t\t// If required and not initialized, call connectedCallback when we get a value\n\t\t\t\t\tif (\n\t\t\t\t\t\toptions.required &&\n\t\t\t\t\t\t!this._selectorInitialized.has(propName) &&\n\t\t\t\t\t\tnewValue !== null &&\n\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\t\t\tthis._selectorInitialized.add(propName)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: (err: Error) => {\n\t\t\t\t\tconsole.error(`Error in selector subscription for ${propName}:`, err)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\t// Store the subscription for cleanup\n\t\t\tthis._selectorSubscriptions.set(propName, subscription)\n\t\t}\n\n\t\t// Override disconnectedCallback to clean up subscriptions\n\t\tproto.disconnectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Call original disconnectedCallback\n\t\t\toriginalDisconnectedCallback?.call(this)\n\n\t\t\t// Clean up subscriptions\n\t\t\tif (this._selectorCleanup) {\n\t\t\t\tthis._selectorCleanup.next()\n\t\t\t\tthis._selectorCleanup.complete()\n\t\t\t}\n\n\t\t\tif (this._selectorSubscriptions) {\n\t\t\t\tthis._selectorSubscriptions.forEach(sub => sub.unsubscribe())\n\t\t\t\tthis._selectorSubscriptions.clear()\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Creates a selector decorator that selects a specific item from a collection store\n *\n * @param store The collection store\n * @param keyGetter Function that returns the key to select\n * @param options Additional options\n */\nexport function selectItem<T>(\n\tstore: ICollectionStore<T>,\n\tkeyGetter: (component: any) => string,\n\toptions: SelectOptions = {},\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<T | undefined>) {\n\t\tselect(\n\t\t\tstore,\n\t\t\tstate => {\n\t\t\t\t// This will be evaluated during subscription, when 'this' is available\n\t\t\t\tconst itemKey = keyGetter(this)\n\t\t\t\treturn itemKey ? state.get(itemKey) : undefined\n\t\t\t},\n\t\t\toptions,\n\t\t)(proto, propName)\n\t}\n}\n"],"names":["createObjectStore","initialData","storage","key","StoreError","store","SchmancyStoreObject","getInstance","obj","value","Object","keys","length","$","next","createContext","o","Map","SchmancyCollectionStore","size","dataType","createObjectContext","createCollectionContext","Array","isArray","map","item","index","String","getFieldValue","path","parts","split","part","getBigrams","s","bigrams","i","push","substring","toLowerCase","computeFuzzyScore","actual","expected","a","trim","b","substringScore","includes","subsequenceScore","sub","str","j","anagramScore","query","target","countChars","reduce","acc","char","queryCount","targetCount","every","diceScore","s1","s2","bigrams1","bigrams2","intersection","used","fill","bigram","maxLen","Math","max","levenshteinScore","matrix","_","charAt","min","safeString","compareValues","op","startsWith","endsWith","applyQueryCondition","fuzzyThreshold","field","strict","operator","valid","score","t","matches","filterMapItems","items","queries","from","values","scoredItems","entries","totalScore","matchCount","result","sort","x","filterArrayItems","forEach","set","filterMap","filterArray","deepEqual","has","get","Set","keysA","keysB","createSelector","selectorFn","pipe","distinctUntilChanged","shareReplay","createCollectionSelector","createItemsSelector","collection","createFilterSelector","filterFn","createItemSelector","itemKey","createCountSelector","count","createCompoundSelector","selectors","combinerFn","combineLatest","createKeysSelector","createEntriesSelector","createMapSelector","mapFn","createSortSelector","compareFn","createFindSelector","predicate","select","state","options","proto","propName","_descriptor","litProperty","attribute","type","originalConnectedCallback","connectedCallback","originalDisconnectedCallback","disconnectedCallback","this","_selectorCleanup","closed","Subject","_selectorSubscriptions","_selectorInitialized","selector","required","call","add","unsubscribe","subscription","takeUntil","subscribe","newValue","deepClone","structuredClone","updateOnly","requestUpdate","error","err","complete","clear","selectItem","keyGetter"],"mappings":";;;;AA4CA,SAASA,EACRC,GACAC,GACAC,GAAAA;AAGA,MAAID,MAAY,YACf,OAAM,IAAIE,EAAW,wDAAwD,MAAM,EAAEF,SAASC,GAAAA,KAAAA,EAAAA,CAAAA;AAI/F,QAAME,IAAQC,EAAoBC,YAAeL,GAASC,GAAKF;AA/ChE,MAAuBO;AAsDf,SAtDeA,QAAAA,IAkDJH,EAAMI,UAjDL,YAAYD,MAAQ,QAGhCE,OAAOC,KAAKH,CAAAA,EAAKI,WAAW,KA+C5BP,EAAAQ,EAAEC,KAAKb,CAGPI,GAAAA;A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KiD,EAAUZ,KAAKC,gBAAmBY,CAAAA,EAAAA,UAAU,EAC9E3J,MAAOL,CAAAA,MAAAA;;AAEN,cAAMiK,IAAWzB,EAAQ0B,YAAYC,gBAAgBnK,CAAAA,IAASA;AAEzDwI,QAAAA,EAAQ4B,eACZjB,KAAKT,CAAAA,IAAYuB,KAGlBd,IAAAA,KAAKkB,kBAALlB,QAAAA,EAAAA,YAICX,EAAQkB,YACPP,CAAAA,KAAKK,qBAAqBjD,IAAImC,CAAAA,KAC/BuB,KAFAzB,SAKAO,KAAAA,QAAAA,EAA2BY,KAAKR,OAC3BA,KAAAK,qBAAqBI,IAAIlB,CAAAA;AAAAA,MAAQ,GAGxC4B,OAAQC,CAAAA;MAC6D,EAKjEpB,CAAAA;AAAAA,WAAAI,uBAAuBpD,IAAIuC,GAAUoB;IAC3C,GAGArB,EAAMS,uBAAuB,WAE5BD;AAAAA,MAAAA,KAAAA,QAAAA,EAA8BU,KAAKR,OAG/BA,KAAKC,qBACRD,KAAKC,iBAAiB/I,QACtB8I,KAAKC,iBAAiBoB,SAGnBrB,IAAAA,KAAKI,2BACRJ,KAAKI,uBAAuBrD,QAAezD,CAAAA,MAAAA,EAAIoH,gBAC/CV,KAAKI,uBAAuBkB;IAE9B;AAAA,EACD;AACD;AASO,SAASC,GACf9K,GACA+K,GACAnC,IAAyB,CAAA,GAElB;AAAA,SAAA,SAAUC,GAA4BC,GAAkBC,GAC9DL;AAAAA,MACC1I,GACS2I,CAAAA,MAEF;AAAA,YAAAhB,IAAUoD,EAAUxB,IAAAA;AAC1B,aAAO5B,IAAUgB,EAAM/B,IAAIe,CAAW,IAAA;AAAA,IAAA,GAEvCiB,CAPDF,EAQEG,GAAOC,CACV;AAAA,EAAA;AACD;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const w=require("./context-object-BIywslrO.cjs"),E=require("lit/decorators.js"),g=require("rxjs"),O=require("rxjs/operators");function q(n,e,t){if(e==="indexeddb")throw new w.StoreError("IndexedDB storage is not supported for plain objects",null,{storage:e,key:t});const r=w.SchmancyStoreObject.getInstance(e,t,n);var o;return typeof(o=r.value)=="object"&&o!==null&&Object.keys(o).length===0&&r.$.next(n),r}function A(n,e,t){if(n==null)throw new w.StoreError("Initial data cannot be null or undefined",null,{storage:e,key:t});if(n instanceof Map)return function(r,o,i){const a=w.SchmancyCollectionStore.getInstance(o,i,r);return a.value.size||a.$.next(new Map(r)),a}(n,e,t);if(typeof n=="object")return q(n,e,t);throw new w.StoreError("Initial data must be an object or a Map",null,{storage:e,key:t,dataType:typeof n})}const L=(n,e)=>{if(!e)return n;const t=e.split(".");let r=n;for(const o of t){if(r==null)return;r=r[o]}return r},v=n=>{if(!n||n.length<2)return[];const e=[];for(let t=0;t<n.length-1;t++)e.push(n.substring(t,t+2).toLowerCase());return e},U=(n,e)=>{if(!n||!e)return 0;const t=n.toLowerCase().trim(),r=e.toLowerCase().trim();if(t===r)return 1;const o=t.includes(r)?1:0,i=((l,c)=>{if(!l)return!0;if(!c)return!1;let u=0,s=0;for(;u<l.length&&s<c.length;)l[u].toLowerCase()===c[s].toLowerCase()&&u++,s++;return u===l.length})(r,t)?.8:0,a=((l,c)=>{if(!l)return!0;if(!c)return!1;const u=b=>b.toLowerCase().split("").reduce((S,y)=>(S[y]=(S[y]||0)+1,S),{}),s=u(l),h=u(c);return Object.keys(s).every(b=>(h[b]||0)>=s[b])})(r,t)?.7:0,f=((l,c)=>{if(!l||!c||l.length<2||c.length<2)return 0;const u=v(l),s=v(c);if(u.length===0||s.length===0)return 0;let h=0;const b=new Array(s.length).fill(!1);for(const S of u)for(let y=0;y<s.length;y++)if(!b[y]&&s[y]===S){h++,b[y]=!0;break}return 2*h/(u.length+s.length)})(t,r),p=Math.max(t.length,r.length),C=p?1-((l,c)=>{if(l===c)return 0;const u=Array(c.length+1).fill(null).map((s,h)=>[h]);for(let s=0;s<=l.length;s++)u[0][s]=s;for(let s=1;s<=c.length;s++)for(let h=1;h<=l.length;h++)c.charAt(s-1)===l.charAt(h-1)?u[s][h]=u[s-1][h-1]:u[s][h]=Math.min(u[s-1][h]+1,u[s][h-1]+1,u[s-1][h-1]+1);return u[c.length][l.length]})(t,r)/p:0;return Math.max(o,i,a,f,C)},I=n=>n==null?"":String(n),m=n=>Array.isArray(n);function M(n,e,t){if(e==null&&t==null)return!0;if(e==null||t==null)return n==="=="?e===t:n==="!="&&e!==t;switch(n){case"==":return e===t;case"!=":return e!==t;case">":return e>t;case"<":return e<t;case">=":return e>=t;case"<=":return e<=t;case"includes":return typeof e=="string"?I(e).toLowerCase().includes(I(t).toLowerCase()):!!m(e)&&e.includes(t);case"notIncludes":return typeof e=="string"?!I(e).toLowerCase().includes(I(t).toLowerCase()):!m(e)||!e.includes(t);case"startsWith":return typeof e=="string"&&typeof t=="string"&&e.toLowerCase().startsWith(t.toLowerCase());case"endsWith":return typeof e=="string"&&typeof t=="string"&&e.toLowerCase().endsWith(t.toLowerCase());case"in":return!!m(t)&&t.includes(e);case"notIn":return!m(t)||!t.includes(e);default:return!1}}function W(n,e,t=.3){let r,o,i,a=!1;if(Array.isArray(e)?[r,o,i,a=!1]=e:(r=e.key,o=e.operator,i=e.value,a=e.strict||!1),!a&&(i===""||i==null||m(i)&&i.length===0))return{valid:!0,score:1};const f=L(n,r);if(o==="any"){if(typeof f!="string"||typeof i!="string")return{valid:!1,score:0};const p=U(f,i);return p<t?{valid:!1,score:0}:{valid:!0,score:p}}{const p=M(o,f,i);return{valid:p,score:p?1:0}}}function k(n,e=[],t=.3){if(!e.length)return Array.from(n.values());const r=[];for(const[o,i]of n.entries()){let a=0,f=0,p=!0;for(const C of e){const l=W(i,C,t);if(!l.valid){p=!1;break}a+=l.score,f++}p&&r.push({item:i,score:f>0?a/f:1})}return r.sort((o,i)=>i.score-o.score),r.map(o=>o.item)}function x(n,e=[],t=.3){const r=new Map;return n.forEach((o,i)=>r.set(String(i),o)),k(r,e,t)}const $=k,F=x;function _(n,e){if(n===e)return!0;if(n instanceof Map&&e instanceof Map){if(n.size!==e.size)return!1;for(const[t,r]of n)if(!e.has(t)||!_(r,e.get(t)))return!1;return!0}if(n instanceof Set&&e instanceof Set){if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0}if(typeof n=="object"&&n!==null&&typeof e=="object"&&e!==null){const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(const o of t)if(!_(n[o],e[o]))return!1;return!0}return!1}function z(n,e){return n.$.pipe(g.map(e),g.distinctUntilChanged(_),g.shareReplay(1))}function d(n,e){return n.$.pipe(g.map(e),g.distinctUntilChanged(_),g.shareReplay(1))}function j(n,e=r=>r,t={}){return function(r,o,i){E.property({attribute:!1,type:Object})(r,o);const a=r.connectedCallback,f=r.disconnectedCallback;r.connectedCallback=function(){var l;this._selectorCleanup&&!this._selectorCleanup.closed||(this._selectorCleanup=new g.Subject),this._selectorSubscriptions||(this._selectorSubscriptions=new Map),this._selectorInitialized||(this._selectorInitialized=new Set);const p=function(c){return"set"in c&&typeof c.set=="function"&&c.value instanceof Map}(n)?d(n,e):z(n,e);t.required||this._selectorInitialized.has(o)||(a==null||a.call(this),this._selectorInitialized.add(o)),this._selectorSubscriptions.has(o)&&((l=this._selectorSubscriptions.get(o))==null||l.unsubscribe());const C=p.pipe(O.takeUntil(this._selectorCleanup)).subscribe({next:c=>{var s;const u=t.deepClone?structuredClone(c):c;t.updateOnly||(this[o]=u),(s=this.requestUpdate)==null||s.call(this),t.required&&!this._selectorInitialized.has(o)&&u!=null&&(a==null||a.call(this),this._selectorInitialized.add(o))},error:c=>{}});this._selectorSubscriptions.set(o,C)},r.disconnectedCallback=function(){f==null||f.call(this),this._selectorCleanup&&(this._selectorCleanup.next(),this._selectorCleanup.complete()),this._selectorSubscriptions&&(this._selectorSubscriptions.forEach(p=>p.unsubscribe()),this._selectorSubscriptions.clear())}}}exports.compareValues=M,exports.createCollectionContext=function(n,e,t="local"){return A(Array.isArray(n)?new Map(n.map((r,o)=>[String(o),r])):n,t,e)},exports.createCollectionSelector=d,exports.createCompoundSelector=function(n,e){return g.combineLatest(n).pipe(g.map(t=>e(...t)),g.distinctUntilChanged(_),g.shareReplay(1))},exports.createContext=A,exports.createCountSelector=function(n,e){return d(n,t=>{if(!e)return t.size;let r=0;return t.forEach((o,i)=>{e(o,i)&&r++}),r})},exports.createEntriesSelector=function(n){return d(n,e=>Array.from(e.entries()))},exports.createFilterSelector=function(n,e){return d(n,t=>{const r=[];return t.forEach((o,i)=>{e(o,i)&&r.push(o)}),r})},exports.createFindSelector=function(n,e){return d(n,t=>{for(const[r,o]of t.entries())if(e(o,r))return o})},exports.createItemSelector=function(n,e){return d(n,t=>t.get(e))},exports.createItemsSelector=function(n){return d(n,e=>Array.from(e.values()))},exports.createKeysSelector=function(n){return d(n,e=>Array.from(e.keys()))},exports.createMapSelector=function(n,e){return d(n,t=>{const r=[];return t.forEach((o,i)=>{r.push(e(o,i))}),r})},exports.createObjectContext=function(n,e,t="local"){return A(n,t,e)},exports.createSelector=z,exports.createSortSelector=function(n,e){return d(n,t=>Array.from(t.values()).sort(e))},exports.filterArray=F,exports.filterArrayItems=x,exports.filterMap=$,exports.filterMapItems=k,exports.getFieldValue=L,exports.select=j,exports.selectItem=function(n,e,t={}){return function(r,o,i){j(n,a=>{const f=e(this);return f?a.get(f):void 0},t)(r,o)}};
2
+ //# sourceMappingURL=selector-hook-DDaYMsHs.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selector-hook-DDaYMsHs.cjs","sources":["../src/store/context-create.ts","../src/store/filter-directive.ts","../src/store/selectors.ts","../src/store/selector-hook.ts"],"sourcesContent":["// src/store/context-create.ts\nimport SchmancyCollectionStore from './context-collection'\nimport { SchmancyStoreObject } from './context-object'\nimport { ICollectionStore, IStore, StorageType, StoreError } from './types'\n\n/**\n * Type guard to check if an object is empty\n */\nfunction isEmptyObject(obj: unknown): boolean {\n\tif (typeof obj !== 'object' || obj === null) {\n\t\treturn false\n\t}\n\treturn Object.keys(obj).length === 0\n}\n\n/**\n * Type guard to check if object is an iterable collection\n */\n// function isCollection(obj: unknown): obj is Iterable<unknown> {\n// \t// Must be non-null and of type 'object'\n// \tif (obj == null || typeof obj !== 'object') {\n// \t\treturn false\n// \t}\n\n// \t// Exclude plain objects\n// \tconst proto = Object.getPrototypeOf(obj)\n// \tif (proto === Object.prototype || proto === null) {\n// \t\treturn false\n// \t}\n\n// \t// Check for Symbol.iterator method\n// \treturn typeof obj[Symbol.iterator] === 'function'\n// }\n\n/**\n * Type guard for Map objects\n */\nfunction isMap<K, V>(value: unknown): value is Map<K, V> {\n\treturn value instanceof Map\n}\n\n/**\n * Creates a regular object store\n */\nfunction createObjectStore<T extends Record<string, any>>(\n\tinitialData: T,\n\tstorage: StorageType,\n\tkey: string,\n): IStore<T> & SchmancyStoreObject<T> {\n\t// Validate storage type\n\tif (storage === 'indexeddb') {\n\t\tthrow new StoreError('IndexedDB storage is not supported for plain objects', null, { storage, key })\n\t}\n\n\t// Create the store instance\n\tconst store = SchmancyStoreObject.getInstance<T>(storage, key, initialData)\n\n\t// Initialize with provided data if store is empty\n\tif (isEmptyObject(store.value)) {\n\t\tstore.$.next(initialData)\n\t}\n\n\treturn store\n}\n\n/**\n * Creates a collection store\n */\nfunction createCollectionStore<V>(\n\tinitialData: Map<string, V>,\n\tstorage: StorageType,\n\tkey: string,\n): ICollectionStore<V> & SchmancyCollectionStore<V> {\n\t// Create the store instance\n\tconst store = SchmancyCollectionStore.getInstance(storage, key, initialData)\n\n\t// Initialize with provided data if store is empty\n\tif (!store.value.size) {\n\t\tstore.$.next(new Map(initialData))\n\t}\n\n\treturn store\n}\n\n/**\n * Creates a context for managing state with better type safety\n * Overload for object stores\n */\nexport function createContext<T extends Record<string, any>>(\n\tinitialData: T,\n\tstorage: StorageType,\n\tkey: string,\n): IStore<T> & SchmancyStoreObject<T>\n\n/**\n * Creates a context for managing state with better type safety\n * Overload for collection stores\n */\nexport function createContext<V>(\n\tinitialData: Map<string, V>,\n\tstorage: StorageType,\n\tkey: string,\n): ICollectionStore<V> & SchmancyCollectionStore<V>\n\n/**\n * Implementation of the createContext function\n */\nexport function createContext<T extends Record<string, any> | Map<string, any>>(\n\tinitialData: T | Map<string, any>,\n\tstorage: StorageType,\n\tkey: string,\n): (IStore<T> & SchmancyStoreObject<T>) | (ICollectionStore<any> & SchmancyCollectionStore<any>) {\n\t// Validate input\n\tif (initialData === null || initialData === undefined) {\n\t\tthrow new StoreError('Initial data cannot be null or undefined', null, { storage, key })\n\t}\n\n\t// Determine store type based on input data\n\tif (isMap(initialData)) {\n\t\treturn createCollectionStore(initialData as Map<string, any>, storage, key)\n\t} else if (typeof initialData === 'object') {\n\t\treturn createObjectStore(initialData, storage, key)\n\t} else {\n\t\tthrow new StoreError('Initial data must be an object or a Map', null, {\n\t\t\tstorage,\n\t\t\tkey,\n\t\t\tdataType: typeof initialData,\n\t\t})\n\t}\n}\n\n/**\n * Creates a context with type inference, simplifying common patterns\n */\nexport function createObjectContext<T extends Record<string, any>>(\n\tinitialData: T,\n\tkey: string,\n\tstorage: StorageType = 'local',\n): IStore<T> & SchmancyStoreObject<T> {\n\treturn createContext(initialData, storage, key)\n}\n\n/**\n * Creates a collection context with type inference\n */\nexport function createCollectionContext<V>(\n\tinitialData: Map<string, V> | V[],\n\tkey: string,\n\tstorage: StorageType = 'local',\n): ICollectionStore<V> & SchmancyCollectionStore<V> {\n\t// Convert array to Map if needed\n\tconst dataMap = Array.isArray(initialData)\n\t\t? new Map(initialData.map((item, index) => [String(index), item]))\n\t\t: initialData\n\n\treturn createContext<V>(dataMap, storage, key)\n}\n","// src/store/filter-directive.ts\n\n/** Supported comparison operators with TypeScript literal types */\nexport type ComparisonOperator =\n\t| '=='\n\t| '!='\n\t| '>'\n\t| '<'\n\t| '>='\n\t| '<='\n\t| 'includes'\n\t| 'notIncludes'\n\t| 'startsWith'\n\t| 'endsWith'\n\t| 'in'\n\t| 'notIn'\n\t| 'any' // fuzzy search operator\n\n/**\n * Type-safe condition tuple\n */\nexport type ConditionTuple = [field: string, op: ComparisonOperator, expected: unknown, strict?: boolean]\n\n/**\n * Type-safe condition object\n */\nexport interface ConditionObject {\n\tkey: string\n\toperator: ComparisonOperator\n\tvalue: unknown\n\tstrict?: boolean\n}\n\n/**\n * Unified query condition type\n */\nexport type QueryCondition = ConditionTuple | ConditionObject\n\n/**\n * Filter result with item and score\n */\nexport interface ScoredItem<T> {\n\titem: T\n\tscore: number\n}\n\n/**\n * Get a nested value from an object using a dot-separated path.\n * Checks explicitly for null/undefined so falsy values like 0 or false are preserved.\n */\nexport const getFieldValue = <T = any>(item: Record<string, any>, path: string): T => {\n\tif (!path) return item as unknown as T\n\n\tconst parts = path.split('.')\n\tlet value: any = item\n\n\tfor (const part of parts) {\n\t\tif (value == null) return undefined as unknown as T\n\t\tvalue = value[part]\n\t}\n\n\treturn value as T\n}\n\n/**\n * Compute the Levenshtein distance between two strings.\n */\nconst levenshtein = (a: string, b: string): number => {\n\tif (a === b) return 0\n\n\tconst matrix: number[][] = Array(b.length + 1)\n\t\t.fill(null)\n\t\t.map((_, i) => [i])\n\n\t// initialize the first row\n\tfor (let j = 0; j <= a.length; j++) {\n\t\tmatrix[0][j] = j\n\t}\n\n\tfor (let i = 1; i <= b.length; i++) {\n\t\tfor (let j = 1; j <= a.length; j++) {\n\t\t\tif (b.charAt(i - 1) === a.charAt(j - 1)) {\n\t\t\t\tmatrix[i][j] = matrix[i - 1][j - 1]\n\t\t\t} else {\n\t\t\t\tmatrix[i][j] = Math.min(\n\t\t\t\t\tmatrix[i - 1][j] + 1, // deletion\n\t\t\t\t\tmatrix[i][j - 1] + 1, // insertion\n\t\t\t\t\tmatrix[i - 1][j - 1] + 1, // substitution\n\t\t\t\t)\n\t\t\t}\n\t\t}\n\t}\n\treturn matrix[b.length][a.length]\n}\n\n/**\n * Check if string `sub` is a subsequence of string `str`.\n * All characters in `sub` must appear in order in `str` (they need not be contiguous).\n */\nconst isSubsequence = (sub: string, str: string): boolean => {\n\tif (!sub) return true\n\tif (!str) return false\n\n\tlet i = 0,\n\t\tj = 0\n\twhile (i < sub.length && j < str.length) {\n\t\tif (sub[i].toLowerCase() === str[j].toLowerCase()) i++\n\t\tj++\n\t}\n\treturn i === sub.length\n}\n\n/**\n * Check if every character (with frequency) in the query exists in the target.\n * For example, \"aovc\" matches \"avocados\".\n */\nconst anagramMatch = (query: string, target: string): boolean => {\n\tif (!query) return true\n\tif (!target) return false\n\n\tconst countChars = (s: string): Record<string, number> =>\n\t\ts\n\t\t\t.toLowerCase()\n\t\t\t.split('')\n\t\t\t.reduce(\n\t\t\t\t(acc, char) => {\n\t\t\t\t\tacc[char] = (acc[char] || 0) + 1\n\t\t\t\t\treturn acc\n\t\t\t\t},\n\t\t\t\t{} as Record<string, number>,\n\t\t\t)\n\n\tconst queryCount = countChars(query)\n\tconst targetCount = countChars(target)\n\treturn Object.keys(queryCount).every(char => (targetCount[char] || 0) >= queryCount[char])\n}\n\n/**\n * Generate bigrams for a string.\n */\nconst getBigrams = (s: string): string[] => {\n\tif (!s || s.length < 2) return []\n\n\tconst bigrams: string[] = []\n\tfor (let i = 0; i < s.length - 1; i++) {\n\t\tbigrams.push(s.substring(i, i + 2).toLowerCase())\n\t}\n\treturn bigrams\n}\n\n/**\n * Compute Dice's coefficient for two strings based on bigrams.\n * Returns a value between 0 (no similarity) and 1 (perfect match).\n */\nconst diceCoefficient = (s1: string, s2: string): number => {\n\tif (!s1 || !s2 || s1.length < 2 || s2.length < 2) return 0\n\n\tconst bigrams1 = getBigrams(s1)\n\tconst bigrams2 = getBigrams(s2)\n\n\tif (bigrams1.length === 0 || bigrams2.length === 0) return 0\n\n\tlet intersection = 0\n\tconst used = new Array(bigrams2.length).fill(false)\n\n\tfor (const bigram of bigrams1) {\n\t\tfor (let i = 0; i < bigrams2.length; i++) {\n\t\t\tif (!used[i] && bigrams2[i] === bigram) {\n\t\t\t\tintersection++\n\t\t\t\tused[i] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (2 * intersection) / (bigrams1.length + bigrams2.length)\n}\n\n/**\n * Compute a fuzzy similarity score between two strings.\n * The score is computed by taking the maximum of several methods:\n * - Direct substring match (score 1)\n * - Subsequence check (score 0.8)\n * - Anagram subset match (score 0.7)\n * - Dice coefficient\n * - Normalized Levenshtein similarity\n */\nconst computeFuzzyScore = (actual: string, expected: string): number => {\n\tif (!actual || !expected) return 0\n\n\tconst a = actual.toLowerCase().trim()\n\tconst b = expected.toLowerCase().trim()\n\n\tif (a === b) return 1\n\n\tconst substringScore = a.includes(b) ? 1 : 0\n\tconst subsequenceScore = isSubsequence(b, a) ? 0.8 : 0\n\tconst anagramScore = anagramMatch(b, a) ? 0.7 : 0\n\tconst diceScore = diceCoefficient(a, b)\n\n\tconst maxLen = Math.max(a.length, b.length)\n\tconst levenshteinScore = maxLen ? 1 - levenshtein(a, b) / maxLen : 0\n\n\treturn Math.max(substringScore, subsequenceScore, anagramScore, diceScore, levenshteinScore)\n}\n\n/**\n * Safely coerce value to string if possible, or return empty string\n */\nconst safeString = (value: unknown): string => {\n\tif (value == null) return ''\n\treturn String(value)\n}\n\n/**\n * Type guard for arrays\n */\nconst isArray = (value: unknown): value is Array<unknown> => {\n\treturn Array.isArray(value)\n}\n\n/**\n * Compare two values based on a comparison operator.\n * For non-fuzzy operators, this returns a boolean.\n */\nexport function compareValues(op: ComparisonOperator, actual: unknown, expected: unknown): boolean {\n\t// Handle null/undefined cases\n\tif (actual == null && expected == null) return true\n\tif (actual == null || expected == null) {\n\t\t// For equality operators, null == null but null != non-null\n\t\tif (op === '==') return actual === expected\n\t\tif (op === '!=') return actual !== expected\n\t\t// Other operators should return false for null/undefined values\n\t\treturn false\n\t}\n\n\tswitch (op) {\n\t\tcase '==':\n\t\t\treturn actual === expected\n\t\tcase '!=':\n\t\t\treturn actual !== expected\n\t\tcase '>':\n\t\t\treturn (actual as number) > (expected as number)\n\t\tcase '<':\n\t\t\treturn (actual as number) < (expected as number)\n\t\tcase '>=':\n\t\t\treturn (actual as number) >= (expected as number)\n\t\tcase '<=':\n\t\t\treturn (actual as number) <= (expected as number)\n\t\tcase 'includes': {\n\t\t\tif (typeof actual === 'string') {\n\t\t\t\treturn safeString(actual).toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t} else if (isArray(actual)) {\n\t\t\t\treturn actual.includes(expected)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIncludes': {\n\t\t\tif (typeof actual === 'string') {\n\t\t\t\treturn !safeString(actual).toLowerCase().includes(safeString(expected).toLowerCase())\n\t\t\t} else if (isArray(actual)) {\n\t\t\t\treturn !actual.includes(expected)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tcase 'startsWith': {\n\t\t\tif (typeof actual === 'string' && typeof expected === 'string') {\n\t\t\t\treturn actual.toLowerCase().startsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'endsWith': {\n\t\t\tif (typeof actual === 'string' && typeof expected === 'string') {\n\t\t\t\treturn actual.toLowerCase().endsWith(expected.toLowerCase())\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'in': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn expected.includes(actual)\n\t\t\t}\n\t\t\treturn false\n\t\t}\n\t\tcase 'notIn': {\n\t\t\tif (isArray(expected)) {\n\t\t\t\treturn !expected.includes(actual)\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\tdefault: {\n\t\t\tconsole.warn(`Operator \"${op}\" is not supported in strict comparison.`)\n\t\t\treturn false\n\t\t}\n\t}\n}\n\n/**\n * Apply a query condition to an item and return score\n */\nfunction applyQueryCondition<T extends Record<string, any>>(\n\titem: T,\n\tquery: QueryCondition,\n\tfuzzyThreshold: number = 0.3,\n): { valid: boolean; score: number } {\n\tlet field: string,\n\t\top: ComparisonOperator,\n\t\texpected: unknown,\n\t\tstrict = false\n\n\tif (Array.isArray(query)) {\n\t\t;[field, op, expected, strict = false] = query\n\t} else {\n\t\tfield = query.key\n\t\top = query.operator\n\t\texpected = query.value\n\t\tstrict = query.strict || false\n\t}\n\n\t// Skip empty filters for non-strict queries\n\tif (!strict && (expected === '' || expected == null || (isArray(expected) && expected.length === 0))) {\n\t\treturn { valid: true, score: 1 }\n\t}\n\n\tconst actual = getFieldValue(item, field)\n\n\t// REMOVE THIS BLOCK - This is the problematic code\n\t// If strict mode is enabled, enforce exact equality\n\t// if (strict) {\n\t// \tif (actual !== expected) {\n\t// \t\treturn { valid: false, score: 0 }\n\t// \t}\n\t// \treturn { valid: true, score: 1 }\n\t// }\n\n\tif (op === 'any') {\n\t\t// Fuzzy search requires both values to be strings\n\t\tif (typeof actual !== 'string' || typeof expected !== 'string') {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\tconst score = computeFuzzyScore(actual, expected)\n\t\tif (score < fuzzyThreshold) {\n\t\t\treturn { valid: false, score: 0 }\n\t\t}\n\n\t\treturn { valid: true, score }\n\t} else {\n\t\t// For non-fuzzy operators, check condition\n\t\tconst matches = compareValues(op, actual, expected)\n\t\treturn {\n\t\t\tvalid: matches,\n\t\t\tscore: matches ? 1 : 0,\n\t\t}\n\t}\n}\n\n/**\n * Filter a Map of items given an array of query conditions.\n * For each query condition:\n * - If the expected value is empty/null/undefined, it is treated as a match.\n * - For non-fuzzy operators, the condition must strictly match.\n * - For the \"any\" operator, a fuzzy similarity score is computed.\n * Items with a fuzzy score below a given threshold (e.g., 0.3) are excluded.\n *\n * The overall item score is the average of the scores from all conditions.\n * The results are sorted in descending order of relevance.\n *\n * @param items - A Map containing items to filter.\n * @param queries - An array of query conditions to apply.\n * @param fuzzyThreshold - Minimum score required for fuzzy matches (default: 0.3)\n * @returns An array of items that match all query conditions, sorted by relevance.\n */\nexport function filterMapItems<T extends Record<string, any>>(\n\titems: Map<string, T>,\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// If no queries, return all items unsorted\n\tif (!queries.length) {\n\t\treturn Array.from(items.values())\n\t}\n\n\t// Score and filter each item\n\tconst scoredItems: ScoredItem<T>[] = []\n\n\tfor (const [_, item] of items.entries()) {\n\t\tlet totalScore = 0\n\t\tlet matchCount = 0\n\t\tlet valid = true\n\n\t\tfor (const query of queries) {\n\t\t\tconst result = applyQueryCondition(item, query, fuzzyThreshold)\n\n\t\t\tif (!result.valid) {\n\t\t\t\tvalid = false\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\ttotalScore += result.score\n\t\t\tmatchCount++\n\t\t}\n\n\t\tif (valid) {\n\t\t\tscoredItems.push({\n\t\t\t\titem,\n\t\t\t\tscore: matchCount > 0 ? totalScore / matchCount : 1,\n\t\t\t})\n\t\t}\n\t}\n\n\t// Sort by descending score\n\tscoredItems.sort((a, b) => b.score - a.score)\n\n\treturn scoredItems.map(x => x.item)\n}\n\n/**\n * Filter an array of items using query conditions\n */\nexport function filterArrayItems<T extends Record<string, any>>(\n\titems: T[],\n\tqueries: QueryCondition[] = [],\n\tfuzzyThreshold: number = 0.3,\n): T[] {\n\t// Create temporary map with numeric indices as keys\n\tconst map = new Map<string, T>()\n\titems.forEach((item, index) => map.set(String(index), item))\n\n\treturn filterMapItems(map, queries, fuzzyThreshold)\n}\n\n// Export a simpler alias for filterMapItems\nexport const filterMap = filterMapItems\n\n// Export an alias for filterArrayItems\nexport const filterArray = filterArrayItems\n","// src/store/selectors.ts\nimport { Observable, combineLatest, distinctUntilChanged, map, shareReplay } from 'rxjs'\nimport { IStore, ICollectionStore } from './types'\n\n/**\n * Deep equality comparison for maps and complex objects\n * More efficient than JSON.stringify for large objects\n */\nfunction deepEqual(a: unknown, b: unknown): boolean {\n\tif (a === b) return true\n\n\tif (a instanceof Map && b instanceof Map) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const [key, value] of a) {\n\t\t\tif (!b.has(key) || !deepEqual(value, b.get(key))) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (a instanceof Set && b instanceof Set) {\n\t\tif (a.size !== b.size) return false\n\t\tfor (const item of a) {\n\t\t\tif (!b.has(item)) return false\n\t\t}\n\t\treturn true\n\t}\n\n\tif (typeof a === 'object' && a !== null && typeof b === 'object' && b !== null) {\n\t\tconst keysA = Object.keys(a)\n\t\tconst keysB = Object.keys(b)\n\n\t\tif (keysA.length !== keysB.length) return false\n\n\t\tfor (const key of keysA) {\n\t\t\t// @ts-ignore: Index signature\n\t\t\tif (!deepEqual(a[key], b[key])) return false\n\t\t}\n\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n/**\n * Creates a selector that derives a value from store state\n *\n * @param store The store to observe\n * @param selectorFn Function that transforms the state\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createSelector<T, R>(store: IStore<T>, selectorFn: (state: T) => R): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector for collection stores that derives a value from the collection\n *\n * @param store The collection store to observe\n * @param selectorFn Function that transforms the collection\n * @returns An observable of the selected state that only emits when the derived value changes\n */\nexport function createCollectionSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tselectorFn: (state: Map<string, T>) => R,\n): Observable<R> {\n\treturn store.$.pipe(map(selectorFn), distinctUntilChanged<R>(deepEqual), shareReplay(1))\n}\n\n/**\n * Creates a selector that returns all items from a collection as an array\n *\n * @param store The collection store\n * @returns An observable of all items as an array\n */\nexport function createItemsSelector<T>(store: ICollectionStore<T>): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.values()))\n}\n\n/**\n * Creates a selector that filters items from a collection\n *\n * @param store The collection store\n * @param filterFn Function that returns true for items to include\n * @returns An observable of filtered items as an array\n */\nexport function createFilterSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn: (item: T, key: string) => boolean,\n): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\tconst result: T[] = []\n\t\tcollection.forEach((item, key) => {\n\t\t\tif (filterFn(item, key)) {\n\t\t\t\tresult.push(item)\n\t\t\t}\n\t\t})\n\t\treturn result\n\t})\n}\n\n/**\n * Creates a selector that retrieves a single item from a collection\n *\n * @param store The collection store\n * @param itemKey The key of the item to select\n * @returns An observable of the selected item that emits when the item changes\n */\nexport function createItemSelector<T>(store: ICollectionStore<T>, itemKey: string): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => collection.get(itemKey))\n}\n\n/**\n * Creates a selector that counts items in a collection, optionally filtered\n *\n * @param store The collection store\n * @param filterFn Optional function to filter which items to count\n * @returns An observable of the count\n */\nexport function createCountSelector<T>(\n\tstore: ICollectionStore<T>,\n\tfilterFn?: (item: T, key: string) => boolean,\n): Observable<number> {\n\treturn createCollectionSelector(store, collection => {\n\t\tif (!filterFn) return collection.size\n\n\t\tlet count = 0\n\t\tcollection.forEach((item, key) => {\n\t\t\tif (filterFn(item, key)) count++\n\t\t})\n\t\treturn count\n\t})\n}\n\n/**\n * Creates a compound selector that depends on multiple other selectors\n *\n * @param selectors Array of source selectors\n * @param combinerFn Function that combines all selector results\n * @returns An observable of the combined result\n */\nexport function createCompoundSelector<T extends unknown[], R>(\n\tselectors: { [K in keyof T]: Observable<T[K]> },\n\tcombinerFn: (...values: T) => R,\n): Observable<R> {\n\treturn combineLatest(selectors).pipe(\n\t\tmap(values => combinerFn(...(values as T))),\n\t\tdistinctUntilChanged<R>(deepEqual),\n\t\tshareReplay(1),\n\t)\n}\n\n/**\n * Creates a selector that returns all keys from a collection\n */\nexport function createKeysSelector<T>(store: ICollectionStore<T>): Observable<string[]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.keys()))\n}\n\n/**\n * Creates a selector that returns entries (key-value pairs) from a collection\n */\nexport function createEntriesSelector<T>(store: ICollectionStore<T>): Observable<[string, T][]> {\n\treturn createCollectionSelector(store, collection => Array.from(collection.entries()))\n}\n\n/**\n * Creates a selector that maps collection values through a transform function\n */\nexport function createMapSelector<T, R>(\n\tstore: ICollectionStore<T>,\n\tmapFn: (item: T, key: string) => R,\n): Observable<R[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\tconst result: R[] = []\n\t\tcollection.forEach((item, key) => {\n\t\t\tresult.push(mapFn(item, key))\n\t\t})\n\t\treturn result\n\t})\n}\n\n/**\n * Creates a selector that sorts collection items\n */\nexport function createSortSelector<T>(store: ICollectionStore<T>, compareFn: (a: T, b: T) => number): Observable<T[]> {\n\treturn createCollectionSelector(store, collection => {\n\t\treturn Array.from(collection.values()).sort(compareFn)\n\t})\n}\n\n/**\n * Creates a selector that finds the first item matching a predicate\n */\nexport function createFindSelector<T>(\n\tstore: ICollectionStore<T>,\n\tpredicate: (item: T, key: string) => boolean,\n): Observable<T | undefined> {\n\treturn createCollectionSelector(store, collection => {\n\t\tfor (const [key, item] of collection.entries()) {\n\t\t\tif (predicate(item, key)) {\n\t\t\t\treturn item\n\t\t\t}\n\t\t}\n\t\treturn undefined\n\t})\n}\n","// src/store/selector-hook.ts\nimport { property as litProperty } from 'lit/decorators.js'\nimport { Observable, Subject, Subscription } from 'rxjs'\nimport { takeUntil } from 'rxjs/operators'\nimport { createCollectionSelector, createSelector } from './selectors'\nimport { ICollectionStore, IStore } from './types'\n\n/**\n * Component lifecycle interface\n */\ninterface ComponentWithLifecycle {\n\t// Lifecycle hooks\n\tisConnected: boolean\n\tdisconnectedCallback?: () => void\n\tconnectedCallback?: () => void\n\trequestUpdate?: () => void\n\n\t// Internal properties\n\t_selectorCleanup?: Subject<void>\n\t_selectorSubscriptions?: Map<string, Subscription>\n\t_selectorInitialized?: Set<string>\n\n\t// Value storage\n\t[key: string]: any\n}\n\n/**\n * Property descriptor interface\n */\ntype PropertyDescriptor<T> = {\n\tget?: () => T\n\tset?: (value: T) => void\n\tvalue?: T\n\tconfigurable?: boolean\n\tenumerable?: boolean\n\twritable?: boolean\n}\n\n/**\n * Options for selecting from a store\n */\ninterface SelectOptions {\n\t/** If true, will wait for selector to emit a non-null value before calling connectedCallback */\n\trequired?: boolean\n\n\t/** If true, will only update the component and not set the property value */\n\tupdateOnly?: boolean\n\n\t/** If true, will use structuredClone to deeply clone values (prevents mutations) */\n\tdeepClone?: boolean\n\n\t/** Custom equality function to determine when to update */\n\tequals?: (a: any, b: any) => boolean\n}\n\n/**\n * Type guard to check if a store is a collection store\n */\nfunction isCollectionStore<T>(store: IStore<any> | ICollectionStore<T>): store is ICollectionStore<T> {\n\treturn 'set' in store && typeof store.set === 'function' && store.value instanceof Map\n}\n\n/**\n * Selector decorator that connects a component property to a store selector\n *\n * @param store The store to select from\n * @param selectorFn Optional function to transform the store state\n * @param options Additional options for the selector\n */\nexport function select<T, R>(\n\tstore: IStore<T> | ICollectionStore<T>,\n\tselectorFn: (state: any) => R = (state: R) => state,\n\toptions: SelectOptions = {},\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<R>) {\n\t\t// Register as a Lit property\n\t\tlitProperty({ attribute: false, type: Object })(proto, propName)\n\n\t\t// Store original lifecycle methods\n\t\tconst originalConnectedCallback = proto.connectedCallback\n\t\tconst originalDisconnectedCallback = proto.disconnectedCallback\n\n\t\t// Override connectedCallback to set up subscription\n\t\tproto.connectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Initialize tracking properties if needed\n\t\t\tif (!this._selectorCleanup || this._selectorCleanup.closed) {\n\t\t\t\tthis._selectorCleanup = new Subject<void>()\n\t\t\t}\n\n\t\t\tif (!this._selectorSubscriptions) {\n\t\t\t\tthis._selectorSubscriptions = new Map()\n\t\t\t}\n\n\t\t\tif (!this._selectorInitialized) {\n\t\t\t\tthis._selectorInitialized = new Set()\n\t\t\t}\n\n\t\t\t// Create the appropriate selector\n\t\t\tconst selector: Observable<R> = isCollectionStore(store)\n\t\t\t\t? createCollectionSelector(store, selectorFn)\n\t\t\t\t: createSelector(store as IStore<T>, selectorFn)\n\n\t\t\t// Call original connectedCallback immediately if not waiting for data\n\t\t\tif (!options.required && !this._selectorInitialized.has(propName)) {\n\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\tthis._selectorInitialized.add(propName)\n\t\t\t}\n\n\t\t\t// Clean up any existing subscription\n\t\t\tif (this._selectorSubscriptions.has(propName)) {\n\t\t\t\tthis._selectorSubscriptions.get(propName)?.unsubscribe()\n\t\t\t}\n\n\t\t\t// Create new subscription\n\t\t\tconst subscription = selector.pipe(takeUntil(this._selectorCleanup)).subscribe({\n\t\t\t\tnext: (value: R) => {\n\t\t\t\t\t// Handle value updates\n\t\t\t\t\tconst newValue = options.deepClone ? structuredClone(value) : value\n\n\t\t\t\t\tif (!options.updateOnly) {\n\t\t\t\t\t\tthis[propName] = newValue\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.requestUpdate?.()\n\n\t\t\t\t\t// If required and not initialized, call connectedCallback when we get a value\n\t\t\t\t\tif (\n\t\t\t\t\t\toptions.required &&\n\t\t\t\t\t\t!this._selectorInitialized.has(propName) &&\n\t\t\t\t\t\tnewValue !== null &&\n\t\t\t\t\t\tnewValue !== undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\toriginalConnectedCallback?.call(this)\n\t\t\t\t\t\tthis._selectorInitialized.add(propName)\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: (err: Error) => {\n\t\t\t\t\tconsole.error(`Error in selector subscription for ${propName}:`, err)\n\t\t\t\t},\n\t\t\t})\n\n\t\t\t// Store the subscription for cleanup\n\t\t\tthis._selectorSubscriptions.set(propName, subscription)\n\t\t}\n\n\t\t// Override disconnectedCallback to clean up subscriptions\n\t\tproto.disconnectedCallback = function (this: ComponentWithLifecycle) {\n\t\t\t// Call original disconnectedCallback\n\t\t\toriginalDisconnectedCallback?.call(this)\n\n\t\t\t// Clean up subscriptions\n\t\t\tif (this._selectorCleanup) {\n\t\t\t\tthis._selectorCleanup.next()\n\t\t\t\tthis._selectorCleanup.complete()\n\t\t\t}\n\n\t\t\tif (this._selectorSubscriptions) {\n\t\t\t\tthis._selectorSubscriptions.forEach(sub => sub.unsubscribe())\n\t\t\t\tthis._selectorSubscriptions.clear()\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * Creates a selector decorator that selects a specific item from a collection store\n *\n * @param store The collection store\n * @param keyGetter Function that returns the key to select\n * @param options Additional options\n */\nexport function selectItem<T>(\n\tstore: ICollectionStore<T>,\n\tkeyGetter: (component: any) => string,\n\toptions: SelectOptions = {},\n) {\n\treturn function (proto: Record<string, any>, propName: string, _descriptor?: PropertyDescriptor<T | undefined>) {\n\t\tselect(\n\t\t\tstore,\n\t\t\tstate => {\n\t\t\t\t// This will be evaluated during subscription, when 'this' is available\n\t\t\t\tconst itemKey = keyGetter(this)\n\t\t\t\treturn itemKey ? state.get(itemKey) : undefined\n\t\t\t},\n\t\t\toptions,\n\t\t)(proto, propName)\n\t}\n}\n"],"names":["createObjectStore","initialData","storage","key","StoreError","store","SchmancyStoreObject","getInstance","obj","value","Object","keys","length","$","next","createContext","Map","SchmancyCollectionStore","size","dataType","getFieldValue","item","path","parts","split","part","getBigrams","s","bigrams","i","push","substring","toLowerCase","computeFuzzyScore","actual","expected","a","trim","b","substringScore","includes","subsequenceScore","sub","str","j","anagramScore","query","target","countChars","reduce","acc","char","queryCount","targetCount","every","diceScore","s1","s2","bigrams1","bigrams2","intersection","used","Array","fill","bigram","maxLen","Math","max","levenshteinScore","matrix","map","_","charAt","min","safeString","String","isArray","compareValues","op","startsWith","endsWith","applyQueryCondition","fuzzyThreshold","field","strict","operator","valid","score","matches","filterMapItems","items","queries","from","values","scoredItems","entries","totalScore","matchCount","result","sort","x","filterArrayItems","forEach","index","set","filterMap","filterArray","deepEqual","has","get","Set","keysA","keysB","createSelector","selectorFn","pipe","distinctUntilChanged","shareReplay","createCollectionSelector","select","state","options","proto","propName","_descriptor","litProperty","attribute","type","originalConnectedCallback","connectedCallback","originalDisconnectedCallback","disconnectedCallback","this","_selectorCleanup","closed","Subject","_selectorSubscriptions","_selectorInitialized","selector","required","call","add","unsubscribe","subscription","takeUntil","subscribe","newValue","deepClone","structuredClone","updateOnly","requestUpdate","error","err","complete","clear","selectors","combinerFn","combineLatest","filterFn","collection","count","predicate","itemKey","mapFn","compareFn","keyGetter"],"mappings":"2IA4CA,SAASA,EACRC,EACAC,EACAC,EAAAA,CAGA,GAAID,IAAY,YACf,MAAM,IAAIE,EAAWA,WAAA,uDAAwD,KAAM,CAAEF,QAASC,EAAAA,IAAAA,CAAAA,CAAAA,EAI/F,MAAME,EAAQC,EAAAA,oBAAoBC,YAAeL,EAASC,EAAKF,CA/ChE,EAAA,IAAuBO,EAsDf,OArDY,OADGA,EAkDJH,EAAMI,QAjDL,UAAYD,IAAQ,MAGhCE,OAAOC,KAAKH,GAAKI,SAAW,GA+C5BP,EAAAQ,EAAEC,KAAKb,CAAAA,EAGPI,CACR,CA4CgB,SAAAU,EACfd,EACAC,EACAC,GAGI,GAAAF,GAAAA,KACH,MAAM,IAAIG,EAAWA,WAAA,2CAA4C,KAAM,CAAEF,QAASC,EAAAA,IAAAA,CAAAA,CAAAA,EAI/E,GAAMF,aAhFce,IAiFhB,OAnDT,SACCf,EACAC,EACAC,EAGA,CAAA,MAAME,EAAQY,EAAAA,wBAAwBV,YAAYL,EAASC,EAAKF,GAOzD,OAJFI,EAAMI,MAAMS,MAChBb,EAAMQ,EAAEC,KAAK,IAAIE,IAAIf,CAAAA,CAAAA,EAGfI,CACR,EAqC+BJ,EAAiCC,EAASC,CAAAA,EACxE,GAAkBF,OAAAA,GAAgB,SAC1B,OAAAD,EAAkBC,EAAaC,EAASC,CAEzC,EAAA,MAAA,IAAIC,EAAAA,WAAW,0CAA2C,KAAM,CACrEF,UACAC,IACAgB,EAAAA,SAAAA,OAAiBlB,GAGpB,CC/Ea,MAAAmB,EAAgB,CAAUC,EAA2BC,KAC7D,GAACA,CAAAA,EAAa,OAAAD,EAEZ,MAAAE,EAAQD,EAAKE,MAAM,KACzB,IAAIf,EAAaY,EAEjB,UAAWI,KAAQF,EAAO,CACrB,GAAAd,GAAS,KAAa,OAC1BA,EAAQA,EAAMgB,EAAI,CAGZ,OAAA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CAAAA,CAAAA,CACrE,8BAnCO,SAAgC7J,EAC/B,CAAA,OAAAiH,EAAyBjH,EAAqB0J,GAAAjG,MAAM8B,KAAKmE,EAAWlE,UAC5E,6BA8EO,SAA+BxF,EAAAA,CAC9B,OAAAiH,EAAyBjH,EAAqB0J,GAAAjG,MAAM8B,KAAKmE,EAAWpJ,KAC5E,CAAA,CAAA,CAAA,4BAYgB,SACfN,EACA8J,EAEO,CAAA,OAAA7C,EAAyBjH,EAAqB0J,GAAAA,CACpD,MAAM7D,EAAc,CAAA,EAIb,OAHI6D,EAAAzD,QAAQ,CAACjF,EAAMlB,KACzB+F,EAAOpE,KAAKqI,EAAM9I,EAAMlB,CAAAA,CAAAA,CAAI,GAEtB+F,CAAA,CAAA,CAET,8BF9CO,SACNjG,EACAE,EACAD,EAAuB,QAEhB,CAAA,OAAAa,EAAcd,EAAaC,EAASC,EAC5C,sDE6CgB,SAAsBE,EAA4B+J,GAC1D,OAAA9C,EAAyBjH,EAAqB0J,GAC7CjG,MAAM8B,KAAKmE,EAAWlE,OAAAA,CAAAA,EAAUM,KAAKiE,CAE9C,CAAA,CAAA,4JClBO,SACN/J,EACAgK,EACA5C,EAAyB,CAAA,EAElB,CAAA,OAAA,SAAUC,EAA4BC,EAAkBC,GAC9DL,EACClH,EACSmH,IAEF,MAAA0C,EAAUG,EAAUjC,IAC1B,EAAA,OAAO8B,EAAU1C,EAAMX,IAAIqD,SAAW,EAEvCzC,GACCC,EAAOC,EACV,CACD"}
package/dist/store.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./context-object-D81PeS3j.cjs"),e=require("./selector-hook-CH-z8W2d.cjs");exports.IndexedDBStorageManager=t.IndexedDBStorageManager,exports.LocalStorageManager=t.LocalStorageManager,exports.MemoryStorageManager=t.MemoryStorageManager,exports.SchmancyStoreObject=t.SchmancyStoreObject,exports.SessionStorageManager=t.SessionStorageManager,exports.StoreError=t.StoreError,exports.createStorageManager=t.createStorageManager,exports.compareValues=e.compareValues,exports.createCollectionContext=e.createCollectionContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createObjectContext=e.createObjectContext,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.select=e.select,exports.selectItem=e.selectItem;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./context-object-BIywslrO.cjs"),e=require("./selector-hook-DDaYMsHs.cjs");exports.IndexedDBStorageManager=t.IndexedDBStorageManager,exports.LocalStorageManager=t.LocalStorageManager,exports.MemoryStorageManager=t.MemoryStorageManager,exports.SchmancyStoreObject=t.SchmancyStoreObject,exports.SessionStorageManager=t.SessionStorageManager,exports.StoreError=t.StoreError,exports.createStorageManager=t.createStorageManager,exports.compareValues=e.compareValues,exports.createCollectionContext=e.createCollectionContext,exports.createCollectionSelector=e.createCollectionSelector,exports.createCompoundSelector=e.createCompoundSelector,exports.createContext=e.createContext,exports.createCountSelector=e.createCountSelector,exports.createEntriesSelector=e.createEntriesSelector,exports.createFilterSelector=e.createFilterSelector,exports.createFindSelector=e.createFindSelector,exports.createItemSelector=e.createItemSelector,exports.createItemsSelector=e.createItemsSelector,exports.createKeysSelector=e.createKeysSelector,exports.createMapSelector=e.createMapSelector,exports.createObjectContext=e.createObjectContext,exports.createSelector=e.createSelector,exports.createSortSelector=e.createSortSelector,exports.filterArray=e.filterArray,exports.filterArrayItems=e.filterArrayItems,exports.filterMap=e.filterMap,exports.filterMapItems=e.filterMapItems,exports.getFieldValue=e.getFieldValue,exports.select=e.select,exports.selectItem=e.selectItem;
2
2
  //# sourceMappingURL=store.cjs.map
package/dist/store.js CHANGED
@@ -1,5 +1,5 @@
1
- import { I as t, L as r, M as s, S as c, a as o, b as l, c as S } from "./context-object-CD26Iary.js";
2
- import { d as g, b as i, l as m, q as M, c as p, p as f, t as C, n as I, w as d, o as x, m as u, r as y, u as b, a as j, k as F, v as h, i as A, e as E, h as L, f as O, g as V, s as k, j as q } from "./selector-hook-9dSW11-1.js";
1
+ import { I as t, L as r, M as s, S as c, a as o, b as l, c as S } from "./context-object-BDXZ5EKJ.js";
2
+ import { d as g, b as i, l as m, q as M, c as p, p as f, t as C, n as I, w as d, o as x, m as u, r as y, u as b, a as j, k as F, v as h, i as A, e as E, h as L, f as O, g as V, s as k, j as q } from "./selector-hook-C6VCezv7.js";
3
3
  export {
4
4
  t as IndexedDBStorageManager,
5
5
  r as LocalStorageManager,
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-CplIV2h1.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./teleport.component-72oIW654.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
2
2
  //# sourceMappingURL=teleport.cjs.map