@baleada/logic 0.20.30 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.cjs CHANGED
@@ -50,34 +50,30 @@ function createFilterAsync(condition) {
50
50
  return createFilter((_, index) => transformedAsync[index])(array);
51
51
  };
52
52
  }
53
- function createDelete(required) {
53
+ function createDelete(index) {
54
54
  return (array) => {
55
- const deleteIndex = "index" in required ? required.index : lazyCollections.findIndex((element) => element === required?.item)(array);
56
- return createConcat(createSlice({ from: 0, to: deleteIndex })(array), createSlice({ from: deleteIndex + 1 })(array))([]);
55
+ return createConcat(createSlice(0, index)(array), createSlice(index + 1)(array))([]);
57
56
  };
58
57
  }
59
- function createInsert(required) {
58
+ function createInsert(item, index) {
60
59
  return (array) => {
61
- const itemsToInsert = "items" in required ? required.items : [required.item], withItems = createConcat(array, itemsToInsert)([]);
62
- return createReorder({
63
- from: { start: array.length, itemCount: itemsToInsert.length },
64
- to: required.index
65
- })(withItems);
60
+ const withItems = createConcat(array, [item])([]);
61
+ return createReorder({ start: array.length, itemCount: 1 }, index)(withItems);
66
62
  };
67
63
  }
68
- function createReorder({ from, to }) {
64
+ function createReorder(from, to) {
69
65
  return (array) => {
70
66
  const [itemsToMoveStartIndex, itemsToMoveCount] = isObject(from) ? [from.start, from.itemCount] : [from, 1], insertIndex = to;
71
67
  if (insertIndex > itemsToMoveStartIndex && insertIndex < itemsToMoveStartIndex + itemsToMoveCount) {
72
68
  return array;
73
69
  }
74
- const itemsToMove = createSlice({ from: itemsToMoveStartIndex, to: itemsToMoveStartIndex + itemsToMoveCount })(array);
70
+ const itemsToMove = createSlice(itemsToMoveStartIndex, itemsToMoveStartIndex + itemsToMoveCount)(array);
75
71
  if (itemsToMoveStartIndex < insertIndex) {
76
- const beforeItemsToMove = itemsToMoveStartIndex === 0 ? [] : createSlice({ from: 0, to: itemsToMoveStartIndex })(array), betweenItemsToMoveAndInsertIndex = createSlice({ from: itemsToMoveStartIndex + itemsToMoveCount, to: insertIndex + 1 })(array), afterInsertIndex = createSlice({ from: insertIndex + 1 })(array);
72
+ const beforeItemsToMove = itemsToMoveStartIndex === 0 ? [] : createSlice(0, itemsToMoveStartIndex)(array), betweenItemsToMoveAndInsertIndex = createSlice(itemsToMoveStartIndex + itemsToMoveCount, insertIndex + 1)(array), afterInsertIndex = createSlice(insertIndex + 1)(array);
77
73
  return createConcat(beforeItemsToMove, betweenItemsToMoveAndInsertIndex, itemsToMove, afterInsertIndex)([]);
78
74
  }
79
75
  if (itemsToMoveStartIndex > insertIndex) {
80
- const beforeInsertion = insertIndex === 0 ? [] : createSlice({ from: 0, to: insertIndex })(array), betweenInsertionAndItemsToMove = createSlice({ from: insertIndex, to: itemsToMoveStartIndex })(array), afterItemsToMove = createSlice({ from: itemsToMoveStartIndex + itemsToMoveCount })(array);
76
+ const beforeInsertion = insertIndex === 0 ? [] : createSlice(0, insertIndex)(array), betweenInsertionAndItemsToMove = createSlice(insertIndex, itemsToMoveStartIndex)(array), afterItemsToMove = createSlice(itemsToMoveStartIndex + itemsToMoveCount)(array);
81
77
  return createConcat(beforeInsertion, itemsToMove, betweenInsertionAndItemsToMove, afterItemsToMove)([]);
82
78
  }
83
79
  return array;
@@ -86,19 +82,19 @@ function createReorder({ from, to }) {
86
82
  function isObject(value) {
87
83
  return typeof value === "object";
88
84
  }
89
- function createSwap({ indices }) {
85
+ function createSwap(indices) {
90
86
  return (array) => {
91
87
  const { 0: from, 1: to } = indices, { reorderFrom, reorderTo } = (() => {
92
88
  if (from < to) {
93
89
  return {
94
- reorderFrom: createReorder({ from, to }),
95
- reorderTo: createReorder({ from: to - 1, to: from })
90
+ reorderFrom: createReorder(from, to),
91
+ reorderTo: createReorder(to - 1, from)
96
92
  };
97
93
  }
98
94
  if (from > to) {
99
95
  return {
100
- reorderFrom: createReorder({ from, to }),
101
- reorderTo: createReorder({ from: to + 1, to: from })
96
+ reorderFrom: createReorder(from, to),
97
+ reorderTo: createReorder(to + 1, from)
102
98
  };
103
99
  }
104
100
  return {
@@ -109,15 +105,15 @@ function createSwap({ indices }) {
109
105
  return new Pipeable(array).pipe(reorderFrom, reorderTo);
110
106
  };
111
107
  }
112
- function createReplace({ index, item }) {
108
+ function createReplace(index, item) {
113
109
  return (array) => {
114
- return createConcat(createSlice({ from: 0, to: index })(array), [item], createSlice({ from: index + 1 })(array))([]);
110
+ return createConcat(createSlice(0, index)(array), [item], createSlice(index + 1)(array))([]);
115
111
  };
116
112
  }
117
113
  function createUnique() {
118
114
  return (array) => lazyCollections.pipe(lazyCollections.unique(), lazyCollections.toArray())(array);
119
115
  }
120
- function createSlice({ from, to }) {
116
+ function createSlice(from, to) {
121
117
  return (array) => {
122
118
  return from === to ? [] : lazyCollections.pipe(lazyCollections.slice(from, to - 1), lazyCollections.toArray())(array);
123
119
  };
@@ -140,9 +136,14 @@ function createReverse() {
140
136
  return reversed;
141
137
  };
142
138
  }
139
+ function createSort(compare) {
140
+ return (array) => {
141
+ return new Pipeable(array).pipe(createSlice(0), (sliced) => sliced.sort(compare));
142
+ };
143
+ }
143
144
  function createSlug(options) {
144
145
  return (string) => {
145
- return slugify__default['default'](string, options);
146
+ return slugify__default["default"](string, options);
146
147
  };
147
148
  }
148
149
  function createClip(required) {
@@ -150,7 +151,7 @@ function createClip(required) {
150
151
  return string.replace(required, "");
151
152
  };
152
153
  }
153
- function createClamp({ min, max }) {
154
+ function createClamp(min, max) {
154
155
  return (number) => {
155
156
  const maxed = Math.max(number, min);
156
157
  return Math.min(maxed, max);
@@ -166,10 +167,10 @@ function createDetermine(potentialities) {
166
167
  })(potentialities);
167
168
  return (determinant) => lazyCollections.find(({ predicate }) => predicate(determinant))(predicates).outcome;
168
169
  }
169
- function createRename({ from, to }) {
170
+ function createRename(from, to) {
170
171
  return (map2) => {
171
- const keys = [...map2.keys()], keyToRenameIndex = lazyCollections.findIndex((k) => k === from)(keys), newKeys = createReplace({ index: keyToRenameIndex, item: to })(keys), values = [...map2.values()];
172
- return createReduce((renamed, key, index) => renamed.set(key, values[index]), new Map())(newKeys);
172
+ const keys = [...map2.keys()], keyToRenameIndex = lazyCollections.findIndex((k) => k === from)(keys), newKeys = createReplace(keyToRenameIndex, to)(keys), values = [...map2.values()];
173
+ return createReduce((renamed, key, index) => renamed.set(key, values[index]), /* @__PURE__ */ new Map())(newKeys);
173
174
  };
174
175
  }
175
176
  function createToEntries() {
@@ -197,7 +198,7 @@ function toEvent(eventType, options) {
197
198
  const implementation = toImplementation(eventType);
198
199
  switch (implementation) {
199
200
  case "keycombo": {
200
- const combo = toCombo(eventType), modifiers = createSlice({ from: 0, to: combo.length - 1 })(combo), { 0: name } = createSlice({ from: combo.length - 1 })(combo);
201
+ const combo = toCombo(eventType), modifiers = createSlice(0, combo.length - 1)(combo), { 0: name } = createSlice(combo.length - 1)(combo);
201
202
  return new KeyboardEvent("keyDirection" in options ? `key${options.keyDirection}` : "keydown", {
202
203
  ...options.init || {},
203
204
  key: toKey(name),
@@ -209,7 +210,7 @@ function toEvent(eventType, options) {
209
210
  }
210
211
  case "leftclickcombo":
211
212
  case "rightclickcombo": {
212
- const combo = toCombo(eventType), modifiers = createSlice({ from: 0, to: combo.length - 1 })(combo), { 0: name } = createSlice({ from: combo.length - 1 })(combo);
213
+ const combo = toCombo(eventType), modifiers = createSlice(0, combo.length - 1)(combo), { 0: name } = createSlice(combo.length - 1)(combo);
213
214
  return new MouseEvent(name === "rightclick" ? "contextmenu" : name, {
214
215
  ...options.init || {},
215
216
  ...createReduce((flags, alias) => {
@@ -219,7 +220,7 @@ function toEvent(eventType, options) {
219
220
  });
220
221
  }
221
222
  case "pointercombo": {
222
- const combo = toCombo(eventType), modifiers = createSlice({ from: 0, to: combo.length - 1 })(combo), { 0: name } = createSlice({ from: combo.length - 1 })(combo);
223
+ const combo = toCombo(eventType), modifiers = createSlice(0, combo.length - 1)(combo), { 0: name } = createSlice(combo.length - 1)(combo);
223
224
  return new PointerEvent(name === "rightclick" ? "contextmenu" : name, {
224
225
  ...options.init || {},
225
226
  ...createReduce((flags, alias) => {
@@ -246,8 +247,6 @@ function toEvent(eventType, options) {
246
247
  return new InputEvent(eventType, options.init);
247
248
  if (eventType === "blur")
248
249
  return new FocusEvent(eventType, options.init);
249
- if (eventType === "cancel")
250
- return new Event(eventType, options.init);
251
250
  if (eventType === "canplay")
252
251
  return new Event(eventType, options.init);
253
252
  if (eventType === "canplaythrough")
@@ -276,8 +275,6 @@ function toEvent(eventType, options) {
276
275
  return new DragEvent(eventType, options.init);
277
276
  if (eventType === "dragenter")
278
277
  return new DragEvent(eventType, options.init);
279
- if (eventType === "dragexit")
280
- return new Event(eventType, options.init);
281
278
  if (eventType === "dragleave")
282
279
  return new DragEvent(eventType, options.init);
283
280
  if (eventType === "dragover")
@@ -500,7 +497,7 @@ function toCombo(type) {
500
497
  function fromComboItemNameToType(name) {
501
498
  return lazyCollections.find((type) => predicatesByType[type](name))(listenableComboItemTypes) ?? "custom";
502
499
  }
503
- const listenableComboItemTypes = new Set(["singleCharacter", "arrow", "other", "modifier", "click", "pointer"]);
500
+ const listenableComboItemTypes = /* @__PURE__ */ new Set(["singleCharacter", "arrow", "other", "modifier", "click", "pointer"]);
504
501
  const predicatesByType = {
505
502
  singleCharacter: (name) => typeREs["singleCharacter"].test(name),
506
503
  arrow: (name) => typeREs["arrow"].test(name),
@@ -596,6 +593,10 @@ function isString(value) {
596
593
  }
597
594
 
598
595
  class Recognizeable {
596
+ maxSequenceLength;
597
+ effects;
598
+ effectApi;
599
+ toType;
599
600
  constructor(sequence, options = { effectsIncludeCombos: true }) {
600
601
  const defaultOptions = {
601
602
  maxSequenceLength: true,
@@ -619,6 +620,7 @@ class Recognizeable {
619
620
  };
620
621
  this.ready();
621
622
  }
623
+ computedMetadata;
622
624
  resetComputedMetadata() {
623
625
  this.computedMetadata = {};
624
626
  }
@@ -628,6 +630,7 @@ class Recognizeable {
628
630
  denied() {
629
631
  this.computedStatus = "denied";
630
632
  }
633
+ computedStatus;
631
634
  ready() {
632
635
  this.computedStatus = "ready";
633
636
  }
@@ -643,13 +646,14 @@ class Recognizeable {
643
646
  get metadata() {
644
647
  return this.computedMetadata;
645
648
  }
649
+ computedSequence;
646
650
  setSequence(sequence) {
647
651
  this.computedSequence = sequence;
648
652
  return this;
649
653
  }
650
654
  recognize(sequenceItem, { onRecognized } = {}) {
651
655
  this.recognizing();
652
- const type = this.toType(sequenceItem), excess = isNumber(this.maxSequenceLength) ? Math.max(0, this.sequence.length - this.maxSequenceLength) : 0, newSequence = createConcat(createSlice({ from: excess })(this.sequence), [sequenceItem])([]);
656
+ const type = this.toType(sequenceItem), excess = isNumber(this.maxSequenceLength) ? Math.max(0, this.sequence.length - this.maxSequenceLength) : 0, newSequence = createConcat(createSlice(excess)(this.sequence), [sequenceItem])([]);
653
657
  this.effectApi.sequenceItem = sequenceItem;
654
658
  this.effectApi.getSequence = () => newSequence;
655
659
  this.effectApi.onRecognized = onRecognized || (() => {
@@ -746,9 +750,12 @@ function createToType({
746
750
  }
747
751
  };
748
752
  }
749
- const leftclickcomboEventTypes = new Set(["click", "mousedown", "mouseup", "dblclick"]), rightclickComboEventTypes = new Set(["contextmenu"]), keycomboEventTypes = new Set(["keydown", "keyup"]), toJoinedClickcombo = lazyCollections.join("+"), toJoinedKeycombo = lazyCollections.pipe(lazyCollections.map(({ name }) => name), toJoinedClickcombo);
753
+ const leftclickcomboEventTypes = /* @__PURE__ */ new Set(["click", "mousedown", "mouseup", "dblclick"]), rightclickComboEventTypes = /* @__PURE__ */ new Set(["contextmenu"]), keycomboEventTypes = /* @__PURE__ */ new Set(["keydown", "keyup"]), toJoinedClickcombo = lazyCollections.join("+"), toJoinedKeycombo = lazyCollections.pipe(lazyCollections.map(({ name }) => name), toJoinedClickcombo);
750
754
 
751
755
  class Listenable {
756
+ computedRecognizeable;
757
+ recognizeableEffectsKeys;
758
+ computedActive;
752
759
  constructor(type, options) {
753
760
  if (type === "recognizeable") {
754
761
  const recognizeableOptions = {
@@ -761,10 +768,11 @@ class Listenable {
761
768
  this.computedRecognizeable = new Recognizeable([], recognizeableOptions);
762
769
  this.recognizeableEffectsKeys = Object.keys(recognizeableOptions.effects);
763
770
  }
764
- this.computedActive = new Set();
771
+ this.computedActive = /* @__PURE__ */ new Set();
765
772
  this.setType(type);
766
773
  this.ready();
767
774
  }
775
+ computedStatus;
768
776
  ready() {
769
777
  this.computedStatus = "ready";
770
778
  }
@@ -783,6 +791,8 @@ class Listenable {
783
791
  get recognizeable() {
784
792
  return this.computedRecognizeable;
785
793
  }
794
+ computedType;
795
+ implementation;
786
796
  setType(type) {
787
797
  this.stop();
788
798
  this.computedType = type;
@@ -975,7 +985,7 @@ function stop(stoppable) {
975
985
  function toImplementation(type) {
976
986
  return lazyCollections.find((implementation) => predicatesByImplementation.get(implementation)(type))(predicatesByImplementation.keys());
977
987
  }
978
- const predicatesByImplementation = new Map([
988
+ const predicatesByImplementation = /* @__PURE__ */ new Map([
979
989
  [
980
990
  "recognizeable",
981
991
  (type) => type === "recognizeable"
@@ -1025,7 +1035,7 @@ const predicatesByImplementation = new Map([
1025
1035
  () => true
1026
1036
  ]
1027
1037
  ]);
1028
- const documentEvents = new Set([
1038
+ const documentEvents = /* @__PURE__ */ new Set([
1029
1039
  "fullscreenchange",
1030
1040
  "fullscreenerror",
1031
1041
  "pointerlockchange",
@@ -1048,6 +1058,11 @@ function eventMatchesKeycombo({ event, keycombo }) {
1048
1058
  return lazyCollections.every(({ name, type }, index) => {
1049
1059
  switch (type) {
1050
1060
  case "singleCharacter":
1061
+ if (name === "!") {
1062
+ return event.key === "!";
1063
+ }
1064
+ const keyToTest = event.altKey && fromComboItemNameToType(event.key) === "custom" ? fromCodeToSingleCharacter(event.code) : event.key.toLowerCase();
1065
+ return name.startsWith("!") ? keyToTest !== toKey(name.slice(1)).toLowerCase() : keyToTest === toKey(name).toLowerCase();
1051
1066
  case "other":
1052
1067
  if (name === "!") {
1053
1068
  return event.key === "!";
@@ -1063,7 +1078,34 @@ function eventMatchesKeycombo({ event, keycombo }) {
1063
1078
  }
1064
1079
  })(keycombo);
1065
1080
  }
1066
- const predicatesByArrow = new Map([
1081
+ function fromCodeToSingleCharacter(code) {
1082
+ for (const c in aliasesByCode) {
1083
+ if (c === code) {
1084
+ return aliasesByCode[c];
1085
+ }
1086
+ }
1087
+ for (const prefix of ["Key", "Digit"]) {
1088
+ const re = new RegExp(`^${prefix}`);
1089
+ if (re.test(code)) {
1090
+ return createClip(re)(code).toLowerCase();
1091
+ }
1092
+ }
1093
+ return code;
1094
+ }
1095
+ const aliasesByCode = {
1096
+ "Backquote": "`",
1097
+ "Minus": "-",
1098
+ "Equal": "=",
1099
+ "BracketLeft": "[",
1100
+ "BracketRight": "]",
1101
+ "Backslash": "\\",
1102
+ "Semicolon": ";",
1103
+ "Quote": "'",
1104
+ "Comma": ",",
1105
+ "Period": ".",
1106
+ "Slash": "/"
1107
+ };
1108
+ const predicatesByArrow = /* @__PURE__ */ new Map([
1067
1109
  [
1068
1110
  "arrow",
1069
1111
  ({ event }) => arrows.has(event.key.toLowerCase())
@@ -1093,9 +1135,9 @@ const predicatesByArrow = new Map([
1093
1135
  ({ event, name }) => name.startsWith("!") ? event.key.toLowerCase() !== `arrow${name.toLowerCase()}` : event.key.toLowerCase() === `arrow${name.toLowerCase()}`
1094
1136
  ]
1095
1137
  ]);
1096
- const arrows = new Set(["arrowup", "arrowright", "arrowdown", "arrowleft"]);
1097
- const verticalArrows = new Set(["arrowup", "arrowdown"]);
1098
- const horizontalArrows = new Set(["arrowright", "arrowleft"]);
1138
+ const arrows = /* @__PURE__ */ new Set(["arrowup", "arrowright", "arrowdown", "arrowleft"]);
1139
+ const verticalArrows = /* @__PURE__ */ new Set(["arrowup", "arrowdown"]);
1140
+ const horizontalArrows = /* @__PURE__ */ new Set(["arrowright", "arrowleft"]);
1099
1141
  function eventMatchesClickcombo({ event, clickcombo }) {
1100
1142
  return lazyCollections.every((name) => fromComboItemNameToType(name) === "click" || name.startsWith("!") && !isModified({ alias: name.slice(1), event }) || !name.startsWith("!") && isModified({ alias: name, event }))(clickcombo);
1101
1143
  }
@@ -1120,6 +1162,21 @@ const defaultOptions$6 = {
1120
1162
  alternates: false
1121
1163
  };
1122
1164
  class Animateable {
1165
+ initialDuration;
1166
+ iterationLimit;
1167
+ alternates;
1168
+ controlPoints;
1169
+ reversedControlPoints;
1170
+ toAnimationProgress;
1171
+ reversedToAnimationProgress;
1172
+ playCache;
1173
+ reverseCache;
1174
+ pauseCache;
1175
+ seekCache;
1176
+ alternateCache;
1177
+ visibilitychange;
1178
+ getEaseables;
1179
+ getReversedEaseables;
1123
1180
  constructor(keyframes, options = {}) {
1124
1181
  this.initialDuration = options?.duration || defaultOptions$6.duration;
1125
1182
  this.controlPoints = fromTimingToControlPoints(options?.timing || defaultOptions$6.timing);
@@ -1143,21 +1200,25 @@ class Animateable {
1143
1200
  this.resetProgress();
1144
1201
  this.resetIterations();
1145
1202
  }
1203
+ computedStatus;
1146
1204
  ready() {
1147
1205
  this.computedStatus = "ready";
1148
1206
  }
1207
+ computedTime;
1149
1208
  resetTime() {
1150
1209
  this.computedTime = {
1151
1210
  elapsed: 0,
1152
1211
  remaining: this.duration
1153
1212
  };
1154
1213
  }
1214
+ computedProgress;
1155
1215
  resetProgress() {
1156
1216
  this.computedProgress = {
1157
1217
  time: 0,
1158
1218
  animation: 0
1159
1219
  };
1160
1220
  }
1221
+ computedIterations;
1161
1222
  resetIterations() {
1162
1223
  this.computedIterations = 0;
1163
1224
  }
@@ -1188,6 +1249,11 @@ class Animateable {
1188
1249
  get progress() {
1189
1250
  return this.computedProgress;
1190
1251
  }
1252
+ computedKeyframes;
1253
+ reversedKeyframes;
1254
+ properties;
1255
+ easeables;
1256
+ reversedEaseables;
1191
1257
  setKeyframes(keyframes) {
1192
1258
  this.stop();
1193
1259
  this.computedKeyframes = Array.from(keyframes).sort(({ progress: progressA }, { progress: progressB }) => progressA - progressB);
@@ -1197,6 +1263,9 @@ class Animateable {
1197
1263
  this.reversedEaseables = this.getReversedEaseables({ keyframes: this.reversedKeyframes, properties: this.properties });
1198
1264
  return this;
1199
1265
  }
1266
+ computedPlaybackRate;
1267
+ duration;
1268
+ totalTimeInvisible;
1200
1269
  setPlaybackRate(playbackRate) {
1201
1270
  const ensuredPlaybackRate = Math.max(0, playbackRate);
1202
1271
  this.computedPlaybackRate = ensuredPlaybackRate;
@@ -1342,6 +1411,7 @@ class Animateable {
1342
1411
  reversed() {
1343
1412
  this.computedStatus = "reversed";
1344
1413
  }
1414
+ invisibleAt;
1345
1415
  listenForVisibilitychange() {
1346
1416
  if (this.visibilitychange.active.size === 0) {
1347
1417
  this.totalTimeInvisible = 0;
@@ -1357,6 +1427,7 @@ class Animateable {
1357
1427
  });
1358
1428
  }
1359
1429
  }
1430
+ computedRequest;
1360
1431
  createAnimate(type) {
1361
1432
  return (effect, options = {}) => {
1362
1433
  const { interpolate: interpolateOptions } = options;
@@ -1377,6 +1448,7 @@ class Animateable {
1377
1448
  return this;
1378
1449
  };
1379
1450
  }
1451
+ startTime;
1380
1452
  setStartTimeAndStatus(type, timestamp) {
1381
1453
  switch (type) {
1382
1454
  case "play":
@@ -1743,7 +1815,7 @@ function createGetEaseables(fromKeyframeToControlPoints) {
1743
1815
  };
1744
1816
  }
1745
1817
  function toProperties(keyframes) {
1746
- const properties = new Set();
1818
+ const properties = /* @__PURE__ */ new Set();
1747
1819
  for (const keyframe of keyframes) {
1748
1820
  for (const property in keyframe.properties) {
1749
1821
  if (!properties.has(property)) {
@@ -1768,7 +1840,7 @@ function fromControlPointsToReversedControlPoints(points) {
1768
1840
  }
1769
1841
  function createToAnimationProgress(points) {
1770
1842
  const { 0: { x: point1x, y: point1y }, 1: { x: point2x, y: point2y } } = points;
1771
- return BezierEasing__default['default'](point1x, point1y, point2x, point2y);
1843
+ return BezierEasing__default["default"](point1x, point1y, point2x, point2y);
1772
1844
  }
1773
1845
  function toInterpolated({ previous, next, progress }, options = {}) {
1774
1846
  if (isUndefined(previous)) {
@@ -1786,7 +1858,7 @@ function toInterpolated({ previous, next, progress }, options = {}) {
1786
1858
  }
1787
1859
  if (isArray(previous) && isArray(next)) {
1788
1860
  const exactSliceEnd = (next.length - previous.length) * progress + previous.length, nextIsLonger = next.length > previous.length, sliceEnd = nextIsLonger ? Math.floor(exactSliceEnd) : Math.ceil(exactSliceEnd), sliceTarget = nextIsLonger ? next : previous;
1789
- return createSlice({ from: 0, to: sliceEnd })(sliceTarget);
1861
+ return createSlice(0, sliceEnd)(sliceTarget);
1790
1862
  }
1791
1863
  }
1792
1864
  const linear = [
@@ -1981,6 +2053,10 @@ const defaultCompleteOptions = {
1981
2053
  select: "completionEnd"
1982
2054
  };
1983
2055
  class Completeable {
2056
+ segmentFrom;
2057
+ segmentTo;
2058
+ divider;
2059
+ computedDividerIndices;
1984
2060
  constructor(string, options = {}) {
1985
2061
  this.constructing();
1986
2062
  this.segmentFrom = options?.segment?.from || defaultOptions$5.segment.from;
@@ -1994,6 +2070,7 @@ class Completeable {
1994
2070
  constructing() {
1995
2071
  this.computedStatus = "constructing";
1996
2072
  }
2073
+ computedStatus;
1997
2074
  ready() {
1998
2075
  this.computedStatus = "ready";
1999
2076
  }
@@ -2038,6 +2115,7 @@ class Completeable {
2038
2115
  return this.dividerIndices.after;
2039
2116
  }
2040
2117
  }
2118
+ computedString;
2041
2119
  setString(string) {
2042
2120
  this.computedString = string;
2043
2121
  switch (this.status) {
@@ -2049,6 +2127,7 @@ class Completeable {
2049
2127
  }
2050
2128
  return this;
2051
2129
  }
2130
+ computedSelection;
2052
2131
  setSelection(selection) {
2053
2132
  this.computedSelection = selection;
2054
2133
  this.setDividerIndices();
@@ -2135,6 +2214,10 @@ function toNextMatch({ string, re, from }) {
2135
2214
  }
2136
2215
 
2137
2216
  class Copyable {
2217
+ computedIsClipboardText;
2218
+ copyListenable;
2219
+ cutListenable;
2220
+ copyAndCutEffect;
2138
2221
  constructor(string, options = {}) {
2139
2222
  this.computedIsClipboardText = false;
2140
2223
  this.copyListenable = new Listenable("copy");
@@ -2146,6 +2229,7 @@ class Copyable {
2146
2229
  this.setString(string);
2147
2230
  this.ready();
2148
2231
  }
2232
+ computedStatus;
2149
2233
  ready() {
2150
2234
  this.computedStatus = "ready";
2151
2235
  }
@@ -2167,10 +2251,13 @@ class Copyable {
2167
2251
  get error() {
2168
2252
  return this.computedError;
2169
2253
  }
2254
+ computedString;
2170
2255
  setString(string) {
2171
2256
  this.computedString = string;
2172
2257
  return this;
2173
2258
  }
2259
+ computedResponse;
2260
+ computedError;
2174
2261
  async copy(options = { type: "clipboard" }) {
2175
2262
  this.copying();
2176
2263
  const { type } = options;
@@ -2223,6 +2310,7 @@ const defaultOptions$4 = {
2223
2310
  executions: 1
2224
2311
  };
2225
2312
  class Delayable {
2313
+ animateable;
2226
2314
  constructor(effect, options = {}) {
2227
2315
  this.animateable = new Animateable([
2228
2316
  { progress: 0, properties: { progress: 0 } },
@@ -2234,6 +2322,7 @@ class Delayable {
2234
2322
  this.setEffect(effect);
2235
2323
  this.ready();
2236
2324
  }
2325
+ computedStatus;
2237
2326
  ready() {
2238
2327
  this.computedStatus = "ready";
2239
2328
  }
@@ -2255,12 +2344,14 @@ class Delayable {
2255
2344
  get progress() {
2256
2345
  return this.animateable.progress.time;
2257
2346
  }
2347
+ computedEffect;
2258
2348
  setEffect(effect) {
2259
2349
  this.stop();
2260
2350
  this.computedEffect = effect;
2261
2351
  this.setFrameEffect(effect);
2262
2352
  return this;
2263
2353
  }
2354
+ frameEffect;
2264
2355
  setFrameEffect(effect) {
2265
2356
  this.frameEffect = (frame) => {
2266
2357
  const { properties: { progress }, timestamp } = frame;
@@ -2363,6 +2454,7 @@ class Dispatchable {
2363
2454
  this.setType(type);
2364
2455
  this.ready();
2365
2456
  }
2457
+ computedStatus;
2366
2458
  ready() {
2367
2459
  this.computedStatus = "ready";
2368
2460
  }
@@ -2378,10 +2470,12 @@ class Dispatchable {
2378
2470
  get status() {
2379
2471
  return this.computedStatus;
2380
2472
  }
2473
+ computedType;
2381
2474
  setType(type) {
2382
2475
  this.computedType = type;
2383
2476
  return this;
2384
2477
  }
2478
+ computedCancelled;
2385
2479
  dispatch(options = {}) {
2386
2480
  const { target = window, ...rest } = options, event = toEvent(this.type, rest);
2387
2481
  this.computedCancelled = !target.dispatchEvent(event);
@@ -2397,11 +2491,14 @@ const defaultOptions$3 = {
2397
2491
  toD: (stroke) => stroke.length === 0 ? "" : toD(stroke)
2398
2492
  };
2399
2493
  class Drawable {
2494
+ computedD;
2495
+ toD;
2400
2496
  constructor(stroke, options = {}) {
2401
2497
  this.toD = options?.toD || defaultOptions$3.toD;
2402
2498
  this.setStroke(stroke);
2403
2499
  this.ready();
2404
2500
  }
2501
+ computedStatus;
2405
2502
  ready() {
2406
2503
  this.computedStatus = "ready";
2407
2504
  }
@@ -2417,6 +2514,7 @@ class Drawable {
2417
2514
  get d() {
2418
2515
  return this.computedD;
2419
2516
  }
2517
+ computedStroke;
2420
2518
  setStroke(stroke) {
2421
2519
  this.computedStroke = stroke;
2422
2520
  this.computedD = this.toD(stroke);
@@ -2445,7 +2543,7 @@ function toFlattenedD(stroke) {
2445
2543
  if (stroke.length === 0) {
2446
2544
  return "";
2447
2545
  }
2448
- const multiPolygon = polygonClipping__default['default'].union([stroke]);
2546
+ const multiPolygon = polygonClipping__default["default"].union([stroke]);
2449
2547
  return createReduce((dFromMultiPolygon, polygon) => {
2450
2548
  return dFromMultiPolygon + createReduce((dFromRing, points) => {
2451
2549
  return dFromRing + toD(points);
@@ -2458,6 +2556,7 @@ class Resolveable {
2458
2556
  this.setGetPromise(getPromise);
2459
2557
  this.ready();
2460
2558
  }
2559
+ computedStatus;
2461
2560
  ready() {
2462
2561
  this.computedStatus = "ready";
2463
2562
  }
@@ -2473,10 +2572,12 @@ class Resolveable {
2473
2572
  get value() {
2474
2573
  return this.computedValue;
2475
2574
  }
2575
+ computedGetPromise;
2476
2576
  setGetPromise(getPromise) {
2477
2577
  this.computedGetPromise = getPromise;
2478
2578
  return this;
2479
2579
  }
2580
+ computedValue;
2480
2581
  async resolve(...args) {
2481
2582
  this.resolving();
2482
2583
  try {
@@ -2501,6 +2602,11 @@ class Resolveable {
2501
2602
  }
2502
2603
 
2503
2604
  class Fetchable {
2605
+ computedArrayBuffer;
2606
+ computedBlob;
2607
+ computedFormData;
2608
+ computedJson;
2609
+ computedText;
2504
2610
  constructor(resource, options = {}) {
2505
2611
  this.setResource(resource);
2506
2612
  this.computedArrayBuffer = new Resolveable(async () => "arrayBuffer" in this.response ? await this.response.arrayBuffer() : await void 0);
@@ -2510,6 +2616,7 @@ class Fetchable {
2510
2616
  this.computedText = new Resolveable(async () => "text" in this.response ? await this.response.text() : await void 0);
2511
2617
  this.ready();
2512
2618
  }
2619
+ computedStatus;
2513
2620
  ready() {
2514
2621
  this.computedStatus = "ready";
2515
2622
  }
@@ -2519,6 +2626,7 @@ class Fetchable {
2519
2626
  set resource(resource) {
2520
2627
  this.setResource(resource);
2521
2628
  }
2629
+ computedAbortController;
2522
2630
  get abortController() {
2523
2631
  if (!this.computedAbortController) {
2524
2632
  this.computedAbortController = new AbortController();
@@ -2564,10 +2672,13 @@ class Fetchable {
2564
2672
  return resolveable;
2565
2673
  }
2566
2674
  }
2675
+ computedResource;
2567
2676
  setResource(resource) {
2568
2677
  this.computedResource = resource;
2569
2678
  return this;
2570
2679
  }
2680
+ computedResponse;
2681
+ computedError;
2571
2682
  async fetch(options = {}) {
2572
2683
  this.computedStatus = "fetching";
2573
2684
  try {
@@ -2622,6 +2733,7 @@ class Fullscreenable {
2622
2733
  this.setGetElement(getElement);
2623
2734
  this.ready();
2624
2735
  }
2736
+ computedStatus;
2625
2737
  ready() {
2626
2738
  this.computedStatus = "ready";
2627
2739
  }
@@ -2640,6 +2752,7 @@ class Fullscreenable {
2640
2752
  get error() {
2641
2753
  return this.computedError;
2642
2754
  }
2755
+ computedGetElement;
2643
2756
  setGetElement(getElement) {
2644
2757
  this.computedGetElement = () => getElement();
2645
2758
  return this;
@@ -2648,6 +2761,7 @@ class Fullscreenable {
2648
2761
  await this.fullscreen(options);
2649
2762
  return this;
2650
2763
  }
2764
+ computedError;
2651
2765
  async fullscreen(options = {}) {
2652
2766
  try {
2653
2767
  await this.element.requestFullscreen(options);
@@ -2684,6 +2798,7 @@ class Grantable {
2684
2798
  this.setDescriptor(descriptor);
2685
2799
  this.ready();
2686
2800
  }
2801
+ computedStatus;
2687
2802
  ready() {
2688
2803
  this.computedStatus = "ready";
2689
2804
  }
@@ -2699,10 +2814,12 @@ class Grantable {
2699
2814
  get status() {
2700
2815
  return this.computedStatus;
2701
2816
  }
2817
+ computedDescriptor;
2702
2818
  setDescriptor(descriptor) {
2703
2819
  this.computedDescriptor = descriptor;
2704
2820
  return this;
2705
2821
  }
2822
+ computedPermission;
2706
2823
  async query() {
2707
2824
  this.querying();
2708
2825
  try {
@@ -2739,15 +2856,18 @@ class Navigateable {
2739
2856
  this.navigate(options?.initialLocation ?? defaultOptions$2.initialLocation);
2740
2857
  this.ready();
2741
2858
  }
2859
+ computedStatus;
2742
2860
  ready() {
2743
2861
  this.computedStatus = "ready";
2744
2862
  }
2863
+ computedArray;
2745
2864
  get array() {
2746
2865
  return this.computedArray;
2747
2866
  }
2748
2867
  set array(value) {
2749
2868
  this.setArray(value);
2750
2869
  }
2870
+ computedLocation;
2751
2871
  get location() {
2752
2872
  return this.computedLocation;
2753
2873
  }
@@ -2871,29 +2991,33 @@ const defaultOptions$1 = {
2871
2991
  };
2872
2992
  class Pickable {
2873
2993
  constructor(array, options = {}) {
2874
- this.toItems = createMap((index) => this.array[index]);
2875
2994
  this.setArray(array);
2876
2995
  this.pick(options.initialPicks ?? defaultOptions$1.initialPicks);
2877
2996
  this.ready();
2878
2997
  }
2998
+ computedStatus;
2879
2999
  ready() {
2880
3000
  this.computedStatus = "ready";
2881
3001
  }
3002
+ computedArray;
2882
3003
  get array() {
2883
3004
  return this.computedArray;
2884
3005
  }
2885
3006
  set array(array) {
2886
3007
  this.setArray(array);
2887
3008
  }
3009
+ computedPicks;
2888
3010
  get picks() {
2889
3011
  return this.computedPicks;
2890
3012
  }
2891
3013
  set picks(indices) {
2892
3014
  this.pick(indices);
2893
3015
  }
3016
+ computedFirst;
2894
3017
  get first() {
2895
3018
  return this.computedFirst;
2896
3019
  }
3020
+ computedLast;
2897
3021
  get last() {
2898
3022
  return this.computedLast;
2899
3023
  }
@@ -2909,9 +3033,11 @@ class Pickable {
2909
3033
  get items() {
2910
3034
  return this.toItems(this.picks);
2911
3035
  }
3036
+ toItems = createMap((index) => this.array[index]);
2912
3037
  get multiple() {
2913
3038
  return this.picks.length > 1;
2914
3039
  }
3040
+ toPossiblePicks;
2915
3041
  setArray(array) {
2916
3042
  this.computedArray = array;
2917
3043
  this.toPossiblePicks = createFilter((index) => index >= 0 && index < array.length);
@@ -2926,7 +3052,7 @@ class Pickable {
2926
3052
  if (replace === "all") {
2927
3053
  return toUnique(possiblePicks);
2928
3054
  }
2929
- const possibleWithoutDuplicates = createFilter((possiblePick) => !lazyCollections.find((pick) => pick === possiblePick)(this.picks || []))(possiblePicks);
3055
+ const possibleWithoutDuplicates = createFilter((possiblePick) => typeof lazyCollections.find((pick) => pick === possiblePick)(this.picks || []) !== "number")(possiblePicks);
2930
3056
  switch (replace) {
2931
3057
  case "none":
2932
3058
  return createConcat(this.picks || [], possibleWithoutDuplicates)([]);
@@ -2938,9 +3064,9 @@ class Pickable {
2938
3064
  return possibleWithoutDuplicates;
2939
3065
  }
2940
3066
  if (possibleWithoutDuplicates.length > this.picks.length) {
2941
- return createSlice({ from: possibleWithoutDuplicates.length - this.picks.length })(possibleWithoutDuplicates);
3067
+ return createSlice(possibleWithoutDuplicates.length - this.picks.length)(possibleWithoutDuplicates);
2942
3068
  }
2943
- return new Pipeable(this.picks).pipe(createSlice({ from: possibleWithoutDuplicates.length }), createConcat(possibleWithoutDuplicates));
3069
+ return new Pipeable(this.picks).pipe(createSlice(possibleWithoutDuplicates.length), createConcat(possibleWithoutDuplicates));
2944
3070
  case "lifo":
2945
3071
  if (possibleWithoutDuplicates.length === 0) {
2946
3072
  return this.picks;
@@ -2949,9 +3075,9 @@ class Pickable {
2949
3075
  return possibleWithoutDuplicates;
2950
3076
  }
2951
3077
  if (possibleWithoutDuplicates.length > this.picks.length) {
2952
- return createSlice({ from: 0, to: possibleWithoutDuplicates.length - this.picks.length + 1 })(possibleWithoutDuplicates);
3078
+ return createSlice(0, possibleWithoutDuplicates.length - this.picks.length + 1)(possibleWithoutDuplicates);
2953
3079
  }
2954
- return new Pipeable(this.picks).pipe(createSlice({ from: 0, to: this.picks.length - possibleWithoutDuplicates.length }), createConcat(possibleWithoutDuplicates));
3080
+ return new Pipeable(this.picks).pipe(createSlice(0, this.picks.length - possibleWithoutDuplicates.length), createConcat(possibleWithoutDuplicates));
2955
3081
  }
2956
3082
  });
2957
3083
  this.computedFirst = Math.min(...this.picks);
@@ -2987,14 +3113,17 @@ function ensureIndices(indexOrIndices) {
2987
3113
  const toUnique = createUnique();
2988
3114
 
2989
3115
  class Sanitizeable {
3116
+ domPurifyConfig;
2990
3117
  constructor(html, options) {
2991
3118
  this.computedHtml = html;
2992
3119
  this.domPurifyConfig = options;
2993
3120
  this.ready();
2994
3121
  }
3122
+ computedDompurify;
3123
+ computedStatus;
2995
3124
  ready() {
2996
3125
  if (domIsAvailable()) {
2997
- this.computedDompurify = createDOMPurify__default['default']();
3126
+ this.computedDompurify = createDOMPurify__default["default"]();
2998
3127
  this.computedDompurify.setConfig(this.domPurifyConfig);
2999
3128
  }
3000
3129
  this.computedStatus = "ready";
@@ -3007,7 +3136,7 @@ class Sanitizeable {
3007
3136
  }
3008
3137
  get dompurify() {
3009
3138
  if (!this.computedDompurify && domIsAvailable()) {
3010
- this.computedDompurify = createDOMPurify__default['default']();
3139
+ this.computedDompurify = createDOMPurify__default["default"]();
3011
3140
  this.computedDompurify.setConfig(this.domPurifyConfig);
3012
3141
  }
3013
3142
  return this.computedDompurify;
@@ -3015,6 +3144,7 @@ class Sanitizeable {
3015
3144
  get status() {
3016
3145
  return this.computedStatus;
3017
3146
  }
3147
+ computedHtml;
3018
3148
  setHtml(html) {
3019
3149
  this.computedHtml = html;
3020
3150
  return this;
@@ -3030,15 +3160,19 @@ class Sanitizeable {
3030
3160
  }
3031
3161
 
3032
3162
  class Searchable {
3163
+ searcherOptions;
3164
+ computedResults;
3033
3165
  constructor(candidates, options = {}) {
3034
3166
  this.searcherOptions = options;
3035
3167
  this.setCandidates(candidates);
3036
3168
  this.computedResults = [];
3037
3169
  this.ready();
3038
3170
  }
3171
+ computedStatus;
3039
3172
  ready() {
3040
3173
  this.computedStatus = "ready";
3041
3174
  }
3175
+ computedCandidates;
3042
3176
  get candidates() {
3043
3177
  return this.computedCandidates;
3044
3178
  }
@@ -3054,6 +3188,7 @@ class Searchable {
3054
3188
  get status() {
3055
3189
  return this.computedStatus;
3056
3190
  }
3191
+ computedSearcher;
3057
3192
  setCandidates(candidates) {
3058
3193
  this.computedCandidates = Array.from(candidates);
3059
3194
  this.computedSearcher = new fastFuzzy.Searcher(candidates, this.searcherOptions);
@@ -3074,6 +3209,8 @@ const defaultOptions = {
3074
3209
  statusKeySuffix: " status"
3075
3210
  };
3076
3211
  class Storeable {
3212
+ type;
3213
+ statusKeySuffix;
3077
3214
  constructor(key, options = {}) {
3078
3215
  this.constructing();
3079
3216
  this.type = options.type ?? defaultOptions.type;
@@ -3084,6 +3221,7 @@ class Storeable {
3084
3221
  constructing() {
3085
3222
  this.computedStatus = "constructing";
3086
3223
  }
3224
+ computedStatus;
3087
3225
  ready() {
3088
3226
  this.computedStatus = "ready";
3089
3227
  if (domIsAvailable()) {
@@ -3121,6 +3259,8 @@ class Storeable {
3121
3259
  get error() {
3122
3260
  return this.computedError;
3123
3261
  }
3262
+ computedKey;
3263
+ computedStatusKey;
3124
3264
  setKey(key) {
3125
3265
  let string;
3126
3266
  switch (this.status) {
@@ -3146,6 +3286,8 @@ class Storeable {
3146
3286
  }
3147
3287
  return this;
3148
3288
  }
3289
+ computedString;
3290
+ computedError;
3149
3291
  store(string) {
3150
3292
  try {
3151
3293
  this.storage.setItem(this.key, string);
@@ -3220,6 +3362,7 @@ exports.createReplace = createReplace;
3220
3362
  exports.createReverse = createReverse;
3221
3363
  exports.createSlice = createSlice;
3222
3364
  exports.createSlug = createSlug;
3365
+ exports.createSort = createSort;
3223
3366
  exports.createSwap = createSwap;
3224
3367
  exports.createToEntries = createToEntries;
3225
3368
  exports.createUnique = createUnique;