/** * @k37z3r/jbase - Ditch the legacy bloat. jBase is a blazing-fast, SSR-ready micro-framework combining an elegant DOM chaining API with powerful, immutable data utilities. Fully typed, modular, and built for modern web & Node.js environments. * @version 2.4.0 * @homepage https://github.com/k37z3r/jBase-2 * @author Sven Minio (https://github.com/k37z3r/jBase-2) * @license GPL-3.0-or-later * @copyright 2026 Sven Minio (https://github.com/k37z3r/jBase-2) */ "use strict";(()=>{var jt=Object.defineProperty;var c=(e,t)=>()=>(e&&(t=e(e=0)),t);var Bt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),h=(e,t)=>{for(var n in t)jt(e,n,{get:t[n],enumerable:!0})};function q(e,t){let n;return function(...s){let r=this;n||(e.apply(r,s),n=!0,setTimeout(()=>n=!1,t))}}function N(e,t){let n;return function(...s){clearTimeout(n),n=setTimeout(()=>e.apply(this,s),t)}}function m(){return typeof window<"u"&&typeof window.requestAnimationFrame<"u"}function l(e,t){if(Array.isArray(e)||e&&typeof e=="object"&&"length"in e&&typeof e.length=="number"){let s=e;for(let r=0,i=s.length;r{"use strict";});var p,K=c(()=>{"use strict";d();p=class extends Array{selectorSource="";doc;constructor(t,n){if(super(),n instanceof Document?this.doc=n:n&&n.document?this.doc=n.document:this.doc=typeof document<"u"?document:null,!(typeof document>"u")&&(this.selectorSource=typeof t=="string"?t:"",!!t))if(t instanceof HTMLElement||t===document||t===window||t instanceof Element)this.push(t);else if(typeof t=="string"){let s=t.trim();if(s.startsWith("<")&&s.endsWith(">")){let r=this.doc.createElement("div");r.innerHTML=y(s),this.push(...Array.from(r.children))}else if(s.startsWith("#")&&!s.includes(" ")&&!s.includes(".")){let r=this.doc.getElementById(s.slice(1));r&&this.push(r)}else if(s.startsWith(".")&&!s.includes(" ")&&!/[:\[#]/.test(s)){let r=this.doc.getElementsByClassName(s.slice(1));for(let i=0;it instanceof Element?t.tagName.toLowerCase():typeof t)}}each(t){for(let n=0,s=this.length;nvt,hasClass:()=>Et,removeClass:()=>Tt,toggleClass:()=>bt});function vt(...e){return this.each(function(t){t instanceof Element&&t.classList.add(...e)}),this}function Tt(...e){return this.each(function(t){t instanceof Element&&t.classList.remove(...e)}),this}function bt(e){return this.each(function(t){t instanceof Element&&t.classList.toggle(e)}),this}function Et(e){return this.some(t=>t instanceof Element&&t.classList.contains(e))}var ke=c(()=>{"use strict";});var R={};h(R,{css:()=>xt});function xt(e,t){if(typeof e=="object"&&e!==null)return this.each(function(n){if(n instanceof HTMLElement||n instanceof SVGElement)for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(s.includes("-")?n.style.setProperty(s,String(e[s])):n.style[s]=e[s])}),this;if(typeof e=="string"){if(t===void 0){let n=this[0];if(n instanceof HTMLElement||n instanceof SVGElement){let s=n.ownerDocument,r=s?s.defaultView:null;return r?r.getComputedStyle(n).getPropertyValue(e)||r.getComputedStyle(n)[e]||"":n.style[e]||""}return""}this.each(function(n){(n instanceof HTMLElement||n instanceof SVGElement)&&(e.includes("-")?n.style.setProperty(e,String(t)):n.style[e]=t)})}return this}var Ce=c(()=>{"use strict";});var We,_e=c(()=>{"use strict";ke();Ce();We={...H,...R}});var J={};h(J,{off:()=>Mt,on:()=>wt,once:()=>St,trigger:()=>Lt});function wt(e,t,n,s){let r,i,o;if(typeof t=="string"?(r=t,typeof n=="function"?o=n:(i=n,o=s)):typeof t=="function"?o=t:(i=t,o=n),!o)return this;let a=e.split(" ");return this.each(function(f){if(!(f instanceof EventTarget))return;let u=f[F]||(f[F]=[]);l(a,function(j,x){let A=function(w){let k=f;if(r){let _=w.target instanceof Element?w.target:w.target?.parentElement,P=_ instanceof Element&&_.closest?_.closest(r):null;if(!P||!f.contains(P))return;k=P}i!==void 0&&(w.data=i),o.call(k,w)};u.push({type:x,original:o,wrapped:A,selector:r}),f.addEventListener(x,A)})}),this}function Mt(e,t,n){let s,r;typeof t=="string"?(s=t,r=n):typeof t=="function"&&(r=t);let i=e.split(" ");return this.each(function(o){if(!(o instanceof EventTarget))return;let a=o[F];a&&l(i,function(f,u){for(let j=a.length-1;j>=0;j--){let x=a[j],A=x.type===u,w=s?x.selector===s:!0,k=r?x.original===r:!0;A&&w&&k&&(o.removeEventListener(u,x.wrapped),a.splice(j,1))}})}),this}function St(e,t,n,s){let r=this,i=function(o){r.off(e,t,i);let a;return typeof t=="function"?a=t:typeof n=="function"?a=n:a=s,a.apply(this,arguments)};return typeof t=="string"?typeof n=="function"?this.on(e,t,i):this.on(e,t,n,i):typeof t=="function"?this.on(e,i):this.on(e,t,i)}function Lt(e,t){return this.each(function(n){if(!(n instanceof EventTarget))return;let s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:t});n.dispatchEvent(s)})}var F,Pe=c(()=>{"use strict";d();F="__jb_events"});var I={};h(I,{click:()=>At,dblclick:()=>qt,hover:()=>Ht,mousedown:()=>_t,mouseenter:()=>Wt,mouseleave:()=>Ct,mousemove:()=>kt,mouseout:()=>Nt,mouseover:()=>Kt,mouseup:()=>Pt});function At(e){return e?this.on("click",e):(this.each(function(t){t instanceof HTMLElement&&t.click()}),this)}function kt(e){return this.on("mousemove",e)}function Ct(e){return this.on("mouseleave",e)}function Wt(e){return this.on("mouseenter",e)}function _t(e){return this.on("mousedown",e)}function Pt(e){return this.on("mouseup",e)}function qt(e){return e?this.on("dblclick",e):(this.each(function(t){t instanceof HTMLElement&&t.dispatchEvent(new MouseEvent("dblclick",{bubbles:!0,cancelable:!0,view:window}))}),this)}function Nt(e){return this.on("mouseout",e)}function Kt(e){return this.on("mouseover",e)}function Ht(e,t){return this.mouseenter(e).mouseleave(t)}var qe=c(()=>{"use strict";});var O={};h(O,{ready:()=>Rt});function Rt(e){let t=window.document;return t.readyState==="complete"||t.readyState==="interactive"?e():this.on("DOMContentLoaded",e),this}var Ne=c(()=>{"use strict";});var D={};h(D,{keydown:()=>Ft,keypress:()=>It,keyup:()=>Jt,pressedKey:()=>Ot});function Ft(e){return this.on("keydown",e)}function Jt(e){return this.on("keyup",e)}function It(e){return this.on("keypress",e)}function Ot(e,t){return this.on("keydown",n=>{let s=n;s.key.toLowerCase()===e.toLowerCase()&&t(s)})}var Ke=c(()=>{"use strict";});var V={};h(V,{blur:()=>zt,change:()=>Vt,focus:()=>Ut,input:()=>$t,submit:()=>Dt});function Dt(e){return this.on("submit",e)}function Vt(e){return this.on("change",e)}function $t(e){return this.on("input",e)}function Ut(e){return e?this.on("focus",e):(this.each(function(t){t instanceof HTMLElement&&t.focus()}),this)}function zt(e){return e?this.on("blur",e):(this.each(function(t){t instanceof HTMLElement&&t.blur()}),this)}var He=c(()=>{"use strict";});var $={};h($,{swipeDown:()=>nn,swipeLeft:()=>Qt,swipeRight:()=>en,swipeUp:()=>tn,touchcancel:()=>Zt,touchend:()=>Gt,touchmove:()=>Yt,touchstart:()=>Xt});function Xt(e){return this.on("touchstart",e)}function Gt(e){return this.on("touchend",e)}function Yt(e){return this.on("touchmove",e)}function Zt(e){return this.on("touchcancel",e)}function Qt(e){return this.each(function(t){t instanceof Element&&C.call(this,t,"left",e)})}function en(e){return this.each(function(t){t instanceof Element&&C.call(this,t,"right",e)})}function tn(e){return this.each(function(t){t instanceof Element&&C.call(this,t,"up",e)})}function nn(e){return this.each(function(t){t instanceof Element&&C.call(this,t,"down",e)})}function C(e,t,n){let s=0,r=0;e.addEventListener("touchstart",i=>{s=i.touches[0].clientX,r=i.touches[0].clientY},{passive:!0}),e.addEventListener("touchend",i=>{let o=i.changedTouches[0].clientX-s,a=i.changedTouches[0].clientY-r,f=50;Math.abs(o)>Math.abs(a)?Math.abs(o)>f&&(o>0&&t==="right"&&n.call(e,i),o<0&&t==="left"&&n.call(e,i)):Math.abs(a)>f&&(a>0&&t==="down"&&n.call(e,i),a<0&&t==="up"&&n.call(e,i))},{passive:!0})}var Re=c(()=>{"use strict";});var Fe,Je=c(()=>{"use strict";Pe();qe();Ne();Ke();He();Re();Fe={...J,...I,...O,...D,...V,...$}});var U={};h(U,{attr:()=>sn,prop:()=>an,removeAttr:()=>on,val:()=>rn});function sn(e,t){if(t===void 0){let n=this[0];return n instanceof Element?n.getAttribute(e):null}return this.each(function(n){n instanceof Element&&n.setAttribute(e,t)}),this}function rn(e){if(e===void 0){let t=this[0];return t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement?t.value:""}return this.each(function(t){(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&(t.value=e)}),this}function on(e){return this.each(function(t){t instanceof Element&&t.removeAttribute(e)}),this}function an(e,t){if(t===void 0){let n=this[0];return n instanceof Element?n[e]:void 0}return this.each(function(n){n instanceof Element&&(n[e]=t)}),this}var Ie=c(()=>{"use strict";});var X={};h(X,{get:()=>cn,getText:()=>z});async function cn(e,t){let n={...t};n.method?.toLowerCase()==="post"&&(n.method="GET"),n.signal||(n.signal=AbortSignal.timeout(5e3));let s=await fetch(e,{...n});if(!s.ok)throw new Error(`HTTP Error: ${s.status}`);let r=await s.text();try{return r?JSON.parse(r):{}}catch{return r}}async function z(e,t){let n={...t};n.method?.toLowerCase()!=="get"&&(n.method="GET"),n.signal||(n.signal=AbortSignal.timeout(5e3));let s=await fetch(e,{...n});if(!s.ok)throw new Error(`HTTP Error: ${s.status}`);return await s.text()}var G=c(()=>{"use strict";});var Y={};h(Y,{html:()=>fn,load:()=>ln,text:()=>hn});function un(e,t){let n=t.createElement("div");return n.innerHTML=e,n.querySelectorAll("script").forEach(r=>{let i=t.createElement("script");Array.from(r.attributes).forEach(o=>{i.setAttribute(o.name,o.value)}),r.textContent&&(i.textContent=r.textContent),t.head.appendChild(i),t.head.removeChild(i),r.remove()}),n.innerHTML}function fn(e,t){if(e===void 0){let r=this[0];return r instanceof Element?r.innerHTML:""}let n=e,s=t?.executeScripts===!0;return this.each(function(r){if(r instanceof Element){let i=r.ownerDocument||document,o=s?un(n,i):y(n);r.innerHTML=o}}),this}function hn(e){if(e===void 0){let t=this[0];return t instanceof Node&&t.textContent||""}return this.each(function(t){t instanceof HTMLElement&&(t.textContent=e)}),this}async function ln(e,t){try{let n={...t};delete n.executeScripts;let s=await z(e,n);this.html(s,{executeScripts:t?.executeScripts})}catch(n){throw console.error(`jBase .load() failed to fetch: ${e}`,n),n}return this}var Oe=c(()=>{"use strict";G();d();});var Z={};h(Z,{after:()=>vn,append:()=>gn,appendTo:()=>bn,before:()=>Bn,empty:()=>yn,insertAfter:()=>wn,insertBefore:()=>xn,prepend:()=>jn,prependTo:()=>En,remove:()=>mn,replaceWith:()=>Tn,replaceWithClone:()=>pn,unwrap:()=>Sn,wrap:()=>Mn});function dn(e,t){let n=t.createElement("div");return n.innerHTML=y(e.trim()),n.firstElementChild}function g(e){return e.length>0&&e[0]instanceof Element?e[0].ownerDocument:typeof document<"u"?document:null}function M(e,t){let n=t.createDocumentFragment(),s=r=>{if(typeof r=="string"){let i=t.createElement("div");for(i.innerHTML=y(r.trim());i.firstChild;)n.appendChild(i.firstChild)}else r instanceof Node?n.appendChild(r):(r instanceof p||Array.isArray(r)||r instanceof NodeList)&&l(r,function(i,o){s(o)})};return s(e),n}function mn(){return this.each(function(e){e instanceof Element&&e.remove()}),this}function yn(){return this.each(function(e){e instanceof Element&&(e.innerHTML="")}),this}function pn(){let e=[];return this.each(function(t){if(t instanceof Element){let n=t.cloneNode(!0);t.replaceWith(n),e.push(n)}}),new this.constructor(e)}function gn(e){if(typeof e=="string"){let r=y(e);return this.each(function(i){i instanceof Element&&i.insertAdjacentHTML("beforeend",r)}),this}let t=g(this);if(!t)return this;let n=M(e,t),s=this.length;return this.each(function(r,i){if(r instanceof Element){let o=i{"use strict";d();K();d();});var Q={};h(Q,{children:()=>kn,closest:()=>Ln,descendants:()=>Wn,descendantsUntil:()=>qn,eq:()=>$n,filterBy:()=>Xn,findAll:()=>Cn,first:()=>Un,last:()=>zn,next:()=>Nn,nextAll:()=>Jn,nextSibling:()=>Hn,nextUntil:()=>Dn,not:()=>Gn,parent:()=>An,parents:()=>_n,parentsUntil:()=>Pn,prev:()=>Kn,prevAll:()=>In,prevSibling:()=>Rn,prevUntil:()=>Vn,sibling:()=>Fn,siblings:()=>On});function Ln(e){let t=[];this.each(function(s){if(s instanceof Element){let r=s.closest(e);r&&t.push(r)}});let n=this.constructor;return new n([...new Set(t)])}function An(){let e=[];this.each(function(n){n instanceof Element&&n.parentElement&&e.push(n.parentElement)});let t=this.constructor;return new t([...new Set(e)])}function kn(e){let t=[];this.each(function(s){if(s instanceof Element){let r=Array.from(s.children);t=t.concat(r)}}),e&&(t=t.filter(s=>s.matches(e)));let n=this.constructor;return new n(t)}function Cn(e){let t=[];this.each(function(s){if(s instanceof Element||s instanceof Document){let r=s.querySelectorAll(e);l(r,function(i,o){t.push(o)})}});let n=this.constructor;return new n([...new Set(t)])}function Wn(){return this.findAll("*")}function _n(e){let t=[];this.each(function(s){if(s instanceof Element){let r=s.parentElement;for(;r;)(!e||r.matches(e))&&t.push(r),r=r.parentElement}});let n=this.constructor;return new n([...new Set(t)])}function Pn(e,t){let n=[];this.each(function(r){if(r instanceof Element){let i=r.parentElement;for(;i&&!i.matches(e);)(!t||i.matches(t))&&n.push(i),i=i.parentElement}});let s=this.constructor;return new s([...new Set(n)])}function qn(e,t){let n=[],s=i=>{let o=i.children;for(let a=0;a{"use strict";d();});var ne={};h(ne,{check:()=>Yn,checked:()=>ee,disable:()=>es,disabled:()=>te,enable:()=>ts,select:()=>Qn,selected:()=>$e,uncheck:()=>Zn});function ee(e){if(e===void 0){let t=this[0];return t instanceof HTMLInputElement?t.checked:!1}return this.each(function(t){t instanceof HTMLInputElement&&(t.checked=e)}),this}function $e(e){if(e===void 0){let t=this[0];return t instanceof HTMLOptionElement?t.selected:!1}return this.each(function(t){t instanceof HTMLOptionElement&&(t.selected=e)}),this}function te(e){if(e===void 0){let t=this[0];return t instanceof HTMLElement&&"disabled"in t?t.disabled:!1}return this.each(function(t){t instanceof HTMLElement&&"disabled"in t&&(t.disabled=e,e?t.classList.add("disabled"):t.classList.remove("disabled"))}),this}function Yn(){return ee.call(this,!0)}function Zn(){return ee.call(this,!1)}function Qn(){return $e.call(this,!0)}function es(){return te.call(this,!0)}function ts(){return te.call(this,!1)}var Ue=c(()=>{"use strict";});var ze,Xe=c(()=>{"use strict";Ie();Oe();De();Ve();Ue();ze={...U,...Y,...Z,...Q,...ne}});var se={};h(se,{slideIn:()=>ns,slideOut:()=>ss,slideToggle:()=>rs});function ns(e={}){if(!m())return this;let{duration:t=300}=e;return this.each(function(n){n instanceof HTMLElement&&(n.style.willChange="transform",n.style.transition=`transform ${t}ms cubic-bezier(0.4, 0.0, 0.2, 1)`,requestAnimationFrame(()=>{n.style.transform="translateX(0%)"}),n.setAttribute("data-slide-state","open"))}),this}function ss(e={}){if(!m())return this;let{direction:t="left",duration:n=300}=e,s=t==="left"?"-100%":"100%";return this.each(function(r){r instanceof HTMLElement&&(r.style.willChange="transform",r.style.transition=`transform ${n}ms cubic-bezier(0.4, 0.0, 0.2, 1)`,requestAnimationFrame(()=>{r.style.transform=`translateX(${s})`}),r.setAttribute("data-slide-state","closed"))}),this}function rs(e={}){return m()?(this.each(function(t){if(t instanceof HTMLElement){let n=t.getAttribute("data-slide-state"),s=t.style.transform;n==="open"||s==="translateX(0%)"?new this.constructor(t).slideOut(e):new this.constructor(t).slideIn(e)}}),this):this}var Ge=c(()=>{"use strict";d();});var re={};h(re,{slideDown:()=>is,slideToggleBox:()=>as,slideUp:()=>os});function is(e={}){if(!m())return this;let{duration:t=300,displayType:n="block"}=e;return this.each(function(s){if(s instanceof HTMLElement){if(window.getComputedStyle(s).display!=="none")return;s.style.display=n;let r=s.scrollHeight;s.style.height="0px",s.style.overflow="hidden",s.style.transition=`height ${t}ms ease-in-out`,s.offsetHeight,s.style.height=`${r}px`,setTimeout(()=>{s.style.height="auto",s.style.overflow="visible",s.style.transition=""},t)}}),this}function os(e={}){if(!m())return this;let{duration:t=300}=e;return this.each(function(n){n instanceof HTMLElement&&(n.style.height=`${n.scrollHeight}px`,n.style.overflow="hidden",n.style.transition=`height ${t}ms ease-in-out`,n.offsetHeight,n.style.height="0px",setTimeout(()=>{n.style.display="none",n.style.height="",n.style.overflow="",n.style.transition=""},t))}),this}function as(e={}){return m()?(this.each(function(t){if(t instanceof HTMLElement){let n=window.getComputedStyle(t).display,s=new this.constructor(t);n==="none"?s.slideDown(e):s.slideUp(e)}}),this):this}var Ye=c(()=>{"use strict";d();});var ie={};h(ie,{fadeIn:()=>Ze,fadeOut:()=>Qe,fadeToggle:()=>et,hide:()=>us,show:()=>cs,toggle:()=>fs});function Ze(e={}){if(!m())return this;let t=typeof e=="number"?e:e.duration||300,n=typeof e=="object"&&e.displayType?e.displayType:"block";return this.each(function(s){s instanceof HTMLElement&&(s._jbaseFadeTimer&&clearTimeout(s._jbaseFadeTimer),s.style.opacity="0",s.style.display=n,s.style.transition=`opacity ${t}ms ease-in-out`,s.offsetHeight,requestAnimationFrame(()=>{s.style.opacity="1"}),s._jbaseFadeTimer=setTimeout(()=>{s.style.transition="",delete s._jbaseFadeTimer},t))}),this}function Qe(e={}){if(!m())return this;let t=typeof e=="number"?e:e.duration||300;return this.each(function(n){n instanceof HTMLElement&&(n._jbaseFadeTimer&&clearTimeout(n._jbaseFadeTimer),n.style.opacity="1",n.style.transition=`opacity ${t}ms ease-in-out`,n.offsetHeight,requestAnimationFrame(()=>{n.style.opacity="0"}),n._jbaseFadeTimer=setTimeout(()=>{n.style.display="none",n.style.transition="",delete n._jbaseFadeTimer},t))}),this}function et(e={}){return m()?(this.each(t=>{if(t instanceof HTMLElement){let n=window.getComputedStyle(t).display,s=new this.constructor(t);n==="none"?s.fadeIn(e):s.fadeOut(e)}}),this):this}var cs,us,fs,tt=c(()=>{"use strict";d();cs=Ze,us=Qe,fs=et});var nt,st=c(()=>{"use strict";Ge();Ye();tt();nt={...se,...re,...ie}});var oe={};h(oe,{post:()=>hs});async function hs(e,t={},n){let s={...n};s.method?.toLowerCase()!=="post"&&(s.method="post"),s.signal||(s.signal=AbortSignal.timeout(5e3));let r=await fetch(e,{...s,headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(r.status===204){let o=await r.text();return o?JSON.parse(o):{}}if(!r.ok)throw new Error(`HTTP Error: ${r.status}`);let i=await r.text();try{return i?JSON.parse(i):{}}catch{return i}}var rt=c(()=>{"use strict";});var ae={};h(ae,{upload:()=>ls});async function ls(e,t,n){return new Promise((s,r)=>{let i=new XMLHttpRequest;i.open("POST",e),n&&(i.upload.onprogress=a=>{if(a.lengthComputable){let f=Math.round(a.loaded/a.total*100);n(f,a.loaded,a.total)}}),i.onload=()=>{if(i.status>=200&&i.status<300){let a=i.responseText;try{s(a?JSON.parse(a):{})}catch{s(a)}}else r(new Error(`HTTP Error: ${i.status}`))},i.onerror=()=>{r(new Error("Network Error during upload"))};let o;t instanceof File?(o=new FormData,o.append("file",t)):o=t,i.send(o)})}var it=c(()=>{"use strict";});var ce,ue=c(()=>{"use strict";G();rt();it();ce={...X,...oe,...ae}});var ge={};h(ge,{add:()=>le,chunk:()=>fe,clear:()=>S,empty:()=>ds,find:()=>B,get:()=>ye,merge:()=>he,mergeArray:()=>ot,omit:()=>me,pick:()=>de,remove:()=>T,set:()=>pe});function fe(e,t){let n=[];for(let s=0;st.includes(s))}function me(e,t){return e.filter((n,s)=>!t.includes(s))}function ye(e,t){return t.split(".").reduce((n,s)=>n&&n[s],e)}function pe(e,t,n){let s=t.split("."),r=e;for(let i=0;i{"use strict";he=ot;ds=S;T={at(e,t){let n=[...e],s=t<0?e.length+t:t;return s>=0&&s{let o=s?i[s]:i,a=String(o).toLowerCase();switch(n){case"exact":return a===r;case"startsWith":return a.startsWith(r);case"endsWith":return a.endsWith(r);case"contains":return a.includes(r);default:return!1}})},byKey(e,t){return this.at(e,t)},byValue(e,t){return e.filter(n=>n!==t)},all(e){return S(e)}},B={at(e,t,n="exact",s){let r=String(t).toLowerCase();return e.findIndex(i=>{let o=s?i[s]:i,a=String(o).toLowerCase();switch(n){case"exact":return a===r;case"startsWith":return a.startsWith(r);case"endsWith":return a.endsWith(r);case"contains":return a.includes(r);default:return!1}})},all(e,t,n="exact",s){let r=String(t).toLowerCase();return e.filter(i=>{let o=s?i[s]:i,a=String(o).toLowerCase();switch(n){case"exact":return a===r;case"startsWith":return a.startsWith(r);case"endsWith":return a.endsWith(r);case"contains":return a.includes(r);default:return!1}})},first(e,t,n="exact",s){let r=String(t).toLowerCase();return e.find(i=>{let o=s?i[s]:i,a=String(o).toLowerCase();switch(n){case"exact":return a===r;case"startsWith":return a.startsWith(r);case"endsWith":return a.endsWith(r);case"contains":return a.includes(r);default:return!1}})},last(e,t,n="exact",s){let r=String(t).toLowerCase();return[...e].reverse().find(i=>{let o=s?i[s]:i,a=String(o).toLowerCase();switch(n){case"exact":return a===r;case"startsWith":return a.startsWith(r);case"endsWith":return a.endsWith(r);case"contains":return a.includes(r);default:return!1}})},key(e,t,n="exact"){let s=String(t).toLowerCase();return Object.keys(e).filter(r=>{let i=String(r).toLowerCase();switch(n){case"exact":return i===s;case"startsWith":return i.startsWith(s);case"endsWith":return i.endsWith(s);case"contains":return i.includes(s);default:return!1}})},value(e,t,n="exact"){return this.all(e,t,n)},byMatch(e,t,n="exact",s){let r=String(t).toLowerCase();return e.findIndex(i=>{let o=s?i[s]:i,a=String(o).toLowerCase();switch(n){case"exact":return a===r;case"startsWith":return a.startsWith(r);case"endsWith":return a.endsWith(r);case"contains":return a.includes(r);default:return!1}})}}});var Me={};h(Me,{add:()=>Te,chunk:()=>ve,clear:()=>L,empty:()=>ms,find:()=>v,get:()=>xe,merge:()=>Be,mergeObjects:()=>W,omit:()=>Ee,pick:()=>be,remove:()=>b,set:()=>we});function je(e){return e&&typeof e=="object"&&!Array.isArray(e)}function W(e,...t){if(!t.length)return e;let n=t.shift();if(je(e)&&je(n))for(let s in n)s==="__proto__"||s==="constructor"||(je(n[s])?(e[s]||(e[s]={}),W(e[s],n[s])):e[s]=n[s]);return W(e,...t)}function ve(e,t){let n=Object.entries(e),s=[];for(let r=0;rn&&n[s],e)}function we(e,t,n){let s=t.split("."),r=e;for(let i=0;i{"use strict";d();Be=W;ms=L;b={at(e,t){let n=Object.entries(e),s=t<0?n.length+t:t;return s>=0&&s{let u=String(s==="key"?o:a).toLowerCase();switch(n){case"exact":return u!==r;case"startsWith":return!u.startsWith(r);case"endsWith":return!u.endsWith(r);case"contains":return!u.includes(r);default:return!0}});return Object.fromEntries(i)},byKey(e,t){let n={...e};return delete n[t],n},byValue(e,t){let n=Object.entries(e).filter(([s,r])=>r!==t);return Object.fromEntries(n)},all(e){return L(e)}},v={at(e,t){let n=Object.entries(e),s=t<0?n.length+t:t;return n[s]},all(e,t,n="exact",s="key"){let r=String(t).toLowerCase(),i=Object.entries(e).filter(([o,a])=>{let u=String(s==="key"?o:a).toLowerCase();switch(n){case"exact":return u===r;case"startsWith":return u.startsWith(r);case"endsWith":return u.endsWith(r);case"contains":return u.includes(r);default:return!1}});return Object.fromEntries(i)},first(e,t,n="exact",s="key"){let r=Object.entries(e),i=String(t).toLowerCase();return r.find(([o,a])=>{let u=String(s==="key"?o:a).toLowerCase();switch(n){case"exact":return u===i;case"startsWith":return u.startsWith(i);case"endsWith":return u.endsWith(i);case"contains":return u.includes(i);default:return!1}})},last(e,t,n="exact",s="key"){let r=Object.entries(e),i=String(t).toLowerCase();return[...r].reverse().find(([o,a])=>{let u=String(s==="key"?o:a).toLowerCase();switch(n){case"exact":return u===i;case"startsWith":return u.startsWith(i);case"endsWith":return u.endsWith(i);case"contains":return u.includes(i);default:return!1}})},key(e,t,n="exact"){let s=String(t).toLowerCase();return Object.keys(e).filter(r=>{let i=String(r).toLowerCase();switch(n){case"exact":return i===s;case"startsWith":return i.startsWith(s);case"endsWith":return i.endsWith(s);case"contains":return i.includes(s);default:return!1}})},value(e,t,n="exact"){let s=String(t).toLowerCase();return Object.values(e).filter(r=>{let i=String(r).toLowerCase();switch(n){case"exact":return i===s;case"startsWith":return i.startsWith(s);case"endsWith":return i.endsWith(s);case"contains":return i.includes(s);default:return!1}})},byMatch(e,t,n="exact",s="key"){let r=String(t).toLowerCase(),o=Object.entries(e).find(([a,f])=>{let j=String(s==="key"?a:f).toLowerCase();switch(n){case"exact":return j===r;case"startsWith":return j.startsWith(r);case"endsWith":return j.endsWith(r);case"contains":return j.includes(r);default:return!1}});return o?o[0]:void 0}}});function ys(e,t){return Array.isArray(e)?fe(e,t):ve(e,t)}function ps(e,...t){return Array.isArray(e)?he(e,...t):Be(e,...t)}function gs(e,t,n,s){return Array.isArray(e)?le(e,t,n):Te(e,t,n,s)}function Se(e){return Array.isArray(e)?S(e):L(e)}function js(e,t){return Array.isArray(e)?de(e,t):be(e,t)}function Bs(e,t){return Array.isArray(e)?me(e,t):Ee(e,t)}function vs(e,t){return Array.isArray(e)?ye(e,t):xe(e,t)}function Ts(e,t,n){return Array.isArray(e)?pe(e,t,n):we(e,t,n)}function bs(e,t){return Array.isArray(e)?T.at(e,t):b.at(e,t)}function Es(e){return Array.isArray(e)?T.first(e):b.first(e)}function xs(e){return Array.isArray(e)?T.last(e):b.last(e)}function ws(e,t,n,s){return Array.isArray(e)?T.byMatch(e,t,n,s):b.byMatch(e,t,n,s)}function Ms(e,t){return Array.isArray(e)?T.byKey(e,t):b.byKey(e,t)}function Ss(e,t){return Array.isArray(e)?T.byValue(e,t):b.byValue(e,t)}function Ls(e,t,n,s){return Array.isArray(e)?B.at(e,t,n,s):v.at(e,t)}function As(e,t,n,s){return Array.isArray(e)?B.all(e,t,n,s):v.all(e,t,n,s)}function ks(e,t,n,s){return Array.isArray(e)?B.first(e,t,n,s):v.first(e,t,n,s)}function Cs(e,t,n,s){return Array.isArray(e)?B.last(e,t,n,s):v.last(e,t,n,s)}function Ws(e,t,n){return Array.isArray(e)?B.key(e,t,n):v.key(e,t,n)}function _s(e,t,n){return Array.isArray(e)?B.value(e,t,n):v.value(e,t,n)}function Ps(e,t,n,s){return Array.isArray(e)?B.byMatch(e,t,n,s):v.byMatch(e,t,n,s)}var Le,Ae=c(()=>{"use strict";at();ct();Le={arr:ge,obj:Me,chunk:ys,merge:ps,add:gs,clear:Se,empty:Se,pick:js,omit:Bs,get:vs,set:Ts,remove:{at:bs,first:Es,last:xs,byKey:Ms,byValue:Ss,byMatch:ws,all:Se},find:{at:Ls,all:As,first:ks,last:Cs,key:Ws,value:_s,byMatch:Ps}}});var qs,E,ut,ft,ht,lt,dt,mt,yt,pt,gt=c(()=>{"use strict";K();_e();Je();Xe();st();ue();Ae();d();d();d();ue();Ae();d();Object.assign(p.prototype,We);Object.assign(p.prototype,Fe);Object.assign(p.prototype,ze);Object.assign(p.prototype,nt);qs=e=>new p(e),E=Object.assign(qs,{http:ce,data:Le,each:l,throttle:q,debounce:N,fn:p.prototype}),ut=E,ft=E,ht=E,lt=E,dt=E,mt=E,yt=E,pt=E});var Ns=Bt(()=>{gt();window.$=ut;window.jBase=yt;window.jB=ft;window._jB=ht;window.__jB=lt;window._jBase=dt;window.__jBase=mt;window.__=pt;console.log("jBase initialized and ready!")});Ns();})(); //# sourceMappingURL=jbase.min.js.map