native-document 1.0.138 → 1.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.js +1 -1
- package/devtools/ComponentRegistry.js +3 -2
- package/dist/native-document.components.min.css +1 -0
- package/dist/native-document.components.min.js +11506 -8566
- package/dist/native-document.dev.js +2645 -2166
- package/dist/native-document.dev.js.map +1 -1
- package/dist/native-document.min.js +1 -1
- package/index.js +1 -0
- package/package.json +5 -2
- package/rollup.config.js +5 -2
- package/src/components/$traits/has-draggable/HasDraggable.js +69 -0
- package/src/components/$traits/has-draggable/has-draggable.css +8 -0
- package/src/components/$traits/{HasItems.js → has-items/HasItems.js} +2 -11
- package/src/components/$traits/has-position/HasFullPosition.js +51 -0
- package/src/components/$traits/has-position/HasPosition.js +23 -0
- package/src/components/$traits/has-resizable/HasResizable.js +113 -0
- package/src/components/$traits/has-resizable/has-resizable.css +121 -0
- package/src/components/$traits/has-validation/HasValidation.js +86 -0
- package/src/components/BaseComponent.js +109 -4
- package/src/components/accordion/Accordion.js +37 -31
- package/src/components/accordion/AccordionItem.js +14 -21
- package/src/components/alert/Alert.js +48 -40
- package/src/components/avatar/Avatar.js +4 -3
- package/src/components/avatar/AvatarGroup.js +8 -2
- package/src/components/badge/Badge.js +7 -7
- package/src/components/base-component.css +0 -0
- package/src/components/breadcrumb/BreadCrumb.js +30 -21
- package/src/components/button/Button.js +3 -14
- package/src/components/context-menu/ContextMenu.js +49 -26
- package/src/components/dropdown/Dropdown.js +172 -34
- package/src/components/dropdown/DropdownDivider.js +4 -3
- package/src/components/dropdown/DropdownGroup.js +19 -19
- package/src/components/dropdown/DropdownItem.js +24 -18
- package/src/components/dropdown/helpers.js +52 -0
- package/src/components/form/FormControl.js +207 -108
- package/src/components/form/field/Field.js +106 -174
- package/src/components/form/field/FieldCollection.js +110 -203
- package/src/components/form/field/types/AutocompleteField.js +26 -5
- package/src/components/form/field/types/CheckboxField.js +4 -4
- package/src/components/form/field/types/CheckboxGroupField.js +11 -5
- package/src/components/form/field/types/ColorField.js +4 -4
- package/src/components/form/field/types/DateField.js +110 -18
- package/src/components/form/field/types/EmailField.js +2 -2
- package/src/components/form/field/types/FileField.js +87 -21
- package/src/components/form/field/types/HiddenField.js +4 -4
- package/src/components/form/field/types/ImageField.js +4 -4
- package/src/components/form/field/types/NumberField.js +5 -5
- package/src/components/form/field/types/PasswordField.js +28 -6
- package/src/components/form/field/types/RadioField.js +12 -8
- package/src/components/form/field/types/RangeField.js +29 -5
- package/src/components/form/field/types/SearchField.js +4 -4
- package/src/components/form/field/types/SelectField.js +75 -8
- package/src/components/form/field/types/StringField.js +4 -4
- package/src/components/form/field/types/TelField.js +4 -4
- package/src/components/form/field/types/TextAreaField.js +7 -5
- package/src/components/form/field/types/TimeField.js +52 -6
- package/src/components/form/field/types/UrlField.js +4 -5
- package/src/components/form/field/types/file-field-mode/FileAvatarMode.js +104 -0
- package/src/components/form/field/types/file-field-mode/FileDropzoneMode.js +59 -0
- package/src/components/form/field/types/file-field-mode/FileItemPreview.js +74 -0
- package/src/components/form/field/types/file-field-mode/FileNativeMode.js +21 -0
- package/src/components/form/field/types/file-field-mode/FileUploadButtonMode.js +59 -0
- package/src/components/form/field/types/file-field-mode/FileWallMode.js +53 -0
- package/src/components/form/index.js +14 -2
- package/src/components/form/validation/Validation.js +9 -0
- package/src/components/list/List.js +1 -1
- package/src/components/list/ListGroup.js +1 -1
- package/src/components/menu/HasMenuItem.js +133 -0
- package/src/components/menu/Menu.js +47 -56
- package/src/components/menu/MenuGroup.js +36 -8
- package/src/components/menu/MenuItem.js +24 -10
- package/src/components/menu/MenuLink.js +2 -0
- package/src/components/modal/Modal.js +153 -23
- package/src/components/pagination/Pagination.js +55 -21
- package/src/components/popover/Popover.js +127 -40
- package/src/components/progress/Progress.js +14 -24
- package/src/components/skeleton/Skeleton.js +36 -13
- package/src/components/slider/Slider.js +96 -70
- package/src/components/spinner/Spinner.js +4 -2
- package/src/components/splitter/Splitter.js +15 -8
- package/src/components/splitter/SplitterGutter.js +28 -7
- package/src/components/splitter/SplitterPanel.js +9 -15
- package/src/components/splitter/index.js +3 -1
- package/src/components/stacks/AbsoluteStack.js +33 -0
- package/src/components/stacks/FixedStack.js +33 -0
- package/src/components/stacks/PositionStack.js +146 -0
- package/src/components/stacks/RelativeStack.js +33 -0
- package/src/components/{layouts → stacks}/Stack.js +22 -3
- package/src/components/{layouts → stacks}/index.js +6 -4
- package/src/components/stepper/Stepper.js +159 -67
- package/src/components/stepper/StepperStep.js +49 -12
- package/src/components/switch/Switch.js +59 -29
- package/src/components/switch/index.js +6 -0
- package/src/components/table/Column.js +22 -26
- package/src/components/table/ColumnGroup.js +4 -13
- package/src/components/table/DataTable.js +388 -103
- package/src/components/table/SimpleTable.js +28 -143
- package/src/components/tabs/Tabs.js +142 -44
- package/src/components/toast/Toast.js +40 -35
- package/src/components/tooltip/Tooltip.js +152 -35
- package/src/core/data/ObservableArray.js +94 -30
- package/src/core/data/ObservableChecker.js +20 -75
- package/src/core/data/ObservableItem.js +35 -3
- package/src/core/data/observable-helpers/computed.js +2 -1
- package/src/core/data/observable-helpers/object.js +13 -8
- package/src/core/data/observable-helpers/observable.is-to.js +196 -0
- package/src/core/elements/anchor/anchor.js +3 -2
- package/src/core/elements/control/for-each-array.js +44 -30
- package/src/core/elements/control/for-each.js +6 -3
- package/src/core/elements/control/show-if.js +11 -6
- package/src/core/elements/control/switch.js +2 -1
- package/src/core/elements/index.js +1 -1
- package/src/core/elements/svg.js +61 -0
- package/src/core/utils/HasEventEmitter.js +6 -0
- package/src/core/utils/debug-manager.js +2 -5
- package/src/core/utils/filters/standard.js +2 -1
- package/src/core/utils/property-accumulator.js +35 -6
- package/src/core/utils/shortcut-manager.js +242 -0
- package/src/core/utils/validator.js +1 -1
- package/src/core/wrappers/AttributesWrapper.js +41 -4
- package/src/core/wrappers/DocumentObserver.js +0 -1
- package/src/core/wrappers/HtmlElementWrapper.js +1 -1
- package/src/core/wrappers/NDElement.js +15 -2
- package/src/core/wrappers/SvgElementWrapper.js +15 -0
- package/src/core/wrappers/prototypes/attributes-extensions.js +4 -1
- package/src/core/wrappers/prototypes/nd-element-extensions.js +8 -1
- package/src/router/Router.js +0 -1
- package/src/ui/components/accordion/AccordionItemRender.js +63 -0
- package/src/ui/components/accordion/AccordionRender.js +34 -0
- package/src/ui/components/accordion/accordion.css +121 -0
- package/src/ui/components/alert/AlertRender.js +80 -0
- package/src/ui/components/alert/alert.css +163 -0
- package/src/ui/components/avatar/avata-group/AvatarGroupRender.js +49 -0
- package/src/ui/components/avatar/avata-group/avatar-group.css +38 -0
- package/src/ui/components/avatar/avatar/AvatarRender.js +87 -0
- package/src/ui/components/avatar/avatar/avatar.css +189 -0
- package/src/ui/components/badge/BadgeRender.js +24 -0
- package/src/ui/components/badge/badge.css +168 -0
- package/src/ui/components/breadcrumb/BreadcrumbRender.js +43 -0
- package/src/ui/components/breadcrumb/breadcrumb.css +55 -0
- package/src/ui/components/button/ButtonRender.js +65 -0
- package/src/ui/components/button/button.css +288 -354
- package/src/ui/components/contextmenu/ContextmenuRender.js +70 -0
- package/src/ui/components/contextmenu/contextmenu.css +36 -0
- package/src/ui/components/divider/DividerRender.js +70 -0
- package/src/ui/components/divider/divider.css +70 -0
- package/src/ui/components/dropdown/DropdownRender.js +92 -0
- package/src/ui/components/dropdown/divider/DropdownDividerRender.js +9 -0
- package/src/ui/components/dropdown/divider/dropdown-divider.css +0 -0
- package/src/ui/components/dropdown/dropdown.css +179 -0
- package/src/ui/components/dropdown/group/DropdownGroupRender.js +23 -0
- package/src/ui/components/dropdown/group/dropdown-group.css +0 -0
- package/src/ui/components/dropdown/item/DropdownItemRender.js +29 -0
- package/src/ui/components/dropdown/item/dropdown-item.css +0 -0
- package/src/ui/components/form/FieldCollectionRender.js +110 -0
- package/src/ui/components/form/FormControlRender.js +84 -0
- package/src/ui/components/form/field-collection.css +55 -0
- package/src/ui/components/form/fields/AutocompleteFieldRender.js +143 -0
- package/src/ui/components/form/fields/CheckboxFieldRender.js +59 -0
- package/src/ui/components/form/fields/CheckboxGroupFieldRender.js +92 -0
- package/src/ui/components/form/fields/ColorFieldRender.js +30 -0
- package/src/ui/components/form/fields/DateFieldRender.js +154 -0
- package/src/ui/components/form/fields/EmailFieldRender.js +5 -0
- package/src/ui/components/form/fields/FieldRender.js +117 -0
- package/src/ui/components/form/fields/FileFieldRender.js +41 -0
- package/src/ui/components/form/fields/HiddenFieldRender.js +14 -0
- package/src/ui/components/form/fields/ImageFieldRender.js +0 -0
- package/src/ui/components/form/fields/NumberFieldRender.js +52 -0
- package/src/ui/components/form/fields/PasswordFieldRender.js +65 -0
- package/src/ui/components/form/fields/RadioFieldRender.js +77 -0
- package/src/ui/components/form/fields/RangeFieldRender.js +121 -0
- package/src/ui/components/form/fields/SelectFieldRender.js +248 -0
- package/src/ui/components/form/fields/SliderFieldRender.js +359 -0
- package/src/ui/components/form/fields/StringFieldRender.js +6 -0
- package/src/ui/components/form/fields/TelFieldRender.js +6 -0
- package/src/ui/components/form/fields/TextAreaFieldRender.js +96 -0
- package/src/ui/components/form/fields/TimeFieldRender.js +141 -0
- package/src/ui/components/form/fields/UrlFieldRender.js +6 -0
- package/src/ui/components/form/fields/date-field.css +32 -0
- package/src/ui/components/form/fields/field.css +402 -0
- package/src/ui/components/form/fields/file-field.css +79 -0
- package/src/ui/components/form/fields/password-field.css +50 -0
- package/src/ui/components/form/fields/range-field.css +120 -0
- package/src/ui/components/form/fields/slider.css +195 -0
- package/src/ui/components/form/file-upload-mode/FileAvatarModeRender.js +143 -0
- package/src/ui/components/form/file-upload-mode/FileDropzoneModeRender.js +108 -0
- package/src/ui/components/form/file-upload-mode/FileNativeModeRender.js +22 -0
- package/src/ui/components/form/file-upload-mode/FileUploadButtonModeRender.js +89 -0
- package/src/ui/components/form/file-upload-mode/FileWallModeRender.js +91 -0
- package/src/ui/components/form/file-upload-mode/file-avatar-mode.css +139 -0
- package/src/ui/components/form/file-upload-mode/file-dropzone-mode.css +88 -0
- package/src/ui/components/form/file-upload-mode/file-upload-button-mode.css +44 -0
- package/src/ui/components/form/file-upload-mode/file-wall-mode.css +88 -0
- package/src/ui/components/form/form-control.css +40 -0
- package/src/ui/components/form/helpers.js +112 -0
- package/src/ui/components/form/index.js +61 -0
- package/src/ui/components/menu/MenuDividerRender.js +12 -0
- package/src/ui/components/menu/MenuGroupRender.js +60 -0
- package/src/ui/components/menu/MenuItemRender.js +57 -0
- package/src/ui/components/menu/MenuLinkRender.js +55 -0
- package/src/ui/components/menu/MenuRender.js +21 -0
- package/src/ui/components/menu/helpers.js +121 -0
- package/src/ui/components/menu/menu.css +308 -0
- package/src/ui/components/modal/ModalRender.js +119 -0
- package/src/ui/components/modal/modal.css +156 -0
- package/src/ui/components/pagination/PaginationRender.js +112 -0
- package/src/ui/components/pagination/pagination.css +63 -0
- package/src/ui/components/popover/PopoverRender.js +234 -0
- package/src/ui/components/popover/popover.css +139 -0
- package/src/ui/components/progress/ProgressRender.js +168 -0
- package/src/ui/components/progress/progress.css +197 -0
- package/src/ui/components/skeleton/SkeletonRender.js +79 -0
- package/src/ui/components/skeleton/skeleton.css +154 -0
- package/src/ui/components/spinner/SpinnerRender.js +46 -0
- package/src/ui/components/spinner/spinner.css +152 -0
- package/src/ui/components/splitter/SplitterGutterRender.js +94 -0
- package/src/ui/components/splitter/SplitterPanelRender.js +38 -0
- package/src/ui/components/splitter/SplitterRender.js +74 -0
- package/src/ui/components/splitter/splitter.css +128 -0
- package/src/ui/components/stacks/PositionStackRender.js +38 -0
- package/src/ui/components/stacks/StackRender.js +42 -0
- package/src/ui/components/stacks/absolute-stack/AbsoluteStackRender.js +5 -0
- package/src/ui/components/stacks/fixed-stack/FixedStackRender.js +5 -0
- package/src/ui/components/stacks/h-stack/HStackRender.js +7 -0
- package/src/ui/components/stacks/h-stack/h-stack.css +4 -0
- package/src/ui/components/stacks/index.js +15 -0
- package/src/ui/components/stacks/position-stack.css +62 -0
- package/src/ui/components/stacks/relative-stack/RelativeStackRender.js +7 -0
- package/src/ui/components/stacks/relative-stack/relative-stack.css +3 -0
- package/src/ui/components/stacks/stack.css +78 -0
- package/src/ui/components/stacks/v-stack/VStackRender.js +5 -0
- package/src/ui/components/stacks/v-stack/v-stack.css +4 -0
- package/src/ui/components/stepper/StepperRender.js +70 -0
- package/src/ui/components/stepper/StepperStepRender.js +67 -0
- package/src/ui/components/stepper/stepper.css +359 -0
- package/src/ui/components/switch/SwitchRender.js +82 -0
- package/src/ui/components/switch/switch.css +143 -0
- package/src/ui/components/table/data-table/DataTableRender.js +49 -0
- package/src/ui/components/table/data-table/bulk-actions.js +35 -0
- package/src/ui/components/table/data-table/data-table.css +246 -0
- package/src/ui/components/table/data-table/pagination.js +56 -0
- package/src/ui/components/table/data-table/tables.js +363 -0
- package/src/ui/components/table/data-table/toolbar.js +67 -0
- package/src/ui/components/table/simple-table/SimpleTableRender.js +188 -0
- package/src/ui/components/table/simple-table/simple-table.css +50 -0
- package/src/ui/components/tabs/TabsRender.js +226 -0
- package/src/ui/components/tabs/tabs.css +253 -0
- package/src/ui/components/toast/ToastRender.js +98 -0
- package/src/ui/components/toast/toast.css +201 -0
- package/src/ui/components/tooltip/TooltipRender.js +8 -0
- package/src/ui/components/tooltip/tooltip.css +113 -0
- package/src/ui/index.js +82 -0
- package/src/ui/tokens/colors-dark.scss +2 -1
- package/src/ui/tokens/reset.scss +3 -0
- package/types/control-flow.d.ts +2 -2
- package/src/components/layouts/ZStack.js +0 -41
- package/src/ui/components/button/button.render.js +0 -63
- /package/src/components/{layouts → stacks}/HStack.js +0 -0
- /package/src/components/{layouts → stacks}/VStack.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
var NativeDocument=function(e){"use strict";let t={};t={log(){},warn(){},error(){},disable(){}};var n=t;class r extends Error{constructor(e,t={}){super(e),this.name="NativeDocumentError",this.context=t,this.timestamp=(new Date).toISOString()}}function o(e,t){this.observable=e,this.checker=t,this.unSubscriptions=[]}o.prototype.__$Observable=!0,o.prototype.__$isObservableChecker=!0,o.prototype.subscribe=function(e){const t=this.observable.subscribe(t=>{e&&e(this.checker(t))});return this.unSubscriptions.push(t),t},o.prototype.check=function(e){return this.observable.check(()=>e(this.val()))},o.prototype.val=function(){return this.checker&&this.checker(this.observable.val())},o.prototype.set=function(e){return this.observable.set(e)},o.prototype.trigger=function(){return this.observable.trigger()},o.prototype.cleanup=function(){return this.observable.cleanup()};const s={mounted:new WeakMap,beforeUnmount:new WeakMap,mountedSupposedSize:0,unmounted:new WeakMap,unmountedSupposedSize:0,observer:null,initObserver:()=>{s.observer||(s.observer=new MutationObserver(s.checkMutation),s.observer.observe(document.body,{childList:!0,subtree:!0}))},executeMountedCallback(e){const t=s.mounted.get(e);if(t&&(t.inDom=!0,t.mounted))if(Array.isArray(t.mounted))for(const n of t.mounted)n(e);else t.mounted(e)},executeUnmountedCallback(e){const t=s.unmounted.get(e);if(!t)return;if(t.inDom=!1,!t.unmounted)return;let n=!1;if(Array.isArray(t.unmounted))for(const r of t.unmounted)!0===r(e)&&(n=!0);else n=!0===t.unmounted(e);n&&(t.disconnect(),e.nd?.remove())},checkMutation:function(e){console.log("mutationsList",e);for(const t of e){if(s.mountedSupposedSize>0)for(const e of t.addedNodes){if(s.executeMountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-mounted]");for(const e of t)s.executeMountedCallback(e)}if(s.unmountedSupposedSize>0)for(const e of t.removedNodes){if(s.executeUnmountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-unmounted]");for(const e of t)s.executeUnmountedCallback(e)}}},watch:function(e,t=!1){let n=!1,r=!1;s.initObserver();let o={inDom:t,mounted:null,unmounted:null,disconnect:()=>{n&&(s.mounted.delete(e),s.mountedSupposedSize--),r&&(s.unmounted.delete(e),s.unmountedSupposedSize--),o=null}};const i=(e,t)=>{o[e]?Array.isArray(o[e])?o[e].push(t):o[e]=[o[e],t]:o[e]=t};return{disconnect:()=>o?.disconnect(),mounted:t=>{i("mounted",t),s.mounted.set(e,o),n||(s.mountedSupposedSize++,n=!0)},unmounted:t=>{i("unmounted",t),s.unmounted.set(e,o),r||(s.unmountedSupposedSize++,r=!0)},off:(e,t)=>{((e,t)=>{if(o?.[e]){if(Array.isArray(o[e])){const n=o[e].indexOf(t);return n>-1&&o[e].splice(n,1),1===o[e].length&&(o[e]=o[e][0]),void(0===o[e].length&&(o[e]=null))}o[e]=null}})(e,t)}}}};function i(e){this.$element=e}i.prototype.__$isNDElement=!0,i.prototype.valueOf=function(){return this.$element},i.prototype.ref=function(e,t){return e[t]=this.$element,this},i.prototype.refSelf=function(e,t){return e[t]=new i(this.$element),this},i.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},i.prototype.remove=function(){let e=this.$element;return e.nd.unmountChildren(),e.$ndProx=null,a.delete(e),e=null,this};const a=new WeakMap;i.prototype.lifecycle=function(e){const t=this.$element;a.has(t)||a.set(t,s.watch(t));const n=a.get(t);return e.mounted&&(this.$element.setAttribute("data--nd-mounted","1"),n.mounted(e.mounted)),e.unmounted&&(this.$element.setAttribute("data--nd-unmounted","1"),n.unmounted(e.unmounted)),this},i.prototype.mounted=function(e){return this.lifecycle({mounted:e})},i.prototype.unmounted=function(e){return this.lifecycle({unmounted:e})},i.prototype.beforeUnmount=function(e,t){const n=this.$element;if(!s.beforeUnmount.has(n)){s.beforeUnmount.set(n,new Map);const e=n.remove.bind(n);let t=!1;n.remove=async()=>{if(!t){t=!0;try{const e=s.beforeUnmount.get(n);for(const t of e.values())await t.call(this,n)}finally{e(),t=!1}}}}return s.beforeUnmount.get(n).set(e,t),this},i.prototype.htmlElement=function(){return this.$element},i.prototype.node=i.prototype.htmlElement,i.prototype.shadow=function(e,t=null){const n=this.$element,r=Array.from(n.childNodes),o=n.attachShadow({mode:e});if(t){const e=document.createElement("style");e.textContent=t,o.appendChild(e)}return n.append=o.append.bind(o),n.appendChild=o.appendChild.bind(o),o.append(...r),this},i.prototype.openShadow=function(e=null){return this.shadow("open",e)},i.prototype.closedShadow=function(e=null){return this.shadow("closed",e)},i.prototype.with=function(e){if(!e||"object"!=typeof e)throw new r("extend() requires an object of methods");for(const t in e){const n=e[t];"function"==typeof n?this[t]=n.bind(this):console.warn(`⚠️ extends(): "${t}" is not a function, skipping`)}return this},i.extend=function(e){if(!e||"object"!=typeof e)throw new r("NDElement.extend() requires an object of methods");if(Array.isArray(e))throw new r("NDElement.extend() requires an object, not an array");const t=new Set(["constructor","valueOf","$element","$observer","ref","remove","cleanup","with","extend","attach","lifecycle","mounted","unmounted","unmountChildren"]);for(const o in e){if(!Object.hasOwn(e,o))continue;const s=e[o];if("function"==typeof s){if(t.has(o))throw n.error("NDElement.extend",`Cannot override protected method "${o}"`),new r(`Cannot override protected method "${o}"`);i.prototype[o]&&n.warn("NDElement.extend",`Overwriting existing prototype method "${o}"`),i.prototype[o]=s}else n.warn("NDElement.extend",`"${o}" is not a function, skipping`)}return i};const l=3,u=8,c=11,h=[];h[1]=!0,h[l]=!0,h[c]=!0,h[u]=!0;const p={isObservable:e=>e?.__$isObservable,isTemplateBinding:e=>e?.__$isTemplateBinding,isObservableWhenResult:e=>e&&(e.__$isObservableWhen||"object"==typeof e&&"$target"in e&&"$observer"in e),isArrayObservable:e=>e?.__$isObservableArray,isProxy:e=>e?.__isProxy__,isObservableOrProxy:e=>p.isObservable(e)||p.isProxy(e),isAnchor:e=>e?.__Anchor__,isObservableChecker:e=>e?.__$isObservableChecker||e instanceof o,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&&null!==e,isJson:e=>!("object"!=typeof e||null===e||Array.isArray(e)||"Object"!==e.constructor.name),isElement:e=>e&&h[e.nodeType],isDOMNode:e=>h[e.nodeType],isFragment:e=>e?.nodeType===c,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?.__$isNDElement||e instanceof i,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 r(`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){},validateEventCallback(e){if("function"!=typeof e)throw new r("Event callback must be a function")}},d=new Set(["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"]),f=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`)}}}(),m=function(e,t){this.$target=t,this.$observer=e};m.prototype.__$Observable=!0,m.prototype.__$isObservableWhen=!0,m.prototype.subscribe=function(e){return this.$observer.on(this.$target,e)},m.prototype.val=function(){return this.$observer.$currentValue===this.$target},m.prototype.isMatch=m.prototype.val,m.prototype.isActive=m.prototype.val;const b=function(e){let t=!1;return function(...n){t||(t=!0,Promise.resolve().then(()=>{e.apply(this,n),t=!1}))}},y=function(e,t){return e.replace(new RegExp(`^[${t}]+|[${t}]+$`,"g"),"")},g=(e,t)=>{try{if(void 0!==window.structuredClone)return window.structuredClone(e)}catch(e){}if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>g(e));if(p.isObservable(e))return t&&t(e),e;const n={};for(const t in e)Object.hasOwn(e,t)&&(n[t]=g(e[t]));return n},v=(e,t)=>{const n=new Date(e);return{d:n,parts:new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(n).reduce((e,{type:t,value:n})=>(e[t]=n,e),{})}},w=(e,t,n)=>{const r=e=>String(e).padStart(2,"0");return e.replace("YYYY",n.year).replace("YY",n.year.slice(-2)).replace("MMMM",n.month).replace("MMM",n.month.slice(0,3)).replace("MM",r(t.getMonth()+1)).replace("DD",r(t.getDate())).replace("D",t.getDate()).replace("HH",n.hour).replace("mm",n.minute).replace("ss",n.second)},$={currency:(e,t,{currency:n="XOF",notation:r,minimumFractionDigits:o,maximumFractionDigits:s}={})=>new Intl.NumberFormat(t,{style:"currency",currency:n,notation:r,minimumFractionDigits:o,maximumFractionDigits:s}).format(e),number:(e,t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}={})=>new Intl.NumberFormat(t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}).format(e),percent:(e,t,{decimals:n=1}={})=>new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:n}).format(e),date:(e,t,{format:n,dateStyle:r="long"}={})=>{if(n){const{d:r,parts:o}=v(e,t);return w(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r}).format(new Date(e))},time:(e,t,{format:n,hour:r="2-digit",minute:o="2-digit",second:s}={})=>{if(n){const{d:r,parts:o}=v(e,t);return w(n,r,o)}return new Intl.DateTimeFormat(t,{hour:r,minute:o,second:s}).format(new Date(e))},datetime:(e,t,{format:n,dateStyle:r="long",hour:o="2-digit",minute:s="2-digit",second:i}={})=>{if(n){const{d:r,parts:o}=v(e,t);return w(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r,hour:o,minute:s,second:i}).format(new Date(e))},relative:(e,t,{unit:n="day",numeric:r="auto"}={})=>{const o=Math.round((e-Date.now())/864e5);return new Intl.RelativeTimeFormat(t,{numeric:r}).format(o,n)},plural:(e,t,{singular:n,plural:r}={})=>`${e} ${"one"===new Intl.PluralRules(t).select(e)?n:r}`},C={getJson(e){let t=localStorage.getItem(e);try{return JSON.parse(t)}catch(t){throw new r("invalid_json:"+e)}},getNumber(e){return Number(this.get(e))},getBool(e){const t=this.get(e);return"true"===t||"1"===t},setJson(e,t){localStorage.setItem(e,JSON.stringify(t))},setBool(e,t){localStorage.setItem(e,t?"true":"false")},get:(e,t=null)=>localStorage.getItem(e)||t,set:(e,t)=>localStorage.setItem(e,t),remove(e){localStorage.removeItem(e)},has:e=>null!=localStorage.getItem(e)},S=(e,t)=>{if(!C.has(e))return t;switch(typeof t){case"object":return C.getJson(e)??t;case"boolean":return C.getBool(e)??t;case"number":return C.getNumber(e)??t;default:return C.get(e,t)??t}},O=e=>{switch(typeof e){case"object":return C.setJson;case"boolean":return C.setBool;default:return C.set}};function A(e,t=null){e=p.isObservable(e)?e.val():e,this.$previousValue=null,this.$currentValue=e,this.$firstListener=null,this.$listeners=null,this.$watchers=null,this.$memoryId=null,t&&(this.configs=t,t.reset&&(this.$initialValue=p.isObject(e)?g(e):e))}Object.defineProperty(A.prototype,"$value",{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0}),A.prototype.__$Observable=!0,A.prototype.__$isObservable=!0;const E=function(){};A.prototype.intercept=function(e){return this.$interceptor=e,this.set=this.$setWithInterceptor,this},A.prototype.triggerFirstListener=function(e){this.$firstListener(this.$currentValue,this.$previousValue,e)},A.prototype.triggerListeners=function(e){const t=this.$listeners,n=this.$previousValue,r=this.$currentValue;for(let o=0,s=t.length;o<s;o++)t[o](r,n,e)},A.prototype.triggerWatchers=function(e){const t=this.$watchers,n=this.$previousValue,r=this.$currentValue,o=t.get(r),s=t.get(n);o&&o(!0,n,e),s&&s(!1,r,e)},A.prototype.triggerAll=function(e){this.triggerWatchers(e),this.triggerListeners(e)},A.prototype.triggerWatchersAndFirstListener=function(e){this.triggerWatchers(e),this.triggerFirstListener(e)},A.prototype.assocTrigger=function(){this.$firstListener=null,this.$watchers?.size&&this.$listeners?.length?this.trigger=1===this.$listeners.length?this.triggerWatchersAndFirstListener:this.triggerAll:this.$listeners?.length?1===this.$listeners.length?(this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener):this.trigger=this.triggerListeners:this.$watchers?.size?this.trigger=this.triggerWatchers:this.trigger=E},A.prototype.trigger=E;const N={action:"set"};function x(e,t=null){return new A(e,t)}A.prototype.$updateWithNewValue=function(e){e=e?.__$isObservable?e.val():e,this.$currentValue!==e&&(this.$previousValue=this.$currentValue,this.$currentValue=e,this.trigger(N),this.$previousValue=null)},A.prototype.$setWithInterceptor=function(e){let t="function"==typeof e?e(this.$currentValue):e;const n=this.$interceptor(t,this.$currentValue);void 0!==n&&(t=n),this.$updateWithNewValue(t)},A.prototype.$basicSet=function(e){let t="function"==typeof e?e(this.$currentValue):e;this.$updateWithNewValue(t)},A.prototype.set=A.prototype.$basicSet,A.prototype.val=function(){return this.$currentValue},A.prototype.disconnectAll=function(){this.$previousValue=null,this.$currentValue=null,this.$listeners=null,this.$watchers=null,this.trigger=E},A.prototype.onCleanup=function(e){this.$cleanupListeners=this.$cleanupListeners??[],this.$cleanupListeners.push(e)},A.prototype.cleanup=function(){if(this.$cleanupListeners){for(let e=0;e<this.$cleanupListeners.length;e++)this.$cleanupListeners[e]();this.$cleanupListeners=null}f.unregister(this.$memoryId),this.disconnectAll(),delete this.$value},A.prototype.subscribe=function(e){this.$listeners=this.$listeners??[],this.$listeners.push(e),this.assocTrigger()},A.prototype.on=function(e,t){this.$watchers=this.$watchers??new Map;let n=this.$watchers.get(e);t.__$isObservable&&(t=t.set.bind(t)),n?p.isArray(n.list)?n.list.push(t):(n=[n,t],t=e=>{for(let t=0,r=n.length;t<r;t++)n[t](e)},t.list=n,this.$watchers.set(e,t)):(n=t,this.$watchers.set(e,t)),this.assocTrigger()},A.prototype.off=function(e,t){if(!this.$watchers)return;const n=this.$watchers.get(e);if(!n)return;if(!t||!Array.isArray(n.list))return this.$watchers?.delete(e),void this.assocTrigger();const r=n.indexOf(t);n?.splice(r,1),1===n.length?this.$watchers.set(e,n[0]):0===n.length&&this.$watchers?.delete(e),this.assocTrigger()},A.prototype.once=function(e,t){const n="function"==typeof e?e:t=>t===e,r=e=>{n(e)&&(this.unsubscribe(r),t(e))};this.subscribe(r)},A.prototype.unsubscribe=function(e){if(!this.$listeners)return;const t=this.$listeners.indexOf(e);t>-1&&this.$listeners.splice(t,1),this.assocTrigger()},A.prototype.check=function(e){return new o(this,e)},A.prototype.transform=A.prototype.check,A.prototype.pluck=A.prototype.check,A.prototype.is=A.prototype.check,A.prototype.select=A.prototype.check,A.prototype.get=function(e){const t=this.$currentValue[e];return p.isObservable(t)?t.val():t},A.prototype.when=function(e){return new m(this,e)},A.prototype.equals=function(e){return p.isObservable(e)?this.$currentValue===e.$currentValue:this.$currentValue===e},A.prototype.toBool=function(){return!!this.$currentValue},A.prototype.toggle=function(){this.set(!this.$currentValue)},A.prototype.reset=function(){if(!this.configs?.reset)return;const e=p.isObject(this.$initialValue)?g(this.$initialValue,e=>{e.reset()}):this.$initialValue;this.set(e)},A.prototype.toString=function(){return String(this.$currentValue)},A.prototype.valueOf=function(){return this.$currentValue},A.prototype.format=function(e,t={}){const n=this;if("function"==typeof e)return new o(n,e);const r=$[e],s=$.locale;return x.computed(()=>r(n.val(),s.val(),t),[n,s])},A.prototype.persist=function(e,t={}){let n=S(e,this.$currentValue);t.get&&(n=t.get(n)),this.set(n);const r=O(this.$currentValue);return this.subscribe(n=>{r(e,t.set?t.set(n):n)}),this};const D=x,k=x;x.useValueProperty=function(e="value"){Object.defineProperty(A.prototype,e,{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0})},x.getById=function(e){const t=f.getObservableById(parseInt(e));if(!t)throw new r("Observable.getById : No observable found with id "+e);return t},x.cleanup=function(e){e.cleanup()},x.autoCleanup=function(e=!1,t={}){if(!e)return;const{interval:n=6e4,threshold:r=100}=t;window.addEventListener("beforeunload",()=>{f.cleanup()}),setInterval(()=>f.cleanObservables(r),n)};const F=(e,t)=>{for(const n in t){const r=t[n];r.__$Observable?(e.classes.toggle(n,r.val()),r.subscribe(t=>e.classes.toggle(n,t))):r.$hydrate?r.$hydrate(e,n):e.classes.toggle(n,r)}},T=(e,t)=>{for(const n in t){const r=t[n];r.__$isObservable?(e.style[n]=r.val(),r.subscribe(t=>e.style[n]=t)):e.style[n]=r}},_=(e,t,n)=>{const r=n.__$isObservable,o=r?n.val():n;if(p.isBoolean(o)?e[t]=o:e[t]=o===e.value,r){if("checked"===t)return"boolean"==typeof o?e.addEventListener("input",()=>n.set(e[t])):e.addEventListener("input",()=>n.set(e.value)),void n.subscribe(n=>e[t]=n);n.subscribe(n=>e[t]=n===e.value)}},I=(e,t)=>{for(const n in t){const r=n.toLowerCase();let o=t[n];if(null!=o)if(o.handleNdAttribute)o.handleNdAttribute(e,r,o);else{if("object"==typeof o){if("class"===r){F(e,o);continue}if("style"===r){T(e,o);continue}}d.has(r)?_(e,r,o):e.setAttribute(r,o)}}return e};function M(e){this.$hydrate=e}M.prototype.__$isTemplateBinding=!0,String.prototype.toNdElement=function(){return L.createStaticTextNode(null,this)},Number.prototype.toNdElement=function(){return L.createStaticTextNode(null,this.toString())},Element.prototype.toNdElement=function(){return this},Text.prototype.toNdElement=function(){return this},Comment.prototype.toNdElement=function(){return this},Document.prototype.toNdElement=function(){return this},DocumentFragment.prototype.toNdElement=function(){return this},A.prototype.toNdElement=function(){return L.createObservableNode(null,this)},o.prototype.toNdElement=A.prototype.toNdElement,i.prototype.toNdElement=function(){return this.$element??this.$build?.()??this.build?.()??null},Array.prototype.toNdElement=function(){const e=document.createDocumentFragment();for(let t=0,n=this.length;t<n;t++){const n=L.getChild(this[t]);null!==n&&e.appendChild(n)}return e},Function.prototype.toNdElement=function(){return L.getChild(this())},M.prototype.toNdElement=function(){return L.createHydratableNode(null,this)};const R=(e,t=1e3)=>new Promise(n=>{let r=!1;const o=t=>{t&&t.target!==e||r||(r=!0,e.removeEventListener("transitionend",o),e.removeEventListener("animationend",o),clearTimeout(s),n())};e.addEventListener("transitionend",o),e.addEventListener("animationend",o);const s=setTimeout(o,t),i=window.getComputedStyle(e),a="0s"!==i.transitionDuration,l="0s"!==i.animationDuration;a||l||o()});i.prototype.transitionOut=function(e){const t=e+"-exit",n=this.$element;return this.beforeUnmount("transition-exit",async function(){n.classes.add(t),await R(n),n.classes.remove(t)}),this},i.prototype.transitionIn=function(e){const t=e+"-enter-from",n=e+"-enter-to",r=this.$element;return r.classes.add(t),this.mounted(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classes.remove(t),r.classes.add(n),R(r).then(()=>{r.classes.remove(n)})})})}),this},i.prototype.transition=function(e){return this.transitionIn(e),this.transitionOut(e),this},i.prototype.animate=function(e){const t=this.$element;return t.classes.add(e),R(t).then(()=>{t.classes.remove(e)}),this},A.prototype.handleNdAttribute=function(e,t){d.has(t)?_(e,t,this):((e,t,n)=>{const r="value"===t?t=>e.value=t:n=>e.setAttribute(t,n);if(n.subscribe(r),"value"===t)return e.value=n.val(),void e.addEventListener("input",()=>n.set(e.value));e.setAttribute(t,n.val())})(e,t,this)},M.prototype.handleNdAttribute=function(e,t){this.$hydrate(e,t)};let P=null;const L={createTextNode:()=>(P||(P=document.createTextNode(""),L.createTextNode=()=>P.cloneNode()),P.cloneNode()),createObservableNode:(e,t)=>{const n=L.createTextNode();return t.subscribe(e=>n.nodeValue=e),n.nodeValue=t.val(),e&&e.appendChild(n),n},createHydratableNode:(e,t)=>{const n=L.createTextNode();return t.$hydrate(n),n},createStaticTextNode:(e,t)=>{let n=L.createTextNode();return n.nodeValue=t,e&&e.appendChild(n),n},createElement:e=>document.createElement(e).cloneNode(),createFragment:e=>j("Fragment"),bindTextNode:(e,t)=>{if(t?.__$isObservable)return t.subscribe(t=>e.nodeValue=t),void(e.nodeValue=t.val());e.nodeValue=t},processChildren:(e,t)=>{if(null===e)return;let n=L.getChild(e);n&&t.appendChild(n)},async safeRemove(e){await e.remove()},getChild:e=>{if(null==e)return null;if(e.toNdElement)do{if(e=e.toNdElement(),p.isElement(e))return e}while(e.toNdElement);return L.createStaticTextNode(null,e)},processAttributes:(e,t)=>{t&&I(e,t)},processAttributesDirect:I,processClassAttribute:F,processStyleAttribute:T};function V(e){const t=Reflect.construct(DocumentFragment,[],V),n=document.createComment((e||"")+" Anchor Sentinel"),r=document.createComment("Anchor Start : "+e),o=document.createComment("/ Anchor End "+e),s={};t.append(r,n,o);const i=new MutationObserver(()=>{n.parentNode===t||n.parentNode instanceof DocumentFragment||s.connected&&s.connected(n.parentNode)});return i.observe(document,{childList:!0,subtree:!0}),t.$sentinel=n,t.$start=r,t.$end=o,t.$observer=i,t.$events=s,t}function j(e,t=!1){const n=new V(e);n.onConnectedOnce(e=>{t&&function(e,t){e.remove=()=>{e.append.apply(e,t.childNodes)},e.getParent=()=>t,e.appendChild=e=>{e=p.isElement(e)?e:L.getChild(e),t.appendChild(e)},e.appendChildRaw=t.appendChild.bind(t),e.append=e.appendChild,e.appendRaw=e.appendChildRaw,e.insertAtStart=e=>{e=p.isElement(e)?e:L.getChild(e),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.insertAtStartRaw=e=>{t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.appendElement=e.appendChild,e.removeChildren=()=>{t.textContent=""},e.replaceContent=function(e){const n=p.isElement(e)?e:L.getChild(e);t.replaceChildren(n)},e.replaceContentRaw=function(e){t.replaceChildren(e)},e.setContent=e.replaceContent,e.insertBefore=(e,n)=>{e=p.isElement(e)?e:L.getChild(e),t.insertBefore(e,n)},e.insertBeforeRaw=(e,n)=>{t.insertBefore(e,n)},e.appendChildBefore=e.insertBefore,e.appendChildBeforeRaw=e.insertBeforeRaw,e.clear=e.remove,e.detach=e.remove,e.replaceChildren=function(){t.replaceChildren(...arguments)},e.getByIndex=e=>t.childNodes[e]}(n,e)}),n.__Anchor__=!0;const r=n.$start,o=n.$end;n.nativeInsertBefore=n.insertBefore,n.nativeAppendChild=n.appendChild,n.nativeAppend=n.append;const s=t?()=>!0:e=>e.firstChild===r&&e.lastChild===o,i=function(e,t,r){e!==n?s(e)&&r===o?e.append(t,r):e.insertBefore(t,r):e.nativeInsertBefore(t,r)};return n.appendElement=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,o):t.nativeInsertBefore(e,o)},n.appendChild=function(e,t=null){const n=o.parentNode;n?function(e,t,n){const r=p.isElement(t)?t:L.getChild(t);i(e,r,n)}(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.appendChildRaw=function(e,t=null){const n=o.parentNode;n?i(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.getParent=()=>o.parentNode,n.append=n.appendChild,n.appendRaw=n.appendChildRaw,n.insertAtStart=function(e){e=p.isElement(e)?e:L.getChild(e),n.insertAtStartRaw(e)},n.insertAtStartRaw=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,r):t.nativeInsertBefore(e,r)},n.removeChildren=function(){const e=o.parentNode;if(e===n)return;if(s(e))return void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,i.remove(),i=t},n.remove=function(){const e=o.parentNode;if(e===n)return;if(s(e))return n.nativeAppend.apply(n,e.childNodes),void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,n.nativeAppend(i),i=t},n.removeWithAnchors=function(){n.removeChildren(),r.remove(),o.remove()},n.replaceContent=function(e){const t=p.isElement(e)?e:L.getChild(e);n.replaceContentRaw(t)},n.replaceContentRaw=function(e){const t=o.parentNode;t&&(s(t)?t.replaceChildren(r,e,o):(n.removeChildren(),t.insertBefore(e,o)))},n.setContent=n.replaceContent,n.setContentRaw=n.replaceContentRaw,n.insertBefore=n.appendChild,n.insertBeforeRaw=n.appendChildRaw,n.endElement=function(){return o},n.startElement=function(){return r},n.restore=function(){n.appendChild(n)},n.clear=n.remove,n.detach=n.remove,n.getByIndex=function(e){let t=r;for(let n=0;n<=e;n++){if(!t.nextSibling)return null;t=t.nextSibling}return t!==r?t:null},n}V.prototype=Object.create(DocumentFragment.prototype),V.prototype.constructor=V,V.prototype.onConnected=function(e){return this.$events.connected=e,this},V.prototype.onConnectedOnce=function(e){this.$events.connected=t=>{e(t),this.$observer.disconnect(),this.$events.connectedOnce=null}},DocumentFragment.prototype.setAttribute=()=>{};const B={configurable:!0,get(){return new i(this)}};Object.defineProperty(HTMLElement.prototype,"nd",B),Object.defineProperty(DocumentFragment.prototype,"nd",B),Object.defineProperty(i.prototype,"nd",{configurable:!0,get:function(){return this}}),["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","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();i.prototype["on"+e]=function(e=null){return this.$element.addEventListener(t,e),this}}),["Click","DblClick","MouseDown","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Change","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","BeforeUnload","HashChange","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();i.prototype["onStop"+e]=function(e=null){return W(this.$element,t,e),this},i.prototype["onPreventStop"+e]=function(e=null){return U(this.$element,t,e),this}}),["Click","DblClick","MouseDown","MouseUp","Wheel","KeyDown","KeyPress","Invalid","Reset","Submit","DragOver","Drop","BeforeUnload","TouchCancel","TouchEnd","TouchMove","TouchStart","Copy","Cut","Paste","ContextMenu"].forEach(e=>{const t=e.toLowerCase();i.prototype["onPrevent"+e]=function(e=null){return q(this.$element,t,e),this}}),i.prototype.on=function(e,t,n){return this.$element.addEventListener(e.toLowerCase(),t,n),this};const q=function(e,t,n){return e.addEventListener(t,t=>{t.preventDefault(),n&&n.call(e,t)}),this},W=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),n&&n.call(e,t)}),this},U=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),t.preventDefault(),n&&n.call(e,t)}),this},H={getClasses(){return this.$element.className?.split(" ").filter(Boolean)},add(e){const t=this.getClasses();t.indexOf(e)>=0||(t.push(e),this.$element.className=t.join(" "))},remove(e){const t=this.getClasses(),n=t.indexOf(e);n<0||(t.splice(n,1),this.$element.className=t.join(" "))},toggle(e,t=void 0){const n=this.getClasses(),r=n.indexOf(e);if(r>=0){if(!0===t)return;n.splice(r,1)}else{if(!1===t)return;n.push(e)}this.$element.className=n.join(" ")},contains(e){return this.getClasses().indexOf(e)>=0}};Object.defineProperty(HTMLElement.prototype,"classes",{configurable:!0,get(){return{$element:this,...H}}});let z=e=>e;e.ArgTypes={},e.ArgTypes={string:()=>!0,number:()=>!0,boolean:()=>!0,observable:()=>!0,element:()=>!0,function:()=>!0,object:()=>!0,objectNotNull:()=>!0,children:()=>!0,attributes:()=>!0,optional:()=>!0,oneOf:()=>!0};const K=function(e,t=null){return e&&t?{props:e,children:t}:"object"!=typeof e||Array.isArray(e)||null===e||"Object"!==e.constructor.name||e.$hydrate?{props:t,children:e}:{props:e,children:t}},J=e=>e?e.toNdElement():L.createTextNode(),Y=(e,t,n=null)=>{let{props:r,children:o=null}=K(t,n);return L.processAttributes(e,r),L.processChildren(o,e),e};function G(e,t=null){if(e){if(t){let n=null,r=(o,s)=>(n=document.createElement(e),r=(e,r)=>Y(t(n.cloneNode()),e,r),Y(t(n.cloneNode()),o,s));return(e,t)=>r(e,t)}let n=null,r=(t,o)=>(n=document.createElement(e),r=(e,t)=>Y(n.cloneNode(),e,t),Y(n.cloneNode(),t,o));return(e,t)=>r(e,t)}return(e,t="")=>{const n=j(t);return n.append(e),n}}function Q(e){this.$element=e,this.$classes=null,this.$styles=null,this.$attrs=null,this.$ndMethods=null}i.prototype.attach=function(e,t){if("function"==typeof t){const n=this.$element;return n.nodeCloner=n.nodeCloner||new Q(n),n.nodeCloner.attach(e,t),n}return t.$hydrate(this.$element,e),this.$element},Q.prototype.__$isNodeCloner=!0;const X=(e,t,n)=>{for(const r in t)e[r]=t[r].apply(null,n);return e};Q.prototype.resolve=function(){if(this.$content)return;const e=[];if(this.$ndMethods){const t=Object.keys(this.$ndMethods);if(1===t.length){const n=t[0],r=this.$ndMethods[n];e.push((e,t)=>{e.nd[n](r.bind(e,...t))})}else e.push((e,t)=>{const n=e.nd;for(const r in this.$ndMethods)n[r](this.$ndMethods[r].bind(e,...t))})}if(this.$classes){const t={},n=Object.keys(this.$classes);if(1===n.length){const r=n[0],o=this.$classes[r];e.push((e,n)=>{t[r]=o.apply(null,n),L.processClassAttribute(e,t)})}else e.push((e,n)=>{L.processClassAttribute(e,X(t,this.$classes,n))})}if(this.$styles){const t={},n=Object.keys(this.$styles);if(1===n.length){const r=n[0],o=this.$styles[r];e.push((e,n)=>{t[r]=o.apply(null,n),L.processStyleAttribute(e,t)})}else e.push((e,n)=>{L.processStyleAttribute(e,X(t,this.$styles,n))})}if(this.$attrs){const t={},n=Object.keys(this.$attrs);if(1===n.length){const r=n[0],o=this.$attrs[r];e.push((e,n)=>{t[r]=o.apply(null,n),L.processAttributes(e,t)})}else e.push((e,n)=>{L.processAttributes(e,X(t,this.$attrs,n))})}const t=e.length,n=this.$element;this.cloneNode=r=>{const o=n.cloneNode(!1);for(let n=0;n<t;n++)e[n](o,r);return o}},Q.prototype.cloneNode=function(e){return this.$element.cloneNode(!1)},Q.prototype.attach=function(e,t){return this.$ndMethods=this.$ndMethods||{},this.$ndMethods[e]=t,this},Q.prototype.text=function(e){return this.$content=e,"function"==typeof e?(this.cloneNode=t=>J(e.apply(null,t)),this):(this.cloneNode=t=>J(t[0][e]),this)},Q.prototype.attr=function(e,t){return"class"===e?(this.$classes=this.$classes||{},this.$classes[t.property]=t.value,this):"style"===e?(this.$styles=this.$styles||{},this.$styles[t.property]=t.value,this):(this.$attrs=this.$attrs||{},this.$attrs[e]=t.value,this)};function Z(e){let t=null;const n=e=>{const t=e.childNodes;let r=!!e.nodeCloner;const o=t.length;for(let e=0;e<o;e++){const o=t[e];o.nodeCloner&&(r=!0);n(o)&&(r=!0)}return r?e.nodeCloner?(e.nodeCloner.resolve(),e.dynamicCloneNode=n=>{const r=e.nodeCloner.cloneNode(n);for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}):e.dynamicCloneNode=n=>{const r=e.cloneNode();for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}:e.dynamicCloneNode=e.cloneNode.bind(e,!0),r};this.clone=r=>{const o=ee(this);return t=e(o),t.nodeCloner||(t.nodeCloner=new Q(t)),n(t),this.clone=t.dynamicCloneNode,t.dynamicCloneNode(r)};const r=(e,t)=>new M((n,r)=>{!function(e,t,n,r){n.nodeCloner=n.nodeCloner||new Q(n),"value"!==t?"attach"!==t?n.nodeCloner.attr(t,{property:r,value:e}):n.nodeCloner.attach(r,e):n.nodeCloner.text(e)}(e,t,n,r)});this.style=e=>r(e,"style"),this.class=e=>r(e,"class"),this.property=e=>this.value(e),this.value=e=>r(e,"value"),this.text=this.value,this.attr=e=>r(e,"attributes"),this.attach=e=>r(e,"attach"),this.callback=this.attach}const ee=e=>new Proxy(e,{get:(e,t)=>t in e||"symbol"==typeof t?e[t]:e.value(t)});function te(e){let t=null,n=null;this.render=r=>{if(t||(t=e(this)),!n)return t;for(const e in n){(0,n[e])(...r)}return t},this.createSection=(e,t)=>{n=n||{};const r=j("Component "+e);return n[e]=function(...e){r.removeChildren(),t?r.appendChild(t(...e)):r.append(e)},r}}DocumentFragment.prototype.__IS_FRAGMENT=!0,Function.prototype.args=function(...e){return this},Function.prototype.cached=function(...e){let t,n=()=>t;return()=>(t||(t=this.apply(this,e),t.cloneNode?n=()=>t.cloneNode(!0):t.$element&&(n=()=>new i(t.$element.cloneNode(!0)))),n())},Function.prototype.errorBoundary=function(e){const t=(...n)=>{try{return this.apply(this,n)}catch(r){return e(r,{caller:t,args:n})}};return t},String.prototype.use=function(e){const t=this;return x.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 x.getById(n)}):this.valueOf()};const ne=function(e={}){let t=p.isString(e)?e.split(";").filter(Boolean):e;const n=p.isArray(t);return{add(e,r){n?t.push(e+": "+r):t[e]=r},value:()=>n?t.join(";").concat(";"):{...t}}},re=function(e=[]){let t=p.isString(e)?e.split(" ").filter(Boolean):e;const n=p.isArray(t);return{add(e,r=!0){n?t.push(e):t[e]=r},value:()=>n?t.join(" "):{...t}}},oe=e=>{let t=null;return(...n)=>(null!=t||(t=e(...n)),t)},se=e=>{let t=null;return new Proxy({},{get:(n,r)=>(t||(t=e()),t[r])})},ie=e=>{const t=new Map;return new Proxy({},{get:(n,r)=>{const o=t.get(r);if(o)return o;if(e.length>0)return(...n)=>{const o=e(...n,r);return t.set(r,o),o};const s=e(r);return t.set(r,s),s}})};function ae(e){return e instanceof Date?e:new Date(e)}function le(e,t){const n=ae(e),r=ae(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function ue(e){const t=ae(e);return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()}function ce(e,t){const n=p.isObservable(e);return{dependencies:n?e:null,callback:r=>t(r,n?e.val():e)}}function he(e,t){const n=e.filter(p.isObservable);return{dependencies:n.length>0?n:null,callback:n=>t(n,e.map(e=>p.isObservable(e)?e.val():e))}}function pe(e){return ce(e,(e,t)=>e===t)}function de(e){return ce(e,(e,t)=>e!==t)}function fe(e){return ce(e,(e,t)=>e>t)}function me(e){return ce(e,(e,t)=>e>=t)}function be(e){return ce(e,(e,t)=>e<t)}function ye(e){return ce(e,(e,t)=>e<=t)}function ge(e,t=!0,n=""){return he([e,t,n],(e,[t,n,r])=>{if(!t)return!0;if(n)try{return new RegExp(t,r).test(String(e))}catch(e){return console.warn("Invalid regex pattern:",t,e),!1}return r&&""!==r?String(e).includes(String(t)):String(e).toLowerCase().includes(String(t).toLowerCase())})}function ve(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(p.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.every(e=>e.callback(t))}}function we(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(p.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.some(e=>e.callback(t))}}const $e=fe,Ce=me,Se=be,Oe=ye,Ae=pe,Ee=de,Ne=ve,xe=we;function De(e,t=!1){return ce(e,(e,n)=>!!e&&(!n||(t?String(e).includes(String(n)):String(e).toLowerCase().includes(String(n).toLowerCase()))))}const ke=De;var Fe=Object.freeze({__proto__:null,all:Ne,and:ve,any:xe,between:function(e,t){return he([e,t],(e,[t,n])=>e>=t&&e<=n)},contains:ke,createFilter:ce,createMultiSourceFilter:he,custom:function(e,...t){const n=t.filter(p.isObservable);return{dependencies:n.length>0?n:null,callback:n=>{const r=t.map(e=>p.isObservable(e)?e.val():e);return e(n,...r)}}},dateAfter:e=>ce(e,(e,t)=>!(!e||!t)&&ae(e)>ae(t)),dateBefore:e=>ce(e,(e,t)=>!(!e||!t)&&ae(e)<ae(t)),dateBetween:(e,t)=>he([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=ae(e);return r>=ae(t)&&r<=ae(n)}),dateEquals:e=>ce(e,(e,t)=>!(!e||!t)&&le(e,t)),dateTimeAfter:e=>ce(e,(e,t)=>!(!e||!t)&&ae(e)>ae(t)),dateTimeBefore:e=>ce(e,(e,t)=>!(!e||!t)&&ae(e)<ae(t)),dateTimeBetween:(e,t)=>he([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=ae(e);return r>=ae(t)&&r<=ae(n)}),dateTimeEquals:e=>ce(e,(e,t)=>!(!e||!t)&&ae(e).getTime()===ae(t).getTime()),endsWith:function(e,t=!1){return ce(e,(e,n)=>!n||(t?String(e).endsWith(String(n)):String(e).toLowerCase().endsWith(String(n).toLowerCase())))},eq:Ae,equals:pe,getSecondsOfDay:ue,greaterThan:fe,greaterThanOrEqual:me,gt:$e,gte:Ce,inArray:function(e){return ce(e,(e,t)=>t.includes(e))},includes:De,isEmpty:function(e=!0){return ce(e,(e,t)=>{const n=!e||""===e||Array.isArray(e)&&0===e.length;return t?n:!n})},isNotEmpty:function(e=!0){return ce(e,(e,t)=>{const n=!!e&&""!==e&&(!Array.isArray(e)||e.length>0);return t?n:!n})},isSameDay:le,lessThan:be,lessThanOrEqual:ye,lt:Se,lte:Oe,match:ge,neq:Ee,not:function(e){return{dependencies:e.dependencies,callback:t=>!e.callback(t)}},notEquals:de,notIn:function(e){return ce(e,(e,t)=>!t.includes(e))},or:we,startsWith:function(e,t=!1){return ce(e,(e,n)=>!n||(t?String(e).startsWith(String(n)):String(e).toLowerCase().startsWith(String(n).toLowerCase())))},timeAfter:e=>ce(e,(e,t)=>!(!e||!t)&&ue(e)>ue(t)),timeBefore:e=>ce(e,(e,t)=>!(!e||!t)&&ue(e)<ue(t)),timeBetween:(e,t)=>he([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=ue(e);return r>=ue(t)&&r<=ue(n)}),timeEquals:e=>ce(e,(e,t)=>{if(!e||!t)return!1;const n=ae(e),r=ae(t);return n.getHours()===r.getHours()&&n.getMinutes()===r.getMinutes()&&n.getSeconds()===r.getSeconds()}),toDate:ae});const Te=function(e,t=null){if(!Array.isArray(e))throw new r("Observable.array : target must be an array");A.call(this,e,t)};(Te.prototype=Object.create(A.prototype)).constructor=Te,Te.prototype.__$isObservableArray=!0,Object.defineProperty(Te.prototype,"length",{get(){return this.$currentValue.length}}),["push","pop","shift","unshift","reverse","sort","splice"].forEach(e=>{Te.prototype[e]=function(...t){const n=this.$currentValue[e].apply(this.$currentValue,t);return this.trigger({action:e,args:t,result:n}),n}}),["map","forEach","filter","reduce","some","every","find","findIndex","concat","includes","indexOf"].forEach(e=>{Te.prototype[e]=function(...t){return this.$currentValue[e].apply(this.$currentValue,t)}});const _e={action:"clear"};Te.prototype.clear=function(){if(0!==this.$currentValue.length)return this.$currentValue.length=0,this.trigger(_e),!0},Te.prototype.at=function(e){return this.$currentValue[e]},Te.prototype.merge=function(e){this.$currentValue.push.apply(this.$currentValue,e),this.trigger({action:"merge",args:e})},Te.prototype.count=function(e){let t=0;return this.$currentValue.forEach((n,r)=>{e(n,r)&&t++}),t},Te.prototype.swap=function(e,t){const n=this.$currentValue,r=n.length;if(r<e||r<t)return!1;if(t<e){const n=e;e=t,t=n}const o=n[e],s=n[t];return n[e]=s,n[t]=o,this.trigger({action:"swap",args:[e,t],result:[o,s]}),!0},Te.prototype.remove=function(e){const t=this.$currentValue.splice(e,1);return 0===t.length?[]:(this.trigger({action:"remove",args:[e],result:t[0]}),t)},Te.prototype.removeItem=function(e){const t=this.$currentValue.indexOf(e);return-1===t?[]:this.remove(t)},Te.prototype.isEmpty=function(){return 0===this.$currentValue.length},Te.prototype.populateAndRender=function(e,t){this.trigger({action:"populate",args:[this.$currentValue,e,t]})},Te.prototype.where=function(e){const t=this,n=[t],r={};for(const[t,o]of Object.entries(e)){const e=p.isObservable(o)?ge(o,!1):o;if(e&&"object"==typeof e&&"callback"in e){if(r[t]=e.callback,e.dependencies){const t=Array.isArray(e.dependencies)?e.dependencies:[e.dependencies];n.push.apply(n,t)}}else r[t]="function"==typeof e?e:t=>t===e}const o=x.array(),s=Object.entries(r),i=()=>{const e=t.val().filter(e=>{for(const[t,n]of s)if("_"===t){if(!n(e))return!1}else if(!n(e[t]))return!1;return!0});o.set(e)};return n.forEach(e=>e.subscribe(i)),i(),o},Te.prototype.whereSome=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.some(e=>t.callback(n[e]))}})},Te.prototype.whereEvery=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.every(e=>t.callback(n[e]))}})},Te.prototype.deepSubscribe=function(e){const t=b(()=>e(this.val())),n=new WeakMap,r=e=>{n.has(e)||(e?.__$isObservableArray?n.set(e,e.deepSubscribe(t)):e?.__$isObservable&&(e.subscribe(t),n.set(e,()=>e.unsubscribe(t))))},o=e=>{const t=n.get(e);t&&(t(),n.delete(e))};return this.$currentValue.forEach(r),this.subscribe(t),this.subscribe((e,t,n)=>{switch(n?.action){case"push":case"unshift":case"merge":n.args.forEach(r);break;case"splice":{const[e,t,...s]=n.args;n.result?.forEach(o),s.forEach(r);break}case"remove":o(n.result);break;case"clear":this.$currentValue.forEach(o)}}),()=>{this.$currentValue.forEach(o)}},x.array=function(e=[],t=null){return new Te(e,t)},x.batch=function(e){const t=x(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};const Ie=function(e,t){A.call(this,e),this.$observables={},this.configs=t,this.$load(e);for(const t in e)Object.hasOwn(this,t)||Object.defineProperty(this,t,{get:()=>this.$observables[t],set:e=>this.$observables[t].set(e)})};Ie.prototype=Object.create(A.prototype),Object.defineProperty(Ie,"$value",{get(){return this.val()},set(e){this.set(e)}}),Ie.prototype.__$isObservableObject=!0,Ie.prototype.__isProxy__=!0,Ie.prototype.$load=function(e){const t=this.configs;for(const n in e){const r=e[n];if(Array.isArray(r)){if(!1!==t?.deep){const e=r.map(e=>p.isJson(e)?x.json(e,t):p.isArray(e)?x.array(e,t):x(e,t));this.$observables[n]=x.array(e,t);continue}this.$observables[n]=x.array(r,t)}else p.isObservable(r)||p.isProxy(r)?this.$observables[n]=r:this.$observables[n]="object"==typeof r?x.object(r,t):x(r,t)}},Ie.prototype.val=function(){const e={};for(const t in this.$observables){const n=this.$observables[t];if(p.isObservable(n)){let r=n.val();Array.isArray(r)&&(r=r.map(e=>p.isObservable(e)?e.val():p.isProxy(e)?e.$value:e)),e[t]=r}else p.isProxy(n)?e[t]=n.$value:e[t]=n}return e},Ie.prototype.$val=Ie.prototype.val,Ie.prototype.get=function(e){const t=this.$observables[e];return p.isObservable(t)?t.val():p.isProxy(t)?t.$value:t},Ie.prototype.$get=Ie.prototype.get,Ie.prototype.set=function(e){const t=p.isProxy(e)?e.$value:e,n=this.configs;for(const r in t){const o=this.$observables[r],s=e[r],i=t[r];if(p.isObservable(o)){if(!p.isArray(i)){o.set(i);continue}const e=s.at(0);if(p.isObservable(e)||p.isProxy(e)){const t=i.map(t=>p.isProxy(e)?x.init(t,n):x(t,n));o.set(t);continue}o.set([...i]);continue}p.isProxy(o)?o.update(i):this[r]=i}},Ie.prototype.$set=Ie.prototype.set,Ie.prototype.$updateWith=Ie.prototype.set,Ie.prototype.observables=function(){return Object.values(this.$observables)},Ie.prototype.$observables=Ie.prototype.observables,Ie.prototype.keys=function(){return Object.keys(this.$observables)},Ie.prototype.$keys=Ie.prototype.keys,Ie.prototype.clone=function(){return x.init(this.val(),this.configs)},Ie.prototype.$clone=Ie.prototype.clone,Ie.prototype.reset=function(){for(const e in this.$observables)this.$observables[e].reset()},Ie.prototype.originalSubscribe=Ie.prototype.subscribe,Ie.prototype.subscribe=function(e){const t=this.observables(),n=b(()=>this.trigger());this.originalSubscribe(e);for(let e=0,r=t.length;e<r;e++){const r=t[e];r.__$isObservableArray?r.deepSubscribe(n):r.subscribe(n)}},Ie.prototype.configs=function(){return this.configs},Ie.prototype.update=Ie.prototype.set,x.init=function(e,t=null){return new Ie(e,t)},x.arrayOfObject=function(e){return e.map(e=>x.object(e))},x.value=function(e){if(p.isObservable(e))return e.val();if(p.isProxy(e))return e.$value;if(p.isArray(e)){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e[n];t.push(x.value(r))}return t}return e},x.object=x.init,x.json=x.init,x.computed=function(e,t=[]){const n=new A(e()),o=b(()=>n.set(e()));if(p.isFunction(t)){if(!p.isObservable(t.$observer))throw new r("Observable.computed : dependencies must be valid batch function");return t.$observer.subscribe(o),n}return t.forEach(e=>{p.isProxy(e)?e.$observables.forEach(e=>{e.subscribe(o)}):e.subscribe(o)}),n};const Me=function(){const e=new Map,t=new Map,o=(t,o)=>{const s=e.get(o);if(!s)throw n.error("Store",`Store.${t}('${o}') : store not found. Did you call Store.create('${o}') first?`),new r(`Store.${t}('${o}') : store not found.`);return s},s=(e,t={})=>Array.isArray(e)?x.array(e,t):"object"==typeof e?x.object(e,t):x(e,t);return new Proxy({create(t,o){if(e.has(t))throw n.warn("Store",`Store.create('${t}') : a store with this name already exists. Use Store.get('${t}') to retrieve it.`),new r(`Store.create('${t}') : a store with this name already exists.`);const i=s(o);return e.set(t,{observer:i,subscribers:new Set,resettable:!1,composed:!1}),i},createResettable(t,o){if(e.has(t))throw n.warn("Store",`Store.createResettable('${t}') : a store with this name already exists.`),new r(`Store.createResettable('${t}') : a store with this name already exists.`);const i=s(o,{reset:!0});return e.set(t,{observer:i,subscribers:new Set,resettable:!0,composed:!1}),i},createComposed(t,o,s){if(e.has(t))throw n.warn("Store",`Store.createComposed('${t}') : a store with this name already exists.`),new r(`Store.createComposed('${t}') : a store with this name already exists.`);if("function"!=typeof o)throw new r(`Store.createComposed('${t}') : computation must be a function.`);if(!Array.isArray(s)||0===s.length)throw new r(`Store.createComposed('${t}') : dependencies must be a non-empty array of store names.`);const i=s.map(o=>{if("string"!=typeof o)return o;const s=e.get(o);if(!s)throw n.error("Store",`Store.createComposed('${t}') : dependency '${o}' not found. Create it first.`),new r(`Store.createComposed('${t}') : dependency store '${o}' not found.`);return s.observer}),a=x.computed(o,i);return e.set(t,{observer:a,subscribers:new Set,resettable:!1,composed:!0}),a},has:t=>e.has(t),reset(e){const t=o("reset",e);if(t.composed)throw n.error("Store",`Store.reset('${e}') : composed stores cannot be reset. Their value is derived from dependencies.`),new r(`Store.reset('${e}') : composed stores cannot be reset.`);if(!t.resettable)throw n.error("Store",`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`),new r(`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`);t.observer.reset()},use(e){const t=o("use",e);if(t.composed)throw n.error("Store",`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`),new r(`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`);const{observer:i,subscribers:a}=t,l=s(i.val()),u=e=>l.set(e),c=e=>i.set(e);return i.subscribe(u),l.subscribe(c),l.destroy=()=>{i.unsubscribe(u),l.unsubscribe(c),a.delete(l),l.cleanup()},l.dispose=l.destroy,a.add(l),l},follow(e){const{observer:t,subscribers:i}=o("follow",e),a=s(t.val()),l=e=>a.set(e);return t.subscribe(l),((e,t,o)=>{const s=e=>()=>{throw n.error("Store",`Store.${o}('${t}') is read-only. '${e}()' is not allowed.`),new r(`Store.${o}('${t}') is read-only.`)};e.set=s("set"),e.toggle=s("toggle"),e.reset=s("reset")})(a,e,"follow"),a.destroy=()=>{t.unsubscribe(l),i.delete(a),a.cleanup()},a.dispose=a.destroy,i.add(a),a},get(t){const r=e.get(t);return r?r.observer:(n.warn("Store",`Store.get('${t}') : store not found.`),null)},getWithSubscribers:t=>e.get(t)??null,delete(t){const r=e.get(t);r?(r.subscribers.forEach(e=>e.destroy()),r.subscribers.clear(),r.observer.cleanup(),e.delete(t)):n.warn("Store",`Store.delete('${t}') : store not found, nothing to delete.`)},group(e,t){"function"==typeof e&&(t=e,e="anonymous");const n=Me();return t&&t(n),n},createPersistent(e,t,n){n=n||e;const r=this.create(e,S(n,t)),o=O(t);return r.subscribe(e=>o(n,e)),r},createPersistentResettable(e,t,n){n=n||e;const r=this.createResettable(e,S(n,t)),o=O(t);r.subscribe(e=>o(n,e));const s=r.reset.bind(r);return r.reset=()=>{C.remove(n),s()},r}},{get(e,n){if("symbol"==typeof n||n.startsWith("$")||n in e)return e[n];if(e.has(n)){if(t.has(n))return t.get(n);const r=e.follow(n);return t.set(n,r),r}},set(e,t,o){throw n.error("Store",`Forbidden: You cannot overwrite the store key '${String(t)}'. Use .use('${String(t)}').set(value) instead.`),new r("Store structure is immutable. Use .set() on the observable.")},deleteProperty(e,t){throw new r("Store keys cannot be deleted.")}})},Re=Me();Re.create("locale",navigator.language.split("-")[0]||"en");const Pe=new Set(["clear","push","unshift","replace"]);const Le=function(e,t,{comment:r=null,shouldKeepInCache:o=!0}={}){if(!p.isObservable(e)&&!p.isObservableWhenResult(e))return n.warn("ShowIf","ShowIf : condition must be an Observable / "+r,e);const s=j("Show if : "+(r||""));let i=null;const a=()=>(i&&o||(i=L.getChild(t),p.isFragment(i)&&(i=Array.from(i.childNodes))),i);return e.val()&&s.appendChild(a()),e.subscribe(e=>{e?s.appendChild(a()):s.remove()}),s},Ve=function(e,t,n=!0){if(!p.isObservable(e))throw new r("Toggle : condition must be an Observable");const o=j("Match"),s=new Map,i=function(e){if(n&&s.has(e))return s.get(e);let r=t[e];return r?(r=L.getChild(r),p.isFragment(r)&&(r=Array.from(r.children)),n&&s.set(e,r),r):null},a=e.val(),l=i(a);return l&&o.appendChild(l),e.subscribe(e=>{const t=i(e);o.remove(),t&&o.appendChild(t)}),o.nd.with({add(n,r,o=!1){t[n]=r,o&&e.set(n)},remove(e){n&&s.delete(e),delete t[e]}})},je=function(e,t,n){if(!p.isObservable(e))throw new r("Toggle : condition must be an Observable");return Ve(e,{true:t,false:n})},Be=G("div"),qe=G("span"),We=G("label"),Ue=G("p"),He=Ue,ze=G("strong"),Ke=G("h1"),Je=G("h2"),Ye=G("h3"),Ge=G("h4"),Qe=G("h5"),Xe=G("h6"),Ze=G("br"),et=G("a"),tt=G("pre"),nt=G("code"),rt=G("blockquote"),ot=G("hr"),st=G("em"),it=G("small"),at=G("mark"),lt=G("del"),ut=G("ins"),ct=G("sub"),ht=G("sup"),pt=G("abbr"),dt=G("cite"),ft=G("q"),mt=G("dl"),bt=G("dt"),yt=G("dd"),gt=G("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}),vt=G("input"),wt=G("textarea"),$t=wt,Ct=G("select"),St=G("fieldset"),Ot=G("option"),At=G("legend"),Et=G("datalist"),Nt=G("output"),xt=G("progress"),Dt=G("meter"),kt=G("button"),Ft=G("main"),Tt=G("section"),_t=G("article"),It=G("aside"),Mt=G("nav"),Rt=G("figure"),Pt=G("figcaption"),Lt=G("header"),Vt=G("footer"),jt=G("img"),Bt=function(e,t){return jt({src:e,...t})},qt=G("details"),Wt=G("summary"),Ut=G("dialog"),Ht=G("menu"),zt=G("ol"),Kt=G("ul"),Jt=G("li"),Yt=Jt,Gt=zt,Qt=Kt,Xt=G("audio"),Zt=G("video"),en=G("source"),tn=G("track"),nn=G("canvas"),rn=G("svg"),on=G("time"),sn=G("data"),an=G("address"),ln=G("kbd"),un=G("samp"),cn=G("var"),hn=G("wbr"),pn=G("caption"),dn=G("table"),fn=G("thead"),mn=G("tfoot"),bn=G("tbody"),yn=G("tr"),gn=yn,vn=G("th"),wn=vn,$n=vn,Cn=G("td"),Sn=Cn,On=G("");var An=Object.freeze({__proto__:null,Abbr:pt,Address:an,Anchor:j,Article:_t,Aside:It,AsyncImg:function(e,t,n,o){const s=p.isObservable(e)?e.val():e,i=Bt(t||s,n),a=new Image;return a.onload=()=>{p.isFunction(o)&&o(null,i),i.src=p.isObservable(e)?e.val():e},a.onerror=()=>{p.isFunction(o)&&o(new r("Image not found"))},p.isObservable(e)&&e.subscribe(e=>{a.src=e}),a.src=s,i},Audio:Xt,BaseImage:jt,Blockquote:rt,Br:Ze,Button:kt,Canvas:nn,Caption:pn,Checkbox:e=>vt({type:"checkbox",...e}),Cite:dt,Code:nt,ColorInput:e=>vt({type:"color",...e}),Data:sn,Datalist:Et,DateInput:e=>vt({type:"date",...e}),DateTimeInput:e=>vt({type:"datetime-local",...e}),Dd:yt,Del:lt,Details:qt,Dialog:Ut,Div:Be,Dl:mt,Dt:bt,Em:st,EmailInput:e=>vt({type:"email",...e}),FieldSet:St,FigCaption:Pt,Figure:Rt,FileInput:e=>vt({type:"file",...e}),Footer:Vt,ForEach:function(e,t,o,{shouldKeepItemsInCache:s=!1}={}){const i=j("ForEach"),a=i.endElement();i.startElement();let l=new Map,u=null;const c=new Set,h=e=>{if(!s)for(const[t,n]of l.entries()){if(c.has(t))continue;const r=n.child?.deref();e&&r&&r.remove(),n.indexObserver?.cleanup(),n.child=null,n.indexObserver=null,l.delete(n.keyId),u&&u.delete(n.keyId)}},d=(e,s)=>{const i=((e,t,n)=>{if(p.isString(n)){const r=p.isObservable(e)?e.val():e,o=r?.[n];return p.isObservable(o)?o.val():o??t}return p.isFunction(n)?n(e,t):(p.isObservable(e)?e.val():e)??t})(e,s,o);if(l.has(i)){const e=l.get(i);if(e.indexObserver?.set(s),e.isNew=!1,e.child?.deref())return i;l.delete(i)}try{const n=t.length>=2?x(s):null;let o=L.getChild(t(e,n));if(!o)throw new r("ForEach child can't be null or undefined!");l.set(i,{keyId:i,isNew:!0,child:new WeakRef(o),indexObserver:n})}catch(e){throw n.error("ForEach",`Error creating element for key ${i}`,e),e}return i},f=()=>{const t=a.parentNode;if(!t)return;const n=p.isObservable(e)?e.val():e;if(c.clear(),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=d(n[e],e);c.add(t)}else for(const e in n){const t=d(n[e],e);c.add(t)}if(0===c.size)return i.removeChildren(),h(),void u?.clear();h(t),u&&0!==u.size?(()=>{let e=document.createDocumentFragment();const t=Array.from(c);Array.from(u);for(const n in t){const r=t[n],o=l.get(r);if(!o)continue;const s=o.child.deref();s&&e.appendChild(s)}i.replaceContent(e)})():(e=>{const t=document.createDocumentFragment();for(const e of c){const n=l.get(e);if(!n)continue;const r=n.child?.deref();r&&t.appendChild(r)}e.insertBefore(t,a)})(t),u?.clear(),u=new Set([...c])};return f(),p.isObservable(e)&&e.subscribe(f),i},ForEachArray:function(e,t,n={}){const r=j("ForEach Array",n.isParentUniqueChild),o=r.endElement();let s=new Map,i=0;const a=t.length>=2,l=e=>{r.removeChildren(),f(e),i=0},u=e=>s.get(e)?.child,c=(e,t=!0)=>{const n=s.get(e);if(n){if(t){const t=n.child;t?.remove(),s.delete(e)}n.indexObserver?.cleanup()}},h=e=>{const n=L.getChild(t(e,null));return s.set(e,{child:n,indexObserver:null}),n},p=(e,n)=>{const r=x(n),o=L.getChild(t(e,r));return s.set(e,{child:o,indexObserver:r}),o},d=(e,t)=>{const n=s.get(e);return n?(n.indexObserver?.set(t),n.child):h(e)};let f,m=h;f=a?n.shouldKeepItemsInCache?()=>{}:e=>{for(const[t,n]of s.entries())e&&e.includes(t)||c(t,!1)}:s.clear.bind(s);const b=(e,t)=>{const n=s.get(e);if(!n)return null;const r=n.child;if(!r)return null;t?t.appendChild(r):r.remove()},y={toFragment:e=>{const t=document.createDocumentFragment();for(let n=0,r=e.length;n<r;n++)t.appendChild(m(e[n],i)),i++;return t},add:e=>{r.appendChildRaw(y.toFragment(e))},replace:e=>{l(e),r.appendChildRaw(y.toFragment(e))},set:()=>{const t=e.val();l(t),r.appendChildRaw(y.toFragment(t))},reOrder:e=>{let t=null;const n=document.createDocumentFragment();for(const r of e)t=u(r),t&&n.appendChild(t);t=null,r.appendElementRaw(n)},removeOne:(e,t)=>{c(e,!0)},clear:l,populate:([e,t,n])=>{const o=document.createDocumentFragment();for(let r=0;r<t;r++){const t=n(r);e.push(t),o.append(m(t,r)),i++}r.appendChildRaw(o),o.replaceChildren()},unshift:e=>{r.insertAtStartRaw(y.toFragment(e))},splice:(e,t)=>{const[n,s,...i]=e;let a=null;const l=document.createDocumentFragment();if(t.length>0){let e=t[0];if(1===t.length)b(e,l);else if(t.length>1){const e=u(t[0]);a=e?.previousSibling;for(let e=0;e<t.length;e++)b(t[e],l)}}else a=o;l.replaceChildren(),i&&i.length&&a&&r.insertBeforeRaw(y.toFragment(i),a.nextSibling)},reverse:(e,t)=>{y.reOrder(t)},sort:(e,t)=>{y.reOrder(t)},remove:(e,t)=>{y.removeOne(t)},pop:(e,t)=>{y.removeOne(t)},shift:(e,t)=>{y.removeOne(t)},swap:(e,t)=>{const n=r.getParent();let o=u(t[0]),s=u(t[1]);if(!o||!s)return;const i=s.nextSibling;n.insertBefore(s,o),n.insertBefore(o,i),o=null,s=null}};y.merge=y.add,y.push=y.add;const g=(e,t,n={})=>{((e=null)=>{m=Pe.has(e)?a?p:h:s.size?d:a?p:h})(n.action),y[n.action]&&y[n.action](n.args,n.result),((e,t=0)=>{if(!a)return;let n=t;for(let r=t,o=e?.length;r<o;r++){const t=s.get(e[r]);t&&(t.indexObserver?.set(n),n++)}})(e,0)};return e.val().length&&g(e.val(),0,{action:null}),e.subscribe(g),r},Form:gt,Fragment:On,H1:Ke,H2:Je,H3:Ye,H4:Ge,H5:Qe,H6:Xe,Header:Lt,HiddenInput:e=>vt({type:"hidden",...e}),HideIf:function(e,t,n){const r=x(!e.val());return e.subscribe(e=>r.set(!e)),Le(r,t,n)},HideIfNot:function(e,t,n){return Le(e,t,n)},Hr:ot,Img:Bt,Input:vt,Ins:ut,Kbd:ln,Label:We,LazyImg:function(e,t){return Bt(e,{...t,loading:"lazy"})},Legend:At,Li:Yt,Link:et,ListItem:Jt,Main:Ft,Mark:at,Match:Ve,Menu:Ht,Meter:Dt,MonthInput:e=>vt({type:"month",...e}),NativeDocumentFragment:j,Nav:Mt,NumberInput:e=>vt({type:"number",...e}),Ol:Gt,Option:Ot,OrderedList:zt,Output:Nt,P:Ue,Paragraph:He,PasswordInput:e=>vt({type:"password",...e}),Pre:tt,Progress:xt,Quote:ft,Radio:e=>vt({type:"radio",...e}),RangeInput:e=>vt({type:"range",...e}),ReadonlyInput:e=>vt({readonly:!0,...e}),Samp:un,SearchInput:e=>vt({type:"search",...e}),Section:Tt,Select:Ct,ShowIf:Le,ShowWhen:function(){if(2===arguments.length){const[e,t]=arguments;if(!p.isObservableWhenResult(e))throw new r("showWhen observer must be an ObservableWhenResult",{data:e,help:"Use observer.when(target) to create an ObservableWhenResult"});return Le(e,t)}if(3===arguments.length){const[e,t,n]=arguments;if(!p.isObservable(e))throw new r("showWhen observer must be an Observable",{data:e});return Le(e.when(t),n)}throw new r("showWhen must have 2 or 3 arguments",{data:["showWhen(observer, target, view)","showWhen(observerWhenResult, view)"]})},SimpleButton:(e,t)=>kt(e,{type:"button",...t}),Small:it,Source:en,Span:qe,Strong:ze,Sub:ct,SubmitButton:(e,t)=>kt(e,{type:"submit",...t}),Summary:Wt,Sup:ht,Svg:rn,Switch:je,TBody:bn,TBodyCell:Sn,TFoot:mn,TFootCell:$n,THead:fn,THeadCell:wn,TRow:gn,Table:dn,Td:Cn,TelInput:e=>vt({type:"tel",...e}),TextArea:wt,TextInput:$t,Th:vn,Time:on,TimeInput:e=>vt({type:"time",...e}),Tr:yn,Track:tn,Ul:Qt,UnorderedList:Kt,UrlInput:e=>vt({type:"url",...e}),Var:cn,Video:Zt,Wbr:hn,WeekInput:e=>vt({type:"week",...e}),When:function(e){if(!p.isObservable(e))throw new r("When : condition must be an Observable");let t=null,n=null;return{show(e){return t=e,this},otherwise:r=>(n=r,je(e,t,n)),toNdElement:()=>je(e,t,n)}},createPortal:function(e,{parent:t,name:n="unnamed"}={}){const r=j("Portal "+n);return r.appendChild(L.getChild(e)),(t||document.body).appendChild(r),r}});const En={};function Nn(e,t,n={}){e="/"+y(e,"/").replace(/\/+/,"/");let r=null,o=n.name||null;const s=n.middlewares||[],i=n.shouldRebuild||!1,a=n.with||{},l=n.layout||null,u={},c=[],h=e=>{if(!e)return null;const[t,n]=e.split(":");let r=a[t];return!r&&n&&(r=En[n]),r||(r="[^/]+"),r=r.replace("(","(?:"),{name:t,pattern:`(${r})`}},p=()=>{if(r)return r;const t=e.replace(/\{(.*?)}/gi,(e,t)=>{const n=h(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=()=>s,this.shouldRebuild=()=>i,this.path=()=>e,this.layout=()=>l,this.match=function(e){e="/"+y(e,"/");if(!p().exec(e))return!1;const t={};return p().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=h(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 xn extends Error{constructor(e,t){super(e),this.context=t}}const Dn=(e,t)=>{const n=[];return e.forEach(e=>{n.push(y(e.suffix,"/"))}),n.push(y(t,"/")),n.join("/")},kn=(e,t)=>{const n=[];return e.forEach(e=>{e.options.middlewares&&n.push(...e.options.middlewares)}),t&&n.push(...t),n},Fn=(e,t)=>{const n=[];return e.forEach(e=>{e.options?.name&&n.push(e.options.name)}),t&&n.push(t),n.join(".")},Tn=e=>{for(let t=e.length-1;t>=0;t--)if(e[t]?.options?.layout)return e[t].options.layout;return null};function _n(){const e=[];let t=0;const n=n=>{const o=t+n;if(!e[o])return;t=o;const{route:s,params:i,query:a,path:l}=e[o];r(l)},r=e=>{window.location.replace(`${window.location.pathname}${window.location.search}#${e}`)},o=()=>window.location.hash.slice(1);this.push=function(n){const{route:s,params:i,query:a,path:l}=this.resolve(n);l!==o()&&(e.splice(t+1),e.push({route:s,params:i,query:a,path:l}),t++,r(l))},this.replace=function(n){const{route:r,params:s,query:i,path:a}=this.resolve(n);a!==o()&&(e[t]={route:r,params:s,query:i,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:s,query:i,path:a}=this.resolve(n||o());e.push({route:r,params:s,query:i,path:a}),t=0,this.handleRouteChange(r,s,i,a)}}function In(){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:s}=this.resolve(t);if(!n)return;this.handleRouteChange(n,r,o,s)}catch(e){n.error("HistoryRouter","Error in popstate event",e)}});const{route:t,params:r,query:o,path:s}=this.resolve(e||window.location.pathname+window.location.search);this.handleRouteChange(t,r,o,s)}}function Mn(){const e=[];let t=0;const n=n=>{const r=t+n;if(!e[r])return;t=r;const{route:o,params:s,query:i,path:a}=e[r];this.handleRouteChange(o,s,i,a)};this.push=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]&&e[t].path===i||(e.splice(t+1),e.push({route:r,params:o,query:s,path:i}),t++,this.handleRouteChange(r,o,s,i))},this.replace=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]={route:r,params:o,query:s,path:i},this.handleRouteChange(r,o,s,i)},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:s,query:i,path:a}=this.resolve(r);e.push({route:o,params:s,query:i,path:a}),t=0,this.handleRouteChange(o,s,i,a)}}function Rn(e,t){const n=new Map,r=new WeakMap,o=new WeakMap;let s=null,i=null;const a=(e,t)=>{const n=o.get(e);if(n)return n;let r=e;return p.isAnchor(e)||(r=j(t),r.appendChild(e)),o.set(e,r),r},l=()=>{p.isAnchor(i)&&i.remove()},u=()=>{t.nodeValue="",l(),s&&s.remove()},c=e=>{let t=e;return p.isNDElement(e)&&(t=e.node()),t},h=function(e,n,o){const h=n.layout();if(h)return void((e,n,o,h)=>{let p=c(n);const d=r.get(p);if(d){if(d===s){const e=a(p,h);return l(),i=p,void e.replaceContent(p)}return u(),i=p,s=d,a(p,h).replaceContent(p),void t.appendChild(s)}u(),i=p;const f=a(p,h);s=L.getChild(e(f)),r.set(p,s),t.appendChild(s)})(h,e,0,o);let p=c(e);u(),t.appendChild(p),i=e},d=function(e){if(!e.route)return;const{route:t,params:r,query:o,path:s}=e;if(n.has(s)){const e=n.get(s);return void h(e,t)}const i=t.component()({params:r,query:o});n.set(s,i),h(i,t,s)};return e.subscribe(d),d(e.currentState()),t}const Pn="default";function Ln(e={}){const t=[],r={},o=[],s=[],i={route:null,params:null,query:null,path:null,hash:null};if("hash"===e.mode)_n.apply(this,[]);else if("history"===e.mode)In.apply(this,[]);else{if("memory"!==e.mode)throw new xn("Invalid router mode "+e.mode);Mn.apply(this,[])}const a=function(e,t){for(const r of s)try{r(e),t&&t(e)}catch(e){n.warn("Route Listener","Error in listener:",e)}};this.routes=()=>[...t],this.currentState=()=>({...i}),this.add=function(e,n,s){const i=new Nn(Dn(o,e),n,{...s,middlewares:kn(o,s?.middlewares||[]),name:s?.name?Fn(o,s.name):null,layout:s?.layout||Tn(o)});return t.push(i),i.name()&&(r[i.name()]=i),this},this.group=function(e,t,n){if(!p.isFunction(n))throw new xn("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 xn(`Route not found for name: ${e}`);return o.url({params:t,query:n})},this.resolve=function(e){if("string"==typeof e){const t=r[e];if(t)return{route:t,params:[],query:[],path:t.url({name:e})}}if(p.isJson(e)){const t=r[e.name];if(!t)throw new xn(`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("?"),s="/"+y(n,"/");let i,a=null;for(const e of t)if(i=e.match(s),i){a=e;break}if(!a)throw new xn(`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:i,query:l,path:e}},this.subscribe=function(e){if(!p.isFunction(e))throw new xn("Listener must be a function");return s.push(e),()=>{s.splice(s.indexOf(e),1)}},this.handleRouteChange=function(e,t,n,r){i.route=e,i.params=t,i.query=n,i.path=r;const o=[...e.middlewares(),a];let s=0;const l={...i},u=e=>{if(s++,!(s>=o.length))return o[s](e||l,u)};return o[s](l,u)}}function Vn(e,t){const{to:n,href:r,...o}=e;if(r){const e=Ln.get();return et({...o,href:r},t).nd.onPreventClick(()=>{e.push(r)})}const s="string"==typeof n?{name:n}:n,i=s.router||Pn,a=Ln.get(i);if(!a)throw new xn('Router not found "'+i+'" for link "'+s.name+'"');const l=a.generateUrl(s.name,s.params,s.query);return et({...o,href:l},t).nd.onPreventClick(()=>{a.push(l)})}Ln.routers={},Ln.create=function(e,t){if(!p.isFunction(t))throw n.error("Router","Callback must be a function"),new xn("Callback must be a function");const r=new Ln(e);return Ln.routers[e.name||Pn]=r,t(r),r.init(e.entry),r.mount=function(e){if(p.isString(e)){const t=document.querySelector(e);if(!t)throw new xn(`Container not found for selector: ${e}`);e=t}else if(!p.isElement(e))throw new xn("Container must be a string or an Element");return Rn(r,e)},r},Ln.get=function(e){const t=Ln.routers[e||Pn];if(!t)throw new xn(`Router not found for name: ${e}`);return t},Ln.push=function(e,t=null){return Ln.get(t).push(e)},Ln.replace=function(e,t=null){return Ln.get(t).replace(e)},Ln.forward=function(e=null){return Ln.get(e).forward()},Ln.back=function(e=null){return Ln.get(e).back()},Ln.redirectTo=function(e,t=null,n=null){let r=e;const o=Ln.get(n);return o.resolve({name:e,params:t})&&(r={name:e,params:t}),console.log(r),o.push(r)},Vn.blank=function(e,t){return et({...e,target:"_blank"},t)};var jn=Object.freeze({__proto__:null,Link:Vn,RouteParamPatterns:En,Router:Ln});var Bn=Object.freeze({__proto__:null,memoize:e=>ie(e),once:e=>se(e),singleton:e=>oe(e)}),qn=Object.freeze({__proto__:null,Cache:Bn,NativeFetch:function(e){const t={request:[],response:[]};this.interceptors={response:e=>{t.response.push(e)},request:e=>{t.request.push(e)}},this.fetch=async function(n,r,o={},s={}){if(s.formData){const e=new FormData;for(const t in o)e.append(t,o[t]);o=e}r.startsWith("http")||(r=(e.endsWith("/")?e:e+"/")+r);let i={method:n,headers:{...s.headers||{}}};if(o)if(o instanceof FormData)i.body=o;else if("GET"!==n)i.headers["Content-Type"]="application/json",i.body=JSON.stringify(o);else{const e=new URLSearchParams(o).toString();e&&(r=r+(r.includes("?")?"&":"?")+e)}for(const e of t.request)i=await e(i,r)||i;let a=await fetch(r,i);for(const e of t.response)a=await e(a,r)||a;const l=(a.headers.get("content-type")||"").includes("application/json")?await a.json():await a.text();if(!a.ok){const e=new Error(l?.message||a.statusText);throw e.status=a.status,e.data=l,e}return l},this.post=function(e,t={},n={}){return this.fetch("POST",e,t,n)},this.put=function(e,t={},n={}){return this.fetch("PUT",e,t,n)},this.delete=function(e,t={},n={}){return this.fetch("DELETE",e,t,n)},this.get=function(e,t={},n={}){return this.fetch("GET",e,t,n)}},classPropertyAccumulator:re,cssPropertyAccumulator:ne,filters:Fe});return e.$=D,e.ElementCreator=L,e.HtmlElementWrapper=G,e.NDElement=i,e.Observable=x,e.PluginsManager=null,e.SingletonView=te,e.Store=Re,e.StoreFactory=Me,e.TemplateCloner=Z,e.Validator=p,e.autoMemoize=ie,e.autoOnce=se,e.classPropertyAccumulator=re,e.createTextNode=J,e.cssPropertyAccumulator=ne,e.elements=An,e.memoize=e=>{const t=new Map;return(...n)=>{const[r,...o]=n,s=t.get(r);if(s)return s;const i=e(...o);return t.set(r,i),i}},e.normalizeComponentArgs=K,e.obs=k,e.once=oe,e.router=jn,e.useCache=function(e){let t=null,n=r=>{t=new Z(e);const o=t.clone(r);return n=t.clone,o};return e.length<2?(...e)=>n(e):(e,t,...r)=>n([e,t,...r])},e.useSingleton=function(e){let t=null;return function(...n){return t||(t=new te(e)),t.render(n)}},e.utils=qn,e.withValidation=z,e}({});
|
|
1
|
+
var NativeDocument=function(e){"use strict";let t={};t={log(){},warn(){},error(){},disable(){}};var n=t;class r extends Error{constructor(e,t={}){super(e),this.name="NativeDocumentError",this.context=t,this.timestamp=(new Date).toISOString()}}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 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`)}}}();const s=function(e,t){this.$target=t,this.$observer=e};s.prototype.__$Observable=!0,s.prototype.__$isObservableWhen=!0,s.prototype.subscribe=function(e){return this.$observer.on(this.$target,e)},s.prototype.val=function(){return this.$observer.$currentValue===this.$target},s.prototype.isMatch=s.prototype.val,s.prototype.isActive=s.prototype.val;const i=function(e){let t=!1;return function(...n){t||(t=!0,Promise.resolve().then(()=>{e.apply(this,n),t=!1}))}},a=function(e,t){return e.replace(new RegExp(`^[${t}]+|[${t}]+$`,"g"),"")},l=(e,t)=>{try{if(void 0!==window.structuredClone)return window.structuredClone(e)}catch(e){}if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e))return e.map(e=>l(e));if(B.isObservable(e))return t&&t(e),e;const n={};for(const t in e)Object.hasOwn(e,t)&&(n[t]=l(e[t]));return n},u=(e,t)=>{const n=new Date(e);return{d:n,parts:new Intl.DateTimeFormat(t,{year:"numeric",month:"long",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).formatToParts(n).reduce((e,{type:t,value:n})=>(e[t]=n,e),{})}},c=(e,t,n)=>{const r=e=>String(e).padStart(2,"0");return e.replace("YYYY",n.year).replace("YY",n.year.slice(-2)).replace("MMMM",n.month).replace("MMM",n.month.slice(0,3)).replace("MM",r(t.getMonth()+1)).replace("DD",r(t.getDate())).replace("D",t.getDate()).replace("HH",n.hour).replace("mm",n.minute).replace("ss",n.second)},p={currency:(e,t,{currency:n="XOF",notation:r,minimumFractionDigits:o,maximumFractionDigits:s}={})=>new Intl.NumberFormat(t,{style:"currency",currency:n,notation:r,minimumFractionDigits:o,maximumFractionDigits:s}).format(e),number:(e,t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}={})=>new Intl.NumberFormat(t,{notation:n,minimumFractionDigits:r,maximumFractionDigits:o}).format(e),percent:(e,t,{decimals:n=1}={})=>new Intl.NumberFormat(t,{style:"percent",maximumFractionDigits:n}).format(e),date:(e,t,{format:n,dateStyle:r="long"}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r}).format(new Date(e))},time:(e,t,{format:n,hour:r="2-digit",minute:o="2-digit",second:s}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{hour:r,minute:o,second:s}).format(new Date(e))},datetime:(e,t,{format:n,dateStyle:r="long",hour:o="2-digit",minute:s="2-digit",second:i}={})=>{if(n){const{d:r,parts:o}=u(e,t);return c(n,r,o)}return new Intl.DateTimeFormat(t,{dateStyle:r,hour:o,minute:s,second:i}).format(new Date(e))},relative:(e,t,{unit:n="day",numeric:r="auto"}={})=>{const o=Math.round((e-Date.now())/864e5);return new Intl.RelativeTimeFormat(t,{numeric:r}).format(o,n)},plural:(e,t,{singular:n,plural:r}={})=>`${e} ${"one"===new Intl.PluralRules(t).select(e)?n:r}`};function h(e,t=null){return new g(e,t)}const d=h,f=h;h.useValueProperty=function(e="value"){Object.defineProperty(g.prototype,e,{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0})},h.getById=function(e){const t=o.getObservableById(parseInt(e));if(!t)throw new r("Observable.getById : No observable found with id "+e);return t},h.cleanup=function(e){e.cleanup()},h.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 m={getJson(e){let t=localStorage.getItem(e);try{return JSON.parse(t)}catch(t){throw new r("invalid_json:"+e)}},getNumber(e){return Number(this.get(e))},getBool(e){const t=this.get(e);return"true"===t||"1"===t},setJson(e,t){localStorage.setItem(e,JSON.stringify(t))},setBool(e,t){localStorage.setItem(e,t?"true":"false")},get:(e,t=null)=>localStorage.getItem(e)||t,set:(e,t)=>localStorage.setItem(e,t),remove(e){localStorage.removeItem(e)},has:e=>null!=localStorage.getItem(e)},b=(e,t)=>{if(!m.has(e))return t;switch(typeof t){case"object":return m.getJson(e)??t;case"boolean":return m.getBool(e)??t;case"number":return m.getNumber(e)??t;default:return m.get(e,t)??t}},y=e=>{switch(typeof e){case"object":return m.setJson;case"boolean":return m.setBool;default:return m.set}};function g(e,t=null){e=B.isObservable(e)?e.val():e,this.$previousValue=null,this.$currentValue=e,this.$firstListener=null,this.$listeners=null,this.$watchers=null,this.$memoryId=null,t&&(this.configs=t,t.reset&&(this.$initialValue=B.isObject(e)?l(e):e))}Object.defineProperty(g.prototype,"$value",{get(){return this.$currentValue},set(e){this.set(e)},configurable:!0}),g.prototype.__$Observable=!0,g.prototype.__$isObservable=!0;const v=function(){};g.prototype.intercept=function(e){return this.$interceptor=e,this.set=this.$setWithInterceptor,this},g.prototype.interceptMutations=function(e){return this.$mutationInterceptor=e,this},g.prototype.triggerFirstListener=function(e){this.$firstListener(this.$currentValue,this.$previousValue,e)},g.prototype.triggerListeners=function(e){const t=this.$listeners,n=this.$previousValue,r=this.$currentValue;for(let o=0,s=t.length;o<s;o++)t[o](r,n,e)},g.prototype.triggerWatchers=function(e){const t=this.$watchers,n=this.$previousValue,r=this.$currentValue,o=t.get(r),s=t.get(n);o&&o(!0,n,e),s&&s(!1,r,e)},g.prototype.triggerAll=function(e){this.triggerWatchers(e),this.triggerListeners(e)},g.prototype.triggerWatchersAndFirstListener=function(e){this.triggerWatchers(e),this.triggerFirstListener(e)},g.prototype.assocTrigger=function(){if(this.$firstListener=null,this.$watchers?.size&&this.$listeners?.length)return this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener,void(this.trigger=1===this.$listeners.length?this.triggerWatchersAndFirstListener:this.triggerAll);this.$listeners?.length?1===this.$listeners.length?(this.$firstListener=this.$listeners[0],this.trigger=0===this.$firstListener.length?this.$firstListener:this.triggerFirstListener):this.trigger=this.triggerListeners:this.$watchers?.size?this.trigger=this.triggerWatchers:this.trigger=v},g.prototype.trigger=v;const w={action:"set"};function $(e,t){this.observable=e,g.call(this),this.$mutation=t,e.subscribe(e=>{this.$updateWithMutation(e)}),this.$updateWithMutation(e.val())}g.prototype.$updateWithNewValue=function(e){e=e?.__$isObservable?e.val():e,this.$currentValue!==e&&(this.$previousValue=this.$currentValue,this.$currentValue=e,this.trigger(w),this.$previousValue=null)},g.prototype.$setWithInterceptor=function(e){let t="function"==typeof e?e(this.$currentValue):e;const n=this.$interceptor(t,this.$currentValue);void 0!==n&&(t=n),this.$updateWithNewValue(t)},g.prototype.$basicSet=function(e){let t="function"==typeof e?e(this.$currentValue):e;this.$updateWithNewValue(t)},g.prototype.set=g.prototype.$basicSet,g.prototype.val=function(){return this.$currentValue},g.prototype.disconnectAll=function(){this.$previousValue=null,this.$currentValue=null,this.$listeners=null,this.$watchers=null,this.trigger=v},g.prototype.onCleanup=function(e){this.$cleanupListeners=this.$cleanupListeners??[],this.$cleanupListeners.push(e)},g.prototype.cleanup=function(){if(this.$cleanupListeners){for(let e=0;e<this.$cleanupListeners.length;e++)this.$cleanupListeners[e]();this.$cleanupListeners=null}o.unregister(this.$memoryId),this.disconnectAll(),delete this.$value},g.prototype.subscribe=function(e){this.$listeners=this.$listeners??[],this.$listeners.push(e),this.assocTrigger()},g.prototype.on=function(e,t){this.$watchers=this.$watchers??new Map;let n=this.$watchers.get(e);t.__$isObservable&&(t=t.set.bind(t)),n?B.isArray(n.list)?n.list.push(t):(n=[n,t],t=e=>{for(let t=0,r=n.length;t<r;t++)n[t](e)},t.list=n,this.$watchers.set(e,t)):(n=t,this.$watchers.set(e,t)),this.assocTrigger()},g.prototype.off=function(e,t){if(!this.$watchers)return;const n=this.$watchers.get(e);if(!n)return;if(!t||!Array.isArray(n.list))return this.$watchers?.delete(e),void this.assocTrigger();const r=n.indexOf(t);n?.splice(r,1),1===n.length?this.$watchers.set(e,n[0]):0===n.length&&this.$watchers?.delete(e),this.assocTrigger()},g.prototype.once=function(e,t){const n="function"==typeof e?e:t=>t===e,r=e=>{n(e)&&(this.unsubscribe(r),t(e))};this.subscribe(r)},g.prototype.unsubscribe=function(e){if(!this.$listeners)return;const t=this.$listeners.indexOf(e);t>-1&&this.$listeners.splice(t,1),this.assocTrigger()},g.prototype.check=function(e){return new $(this,e)},g.prototype.transform=g.prototype.check,g.prototype.pluck=function(e){return new $(this,t=>t[e])},g.prototype.is=function(e){return new $(this,"function"==typeof e?e:t=>t===e)},g.prototype.select=g.prototype.check,g.prototype.get=function(e){const t=this.$currentValue[e];return B.isObservable(t)?t.val():t},g.prototype.when=function(e){return new s(this,e)},g.prototype.equals=function(e){return B.isObservable(e)?this.$currentValue===e.$currentValue:this.$currentValue===e},g.prototype.toBool=function(){return!!this.$currentValue},g.prototype.toggle=function(){this.set(!this.$currentValue)},g.prototype.reset=function(){if(!this.configs?.reset)return;const e=B.isObject(this.$initialValue)?l(this.$initialValue,e=>{e.reset()}):this.$initialValue;this.set(e)},g.prototype.toString=function(){return String(this.$currentValue)},g.prototype.valueOf=function(){return this.$currentValue},g.prototype.format=function(e,t={}){const n=this;if("function"==typeof e)return new $(n,e);const r=p[e],o=p.locale;return h.computed(()=>r(n.val(),o.val(),t),[n,o])},g.prototype.persist=function(e,t={}){let n=b(e,this.$currentValue);t.get&&(n=t.get(n)),this.set(n);const r=y(this.$currentValue);return this.subscribe(n=>{r(e,t.set?t.set(n):n)}),this},g.prototype.clone=function(){let e=this.$currentValue;return e&&"object"==typeof e&&(e="function"==typeof e.clone?e.clone():structuredClone(e)),new g(e)},$.prototype=Object.create(g.prototype),$.prototype.constructor=$,$.prototype.__$Observable=!0,$.prototype.__$isObservableChecker=!0;const S=$;S.prototype.constructor=S,$.prototype.$updateWithMutation=function(e){return e=this.$mutation(e),this.set(e)};const C={mounted:new WeakMap,beforeUnmount:new WeakMap,mountedSupposedSize:0,unmounted:new WeakMap,unmountedSupposedSize:0,observer:null,initObserver:()=>{C.observer||(C.observer=new MutationObserver(C.checkMutation),C.observer.observe(document.body,{childList:!0,subtree:!0}))},executeMountedCallback(e){const t=C.mounted.get(e);if(t&&(t.inDom=!0,t.mounted))if(Array.isArray(t.mounted))for(const n of t.mounted)n(e);else t.mounted(e)},executeUnmountedCallback(e){const t=C.unmounted.get(e);if(!t)return;if(t.inDom=!1,!t.unmounted)return;let n=!1;if(Array.isArray(t.unmounted))for(const r of t.unmounted)!0===r(e)&&(n=!0);else n=!0===t.unmounted(e);n&&(t.disconnect(),e.nd?.remove())},checkMutation:function(e){for(const t of e){if(C.mountedSupposedSize>0)for(const e of t.addedNodes){if(C.executeMountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-mounted]");for(const e of t)C.executeMountedCallback(e)}if(C.unmountedSupposedSize>0)for(const e of t.removedNodes){if(C.executeUnmountedCallback(e),!e.querySelectorAll)continue;const t=e.querySelectorAll("[data--nd-unmounted]");for(const e of t)C.executeUnmountedCallback(e)}}},watch:function(e,t=!1){let n=!1,r=!1;C.initObserver();let o={inDom:t,mounted:null,unmounted:null,disconnect:()=>{n&&(C.mounted.delete(e),C.mountedSupposedSize--),r&&(C.unmounted.delete(e),C.unmountedSupposedSize--),o=null}};const s=(e,t)=>{o[e]?Array.isArray(o[e])?o[e].push(t):o[e]=[o[e],t]:o[e]=t};return{disconnect:()=>o?.disconnect(),mounted:t=>{s("mounted",t),C.mounted.set(e,o),n||(C.mountedSupposedSize++,n=!0)},unmounted:t=>{s("unmounted",t),C.unmounted.set(e,o),r||(C.unmountedSupposedSize++,r=!0)},off:(e,t)=>{((e,t)=>{if(o?.[e]){if(Array.isArray(o[e])){const n=o[e].indexOf(t);return n>-1&&o[e].splice(n,1),1===o[e].length&&(o[e]=o[e][0]),void(0===o[e].length&&(o[e]=null))}o[e]=null}})(e,t)}}}},O=new Set(["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"]),A=(e,t)=>{for(const n in t){const r=t[n];if(r.__$Observable){if(r.__$isObservableChecker){let t=r.val();if("string"==typeof t){e.classes.toggle(t,!0),r.subscribe(n=>{e.classes.remove(t),e.classes.toggle(n,!0),t=n});continue}}e.classes.toggle(n,r.val()),r.subscribe(t=>e.classes.toggle(n,t))}else r.$hydrate?r.$hydrate(e,n):e.classes.toggle(n,r)}},E=(e,t)=>{for(const n in t){const r=t[n],o=n.startsWith("--");r.__$Observable?o?(e.style.setProperty(n,r.val()),r.subscribe(t=>{!1!==t?e.style.setProperty(n,t):e.style.removeProperty(n)})):(e.style[n]=r.val(),r.subscribe(t=>{!1!==t?e.style[n]=t:e.style.removeProperty(n)})):o?e.style.setProperty(n,r):e.style[n]=r}},_=(e,t,n)=>{const r=n.__$isObservable,o=r?n.val():n;if(B.isBoolean(o)?e[t]=o:e[t]=o===e.value,r){if("checked"===t)return"boolean"==typeof o?e.addEventListener("input",()=>n.set(e[t])):e.addEventListener("input",()=>n.set(e.value)),void n.subscribe(n=>e[t]=n);n.subscribe(n=>e[t]=n===e.value)}},N=(e,t)=>{for(const n in t){const r=n.toLowerCase();let o=t[n];if(null!=o)if(o.handleNdAttribute)o.handleNdAttribute(e,r,o);else{if("object"==typeof o){if("class"===r){A(e,o);continue}if("style"===r){E(e,o);continue}}O.has(r)?_(e,r,o):e.setAttribute(r,o)}}return e};function x(e){this.$hydrate=e}x.prototype.__$isTemplateBinding=!0,String.prototype.toNdElement=function(){return M.createStaticTextNode(null,this)},Number.prototype.toNdElement=function(){return M.createStaticTextNode(null,this.toString())},Element.prototype.toNdElement=function(){return this},Text.prototype.toNdElement=function(){return this},Comment.prototype.toNdElement=function(){return this},Document.prototype.toNdElement=function(){return this},DocumentFragment.prototype.toNdElement=function(){return this},g.prototype.toNdElement=function(){return M.createObservableNode(null,this)},$.prototype.toNdElement=g.prototype.toNdElement,I.prototype.toNdElement=function(){const e=this.$element??this.$build?.()??this.build?.()??null;return this.$attachements?(this.$attachements.contains(this.$element)||this.$attachements.append(this.$element),this.$attachements):e},Array.prototype.toNdElement=function(){const e=document.createDocumentFragment();for(let t=0,n=this.length;t<n;t++){const n=M.getChild(this[t]);null!==n&&e.appendChild(n)}return e},Function.prototype.toNdElement=function(){return M.getChild(this())},x.prototype.toNdElement=function(){return M.createHydratableNode(null,this)};const F=(e,t=1e3)=>new Promise(n=>{let r=!1;const o=t=>{t&&t.target!==e||r||(r=!0,e.removeEventListener("transitionend",o),e.removeEventListener("animationend",o),clearTimeout(s),n())};e.addEventListener("transitionend",o),e.addEventListener("animationend",o);const s=setTimeout(o,t),i=window.getComputedStyle(e),a="0s"!==i.transitionDuration,l="0s"!==i.animationDuration;a||l||o()});I.prototype.transitionOut=function(e){const t=e+"-exit",n=this.$element;return this.beforeUnmount("transition-exit",async function(){n.classes.add(t),await F(n),n.classes.remove(t)}),this},I.prototype.transitionIn=function(e){const t=e+"-enter-from",n=e+"-enter-to",r=this.$element;return r.classes.add(t),this.mounted(()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{r.classes.remove(t),r.classes.add(n),F(r).then(()=>{r.classes.remove(n)})})})}),this},I.prototype.transition=function(e){return this.transitionIn(e),this.transitionOut(e),this},I.prototype.animate=function(e){const t=this.$element;return t.classes.add(e),F(t).then(()=>{t.classes.remove(e)}),this},g.prototype.handleNdAttribute=function(e,t){O.has(t)?_(e,t,this):((e,t,n)=>{const r="value"===t?t=>e.value=t:n=>e.setAttribute(t,n);if(n.subscribe(r),"value"===t)return e.value=n.val(),void e.addEventListener("input",()=>n.set(e.value));e.setAttribute(t,n.val())})(e,t,this)},$.prototype.handleNdAttribute=g.prototype.handleNdAttribute,x.prototype.handleNdAttribute=function(e,t){this.$hydrate(e,t)};let D=null;const M={createTextNode:()=>(D||(D=document.createTextNode(""),M.createTextNode=()=>D.cloneNode()),D.cloneNode()),createObservableNode:(e,t)=>{const n=M.createTextNode();return t.subscribe(e=>n.nodeValue=e),n.nodeValue=t.val(),e&&e.appendChild(n),n},createHydratableNode:(e,t)=>{const n=M.createTextNode();return t.$hydrate(n),n},createStaticTextNode:(e,t)=>{let n=M.createTextNode();return n.nodeValue=t,e&&e.appendChild(n),n},createElement:e=>document.createElement(e).cloneNode(),createFragment:e=>k("Fragment"),bindTextNode:(e,t)=>{if(t?.__$isObservable)return t.subscribe(t=>e.nodeValue=t),void(e.nodeValue=t.val());e.nodeValue=t},processChildren:(e,t)=>{if(null===e)return;let n=M.getChild(e);n&&t.appendChild(n)},async safeRemove(e){await e.remove()},getChild:e=>{if(null==e)return null;if(e.toNdElement)do{if(e=e.toNdElement(),B.isElement(e))return e}while(e.toNdElement);return M.createStaticTextNode(null,e)},processAttributes:(e,t)=>{t&&N(e,t)},processAttributesDirect:N,processClassAttribute:A,processStyleAttribute:E};function T(e){const t=Reflect.construct(DocumentFragment,[],T),n=document.createComment((e||"")+" Anchor Sentinel"),r=document.createComment("Anchor Start : "+e),o=document.createComment("/ Anchor End "+e),s={};t.append(r,n,o);const i=new MutationObserver(()=>{n.parentNode===t||n.parentNode instanceof DocumentFragment||s.connected&&s.connected(n.parentNode)});return i.observe(document,{childList:!0,subtree:!0}),t.$sentinel=n,t.$start=r,t.$end=o,t.$observer=i,t.$events=s,t}function k(e,t=!1){const n=new T(e);n.onConnectedOnce(e=>{t&&function(e,t){e.remove=()=>{e.append.apply(e,t.childNodes)},e.getParent=()=>t,e.appendChild=e=>{e=B.isElement(e)?e:M.getChild(e),t.appendChild(e)},e.appendChildRaw=t.appendChild.bind(t),e.append=e.appendChild,e.appendRaw=e.appendChildRaw,e.insertAtStart=e=>{e=B.isElement(e)?e:M.getChild(e),t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.insertAtStartRaw=e=>{t.firstChild?t.insertBefore(e,t.firstChild):t.appendChild(e)},e.appendElement=e.appendChild,e.removeChildren=()=>{t.textContent=""},e.replaceContent=function(e){const n=B.isElement(e)?e:M.getChild(e);t.replaceChildren(n)},e.replaceContentRaw=function(e){t.replaceChildren(e)},e.setContent=e.replaceContent,e.insertBefore=(e,n)=>{e=B.isElement(e)?e:M.getChild(e),t.insertBefore(e,n)},e.insertBeforeRaw=(e,n)=>{t.insertBefore(e,n)},e.appendChildBefore=e.insertBefore,e.appendChildBeforeRaw=e.insertBeforeRaw,e.clear=e.remove,e.detach=e.remove,e.replaceChildren=function(){t.replaceChildren(...arguments)},e.getByIndex=e=>t.childNodes[e]}(n,e)}),n.__Anchor__=!0;const r=n.$start,o=n.$end;n.nativeInsertBefore=n.insertBefore,n.nativeAppendChild=n.appendChild,n.nativeAppend=n.append;const s=t?()=>!0:e=>e.firstChild===r&&e.lastChild===o,i=(e,t,r)=>{e!==n?s(e)&&r===o?e.append(t,r):e.insertBefore(t,r):e.nativeInsertBefore(t,r)};return n.appendElement=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,o):t.nativeInsertBefore(e,o)},n.appendChild=function(e,t=null){const n=o.parentNode;n?((e,t,n)=>{const r=B.isElement(t)?t:M.getChild(t);i(e,r,n)})(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.appendChildRaw=function(e,t=null){const n=o.parentNode;n?i(n,e,t=t??o):DebugManager.error("Anchor","Anchor : parent not found",e)},n.getParent=()=>o.parentNode,n.append=n.appendChild,n.appendRaw=n.appendChildRaw,n.insertAtStart=function(e){e=B.isElement(e)?e:M.getChild(e),n.insertAtStartRaw(e)},n.insertAtStartRaw=function(e){const t=r.parentNode;t!==n?t.insertBefore(e,r):t.nativeInsertBefore(e,r)},n.removeChildren=function(){const e=o.parentNode;if(e===n)return;if(s(e))return void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,i.remove(),i=t},n.remove=function(){const e=o.parentNode;if(e===n)return;if(s(e))return n.nativeAppend.apply(n,e.childNodes),void e.replaceChildren(r,o);let t,i=r.nextSibling;for(;i&&i!==o;)t=i.nextSibling,n.nativeAppend(i),i=t},n.removeWithAnchors=function(){n.removeChildren(),r.remove(),o.remove()},n.delete=n.removeWithAnchors,n.replaceContent=function(e){const t=B.isElement(e)?e:M.getChild(e);n.replaceContentRaw(t)},n.replaceContentRaw=function(e){const t=o.parentNode;t&&(s(t)?t.replaceChildren(r,e,o):(n.removeChildren(),t.insertBefore(e,o)))},n.setContent=n.replaceContent,n.setContentRaw=n.replaceContentRaw,n.insertBefore=n.appendChild,n.insertBeforeRaw=n.appendChildRaw,n.endElement=function(){return o},n.startElement=function(){return r},n.restore=function(){n.appendChild(n)},n.clear=n.remove,n.detach=n.remove,n.getByIndex=function(e){let t=r;for(let n=0;n<=e;n++){if(!t.nextSibling)return null;t=t.nextSibling}return t!==r?t:null},n}function I(e){this.$element=e,this.$attachements=null}T.prototype=Object.create(DocumentFragment.prototype),T.prototype.constructor=T,T.prototype.onConnected=function(e){return this.$events.connected=e,this},T.prototype.onConnectedOnce=function(e){this.$events.connected=t=>{e(t),this.$observer.disconnect(),this.$events.connectedOnce=null}},DocumentFragment.prototype.setAttribute=()=>{},I.prototype.__$isNDElement=!0,I.prototype.ghostDom=function(e){return this.$attachements||(this.$attachements=document.createDocumentFragment()),this.$attachements.appendChild(M.getChild(e)),this},I.prototype.valueOf=function(){return this.$element},I.prototype.ref=function(e,t){return e[t]=this.$element,this},I.prototype.refSelf=function(e,t){return e[t]=this,this},I.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},I.prototype.remove=function(){let e=this.$element;return e.nd.unmountChildren(),e.$ndProx=null,P.delete(e),e=null,this};const P=new WeakMap;I.prototype.lifecycle=function(e){const t=this.$element;P.has(t)||P.set(t,C.watch(t));const n=P.get(t);return e.mounted&&(this.$element.setAttribute("data--nd-mounted","1"),n.mounted(e.mounted)),e.unmounted&&(this.$element.setAttribute("data--nd-unmounted","1"),n.unmounted(e.unmounted)),this},I.prototype.mounted=function(e){return this.lifecycle({mounted:e})},I.prototype.unmounted=function(e){return this.lifecycle({unmounted:e})},I.prototype.beforeUnmount=function(e,t){const n=this.$element;if(!C.beforeUnmount.has(n)){C.beforeUnmount.set(n,new Map);const e=n.remove.bind(n);let t=!1;n.remove=async()=>{if(!t){t=!0;try{const e=C.beforeUnmount.get(n);for(const t of e.values())await t.call(this,n)}finally{e(),t=!1}}}}return C.beforeUnmount.get(n).set(e,t),this},I.prototype.htmlElement=function(){return this.$element},I.prototype.node=I.prototype.htmlElement,I.prototype.shadow=function(e,t=null){const n=this.$element,r=Array.from(n.childNodes),o=n.attachShadow({mode:e});if(t){const e=document.createElement("style");e.textContent=t,o.appendChild(e)}return n.append=o.append.bind(o),n.appendChild=o.appendChild.bind(o),o.append(...r),this},I.prototype.openShadow=function(e=null){return this.shadow("open",e)},I.prototype.closedShadow=function(e=null){return this.shadow("closed",e)},I.prototype.with=function(e){if(!e||"object"!=typeof e)throw new r("extend() requires an object of methods");for(const t in e){const r=e[t];"function"==typeof r?this[t]=r.bind(this):n.warn(`⚠️ extends(): "${t}" is not a function, skipping`)}return this},I.extend=function(e){if(!e||"object"!=typeof e)throw new r("NDElement.extend() requires an object of methods");if(Array.isArray(e))throw new r("NDElement.extend() requires an object, not an array");const t=new Set(["constructor","valueOf","$element","$observer","ref","remove","cleanup","with","extend","attach","lifecycle","mounted","unmounted","unmountChildren"]);for(const o in e){if(!Object.hasOwn(e,o))continue;const s=e[o];if("function"==typeof s){if(t.has(o))throw n.error("NDElement.extend",`Cannot override protected method "${o}"`),new r(`Cannot override protected method "${o}"`);I.prototype[o]&&n.warn("NDElement.extend",`Overwriting existing prototype method "${o}"`),I.prototype[o]=s}else n.warn("NDElement.extend",`"${o}" is not a function, skipping`)}return I};const L=3,R=8,j=11,V=[];V[1]=!0,V[L]=!0,V[j]=!0,V[R]=!0;const B={isObservable:e=>e&&(e.__$isObservable||e.__$Observable),isTemplateBinding:e=>e?.__$isTemplateBinding,isObservableWhenResult:e=>e&&(e.__$isObservableWhen||"object"==typeof e&&"$target"in e&&"$observer"in e),isArrayObservable:e=>e?.__$isObservableArray,isProxy:e=>e?.__isProxy__,isObservableOrProxy:e=>B.isObservable(e)||B.isProxy(e),isAnchor:e=>e?.__Anchor__,isObservableChecker:e=>e?.__$isObservableChecker||e instanceof $,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&&null!==e,isJson:e=>!("object"!=typeof e||null===e||Array.isArray(e)||"Object"!==e.constructor.name),isElement:e=>e&&V[e.nodeType],isDOMNode:e=>V[e.nodeType],isFragment:e=>e?.nodeType===j,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?.__$isNDElement||e instanceof I,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 r(`Invalid children detected: ${t.map(e=>typeof e).join(", ")}`);return e},containsObservables:e=>!!e&&(B.isObject(e)&&Object.values(e).some(e=>B.isObservable(e))),containsObservableReference:e=>!(!e||"string"!=typeof e)&&/\{\{#ObItem::\([0-9]+\)\}\}/.test(e),validateAttributes(e){},validateEventCallback(e){if("function"!=typeof e)throw new r("Event callback must be a function")}},W={configurable:!0,get(){return new I(this)}};Object.defineProperty(HTMLElement.prototype,"nd",W),Object.defineProperty(DocumentFragment.prototype,"nd",W),Object.defineProperty(I.prototype,"nd",{configurable:!0,get:function(){return this}}),["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","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();I.prototype["on"+e]=function(e=null){return this.$element.addEventListener(t,e),this}}),["Click","DblClick","MouseDown","MouseMove","MouseOut","MouseOver","MouseUp","Wheel","KeyDown","KeyPress","KeyUp","Change","Input","Invalid","Reset","Search","Select","Submit","Drag","DragEnd","DragEnter","DragLeave","DragOver","DragStart","Drop","BeforeUnload","HashChange","TouchCancel","TouchEnd","TouchMove","TouchStart","AnimationEnd","AnimationIteration","AnimationStart","TransitionEnd","Copy","Cut","Paste","FocusIn","FocusOut","ContextMenu"].forEach(e=>{const t=e.toLowerCase();I.prototype["onStop"+e]=function(e=null){return U(this.$element,t,e),this},I.prototype["onPreventStop"+e]=function(e=null){return H(this.$element,t,e),this}}),["Click","DblClick","MouseDown","MouseUp","Wheel","KeyDown","KeyPress","Invalid","Reset","Submit","DragOver","Drop","BeforeUnload","TouchCancel","TouchEnd","TouchMove","TouchStart","Copy","Cut","Paste","ContextMenu"].forEach(e=>{const t=e.toLowerCase();I.prototype["onPrevent"+e]=function(e=null){return q(this.$element,t,e),this}}),I.prototype.on=function(e,t,n){return this.$element.addEventListener(e.toLowerCase(),t,n),this};const q=function(e,t,n){return e.addEventListener(t,t=>{t.preventDefault(),n&&n.call(e,t)}),this},U=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),n&&n.call(e,t)}),this},H=function(e,t,n){return e.addEventListener(t,t=>{t.stopPropagation(),t.preventDefault(),n&&n.call(e,t)}),this},z={getClasses(){return this.$element.className?.split(" ").filter(Boolean)},add(e){const t=this.getClasses();t.indexOf(e)>=0||(t.push(e),this.$element.className=t.join(" "))},remove(e){const t=this.getClasses(),n=t.indexOf(e);n<0||(t.splice(n,1),this.$element.className=t.join(" "))},toggle(e,t=void 0){const n=this.getClasses(),r=n.indexOf(e);if(r>=0){if(!0===t)return;n.splice(r,1)}else{if(!1===t)return;n.push(e)}this.$element.className=n.join(" ")},contains(e){return this.getClasses().indexOf(e)>=0}};Object.defineProperty(HTMLElement.prototype,"classes",{configurable:!0,get(){return{$element:this,...z}}});let G=e=>e;e.ArgTypes={},e.ArgTypes={string:()=>!0,number:()=>!0,boolean:()=>!0,observable:()=>!0,element:()=>!0,function:()=>!0,object:()=>!0,objectNotNull:()=>!0,children:()=>!0,attributes:()=>!0,optional:()=>!0,oneOf:()=>!0};const K=function(e,t=null){return e&&t?{props:e,children:t}:"object"!=typeof e||Array.isArray(e)||null===e||"Object"!==e.constructor.name||e.$hydrate?{props:t,children:e}:{props:e,children:t}},J=e=>e?e.toNdElement():M.createTextNode(),Y=(e,t,n=null)=>{let{props:r,children:o=null}=K(t,n);return M.processAttributes(e,r),M.processChildren(o,e),e};function Q(e,t=null){if(e){if(t){let n=null,r=(o,s)=>(n=document.createElement(e),r=(e,r)=>Y(t(n.cloneNode()),e,r),Y(t(n.cloneNode()),o,s));return(e,t)=>r(e,t)}let n=null,r=(t,o)=>(n=document.createElement(e),r=(e,t)=>Y(n.cloneNode(),e,t),Y(n.cloneNode(),t,o));return(e,t)=>r(e,t)}return(e,t="")=>{const n=k(t);return n.append(e),n}}function X(e){this.$element=e,this.$classes=null,this.$styles=null,this.$attrs=null,this.$ndMethods=null}I.prototype.attach=function(e,t){if("function"==typeof t){const n=this.$element;return n.nodeCloner=n.nodeCloner||new X(n),n.nodeCloner.attach(e,t),n}return t.$hydrate(this.$element,e),this.$element},X.prototype.__$isNodeCloner=!0;const Z=(e,t,n)=>{for(const r in t)e[r]=t[r].apply(null,n);return e};X.prototype.resolve=function(){if(this.$content)return;const e=[];if(this.$ndMethods){const t=Object.keys(this.$ndMethods);if(1===t.length){const n=t[0],r=this.$ndMethods[n];e.push((e,t)=>{e.nd[n](r.bind(e,...t))})}else e.push((e,t)=>{const n=e.nd;for(const r in this.$ndMethods)n[r](this.$ndMethods[r].bind(e,...t))})}if(this.$classes){const t={},n=Object.keys(this.$classes);if(1===n.length){const r=n[0],o=this.$classes[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processClassAttribute(e,t)})}else e.push((e,n)=>{M.processClassAttribute(e,Z(t,this.$classes,n))})}if(this.$styles){const t={},n=Object.keys(this.$styles);if(1===n.length){const r=n[0],o=this.$styles[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processStyleAttribute(e,t)})}else e.push((e,n)=>{M.processStyleAttribute(e,Z(t,this.$styles,n))})}if(this.$attrs){const t={},n=Object.keys(this.$attrs);if(1===n.length){const r=n[0],o=this.$attrs[r];e.push((e,n)=>{t[r]=o.apply(null,n),M.processAttributes(e,t)})}else e.push((e,n)=>{M.processAttributes(e,Z(t,this.$attrs,n))})}const t=e.length,n=this.$element;this.cloneNode=r=>{const o=n.cloneNode(!1);for(let n=0;n<t;n++)e[n](o,r);return o}},X.prototype.cloneNode=function(e){return this.$element.cloneNode(!1)},X.prototype.attach=function(e,t){return this.$ndMethods=this.$ndMethods||{},this.$ndMethods[e]=t,this},X.prototype.text=function(e){return this.$content=e,"function"==typeof e?(this.cloneNode=t=>J(e.apply(null,t)),this):(this.cloneNode=t=>J(t[0][e]),this)},X.prototype.attr=function(e,t){return"class"===e?(this.$classes=this.$classes||{},this.$classes[t.property]=t.value,this):"style"===e?(this.$styles=this.$styles||{},this.$styles[t.property]=t.value,this):(this.$attrs=this.$attrs||{},this.$attrs[e]=t.value,this)};function ee(e){let t=null;const n=e=>{const t=e.childNodes;let r=!!e.nodeCloner;const o=t.length;for(let e=0;e<o;e++){const o=t[e];o.nodeCloner&&(r=!0);n(o)&&(r=!0)}return r?e.nodeCloner?(e.nodeCloner.resolve(),e.dynamicCloneNode=n=>{const r=e.nodeCloner.cloneNode(n);for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}):e.dynamicCloneNode=n=>{const r=e.cloneNode();for(let e=0;e<o;e++)r.appendChild(t[e].dynamicCloneNode(n));return r}:e.dynamicCloneNode=e.cloneNode.bind(e,!0),r};this.clone=r=>{const o=te(this);return t=e(o),t.nodeCloner||(t.nodeCloner=new X(t)),n(t),this.clone=t.dynamicCloneNode,t.dynamicCloneNode(r)};const r=(e,t)=>new x((n,r)=>{!function(e,t,n,r){n.nodeCloner=n.nodeCloner||new X(n),"value"!==t?"attach"!==t?n.nodeCloner.attr(t,{property:r,value:e}):n.nodeCloner.attach(r,e):n.nodeCloner.text(e)}(e,t,n,r)});this.style=e=>r(e,"style"),this.class=e=>r(e,"class"),this.property=e=>this.value(e),this.value=e=>r(e,"value"),this.text=this.value,this.attr=e=>r(e,"attributes"),this.attach=e=>r(e,"attach"),this.callback=this.attach}const te=e=>new Proxy(e,{get:(e,t)=>t in e||"symbol"==typeof t?e[t]:e.value(t)});function ne(e){let t=null,n=null;this.render=r=>{if(t||(t=e(this)),!n)return t;for(const e in n){(0,n[e])(...r)}return t},this.createSection=(e,t)=>{n=n||{};const r=k("Component "+e);return n[e]=function(...e){r.removeChildren(),t?r.appendChild(t(...e)):r.append(e)},r}}DocumentFragment.prototype.__IS_FRAGMENT=!0,Function.prototype.args=function(...e){return this},Function.prototype.cached=function(...e){let t,n=()=>t;return()=>(t||(t=this.apply(this,e),t.cloneNode?n=()=>t.cloneNode(!0):t.$element&&(n=()=>new I(t.$element.cloneNode(!0)))),n())},Function.prototype.errorBoundary=function(e){const t=(...n)=>{try{return this.apply(this,n)}catch(r){return e(r,{caller:t,args:n})}};return t},String.prototype.use=function(e){const t=this;return h.computed(()=>t.replace(/\$\{(.*?)}/g,(t,n)=>{const r=e[n];return B.isObservable(r)?r.val():r}),Object.values(e))},String.prototype.resolveObservableTemplate=function(){return B.containsObservableReference(this)?this.split(/(\{\{#ObItem::\([0-9]+\)\}\})/g).filter(Boolean).map(e=>{if(!B.containsObservableReference(e))return e;const[t,n]=e.match(/\{\{#ObItem::\(([0-9]+)\)\}\}/);return h.getById(n)}):this.valueOf()};const re=function(e={}){let t=B.isString(e)?e.split(";").filter(Boolean):e;return{add(e,n){if(Array.isArray(t))t.push(e+": "+n);else if(B.isObject(e)){n=e;for(const e in n)t[e]=n[e]}else t[e]=n},value:()=>Array.isArray(t)?t.join(";").concat(";"):{...t}}},oe=function(e=[]){let t=B.isString(e)?e.split(" ").filter(Boolean):e;return{add(e,n=!0){if(B.isJson(e))for(const n in e)e[n]&&(t[n]=e[n]);else if(null!=n||e.__$Observable)if(Array.isArray(t)&&(t=t.reduce((e,t)=>(e[t]=!0,e),{})),e.__$Observable){const n=`obs-${Math.random().toString(36).substr(2,9)}`;t[n]=e}else t[e]=n;else Array.isArray(t)?t.push(e):t[e]=n},value:()=>Array.isArray(t)?t.join(" "):{...t}}},se=e=>{let t=null;return(...n)=>(null!=t||(t=e(...n)),t)},ie=e=>{let t=null;return new Proxy({},{get:(n,r)=>(t||(t=e()),t[r])})},ae=e=>{const t=new Map;return new Proxy({},{get:(n,r)=>{const o=t.get(r);if(o)return o;if(e.length>0)return(...n)=>{const o=e(...n,r);return t.set(r,o),o};const s=e(r);return t.set(r,s),s}})};function le(e){return e instanceof Date?e:new Date(e)}function ue(e,t){const n=le(e),r=le(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()&&n.getDate()===r.getDate()}function ce(e){const t=le(e);return 3600*t.getHours()+60*t.getMinutes()+t.getSeconds()}function pe(e,t){const n=B.isObservable(e);return{dependencies:n?e:null,callback:r=>t(r,n?e.val():e)}}function he(e,t){const n=e.filter(B.isObservable);return{dependencies:n.length>0?n:null,callback:n=>t(n,e.map(e=>B.isObservable(e)?e.val():e))}}function de(e){return pe(e,(e,t)=>e===t)}function fe(e){return pe(e,(e,t)=>e!==t)}function me(e){return pe(e,(e,t)=>e>t)}function be(e){return pe(e,(e,t)=>e>=t)}function ye(e){return pe(e,(e,t)=>e<t)}function ge(e){return pe(e,(e,t)=>e<=t)}function ve(e,t=!0,r=""){return he([e,t,r],(e,[t,r,o])=>{if(!t)return!0;if(r)try{return new RegExp(t,o).test(String(e))}catch(e){return n.warn("Invalid regex pattern:",t,e),!1}return o&&""!==o?String(e).includes(String(t)):String(e).toLowerCase().includes(String(t).toLowerCase())})}function we(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(B.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.every(e=>e.callback(t))}}function $e(...e){const t=e.flatMap(e=>e.dependencies?Array.isArray(e.dependencies)?e.dependencies:[e.dependencies]:[]).filter(B.isObservable);return{dependencies:t.length>0?t:null,callback:t=>e.some(e=>e.callback(t))}}const Se=me,Ce=be,Oe=ye,Ae=ge,Ee=de,_e=fe,Ne=we,xe=$e;function Fe(e,t=!1){return pe(e,(e,n)=>!!e&&(!n||(t?String(e).includes(String(n)):String(e).toLowerCase().includes(String(n).toLowerCase()))))}const De=Fe;var Me=Object.freeze({__proto__:null,all:Ne,and:we,any:xe,between:function(e,t){return he([e,t],(e,[t,n])=>e>=t&&e<=n)},contains:De,createFilter:pe,createMultiSourceFilter:he,custom:function(e,...t){const n=t.filter(B.isObservable);return{dependencies:n.length>0?n:null,callback:n=>{const r=t.map(e=>B.isObservable(e)?e.val():e);return e(n,...r)}}},dateAfter:e=>pe(e,(e,t)=>!(!e||!t)&&le(e)>le(t)),dateBefore:e=>pe(e,(e,t)=>!(!e||!t)&&le(e)<le(t)),dateBetween:(e,t)=>he([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=le(e);return r>=le(t)&&r<=le(n)}),dateEquals:e=>pe(e,(e,t)=>!(!e||!t)&&ue(e,t)),dateTimeAfter:e=>pe(e,(e,t)=>!(!e||!t)&&le(e)>le(t)),dateTimeBefore:e=>pe(e,(e,t)=>!(!e||!t)&&le(e)<le(t)),dateTimeBetween:(e,t)=>he([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=le(e);return r>=le(t)&&r<=le(n)}),dateTimeEquals:e=>pe(e,(e,t)=>!(!e||!t)&&le(e).getTime()===le(t).getTime()),endsWith:function(e,t=!1){return pe(e,(e,n)=>!n||(t?String(e).endsWith(String(n)):String(e).toLowerCase().endsWith(String(n).toLowerCase())))},eq:Ee,equals:de,getSecondsOfDay:ce,greaterThan:me,greaterThanOrEqual:be,gt:Se,gte:Ce,inArray:function(e){return pe(e,(e,t)=>t.includes(e))},includes:Fe,isEmpty:function(e=!0){return pe(e,(e,t)=>{const n=!e||""===e||Array.isArray(e)&&0===e.length;return t?n:!n})},isNotEmpty:function(e=!0){return pe(e,(e,t)=>{const n=!!e&&""!==e&&(!Array.isArray(e)||e.length>0);return t?n:!n})},isSameDay:ue,lessThan:ye,lessThanOrEqual:ge,lt:Oe,lte:Ae,match:ve,neq:_e,not:function(e){return{dependencies:e.dependencies,callback:t=>!e.callback(t)}},notEquals:fe,notIn:function(e){return pe(e,(e,t)=>!t.includes(e))},or:$e,startsWith:function(e,t=!1){return pe(e,(e,n)=>!n||(t?String(e).startsWith(String(n)):String(e).toLowerCase().startsWith(String(n).toLowerCase())))},timeAfter:e=>pe(e,(e,t)=>!(!e||!t)&&ce(e)>ce(t)),timeBefore:e=>pe(e,(e,t)=>!(!e||!t)&&ce(e)<ce(t)),timeBetween:(e,t)=>he([e,t],(e,[t,n])=>{if(!e||!t||!n)return!1;const r=ce(e);return r>=ce(t)&&r<=ce(n)}),timeEquals:e=>pe(e,(e,t)=>{if(!e||!t)return!1;const n=le(e),r=le(t);return n.getHours()===r.getHours()&&n.getMinutes()===r.getMinutes()&&n.getSeconds()===r.getSeconds()}),toDate:le});const Te=function(e,t=null){if(!Array.isArray(e))throw new r("Observable.array : target must be an array");g.call(this,e,t)};(Te.prototype=Object.create(g.prototype)).constructor=Te,Te.prototype.__$isObservableArray=!0,Object.defineProperty(Te.prototype,"length",{get(){return this.$currentValue.length}}),Te.prototype.$mutate=function(e,t,n){if(this.$mutationInterceptor){const n=this.$mutationInterceptor(t,{action:e});void 0!==t&&(t=n)}n(t)},["push","pop","shift","unshift","reverse","sort","splice"].forEach(e=>{Te.prototype[e]=function(...t){return this.$mutate(e,t,t=>{const n=this.$currentValue[e].apply(this.$currentValue,t);return this.trigger({action:e,args:t,result:n}),n})}}),["map","forEach","filter","reduce","some","every","find","findIndex","concat","includes","indexOf"].forEach(e=>{Te.prototype[e]=function(...t){return this.$currentValue[e].apply(this.$currentValue,t)}});const ke={action:"clear"};Te.prototype.clear=function(){if(0!==this.$currentValue.length)return this.$mutate("clear",[],()=>{this.$currentValue.length=0,this.trigger(ke)}),!0},Te.prototype.at=function(e){return this.$currentValue[e]},Te.prototype.merge=function(e){this.$mutate("merge",e,e=>{this.$currentValue.push.apply(this.$currentValue,e),this.trigger({action:"merge",args:e})})},Te.prototype.count=function(e){let t=0;return this.$currentValue.forEach((n,r)=>{e(n,r)&&t++}),t},Te.prototype.swap=function(e,t){return this.$mutate("swap",[e,t],([e,t])=>{const n=this.$currentValue,r=n.length;if(t<e){const n=e;e=t,t=n}if(r<e||r<t)return!1;const o=n[e],s=n[t];n[e]=s,n[t]=o,this.trigger({action:"swap",args:[e,t],result:[o,s]})}),!0},Te.prototype.swapItems=function(e,t){const n=this.$currentValue.indexOf(e),r=this.$currentValue.indexOf(t);return this.swap(n,r)},Te.prototype.insertAfter=function(e,t){const n=this.$currentValue.indexOf(t);return this.splice(n+1,0,e)},Te.prototype.remove=function(e){let t=[];return this.$mutate("remove",[e],([e])=>{t=this.$currentValue.splice(e,1),0!==t.length&&this.trigger({action:"remove",args:[e],result:t[0]})}),t},Te.prototype.removeItem=function(e){const t=this.$currentValue.indexOf(e);return-1===t?[]:this.remove(t)},Te.prototype.empty=function(){return 0===this.$currentValue.length},Te.prototype.populateAndRender=function(e,t){this.trigger({action:"populate",args:[this.$currentValue,e,t]})},Te.prototype.where=function(e){"function"==typeof e&&(e={_:e});const t=this,n=[t],r={};for(const[t,o]of Object.entries(e)){const e=B.isObservable(o)?ve(o,!1):o;if(e&&"object"==typeof e&&"callback"in e){if(r[t]=e.callback,e.dependencies){const t=Array.isArray(e.dependencies)?e.dependencies:[e.dependencies];n.push.apply(n,t)}}else r[t]="function"==typeof e?e:t=>t===e}const o=h.array(),s=Object.entries(r),i=()=>{const e=t.val().filter(e=>{for(const[t,n]of s)if("_"===t){if(!n(e))return!1}else if(!n(e[t]))return!1;return!0});o.set(e)};return n.forEach(e=>e.subscribe(i)),i(),o},Te.prototype.whereSome=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.some(e=>t.callback(n[e]))}})},Te.prototype.whereEvery=function(e,t){return this.where({_:{dependencies:t.dependencies,callback:n=>e.every(e=>t.callback(n[e]))}})},Te.prototype.deepSubscribe=function(e){const t=i(()=>e(this.val())),n=new WeakMap,r=e=>{n.has(e)||(e?.__$isObservableArray?n.set(e,e.deepSubscribe(t)):e?.__$isObservable&&(e.subscribe(t),n.set(e,()=>e.unsubscribe(t))))},o=e=>{const t=n.get(e);t&&(t(),n.delete(e))};return this.$currentValue.forEach(r),this.subscribe(t),this.subscribe((e,t,n)=>{switch(n?.action){case"push":case"unshift":case"merge":n.args.forEach(r);break;case"splice":{const[e,t,...s]=n.args;n.result?.forEach(o),s.forEach(r);break}case"remove":o(n.result);break;case"clear":this.$currentValue.forEach(o)}}),()=>{this.$currentValue.forEach(o)}},Te.prototype.sync=function(e){if(!e||!e.__$isObservableArray)throw new r("ObservableArray.sync : target must be an ObservableArray");e.set([...this.$currentValue]);const t=(t,n,r)=>{if(!r)return void e.set([...t]);const{action:o,args:s}=r;e[o].apply(e,s)};return this.subscribe(t),()=>this.unsubscribe(t)},Te.prototype.clone=function(){return new Te(this.resolve())},h.array=function(e=[],t=null){return new Te(e,t)},h.batch=function(e){const t=h(0),n=function(){if(B.isAsyncFunction(e))return e(...arguments).then(()=>{t.trigger()}).catch(e=>{throw e});e(...arguments),t.trigger()};return n.$observer=t,n};const Ie=function(e,t){g.call(this,e),this.$observables={},this.configs=t,this.$load(e);for(const t in e)Object.hasOwn(this,t)||Object.defineProperty(this,t,{get:()=>this.$observables[t],set:e=>this.$observables[t].set(e)})};Ie.prototype=Object.create(g.prototype),Object.defineProperty(Ie,"$value",{get(){return this.val()},set(e){this.set(e)}}),Ie.prototype.__$isObservableObject=!0,Ie.prototype.__isProxy__=!0,Ie.prototype.$load=function(e){const t=this.configs;for(const n in e){const r=e[n];if(Array.isArray(r)){if(!1!==t?.deep){const e=r.map(e=>B.isJson(e)?h.json(e,t):B.isArray(e)?h.array(e,t):h(e,t));this.$observables[n]=h.array(e,t);continue}this.$observables[n]=h.array(r,t)}else B.isObservable(r)||B.isProxy(r)?this.$observables[n]=r:this.$observables[n]="object"==typeof r?h.object(r,t):h(r,t)}},Ie.prototype.val=function(){const e={};for(const t in this.$observables){const n=this.$observables[t];if(B.isObservable(n)){let r=n.val();Array.isArray(r)&&(r=r.map(e=>B.isObservable(e)?e.val():B.isProxy(e)?e.$value:e)),e[t]=r}else B.isProxy(n)?e[t]=n.$value:e[t]=n}return e},Ie.prototype.$val=Ie.prototype.val,Ie.prototype.get=function(e){const t=this.$observables[e];return B.isObservable(t)?t.val():B.isProxy(t)?t.$value:t},Ie.prototype.$get=Ie.prototype.get,Ie.prototype.set=function(e){const t=B.isProxy(e)?e.$value:e,n=this.configs;for(const r in t){const o=this.$observables[r],s=e[r],i=t[r];if(B.isObservable(o)){if(!B.isArray(i)){o.set(i);continue}const e=s.at(0);if(B.isObservable(e)||B.isProxy(e)){const t=i.map(t=>B.isProxy(e)?h.init(t,n):h(t,n));o.set(t);continue}o.set([...i]);continue}B.isProxy(o)?o.update(i):this[r]=i}},Ie.prototype.$set=Ie.prototype.set,Ie.prototype.$updateWith=Ie.prototype.set,Ie.prototype.observables=function(){return Object.values(this.$observables)},Ie.prototype.$observables=Ie.prototype.observables,Ie.prototype.keys=function(){return Object.keys(this.$observables)},Ie.prototype.$keys=Ie.prototype.keys,Ie.prototype.clone=function(){return h.init(this.val(),this.configs)},Ie.prototype.$clone=Ie.prototype.clone,Ie.prototype.reset=function(){for(const e in this.$observables)this.$observables[e].reset()},Ie.prototype.originalSubscribe=Ie.prototype.subscribe,Ie.prototype.subscribe=function(e){const t=this.observables(),n=i(()=>this.trigger());this.originalSubscribe(e);for(let e=0,r=t.length;e<r;e++){const r=t[e];r.__$isObservableArray?r.deepSubscribe(n):r.subscribe(n)}},Ie.prototype.configs=function(){return this.configs},Ie.prototype.update=Ie.prototype.set,h.init=function(e,t=null){return new Ie(e,t)},h.arrayOfObject=function(e){return e.map(e=>h.object(e))},h.value=function(e){if(e?.__$isObservableArray){const t=[];for(let n=0,r=e.length;n<r;n++){const r=e.at(n);t.push(h.value(r))}return t}return e?.__$Observable?e.val():B.isProxy(e)?e.$value:e},g.prototype.resolve=function(){return h.value(this)},h.object=h.init,h.json=h.init,h.computed=function(e,t=[]){const n=new g(e()),o=i(()=>n.set(e(...t.map(e=>e.val()))));if(B.isFunction(t)){if(!B.isObservable(t.$observer))throw new r("Observable.computed : dependencies must be valid batch function");return t.$observer.subscribe(o),n}return t.forEach(e=>{B.isProxy(e)?e.$observables.forEach(e=>{e.subscribe(o)}):e.subscribe(o)}),n};const Pe=(e,t)=>h.computed(e,t),Le=(e,t)=>e.transform(t);g.prototype.isEqualTo=function(e){return e?.__$Observable?Pe((e,t)=>e===t,[this,e]):Le(this,t=>t===e)},g.prototype.isNotEqualTo=function(e){return e?.__$Observable?Pe((e,t)=>e!==t,[this,e]):Le(this,t=>t!==e)},g.prototype.isGreaterThan=function(e){return e?.__$Observable?Pe((e,t)=>e>t,[this,e]):Le(this,t=>t>e)},g.prototype.isGreaterThanOrEqualTo=function(e){return e?.__$Observable?Pe((e,t)=>e>=t,[this,e]):Le(this,t=>t>=e)},g.prototype.isLessThan=function(e){return e?.__$Observable?Pe((e,t)=>e<t,[this,e]):Le(this,t=>t<e)},g.prototype.isLessThanOrEqualTo=function(e){return e?.__$Observable?Pe((e,t)=>e<=t,[this,e]):Le(this,t=>t<=e)},g.prototype.isBetween=function(e,t){return e.__$Observable&&t.__$Observable?Pe((e,t,n)=>e>=t&&e<=n,[this,e,t]):e.__$Observable?Pe((e,n)=>e>=n&&e<=t,[this,e]):t.__$Observable?Pe((t,n)=>t>=e&&t<=n,[this,t]):Le(this,n=>n>=e&&n<=t)},g.prototype.isNull=function(){return Le(this,e=>null==e)},g.prototype.isTruthy=function(){return Le(this,e=>!!e)},g.prototype.isFalsy=function(){return Le(this,e=>!e)},g.prototype.isStartingWith=function(e){return e?.__$Observable?Pe((e,t)=>String(e).startsWith(t),[this,e]):Le(this,t=>String(t).startsWith(e))},g.prototype.isEndingWith=function(e){return e?.__$Observable?Pe((e,t)=>String(e).endsWith(t),[this,e]):Le(this,t=>String(t).endsWith(e))},g.prototype.isMatchingPattern=function(e){return e?.__$Observable?Pe((e,t)=>new RegExp(t).test(String(e)),[this,e]):Le(this,t=>e.test(String(t)))},g.prototype.isEmpty=function(){return Le(this,e=>null==e||""===e||Array.isArray(e)&&0===e.length)},g.prototype.isNotEmpty=function(){return Le(this,e=>null==e||""===e||Array.isArray(e)&&0!==e.length)},g.prototype.isIncludes=function(e){return e?.__$Observable?Pe((e,t)=>Array.isArray(e)?e.includes(t):String(e).includes(String(t)),[this,e]):Le(this,t=>Array.isArray(t)?t.includes(e):String(t).includes(String(e)))},g.prototype.isIncludedIn=function(e){return e?.__$Observable?Pe((e,t)=>t.includes(e),[this,e]):Le(this,t=>e.includes(t))},g.prototype.isOneOf=g.prototype.isIncludedIn,g.prototype.isHaving=function(e){return e?.__$Observable?Pe((e,t)=>t in Object(e),[this,e]):Le(this,t=>e in Object(t))},g.prototype.toUpperCase=function(){return Le(this,e=>String(e).toUpperCase())},g.prototype.toLowerCase=function(){return Le(this,e=>String(e).toLowerCase())},g.prototype.toTrimmed=function(){return Le(this,e=>String(e).trim())},g.prototype.toBoolean=function(){return Le(this,e=>!!e)},g.prototype.toLiteral=function(e,t="${v}"){return Le(this,n=>e.replace(t,n))},g.prototype.toFormatted=g.prototype.toLiteral,g.prototype.toProperty=function(e){const t=e.split(".");return Le(this,e=>{let n=e;for(const e of t){if(null==n)return;n=n[e]}return n})},g.prototype.toLength=function(){return Le(this,e=>null==e?0:e.length)},g.prototype.toClamped=function(e,t){return e.__$Observable&&t.__$Observable?Pe((e,t,n)=>Math.min(Math.max(e,t),n),[this,e,t]):e.__$Observable?Pe((e,n)=>Math.min(Math.max(e,n),t),[this,e]):t.__$Observable?Pe((t,n)=>Math.min(Math.max(t,e),n),[this,t]):Le(this,n=>Math.min(Math.max(n,e),t))},g.prototype.toPercent=function(e){return e?.__$Observable?Pe((e,t)=>0===t?0:e/t*100,[this,e]):Le(this,t=>0===e?0:t/e*100)};const Re=function(){const e=new Map,t=new Map,o=(t,o)=>{const s=e.get(o);if(!s)throw n.error("Store",`Store.${t}('${o}') : store not found. Did you call Store.create('${o}') first?`),new r(`Store.${t}('${o}') : store not found.`);return s},s=(e,t={})=>Array.isArray(e)?h.array(e,t):"object"==typeof e?h.object(e,t):h(e,t);return new Proxy({create(t,o){if(e.has(t))throw n.warn("Store",`Store.create('${t}') : a store with this name already exists. Use Store.get('${t}') to retrieve it.`),new r(`Store.create('${t}') : a store with this name already exists.`);const i=s(o);return e.set(t,{observer:i,subscribers:new Set,resettable:!1,composed:!1}),i},createResettable(t,o){if(e.has(t))throw n.warn("Store",`Store.createResettable('${t}') : a store with this name already exists.`),new r(`Store.createResettable('${t}') : a store with this name already exists.`);const i=s(o,{reset:!0});return e.set(t,{observer:i,subscribers:new Set,resettable:!0,composed:!1}),i},createComposed(t,o,s){if(e.has(t))throw n.warn("Store",`Store.createComposed('${t}') : a store with this name already exists.`),new r(`Store.createComposed('${t}') : a store with this name already exists.`);if("function"!=typeof o)throw new r(`Store.createComposed('${t}') : computation must be a function.`);if(!Array.isArray(s)||0===s.length)throw new r(`Store.createComposed('${t}') : dependencies must be a non-empty array of store names.`);const i=s.map(o=>{if("string"!=typeof o)return o;const s=e.get(o);if(!s)throw n.error("Store",`Store.createComposed('${t}') : dependency '${o}' not found. Create it first.`),new r(`Store.createComposed('${t}') : dependency store '${o}' not found.`);return s.observer}),a=h.computed(o,i);return e.set(t,{observer:a,subscribers:new Set,resettable:!1,composed:!0}),a},has:t=>e.has(t),reset(e){const t=o("reset",e);if(t.composed)throw n.error("Store",`Store.reset('${e}') : composed stores cannot be reset. Their value is derived from dependencies.`),new r(`Store.reset('${e}') : composed stores cannot be reset.`);if(!t.resettable)throw n.error("Store",`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`),new r(`Store.reset('${e}') : this store is not resettable. Use Store.createResettable('${e}', value) instead of Store.create().`);t.observer.reset()},use(e){const t=o("use",e);if(t.composed)throw n.error("Store",`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`),new r(`Store.use('${e}') : composed stores are read-only. Use Store.follow('${e}') instead.`);const{observer:i,subscribers:a}=t,l=s(i.val()),u=e=>l.set(e),c=e=>i.set(e);return i.subscribe(u),l.subscribe(c),l.destroy=()=>{i.unsubscribe(u),l.unsubscribe(c),a.delete(l),l.cleanup()},l.dispose=l.destroy,a.add(l),l},follow(e){const{observer:t,subscribers:i}=o("follow",e),a=s(t.val()),l=e=>a.set(e);return t.subscribe(l),((e,t,o)=>{const s=e=>()=>{throw n.error("Store",`Store.${o}('${t}') is read-only. '${e}()' is not allowed.`),new r(`Store.${o}('${t}') is read-only.`)};e.set=s("set"),e.toggle=s("toggle"),e.reset=s("reset")})(a,e,"follow"),a.destroy=()=>{t.unsubscribe(l),i.delete(a),a.cleanup()},a.dispose=a.destroy,i.add(a),a},get(t){const r=e.get(t);return r?r.observer:(n.warn("Store",`Store.get('${t}') : store not found.`),null)},getWithSubscribers:t=>e.get(t)??null,delete(t){const r=e.get(t);r?(r.subscribers.forEach(e=>e.destroy()),r.subscribers.clear(),r.observer.cleanup(),e.delete(t)):n.warn("Store",`Store.delete('${t}') : store not found, nothing to delete.`)},group(e,t){"function"==typeof e&&(t=e,e="anonymous");const n=Re();return t&&t(n),n},createPersistent(e,t,n){n=n||e;const r=this.create(e,b(n,t)),o=y(t);return r.subscribe(e=>o(n,e)),r},createPersistentResettable(e,t,n){n=n||e;const r=this.createResettable(e,b(n,t)),o=y(t);r.subscribe(e=>o(n,e));const s=r.reset.bind(r);return r.reset=()=>{m.remove(n),s()},r}},{get(e,n){if("symbol"==typeof n||n.startsWith("$")||n in e)return e[n];if(e.has(n)){if(t.has(n))return t.get(n);const r=e.follow(n);return t.set(n,r),r}},set(e,t,o){throw n.error("Store",`Forbidden: You cannot overwrite the store key '${String(t)}'. Use .use('${String(t)}').set(value) instead.`),new r("Store structure is immutable. Use .set() on the observable.")},deleteProperty(e,t){throw new r("Store keys cannot be deleted.")}})},je=Re();je.create("locale",navigator.language.split("-")[0]||"en");const Ve=e=>e;const Be=new Set(["clear","push","unshift","replace"]),We=e=>e;const qe=function(e,t,{comment:r=null,shouldKeepInCache:o=!0}={}){if(!B.isObservable(e))return"boolean"==typeof e?e?M.getChild(t):null:n.warn("ShowIf","ShowIf : condition must be an Observable or boolean / "+r,e);const s=k("Show if : "+(r||""));let i=null;const a=()=>(i&&o||(i=M.getChild(t),B.isFragment(i)&&(i=Array.from(i.childNodes))),i);return e.val()&&s.appendChild(a()),e.subscribe(e=>{e?s.appendChild(a()):s.remove()}),s},Ue=function(e,t,n=!0){if(!B.isObservable(e))throw new r("Toggle : condition must be an Observable");const o=k("Match"),s=new Map,i=function(e){if(n&&s.has(e))return s.get(e);let r=t[e];return r?(r=M.getChild(r),B.isFragment(r)&&(r=Array.from(r.children)),n&&s.set(e,r),r):null},a=e.val(),l=i(a);return l&&o.appendChild(l),e.subscribe(e=>{const t=i(e);o.remove(),t&&o.appendChild(t)}),o.nd.with({add(n,r,o=!1){t[n]=r,o&&e.set(n)},remove(r){n&&s.delete(r),e.set([...s.keys()].at(-1)??""),delete t[r]}})},He=function(e,t,n){if(!B.isObservable(e))throw new r("Toggle : condition must be an Observable");return Ue(e.toBoolean(),{true:t,false:n})},ze=Q("div"),Ge=Q("span"),Ke=Q("label"),Je=Q("p"),Ye=Je,Qe=Q("strong"),Xe=Q("h1"),Ze=Q("h2"),et=Q("h3"),tt=Q("h4"),nt=Q("h5"),rt=Q("h6"),ot=Q("br"),st=Q("a"),it=Q("pre"),at=Q("code"),lt=Q("blockquote"),ut=Q("hr"),ct=Q("em"),pt=Q("small"),ht=Q("mark"),dt=Q("del"),ft=Q("ins"),mt=Q("sub"),bt=Q("sup"),yt=Q("abbr"),gt=Q("cite"),vt=Q("q"),wt=Q("dl"),$t=Q("dt"),St=Q("dd"),Ct=Q("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}),Ot=Q("input"),At=Q("textarea"),Et=At,_t=Q("select"),Nt=Q("fieldset"),xt=Q("option"),Ft=Q("legend"),Dt=Q("datalist"),Mt=Q("output"),Tt=Q("progress"),kt=Q("meter"),It=Q("button"),Pt=Q("main"),Lt=Q("section"),Rt=Q("article"),jt=Q("aside"),Vt=Q("nav"),Bt=Q("figure"),Wt=Q("figcaption"),qt=Q("header"),Ut=Q("footer"),Ht=Q("img"),zt=function(e,t){return Ht({src:e,...t})},Gt=Q("details"),Kt=Q("summary"),Jt=Q("dialog"),Yt=Q("menu"),Qt=Q("ol"),Xt=Q("ul"),Zt=Q("li"),en=Zt,tn=Qt,nn=Xt,rn=Q("audio"),on=Q("video"),sn=Q("source"),an=Q("track"),ln=Q("canvas"),un=Q("svg"),cn=Q("time"),pn=Q("data"),hn=Q("address"),dn=Q("kbd"),fn=Q("samp"),mn=Q("var"),bn=Q("wbr"),yn=Q("caption"),gn=Q("table"),vn=Q("thead"),wn=Q("tfoot"),$n=Q("tbody"),Sn=Q("tr"),Cn=Sn,On=Q("th"),An=On,En=On,_n=Q("td"),Nn=_n;function xn(e){let t=null,n=(r,o)=>(t=document.createElementNS("http://www.w3.org/2000/svg",e),n=(e,n)=>Y(t.cloneNode(),e,n),Y(t.cloneNode(),r,o));return(e,t)=>n(e,t)}const Fn=xn("svg"),Dn=xn("circle"),Mn=xn("rect"),Tn=xn("ellipse"),kn=xn("line"),In=xn("polyline"),Pn=xn("polygon"),Ln=xn("path"),Rn=xn("text"),jn=xn("tspan"),Vn=xn("textPath"),Bn=xn("g"),Wn=xn("defs"),qn=xn("use"),Un=xn("symbol"),Hn=xn("clipPath"),zn=xn("mask"),Gn=xn("marker"),Kn=xn("pattern"),Jn=xn("image"),Yn=xn("foreignObject"),Qn=xn("switch"),Xn=xn("linearGradient"),Zn=xn("radialGradient"),er=xn("stop"),tr=xn("filter"),nr=xn("feBlend"),rr=xn("feColorMatrix"),or=xn("feComposite"),sr=xn("feFlood"),ir=xn("feGaussianBlur"),ar=xn("feMerge"),lr=xn("feMergeNode"),ur=xn("feOffset"),cr=xn("feTurbulence"),pr=xn("feDisplacementMap"),hr=xn("feDiffuseLighting"),dr=xn("feSpecularLighting"),fr=xn("feDistantLight"),mr=xn("fePointLight"),br=xn("feSpotLight"),yr=xn("feMorphology"),gr=xn("feConvolveMatrix"),vr=xn("feComponentTransfer"),wr=xn("feFuncR"),$r=xn("feFuncG"),Sr=xn("feFuncB"),Cr=xn("feFuncA"),Or=xn("animate"),Ar=xn("animateTransform"),Er=xn("animateMotion"),_r=xn("mpath"),Nr=xn("set"),xr=xn("desc"),Fr=xn("title"),Dr=xn("metadata"),Mr=xn("view"),Tr=xn("style"),kr=xn("script"),Ir=Q("");var Pr=Object.freeze({__proto__:null,Abbr:yt,Address:hn,Anchor:k,Article:Rt,Aside:jt,AsyncImg:function(e,t,n,o){const s=B.isObservable(e)?e.val():e,i=zt(t||s,n),a=new Image;return a.onload=()=>{B.isFunction(o)&&o(null,i),i.src=B.isObservable(e)?e.val():e},a.onerror=()=>{B.isFunction(o)&&o(new r("Image not found"))},B.isObservable(e)&&e.subscribe(e=>{a.src=e}),a.src=s,i},Audio:rn,BaseImage:Ht,Blockquote:lt,Br:ot,Button:It,Canvas:ln,Caption:yn,Checkbox:e=>Ot({type:"checkbox",...e}),Cite:gt,Code:at,ColorInput:e=>Ot({type:"color",...e}),Data:pn,Datalist:Dt,DateInput:e=>Ot({type:"date",...e}),DateTimeInput:e=>Ot({type:"datetime-local",...e}),Dd:St,Del:dt,Details:Gt,Dialog:Jt,Div:ze,Dl:wt,Dt:$t,Em:ct,EmailInput:e=>Ot({type:"email",...e}),FieldSet:Nt,FigCaption:Wt,Figure:Bt,FileInput:e=>Ot({type:"file",...e}),Footer:Ut,ForEach:function(e,t,o,{shouldKeepItemsInCache:s=!1}={}){t=t||Ve;const i=k("ForEach"),a=i.endElement();i.startElement();let l=new Map,u=null;const c=new Set,p=e=>{if(!s)for(const[t,n]of l.entries()){if(c.has(t))continue;const r=n.child?.deref();e&&r&&r.remove(),n.indexObserver?.cleanup(),n.child=null,n.indexObserver=null,l.delete(n.keyId),u&&u.delete(n.keyId)}},d=(e,s)=>{const i=((e,t,n)=>{if(B.isString(n)){const r=B.isObservable(e)?e.val():e,o=r?.[n];return B.isObservable(o)?o.val():o??t}return B.isFunction(n)?n(e,t):(B.isObservable(e)?e.val():e)??t})(e,s,o);if(l.has(i)){const e=l.get(i);if(e.indexObserver?.set(s),e.isNew=!1,e.child?.deref())return i;l.delete(i)}try{const n=t.length>=2?h(s):null;let o=M.getChild(t(e,n));if(!o)throw new r("ForEach child can't be null or undefined!");l.set(i,{keyId:i,isNew:!0,child:new WeakRef(o),indexObserver:n})}catch(e){throw n.error("ForEach",`Error creating element for key ${i}`,e),e}return i},f=()=>{const t=a.parentNode;if(!t)return;const n=B.isObservable(e)?e.val():e;if(c.clear(),Array.isArray(n))for(let e=0,t=n.length;e<t;e++){const t=d(n[e],e);c.add(t)}else for(const e in n){const t=d(n[e],e);c.add(t)}if(0===c.size)return i.removeChildren(),p(),void u?.clear();p(t),u&&0!==u.size?(()=>{let e=document.createDocumentFragment();const t=Array.from(c);Array.from(u);for(const n in t){const r=t[n],o=l.get(r);if(!o)continue;const s=o.child.deref();s&&e.appendChild(s)}i.replaceContent(e)})():(e=>{const t=document.createDocumentFragment();for(const e of c){const n=l.get(e);if(!n)continue;const r=n.child?.deref();r&&t.appendChild(r)}e.insertBefore(t,a)})(t),u?.clear(),u=new Set([...c])};return f(),B.isObservable(e)&&e.subscribe(f),i},ForEachArray:function(e,t,n={}){t=t||We;const r=k("ForEach Array",n.isParentUniqueChild),o=r.endElement();let s=new Map,i=0;const a=t.length>=2,l=e=>{r.removeChildren(),f(e),i=0},u=e=>s.get(e)?.child,c=(e,t=!0)=>{const n=s.get(e);if(n){if(t){const t=n.child;t?.remove(),s.delete(e)}n.indexObserver?.cleanup()}},p=e=>{const n=M.getChild(t(e,null));return s.set(e,{child:n,indexObserver:null}),n};let h=(n,r)=>{const o=e.transform(e=>e.indexOf(n)),i=M.getChild(t(n,o));return s.set(n,{child:i,indexObserver:o}),i};e.__$Observable||(h=(e,n)=>{const r=M.getChild(t(e,n));return s.set(e,{child:r,indexObserver:null}),r});const d=(e,t)=>{const n=s.get(e);return n?(n.indexObserver?.set(t),n.child):p(e)};let f,m=p;f=a?n.shouldKeepItemsInCache?()=>{}:e=>{for(const[t,n]of s.entries())e&&e.includes(t)||c(t,!1)}:s.clear.bind(s);const b=(e,t)=>{const n=s.get(e);if(!n)return null;const r=n.child;if(!r)return null;t?t.appendChild(r):r.remove()};let y=null;y=Array.isArray(e)?()=>{l(e),r.appendChildRaw(g.toFragment(e))}:()=>{const t=e.val();l(t),r.appendChildRaw(g.toFragment(t))};const g={toFragment:e=>{const t=document.createDocumentFragment();for(let n=0,r=e.length;n<r;n++)t.appendChild(m(e[n],i)),i++;return t},add:e=>{r.appendChildRaw(g.toFragment(e))},replace:e=>{l(e),r.appendChildRaw(g.toFragment(e))},set:y,reOrder:e=>{let t=null;const n=document.createDocumentFragment();for(const r of e)t=u(r),t&&n.appendChild(t);t=null,r.appendElementRaw(n)},removeOne:(e,t)=>{c(e,!0)},clear:l,populate:([e,t,n])=>{const o=document.createDocumentFragment();for(let r=0;r<t;r++){const t=n(r);e.push(t),o.append(m(t,r)),i++}r.appendChildRaw(o),o.replaceChildren()},unshift:e=>{r.insertAtStartRaw(g.toFragment(e))},splice:(t,n)=>{const[s,i,...a]=t;let l=null;const c=document.createDocumentFragment();if(n.length>0){let e=n[0];if(1===n.length)b(e,c);else if(n.length>1){const e=u(n[0]);l=e?.previousSibling;for(let e=0;e<n.length;e++)b(n[e],c)}}else{const t=s-1>=0?s-1:s,n=e.at(t);l=u(n)||o.previousSibling}c.replaceChildren(),a&&a.length&&l&&r.insertBeforeRaw(g.toFragment(a),l.nextSibling)},reverse:(e,t)=>{g.reOrder(t)},sort:(e,t)=>{g.reOrder(t)},remove:(e,t)=>{g.removeOne(t)},pop:(e,t)=>{g.removeOne(t)},shift:(e,t)=>{g.removeOne(t)},swap:(e,t)=>{const n=r.getParent();let o=u(t[0]),s=u(t[1]);if(!o||!s)return;const i=s.nextSibling;n.insertBefore(s,o),n.insertBefore(o,i),o=null,s=null}};g.merge=g.add,g.push=g.add;const v=(e,t,n={})=>{((e=null)=>{m=Be.has(e)?a?h:p:s.size?d:a?h:p})(n.action),g[n.action]&&g[n.action](n.args,n.result)};return Array.isArray(e)?(v(0,0,{action:"set"}),r):(e.val().length&&v(e.val(),0,{action:"set"}),e.subscribe(v),r)},Form:Ct,Fragment:Ir,H1:Xe,H2:Ze,H3:et,H4:tt,H5:nt,H6:rt,Header:qt,HiddenInput:e=>Ot({type:"hidden",...e}),HideIf:function(e,t,n){const r=h(!e.val());return e.subscribe(e=>r.set(!e)),qe(r,t,n)},HideIfNot:function(e,t,n){return qe(e,t,n)},Hr:ut,Img:zt,Input:Ot,Ins:ft,Kbd:dn,Label:Ke,LazyImg:function(e,t){return zt(e,{...t,loading:"lazy"})},Legend:Ft,Li:en,Link:st,ListItem:Zt,Main:Pt,Mark:ht,Match:Ue,Menu:Yt,Meter:kt,MonthInput:e=>Ot({type:"month",...e}),NativeDocumentFragment:k,Nav:Vt,NumberInput:e=>Ot({type:"number",...e}),Ol:tn,Option:xt,OrderedList:Qt,Output:Mt,P:Je,Paragraph:Ye,PasswordInput:e=>Ot({type:"password",...e}),Pre:it,Progress:Tt,Quote:vt,Radio:e=>Ot({type:"radio",...e}),RangeInput:e=>Ot({type:"range",...e}),ReadonlyInput:e=>Ot({readonly:!0,...e}),Samp:fn,SearchInput:e=>Ot({type:"search",...e}),Section:Lt,Select:_t,ShowIf:qe,ShowWhen:function(){if(2===arguments.length){const[e,t]=arguments;if(!B.isObservableWhenResult(e))throw new r("showWhen observer must be an ObservableWhenResult",{data:e,help:"Use observer.when(target) to create an ObservableWhenResult"});return qe(e,t)}if(3===arguments.length){const[e,t,n]=arguments;if(!B.isObservable(e))throw new r("showWhen observer must be an Observable",{data:e});return qe(e.when(t),n)}throw new r("showWhen must have 2 or 3 arguments",{data:["showWhen(observer, target, view)","showWhen(observerWhenResult, view)"]})},SimpleButton:(e,t)=>It(e,{type:"button",...t}),Small:pt,Source:sn,Span:Ge,Strong:Qe,Sub:mt,SubmitButton:(e,t)=>It(e,{type:"submit",...t}),Summary:Kt,Sup:bt,Svg:un,SvgAnimate:Or,SvgAnimateMotion:Er,SvgAnimateTransform:Ar,SvgCircle:Dn,SvgClipPath:Hn,SvgDefs:Wn,SvgDesc:xr,SvgEllipse:Tn,SvgFEBlend:nr,SvgFEColorMatrix:rr,SvgFEComponentTransfer:vr,SvgFEComposite:or,SvgFEConvolveMatrix:gr,SvgFEDiffuseLighting:hr,SvgFEDisplacementMap:pr,SvgFEDistantLight:fr,SvgFEFlood:sr,SvgFEFuncA:Cr,SvgFEFuncB:Sr,SvgFEFuncG:$r,SvgFEFuncR:wr,SvgFEGaussianBlur:ir,SvgFEMerge:ar,SvgFEMergeNode:lr,SvgFEMorphology:yr,SvgFEOffset:ur,SvgFEPointLight:mr,SvgFESpecularLighting:dr,SvgFESpotLight:br,SvgFETurbulence:cr,SvgFilter:tr,SvgForeignObject:Yn,SvgG:Bn,SvgImage:Jn,SvgLine:kn,SvgLinearGradient:Xn,SvgMPath:_r,SvgMarker:Gn,SvgMask:zn,SvgMetadata:Dr,SvgPath:Ln,SvgPattern:Kn,SvgPolygon:Pn,SvgPolyline:In,SvgRadialGradient:Zn,SvgRect:Mn,SvgScript:kr,SvgSet:Nr,SvgStop:er,SvgStyle:Tr,SvgSvg:Fn,SvgSwitch:Qn,SvgSymbol:Un,SvgTSpan:jn,SvgText:Rn,SvgTextPath:Vn,SvgTitle:Fr,SvgUse:qn,SvgView:Mr,Switch:He,TBody:$n,TBodyCell:Nn,TFoot:wn,TFootCell:En,THead:vn,THeadCell:An,TRow:Cn,Table:gn,Td:_n,TelInput:e=>Ot({type:"tel",...e}),TextArea:At,TextInput:Et,Th:On,Time:cn,TimeInput:e=>Ot({type:"time",...e}),Tr:Sn,Track:an,Ul:nn,UnorderedList:Xt,UrlInput:e=>Ot({type:"url",...e}),Var:mn,Video:on,Wbr:bn,WeekInput:e=>Ot({type:"week",...e}),When:function(e){if(!B.isObservable(e))throw new r("When : condition must be an Observable");let t=null,n=null;return{show(e){return t=e,this},otherwise:r=>(n=r,He(e,t,n)),toNdElement:()=>He(e,t,n)}},createPortal:function(e,{parent:t,name:n="unnamed"}={}){const r=k("Portal "+n);return r.appendChild(M.getChild(e)),(t||document.body).appendChild(r),r}});const Lr={};function Rr(e,t,n={}){e="/"+a(e,"/").replace(/\/+/,"/");let r=null,o=n.name||null;const s=n.middlewares||[],i=n.shouldRebuild||!1,l=n.with||{},u=n.layout||null,c={},p=[],h=e=>{if(!e)return null;const[t,n]=e.split(":");let r=l[t];return!r&&n&&(r=Lr[n]),r||(r="[^/]+"),r=r.replace("(","(?:"),{name:t,pattern:`(${r})`}},d=()=>{if(r)return r;const t=e.replace(/\{(.*?)}/gi,(e,t)=>{const n=h(t);return n&&n.pattern?(c[n.name]=n.pattern,p.push(n.name),n.pattern):e});return r=new RegExp("^"+t+"$"),r};this.name=()=>o,this.component=()=>t,this.middlewares=()=>s,this.shouldRebuild=()=>i,this.path=()=>e,this.layout=()=>u,this.match=function(e){e="/"+a(e,"/");if(!d().exec(e))return!1;const t={};return d().exec(e).forEach((e,n)=>{if(n<1)return;const r=p[n-1];t[r]=e}),t},this.url=function(t){const n=e.replace(/\{(.*?)}/gi,(e,n)=>{const r=h(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 jr extends Error{constructor(e,t){super(e),this.context=t}}const Vr=(e,t)=>{const n=[];return e.forEach(e=>{n.push(a(e.suffix,"/"))}),n.push(a(t,"/")),n.join("/")},Br=(e,t)=>{const n=[];return e.forEach(e=>{e.options.middlewares&&n.push(...e.options.middlewares)}),t&&n.push(...t),n},Wr=(e,t)=>{const n=[];return e.forEach(e=>{e.options?.name&&n.push(e.options.name)}),t&&n.push(t),n.join(".")},qr=e=>{for(let t=e.length-1;t>=0;t--)if(e[t]?.options?.layout)return e[t].options.layout;return null};function Ur(){const e=[];let t=0;const n=n=>{const o=t+n;if(!e[o])return;t=o;const{route:s,params:i,query:a,path:l}=e[o];r(l)},r=e=>{window.location.replace(`${window.location.pathname}${window.location.search}#${e}`)},o=()=>window.location.hash.slice(1);this.push=function(n){const{route:s,params:i,query:a,path:l}=this.resolve(n);l!==o()&&(e.splice(t+1),e.push({route:s,params:i,query:a,path:l}),t++,r(l))},this.replace=function(n){const{route:r,params:s,query:i,path:a}=this.resolve(n);a!==o()&&(e[t]={route:r,params:s,query:i,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:s,query:i,path:a}=this.resolve(n||o());e.push({route:r,params:s,query:i,path:a}),t=0,this.handleRouteChange(r,s,i,a)}}function Hr(){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:s}=this.resolve(t);if(!n)return;this.handleRouteChange(n,r,o,s)}catch(e){n.error("HistoryRouter","Error in popstate event",e)}});const{route:t,params:r,query:o,path:s}=this.resolve(e||window.location.pathname+window.location.search);this.handleRouteChange(t,r,o,s)}}function zr(){const e=[];let t=0;const n=n=>{const r=t+n;if(!e[r])return;t=r;const{route:o,params:s,query:i,path:a}=e[r];this.handleRouteChange(o,s,i,a)};this.push=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]&&e[t].path===i||(e.splice(t+1),e.push({route:r,params:o,query:s,path:i}),t++,this.handleRouteChange(r,o,s,i))},this.replace=function(n){const{route:r,params:o,query:s,path:i}=this.resolve(n);e[t]={route:r,params:o,query:s,path:i},this.handleRouteChange(r,o,s,i)},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:s,query:i,path:a}=this.resolve(r);e.push({route:o,params:s,query:i,path:a}),t=0,this.handleRouteChange(o,s,i,a)}}function Gr(e,t){const n=new Map,r=new WeakMap,o=new WeakMap;let s=null,i=null;const a=(e,t)=>{const n=o.get(e);if(n)return n;let r=e;return B.isAnchor(e)||(r=k(t),r.appendChild(e)),o.set(e,r),r},l=()=>{B.isAnchor(i)&&i.remove()},u=()=>{t.nodeValue="",l(),s&&s.remove()},c=e=>{let t=e;return B.isNDElement(e)&&(t=e.node()),t},p=function(e,n,o){const p=n.layout();if(p)return void((e,n,o,p)=>{let h=c(n);const d=r.get(h);if(d){if(d===s){const e=a(h,p);return l(),i=h,void e.replaceContent(h)}return u(),i=h,s=d,a(h,p).replaceContent(h),void t.appendChild(s)}u(),i=h;const f=a(h,p);s=M.getChild(e(f)),r.set(h,s),t.appendChild(s)})(p,e,0,o);let h=c(e);u(),t.appendChild(h),i=e},h=function(e){if(!e.route)return;const{route:t,params:r,query:o,path:s}=e;if(n.has(s)){const e=n.get(s);return void p(e,t)}const i=t.component()({params:r,query:o});n.set(s,i),p(i,t,s)};return e.subscribe(h),h(e.currentState()),t}const Kr="default";function Jr(e={}){const t=[],r={},o=[],s=[],i={route:null,params:null,query:null,path:null,hash:null};if("hash"===e.mode)Ur.apply(this,[]);else if("history"===e.mode)Hr.apply(this,[]);else{if("memory"!==e.mode)throw new jr("Invalid router mode "+e.mode);zr.apply(this,[])}const l=function(e,t){for(const r of s)try{r(e),t&&t(e)}catch(e){n.warn("Route Listener","Error in listener:",e)}};this.routes=()=>[...t],this.currentState=()=>({...i}),this.add=function(e,n,s){const i=new Rr(Vr(o,e),n,{...s,middlewares:Br(o,s?.middlewares||[]),name:s?.name?Wr(o,s.name):null,layout:s?.layout||qr(o)});return t.push(i),i.name()&&(r[i.name()]=i),this},this.group=function(e,t,n){if(!B.isFunction(n))throw new jr("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 jr(`Route not found for name: ${e}`);return o.url({params:t,query:n})},this.resolve=function(e){if("string"==typeof e){const t=r[e];if(t)return{route:t,params:[],query:[],path:t.url({name:e})}}if(B.isJson(e)){const t=r[e.name];if(!t)throw new jr(`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("?"),s="/"+a(n,"/");let i,l=null;for(const e of t)if(i=e.match(s),i){l=e;break}if(!l)throw new jr(`Route not found for url: ${n}`);const u={};if(o){const e=new URLSearchParams(o).entries();for(const[t,n]of e)u[t]=n}return{route:l,params:i,query:u,path:e}},this.subscribe=function(e){if(!B.isFunction(e))throw new jr("Listener must be a function");return s.push(e),()=>{s.splice(s.indexOf(e),1)}},this.handleRouteChange=function(e,t,n,r){i.route=e,i.params=t,i.query=n,i.path=r;const o=[...e.middlewares(),l];let s=0;const a={...i},u=e=>{if(s++,!(s>=o.length))return o[s](e||a,u)};return o[s](a,u)}}function Yr(e,t){const{to:n,href:r,...o}=e;if(r){const e=Jr.get();return st({...o,href:r},t).nd.onPreventClick(()=>{e.push(r)})}const s="string"==typeof n?{name:n}:n,i=s.router||Kr,a=Jr.get(i);if(!a)throw new jr('Router not found "'+i+'" for link "'+s.name+'"');const l=a.generateUrl(s.name,s.params,s.query);return st({...o,href:l},t).nd.onPreventClick(()=>{a.push(l)})}Jr.routers={},Jr.create=function(e,t){if(!B.isFunction(t))throw n.error("Router","Callback must be a function"),new jr("Callback must be a function");const r=new Jr(e);return Jr.routers[e.name||Kr]=r,t(r),r.init(e.entry),r.mount=function(e){if(B.isString(e)){const t=document.querySelector(e);if(!t)throw new jr(`Container not found for selector: ${e}`);e=t}else if(!B.isElement(e))throw new jr("Container must be a string or an Element");return Gr(r,e)},r},Jr.get=function(e){const t=Jr.routers[e||Kr];if(!t)throw new jr(`Router not found for name: ${e}`);return t},Jr.push=function(e,t=null){return Jr.get(t).push(e)},Jr.replace=function(e,t=null){return Jr.get(t).replace(e)},Jr.forward=function(e=null){return Jr.get(e).forward()},Jr.back=function(e=null){return Jr.get(e).back()},Jr.redirectTo=function(e,t=null,n=null){let r=e;const o=Jr.get(n);return o.resolve({name:e,params:t})&&(r={name:e,params:t}),o.push(r)},Yr.blank=function(e,t){return st({...e,target:"_blank"},t)};var Qr=Object.freeze({__proto__:null,Link:Yr,RouteParamPatterns:Lr,Router:Jr});var Xr=Object.freeze({__proto__:null,memoize:e=>ae(e),once:e=>ie(e),singleton:e=>se(e)}),Zr=Object.freeze({__proto__:null,Cache:Xr,NativeFetch:function(e){const t={request:[],response:[]};this.interceptors={response:e=>{t.response.push(e)},request:e=>{t.request.push(e)}},this.fetch=async function(n,r,o={},s={}){if(s.formData){const e=new FormData;for(const t in o)e.append(t,o[t]);o=e}r.startsWith("http")||(r=(e.endsWith("/")?e:e+"/")+r);let i={method:n,headers:{...s.headers||{}}};if(o)if(o instanceof FormData)i.body=o;else if("GET"!==n)i.headers["Content-Type"]="application/json",i.body=JSON.stringify(o);else{const e=new URLSearchParams(o).toString();e&&(r=r+(r.includes("?")?"&":"?")+e)}for(const e of t.request)i=await e(i,r)||i;let a=await fetch(r,i);for(const e of t.response)a=await e(a,r)||a;const l=(a.headers.get("content-type")||"").includes("application/json")?await a.json():await a.text();if(!a.ok){const e=new Error(l?.message||a.statusText);throw e.status=a.status,e.data=l,e}return l},this.post=function(e,t={},n={}){return this.fetch("POST",e,t,n)},this.put=function(e,t={},n={}){return this.fetch("PUT",e,t,n)},this.delete=function(e,t={},n={}){return this.fetch("DELETE",e,t,n)},this.get=function(e,t={},n={}){return this.fetch("GET",e,t,n)}},classPropertyAccumulator:oe,cssPropertyAccumulator:re,filters:Me});return e.$=d,e.ElementCreator=M,e.HtmlElementWrapper=Q,e.NDElement=I,e.Observable=h,e.PluginsManager=null,e.SingletonView=ne,e.Store=je,e.StoreFactory=Re,e.TemplateCloner=ee,e.Validator=B,e.autoMemoize=ae,e.autoOnce=ie,e.classPropertyAccumulator=oe,e.createTextNode=J,e.cssPropertyAccumulator=re,e.elements=Pr,e.memoize=e=>{const t=new Map;return(...n)=>{const[r,...o]=n,s=t.get(r);if(s)return s;const i=e(...o);return t.set(r,i),i}},e.normalizeComponentArgs=K,e.obs=f,e.once=se,e.router=Qr,e.useCache=function(e){let t=null,n=r=>{t=new ee(e);const o=t.clone(r);return n=t.clone,o};return e.length<2?(...e)=>n(e):(e,t,...r)=>n([e,t,...r])},e.useSingleton=function(e){let t=null;return function(...n){return t||(t=new ne(e)),t.render(n)}},e.utils=Zr,e.withValidation=G,e}({});
|
package/index.js
CHANGED
|
@@ -16,6 +16,7 @@ export * from './src/core/data/observable-helpers/array';
|
|
|
16
16
|
export * from './src/core/data/observable-helpers/batch';
|
|
17
17
|
export * from './src/core/data/observable-helpers/object';
|
|
18
18
|
export * from './src/core/data/observable-helpers/computed';
|
|
19
|
+
export * from './src/core/data/observable-helpers/observable.is-to';
|
|
19
20
|
export * from './src/core/data/Store';
|
|
20
21
|
|
|
21
22
|
import * as elements from './elements';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.140",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -20,9 +20,12 @@
|
|
|
20
20
|
"eslint": "^9.33.0",
|
|
21
21
|
"eslint-plugin-jsdoc": "^62.5.4",
|
|
22
22
|
"magic-string": "^0.30.21",
|
|
23
|
-
"
|
|
23
|
+
"postcss": "^8.5.12",
|
|
24
|
+
"rollup": "^4.53.3",
|
|
25
|
+
"rollup-plugin-postcss": "^4.0.2"
|
|
24
26
|
},
|
|
25
27
|
"dependencies": {
|
|
28
|
+
"@floating-ui/dom": "^1.7.6",
|
|
26
29
|
"i18next": "^25.8.0"
|
|
27
30
|
}
|
|
28
31
|
}
|
package/rollup.config.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import terser from '@rollup/plugin-terser';
|
|
2
2
|
import replace from '@rollup/plugin-replace';
|
|
3
|
-
import
|
|
4
|
-
import { fileURLToPath } from 'node:url'
|
|
3
|
+
import postcss from 'rollup-plugin-postcss';
|
|
5
4
|
|
|
6
5
|
const PreventProd = replace({
|
|
7
6
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
@@ -69,6 +68,10 @@ export default [
|
|
|
69
68
|
},
|
|
70
69
|
plugins: [
|
|
71
70
|
PreventProd,
|
|
71
|
+
postcss({
|
|
72
|
+
extract: true,
|
|
73
|
+
minimize: true,
|
|
74
|
+
}),
|
|
72
75
|
// terser()
|
|
73
76
|
]
|
|
74
77
|
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import './has-draggable.css';
|
|
3
|
+
|
|
4
|
+
export default function HasDraggable() {}
|
|
5
|
+
|
|
6
|
+
HasDraggable.prototype.move = function(x, y) {
|
|
7
|
+
if(!this.$movableElement) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
this.$movableElement.style.left = x + 'px';
|
|
12
|
+
this.$movableElement.style.top = y + 'px';
|
|
13
|
+
this.$movableElement.style.margin = '0';
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
HasDraggable.prototype.makeDraggable = function(parent, grip = null) {
|
|
17
|
+
if(!this.emit) {
|
|
18
|
+
throw new Error('HasDraggable requires HasEventEmitter - add it via BaseComponent.use(Component, HasEventEmitter, HasDraggable).');
|
|
19
|
+
}
|
|
20
|
+
this.$movableElement = parent;
|
|
21
|
+
|
|
22
|
+
const gripElement = grip || parent;
|
|
23
|
+
gripElement.classList.add('is-draggable');
|
|
24
|
+
|
|
25
|
+
let isDragging = false;
|
|
26
|
+
let startX = 0;
|
|
27
|
+
let startY = 0;
|
|
28
|
+
let initialX = 0;
|
|
29
|
+
let initialY = 0;
|
|
30
|
+
|
|
31
|
+
const onMouseDown = (e) => {
|
|
32
|
+
isDragging = true;
|
|
33
|
+
startX = e.clientX;
|
|
34
|
+
startY = e.clientY;
|
|
35
|
+
initialX = parent.offsetLeft;
|
|
36
|
+
initialY = parent.offsetTop;
|
|
37
|
+
this.emit('onDragStart', [e, initialX, initialY]);
|
|
38
|
+
|
|
39
|
+
gripElement.classList.add('is-dragging');
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const onMouseMove = (e) => {
|
|
43
|
+
if(!isDragging) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const x = initialX + (e.clientX - startX);
|
|
48
|
+
const y = initialY + (e.clientY - startY);
|
|
49
|
+
|
|
50
|
+
this.move(x, y);
|
|
51
|
+
this.emit('onDrag', [e, x, y]);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const onMouseUp = () => {
|
|
55
|
+
isDragging = false;
|
|
56
|
+
this.emit('onDragEnd');
|
|
57
|
+
gripElement.classList.remove('is-dragging');
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
gripElement.addEventListener('mousedown', onMouseDown);
|
|
61
|
+
document.addEventListener('mousemove', onMouseMove);
|
|
62
|
+
document.addEventListener('mouseup', onMouseUp);
|
|
63
|
+
|
|
64
|
+
return () => {
|
|
65
|
+
gripElement.removeEventListener('mousedown', onMouseDown);
|
|
66
|
+
document.removeEventListener('mousemove', onMouseMove);
|
|
67
|
+
document.removeEventListener('mouseup', onMouseUp);
|
|
68
|
+
};
|
|
69
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {$} from "
|
|
1
|
+
import {$} from "../../../../index";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Mixin for managing a collection of items with manipulation methods
|
|
@@ -18,6 +18,7 @@ HasItems.prototype.dynamic = function(observableArray = null) {
|
|
|
18
18
|
this.$description.items = observableArray || $.array([]);
|
|
19
19
|
return this;
|
|
20
20
|
};
|
|
21
|
+
HasItems.prototype.bind = HasItems.prototype.dynamic;
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* Replaces all existing items with a new array of items
|
|
@@ -61,13 +62,3 @@ HasItems.prototype.removeItem = function(item) {
|
|
|
61
62
|
items.removeItem(item);
|
|
62
63
|
return this;
|
|
63
64
|
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Sets the render function for items
|
|
67
|
-
* @param {(element: *) => ValidChildren} renderFn - Render function to apply
|
|
68
|
-
* @returns {HasItems}
|
|
69
|
-
*/
|
|
70
|
-
HasItems.prototype.render = function(renderFn) {
|
|
71
|
-
this.$description.render = renderFn;
|
|
72
|
-
return this;
|
|
73
|
-
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
|
|
2
|
+
export default function HasFullPosition() {}
|
|
3
|
+
|
|
4
|
+
HasFullPosition.prototype.atTop = function() {
|
|
5
|
+
this.$description.position = 'top';
|
|
6
|
+
return this;
|
|
7
|
+
};
|
|
8
|
+
HasFullPosition.prototype.atBottom = function() {
|
|
9
|
+
this.$description.position = 'bottom';
|
|
10
|
+
return this;
|
|
11
|
+
};
|
|
12
|
+
HasFullPosition.prototype.atLeft = function() {
|
|
13
|
+
this.$description.position = 'left';
|
|
14
|
+
return this;
|
|
15
|
+
};
|
|
16
|
+
HasFullPosition.prototype.atRight = function() {
|
|
17
|
+
this.$description.position = 'right';
|
|
18
|
+
return this;
|
|
19
|
+
};
|
|
20
|
+
HasFullPosition.prototype.atTopLeading = function() {
|
|
21
|
+
this.$description.position = 'top-leading';
|
|
22
|
+
return this;
|
|
23
|
+
};
|
|
24
|
+
HasFullPosition.prototype.atTopTrailing = function() {
|
|
25
|
+
this.$description.position = 'top-trailing';
|
|
26
|
+
return this;
|
|
27
|
+
};
|
|
28
|
+
HasFullPosition.prototype.atTopCenter = function() {
|
|
29
|
+
this.$description.position = 'top-center';
|
|
30
|
+
return this;
|
|
31
|
+
};
|
|
32
|
+
HasFullPosition.prototype.atBottomLeading = function() {
|
|
33
|
+
this.$description.position = 'bottom-leading';
|
|
34
|
+
return this;
|
|
35
|
+
};
|
|
36
|
+
HasFullPosition.prototype.atBottomTrailing = function() {
|
|
37
|
+
this.$description.position = 'bottom-trailing';
|
|
38
|
+
return this;
|
|
39
|
+
};
|
|
40
|
+
HasFullPosition.prototype.atBottomCenter = function() {
|
|
41
|
+
this.$description.position = 'bottom-center';
|
|
42
|
+
return this;
|
|
43
|
+
};
|
|
44
|
+
HasFullPosition.prototype.atLeadingCenter = function() {
|
|
45
|
+
this.$description.position = 'leading-center';
|
|
46
|
+
return this;
|
|
47
|
+
};
|
|
48
|
+
HasFullPosition.prototype.atTrailingCenter = function() {
|
|
49
|
+
this.$description.position = 'trailing-center';
|
|
50
|
+
return this;
|
|
51
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
export default function HasPosition() {}
|
|
3
|
+
|
|
4
|
+
HasPosition.prototype.atTop = function() {
|
|
5
|
+
this.$description.position = 'top';
|
|
6
|
+
return this;
|
|
7
|
+
};
|
|
8
|
+
HasPosition.prototype.atBottom = function() {
|
|
9
|
+
this.$description.position = 'bottom';
|
|
10
|
+
return this;
|
|
11
|
+
};
|
|
12
|
+
HasPosition.prototype.atLeft = function() {
|
|
13
|
+
this.$description.position = 'left';
|
|
14
|
+
return this;
|
|
15
|
+
};
|
|
16
|
+
HasPosition.prototype.atRight = function() {
|
|
17
|
+
this.$description.position = 'right';
|
|
18
|
+
return this;
|
|
19
|
+
};
|
|
20
|
+
HasPosition.prototype.atCenter = function() {
|
|
21
|
+
this.$description.position = 'center';
|
|
22
|
+
return this;
|
|
23
|
+
};
|