7 lines
274 KiB
Text
7 lines
274 KiB
Text
{
|
|
"version": 3,
|
|
"sources": ["../src/index.ts", "../src/utils.ts", "../src/core.ts", "../src/modules/css/classes.ts", "../src/modules/css/styles.ts", "../src/modules/css/index.ts", "../src/modules/events/binding.ts", "../src/modules/events/mouse.ts", "../src/modules/events/lifecycle.ts", "../src/modules/events/keyboard.ts", "../src/modules/events/form.ts", "../src/modules/events/touch.ts", "../src/modules/events/index.ts", "../src/modules/dom/attributes.ts", "../src/modules/dom/content.ts", "../src/modules/http/get.ts", "../src/modules/dom/manipulation.ts", "../src/modules/dom/traversal.ts", "../src/modules/dom/states.ts", "../src/modules/dom/index.ts", "../src/modules/effects/slide.ts", "../src/modules/effects/vertical.ts", "../src/modules/effects/fade.ts", "../src/modules/effects/index.ts", "../src/modules/http/post.ts", "../src/modules/http/upload.ts", "../src/modules/http/index.ts", "../src/modules/data/arrays.ts", "../src/modules/data/objects.ts", "../src/modules/data/index.ts"],
|
|
"sourcesContent": ["/**\r\n * @file src/index.ts\r\n * @version 2.3.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Entry Point\r\n * @description\r\n * * Main library entry point. Aggregates Core, Types, Utils, and all functional modules into a single export.\r\n * @requires ./core\r\n * * Core class logic and inheritance.\r\n * @requires ./types\r\n * * TypeScript type definitions and interfaces.\r\n * @requires ./utils\r\n * * Helper functions (throttle, debounce).\r\n * @requires ./modules/css\r\n * * Style manipulation methods.\r\n * @requires ./modules/events\r\n * * Event handling logic.\r\n * @requires ./modules/dom\r\n * * DOM traversal and manipulation.\r\n * @requires ./modules/effects\r\n * * Visual effects and animations.\r\n * @requires ./modules/http\r\n * * HTTP client for AJAX requests.\r\n * @requires ./modules/data\r\n * * Data structure utilities.\r\n */\r\n\r\nimport { jBase as JBaseClass } from './core';\r\nimport { JBaseInput, JBaseCSSProperty, JBaseEventMap, JBaseElement } from './types';\r\nimport { cssMethods } from './modules/css';\r\nimport { eventMethods } from './modules/events';\r\nimport { domMethods } from './modules/dom';\r\nimport { effectMethods } from './modules/effects';\r\nimport { http } from './modules/http';\r\nimport { data } from './modules/data';\r\nimport { debounce, each, throttle } from './utils';\r\n\r\nObject.assign(JBaseClass.prototype, cssMethods);\r\nObject.assign(JBaseClass.prototype, eventMethods);\r\nObject.assign(JBaseClass.prototype, domMethods);\r\nObject.assign(JBaseClass.prototype, effectMethods);\r\n\r\n/**\r\n * * TypeScript Declaration Merging.\r\n */\r\ndeclare module './core' {\r\n interface jBase {\r\n /**\r\n * * Adds one or more CSS classes to the selected elements.\r\n * @example addClass('active', 'highlight'); => Adds the 'active' and 'highlight' classes to all selected elements.\r\n * @param classNames One or more class names to be added.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n addClass(...classNames: string[]): jBase;\r\n\r\n /**\r\n * * Removes one or more CSS classes from the selected elements.\r\n * @example removeClass('active', 'highlight'); => Removes the 'active' and 'highlight' classes from all selected elements.\r\n * @param classNames One or more class names to be removed.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n removeClass(...classNames: string[]): jBase;\r\n\r\n /**\r\n * * Toggles a CSS class (adds if missing, removes if present).\r\n * @example toggleClass('active'); => Toggles the 'active' class on all selected elements.\r\n * @param className The class name to toggle.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n toggleClass(className: string): jBase;\r\n\r\n /**\r\n * * Checks if at least one of the selected elements has the specified class.\r\n * @example hasClass('active'); => Checks if at least one selected element has the 'active' class.\r\n * @param className The class name to check for.\r\n * @returns True if the class exists on at least one element, otherwise false.\r\n */\r\n hasClass(className: string): boolean;\r\n\r\n /**\r\n * * Sets a CSS property for all selected elements.\r\n * @example css('color', 'red'); => Sets the 'color' style to 'red' for all selected elements.\r\n * @param property The CSS property name (camelCase).\r\n * @param value The value to set.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n css(property: JBaseCSSProperty, value: string | number): jBase;\r\n\r\n /**\r\n * * Gets the computed CSS value of the first element.\r\n * @example css('color'); => Returns the computed 'color' value of the first selected element.\r\n * @param property The CSS property name (camelCase).\r\n * @returns The computed value as a string.\r\n */\r\n css(property: JBaseCSSProperty): string;\r\n\r\n /**\r\n * * Sets multiple CSS properties for all selected elements using an object.\r\n * @example css({ color: 'red', backgroundColor: 'blue' }); => Sets the 'color' to 'red' and 'background-color' to 'blue' for all selected elements.\r\n * @param properties An object containing CSS property-value pairs.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n css(properties: Record<string, string | number>): jBase;\r\n\r\n /**\r\n * Iterates over the jBase collection in a highly performant manner.\r\n * Returning `false` within the callback breaks the loop early.\r\n * @example each((el, index) => { console.log(el); if (index === 5) return false; }); => Logs the first 6 matched elements to the console.\r\n * @param callback The function to execute for each element.\r\n * The context (`this`)\r\n * The first argument (`el`) are set to the current DOM element.\r\n * The second argument (`index`) provides the current loop index.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n each(callback: (this: JBaseElement, el: JBaseElement, index: number) => boolean | void): jBase;\r\n\r\n /**\r\n * * Registers a typed event listener.\r\n * @example on('click', event => { console.log(event); }); => Attaches a click event listener that logs the event object.\r\n * @param event The event name (e.g., 'click').\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n on<K extends keyof JBaseEventMap>(event: K, handler: (event: JBaseEventMap[K]) => void): jBase;\r\n\r\n /**\r\n * * Attaches an event handler function for one or more events to the selected elements.\r\n * @example on('click', handler) => Binds a click event handler to all matched elements.\r\n * @param events One or more space-separated event types (e.g., 'click', 'mouseenter mouseleave').\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, handler: (event: any) => void): jBase;\r\n \r\n /**\r\n * * Attaches an event handler to the selected elements, passing custom data to the event object.\r\n * @example on('click', { key: 'value' }, handler) => Binds a click event handler and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, data: any, handler: (event: any) => void): jBase;\r\n \r\n /**\r\n * * Attaches a delegated event handler. The handler is only executed if the event target matches the given selector.\r\n * * Highly performant for observing dynamically added child elements.\r\n * @example on('click', '.btn', handler) => Binds a click event handler to all current and future elements matching '.btn' within the matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string to filter the descendants of the selected elements.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, selector: string, handler: (event: any) => void): jBase;\r\n \r\n /**\r\n * * Attaches a delegated event handler and passes custom data to the event object.\r\n * @example on('click', '.btn', { key: 'value' }, handler) => Binds a click event handler to all current and future elements matching '.btn' and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string to filter the descendants of the selected elements.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n on(events: string, selector: string, data: any, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Removes a typed event listener.\r\n * @example off('click', handler) => Removes a click event handler from all matched elements.\r\n * @param event The event name.\r\n * @param handler The exact reference of the handler to remove.\r\n * @returns The current jBase instance.\r\n */\r\n off<K extends keyof JBaseEventMap>(event: K, handler: (event: JBaseEventMap[K]) => void): jBase;\r\n\r\n /**\r\n * * Removes all or a specific event listener.\r\n * @example off('click') => Removes all click event handlers from all matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param handler (Optional) The specific handler to remove.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n off(events: string, handler?: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Removes a delegated event listener.\r\n * @example off('click', '.btn', handler) => Removes a delegated click event handler from all matched elements for the specified selector.\r\n * @param events One or more space-separated event types.\r\n * @param selector The CSS selector string originally used for delegation.\r\n * @param handler (Optional) The specific handler to remove.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n off(events: string, selector: string, handler?: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a typed event listener that executes only once.\r\n * @example once('click', event => { console.log(event); }); => Attaches a click event listener that executes only once and logs the event object.\r\n * @param event The event name.\r\n * @param handler The exact reference of the handler.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once<K extends keyof JBaseEventMap>(event: K, handler: (event: JBaseEventMap[K]) => void): jBase;\r\n\r\n /**\r\n * * Registers an event listener that executes only once.\r\n * @example once('click', handler) => Binds a click event handler that executes only once for all matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a one-time listener with custom data.\r\n * @example once('click', { key: 'value' }, handler) => Binds a click event handler that executes only once and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, data: any, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a one-time listener with event delegation.\r\n * @example once('click', '.btn', handler) => Binds a click event handler that executes only once for all current and future elements matching '.btn' within the matched elements.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string for event delegation.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, selector: string, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Registers a one-time listener with event delegation and custom data.\r\n * @example once('click', '.btn', { key: 'value' }, handler) => Binds a click event handler that executes only once for all current and future elements matching '.btn' and passes custom data to the event object.\r\n * @example once('click', { key: 'value' }, handler) => Binds a click event handler that executes only once and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param selector A CSS selector string for event delegation.\r\n * @param data Custom data to be passed to the handler via `event.data`.\r\n * @param handler A function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\n once(events: string, selector: string, data: any, handler: (event: any) => void): jBase;\r\n\r\n /**\r\n * * Triggers an event on each element in the collection.\r\n * @example trigger('customEvent') => Triggers 'customEvent' on all matched elements.\r\n * @example trigger('customEvent', { key: 'value' }) => Triggers 'customEvent' on all matched elements and passes custom data to the event object.\r\n * @example trigger('click') => Programmatically triggers a click event on all matched elements.\r\n * @example trigger('click', { key: 'value' }) => Programmatically triggers a click event on all matched elements and passes custom data to the event object.\r\n * @param eventName The name of the event to trigger.\r\n * @param data Optional data to pass to the event (accessible via event.detail).\r\n * @returns The current jBase instance.\r\n */\r\n trigger(eventName: string, data?: any): jBase;\r\n\r\n /**\r\n * * Triggers the 'click' event or binds a handler.\r\n * @example click() => Triggers the 'click' event on all matched elements.\r\n * @example click(handler) => Binds a click event handler to all matched elements.\r\n * @param handler (Optional) The function to execute on click.\r\n * @returns The current jBase instance.\r\n */\r\n click(handler?: (event: Event) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mousemove' event.\r\n * @example mousemove(handler) => Binds a mousemove event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mousemove(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseleave' event.\r\n * @example mouseleave(handler) => Binds a mouseleave event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseleave(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseenter' event.\r\n * @example mouseenter(handler) => Binds a mouseenter event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseenter(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mousedown' event.\r\n * @example mousedown(handler) => Binds a mousedown event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mousedown(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseup' event.\r\n * @example mouseup(handler) => Binds a mouseup event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseup(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Triggers the 'dblclick' event or binds a handler.\r\n * @example dblclick() => Triggers the 'dblclick' event on all matched elements.\r\n * @example dblclick(handler) => Binds a dblclick event handler to all matched elements.\r\n * @param handler (Optional) The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n dblclick(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseout' event.\r\n * @example mouseout(handler) => Binds a mouseout event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseout(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'mouseover' event.\r\n * @example mouseover(handler) => Binds a mouseover event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n mouseover(handler: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds handlers to both 'mouseenter' and 'mouseleave' events.\r\n * @example hover(handlerIn, handlerOut) => Binds handlerIn to mouseenter and handlerOut to mouseleave for all matched elements.\r\n * @param handlerIn Executed on mouseenter.\r\n * @param handlerOut Executed on mouseleave.\r\n * @returns The current jBase instance.\r\n */\r\n hover(handlerIn: (event: MouseEvent) => void, handlerOut: (event: MouseEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'keydown' event\r\n * @example keydown(handler) => Binds a keydown event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n keydown(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'keyup' event.\r\n * @example keyup(handler) => Binds a keyup event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n keyup(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'keypress' event (Deprecated).\r\n * @deprecated Use keydown instead.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n keypress(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler that fires only when a specific key is pressed.\r\n * @example pressedKey(handler) => Binds a handler that executes only when a specific key is pressed.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n pressedKey(handler: (event: KeyboardEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'submit' event.\r\n * @example submit(handler) => Binds a submit event handler to all matched forms.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n submit(handler: (event: SubmitEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'change' event.\r\n * @example change(handler) => Binds a change event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n change(handler: (event: Event) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'input' event (real-time).\r\n * @example input(handler) => Binds an input event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n input(handler: (event: Event) => void): jBase;\r\n\r\n /**\r\n * * Sets focus on the element.\r\n * @example focus() => Sets focus on the element.\r\n * @returns The current jBase instance.\r\n */\r\n focus(): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'focus' event.\r\n * @example focus(handler) => Binds a focus event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n focus(handler: (event: FocusEvent) => void): jBase;\r\n\r\n /**\r\n * * Removes focus from the element.\r\n * @example blur() => Removes focus from the element.\r\n * @returns The current jBase instance.\r\n */\r\n blur(): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'blur' event.\r\n * @example blur(handler) => Binds a blur event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n blur(handler: (event: FocusEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchstart' event.\r\n * @example touchstart(handler) => Binds a touchstart event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchstart(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchend' event.\r\n * @example touchend(handler) => Binds a touchend event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchend(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchmove' event.\r\n * @example touchmove(handler) => Binds a touchmove event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchmove(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'touchcancel' event.\r\n * @example touchcancel(handler) => Binds a touchcancel event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n touchcancel(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeLeft' gesture.\r\n * @example swipeLeft(handler) => Binds a swipeLeft gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeLeft(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeRight' gesture.\r\n * @example swipeRight(handler) => Binds a swipeRight gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeRight(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeDown' gesture.\r\n * @example swipeDown(handler) => Binds a swipeDown gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeDown(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Binds a handler to the 'swipeUp' gesture.\r\n * @example swipeUp(handler) => Binds a swipeUp gesture handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\n swipeUp(handler: (event: TouchEvent) => void): jBase;\r\n\r\n /**\r\n * * Gets the HTML content of the first element.\r\n * @example html() => Returns the HTML content of the first matched element as a string.\r\n * @returns The HTML content as a string.\r\n */\r\n html(): string;\r\n \r\n /**\r\n * * Gets the HTML content of the first element, or sets the HTML content of all matched elements.\r\n * @example html() => Returns the innerHTML of the first element.\r\n * @example html('<div>New</div>') => Sets safe HTML for all matched elements.\r\n * @example html('<script>alert(\"Hi\")</script>', { executeScripts: true }) => Injects and executes scripts.\r\n * @param content The HTML string to set. If undefined, acts as a getter.\r\n * @param options Security and execution options.\r\n * @returns HTML string (getter) or the current jBase instance (setter).\r\n */\r\n html(content: string, options?: { executeScripts?: boolean }): jBase;\r\n\r\n /**\r\n * * Gets the text content of the first element.\r\n * @example text() => Returns the text content of the first matched element as a string.\r\n * @returns The text content as a string.\r\n */\r\n text(): string;\r\n /**\r\n * * Sets the text content of all selected elements (safe against XSS).\r\n * @example text('New text content') => Sets the text content of all matched elements to 'New text content'.\r\n * @param content The new text content.\r\n * @returns The current jBase instance.\r\n */\r\n text(content: string): jBase;\r\n\r\n /**\r\n * * Loads HTML from a server and injects it into the matched elements.\r\n * @example $('#content').load('/pages/about.html')\r\n * @example $('#content').load('/pages/widget.html', { executeScripts: true })\r\n * @param url The URL to fetch the HTML from.\r\n * @param options Fetch options extended with jBase specific settings (e.g., executeScripts).\r\n * @returns A Promise resolving to the current jBase instance.\r\n */\r\n load(url: string, options?: RequestInit & { executeScripts?: boolean }): Promise<jBase>;\r\n\r\n /**\r\n * * Gets an attribute value from the first element.\r\n * @example attr('href') => Returns the value of the 'href' attribute from the first matched element or null if it doesn't exist.\r\n * @param name The name of the attribute.\r\n * @returns The attribute value or null.\r\n */\r\n attr(name: string): string | null;\r\n\r\n /**\r\n * * Sets an attribute for all selected elements.\r\n * @example attr('data-id', '123') => Sets the 'data-id' attribute to '123' for all matched elements.\r\n * @param name The name of the attribute.\r\n * @param value The value to set.\r\n * @returns The current jBase instance.\r\n */\r\n attr(name: string, value: string): jBase;\r\n\r\n /**\r\n * * Gets the value of the first form element.\r\n * @example val() => Returns the current value of the first matched form element as a string.\r\n * @returns The value as a string.\r\n */\r\n val(): string;\r\n\r\n /**\r\n * * Sets the value for all selected form elements.\r\n * @example val('New value') => Sets the value of all matched form elements to 'New value'.\r\n * @param value The value to set.\r\n * @returns The current jBase instance.\r\n */\r\n val(value: string | number): jBase;\r\n\r\n /**\r\n * * Gets a property from the first element.\r\n * * Useful for DOM properties that don't directly map to HTML attributes.\r\n * @example prop('checked') => Returns the checked property of the first matched element (true or false).\r\n * @param name The name of the property (e.g., 'checked', 'disabled').\r\n * @returns The property value.\r\n */\r\n prop(name: string): any;\r\n\r\n /**\r\n * * Sets a property for all selected elements.\r\n * @example prop('checked', true) => Sets the checked property to true for all matched elements.\r\n * @param name The name of the property.\r\n * @param value The value to set.\r\n * @returns The current jBase instance.\r\n */\r\n prop(name: string, value: any): jBase;\r\n\r\n /**\r\n * * Removes an attribute from all selected elements.\r\n * @example removeAttr('data-id') => Removes the 'data-id' attribute from all matched elements.\r\n * @param name The name of the attribute to remove.\r\n * @returns The current jBase instance.\r\n */\r\n removeAttr(name: string): jBase;\r\n\r\n /**\r\n * * Replaces elements with a deep clone of themselves (removes listeners).\r\n * @example replaceWithClone() => Replaces each matched element with a deep clone of itself, effectively removing all event listeners and data.\r\n * @returns The current jBase instance.\r\n */\r\n replaceWithClone(): jBase;\r\n\r\n /**\r\n * * Removes all selected elements from the DOM.\r\n * @example remove() => Removes all matched elements from the DOM.\r\n * @returns The current jBase instance.\r\n */\r\n remove(): jBase;\r\n\r\n /**\r\n * * Removes all child nodes from the selected elements.\r\n * @example empty() => Removes all child nodes from each matched element, leaving the elements themselves intact.\r\n * @returns The current jBase instance.\r\n */\r\n empty(): jBase;\r\n\r\n /**\r\n * * Finds the closest ancestor matching the selector.\r\n * @example closest('.container') => For each matched element, returns the closest ancestor that matches the '.container' selector.\r\n * @param selector The CSS selector to match.\r\n * @returns A new jBase instance containing the ancestor.\r\n */\r\n closest(selector: string): jBase;\r\n\r\n /**\r\n * * Executes the handler when the DOM is fully loaded.\r\n * @example ready(() => { console.log('DOM is ready'); }); => Executes the provided function when the DOM is fully loaded.\r\n * @param handler The function to execute.\r\n * @returns The current jBase instance.\r\n */\r\n ready(handler: () => void): jBase;\r\n\r\n /**\r\n * * Inserts content at the end of the selected elements (inside).\r\n * @example append('<span>New content</span>') => Appends a new <span> element with 'New content' inside each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n append(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Inserts content at the beginning of the selected elements (inside).\r\n * @example prepend('<span>New content</span>') => Prepends a new <span> element with 'New content' inside each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n prepend(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Inserts content before the selected elements (outside).\r\n * @example before('<span>New content</span>') => Inserts a new <span> element with 'New content' before each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n before(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Inserts content after the selected elements (outside).\r\n * @example after('<span>New content</span>') => Inserts a new <span> element with 'New content' after each matched element.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n after(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Replaces the selected elements with new content.\r\n * @example replaceWith('<span>New content</span>') => Replaces each matched element with a new <span> element containing 'New content'.\r\n * @param content Content to insert (String, Node, or jBase).\r\n * @returns The current jBase instance.\r\n */\r\n replaceWith(content: string | Node | jBase): jBase;\r\n\r\n /**\r\n * * Appends the selected elements to a target.\r\n * @example appendTo('#container') => Appends all matched elements to the element with id 'container'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n appendTo(target: string | Element): jBase;\r\n\r\n /**\r\n * * Prepends the selected elements to a target.\r\n * @example prependTo('#container') => Prepends all matched elements to the element with id 'container'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n prependTo(target: string | Element): jBase;\r\n\r\n /**\r\n * * Inserts the selected elements before a target.\r\n * @example insertBefore('#target') => Inserts all matched elements before the element with id 'target'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n insertBefore(target: string | Element): jBase;\r\n\r\n /**\r\n * * Inserts the selected elements after a target.\r\n * @example insertAfter('#target') => Inserts all matched elements after the element with id 'target'.\r\n * @param target Target element or selector.\r\n * @returns The current jBase instance.\r\n */\r\n insertAfter(target: string | Element): jBase;\r\n\r\n /**\r\n * * Wraps each selected element with the specified HTML structure.\r\n * @example wrap('<div class=\"wrapper\"></div>') => Wraps each matched element with a <div> element having the class 'wrapper'.\r\n * @param wrapperHtml The HTML string for the wrapper.\r\n * @returns The current jBase instance.\r\n */\r\n wrap(wrapperHtml: string): jBase;\r\n\r\n /**\r\n * * Removes the direct parent of the selected elements.\r\n * @example unwrap() => Removes the direct parent of each matched element, effectively unwrapping it from its parent.\r\n * @returns The current jBase instance.\r\n */\r\n unwrap(): jBase;\r\n\r\n /**\r\n * * Gets the direct parents.\r\n * @example parent() => Gets the direct parent of each matched element.\r\n * @returns A new jBase instance with parents.\r\n */\r\n parent(): jBase;\r\n\r\n /**\r\n * * Gets the direct children.\r\n * @example children() => Gets the direct children of each matched element.\r\n * @example children('.filter') => Gets the direct children of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance with children.\r\n */\r\n children(selector?: string): jBase;\r\n\r\n /**\r\n * * Finds descendants matching the selector (deep).\r\n * @example find('.item') => Finds all descendant elements matching the '.item' selector for each matched element.\r\n * @param selector CSS selector to find.\r\n * @returns A new jBase instance.\r\n */\r\n findAll(selector: string): jBase;\r\n\r\n /**\r\n * * Gets all descendants recursively.\r\n * @example descendants() => Gets all descendant elements of each matched element, regardless of depth.\r\n * @returns A new jBase instance.\r\n */\r\n descendants(): jBase;\r\n\r\n /**\r\n * * Gets descendants recursively until a selector is met.\r\n * @example descendantsUntil('.stop') => Gets all descendant elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example descendantsUntil('.stop', '.filter') => Gets all descendant elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param untilSelector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n descendantsUntil(untilSelector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Gets all ancestors up to the root.\r\n * @example parents() => Gets all ancestor elements of each matched element, up to the document root.\r\n * @example parents('.filter') => Gets all ancestor elements of each matched element, up to the document root, filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n parents(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all ancestors until a selector is met.\r\n * @example parentsUntil('.stop') => Gets all ancestor elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example parentsUntil('.stop', '.filter') => Gets all ancestor elements of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param selector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n parentsUntil(selector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Gets the immediately following sibling.\r\n * @example next() => Gets the immediately following sibling of each matched element.\r\n * @example next('.filter') => Gets the immediately following sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n next(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets the immediately preceding sibling.\r\n * @example prev() => Gets the immediately preceding sibling of each matched element.\r\n * @example prev('.filter') => Gets the immediately preceding sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prev(selector?: string): jBase;\r\n\r\n /**\r\n * * Alias for `next()`.\r\n * @example sibling() => Gets the immediately following sibling of each matched element.\r\n * @example sibling('.filter') => Gets the immediately following sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n sibling(selector?: string): jBase;\r\n\r\n /**\r\n * * Alias for `next()`.\r\n * @example nextSibling() => Gets the immediately following sibling of each matched element.\r\n * @example nextSibling('.filter') => Gets the immediately following sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n nextSibling(selector?: string): jBase;\r\n\r\n /**\r\n * * Alias for `prev()`.\r\n * @example prevSibling() => Gets the immediately preceding sibling of each matched element.\r\n * @example prevSibling('.filter') => Gets the immediately preceding sibling of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prevSibling(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all following siblings.\r\n * @example nextAll() => Gets all following siblings of each matched element.\r\n * @example nextAll('.filter') => Gets all following siblings of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n nextAll(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all preceding siblings.\r\n * @example prevAll() => Gets all preceding siblings of each matched element.\r\n * @example prevAll('.filter') => Gets all preceding siblings of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prevAll(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets all siblings (prev and next).\r\n * @example siblings() => Gets all siblings (both previous and next) of each matched element.\r\n * @example siblings('.filter') => Gets all siblings of each matched element filtered by '.filter'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n siblings(selector?: string): jBase;\r\n\r\n /**\r\n * * Gets following siblings until a selector is met.\r\n * @example nextUntil('.stop') => Gets all following siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example nextUntil('.stop', '.filter') => Gets all following siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param untilSelector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n nextUntil(untilSelector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Gets preceding siblings until a selector is met.\r\n * @example prevUntil('.stop') => Gets all preceding siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy.\r\n * @example prevUntil('.stop', '.filter') => Gets all preceding siblings of each matched element until an element matching the '.stop' selector is encountered in the hierarchy, filtered by '.filter'.\r\n * @param untilSelector Selector to stop at.\r\n * @param filter (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\n prevUntil(untilSelector: string, filter?: string): jBase;\r\n\r\n /**\r\n * * Reduces the set to the element at the index.\r\n * @example eq(0) => Reduces the set to the first element.\r\n * @example eq(-1) => Reduces the set to the last element.\r\n * @param index Index (negative values count from the end).\r\n * @returns A new jBase instance.\r\n */\r\n eq(index: number): jBase;\r\n\r\n /**\r\n * * Reduces the set to the first element.\r\n * @example first() => Reduces the set to the first element.\r\n * @returns A new jBase instance.\r\n */\r\n first(): jBase;\r\n\r\n /**\r\n * * Reduces the set to the last element.\r\n * @example last() => Reduces the set to the last element.\r\n * @returns A new jBase instance.\r\n */\r\n last(): jBase;\r\n\r\n /**\r\n * * Filters elements by selector.\r\n * @example filterBy('.active') => Reduces the set to elements that match the '.active' selector.\r\n * @param selector CSS selector to filter by.\r\n * @returns A new jBase instance.\r\n */\r\n filterBy(selector: string): jBase;\r\n\r\n /**\r\n * * Filters the collection based on a custom callback function.\r\n * * Elements for which the callback returns `true` are kept in the new collection.\r\n * @example filterBy((index, element) => element.classList.contains('active')) => Reduces the set to elements for which the callback returns true (e.g., elements with the 'active' class).\r\n * @param predicate A function executed for each element in the current collection. \r\n * Receives the current `index` and the DOM `element` as arguments. \r\n * Return `true` to keep the element, or `false` to exclude it.\r\n * @returns A new jBase instance containing only the elements that passed the test.\r\n */\r\n filterBy(predicate: (index: number, element: Element) => boolean): jBase;\r\n\r\n /**\r\n * * Removes elements matching the selector.\r\n * @example not('.active') => Removes elements that match the '.active' selector from the set.\r\n * @param selector CSS selector to remove.\r\n * @returns A new jBase instance.\r\n */\r\n not(selector: string): jBase;\r\n\r\n /**\r\n * * Removes elements matching the callback function.\r\n * @example not((index, element) => element.classList.contains('active')) => Removes elements for which the callback returns true (e.g., elements with the 'active' class) from the set.\r\n * @param predicate Function that returns true to remove the element.\r\n * @returns A new jBase instance.\r\n */\r\n not(predicate: (index: number, element: Element) => boolean): jBase;\r\n\r\n /**\r\n * * Slides the element into view (horizontal).\r\n * @example slideIn() => Slides the element into view from the left with default duration.\r\n * @example slideIn({ direction: 'right', duration: 500 }) => Slides the element into view from the right over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideIn(options?: { direction?: 'left' | 'right', duration?: number }): jBase;\r\n\r\n /**\r\n * * Slides the element out of view (horizontal).\r\n * @example slideOut() => Slides the element out of view to the left with default duration.\r\n * @example slideOut({ direction: 'right', duration: 500 }) => Slides the element out of view to the right over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideOut(options?: { direction?: 'left' | 'right', duration?: number }): jBase;\r\n\r\n /**\r\n * * Toggles between slideIn and slideOut.\r\n * @example slideToggle() => Toggles between sliding the element into and out of view from the left with default duration.\r\n * @example slideToggle({ direction: 'right', duration: 500 }) => Toggles between sliding the element into and out of view from the right over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideToggle(options?: { direction?: 'left' | 'right', duration?: number }): jBase;\r\n\r\n /**\r\n * * Slides the element down (Accordion).\r\n * @example slideDown() => Slides the element down into view with default duration.\r\n * @example slideDown({ duration: 500, displayType: 'block' }) => Slides the element down into view over 500 milliseconds and sets display to 'block' when shown.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideDown(options?: { duration?: number, displayType?: string }): jBase;\r\n\r\n /**\r\n * * Slides the element up.\r\n * @example slideUp() => Slides the element up out of view with default duration.\r\n * @example slideUp({ duration: 500 }) => Slides the element up out of view over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideUp(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Toggles between slideDown and slideUp.\r\n * @example slideToggleBox() => Toggles between sliding the element down into view and up out of view with default duration.\r\n * @example slideToggleBox({ duration: 500, displayType: 'block' }) => Toggles between sliding the element down into view and up out of view over 500 milliseconds, and sets display to 'block' when shown.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n slideToggleBox(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Fades the element in (Opacity).\r\n * @example fadeIn() => Fades the element in with default duration.\r\n * @example fadeIn({ duration: 500, displayType: 'block' }) => Fades the element in over 500 milliseconds and sets display to 'block' when shown.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n fadeIn(options?: { duration?: number, displayType?: string }): jBase;\r\n\r\n /**\r\n * * Fades the element out (Opacity).\r\n * @example fadeOut() => Fades the element out with default duration.\r\n * @example fadeOut({ duration: 500 }) => Fades the element out over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n fadeOut(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Toggles between fadeIn and fadeOut.\r\n * @example fadeToggle() => Toggles between fading the element in and out with default duration.\r\n * @example fadeToggle({ duration: 500 }) => Toggles between fading the element in and out over 500 milliseconds.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\n fadeToggle(options?: { duration?: number }): jBase;\r\n\r\n /**\r\n * * Checks the 'checked' state (Getter).\r\n * @example checked() => Returns true if the first matched element is checked (for checkboxes/radio buttons).\r\n * @returns True if checked.\r\n */\r\n checked(): boolean;\r\n\r\n /**\r\n * * Sets the 'checked' state (Setter).\r\n * @example checked(true) => Sets the checked state to true for all matched checkboxes/radio buttons.\r\n * @param state The new state.\r\n * @returns The current jBase instance.\r\n */\r\n checked(state: boolean): jBase;\r\n\r\n /**\r\n * * ALIAS for .checked(true). Checks the matched elements.\r\n * @example check() => Checks all matched checkboxes/radio buttons.\r\n * @returns The current jBase instance.\r\n */\r\n check(): jBase;\r\n\r\n /**\r\n * * ALIAS for .checked(false). Unchecks the matched elements.\r\n * @example uncheck() => Unchecks all matched checkboxes/radio buttons.\r\n * @returns The current jBase instance.\r\n */\r\n uncheck(): jBase;\r\n\r\n /**\r\n * * Checks the 'selected' state (Getter).\r\n * @example selected() => Returns true if the first matched element is selected (for options in a select element).\r\n * @returns True if selected.\r\n */\r\n selected(): boolean;\r\n\r\n /**\r\n * * Sets the 'selected' state (Setter).\r\n * @example selected(true) => Sets the selected state to true for all matched options in a select element.\r\n * @param state The new state.\r\n * @returns The current jBase instance.\r\n */\r\n selected(state: boolean): jBase;\r\n\r\n /**\r\n * * ALIAS for .selected(true). Selects the matched <option> elements.\r\n * @example select() => Selects all matched option elements.\r\n * @returns The current jBase instance.\r\n */\r\n select(): jBase;\r\n\r\n /**\r\n * * Checks the 'disabled' state (Getter).\r\n * @example disabled() => Returns true if the first matched element is disabled (for form elements).\r\n * @returns True if disabled.\r\n */\r\n disabled(): boolean;\r\n\r\n /**\r\n * * Sets the 'disabled' state and toggles CSS class (Setter).\r\n * @example disabled(true) => Sets the disabled state to true for all matched form elements and adds a 'disabled' CSS class.\r\n * @example disabled(false) => Sets the disabled state to false for all matched form elements and removes the 'disabled' CSS class.\r\n * @param state The new state.\r\n * @returns The current jBase instance.\r\n */\r\n disabled(state: boolean): jBase;\r\n\r\n /**\r\n * * ALIAS for .disabled(true). Disables the matched elements and adds the 'disabled' class.\r\n * @example disable() => Disables all matched elements.\r\n * @returns The current jBase instance.\r\n */\r\n disable(): jBase;\r\n\r\n /**\r\n * * ALIAS for .disabled(false). Enables the matched elements and removes the 'disabled' class.\r\n * @example enable() => Enables all matched elements.\r\n * @returns The current jBase instance.\r\n */\r\n enable(): jBase;\r\n }\r\n}\r\n\r\n/**\r\n * * Factory function to initialize a new jBase instance.\r\n * @param selector CSS selector, HTML string, DOM element, or collection.\r\n * @returns A new jBase collection.\r\n */\r\nconst initFn = (selector: JBaseInput): JBaseClass => {\r\n return new JBaseClass(selector);\r\n};\r\n\r\nconst init = Object.assign(initFn, {\r\n http,\r\n data,\r\n each,\r\n throttle,\r\n debounce,\r\n fn: JBaseClass.prototype\r\n});\r\n\r\n/**\r\n * * Binds the factory function to a specific window/document context.\r\n * Useful for iframes or multiple document contexts.\r\n * @example const iframeFactory = bind(iframe.contentWindow); => Creates a new factory function bound to the iframe's window context.\r\n * @param window The window context to bind to.\r\n * @returns A factory function bound to the specified context.\r\n */\r\nexport const bind = (window: Window) => {\r\n const doc = window.document;\r\n const boundInit = (selector: JBaseInput) => new JBaseClass(selector, doc);\r\n \r\n Object.assign(boundInit, {\r\n fn: JBaseClass.prototype,\r\n http,\r\n data,\r\n each,\r\n throttle,\r\n debounce,\r\n });\r\n\r\n return boundInit;\r\n};\r\n\r\n/**\r\n * * Export the factory under different aliases for maximum compatibility and convenience.\r\n */\r\nexport const $ = init;\r\nexport const jB = init;\r\nexport const _jB = init;\r\nexport const __jB = init;\r\nexport const _jBase = init;\r\nexport const __jBase = init;\r\nexport const jBase = init;\r\nexport const __ = init;\r\n\r\n/**\r\n * * Utility for throttled function calls.\r\n */\r\nexport { throttle } from './utils';\r\n\r\n/**\r\n * * Utility for debounced function calls.\r\n */\r\nexport { debounce } from './utils';\r\n\r\n/**\r\n * * HTTP Client for AJAX requests.\r\n */\r\nexport { http } from './modules/http';\r\n\r\n/**\r\n * * Data utilities for Arrays and Objects.\r\n */\r\nexport { data } from './modules/data';\r\n\r\n/**\r\n * * The class itself, if needed for type checks.\r\n */\r\nexport { JBaseClass };\r\n\r\n/**\r\n * * Generic, highly performant iterator utility for arrays, objects, and NodeLists.\r\n */\r\nexport { each } from './utils';", "/**\r\n * @file src/utils.ts\r\n * @version 2.2.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Utilities\r\n * @description\r\n * * General utility functions and helpers (e.g., debounce, throttle, type checks).\r\n */\r\n\r\n/**\r\n * * Creates a throttled version of the provided function. The function is executed at most once within the specified time interval, regardless of how often it is called.\r\n * Use case: Performance optimization for high-frequency events (e.g., Scroll, Resize, Mousemove).\r\n * @example const throttledScroll = throttle(() => { console.log('Scroll event'); }, 200); => Creates a throttled scroll event handler that logs at most once every 200 milliseconds.\r\n * @template T The type of the original function.\r\n * @param func The function to be throttled.\r\n * @param limit The time interval in milliseconds during which at most one execution is permitted.\r\n * @returns A new function that throttles calls.\r\n */\r\nexport function throttle<T extends (...args: any[]) => any>(func: T, limit: number): (...args: Parameters<T>) => void {\r\n let inThrottle: boolean;\r\n return function(this: any, ...args: Parameters<T>) {\r\n const context = this;\r\n if (!inThrottle) {\r\n func.apply(context, args);\r\n inThrottle = true;\r\n setTimeout(() => inThrottle = false, limit);\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * * Creates a debounced version of the provided function. Execution is delayed until `delay` milliseconds have passed since the last invocation.\r\n * Use case: Waiting for user input (e.g., Live Search, Validation) to avoid unnecessary calculations.\r\n * @example const debouncedInput = debounce(() => { console.log('Input event'); }, 300); => Creates a debounced input event handler that logs only after the user has stopped typing for 300 milliseconds.\r\n * @template T The type of the original function.\r\n * @param func The function to be debounced.\r\n * @param delay The waiting time in milliseconds after the last call.\r\n * @returns A new function that delays execution.\r\n */\r\nexport function debounce<T extends (...args: any[]) => any>(func: T, delay: number): (...args: Parameters<T>) => void {\r\n let timer: ReturnType<typeof setTimeout>;\r\n return function(this: any, ...args: Parameters<T>) {\r\n clearTimeout(timer);\r\n timer = setTimeout(() => func.apply(this, args), delay);\r\n };\r\n}\r\n\r\n/**\r\n * * Checks if the code is running in a browser environment.\r\n * * Verifies the existence of `window` and `requestAnimationFrame` to ensure animation support.\r\n * * Used to safely guard DOM-dependent logic (Effects, Events) during Server-Side Rendering (SSR).\r\n * @example const isBrowserEnv = isBrowser(); => Checks if the code is running in a browser environment.\r\n * @returns `true` if running in a browser with animation support, otherwise `false`.\r\n */\r\nexport function isBrowser(): boolean {\r\n return typeof window !== 'undefined' && typeof window.requestAnimationFrame !== 'undefined';\r\n}\r\n\r\n/**\r\n * * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays.\r\n * * Arrays and array-like objects with a length property are iterated by numeric index.\r\n * * Objects are iterated via their named properties.\r\n * * Returning 'false' in the callback breaks the loop early.\r\n * @example each([1, 2, 3], (index, value) => { console.log(index, value); }) => Logs the index and value of each item in the array.\r\n * @example each({ a: 1, b: 2 }, (key, value) => { console.log(key, value); }) => Logs the key and value of each property in the object.\r\n * @template T The type of the items in the collection.\r\n * @param collection The array, array-like object, or plain object to iterate over.\r\n * @param callback The function that will be executed on every object.\r\n */\r\nexport function each<T>(collection: T[] | ArrayLike<T> | Record<string, T>, callback: (this: T, indexOrKey: any, value: T) => boolean | void): collection is T[] | ArrayLike<T> | Record<string, T> {\r\n const isArrayLike = Array.isArray(collection) || (collection && typeof collection === 'object' && 'length' in collection && typeof (collection as any).length === 'number');\r\n if (isArrayLike) {\r\n const arr = collection as ArrayLike<T>;\r\n for (let i = 0, len = arr.length; i < len; i++) {\r\n if (callback.call(arr[i], i, arr[i]) === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n const obj = collection as Record<string, T>;\r\n for (const key in obj) {\r\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\r\n if (callback.call(obj[key], key, obj[key]) === false) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n return collection as any;\r\n}\r\n\r\n/**\r\n * * Internal Helper: Sanitizes an HTML string by removing dangerous attributes.\r\n * * Strips inline event handlers and javascript: protocols to mitigate XSS.\r\n * @param htmlStr The raw HTML string.\r\n * @returns The sanitized HTML string.\r\n */\r\nexport function sanitizeDangerousAttributes(htmlStr: string): string {\r\n let cleanStr = htmlStr.replace(/on\\w+\\s*=\\s*(['\"])(?:(?!\\1).)*\\1/gi, '');\r\n cleanStr = cleanStr.replace(/(href|action)\\s*=\\s*(['\"])\\s*javascript\\s*:[\\s\\S]*?\\2/gi, '');\r\n return cleanStr;\r\n}", "/**\r\n * @file src/core.ts\r\n * @version 2.2.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Core\r\n * @description\r\n * * The main jBase class. Handles the selection engine, initialization, and plugin architecture.\r\n * @requires ./types\r\n * * Type definitions for the core class and its methods.\r\n */\r\n\r\nimport { JBaseElement, JBaseInput } from './types';\r\nimport { sanitizeDangerousAttributes } from './utils';\r\n\r\n/**\r\n * * The core class of the framework, inheriting from the native Array class. Acts as a wrapper around DOM elements and enables chainable methods (Fluent Interface).\r\n */\r\nexport class jBase extends Array<JBaseElement> {\r\n /**\r\n * * The original selector string or input type used to create this instance.\r\n */\r\n public selectorSource: string = '';\r\n\r\n /**\r\n * * The document context this instance is bound to (supports SSR via jsdom).\r\n */\r\n public doc: Document;\r\n\r\n /**\r\n * * Initializes a new jBase instance. Analyzes the provided selector and populates the internal array with found or created DOM elements.\r\n * @param selector The input selector (CSS selector, HTML string, DOM element, or collection).\r\n * @param context An optional specific Document or Window context (essential for SSR).\r\n */\r\n constructor(selector?: JBaseInput, context?: Document | Window) {\r\n super();\r\n\r\n if (context instanceof Document) {\r\n this.doc = context;\r\n } else if (context && (context as Window).document) {\r\n this.doc = (context as Window).document;\r\n } else {\r\n this.doc = (typeof document !== 'undefined') ? document : (null as any);\r\n }\r\n if (typeof document === 'undefined') {\r\n return;\r\n }\r\n this.selectorSource = typeof selector === 'string' ? selector : '<DOM Object/Array>';\r\n \r\n if (!selector)\r\n return;\r\n\r\n if (selector instanceof HTMLElement || selector === document || selector === window || selector instanceof Element) {\r\n this.push(selector);\r\n }\r\n else if (typeof selector === 'string') {\r\n const trimmed = selector.trim();\r\n if (trimmed.startsWith('<') && trimmed.endsWith('>')) {\r\n const tempDiv = this.doc.createElement('div');\r\n tempDiv.innerHTML = sanitizeDangerousAttributes(trimmed);\r\n this.push(...Array.from(tempDiv.children));\r\n }\r\n else if (trimmed.startsWith('#') && !trimmed.includes(' ') && !trimmed.includes('.')) {\r\n const el = this.doc.getElementById(trimmed.slice(1));\r\n if (el)\r\n this.push(el);\r\n }\r\n else if (trimmed.startsWith('.') && !trimmed.includes(' ') && !/[:\\[#]/.test(trimmed)) {\r\n const els = this.doc.getElementsByClassName(trimmed.slice(1));\r\n for (let i = 0; i < els.length; i++) {\r\n this.push(els[i] as HTMLElement);\r\n }\r\n }\r\n else if (/^[a-zA-Z0-9]+$/.test(trimmed)) {\r\n const els = this.doc.getElementsByTagName(trimmed);\r\n for (let i = 0; i < els.length; i++) {\r\n this.push(els[i] as HTMLElement);\r\n }\r\n }\r\n else {\r\n try {\r\n this.push(...Array.from(this.doc.querySelectorAll(selector)));\r\n } catch (e) {\r\n console.warn(`jBase: Invalid selector \"${selector}\"`, e);\r\n }\r\n }\r\n }\r\n else if (selector instanceof NodeList || Array.isArray(selector)) {\r\n this.push(...Array.from(selector as ArrayLike<JBaseElement>));\r\n }\r\n }\r\n\r\n /**\r\n * * Custom serializer for JSON.stringify. Prevents circular references and huge outputs by returning a simplified preview.\r\n * @example toJson() => { meta: 'jBase Wrapper', query: '#myId', count: 1, preview: ['div'] }\r\n * @returns A simplified object representation for debugging.\r\n */\r\n toJSON() {\r\n return {\r\n meta: 'jBase Wrapper',\r\n query: this.selectorSource,\r\n count: this.length,\r\n preview: this.slice(0, 10).map(el => {\r\n if (el instanceof Element)\r\n return el.tagName.toLowerCase();\r\n return typeof el;\r\n })\r\n };\r\n }\r\n\r\n /**\r\n * * High-performance iteration over matched elements.\r\n * * Returning 'false' in the callback breaks the loop early.\r\n * @example each((el, index) => { console.log(el); if (index === 5) return false; }) => Logs the first 6 matched elements to the console.\r\n * @param callback The function to execute for each element. Context (`this`) is set to the current element.\r\n * @returns The current jBase instance for chaining.\r\n */\r\n each(callback: (this: JBaseElement, el: JBaseElement, index: number) => boolean | void): this {\r\n for (let i = 0, len = this.length; i < len; i++) {\r\n if (callback.call(this[i], this[i], i) === false) {\r\n break;\r\n }\r\n }\r\n return this;\r\n }\r\n}", "/**\r\n * @file src/modules/css/classes.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category CSS\r\n * @description\r\n * * Methods for manipulating CSS classes (add, remove, toggle, has).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Adds one or more CSS classes to each element in the collection.\r\n * @example addClass('active', 'highlight') => Adds the 'active' and 'highlight' classes to all matched elements.\r\n * @param classNames One or more class names to be added\r\n * @returns The current jBase instance for method chaining\r\n */\r\nexport function addClass(this: jBase, ...classNames: string[]): jBase {\r\n this.each(function(el) {\r\n if (el instanceof Element) el.classList.add(...classNames);\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Removes one or more CSS classes from each element in the collection.\r\n * @example removeClass('active', 'highlight') => Removes the 'active' and 'highlight' classes from all matched elements.\r\n * @param classNames One or more class names to be removed\r\n * @returns The current jBase instance for method chaining\r\n */\r\nexport function removeClass(this: jBase, ...classNames: string[]): jBase {\r\n this.each(function(el) {\r\n if (el instanceof Element) el.classList.remove(...classNames);\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Toggles a CSS class (adds if missing, removes if present) for each element.\r\n * @example toggleClass('active') => Toggles the 'active' class on all matched elements.\r\n * @param className The class name to toggle.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function toggleClass(this: jBase, className: string): jBase {\r\n this.each(function(el) {\r\n if (el instanceof Element) el.classList.toggle(className);\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Checks if at least one element in the collection has the specified class.\r\n * @example hasClass('active') => Returns true if at least one matched element has the 'active' class, otherwise false.\r\n * @param className The class name to check for.\r\n * @returns True if the class exists on at least one element, otherwise false.\r\n */\r\nexport function hasClass(this: jBase, className: string): boolean {\r\n return this.some(el => {\r\n return (el instanceof Element) && el.classList.contains(className);\r\n });\r\n}", "/**\r\n * @file src/modules/css/styles.ts\r\n * @version 2.0.4\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category CSS\r\n * @description\r\n * * Methods for getting and setting inline CSS styles.\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Gets a CSS property value from the first element or sets one/multiple CSS properties for all elements.\r\n * @example css('color', 'red') => Sets the 'color' style to 'red' for all matched elements.\r\n * @example css({ color: 'red', backgroundColor: 'blue' }) => Sets multiple styles for all matched elements.\r\n * @example css('color') => Returns the computed 'color' value of the first matched element.\r\n * @param property A CSS property name as a string, or an object of property-value pairs to set multiple styles.\r\n * @param value (Optional) The value to set if `property` is a string. If undefined and `property` is a string, acts as a getter.\r\n * @returns The CSS value as a string when reading, or the jBase instance when writing.\r\n */\r\nexport function css(this: jBase, property: string | Record<string, string | number>, value?: string | number): string | jBase {\r\n if (typeof property === 'object' && property !== null) {\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement || el instanceof SVGElement) {\r\n for (const key in property) {\r\n if (Object.prototype.hasOwnProperty.call(property, key)) {\r\n if (key.includes('-')) {\r\n el.style.setProperty(key, String(property[key]));\r\n } else {\r\n (el.style as any)[key] = property[key];\r\n }\r\n }\r\n }\r\n }\r\n });\r\n return this;\r\n }\r\n if (typeof property === 'string') {\r\n if (value === undefined) {\r\n const el = this[0];\r\n if (el instanceof HTMLElement || el instanceof SVGElement) {\r\n const doc = el.ownerDocument;\r\n const win = doc ? doc.defaultView : null;\r\n if (win) {\r\n return win.getComputedStyle(el).getPropertyValue(property) || win.getComputedStyle(el)[property as any] || '';\r\n } else {\r\n return (el.style as any)[property] || '';\r\n }\r\n }\r\n return '';\r\n }\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement || el instanceof SVGElement) {\r\n if (property.includes('-')) {\r\n el.style.setProperty(property, String(value));\r\n } else {\r\n (el.style as any)[property] = value;\r\n }\r\n }\r\n });\r\n }\r\n\r\n return this;\r\n}", "/**\r\n * @file src/modules/css/index.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category CSS\r\n * @description\r\n * * Central entry point for CSS operations. Aggregates class and style manipulation methods.\r\n * @requires ./classes\r\n * * Class manipulation methods (addClass, removeClass, etc.).\r\n * @requires ./styles\r\n * * Style manipulation methods (css).\r\n */\r\n\r\nimport * as classMethods from './classes';\r\nimport * as styleMethods from './styles';\r\n\r\n/**\r\n * * Aggregation of all CSS methods. This object bundles functions for class manipulation and style manipulation. It is exported to extend the jBase prototype centrally via Object.assign.\r\n */\r\nexport const cssMethods = {\r\n ...classMethods,\r\n ...styleMethods\r\n};", "/**\r\n * @file src/modules/events/binding.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Core event binding methods (on, off, trigger). Handles event registration and removal.\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n * @requires ../../utils\r\n * * Uses utility functions for iteration and environment checks.\r\n */\r\n\r\nimport { each } from '../../utils';\r\nimport { jBase } from '../../core';\r\n\r\nconst JB_EVENTS = '__jb_events';\r\n\r\n/**\r\n * * Attaches an event handler function for one or more events to the selected elements.\r\n * * This core method handles dynamic event delegation and allows passing custom data.\r\n * @example on('click', handler) => Binds a click event handler to all matched elements.\r\n * @example on('click', '.btn', handler) => Binds a click event handler to all current and future elements matching '.btn' within the matched elements.\r\n * @example on('click', { key: 'value' }, handler) => Binds a click event handler and passes custom data to the event object.\r\n * @param events One or more space-separated event types (e.g., 'click', 'mouseenter mouseleave').\r\n * @param selectorOrDataOrHandler A CSS selector string for delegation, custom data, or the callback function.\r\n * @param dataOrHandler Custom data to pass to `event.data`, or the callback function.\r\n * @param handlerOrUndefined The callback function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function on(this: jBase, events: string, selectorOrDataOrHandler: any, dataOrHandler?: any, handlerOrUndefined?: any): jBase {\r\n let selector: string | undefined;\r\n let data: any;\r\n let handler: Function;\r\n if (typeof selectorOrDataOrHandler === 'string') {\r\n selector = selectorOrDataOrHandler;\r\n if (typeof dataOrHandler === 'function') {\r\n handler = dataOrHandler;\r\n } else {\r\n data = dataOrHandler;\r\n handler = handlerOrUndefined;\r\n }\r\n } else if (typeof selectorOrDataOrHandler === 'function') {\r\n handler = selectorOrDataOrHandler;\r\n } else {\r\n data = selectorOrDataOrHandler;\r\n handler = dataOrHandler;\r\n }\r\n if (!handler) return this;\r\n const eventTypes = events.split(' ');\r\n this.each(function (el) {\r\n if (!(el instanceof EventTarget)) return;\r\n const registry = (el as any)[JB_EVENTS] || ((el as any)[JB_EVENTS] = []);\r\n each(eventTypes, function(_index, eventType) {\r\n const wrappedHandler = function (e: Event) {\r\n let targetContext: EventTarget = el;\r\n if (selector) {\r\n const target = e.target instanceof Element ? e.target : (e.target as Node)?.parentElement;\r\n const match = (target instanceof Element && target.closest) ? target.closest(selector) : null;\r\n if (!match || !(el as Element).contains(match)) {\r\n return; \r\n }\r\n targetContext = match;\r\n }\r\n if (data !== undefined) {\r\n (e as any).data = data;\r\n }\r\n handler.call(targetContext, e);\r\n };\r\n registry.push({\r\n type: eventType,\r\n original: handler,\r\n wrapped: wrappedHandler,\r\n selector: selector\r\n });\r\n el.addEventListener(eventType, wrappedHandler);\r\n });\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Removes an event handler previously attached with `.on()`.\r\n * * Can remove all handlers for an event, or specific ones by selector or handler reference.\r\n * @example off('click') => Removes all click handlers from the matched elements.\r\n * @example off('click', '.btn') => Removes all click handlers that were delegated to '.btn' within the matched elements.\r\n * @example off('click', handler) => Removes the specific click handler function from the matched elements.\r\n * @example off('click', '.btn', handler) => Removes the specific click handler function that was delegated to '.btn' within the matched elements.\r\n * @param events One or more space-separated event types (e.g., 'click').\r\n * @param selectorOrHandler A CSS selector string originally used for delegation, or the specific handler function.\r\n * @param handlerOrUndefined The specific handler function to remove.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function off(this: jBase, events: string, selectorOrHandler?: any, handlerOrUndefined?: any): jBase {\r\n let selector: string | undefined;\r\n let handler: Function | undefined;\r\n if (typeof selectorOrHandler === 'string') {\r\n selector = selectorOrHandler;\r\n handler = handlerOrUndefined;\r\n } else if (typeof selectorOrHandler === 'function') {\r\n handler = selectorOrHandler;\r\n }\r\n const eventTypes = events.split(' ');\r\n this.each(function (el) {\r\n if (!(el instanceof EventTarget)) return;\r\n const registry = (el as any)[JB_EVENTS];\r\n if (!registry) return;\r\n each(eventTypes, function(_index, eventType) {\r\n for (let i = registry.length - 1; i >= 0; i--) {\r\n const record = registry[i];\r\n const matchType = record.type === eventType;\r\n const matchSelector = selector ? record.selector === selector : true;\r\n const matchHandler = handler ? record.original === handler : true;\r\n if (matchType && matchSelector && matchHandler) {\r\n el.removeEventListener(eventType, record.wrapped);\r\n registry.splice(i, 1);\r\n }\r\n }\r\n });\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Attaches an event handler that will be executed at most once per element and event type.\r\n * * Automatically unbinds itself after the first execution. Supports event delegation and custom data.\r\n * @example once('click', handler) => Binds a click event handler that executes only once for all matched elements.\r\n * @example once('click', '.btn', handler) => Binds a click event handler that executes only once for all current and future elements matching '.btn' within the matched elements.\r\n * @example once('click', { key: 'value' }, handler) => Binds a click event handler that executes only once and passes custom data to the event object.\r\n * @param events One or more space-separated event types.\r\n * @param selectorOrDataOrHandler A CSS selector string for delegation, custom data, or the callback function.\r\n * @param dataOrHandler Custom data to pass to `event.data`, or the callback function.\r\n * @param handlerOrUndefined The callback function to execute when the event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function once(this: jBase, events: string, selectorOrDataOrHandler: any, dataOrHandler?: any, handlerOrUndefined?: any): jBase {\r\n const self = this;\r\n const handleOnce = function(this: any, e: any) {\r\n self.off(events, selectorOrDataOrHandler, handleOnce);\r\n let realHandler: Function;\r\n if (typeof selectorOrDataOrHandler === 'function') {\r\n realHandler = selectorOrDataOrHandler;\r\n } else if (typeof dataOrHandler === 'function') {\r\n realHandler = dataOrHandler;\r\n } else {\r\n realHandler = handlerOrUndefined;\r\n }\r\n return realHandler.apply(this, arguments);\r\n };\r\n if (typeof selectorOrDataOrHandler === 'string') {\r\n if (typeof dataOrHandler === 'function') {\r\n return this.on(events, selectorOrDataOrHandler, handleOnce);\r\n } else {\r\n return this.on(events, selectorOrDataOrHandler, dataOrHandler, handleOnce);\r\n }\r\n } else if (typeof selectorOrDataOrHandler === 'function') {\r\n return this.on(events, handleOnce);\r\n } else {\r\n return this.on(events, selectorOrDataOrHandler, handleOnce);\r\n }\r\n}\r\n\r\n/**\r\n * * Triggers an event on each element in the collection.\r\n * @example trigger('customEvent') => Triggers 'customEvent' on all matched elements.\r\n * @example trigger('customEvent', { key: 'value' }) => Triggers 'customEvent' on all matched elements and passes custom data to the event object.\r\n * @example trigger('click') => Programmatically triggers a click event on all matched elements.\r\n * @example trigger('click', { key: 'value' }) => Programmatically triggers a click event on all matched elements and passes custom data to the event object.\r\n * @param eventName The name of the event to trigger.\r\n * @param data Optional data to pass to the event (accessible via event.detail).\r\n */\r\nexport function trigger(this: jBase, eventName: string, data?: any): jBase {\r\n return this.each(function(el) {\r\n if (!(el instanceof EventTarget)) return;\r\n const event = new CustomEvent(eventName, {\r\n bubbles: true,\r\n cancelable: true,\r\n detail: data\r\n });\r\n el.dispatchEvent(event);\r\n });\r\n}", "/**\r\n * @file src/modules/events/mouse.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Methods for handling mouse events (click, dblclick, hover, mouseenter, mouseleave).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Binds an event handler to the \"click\" JavaScript event, or triggers that event on an element.\r\n * * If no handler is provided, it programmatically triggers a native click on all matched elements.\r\n * @example click(handler) => Binds a click event handler to all matched elements.\r\n * @example click() => Programmatically triggers a click event on all matched elements.\r\n * @param handler (Optional) A function to execute each time the click event is triggered.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function click(this: jBase, handler?: (event: Event) => void): jBase {\r\n if (handler) {\r\n return this.on('click', handler);\r\n } else {\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) el.click();\r\n });\r\n return this;\r\n }\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mousemove' event. Fires continuously while the pointer moves inside the element.\r\n * @example mousemove(handler) => Binds a mousemove event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mousemove(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mousemove', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mouseleave' event. Fires when the pointer leaves the element (does not bubble).\r\n * @example mouseleave(handler) => Binds a mouseleave event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mouseleave(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mouseleave', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mouseenter' event. Fires when the pointer enters the element (does not bubble).\r\n * @example mouseenter(handler) => Binds a mouseenter event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mouseenter(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mouseenter', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mousedown' event. Fires as soon as a mouse button is pressed over the element.\r\n * @example mousedown(handler) => Binds a mousedown event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mousedown(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mousedown', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mouseup' event. Fires when a mouse button is released over the element.\r\n * @example mouseup(handler) => Binds a mouseup event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mouseup(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mouseup', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'dblclick' event or triggers it manually.\r\n * @example dblclick(handler) => Binds a dblclick event handler to all matched elements.\r\n * @param handler (Optional) The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function dblclick(this: jBase, handler?: (event: MouseEvent) => void): jBase {\r\n if (handler) {\r\n return this.on('dblclick', handler as EventListener);\r\n } else {\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n el.dispatchEvent(new MouseEvent('dblclick', {\r\n bubbles: true,\r\n cancelable: true,\r\n view: window\r\n }));\r\n }\r\n });\r\n return this;\r\n }\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mouseout' event. Fires when the pointer leaves the element OR one of its children (bubbles).\r\n * @example mouseout(handler) => Binds a mouseout event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mouseout(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mouseout', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'mouseover' event. Fires when the pointer enters the element OR one of its children (bubbles).\r\n * @example mouseover(handler) => Binds a mouseover event handler to all matched elements.\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function mouseover(this: jBase, handler: (event: MouseEvent) => void): jBase {\r\n return this.on('mouseover', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds two handlers to the matched elements, to be executed when the mouse pointer enters and leaves the elements.\r\n * * This is a highly convenient shorthand for chaining `.mouseenter()` and `.mouseleave()`.\r\n * @example hover(handlerIn, handlerOut) => Binds handlerIn to mouseenter and handlerOut to mouseleave for all matched elements.\r\n * @param handlerIn A function to execute when the mouse pointer enters the element.\r\n * @param handlerOut A function to execute when the mouse pointer leaves the element.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function hover(this: jBase, handlerIn: (event: MouseEvent) => void, handlerOut: (event: MouseEvent) => void): jBase {\r\n return this.mouseenter(handlerIn).mouseleave(handlerOut);\r\n}", "/**\r\n * @file src/modules/events/lifecycle.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Methods for handling DOM lifecycle events (e.g., ready).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Executes the handler as soon as the DOM is fully loaded and parsed. If the document is already ready (readyState 'interactive' or 'complete'), the handler executes immediately to avoid race conditions.\r\n * @example ready(handler) => Binds a handler to execute when the DOM is ready.\r\n * @param handler The callback function to execute when the DOM is ready.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function ready(this: jBase, handler: () => void): jBase {\r\n const doc = window.document;\r\n if (doc.readyState === 'complete' || doc.readyState === 'interactive') {\r\n handler();\r\n } else {\r\n this.on('DOMContentLoaded', handler);\r\n }\r\n return this;\r\n}", "/**\r\n * @file src/modules/events/keyboard.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Methods for handling keyboard events (keydown, keyup, keypress).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Binds an event handler to the 'keydown' event. Fires immediately when a key is pressed (repeats if held).\r\n * @example keydown(handler) => Binds a keydown event handler to all matched elements.\r\n * @param handler The callback function receiving the KeyboardEvent.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function keydown(this: jBase, handler: (event: KeyboardEvent) => void): jBase {\r\n return this.on('keydown', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'keyup' event. Fires when a key is released.\r\n * @example keyup(handler) => Binds a keyup event handler to all matched elements.\r\n * @param handler The callback function receiving the KeyboardEvent.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function keyup(this: jBase, handler: (event: KeyboardEvent) => void): jBase {\r\n return this.on('keyup', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'keypress' event. Deprecated in modern standards.\r\n * @deprecated Use keydown or input instead.\r\n * @param handler The callback function receiving the KeyboardEvent.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function keypress(this: jBase, handler: (event: KeyboardEvent) => void): jBase {\r\n return this.on('keypress', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler for a specific key (case-insensitive).\r\n * @example pressedKey('Enter', handler) => Binds a handler that executes when the Enter key is pressed on any matched element.\r\n * @param targetKey The key to react to (e.g., 'm', 'Enter', 'Escape').\r\n * @param handler The callback function.\r\n * @returns The current jBase instance.\r\n */\r\nexport function pressedKey(this: jBase, targetKey: string, handler: (event: KeyboardEvent) => void): jBase {\r\n return this.on('keydown', (e: Event) => {\r\n const event = e as KeyboardEvent;\r\n if (event.key.toLowerCase() === targetKey.toLowerCase()) {\r\n handler(event);\r\n }\r\n });\r\n}", "/**\r\n * @file src/modules/events/form.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Methods for handling form events (submit, change, focus, blur, input).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Registers an event handler for the 'submit' event. Triggered when a form is submitted.\r\n * @example submit(handler) => Binds a submit event handler to all matched forms.\r\n * @param handler The function to execute when the event occurs.\r\n * @returns The current jBase instance for chaining.\r\n */\r\nexport function submit(this: jBase, handler: (event: SubmitEvent) => void): jBase {\r\n return this.on('submit', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Registers an event handler for the 'change' event. Triggered when the value of an element (<input>, <select>, <textarea>) is changed by the user and committed (e.g., on blur).\r\n * @example change(handler) => Binds a change event handler to all matched form elements.\r\n * @param handler The function to execute when the event occurs.\r\n * @returns The current jBase instance for chaining.\r\n */\r\nexport function change(this: jBase, handler: (event: Event) => void): jBase {\r\n return this.on('change', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Registers an event handler for the 'input' event. Triggered immediately when the value changes (real-time, e.g., every keystroke).\r\n * @example input(handler) => Binds an input event handler to all matched form elements.\r\n * @param handler The function to execute when the event occurs.\r\n * @returns The current jBase instance for chaining.\r\n */\r\nexport function input(this: jBase, handler: (event: Event) => void): jBase {\r\n return this.on('input', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Handles the 'focus' event. If a handler is provided, it binds the listener. If no handler is provided, it programmatically sets focus on the element(s).\r\n * @example focus(handler) => Binds a focus event handler to all matched elements.\r\n * @example focus() => Programmatically focuses the first matched element.\r\n * @param handler (Optional) The function to execute when the event occurs.\r\n * @returns The current jBase instance for chaining.\r\n */\r\nexport function focus(this: jBase, handler?: (event: FocusEvent) => void): jBase {\r\n if (handler) {\r\n return this.on('focus', handler as EventListener);\r\n } else {\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) el.focus();\r\n });\r\n return this;\r\n }\r\n}\r\n\r\n/**\r\n * * Handles the 'blur' event (element loses focus). If a handler is provided, it binds the listener. If no handler is provided, it programmatically removes focus.\r\n * @example blur(handler) => Binds a blur event handler to all matched elements.\r\n * @example blur() => Programmatically blurs the first matched element.\r\n * @param handler (Optional) The function to execute when the event occurs.\r\n * @returns The current jBase instance for chaining.\r\n */\r\nexport function blur(this: jBase, handler?: (event: FocusEvent) => void): jBase {\r\n if (handler) {\r\n return this.on('blur', handler as EventListener);\r\n } else {\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) el.blur();\r\n });\r\n return this;\r\n }\r\n}", "/**\r\n * @file src/modules/events/touch.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Methods for handling touch events (touchstart, touchend, touchmove).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Binds an event handler to the 'touchstart' event. Triggered when a touch point is placed on the touch surface.\r\n * @example touchstart(handler) => Binds a touchstart event handler to all matched elements.\r\n * @param handler The callback function executed on touch start.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function touchstart(this: jBase, handler: (event: TouchEvent) => void): jBase {\r\n return this.on('touchstart', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'touchend' event. Triggered when a touch point is removed from the touch surface.\r\n * @example touchend(handler) => Binds a touchend event handler to all matched elements.\r\n * @param handler The callback function executed on touch end.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function touchend(this: jBase, handler: (event: TouchEvent) => void): jBase {\r\n return this.on('touchend', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'touchmove' event. Triggered when a touch point moves along the touch surface. Important for swipe gestures or Drag & Drop.\r\n * @example touchmove(handler) => Binds a touchmove event handler to all matched elements.\r\n * @param handler The callback function executed on movement.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function touchmove(this: jBase, handler: (event: TouchEvent) => void): jBase {\r\n return this.on('touchmove', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to the 'touchcancel' event. Triggered when a touch point has been disrupted by the system (e.g., too many touch points or a UI popup).\r\n * @example touchcancel(handler) => Binds a touchcancel event handler to all matched elements.\r\n * @param handler The callback function executed on cancellation.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function touchcancel(this: jBase, handler: (event: TouchEvent) => void): jBase {\r\n return this.on('touchcancel', handler as EventListener);\r\n}\r\n\r\n/**\r\n * * Binds an event handler to be executed when the user swipes left across the selected elements.\r\n * * The swipe must cover a minimum distance of 50 pixels to trigger.\r\n * @example swipeLeft(handler) => Binds a handler to execute when a left swipe gesture is detected on all matched elements.\r\n * @param handler A function to execute when the left swipe gesture is detected.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function swipeLeft(this: jBase, handler: (e: TouchEvent) => void): jBase {\r\n return this.each(function(el) { if (el instanceof Element) handleSwipe.call(this, el, 'left', handler); });\r\n}\r\n\r\n/**\r\n * * Binds an event handler to be executed when the user swipes right across the selected elements.\r\n * * The swipe must cover a minimum distance of 50 pixels to trigger.\r\n * @example swipeRight(handler) => Binds a handler to execute when a right swipe gesture is detected on all matched elements.\r\n * @param handler A function to execute when the right swipe gesture is detected.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function swipeRight(this: jBase, handler: (e: TouchEvent) => void): jBase {\r\n return this.each(function(el) { if (el instanceof Element) handleSwipe.call(this, el, 'right', handler); });\r\n}\r\n\r\n/**\r\n * * Binds an event handler to be executed when the user swipes up across the selected elements.\r\n * * The swipe must cover a minimum distance of 50 pixels to trigger.\r\n * @example swipeUp(handler) => Binds a handler to execute when an upward swipe gesture is detected on all matched elements.\r\n * @param handler A function to execute when the upward swipe gesture is detected.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function swipeUp(this: jBase, handler: (e: TouchEvent) => void): jBase {\r\n return this.each(function(el) { if (el instanceof Element) handleSwipe.call(this, el, 'up', handler); });\r\n}\r\n\r\n/**\r\n * * Binds an event handler to be executed when the user swipes down across the selected elements.\r\n * * The swipe must cover a minimum distance of 50 pixels to trigger.\r\n * @example swipeDown(handler) => Binds a handler to execute when a downward swipe gesture is detected on all matched elements.\r\n * @param handler A function to execute when the downward swipe gesture is detected.\r\n * @returns The current jBase instance for method chaining.\r\n */\r\nexport function swipeDown(this: jBase, handler: (e: TouchEvent) => void): jBase {\r\n return this.each(function(el) { if (el instanceof Element) handleSwipe.call(this, el, 'down', handler); });\r\n}\r\n\r\n/**\r\n * * Internal helper function to detect swipe gestures on touch devices.\r\n * * Calculates the distance between 'touchstart' and 'touchend' coordinates.\r\n * * Triggers the handler only if the movement exceeds the 50px threshold in the specified direction.\r\n * @private\r\n * @example handleSwipe(el, 'left', handler) => Attaches swipe detection for left swipes on the specified element.\r\n * @param el The DOM element to attach the touch listeners to.\r\n * @param direction The target swipe direction ('left', 'right', 'up', 'down').\r\n * @param handler The callback function to execute when a valid swipe is detected.\r\n */\r\nfunction handleSwipe(this: any, el: HTMLElement | Element, direction: 'left' | 'right' | 'up' | 'down', handler: (e: TouchEvent) => void) {\r\n let startX = 0, startY = 0;\r\n \r\n el.addEventListener('touchstart', (e: any) => {\r\n startX = e.touches[0].clientX;\r\n startY = e.touches[0].clientY;\r\n }, { passive: true });\r\n\r\n el.addEventListener('touchend', (e: any) => {\r\n const diffX = e.changedTouches[0].clientX - startX;\r\n const diffY = e.changedTouches[0].clientY - startY;\r\n const threshold = 50;\r\n\r\n if (Math.abs(diffX) > Math.abs(diffY)) {\r\n if (Math.abs(diffX) > threshold) {\r\n if (diffX > 0 && direction === 'right') handler.call(el, e);\r\n if (diffX < 0 && direction === 'left') handler.call(el, e);\r\n }\r\n } else {\r\n if (Math.abs(diffY) > threshold) {\r\n if (diffY > 0 && direction === 'down') handler.call(el, e);\r\n if (diffY < 0 && direction === 'up') handler.call(el, e);\r\n }\r\n }\r\n }, { passive: true });\r\n}", "/**\r\n * @file src/modules/events/index.ts\r\n * @version 2.0.2\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Events\r\n * @description\r\n * * Central entry point for event handling. Aggregates binding, mouse, lifecycle, keyboard, form, and touch events.\r\n * @requires ./binding\r\n * * General event binding (on, off).\r\n * @requires ./mouse\r\n * * Mouse interaction events (click, hover, etc.).\r\n * @requires ./lifecycle\r\n * * DOM lifecycle events (ready).\r\n * @requires ./keyboard\r\n * * Keyboard interaction events (keydown, keyup).\r\n * @requires ./form\r\n * * Form handling events (submit, change, input).\r\n * @requires ./touch\r\n * * Touch interaction events.\r\n */\r\n\r\nimport * as bindingMethods from './binding';\r\nimport * as mouseMethods from './mouse';\r\nimport * as lifecycleMethods from './lifecycle';\r\nimport * as keyboardMethods from './keyboard';\r\nimport * as formMethods from './form';\r\nimport * as touchMethods from './touch';\r\n\r\n/**\r\n * * Aggregated object of all event methods. Combines logic from various sub-modules into a single object. Used to extend the `jBase` prototype via `Object.assign`.\r\n */\r\nexport const eventMethods = {\r\n ...bindingMethods,\r\n ...mouseMethods,\r\n ...lifecycleMethods,\r\n ...keyboardMethods,\r\n ...formMethods,\r\n ...touchMethods\r\n};", "/**\r\n * @file src/modules/dom/attributes.ts\r\n * @version 2.1.1\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category DOM\r\n * @description\r\n * * Methods for getting and setting HTML attributes and properties (attr, data, val).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Gets an attribute from the first element or sets it for all elements in the selection.\r\n * @example attr('href', 'https://example.com') => Sets the 'href' attribute to 'https://example.com' for all matched elements.\r\n * @example attr('href') => Returns the 'href' attribute value of the first matched element.\r\n * @param name The name of the attribute (e.g., 'href', 'data-id').\r\n * @param value (Optional) The value to set. If undefined, acts as a getter.\r\n * @returns The attribute value (string/null) when reading, or the jBase instance when writing.\r\n */\r\nexport function attr(this: jBase, name: string, value?: string): string | null | jBase {\r\n if (value === undefined) {\r\n const el = this[0];\r\n return (el instanceof Element) ? el.getAttribute(name) : null;\r\n }\r\n\r\n this.each(function(el) {\r\n if (el instanceof Element) el.setAttribute(name, value);\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Gets the 'value' from the first form element or sets it for all elements. Supports Input, Textarea, and Select elements.\r\n * @example val('Hello') => Sets the value of all matched form elements to 'Hello'.\r\n * @example val() => Returns the value of the first matched form element.\r\n * @param value (Optional) The value to set. If undefined, acts as a getter.\r\n * @returns The current value as a string when reading, or the jBase instance when writing.\r\n */\r\nexport function val(this: jBase, value?: string): string | jBase {\r\n if (value === undefined) {\r\n const el = this[0];\r\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement) {\r\n return el.value;\r\n }\r\n return '';\r\n }\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement || el instanceof HTMLSelectElement) {\r\n el.value = value;\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Removes an attribute from all elements in the selection.\r\n * @example removeAttr('disabled') => Removes the 'disabled' attribute from all matched elements.\r\n * @param name The name of the attribute to remove (e.g., 'disabled', 'readonly').\r\n * @returns The jBase instance for chaining.\r\n */\r\nexport function removeAttr(this: jBase, name: string): jBase {\r\n this.each(function(el) {\r\n if (el instanceof Element) el.removeAttribute(name);\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Gets a property from the first element or sets it for all elements in the selection.\r\n * * Useful for DOM properties that don't directly map to HTML attributes (like 'checked' or 'selectedIndex').\r\n * @example prop('checked', true) => Sets the 'checked' property to true for all matched elements (e.g., checkboxes).\r\n * @example prop('checked') => Returns the 'checked' property value of the first matched element.\r\n * @example prop('selectedIndex', 2) => Sets the 'selectedIndex' property to 2 for all matched <select> elements.\r\n * @param name The name of the property (e.g., 'checked', 'disabled').\r\n * @param value (Optional) The value to set. If undefined, acts as a getter.\r\n * @returns The property value when reading, or the jBase instance when writing.\r\n */\r\nexport function prop(this: jBase, name: string, value?: any): any | jBase {\r\n if (value === undefined) {\r\n const el = this[0];\r\n return (el instanceof Element) ? (el as any)[name] : undefined;\r\n }\r\n\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n (el as any)[name] = value;\r\n }\r\n });\r\n return this;\r\n}", "/**\r\n * @file src/modules/dom/content.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category DOM\r\n * @description\r\n * * Methods for getting and setting element content (html, text, empty, replaceWith).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\nimport { getText } from '../http/get';\r\nimport { sanitizeDangerousAttributes } from '../../utils';\r\n\r\n/**\r\n * * Internal Helper: Extracts and executes <script> tags found within an HTML string.\r\n * * Creates new script elements, injects them into the document head to trigger execution,\r\n * * and immediately removes them to keep the DOM clean.\r\n * @private\r\n * @param htmlStr The raw HTML string containing potential <script> tags.\r\n * @param doc The document context used for element creation and script injection.\r\n * @returns The remaining HTML string with the original (dead) <script> tags removed.\r\n */\r\nfunction extractAndExecuteScripts(htmlStr: string, doc: Document): string {\r\n const tempDiv = doc.createElement('div');\r\n tempDiv.innerHTML = htmlStr;\r\n\r\n const scripts = tempDiv.querySelectorAll('script');\r\n \r\n scripts.forEach(oldScript => {\r\n const newScript = doc.createElement('script');\r\n Array.from(oldScript.attributes).forEach(attr => {\r\n newScript.setAttribute(attr.name, attr.value);\r\n });\r\n if (oldScript.textContent) {\r\n newScript.textContent = oldScript.textContent;\r\n }\r\n doc.head.appendChild(newScript);\r\n doc.head.removeChild(newScript);\r\n oldScript.remove();\r\n });\r\n\r\n return tempDiv.innerHTML;\r\n}\r\n\r\n/**\r\n * * Gets the HTML content of the first element, or sets the HTML content of all matched elements.\r\n * @example html() => Returns the innerHTML of the first element.\r\n * @example html('<div>New</div>') => Sets safe HTML for all matched elements.\r\n * @example html('<script>alert(\"Hi\")</script>', { executeScripts: true }) => Injects and executes scripts.\r\n * @param content The HTML string to set. If undefined, acts as a getter.\r\n * @param options Security and execution options.\r\n * @returns HTML string (getter) or the current jBase instance (setter).\r\n */\r\nexport function html(this: jBase, content?: string, options?: { executeScripts?: boolean }): string | jBase {\r\n if (content === undefined) {\r\n const el = this[0];\r\n return (el instanceof Element) ? el.innerHTML : '';\r\n }\r\n\r\n let finalHtml = content;\r\n const execute = options?.executeScripts === true;\r\n\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n const doc = el.ownerDocument || document;\r\n const processedHtml = execute ? extractAndExecuteScripts(finalHtml, doc) : sanitizeDangerousAttributes(finalHtml);\r\n\r\n el.innerHTML = processedHtml;\r\n }\r\n });\r\n\r\n return this;\r\n}\r\n\r\n/**\r\n * * Gets the text content of the first element or sets it for all elements. Safe against XSS attacks.\r\n * @example text('Hello World') => Sets the text content of all matched elements to 'Hello World'.\r\n * @example text() => Returns the text content of the first matched element.\r\n * @param content (Optional) The text content to set.\r\n * @returns The text content (getter) or the current jBase instance (setter).\r\n */\r\nexport function text(this: jBase, content?: string): string | jBase {\r\n if (content === undefined) {\r\n const el = this[0];\r\n return (el instanceof Node) ? (el.textContent || '') : '';\r\n }\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n el.textContent = content;\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Loads HTML from a server and injects it into the matched elements.\r\n * * This is now a clean wrapper around $.http.getText() and this.html().\r\n * @example $('#content').load('/pages/about.html')\r\n * @param url The URL to fetch the HTML from.\r\n * @param options Fetch options extended with jBase specific settings (e.g., executeScripts).\r\n * @returns A Promise resolving to the current jBase instance.\r\n */\r\nexport async function load(this: jBase, url: string, options?: RequestInit & { executeScripts?: boolean }): Promise<jBase> {\r\n try {\r\n const fetchOptions = { ...options };\r\n delete fetchOptions.executeScripts; \r\n\r\n const htmlStr = await getText(url, fetchOptions);\r\n this.html(htmlStr, { executeScripts: options?.executeScripts });\r\n\r\n } catch (error) {\r\n console.error(`jBase .load() failed to fetch: ${url}`, error);\r\n throw error;\r\n }\r\n return this;\r\n}", "/**\r\n * @file src/modules/http/get.ts\r\n * @version 2.0.6\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category HTTP\r\n * @description\r\n * * Abstraction for HTTP GET requests.\r\n */\r\n\r\n/**\r\n * * Performs an asynchronous HTTP GET request and expects a JSON response. Includes an automatic timeout of 5000ms to avoid hanging requests.\r\n * @example const data = await get<UserData>('/api/user/1'); => Fetches user data from the specified endpoint and parses it as JSON.\r\n * @example const data = await get('/api/user/1', { signal: customAbortSignal }); => Fetches user data with a custom abort signal for cancellation.\r\n * @template T The expected type of the response data (Generic).\r\n * @param url The target URL for the request.\r\n * @param option Optional RequestInit object to customize the fetch request.\r\n * @returns A Promise resolving with the typed JSON data.\r\n * @throws Error if HTTP status is not in success range (200-299) or a timeout occurs.\r\n */\r\nexport async function get<T>(url: string, option?: RequestInit): Promise<T> {\r\n const fetchOptions: RequestInit = { ...option };\r\n if (fetchOptions.method?.toLowerCase() === 'post') {\r\n fetchOptions.method = 'GET';\r\n }\r\n if (!fetchOptions.signal) {\r\n fetchOptions.signal = AbortSignal.timeout(5000);\r\n }\r\n const response = await fetch(url, {\r\n ...fetchOptions\r\n });\r\n if (!response.ok) {\r\n throw new Error(`HTTP Error: ${response.status}`);\r\n }\r\n const text = await response.text();\r\n try {\r\n return text ? JSON.parse(text) : {} as T;\r\n } catch (e) {\r\n return text as unknown as T; \r\n }\r\n}\r\n\r\n/**\r\n * * Performs an asynchronous HTTP GET request and returns the raw text content. Ideal for loading HTML fragments (Server-Side Rendering Partials) or plain text.\r\n * @example const html = await getText('/templates/modal.html'); => Fetches an HTML template as a string for later insertion into the DOM.\r\n * @example const text = await getText('/api/status'); => Fetches a plain text status message from the server.\r\n * @example const html = await getText('/templates/modal.html', { signal: customAbortSignal }); => Fetches an HTML template with a custom abort signal for cancellation.\r\n * @template T The expected type of the response data (Generic, defaults to string).\r\n * @param url The target URL for the request.\r\n * @param option Optional RequestInit object to customize the fetch request.\r\n * @returns A Promise containing the response body as a string.\r\n * @throws Error if HTTP status is not in success range (200-299).\r\n */\r\nexport async function getText<T = string>(url: string, option?: RequestInit): Promise<T> {\r\n const fetchOptions: RequestInit = { ...option };\r\n \r\n if (fetchOptions.method?.toLowerCase() !== 'get') {\r\n fetchOptions.method = 'GET';\r\n }\r\n if (!fetchOptions.signal) {\r\n fetchOptions.signal = AbortSignal.timeout(5000);\r\n }\r\n \r\n const response = await fetch(url, {\r\n ...fetchOptions\r\n });\r\n \r\n if (!response.ok) {\r\n throw new Error(`HTTP Error: ${response.status}`);\r\n }\r\n \r\n const text = await response.text();\r\n return text as unknown as T; \r\n}", "/**\r\n * @file src/modules/dom/manipulation.ts\r\n * @version 2.0.4\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category DOM\r\n * @description\r\n * * Methods for inserting, moving, and removing elements (append, prepend, remove).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n * @requires src/utils\r\n * * Depends on utility functions (e.g., each).\r\n */\r\n\r\nimport { each } from 'src/utils';\r\nimport { jBase } from '../../core';\r\nimport { sanitizeDangerousAttributes } from '../../utils';\r\n\r\n/**\r\n * * Internal Helper: Parses a raw HTML string into a DOM element using a temporary container.^\r\n * @private\r\n * @param html The HTML string to parse.\r\n * @param doc The document context to use for creation (essential for SSR).\r\n * @returns The created HTMLElement.\r\n */\r\nfunction parseHTML(html: string, doc: Document): HTMLElement {\r\n const tmp = doc.createElement('div');\r\n tmp.innerHTML = sanitizeDangerousAttributes(html.trim());\r\n return tmp.firstElementChild as HTMLElement;\r\n}\r\n\r\n/**\r\n * * Internal Helper: Retrieves the correct document context from a jBase collection.\r\n * * Ensures compatibility with Node.js/JSDOM by preferring the element's ownerDocument over the global document.\r\n * @private\r\n * @param collection The jBase instance to check.\r\n * @returns The found Document object or null (in strict Node environments without global context).\r\n */\r\nfunction getDoc(collection: jBase): Document {\r\n if (collection.length > 0 && collection[0] instanceof Element) {\r\n return collection[0].ownerDocument;\r\n }\r\n return (typeof document !== 'undefined') ? document : (null as any);\r\n}\r\n\r\n/**\r\n * * Internal Helper: Normalizes various content types into a single DocumentFragment.\r\n * * Handles HTML strings (parsing), DOM Nodes, Arrays, NodeLists, and jBase collections recursively.\r\n * * Using a Fragment minimizes browser reflows during insertion.\r\n * @private\r\n * @param content The content to normalize (String, Node, Array, Collection).\r\n * @param doc The document context to use for element creation (essential for SSR).\r\n * @returns A DocumentFragment containing the processed DOM nodes.\r\n */\r\nfunction normalizeToFragment(content: string | Node | jBase | (string | Node)[], doc: Document): DocumentFragment {\r\n const fragment = doc.createDocumentFragment();\r\n\r\n const add = (item: any) => {\r\n if (typeof item === 'string') {\r\n const temp = doc.createElement('div');\r\n temp.innerHTML = sanitizeDangerousAttributes(item.trim());\r\n while (temp.firstChild) {\r\n fragment.appendChild(temp.firstChild);\r\n }\r\n } else if (item instanceof Node) {\r\n fragment.appendChild(item);\r\n } else if (item instanceof jBase || Array.isArray(item) || item instanceof NodeList) {\r\n each(item as any, function(_index, child) { \r\n add(child); \r\n });\r\n }\r\n };\r\n add(content);\r\n return fragment;\r\n}\r\n\r\n/**\r\n * * Removes the selected elements from the DOM.\r\n * @example remove() => Removes all matched elements from the DOM.\r\n * @returns The current jBase instance.\r\n */\r\nexport function remove(this: jBase): jBase {\r\n this.each(function(el) {\r\n if (el instanceof Element) el.remove();\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Removes all child nodes and text content from the selected elements.\r\n * @example empty() => Empties the content of all matched elements, leaving them in the DOM.\r\n * @returns The current jBase instance.\r\n */\r\nexport function empty(this: jBase): jBase {\r\n this.each(function(el) {\r\n if (el instanceof Element) el.innerHTML = '';\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Replaces each element with a deep clone of itself. Useful for removing all event listeners (\"Nuke\" strategy).\r\n * @example replaceWithClone() => Replaces each matched element with a clone, effectively removing all event listeners.\r\n * @returns A new jBase instance containing the cloned elements.\r\n */\r\nexport function replaceWithClone(this: jBase): jBase {\r\n const newElements: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n const clone = el.cloneNode(true) as Element;\r\n el.replaceWith(clone);\r\n newElements.push(clone);\r\n }\r\n });\r\n return new (this.constructor as any)(newElements);\r\n}\r\n\r\n/**\r\n * * Inserts content at the end of each selected element (inside).\r\n * @example append('<span>New</span>') => Appends a new <span> element to the end of each matched element.\r\n * @param content HTML string, DOM Node, or jBase collection.\r\n * @returns The current jBase instance.\r\n */\r\nexport function append(this: jBase, content: string | Node | jBase): jBase {\r\n if (typeof content === 'string') {\r\n const safeContent = sanitizeDangerousAttributes(content);\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n el.insertAdjacentHTML('beforeend', safeContent);\r\n }\r\n });\r\n return this;\r\n }\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const fragment = normalizeToFragment(content, doc);\r\n const len = this.length;\r\n this.each(function(el, i) {\r\n if (el instanceof Element) {\r\n const contentToInsert = (i < len - 1) ? fragment.cloneNode(true) : fragment;\r\n el.appendChild(contentToInsert);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Inserts content at the beginning of each selected element (inside).\r\n * @example prepend('<span>New</span>') => Prepends a new <span> element to the beginning of each matched element.\r\n * @param content HTML string, DOM Node, or jBase collection.\r\n * @returns The current jBase instance.\r\n */\r\nexport function prepend(this: jBase, content: string | Node | jBase): jBase {\r\n if (typeof content === 'string') {\r\n const safeContent = sanitizeDangerousAttributes(content);\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n el.insertAdjacentHTML('afterbegin', safeContent);\r\n }\r\n });\r\n return this;\r\n }\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const fragment = normalizeToFragment(content, doc);\r\n const len = this.length;\r\n this.each(function(el, i) {\r\n if (el instanceof Element) {\r\n const contentToInsert = (i < len - 1) ? fragment.cloneNode(true) : fragment;\r\n el.prepend(contentToInsert);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Inserts content before the element (outside).\r\n * @example before('<div>New</div>') => Inserts a new <div> element immediately before each matched element.\r\n * @param content HTML string, DOM Node, or jBase collection.\r\n * @returns The current jBase instance.\r\n */\r\nexport function before(this: jBase, content: string | Node | jBase): jBase {\r\n if (typeof content === 'string') {\r\n const safeContent = sanitizeDangerousAttributes(content);\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n el.insertAdjacentHTML('beforebegin', safeContent);\r\n }\r\n });\r\n return this;\r\n }\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const fragment = normalizeToFragment(content, doc);\r\n const len = this.length;\r\n this.each(function(el, i) {\r\n if (el instanceof Element) {\r\n const contentToInsert = (i < len - 1) ? fragment.cloneNode(true) : fragment;\r\n el.before(contentToInsert);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Inserts content after the element (outside).\r\n * @example after('<div>New</div>') => Inserts a new <div> element immediately after each matched element.\r\n * @param content HTML string, DOM Node, or jBase collection.\r\n * @returns The current jBase instance.\r\n */\r\nexport function after(this: jBase, content: string | Node | jBase): jBase {\r\n if (typeof content === 'string') {\r\n const safeContent = sanitizeDangerousAttributes(content);\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n el.insertAdjacentHTML('afterend', safeContent);\r\n }\r\n });\r\n return this;\r\n }\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const fragment = normalizeToFragment(content, doc);\r\n const len = this.length;\r\n this.each(function(el, i) {\r\n if (el instanceof Element) {\r\n const contentToInsert = (i < len - 1) ? fragment.cloneNode(true) : fragment;\r\n el.after(contentToInsert);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Replaces the element with new content.\r\n * @example replaceWith('<div>New</div>') => Replaces each matched element with a new <div> element.\r\n * @param content The new content.\r\n * @returns The current jBase instance.\r\n */\r\nexport function replaceWith(this: jBase, content: string | Node | jBase): jBase {\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const fragment = normalizeToFragment(content, doc);\r\n const len = this.length;\r\n this.each(function(el, i) {\r\n if (el instanceof Element) {\r\n const contentToInsert = (i < len - 1) ? fragment.cloneNode(true) : fragment;\r\n el.replaceWith(contentToInsert);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Appends the selected elements to the end of a target element.\r\n * @example appendTo('#container') => Appends all matched elements to the element with id 'container'.\r\n * @param target CSS selector or DOM element.\r\n * @returns The current jBase instance.\r\n */\r\nexport function appendTo(this: jBase, target: string | Element): jBase {\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const parent = typeof target === 'string' ? doc.querySelector(target) : target;\r\n if (parent instanceof Element) {\r\n const fragment = doc.createDocumentFragment();\r\n this.each(function(el) {\r\n if (el instanceof Node) fragment.appendChild(el);\r\n });\r\n parent.appendChild(fragment);\r\n }\r\n return this;\r\n}\r\n\r\n/**\r\n * * Prepends the selected elements to the beginning of a target element.\r\n * @example prependTo('#container') => Prepends all matched elements to the element with id 'container', before its existing content.\r\n * @param target CSS selector or DOM element.\r\n * @returns The current jBase instance.\r\n */\r\nexport function prependTo(this: jBase, target: string | Element): jBase {\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const parent = typeof target === 'string' ? doc.querySelector(target) : target;\r\n if (parent instanceof Element) {\r\n const fragment = doc.createDocumentFragment();\r\n this.each(function(el) {\r\n if (el instanceof Node) fragment.appendChild(el);\r\n });\r\n parent.prepend(fragment);\r\n }\r\n return this;\r\n}\r\n\r\n/**\r\n * * Inserts the selected elements immediately before the target element.\r\n * @example insertBefore('#target') => Inserts all matched elements immediately before the element with id 'target'.\r\n * @param target CSS selector or DOM element.\r\n * @returns The current jBase instance.\r\n */\r\nexport function insertBefore(this: jBase, target: string | Element): jBase {\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const targetEl = typeof target === 'string' ? doc.querySelector(target) : target;\r\n if (targetEl instanceof Element) {\r\n const fragment = doc.createDocumentFragment();\r\n this.each(function(el) {\r\n if (el instanceof Node) fragment.appendChild(el);\r\n });\r\n targetEl.before(fragment);\r\n }\r\n return this;\r\n}\r\n\r\n/**\r\n * * Inserts the selected elements immediately after the target element.\r\n * @example insertAfter('#target') => Inserts all matched elements immediately after the element with id 'target'.\r\n * @param target CSS selector or DOM element.\r\n * @returns The current jBase instance.\r\n */\r\nexport function insertAfter(this: jBase, target: string | Element): jBase {\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n const targetEl = typeof target === 'string' ? doc.querySelector(target) : target;\r\n if (targetEl instanceof Element) {\r\n const fragment = doc.createDocumentFragment();\r\n this.each(function(el) {\r\n if (el instanceof Node) fragment.appendChild(el);\r\n });\r\n targetEl.after(fragment);\r\n }\r\n return this;\r\n}\r\n\r\n/**\r\n * * Wraps each selected element with the specified HTML structure.\r\n * @example wrap('<div class=\"box\"></div>') => Wraps each matched element with a <div class=\"box\"></div> element.\r\n * @param wrapperHtml HTML string defining the wrapper (e.g., `<div class=\"box\"></div>`).\r\n * @returns The current jBase instance.\r\n */\r\nexport function wrap(this: jBase, wrapperHtml: string): jBase {\r\n const doc = getDoc(this);\r\n if (!doc)\r\n return this;\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n const wrapper = parseHTML(wrapperHtml, doc);\r\n if (el.parentNode) {\r\n el.parentNode.insertBefore(wrapper, el);\r\n }\r\n wrapper.appendChild(el);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Removes the direct parent of the selected elements from the DOM.\r\n * * @example unwrap() => Removes the parent element of each matched element, effectively \"unwrapping\" it from its container.\r\n * @returns The current jBase instance.\r\n */\r\nexport function unwrap(this: jBase): jBase {\r\n const doc = getDoc(this);\r\n if (!doc) return this;\r\n const parents = new Set<Element>();\r\n this.each(function(el) {\r\n if (el instanceof Element && el.parentElement) {\r\n parents.add(el.parentElement);\r\n }\r\n });\r\n each(Array.from(parents), function(_index, parent) {\r\n const fragment = doc.createDocumentFragment();\r\n while (parent.firstChild) {\r\n fragment.appendChild(parent.firstChild);\r\n }\r\n parent.replaceWith(fragment);\r\n });\r\n return this;\r\n}", "/**\r\n * @file src/modules/dom/traversal.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category DOM\r\n * @description\r\n * * Methods for navigating the DOM tree (find, parent, children, siblings).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n * @requires ../../utils\r\n * * Utility functions (e.g., `each` for iteration).\r\n */\r\n\r\nimport { each } from '../../utils';\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Traverses the parents (heading toward the document root) of each element and finds the first element that matches the specified selector.\r\n * @example closest('.container') => For each matched element, finds the nearest ancestor with the class 'container'.\r\n * @param selector A string containing a selector expression.\r\n * @returns A new jBase instance containing the matched elements.\r\n */\r\nexport function closest(this: jBase, selector: string): jBase {\r\n const found: Element[] = [];\r\n\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n const match = el.closest(selector);\r\n if (match) {\r\n found.push(match);\r\n }\r\n }\r\n });\r\n\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets the direct parent of each element in the current set. Deduplicates results.\r\n * @example parent() => Returns a new jBase instance containing the parent elements of all matched elements, without duplicates.\r\n * @returns A new jBase instance containing the parent elements.\r\n */\r\nexport function parent(this: jBase): jBase {\r\n const parents: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element && el.parentElement) {\r\n parents.push(el.parentElement);\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(parents)]);\r\n}\r\n\r\n/**\r\n * * Gets the direct children of each element in the set, optionally filtered by a selector.\r\n * @example children() => Returns a new jBase instance containing all direct children of the matched elements.\r\n * @example children('.item') => Returns a new jBase instance containing only the direct children that match the selector '.item'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance containing the children.\r\n */\r\nexport function children(this: jBase, selector?: string): jBase {\r\n let allChildren: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n const kids = Array.from(el.children);\r\n allChildren = allChildren.concat(kids);\r\n }\r\n });\r\n\r\n if (selector) {\r\n allChildren = allChildren.filter(child => child.matches(selector));\r\n }\r\n\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction(allChildren);\r\n}\r\n\r\n/**\r\n * * Finds descendants (deep) that match the selector using `querySelectorAll`.\r\n * @example findAll('.item') => Returns a new jBase instance containing all descendant elements that match the selector '.item'.\r\n * @param selector The CSS selector to search for.\r\n * @returns A new jBase instance with the found elements.\r\n */\r\nexport function findAll(this: jBase, selector: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element || el instanceof Document) {\r\n const matches = el.querySelectorAll(selector);\r\n each(matches as any, function(_index, m) {\r\n found.push(m as Element);\r\n });\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Recursively gets ALL descendants (not just direct children).\r\n * @example descendants() => Returns a new jBase instance containing all descendant elements of the matched elements.\r\n * @returns A new jBase instance with all descendants.\r\n */\r\nexport function descendants(this: jBase): jBase {\r\n return this.findAll('*');\r\n}\r\n\r\n/**\r\n * * Gets all ancestors (parents, grandparents...) up to the root. Optionally filtered.\r\n * @example parents() => Returns a new jBase instance containing all ancestors of the matched elements, without duplicates.\r\n * @example parents('.container') => Returns a new jBase instance containing only the ancestors that match the selector '.container'.\r\n * @param selector (Optional) Filter selector for ancestors.\r\n * @returns A new jBase instance with the ancestors.\r\n */\r\nexport function parents(this: jBase, selector?: string): jBase {\r\n const ancestors: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n let curr = el.parentElement;\r\n while (curr) {\r\n if (!selector || curr.matches(selector)) {\r\n ancestors.push(curr);\r\n }\r\n curr = curr.parentElement;\r\n }\r\n }\r\n });\r\n\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(ancestors)]);\r\n}\r\n\r\n/**\r\n * * Gets all ancestors UP TO (but not including) an element matching the selector.\r\n * @example parentsUntil('.container') => Returns a new jBase instance containing all ancestors of the matched elements up to (but not including) the nearest ancestor that matches '.container'.\r\n * @example parentsUntil('.container', '.item') => Returns a new jBase instance containing ancestors up to '.container' that also match '.item'.\r\n * @param selector The selector where traversal stops.\r\n * @param filter (Optional) Filter for the collected elements.\r\n * @returns A new jBase instance.\r\n */\r\nexport function parentsUntil(this: jBase, selector: string, filter?: string): jBase {\r\n const ancestors: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n let curr = el.parentElement;\r\n while (curr && !curr.matches(selector)) {\r\n if (!filter || curr.matches(filter)) {\r\n ancestors.push(curr);\r\n }\r\n curr = curr.parentElement;\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(ancestors)]);\r\n}\r\n\r\n/**\r\n * * Recursively finds descendants but stops traversing a branch if `untilSelector` is met. Useful for finding nested elements without going too deep (e.g., nested forms).\r\n * @example descendantsUntil('.stop-here') => Returns a new jBase instance containing all descendant elements of the matched elements, but does not include any elements that are descendants of an element matching '.stop-here'.\r\n * @example descendantsUntil('.stop-here', '.item') => Returns a new jBase instance containing descendant elements that match '.item', but does not include any elements that are descendants of an element matching '.stop-here'.\r\n * @param untilSelector The selector that stops recursion in a branch.\r\n * @param filter (Optional) Selector to filter collected elements.\r\n * @returns A new jBase instance.\r\n */\r\nexport function descendantsUntil(this: jBase, untilSelector: string, filter?: string): jBase {\r\n const found: Element[] = [];\r\n\r\n const traverse = (parent: Element) => {\r\n const kids = parent.children;\r\n for (let i = 0; i < kids.length; i++) {\r\n const child = kids[i];\r\n if (child.matches(untilSelector)) {\r\n continue;\r\n }\r\n if (!filter || child.matches(filter)) {\r\n found.push(child);\r\n }\r\n traverse(child);\r\n }\r\n };\r\n this.each(function(el) {\r\n if (el instanceof Element) traverse(el);\r\n });\r\n\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets the immediately following sibling.\r\n * @example next() => Returns a new jBase instance containing the immediately following sibling of each matched element.\r\n * @example next('.item') => Returns a new jBase instance containing the immediately following sibling that matches the selector '.item'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\nexport function next(this: jBase, selector?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element && el.nextElementSibling) {\r\n const nextEl = el.nextElementSibling;\r\n if (!selector || nextEl.matches(selector)) {\r\n found.push(nextEl);\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets the immediately preceding sibling.\r\n * @example prev() => Returns a new jBase instance containing the immediately preceding sibling of each matched element.\r\n * @example prev('.item') => Returns a new jBase instance containing the immediately preceding sibling that matches the selector '.item'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\nexport function prev(this: jBase, selector?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element && el.previousElementSibling) {\r\n const prevEl = el.previousElementSibling;\r\n if (!selector || prevEl.matches(selector)) {\r\n found.push(prevEl);\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Alias for `next()`.\r\n */\r\nexport function nextSibling(this: jBase, selector?: string): jBase {\r\n return this.next(selector);\r\n}\r\n\r\n/**\r\n * * Alias for `prev()`.\r\n */\r\nexport function prevSibling(this: jBase, selector?: string): jBase {\r\n return this.prev(selector);\r\n}\r\n\r\n/**\r\n * * Alias for `next()`.\r\n */\r\nexport function sibling(this: jBase, selector?: string): jBase {\r\n return this.next(selector);\r\n}\r\n\r\n/**\r\n * * Gets ALL following siblings.\r\n * @example nextAll() => Returns a new jBase instance containing all following siblings of each matched element.\r\n * @example nextAll('.item') => Returns a new jBase instance containing all following siblings that match the selector '.item'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\nexport function nextAll(this: jBase, selector?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n let curr = el.nextElementSibling;\r\n while (curr) {\r\n if (!selector || curr.matches(selector)) {\r\n found.push(curr);\r\n }\r\n curr = curr.nextElementSibling;\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets ALL preceding siblings.\r\n * @example prevAll() => Returns a new jBase instance containing all preceding siblings of each matched element.\r\n * @example prevAll('.item') => Returns a new jBase instance containing all preceding siblings that match the selector '.item'.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\nexport function prevAll(this: jBase, selector?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n let curr = el.previousElementSibling;\r\n while (curr) {\r\n if (!selector || curr.matches(selector)) {\r\n found.push(curr);\r\n }\r\n curr = curr.previousElementSibling;\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets ALL siblings (previous and next), excluding itself.\r\n * @example siblings() => Returns a new jBase instance containing all siblings of each matched element, without duplicates.\r\n * @example siblings('.item') => Returns a new jBase instance containing all siblings that match the selector '.item', without duplicates.\r\n * @param selector (Optional) Filter selector.\r\n * @returns A new jBase instance.\r\n */\r\nexport function siblings(this: jBase, selector?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element && el.parentElement) {\r\n const children = Array.from(el.parentElement.children);\r\n each(children, function(_index, child) {\r\n if (child !== el) {\r\n if (!selector || child.matches(selector)) {\r\n found.push(child);\r\n }\r\n }\r\n });\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets all following siblings UNTIL a selector is met (exclusive).\r\n * @example nextUntil('.stop-here') => Returns a new jBase instance containing all following siblings of the matched elements up to (but not including) the nearest sibling that matches '.stop-here'.\r\n * @example nextUntil('.stop-here', '.item') => Returns a new jBase instance containing following siblings that match '.item' up to (but not including) the nearest sibling that matches '.stop-here'.\r\n * @param untilSelector The selector that stops the search.\r\n * @param filter (Optional) Filter for the found elements.\r\n * @returns A new jBase instance.\r\n */\r\nexport function nextUntil(this: jBase, untilSelector: string, filter?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n let curr = el.nextElementSibling;\r\n while (curr && !curr.matches(untilSelector)) {\r\n if (!filter || curr.matches(filter)) {\r\n found.push(curr);\r\n }\r\n curr = curr.nextElementSibling;\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Gets all preceding siblings UNTIL a selector is met (exclusive).\r\n * @example prevUntil('.stop-here') => Returns a new jBase instance containing all preceding siblings of the matched elements up to (but not including) the nearest sibling that matches '.stop-here'.\r\n * @example prevUntil('.stop-here', '.item') => Returns a new jBase instance containing preceding siblings that match '.item' up to (but not including) the nearest sibling that matches '.stop-here'.\r\n * @param untilSelector The selector that stops the search.\r\n * @param filter (Optional) Filter for the found elements.\r\n * @returns A new jBase instance.\r\n */\r\nexport function prevUntil(this: jBase, untilSelector: string, filter?: string): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el) {\r\n if (el instanceof Element) {\r\n let curr = el.previousElementSibling;\r\n while (curr && !curr.matches(untilSelector)) {\r\n if (!filter || curr.matches(filter)) {\r\n found.push(curr);\r\n }\r\n curr = curr.previousElementSibling;\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction([...new Set(found)]);\r\n}\r\n\r\n/**\r\n * * Reduces the set to the element at the specified index. Supports negative indices.\r\n * @example eq(0) => Returns a new jBase instance containing only the first element of the matched set.\r\n * @example eq(-1) => Returns a new jBase instance containing only the last element of the matched set.\r\n * @param index The position (0-based). Negative values count from the end.\r\n * @returns A new jBase instance containing the single element (or empty).\r\n */\r\nexport function eq(this: jBase, index: number): jBase {\r\n const len = this.length;\r\n const idx = index < 0 ? len + index : index;\r\n const el = this[idx];\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction(el ? [el] : []);\r\n}\r\n\r\n/**\r\n * * Reduces the set of matched elements to the first one in the collection.\r\n * @example first() => Returns a new jBase instance containing only the first element of the matched set.\r\n * @param selector (Optional) Filter selector to find the first matching element.\r\n * @returns A new jBase instance containing only the first element, allowing for further method chaining.\r\n */\r\nexport function first(this: jBase): jBase {\r\n return this.eq(0);\r\n}\r\n\r\n/**\r\n * * Reduces the set of matched elements to the final one in the collection.\r\n * @example last() => Returns a new jBase instance containing only the last element of the matched set.\r\n * @returns A new jBase instance containing only the last element, allowing for further method chaining.\r\n */\r\nexport function last(this: jBase): jBase {\r\n return this.eq(-1);\r\n}\r\n\r\n/**\r\n * * Filters elements based on a selector or a function.\r\n * @example filterBy('.active') => Returns a new jBase instance containing only the elements that match the selector '.active'.\r\n * @example filterBy((index, el) => el.textContent.includes('Hello')) => Returns a new jBase instance containing only the elements for which the function returns true.\r\n * @param selectorOrFn CSS selector string or filter function.\r\n * @returns A new jBase instance with filtered elements.\r\n */\r\nexport function filterBy(this: jBase, selectorOrFn: string | ((index: number, element: Element) => boolean)): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el, index) {\r\n if (el instanceof Element) {\r\n if (typeof selectorOrFn === 'string') {\r\n if (el.matches(selectorOrFn)) {\r\n found.push(el);\r\n }\r\n } else if (typeof selectorOrFn === 'function') {\r\n if (selectorOrFn.call(el, index, el)) {\r\n found.push(el);\r\n }\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction(found);\r\n}\r\n\r\n/**\r\n * * Removes elements from the set that match the selector or function (Inverse of filterBy).\r\n * @example not('.active') => Returns a new jBase instance containing only the elements that do NOT match the selector '.active'.\r\n * @example not((index, el) => el.textContent.includes('Hello')) => Returns a new jBase instance containing only the elements for which the function returns false.\r\n * @param selectorOrFn CSS selector string or filter function.\r\n * @returns A new jBase instance with remaining elements.\r\n */\r\nexport function not(this: jBase, selectorOrFn: string | ((index: number, element: Element) => boolean)): jBase {\r\n const found: Element[] = [];\r\n this.each(function(el, index) {\r\n if (el instanceof Element) {\r\n if (typeof selectorOrFn === 'string') {\r\n if (!el.matches(selectorOrFn)) {\r\n found.push(el);\r\n }\r\n } else if (typeof selectorOrFn === 'function') {\r\n if (!selectorOrFn.call(el, index, el)) {\r\n found.push(el);\r\n }\r\n }\r\n }\r\n });\r\n const Construction = this.constructor as new (args: any) => jBase;\r\n return new Construction(found);\r\n}", "/**\r\n * @file src/modules/dom/states.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category DOM\r\n * @description\r\n * * Methods for checking element states (e.g., visibility, checked, disabled).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\n\r\n/**\r\n * * Gets or sets the 'checked' state of checkboxes and radio buttons.\r\n * @example checked() => Gets the checked state of the first matched element.\r\n * @example checked(true) => Checks the first matched element.\r\n * @param state (Optional) `true` to check, `false` to uncheck. If undefined, acts as a getter.\r\n * @returns Boolean (getter) or the current jBase instance (setter).\r\n */\r\nexport function checked(this: jBase, state?: boolean): boolean | jBase {\r\n if (state === undefined) {\r\n const el = this[0];\r\n return (el instanceof HTMLInputElement) ? el.checked : false;\r\n }\r\n this.each(function(el) {\r\n if (el instanceof HTMLInputElement)\r\n el.checked = state;\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Gets or sets the 'selected' state of `<option>` elements.\r\n * @example selected() => Gets the selected state of the first matched option element.\r\n * @example selected(true) => Selects the first matched option element.\r\n * @param state (Optional) `true` to select, `false` to deselect. If undefined, acts as a getter.\r\n * @returns Boolean (getter) or the current jBase instance (setter).\r\n */\r\nexport function selected(this: jBase, state?: boolean): boolean | jBase {\r\n if (state === undefined) {\r\n const el = this[0];\r\n return (el instanceof HTMLOptionElement) ? el.selected : false;\r\n }\r\n this.each(function(el) {\r\n if (el instanceof HTMLOptionElement)\r\n el.selected = state;\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Enables or disables form fields and buttons. Additionally toggles the CSS class `.disabled`.\r\n * @example disabled() => Gets the disabled state of the first matched element.\r\n * @example disabled(true) => Disables the first matched element.\r\n * @param state (Optional) `true` to disable, `false` to enable. If undefined, acts as a getter.\r\n * @returns Boolean (getter) or the current jBase instance (setter).\r\n */\r\nexport function disabled(this: jBase, state?: boolean): boolean | jBase {\r\n if (state === undefined) {\r\n const el = this[0];\r\n return (el instanceof HTMLElement && 'disabled' in el) ? (el as any).disabled : false;\r\n }\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement && 'disabled' in el) {\r\n (el as any).disabled = state;\r\n if (state)\r\n el.classList.add('disabled');\r\n else\r\n el.classList.remove('disabled');\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * ALIAS for .checked(true). Checks the matched elements.\r\n * @example check() => Checks all matched checkboxes/radio buttons.\r\n * @returns The current jBase instance.\r\n */\r\nexport function check(this: jBase): jBase {\r\n return checked.call(this, true) as jBase;\r\n}\r\n\r\n/**\r\n * * ALIAS for .checked(false). Unchecks the matched elements.\r\n * @example uncheck() => Unchecks all matched checkboxes/radio buttons.\r\n * @returns The current jBase instance.\r\n */\r\nexport function uncheck(this: jBase): jBase {\r\n return checked.call(this, false) as jBase;\r\n}\r\n\r\n/**\r\n * * ALIAS for .selected(true). Selects the matched <option> elements.\r\n * @example select() => Selects all matched option elements.\r\n * @returns The current jBase instance.\r\n */\r\nexport function select(this: jBase): jBase {\r\n return selected.call(this, true) as jBase;\r\n}\r\n\r\n/**\r\n * * ALIAS for .disabled(true). Disables the matched elements and adds the 'disabled' class.\r\n * @example disable() => Disables all matched elements.\r\n * @returns The current jBase instance.\r\n */\r\nexport function disable(this: jBase): jBase {\r\n return disabled.call(this, true) as jBase;\r\n}\r\n\r\n/**\r\n * * ALIAS for .disabled(false). Enables the matched elements and removes the 'disabled' class.\r\n * @example enable() => Enables all matched elements.\r\n * @returns The current jBase instance.\r\n */\r\nexport function enable(this: jBase): jBase {\r\n return disabled.call(this, false) as jBase;\r\n}", "/**\r\n * @file src/modules/dom/index.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category DOM\r\n * @description\r\n * * Central entry point for DOM operations. Aggregates methods for attributes, content, manipulation, traversal, and states.\r\n * @requires ./attributes\r\n * * Attribute and value manipulation.\r\n * @requires ./content\r\n * * Content handling (html, text).\r\n * @requires ./manipulation\r\n * * DOM manipulation (append, remove, etc.).\r\n * @requires ./traversal\r\n * * Tree traversal (find, parent, children).\r\n * @requires ./states\r\n * * State checks (checked, disabled).\r\n */\r\n\r\nimport * as attributeMethods from './attributes';\r\nimport * as contentMethods from './content';\r\nimport * as manipulationMethods from './manipulation';\r\nimport * as traversalMethods from './traversal';\r\nimport * as stateMethods from './states';\r\n\r\n/**\r\n * * Aggregation of all DOM methods. Bundles specialized sub-modules into a single interface. Used to extend the jBase prototype centrally via Object.assign.\r\n */\r\nexport const domMethods = {\r\n ...attributeMethods,\r\n ...contentMethods,\r\n ...manipulationMethods,\r\n ...traversalMethods,\r\n ...stateMethods\r\n};", "/**\r\n * @file src/modules/effects/slide.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Effects\r\n * @description\r\n * * Methods for horizontal sliding effects (slideIn, slideOut, slideToggle).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n * @requires ../../utils\r\n * * Uses utility functions for environment checks.\r\n * @requires ./types\r\n * * Type definitions for slide options.\r\n */\r\n\r\nimport { isBrowser } from '../../utils';\r\nimport { jBase } from '../../core';\r\nimport { SlideOptions } from './types';\r\n\r\n\r\n\r\n/**\r\n * * Slides an element (e.g., a menu) into view. Sets `transform: translateX(0)`.\r\n * @example slideIn() => Slides in all matched elements over 300ms.\r\n * @example slideIn({ duration: 500 }) => Slides in all matched elements over 500ms.\r\n * @param options Direction ('left'|'right') and duration in ms.\r\n * @returns The current jBase instance.\r\n */\r\nexport function slideIn(this: jBase, options: SlideOptions = {}): jBase {\r\n if (!isBrowser())\r\n return this;\r\n const { duration = 300 } = options;\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n el.style.willChange = 'transform';\r\n el.style.transition = `transform ${duration}ms cubic-bezier(0.4, 0.0, 0.2, 1)`;\r\n\r\n requestAnimationFrame(() => {\r\n el.style.transform = 'translateX(0%)';\r\n });\r\n\r\n el.setAttribute('data-slide-state', 'open');\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Slides an element out of view.\r\n * @example slideOut() => Slides out all matched elements to the left over 300ms.\r\n * @example slideOut({ direction: 'right', duration: 500 }) => Slides out all matched elements to the right over 500ms.\r\n * @param options Direction ('left'|'right') and duration in ms.\r\n * @returns The current jBase instance.\r\n */\r\nexport function slideOut(this: jBase, options: SlideOptions = {}): jBase {\r\n if (!isBrowser())\r\n return this;\r\n const { direction = 'left', duration = 300 } = options;\r\n const translateValue = direction === 'left' ? '-100%' : '100%';\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n el.style.willChange = 'transform';\r\n el.style.transition = `transform ${duration}ms cubic-bezier(0.4, 0.0, 0.2, 1)`;\r\n\r\n requestAnimationFrame(() => {\r\n el.style.transform = `translateX(${translateValue})`;\r\n });\r\n\r\n el.setAttribute('data-slide-state', 'closed');\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Toggles between slideIn and slideOut based on the current state.\r\n * @example slideToggle() => Slides in hidden elements and slides out visible elements to the left over 300ms.\r\n * @example slideToggle({ direction: 'right', duration: 500 }) => Slides in hidden elements and slides out visible elements to the right over 500ms.\r\n * @param options Direction ('left'|'right') and duration in ms.\r\n * @returns The current jBase instance.\r\n */\r\nexport function slideToggle(this: jBase, options: SlideOptions = {}): jBase {\r\n if (!isBrowser())\r\n return this;\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n const state = el.getAttribute('data-slide-state');\r\n const currentTransform = el.style.transform;\r\n\r\n if (state === 'open' || currentTransform === 'translateX(0%)') {\r\n const wrapper = new (this.constructor as any)(el);\r\n wrapper.slideOut(options);\r\n } else {\r\n const wrapper = new (this.constructor as any)(el);\r\n wrapper.slideIn(options);\r\n }\r\n }\r\n });\r\n return this;\r\n}", "/**\r\n * @file src/modules/effects/vertical.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Effects\r\n * @description\r\n * * Methods for vertical sliding effects (slideDown, slideUp, slideToggle).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n * @requires ../../utils\r\n * * Utility function to check for browser environment.\r\n * @requires ./types\r\n * * Type definitions for effect options.\r\n */\r\n\r\nimport { isBrowser } from '../../utils';\r\nimport { jBase } from '../../core';\r\nimport { SlideVerticalOptions } from './types';\r\n\r\n/**\r\n * * Slides an element down (animates height from 0 to auto). Sets `display` property and animates height.\r\n * @example slideDown() => Slides down all matched elements over 300ms with display: block.\r\n * @example slideDown({ duration: 500, displayType: 'inline-block' }) => Slides down all matched elements over 500ms with display: inline-block.\r\n * @param options Animation duration and display type.\r\n * @returns The current jBase instance.\r\n */\r\nexport function slideDown(this: jBase, options: SlideVerticalOptions = {}): jBase {\r\n if (!isBrowser())\r\n return this;\r\n const { duration = 300, displayType = 'block' } = options;\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n if (window.getComputedStyle(el).display !== 'none')\r\n return;\r\n\r\n el.style.display = displayType;\r\n const height = el.scrollHeight;\r\n\r\n el.style.height = '0px';\r\n el.style.overflow = 'hidden'; \r\n el.style.transition = `height ${duration}ms ease-in-out`;\r\n\r\n void el.offsetHeight;\r\n\r\n el.style.height = `${height}px`;\r\n\r\n setTimeout(() => {\r\n el.style.height = 'auto';\r\n el.style.overflow = 'visible';\r\n el.style.transition = '';\r\n }, duration);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Slides an element up (animates height to 0). Sets `display: none` after animation.\r\n * @example slideUp() => Slides up all matched elements over 300ms with display: none.\r\n * @example slideUp({ duration: 500 }) => Slides up all matched elements over 500ms with display: none.\r\n * @param options Animation duration.\r\n * @returns The current jBase instance.\r\n */\r\nexport function slideUp(this: jBase, options: SlideVerticalOptions = {}): jBase {\r\n if (!isBrowser())\r\n return this;\r\n const { duration = 300 } = options;\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n el.style.height = `${el.scrollHeight}px`;\r\n el.style.overflow = 'hidden';\r\n el.style.transition = `height ${duration}ms ease-in-out`;\r\n\r\n void el.offsetHeight;\r\n\r\n el.style.height = '0px';\r\n\r\n setTimeout(() => {\r\n el.style.display = 'none';\r\n el.style.height = '';\r\n el.style.overflow = '';\r\n el.style.transition = '';\r\n }, duration);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Toggles between slideDown and slideUp based on the display state.\r\n * @example slideToggle() => Slides in hidden elements and slides out visible elements over 300ms.\r\n * @example slideToggle({ duration: 500 }) => Slides in hidden elements and slides out visible elements over 500ms.\r\n * @param options Animation duration.\r\n * @returns The current jBase instance.\r\n */\r\nexport function slideToggleBox(this: jBase, options: SlideVerticalOptions = {}): jBase {\r\n if (!isBrowser())\r\n return this;\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n const display = window.getComputedStyle(el).display;\r\n const wrapper = new (this.constructor as any)(el);\r\n\r\n if (display === 'none') {\r\n wrapper.slideDown(options);\r\n } else {\r\n wrapper.slideUp(options);\r\n }\r\n }\r\n });\r\n return this;\r\n}", "/**\r\n * @file src/modules/effects/fade.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Effects\r\n * @description\r\n * * Methods for fading elements in and out (fadeIn, fadeOut, fadeToggle).\r\n * @requires ../../core\r\n * * Depends on the core jBase class for type definitions.\r\n * @requires ../../utils\r\n * * Uses utility functions for environment checks.\r\n * @requires ./types\r\n * * Type definitions for fade options.\r\n */\r\n\r\nimport { jBase } from '../../core';\r\nimport { isBrowser } from '../../utils';\r\nimport { FadeOptions } from './types';\r\n\r\n/**\r\n * * Fades an element in (Opacity 0 -> 1).\r\n * @example fadeIn() => Fades in all matched elements over 300ms with display: block.\r\n * @example fadeIn({ duration: 500, displayType: 'inline-block' }) => Fades in all matched elements over 500ms with display: inline-block.\r\n * @example fadeIn(500) => Fades in over 500ms.\r\n * @param options Duration in ms (default: 300) and display type (default: 'block').\r\n * @returns The current jBase instance.\r\n */\r\nexport function fadeIn(this: jBase, options: FadeOptions | number = {}): jBase {\r\n if (!isBrowser()) return this;\r\n const duration = typeof options === 'number' ? options : (options.duration || 300);\r\n const displayType = typeof options === 'object' && options.displayType ? options.displayType : 'block';\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n if ((el as any)._jbaseFadeTimer) {\r\n clearTimeout((el as any)._jbaseFadeTimer);\r\n }\r\n\r\n el.style.opacity = '0';\r\n el.style.display = displayType;\r\n el.style.transition = `opacity ${duration}ms ease-in-out`;\r\n void el.offsetHeight;\r\n \r\n requestAnimationFrame(() => {\r\n el.style.opacity = '1';\r\n });\r\n\r\n (el as any)._jbaseFadeTimer = setTimeout(() => {\r\n el.style.transition = '';\r\n delete (el as any)._jbaseFadeTimer;\r\n }, duration);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Fades an element out (Opacity 1 -> 0) and sets display: none afterwards.\r\n * @example fadeOut() => Fades out all matched elements over 300ms with display: none.\r\n * @example fadeOut({ duration: 500 }) => Fades out all matched elements over 500ms with display: none.\r\n * @example fadeOut(500) => Fades out over 500ms.\r\n * @param options Duration in ms (default: 300).\r\n * @returns The current jBase instance.\r\n */\r\nexport function fadeOut(this: jBase, options: FadeOptions | number = {}): jBase {\r\n if (!isBrowser()) return this;\r\n \r\n const duration = typeof options === 'number' ? options : (options.duration || 300);\r\n\r\n this.each(function(el) {\r\n if (el instanceof HTMLElement) {\r\n if ((el as any)._jbaseFadeTimer) {\r\n clearTimeout((el as any)._jbaseFadeTimer);\r\n }\r\n\r\n el.style.opacity = '1';\r\n el.style.transition = `opacity ${duration}ms ease-in-out`;\r\n void el.offsetHeight;\r\n \r\n requestAnimationFrame(() => {\r\n el.style.opacity = '0';\r\n });\r\n (el as any)._jbaseFadeTimer = setTimeout(() => {\r\n el.style.display = 'none';\r\n el.style.transition = '';\r\n delete (el as any)._jbaseFadeTimer;\r\n }, duration);\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * Toggles between fadeIn and fadeOut based on the current display state.\r\n * @example fadeToggle() => Fades in hidden elements and fades out visible elements over 300ms.\r\n * @example fadeToggle({ duration: 500 }) => Fades in hidden elements and fades out visible elements over 500ms.\r\n * @example fadeToggle({ duration: 500, displayType: 'inline-block' }) => Fades in all matched elements over 500ms with display: inline-block.\r\n * @example fadeToggle(500) => Fades in over 500ms.\r\n * @param options Animation options.\r\n * @returns The current jBase instance.\r\n */\r\nexport function fadeToggle(this: jBase, options: FadeOptions | number = {}): jBase {\r\n if (!isBrowser()) return this;\r\n this.each((el) => {\r\n if (el instanceof HTMLElement) {\r\n const display = window.getComputedStyle(el).display;\r\n const wrapper = new (this.constructor as any)(el);\r\n if (display === 'none') {\r\n wrapper.fadeIn(options);\r\n } else {\r\n wrapper.fadeOut(options);\r\n }\r\n }\r\n });\r\n return this;\r\n}\r\n\r\n/**\r\n * * ALIAS for fadeIn.\r\n */\r\nexport const show = fadeIn;\r\n\r\n/**\r\n * * ALIAS for fadeOut.\r\n */\r\nexport const hide = fadeOut;\r\n\r\n/**\r\n * * ALIAS for fadeToggle.\r\n */\r\nexport const toggle = fadeToggle;\r\n", "/**\r\n * @file src/modules/effects/index.ts\r\n * @version 2.0.3\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Effects\r\n * @description\r\n * * Central entry point for visual effects. Aggregates slide, fade, and vertical animation modules.\r\n * @requires ./slide\r\n * * Horizontal slide effects (slideIn, slideOut).\r\n * @requires ./vertical\r\n * * Vertical slide effects / Accordion (slideDown, slideUp).\r\n * @requires ./fade\r\n * * Opacity fade effects (fadeIn, fadeOut).\r\n */\r\n\r\nimport * as slideMethods from './slide';\r\nimport * as verticalMethods from './vertical';\r\nimport * as fadeMethods from './fade';\r\n\r\n/**\r\n * * Aggregation of all visual effect methods. Bundles sliding and fading animations to extend the jBase prototype.\r\n */\r\nexport const effectMethods = {\r\n ...slideMethods,\r\n ...verticalMethods,\r\n ...fadeMethods\r\n};", "/**\r\n * @file src/modules/http/post.ts\r\n * @version 2.0.5\r\n * @since 2.0.2\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category HTTP\r\n * * @description\r\n * * Abstraction for HTTP POST requests.\r\n */\r\n\r\n/**\r\n * * Performs an asynchronous HTTP POST request to the specified URL. Automatically sets the 'Content-Type' header to 'application/json' and serializes the body.\r\n * @example const response = await post('/api/login', { username: 'user', password: 'pass' });\r\n * @template T The expected response type (Generic).\r\n * @param url The target URL for the request.\r\n * @param body The data to send (automatically JSON serialized). Default is {}.\r\n * @param option Optional RequestInit object to customize the fetch request.\r\n * @returns A Promise resolving with the deserialized JSON response of type T.\r\n * @throws Error if the HTTP status code is not in the range 200-299.\r\n */\r\nexport async function post<T>(url: string, body: any = {}, option?: RequestInit): Promise<T> {\r\n const fetchOptions: RequestInit = { ...option };\r\n if (fetchOptions.method?.toLowerCase() !== 'post') {\r\n fetchOptions.method = 'post';\r\n }\r\n if (!fetchOptions.signal) {\r\n fetchOptions.signal = AbortSignal.timeout(5000);\r\n }\r\n const response = await fetch(url, {\r\n ...fetchOptions,\r\n headers: { 'Content-Type': 'application/json' },\r\n body: JSON.stringify(body)\r\n });\r\n\r\n if (response.status === 204) {\r\n const text = await response.text();\r\n return text ? JSON.parse(text) : {} as T;\r\n }\r\n\r\n if (!response.ok) {\r\n throw new Error(`HTTP Error: ${response.status}`);\r\n }\r\n\r\n const text = await response.text();\r\n try {\r\n return text ? JSON.parse(text) : {} as T;\r\n } catch (e) {\r\n return text as unknown as T; \r\n }\r\n}", "/**\r\n * @file src/modules/http/upload.ts\r\n * @version 2.0.0\r\n * @since 2.3.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category HTTP\r\n * * @description\r\n * * Abstraction for HTTP POST requests.\r\n */\r\n\r\n/**\r\n * * Performs a multipart/form-data upload with precise progress tracking.\r\n * * Uses XMLHttpRequest under the hood because the native Fetch API lacks upload progress support.\r\n * @example\r\n * const fileInput = $('input[type=\"file\"]')[0] as HTMLInputElement;\r\n * if (fileInput && fileInput.files?.length) {\r\n * await $.http.upload('/upload', fileInput.files[0], (percentage) => {\r\n * // Update a progress bar using jBase\r\n * $('#progress-bar').css('width', `${percentage}%`);\r\n * });\r\n * }\r\n * @template T The expected response type (Generic).\r\n * @param url The target endpoint.\r\n * @param data A FormData object or a single File.\r\n * @param onProgress Optional callback receiving the progress percentage (0-100), loaded bytes, and total bytes.\r\n * @returns A Promise resolving to the parsed JSON response.\r\n */\r\nexport async function upload<T>(url: string, data: FormData | File, onProgress?: (percentage: number, loaded: number, total: number) => void): Promise<T> {\r\n return new Promise((resolve, reject) => {\r\n const xhr = new XMLHttpRequest();\r\n xhr.open('POST', url);\r\n if (onProgress) {\r\n xhr.upload.onprogress = (event) => {\r\n if (event.lengthComputable) {\r\n const percentage = Math.round((event.loaded / event.total) * 100);\r\n onProgress(percentage, event.loaded, event.total);\r\n }\r\n };\r\n }\r\n xhr.onload = () => {\r\n if (xhr.status >= 200 && xhr.status < 300) {\r\n const text = xhr.responseText;\r\n try {\r\n resolve(text ? JSON.parse(text) : {} as T);\r\n } catch (e) {\r\n resolve(text as unknown as T);\r\n }\r\n } else {\r\n reject(new Error(`HTTP Error: ${xhr.status}`));\r\n }\r\n };\r\n xhr.onerror = () => {\r\n reject(new Error('Network Error during upload'));\r\n };\r\n let payload: FormData;\r\n if (data instanceof File) {\r\n payload = new FormData();\r\n payload.append('file', data);\r\n } else {\r\n payload = data;\r\n }\r\n xhr.send(payload);\r\n });\r\n}", "/**\r\n * @file src/modules/http/index.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category HTTP\r\n * @description\r\n * * Central entry point for HTTP requests. Aggregates GET and POST methods.\r\n * @requires ./get\r\n * * HTTP GET methods (get, getText).\r\n * @requires ./post\r\n * * HTTP POST methods.\r\n * @requires ./upload\r\n * * HTTP file upload method with progress tracking.\r\n */\r\n\r\nimport * as getMethods from './get';\r\nimport * as postMethods from './post';\r\nimport * as uploadMethods from './upload';\r\n\r\n/**\r\n * * The central HTTP client of the framework. Aggregates all HTTP methods (GET, POST, etc.) into a unified interface. Acts as a wrapper around the native `fetch` API to simplify JSON parsing, error handling, and typing.\r\n */\r\nexport const http = {\r\n ...getMethods,\r\n ...postMethods,\r\n ...uploadMethods\r\n};", "/**\r\n * @file src/modules/data/arrays.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Data\r\n * @description\r\n * * Utility functions for array manipulation and data processing.\r\n * @requires ./types\r\n * * Depends on types.\r\n */\r\n\r\nimport { MatchMode } from './types';\r\n\r\n/**\r\n * * Splits an array into smaller groups (chunks). Ideal for pagination or grid layouts.\r\n * @example chunk([1, 2, 3, 4, 5], 2) => [[1, 2], [3, 4], [5]]\r\n * @template T The type of the items in the array.\r\n * @param array The source array.\r\n * @param size The size of each chunk.\r\n * @returns An array of arrays.\r\n */\r\nexport function chunk<T>(array: T[], size: number): T[][] {\r\n const chunks: T[][] = [];\r\n for (let i = 0; i < array.length; i += size) {\r\n chunks.push(array.slice(i, i + size));\r\n }\r\n return chunks;\r\n}\r\n\r\n/**\r\n * * Merges multiple arrays into a single flat array.\r\n * @example mergeArray([1, 2], [3, 4], [5]) => [1, 2, 3, 4, 5]\r\n * @template T The type of the items in the arrays.\r\n * @param arrays A list of arrays.\r\n * @returns A new, merged array.\r\n */\r\nexport function mergeArray<T>(...arrays: T[][]): T[] {\r\n return [].concat(...(arrays as any));\r\n}\r\n\r\n/**\r\n * * ALIAS for mergeArray (Consistency with object.merge)\r\n */\r\nexport const merge = mergeArray;\r\n\r\n/**\r\n * * Safely adds an element at a specific position without mutating the original array (Immutable).\r\n * @example add([1, 2, 4], 3, 2) => [1, 2, 3, 4]\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param item The item to add.\r\n * @param index The position (default: end). Negative values count from the back (-1 = before the last one).\r\n * @returns A new array including the element.\r\n */\r\nexport function add<T>(array: T[], item: T, index: number = array.length): T[] {\r\n const copy = [...array];\r\n const idx = index < 0 ? array.length + index + 1 : index;\r\n copy.splice(idx, 0, item);\r\n return copy;\r\n}\r\n\r\n/**\r\n * * Clears the array and returns a new empty array (Immutable).\r\n * @example clear([1, 2, 3]) => []\r\n * @template T The type of the items in the array.\r\n * @param array The array to clear.\r\n * @returns A new empty array.\r\n */\r\nexport function clear<T>(array: T[]): T[] {\r\n return [];\r\n}\r\n\r\n/**\r\n * * ALIAS for clear.\r\n */\r\nexport const empty = clear;\r\n\r\n/**\r\n * * Creates a new array containing only the elements at the specified indices (Allowlist).\r\n * * Mirrors object.pick.\r\n * @example pick(['a', 'b', 'c', 'd'], [0, 2]) => ['a', 'c']\r\n * @template T The type of the items in the array.\r\n * @param array The source array.\r\n * @param indices Array of indices to keep.\r\n * @returns A new array with selected elements.\r\n */\r\nexport function pick<T>(array: T[], indices: number[]): T[] {\r\n return array.filter((_, index) => indices.includes(index));\r\n}\r\n\r\n/**\r\n * * Creates a new array containing all elements EXCEPT those at the specified indices (Blocklist).\r\n * * Mirrors object.omit.\r\n * @example omit(['a', 'b', 'c', 'd'], [1, 3]) => ['a', 'c']\r\n * @template T The type of the items in the array.\r\n * @param array The source array.\r\n * @param indices Array of indices to remove.\r\n * @returns A new array without the specified elements.\r\n */\r\nexport function omit<T>(array: T[], indices: number[]): T[] {\r\n return array.filter((_, index) => !indices.includes(index));\r\n}\r\n\r\n/**\r\n * * Safely retrieves a value from a nested array/object structure (Safe Navigation).\r\n * * Mirrors object.get.\r\n * @example get(users, '0.profile.name') => Returns the name of the first user.\r\n * @param array The array.\r\n * @param path The path as a dot-notation string.\r\n * @returns The found value or undefined.\r\n */\r\nexport function get(array: any[], path: string): any {\r\n return path.split('.').reduce((acc, part) => acc && acc[part as keyof typeof acc], array);\r\n}\r\n\r\n/**\r\n * * Sets a value deeply within a nested array/object structure.\r\n * * Mirrors object.set.\r\n * @example set(users, '0.profile.name', 'Sven')\r\n * @param array The array to modify.\r\n * @param path The path as a string (e.g., '0.profile.name').\r\n * @param value The value to set.\r\n */\r\nexport function set(array: any[], path: string, value: any): void {\r\n const parts = path.split('.');\r\n let current: any = array;\r\n for (let i = 0; i < parts.length - 1; i++) {\r\n const part = parts[i];\r\n if (!current[part]) {\r\n current[part] = isNaN(Number(parts[i + 1])) ? {} : [];\r\n }\r\n current = current[part];\r\n }\r\n current[parts[parts.length - 1]] = value;\r\n}\r\n\r\n/**\r\n * * Removes elements based on index or match logic.\r\n */\r\nexport const remove = {\r\n /**\r\n * * Removes an element at a specific index.\r\n * @example remove.at([1, 2, 3, 4], -2) => [1, 2, 4]\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param index The index (negative values allowed).\r\n * @returns A new array with the element removed.\r\n */\r\n at<T>(array: T[], index: number): T[] {\r\n const copy = [...array];\r\n const idx = index < 0 ? array.length + index : index;\r\n if (idx >= 0 && idx < copy.length) {\r\n copy.splice(idx, 1);\r\n }\r\n return copy;\r\n },\r\n\r\n /**\r\n * * Removes the first element.\r\n * @example remove.first([1, 2, 3]) => [2, 3]\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n */\r\n first<T>(array: T[]): T[] { return array.slice(1); },\r\n\r\n /**\r\n * * Removes the last element.\r\n * @example remove.last([1, 2, 3]) => [1, 2]\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n */\r\n last<T>(array: T[]): T[] { return array.slice(0, -1); },\r\n\r\n /**\r\n * * Removes all elements matching a query condition.\r\n * @example remove.byMatch(users, 'Admin', 'exact', 'role')\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param key (Optional) The object key if it is an array of objects.\r\n */\r\n byMatch<T>(array: T[], query: string | number, mode: MatchMode = 'exact', key?: keyof T): T[] {\r\n const queryStr = String(query).toLowerCase();\r\n return array.filter(item => {\r\n const val = key ? item[key] : item;\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Removes the element at a specific index.\r\n * * Mirrors object.remove.byKey.\r\n * @example remove.byKey(['a', 'b', 'c'], 1) => ['a', 'c']\r\n * @template T The type of the items in the array.\r\n * @param array The source array.\r\n * @param index The index (key) to remove.\r\n * @returns A new array without the specified index.\r\n */\r\n byKey<T>(array: T[], index: number): T[] {\r\n return this.at(array, index);\r\n },\r\n\r\n /**\r\n * * Removes all elements that match a specific value exactly (Strict Equality).\r\n * * Mirrors object.remove.byValue.\r\n * @example remove.byValue([1, 2, 1, 3], 1) => [2, 3]\r\n * @template T The type of the items in the array.\r\n * @param array The source array.\r\n * @param value The value to remove.\r\n * @returns A new array without the matching values.\r\n */\r\n byValue<T>(array: T[], value: T): T[] {\r\n return array.filter(item => item !== value);\r\n },\r\n\r\n /**\r\n * * ALIAS for clear. Removes all elements.\r\n * @param array The source array.\r\n * @returns A new, empty array.\r\n */\r\n all<T>(array: T[]): T[] {\r\n return clear(array);\r\n },\r\n};\r\n\r\n/**\r\n * * Searches for elements in the array.\r\n */\r\nexport const find = {\r\n /**\r\n * * Finds the index of the first match.\r\n * @example find.at(['apple', 'banana', 'cherry'], 'an', 'contains') => 1\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param key (Optional) The object key if it is an array of objects.\r\n * @returns Index or -1.\r\n */\r\n at<T>(array: T[], query: string | number, mode: MatchMode = 'exact', key?: keyof T): number {\r\n const queryStr = String(query).toLowerCase();\r\n return array.findIndex(item => {\r\n const val = key ? item[key] : item;\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Returns all elements matching the condition (Filter).\r\n * @example find.all(['apple', 'banana', 'cherry'], 'a', 'contains') => ['apple', 'banana']\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param key (Optional) The object key if it is an array of objects.\r\n * @returns All matching elements or -1.\r\n */\r\n all<T>(array: T[], query: string | number, mode: MatchMode = 'exact', key?: keyof T): T[] {\r\n const queryStr = String(query).toLowerCase();\r\n return array.filter(item => {\r\n const val = key ? item[key] : item;\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Returns the first matching element (or undefined).\r\n * @example find.first(['apple', 'banana', 'cherry'], 'a', 'contains') => 'apple'\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param key (Optional) The object key if it is an array of objects.\r\n * @returns Index or -1.\r\n */\r\n first<T>(array: T[], query: string | number, mode: MatchMode = 'exact', key?: keyof T): T | undefined {\r\n const queryStr = String(query).toLowerCase();\r\n return array.find(item => {\r\n const val = key ? item[key] : item;\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Returns the last matching element (or undefined).\r\n * @example find.last(['apple', 'banana', 'cherry'], 'a', 'contains') => 'banana'\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param key (Optional) The object key if it is an array of objects.\r\n * @returns Index or -1.\r\n */\r\n last<T>(array: T[], query: string | number, mode: MatchMode = 'exact', key?: keyof T): T | undefined {\r\n const queryStr = String(query).toLowerCase();\r\n return [...array].reverse().find(item => {\r\n const val = key ? item[key] : item;\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Finds all indices (keys) matching the query.\r\n * * Mirrors object.find.key(). For arrays, keys are the indices.\r\n * @param array The array to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode.\r\n * @returns An array of matching indices as strings.\r\n */\r\n key<T>(array: T[], query: string, mode: MatchMode = 'exact'): string[] {\r\n const queryStr = String(query).toLowerCase();\r\n return Object.keys(array).filter(indexKey => {\r\n const valStr = String(indexKey).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Finds all values matching the query.\r\n * * Mirrors object.find.value(). Identical to find.all() for flat arrays.\r\n * @param array The array to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode.\r\n * @returns An array of matching values.\r\n */\r\n value<T>(array: T[], query: string, mode: MatchMode = 'exact'): T[] {\r\n return this.all(array, query, mode);\r\n },\r\n\r\n /**\r\n * * Finds the key of the first match based on the query condition.\r\n * @example find.byMatch(users, 'Admin', 'exact', 'role') => 0\r\n * @template T The type of the items in the array.\r\n * @param array The array.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param key (Optional) The object key if it is an array of objects.\r\n * @returns Index or -1.\r\n */\r\n byMatch<T>(array: T[], query: string | number, mode: MatchMode = 'exact', key?: keyof T): number | undefined {\r\n const queryStr = String(query).toLowerCase();\r\n return array.findIndex(item => {\r\n const val = key ? item[key] : item;\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n }\r\n};", "/**\r\n * @file src/modules/data/objects.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Data\r\n * @description\r\n * * Utility functions for object manipulation (e.g., deep merging, extension).\r\n * @requires ./types\r\n * * Depends on types.\r\n * @requires src/utils\r\n * * Depends on utility functions (e.g., each).\r\n */\r\n\r\nimport { each } from 'src/utils';\r\nimport { MatchMode } from './types';\r\n\r\n/**\r\n * * Checks if the provided value is a plain object (not null, not an array).\r\n * * Acts as a TypeScript Type Guard.\r\n * @private\r\n * @param item The value to check.\r\n * @returns True if the value is a plain object.\r\n */\r\nfunction isObject(item: any): item is Record<string, any> {\r\n return (item && typeof item === 'object' && !Array.isArray(item));\r\n}\r\n\r\n/**\r\n * * Recursively merges multiple objects (Deep Merge).\r\n * @example mergeObjects({ a: 1, b: { x: 1 } }, { b: { y: 2 } }) => { a: 1, b: { x: 1, y: 2 } }\r\n * @param target The target object (will be modified!).\r\n * @param sources One or more source objects.\r\n * @returns The modified target object.\r\n */\r\nexport function mergeObjects(target: any, ...sources: any[]): any {\r\n if (!sources.length)\r\n return target;\r\n const source = sources.shift();\r\n\r\n if (isObject(target) && isObject(source)) {\r\n for (const key in source) {\r\n if (key === '__proto__' || key === 'constructor')\r\n continue;\r\n if (isObject(source[key])) {\r\n if (!target[key]) target[key] = {};\r\n mergeObjects(target[key], source[key]);\r\n } else {\r\n target[key] = source[key];\r\n }\r\n }\r\n }\r\n return mergeObjects(target, ...sources);\r\n}\r\n\r\n/**\r\n * * ALIAS for mergeObjects (Consistency with array.mergeArray)\r\n */\r\nexport const merge = mergeObjects;\r\n\r\n/**\r\n * * Splits an object into an array of smaller objects (chunks). Ideal for batched processing.\r\n * @example chunk({a: 1, b: 2, c: 3}, 2) => [{a: 1, b: 2}, {c: 3}]\r\n * @param obj The source object.\r\n * @param size The maximum number of keys per chunk.\r\n * @returns An array of partial objects.\r\n */\r\nexport function chunk<T extends Record<string, any>>(obj: T, size: number): Partial<T>[] {\r\n const entries = Object.entries(obj);\r\n const chunks: Partial<T>[] = [];\r\n for (let i = 0; i < entries.length; i += size) {\r\n const slice = entries.slice(i, i + size);\r\n chunks.push(Object.fromEntries(slice) as Partial<T>);\r\n }\r\n return chunks;\r\n}\r\n\r\n/**\r\n * * Safely adds a key-value pair at a specific index without mutating the original object (Immutable).\r\n * * Note: While JS object key order is generally insertion-based, relying on it is not always recommended.\r\n * @example add({a: 1, c: 3}, 'b', 2, 1) => {a: 1, b: 2, c: 3}\r\n * @param obj The object.\r\n * @param key The key to add.\r\n * @param value The value to add.\r\n * @param index The position (default: end). Negative values count from the back.\r\n * @returns A new object including the element at the specified position.\r\n */\r\nexport function add<T extends Record<string, any>>(obj: T, key: string, value: any, index: number = Object.keys(obj).length): T & Record<string, any> {\r\n const entries = Object.entries(obj);\r\n const idx = index < 0 ? entries.length + index + 1 : index;\r\n entries.splice(idx, 0, [key, value]);\r\n return Object.fromEntries(entries) as T & Record<string, any>;\r\n}\r\n\r\n/**\r\n * * Clears the object and returns a new empty object (Immutable).\r\n * @example clear({ a: 1, b: 2 }) => {}\r\n * @template T The type of the object.\r\n * @param obj The object to clear.\r\n * @returns A new empty object.\r\n */\r\nexport function clear<T extends Record<string, any>>(obj: T): Partial<T> {\r\n return {} as Partial<T>;\r\n}\r\n\r\n/**\r\n * * ALIAS for clear.\r\n */\r\nexport const empty = clear;\r\n\r\n/**\r\n * * Creates a new object containing only the specified keys (Allowlist).\r\n * @example pick({ a: 1, b: 2, c: 3 }, ['a', 'c']) => { a: 1, c: 3 }\r\n * @param obj The source object.\r\n * @param keys Array of keys to keep.\r\n * @returns A new object with selected keys.\r\n */\r\nexport function pick<T extends object, K extends keyof T>(obj: T, keys: K[]): Pick<T, K> {\r\n const ret: any = {};\r\n each(keys, function(_index, key) {\r\n if (key in obj) ret[key] = obj[key];\r\n });\r\n return ret as Pick<T, K>;\r\n}\r\n\r\n/**\r\n * * Creates a new object containing all keys EXCEPT the specified ones (Blocklist).\r\n * @example omit({ a: 1, b: 2, c: 3 }, ['b']) => { a: 1, c: 3 }\r\n * @param obj The source object.\r\n * @param keys Array of keys to remove.\r\n * @returns A new object without the specified keys.\r\n */\r\nexport function omit<T, K extends keyof T>(obj: T, keys: K[]): Omit<T, K> {\r\n const ret = { ...obj };\r\n each(keys, function(_index, key) {\r\n delete ret[key];\r\n });\r\n return ret as Omit<T, K>;\r\n}\r\n\r\n/**\r\n * * Safely retrieves a value from a nested object (Safe Navigation).\r\n * @example get(config, 'settings.theme.color') => Returns the value of config.settings.theme.color or undefined if any part is missing.\r\n * @param obj The object.\r\n * @param path The path as a dot-notation string.\r\n * @returns The found value or undefined.\r\n */\r\nexport function get(obj: any, path: string): any {\r\n return path.split('.').reduce((acc, part) => acc && acc[part], obj);\r\n}\r\n\r\n/**\r\n * * Sets a value deeply within a nested object. Creates missing intermediate objects automatically.\r\n * @example set(config, 'settings.theme.color', 'dark') => Sets config.settings.theme.color to 'dark', creating objects if needed.\r\n * @param obj The object to modify.\r\n * @param path The path as a string (e.g., 'settings.theme.color').\r\n * @param value The value to set.\r\n */\r\nexport function set(obj: any, path: string, value: any): void {\r\n const parts = path.split('.');\r\n let current = obj;\r\n for (let i = 0; i < parts.length - 1; i++) {\r\n const part = parts[i];\r\n if (!current[part]) current[part] = {};\r\n current = current[part];\r\n }\r\n current[parts[parts.length - 1]] = value;\r\n}\r\n\r\n/**\r\n * * Removes elements from an object based on index or match logic (Immutable).\r\n * * Mirrors the array.remove API.\r\n */\r\nexport const remove = {\r\n /**\r\n * * Removes an entry at a specific index.\r\n * @example remove.at({a: 1, b: 2, c: 3}, -1) => {a: 1, b: 2}\r\n * @param obj The source object.\r\n * @param index The index (negative values allowed).\r\n * @returns A new object with the element removed.\r\n */\r\n at<T extends Record<string, any>>(obj: T, index: number): Partial<T> {\r\n const entries = Object.entries(obj);\r\n const idx = index < 0 ? entries.length + index : index;\r\n if (idx >= 0 && idx < entries.length) {\r\n entries.splice(idx, 1);\r\n }\r\n return Object.fromEntries(entries) as Partial<T>;\r\n },\r\n\r\n /**\r\n * * Removes the first entry from the object.\r\n * @param obj The source object.\r\n * @returns A new object without the first entry.\r\n */\r\n first<T extends Record<string, any>>(obj: T): Partial<T> {\r\n const entries = Object.entries(obj).slice(1);\r\n return Object.fromEntries(entries) as Partial<T>;\r\n },\r\n\r\n /**\r\n * * Removes the last entry from the object.\r\n * @param obj The source object.\r\n * @returns A new object without the last entry.\r\n */\r\n last<T extends Record<string, any>>(obj: T): Partial<T> {\r\n const entries = Object.entries(obj).slice(0, -1);\r\n return Object.fromEntries(entries) as Partial<T>;\r\n },\r\n\r\n /**\r\n * * Removes all entries matching a query condition.\r\n * @example remove.byMatch(config, 'hidden', 'exact', 'key')\r\n * @param obj The source object.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param searchBy Whether to search by 'key' or 'value' (default: 'key').\r\n * @returns A new object without the matching elements.\r\n */\r\n byMatch<T extends Record<string, any>>(obj: T, query: string | number, mode: MatchMode = 'exact', searchBy: 'key' | 'value' = 'key'): Partial<T> {\r\n const queryStr = String(query).toLowerCase();\r\n const filteredEntries = Object.entries(obj).filter(([key, val]) => {\r\n const target = searchBy === 'key' ? key : val;\r\n const valStr = String(target).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr !== queryStr;\r\n case 'startsWith': return !valStr.startsWith(queryStr);\r\n case 'endsWith': return !valStr.endsWith(queryStr);\r\n case 'contains': return !valStr.includes(queryStr);\r\n default: return true;\r\n }\r\n });\r\n return Object.fromEntries(filteredEntries) as Partial<T>;\r\n },\r\n\r\n /**\r\n * * Removes all entries that have a specific key.\r\n * @example remove.byKey({ a: 1, b: 2, c: 3 }, 'b') => { a: 1, c: 3 }\r\n * @param obj The source object.\r\n * @param key The key to remove.\r\n * @returns A new object without the specified key.\r\n */\r\n byKey<T extends Record<string, any>>(obj: T, key: string): Partial<T> {\r\n const ret = { ...obj };\r\n delete ret[key];\r\n return ret as Partial<T>;\r\n },\r\n\r\n /**\r\n * * Removes all entries that match a specific value exactly (Strict Equality).\r\n * @example remove.byValue({ a: 1, b: 2, c: 1 }, 1) => { b: 2 }\r\n * @param obj The source object.\r\n * @param value The value to remove.\r\n * @returns A new object without the matching values.\r\n */\r\n byValue<T extends Record<string, any>>(obj: T, value: any): Partial<T> {\r\n const filteredEntries = Object.entries(obj).filter(([_key, val]) => val !== value);\r\n return Object.fromEntries(filteredEntries) as Partial<T>;\r\n },\r\n\r\n /**\r\n * * ALIAS for clear. Removes all entries.\r\n * @param obj The source object.\r\n * @returns A new, empty object.\r\n */\r\n all<T extends Record<string, any>>(obj: T): Partial<T> {\r\n return clear(obj);\r\n },\r\n};\r\n\r\n/**\r\n * * Searches keys or values in the object.\r\n */\r\nexport const find = {\r\n /**\r\n * * Returns the n-th entry of an object as a [key, value] pair. Supports negative indices.\r\n * @example find.at({ a: 1, b: 2 }, 1) => ['b', 2]\r\n * @param obj The object to search.\r\n * @param index The index (0-based, negative counts from the back).\r\n * @returns A [key, value] tuple or undefined.\r\n */\r\n at(obj: any, index: number): [string, any] | undefined {\r\n const entries = Object.entries(obj);\r\n const idx = index < 0 ? entries.length + index : index;\r\n return entries[idx];\r\n },\r\n\r\n /**\r\n * * Returns a NEW OBJECT containing ALL elements matching the condition.\r\n * * Mirrors array.find.all() but returns a partial object.\r\n * @example find.all({a: 1, b: 2, c: 1}, 1, 'exact', 'value') => {a: 1, c: 1}\r\n * @param obj The object to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param searchBy Whether to search by 'key' or 'value' (default: 'key').\r\n * @returns A new object with only the matching elements.\r\n */\r\n all<T extends Record<string, any>>(obj: T, query: string | number, mode: MatchMode = 'exact', searchBy: 'key' | 'value' = 'key'): Partial<T> {\r\n const queryStr = String(query).toLowerCase();\r\n const filteredEntries = Object.entries(obj).filter(([key, val]) => {\r\n const target = searchBy === 'key' ? key : val;\r\n const valStr = String(target).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n return Object.fromEntries(filteredEntries) as Partial<T>;\r\n },\r\n\r\n /**\r\n * * Finds the first entry where the key or value matches the query.\r\n * @example find.first(config, 'admin', 'exact', 'key')\r\n * @param obj The object to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param searchBy Whether to search by 'key' or 'value'.\r\n * @returns The first matching [key, value] pair or undefined.\r\n */\r\n first(obj: any, query: string | number, mode: MatchMode = 'exact', searchBy: 'key' | 'value' = 'key'): [string, any] | undefined {\r\n const entries = Object.entries(obj);\r\n const queryStr = String(query).toLowerCase();\r\n \r\n return entries.find(([key, val]) => {\r\n const target = searchBy === 'key' ? key : val;\r\n const valStr = String(target).toLowerCase();\r\n \r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Finds the last entry where the key or value matches the query.\r\n * @example find.last(config, '.php', 'endsWith', 'key')\r\n * @param obj The object to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param searchBy Whether to search by 'key' or 'value'.\r\n * @returns The last matching [key, value] pair or undefined.\r\n */\r\n last(obj: any, query: string | number, mode: MatchMode = 'exact', searchBy: 'key' | 'value' = 'key'): [string, any] | undefined {\r\n const entries = Object.entries(obj);\r\n const queryStr = String(query).toLowerCase();\r\n\r\n return [...entries].reverse().find(([key, val]) => {\r\n const target = searchBy === 'key' ? key : val;\r\n const valStr = String(target).toLowerCase();\r\n \r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Finds all keys matching the query.\r\n * @example find.key(config, 'api_', 'startsWith')\r\n * @param obj The object to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @returns An array of matching keys.\r\n */\r\n key(obj: any, query: string, mode: MatchMode = 'exact'): string[] {\r\n const queryStr = String(query).toLowerCase();\r\n \r\n return Object.keys(obj).filter(key => {\r\n const valStr = String(key).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Finds all values matching the query.\r\n * @example find.value(config, 'enabled', 'exact')\r\n * @param obj The object to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @returns An array of matching values.\r\n */\r\n value(obj: any, query: string, mode: MatchMode = 'exact'): any[] {\r\n const queryStr = String(query).toLowerCase();\r\n\r\n return Object.values(obj).filter(val => {\r\n const valStr = String(val).toLowerCase();\r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n },\r\n\r\n /**\r\n * * Finds the key of the first match based on the query condition.\r\n * * Mirrors array.find.byMatch(). For objects, it returns the key instead of a numeric index.\r\n * @example find.byMatch(config, 'admin', 'exact', 'value') => 'role'\r\n * @param obj The object to search.\r\n * @param query The search query.\r\n * @param mode The comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @param searchBy Whether to search by 'key' or 'value' (default: 'key').\r\n * @returns The matched key as a string, or undefined if no match is found.\r\n */\r\n byMatch(obj: any, query: string | number, mode: MatchMode = 'exact', searchBy: 'key' | 'value' = 'key'): string | undefined {\r\n const queryStr = String(query).toLowerCase();\r\n const entries = Object.entries(obj);\r\n \r\n const found = entries.find(([key, val]) => {\r\n const target = searchBy === 'key' ? key : val;\r\n const valStr = String(target).toLowerCase();\r\n \r\n switch (mode) {\r\n case 'exact': return valStr === queryStr;\r\n case 'startsWith': return valStr.startsWith(queryStr);\r\n case 'endsWith': return valStr.endsWith(queryStr);\r\n case 'contains': return valStr.includes(queryStr);\r\n default: return false;\r\n }\r\n });\r\n \r\n return found ? found[0] : undefined;\r\n }\r\n};", "/**\r\n * @file src/modules/data/index.ts\r\n * @version 2.1.0\r\n * @since 2.0.0\r\n * * @license GPL-3.0-or-later\r\n * @copyright Sven Minio 2026\r\n * @author Sven Minio <https://sven-minio.de>\r\n * @category Data\r\n * @description\r\n * * Central entry point for data manipulation. \r\n * * Features a dynamic, overloaded API router that automatically delegates \r\n * * to array or object utilities based on the input type.\r\n * @requires ./arrays\r\n * * Array manipulation methods.\r\n * @requires ./objects\r\n * * Object manipulation methods.\r\n */\r\n\r\nimport * as arr from './arrays';\r\nimport * as obj from './objects';\r\nimport { MatchMode } from './types';\r\n\r\n/**\r\n * * Splits an array or object into smaller chunks (batched processing).\r\n * @param data The source array or object.\r\n * @param size The maximum size/length of each chunk.\r\n * @returns An array containing the chunked arrays or partial objects.\r\n */\r\nfunction chunk<T>(array: T[], size: number): T[][];\r\nfunction chunk<T extends Record<string, any>>(object: T, size: number): Partial<T>[];\r\nfunction chunk(data: any, size: number): any {\r\n return Array.isArray(data) ? arr.chunk(data, size) : obj.chunk(data, size);\r\n}\r\n\r\n/**\r\n * * Merges multiple arrays (flat) or objects (deep merge) into a single structure.\r\n * @param data The target array or object.\r\n * @param args The source arrays or objects to merge.\r\n * @returns The newly merged array or modified target object.\r\n */\r\nfunction merge(...arrays: any[][]): any[];\r\nfunction merge(target: any, ...sources: any[]): any;\r\nfunction merge(data: any, ...args: any[]): any {\r\n return Array.isArray(data) ? arr.merge(data, ...args) : obj.merge(data, ...args);\r\n}\r\n\r\n/**\r\n * * Safely adds an element/property at a specific index without mutating the original structure (Immutable).\r\n * @param data The source array or object.\r\n * @param arg1 The item to add (array) or the key to add (object).\r\n * @param arg2 The index (array) or the value to add (object).\r\n * @param arg3 The index (object only).\r\n * @returns A new array or object including the added element.\r\n */\r\nfunction add<T>(array: T[], item: T, index?: number): T[];\r\nfunction add<T extends Record<string, any>>(object: T, key: string, value: any, index?: number): T & Record<string, any>;\r\nfunction add(data: any, arg1: any, arg2?: any, arg3?: any): any {\r\n return Array.isArray(data) ? arr.add(data, arg1, arg2) : obj.add(data, arg1, arg2, arg3);\r\n}\r\n\r\n/**\r\n * * Clears the array or object and returns a new empty one (Immutable).\r\n * @param data The array or object to clear.\r\n * @returns A new empty array `[]` or object `{}`.\r\n */\r\nfunction clear<T>(array: T[]): T[];\r\nfunction clear<T extends Record<string, any>>(object: T): Partial<T>;\r\nfunction clear(data: any): any {\r\n return Array.isArray(data) ? arr.clear(data) : obj.clear(data);\r\n}\r\n\r\n/**\r\n * * Creates a new array or object containing ONLY the specified indices/keys (Allowlist).\r\n * @param data The source array or object.\r\n * @param keysOrIndices Array of keys (object) or indices (array) to keep.\r\n * @returns A new filtered array or object.\r\n */\r\nfunction pick<T>(array: T[], indices: number[]): T[];\r\nfunction pick<T extends object, K extends keyof T>(object: T, keys: K[]): Pick<T, K>;\r\nfunction pick(data: any, keysOrIndices: any): any {\r\n return Array.isArray(data) ? arr.pick(data, keysOrIndices) : obj.pick(data, keysOrIndices);\r\n}\r\n\r\n/**\r\n * * Creates a new array or object containing all elements EXCEPT the specified indices/keys (Blocklist).\r\n * @param data The source array or object.\r\n * @param keysOrIndices Array of keys (object) or indices (array) to remove.\r\n * @returns A new filtered array or object.\r\n */\r\nfunction omit<T>(array: T[], indices: number[]): T[];\r\nfunction omit<T extends object, K extends keyof T>(object: T, keys: K[]): Omit<T, K>;\r\nfunction omit(data: any, keysOrIndices: any): any {\r\n return Array.isArray(data) ? arr.omit(data, keysOrIndices) : obj.omit(data, keysOrIndices);\r\n}\r\n\r\n/**\r\n * * Safely retrieves a value from a nested array/object structure using dot-notation.\r\n * @param data The source array or object.\r\n * @param path The path string (e.g., 'settings.theme' or '0.profile.name').\r\n * @returns The found value or undefined if any part is missing.\r\n */\r\nfunction get(array: any[], path: string): any;\r\nfunction get(object: any, path: string): any;\r\nfunction get(data: any, path: string): any {\r\n return Array.isArray(data) ? arr.get(data, path) : obj.get(data, path);\r\n}\r\n\r\n/**\r\n * * Sets a value deeply within a nested structure. Creates missing objects/arrays automatically.\r\n * @param data The array or object to modify.\r\n * @param path The path string (e.g., 'settings.theme').\r\n * @param value The value to set.\r\n */\r\nfunction set(array: any[], path: string, value: any): void;\r\nfunction set(object: any, path: string, value: any): void;\r\nfunction set(data: any, path: string, value: any): void {\r\n return Array.isArray(data) ? arr.set(data, path, value) : obj.set(data, path, value);\r\n}\r\n\r\n// --- REMOVE NAMESPACE ---\r\n\r\n/**\r\n * * Removes an entry/element at a specific index (Immutable).\r\n * @param data The source array or object.\r\n * @param index The index to remove (negative values count from the end).\r\n * @returns A new array or object without the specified element.\r\n */\r\nfunction removeAt<T>(array: T[], index: number): T[];\r\nfunction removeAt<T extends Record<string, any>>(object: T, index: number): Partial<T>;\r\nfunction removeAt(data: any, index: number): any {\r\n return Array.isArray(data) ? arr.remove.at(data, index) : obj.remove.at(data, index);\r\n}\r\n\r\n/**\r\n * * Removes the first entry/element (Immutable).\r\n * @param data The source array or object.\r\n * @returns A new array or object without the first element.\r\n */\r\nfunction removeFirst<T>(array: T[]): T[];\r\nfunction removeFirst<T extends Record<string, any>>(object: T): Partial<T>;\r\nfunction removeFirst(data: any): any {\r\n return Array.isArray(data) ? arr.remove.first(data) : obj.remove.first(data);\r\n}\r\n\r\n/**\r\n * * Removes the last entry/element (Immutable).\r\n * @param data The source array or object.\r\n * @returns A new array or object without the last element.\r\n */\r\nfunction removeLast<T>(array: T[]): T[];\r\nfunction removeLast<T extends Record<string, any>>(object: T): Partial<T>;\r\nfunction removeLast(data: any): any {\r\n return Array.isArray(data) ? arr.remove.last(data) : obj.remove.last(data);\r\n}\r\n\r\n/**\r\n * * Removes all entries/elements matching a query condition (Immutable). Acts as an inverse filter.\r\n * @param data The source array or object.\r\n * @param query The search term.\r\n * @param mode Comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @returns A new array or object containing only the non-matching elements.\r\n */\r\nfunction removeByMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];\r\nfunction removeByMatch<T extends Record<string, any>>(object: T, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): Partial<T>;\r\nfunction removeByMatch(data: any, query: any, mode?: any, keyOrSearchBy?: any): any {\r\n return Array.isArray(data) ? arr.remove.byMatch(data, query, mode, keyOrSearchBy) : obj.remove.byMatch(data, query, mode, keyOrSearchBy);\r\n}\r\n\r\n/**\r\n * * Removes a specific element by its index (arrays) or key (objects) (Immutable).\r\n * @param data The source array or object.\r\n * @param keyOrIndex The index or key string to remove.\r\n * @returns A new array or object without the specified property/element.\r\n */\r\nfunction removeByKey<T>(array: T[], index: number): T[];\r\nfunction removeByKey<T extends Record<string, any>>(object: T, key: string): Partial<T>;\r\nfunction removeByKey(data: any, keyOrIndex: any): any {\r\n return Array.isArray(data) ? arr.remove.byKey(data, keyOrIndex as number) : obj.remove.byKey(data, keyOrIndex as string);\r\n}\r\n\r\n/**\r\n * * Removes all elements/entries that match a specific value exactly (Immutable).\r\n * @param data The source array or object.\r\n * @param value The exact value to remove (strict equality).\r\n * @returns A new array or object without the matching values.\r\n */\r\nfunction removeByValue<T>(array: T[], value: T): T[];\r\nfunction removeByValue<T extends Record<string, any>>(object: T, value: any): Partial<T>;\r\nfunction removeByValue(data: any, value: any): any {\r\n return Array.isArray(data) ? arr.remove.byValue(data, value) : obj.remove.byValue(data, value);\r\n}\r\n\r\n// --- FIND NAMESPACE ---\r\n\r\n/**\r\n * * Arrays: Finds the index of the first match. Objects: Returns the n-th [key, value] tuple.\r\n * @param data The array or object to search.\r\n * @param arg1 Query term (array) or numeric index (object).\r\n * @returns The index (array) or tuple (object), or undefined.\r\n */\r\nfunction findAt<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number;\r\nfunction findAt(object: any, index: number): [string, any] | undefined;\r\nfunction findAt(data: any, arg1: any, arg2?: any, arg3?: any): any {\r\n return Array.isArray(data) ? arr.find.at(data, arg1, arg2, arg3) : obj.find.at(data, arg1);\r\n}\r\n\r\n/**\r\n * * Returns ALL elements/entries matching the condition. Similar to filter().\r\n * @param data The array or object to search.\r\n * @param query The search term.\r\n * @param mode Comparison mode ('exact', 'contains', 'startsWith', 'endsWith').\r\n * @returns A new array or partial object containing the matching elements.\r\n */\r\nfunction findAll<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T[];\r\nfunction findAll<T extends Record<string, any>>(object: T, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): Partial<T>;\r\nfunction findAll(data: any, query: any, mode?: any, keyOrSearchBy?: any): any {\r\n return Array.isArray(data) ? arr.find.all(data, query, mode, keyOrSearchBy) : obj.find.all(data, query, mode, keyOrSearchBy);\r\n}\r\n\r\n/**\r\n * * Returns the FIRST matching element (array) or [key, value] tuple (object).\r\n * @param data The array or object to search.\r\n * @param query The search term.\r\n * @returns The found element/tuple or undefined.\r\n */\r\nfunction findFirst<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;\r\nfunction findFirst(object: any, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): [string, any] | undefined;\r\nfunction findFirst(data: any, query: any, mode?: any, keyOrSearchBy?: any): any {\r\n return Array.isArray(data) ? arr.find.first(data, query, mode, keyOrSearchBy) : obj.find.first(data, query, mode, keyOrSearchBy);\r\n}\r\n\r\n/**\r\n * * Returns the LAST matching element (array) or [key, value] tuple (object). Searches in reverse.\r\n * @param data The array or object to search.\r\n * @param query The search term.\r\n * @returns The found element/tuple or undefined.\r\n */\r\nfunction findLast<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): T | undefined;\r\nfunction findLast(object: any, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): [string, any] | undefined;\r\nfunction findLast(data: any, query: any, mode?: any, keyOrSearchBy?: any): any {\r\n return Array.isArray(data) ? arr.find.last(data, query, mode, keyOrSearchBy) : obj.find.last(data, query, mode, keyOrSearchBy);\r\n}\r\n\r\n/**\r\n * * Finds all matching indices (arrays) or keys (objects) based on the query.\r\n * @param data The array or object to search.\r\n * @param query The search term.\r\n * @returns An array of matching stringified keys/indices.\r\n */\r\nfunction findKey<T>(array: T[], query: string, mode?: MatchMode): string[];\r\nfunction findKey(object: any, query: string, mode?: MatchMode): string[];\r\nfunction findKey(data: any, query: string, mode?: MatchMode): string[] {\r\n return Array.isArray(data) ? arr.find.key(data, query, mode) : obj.find.key(data, query, mode);\r\n}\r\n\r\n/**\r\n * * Finds all matching values within the array or object.\r\n * @param data The array or object to search.\r\n * @param query The search term.\r\n * @returns An array of matching values.\r\n */\r\nfunction findValue<T>(array: T[], query: string, mode?: MatchMode): T[];\r\nfunction findValue(object: any, query: string, mode?: MatchMode): any[];\r\nfunction findValue(data: any, query: string, mode?: MatchMode): any[] {\r\n return Array.isArray(data) ? arr.find.value(data, query, mode) : obj.find.value(data, query, mode);\r\n}\r\n\r\n/**\r\n * * Finds the index (array) or key (object) of the first match based on the query condition.\r\n * @param data The array or object to search.\r\n * @param query The search term.\r\n * @returns The matching index/key or undefined.\r\n */\r\nfunction findByMatch<T>(array: T[], query: string | number, mode?: MatchMode, key?: keyof T): number | undefined;\r\nfunction findByMatch(object: any, query: string | number, mode?: MatchMode, searchBy?: 'key' | 'value'): string | undefined;\r\nfunction findByMatch(data: any, query: any, mode?: any, keyOrSearchBy?: any): any {\r\n return Array.isArray(data) ? arr.find.byMatch(data, query, mode, keyOrSearchBy) : obj.find.byMatch(data, query, mode, keyOrSearchBy);\r\n}\r\n\r\n/**\r\n * * Central data utility object. \r\n * * Dynamically routes to array or object methods based on input.\r\n * * Backward compatibility for strict calls is maintained via `.arr` and `.obj`.\r\n */\r\nexport const data = {\r\n arr,\r\n obj,\r\n chunk,\r\n merge,\r\n add,\r\n clear,\r\n empty: clear,\r\n pick,\r\n omit,\r\n get,\r\n set,\r\n remove: {\r\n at: removeAt,\r\n first: removeFirst,\r\n last: removeLast,\r\n byKey: removeByKey,\r\n byValue: removeByValue,\r\n byMatch: removeByMatch,\r\n all: clear\r\n },\r\n find: {\r\n at: findAt,\r\n all: findAll,\r\n first: findFirst,\r\n last: findLast,\r\n key: findKey,\r\n value: findValue,\r\n byMatch: findByMatch\r\n }\r\n};"],
|
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAAAA;AAAA,EAAA;AAAA;AAAA;;;ACqBO,SAAS,SAA4C,MAAS,OAAiD;AAClH,MAAI;AACJ,SAAO,YAAuB,MAAqB;AAC/C,UAAM,UAAU;AAChB,QAAI,CAAC,YAAY;AACb,WAAK,MAAM,SAAS,IAAI;AACxB,mBAAa;AACb,iBAAW,MAAM,aAAa,OAAO,KAAK;AAAA,IAC9C;AAAA,EACJ;AACJ;AAWO,SAAS,SAA4C,MAAS,OAAiD;AAClH,MAAI;AACJ,SAAO,YAAuB,MAAqB;AAC/C,iBAAa,KAAK;AAClB,YAAQ,WAAW,MAAM,KAAK,MAAM,MAAM,IAAI,GAAG,KAAK;AAAA,EAC1D;AACJ;AASO,SAAS,YAAqB;AACjC,SAAO,OAAO,WAAW,eAAe,OAAO,OAAO,0BAA0B;AACpF;AAaO,SAAS,KAAQ,YAAoD,UAAwH;AAChM,QAAM,cAAc,MAAM,QAAQ,UAAU,KAAM,cAAc,OAAO,eAAe,YAAY,YAAY,cAAc,OAAQ,WAAmB,WAAW;AAClK,MAAI,aAAa;AACb,UAAM,MAAM;AACZ,aAAS,IAAI,GAAG,MAAM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AAAC;AAAA,EACA,KAAAC;AAAA,EACA,KAAAC;AAAA,EACA,QAAQ;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,IACT,KAAKJ;AAAA,EACT;AAAA,EACA,MAAM;AAAA,IACF,IAAI;AAAA,IACJ,KAAKO;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,EACb;AACJ;;;A7BlRA,OAAO,OAAO,MAAW,WAAW,UAAU;AAC9C,OAAO,OAAO,MAAW,WAAW,YAAY;AAChD,OAAO,OAAO,MAAW,WAAW,UAAU;AAC9C,OAAO,OAAO,MAAW,WAAW,aAAa;AA4hCjD,IAAM,SAAS,CAAC,aAAqC;AACjD,SAAO,IAAI,MAAW,QAAQ;AAClC;AAEA,IAAM,OAAO,OAAO,OAAO,QAAQ;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,IAAI,MAAW;AACnB,CAAC;AASM,IAAM,OAAO,CAACC,YAAmB;AACpC,QAAM,MAAMA,QAAO;AACnB,QAAM,YAAY,CAAC,aAAyB,IAAI,MAAW,UAAU,GAAG;AAExE,SAAO,OAAO,WAAW;AAAA,IACrB,IAAI,MAAW;AAAA,IACf;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAC;AAED,SAAO;AACX;AAKO,IAAM,IAAI;AACV,IAAM,KAAK;AACX,IAAM,MAAM;AACZ,IAAM,OAAO;AACb,IAAM,SAAS;AACf,IAAM,UAAU;AAChB,IAAMC,SAAQ;AACd,IAAM,KAAK;",
|
|
"names": ["jBase", "data", "text", "attr", "html", "add", "parent", "parents", "parents", "parent", "children", "text", "data", "text", "empty", "get", "remove", "val", "add", "chunk", "clear", "empty", "find", "get", "merge", "omit", "pick", "remove", "set", "merge", "chunk", "add", "clear", "empty", "pick", "omit", "get", "set", "remove", "val", "find", "chunk", "data", "merge", "add", "clear", "pick", "omit", "get", "set", "remove", "find", "findAll", "window", "jBase"]
|
|
}
|