native-document 1.0.17 โ†’ 1.0.19

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.
@@ -1,35 +1,41 @@
1
1
  var NativeDocument = (function (exports) {
2
2
  'use strict';
3
3
 
4
- const DebugManager = {
5
- enabled: false,
4
+ let DebugManager = {};
6
5
 
7
- enable() {
8
- this.enabled = true;
9
- console.log('๐Ÿ” NativeDocument Debug Mode enabled');
10
- },
6
+ {
7
+ DebugManager = {
8
+ enabled: false,
11
9
 
12
- disable() {
13
- this.enabled = false;
14
- },
10
+ enable() {
11
+ this.enabled = true;
12
+ console.log('๐Ÿ” NativeDocument Debug Mode enabled');
13
+ },
15
14
 
16
- log(category, message, data) {
17
- if (!this.enabled) return;
18
- console.group(`๐Ÿ” [${category}] ${message}`);
19
- if (data) console.log(data);
20
- console.trace();
21
- console.groupEnd();
22
- },
15
+ disable() {
16
+ this.enabled = false;
17
+ },
23
18
 
24
- warn(category, message, data) {
25
- if (!this.enabled) return;
26
- console.warn(`โš ๏ธ [${category}] ${message}`, data);
27
- },
19
+ log(category, message, data) {
20
+ if (!this.enabled) return;
21
+ console.group(`๐Ÿ” [${category}] ${message}`);
22
+ if (data) console.log(data);
23
+ console.trace();
24
+ console.groupEnd();
25
+ },
28
26
 
29
- error(category, message, error) {
30
- console.error(`โŒ [${category}] ${message}`, error);
31
- }
32
- };
27
+ warn(category, message, data) {
28
+ if (!this.enabled) return;
29
+ console.warn(`โš ๏ธ [${category}] ${message}`, data);
30
+ },
31
+
32
+ error(category, message, error) {
33
+ console.error(`โŒ [${category}] ${message}`, error);
34
+ }
35
+ };
36
+
37
+ }
38
+ var DebugManager$1 = DebugManager;
33
39
 
34
40
  const MemoryManager = (function() {
35
41
 
@@ -78,7 +84,7 @@ var NativeDocument = (function (exports) {
78
84
  }
79
85
  }
80
86
  if (cleanedCount > 0) {
81
- DebugManager.log('Memory Auto Clean', `๐Ÿงน Cleaned ${cleanedCount} orphaned observables`);
87
+ DebugManager$1.log('Memory Auto Clean', `๐Ÿงน Cleaned ${cleanedCount} orphaned observables`);
82
88
  }
83
89
  }
84
90
  };
@@ -264,7 +270,7 @@ var NativeDocument = (function (exports) {
264
270
  ObservableItem.prototype.subscribe = function(callback) {
265
271
  this.$listeners = this.$listeners ?? [];
266
272
  if (this.$isCleanedUp) {
267
- DebugManager.warn('Observable subscription', 'โš ๏ธ Attempted to subscribe to a cleaned up observable.');
273
+ DebugManager$1.warn('Observable subscription', 'โš ๏ธ Attempted to subscribe to a cleaned up observable.');
268
274
  return () => {};
269
275
  }
270
276
  if (typeof callback !== 'function') {
@@ -324,38 +330,6 @@ var NativeDocument = (function (exports) {
324
330
  return '{{#ObItem::(' +this.$memoryId+ ')}}';
325
331
  };
326
332
 
327
- const invoke = function(fn, args, context) {
328
- if(context) {
329
- fn.apply(context, args);
330
- } else {
331
- fn(...args);
332
- }
333
- };
334
- /**
335
- *
336
- * @param {Function} fn
337
- * @param {number} delay
338
- * @param {{leading?:Boolean, trailing?:Boolean, debounce?:Boolean, check: Function}}options
339
- * @returns {(function(...[*]): void)|*}
340
- */
341
- const debounce = function(fn, delay, options = {}) {
342
- let timer = null;
343
- let lastArgs = null;
344
-
345
- return function(...args) {
346
- const context = options.context === true ? this : null;
347
- if(options.check) {
348
- options.check(...args);
349
- }
350
- lastArgs = args;
351
-
352
- // debounce mode: reset the timer for each call
353
- clearTimeout(timer);
354
- timer = setTimeout(() => invoke(fn, lastArgs, context), delay);
355
- }
356
- };
357
-
358
-
359
333
  /**
360
334
  *
361
335
  * @param {*} item
@@ -385,7 +359,7 @@ var NativeDocument = (function (exports) {
385
359
  unmounted: new WeakMap(),
386
360
  unmountedSupposedSize: 0,
387
361
  observer: null,
388
- checkMutation: debounce(function(mutationsList) {
362
+ checkMutation: function(mutationsList) {
389
363
  for(const mutation of mutationsList) {
390
364
  if(DocumentObserver.mountedSupposedSize > 0 ) {
391
365
  for(const node of mutation.addedNodes) {
@@ -413,7 +387,7 @@ var NativeDocument = (function (exports) {
413
387
  }
414
388
  }
415
389
  }
416
- }, 16),
390
+ },
417
391
  /**
418
392
  *
419
393
  * @param {HTMLElement} element
@@ -601,6 +575,12 @@ var NativeDocument = (function (exports) {
601
575
  return this.lifecycle({ unmounted: callback });
602
576
  };
603
577
 
578
+ NDElement.prototype.htmlElement = function() {
579
+ return this.$element;
580
+ };
581
+
582
+ NDElement.prototype.node = NDElement.prototype.htmlElement;
583
+
604
584
  const Validator = {
605
585
  isObservable(value) {
606
586
  return value instanceof ObservableItem || value instanceof ObservableChecker;
@@ -706,7 +686,7 @@ var NativeDocument = (function (exports) {
706
686
  const foundReserved = Object.keys(attributes).filter(key => reserved.includes(key));
707
687
 
708
688
  if (foundReserved.length > 0) {
709
- DebugManager.warn('Validator', `Reserved attributes found: ${foundReserved.join(', ')}`);
689
+ DebugManager$1.warn('Validator', `Reserved attributes found: ${foundReserved.join(', ')}`);
710
690
  }
711
691
 
712
692
  return attributes;
@@ -750,7 +730,7 @@ var NativeDocument = (function (exports) {
750
730
  element.appendChild = function(child, before = null) {
751
731
  const parent = anchorEnd.parentNode;
752
732
  if(!parent) {
753
- DebugManager.error('Anchor', 'Anchor : parent not found', child);
733
+ DebugManager$1.error('Anchor', 'Anchor : parent not found', child);
754
734
  return;
755
735
  }
756
736
  before = before ?? anchorEnd;
@@ -1182,7 +1162,7 @@ var NativeDocument = (function (exports) {
1182
1162
 
1183
1163
  return ElementCreator.setup(finalElement, attributes, customWrapper);
1184
1164
  } catch (error) {
1185
- DebugManager.error('ElementCreation', `Error creating ${$tagName}`, error);
1165
+ DebugManager$1.error('ElementCreation', `Error creating ${$tagName}`, error);
1186
1166
  }
1187
1167
  };
1188
1168
  }
@@ -1690,7 +1670,7 @@ var NativeDocument = (function (exports) {
1690
1670
  let child = ElementCreator.getChild(callback(item, indexObserver));
1691
1671
  cache.set(keyId, { keyId, isNew: true, child: new WeakRef(child), indexObserver});
1692
1672
  } catch (e) {
1693
- DebugManager.error('ForEach', `Error creating element for key ${keyId}` , e);
1673
+ DebugManager$1.error('ForEach', `Error creating element for key ${keyId}` , e);
1694
1674
  throw e;
1695
1675
  }
1696
1676
  return keyId;
@@ -1868,7 +1848,7 @@ var NativeDocument = (function (exports) {
1868
1848
  }
1869
1849
  return child;
1870
1850
  } catch (e) {
1871
- DebugManager.error('ForEach', `Error creating element for key ${keyId}` , e);
1851
+ DebugManager$1.error('ForEach', `Error creating element for key ${keyId}` , e);
1872
1852
  throw e;
1873
1853
  }
1874
1854
  };
@@ -2073,7 +2053,7 @@ var NativeDocument = (function (exports) {
2073
2053
  */
2074
2054
  const ShowIf = function(condition, child, comment = null) {
2075
2055
  if(!(Validator.isObservable(condition))) {
2076
- return DebugManager.warn('ShowIf', "ShowIf : condition must be an Observable / "+comment, condition);
2056
+ return DebugManager$1.warn('ShowIf', "ShowIf : condition must be an Observable / "+comment, condition);
2077
2057
  }
2078
2058
  const element = new Anchor('Show if : '+(comment || ''));
2079
2059
 
@@ -2803,7 +2783,7 @@ var NativeDocument = (function (exports) {
2803
2783
  window.history.pushState({ name: route.name(), params, path}, route.name() || path , path);
2804
2784
  this.handleRouteChange(route, params, query, path);
2805
2785
  } catch (e) {
2806
- DebugManager.error('HistoryRouter', 'Error in pushState', e);
2786
+ DebugManager$1.error('HistoryRouter', 'Error in pushState', e);
2807
2787
  }
2808
2788
  };
2809
2789
  /**
@@ -2816,7 +2796,7 @@ var NativeDocument = (function (exports) {
2816
2796
  window.history.replaceState({ name: route.name(), params, path}, route.name() || path , path);
2817
2797
  this.handleRouteChange(route, params, {}, path);
2818
2798
  } catch(e) {
2819
- DebugManager.error('HistoryRouter', 'Error in replaceState', e);
2799
+ DebugManager$1.error('HistoryRouter', 'Error in replaceState', e);
2820
2800
  }
2821
2801
  };
2822
2802
  this.forward = function() {
@@ -2843,7 +2823,7 @@ var NativeDocument = (function (exports) {
2843
2823
  }
2844
2824
  this.handleRouteChange(route, params, query, path);
2845
2825
  } catch(e) {
2846
- DebugManager.error('HistoryRouter', 'Error in popstate event', e);
2826
+ DebugManager$1.error('HistoryRouter', 'Error in popstate event', e);
2847
2827
  }
2848
2828
  });
2849
2829
  const { route, params, query, path } = this.resolve(defaultPath || (window.location.pathname+window.location.search));
@@ -2992,7 +2972,7 @@ var NativeDocument = (function (exports) {
2992
2972
  listener(request);
2993
2973
  next && next(request);
2994
2974
  } catch (e) {
2995
- DebugManager.warn('Route Listener', 'Error in listener:', e);
2975
+ DebugManager$1.warn('Route Listener', 'Error in listener:', e);
2996
2976
  }
2997
2977
  }
2998
2978
  };
@@ -3150,7 +3130,7 @@ var NativeDocument = (function (exports) {
3150
3130
  */
3151
3131
  Router.create = function(options, callback) {
3152
3132
  if(!Validator.isFunction(callback)) {
3153
- DebugManager.error('Router', 'Callback must be a function', e);
3133
+ DebugManager$1.error('Router', 'Callback must be a function', e);
3154
3134
  throw new RouterError('Callback must be a function');
3155
3135
  }
3156
3136
  const router = new Router(options);
@@ -3234,6 +3214,7 @@ var NativeDocument = (function (exports) {
3234
3214
  exports.ArgTypes = ArgTypes;
3235
3215
  exports.ElementCreator = ElementCreator;
3236
3216
  exports.HtmlElementWrapper = HtmlElementWrapper;
3217
+ exports.NDElement = NDElement;
3237
3218
  exports.Observable = Observable;
3238
3219
  exports.Store = Store;
3239
3220
  exports.elements = elements;
@@ -3243,3 +3224,4 @@ var NativeDocument = (function (exports) {
3243
3224
  return exports;
3244
3225
 
3245
3226
  })({});
3227
+ //# sourceMappingURL=native-document.dev.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-document.dev.js","sources":["../src/utils/debug-manager.js","../src/data/MemoryManager.js","../src/errors/NativeDocumentError.js","../src/data/ObservableChecker.js","../src/data/ObservableItem.js","../src/utils/helpers.js","../src/wrappers/DocumentObserver.js","../src/utils/events.js","../src/wrappers/NDElement.js","../src/utils/validator.js","../src/elements/anchor.js","../src/wrappers/constants.js","../src/data/Observable.js","../src/wrappers/AttributesWrapper.js","../src/wrappers/ElementCreator.js","../src/wrappers/NdPrototype.js","../src/wrappers/HtmlElementWrapper.js","../src/errors/ArgTypesError.js","../src/utils/args-types.js","../src/utils/prototypes.js","../src/data/observable-helpers/array.js","../src/data/observable-helpers/batch.js","../src/data/observable-helpers/object.js","../src/data/observable-helpers/computed.js","../src/data/Store.js","../src/elements/control/for-each.js","../src/elements/control/for-each-array.js","../src/elements/control/show-if.js","../src/elements/control/switch.js","../src/elements/content-formatter.js","../src/elements/description-list.js","../src/elements/form.js","../src/elements/html5-semantics.js","../src/elements/img.js","../src/elements/interactive.js","../src/elements/list.js","../src/elements/medias.js","../src/elements/meta-data.js","../src/elements/table.js","../src/elements/index.js","../src/router/Route.js","../src/errors/RouterError.js","../src/router/RouteGroupHelper.js","../src/router/modes/HashRouter.js","../src/router/modes/HistoryRouter.js","../src/router/modes/MemoryRouter.js","../src/router/RouterComponent.js","../src/router/Router.js","../src/router/link.js"],"sourcesContent":["let DebugManager = {};\n\nif(process.env.NODE_ENV === 'development') {\n DebugManager = {\n enabled: false,\n\n enable() {\n this.enabled = true;\n console.log('๐Ÿ” NativeDocument Debug Mode enabled');\n },\n\n disable() {\n this.enabled = false;\n },\n\n log(category, message, data) {\n if (!this.enabled) return;\n console.group(`๐Ÿ” [${category}] ${message}`);\n if (data) console.log(data);\n console.trace();\n console.groupEnd();\n },\n\n warn(category, message, data) {\n if (!this.enabled) return;\n console.warn(`โš ๏ธ [${category}] ${message}`, data);\n },\n\n error(category, message, error) {\n console.error(`โŒ [${category}] ${message}`, error);\n }\n };\n\n}\nif(process.env.NODE_ENV === 'production') {\n DebugManager = {\n log() {},\n warn() {},\n error() {},\n disable() {}\n };\n}\nexport default DebugManager;","import DebugManager from \"../utils/debug-manager\";\nimport Validator from \"../utils/validator\";\n\n\nconst MemoryManager = (function() {\n\n let $nextObserverId = 0;\n const $observables = new Map();\n\n return {\n /**\n * Register an observable and return an id.\n *\n * @param {ObservableItem} observable\n * @param {Function} getListeners\n * @returns {number}\n */\n register(observable) {\n const id = ++$nextObserverId;\n $observables.set(id, new WeakRef(observable));\n return id;\n },\n unregister(id) {\n $observables.delete(id);\n },\n getObservableById(id) {\n return $observables.get(id)?.deref();\n },\n cleanup() {\n for (const [_, weakObservableRef] of $observables) {\n const observable = weakObservableRef.deref();\n if (observable) {\n observable.cleanup();\n }\n }\n $observables.clear();\n },\n /**\n * Clean observables that are not referenced anymore.\n * @param {number} threshold\n */\n cleanObservables(threshold) {\n if($observables.size < threshold) return;\n let cleanedCount = 0;\n for (const [id, weakObservableRef] of $observables) {\n if (!weakObservableRef.deref()) {\n $observables.delete(id);\n cleanedCount++;\n }\n }\n if (cleanedCount > 0) {\n DebugManager.log('Memory Auto Clean', `๐Ÿงน Cleaned ${cleanedCount} orphaned observables`);\n }\n }\n };\n}());\n\nexport default MemoryManager;","export default class NativeDocumentError extends Error {\n constructor(message, context = {}) {\n super(message);\n this.name = 'NativeDocumentError';\n this.context = context;\n this.timestamp = new Date().toISOString();\n }\n}","/**\n *\n * @param {ObservableItem} $observable\n * @param {Function} $checker\n * @class ObservableChecker\n */\nexport default function ObservableChecker($observable, $checker) {\n this.observable = $observable;\n this.checker = $checker;\n this.unSubscriptions = [];\n}\n\nObservableChecker.prototype.subscribe = function(callback) {\n const unSubscribe = this.observable.subscribe((value) => {\n callback && callback(this.checker(value));\n });\n this.unSubscriptions.push(unSubscribe);\n return unSubscribe;\n};\n\nObservableChecker.prototype.check = function(callback) {\n return this.observable.check(() => callback(this.val()));\n}\n\nObservableChecker.prototype.val = function() {\n return this.checker && this.checker(this.observable.val());\n}\n\nObservableChecker.prototype.set = function(value) {\n return this.observable.set(value);\n};\n\nObservableChecker.prototype.trigger = function() {\n return this.observable.trigger();\n};\n\nObservableChecker.prototype.cleanup = function() {\n return this.observable.cleanup();\n};","import DebugManager from \"../utils/debug-manager\";\nimport MemoryManager from \"./MemoryManager\";\nimport NativeDocumentError from \"../errors/NativeDocumentError\";\nimport ObservableChecker from \"./ObservableChecker\";\n\n/**\n *\n * @param {*} value\n * @class ObservableItem\n */\nexport default function ObservableItem(value) {\n if (value === undefined) {\n throw new NativeDocumentError('ObservableItem requires an initial value');\n }\n if(value instanceof ObservableItem) {\n throw new NativeDocumentError('ObservableItem cannot be an Observable');\n }\n\n this.$previousValue = value;\n this.$currentValue = value;\n this.$isCleanedUp = false;\n\n this.$listeners = null;\n this.$watchers = null;\n\n this.$memoryId = MemoryManager.register(this);\n}\n\nObject.defineProperty(ObservableItem.prototype, '$value', {\n get() {\n return this.$currentValue;\n },\n set(value) {\n this.set(value);\n },\n configurable: true,\n});\n\nObservableItem.prototype.triggerListeners = function(operations) {\n const $listeners = this.$listeners;\n const $previousValue = this.$previousValue;\n const $currentValue = this.$currentValue;\n\n operations = operations || {};\n if($listeners?.length) {\n for(let i = 0, length = $listeners.length; i < length; i++) {\n $listeners[i]($currentValue, $previousValue, operations);\n }\n }\n};\n\nObservableItem.prototype.triggerWatchers = function() {\n if(!this.$watchers) {\n return;\n }\n\n const $watchers = this.$watchers;\n const $previousValue = this.$previousValue;\n const $currentValue = this.$currentValue;\n\n if($watchers.has($currentValue)) {\n const watchValueList = $watchers.get($currentValue);\n watchValueList.forEach(itemValue => {\n if(itemValue.ifTrue.called) {\n return;\n }\n itemValue.ifTrue.callback();\n itemValue.else.called = false;\n })\n }\n if($watchers.has($previousValue)) {\n const watchValueList = $watchers.get($previousValue);\n watchValueList.forEach(itemValue => {\n if(itemValue.else.called) {\n return;\n }\n itemValue.else.callback();\n itemValue.ifTrue.called = false;\n });\n }\n};\n\nObservableItem.prototype.trigger = function(operations) {\n this.triggerListeners(operations);\n this.triggerWatchers();\n}\n\n/**\n * @param {*} data\n */\nObservableItem.prototype.set = function(data) {\n const newValue = (typeof data === 'function') ? data(this.$currentValue) : data;\n if(this.$currentValue === newValue) {\n return;\n }\n this.$previousValue = this.$currentValue;\n this.$currentValue = newValue;\n this.trigger();\n};\n\nObservableItem.prototype.val = function() {\n return this.$currentValue;\n};\n\nObservableItem.prototype.disconnectAll = function() {\n this.$listeners?.splice(0);\n this.$previousValue = null;\n this.$currentValue = null;\n if(this.$watchers) {\n for (const [_, watchValueList] of this.$watchers) {\n for (const itemValue of watchValueList) {\n itemValue.ifTrue.callback = null;\n itemValue.else.callback = null;\n }\n watchValueList.clear();\n }\n }\n this.$watchers?.clear();\n this.$listeners = null;\n this.$watchers = null;\n}\nObservableItem.prototype.cleanup = function() {\n MemoryManager.unregister(this.$memoryId);\n this.disconnectAll();\n this.$isCleanedUp = true;\n delete this.$value;\n}\n\n/**\n *\n * @param {Function} callback\n * @returns {(function(): void)}\n */\nObservableItem.prototype.subscribe = function(callback) {\n this.$listeners = this.$listeners ?? [];\n if (this.$isCleanedUp) {\n DebugManager.warn('Observable subscription', 'โš ๏ธ Attempted to subscribe to a cleaned up observable.');\n return () => {};\n }\n if (typeof callback !== 'function') {\n throw new NativeDocumentError('Callback must be a function');\n }\n\n this.$listeners.push(callback);\n return () => this.unsubscribe(callback);\n};\n\nObservableItem.prototype.on = function(value, callback, elseCallback) {\n this.$watchers = this.$watchers ?? new Map();\n\n let watchValueList = this.$watchers.get(value);\n if(!watchValueList) {\n watchValueList = new Set();\n this.$watchers.set(value, watchValueList);\n }\n\n let itemValue = {\n ifTrue: { callback, called: false },\n else: { callback: elseCallback, called: false }\n };\n watchValueList.add(itemValue);\n return () => {\n watchValueList?.delete(itemValue);\n if(watchValueList.size === 0) {\n this.$watchers?.delete(value);\n }\n watchValueList = null;\n itemValue = null;\n };\n};\n\n/**\n * Unsubscribe from an observable.\n * @param {Function} callback\n */\nObservableItem.prototype.unsubscribe = function(callback) {\n const index = this.$listeners.indexOf(callback);\n if (index > -1) {\n this.$listeners.splice(index, 1);\n }\n};\n\n/**\n * Create an Observable checker instance\n * @param callback\n * @returns {ObservableChecker}\n */\nObservableItem.prototype.check = function(callback) {\n return new ObservableChecker(this, callback)\n};\nObservableItem.prototype.get = ObservableItem.prototype.check;\n\n ObservableItem.prototype.toString = function() {\n return '{{#ObItem::(' +this.$memoryId+ ')}}';\n}","import Validator from \"./validator\";\n\nconst invoke = function(fn, args, context) {\n if(context) {\n fn.apply(context, args);\n } else {\n fn(...args);\n }\n};\n/**\n *\n * @param {Function} fn\n * @param {number} delay\n * @param {{leading?:Boolean, trailing?:Boolean, debounce?:Boolean, check: Function}}options\n * @returns {(function(...[*]): void)|*}\n */\nexport const debounce = function(fn, delay, options = {}) {\n let timer = null;\n let lastArgs = null;\n\n return function(...args) {\n const context = options.context === true ? this : null;\n let scopeDelay = delay;\n if(options.check) {\n const response = options.check(...args);\n if(typeof response === 'number') {\n scopeDelay = response;\n }\n }\n lastArgs = args;\n\n // debounce mode: reset the timer for each call\n clearTimeout(timer);\n timer = setTimeout(() => invoke(fn, lastArgs, context), delay);\n }\n};\n\n\n/**\n *\n * @param {*} item\n * @param {string|null} defaultKey\n * @param {?Function} key\n * @returns {*}\n */\nexport const getKey = (item, defaultKey, key) => {\n if(Validator.isFunction(key)) return key(item, defaultKey);\n if(Validator.isObservable(item)) {\n const val = item.val();\n return (val && key) ? val[key] : defaultKey;\n }\n if(!Validator.isObject(item)) {\n return item;\n }\n return item[key] ?? defaultKey;\n};\n\nexport const trim = function(str, char) {\n return str.replace(new RegExp(`^[${char}]+|[${char}]+$`, 'g'), '');\n}","import {debounce} from \"../utils/helpers\";\n\nconst DocumentObserver = {\n mounted: new WeakMap(),\n mountedSupposedSize: 0,\n unmounted: new WeakMap(),\n unmountedSupposedSize: 0,\n observer: null,\n checkMutation: function(mutationsList) {\n let i = 0;\n for(const mutation of mutationsList) {\n if(DocumentObserver.mountedSupposedSize > 0 ) {\n for(const node of mutation.addedNodes) {\n const data = DocumentObserver.mounted.get(node);\n if(!data) {\n continue;\n }\n data.inDom = true;\n data.mounted && data.mounted(node);\n }\n }\n\n if(DocumentObserver.unmountedSupposedSize > 0 ) {\n for(const node of mutation.removedNodes) {\n const data = DocumentObserver.unmounted.get(node);\n if(!data) {\n continue;\n }\n\n data.inDom = false;\n if(data.unmounted && data.unmounted(node) === true) {\n data.disconnect();\n node.nd?.remove();\n }\n }\n }\n }\n },\n /**\n *\n * @param {HTMLElement} element\n * @param {boolean} inDom\n * @returns {{watch: (function(): Map<any, any>), disconnect: (function(): boolean), mounted: (function(*): Set<any>), unmounted: (function(*): Set<any>)}}\n */\n watch: function(element, inDom = false) {\n let data = {\n inDom,\n mounted: null,\n unmounted: null,\n disconnect: () => {\n DocumentObserver.mounted.delete(element);\n DocumentObserver.unmounted.delete(element);\n DocumentObserver.mountedSupposedSize--;\n DocumentObserver.unmountedSupposedSize--;\n data = null;\n }\n };\n\n return {\n disconnect: data.disconnect,\n mounted: (callback) => {\n data.mounted = callback;\n DocumentObserver.mounted.set(element, data);\n DocumentObserver.mountedSupposedSize++;\n },\n unmounted: (callback) => {\n data.unmounted = callback;\n DocumentObserver.unmounted.set(element, data);\n DocumentObserver.unmountedSupposedSize++;\n }\n };\n }\n};\n\nDocumentObserver.observer = new MutationObserver(DocumentObserver.checkMutation);\nDocumentObserver.observer.observe(document.body, {\n childList: true,\n subtree: true,\n});\nexport default DocumentObserver;","export const EVENTS = [\n \"Click\",\n \"DblClick\",\n \"MouseDown\",\n \"MouseEnter\",\n \"MouseLeave\",\n \"MouseMove\",\n \"MouseOut\",\n \"MouseOver\",\n \"MouseUp\",\n \"Wheel\",\n \"KeyDown\",\n \"KeyPress\",\n \"KeyUp\",\n \"Blur\",\n \"Change\",\n \"Focus\",\n \"Input\",\n \"Invalid\",\n \"Reset\",\n \"Search\",\n \"Select\",\n \"Submit\",\n \"Drag\",\n \"DragEnd\",\n \"DragEnter\",\n \"DragLeave\",\n \"DragOver\",\n \"DragStart\",\n \"Drop\",\n \"AfterPrint\",\n \"BeforePrint\",\n \"BeforeUnload\",\n \"Error\",\n \"HashChange\",\n \"Load\",\n \"Offline\",\n \"Online\",\n \"PageHide\",\n \"PageShow\",\n \"Resize\",\n \"Scroll\",\n \"Unload\",\n \"Abort\",\n \"CanPlay\",\n \"CanPlayThrough\",\n \"DurationChange\",\n \"Emptied\",\n \"Ended\",\n \"LoadedData\",\n \"LoadedMetadata\",\n \"LoadStart\",\n \"Pause\",\n \"Play\",\n \"Playing\",\n \"Progress\",\n \"RateChange\",\n \"Seeked\",\n \"Seeking\",\n \"Stalled\",\n \"Suspend\",\n \"TimeUpdate\",\n \"VolumeChange\",\n \"Waiting\"\n];","import DocumentObserver from \"./DocumentObserver\";\nimport { EVENTS } from \"../utils/events\";\n\nexport function NDElement(element) {\n this.$element = element;\n this.$observer = null;\n}\n\nfor(const event of EVENTS) {\n const eventName = event.toLowerCase();\n NDElement.prototype['on'+event] = function(callback) {\n this.$element.addEventListener(eventName, callback);\n return this;\n };\n NDElement.prototype['onPrevent'+event] = function(callback) {\n this.$element.addEventListener(eventName, function(event) {\n event.preventDefault();\n callback(event);\n });\n return this;\n };\n NDElement.prototype['onStop'+event] = function(callback) {\n this.$element.addEventListener(eventName, function(event) {\n event.stopPropagation();\n callback(event);\n });\n return this;\n };\n NDElement.prototype['onPreventStop'+event] = function(callback) {\n this.$element.addEventListener(eventName, function(event) {\n event.stopPropagation();\n event.preventDefault();\n callback(event);\n });\n return this;\n };\n}\n\nNDElement.prototype.ref = function(target, name) {\n target[name] = element;\n return this;\n};\n\nNDElement.prototype.unmountChildren = function() {\n let element = this.$element;\n for(let i = 0, length = element.children.length; i < length; i++) {\n let elementchildren = element.children[i];\n if(!elementchildren.$ndProx) {\n elementchildren.nd?.remove();\n }\n elementchildren = null;\n }\n element = null;\n return this;\n};\n\nNDElement.prototype.remove = function() {\n let element = this.$element;\n element.nd.unmountChildren();\n element.$ndProx = null;\n delete element.nd?.on?.prevent;\n delete element.nd?.on;\n delete element.nd;\n element = null;\n return this;\n};\n\nNDElement.prototype.lifecycle = function(states) {\n this.$observer = this.$observer || DocumentObserver.watch(this.$element);\n\n states.mounted && this.$observer.mounted(states.mounted);\n states.unmounted && this.$observer.unmounted(states.unmounted);\n return this;\n};\nNDElement.prototype.mounted = function(callback) {\n return this.lifecycle({ mounted: callback });\n};\n\nNDElement.prototype.mounted = function(callback) {\n return this.lifecycle({ unmounted: callback });\n};\n\nNDElement.prototype.htmlElement = function() {\n return this.$element;\n};\n\nNDElement.prototype.node = NDElement.prototype.htmlElement;","import ObservableItem from \"../data/ObservableItem\";\nimport DebugManager from \"./debug-manager\";\nimport NativeDocumentError from \"../errors/NativeDocumentError\";\nimport ObservableChecker from \"../data/ObservableChecker\";\nimport {NDElement} from \"../wrappers/NDElement\";\n\nconst Validator = {\n isObservable(value) {\n return value instanceof ObservableItem || value instanceof ObservableChecker;\n },\n isProxy(value) {\n return value?.__isProxy__\n },\n isObservableChecker(value) {\n return value instanceof ObservableChecker;\n },\n isArray(value) {\n return Array.isArray(value);\n },\n isString(value) {\n return typeof value === 'string';\n },\n isNumber(value) {\n return typeof value === 'number';\n },\n isBoolean(value) {\n return typeof value === 'boolean';\n },\n isFunction(value) {\n return typeof value === 'function';\n },\n isAsyncFunction(value) {\n return typeof value === 'function' && value.constructor.name === 'AsyncFunction';\n },\n isObject(value) {\n return typeof value === 'object';\n },\n isJson(value) {\n return typeof value === 'object' && value !== null && value.constructor.name === 'Object' && !Array.isArray(value);\n },\n isElement(value) {\n return value instanceof HTMLElement || value instanceof DocumentFragment || value instanceof Text;\n },\n isFragment(value) {\n return value instanceof DocumentFragment;\n },\n isStringOrObservable(value) {\n return this.isString(value) || this.isObservable(value);\n },\n isValidChild(child) {\n return child === null ||\n this.isElement(child) ||\n this.isObservable(child) ||\n this.isNDElement(child) ||\n ['string', 'number', 'boolean'].includes(typeof child);\n },\n isNDElement(child) {\n return child instanceof NDElement;\n },\n isValidChildren(children) {\n if (!Array.isArray(children)) {\n children = [children];\n }\n\n const invalid = children.filter(child => !this.isValidChild(child));\n return invalid.length === 0;\n },\n validateChildren(children) {\n if (!Array.isArray(children)) {\n children = [children];\n }\n\n const invalid = children.filter(child => !this.isValidChild(child));\n if (invalid.length > 0) {\n throw new NativeDocumentError(`Invalid children detected: ${invalid.map(i => typeof i).join(', ')}`);\n }\n\n return children;\n },\n /**\n * Check if the data contains observables.\n * @param {Array|Object} data\n * @returns {boolean}\n */\n containsObservables(data) {\n if(!data) {\n return false;\n }\n return Validator.isObject(data)\n && Object.values(data).some(value => Validator.isObservable(value));\n },\n /**\n * Check if the data contains an observable reference.\n * @param {string} data\n * @returns {boolean}\n */\n containsObservableReference(data) {\n if(!data || typeof data !== 'string') {\n return false;\n }\n return /\\{\\{#ObItem::\\([0-9]+\\)\\}\\}/.test(data);\n },\n validateAttributes(attributes) {\n if (!attributes || typeof attributes !== 'object') {\n return attributes;\n }\n\n const reserved = [];\n const foundReserved = Object.keys(attributes).filter(key => reserved.includes(key));\n\n if (foundReserved.length > 0) {\n DebugManager.warn('Validator', `Reserved attributes found: ${foundReserved.join(', ')}`);\n }\n\n return attributes;\n },\n\n validateEventCallback(callback) {\n if (typeof callback !== 'function') {\n throw new NativeDocumentError('Event callback must be a function');\n }\n }\n};\n\nexport default Validator;","import Validator from \"../utils/validator\";\nimport DebugManager from \"../utils/debug-manager\";\nimport {ElementCreator} from \"../wrappers/ElementCreator\";\n\n\nexport default function Anchor(name) {\n const element = document.createDocumentFragment();\n\n const anchorStart = document.createComment('Anchor Start : '+name);\n const anchorEnd = document.createComment('/ Anchor End '+name);\n\n element.appendChild(anchorStart);\n element.appendChild(anchorEnd);\n\n element.nativeInsertBefore = element.insertBefore;\n element.nativeAppendChild = element.appendChild;\n\n const insertBefore = function(parent, child, target) {\n if(parent === element) {\n parent.nativeInsertBefore(ElementCreator.getChild(child), target);\n return;\n }\n parent.insertBefore(ElementCreator.getChild(child), target);\n };\n\n element.appendElement = function(child, before = null) {\n if(anchorEnd.parentNode === element) {\n anchorEnd.parentNode.nativeInsertBefore(child, before || anchorEnd);\n return;\n }\n anchorEnd.parentNode?.insertBefore(child, before || anchorEnd);\n };\n\n element.appendChild = function(child, before = null) {\n const parent = anchorEnd.parentNode;\n if(!parent) {\n DebugManager.error('Anchor', 'Anchor : parent not found', child);\n return;\n }\n before = before ?? anchorEnd;\n if(Validator.isArray(child)) {\n const fragment = document.createDocumentFragment();\n for(let i = 0, length = child.length; i < length; i++) {\n fragment.appendChild(ElementCreator.getChild(child[i]));\n }\n insertBefore(parent, fragment, before);\n return element;\n }\n insertBefore(parent, child, before);\n };\n\n element.removeChildren = function() {\n const parent = anchorEnd.parentNode;\n if(parent === element) {\n return;\n }\n if(parent.firstChild === anchorStart && parent.lastChild === anchorEnd) {\n parent.replaceChildren(anchorStart, anchorEnd);\n return;\n }\n\n let itemToRemove = anchorStart.nextSibling, tempItem;\n const fragment = document.createDocumentFragment();\n while(itemToRemove && itemToRemove !== anchorEnd) {\n tempItem = itemToRemove.nextSibling;\n fragment.append(itemToRemove);\n itemToRemove = tempItem;\n }\n fragment.replaceChildren();\n }\n element.remove = function() {\n const parent = anchorEnd.parentNode;\n if(parent === element) {\n return;\n }\n let itemToRemove = anchorStart.nextSibling, tempItem;\n while(itemToRemove !== anchorEnd) {\n tempItem = itemToRemove.nextSibling;\n element.nativeAppendChild(itemToRemove);\n itemToRemove = tempItem;\n }\n };\n\n element.removeWithAnchors = function() {\n element.removeChildren();\n anchorStart.remove();\n anchorEnd.remove();\n };\n\n element.replaceContent = function(child) {\n const parent = anchorEnd.parentNode;\n if(!parent) {\n return;\n }\n if(parent.firstChild === anchorStart && parent.lastChild === anchorEnd) {\n parent.replaceChildren(anchorStart, child, anchorEnd);\n return;\n }\n element.removeChildren();\n parent.insertBefore(child, anchorEnd);\n };\n\n element.insertBefore = function(child, anchor = null) {\n element.appendChild(child, anchor);\n };\n\n element.clear = function() {\n element.remove();\n };\n\n element.endElement = function() {\n return anchorEnd;\n };\n element.startElement = function() {\n return anchorStart;\n };\n\n return element;\n};","\nexport const BOOLEAN_ATTRIBUTES = ['checked', 'selected', 'disabled', 'readonly', 'required', 'autofocus', 'multiple', 'autocomplete', 'hidden', 'contenteditable', 'spellcheck', 'translate', 'draggable', 'async', 'defer', 'autoplay', 'controls', 'loop', 'muted', 'download', 'reversed', 'open', 'default', 'formnovalidate', 'novalidate', 'scoped', 'itemscope', 'allowfullscreen', 'allowpaymentrequest', 'playsinline'];","import ObservableItem from './ObservableItem';\nimport Validator from \"../utils/validator\";\nimport MemoryManager from \"./MemoryManager\";\nimport NativeDocumentError from \"../errors/NativeDocumentError\";\nimport {debounce} from \"../utils/helpers.js\";\n\n/**\n *\n * @param {*} value\n * @returns {ObservableItem}\n * @constructor\n */\nexport function Observable(value) {\n return new ObservableItem(value);\n}\n\n/**\n *\n * @param id\n * @returns {ObservableItem|null}\n */\nObservable.getById = function(id) {\n const item = MemoryManager.getObservableById(parseInt(id));\n if(!item) {\n throw new NativeDocumentError('Observable.getById : No observable found with id ' + id);\n }\n return item;\n};\n\n/**\n *\n * @param {ObservableItem} observable\n */\nObservable.cleanup = function(observable) {\n observable.cleanup();\n};\n\n/**\n * Enable auto cleanup of observables.\n * @param {Boolean} enable\n * @param {{interval:Boolean, threshold:number}} options\n */\nObservable.autoCleanup = function(enable = false, options = {}) {\n if(!enable) {\n return;\n }\n const { interval = 60000, threshold = 100 } = options;\n\n window.addEventListener('beforeunload', () => {\n MemoryManager.cleanup();\n });\n\n setInterval(() => MemoryManager.cleanObservables(threshold), interval);\n};\n\n","import Validator from \"../utils/validator\";\nimport NativeDocumentError from \"../errors/NativeDocumentError\";\nimport {BOOLEAN_ATTRIBUTES} from \"./constants.js\";\nimport {Observable} from \"../data/Observable\";\n\n/**\n *\n * @param {HTMLElement} element\n * @param {Object} data\n */\nfunction bindClassAttribute(element, data) {\n for(let className in data) {\n const value = data[className];\n if(Validator.isObservable(value)) {\n element.classList.toggle(className, value.val());\n value.subscribe(newValue => element.classList.toggle(className, newValue));\n continue;\n }\n element.classList.toggle(className, value)\n }\n}\n\n/**\n *\n * @param {HTMLElement} element\n * @param {Object} data\n */\nfunction bindStyleAttribute(element, data) {\n for(let styleName in data) {\n const value = data[styleName];\n if(Validator.isObservable(value)) {\n element.style[styleName] = value.val();\n value.subscribe(newValue => {\n element.style[styleName] = newValue;\n });\n continue;\n }\n element.style[styleName] = value;\n }\n}\n\n/**\n *\n * @param {HTMLElement} element\n * @param {string} attributeName\n * @param {boolean|number|Observable} value\n */\nfunction bindBooleanAttribute(element, attributeName, value) {\n const defaultValue = Validator.isObservable(value) ? value.val() : value;\n if(Validator.isBoolean(defaultValue)) {\n element[attributeName] = defaultValue;\n }\n else {\n element[attributeName] = defaultValue === element.value;\n }\n if(Validator.isObservable(value)) {\n if(['checked'].includes(attributeName)) {\n element.addEventListener('input', () => {\n if(Validator.isBoolean(defaultValue)) {\n value.set(element[attributeName]);\n return;\n }\n value.set(element.value);\n });\n }\n value.subscribe(newValue => {\n if(Validator.isBoolean(newValue)) {\n element[attributeName] = newValue;\n return;\n }\n element[attributeName] = newValue === element.value;\n });\n }\n}\n\n\n/**\n *\n * @param {HTMLElement} element\n * @param {string} attributeName\n * @param {Observable} value\n */\nfunction bindAttributeWithObservable(element, attributeName, value) {\n const applyValue = (newValue) => {\n if(attributeName === 'value') {\n element.value = newValue;\n return;\n }\n element.setAttribute(attributeName, newValue);\n };\n applyValue(value.val());\n value.subscribe(applyValue);\n\n if(attributeName === 'value') {\n element.addEventListener('input', () => value.set(element.value));\n }\n}\n\n/**\n *\n * @param {HTMLElement} element\n * @param {Object} attributes\n */\nexport default function AttributesWrapper(element, attributes) {\n\n Validator.validateAttributes(attributes);\n\n if(!Validator.isObject(attributes)) {\n throw new NativeDocumentError('Attributes must be an object');\n }\n\n for(let key in attributes) {\n const attributeName = key.toLowerCase();\n let value = attributes[attributeName];\n if(Validator.isString(value) && Validator.isFunction(value.resolveObservableTemplate)) {\n value = value.resolveObservableTemplate();\n if(Validator.isArray(value)) {\n const observables = value.filter(item => Validator.isObservable(item));\n value = Observable.computed(() => {\n return value.map(item => Validator.isObservable(item) ? item.val() : item).join(' ') || ' ';\n }, observables);\n }\n }\n if(BOOLEAN_ATTRIBUTES.includes(attributeName)) {\n bindBooleanAttribute(element, attributeName, value);\n continue;\n }\n if(Validator.isObservable(value)) {\n bindAttributeWithObservable(element, attributeName, value);\n continue;\n }\n if(attributeName === 'class' && Validator.isJson(value)) {\n bindClassAttribute(element, value);\n continue;\n }\n if(attributeName === 'style' && Validator.isJson(value)) {\n bindStyleAttribute(element, value);\n continue;\n }\n element.setAttribute(attributeName, value);\n\n }\n return element;\n}","import Anchor from \"../elements/anchor\";\nimport Validator from \"../utils/validator\";\nimport AttributesWrapper from \"./AttributesWrapper\";\n\nconst $nodeCache = new Map();\nlet $textNodeCache = null;\n\nexport const ElementCreator = {\n createTextNode() {\n if(!$textNodeCache) {\n $textNodeCache = document.createTextNode('');\n }\n return $textNodeCache.cloneNode();\n },\n /**\n *\n * @param {HTMLElement|DocumentFragment} parent\n * @param {ObservableItem} observable\n * @returns {Text}\n */\n createObservableNode(parent, observable) {\n const text = ElementCreator.createTextNode();\n observable.subscribe(value => text.nodeValue = String(value));\n text.nodeValue = observable.val();\n parent && parent.appendChild(text);\n return text;\n },\n\n /**\n *\n * @param {HTMLElement|DocumentFragment} parent\n * @param {*} value\n * @returns {Text}\n */\n createStaticTextNode(parent, value) {\n let text = ElementCreator.createTextNode();\n text.nodeValue = String(value);\n parent && parent.appendChild(text);\n return text;\n },\n /**\n *\n * @param {string} name\n * @returns {HTMLElement|DocumentFragment}\n */\n createElement(name) {\n if(name) {\n if($nodeCache.has(name)) {\n return $nodeCache.get(name).cloneNode();\n }\n const node = document.createElement(name);\n $nodeCache.set(name, node);\n return node.cloneNode();\n }\n return new Anchor('Fragment');\n },\n /**\n *\n * @param {*} children\n * @param {HTMLElement|DocumentFragment} parent\n */\n processChildren(children, parent) {\n if(children === null) return;\n const childrenArray = Array.isArray(children) ? children : [children];\n\n for(let i = 0, length = childrenArray.length; i < length; i++) {\n let child = this.getChild(childrenArray[i]);\n if (child === null) continue;\n parent.appendChild(child);\n }\n },\n getChild(child) {\n if(child === null) {\n return null;\n }\n if(Validator.isString(child) && Validator.isFunction(child.resolveObservableTemplate)) {\n child = child.resolveObservableTemplate();\n }\n if(Validator.isString(child)) {\n return ElementCreator.createStaticTextNode(null, child);\n }\n if (Validator.isObservable(child)) {\n return ElementCreator.createObservableNode(null, child);\n }\n if(Validator.isArray(child)) {\n const fragment = document.createDocumentFragment();\n for(let i = 0, length = child.length; i < length; i++) {\n fragment.appendChild(this.getChild(child[i]));\n }\n return fragment;\n }\n if(Validator.isFunction(child)) {\n return this.getChild(child());\n }\n if (Validator.isElement(child)) {\n return child;\n }\n if(Validator.isNDElement(child)) {\n return child.$element;\n }\n return ElementCreator.createStaticTextNode(null, child);\n },\n /**\n *\n * @param {HTMLElement} element\n * @param {Object} attributes\n */\n processAttributes(element, attributes) {\n if(Validator.isFragment(element)) return;\n if (attributes) {\n AttributesWrapper(element, attributes);\n }\n },\n /**\n *\n * @param {HTMLElement} element\n * @param {Object} attributes\n * @param {?Function} customWrapper\n * @returns {HTMLElement|DocumentFragment}\n */\n setup(element, attributes, customWrapper) {\n return element;\n }\n};","import { NDElement } from \"./NDElement\";\n\nObject.defineProperty(HTMLElement.prototype, 'nd', {\n get() {\n if(this.$nd) {\n return this.$nd;\n }\n\n this.$nd = new NDElement(this);\n this.$nd.nd = this.$nd;\n return this.$nd;\n }\n});","import Validator from \"../utils/validator\";\nimport DebugManager from \"../utils/debug-manager\";\nimport {ElementCreator} from \"./ElementCreator\";\nimport './NdPrototype';\n\n/**\n *\n * @param {*} value\n * @returns {Text}\n */\nexport const createTextNode = function(value) {\n return (Validator.isObservable(value))\n ? ElementCreator.createObservableNode(null, value)\n : ElementCreator.createStaticTextNode(null, value);\n};\n\n\n/**\n *\n * @param {string} name\n * @param {?Function} customWrapper\n * @returns {Function}\n */\nexport default function HtmlElementWrapper(name, customWrapper) {\n const $tagName = name.toLowerCase();\n\n return function(attributes, children = null) {\n try {\n if(!Validator.isJson(attributes)) {\n const tempChildren = children;\n children = attributes;\n attributes = tempChildren;\n }\n const element = ElementCreator.createElement($tagName);\n const finalElement = (typeof customWrapper === 'function') ? customWrapper(element) : element;\n\n ElementCreator.processAttributes(finalElement, attributes);\n ElementCreator.processChildren(children, finalElement);\n\n return ElementCreator.setup(finalElement, attributes, customWrapper);\n } catch (error) {\n DebugManager.error('ElementCreation', `Error creating ${$tagName}`, error);\n }\n };\n}\n\n","\n\nexport default class ArgTypesError extends Error {\n constructor(message, errors) {\n super(`${message}\\n\\n${errors.join(\"\\n\")}\\n\\n`);\n }\n}","import Validator from \"./validator\";\nimport ArgTypesError from \"../errors/ArgTypesError\";\nimport NativeDocumentError from \"../errors/NativeDocumentError\";\n\n/**\n *\n * @type {{string: (function(*): {name: *, type: string, validate: function(*): boolean}),\n * number: (function(*): {name: *, type: string, validate: function(*): boolean}),\n * boolean: (function(*): {name: *, type: string, validate: function(*): boolean}),\n * observable: (function(*): {name: *, type: string, validate: function(*): boolean}),\n * element: (function(*): {name: *, type: string, validate: function(*): *}),\n * function: (function(*): {name: *, type: string, validate: function(*): boolean}),\n * object: (function(*): {name: *, type: string, validate: function(*): boolean}),\n * objectNotNull: (function(*): {name: *, type: string, validate: function(*): *}),\n * children: (function(*): {name: *, type: string, validate: function(*): *}),\n * attributes: (function(*): {name: *, type: string, validate: function(*): *}),\n * optional: (function(*): *&{optional: boolean}),\n * oneOf: (function(*, ...[*]): {name: *, type: string, types: *[],\n * validate: function(*): boolean})\n * }}\n */\nexport const ArgTypes = {\n string: (name) => ({ name, type: 'string', validate: (v) => Validator.isString(v) }),\n number: (name) => ({ name, type: 'number', validate: (v) => Validator.isNumber(v) }),\n boolean: (name) => ({ name, type: 'boolean', validate: (v) => Validator.isBoolean(v) }),\n observable: (name) => ({ name, type: 'observable', validate: (v) => Validator.isObservable(v) }),\n element: (name) => ({ name, type: 'element', validate: (v) => Validator.isElement(v) }),\n function: (name) => ({ name, type: 'function', validate: (v) => Validator.isFunction(v) }),\n object: (name) => ({ name, type: 'object', validate: (v) => (Validator.isObject(v)) }),\n objectNotNull: (name) => ({ name, type: 'object', validate: (v) => (Validator.isObject(v) && v !== null) }),\n children: (name) => ({ name, type: 'children', validate: (v) => Validator.validateChildren(v) }),\n attributes: (name) => ({ name, type: 'attributes', validate: (v) => Validator.validateAttributes(v) }),\n\n // Optional arguments\n optional: (argType) => ({ ...argType, optional: true }),\n\n // Union types\n oneOf: (name, ...argTypes) => ({\n name,\n type: 'oneOf',\n types: argTypes,\n validate: (v) => argTypes.some(type => type.validate(v))\n })\n};\n\n/**\n *\n * @param {Array} args\n * @param {Array} argSchema\n * @param {string} fnName\n */\nconst validateArgs = (args, argSchema, fnName = 'Function') => {\n if (!argSchema) return;\n\n const errors = [];\n\n // Check the number of arguments\n const requiredCount = argSchema.filter(arg => !arg.optional).length;\n if (args.length < requiredCount) {\n errors.push(`${fnName}: Expected at least ${requiredCount} arguments, got ${args.length}`);\n }\n\n // Validate each argument\n argSchema.forEach((schema, index) => {\n const position = index + 1;\n const value = args[index];\n\n if (value === undefined) {\n if (!schema.optional) {\n errors.push(`${fnName}: Missing required argument '${schema.name}' at position ${position}`);\n }\n return;\n }\n\n if (!schema.validate(value)) {\n const valueTypeOf = value?.constructor?.name || typeof value;\n errors.push(`${fnName}: Invalid argument '${schema.name}' at position ${position}, expected ${schema.type}, got ${valueTypeOf}`);\n }\n });\n\n if (errors.length > 0) {\n throw new ArgTypesError(`Argument validation failed`, errors);\n }\n};\n\n/**\n * @param {Function} fn\n * @param {Array} argSchema\n * @param {string} fnName\n * @returns {Function}\n */\nexport const withValidation = (fn, argSchema, fnName = 'Function') => {\n if(!Validator.isArray(argSchema)) {\n throw new NativeDocumentError('withValidation : argSchema must be an array');\n }\n return function(...args) {\n validateArgs(args, argSchema, fn.name || fnName);\n return fn.apply(this, args);\n };\n};","import {withValidation} from \"./args-types.js\";\nimport {Observable} from \"../data/Observable\";\nimport Validator from \"./validator\";\n\n\nFunction.prototype.args = function(...args) {\n return withValidation(this, args);\n};\n\nFunction.prototype.errorBoundary = function(callback) {\n return (...args) => {\n try {\n return this.apply(this, args);\n } catch(e) {\n return callback(e);\n }\n };\n};\n\nString.prototype.use = function(args) {\n const value = this;\n\n return Observable.computed(() => {\n return value.replace(/\\$\\{(.*?)}/g, (match, key) => {\n const data = args[key];\n if(Validator.isObservable(data)) {\n return data.val();\n }\n return data;\n });\n }, Object.values(args));\n};\n\nString.prototype.resolveObservableTemplate = function() {\n if(!Validator.containsObservableReference(this)) {\n return this.valueOf();\n }\n return this.split(/(\\{\\{#ObItem::\\([0-9]+\\)\\}\\})/g).filter(Boolean).map((value) => {\n if(!Validator.containsObservableReference(value)) {\n return value;\n }\n const [_, id] = value.match(/\\{\\{#ObItem::\\(([0-9]+)\\)\\}\\}/);\n return Observable.getById(id);\n });\n}","import NativeDocumentError from \"../../errors/NativeDocumentError\";\nimport {Observable} from \"../Observable\";\n\n\nconst methods = ['push', 'pop', 'shift', 'unshift', 'reverse', 'sort', 'splice'];\n\n/**\n *\n * @param {Array} target\n * @returns {ObservableItem}\n */\nObservable.array = function(target) {\n if(!Array.isArray(target)) {\n throw new NativeDocumentError('Observable.array : target must be an array');\n }\n const observer = Observable(target);\n\n methods.forEach((method) => {\n observer[method] = function(...values) {\n const result = observer.val()[method](...values);\n observer.trigger({ action: method, args: values, result });\n return result;\n };\n });\n\n observer.clear = function() {\n observer.$value.length = 0;\n observer.trigger({ action: 'clear' });\n return true;\n };\n\n observer.merge = function(values) {\n observer.$value = [...observer.$value, ...values];\n };\n\n observer.populateAndRender = function(iteration, callback) {\n observer.trigger({ action: 'populate', args: [observer.$value, iteration, callback] });\n };\n observer.remove = function(index) {\n const deleted = observer.$value.splice(index, 1);\n if(deleted.length === 0) {\n return [];\n }\n observer.trigger({ action: 'remove', args: [index], result: deleted[0] });\n return deleted;\n };\n\n observer.swap = function(indexA, indexB) {\n const value = observer.$value;\n const length = value.length;\n if(length < indexA || length < indexB) {\n return false;\n }\n if(indexB < indexA) {\n const temp = indexA;\n indexA = indexB;\n indexB = temp;\n }\n const elementA = value[indexA];\n const elementB = value[indexB]\n\n value[indexA] = elementB;\n value[indexB] = elementA;\n observer.trigger({ action: 'swap', args: [indexA, indexB], result: [elementA, elementB] });\n return true;\n };\n\n observer.length = function() {\n return observer.$value.length;\n }\n\n const overrideMethods = ['map', 'filter', 'reduce', 'some', 'every', 'find', 'findIndex', 'concat'];\n overrideMethods.forEach((method) => {\n observer[method] = function(...args) {\n return observer.val()[method](...args);\n };\n })\n\n return observer;\n};","import Validator from \"../../utils/validator\";\nimport {Observable} from \"../Observable\";\n\n/**\n *\n * @param {Function} callback\n * @returns {Function}\n */\nObservable.batch = function(callback) {\n const $observer = Observable(0);\n const batch = function() {\n if(Validator.isAsyncFunction(callback)) {\n return (callback(...arguments)).then(() => {\n $observer.trigger();\n }).catch(error => { throw error; });\n }\n callback(...arguments);\n $observer.trigger();\n };\n batch.$observer = $observer;\n return batch;\n};","import Validator from \"../../utils/validator\";\nimport {Observable} from \"../Observable\";\n\n/**\n *\n * @param {Object} value\n * @returns {Proxy}\n */\nObservable.init = function(value) {\n const data = {};\n for(const key in value) {\n const itemValue = value[key];\n if(Validator.isJson(itemValue)) {\n data[key] = Observable.init(itemValue);\n continue;\n }\n else if(Validator.isArray(itemValue)) {\n data[key] = Observable.array(itemValue);\n continue;\n }\n data[key] = Observable(itemValue);\n }\n\n const $val = function() {\n const result = {};\n for(const key in data) {\n const dataItem = data[key];\n if(Validator.isObservable(dataItem)) {\n result[key] = dataItem.val();\n } else if(Validator.isProxy(dataItem)) {\n result[key] = dataItem.$value;\n } else {\n result[key] = dataItem;\n }\n }\n return result;\n };\n const $clone = function() {\n\n };\n\n return new Proxy(data, {\n get(target, property) {\n if(property === '__isProxy__') {\n return true;\n }\n if(property === '$value') {\n return $val();\n }\n if(property === '$clone') {\n return $clone;\n }\n if(target[property] !== undefined) {\n return target[property];\n }\n return undefined;\n },\n set(target, prop, newValue) {\n if(target[prop] !== undefined) {\n target[prop].set(newValue);\n }\n }\n })\n};\n\n/**\n * Get the value of an observable or an object of observables.\n * @param {ObservableItem|Object<ObservableItem>} data\n * @returns {{}|*|null}\n */\nObservable.value = function(data) {\n if(Validator.isObservable(data)) {\n return data.val();\n }\n if(Validator.isProxy(data)) {\n return data.$value;\n }\n if(Validator.isArray(data)) {\n const result = [];\n data.forEach(item => {\n result.push(Observable.value(item));\n });\n return result;\n }\n return data;\n};\n\n\nObservable.update = function($target, data) {\n for(const key in data) {\n const targetItem = $target[key];\n const newValue = data[key];\n\n if(Validator.isObservable(targetItem)) {\n if(Validator.isArray(newValue)) {\n Observable.update(targetItem, newValue);\n continue;\n }\n targetItem.set(newValue);\n continue;\n }\n if(Validator.isProxy(targetItem)) {\n Observable.update(targetItem, newValue);\n continue;\n }\n $target[key] = newValue;\n }\n};\n\nObservable.object = Observable.init;\nObservable.json = Observable.init;","import ObservableItem from \"../ObservableItem\";\nimport Validator from \"../../utils/validator\";\nimport NativeDocumentError from \"../../errors/NativeDocumentError\";\nimport {Observable} from \"../Observable\";\n\n/**\n *\n * @param {Function} callback\n * @param {Array|Function} dependencies\n * @returns {ObservableItem}\n */\nObservable.computed = function(callback, dependencies = []) {\n const initialValue = callback();\n const observable = new ObservableItem(initialValue);\n const updatedValue = () => observable.set(callback());\n\n if(Validator.isFunction(dependencies)) {\n if(!Validator.isObservable(dependencies.$observer)) {\n throw new NativeDocumentError('Observable.computed : dependencies must be valid batch function');\n }\n dependencies.$observer.subscribe(updatedValue);\n return observable;\n }\n\n dependencies.forEach(dependency => dependency.subscribe(updatedValue));\n\n return observable;\n};","import {Observable} from \"./Observable\";\n\nexport const Store = (function() {\n\n const $stores = new Map();\n\n return {\n /**\n * Create a new state follower and return it.\n * @param {string} name\n * @returns {ObservableItem}\n */\n use(name) {\n const {observer: originalObserver, subscribers } = $stores.get(name);\n const observerFollower = Observable(originalObserver.val());\n const unSubscriber = originalObserver.subscribe(value => observerFollower.set(value));\n const updaterUnsubscriber = observerFollower.subscribe(value => originalObserver.set(value));\n observerFollower.destroy = () => {\n unSubscriber();\n updaterUnsubscriber();\n observerFollower.cleanup();\n };\n subscribers.add(observerFollower);\n\n return observerFollower;\n },\n /**\n * @param {string} name\n * @returns {ObservableItem}\n */\n follow(name) {\n return this.use(name);\n },\n /**\n * Create a new state and return the observer.\n * @param {string} name\n * @param {*} value\n * @returns {ObservableItem}\n */\n create(name, value) {\n const observer = Observable(value);\n $stores.set(name, { observer, subscribers: new Set()});\n return observer;\n },\n /**\n * Get the observer for a state.\n * @param {string} name\n * @returns {null|ObservableItem}\n */\n get(name) {\n const item = $stores.get(name);\n return item ? item.observer : null;\n },\n /**\n *\n * @param {string} name\n * @returns {{observer: ObservableItem, subscribers: Set}}\n */\n getWithSubscribers(name) {\n return $stores.get(name);\n },\n /**\n * Delete a state.\n * @param {string} name\n */\n delete(name) {\n const item = $stores.get(name);\n if(!item) return;\n item.observer.cleanup();\n item.subscribers.forEach(follower => follower.destroy());\n item.observer.clear();\n }\n };\n}());","import ObservableItem from \"../../data/ObservableItem\";\nimport {Observable} from \"../../data/Observable\";\nimport Validator from \"../../utils/validator\";\nimport Anchor from \"../anchor\";\nimport DebugManager from \"../../utils/debug-manager\";\nimport {getKey} from \"../../utils/helpers\";\nimport { ElementCreator } from \"../../wrappers/ElementCreator\";\n\n/**\n *\n * @param {Array|Object|ObservableItem} data\n * @param {Function} callback\n * @param {?Function} key\n * @returns {DocumentFragment}\n */\nexport function ForEach(data, callback, key) {\n const element = new Anchor('ForEach');\n const blockEnd = element.endElement();\n const blockStart = element.startElement();\n\n let cache = new Map();\n let lastKeyOrder = null;\n const keyIds = new Set();\n\n const clear = () => {\n element.removeChildren();\n cleanCache();\n };\n\n const cleanCache = (parent) => {\n for(const [keyId, cacheItem] of cache.entries()) {\n if(keyIds.has(keyId)) {\n continue;\n }\n const child = cacheItem.child?.deref();\n if(parent && child) {\n parent.removeChild(child);\n }\n cacheItem.indexObserver?.cleanup();\n cacheItem.child = null;\n cacheItem.indexObserver = null;\n cache.delete(cacheItem.keyId);\n lastKeyOrder && lastKeyOrder.delete(cacheItem.keyId);\n }\n };\n\n const handleContentItem = (item, indexKey) => {\n const keyId = getKey(item, indexKey, key);\n\n if(cache.has(keyId)) {\n const cacheItem = cache.get(keyId);\n cacheItem.indexObserver?.set(indexKey);\n cacheItem.isNew = false;\n if(cacheItem.child?.deref()) {\n return keyId;\n }\n cache.delete(keyId);\n }\n\n try {\n const indexObserver = callback.length >= 2 ? Observable(indexKey) : null;\n let child = ElementCreator.getChild(callback(item, indexObserver))\n cache.set(keyId, { keyId, isNew: true, child: new WeakRef(child), indexObserver});\n } catch (e) {\n DebugManager.error('ForEach', `Error creating element for key ${keyId}` , e);\n throw e;\n }\n return keyId;\n };\n\n const batchDOMUpdates = (parent) => {\n const fragment = document.createDocumentFragment();\n for(const itemKey of keyIds) {\n const cacheItem = cache.get(itemKey);\n if(!cacheItem) {\n continue;\n }\n const child = cacheItem.child?.deref();\n child && fragment.appendChild(child);\n }\n parent.insertBefore(fragment, blockEnd);\n }\n\n const diffingDOMUpdates = (parent) => {\n const operations = [];\n let fragment = document.createDocumentFragment();\n const newKeys = Array.from(keyIds);\n const oldKeys = Array.from(lastKeyOrder);\n\n let currentPosition = blockStart;\n\n for(const index in newKeys) {\n const itemKey = newKeys[index];\n const cacheItem = cache.get(itemKey);\n if(!cacheItem) {\n continue;\n }\n const child = cacheItem.child.deref();\n if(!child) {\n continue;\n }\n fragment.appendChild(child);\n }\n element.replaceContent(fragment);\n };\n\n const buildContent = () => {\n const parent = blockEnd.parentNode;\n if(!parent) {\n return;\n }\n\n const items = (Validator.isObservable(data)) ? data.val() : data;\n keyIds.clear();\n if(Array.isArray(items)) {\n for(let i = 0, length = items.length; i < length; i++) {\n const keyId= handleContentItem(items[i], i);\n keyIds.add(keyId);\n }\n } else {\n for(const indexKey in items) {\n const keyId = handleContentItem(items[indexKey], indexKey);\n keyIds.add(keyId);\n }\n }\n\n if(keyIds.size === 0) {\n clear();\n lastKeyOrder?.clear();\n return;\n }\n\n cleanCache(parent);\n if(!lastKeyOrder || lastKeyOrder.size === 0) {\n batchDOMUpdates(parent);\n } else {\n diffingDOMUpdates(parent);\n }\n lastKeyOrder?.clear();\n lastKeyOrder = new Set([...keyIds]);\n };\n\n buildContent();\n if(Validator.isObservable(data)) {\n data.subscribe(buildContent)\n }\n return element;\n}\n","import Anchor from \"../anchor\";\nimport {Observable} from \"../../data/Observable\";\nimport Validator from \"../../utils/validator\";\nimport DebugManager from \"../../utils/debug-manager\";\nimport {getKey} from \"../../utils/helpers\";\nimport { ElementCreator } from \"../../wrappers/ElementCreator\";\n\nexport function ForEachArray(data, callback, key, configs = {}) {\n const element = new Anchor('ForEach Array');\n const blockEnd = element.endElement();\n const blockStart = element.startElement();\n\n let cache = new Map();\n let nodeCacheByElement = new WeakMap();\n let lastNumberOfItems = 0;\n\n const keysCache = new WeakMap();\n\n const clear = () => {\n element.removeChildren();\n cleanCache();\n lastNumberOfItems = 0;\n };\n const getItemKey = (item, indexKey) => {\n if(keysCache.has(item)) {\n return keysCache.get(item);\n }\n return getKey(item, indexKey, key);\n }\n\n const updateIndexObservers = (items, startFrom = 0) => {\n if(callback.length < 2) {\n return;\n }\n let index = startFrom;\n for(let i = startFrom, length = items?.length; i < length; i++) {\n const cacheItem = cache.get(getItemKey(items[i], i));\n if(!cacheItem) {\n continue;\n }\n cacheItem.indexObserver?.deref()?.set(index);\n index++;\n }\n };\n\n const removeCacheItem = (cacheItem, removeChild = true) => {\n if(!cacheItem) {\n return;\n }\n const child = cacheItem.child?.deref();\n cacheItem.indexObserver?.deref()?.cleanup();\n cacheItem.child = null;\n cacheItem.indexObserver = null;\n nodeCacheByElement.delete(cacheItem.item);\n keysCache.delete(cacheItem.item);\n cacheItem.item = null;\n if(removeChild) {\n child?.remove();\n cache.delete(cacheItem.keyId);\n }\n }\n\n const removeCacheItemByKey = (keyId, removeChild = true) => {\n removeCacheItem(cache.get(keyId), removeChild);\n };\n\n const cleanCache = () => {\n for (const [keyId, cacheItem] of cache.entries()) {\n removeCacheItem(cacheItem, false);\n }\n cache.clear();\n }\n\n const buildItem = (item, indexKey) => {\n const keyId = getItemKey(item, indexKey);\n\n if(cache.has(keyId)) {\n const cacheItem = cache.get(keyId);\n cacheItem.indexObserver?.deref()?.set(indexKey);\n cacheItem.isNew = false;\n const child = cacheItem.child?.deref();\n if(child) {\n return child;\n }\n cache.delete(keyId);\n }\n\n try {\n const indexObserver = callback.length >= 2 ? Observable(indexKey) : null;\n let child = ElementCreator.getChild(callback(item, indexObserver));\n cache.set(keyId, {\n keyId,\n isNew: true,\n item,\n child: new WeakRef(child),\n indexObserver: (indexObserver ? new WeakRef(indexObserver) : null)\n });\n keysCache.set(item, keyId);\n if(Validator.isObject(item)) {\n nodeCacheByElement.set(item, child);\n }\n return child;\n } catch (e) {\n DebugManager.error('ForEach', `Error creating element for key ${keyId}` , e);\n throw e;\n }\n };\n const getChildByKey = function(keyId, fragment) {\n const cacheItem = cache.get(keyId);\n if(!cacheItem) {\n return null;\n }\n const child = cacheItem.child?.deref();\n if(!child) {\n removeCacheItem(cacheItem, false);\n return null;\n }\n return child;\n };\n\n const removeByKey = function(keyId, fragment) {\n const cacheItem = cache.get(keyId);\n if(!cacheItem) {\n return null;\n }\n const child = cacheItem.child?.deref();\n if(!child) {\n return null;\n }\n\n if(fragment) {\n fragment.appendChild(child);\n return;\n }\n child.remove();\n }\n\n const Actions = {\n toFragment(items, startIndexFrom = 0){\n const fragment = document.createDocumentFragment();\n for(let i = 0, length = items.length; i < length; i++) {\n fragment.append(buildItem(items[i], lastNumberOfItems));\n lastNumberOfItems++;\n }\n return fragment;\n },\n add(items, delay = 0) {\n setTimeout(() => {\n element.appendElement(Actions.toFragment(items))\n }, delay);\n },\n replace(items) {\n clear();\n Actions.add(items);\n },\n reOrder(items) {\n let child = null;\n const fragment = document.createDocumentFragment();\n for(const item of items) {\n child = nodeCacheByElement.get(item);\n if(child) {\n fragment.appendChild(child);\n }\n }\n child = null;\n element.appendElement(fragment, blockEnd);\n },\n removeOne(element, index) {\n let child = nodeCacheByElement.get(element);\n if(child) {\n child.remove();\n nodeCacheByElement.delete(element);\n removeCacheItemByKey(getItemKey(element, index));\n }\n child = null;\n },\n clear,\n merge(items) {\n Actions.add(items, 0);\n },\n push(items) {\n let delay = 0;\n if(configs.pushDelay) {\n delay = configs.pushDelay(items) ?? 0;\n }\n\n Actions.add(items, delay);\n },\n populate([target, iteration, callback]) {\n const fragment = document.createDocumentFragment();\n for (let i = 0; i < iteration; i++) {\n const data = callback(i);\n target.push(data);\n fragment.append(buildItem(data, i));\n lastNumberOfItems++;\n }\n element.appendChild(fragment);\n fragment.replaceChildren();\n },\n unshift(values){\n element.insertBefore(Actions.toFragment(values), blockStart.nextSibling);\n },\n splice(args, deleted) {\n const [start, deleteCount, ...values] = args;\n let elementBeforeFirst = null;\n const garbageFragment = document.createDocumentFragment();\n\n if(deleted.length > 0) {\n let firstKey = getItemKey(deleted[0], start);\n if(deleted.length === 1) {\n removeByKey(firstKey, garbageFragment);\n } else if(deleted.length > 1) {\n const firstChildRemoved = getChildByKey(firstKey);\n elementBeforeFirst = firstChildRemoved?.previousSibling;\n\n for(let i = 0; i < deleted.length; i++) {\n const keyId = getItemKey(deleted[i], start + i, key);\n removeByKey(keyId, garbageFragment);\n }\n }\n } else {\n elementBeforeFirst = blockEnd;\n }\n garbageFragment.replaceChildren();\n\n if(values && values.length && elementBeforeFirst) {\n element.insertBefore(Actions.toFragment(values), elementBeforeFirst.nextSibling);\n }\n\n },\n reverse(_, reversed) {\n Actions.reOrder(reversed);\n },\n sort(_, sorted) {\n Actions.reOrder(sorted);\n },\n remove(_, deleted) {\n Actions.removeOne(deleted);\n },\n pop(_, deleted) {\n Actions.removeOne(deleted);\n },\n shift(_, deleted) {\n Actions.removeOne(deleted);\n },\n swap(args, elements) {\n const parent = blockEnd.parentNode;\n\n let childA = nodeCacheByElement.get(elements[0]);\n let childB = nodeCacheByElement.get(elements[1]);\n if(!childA || !childB) {\n return;\n }\n\n const childBNext = childB.nextSibling;\n parent.insertBefore(childB, childA);\n parent.insertBefore(childA, childBNext);\n childA = null;\n childB = null;\n }\n };\n\n const buildContent = (items, _, operations) => {\n if(operations?.action === 'populate') {\n Actions.populate(operations.args, operations.result);\n } else {\n console.log(lastNumberOfItems);\n if(operations.action === 'clear' || !items.length) {\n if(lastNumberOfItems === 0) {\n return;\n }\n clear();\n }\n\n if(!operations?.action) {\n if(lastNumberOfItems === 0) {\n Actions.add(items);\n return;\n }\n Actions.replace(items);\n }\n else if(Actions[operations.action]) {\n Actions[operations.action](operations.args, operations.result);\n }\n }\n\n console.log(items)\n updateIndexObservers(items, 0);\n };\n\n buildContent(data.val(), null, {action: null});\n if(Validator.isObservable(data)) {\n data.subscribe(buildContent);\n }\n\n return element;\n}","import { Observable } from \"../../data/Observable\";\nimport Validator from \"../../utils/validator\";\nimport DebugManager from \"../../utils/debug-manager.js\";\nimport Anchor from \"../anchor\";\nimport {ElementCreator} from \"../../wrappers/ElementCreator\";\n\n/**\n * Show the element if the condition is true\n *\n * @param {ObservableItem|ObservableChecker} condition\n * @param {*} child\n * @param {string|null} comment\n * @returns {DocumentFragment}\n */\nexport const ShowIf = function(condition, child, comment = null) {\n if(!(Validator.isObservable(condition))) {\n return DebugManager.warn('ShowIf', \"ShowIf : condition must be an Observable / \"+comment, condition);\n }\n const element = new Anchor('Show if : '+(comment || ''));\n\n let childElement = null;\n const getChildElement = () => {\n if(childElement) {\n return childElement;\n }\n childElement = ElementCreator.getChild(child);\n return childElement;\n };\n\n const currentValue = condition.val();\n\n if(currentValue) {\n element.appendChild(getChildElement());\n }\n condition.subscribe(value => {\n if(value) {\n element.appendChild(getChildElement());\n } else {\n element.remove();\n }\n });\n\n return element;\n}\n\n/**\n * Hide the element if the condition is true\n * @param {ObservableItem|ObservableChecker} condition\n * @param child\n * @param comment\n * @returns {DocumentFragment}\n */\nexport const HideIf = function(condition, child, comment) {\n\n const hideCondition = Observable(!condition.val());\n condition.subscribe(value => hideCondition.set(!value));\n\n return ShowIf(hideCondition, child, comment);\n}\n\n/**\n * Hide the element if the condition is false\n *\n * @param {ObservableItem|ObservableChecker} condition\n * @param {*} child\n * @param {string|null} comment\n * @returns {DocumentFragment}\n */\nexport const HideIfNot = function(condition, child, comment) {\n return ShowIf(condition, child, comment);\n}","import NativeDocumentError from \"../../errors/NativeDocumentError\";\nimport Validator from \"../../utils/validator\";\nimport Anchor from \"../anchor\";\nimport {ElementCreator} from \"../../wrappers/ElementCreator\";\n\n\n\n/**\n *\n * @param {ObservableItem|ObservableChecker} $condition\n * @param {{[key]: *}} values\n * @param {Boolean} shouldKeepInCache\n * @returns {DocumentFragment}\n */\nexport const Match = function($condition, values, shouldKeepInCache = true) {\n\n if(!Validator.isObservable($condition)) {\n throw new NativeDocumentError(\"Toggle : condition must be an Observable\");\n }\n\n const anchor = new Anchor();\n const cache = new Map();\n\n const getItem = function(key) {\n if(shouldKeepInCache && cache.has(key)) {\n return cache.get(key);\n }\n let item = values[key];\n if(!item) {\n return null;\n }\n item = ElementCreator.getChild(item);\n shouldKeepInCache && cache.set(key, item);\n return item;\n }\n\n const defaultValue = $condition.val();\n const defaultContent = getItem(defaultValue);\n if(defaultContent) {\n anchor.appendChild(defaultContent);\n }\n\n $condition.subscribe(value => {\n const content = getItem(value);\n anchor.remove();\n if(content) {\n anchor.appendChild(content);\n }\n })\n\n return anchor;\n}\n\n\n/**\n *\n * @param {ObservableItem|ObservableChecker} $condition\n * @param {*} onTrue\n * @param {*} onFalse\n * @returns {DocumentFragment}\n */\nexport const Switch = function ($condition, onTrue, onFalse) {\n\n if(!Validator.isObservable($condition)) {\n throw new NativeDocumentError(\"Toggle : condition must be an Observable\");\n }\n\n return Match($condition, {\n true: onTrue,\n false: onFalse,\n });\n}\n\n/**\n *\n * @param {ObservableItem|ObservableChecker} $condition\n * @returns {{show: Function, otherwise: (((*) => {}):DocumentFragment)}\n */\nexport const When = function($condition) {\n if(!Validator.isObservable($condition)) {\n throw new NativeDocumentError(\"When : condition must be an Observable\");\n }\n\n let $onTrue = null;\n let $onFalse = null;\n\n return {\n show(onTrue) {\n $onTrue = onTrue;\n return this;\n },\n otherwise(onFalse) {\n $onFalse = onFalse;\n return Switch($condition, $onTrue, $onFalse);\n }\n }\n}","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const Div = HtmlElementWrapper('div');\nexport const Span = HtmlElementWrapper('span');\nexport const Label = HtmlElementWrapper('label');\nexport const P = HtmlElementWrapper('p');\nexport const Paragraph = P;\nexport const Strong = HtmlElementWrapper('strong');\nexport const H1 = HtmlElementWrapper('h1');\nexport const H2 = HtmlElementWrapper('h2');\nexport const H3 = HtmlElementWrapper('h3');\nexport const H4 = HtmlElementWrapper('h4');\nexport const H5 = HtmlElementWrapper('h5');\nexport const H6 = HtmlElementWrapper('h6');\n\nexport const Br = HtmlElementWrapper('br');\n\nexport const Link = HtmlElementWrapper('a');\nexport const Pre = HtmlElementWrapper('pre');\nexport const Code = HtmlElementWrapper('code');\nexport const Blockquote = HtmlElementWrapper('blockquote');\nexport const Hr = HtmlElementWrapper('hr');\nexport const Em = HtmlElementWrapper('em');\nexport const Small = HtmlElementWrapper('small');\nexport const Mark = HtmlElementWrapper('mark');\nexport const Del = HtmlElementWrapper('del');\nexport const Ins = HtmlElementWrapper('ins');\nexport const Sub = HtmlElementWrapper('sub');\nexport const Sup = HtmlElementWrapper('sup');\nexport const Abbr = HtmlElementWrapper('abbr');\nexport const Cite = HtmlElementWrapper('cite');\nexport const Quote = HtmlElementWrapper('q');","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const Dl = HtmlElementWrapper('dl');\nexport const Dt = HtmlElementWrapper('dt');\nexport const Dd = HtmlElementWrapper('dd');","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\n\nexport const Form = HtmlElementWrapper('form', function(el) {\n\n el.submit = function(action) {\n if(typeof action === 'function') {\n el.onSubmit((e) => {\n e.preventDefault();\n action(e);\n });\n return el;\n }\n this.setAttribute('action', action);\n return el;\n };\n el.multipartFormData = function() {\n this.setAttribute('enctype', 'multipart/form-data');\n return el;\n }\n el.post = function(action) {\n this.setAttribute('method', 'post');\n this.setAttribute('action', action);\n return el;\n };\n el.get = function(action) {\n this.setAttribute('method', 'get');\n this.setAttribute('action', action);\n };\n return el;\n});\n\nexport const Input = HtmlElementWrapper('input');\n\nexport const TextArea = HtmlElementWrapper('textarea');\nexport const TextInput = TextArea;\n\nexport const Select = HtmlElementWrapper('select');\nexport const FieldSet = HtmlElementWrapper('fieldset', );\nexport const Option = HtmlElementWrapper('option');\nexport const Legend = HtmlElementWrapper('legend');\nexport const Datalist = HtmlElementWrapper('datalist');\nexport const Output = HtmlElementWrapper('output');\nexport const Progress = HtmlElementWrapper('progress');\nexport const Meter = HtmlElementWrapper('meter');\n\nexport const ReadonlyInput = (attributes) => Input({ readonly: true, ...attributes });\nexport const HiddenInput = (attributes) => Input({type: 'hidden', ...attributes });\nexport const FileInput = (attributes) => Input({ type: 'file', ...attributes });\nexport const PasswordInput = (attributes) => Input({ type: 'password', ...attributes });\nexport const Checkbox = (attributes) => Input({ type: 'checkbox', ...attributes });\nexport const Radio = (attributes) => Input({ type: 'radio', ...attributes });\n\nexport const RangeInput = (attributes) => Input({ type: 'range', ...attributes });\nexport const ColorInput = (attributes) => Input({ type: 'color', ...attributes });\nexport const DateInput = (attributes) => Input({ type: 'date', ...attributes });\nexport const TimeInput = (attributes) => Input({ type: 'time', ...attributes });\nexport const DateTimeInput = (attributes) => Input({ type: 'datetime-local', ...attributes });\nexport const WeekInput = (attributes) => Input({ type: 'week', ...attributes });\nexport const MonthInput = (attributes) => Input({ type: 'month', ...attributes });\nexport const SearchInput = (attributes) => Input({ type: 'search', ...attributes });\nexport const TelInput = (attributes) => Input({ type: 'tel', ...attributes });\nexport const UrlInput = (attributes) => Input({ type: 'url', ...attributes });\nexport const EmailInput = (attributes) => Input({ type: 'email', ...attributes });\nexport const NumberInput = (attributes) => Input({ type: 'number', ...attributes });\n\n\nexport const Button = HtmlElementWrapper('button');\nexport const SimpleButton = (child, attributes) => Button(child, { type: 'button', ...attributes });\nexport const SubmitButton = (child, attributes) => Button(child, { type: 'submit', ...attributes });\n\n","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const Main = HtmlElementWrapper('main');\nexport const Section = HtmlElementWrapper('section');\nexport const Article = HtmlElementWrapper('article');\nexport const Aside = HtmlElementWrapper('aside');\nexport const Nav = HtmlElementWrapper('nav');\nexport const Figure = HtmlElementWrapper('figure');\nexport const FigCaption = HtmlElementWrapper('figcaption');\n\nexport const Header = HtmlElementWrapper('header');\nexport const Footer = HtmlElementWrapper('footer');\n","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\"\nimport Validator from \"../utils/validator\";\nimport NativeDocumentError from \"../errors/NativeDocumentError\";\n\nexport const BaseImage = HtmlElementWrapper('img');\nexport const Img = function(src, attributes) {\n return BaseImage({ src, ...attributes });\n};\n\n/**\n *\n * @param {string} src\n * @param {string|null} defaultImage\n * @param {Object} attributes\n * @param {?Function} callback\n * @returns {Image}\n */\nexport const AsyncImg = function(src, defaultImage, attributes, callback) {\n const image = Img(defaultImage || src, attributes);\n const img = new Image();\n img.onload = () => {\n Validator.isFunction(callback) && callback(null, image);\n image.src = src;\n };\n img.onerror = () => {\n Validator.isFunction(callback) && callback(new NativeDocumentError('Image not found'));\n };\n if(Validator.isObservable(src)) {\n src.subscribe(newSrc => {\n img.src = newSrc;\n });\n }\n img.src = src;\n return image;\n};\n\n/**\n *\n * @param {string} src\n * @param {Object} attributes\n * @returns {Image}\n */\nexport const LazyImg = function(src, attributes) {\n return Img(src, { ...attributes, loading: 'lazy' });\n};","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\n\nexport const Details = HtmlElementWrapper('details');\nexport const Summary = HtmlElementWrapper('summary');\nexport const Dialog = HtmlElementWrapper('dialog');\nexport const Menu = HtmlElementWrapper('menu');","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const OrderedList = HtmlElementWrapper('ol');\nexport const UnorderedList = HtmlElementWrapper('ul');\nexport const ListItem = HtmlElementWrapper('li');\n\nexport const Li = ListItem;\nexport const Ol = OrderedList;\nexport const Ul = UnorderedList;\n\n","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const Audio = HtmlElementWrapper('audio');\nexport const Video = HtmlElementWrapper('video');\nexport const Source = HtmlElementWrapper('source');\nexport const Track = HtmlElementWrapper('track');\nexport const Canvas = HtmlElementWrapper('canvas');\nexport const Svg = HtmlElementWrapper('svg');","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const Time = HtmlElementWrapper('time');\nexport const Data = HtmlElementWrapper('data');\nexport const Address = HtmlElementWrapper('address');\nexport const Kbd = HtmlElementWrapper('kbd');\nexport const Samp = HtmlElementWrapper('samp');\nexport const Var = HtmlElementWrapper('var');\nexport const Wbr = HtmlElementWrapper('wbr');","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport const Caption = HtmlElementWrapper('caption');\nexport const Table = HtmlElementWrapper('table');\nexport const THead = HtmlElementWrapper('thead');\nexport const TFoot = HtmlElementWrapper('tfoot');\nexport const TBody = HtmlElementWrapper('tbody');\nexport const Tr = HtmlElementWrapper('tr');\nexport const TRow = Tr;\nexport const Th = HtmlElementWrapper('th');\nexport const THeadCell = Th;\nexport const TFootCell = Th;\nexport const Td = HtmlElementWrapper('td');\nexport const TBodyCell = Td;","import HtmlElementWrapper from \"../wrappers/HtmlElementWrapper\";\n\nexport * from './control/for-each';\nexport * from './control/for-each-array';\nexport * from './control/show-if';\nexport * from './control/switch';\nexport * from './content-formatter';\nexport * from './description-list';\nexport * from './form';\nexport * from './html5-semantics';\nexport * from './img';\nexport * from './interactive';\nexport * from './list';\nexport * from './medias';\nexport * from './meta-data';\nexport * from './table';\n\nexport const Fragment = HtmlElementWrapper('');\n\n\n\n\n","import {trim} from \"../utils/helpers.js\";\n\nexport const RouteParamPatterns = {\n\n};\n\n/**\n *\n * @param {string} $path\n * @param {Function} $component\n * @param {{name:?string, middlewares:Function[], shouldRebuild:Boolean, with: Object }}$options\n * @class\n */\nexport function Route($path, $component, $options = {}) {\n\n $path = '/'+trim($path, '/');\n\n let $pattern = null;\n let $name = $options.name || null;\n\n const $middlewares = $options.middlewares || [];\n const $shouldRebuild = $options.shouldRebuild || false;\n const $paramsValidators = $options.with || {};\n\n const $params = {};\n const $paramsNames = [];\n\n\n const paramsExtractor = (description) => {\n if(!description) return null;\n const [name, type] = description.split(':');\n\n let pattern = $paramsValidators[name];\n if(!pattern && type) {\n pattern = RouteParamPatterns[type];\n }\n if(!pattern) {\n pattern = '[^/]+';\n }\n\n pattern = pattern.replace('(', '(?:');\n\n return { name, pattern: `(${pattern})` };\n };\n\n const getPattern = () => {\n if($pattern) {\n return $pattern;\n }\n\n const patternDescription = $path.replace(/\\{(.*?)}/ig, (block, definition) => {\n const description = paramsExtractor(definition);\n if(!description || !description.pattern) return block;\n $params[description.name] = description.pattern;\n $paramsNames.push(description.name);\n return description.pattern;\n });\n\n $pattern = new RegExp('^'+patternDescription+'$');\n return $pattern;\n };\n\n this.name = () => $name;\n this.component = () => $component;\n this.middlewares = () => $middlewares;\n this.shouldRebuild = () => $shouldRebuild;\n this.path = () => $path;\n\n /**\n *\n * @param {string} path\n */\n this.match = function(path) {\n path = '/'+trim(path, '/');\n const match = getPattern().exec(path);\n if(!match) return false;\n const params = {};\n\n getPattern().exec(path).forEach((value, index) => {\n if(index < 1) return;\n const name = $paramsNames[index - 1];\n params[name] = value;\n });\n\n return params;\n };\n /**\n * @param {{params: ?Object, query: ?Object, basePath: ?string}} configs\n */\n this.url = function(configs) {\n const path = $path.replace(/\\{(.*?)}/ig, (block, definition) => {\n const description = paramsExtractor(definition);\n if(configs.params && configs.params[description.name]) {\n return configs.params[description.name];\n }\n throw new Error(`Missing parameter '${description.name}'`);\n });\n\n const queryString = (typeof configs.query === 'object') ? (new URLSearchParams(configs.query)).toString() : null;\n return (configs.basePath ? configs.basePath : '') + (queryString ? `${path}?${queryString}` : path);\n }\n}","\n\nexport default class RouterError extends Error {\n constructor(message, context) {\n super(message);\n this.context = context;\n }\n\n}","import {trim} from \"../utils/helpers.js\";\n\nexport const RouteGroupHelper = {\n /**\n *\n * @param {{suffix: string, options: {middlewares: Function[], name: string}}[]} $groupTree\n * @param {string} path\n * @returns {string}\n */\n fullPath: ($groupTree, path) => {\n const fullPath = [];\n $groupTree.forEach(group => {\n fullPath.push(trim(group.suffix, '/'));\n });\n fullPath.push(trim(path, '/'));\n return fullPath.join('/');\n },\n /**\n *\n * @param {{suffix: string, options: {middlewares: Function[], name: string}}[]} $groupTree\n * @param {Function[]} middlewares\n * @returns {Function[]}\n */\n fullMiddlewares: ($groupTree, middlewares) => {\n const fullMiddlewares = [];\n $groupTree.forEach(group => {\n if(group.options.middlewares) {\n fullMiddlewares.push(...group.options.middlewares);\n }\n });\n if(middlewares) {\n fullMiddlewares.push(...middlewares);\n }\n return fullMiddlewares;\n },\n /**\n *\n * @param {{suffix: string, options: {middlewares: Function[], name: string}}[]} $groupTree\n * @param {string} name\n * @returns {string}\n */\n fullName: ($groupTree, name) => {\n const fullName = [];\n $groupTree.forEach(group => {\n if(group.options?.name) {\n fullName.push(group.options.name);\n }\n });\n name && fullName.push(name);\n return fullName.join('.');\n }\n};","\n\nexport default function HashRouter() {\n\n const $history = [];\n let $currentIndex = 0;\n\n /**\n *\n * @param {number} delta\n */\n const go = (delta) => {\n const index = $currentIndex + delta;\n if(!$history[index]) {\n return;\n }\n $currentIndex = index;\n const { route, params, query, path } = $history[index];\n setHash(path);\n };\n\n const canGoBack = function() {\n return $currentIndex > 0;\n };\n const canGoForward = function() {\n return $currentIndex < $history.length - 1;\n };\n\n /**\n *\n * @param {string} path\n */\n const setHash = (path) => {\n window.location.replace(`${window.location.pathname}${window.location.search}#${path}`);\n }\n\n const getCurrentHash = () => window.location.hash.slice(1);\n\n /**\n * @param {string|{name:string,params?:Object, query?:Object }} target\n */\n this.push = function(target) {\n const { route, params, query, path } = this.resolve(target);\n if(path === getCurrentHash()) {\n return;\n }\n $history.splice($currentIndex + 1);\n $history.push({ route, params, query, path });\n $currentIndex++;\n setHash(path);\n };\n /**\n *\n * @param {string|{name:string,params?:Object, query?:Object }} target\n */\n this.replace = function(target) {\n const { route, params, query, path } = this.resolve(target);\n if(path === getCurrentHash()) {\n return;\n }\n $history[$currentIndex] = { route, params, query, path };\n };\n this.forward = function() {\n return canGoForward() && go(1);\n };\n this.back = function() {\n return canGoBack() && go(-1);\n };\n\n /**\n * @param {string} defaultPath\n */\n this.init = function(defaultPath) {\n window.addEventListener('hashchange', () => {\n const { route, params, query, path } = this.resolve(getCurrentHash());\n this.handleRouteChange(route, params, query, path);\n });\n const { route, params, query, path } = this.resolve(defaultPath || getCurrentHash());\n $history.push({ route, params, query, path });\n $currentIndex = 0;\n this.handleRouteChange(route, params, query, path);\n }\n};","import RouterError from '../../errors/RouterError';\nimport DebugManager from \"../../utils/debug-manager.js\";\n\nexport default function HistoryRouter() {\n\n /**\n *\n * @param {string|{name:string,params?:Object, query?:Object }} target\n */\n this.push = function(target) {\n try {\n const { route, path, params, query } = this.resolve(target);\n if(window.history.state && window.history.state.path === path) {\n return;\n }\n window.history.pushState({ name: route.name(), params, path}, route.name() || path , path);\n this.handleRouteChange(route, params, query, path);\n } catch (e) {\n DebugManager.error('HistoryRouter', 'Error in pushState', e);\n }\n };\n /**\n *\n * @param {string|{name:string,params?:Object, query?:Object }} target\n */\n this.replace = function(target) {\n const { route, path, params } = this.resolve(target);\n try {\n window.history.replaceState({ name: route.name(), params, path}, route.name() || path , path);\n this.handleRouteChange(route, params, {}, path);\n } catch(e) {\n DebugManager.error('HistoryRouter', 'Error in replaceState', e);\n }\n };\n this.forward = function() {\n window.history.forward();\n };\n\n this.back = function() {\n window.history.back();\n };\n\n /**\n * @param {string} defaultPath\n */\n this.init = function(defaultPath) {\n window.addEventListener('popstate', (event) => {\n try {\n if(!event.state || !event.state.path) {\n return;\n }\n const statePath = event.state.path;\n const {route, params, query, path} = this.resolve(statePath);\n if(!route) {\n return;\n }\n this.handleRouteChange(route, params, query, path);\n } catch(e) {\n DebugManager.error('HistoryRouter', 'Error in popstate event', e);\n }\n });\n const { route, params, query, path } = this.resolve(defaultPath || (window.location.pathname+window.location.search));\n this.handleRouteChange(route, params, query, path);\n }\n\n};","\nexport default function MemoryRouter() {\n const $history = [];\n let $currentIndex = 0;\n\n /**\n *\n * @param {number} delta\n */\n const go = (delta) => {\n const index = $currentIndex + delta;\n if(!$history[index]) {\n return;\n }\n $currentIndex = index;\n const { route, params, query, path } = $history[index];\n this.handleRouteChange(route, params, query, path);\n };\n\n const canGoBack = function() {\n return $currentIndex > 0;\n };\n const canGoForward = function() {\n return $currentIndex < $history.length - 1;\n };\n\n /**\n *\n * @param {string|{name:string,params?:Object, query?:Object }} target\n */\n this.push = function(target) {\n const { route, params, query, path} = this.resolve(target);\n if($history[$currentIndex] && $history[$currentIndex].path === path) {\n return;\n }\n $history.splice($currentIndex + 1);\n $history.push({ route, params, query, path });\n $currentIndex++;\n this.handleRouteChange(route, params, query, path);\n };\n\n /**\n *\n * @param {string|{name:string,params?:Object, query?:Object }} target\n */\n this.replace = function(target) {\n const { route, params, query, path} = this.resolve(target);\n $history[$currentIndex] = { route, params, query, path };\n this.handleRouteChange(route, params, query, path);\n };\n\n this.forward = function() {\n return canGoForward() && go(1);\n };\n\n this.back = function() {\n return canGoBack() && go(-1);\n };\n\n /**\n * @param {string} defaultPath\n */\n this.init = function(defaultPath) {\n const currentPath = defaultPath || (window.location.pathname + window.location.search);\n const { route, params, query, path } = this.resolve(currentPath);\n $history.push({ route, params, query, path });\n $currentIndex = 0;\n\n this.handleRouteChange(route, params, query, path);\n }\n};","/**\n *\n * @param {Router} router\n * @param {?HTMLElement} container\n */\nexport function RouterComponent(router, container) {\n\n const $cache = new Map();\n\n const updateContainer = function(node) {\n container.innerHTML = '';\n container.appendChild(node);\n };\n\n const handleCurrentRouterState = function(state) {\n if(!state.route) {\n return;\n }\n const { route, params, query, path } = state;\n if($cache.has(path)) {\n const cacheNode = $cache.get(path);\n updateContainer(cacheNode);\n return;\n }\n const Component = route.component();\n const node = Component({ params, query });\n $cache.set(path, node);\n updateContainer(node);\n };\n\n router.subscribe(handleCurrentRouterState);\n\n handleCurrentRouterState(router.currentState());\n return container;\n}","import {Route} from \"./Route.js\";\nimport Validator from \"../utils/validator.js\";\nimport RouterError from \"../errors/RouterError.js\";\nimport {RouteGroupHelper} from \"./RouteGroupHelper.js\";\nimport {trim} from \"../utils/helpers.js\";\nimport HashRouter from \"./modes/HashRouter.js\";\nimport HistoryRouter from \"./modes/HistoryRouter.js\";\nimport MemoryRouter from \"./modes/MemoryRouter.js\";\nimport DebugManager from \"../utils/debug-manager.js\";\nimport {RouterComponent} from \"./RouterComponent.js\";\n\nexport const DEFAULT_ROUTER_NAME = 'default';\n\n/**\n *\n * @param {{mode: 'memory'|'history'|'hash'}} $options\n * @constructor\n */\nexport default function Router($options = {}) {\n\n /** @type {Route[]} */\n const $routes = [];\n /** @type {{[string]: Route}} */\n const $routesByName = {};\n const $groupTree = [];\n const $listeners = [];\n const $currentState = { route: null, params: null, query: null, path: null, hash: null };\n\n if($options.mode === 'hash') {\n HashRouter.apply(this, []);\n } else if($options.mode === 'history') {\n HistoryRouter.apply(this, []);\n } else if($options.mode === 'memory') {\n MemoryRouter.apply(this, []);\n } else {\n throw new RouterError('Invalid router mode '+$options.mode);\n }\n\n const trigger = function(request, next) {\n for(const listener of $listeners) {\n try {\n listener(request);\n next && next(request);\n } catch (e) {\n DebugManager.warn('Route Listener', 'Error in listener:', e);\n }\n }\n }\n\n this.routes = () => [...$routes];\n this.currentState = () => ({ ...$currentState });\n\n /**\n *\n * @param {string} path\n * @param {Function} component\n * @param {{name:?string, middlewares:Function[], shouldRebuild:Boolean, with: Object }} options\n * @returns {this}\n */\n this.add = function(path, component, options) {\n const route = new Route(RouteGroupHelper.fullPath($groupTree, path), component, {\n ...options,\n middlewares: RouteGroupHelper.fullMiddlewares($groupTree, options?.middlewares || []),\n name: options?.name ? RouteGroupHelper.fullName($groupTree, options.name) : null,\n });\n $routes.push(route);\n if(route.name()) {\n $routesByName[route.name()] = route;\n }\n return this;\n };\n\n /**\n *\n * @param {string} suffix\n * @param {{ middlewares: Function[], name: string}} options\n * @param {Function} callback\n * @returns {this}\n */\n this.group = function(suffix, options, callback) {\n if(!Validator.isFunction(callback)) {\n throw new RouterError('Callback must be a function');\n }\n $groupTree.push({suffix, options});\n callback();\n $groupTree.pop();\n return this;\n };\n\n /**\n *\n * @param {string} name\n * @param {Object}params\n * @param {Object} query\n * @returns {*}\n */\n this.generateUrl = function(name, params = {}, query = {}) {\n const route = $routesByName[name];\n if(!route) {\n throw new RouterError(`Route not found for name: ${name}`);\n }\n return route.url({ params, query });\n };\n\n /**\n *\n * @param {string|{name:string,params?:Object, query?:Object }} target\n * @returns {{route:Route, params:Object, query:Object, path:string}}\n */\n this.resolve = function(target) {\n if(Validator.isJson(target)) {\n const route = $routesByName[target.name];\n if(!route) {\n throw new RouterError(`Route not found for name: ${target.name}`);\n }\n return {\n route,\n params: target.params,\n query: target.query,\n path: route.url({ ...target })\n };\n }\n\n const [urlPath, urlQuery] = target.split('?');\n const path = '/'+trim(urlPath, '/');\n let routeFound = null, params;\n\n for(const route of $routes) {\n params = route.match(path);\n if(params) {\n routeFound = route;\n break;\n }\n }\n if(!routeFound) {\n throw new RouterError(`Route not found for url: ${urlPath}`);\n }\n const queryParams = {};\n if(urlQuery) {\n const queries = new URLSearchParams(urlQuery).entries();\n for (const [key, value] of queries) {\n queryParams[key] = value;\n }\n }\n\n return { route: routeFound, params, query: queryParams, path: target };\n };\n\n /**\n *\n * @param {Function} listener\n * @returns {(function(): void)|*}\n */\n this.subscribe = function(listener) {\n if(!Validator.isFunction(listener)) {\n throw new RouterError('Listener must be a function');\n }\n $listeners.push(listener);\n return () => {\n $listeners.splice($listeners.indexOf(listener), 1);\n };\n };\n\n /**\n *\n * @param {Route} route\n * @param {Object} params\n * @param {Object} query\n * @param {string} path\n */\n this.handleRouteChange = function(route, params, query, path) {\n $currentState.route = route;\n $currentState.params = params;\n $currentState.query = query;\n $currentState.path = path;\n\n const middlewares = [...route.middlewares(), trigger];\n let currentIndex = 0;\n const request = { ...$currentState };\n\n const next = (editableRequest) => {\n currentIndex++;\n if(currentIndex >= middlewares.length) {\n return;\n }\n return middlewares[currentIndex](editableRequest || request, next);\n };\n return middlewares[currentIndex](request, next);\n };\n\n}\n\nRouter.routers = {};\n\n/**\n *\n * @param {{mode: 'memory'|'history'|'hash', name?:string, entry?: string}} options\n * @param {Function} callback\n * @param {Element} container\n */\nRouter.create = function(options, callback) {\n if(!Validator.isFunction(callback)) {\n DebugManager.error('Router', 'Callback must be a function', e);\n throw new RouterError('Callback must be a function');\n }\n const router = new Router(options);\n Router.routers[options.name || DEFAULT_ROUTER_NAME] = router;\n callback(router);\n\n router.init(options.entry);\n\n router.mount = function(container) {\n if(Validator.isString(container)) {\n const mountContainer = document.querySelector(container);\n if(!mountContainer) {\n throw new RouterError(`Container not found for selector: ${container}`);\n }\n container = mountContainer;\n } else if(!Validator.isElement(container)) {\n throw new RouterError('Container must be a string or an Element');\n }\n\n return RouterComponent(router, container);\n };\n\n return router;\n};\n\nRouter.get = function(name) {\n const router = Router.routers[name || DEFAULT_ROUTER_NAME];\n if(!router) {\n throw new RouterError(`Router not found for name: ${name}`);\n }\n return router;\n};\n\nRouter.push = function(target, name = null) {\n return Router.get(name).push(target);\n};\n\nRouter.replace = function(target, name = null) {\n return Router.get(name).replace(target);\n};\n\nRouter.forward = function(name = null) {\n return Router.get(name).forward();\n};\nRouter.back = function(name = null) {\n return Router.get(name).back();\n};\n","import Validator from \"../utils/validator.js\";\nimport {Link as NativeLink} from \"../../elements.js\";\nimport Router, {DEFAULT_ROUTER_NAME} from \"./Router.js\";\nimport RouterError from \"../errors/RouterError.js\";\n\n\nexport function Link(options, children){\n const { to, href, ...attributes } = options;\n const target = to || href;\n if(Validator.isString(target)) {\n const router = Router.get();\n return NativeLink({ ...attributes, href: target}, children).nd.onPreventClick(() => {\n router.push(target);\n });\n }\n const routerName = target.router || DEFAULT_ROUTER_NAME;\n const router = Router.get(routerName);\n console.log(routerName)\n if(!router) {\n throw new RouterError('Router not found \"'+routerName+'\" for link \"'+target.name+'\"');\n }\n const url = router.generateUrl(target.name, target.params, target.query);\n return NativeLink({ ...attributes, href: url }, children).nd.onPreventClick(() => {\n router.push(url);\n });\n}\n\nLink.blank = function(attributes, children){\n return NativeLink({ ...attributes, target: '_blank'}, children);\n};"],"names":["DebugManager","Link","NativeLink"],"mappings":";;;IAAA,IAAI,YAAY,GAAG,EAAE;;IAEsB;IAC3C,IAAI,YAAY,GAAG;IACnB,QAAQ,OAAO,EAAE,KAAK;;IAEtB,QAAQ,MAAM,GAAG;IACjB,YAAY,IAAI,CAAC,OAAO,GAAG,IAAI;IAC/B,YAAY,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC;IAC/D,SAAS;;IAET,QAAQ,OAAO,GAAG;IAClB,YAAY,IAAI,CAAC,OAAO,GAAG,KAAK;IAChC,SAAS;;IAET,QAAQ,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE;IACrC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IAC/B,YAAY,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,YAAY,IAAI,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;IACvC,YAAY,OAAO,CAAC,KAAK,EAAE;IAC3B,YAAY,OAAO,CAAC,QAAQ,EAAE;IAC9B,SAAS;;IAET,QAAQ,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE;IACtC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;IAC/B,YAAY,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,QAAQ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oBAAoB,CAAC,UAAU,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IAC7F;IACA,IAAI,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;IAC5E,IAAI,OAAOA,MAAU,CAAC,EAAE,GAAG,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,MAAM;IACtF,QAAQ,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;IACxB,KAAK,CAAC;IACN;;IAEA,IAAI,CAAC,KAAK,GAAG,SAAS,UAAU,EAAE,QAAQ,CAAC;IAC3C,IAAI,OAAOA,MAAU,CAAC,EAAE,GAAG,UAAU,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACnE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- var NativeDocument=function(t){"use strict";const n={enabled:!1,enable(){this.enabled=!0,console.log("๐Ÿ” NativeDocument Debug Mode enabled")},disable(){this.enabled=!1},log(e,t,n){this.enabled&&(console.group(`๐Ÿ” [${e}] ${t}`),n&&console.log(n),console.trace(),console.groupEnd())},warn(e,t,n){this.enabled&&console.warn(`โš ๏ธ [${e}] ${t}`,n)},error(e,t,n){console.error(`โŒ [${e}] ${t}`,n)}},r=function(){let e=0;const t=new Map;return{register(n){const r=++e;return t.set(r,new WeakRef(n)),r},unregister(e){t.delete(e)},getObservableById:e=>t.get(e)?.deref(),cleanup(){for(const[e,n]of t){const e=n.deref();e&&e.cleanup()}t.clear()},cleanObservables(e){if(t.size<e)return;let r=0;for(const[e,n]of t)n.deref()||(t.delete(e),r++);r>0&&n.log("Memory Auto Clean",`๐Ÿงน Cleaned ${r} orphaned observables`)}}}();class o extends Error{constructor(e,t={}){super(e),this.name="NativeDocumentError",this.context=t,this.timestamp=(new Date).toISOString()}}function i(e,t){this.observable=e,this.checker=t,this.unSubscriptions=[]}function s(e){if(void 0===e)throw new o("ObservableItem requires an initial value");if(e instanceof s)throw new o("ObservableItem cannot be an Observable");this.$previousValue=e,this.$currentValue=e,this.$isCleanedUp=!1,this.$listeners=null,this.$watchers=null,this.$memoryId=r.register(this)}i.prototype.subscribe=function(e){const t=this.observable.subscribe(t=>{e&&e(this.checker(t))});return this.unSubscriptions.push(t),t},i.prototype.check=function(e){return this.observable.check(()=>e(this.val()))},i.prototype.val=function(){return this.checker&&this.checker(this.observable.val())},i.prototype.set=function(e){return this.observable.set(e)},i.prototype.trigger=function(){return this.observable.trigger()},i.prototype.cleanup=function(){return this.observable.cleanup()},Object.defineProperty(s.prototype,"$value",{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0}),s.prototype.triggerListeners=function(e){const t=this.$listeners,n=this.$previousValue,r=this.$currentValue;if(e=e||{},t?.length)for(let o=0,i=t.length;o<i;o++)t[o](r,n,e)},s.prototype.triggerWatchers=function(){if(!this.$watchers)return;const e=this.$watchers,t=this.$previousValue,n=this.$currentValue;if(e.has(n)){e.get(n).forEach(e=>{e.ifTrue.called||(e.ifTrue.callback(),e.else.called=!1)})}if(e.has(t)){e.get(t).forEach(e=>{e.else.called||(e.else.callback(),e.ifTrue.called=!1)})}},s.prototype.trigger=function(e){this.triggerListeners(e),this.triggerWatchers()},s.prototype.set=function(e){const t="function"==typeof e?e(this.$currentValue):e;this.$currentValue!==t&&(this.$previousValue=this.$currentValue,this.$currentValue=t,this.trigger())},s.prototype.val=function(){return this.$currentValue},s.prototype.disconnectAll=function(){if(this.$listeners?.splice(0),this.$previousValue=null,this.$currentValue=null,this.$watchers)for(const[e,t]of this.$watchers){for(const e of t)e.ifTrue.callback=null,e.else.callback=null;t.clear()}this.$watchers?.clear(),this.$listeners=null,this.$watchers=null},s.prototype.cleanup=function(){r.unregister(this.$memoryId),this.disconnectAll(),this.$isCleanedUp=!0,delete this.$value},s.prototype.subscribe=function(e){if(this.$listeners=this.$listeners??[],this.$isCleanedUp)return n.warn("Observable subscription","โš ๏ธ Attempted to subscribe to a cleaned up observable."),()=>{};if("function"!=typeof e)throw new o("Callback must be a function");return this.$listeners.push(e),()=>this.unsubscribe(e)},s.prototype.on=function(e,t,n){this.$watchers=this.$watchers??new Map;let r=this.$watchers.get(e);r||(r=new Set,this.$watchers.set(e,r));let o={ifTrue:{callback:t,called:!1},else:{callback:n,called:!1}};return r.add(o),()=>{r?.delete(o),0===r.size&&this.$watchers?.delete(e),r=null,o=null}},s.prototype.unsubscribe=function(e){const t=this.$listeners.indexOf(e);t>-1&&this.$listeners.splice(t,1)},s.prototype.check=function(e){return new i(this,e)},s.prototype.get=s.prototype.check,s.prototype.toString=function(){return"{{#ObItem::("+this.$memoryId+")}}"};const a=(e,t,n)=>{if(h.isFunction(n))return n(e,t);if(h.isObservable(e)){const r=e.val();return r&&n?r[n]:t}return h.isObject(e)?e[n]??t:e},u=function(e,t){return e.replace(new RegExp(`^[${t}]+|[${t}]+$`,"g"),"")},l={mounted:new WeakMap,mountedSupposedSize:0,unmounted:new WeakMap,unmountedSupposedSize:0,observer:null,checkMutation:function(e,t,n={}){let r=null,o=null;return function(...i){const s=!0===n.context?this:null;n.check&&n.check(...i),o=i,clearTimeout(r),r=setTimeout(()=>function(e,t,n){n?e.apply(n,t):e(...t)}(e,o,s),t)}}(function(e){for(const t of e){if(l.mountedSupposedSize>0)for(const e of t.addedNodes){const t=l.mounted.get(e);t&&(t.inDom=!0,t.mounted&&t.mounted(e))}if(l.unmountedSupposedSize>0)for(const e of t.removedNodes){const t=l.unmounted.get(e);t&&(t.inDom=!1,t.unmounted&&!0===t.unmounted(e)&&(t.disconnect(),e.nd?.remove()))}}},16),watch:function(e,t=!1){let n={inDom:t,mounted:null,unmounted:null,disconnect:()=>{l.mounted.delete(e),l.unmounted.delete(e),l.mountedSupposedSize--,l.unmountedSupposedSize--,n=null}};return{disconnect:n.disconnect,mounted:t=>{n.mounted=t,l.mounted.set(e,n),l.mountedSupposedSize++},unmounted:t=>{n.unmounted=t,l.unmounted.set(e,n),l.unmountedSupposedSize++}}}};l.observer=new MutationObserver(l.checkMutation),l.observer.observe(document.body,{childList:!0,subtree:!0});const c=["Click","DblClick","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Blur","Change","Focus","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","AfterPrint","BeforePrint","BeforeUnload","Error","HashChange","Load","Offline","Online","PageHide","PageShow","Resize","Scroll","Unload","Abort","CanPlay","CanPlayThrough","DurationChange","Emptied","Ended","LoadedData","LoadedMetadata","LoadStart","Pause","Play","Playing","Progress","RateChange","Seeked","Seeking","Stalled","Suspend","TimeUpdate","VolumeChange","Waiting"];function d(e){this.$element=e,this.$observer=null}for(const e of c){const t=e.toLowerCase();d.prototype["on"+e]=function(e){return this.$element.addEventListener(t,e),this},d.prototype["onPrevent"+e]=function(e){return this.$element.addEventListener(t,function(t){t.preventDefault(),e(t)}),this},d.prototype["onStop"+e]=function(e){return this.$element.addEventListener(t,function(t){t.stopPropagation(),e(t)}),this},d.prototype["onPreventStop"+e]=function(e){return this.$element.addEventListener(t,function(t){t.stopPropagation(),t.preventDefault(),e(t)}),this}}d.prototype.ref=function(e,t){return e[t]=element,this},d.prototype.unmountChildren=function(){let e=this.$element;for(let t=0,n=e.children.length;t<n;t++){let n=e.children[t];n.$ndProx||n.nd?.remove(),n=null}return e=null,this},d.prototype.remove=function(){let e=this.$element;return e.nd.unmountChildren(),e.$ndProx=null,delete e.nd?.on?.prevent,delete e.nd?.on,delete e.nd,e=null,this},d.prototype.lifecycle=function(e){return this.$observer=this.$observer||l.watch(this.$element),e.mounted&&this.$observer.mounted(e.mounted),e.unmounted&&this.$observer.unmounted(e.unmounted),this},d.prototype.mounted=function(e){return this.lifecycle({mounted:e})},d.prototype.mounted=function(e){return this.lifecycle({unmounted:e})};const h={isObservable:e=>e instanceof s||e instanceof i,isProxy:e=>e?.__isProxy__,isObservableChecker:e=>e instanceof i,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isNumber:e=>"number"==typeof e,isBoolean:e=>"boolean"==typeof e,isFunction:e=>"function"==typeof e,isAsyncFunction:e=>"function"==typeof e&&"AsyncFunction"===e.constructor.name,isObject:e=>"object"==typeof e,isJson:e=>"object"==typeof e&&null!==e&&"Object"===e.constructor.name&&!Array.isArray(e),isElement:e=>e instanceof HTMLElement||e instanceof DocumentFragment||e instanceof Text,isFragment:e=>e instanceof DocumentFragment,isStringOrObservable(e){return this.isString(e)||this.isObservable(e)},isValidChild(e){return null===e||this.isElement(e)||this.isObservable(e)||this.isNDElement(e)||["string","number","boolean"].includes(typeof e)},isNDElement:e=>e instanceof d,isValidChildren(e){Array.isArray(e)||(e=[e]);return 0===e.filter(e=>!this.isValidChild(e)).length},validateChildren(e){Array.isArray(e)||(e=[e]);const t=e.filter(e=>!this.isValidChild(e));if(t.length>0)throw new o(`Invalid children detected: ${t.map(e=>typeof e).join(", ")}`);return e},containsObservables:e=>!!e&&(h.isObject(e)&&Object.values(e).some(e=>h.isObservable(e))),containsObservableReference:e=>!(!e||"string"!=typeof e)&&/\{\{#ObItem::\([0-9]+\)\}\}/.test(e),validateAttributes(e){if(!e||"object"!=typeof e)return e;const t=[],r=Object.keys(e).filter(e=>t.includes(e));return r.length>0&&n.warn("Validator",`Reserved attributes found: ${r.join(", ")}`),e},validateEventCallback(e){if("function"!=typeof e)throw new o("Event callback must be a function")}};function p(e){const t=document.createDocumentFragment(),r=document.createComment("Anchor Start : "+e),o=document.createComment("/ Anchor End "+e);t.appendChild(r),t.appendChild(o),t.nativeInsertBefore=t.insertBefore,t.nativeAppendChild=t.appendChild;const i=function(e,n,r){e!==t?e.insertBefore(C.getChild(n),r):e.nativeInsertBefore(C.getChild(n),r)};return t.appendElement=function(e,n=null){o.parentNode!==t?o.parentNode?.insertBefore(e,n||o):o.parentNode.nativeInsertBefore(e,n||o)},t.appendChild=function(e,r=null){const s=o.parentNode;if(s){if(r=r??o,h.isArray(e)){const n=document.createDocumentFragment();for(let t=0,r=e.length;t<r;t++)n.appendChild(C.getChild(e[t]));return i(s,n,r),t}i(s,e,r)}else n.error("Anchor","Anchor : parent not found",e)},t.removeChildren=function(){const e=o.parentNode;if(e===t)return;if(e.firstChild===r&&e.lastChild===o)return void e.replaceChildren(r,o);let n,i=r.nextSibling;const s=document.createDocumentFragment();for(;i&&i!==o;)n=i.nextSibling,s.append(i),i=n;s.replaceChildren()},t.remove=function(){if(o.parentNode===t)return;let e,n=r.nextSibling;for(;n!==o;)e=n.nextSibling,t.nativeAppendChild(n),n=e},t.removeWithAnchors=function(){t.removeChildren(),r.remove(),o.remove()},t.replaceContent=function(e){const n=o.parentNode;n&&(n.firstChild!==r||n.lastChild!==o?(t.removeChildren(),n.insertBefore(e,o)):n.replaceChildren(r,e,o))},t.insertBefore=function(e,n=null){t.appendChild(e,n)},t.clear=function(){t.remove()},t.endElement=function(){return o},t.startElement=function(){return r},t}const f=["checked","selected","disabled","readonly","required","autofocus","multiple","autocomplete","hidden","contenteditable","spellcheck","translate","draggable","async","defer","autoplay","controls","loop","muted","download","reversed","open","default","formnovalidate","novalidate","scoped","itemscope","allowfullscreen","allowpaymentrequest","playsinline"];function m(e){return new s(e)}function b(e,t){for(let n in t){const r=t[n];h.isObservable(r)?(e.classList.toggle(n,r.val()),r.subscribe(t=>e.classList.toggle(n,t))):e.classList.toggle(n,r)}}function g(e,t){for(let n in t){const r=t[n];h.isObservable(r)?(e.style[n]=r.val(),r.subscribe(t=>{e.style[n]=t})):e.style[n]=r}}function v(e,t,n){const r=h.isObservable(n)?n.val():n;h.isBoolean(r)?e[t]=r:e[t]=r===e.value,h.isObservable(n)&&(["checked"].includes(t)&&e.addEventListener("input",()=>{h.isBoolean(r)?n.set(e[t]):n.set(e.value)}),n.subscribe(n=>{h.isBoolean(n)?e[t]=n:e[t]=n===e.value}))}function y(e,t,n){const r=n=>{"value"!==t?e.setAttribute(t,n):e.value=n};r(n.val()),n.subscribe(r),"value"===t&&e.addEventListener("input",()=>n.set(e.value))}m.getById=function(e){const t=r.getObservableById(parseInt(e));if(!t)throw new o("Observable.getById : No observable found with id "+e);return t},m.cleanup=function(e){e.cleanup()},m.autoCleanup=function(e=!1,t={}){if(!e)return;const{interval:n=6e4,threshold:o=100}=t;window.addEventListener("beforeunload",()=>{r.cleanup()}),setInterval(()=>r.cleanObservables(o),n)};const w=new Map;let $=null;const C={createTextNode:()=>($||($=document.createTextNode("")),$.cloneNode()),createObservableNode(e,t){const n=C.createTextNode();return t.subscribe(e=>n.nodeValue=String(e)),n.nodeValue=t.val(),e&&e.appendChild(n),n},createStaticTextNode(e,t){let n=C.createTextNode();return n.nodeValue=String(t),e&&e.appendChild(n),n},createElement(e){if(e){if(w.has(e))return w.get(e).cloneNode();const t=document.createElement(e);return w.set(e,t),t.cloneNode()}return new p("Fragment")},processChildren(e,t){if(null===e)return;const n=Array.isArray(e)?e:[e];for(let e=0,r=n.length;e<r;e++){let r=this.getChild(n[e]);null!==r&&t.appendChild(r)}},getChild(e){if(null===e)return null;if(h.isString(e)&&h.isFunction(e.resolveObservableTemplate)&&(e=e.resolveObservableTemplate()),h.isString(e))return C.createStaticTextNode(null,e);if(h.isObservable(e))return C.createObservableNode(null,e);if(h.isArray(e)){const t=document.createDocumentFragment();for(let n=0,r=e.length;n<r;n++)t.appendChild(this.getChild(e[n]));return t}return h.isFunction(e)?this.getChild(e()):h.isElement(e)?e:h.isNDElement(e)?e.$element:C.createStaticTextNode(null,e)},processAttributes(e,t){h.isFragment(e)||t&&function(e,t){if(h.validateAttributes(t),!h.isObject(t))throw new o("Attributes must be an object");for(let n in t){const r=n.toLowerCase();let o=t[r];if(h.isString(o)&&h.isFunction(o.resolveObservableTemplate)&&(o=o.resolveObservableTemplate(),h.isArray(o))){const e=o.filter(e=>h.isObservable(e));o=m.computed(()=>o.map(e=>h.isObservable(e)?e.val():e).join(" ")||" ",e)}f.includes(r)?v(e,r,o):h.isObservable(o)?y(e,r,o):"class"===r&&h.isJson(o)?b(e,o):"style"===r&&h.isJson(o)?g(e,o):e.setAttribute(r,o)}}(e,t)},setup:(e,t,n)=>e};function O(e,t){const r=e.toLowerCase();return function(e,o=null){try{if(!h.isJson(e)){const t=o;o=e,e=t}const n=C.createElement(r),i="function"==typeof t?t(n):n;return C.processAttributes(i,e),C.processChildren(o,i),C.setup(i,e,t)}catch(e){n.error("ElementCreation",`Error creating ${r}`,e)}}}Object.defineProperty(HTMLElement.prototype,"nd",{get(){return this.$nd||(this.$nd=new d(this),this.$nd.nd=this.$nd),this.$nd}});class S extends Error{constructor(e,t){super(`${e}\n\n${t.join("\n")}\n\n`)}}const E={string:e=>({name:e,type:"string",validate:e=>h.isString(e)}),number:e=>({name:e,type:"number",validate:e=>h.isNumber(e)}),boolean:e=>({name:e,type:"boolean",validate:e=>h.isBoolean(e)}),observable:e=>({name:e,type:"observable",validate:e=>h.isObservable(e)}),element:e=>({name:e,type:"element",validate:e=>h.isElement(e)}),function:e=>({name:e,type:"function",validate:e=>h.isFunction(e)}),object:e=>({name:e,type:"object",validate:e=>h.isObject(e)}),objectNotNull:e=>({name:e,type:"object",validate:e=>h.isObject(e)&&null!==e}),children:e=>({name:e,type:"children",validate:e=>h.validateChildren(e)}),attributes:e=>({name:e,type:"attributes",validate:e=>h.validateAttributes(e)}),optional:e=>({...e,optional:!0}),oneOf:(e,...t)=>({name:e,type:"oneOf",types:t,validate:e=>t.some(t=>t.validate(e))})},k=(e,t,n="Function")=>{if(!h.isArray(t))throw new o("withValidation : argSchema must be an array");return function(...r){return((e,t,n="Function")=>{if(!t)return;const r=[],o=t.filter(e=>!e.optional).length;if(e.length<o&&r.push(`${n}: Expected at least ${o} arguments, got ${e.length}`),t.forEach((t,o)=>{const i=o+1,s=e[o];if(void 0!==s){if(!t.validate(s)){const e=s?.constructor?.name||typeof s;r.push(`${n}: Invalid argument '${t.name}' at position ${i}, expected ${t.type}, got ${e}`)}}else t.optional||r.push(`${n}: Missing required argument '${t.name}' at position ${i}`)}),r.length>0)throw new S("Argument validation failed",r)})(r,t,e.name||n),e.apply(this,r)}};Function.prototype.args=function(...e){return k(this,e)},Function.prototype.errorBoundary=function(e){return(...t)=>{try{return this.apply(this,t)}catch(t){return e(t)}}},String.prototype.use=function(e){const t=this;return m.computed(()=>t.replace(/\$\{(.*?)}/g,(t,n)=>{const r=e[n];return h.isObservable(r)?r.val():r}),Object.values(e))},String.prototype.resolveObservableTemplate=function(){return h.containsObservableReference(this)?this.split(/(\{\{#ObItem::\([0-9]+\)\}\})/g).filter(Boolean).map(e=>{if(!h.containsObservableReference(e))return e;const[t,n]=e.match(/\{\{#ObItem::\(([0-9]+)\)\}\}/);return m.getById(n)}):this.valueOf()};const A=["push","pop","shift","unshift","reverse","sort","splice"];m.array=function(e){if(!Array.isArray(e))throw new o("Observable.array : target must be an array");const t=m(e);A.forEach(e=>{t[e]=function(...n){const r=t.val()[e](...n);return t.trigger({action:e,args:n,result:r}),r}}),t.clear=function(){return t.$value.length=0,t.trigger({action:"clear"}),!0},t.merge=function(e){t.$value=[...t.$value,...e]},t.populateAndRender=function(e,n){t.trigger({action:"populate",args:[t.$value,e,n]})},t.remove=function(e){const n=t.$value.splice(e,1);return 0===n.length?[]:(t.trigger({action:"remove",args:[e],result:n[0]}),n)},t.swap=function(e,n){const r=t.$value,o=r.length;if(o<e||o<n)return!1;if(n<e){const t=e;e=n,n=t}const i=r[e],s=r[n];return r[e]=s,r[n]=i,t.trigger({action:"swap",args:[e,n],result:[i,s]}),!0},t.length=function(){return t.$value.length};return["map","filter","reduce","some","every","find","findIndex","concat"].forEach(e=>{t[e]=function(...n){return t.val()[e](...n)}}),t},m.batch=function(e){const t=m(0),n=function(){if(h.isAsyncFunction(e))return e(...arguments).then(()=>{t.trigger()}).catch(e=>{throw e});e(...arguments),t.trigger()};return n.$observer=t,n},m.init=function(e){const t={};for(const n in e){const r=e[n];h.isJson(r)?t[n]=m.init(r):h.isArray(r)?t[n]=m.array(r):t[n]=m(r)}const n=function(){};return new Proxy(t,{get:(e,r)=>"__isProxy__"===r||("$value"===r?function(){const e={};for(const n in t){const r=t[n];h.isObservable(r)?e[n]=r.val():h.isProxy(r)?e[n]=r.$value:e[n]=r}return e}():"$clone"===r?n:void 0!==e[r]?e[r]:void 0),set(e,t,n){void 0!==e[t]&&e[t].set(n)}})},m.value=function(e){if(h.isObservable(e))return e.val();if(h.isProxy(e))return e.$value;if(h.isArray(e)){const t=[];return e.forEach(e=>{t.push(m.value(e))}),t}return e},m.update=function(e,t){for(const n in t){const r=e[n],o=t[n];if(h.isObservable(r)){if(h.isArray(o)){m.update(r,o);continue}r.set(o)}else h.isProxy(r)?m.update(r,o):e[n]=o}},m.object=m.init,m.json=m.init,m.computed=function(e,t=[]){const n=new s(e()),r=()=>n.set(e());if(h.isFunction(t)){if(!h.isObservable(t.$observer))throw new o("Observable.computed : dependencies must be valid batch function");return t.$observer.subscribe(r),n}return t.forEach(e=>e.subscribe(r)),n};const I=function(){const e=new Map;return{use(t){const{observer:n,subscribers:r}=e.get(t),o=m(n.val()),i=n.subscribe(e=>o.set(e)),s=o.subscribe(e=>n.set(e));return o.destroy=()=>{i(),s(),o.cleanup()},r.add(o),o},follow(e){return this.use(e)},create(t,n){const r=m(n);return e.set(t,{observer:r,subscribers:new Set}),r},get(t){const n=e.get(t);return n?n.observer:null},getWithSubscribers:t=>e.get(t),delete(t){const n=e.get(t);n&&(n.observer.cleanup(),n.subscribers.forEach(e=>e.destroy()),n.observer.clear())}}}();const F=function(e,t,r=null){if(!h.isObservable(e))return n.warn("ShowIf","ShowIf : condition must be an Observable / "+r,e);const o=new p("Show if : "+(r||""));let i=null;const s=()=>i||(i=C.getChild(t),i);return e.val()&&o.appendChild(s()),e.subscribe(e=>{e?o.appendChild(s()):o.remove()}),o},x=function(e,t,n=!0){if(!h.isObservable(e))throw new o("Toggle : condition must be an Observable");const r=new p,i=new Map,s=function(e){if(n&&i.has(e))return i.get(e);let r=t[e];return r?(r=C.getChild(r),n&&i.set(e,r),r):null},a=e.val(),u=s(a);return u&&r.appendChild(u),e.subscribe(e=>{const t=s(e);r.remove(),t&&r.appendChild(t)}),r},D=function(e,t,n){if(!h.isObservable(e))throw new o("Toggle : condition must be an Observable");return x(e,{true:t,false:n})},T=O("div"),R=O("span"),N=O("label"),L=O("p"),P=L,q=O("strong"),M=O("h1"),B=O("h2"),j=O("h3"),V=O("h4"),H=O("h5"),W=O("h6"),z=O("br"),_=O("a"),U=O("pre"),J=O("code"),K=O("blockquote"),Q=O("hr"),G=O("em"),X=O("small"),Y=O("mark"),Z=O("del"),ee=O("ins"),te=O("sub"),ne=O("sup"),re=O("abbr"),oe=O("cite"),ie=O("q"),se=O("dl"),ae=O("dt"),ue=O("dd"),le=O("form",function(e){return e.submit=function(t){return"function"==typeof t?(e.onSubmit(e=>{e.preventDefault(),t(e)}),e):(this.setAttribute("action",t),e)},e.multipartFormData=function(){return this.setAttribute("enctype","multipart/form-data"),e},e.post=function(t){return this.setAttribute("method","post"),this.setAttribute("action",t),e},e.get=function(e){this.setAttribute("method","get"),this.setAttribute("action",e)},e}),ce=O("input"),de=O("textarea"),he=de,pe=O("select"),fe=O("fieldset"),me=O("option"),be=O("legend"),ge=O("datalist"),ve=O("output"),ye=O("progress"),we=O("meter"),$e=O("button"),Ce=O("main"),Oe=O("section"),Se=O("article"),Ee=O("aside"),ke=O("nav"),Ae=O("figure"),Ie=O("figcaption"),Fe=O("header"),xe=O("footer"),De=O("img"),Te=function(e,t){return De({src:e,...t})},Re=O("details"),Ne=O("summary"),Le=O("dialog"),Pe=O("menu"),qe=O("ol"),Me=O("ul"),Be=O("li"),je=Be,Ve=qe,He=Me,We=O("audio"),ze=O("video"),_e=O("source"),Ue=O("track"),Je=O("canvas"),Ke=O("svg"),Qe=O("time"),Ge=O("data"),Xe=O("address"),Ye=O("kbd"),Ze=O("samp"),et=O("var"),tt=O("wbr"),nt=O("caption"),rt=O("table"),ot=O("thead"),it=O("tfoot"),st=O("tbody"),at=O("tr"),ut=at,lt=O("th"),ct=lt,dt=lt,ht=O("td"),pt=ht,ft=O("");var mt=Object.freeze({__proto__:null,Abbr:re,Address:Xe,Anchor:p,Article:Se,Aside:Ee,AsyncImg:function(e,t,n,r){const i=Te(t||e,n),s=new Image;return s.onload=()=>{h.isFunction(r)&&r(null,i),i.src=e},s.onerror=()=>{h.isFunction(r)&&r(new o("Image not found"))},h.isObservable(e)&&e.subscribe(e=>{s.src=e}),s.src=e,i},Audio:We,BaseImage:De,Blockquote:K,Br:z,Button:$e,Canvas:Je,Caption:nt,Checkbox:e=>ce({type:"checkbox",...e}),Cite:oe,Code:J,ColorInput:e=>ce({type:"color",...e}),Data:Ge,Datalist:ge,DateInput:e=>ce({type:"date",...e}),DateTimeInput:e=>ce({type:"datetime-local",...e}),Dd:ue,Del:Z,Details:Re,Dialog:Le,Div:T,Dl:se,Dt:ae,Em:G,EmailInput:e=>ce({type:"email",...e}),FieldSet:fe,FigCaption:Ie,Figure:Ae,FileInput:e=>ce({type:"file",...e}),Footer:xe,ForEach:function(e,t,r){const o=new p("ForEach"),i=o.endElement();o.startElement();let s=new Map,u=null;const l=new Set,c=e=>{for(const[t,n]of s.entries()){if(l.has(t))continue;const r=n.child?.deref();e&&r&&e.removeChild(r),n.indexObserver?.cleanup(),n.child=null,n.indexObserver=null,s.delete(n.keyId),u&&u.delete(n.keyId)}},d=(e,o)=>{const i=a(e,o,r);if(s.has(i)){const e=s.get(i);if(e.indexObserver?.set(o),e.isNew=!1,e.child?.deref())return i;s.delete(i)}try{const n=t.length>=2?m(o):null;let r=C.getChild(t(e,n));s.set(i,{keyId:i,isNew:!0,child:new WeakRef(r),indexObserver:n})}catch(e){throw n.error("ForEach",`Error creating element for key ${i}`,e),e}return i},f=()=>{const t=i.parentNode;if(!t)return;const n=h.isObservable(e)?e.val():e;if(l.clear(),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=d(n[e],e);l.add(t)}else for(const e in n){const t=d(n[e],e);l.add(t)}if(0===l.size)return o.removeChildren(),c(),void u?.clear();c(t),u&&0!==u.size?(()=>{let e=document.createDocumentFragment();const t=Array.from(l);Array.from(u);for(const n in t){const r=t[n],o=s.get(r);if(!o)continue;const i=o.child.deref();i&&e.appendChild(i)}o.replaceContent(e)})():(e=>{const t=document.createDocumentFragment();for(const e of l){const n=s.get(e);if(!n)continue;const r=n.child?.deref();r&&t.appendChild(r)}e.insertBefore(t,i)})(t),u?.clear(),u=new Set([...l])};return f(),h.isObservable(e)&&e.subscribe(f),o},ForEachArray:function(e,t,r,o={}){const i=new p("ForEach Array"),s=i.endElement(),u=i.startElement();let l=new Map,c=new WeakMap,d=0;const f=new WeakMap,b=()=>{i.removeChildren(),y(),d=0},g=(e,t)=>f.has(e)?f.get(e):a(e,t,r),v=(e,t=!0)=>{if(!e)return;const n=e.child?.deref();e.indexObserver?.deref()?.cleanup(),e.child=null,e.indexObserver=null,c.delete(e.item),f.delete(e.item),e.item=null,t&&(n?.remove(),l.delete(e.keyId))},y=()=>{for(const[e,t]of l.entries())v(t,!1);l.clear()},w=(e,r)=>{const o=g(e,r);if(l.has(o)){const e=l.get(o);e.indexObserver?.deref()?.set(r),e.isNew=!1;const t=e.child?.deref();if(t)return t;l.delete(o)}try{const n=t.length>=2?m(r):null;let i=C.getChild(t(e,n));return l.set(o,{keyId:o,isNew:!0,item:e,child:new WeakRef(i),indexObserver:n?new WeakRef(n):null}),f.set(e,o),h.isObject(e)&&c.set(e,i),i}catch(e){throw n.error("ForEach",`Error creating element for key ${o}`,e),e}},$=function(e,t){const n=l.get(e);if(!n)return null;const r=n.child?.deref();if(!r)return null;t?t.appendChild(r):r.remove()},O={toFragment(e,t=0){const n=document.createDocumentFragment();for(let t=0,r=e.length;t<r;t++)n.append(w(e[t],d)),d++;return n},add(e,t=0){setTimeout(()=>{i.appendElement(O.toFragment(e))},t)},replace(e){b(),O.add(e)},reOrder(e){let t=null;const n=document.createDocumentFragment();for(const r of e)t=c.get(r),t&&n.appendChild(t);t=null,i.appendElement(n,s)},removeOne(e,t){let n=c.get(e);n&&(n.remove(),c.delete(e),((e,t=!0)=>{v(l.get(e),t)})(g(e,t))),n=null},clear:b,merge(e){O.add(e,0)},push(e){let t=0;o.pushDelay&&(t=o.pushDelay(e)??0),O.add(e,t)},populate([e,t,n]){const r=document.createDocumentFragment();for(let o=0;o<t;o++){const t=n(o);e.push(t),r.append(w(t,o)),d++}i.appendChild(r),r.replaceChildren()},unshift(e){i.insertBefore(O.toFragment(e),u.nextSibling)},splice(e,t){const[n,r,...o]=e;let a=null;const u=document.createDocumentFragment();if(t.length>0){let e=g(t[0],n);if(1===t.length)$(e,u);else if(t.length>1){const r=function(e){const t=l.get(e);if(!t)return null;const n=t.child?.deref();return n||(v(t,!1),null)}(e);a=r?.previousSibling;for(let e=0;e<t.length;e++){const r=g(t[e],n+e);$(r,u)}}}else a=s;u.replaceChildren(),o&&o.length&&a&&i.insertBefore(O.toFragment(o),a.nextSibling)},reverse(e,t){O.reOrder(t)},sort(e,t){O.reOrder(t)},remove(e,t){O.removeOne(t)},pop(e,t){O.removeOne(t)},shift(e,t){O.removeOne(t)},swap(e,t){const n=s.parentNode;let r=c.get(t[0]),o=c.get(t[1]);if(!r||!o)return;const i=o.nextSibling;n.insertBefore(o,r),n.insertBefore(r,i),r=null,o=null}},S=(e,n,r)=>{if("populate"===r?.action)O.populate(r.args,r.result);else{if(console.log(d),"clear"===r.action||!e.length){if(0===d)return;b()}if(r?.action)O[r.action]&&O[r.action](r.args,r.result);else{if(0===d)return void O.add(e);O.replace(e)}}console.log(e),((e,n=0)=>{if(t.length<2)return;let r=n;for(let t=n,o=e?.length;t<o;t++){const n=l.get(g(e[t],t));n&&(n.indexObserver?.deref()?.set(r),r++)}})(e,0)};return S(e.val(),0,{action:null}),h.isObservable(e)&&e.subscribe(S),i},Form:le,Fragment:ft,H1:M,H2:B,H3:j,H4:V,H5:H,H6:W,Header:Fe,HiddenInput:e=>ce({type:"hidden",...e}),HideIf:function(e,t,n){const r=m(!e.val());return e.subscribe(e=>r.set(!e)),F(r,t,n)},HideIfNot:function(e,t,n){return F(e,t,n)},Hr:Q,Img:Te,Input:ce,Ins:ee,Kbd:Ye,Label:N,LazyImg:function(e,t){return Te(e,{...t,loading:"lazy"})},Legend:be,Li:je,Link:_,ListItem:Be,Main:Ce,Mark:Y,Match:x,Menu:Pe,Meter:we,MonthInput:e=>ce({type:"month",...e}),NativeDocumentFragment:p,Nav:ke,NumberInput:e=>ce({type:"number",...e}),Ol:Ve,Option:me,OrderedList:qe,Output:ve,P:L,Paragraph:P,PasswordInput:e=>ce({type:"password",...e}),Pre:U,Progress:ye,Quote:ie,Radio:e=>ce({type:"radio",...e}),RangeInput:e=>ce({type:"range",...e}),ReadonlyInput:e=>ce({readonly:!0,...e}),Samp:Ze,SearchInput:e=>ce({type:"search",...e}),Section:Oe,Select:pe,ShowIf:F,SimpleButton:(e,t)=>$e(e,{type:"button",...t}),Small:X,Source:_e,Span:R,Strong:q,Sub:te,SubmitButton:(e,t)=>$e(e,{type:"submit",...t}),Summary:Ne,Sup:ne,Svg:Ke,Switch:D,TBody:st,TBodyCell:pt,TFoot:it,TFootCell:dt,THead:ot,THeadCell:ct,TRow:ut,Table:rt,Td:ht,TelInput:e=>ce({type:"tel",...e}),TextArea:de,TextInput:he,Th:lt,Time:Qe,TimeInput:e=>ce({type:"time",...e}),Tr:at,Track:Ue,Ul:He,UnorderedList:Me,UrlInput:e=>ce({type:"url",...e}),Var:et,Video:ze,Wbr:tt,WeekInput:e=>ce({type:"week",...e}),When:function(e){if(!h.isObservable(e))throw new o("When : condition must be an Observable");let t=null,n=null;return{show(e){return t=e,this},otherwise:r=>(n=r,D(e,t,n))}}});const bt={};function gt(e,t,n={}){e="/"+u(e,"/");let r=null,o=n.name||null;const i=n.middlewares||[],s=n.shouldRebuild||!1,a=n.with||{},l={},c=[],d=e=>{if(!e)return null;const[t,n]=e.split(":");let r=a[t];return!r&&n&&(r=bt[n]),r||(r="[^/]+"),r=r.replace("(","(?:"),{name:t,pattern:`(${r})`}},h=()=>{if(r)return r;const t=e.replace(/\{(.*?)}/gi,(e,t)=>{const n=d(t);return n&&n.pattern?(l[n.name]=n.pattern,c.push(n.name),n.pattern):e});return r=new RegExp("^"+t+"$"),r};this.name=()=>o,this.component=()=>t,this.middlewares=()=>i,this.shouldRebuild=()=>s,this.path=()=>e,this.match=function(e){e="/"+u(e,"/");if(!h().exec(e))return!1;const t={};return h().exec(e).forEach((e,n)=>{if(n<1)return;const r=c[n-1];t[r]=e}),t},this.url=function(t){const n=e.replace(/\{(.*?)}/gi,(e,n)=>{const r=d(n);if(t.params&&t.params[r.name])return t.params[r.name];throw new Error(`Missing parameter '${r.name}'`)}),r="object"==typeof t.query?new URLSearchParams(t.query).toString():null;return(t.basePath?t.basePath:"")+(r?`${n}?${r}`:n)}}class vt extends Error{constructor(e,t){super(e),this.context=t}}const yt=(e,t)=>{const n=[];return e.forEach(e=>{n.push(u(e.suffix,"/"))}),n.push(u(t,"/")),n.join("/")},wt=(e,t)=>{const n=[];return e.forEach(e=>{e.options.middlewares&&n.push(...e.options.middlewares)}),t&&n.push(...t),n},$t=(e,t)=>{const n=[];return e.forEach(e=>{e.options?.name&&n.push(e.options.name)}),t&&n.push(t),n.join(".")};function Ct(){const e=[];let t=0;const n=n=>{const o=t+n;if(!e[o])return;t=o;const{route:i,params:s,query:a,path:u}=e[o];r(u)},r=e=>{window.location.replace(`${window.location.pathname}${window.location.search}#${e}`)},o=()=>window.location.hash.slice(1);this.push=function(n){const{route:i,params:s,query:a,path:u}=this.resolve(n);u!==o()&&(e.splice(t+1),e.push({route:i,params:s,query:a,path:u}),t++,r(u))},this.replace=function(n){const{route:r,params:i,query:s,path:a}=this.resolve(n);a!==o()&&(e[t]={route:r,params:i,query:s,path:a})},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){window.addEventListener("hashchange",()=>{const{route:e,params:t,query:n,path:r}=this.resolve(o());this.handleRouteChange(e,t,n,r)});const{route:r,params:i,query:s,path:a}=this.resolve(n||o());e.push({route:r,params:i,query:s,path:a}),t=0,this.handleRouteChange(r,i,s,a)}}function Ot(){this.push=function(e){try{const{route:t,path:n,params:r,query:o}=this.resolve(e);if(window.history.state&&window.history.state.path===n)return;window.history.pushState({name:t.name(),params:r,path:n},t.name()||n,n),this.handleRouteChange(t,r,o,n)}catch(e){n.error("HistoryRouter","Error in pushState",e)}},this.replace=function(e){const{route:t,path:r,params:o}=this.resolve(e);try{window.history.replaceState({name:t.name(),params:o,path:r},t.name()||r,r),this.handleRouteChange(t,o,{},r)}catch(e){n.error("HistoryRouter","Error in replaceState",e)}},this.forward=function(){window.history.forward()},this.back=function(){window.history.back()},this.init=function(e){window.addEventListener("popstate",e=>{try{if(!e.state||!e.state.path)return;const t=e.state.path,{route:n,params:r,query:o,path:i}=this.resolve(t);if(!n)return;this.handleRouteChange(n,r,o,i)}catch(e){n.error("HistoryRouter","Error in popstate event",e)}});const{route:t,params:r,query:o,path:i}=this.resolve(e||window.location.pathname+window.location.search);this.handleRouteChange(t,r,o,i)}}function St(){const e=[];let t=0;const n=n=>{const r=t+n;if(!e[r])return;t=r;const{route:o,params:i,query:s,path:a}=e[r];this.handleRouteChange(o,i,s,a)};this.push=function(n){const{route:r,params:o,query:i,path:s}=this.resolve(n);e[t]&&e[t].path===s||(e.splice(t+1),e.push({route:r,params:o,query:i,path:s}),t++,this.handleRouteChange(r,o,i,s))},this.replace=function(n){const{route:r,params:o,query:i,path:s}=this.resolve(n);e[t]={route:r,params:o,query:i,path:s},this.handleRouteChange(r,o,i,s)},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){const r=n||window.location.pathname+window.location.search,{route:o,params:i,query:s,path:a}=this.resolve(r);e.push({route:o,params:i,query:s,path:a}),t=0,this.handleRouteChange(o,i,s,a)}}const Et="default";function kt(e={}){const t=[],r={},o=[],i=[],s={route:null,params:null,query:null,path:null,hash:null};if("hash"===e.mode)Ct.apply(this,[]);else if("history"===e.mode)Ot.apply(this,[]);else{if("memory"!==e.mode)throw new vt("Invalid router mode "+e.mode);St.apply(this,[])}const a=function(e,t){for(const r of i)try{r(e),t&&t(e)}catch(e){n.warn("Route Listener","Error in listener:",e)}};this.routes=()=>[...t],this.currentState=()=>({...s}),this.add=function(e,n,i){const s=new gt(yt(o,e),n,{...i,middlewares:wt(o,i?.middlewares||[]),name:i?.name?$t(o,i.name):null});return t.push(s),s.name()&&(r[s.name()]=s),this},this.group=function(e,t,n){if(!h.isFunction(n))throw new vt("Callback must be a function");return o.push({suffix:e,options:t}),n(),o.pop(),this},this.generateUrl=function(e,t={},n={}){const o=r[e];if(!o)throw new vt(`Route not found for name: ${e}`);return o.url({params:t,query:n})},this.resolve=function(e){if(h.isJson(e)){const t=r[e.name];if(!t)throw new vt(`Route not found for name: ${e.name}`);return{route:t,params:e.params,query:e.query,path:t.url({...e})}}const[n,o]=e.split("?"),i="/"+u(n,"/");let s,a=null;for(const e of t)if(s=e.match(i),s){a=e;break}if(!a)throw new vt(`Route not found for url: ${n}`);const l={};if(o){const e=new URLSearchParams(o).entries();for(const[t,n]of e)l[t]=n}return{route:a,params:s,query:l,path:e}},this.subscribe=function(e){if(!h.isFunction(e))throw new vt("Listener must be a function");return i.push(e),()=>{i.splice(i.indexOf(e),1)}},this.handleRouteChange=function(e,t,n,r){s.route=e,s.params=t,s.query=n,s.path=r;const o=[...e.middlewares(),a];let i=0;const u={...s},l=e=>{if(i++,!(i>=o.length))return o[i](e||u,l)};return o[i](u,l)}}function At(e,t){const{to:n,href:r,...o}=e,i=n||r;if(h.isString(i)){const e=kt.get();return _({...o,href:i},t).nd.onPreventClick(()=>{e.push(i)})}const s=i.router||Et,a=kt.get(s);if(console.log(s),!a)throw new vt('Router not found "'+s+'" for link "'+i.name+'"');const u=a.generateUrl(i.name,i.params,i.query);return _({...o,href:u},t).nd.onPreventClick(()=>{a.push(u)})}kt.routers={},kt.create=function(t,r){if(!h.isFunction(r))throw n.error("Router","Callback must be a function",e),new vt("Callback must be a function");const o=new kt(t);return kt.routers[t.name||Et]=o,r(o),o.init(t.entry),o.mount=function(e){if(h.isString(e)){const t=document.querySelector(e);if(!t)throw new vt(`Container not found for selector: ${e}`);e=t}else if(!h.isElement(e))throw new vt("Container must be a string or an Element");return function(e,t){const n=new Map,r=function(e){t.innerHTML="",t.appendChild(e)},o=function(e){if(!e.route)return;const{route:t,params:o,query:i,path:s}=e;if(n.has(s)){const e=n.get(s);return void r(e)}const a=t.component()({params:o,query:i});n.set(s,a),r(a)};return e.subscribe(o),o(e.currentState()),t}(o,e)},o},kt.get=function(e){const t=kt.routers[e||Et];if(!t)throw new vt(`Router not found for name: ${e}`);return t},kt.push=function(e,t=null){return kt.get(t).push(e)},kt.replace=function(e,t=null){return kt.get(t).replace(e)},kt.forward=function(e=null){return kt.get(e).forward()},kt.back=function(e=null){return kt.get(e).back()},At.blank=function(e,t){return _({...e,target:"_blank"},t)};var It=Object.freeze({__proto__:null,Link:At,RouteParamPatterns:bt,Router:kt});return t.ArgTypes=E,t.ElementCreator=C,t.HtmlElementWrapper=O,t.Observable=m,t.Store=I,t.elements=mt,t.router=It,t.withValidation=k,t}({});
1
+ var NativeDocument=function(t){"use strict";let n={};n={log(){},warn(){},error(){},disable(){}};var r=n;const o=function(){let e=0;const t=new Map;return{register(n){const r=++e;return t.set(r,new WeakRef(n)),r},unregister(e){t.delete(e)},getObservableById:e=>t.get(e)?.deref(),cleanup(){for(const[e,n]of t){const e=n.deref();e&&e.cleanup()}t.clear()},cleanObservables(e){if(t.size<e)return;let n=0;for(const[e,r]of t)r.deref()||(t.delete(e),n++);n>0&&r.log("Memory Auto Clean",`๐Ÿงน Cleaned ${n} orphaned observables`)}}}();class i extends Error{constructor(e,t={}){super(e),this.name="NativeDocumentError",this.context=t,this.timestamp=(new Date).toISOString()}}function s(e,t){this.observable=e,this.checker=t,this.unSubscriptions=[]}function a(e){if(void 0===e)throw new i("ObservableItem requires an initial value");if(e instanceof a)throw new i("ObservableItem cannot be an Observable");this.$previousValue=e,this.$currentValue=e,this.$isCleanedUp=!1,this.$listeners=null,this.$watchers=null,this.$memoryId=o.register(this)}s.prototype.subscribe=function(e){const t=this.observable.subscribe(t=>{e&&e(this.checker(t))});return this.unSubscriptions.push(t),t},s.prototype.check=function(e){return this.observable.check(()=>e(this.val()))},s.prototype.val=function(){return this.checker&&this.checker(this.observable.val())},s.prototype.set=function(e){return this.observable.set(e)},s.prototype.trigger=function(){return this.observable.trigger()},s.prototype.cleanup=function(){return this.observable.cleanup()},Object.defineProperty(a.prototype,"$value",{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0}),a.prototype.triggerListeners=function(e){const t=this.$listeners,n=this.$previousValue,r=this.$currentValue;if(e=e||{},t?.length)for(let o=0,i=t.length;o<i;o++)t[o](r,n,e)},a.prototype.triggerWatchers=function(){if(!this.$watchers)return;const e=this.$watchers,t=this.$previousValue,n=this.$currentValue;if(e.has(n)){e.get(n).forEach(e=>{e.ifTrue.called||(e.ifTrue.callback(),e.else.called=!1)})}if(e.has(t)){e.get(t).forEach(e=>{e.else.called||(e.else.callback(),e.ifTrue.called=!1)})}},a.prototype.trigger=function(e){this.triggerListeners(e),this.triggerWatchers()},a.prototype.set=function(e){const t="function"==typeof e?e(this.$currentValue):e;this.$currentValue!==t&&(this.$previousValue=this.$currentValue,this.$currentValue=t,this.trigger())},a.prototype.val=function(){return this.$currentValue},a.prototype.disconnectAll=function(){if(this.$listeners?.splice(0),this.$previousValue=null,this.$currentValue=null,this.$watchers)for(const[e,t]of this.$watchers){for(const e of t)e.ifTrue.callback=null,e.else.callback=null;t.clear()}this.$watchers?.clear(),this.$listeners=null,this.$watchers=null},a.prototype.cleanup=function(){o.unregister(this.$memoryId),this.disconnectAll(),this.$isCleanedUp=!0,delete this.$value},a.prototype.subscribe=function(e){if(this.$listeners=this.$listeners??[],this.$isCleanedUp)return r.warn("Observable subscription","โš ๏ธ Attempted to subscribe to a cleaned up observable."),()=>{};if("function"!=typeof e)throw new i("Callback must be a function");return this.$listeners.push(e),()=>this.unsubscribe(e)},a.prototype.on=function(e,t,n){this.$watchers=this.$watchers??new Map;let r=this.$watchers.get(e);r||(r=new Set,this.$watchers.set(e,r));let o={ifTrue:{callback:t,called:!1},else:{callback:n,called:!1}};return r.add(o),()=>{r?.delete(o),0===r.size&&this.$watchers?.delete(e),r=null,o=null}},a.prototype.unsubscribe=function(e){const t=this.$listeners.indexOf(e);t>-1&&this.$listeners.splice(t,1)},a.prototype.check=function(e){return new s(this,e)},a.prototype.get=a.prototype.check,a.prototype.toString=function(){return"{{#ObItem::("+this.$memoryId+")}}"};const u=(e,t,n)=>{if(p.isFunction(n))return n(e,t);if(p.isObservable(e)){const r=e.val();return r&&n?r[n]:t}return p.isObject(e)?e[n]??t:e},l=function(e,t){return e.replace(new RegExp(`^[${t}]+|[${t}]+$`,"g"),"")},c={mounted:new WeakMap,mountedSupposedSize:0,unmounted:new WeakMap,unmountedSupposedSize:0,observer:null,checkMutation:function(e){for(const t of e){if(c.mountedSupposedSize>0)for(const e of t.addedNodes){const t=c.mounted.get(e);t&&(t.inDom=!0,t.mounted&&t.mounted(e))}if(c.unmountedSupposedSize>0)for(const e of t.removedNodes){const t=c.unmounted.get(e);t&&(t.inDom=!1,t.unmounted&&!0===t.unmounted(e)&&(t.disconnect(),e.nd?.remove()))}}},watch:function(e,t=!1){let n={inDom:t,mounted:null,unmounted:null,disconnect:()=>{c.mounted.delete(e),c.unmounted.delete(e),c.mountedSupposedSize--,c.unmountedSupposedSize--,n=null}};return{disconnect:n.disconnect,mounted:t=>{n.mounted=t,c.mounted.set(e,n),c.mountedSupposedSize++},unmounted:t=>{n.unmounted=t,c.unmounted.set(e,n),c.unmountedSupposedSize++}}}};c.observer=new MutationObserver(c.checkMutation),c.observer.observe(document.body,{childList:!0,subtree:!0});const d=["Click","DblClick","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Blur","Change","Focus","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","AfterPrint","BeforePrint","BeforeUnload","Error","HashChange","Load","Offline","Online","PageHide","PageShow","Resize","Scroll","Unload","Abort","CanPlay","CanPlayThrough","DurationChange","Emptied","Ended","LoadedData","LoadedMetadata","LoadStart","Pause","Play","Playing","Progress","RateChange","Seeked","Seeking","Stalled","Suspend","TimeUpdate","VolumeChange","Waiting"];function h(e){this.$element=e,this.$observer=null}for(const e of d){const t=e.toLowerCase();h.prototype["on"+e]=function(e){return this.$element.addEventListener(t,e),this},h.prototype["onPrevent"+e]=function(e){return this.$element.addEventListener(t,function(t){t.preventDefault(),e(t)}),this},h.prototype["onStop"+e]=function(e){return this.$element.addEventListener(t,function(t){t.stopPropagation(),e(t)}),this},h.prototype["onPreventStop"+e]=function(e){return this.$element.addEventListener(t,function(t){t.stopPropagation(),t.preventDefault(),e(t)}),this}}h.prototype.ref=function(e,t){return e[t]=element,this},h.prototype.unmountChildren=function(){let e=this.$element;for(let t=0,n=e.children.length;t<n;t++){let n=e.children[t];n.$ndProx||n.nd?.remove(),n=null}return e=null,this},h.prototype.remove=function(){let e=this.$element;return e.nd.unmountChildren(),e.$ndProx=null,delete e.nd?.on?.prevent,delete e.nd?.on,delete e.nd,e=null,this},h.prototype.lifecycle=function(e){return this.$observer=this.$observer||c.watch(this.$element),e.mounted&&this.$observer.mounted(e.mounted),e.unmounted&&this.$observer.unmounted(e.unmounted),this},h.prototype.mounted=function(e){return this.lifecycle({mounted:e})},h.prototype.mounted=function(e){return this.lifecycle({unmounted:e})},h.prototype.htmlElement=function(){return this.$element},h.prototype.node=h.prototype.htmlElement;const p={isObservable:e=>e instanceof a||e instanceof s,isProxy:e=>e?.__isProxy__,isObservableChecker:e=>e instanceof s,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isNumber:e=>"number"==typeof e,isBoolean:e=>"boolean"==typeof e,isFunction:e=>"function"==typeof e,isAsyncFunction:e=>"function"==typeof e&&"AsyncFunction"===e.constructor.name,isObject:e=>"object"==typeof e,isJson:e=>"object"==typeof e&&null!==e&&"Object"===e.constructor.name&&!Array.isArray(e),isElement:e=>e instanceof HTMLElement||e instanceof DocumentFragment||e instanceof Text,isFragment:e=>e instanceof DocumentFragment,isStringOrObservable(e){return this.isString(e)||this.isObservable(e)},isValidChild(e){return null===e||this.isElement(e)||this.isObservable(e)||this.isNDElement(e)||["string","number","boolean"].includes(typeof e)},isNDElement:e=>e instanceof h,isValidChildren(e){Array.isArray(e)||(e=[e]);return 0===e.filter(e=>!this.isValidChild(e)).length},validateChildren(e){Array.isArray(e)||(e=[e]);const t=e.filter(e=>!this.isValidChild(e));if(t.length>0)throw new i(`Invalid children detected: ${t.map(e=>typeof e).join(", ")}`);return e},containsObservables:e=>!!e&&(p.isObject(e)&&Object.values(e).some(e=>p.isObservable(e))),containsObservableReference:e=>!(!e||"string"!=typeof e)&&/\{\{#ObItem::\([0-9]+\)\}\}/.test(e),validateAttributes(e){if(!e||"object"!=typeof e)return e;const t=[],n=Object.keys(e).filter(e=>t.includes(e));return n.length>0&&r.warn("Validator",`Reserved attributes found: ${n.join(", ")}`),e},validateEventCallback(e){if("function"!=typeof e)throw new i("Event callback must be a function")}};function f(e){const t=document.createDocumentFragment(),n=document.createComment("Anchor Start : "+e),o=document.createComment("/ Anchor End "+e);t.appendChild(n),t.appendChild(o),t.nativeInsertBefore=t.insertBefore,t.nativeAppendChild=t.appendChild;const i=function(e,n,r){e!==t?e.insertBefore(O.getChild(n),r):e.nativeInsertBefore(O.getChild(n),r)};return t.appendElement=function(e,n=null){o.parentNode!==t?o.parentNode?.insertBefore(e,n||o):o.parentNode.nativeInsertBefore(e,n||o)},t.appendChild=function(e,n=null){const s=o.parentNode;if(s){if(n=n??o,p.isArray(e)){const r=document.createDocumentFragment();for(let t=0,n=e.length;t<n;t++)r.appendChild(O.getChild(e[t]));return i(s,r,n),t}i(s,e,n)}else r.error("Anchor","Anchor : parent not found",e)},t.removeChildren=function(){const e=o.parentNode;if(e===t)return;if(e.firstChild===n&&e.lastChild===o)return void e.replaceChildren(n,o);let r,i=n.nextSibling;const s=document.createDocumentFragment();for(;i&&i!==o;)r=i.nextSibling,s.append(i),i=r;s.replaceChildren()},t.remove=function(){if(o.parentNode===t)return;let e,r=n.nextSibling;for(;r!==o;)e=r.nextSibling,t.nativeAppendChild(r),r=e},t.removeWithAnchors=function(){t.removeChildren(),n.remove(),o.remove()},t.replaceContent=function(e){const r=o.parentNode;r&&(r.firstChild!==n||r.lastChild!==o?(t.removeChildren(),r.insertBefore(e,o)):r.replaceChildren(n,e,o))},t.insertBefore=function(e,n=null){t.appendChild(e,n)},t.clear=function(){t.remove()},t.endElement=function(){return o},t.startElement=function(){return n},t}const m=["checked","selected","disabled","readonly","required","autofocus","multiple","autocomplete","hidden","contenteditable","spellcheck","translate","draggable","async","defer","autoplay","controls","loop","muted","download","reversed","open","default","formnovalidate","novalidate","scoped","itemscope","allowfullscreen","allowpaymentrequest","playsinline"];function b(e){return new a(e)}function g(e,t){for(let n in t){const r=t[n];p.isObservable(r)?(e.classList.toggle(n,r.val()),r.subscribe(t=>e.classList.toggle(n,t))):e.classList.toggle(n,r)}}function v(e,t){for(let n in t){const r=t[n];p.isObservable(r)?(e.style[n]=r.val(),r.subscribe(t=>{e.style[n]=t})):e.style[n]=r}}function y(e,t,n){const r=p.isObservable(n)?n.val():n;p.isBoolean(r)?e[t]=r:e[t]=r===e.value,p.isObservable(n)&&(["checked"].includes(t)&&e.addEventListener("input",()=>{p.isBoolean(r)?n.set(e[t]):n.set(e.value)}),n.subscribe(n=>{p.isBoolean(n)?e[t]=n:e[t]=n===e.value}))}function w(e,t,n){const r=n=>{"value"!==t?e.setAttribute(t,n):e.value=n};r(n.val()),n.subscribe(r),"value"===t&&e.addEventListener("input",()=>n.set(e.value))}b.getById=function(e){const t=o.getObservableById(parseInt(e));if(!t)throw new i("Observable.getById : No observable found with id "+e);return t},b.cleanup=function(e){e.cleanup()},b.autoCleanup=function(e=!1,t={}){if(!e)return;const{interval:n=6e4,threshold:r=100}=t;window.addEventListener("beforeunload",()=>{o.cleanup()}),setInterval(()=>o.cleanObservables(r),n)};const $=new Map;let C=null;const O={createTextNode:()=>(C||(C=document.createTextNode("")),C.cloneNode()),createObservableNode(e,t){const n=O.createTextNode();return t.subscribe(e=>n.nodeValue=String(e)),n.nodeValue=t.val(),e&&e.appendChild(n),n},createStaticTextNode(e,t){let n=O.createTextNode();return n.nodeValue=String(t),e&&e.appendChild(n),n},createElement(e){if(e){if($.has(e))return $.get(e).cloneNode();const t=document.createElement(e);return $.set(e,t),t.cloneNode()}return new f("Fragment")},processChildren(e,t){if(null===e)return;const n=Array.isArray(e)?e:[e];for(let e=0,r=n.length;e<r;e++){let r=this.getChild(n[e]);null!==r&&t.appendChild(r)}},getChild(e){if(null===e)return null;if(p.isString(e)&&p.isFunction(e.resolveObservableTemplate)&&(e=e.resolveObservableTemplate()),p.isString(e))return O.createStaticTextNode(null,e);if(p.isObservable(e))return O.createObservableNode(null,e);if(p.isArray(e)){const t=document.createDocumentFragment();for(let n=0,r=e.length;n<r;n++)t.appendChild(this.getChild(e[n]));return t}return p.isFunction(e)?this.getChild(e()):p.isElement(e)?e:p.isNDElement(e)?e.$element:O.createStaticTextNode(null,e)},processAttributes(e,t){p.isFragment(e)||t&&function(e,t){if(p.validateAttributes(t),!p.isObject(t))throw new i("Attributes must be an object");for(let n in t){const r=n.toLowerCase();let o=t[r];if(p.isString(o)&&p.isFunction(o.resolveObservableTemplate)&&(o=o.resolveObservableTemplate(),p.isArray(o))){const e=o.filter(e=>p.isObservable(e));o=b.computed(()=>o.map(e=>p.isObservable(e)?e.val():e).join(" ")||" ",e)}m.includes(r)?y(e,r,o):p.isObservable(o)?w(e,r,o):"class"===r&&p.isJson(o)?g(e,o):"style"===r&&p.isJson(o)?v(e,o):e.setAttribute(r,o)}}(e,t)},setup:(e,t,n)=>e};function S(e,t){const n=e.toLowerCase();return function(e,o=null){try{if(!p.isJson(e)){const t=o;o=e,e=t}const r=O.createElement(n),i="function"==typeof t?t(r):r;return O.processAttributes(i,e),O.processChildren(o,i),O.setup(i,e,t)}catch(e){r.error("ElementCreation",`Error creating ${n}`,e)}}}Object.defineProperty(HTMLElement.prototype,"nd",{get(){return this.$nd||(this.$nd=new h(this),this.$nd.nd=this.$nd),this.$nd}});class E extends Error{constructor(e,t){super(`${e}\n\n${t.join("\n")}\n\n`)}}const k={string:e=>({name:e,type:"string",validate:e=>p.isString(e)}),number:e=>({name:e,type:"number",validate:e=>p.isNumber(e)}),boolean:e=>({name:e,type:"boolean",validate:e=>p.isBoolean(e)}),observable:e=>({name:e,type:"observable",validate:e=>p.isObservable(e)}),element:e=>({name:e,type:"element",validate:e=>p.isElement(e)}),function:e=>({name:e,type:"function",validate:e=>p.isFunction(e)}),object:e=>({name:e,type:"object",validate:e=>p.isObject(e)}),objectNotNull:e=>({name:e,type:"object",validate:e=>p.isObject(e)&&null!==e}),children:e=>({name:e,type:"children",validate:e=>p.validateChildren(e)}),attributes:e=>({name:e,type:"attributes",validate:e=>p.validateAttributes(e)}),optional:e=>({...e,optional:!0}),oneOf:(e,...t)=>({name:e,type:"oneOf",types:t,validate:e=>t.some(t=>t.validate(e))})},A=(e,t,n="Function")=>{if(!p.isArray(t))throw new i("withValidation : argSchema must be an array");return function(...r){return((e,t,n="Function")=>{if(!t)return;const r=[],o=t.filter(e=>!e.optional).length;if(e.length<o&&r.push(`${n}: Expected at least ${o} arguments, got ${e.length}`),t.forEach((t,o)=>{const i=o+1,s=e[o];if(void 0!==s){if(!t.validate(s)){const e=s?.constructor?.name||typeof s;r.push(`${n}: Invalid argument '${t.name}' at position ${i}, expected ${t.type}, got ${e}`)}}else t.optional||r.push(`${n}: Missing required argument '${t.name}' at position ${i}`)}),r.length>0)throw new E("Argument validation failed",r)})(r,t,e.name||n),e.apply(this,r)}};Function.prototype.args=function(...e){return A(this,e)},Function.prototype.errorBoundary=function(e){return(...t)=>{try{return this.apply(this,t)}catch(t){return e(t)}}},String.prototype.use=function(e){const t=this;return b.computed(()=>t.replace(/\$\{(.*?)}/g,(t,n)=>{const r=e[n];return p.isObservable(r)?r.val():r}),Object.values(e))},String.prototype.resolveObservableTemplate=function(){return p.containsObservableReference(this)?this.split(/(\{\{#ObItem::\([0-9]+\)\}\})/g).filter(Boolean).map(e=>{if(!p.containsObservableReference(e))return e;const[t,n]=e.match(/\{\{#ObItem::\(([0-9]+)\)\}\}/);return b.getById(n)}):this.valueOf()};const I=["push","pop","shift","unshift","reverse","sort","splice"];b.array=function(e){if(!Array.isArray(e))throw new i("Observable.array : target must be an array");const t=b(e);I.forEach(e=>{t[e]=function(...n){const r=t.val()[e](...n);return t.trigger({action:e,args:n,result:r}),r}}),t.clear=function(){return t.$value.length=0,t.trigger({action:"clear"}),!0},t.merge=function(e){t.$value=[...t.$value,...e]},t.populateAndRender=function(e,n){t.trigger({action:"populate",args:[t.$value,e,n]})},t.remove=function(e){const n=t.$value.splice(e,1);return 0===n.length?[]:(t.trigger({action:"remove",args:[e],result:n[0]}),n)},t.swap=function(e,n){const r=t.$value,o=r.length;if(o<e||o<n)return!1;if(n<e){const t=e;e=n,n=t}const i=r[e],s=r[n];return r[e]=s,r[n]=i,t.trigger({action:"swap",args:[e,n],result:[i,s]}),!0},t.length=function(){return t.$value.length};return["map","filter","reduce","some","every","find","findIndex","concat"].forEach(e=>{t[e]=function(...n){return t.val()[e](...n)}}),t},b.batch=function(e){const t=b(0),n=function(){if(p.isAsyncFunction(e))return e(...arguments).then(()=>{t.trigger()}).catch(e=>{throw e});e(...arguments),t.trigger()};return n.$observer=t,n},b.init=function(e){const t={};for(const n in e){const r=e[n];p.isJson(r)?t[n]=b.init(r):p.isArray(r)?t[n]=b.array(r):t[n]=b(r)}const n=function(){};return new Proxy(t,{get:(e,r)=>"__isProxy__"===r||("$value"===r?function(){const e={};for(const n in t){const r=t[n];p.isObservable(r)?e[n]=r.val():p.isProxy(r)?e[n]=r.$value:e[n]=r}return e}():"$clone"===r?n:void 0!==e[r]?e[r]:void 0),set(e,t,n){void 0!==e[t]&&e[t].set(n)}})},b.value=function(e){if(p.isObservable(e))return e.val();if(p.isProxy(e))return e.$value;if(p.isArray(e)){const t=[];return e.forEach(e=>{t.push(b.value(e))}),t}return e},b.update=function(e,t){for(const n in t){const r=e[n],o=t[n];if(p.isObservable(r)){if(p.isArray(o)){b.update(r,o);continue}r.set(o)}else p.isProxy(r)?b.update(r,o):e[n]=o}},b.object=b.init,b.json=b.init,b.computed=function(e,t=[]){const n=new a(e()),r=()=>n.set(e());if(p.isFunction(t)){if(!p.isObservable(t.$observer))throw new i("Observable.computed : dependencies must be valid batch function");return t.$observer.subscribe(r),n}return t.forEach(e=>e.subscribe(r)),n};const F=function(){const e=new Map;return{use(t){const{observer:n,subscribers:r}=e.get(t),o=b(n.val()),i=n.subscribe(e=>o.set(e)),s=o.subscribe(e=>n.set(e));return o.destroy=()=>{i(),s(),o.cleanup()},r.add(o),o},follow(e){return this.use(e)},create(t,n){const r=b(n);return e.set(t,{observer:r,subscribers:new Set}),r},get(t){const n=e.get(t);return n?n.observer:null},getWithSubscribers:t=>e.get(t),delete(t){const n=e.get(t);n&&(n.observer.cleanup(),n.subscribers.forEach(e=>e.destroy()),n.observer.clear())}}}();const x=function(e,t,n=null){if(!p.isObservable(e))return r.warn("ShowIf","ShowIf : condition must be an Observable / "+n,e);const o=new f("Show if : "+(n||""));let i=null;const s=()=>i||(i=O.getChild(t),i);return e.val()&&o.appendChild(s()),e.subscribe(e=>{e?o.appendChild(s()):o.remove()}),o},D=function(e,t,n=!0){if(!p.isObservable(e))throw new i("Toggle : condition must be an Observable");const r=new f,o=new Map,s=function(e){if(n&&o.has(e))return o.get(e);let r=t[e];return r?(r=O.getChild(r),n&&o.set(e,r),r):null},a=e.val(),u=s(a);return u&&r.appendChild(u),e.subscribe(e=>{const t=s(e);r.remove(),t&&r.appendChild(t)}),r},R=function(e,t,n){if(!p.isObservable(e))throw new i("Toggle : condition must be an Observable");return D(e,{true:t,false:n})},T=S("div"),N=S("span"),L=S("label"),P=S("p"),q=P,B=S("strong"),M=S("h1"),j=S("h2"),V=S("h3"),H=S("h4"),W=S("h5"),z=S("h6"),_=S("br"),U=S("a"),J=S("pre"),K=S("code"),Q=S("blockquote"),G=S("hr"),X=S("em"),Y=S("small"),Z=S("mark"),ee=S("del"),te=S("ins"),ne=S("sub"),re=S("sup"),oe=S("abbr"),ie=S("cite"),se=S("q"),ae=S("dl"),ue=S("dt"),le=S("dd"),ce=S("form",function(e){return e.submit=function(t){return"function"==typeof t?(e.onSubmit(e=>{e.preventDefault(),t(e)}),e):(this.setAttribute("action",t),e)},e.multipartFormData=function(){return this.setAttribute("enctype","multipart/form-data"),e},e.post=function(t){return this.setAttribute("method","post"),this.setAttribute("action",t),e},e.get=function(e){this.setAttribute("method","get"),this.setAttribute("action",e)},e}),de=S("input"),he=S("textarea"),pe=he,fe=S("select"),me=S("fieldset"),be=S("option"),ge=S("legend"),ve=S("datalist"),ye=S("output"),we=S("progress"),$e=S("meter"),Ce=S("button"),Oe=S("main"),Se=S("section"),Ee=S("article"),ke=S("aside"),Ae=S("nav"),Ie=S("figure"),Fe=S("figcaption"),xe=S("header"),De=S("footer"),Re=S("img"),Te=function(e,t){return Re({src:e,...t})},Ne=S("details"),Le=S("summary"),Pe=S("dialog"),qe=S("menu"),Be=S("ol"),Me=S("ul"),je=S("li"),Ve=je,He=Be,We=Me,ze=S("audio"),_e=S("video"),Ue=S("source"),Je=S("track"),Ke=S("canvas"),Qe=S("svg"),Ge=S("time"),Xe=S("data"),Ye=S("address"),Ze=S("kbd"),et=S("samp"),tt=S("var"),nt=S("wbr"),rt=S("caption"),ot=S("table"),it=S("thead"),st=S("tfoot"),at=S("tbody"),ut=S("tr"),lt=ut,ct=S("th"),dt=ct,ht=ct,pt=S("td"),ft=pt,mt=S("");var bt=Object.freeze({__proto__:null,Abbr:oe,Address:Ye,Anchor:f,Article:Ee,Aside:ke,AsyncImg:function(e,t,n,r){const o=Te(t||e,n),s=new Image;return s.onload=()=>{p.isFunction(r)&&r(null,o),o.src=e},s.onerror=()=>{p.isFunction(r)&&r(new i("Image not found"))},p.isObservable(e)&&e.subscribe(e=>{s.src=e}),s.src=e,o},Audio:ze,BaseImage:Re,Blockquote:Q,Br:_,Button:Ce,Canvas:Ke,Caption:rt,Checkbox:e=>de({type:"checkbox",...e}),Cite:ie,Code:K,ColorInput:e=>de({type:"color",...e}),Data:Xe,Datalist:ve,DateInput:e=>de({type:"date",...e}),DateTimeInput:e=>de({type:"datetime-local",...e}),Dd:le,Del:ee,Details:Ne,Dialog:Pe,Div:T,Dl:ae,Dt:ue,Em:X,EmailInput:e=>de({type:"email",...e}),FieldSet:me,FigCaption:Fe,Figure:Ie,FileInput:e=>de({type:"file",...e}),Footer:De,ForEach:function(e,t,n){const o=new f("ForEach"),i=o.endElement();o.startElement();let s=new Map,a=null;const l=new Set,c=e=>{for(const[t,n]of s.entries()){if(l.has(t))continue;const r=n.child?.deref();e&&r&&e.removeChild(r),n.indexObserver?.cleanup(),n.child=null,n.indexObserver=null,s.delete(n.keyId),a&&a.delete(n.keyId)}},d=(e,o)=>{const i=u(e,o,n);if(s.has(i)){const e=s.get(i);if(e.indexObserver?.set(o),e.isNew=!1,e.child?.deref())return i;s.delete(i)}try{const n=t.length>=2?b(o):null;let r=O.getChild(t(e,n));s.set(i,{keyId:i,isNew:!0,child:new WeakRef(r),indexObserver:n})}catch(e){throw r.error("ForEach",`Error creating element for key ${i}`,e),e}return i},h=()=>{const t=i.parentNode;if(!t)return;const n=p.isObservable(e)?e.val():e;if(l.clear(),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=d(n[e],e);l.add(t)}else for(const e in n){const t=d(n[e],e);l.add(t)}if(0===l.size)return o.removeChildren(),c(),void a?.clear();c(t),a&&0!==a.size?(()=>{let e=document.createDocumentFragment();const t=Array.from(l);Array.from(a);for(const n in t){const r=t[n],o=s.get(r);if(!o)continue;const i=o.child.deref();i&&e.appendChild(i)}o.replaceContent(e)})():(e=>{const t=document.createDocumentFragment();for(const e of l){const n=s.get(e);if(!n)continue;const r=n.child?.deref();r&&t.appendChild(r)}e.insertBefore(t,i)})(t),a?.clear(),a=new Set([...l])};return h(),p.isObservable(e)&&e.subscribe(h),o},ForEachArray:function(e,t,n,o={}){const i=new f("ForEach Array"),s=i.endElement(),a=i.startElement();let l=new Map,c=new WeakMap,d=0;const h=new WeakMap,m=()=>{i.removeChildren(),y(),d=0},g=(e,t)=>h.has(e)?h.get(e):u(e,t,n),v=(e,t=!0)=>{if(!e)return;const n=e.child?.deref();e.indexObserver?.deref()?.cleanup(),e.child=null,e.indexObserver=null,c.delete(e.item),h.delete(e.item),e.item=null,t&&(n?.remove(),l.delete(e.keyId))},y=()=>{for(const[e,t]of l.entries())v(t,!1);l.clear()},w=(e,n)=>{const o=g(e,n);if(l.has(o)){const e=l.get(o);e.indexObserver?.deref()?.set(n),e.isNew=!1;const t=e.child?.deref();if(t)return t;l.delete(o)}try{const r=t.length>=2?b(n):null;let i=O.getChild(t(e,r));return l.set(o,{keyId:o,isNew:!0,item:e,child:new WeakRef(i),indexObserver:r?new WeakRef(r):null}),h.set(e,o),p.isObject(e)&&c.set(e,i),i}catch(e){throw r.error("ForEach",`Error creating element for key ${o}`,e),e}},$=function(e,t){const n=l.get(e);if(!n)return null;const r=n.child?.deref();if(!r)return null;t?t.appendChild(r):r.remove()},C={toFragment(e,t=0){const n=document.createDocumentFragment();for(let t=0,r=e.length;t<r;t++)n.append(w(e[t],d)),d++;return n},add(e,t=0){setTimeout(()=>{i.appendElement(C.toFragment(e))},t)},replace(e){m(),C.add(e)},reOrder(e){let t=null;const n=document.createDocumentFragment();for(const r of e)t=c.get(r),t&&n.appendChild(t);t=null,i.appendElement(n,s)},removeOne(e,t){let n=c.get(e);n&&(n.remove(),c.delete(e),((e,t=!0)=>{v(l.get(e),t)})(g(e,t))),n=null},clear:m,merge(e){C.add(e,0)},push(e){let t=0;o.pushDelay&&(t=o.pushDelay(e)??0),C.add(e,t)},populate([e,t,n]){const r=document.createDocumentFragment();for(let o=0;o<t;o++){const t=n(o);e.push(t),r.append(w(t,o)),d++}i.appendChild(r),r.replaceChildren()},unshift(e){i.insertBefore(C.toFragment(e),a.nextSibling)},splice(e,t){const[n,r,...o]=e;let a=null;const u=document.createDocumentFragment();if(t.length>0){let e=g(t[0],n);if(1===t.length)$(e,u);else if(t.length>1){const r=function(e){const t=l.get(e);if(!t)return null;const n=t.child?.deref();return n||(v(t,!1),null)}(e);a=r?.previousSibling;for(let e=0;e<t.length;e++){const r=g(t[e],n+e);$(r,u)}}}else a=s;u.replaceChildren(),o&&o.length&&a&&i.insertBefore(C.toFragment(o),a.nextSibling)},reverse(e,t){C.reOrder(t)},sort(e,t){C.reOrder(t)},remove(e,t){C.removeOne(t)},pop(e,t){C.removeOne(t)},shift(e,t){C.removeOne(t)},swap(e,t){const n=s.parentNode;let r=c.get(t[0]),o=c.get(t[1]);if(!r||!o)return;const i=o.nextSibling;n.insertBefore(o,r),n.insertBefore(r,i),r=null,o=null}},S=(e,n,r)=>{if("populate"===r?.action)C.populate(r.args,r.result);else{if(console.log(d),"clear"===r.action||!e.length){if(0===d)return;m()}if(r?.action)C[r.action]&&C[r.action](r.args,r.result);else{if(0===d)return void C.add(e);C.replace(e)}}console.log(e),((e,n=0)=>{if(t.length<2)return;let r=n;for(let t=n,o=e?.length;t<o;t++){const n=l.get(g(e[t],t));n&&(n.indexObserver?.deref()?.set(r),r++)}})(e,0)};return S(e.val(),0,{action:null}),p.isObservable(e)&&e.subscribe(S),i},Form:ce,Fragment:mt,H1:M,H2:j,H3:V,H4:H,H5:W,H6:z,Header:xe,HiddenInput:e=>de({type:"hidden",...e}),HideIf:function(e,t,n){const r=b(!e.val());return e.subscribe(e=>r.set(!e)),x(r,t,n)},HideIfNot:function(e,t,n){return x(e,t,n)},Hr:G,Img:Te,Input:de,Ins:te,Kbd:Ze,Label:L,LazyImg:function(e,t){return Te(e,{...t,loading:"lazy"})},Legend:ge,Li:Ve,Link:U,ListItem:je,Main:Oe,Mark:Z,Match:D,Menu:qe,Meter:$e,MonthInput:e=>de({type:"month",...e}),NativeDocumentFragment:f,Nav:Ae,NumberInput:e=>de({type:"number",...e}),Ol:He,Option:be,OrderedList:Be,Output:ye,P:P,Paragraph:q,PasswordInput:e=>de({type:"password",...e}),Pre:J,Progress:we,Quote:se,Radio:e=>de({type:"radio",...e}),RangeInput:e=>de({type:"range",...e}),ReadonlyInput:e=>de({readonly:!0,...e}),Samp:et,SearchInput:e=>de({type:"search",...e}),Section:Se,Select:fe,ShowIf:x,SimpleButton:(e,t)=>Ce(e,{type:"button",...t}),Small:Y,Source:Ue,Span:N,Strong:B,Sub:ne,SubmitButton:(e,t)=>Ce(e,{type:"submit",...t}),Summary:Le,Sup:re,Svg:Qe,Switch:R,TBody:at,TBodyCell:ft,TFoot:st,TFootCell:ht,THead:it,THeadCell:dt,TRow:lt,Table:ot,Td:pt,TelInput:e=>de({type:"tel",...e}),TextArea:he,TextInput:pe,Th:ct,Time:Ge,TimeInput:e=>de({type:"time",...e}),Tr:ut,Track:Je,Ul:We,UnorderedList:Me,UrlInput:e=>de({type:"url",...e}),Var:tt,Video:_e,Wbr:nt,WeekInput:e=>de({type:"week",...e}),When:function(e){if(!p.isObservable(e))throw new i("When : condition must be an Observable");let t=null,n=null;return{show(e){return t=e,this},otherwise:r=>(n=r,R(e,t,n))}}});const gt={};function vt(e,t,n={}){e="/"+l(e,"/");let r=null,o=n.name||null;const i=n.middlewares||[],s=n.shouldRebuild||!1,a=n.with||{},u={},c=[],d=e=>{if(!e)return null;const[t,n]=e.split(":");let r=a[t];return!r&&n&&(r=gt[n]),r||(r="[^/]+"),r=r.replace("(","(?:"),{name:t,pattern:`(${r})`}},h=()=>{if(r)return r;const t=e.replace(/\{(.*?)}/gi,(e,t)=>{const n=d(t);return n&&n.pattern?(u[n.name]=n.pattern,c.push(n.name),n.pattern):e});return r=new RegExp("^"+t+"$"),r};this.name=()=>o,this.component=()=>t,this.middlewares=()=>i,this.shouldRebuild=()=>s,this.path=()=>e,this.match=function(e){e="/"+l(e,"/");if(!h().exec(e))return!1;const t={};return h().exec(e).forEach((e,n)=>{if(n<1)return;const r=c[n-1];t[r]=e}),t},this.url=function(t){const n=e.replace(/\{(.*?)}/gi,(e,n)=>{const r=d(n);if(t.params&&t.params[r.name])return t.params[r.name];throw new Error(`Missing parameter '${r.name}'`)}),r="object"==typeof t.query?new URLSearchParams(t.query).toString():null;return(t.basePath?t.basePath:"")+(r?`${n}?${r}`:n)}}class yt extends Error{constructor(e,t){super(e),this.context=t}}const wt=(e,t)=>{const n=[];return e.forEach(e=>{n.push(l(e.suffix,"/"))}),n.push(l(t,"/")),n.join("/")},$t=(e,t)=>{const n=[];return e.forEach(e=>{e.options.middlewares&&n.push(...e.options.middlewares)}),t&&n.push(...t),n},Ct=(e,t)=>{const n=[];return e.forEach(e=>{e.options?.name&&n.push(e.options.name)}),t&&n.push(t),n.join(".")};function Ot(){const e=[];let t=0;const n=n=>{const o=t+n;if(!e[o])return;t=o;const{route:i,params:s,query:a,path:u}=e[o];r(u)},r=e=>{window.location.replace(`${window.location.pathname}${window.location.search}#${e}`)},o=()=>window.location.hash.slice(1);this.push=function(n){const{route:i,params:s,query:a,path:u}=this.resolve(n);u!==o()&&(e.splice(t+1),e.push({route:i,params:s,query:a,path:u}),t++,r(u))},this.replace=function(n){const{route:r,params:i,query:s,path:a}=this.resolve(n);a!==o()&&(e[t]={route:r,params:i,query:s,path:a})},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){window.addEventListener("hashchange",()=>{const{route:e,params:t,query:n,path:r}=this.resolve(o());this.handleRouteChange(e,t,n,r)});const{route:r,params:i,query:s,path:a}=this.resolve(n||o());e.push({route:r,params:i,query:s,path:a}),t=0,this.handleRouteChange(r,i,s,a)}}function St(){this.push=function(e){try{const{route:t,path:n,params:r,query:o}=this.resolve(e);if(window.history.state&&window.history.state.path===n)return;window.history.pushState({name:t.name(),params:r,path:n},t.name()||n,n),this.handleRouteChange(t,r,o,n)}catch(e){r.error("HistoryRouter","Error in pushState",e)}},this.replace=function(e){const{route:t,path:n,params:o}=this.resolve(e);try{window.history.replaceState({name:t.name(),params:o,path:n},t.name()||n,n),this.handleRouteChange(t,o,{},n)}catch(e){r.error("HistoryRouter","Error in replaceState",e)}},this.forward=function(){window.history.forward()},this.back=function(){window.history.back()},this.init=function(e){window.addEventListener("popstate",e=>{try{if(!e.state||!e.state.path)return;const t=e.state.path,{route:n,params:r,query:o,path:i}=this.resolve(t);if(!n)return;this.handleRouteChange(n,r,o,i)}catch(e){r.error("HistoryRouter","Error in popstate event",e)}});const{route:t,params:n,query:o,path:i}=this.resolve(e||window.location.pathname+window.location.search);this.handleRouteChange(t,n,o,i)}}function Et(){const e=[];let t=0;const n=n=>{const r=t+n;if(!e[r])return;t=r;const{route:o,params:i,query:s,path:a}=e[r];this.handleRouteChange(o,i,s,a)};this.push=function(n){const{route:r,params:o,query:i,path:s}=this.resolve(n);e[t]&&e[t].path===s||(e.splice(t+1),e.push({route:r,params:o,query:i,path:s}),t++,this.handleRouteChange(r,o,i,s))},this.replace=function(n){const{route:r,params:o,query:i,path:s}=this.resolve(n);e[t]={route:r,params:o,query:i,path:s},this.handleRouteChange(r,o,i,s)},this.forward=function(){return t<e.length-1&&n(1)},this.back=function(){return t>0&&n(-1)},this.init=function(n){const r=n||window.location.pathname+window.location.search,{route:o,params:i,query:s,path:a}=this.resolve(r);e.push({route:o,params:i,query:s,path:a}),t=0,this.handleRouteChange(o,i,s,a)}}const kt="default";function At(e={}){const t=[],n={},o=[],i=[],s={route:null,params:null,query:null,path:null,hash:null};if("hash"===e.mode)Ot.apply(this,[]);else if("history"===e.mode)St.apply(this,[]);else{if("memory"!==e.mode)throw new yt("Invalid router mode "+e.mode);Et.apply(this,[])}const a=function(e,t){for(const n of i)try{n(e),t&&t(e)}catch(e){r.warn("Route Listener","Error in listener:",e)}};this.routes=()=>[...t],this.currentState=()=>({...s}),this.add=function(e,r,i){const s=new vt(wt(o,e),r,{...i,middlewares:$t(o,i?.middlewares||[]),name:i?.name?Ct(o,i.name):null});return t.push(s),s.name()&&(n[s.name()]=s),this},this.group=function(e,t,n){if(!p.isFunction(n))throw new yt("Callback must be a function");return o.push({suffix:e,options:t}),n(),o.pop(),this},this.generateUrl=function(e,t={},r={}){const o=n[e];if(!o)throw new yt(`Route not found for name: ${e}`);return o.url({params:t,query:r})},this.resolve=function(e){if(p.isJson(e)){const t=n[e.name];if(!t)throw new yt(`Route not found for name: ${e.name}`);return{route:t,params:e.params,query:e.query,path:t.url({...e})}}const[r,o]=e.split("?"),i="/"+l(r,"/");let s,a=null;for(const e of t)if(s=e.match(i),s){a=e;break}if(!a)throw new yt(`Route not found for url: ${r}`);const u={};if(o){const e=new URLSearchParams(o).entries();for(const[t,n]of e)u[t]=n}return{route:a,params:s,query:u,path:e}},this.subscribe=function(e){if(!p.isFunction(e))throw new yt("Listener must be a function");return i.push(e),()=>{i.splice(i.indexOf(e),1)}},this.handleRouteChange=function(e,t,n,r){s.route=e,s.params=t,s.query=n,s.path=r;const o=[...e.middlewares(),a];let i=0;const u={...s},l=e=>{if(i++,!(i>=o.length))return o[i](e||u,l)};return o[i](u,l)}}function It(e,t){const{to:n,href:r,...o}=e,i=n||r;if(p.isString(i)){const e=At.get();return U({...o,href:i},t).nd.onPreventClick(()=>{e.push(i)})}const s=i.router||kt,a=At.get(s);if(console.log(s),!a)throw new yt('Router not found "'+s+'" for link "'+i.name+'"');const u=a.generateUrl(i.name,i.params,i.query);return U({...o,href:u},t).nd.onPreventClick(()=>{a.push(u)})}At.routers={},At.create=function(t,n){if(!p.isFunction(n))throw r.error("Router","Callback must be a function",e),new yt("Callback must be a function");const o=new At(t);return At.routers[t.name||kt]=o,n(o),o.init(t.entry),o.mount=function(e){if(p.isString(e)){const t=document.querySelector(e);if(!t)throw new yt(`Container not found for selector: ${e}`);e=t}else if(!p.isElement(e))throw new yt("Container must be a string or an Element");return function(e,t){const n=new Map,r=function(e){t.innerHTML="",t.appendChild(e)},o=function(e){if(!e.route)return;const{route:t,params:o,query:i,path:s}=e;if(n.has(s)){const e=n.get(s);return void r(e)}const a=t.component()({params:o,query:i});n.set(s,a),r(a)};return e.subscribe(o),o(e.currentState()),t}(o,e)},o},At.get=function(e){const t=At.routers[e||kt];if(!t)throw new yt(`Router not found for name: ${e}`);return t},At.push=function(e,t=null){return At.get(t).push(e)},At.replace=function(e,t=null){return At.get(t).replace(e)},At.forward=function(e=null){return At.get(e).forward()},At.back=function(e=null){return At.get(e).back()},It.blank=function(e,t){return U({...e,target:"_blank"},t)};var Ft=Object.freeze({__proto__:null,Link:It,RouteParamPatterns:gt,Router:At});return t.ArgTypes=k,t.ElementCreator=O,t.HtmlElementWrapper=S,t.NDElement=h,t.Observable=b,t.Store=F,t.elements=bt,t.router=Ft,t.withValidation=A,t}({});
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as HtmlElementWrapper } from './src/wrappers/HtmlElementWrapper'
2
2
  export { ElementCreator } from './src/wrappers/ElementCreator'
3
+ export { NDElement } from './src/wrappers/NDElement'
3
4
 
4
5
  import './src/utils/prototypes.js';
5
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "native-document",
3
- "version": "1.0.17",
3
+ "version": "1.0.19",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -11,6 +11,7 @@
11
11
  "license": "ISC",
12
12
  "description": "",
13
13
  "devDependencies": {
14
+ "@rollup/plugin-replace": "^6.0.2",
14
15
  "@rollup/plugin-terser": "^0.4.4"
15
16
  }
16
17
  }
package/rollup.config.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import terser from '@rollup/plugin-terser';
2
+ import replace from '@rollup/plugin-replace';
2
3
 
4
+ const isProduction = process.env.NODE_ENV === 'production';
3
5
  export default [
4
6
  {
5
7
  input: {
@@ -9,8 +11,15 @@ export default [
9
11
  dir: 'dist',
10
12
  entryFileNames: 'native-document.dev.js',
11
13
  format: 'iife',
12
- name: 'NativeDocument'
14
+ name: 'NativeDocument',
15
+ sourcemap: true
13
16
  },
17
+ plugins: [
18
+ replace({
19
+ 'process.env.NODE_ENV': JSON.stringify('development'),
20
+ preventAssignment: true,
21
+ })
22
+ ]
14
23
  },
15
24
  {
16
25
  input: {
@@ -23,6 +32,10 @@ export default [
23
32
  name: 'NativeDocument'
24
33
  },
25
34
  plugins: [
35
+ replace({
36
+ 'process.env.NODE_ENV': JSON.stringify('production'),
37
+ preventAssignment: true,
38
+ }),
26
39
  terser()
27
40
  ]
28
41
  }
@@ -5,6 +5,7 @@
5
5
  * @class ObservableChecker
6
6
  */
7
7
  export default function ObservableChecker($observable, $checker) {
8
+ this.__$isObservableChecker = true;
8
9
  this.observable = $observable;
9
10
  this.checker = $checker;
10
11
  this.unSubscriptions = [];
@@ -16,6 +16,7 @@ export default function ObservableItem(value) {
16
16
  throw new NativeDocumentError('ObservableItem cannot be an Observable');
17
17
  }
18
18
 
19
+ this.__$isObservable = true;
19
20
  this.$previousValue = value;
20
21
  this.$currentValue = value;
21
22
  this.$isCleanedUp = false;
@@ -77,9 +77,10 @@ Observable.value = function(data) {
77
77
  }
78
78
  if(Validator.isArray(data)) {
79
79
  const result = [];
80
- data.forEach(item => {
80
+ for(let i = 0, length = data.length; i < length; i++) {
81
+ const item = data[i];
81
82
  result.push(Observable.value(item));
82
- });
83
+ }
83
84
  return result;
84
85
  }
85
86
  return data;
@@ -264,7 +264,6 @@ export function ForEachArray(data, callback, key, configs = {}) {
264
264
  if(operations?.action === 'populate') {
265
265
  Actions.populate(operations.args, operations.result);
266
266
  } else {
267
- console.log(lastNumberOfItems);
268
267
  if(operations.action === 'clear' || !items.length) {
269
268
  if(lastNumberOfItems === 0) {
270
269
  return;
@@ -284,7 +283,6 @@ export function ForEachArray(data, callback, key, configs = {}) {
284
283
  }
285
284
  }
286
285
 
287
- console.log(items)
288
286
  updateIndexObservers(items, 0);
289
287
  };
290
288
 
@@ -15,7 +15,6 @@ export function Link(options, children){
15
15
  }
16
16
  const routerName = target.router || DEFAULT_ROUTER_NAME;
17
17
  const router = Router.get(routerName);
18
- console.log(routerName)
19
18
  if(!router) {
20
19
  throw new RouterError('Router not found "'+routerName+'" for link "'+target.name+'"');
21
20
  }
@@ -1,31 +1,43 @@
1
- const DebugManager = {
2
- enabled: false,
1
+ let DebugManager = {};
3
2
 
4
- enable() {
5
- this.enabled = true;
6
- console.log('๐Ÿ” NativeDocument Debug Mode enabled');
7
- },
3
+ if(process.env.NODE_ENV === 'development') {
4
+ DebugManager = {
5
+ enabled: false,
8
6
 
9
- disable() {
10
- this.enabled = false;
11
- },
7
+ enable() {
8
+ this.enabled = true;
9
+ console.log('๐Ÿ” NativeDocument Debug Mode enabled');
10
+ },
12
11
 
13
- log(category, message, data) {
14
- if (!this.enabled) return;
15
- console.group(`๐Ÿ” [${category}] ${message}`);
16
- if (data) console.log(data);
17
- console.trace();
18
- console.groupEnd();
19
- },
12
+ disable() {
13
+ this.enabled = false;
14
+ },
20
15
 
21
- warn(category, message, data) {
22
- if (!this.enabled) return;
23
- console.warn(`โš ๏ธ [${category}] ${message}`, data);
24
- },
16
+ log(category, message, data) {
17
+ if (!this.enabled) return;
18
+ console.group(`๐Ÿ” [${category}] ${message}`);
19
+ if (data) console.log(data);
20
+ console.trace();
21
+ console.groupEnd();
22
+ },
25
23
 
26
- error(category, message, error) {
27
- console.error(`โŒ [${category}] ${message}`, error);
28
- }
29
- };
24
+ warn(category, message, data) {
25
+ if (!this.enabled) return;
26
+ console.warn(`โš ๏ธ [${category}] ${message}`, data);
27
+ },
30
28
 
29
+ error(category, message, error) {
30
+ console.error(`โŒ [${category}] ${message}`, error);
31
+ }
32
+ };
33
+
34
+ }
35
+ if(process.env.NODE_ENV === 'production') {
36
+ DebugManager = {
37
+ log() {},
38
+ warn() {},
39
+ error() {},
40
+ disable() {}
41
+ };
42
+ }
31
43
  export default DebugManager;
@@ -6,13 +6,13 @@ import {NDElement} from "../wrappers/NDElement";
6
6
 
7
7
  const Validator = {
8
8
  isObservable(value) {
9
- return value instanceof ObservableItem || value instanceof ObservableChecker;
9
+ return value instanceof ObservableItem || value instanceof ObservableChecker || value?.__$isObservable;
10
10
  },
11
11
  isProxy(value) {
12
12
  return value?.__isProxy__
13
13
  },
14
14
  isObservableChecker(value) {
15
- return value instanceof ObservableChecker;
15
+ return value instanceof ObservableChecker || value?.__$isObservableChecker;
16
16
  },
17
17
  isArray(value) {
18
18
  return Array.isArray(value);
@@ -55,7 +55,7 @@ const Validator = {
55
55
  ['string', 'number', 'boolean'].includes(typeof child);
56
56
  },
57
57
  isNDElement(child) {
58
- return child instanceof NDElement;
58
+ return child instanceof NDElement || child?.constructor?.__$isNDElement;
59
59
  },
60
60
  isValidChildren(children) {
61
61
  if (!Array.isArray(children)) {
@@ -6,7 +6,7 @@ const DocumentObserver = {
6
6
  unmounted: new WeakMap(),
7
7
  unmountedSupposedSize: 0,
8
8
  observer: null,
9
- checkMutation: debounce(function(mutationsList) {
9
+ checkMutation: function(mutationsList) {
10
10
  let i = 0;
11
11
  for(const mutation of mutationsList) {
12
12
  if(DocumentObserver.mountedSupposedSize > 0 ) {
@@ -35,7 +35,7 @@ const DocumentObserver = {
35
35
  }
36
36
  }
37
37
  }
38
- }, 16),
38
+ },
39
39
  /**
40
40
  *
41
41
  * @param {HTMLElement} element
@@ -2,6 +2,7 @@ import DocumentObserver from "./DocumentObserver";
2
2
  import { EVENTS } from "../utils/events";
3
3
 
4
4
  export function NDElement(element) {
5
+ this.__$isNDElement = true;
5
6
  this.$element = element;
6
7
  this.$observer = null;
7
8
  }
@@ -78,4 +79,10 @@ NDElement.prototype.mounted = function(callback) {
78
79
 
79
80
  NDElement.prototype.mounted = function(callback) {
80
81
  return this.lifecycle({ unmounted: callback });
81
- };
82
+ };
83
+
84
+ NDElement.prototype.htmlElement = function() {
85
+ return this.$element;
86
+ };
87
+
88
+ NDElement.prototype.node = NDElement.prototype.htmlElement;
@@ -1,6 +1,7 @@
1
1
  import { NDElement } from "./NDElement";
2
2
 
3
3
  Object.defineProperty(HTMLElement.prototype, 'nd', {
4
+ configurable: true,
4
5
  get() {
5
6
  if(this.$nd) {
6
7
  return this.$nd;