jmini 0.0.120 → 0.0.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";var P=Object.defineProperty,ne=Object.defineProperties,ie=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var j=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var O=Math.pow,G=(e,t,r)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))U.call(t,r)&&G(e,r,t[r]);if(L)for(var r of L(t))Q.call(t,r)&&G(e,r,t[r]);return e},_=(e,t)=>ne(e,se(t));var B=(e,t)=>{var r={};for(var i in e)U.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&L)for(var i of L(e))t.indexOf(i)<0&&Q.call(e,i)&&(r[i]=e[i]);return r};var oe=(e,t)=>{for(var r in t)P(e,r,{get:t[r],enumerable:!0})},le=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ae(t))!U.call(e,n)&&n!==r&&P(e,n,{get:()=>t[n],enumerable:!(i=ie(t,n))||i.enumerable});return e};var ue=e=>le(P({},"__esModule",{value:!0}),e);var C=(e,t,r)=>new Promise((i,n)=>{var a=u=>{try{l(r.next(u))}catch(h){n(h)}},o=u=>{try{l(r.throw(u))}catch(h){n(h)}},l=u=>u.done?i(u.value):Promise.resolve(u.value).then(a,o);l((r=r.apply(e,t)).next())}),$=function(e,t){this[0]=e,this[1]=t},Z=(e,t,r)=>{var i=(o,l,u,h)=>{try{var d=r[o](l),p=(l=d.value)instanceof $,g=d.done;Promise.resolve(p?l[0]:l).then(m=>p?i(o==="return"?o:"next",l[1]?{done:m.done,value:m.value}:m,u,h):u({value:m,done:g})).catch(m=>i("throw",m,u,h))}catch(m){h(m)}},n=o=>a[o]=l=>new Promise((u,h)=>i(o,l,u,h)),a={};return r=r.apply(e,t),a[j("asyncIterator")]=()=>a,n("next"),n("throw"),n("return"),a};var ee=(e,t,r)=>(t=e[j("asyncIterator")])?t.call(e):(e=e[j("iterator")](),t={},r=(i,n)=>(n=e[i])&&(t[i]=a=>new Promise((o,l,u)=>(a=n.call(e,a),u=a.done,Promise.resolve(a.value).then(h=>o({value:h,done:u}),l)))),r("next"),r("return"),t);var ve={};oe(ve,{Fetcher:()=>c,Filer:()=>E,Server:()=>N,Time:()=>f,UUID:()=>x,default:()=>Ee,useStore:()=>M});module.exports=ue(ve);typeof HTMLElement!="undefined"&&(HTMLElement.prototype.position=function(){return this.getBoundingClientRect()});typeof String!="undefined"&&(String.prototype.compress=function(){return this.trim().replace(/(\s|\n|\t)/ig,"")},String.prototype.encode=function(){return encodeURIComponent(this)},String.prototype.decode=function(){return decodeURIComponent(this)},String.prototype.toUpper=function(){return this.toLocaleUpperCase()},String.prototype.toLower=function(){return this.toLocaleLowerCase()},String.prototype.toCapital=function(){let e=this;return e&&(e=e.replace(/^./,this[0].toUpper()).replace(/(\s|_|-)[a-z]{1}/ig,t=>t[1].toUpper())),e},String.prototype.clip=function(e,t){return this.slice(e,t)},String.prototype.partReplace=function(...e){let t="";if(e.length==2){let[r,i]=e;t=[this.slice(0,r),i,this.slice(r+i.length)].join("")}if(e.length==3){let[r,i,n]=e;t=[this.slice(0,r),n,this.slice(r+i)].join("")}return t},String.prototype.toBlob=function(e){let t=atob(this.replace(/^.*,/,"")),r=new Uint8Array(t.length);for(var i=0;i<t.length;i++)r[i]=t.charCodeAt(i);try{var n=new Blob([r.buffer],{type:e})}catch(a){return!1}return n},String.prototype.toNumber=function(){let e=this.replace(/[^\d.-]/g,"").replace(/(-)(?=.*\d)/g,"").replace(/(\d+)\.(\d+)\.(\d+)/g,"$1.$2$3");return Number(e)||0},String.prototype.removeLetters=function(){return this.replace(/[\D]/ig,"")},String.prototype.removeSpecifics=function(){return this.replace(/[^\w\s\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]|_/uig,"")},String.prototype.removeJP=function(){return this.replace(/[\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]+/uig,"")},String.prototype.zen2hanNumber=function(){return this.replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).replace(/[--﹣−‐⁃‑‒–—﹘―⎯⏤ーー─━]/g,"-").replace(/¥/,"\xA5").replace(/、/,",").replace(/(/,"(").replace(/)/,")").replace(/+/,"+")},String.prototype.escapeRegExChar=function(){return this.replace(/\\/g,"\\\\").replace(/(\?|\^|\$|\.|\||\*|\+|\(|\)|\{|\}|\[|\])/g,"\\$1")});typeof Number!="undefined"&&(Number.prototype.zeroEmbed=function(e){let t=Number(this)<0,r=Math.abs(Number(this));return isNaN(r)?"":(t?"-":"")+String(r).padStart(e||2,"0")},Number.prototype.ratio=function(e,t=2){let r=O(10,t);return Math.round(this/e*r*100)/r},Number.prototype.rate=function(e,t=2){let r=O(10,t);return Math.round(this/e*r)/r},Number.prototype.rank=function(e=1){let t=O(10,e),r=Number(this);if(r<1e3)return String(this);let i=r.toLocaleString().replace(/\d/ig,"").length;return Math.round(r/O(1e3,i)*t)/t+("KMGTPEZY"[i-1]||"")},Number.prototype.rankJp=function(){let e=Number(this),t="";return e>=1e12?t=`${e/1e12}\u5146`:e>=1e8?t=`${e/1e8}\u5104`:e>=1e4?t=`${e/1e4}\u4E07`:e>=1e3?t=`${e/1e3}\u5343`:t=`${e.toLocaleString()}`,t},Number.prototype.toDate=function(e="/"){let t=String(this),r=t.slice(0,4),i=t.slice(4,6),n=t.slice(6,8),a=[];return r.length!=4||a.push(r),i.length!=2||a.push(i),n.length!=2||a.push(n),a.join(e)});if(typeof Array!="undefined"){let e=(r,...i)=>{var a;let n=r;for(let o of i){if(o!==(o!=null?o:!o))break;n=(a=(n||{})[o!=null?o:""])!=null?a:null}return n},t=r=>typeof Number(r)=="number"&&!isNaN(r);Array.prototype.sortBy=function(r,i,n,a){let l=(Array.isArray(i)?i:i?[i]:[""]).map(d=>String(d).match(/([^\.\[\]"]+)/g)||[]),u=l.map((d,p)=>1);return this.map(d=>({origin:d,sortVal:l.map((p,g)=>{let m=e(d,...p);if(t(m))return Number(m);let y=String(m).replace(/¥|,/g,"");return t(y)?Number(y):(u[g]=0,y.replace(/(\d+)/g,b=>b.padStart(10,"0")))})})).sort((d,p)=>{for(let g=0;g<l.length;g++){let m=d.sortVal[g],y=p.sortVal[g];if(u[g]){if(m>y)return 1*r;if(m<y)return-1*r;continue}let b=String(m).localeCompare(String(y),n,a);if(b!=0)return b*r}return 0}).map((d,p)=>(this[p]=d.origin,d.origin))},Array.prototype.toASC=function(...r){return this.sortBy(1,...r)},Array.prototype.toDESC=function(...r){return this.sortBy(-1,...r)},Array.prototype.getSum=function(...r){return this.reduce((i,n)=>i+(r?e(n,...r):Number(n)||0),0)},Array.prototype.getAve=function(...r){return this.getSum(...r)/this.length},Array.prototype.getMedian=function(...r){let i=this.map(a=>r?e(a,...r):Number(a)||0);i.sort((a,o)=>a-o);let n=Math.floor(i.length/2);return i.length%2===0?(i[n-1]+i[n])/2:i[n]},Array.prototype.getMin=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.min(...i)},Array.prototype.getMax=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.max(...i)},Array.prototype.chunk=function(r){let i=[];for(let n=0;n<this.length;n+=r)i.push(this.slice(n,n+r));return i},Array.prototype.forEachChunk=function(r,i,n){return C(this,null,function*(){let a=[],o=this.chunk(r);if(n)yield Promise.all(o.map((l,u)=>C(this,null,function*(){a[u]=v({ok:!0},yield i(l,u))})));else for(let l=0;l<o.length;l++)a.push(v({ok:!0},yield i(o[l],l)));return[a.every(l=>l.ok),a]})}}typeof File!="undefined"&&(File.prototype.convert=function(e){e=e||"dataURL";let t="readAs"+(e==null?void 0:e.toCapital());return new Promise((r,i)=>{let n=new FileReader;n.onload=a=>{r(n.result)},n.onerror=a=>i(n.error||a),n[t](this)})},File.prototype.clone=function(){return new File([this.slice(0,this.size,this.type)],this.name,{type:this.type,lastModified:this.lastModified})});var he=(e=24)=>Array.from({length:e}).map((t,r)=>{let i=r==0?25:35,n=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*i)][n?"toUpper":"toLower"]()}).join(""),x=he;x.get128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");x.get32Hex=(e="Formatted",t="-")=>{let r=Array.from({length:32}).map((i,n)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(r=[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20,32)].join(t)),r};x.to32Format=e=>[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-").toUpper();var me=e=>new s.prototype.jmini(e),s=me;s.prototype={};s.extend=function(e,t=s){for(var[r,i]of Object.entries(e))t.prototype[r]=i};s.expando="__jmini_"+x();s.__classAlias="jmini";var R=(e,t)=>(e.queue.push(t),q(e),e),q=e=>C(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let t=e.queue.shift();t&&(yield t()),e.queueProcess=!1,q(e)}),k=(e,t)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,i]of Object.entries(t))r.match(/queue/)||(e[r]=i);return e},fe=(e,t)=>{if(t.length){for(var r=0;r<t.length;r++){let i=t[r];i&&(i[s.expando]||(s.isElement(i)||s.isShadowRoot(i))&&(i[s.expando]={events:{}})),e[r]=i}e.length=t.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,q(e),e};s.extend({constructor:s,__classAlias:s.__classAlias,jmini:function(e){return this.src=e,this.srcType=s.isWhat(e),this.queueProcess=!0,this.queue=[],fe(this,s.isJmini(e)?e.get():s.isElement(e)?[e]:s.isElements(e)?e:s.isShadowRoot(e)?[e]:s.isString(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}});s.prototype[String(Symbol.iterator)]=[][Symbol.iterator];s.prototype.jmini.prototype=s.prototype;{let e=function(n,a,o){let l=[];for(let u=0;u<(n.length||0);u++)l.push(a(n[u],u));return o&&(l=l.filter(u=>u!=null)),l},t=n=>(n.for((a,o)=>{if(!(s.isElement(a)||s.isShadowRoot(a)))return;let l=a.cloneNode(),u=a.parentNode;u&&u.replaceChild(l,a),n[o]=l}),n),r=(n,a)=>(s(a).for(o=>{if(n&&(s.isElement(o)||s.isShadowRoot(o)))if(s.isString(n)||s.isNumber(n))n=String(n),o.insertAdjacentHTML("beforeend",String(n));else if(s.isElement(n))o.appendChild(n);else{s.isJmini(n)?n=n.get():s.isElement(n)?n=[n]:s.isRecord(n)&&(n=[s(n)]);for(var l=0;l<n.length;l++)r(n[l],o)}}),a),i=(n,a,...o)=>{let{p:l,s:u}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[a]||{p:"",s:""};return n.for(h=>{if(s.isString(o[0]))h.insertAdjacentHTML(l,o[0]);else{if(!h.parentNode)return;s(o[0]).for(p=>{o[1]&&(p=p.cloneNode(!0)),h.parentNode.insertBefore(p,h[u]||h)})}}),n};s.extend({get:function(n){return n?this[0]:e(this,a=>a)},for:function(n,a=1){let o=e(this,(l,u)=>n(l,u),1);return a?o:[]},await:function(n){return R(this,()=>new Promise((a,o)=>{setTimeout(()=>{a(this)},n)}))},abort:function(){return R(this,()=>C(this,null,function*(){return this.queue=[],this}))},callback:function(n){return R(this,()=>C(this,null,function*(){return yield n(this),this}))},click:function(){return R(this,()=>{for(var n=0;n<this.length;n++){let a=this[n];s.isElement(a)&&a.click()}return this})},focus:function(){return R(this,()=>{for(var n=0;n<this.length;n++){let a=this[n];s.isElement(a)&&a.focus()}return this})},onEvent:function(n,a,o){return R(this,()=>{let d=o||{},{target:l,eventID:u=x()}=d,h=B(d,["target","eventID"]);return h=v({passive:!0,capture:!1},h),this.for(p=>{if(!(s.isElement(p)||s.isShadowRoot(p)))return;let{events:g}=p[s.expando];if(l){let m=a;a=y=>{if(y.target){if(s.isString(l)){let T=y.target.closest(l);T&&(!T||m.call(T,y))}else if(s.isElements(l)){for(let b of l)if(y.target==b)return m.call(b,y)}}}}if(g[u]){let m=g[u];p.removeEventListener(m.eventType,m.callback,m.options)}g[u]={eventType:n,callback:a,options:h},p.addEventListener(n,a,h)}),this})},addEvent:function(n){return R(this,()=>{let{eventType:a,eventID:o=x(),target:l,callback:u,options:h}=n;return h=v({passive:!0,capture:!1},h),this.for(d=>{if(!(s.isElement(d)||s.isShadowRoot(d)))return;let{events:p}=d[s.expando];if(l){let g=u;u=m=>{if(m.target){if(s.isString(l)){let b=m.target.closest(l);b&&(!b||g.call(b,m))}else if(s.isElements(l)){for(let y of l)if(m.target==y)return g.call(y,m)}}}}if(p[o]){let g=p[o];d.removeEventListener(g.eventType,g.callback,g.options)}p[o]={eventType:a,callback:u,options:h},d.addEventListener(a,u,h)}),this})},removeEvent:function(n){return R(this,()=>{let a=s.isArray(n)?n:[n];return this.for(o=>{let{events:l}=o[s.expando];for(let u of a){let h=l[u];h&&o.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(n){return R(this,()=>k(this,r(n,t(this))))},empty:function(){return R(this,()=>k(this,t(this)))},append:function(n){return R(this,()=>{r(n,this)})},remove:function(){return R(this,()=>(this.for((n,a)=>{n&&s.isElement(n)&&(n.remove(),delete this[a])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...n){return R(this,()=>k(this,i(this,"before",...n)))},after:function(...n){return R(this,()=>k(this,i(this,"after",...n)))},find:function(n){return R(this,()=>{let a=[],o=this[0];o||k(this,s()),(s.isElement(o)||s.isShadowRoot(o))&&(s.isString(n)?a=o.querySelectorAll(n):s.isElement(o)&&s(n).for(l=>{let u=o.childNodes;for(let h of u)if(h===l){a.push(h);break}else h.childNodes.length&&(a=[...a,...s(h).find(l).for(d=>d)])})),k(this,s(a))})},parent:function(n){return R(this,()=>{var o,l;let a=s(n?(o=this[0])==null?void 0:o.closest(n):(l=this[0])==null?void 0:l.parentNode);k(this,a)})},children:function(n){return R(this,()=>{let a=this[0].children;s.isExist(n)&&(n=String(n).replace(/^ : /,""),a=n=="first"?a[0]:n=="last"?a[a.length-1]:a[Number(n)]);let o=s(a);return k(this,o)})},addClass:function(...n){return R(this,()=>{let a=n.join(" ").split(/\s+/).filter(o=>o.trim()!=="");return a.length&&this.for(o=>{o&&s.isElement(o)&&o.classList.add(...a)}),this})},removeClass:function(...n){return R(this,()=>{let a=n.join(" ").split(/\s+/).filter(o=>o.trim()!=="");return a.length&&this.for(o=>{o&&s.isElement(o)&&o.classList.remove(...a)}),this})},toggleClass:function(n){return R(this,()=>(n&&this.for(a=>{a.classList.toggle(n)}),this))},hasClass:function(n=""){return this[0]?this[0].classList.contains(n.replace(/^\./,"")):!1},findClass:function(n){let a=[];return s.scope(()=>{this[0]&&(a=[...this[0].classList||[]].filter(o=>o.match(n)))}),a},css:function(n){return R(this,()=>(this.for(a=>{if(s.isElement(a))for(let[o,l]of Object.entries(n)){if(s.isNumber(l)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){a.style[o]=l+"px";continue}a.style[o]=String(l)}}),this))},getAttribute:function(n){return this[0].getAttribute(String(n))||""},setAttribute:function(n,a){return R(this,()=>(this.for(o=>o.setAttribute(n,a)),this))},getStyleProperty:function(n){let a=this[0];return a&&s.isElement(a)?getComputedStyle(a).getPropertyValue(n):""},setStyleProperty:function(n,a){let o=this[0];return o&&s.isElement(o)&&o.style.setProperty(n,a),this},val:function(){var a;let n=this[0];return(n==null?void 0:n.value)||((a=n==null?void 0:n.dataset)==null?void 0:a.value)},position:function(){return s.isElement(this[0])?this[0].getBoundingClientRect():{x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0,toJSON:()=>{}}}})}s.uniqueArray=(e,t)=>t?Array.from(new Map(e.map(r=>[s.getRecord(r,t||"0"),r])).values()):Array.from(new Set(e));s.getRecord=(e,t)=>{let r={},i=e;return t.split(".").forEach(n=>{i=i==null?void 0:i[n],r=i}),r};s.Arrayify=s.flatArray=(e,t)=>{if(!s.isArray(e))return[e];let r=[];for(let i of e)r.push(...t=="-R"?s.Arrayify(i,"-R"):[i]);return r};s.Stringify=(...e)=>{let[t,r,i]=e;return JSON.stringify(t,r!=null?r:(()=>{let n=new WeakSet;return(a,o)=>{if(typeof o=="object"&&o!==null){if(n.has(o))return"[Circular Reference]";n.add(o)}return o}})(),i)};s.Objectify=(e,t)=>{try{return JSON.parse(e)}catch(r){return t!=null?t:null}};s.SortifyObject=(e,t)=>{let r={};return!e||!s.isArray(e)&&!s.isRecord(e)?null:(Object.keys(e).sort().forEach(i=>{let n=e[i];if(t){if(s.isRecord(n)){r[i]=s.SortifyObject(n,t);return}if(s.isArray(n)){r[i]=n.map(a=>s.isRecord(a)||s.isArray(a)?s.SortifyObject(a,t):a);return}}r[i]=n}),r)};s.randomNumber=(e=0,t=100,r)=>{if(e>t)return NaN;let i=Math.round(Math.random()*(t-e))+e;return r&&r.length&&r.includes(i)?s.randomNumber(e,t,r):i};s.try=e=>{try{return[e(),!0]}catch(t){return[t,!1]}};s.trySync=e=>C(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});s.scope=e=>e();s.scopeSync=e=>C(void 0,null,function*(){return yield e()});s.createElement=function(e){var p;let{tag:t,className:r="",id:i,html:n,attr:a,style:o,parent:l}=e,u=document.createElement(t||"div");if(r&&u.classList.add(...r.split(" ")),i&&(u.id=i),a)for(let g of Object.entries(a)){let m=g[0],y=(p=g[1])!=null?p:"";if(m=="data"&&s.isRecord(y))for(let[b,T]of Object.entries(y))u.dataset[b]=T;else m=="for"?m="htmlFor":m=="tabindex"?m="tabIndex":m=="aria-label"&&(m="ariaLabel"),u[m]=y}if(n&&s(u).append(n),o)for(var[h,d]of Object.entries(o))u.style[h]=d;return l&&s(l).append(u),u};s.setCookie=e=>{let{hostname:t}=new URL(location.toString()),{name:r,value:i="",age:n=60*60*24*365,path:a="/",domain:o=t,secure:l=!1}=e,u=`${r}=${i}max-age=${n}path=${a}domain=${o}`;l&&(u+=" Secure"),document.cookie=u};s.getCookie=e=>{let t=document.cookie.match(new RegExp(e+"=[^]*"));return t?t[0].replace(new RegExp(e+"="),""):""};s.localStorage={set:(e,t)=>{localStorage.setItem(e,s.Stringify(t))},get:e=>{let t=localStorage.getItem(e);return s.Objectify(t,t)}};s.deleteCookie=e=>{document.cookie=e+"=max-age=0"};s.getScreenSize=()=>{let{innerHeight:e,innerWidth:t,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:a}=window,o=Number(s(document.body).getStyleProperty("--sat").removeLetters()),l=Number(s(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:t,pageHeight:e-o-l,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:a,safeAreaTop:o,safeAreaBottom:l}};s.getCursor=e=>{var i,n,a,o,l,u,h,d;let t=(o=e.pageX)!=null?o:(a=(i=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:i.pageX)!=null?a:(((n=e==null?void 0:e.originalEvent)==null?void 0:n.touches)||[])[0].pageX,r=(d=e.pageY)!=null?d:(h=(l=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:l.pageY)!=null?h:(((u=e==null?void 0:e.originalEvent)==null?void 0:u.touches)||[])[0].pageY;return{x:t,y:r}};s.pending=(e,t)=>{var i;let r=(i=t||Number(e))!=null?i:-1;return new Promise((n,a)=>{s.isFunction(e)&&e(n),!(r<0)&&setTimeout(()=>{n(!0)},r)})};s.deepMerge=(e,...t)=>{if(!t.length)return e;let r=t.shift();if(s.isRecord(e)&&s.isRecord(r))for(let i in r)s.isRecord(r[i])?(e[i]||Object.assign(e,{[i]:{}}),s.deepMerge(e[i],r[i])):Object.assign(e,{[i]:r[i]});return s.deepMerge(e,...t)};s.deepCopy=e=>{if(s.isArray(e))return e.map(t=>s.deepCopy(t));if(s.isRecord(e)){let t={};return Object.entries(e).forEach(([r,i])=>{t[r]=s.deepCopy(i)}),t}return e};s.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,t)=>{let r=new URL(t||location.href);if(s.isString(e))r.pathname=e;else{let i=s.url.path.get();Object.entries(e).forEach(([n,a])=>{i[Number(n)]=a}),r.pathname="/"+i.filter(n=>n!=null).join("/")}return t||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{get:e=>{let t=new URL(e||location.href),r={};return t.searchParams.forEach((i,n)=>r[n]=i),r},set:(e,t)=>{let r=new URL(t||location.href);return Object.entries(e).forEach(([i,n])=>{r.searchParams.set(i,String(n))}),t||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,t)=>{let r=new URL(t||location.href);return e.forEach(i=>{r.searchParams.delete(i)}),t||history.replaceState({},"",r.pathname+r.search),r.toString()}}};s.queryParams={get:e=>{let t=new URL(e||location.href),r={};return t.searchParams.forEach((i,n)=>r[n]=i),r},set:(e,t)=>{let r=new URL(t||location.href);return Object.entries(e).forEach(([i,n])=>{r.searchParams.set(i,String(n))}),t||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,t)=>{let r=new URL(t||location.href);return e.forEach(i=>{r.searchParams.delete(i)}),t||history.replaceState({},"",r.pathname+r.search),r.toString()}};s.ellipsisText=(e,t)=>{let r=String(e);return r.length>t&&(r=r.slice(0,t)+" ..."),r};s.isEqual=(e,t,r)=>r==null||r?s.Stringify(e)===s.Stringify(t):e===t,s.isExist=e=>e===(e!=null?e:!e),s.isNullish=e=>!s.isExist(e),s.isJmini=e=>{var t,r;return((t=e||{})==null?void 0:t.constructor)===s||((r=e||{})==null?void 0:r.__classAlias)===s.__classAlias},s.isString=e=>typeof e=="string",s.isBoolean=e=>typeof e=="boolean",s.isNumber=e=>!isNaN(e)&&typeof e=="number",s.isArray=e=>{let t={}.toString.call(e);return Array.isArray(e)||e instanceof Array||t=="[object NodeList]"||t=="[object HTMLCollection]"},s.isFunction=e=>typeof e=="function",s.isRecord=e=>({}).toString.call(e)==="[object Object]"&&!s.isJmini(e),s.isElement=e=>e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e)),s.isElements=e=>{let t={}.toString.call(e),r=Number(!!e&&!s.isString(e)&&s.isArray(e)&&t!=="[object Text]");if(r&&s.isArray(e)&&t!=="[object NodeList]")for(var i of e)r&=Number(s.isElement(i));return!!r},s.isShadowRoot=e=>e instanceof ShadowRoot,s.isDate=e=>s.isNumber(new Date(e).getTime()),s.isInRange=(e,t,r,i=!0)=>i?t<=e&&e<=r:t<e&&e<r,s.isOneOf=(e,...t)=>{if(!(t!=null&&t.length))return!1;let r=s.isArray(e),i=s.isRecord(e);return r||i?t==null?void 0:t.some(n=>s.isEqual(e,n)):t==null?void 0:t.includes(e)},s.isWhat=e=>{let t="other";return s.isJmini(e)?t="jmini":s.isElement(e)?t="element":s.isElements(e)?t="elements":s.isShadowRoot(e)?t="shadowRoot":s.isString(e)?t="string":s.isNumber(e)?t="number":s.isArray(e)?t="array":s.isFunction(e)?t="function":s.isDate(e)?t="date":typeof e=="undefined"?t="undefined":s.isRecord(e)?t="record":e==null?t="null":isNaN(e)&&(t="NaN"),t};s.is={equal:s.isEqual,exist:s.isExist,nullish:s.isNullish,jmini:s.isJmini,string:s.isString,boolean:s.isBoolean,number:s.isNumber,array:s.isArray,function:s.isFunction,record:s.isRecord,element:s.isElement,elements:s.isElements,shadowRoot:s.isShadowRoot,date:s.isDate,inRange:s.isInRange,oneOf:s.isOneOf,what:s.isWhat};var A={},M={set:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{let a=A[i]||{};a&&a.privateKey&&a.privateKey!=t&&(r=!1),A[i]={privateKey:t,value:n}}),r},update:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{var o;let a=A[i]||{};a&&a.privateKey&&a.privateKey!=t&&(r=!1),A[i]=_(v({},A[i]),{value:v(v({},(o=A[i])==null?void 0:o.value),n)})}),r},get:(e,t)=>{let r=A[e];if(!(r&&r.privateKey&&r.privateKey!=t))return r==null?void 0:r.value},delete:(e,t)=>{let r=A[e];return r&&r.privateKey&&r.privateKey!=t?!1:(delete A[e],!0)}};var te=-new Date().getTimezoneOffset(),ce=(e,t)=>new f.prototype.Time(e,t),f=ce;f.prototype={};f.__classAlias="jmini.Time";var de=function(e,t){if(t&&(this.localTimezoneOffset=t),f.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0?e=new Date:e===0&&(e=new Date(0))),e&&(s.isNumber(e)&&(e=new Date(e)),s.isString(e)&&(e=String(e).trim().replace(/\//g,"-").replace(/ +|\s+/g," ").replace(/\-+/g,"-"),e=e.replace(/^(\d{4}-\d{2}-\d{2})$/,"$1T00:00:00").replace(/^(\d{4}-\d{2}-\d{2})\s+/,"$1T").replace(/^(\d{4}-\d{2}-\d{2}T\d{2})(:?|:+)$/,"$1:00").replace(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(:?|:+)$/,"$1:00"),e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1,3})?$/)))){let i=this.getLocalTimezoneOffset(),n=Math.floor(i/60),a=i%60;n>=0&&(e+="+"),e+=n.zeroEmbed(2),e+=":"+a.zeroEmbed(2)}let r=new Date(String(e));return this.set(r)};s.extend({constructor:f,Time:de,__classAlias:f.__classAlias,value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,warekiYear:-1,wareki:"",warekiLabel:"",year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,localTimezoneOffset:void 0,getLocalTimezoneOffset:function(){var e,t;return(t=(e=this.localTimezoneOffset)!=null?e:M.get("jmini/time/env/localTimezoneOffset"))!=null?t:te},setLocalTimezoneOffset:function(e,t){return this.localTimezoneOffset=e,t&&M.set({"jmini/time/env/localTimezoneOffset":e}),this.set(this.value)},clone:function(){return f(this,this.localTimezoneOffset)},set:function(e){var n;this.value=e;let t=s.isDate(e);if(this.validate=t,s.isNullish(this.localTimezoneOffset)&&(this.localTimezoneOffset=(n=M.get("jmini/time/env/localTimezoneOffset"))!=null?n:te),!t)return this.ms=-1,this.year=-1,this.month=-1,this.weekday=-1,this.weekInYear=-1,this.date=-1,this.hours=-1,this.minutes=-1,this.seconds=-1,this;let r=e.getTime()+e.getTimezoneOffset()*6e4,i=new Date(r+this.getLocalTimezoneOffset()*60*1e3);this.ms=e.getTime(),this.year=i.getFullYear(),this.month=i.getMonth()+1,this.date=i.getDate(),this.weekday=i.getDay(),this.hours=i.getHours(),this.minutes=i.getMinutes(),this.seconds=i.getSeconds();{let a=this.year||0,o=this.month||0,l=this.date||0,u=Number(a+o.zeroEmbed(2)+l.zeroEmbed(2));u>=20190501?(this.warekiYear=a-2018,this.wareki="REIWA",this.warekiLabel="\u4EE4\u548C"):u>=19890108?(this.warekiYear=a-1988,this.wareki="HEISEI",this.warekiLabel="\u5E73\u6210"):u>=19261225?(this.warekiYear=a-1925,this.wareki="SHOUWA",this.warekiLabel="\u662D\u548C"):u>=19120730?(this.warekiYear=a-1911,this.wareki="TAISHO",this.warekiLabel="\u5927\u6B63"):u>=19680125?(this.warekiYear=a-1867,this.wareki="MEIJI",this.warekiLabel="\u660E\u6CBB"):(this.warekiYear=0,this.wareki="",this.warekiLabel="")}{let a=new Date(this.year,0,1),o=new Date(a.valueOf());o.setDate(o.getDate()-(a.getDay()+1));let l=this.ms-o.getTime(),u=Math.ceil(l/(1e3*60*60*24));this.weekInYear=Math.ceil(u/7)}{let a=new Date(this.year,this.month-1,1),o=new Date(a.valueOf());o.setDate(o.getDate()-(a.getDay()+1));let l=this.ms-o.getTime(),u=Math.ceil(l/(1e3*60*60*24)),h=Math.ceil(u/7);this.weekInMonth=h}{let a=new Date(this.year,this.month,0),o=a.getDay(),l=new Date(new Date(a).setDate(a.getDate()-o));this.isLastWeekInMonth=this.date>=l.getDate()}return this},isPast:function(){let e=f();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=f(e);return this.year==t.year},isSameMonth:function(e){let t=f(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=f(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=f(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},isInRange:function(e,t){return!this.validate||!e.validate||!t.validate?!1:this.value>=e.value&&this.value<=t.value},setYear:function(e){let t=new Date(this.value.valueOf());return t.setFullYear(e),this.set(t)},setMonth:function(e){let t=new Date(this.value.valueOf()),r=t.getDate();t.setDate(1),t.setMonth(e-1);let i=f(t).getLastDayOfMonth();return t.setDate(Math.min(r,i.date)),this.set(t)},setDate:function(e){let t=new Date(this.value.valueOf());return t.setDate(e),this.set(t)},setHours:function(e){let t=new Date(this.value.valueOf());return t.setHours(e),this.set(t)},setMinutes:function(e){let t=new Date(this.value.valueOf());return t.setMinutes(e),this.set(t)},setSeconds:function(e){let t=new Date(this.value.valueOf());return t.setSeconds(e),this.set(t)},setMilliseconds:function(e){let t=new Date(this.value.valueOf());return t.setMilliseconds(e),this.set(t)},addYear:function(e){return this.setYear(this.year+e)},addMonth:function(e){return this.setMonth(this.month+e)},addWeek:function(e){return this.addDate(7*e)},addDate:function(e){return this.setDate(this.date+e)},addHours:function(e){return this.setHours(this.hours+e)},addMinutes:function(e){return this.setMinutes(this.minutes+e)},addSeconds:function(e){return this.setSeconds(this.seconds+e)},toFormat:function(e,t){if(!this.validate)return"";let r=this;return s.isExist(t)&&(r=r.clone(),r.setLocalTimezoneOffset(t||0)),e.replace(/\%y/ig,r.year.zeroEmbed(4)).replace(/\%m/ig,r.month.zeroEmbed(2)).replace(/\%d/ig,r.date.zeroEmbed(2)).replace(/\%w/ig,r.weekInYear.zeroEmbed(2)).replace(/\%h/ig,r.hours.zeroEmbed(2)).replace(/\%i/ig,r.minutes.zeroEmbed(2)).replace(/\%s/ig,r.seconds.zeroEmbed(2))},toFormatISO:function(){return this.value.toISOString()},toFormatabbrYMD:function(e,t){if(!this.validate)return"";let r=this.isSameYear(f()),i="%Y/%M/%D";return r&&(i="%M/%D"),e=="JP"&&(i="%Y\u5E74%M\u6708%D\u65E5",r&&(i="%M\u6708%D\u65E5")),this.toFormat(i,t)},toFormatYMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t):""},toFormatYM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708",t):this.toFormat("%Y/%M",t):""},toFormatMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):""},toFormatHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206",t):this.toFormat("%h:%i",t):""},toFormatHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206%s\u79D2",t):this.toFormat("%h:%i:%s",t):""},toFormatYMDHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206",t):this.toFormat("%Y/%M/%D %h:%i",t):""},toFormatYMDHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2",t):this.toFormat("%Y/%M/%D %h:%i:%s",t):""},toLangYMD:function(e,t){if(!this.validate)return"";let r=f(),i=r.diff(this);return i.dates==0?"\u4ECA\u65E5":i.dates==1?"\u6628\u65E5":i.dates>=-7&&i.dates<0?-1*i.dates+"\u65E5\u5F8C":i.dates<=7&&i.dates>0?i.dates+"\u65E5\u524D":this.isSameYear(r)?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t)},setFirstOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},setFromFormatHHMM:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(4).replace(/(\d{2})(\d{2})/,"$1:$2"),[r,i]=t.split(":"),n=new Date(this.value.valueOf());return n.setHours(Number(r)),n.setMinutes(Number(i)),this.set(n)},setFromFormatHHMMSS:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(6).replace(/(\d{2})(\d{2})(\d{2})/,"$1:$2:$3"),[r,i,n]=t.split(":"),a=new Date(this.value.valueOf());return a.setHours(Number(r)),a.setMinutes(Number(i)),a.setSeconds(Number(n)),this.set(a)},getFirstDayOfYear:function(){return f(new Date(this.value.getFullYear(),0,1))},getLastDayOfYear:function(){return f(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfMonth:function(){return f(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfMonth:function(){return f(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfWeek:function(){let e=f(this.value);return e.addDate(-e.weekday)},getLastDayOfWeek:function(){let e=f(this.value);return e.addDate(6-e.weekday)},diff:function(e){return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:s.scope(()=>{let t=864e5,r=this.clone().setFirstOfDay(),i=e.clone().setFirstOfDay();return Math.floor((r.ms-i.ms)/t)}),hours:s.scope(()=>{let t=36e5,r=this.clone().setMinutes(0).setSeconds(0).setMilliseconds(0),i=e.clone().setMinutes(0).setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),minutes:s.scope(()=>{let t=6e4,r=this.clone().setSeconds(0).setMilliseconds(0),i=e.clone().setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),seconds:s.scope(()=>{let t=this.clone().setMilliseconds(0),r=e.clone().setMilliseconds(0);return Math.floor((t.ms-r.ms)/1e3)}),ms:this.ms-e.ms}},getAge:function(e){let t=e||f(),r=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&r--,r}},f);f.isTimeObject=e=>{var t,r;return((t=e||{})==null?void 0:t.constructor)===f||((r=e||{})==null?void 0:r.__classAlias)===f.__classAlias};f.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return f(t+" 00:00:00")};f.getShortYMDs=(e,t)=>{let r="",i="";return e.year==t.year&&e.year==f().year?r=e.toFormatMD():r=e.toFormatYMD(),e.year!=t.year?i=t.toFormatYMD():i=t.toFormatMD(),[r,i]};f.getPeriodArray=(e,t,r)=>{let i=[],n=t;if(!t.validate||!r.validate)return i;for(e=="year"?n=f(n).setMonth(1).setDate(1).setFirstOfDay():e=="month"?n=f(n).setDate(1):e=="week"?n=f(n).getFirstDayOfWeek():e=="day"?n=f(n).setFirstOfDay():e=="hours"?n=f(n).setMinutes(0).setSeconds(0).setMilliseconds(0):e=="minutes"?n=f(n).setSeconds(0).setMilliseconds(0):e=="seconds"&&(n=f(n).setMilliseconds(0));n.toFormatYMDHMS().toNumber()<=r.toFormatYMDHMS().toNumber();)i.push(n),e=="year"?n=f(n).addYear(1):e=="month"?n=f(n).addMonth(1):e=="week"?n=f(n).addWeek(1):e=="day"?n=f(n).addDate(1):e=="hours"?n=f(n).addHours(1):e=="minutes"?n=f(n).addMinutes(1):e=="seconds"&&(n=f(n).addSeconds(1));return i};f.prototype.Time.prototype=f.prototype;var pe=(...[e,t,r])=>new S.prototype.Interval(e,t,r),S=pe;S.prototype={};var ye=function(...[e,t,r]){return this.fn=e,this.ms=t,this.key=r,this.isFinished=!1,S.abort(this.key),this.store(),this};s.extend({key:"",ms:0,timeoutIndex:-1,fn:null,isFinished:!1,Interval:ye,store:function(){M.set({["Interval_"+this.key]:this})},once:function(){if(this.fn){let e=()=>{this.fn&&this.fn(),this.isFinished=!0,this.store()};this.timeoutIndex=setTimeout(e,this.ms)}return this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return S.abort(this.timeoutIndex),this},setState:function(e){return Object.entries(e).forEach(([t,r])=>{this.hasOwnProperty(t)&&(this[t]=r)}),this.store(),this}},S);S.abort=e=>{if(s.isNumber(e))return clearInterval(e);let t=M.get("Interval_"+e);t&&(t&&clearInterval(t.timeoutIndex),t.setState({isFinished:!0}))};S.get=e=>M.get("Interval_"+e);S.once=(e,t,r)=>S(e,t,r).once();S.series=(e,t)=>C(void 0,null,function*(){return new Promise(r=>{let i=S.get(e);if(i&&!i.isFinished)return r(null);let n=()=>{S.abort(e)};r(n),t&&S(n,t,e).once()})});S.start=(e,t,r)=>S(e,t,r).start();S.prototype.Interval.prototype=S.prototype;var ge=(e,t)=>new c.prototype.Fetcher(e,t),c=ge;c.prototype={};c.waitList=[];c.setDefaultTrafficControl=0;c.setDefaultTimeout=1e3*60*10;c.abort=e=>{let t="fetcher.abortController."+e,r=M.get(t);console.log(r),r&&r.abort()};c.safetyRecords=e=>{let t={};return Object.entries(e).forEach(([r,i])=>{if(s.isArray(i)){t[r]=i.join(",");return}else if(s.isRecord(i)){Object.entries(c.safetyRecords(i)).forEach(([n,a])=>{t[`${r}.${n}`]=a});return}t[r]=i}),t};c.isReadableStream=e=>e instanceof ReadableStream;c.isReadableStreamReader=e=>e instanceof ReadableStreamDefaultReader;c.streamToContext=(e,t)=>C(void 0,null,function*(){try{let r=(t==null?void 0:t.reader)||e.getReader();if(!c.isReadableStreamReader(r))return{ok:!1,done:!0,data:null};if(!r)return{ok:!1,done:!0,data:null};let i=(t==null?void 0:t.decoder)||new TextDecoder("utf-8"),n=yield r.read();return{ok:!0,done:n.done,data:i.decode(n.value)}}catch(r){return{ok:!1,done:!0,data:r}}});var be=function(e,t){var n;t=t||{};let r=t.body;t.body&&!s.isString(t.body)&&((n=t.bodyStringify)==null||n)&&(r=s.Stringify(t.body||{}));let i=e;return s.isString(e)&&!e.match(/https?:/)&&(i=location.origin+"/"+e.replace(/^\//,"")),this.url=i,this.method=t.method||"get",this.streamStatus="open",this.params=_(v({key:x(),response_format:"json",timeout:c.setDefaultTimeout,trafficControl:c.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:v(v({"Content-Type":"application/json"},c.setDefaultHeaders&&c.setDefaultHeaders()),t.headers),body:r}),this};s.extend({Fetcher:be,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:void 0,onKeyDuplicateCB:void 0,onCompleteCB:void 0,onRetryCB:void 0,isRetry:!1,extraBody:{},abortController:null,setExtraBody:function(e){return this.extraBody=v(v({},this.extraBody),e),this},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(e){return this.onStartCB=e,this},onKeyDuplicate:function(e){return this.onKeyDuplicateCB=e,this},onStream:function(e){return this.onStreamCB=e,this},onResult:function(e){return this.onResultCB=e,this},onComplete:function(e){return this.onCompleteCB=e,this},onRetry:function(e){return this.onRetryCB=e,this},onError:function(e){return this.onErrorCB=e,this},onStreamProcess:function(e){return C(this,null,function*(){let{response:t,errorCB:r,streamCB:i,reader:n,decoder:a}=e,o=t.body,l=this,u=function(){return Z(this,null,function*(){if(!t.ok){s.scope(()=>C(this,null,function*(){let{ok:y,done:b,data:T}=yield c.streamToContext(o,{reader:n,decoder:a});y&&r(T)}));return}let m=!1;for(;!m;){let{ok:y,done:b,data:T}=yield new $(c.streamToContext(o,{reader:n,decoder:a}));l.streamStatus=="abort"?(l.streamStatus="closed",n.cancel(),b=!0):l.streamStatus=="closed"&&(b=!0),b&&(m=b,n.releaseLock()),i(T,b)}})};try{for(var h=ee(u()),d,p,g;d=!(p=yield h.next()).done;d=!1){let m=p.value;;}}catch(p){g=[p]}finally{try{d&&(p=h.return)&&(yield p.call(h))}finally{if(g)throw g[0]}}})},get:function(){return this.method="GET",this.send()},head:function(){return this.method="HEAD",this.send()},post:function(){return this.method="POST",this.send()},put:function(){return this.method="PUT",this.send()},delete:function(){return this.method="DELETE",this.send()},patch:function(){return this.method="PATCH",this.send()},options:function(){return this.method="OPTIONS",this.send()},send:function(){return C(this,null,function*(){var X;let e=this.params,t=performance.now(),V=e,{key:r,response_format:i,trafficControl:n=0,preventMultiRequest:a,timeout:o,queries:l}=V,u=B(V,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);u.method=this.method;let h=[this.method,r].join("."),d=c.waitList.includes(h);c.waitList=[...c.waitList,h];let p=!1,g=!1,m=!1,y=500,b="InternalServerError",T={},J=null,z=null;n>0&&(z=s.pending(n));let I=new AbortController,re=setTimeout(()=>{I.abort(),console.log("timeout",o)},e.timeout);u.signal=I.signal,this.abortController=I;let W="fetcher.abortController."+this.params.key;M.set({[W]:I});let H=()=>{p=!0},K=()=>(I.abort(),c.waitList=c.waitList.filter(w=>w!=h),{isCancelled:p,isAborted:g,ok:!1,status:0,statusText:"CANCELLED",body:T,requestTime:0,rawData:null});try{if(c.setDefaultOnStart&&(yield c.setDefaultOnStart(e,H)),this.onStartCB&&(yield this.onStartCB(e,H)),p)return K();if(d){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(H)),p)return K();if(a)throw y=429,new Error("TooManyRequests")}let w=s.url.search.set(v({},c.safetyRecords(l||{})),String(this.url)),Y=yield fetch(w,u).then(F=>C(this,null,function*(){return m=F.ok,y=F.status,b=F.statusText,J=F,i=="none"||i=="stream"?F:F[i]()})).catch(F=>{throw new Error(F)});M.delete(W),T=Y}catch(w){y==200&&(y=500,m=!1),y==429&&(b="TooManyRequests"),I.signal.aborted&&(y=408,b="Timeout",g=!0),y==500&&(b=String(w)||b),T={errorCode:String(w)}}finally{clearTimeout(re)}let D={isCancelled:p,isAborted:g,ok:m,status:y,statusText:b,body:T,additionalBody:this.extraBody,requestTime:performance.now()-t,rawData:J};if(!m){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let w=yield this.onRetryCB(D.body,this.params,this);if(w)return c.waitList=c.waitList.filter(Y=>Y!=h),this.params=w,this.send()}this.onErrorCB&&this.onErrorCB(D.body)}if(m&&this.onStreamCB&&e.response_format=="stream"){let w=(X=J.body)==null?void 0:X.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:D,reader:w,decoder:new TextDecoder("utf-8")})}return yield z,D.requestTime=performance.now()-t,m&&this.onCompleteCB&&this.onCompleteCB(D.body),this.onResultCB&&this.onResultCB(D,e),c.setDefaultOnEnd&&c.setDefaultOnEnd(D,e),c.waitList=c.waitList.filter(w=>w!=h),D})},abortStream:function(){this.streamStatus="abort"}},c);c.prototype.Fetcher.prototype=c.prototype;var Ce=e=>new E.prototype.Filer(e),E=Ce;E.prototype={};var Re=function(e){this.ok=!0;try{let[t,r]=e.name.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" ");this.file=e,this.extension=r,this.fileName=t,this.type=e.type}catch(t){console.log(t),this.ok=!1}return this};s.extend({ok:!1,extension:"",type:"",file:{},fileName:"",Filer:Re,isValid:function(){return this.ok},toBlob:function(){return C(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return C(this,null,function*(){return yield this.file.convert("dataURL")})},toAarrayBuffer:function(){return C(this,null,function*(){return yield this.file.convert("arrayBuffer")})},toObjectURL:function(){return C(this,null,function*(){return URL.createObjectURL(this.file)})},updateFileName:function(e){let t=new File([this.file],e+"."+this.extension);return this.file=t,this.fileName=e,this},updateMimeType:function(e){return this.file=new File([this.file],this.fileName+"."+this.extension,{type:e}),this.type=e,this},updateExtension:function(e){let t=new File([this.file],this.fileName+"."+e);return this.file=t,this.extension=e,this}},E);E.fromFile=e=>E(e);E.fromBlob=(e,t)=>{let r=(t==null?void 0:t.fileName)||"file",i=(t==null?void 0:t.extension)||"",n=new File([e],r+"."+i,{type:t==null?void 0:t.mimeType});return E(n)};E.fromArrayBuffer=(e,t)=>E.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t);E.fromObjectURL=(e,t)=>C(void 0,null,function*(){let r=yield c(e,{response_format:"blob"}).get();return r.ok?E.fromBlob(r.body,t):E({})});E.fromDataURL=(e,t)=>{let r=e.toBlob((t==null?void 0:t.mimeType)||"");return r?E.fromBlob(r,t):E({})};E.prototype.Filer.prototype=E.prototype;var Se=function(e){let t=e,r=null;return t.use((i,n,a)=>{let o=n;o.return=l=>{let{ok:u,status:h,body:d={},bodyStringify:p=!0}=l||{};h=h!=null?h:(u!=null?u:!0)&&200||403;let g=d;return p&&!s.isString(d)&&(g=s.Stringify(d)),n.status(h).end(g)},a()}),t.onPathRouter=function(i){return r=i,this},t.pathRouter=function(i){if(!r)return;let n=r(i);return n.route(i),t.use(i,n),n},t.exception=function(i){return t.use(i),this},t},N=Se;N.getLocalIP=e=>{let t="";return s.scope(()=>{if(!e)return;let r=e.networkInterfaces();for(let[i,n]of Object.entries(r))n.forEach(a=>{!a.internal&&a.family==="IPv4"&&!a.address.match(/^(169|127)/)&&(t=a.address)})}),t};N.getIP=function(e){var i;return(((e==null?void 0:e.headers["x-forwarded-for"])||((i=e==null?void 0:e.socket)==null?void 0:i.remoteAddress)||"").toString().match(new RegExp(/(::ffff:)?(\d+\.\d+.\d+\.\d+(:\d+)?)/))||[])[2]||"UNKNOWN IP"};s.copyToClipboard=e=>C(void 0,null,function*(){let t="";s.isString(e)?t=e:s.isFunction(e)&&(t=e());let r={ok:!1,body:"NotSupported"};return yield C(void 0,null,function*(){let i;if(navigator.clipboard){if(i=yield navigator.clipboard.writeText(t).then(()=>!0,()=>!1),!i)return}else{let n=document.createElement("input");if(s(document.body).append(n),n.value=t,n.select(),i=document.execCommand("copy"),document.body.removeChild(n),!i)return}r={ok:!0,body:""}}),r});s.ImageLoader=(e,t)=>{let r;return new Promise((i,n)=>{r=t||new Image,r.onload=()=>i(r),r.onerror=a=>n(a),r.crossOrigin="anonymous",r.src=e})};s.formatCharacter={postal:{JP:e=>{let t="";return e=String(e).replace(/\D/ig,""),e.length==7&&(t=e.replace(/^(\d{3})(.*)/,"$1-$2")),t}},tel:{_:e=>{let t=e;return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t},mobile:e=>{let t="";return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),t},fixed:e=>{let t="";return e=String(e).removeLetters(),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t}}};s.transformer={weekday:{ENG:e=>["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][e]+"day",JP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]+"\u66DC\u65E5",shortJP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]},wareki:e=>{let t=[],r=[],i=!1;return[{From:1868,To:1912,name:"\u660E\u6CBB"},{From:1912,To:1926,name:"\u5927\u6B63"},{From:1926,To:1989,name:"\u662D\u548C"},{From:1989,To:2019,name:"\u5E73\u6210"},{From:2019,To:1e5,name:"\u4EE4\u548C"}].forEach(a=>{let{From:o,To:l,name:u}=a;if(o<=e&&e<=l){let h=e-o+1;h==1&&(i=!0,h="\u5143"),r.push(u+h+"\u5E74"),t.push(u)}}),{era:t,value:r,gap:i}}};s.interval=S;c.setDefaultHeaders=()=>({});var Ee=s;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
1
+ "use strict";var P=Object.defineProperty,ne=Object.defineProperties,ie=Object.getOwnPropertyDescriptor,se=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertyNames,L=Object.getOwnPropertySymbols;var U=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var j=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var O=Math.pow,G=(e,t,r)=>t in e?P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v=(e,t)=>{for(var r in t||(t={}))U.call(t,r)&&G(e,r,t[r]);if(L)for(var r of L(t))Q.call(t,r)&&G(e,r,t[r]);return e},_=(e,t)=>ne(e,se(t));var B=(e,t)=>{var r={};for(var i in e)U.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(e!=null&&L)for(var i of L(e))t.indexOf(i)<0&&Q.call(e,i)&&(r[i]=e[i]);return r};var oe=(e,t)=>{for(var r in t)P(e,r,{get:t[r],enumerable:!0})},le=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ae(t))!U.call(e,n)&&n!==r&&P(e,n,{get:()=>t[n],enumerable:!(i=ie(t,n))||i.enumerable});return e};var ue=e=>le(P({},"__esModule",{value:!0}),e);var C=(e,t,r)=>new Promise((i,n)=>{var a=u=>{try{l(r.next(u))}catch(h){n(h)}},o=u=>{try{l(r.throw(u))}catch(h){n(h)}},l=u=>u.done?i(u.value):Promise.resolve(u.value).then(a,o);l((r=r.apply(e,t)).next())}),$=function(e,t){this[0]=e,this[1]=t},Z=(e,t,r)=>{var i=(o,l,u,h)=>{try{var d=r[o](l),p=(l=d.value)instanceof $,g=d.done;Promise.resolve(p?l[0]:l).then(m=>p?i(o==="return"?o:"next",l[1]?{done:m.done,value:m.value}:m,u,h):u({value:m,done:g})).catch(m=>i("throw",m,u,h))}catch(m){h(m)}},n=o=>a[o]=l=>new Promise((u,h)=>i(o,l,u,h)),a={};return r=r.apply(e,t),a[j("asyncIterator")]=()=>a,n("next"),n("throw"),n("return"),a};var ee=(e,t,r)=>(t=e[j("asyncIterator")])?t.call(e):(e=e[j("iterator")](),t={},r=(i,n)=>(n=e[i])&&(t[i]=a=>new Promise((o,l,u)=>(a=n.call(e,a),u=a.done,Promise.resolve(a.value).then(h=>o({value:h,done:u}),l)))),r("next"),r("return"),t);var ve={};oe(ve,{Fetcher:()=>c,Filer:()=>E,Server:()=>N,Time:()=>f,UUID:()=>x,default:()=>Ee,useStore:()=>M});module.exports=ue(ve);typeof HTMLElement!="undefined"&&(HTMLElement.prototype.position=function(){return this.getBoundingClientRect()});typeof String!="undefined"&&(String.prototype.compress=function(){return this.trim().replace(/(\s|\n|\t)/ig,"")},String.prototype.encode=function(){return encodeURIComponent(this)},String.prototype.decode=function(){return decodeURIComponent(this)},String.prototype.toUpper=function(){return this.toLocaleUpperCase()},String.prototype.toLower=function(){return this.toLocaleLowerCase()},String.prototype.toCapital=function(){let e=this;return e&&(e=e.replace(/^./,this[0].toUpper()).replace(/(\s|_|-)[a-z]{1}/ig,t=>t[1].toUpper())),e},String.prototype.clip=function(e,t){return this.slice(e,t)},String.prototype.partReplace=function(...e){let t="";if(e.length==2){let[r,i]=e;t=[this.slice(0,r),i,this.slice(r+i.length)].join("")}if(e.length==3){let[r,i,n]=e;t=[this.slice(0,r),n,this.slice(r+i)].join("")}return t},String.prototype.toBlob=function(e){let t=atob(this.replace(/^.*,/,"")),r=new Uint8Array(t.length);for(var i=0;i<t.length;i++)r[i]=t.charCodeAt(i);try{var n=new Blob([r.buffer],{type:e})}catch(a){return!1}return n},String.prototype.toNumber=function(){let e=this.replace(/[^\d.-]/g,"").replace(/(-)(?=.*\d)/g,"").replace(/(\d+)\.(\d+)\.(\d+)/g,"$1.$2$3");return Number(e)||0},String.prototype.removeLetters=function(){return this.replace(/[\D]/ig,"")},String.prototype.removeSpecifics=function(){return this.replace(/[^\w\s\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]|_/uig,"")},String.prototype.removeJP=function(){return this.replace(/[\p{scx=Hiragana}\p{scx=Katakana}\p{scx=Han}]+/uig,"")},String.prototype.zen2hanNumber=function(){return this.replace(/[0-9]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).replace(/[--﹣−‐⁃‑‒–—﹘―⎯⏤ーー─━]/g,"-").replace(/¥/,"\xA5").replace(/、/,",").replace(/(/,"(").replace(/)/,")").replace(/+/,"+")},String.prototype.escapeRegExChar=function(){return this.replace(/\\/g,"\\\\").replace(/(\?|\^|\$|\.|\||\*|\+|\(|\)|\{|\}|\[|\])/g,"\\$1")});typeof Number!="undefined"&&(Number.prototype.zeroEmbed=function(e){let t=Number(this)<0,r=Math.abs(Number(this));return isNaN(r)?"":(t?"-":"")+String(r).padStart(e||2,"0")},Number.prototype.ratio=function(e,t=2){let r=O(10,t);return Math.round(this/e*r*100)/r},Number.prototype.rate=function(e,t=2){let r=O(10,t);return Math.round(this/e*r)/r},Number.prototype.rank=function(e=1){let t=O(10,e),r=Number(this);if(r<1e3)return String(this);let i=r.toLocaleString().replace(/\d/ig,"").length;return Math.round(r/O(1e3,i)*t)/t+("KMGTPEZY"[i-1]||"")},Number.prototype.rankJp=function(){let e=Number(this),t="";return e>=1e12?t=`${e/1e12}\u5146`:e>=1e8?t=`${e/1e8}\u5104`:e>=1e4?t=`${e/1e4}\u4E07`:e>=1e3?t=`${e/1e3}\u5343`:t=`${e.toLocaleString()}`,t},Number.prototype.toDate=function(e="/"){let t=String(this),r=t.slice(0,4),i=t.slice(4,6),n=t.slice(6,8),a=[];return r.length!=4||a.push(r),i.length!=2||a.push(i),n.length!=2||a.push(n),a.join(e)});if(typeof Array!="undefined"){let e=(r,...i)=>{var a;let n=r;for(let o of i){if(o!==(o!=null?o:!o))break;n=(a=(n||{})[o!=null?o:""])!=null?a:null}return n},t=r=>typeof Number(r)=="number"&&!isNaN(r);Array.prototype.sortBy=function(r,i,n,a){let l=(Array.isArray(i)?i:i?[i]:[""]).map(d=>String(d).match(/([^\.\[\]"]+)/g)||[]),u=l.map((d,p)=>1);return this.map(d=>({origin:d,sortVal:l.map((p,g)=>{let m=e(d,...p);if(t(m))return Number(m);let y=String(m).replace(/¥|,/g,"");return t(y)?Number(y):(u[g]=0,y.replace(/(\d+)/g,b=>b.padStart(10,"0")))})})).sort((d,p)=>{for(let g=0;g<l.length;g++){let m=d.sortVal[g],y=p.sortVal[g];if(u[g]){if(m>y)return 1*r;if(m<y)return-1*r;continue}let b=String(m).localeCompare(String(y),n,a);if(b!=0)return b*r}return 0}).map((d,p)=>(this[p]=d.origin,d.origin))},Array.prototype.toASC=function(...r){return this.sortBy(1,...r)},Array.prototype.toDESC=function(...r){return this.sortBy(-1,...r)},Array.prototype.getSum=function(...r){return this.reduce((i,n)=>i+(r?e(n,...r):Number(n)||0),0)},Array.prototype.getAve=function(...r){return this.getSum(...r)/this.length},Array.prototype.getMedian=function(...r){let i=this.map(a=>r?e(a,...r):Number(a)||0);i.sort((a,o)=>a-o);let n=Math.floor(i.length/2);return i.length%2===0?(i[n-1]+i[n])/2:i[n]},Array.prototype.getMin=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.min(...i)},Array.prototype.getMax=function(...r){let i=this.map(n=>r?e(n,...r):Number(n)||0);return Math.max(...i)},Array.prototype.chunk=function(r){let i=[];for(let n=0;n<this.length;n+=r)i.push(this.slice(n,n+r));return i},Array.prototype.forEachChunk=function(r,i,n){return C(this,null,function*(){let a=[],o=this.chunk(r);if(n)yield Promise.all(o.map((l,u)=>C(this,null,function*(){a[u]=v({ok:!0},yield i(l,u))})));else for(let l=0;l<o.length;l++)a.push(v({ok:!0},yield i(o[l],l)));return[a.every(l=>l.ok),a]})}}typeof File!="undefined"&&(File.prototype.convert=function(e){e=e||"dataURL";let t="readAs"+(e==null?void 0:e.toCapital());return new Promise((r,i)=>{let n=new FileReader;n.onload=a=>{r(n.result)},n.onerror=a=>i(n.error||a),n[t](this)})},File.prototype.clone=function(){return new File([this.slice(0,this.size,this.type)],this.name,{type:this.type,lastModified:this.lastModified})});var he=(e=24)=>Array.from({length:e}).map((t,r)=>{let i=r==0?25:35,n=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*i)][n?"toUpper":"toLower"]()}).join(""),x=he;x.get128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");x.get32Hex=(e="Formatted",t="-")=>{let r=Array.from({length:32}).map((i,n)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(r=[r.slice(0,8),r.slice(8,12),r.slice(12,16),r.slice(16,20),r.slice(20,32)].join(t)),r};x.to32Format=e=>[e.slice(0,8),e.slice(8,12),e.slice(12,16),e.slice(16,20),e.slice(20,32)].join("-").toUpper();var me=e=>new s.prototype.jmini(e),s=me;s.prototype={};s.extend=function(e,t=s){for(var[r,i]of Object.entries(e))t.prototype[r]=i};s.expando="__jmini_"+x();s.__classAlias="jmini";var R=(e,t)=>(e.queue.push(t),q(e),e),q=e=>C(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let t=e.queue.shift();t&&(yield t()),e.queueProcess=!1,q(e)}),k=(e,t)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,i]of Object.entries(t))r.match(/queue/)||(e[r]=i);return e},fe=(e,t)=>{if(t.length){for(var r=0;r<t.length;r++){let i=t[r];i&&(i[s.expando]||(s.isElement(i)||s.isShadowRoot(i))&&(i[s.expando]={events:{}})),e[r]=i}e.length=t.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,q(e),e};s.extend({constructor:s,__classAlias:s.__classAlias,jmini:function(e){return this.src=e,this.srcType=s.isWhat(e),this.queueProcess=!0,this.queue=[],fe(this,s.isJmini(e)?e.get():s.isElement(e)?[e]:s.isElements(e)?e:s.isShadowRoot(e)?[e]:s.isString(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}});s.prototype[String(Symbol.iterator)]=[][Symbol.iterator];s.prototype.jmini.prototype=s.prototype;{let e=function(n,a,o){let l=[];for(let u=0;u<(n.length||0);u++)l.push(a(n[u],u));return o&&(l=l.filter(u=>u!=null)),l},t=n=>(n.for((a,o)=>{if(!(s.isElement(a)||s.isShadowRoot(a)))return;let l=a.cloneNode(),u=a.parentNode;u&&u.replaceChild(l,a),n[o]=l}),n),r=(n,a)=>(s(a).for(o=>{if(n&&(s.isElement(o)||s.isShadowRoot(o)))if(s.isString(n)||s.isNumber(n))n=String(n),o.insertAdjacentHTML("beforeend",String(n));else if(s.isElement(n))o.appendChild(n);else{s.isJmini(n)?n=n.get():s.isElement(n)?n=[n]:s.isRecord(n)&&(n=[s(n)]);for(var l=0;l<n.length;l++)r(n[l],o)}}),a),i=(n,a,...o)=>{let{p:l,s:u}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[a]||{p:"",s:""};return n.for(h=>{if(s.isString(o[0]))h.insertAdjacentHTML(l,o[0]);else{if(!h.parentNode)return;s(o[0]).for(p=>{o[1]&&(p=p.cloneNode(!0)),h.parentNode.insertBefore(p,h[u]||h)})}}),n};s.extend({get:function(n){return n?this[0]:e(this,a=>a)},for:function(n,a=1){let o=e(this,(l,u)=>n(l,u),1);return a?o:[]},await:function(n){return R(this,()=>new Promise((a,o)=>{setTimeout(()=>{a(this)},n)}))},abort:function(){return R(this,()=>C(this,null,function*(){return this.queue=[],this}))},callback:function(n){return R(this,()=>C(this,null,function*(){return yield n(this),this}))},click:function(){return R(this,()=>{for(var n=0;n<this.length;n++){let a=this[n];s.isElement(a)&&a.click()}return this})},focus:function(){return R(this,()=>{for(var n=0;n<this.length;n++){let a=this[n];s.isElement(a)&&a.focus()}return this})},onEvent:function(n,a,o){return R(this,()=>{let d=o||{},{target:l,eventID:u=x()}=d,h=B(d,["target","eventID"]);return h=v({passive:!0,capture:!1},h),this.for(p=>{if(!(s.isElement(p)||s.isShadowRoot(p)))return;let{events:g}=p[s.expando];if(l){let m=a;a=y=>{if(y.target){if(s.isString(l)){let T=y.target.closest(l);T&&(!T||m.call(T,y))}else if(s.isElements(l)){for(let b of l)if(y.target==b)return m.call(b,y)}}}}if(g[u]){let m=g[u];p.removeEventListener(m.eventType,m.callback,m.options)}g[u]={eventType:n,callback:a,options:h},p.addEventListener(n,a,h)}),this})},addEvent:function(n){return R(this,()=>{let{eventType:a,eventID:o=x(),target:l,callback:u,options:h}=n;return h=v({passive:!0,capture:!1},h),this.for(d=>{if(!(s.isElement(d)||s.isShadowRoot(d)))return;let{events:p}=d[s.expando];if(l){let g=u;u=m=>{if(m.target){if(s.isString(l)){let b=m.target.closest(l);b&&(!b||g.call(b,m))}else if(s.isElements(l)){for(let y of l)if(m.target==y)return g.call(y,m)}}}}if(p[o]){let g=p[o];d.removeEventListener(g.eventType,g.callback,g.options)}p[o]={eventType:a,callback:u,options:h},d.addEventListener(a,u,h)}),this})},removeEvent:function(n){return R(this,()=>{let a=s.isArray(n)?n:[n];return this.for(o=>{let{events:l}=o[s.expando];for(let u of a){let h=l[u];h&&o.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(n){return R(this,()=>k(this,r(n,t(this))))},empty:function(){return R(this,()=>k(this,t(this)))},append:function(n){return R(this,()=>{r(n,this)})},remove:function(){return R(this,()=>(this.for((n,a)=>{n&&s.isElement(n)&&(n.remove(),delete this[a])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...n){return R(this,()=>k(this,i(this,"before",...n)))},after:function(...n){return R(this,()=>k(this,i(this,"after",...n)))},find:function(n){return R(this,()=>{let a=[],o=this[0];o||k(this,s()),(s.isElement(o)||s.isShadowRoot(o))&&(s.isString(n)?a=o.querySelectorAll(n):s.isElement(o)&&s(n).for(l=>{let u=o.childNodes;for(let h of u)if(h===l){a.push(h);break}else h.childNodes.length&&(a=[...a,...s(h).find(l).for(d=>d)])})),k(this,s(a))})},parent:function(n){return R(this,()=>{var o,l;let a=s(n?(o=this[0])==null?void 0:o.closest(n):(l=this[0])==null?void 0:l.parentNode);k(this,a)})},children:function(n){return R(this,()=>{let a=this[0].children;s.isExist(n)&&(n=String(n).replace(/^ : /,""),a=n=="first"?a[0]:n=="last"?a[a.length-1]:a[Number(n)]);let o=s(a);return k(this,o)})},addClass:function(...n){return R(this,()=>{let a=n.join(" ").split(/\s+/).filter(o=>o.trim()!=="");return a.length&&this.for(o=>{o&&s.isElement(o)&&o.classList.add(...a)}),this})},removeClass:function(...n){return R(this,()=>{let a=n.join(" ").split(/\s+/).filter(o=>o.trim()!=="");return a.length&&this.for(o=>{o&&s.isElement(o)&&o.classList.remove(...a)}),this})},toggleClass:function(n){return R(this,()=>(n&&this.for(a=>{a.classList.toggle(n)}),this))},hasClass:function(n=""){return this[0]?this[0].classList.contains(n.replace(/^\./,"")):!1},findClass:function(n){let a=[];return s.scope(()=>{this[0]&&(a=[...this[0].classList||[]].filter(o=>o.match(n)))}),a},css:function(n){return R(this,()=>(this.for(a=>{if(s.isElement(a))for(let[o,l]of Object.entries(n)){if(s.isNumber(l)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){a.style[o]=l+"px";continue}a.style[o]=String(l)}}),this))},getAttribute:function(n){return this[0].getAttribute(String(n))||""},setAttribute:function(n,a){return R(this,()=>(this.for(o=>o.setAttribute(n,a)),this))},getStyleProperty:function(n){let a=this[0];return a&&s.isElement(a)?getComputedStyle(a).getPropertyValue(n):""},setStyleProperty:function(n,a){let o=this[0];return o&&s.isElement(o)&&o.style.setProperty(n,a),this},val:function(){var a;let n=this[0];return(n==null?void 0:n.value)||((a=n==null?void 0:n.dataset)==null?void 0:a.value)},position:function(){return s.isElement(this[0])?this[0].getBoundingClientRect():{x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0,toJSON:()=>{}}}})}s.uniqueArray=(e,t)=>t?Array.from(new Map(e.map(r=>[s.getRecord(r,t||"0"),r])).values()):Array.from(new Set(e));s.getRecord=(e,t)=>{let r={},i=e;return t.split(".").forEach(n=>{i=i==null?void 0:i[n],r=i}),r};s.Arrayify=s.flatArray=(e,t)=>{if(!s.isArray(e))return[e];let r=[];for(let i of e)r.push(...t=="-R"?s.Arrayify(i,"-R"):[i]);return r};s.Stringify=(...e)=>{let[t,r,i]=e;return JSON.stringify(t,r!=null?r:(()=>{let n=new WeakSet;return(a,o)=>{if(typeof o=="object"&&o!==null){if(n.has(o))return"[Circular Reference]";n.add(o)}return o}})(),i)};s.Objectify=(e,t)=>{try{return JSON.parse(e)}catch(r){return t!=null?t:null}};s.SortifyObject=(e,t)=>{let r={};return!e||!s.isArray(e)&&!s.isRecord(e)?null:(Object.keys(e).sort().forEach(i=>{let n=e[i];if(t){if(s.isRecord(n)){r[i]=s.SortifyObject(n,t);return}if(s.isArray(n)){r[i]=n.map(a=>s.isRecord(a)||s.isArray(a)?s.SortifyObject(a,t):a);return}}r[i]=n}),r)};s.randomNumber=(e=0,t=100,r)=>{if(e>t)return NaN;let i=Math.round(Math.random()*(t-e))+e;return r&&r.length&&r.includes(i)?s.randomNumber(e,t,r):i};s.try=e=>{try{return[e(),!0]}catch(t){return[t,!1]}};s.trySync=e=>C(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});s.scope=e=>e();s.scopeSync=e=>C(void 0,null,function*(){return yield e()});s.createElement=function(e){var p;let{tag:t,className:r="",id:i,html:n,attr:a,style:o,parent:l}=e,u=document.createElement(t||"div");if(r&&u.classList.add(...r.split(" ")),i&&(u.id=i),a)for(let g of Object.entries(a)){let m=g[0],y=(p=g[1])!=null?p:"";if(m=="data"&&s.isRecord(y))for(let[b,T]of Object.entries(y))u.dataset[b]=T;else m=="for"?m="htmlFor":m=="tabindex"?m="tabIndex":m=="aria-label"&&(m="ariaLabel"),u[m]=y}if(n&&s(u).append(n),o)for(var[h,d]of Object.entries(o))u.style[h]=d;return l&&s(l).append(u),u};s.setCookie=e=>{let{hostname:t}=new URL(location.toString()),{name:r,value:i="",age:n=60*60*24*365,path:a="/",domain:o=t,secure:l=!1}=e,u=`${r}=${i}max-age=${n}path=${a}domain=${o}`;l&&(u+=" Secure"),document.cookie=u};s.getCookie=e=>{let t=document.cookie.match(new RegExp(e+"=[^]*"));return t?t[0].replace(new RegExp(e+"="),""):""};s.localStorage={set:(e,t)=>{localStorage.setItem(e,s.Stringify(t))},get:e=>{let t=localStorage.getItem(e);return s.Objectify(t,t)}};s.deleteCookie=e=>{document.cookie=e+"=max-age=0"};s.getScreenSize=()=>{let{innerHeight:e,innerWidth:t,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:a}=window,o=Number(s(document.body).getStyleProperty("--sat").removeLetters()),l=Number(s(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:t,pageHeight:e-o-l,scrollY:r,scrollX:i,pageXOffset:n,pageYOffset:a,safeAreaTop:o,safeAreaBottom:l}};s.getCursor=e=>{var i,n,a,o,l,u,h,d;let t=(o=e.pageX)!=null?o:(a=(i=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:i.pageX)!=null?a:(((n=e==null?void 0:e.originalEvent)==null?void 0:n.touches)||[])[0].pageX,r=(d=e.pageY)!=null?d:(h=(l=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:l.pageY)!=null?h:(((u=e==null?void 0:e.originalEvent)==null?void 0:u.touches)||[])[0].pageY;return{x:t,y:r}};s.pending=(e,t)=>{var i;let r=(i=t||Number(e))!=null?i:-1;return new Promise((n,a)=>{s.isFunction(e)&&e(n),!(r<0)&&setTimeout(()=>{n(!0)},r)})};s.deepMerge=(e,...t)=>{if(!t.length)return e;let r=t.shift();if(s.isRecord(e)&&s.isRecord(r))for(let i in r)s.isRecord(r[i])?(e[i]||Object.assign(e,{[i]:{}}),s.deepMerge(e[i],r[i])):Object.assign(e,{[i]:r[i]});return s.deepMerge(e,...t)};s.deepCopy=e=>{let t=(r,i)=>{if(s.isArray(r))return i.has(r)?r:(i.add(r),r.map(n=>t(n,i)));if(s.isRecord(r)){if(i.has(r))return r;i.add(r);let n={};return Object.entries(r).forEach(([a,o])=>{n[a]=t(o,i)}),n}return r};return t(e,new WeakSet)};s.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,t)=>{let r=new URL(t||location.href);if(s.isString(e))r.pathname=e;else{let i=s.url.path.get();Object.entries(e).forEach(([n,a])=>{i[Number(n)]=a}),r.pathname="/"+i.filter(n=>n!=null).join("/")}return t||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{get:e=>{let t=new URL(e||location.href),r={};return t.searchParams.forEach((i,n)=>r[n]=i),r},set:(e,t)=>{let r=new URL(t||location.href);return Object.entries(e).forEach(([i,n])=>{r.searchParams.set(i,String(n))}),t||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,t)=>{let r=new URL(t||location.href);return e.forEach(i=>{r.searchParams.delete(i)}),t||history.replaceState({},"",r.pathname+r.search),r.toString()}}};s.queryParams={get:e=>{let t=new URL(e||location.href),r={};return t.searchParams.forEach((i,n)=>r[n]=i),r},set:(e,t)=>{let r=new URL(t||location.href);return Object.entries(e).forEach(([i,n])=>{r.searchParams.set(i,String(n))}),t||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,t)=>{let r=new URL(t||location.href);return e.forEach(i=>{r.searchParams.delete(i)}),t||history.replaceState({},"",r.pathname+r.search),r.toString()}};s.ellipsisText=(e,t)=>{let r=String(e);return r.length>t&&(r=r.slice(0,t)+" ..."),r};s.isEqual=(e,t,r)=>r==null||r?s.Stringify(e)===s.Stringify(t):e===t,s.isExist=e=>e===(e!=null?e:!e),s.isNullish=e=>!s.isExist(e),s.isJmini=e=>{var t,r;return((t=e||{})==null?void 0:t.constructor)===s||((r=e||{})==null?void 0:r.__classAlias)===s.__classAlias},s.isString=e=>typeof e=="string",s.isBoolean=e=>typeof e=="boolean",s.isNumber=e=>!isNaN(e)&&typeof e=="number",s.isArray=e=>{let t={}.toString.call(e);return Array.isArray(e)||e instanceof Array||t=="[object NodeList]"||t=="[object HTMLCollection]"},s.isFunction=e=>typeof e=="function",s.isRecord=e=>({}).toString.call(e)==="[object Object]"&&!s.isJmini(e),s.isElement=e=>e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e)),s.isElements=e=>{let t={}.toString.call(e),r=Number(!!e&&!s.isString(e)&&s.isArray(e)&&t!=="[object Text]");if(r&&s.isArray(e)&&t!=="[object NodeList]")for(var i of e)r&=Number(s.isElement(i));return!!r},s.isShadowRoot=e=>e instanceof ShadowRoot,s.isDate=e=>s.isNumber(new Date(e).getTime()),s.isInRange=(e,t,r,i=!0)=>i?t<=e&&e<=r:t<e&&e<r,s.isOneOf=(e,...t)=>{if(!(t!=null&&t.length))return!1;let r=s.isArray(e),i=s.isRecord(e);return r||i?t==null?void 0:t.some(n=>s.isEqual(e,n)):t==null?void 0:t.includes(e)},s.isWhat=e=>{let t="other";return s.isJmini(e)?t="jmini":s.isElement(e)?t="element":s.isElements(e)?t="elements":s.isShadowRoot(e)?t="shadowRoot":s.isString(e)?t="string":s.isNumber(e)?t="number":s.isArray(e)?t="array":s.isFunction(e)?t="function":s.isDate(e)?t="date":typeof e=="undefined"?t="undefined":s.isRecord(e)?t="record":e==null?t="null":isNaN(e)&&(t="NaN"),t};s.is={equal:s.isEqual,exist:s.isExist,nullish:s.isNullish,jmini:s.isJmini,string:s.isString,boolean:s.isBoolean,number:s.isNumber,array:s.isArray,function:s.isFunction,record:s.isRecord,element:s.isElement,elements:s.isElements,shadowRoot:s.isShadowRoot,date:s.isDate,inRange:s.isInRange,oneOf:s.isOneOf,what:s.isWhat};var A={},M={set:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{let a=A[i]||{};a&&a.privateKey&&a.privateKey!=t&&(r=!1),A[i]={privateKey:t,value:n}}),r},update:(e,t)=>{let r=!0;return Object.entries(e).forEach(([i,n])=>{var o;let a=A[i]||{};a&&a.privateKey&&a.privateKey!=t&&(r=!1),A[i]=_(v({},A[i]),{value:v(v({},(o=A[i])==null?void 0:o.value),n)})}),r},get:(e,t)=>{let r=A[e];if(!(r&&r.privateKey&&r.privateKey!=t))return r==null?void 0:r.value},delete:(e,t)=>{let r=A[e];return r&&r.privateKey&&r.privateKey!=t?!1:(delete A[e],!0)}};var te=-new Date().getTimezoneOffset(),ce=(e,t)=>new f.prototype.Time(e,t),f=ce;f.prototype={};f.__classAlias="jmini.Time";var de=function(e,t){if(t&&(this.localTimezoneOffset=t),f.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0?e=new Date:e===0&&(e=new Date(0))),e&&(s.isNumber(e)&&(e=new Date(e)),s.isString(e)&&(e=String(e).trim().replace(/\//g,"-").replace(/ +|\s+/g," ").replace(/\-+/g,"-"),e=e.replace(/^(\d{4}-\d{2}-\d{2})$/,"$1T00:00:00").replace(/^(\d{4}-\d{2}-\d{2})\s+/,"$1T").replace(/^(\d{4}-\d{2}-\d{2}T\d{2})(:?|:+)$/,"$1:00").replace(/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(:?|:+)$/,"$1:00"),e.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(.\d{1,3})?$/)))){let i=this.getLocalTimezoneOffset(),n=Math.floor(i/60),a=i%60;n>=0&&(e+="+"),e+=n.zeroEmbed(2),e+=":"+a.zeroEmbed(2)}let r=new Date(String(e));return this.set(r)};s.extend({constructor:f,Time:de,__classAlias:f.__classAlias,value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,warekiYear:-1,wareki:"",warekiLabel:"",year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,localTimezoneOffset:void 0,getLocalTimezoneOffset:function(){var e,t;return(t=(e=this.localTimezoneOffset)!=null?e:M.get("jmini/time/env/localTimezoneOffset"))!=null?t:te},setLocalTimezoneOffset:function(e,t){return this.localTimezoneOffset=e,t&&M.set({"jmini/time/env/localTimezoneOffset":e}),this.set(this.value)},clone:function(){return f(this,this.localTimezoneOffset)},set:function(e){var n;this.value=e;let t=s.isDate(e);if(this.validate=t,s.isNullish(this.localTimezoneOffset)&&(this.localTimezoneOffset=(n=M.get("jmini/time/env/localTimezoneOffset"))!=null?n:te),!t)return this.ms=-1,this.year=-1,this.month=-1,this.weekday=-1,this.weekInYear=-1,this.date=-1,this.hours=-1,this.minutes=-1,this.seconds=-1,this;let r=e.getTime()+e.getTimezoneOffset()*6e4,i=new Date(r+this.getLocalTimezoneOffset()*60*1e3);this.ms=e.getTime(),this.year=i.getFullYear(),this.month=i.getMonth()+1,this.date=i.getDate(),this.weekday=i.getDay(),this.hours=i.getHours(),this.minutes=i.getMinutes(),this.seconds=i.getSeconds();{let a=this.year||0,o=this.month||0,l=this.date||0,u=Number(a+o.zeroEmbed(2)+l.zeroEmbed(2));u>=20190501?(this.warekiYear=a-2018,this.wareki="REIWA",this.warekiLabel="\u4EE4\u548C"):u>=19890108?(this.warekiYear=a-1988,this.wareki="HEISEI",this.warekiLabel="\u5E73\u6210"):u>=19261225?(this.warekiYear=a-1925,this.wareki="SHOUWA",this.warekiLabel="\u662D\u548C"):u>=19120730?(this.warekiYear=a-1911,this.wareki="TAISHO",this.warekiLabel="\u5927\u6B63"):u>=19680125?(this.warekiYear=a-1867,this.wareki="MEIJI",this.warekiLabel="\u660E\u6CBB"):(this.warekiYear=0,this.wareki="",this.warekiLabel="")}{let a=new Date(this.year,0,1),o=new Date(a.valueOf());o.setDate(o.getDate()-(a.getDay()+1));let l=this.ms-o.getTime(),u=Math.ceil(l/(1e3*60*60*24));this.weekInYear=Math.ceil(u/7)}{let a=new Date(this.year,this.month-1,1),o=new Date(a.valueOf());o.setDate(o.getDate()-(a.getDay()+1));let l=this.ms-o.getTime(),u=Math.ceil(l/(1e3*60*60*24)),h=Math.ceil(u/7);this.weekInMonth=h}{let a=new Date(this.year,this.month,0),o=a.getDay(),l=new Date(new Date(a).setDate(a.getDate()-o));this.isLastWeekInMonth=this.date>=l.getDate()}return this},isPast:function(){let e=f();return this.value.valueOf()<e.value.valueOf()},isSameYear:function(e){let t=f(e);return this.year==t.year},isSameMonth:function(e){let t=f(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=f(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=f(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},isInRange:function(e,t){return!this.validate||!e.validate||!t.validate?!1:this.value>=e.value&&this.value<=t.value},setYear:function(e){let t=new Date(this.value.valueOf());return t.setFullYear(e),this.set(t)},setMonth:function(e){let t=new Date(this.value.valueOf()),r=t.getDate();t.setDate(1),t.setMonth(e-1);let i=f(t).getLastDayOfMonth();return t.setDate(Math.min(r,i.date)),this.set(t)},setDate:function(e){let t=new Date(this.value.valueOf());return t.setDate(e),this.set(t)},setHours:function(e){let t=new Date(this.value.valueOf());return t.setHours(e),this.set(t)},setMinutes:function(e){let t=new Date(this.value.valueOf());return t.setMinutes(e),this.set(t)},setSeconds:function(e){let t=new Date(this.value.valueOf());return t.setSeconds(e),this.set(t)},setMilliseconds:function(e){let t=new Date(this.value.valueOf());return t.setMilliseconds(e),this.set(t)},addYear:function(e){return this.setYear(this.year+e)},addMonth:function(e){return this.setMonth(this.month+e)},addWeek:function(e){return this.addDate(7*e)},addDate:function(e){return this.setDate(this.date+e)},addHours:function(e){return this.setHours(this.hours+e)},addMinutes:function(e){return this.setMinutes(this.minutes+e)},addSeconds:function(e){return this.setSeconds(this.seconds+e)},toFormat:function(e,t){if(!this.validate)return"";let r=this;return s.isExist(t)&&(r=r.clone(),r.setLocalTimezoneOffset(t||0)),e.replace(/\%y/ig,r.year.zeroEmbed(4)).replace(/\%m/ig,r.month.zeroEmbed(2)).replace(/\%d/ig,r.date.zeroEmbed(2)).replace(/\%w/ig,r.weekInYear.zeroEmbed(2)).replace(/\%h/ig,r.hours.zeroEmbed(2)).replace(/\%i/ig,r.minutes.zeroEmbed(2)).replace(/\%s/ig,r.seconds.zeroEmbed(2))},toFormatISO:function(){return this.value.toISOString()},toFormatabbrYMD:function(e,t){if(!this.validate)return"";let r=this.isSameYear(f()),i="%Y/%M/%D";return r&&(i="%M/%D"),e=="JP"&&(i="%Y\u5E74%M\u6708%D\u65E5",r&&(i="%M\u6708%D\u65E5")),this.toFormat(i,t)},toFormatYMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t):""},toFormatYM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708",t):this.toFormat("%Y/%M",t):""},toFormatMD:function(e,t){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):""},toFormatHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206",t):this.toFormat("%h:%i",t):""},toFormatHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%h\u6642%i\u5206%s\u79D2",t):this.toFormat("%h:%i:%s",t):""},toFormatYMDHM:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%i\u5206",t):this.toFormat("%Y/%M/%D %h:%i",t):""},toFormatYMDHMS:function(e,t){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2",t):this.toFormat("%Y/%M/%D %h:%i:%s",t):""},toLangYMD:function(e,t){if(!this.validate)return"";let r=f(),i=r.diff(this);return i.dates==0?"\u4ECA\u65E5":i.dates==1?"\u6628\u65E5":i.dates>=-7&&i.dates<0?-1*i.dates+"\u65E5\u5F8C":i.dates<=7&&i.dates>0?i.dates+"\u65E5\u524D":this.isSameYear(r)?e=="JP"?this.toFormat("%M\u6708%D\u65E5",t):this.toFormat("%M/%D",t):e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5",t):this.toFormat("%Y/%M/%D",t)},setFirstOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},setFromFormatHHMM:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(4).replace(/(\d{2})(\d{2})/,"$1:$2"),[r,i]=t.split(":"),n=new Date(this.value.valueOf());return n.setHours(Number(r)),n.setMinutes(Number(i)),this.set(n)},setFromFormatHHMMSS:function(e){let t=String(e).removeLetters().removeSpecifics().toNumber().zeroEmbed(6).replace(/(\d{2})(\d{2})(\d{2})/,"$1:$2:$3"),[r,i,n]=t.split(":"),a=new Date(this.value.valueOf());return a.setHours(Number(r)),a.setMinutes(Number(i)),a.setSeconds(Number(n)),this.set(a)},getFirstDayOfYear:function(){return f(new Date(this.value.getFullYear(),0,1))},getLastDayOfYear:function(){return f(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfMonth:function(){return f(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfMonth:function(){return f(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfWeek:function(){let e=f(this.value);return e.addDate(-e.weekday)},getLastDayOfWeek:function(){let e=f(this.value);return e.addDate(6-e.weekday)},diff:function(e){return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:s.scope(()=>{let t=864e5,r=this.clone().setFirstOfDay(),i=e.clone().setFirstOfDay();return Math.floor((r.ms-i.ms)/t)}),hours:s.scope(()=>{let t=36e5,r=this.clone().setMinutes(0).setSeconds(0).setMilliseconds(0),i=e.clone().setMinutes(0).setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),minutes:s.scope(()=>{let t=6e4,r=this.clone().setSeconds(0).setMilliseconds(0),i=e.clone().setSeconds(0).setMilliseconds(0);return Math.floor((r.ms-i.ms)/t)}),seconds:s.scope(()=>{let t=this.clone().setMilliseconds(0),r=e.clone().setMilliseconds(0);return Math.floor((t.ms-r.ms)/1e3)}),ms:this.ms-e.ms}},getAge:function(e){let t=e||f(),r=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&r--,r}},f);f.isTimeObject=e=>{var t,r;return((t=e||{})==null?void 0:t.constructor)===f||((r=e||{})==null?void 0:r.__classAlias)===f.__classAlias};f.getFromNumberYYYYMMDD=e=>{let t=Number(e).zeroEmbed(8).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return f(t+" 00:00:00")};f.getShortYMDs=(e,t)=>{let r="",i="";return e.year==t.year&&e.year==f().year?r=e.toFormatMD():r=e.toFormatYMD(),e.year!=t.year?i=t.toFormatYMD():i=t.toFormatMD(),[r,i]};f.getPeriodArray=(e,t,r)=>{let i=[],n=t;if(!t.validate||!r.validate)return i;for(e=="year"?n=f(n).setMonth(1).setDate(1).setFirstOfDay():e=="month"?n=f(n).setDate(1):e=="week"?n=f(n).getFirstDayOfWeek():e=="day"?n=f(n).setFirstOfDay():e=="hours"?n=f(n).setMinutes(0).setSeconds(0).setMilliseconds(0):e=="minutes"?n=f(n).setSeconds(0).setMilliseconds(0):e=="seconds"&&(n=f(n).setMilliseconds(0));n.toFormatYMDHMS().toNumber()<=r.toFormatYMDHMS().toNumber();)i.push(n),e=="year"?n=f(n).addYear(1):e=="month"?n=f(n).addMonth(1):e=="week"?n=f(n).addWeek(1):e=="day"?n=f(n).addDate(1):e=="hours"?n=f(n).addHours(1):e=="minutes"?n=f(n).addMinutes(1):e=="seconds"&&(n=f(n).addSeconds(1));return i};f.prototype.Time.prototype=f.prototype;var pe=(...[e,t,r])=>new S.prototype.Interval(e,t,r),S=pe;S.prototype={};var ye=function(...[e,t,r]){return this.fn=e,this.ms=t,this.key=r,this.isFinished=!1,S.abort(this.key),this.store(),this};s.extend({key:"",ms:0,timeoutIndex:-1,fn:null,isFinished:!1,Interval:ye,store:function(){M.set({["Interval_"+this.key]:this})},once:function(){if(this.fn){let e=()=>{this.fn&&this.fn(),this.isFinished=!0,this.store()};this.timeoutIndex=setTimeout(e,this.ms)}return this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return S.abort(this.timeoutIndex),this},setState:function(e){return Object.entries(e).forEach(([t,r])=>{this.hasOwnProperty(t)&&(this[t]=r)}),this.store(),this}},S);S.abort=e=>{if(s.isNumber(e))return clearInterval(e);let t=M.get("Interval_"+e);t&&(t&&clearInterval(t.timeoutIndex),t.setState({isFinished:!0}))};S.get=e=>M.get("Interval_"+e);S.once=(e,t,r)=>S(e,t,r).once();S.series=(e,t)=>C(void 0,null,function*(){return new Promise(r=>{let i=S.get(e);if(i&&!i.isFinished)return r(null);let n=()=>{S.abort(e)};r(n),t&&S(n,t,e).once()})});S.start=(e,t,r)=>S(e,t,r).start();S.prototype.Interval.prototype=S.prototype;var ge=(e,t)=>new c.prototype.Fetcher(e,t),c=ge;c.prototype={};c.waitList=[];c.setDefaultTrafficControl=0;c.setDefaultTimeout=1e3*60*10;c.abort=e=>{let t="fetcher.abortController."+e,r=M.get(t);console.log(r),r&&r.abort()};c.safetyRecords=e=>{let t={};return Object.entries(e).forEach(([r,i])=>{if(s.isArray(i)){t[r]=i.join(",");return}else if(s.isRecord(i)){Object.entries(c.safetyRecords(i)).forEach(([n,a])=>{t[`${r}.${n}`]=a});return}t[r]=i}),t};c.isReadableStream=e=>e instanceof ReadableStream;c.isReadableStreamReader=e=>e instanceof ReadableStreamDefaultReader;c.streamToContext=(e,t)=>C(void 0,null,function*(){try{let r=(t==null?void 0:t.reader)||e.getReader();if(!c.isReadableStreamReader(r))return{ok:!1,done:!0,data:null};if(!r)return{ok:!1,done:!0,data:null};let i=(t==null?void 0:t.decoder)||new TextDecoder("utf-8"),n=yield r.read();return{ok:!0,done:n.done,data:i.decode(n.value)}}catch(r){return{ok:!1,done:!0,data:r}}});var be=function(e,t){var n;t=t||{};let r=t.body;t.body&&!s.isString(t.body)&&((n=t.bodyStringify)==null||n)&&(r=s.Stringify(t.body||{}));let i=e;return s.isString(e)&&!e.match(/https?:/)&&(i=location.origin+"/"+e.replace(/^\//,"")),this.url=i,this.method=t.method||"get",this.streamStatus="open",this.params=_(v({key:x(),response_format:"json",timeout:c.setDefaultTimeout,trafficControl:c.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:v(v({"Content-Type":"application/json"},c.setDefaultHeaders&&c.setDefaultHeaders()),t.headers),body:r}),this};s.extend({Fetcher:be,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:void 0,onKeyDuplicateCB:void 0,onCompleteCB:void 0,onRetryCB:void 0,isRetry:!1,extraBody:{},abortController:null,setExtraBody:function(e){return this.extraBody=v(v({},this.extraBody),e),this},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(e){return this.onStartCB=e,this},onKeyDuplicate:function(e){return this.onKeyDuplicateCB=e,this},onStream:function(e){return this.onStreamCB=e,this},onResult:function(e){return this.onResultCB=e,this},onComplete:function(e){return this.onCompleteCB=e,this},onRetry:function(e){return this.onRetryCB=e,this},onError:function(e){return this.onErrorCB=e,this},onStreamProcess:function(e){return C(this,null,function*(){let{response:t,errorCB:r,streamCB:i,reader:n,decoder:a}=e,o=t.body,l=this,u=function(){return Z(this,null,function*(){if(!t.ok){s.scope(()=>C(this,null,function*(){let{ok:y,done:b,data:T}=yield c.streamToContext(o,{reader:n,decoder:a});y&&r(T)}));return}let m=!1;for(;!m;){let{ok:y,done:b,data:T}=yield new $(c.streamToContext(o,{reader:n,decoder:a}));l.streamStatus=="abort"?(l.streamStatus="closed",n.cancel(),b=!0):l.streamStatus=="closed"&&(b=!0),b&&(m=b,n.releaseLock()),i(T,b)}})};try{for(var h=ee(u()),d,p,g;d=!(p=yield h.next()).done;d=!1){let m=p.value;;}}catch(p){g=[p]}finally{try{d&&(p=h.return)&&(yield p.call(h))}finally{if(g)throw g[0]}}})},get:function(){return this.method="GET",this.send()},head:function(){return this.method="HEAD",this.send()},post:function(){return this.method="POST",this.send()},put:function(){return this.method="PUT",this.send()},delete:function(){return this.method="DELETE",this.send()},patch:function(){return this.method="PATCH",this.send()},options:function(){return this.method="OPTIONS",this.send()},send:function(){return C(this,null,function*(){var X;let e=this.params,t=performance.now(),V=e,{key:r,response_format:i,trafficControl:n=0,preventMultiRequest:a,timeout:o,queries:l}=V,u=B(V,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);u.method=this.method;let h=[this.method,r].join("."),d=c.waitList.includes(h);c.waitList=[...c.waitList,h];let p=!1,g=!1,m=!1,y=500,b="InternalServerError",T={},J=null,z=null;n>0&&(z=s.pending(n));let I=new AbortController,re=setTimeout(()=>{I.abort(),console.log("timeout",o)},e.timeout);u.signal=I.signal,this.abortController=I;let W="fetcher.abortController."+this.params.key;M.set({[W]:I});let H=()=>{p=!0},K=()=>(I.abort(),c.waitList=c.waitList.filter(w=>w!=h),{isCancelled:p,isAborted:g,ok:!1,status:0,statusText:"CANCELLED",body:T,requestTime:0,rawData:null});try{if(c.setDefaultOnStart&&(yield c.setDefaultOnStart(e,H)),this.onStartCB&&(yield this.onStartCB(e,H)),p)return K();if(d){if(this.onKeyDuplicateCB&&(yield this.onKeyDuplicateCB(H)),p)return K();if(a)throw y=429,new Error("TooManyRequests")}let w=s.url.search.set(v({},c.safetyRecords(l||{})),String(this.url)),Y=yield fetch(w,u).then(F=>C(this,null,function*(){return m=F.ok,y=F.status,b=F.statusText,J=F,i=="none"||i=="stream"?F:F[i]()})).catch(F=>{throw new Error(F)});M.delete(W),T=Y}catch(w){y==200&&(y=500,m=!1),y==429&&(b="TooManyRequests"),I.signal.aborted&&(y=408,b="Timeout",g=!0),y==500&&(b=String(w)||b),T={errorCode:String(w)}}finally{clearTimeout(re)}let D={isCancelled:p,isAborted:g,ok:m,status:y,statusText:b,body:T,additionalBody:this.extraBody,requestTime:performance.now()-t,rawData:J};if(!m){if(this.onRetryCB&&!this.isRetry){this.isRetry=!0;let w=yield this.onRetryCB(D.body,this.params,this);if(w)return c.waitList=c.waitList.filter(Y=>Y!=h),this.params=w,this.send()}this.onErrorCB&&this.onErrorCB(D.body)}if(m&&this.onStreamCB&&e.response_format=="stream"){let w=(X=J.body)==null?void 0:X.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:D,reader:w,decoder:new TextDecoder("utf-8")})}return yield z,D.requestTime=performance.now()-t,m&&this.onCompleteCB&&this.onCompleteCB(D.body),this.onResultCB&&this.onResultCB(D,e),c.setDefaultOnEnd&&c.setDefaultOnEnd(D,e),c.waitList=c.waitList.filter(w=>w!=h),D})},abortStream:function(){this.streamStatus="abort"}},c);c.prototype.Fetcher.prototype=c.prototype;var Ce=e=>new E.prototype.Filer(e),E=Ce;E.prototype={};var Re=function(e){this.ok=!0;try{let[t,r]=e.name.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" ");this.file=e,this.extension=r,this.fileName=t,this.type=e.type}catch(t){console.log(t),this.ok=!1}return this};s.extend({ok:!1,extension:"",type:"",file:{},fileName:"",Filer:Re,isValid:function(){return this.ok},toBlob:function(){return C(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return C(this,null,function*(){return yield this.file.convert("dataURL")})},toAarrayBuffer:function(){return C(this,null,function*(){return yield this.file.convert("arrayBuffer")})},toObjectURL:function(){return C(this,null,function*(){return URL.createObjectURL(this.file)})},updateFileName:function(e){let t=new File([this.file],e+"."+this.extension);return this.file=t,this.fileName=e,this},updateMimeType:function(e){return this.file=new File([this.file],this.fileName+"."+this.extension,{type:e}),this.type=e,this},updateExtension:function(e){let t=new File([this.file],this.fileName+"."+e);return this.file=t,this.extension=e,this}},E);E.fromFile=e=>E(e);E.fromBlob=(e,t)=>{let r=(t==null?void 0:t.fileName)||"file",i=(t==null?void 0:t.extension)||"",n=new File([e],r+"."+i,{type:t==null?void 0:t.mimeType});return E(n)};E.fromArrayBuffer=(e,t)=>E.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t);E.fromObjectURL=(e,t)=>C(void 0,null,function*(){let r=yield c(e,{response_format:"blob"}).get();return r.ok?E.fromBlob(r.body,t):E({})});E.fromDataURL=(e,t)=>{let r=e.toBlob((t==null?void 0:t.mimeType)||"");return r?E.fromBlob(r,t):E({})};E.prototype.Filer.prototype=E.prototype;var Se=function(e){let t=e,r=null;return t.use((i,n,a)=>{let o=n;o.return=l=>{let{ok:u,status:h,body:d={},bodyStringify:p=!0}=l||{};h=h!=null?h:(u!=null?u:!0)&&200||403;let g=d;return p&&!s.isString(d)&&(g=s.Stringify(d)),n.status(h).end(g)},a()}),t.onPathRouter=function(i){return r=i,this},t.pathRouter=function(i){if(!r)return;let n=r(i);return n.route(i),t.use(i,n),n},t.exception=function(i){return t.use(i),this},t},N=Se;N.getLocalIP=e=>{let t="";return s.scope(()=>{if(!e)return;let r=e.networkInterfaces();for(let[i,n]of Object.entries(r))n.forEach(a=>{!a.internal&&a.family==="IPv4"&&!a.address.match(/^(169|127)/)&&(t=a.address)})}),t};N.getIP=function(e){var i;return(((e==null?void 0:e.headers["x-forwarded-for"])||((i=e==null?void 0:e.socket)==null?void 0:i.remoteAddress)||"").toString().match(new RegExp(/(::ffff:)?(\d+\.\d+.\d+\.\d+(:\d+)?)/))||[])[2]||"UNKNOWN IP"};s.copyToClipboard=e=>C(void 0,null,function*(){let t="";s.isString(e)?t=e:s.isFunction(e)&&(t=e());let r={ok:!1,body:"NotSupported"};return yield C(void 0,null,function*(){let i;if(navigator.clipboard){if(i=yield navigator.clipboard.writeText(t).then(()=>!0,()=>!1),!i)return}else{let n=document.createElement("input");if(s(document.body).append(n),n.value=t,n.select(),i=document.execCommand("copy"),document.body.removeChild(n),!i)return}r={ok:!0,body:""}}),r});s.ImageLoader=(e,t)=>{let r;return new Promise((i,n)=>{r=t||new Image,r.onload=()=>i(r),r.onerror=a=>n(a),r.crossOrigin="anonymous",r.src=e})};s.formatCharacter={postal:{JP:e=>{let t="";return e=String(e).replace(/\D/ig,""),e.length==7&&(t=e.replace(/^(\d{3})(.*)/,"$1-$2")),t}},tel:{_:e=>{let t=e;return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t},mobile:e=>{let t="";return e=String(e).removeLetters(),e.length==11&&(t=e.replace(/^(\d{3})(\d{4})(\d{4})/,"$1-$2-$3")),t},fixed:e=>{let t="";return e=String(e).removeLetters(),e.length==10&&(t=e.replace(/^(\d{2})(\d{4})(\d{4})/,"$1-$2-$3")),t}}};s.transformer={weekday:{ENG:e=>["Sun","Mon","Tues","Wednes","Thurs","Fri","Satur"][e]+"day",JP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]+"\u66DC\u65E5",shortJP:e=>["\u65E5","\u6708","\u706B","\u6C34","\u6728","\u91D1","\u571F"][e]},wareki:e=>{let t=[],r=[],i=!1;return[{From:1868,To:1912,name:"\u660E\u6CBB"},{From:1912,To:1926,name:"\u5927\u6B63"},{From:1926,To:1989,name:"\u662D\u548C"},{From:1989,To:2019,name:"\u5E73\u6210"},{From:2019,To:1e5,name:"\u4EE4\u548C"}].forEach(a=>{let{From:o,To:l,name:u}=a;if(o<=e&&e<=l){let h=e-o+1;h==1&&(i=!0,h="\u5143"),r.push(u+h+"\u5E74"),t.push(u)}}),{era:t,value:r,gap:i}}};s.interval=S;c.setDefaultHeaders=()=>({});var Ee=s;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
package/esm/core.js CHANGED
@@ -1 +1 @@
1
- import{b as v,d as R,e as E}from"./chunk-ABA72NWU.js";import{UUID as T}from"./uuid";import"./primitiveExtension";const J=e=>new t.prototype.jmini(e),t=J;t.prototype={},t.extend=function(e,i=t){for(var[r,o]of Object.entries(e))i.prototype[r]=o},t.expando="__jmini_"+T(),t.__classAlias="jmini";const f=(e,i)=>(e.queue.push(i),S(e),e),S=e=>E(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let i=e.queue.shift();i&&(yield i()),e.queueProcess=!1,S(e)}),b=(e,i)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,o]of Object.entries(i))r.match(/queue/)||(e[r]=o);return e},w=(e,i)=>{if(i.length){for(var r=0;r<i.length;r++){let o=i[r];o&&(o[t.expando]||(t.isElement(o)||t.isShadowRoot(o))&&(o[t.expando]={events:{}})),e[r]=o}e.length=i.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,S(e),e};t.extend({constructor:t,__classAlias:t.__classAlias,jmini:function(e){return this.src=e,this.srcType=t.isWhat(e),this.queueProcess=!0,this.queue=[],w(this,t.isJmini(e)?e.get():t.isElement(e)?[e]:t.isElements(e)?e:t.isShadowRoot(e)?[e]:t.isString(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}}),t.prototype[String(Symbol.iterator)]=[][Symbol.iterator],t.prototype.jmini.prototype=t.prototype;{const e=function(n,s,a){let l=[];for(let u=0;u<(n.length||0);u++)l.push(s(n[u],u));return a&&(l=l.filter(u=>u!=null)),l},i=n=>(n.for((s,a)=>{if(!(t.isElement(s)||t.isShadowRoot(s)))return;let l=s.cloneNode(),u=s.parentNode;u&&u.replaceChild(l,s),n[a]=l}),n),r=(n,s)=>(t(s).for(a=>{if(n&&(t.isElement(a)||t.isShadowRoot(a)))if(t.isString(n)||t.isNumber(n))n=String(n),a.insertAdjacentHTML("beforeend",String(n));else if(t.isElement(n))a.appendChild(n);else{t.isJmini(n)?n=n.get():t.isElement(n)?n=[n]:t.isRecord(n)&&(n=[t(n)]);for(var l=0;l<n.length;l++)r(n[l],a)}}),s),o=(n,s,...a)=>{let{p:l,s:u}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return n.for(h=>{if(t.isString(a[0]))h.insertAdjacentHTML(l,a[0]);else{if(!h.parentNode)return;t(a[0]).for(y=>{a[1]&&(y=y.cloneNode(!0)),h.parentNode.insertBefore(y,h[u]||h)})}}),n};t.extend({get:function(n){return n?this[0]:e(this,s=>s)},for:function(n,s=1){let a=e(this,(l,u)=>n(l,u),1);return s?a:[]},await:function(n){return f(this,()=>new Promise((s,a)=>{setTimeout(()=>{s(this)},n)}))},abort:function(){return f(this,()=>E(this,null,function*(){return this.queue=[],this}))},callback:function(n){return f(this,()=>E(this,null,function*(){return yield n(this),this}))},click:function(){return f(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];t.isElement(s)&&s.click()}return this})},focus:function(){return f(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];t.isElement(s)&&s.focus()}return this})},onEvent:function(n,s,a){return f(this,()=>{let m=a||{},{target:l,eventID:u=T()}=m,h=R(m,["target","eventID"]);return h=v({passive:!0,capture:!1},h),this.for(y=>{if(!(t.isElement(y)||t.isShadowRoot(y)))return;let{events:g}=y[t.expando];if(l){let c=s;s=d=>{if(d.target){if(t.isString(l)){let C=d.target.closest(l);C&&(!C||c.call(C,d))}else if(t.isElements(l)){for(let p of l)if(d.target==p)return c.call(p,d)}}}}if(g[u]){let c=g[u];y.removeEventListener(c.eventType,c.callback,c.options)}g[u]={eventType:n,callback:s,options:h},y.addEventListener(n,s,h)}),this})},addEvent:function(n){return f(this,()=>{let{eventType:s,eventID:a=T(),target:l,callback:u,options:h}=n;return h=v({passive:!0,capture:!1},h),this.for(m=>{if(!(t.isElement(m)||t.isShadowRoot(m)))return;let{events:y}=m[t.expando];if(l){let g=u;u=c=>{if(c.target){if(t.isString(l)){let p=c.target.closest(l);p&&(!p||g.call(p,c))}else if(t.isElements(l)){for(let d of l)if(c.target==d)return g.call(d,c)}}}}if(y[a]){let g=y[a];m.removeEventListener(g.eventType,g.callback,g.options)}y[a]={eventType:s,callback:u,options:h},m.addEventListener(s,u,h)}),this})},removeEvent:function(n){return f(this,()=>{let s=t.isArray(n)?n:[n];return this.for(a=>{let{events:l}=a[t.expando];for(let u of s){let h=l[u];h&&a.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(n){return f(this,()=>b(this,r(n,i(this))))},empty:function(){return f(this,()=>b(this,i(this)))},append:function(n){return f(this,()=>{r(n,this)})},remove:function(){return f(this,()=>(this.for((n,s)=>{n&&t.isElement(n)&&(n.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...n){return f(this,()=>b(this,o(this,"before",...n)))},after:function(...n){return f(this,()=>b(this,o(this,"after",...n)))},find:function(n){return f(this,()=>{let s=[],a=this[0];a||b(this,t()),(t.isElement(a)||t.isShadowRoot(a))&&(t.isString(n)?s=a.querySelectorAll(n):t.isElement(a)&&t(n).for(l=>{let u=a.childNodes;for(let h of u)if(h===l){s.push(h);break}else h.childNodes.length&&(s=[...s,...t(h).find(l).for(m=>m)])})),b(this,t(s))})},parent:function(n){return f(this,()=>{var a,l;let s=t(n?(a=this[0])==null?void 0:a.closest(n):(l=this[0])==null?void 0:l.parentNode);b(this,s)})},children:function(n){return f(this,()=>{let s=this[0].children;t.isExist(n)&&(n=String(n).replace(/^ : /,""),s=n=="first"?s[0]:n=="last"?s[s.length-1]:s[Number(n)]);let a=t(s);return b(this,a)})},addClass:function(...n){return f(this,()=>{let s=n.join(" ").split(/\s+/).filter(a=>a.trim()!=="");return s.length&&this.for(a=>{a&&t.isElement(a)&&a.classList.add(...s)}),this})},removeClass:function(...n){return f(this,()=>{let s=n.join(" ").split(/\s+/).filter(a=>a.trim()!=="");return s.length&&this.for(a=>{a&&t.isElement(a)&&a.classList.remove(...s)}),this})},toggleClass:function(n){return f(this,()=>(n&&this.for(s=>{s.classList.toggle(n)}),this))},hasClass:function(n=""){return this[0]?this[0].classList.contains(n.replace(/^\./,"")):!1},findClass:function(n){let s=[];return t.scope(()=>{this[0]&&(s=[...this[0].classList||[]].filter(a=>a.match(n)))}),s},css:function(n){return f(this,()=>(this.for(s=>{if(t.isElement(s))for(let[a,l]of Object.entries(n)){if(t.isNumber(l)&&a.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[a]=l+"px";continue}s.style[a]=String(l)}}),this))},getAttribute:function(n){return this[0].getAttribute(String(n))||""},setAttribute:function(n,s){return f(this,()=>(this.for(a=>a.setAttribute(n,s)),this))},getStyleProperty:function(n){let s=this[0];return s&&t.isElement(s)?getComputedStyle(s).getPropertyValue(n):""},setStyleProperty:function(n,s){let a=this[0];return a&&t.isElement(a)&&a.style.setProperty(n,s),this},val:function(){var s;let n=this[0];return(n==null?void 0:n.value)||((s=n==null?void 0:n.dataset)==null?void 0:s.value)},position:function(){return t.isElement(this[0])?this[0].getBoundingClientRect():{x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0,toJSON:()=>{}}}})}t.uniqueArray=(e,i)=>i?Array.from(new Map(e.map(r=>[t.getRecord(r,i||"0"),r])).values()):Array.from(new Set(e)),t.getRecord=(e,i)=>{let r={},o=e;return i.split(".").forEach(n=>{o=o==null?void 0:o[n],r=o}),r},t.Arrayify=t.flatArray=(e,i)=>{if(!t.isArray(e))return[e];let r=[];for(let o of e)r.push(...i=="-R"?t.Arrayify(o,"-R"):[o]);return r},t.Stringify=(...e)=>{let[i,r,o]=e;return JSON.stringify(i,r!=null?r:(()=>{const n=new WeakSet;return(s,a)=>{if(typeof a=="object"&&a!==null){if(n.has(a))return"[Circular Reference]";n.add(a)}return a}})(),o)},t.Objectify=(e,i)=>{try{return JSON.parse(e)}catch(r){return i!=null?i:null}},t.SortifyObject=(e,i)=>{let r={};return!e||!t.isArray(e)&&!t.isRecord(e)?null:(Object.keys(e).sort().forEach(o=>{let n=e[o];if(i){if(t.isRecord(n)){r[o]=t.SortifyObject(n,i);return}if(t.isArray(n)){r[o]=n.map(s=>t.isRecord(s)||t.isArray(s)?t.SortifyObject(s,i):s);return}}r[o]=n}),r)},t.randomNumber=(e=0,i=100,r)=>{if(e>i)return NaN;let o=Math.round(Math.random()*(i-e))+e;return r&&r.length&&r.includes(o)?t.randomNumber(e,i,r):o},t.try=e=>{try{return[e(),!0]}catch(i){return[i,!1]}},t.trySync=e=>E(void 0,null,function*(){try{return[yield e(),!0]}catch(i){return[i,!1]}}),t.scope=e=>e(),t.scopeSync=e=>E(void 0,null,function*(){return yield e()}),t.createElement=function(e){var y;let{tag:i,className:r="",id:o,html:n,attr:s,style:a,parent:l}=e,u=document.createElement(i||"div");if(r&&u.classList.add(...r.split(" ")),o&&(u.id=o),s)for(let g of Object.entries(s)){let c=g[0],d=(y=g[1])!=null?y:"";if(c=="data"&&t.isRecord(d))for(let[p,C]of Object.entries(d))u.dataset[p]=C;else c=="for"?c="htmlFor":c=="tabindex"?c="tabIndex":c=="aria-label"&&(c="ariaLabel"),u[c]=d}if(n&&t(u).append(n),a)for(var[h,m]of Object.entries(a))u.style[h]=m;return l&&t(l).append(u),u},t.setCookie=e=>{let{hostname:i}=new URL(location.toString()),{name:r,value:o="",age:n=60*60*24*365,path:s="/",domain:a=i,secure:l=!1}=e,u=`${r}=${o}max-age=${n}path=${s}domain=${a}`;l&&(u+=" Secure"),document.cookie=u},t.getCookie=e=>{let i=document.cookie.match(new RegExp(e+"=[^]*"));return i?i[0].replace(new RegExp(e+"="),""):""},t.localStorage={set:(e,i)=>{localStorage.setItem(e,t.Stringify(i))},get:e=>{let i=localStorage.getItem(e);return t.Objectify(i,i)}},t.deleteCookie=e=>{document.cookie=e+"=max-age=0"},t.getScreenSize=()=>{let{innerHeight:e,innerWidth:i,scrollY:r,scrollX:o,pageXOffset:n,pageYOffset:s}=window,a=Number(t(document.body).getStyleProperty("--sat").removeLetters()),l=Number(t(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:i,pageHeight:e-a-l,scrollY:r,scrollX:o,pageXOffset:n,pageYOffset:s,safeAreaTop:a,safeAreaBottom:l}},t.getCursor=e=>{var o,n,s,a,l,u,h,m;let i=(a=e.pageX)!=null?a:(s=(o=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:o.pageX)!=null?s:(((n=e==null?void 0:e.originalEvent)==null?void 0:n.touches)||[])[0].pageX,r=(m=e.pageY)!=null?m:(h=(l=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:l.pageY)!=null?h:(((u=e==null?void 0:e.originalEvent)==null?void 0:u.touches)||[])[0].pageY;return{x:i,y:r}},t.pending=(e,i)=>{var o;let r=(o=i||Number(e))!=null?o:-1;return new Promise((n,s)=>{t.isFunction(e)&&e(n),!(r<0)&&setTimeout(()=>{n(!0)},r)})},t.deepMerge=(e,...i)=>{if(!i.length)return e;const r=i.shift();if(t.isRecord(e)&&t.isRecord(r))for(const o in r)t.isRecord(r[o])?(e[o]||Object.assign(e,{[o]:{}}),t.deepMerge(e[o],r[o])):Object.assign(e,{[o]:r[o]});return t.deepMerge(e,...i)},t.deepCopy=e=>{if(t.isArray(e))return e.map(i=>t.deepCopy(i));if(t.isRecord(e)){let i={};return Object.entries(e).forEach(([r,o])=>{i[r]=t.deepCopy(o)}),i}return e},t.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,i)=>{const r=new URL(i||location.href);if(t.isString(e))r.pathname=e;else{let o=t.url.path.get();Object.entries(e).forEach(([n,s])=>{o[Number(n)]=s}),r.pathname="/"+o.filter(n=>n!=null).join("/")}return i||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((o,n)=>r[n]=o),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([o,n])=>{r.searchParams.set(o,String(n))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(o=>{r.searchParams.delete(o)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}}},t.queryParams={get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((o,n)=>r[n]=o),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([o,n])=>{r.searchParams.set(o,String(n))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(o=>{r.searchParams.delete(o)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}},t.ellipsisText=(e,i)=>{let r=String(e);return r.length>i&&(r=r.slice(0,i)+" ..."),r},t.isEqual=(e,i,r)=>r==null||r?t.Stringify(e)===t.Stringify(i):e===i,t.isExist=e=>e===(e!=null?e:!e),t.isNullish=e=>!t.isExist(e),t.isJmini=e=>{var i,r;return((i=e||{})==null?void 0:i.constructor)===t||((r=e||{})==null?void 0:r.__classAlias)===t.__classAlias},t.isString=e=>typeof e=="string",t.isBoolean=e=>typeof e=="boolean",t.isNumber=e=>!isNaN(e)&&typeof e=="number",t.isArray=e=>{let i={}.toString.call(e);return Array.isArray(e)||e instanceof Array||i=="[object NodeList]"||i=="[object HTMLCollection]"},t.isFunction=e=>typeof e=="function",t.isRecord=e=>({}).toString.call(e)==="[object Object]"&&!t.isJmini(e),t.isElement=e=>e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e)),t.isElements=e=>{let i={}.toString.call(e),r=Number(!!e&&!t.isString(e)&&t.isArray(e)&&i!=="[object Text]");if(r&&t.isArray(e)&&i!=="[object NodeList]")for(var o of e)r&=Number(t.isElement(o));return!!r},t.isShadowRoot=e=>e instanceof ShadowRoot,t.isDate=e=>t.isNumber(new Date(e).getTime()),t.isInRange=(e,i,r,o=!0)=>o?i<=e&&e<=r:i<e&&e<r,t.isOneOf=(e,...i)=>{if(!(i!=null&&i.length))return!1;let r=t.isArray(e),o=t.isRecord(e);return r||o?i==null?void 0:i.some(n=>t.isEqual(e,n)):i==null?void 0:i.includes(e)},t.isWhat=e=>{let i="other";return t.isJmini(e)?i="jmini":t.isElement(e)?i="element":t.isElements(e)?i="elements":t.isShadowRoot(e)?i="shadowRoot":t.isString(e)?i="string":t.isNumber(e)?i="number":t.isArray(e)?i="array":t.isFunction(e)?i="function":t.isDate(e)?i="date":typeof e=="undefined"?i="undefined":t.isRecord(e)?i="record":e==null?i="null":isNaN(e)&&(i="NaN"),i},t.is={equal:t.isEqual,exist:t.isExist,nullish:t.isNullish,jmini:t.isJmini,string:t.isString,boolean:t.isBoolean,number:t.isNumber,array:t.isArray,function:t.isFunction,record:t.isRecord,element:t.isElement,elements:t.isElements,shadowRoot:t.isShadowRoot,date:t.isDate,inRange:t.isInRange,oneOf:t.isOneOf,what:t.isWhat};export{t as Jmini,t as default};
1
+ import{b as T,d as R,e as E}from"./chunk-ABA72NWU.js";import{UUID as S}from"./uuid";import"./primitiveExtension";const J=e=>new t.prototype.jmini(e),t=J;t.prototype={},t.extend=function(e,i=t){for(var[r,o]of Object.entries(e))i.prototype[r]=o},t.expando="__jmini_"+S(),t.__classAlias="jmini";const f=(e,i)=>(e.queue.push(i),v(e),e),v=e=>E(void 0,null,function*(){if(e.queueProcess||!e.queue.length)return;e.queueProcess=!0;let i=e.queue.shift();i&&(yield i()),e.queueProcess=!1,v(e)}),b=(e,i)=>{for(let r=0;r<e.length;r++)e[r]=null;for(let[r,o]of Object.entries(i))r.match(/queue/)||(e[r]=o);return e},w=(e,i)=>{if(i.length){for(var r=0;r<i.length;r++){let o=i[r];o&&(o[t.expando]||(t.isElement(o)||t.isShadowRoot(o))&&(o[t.expando]={events:{}})),e[r]=o}e.length=i.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,v(e),e};t.extend({constructor:t,__classAlias:t.__classAlias,jmini:function(e){return this.src=e,this.srcType=t.isWhat(e),this.queueProcess=!0,this.queue=[],w(this,t.isJmini(e)?e.get():t.isElement(e)?[e]:t.isElements(e)?e:t.isShadowRoot(e)?[e]:t.isString(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}}),t.prototype[String(Symbol.iterator)]=[][Symbol.iterator],t.prototype.jmini.prototype=t.prototype;{const e=function(n,s,a){let l=[];for(let u=0;u<(n.length||0);u++)l.push(s(n[u],u));return a&&(l=l.filter(u=>u!=null)),l},i=n=>(n.for((s,a)=>{if(!(t.isElement(s)||t.isShadowRoot(s)))return;let l=s.cloneNode(),u=s.parentNode;u&&u.replaceChild(l,s),n[a]=l}),n),r=(n,s)=>(t(s).for(a=>{if(n&&(t.isElement(a)||t.isShadowRoot(a)))if(t.isString(n)||t.isNumber(n))n=String(n),a.insertAdjacentHTML("beforeend",String(n));else if(t.isElement(n))a.appendChild(n);else{t.isJmini(n)?n=n.get():t.isElement(n)?n=[n]:t.isRecord(n)&&(n=[t(n)]);for(var l=0;l<n.length;l++)r(n[l],a)}}),s),o=(n,s,...a)=>{let{p:l,s:u}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return n.for(h=>{if(t.isString(a[0]))h.insertAdjacentHTML(l,a[0]);else{if(!h.parentNode)return;t(a[0]).for(y=>{a[1]&&(y=y.cloneNode(!0)),h.parentNode.insertBefore(y,h[u]||h)})}}),n};t.extend({get:function(n){return n?this[0]:e(this,s=>s)},for:function(n,s=1){let a=e(this,(l,u)=>n(l,u),1);return s?a:[]},await:function(n){return f(this,()=>new Promise((s,a)=>{setTimeout(()=>{s(this)},n)}))},abort:function(){return f(this,()=>E(this,null,function*(){return this.queue=[],this}))},callback:function(n){return f(this,()=>E(this,null,function*(){return yield n(this),this}))},click:function(){return f(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];t.isElement(s)&&s.click()}return this})},focus:function(){return f(this,()=>{for(var n=0;n<this.length;n++){let s=this[n];t.isElement(s)&&s.focus()}return this})},onEvent:function(n,s,a){return f(this,()=>{let m=a||{},{target:l,eventID:u=S()}=m,h=R(m,["target","eventID"]);return h=T({passive:!0,capture:!1},h),this.for(y=>{if(!(t.isElement(y)||t.isShadowRoot(y)))return;let{events:g}=y[t.expando];if(l){let c=s;s=d=>{if(d.target){if(t.isString(l)){let C=d.target.closest(l);C&&(!C||c.call(C,d))}else if(t.isElements(l)){for(let p of l)if(d.target==p)return c.call(p,d)}}}}if(g[u]){let c=g[u];y.removeEventListener(c.eventType,c.callback,c.options)}g[u]={eventType:n,callback:s,options:h},y.addEventListener(n,s,h)}),this})},addEvent:function(n){return f(this,()=>{let{eventType:s,eventID:a=S(),target:l,callback:u,options:h}=n;return h=T({passive:!0,capture:!1},h),this.for(m=>{if(!(t.isElement(m)||t.isShadowRoot(m)))return;let{events:y}=m[t.expando];if(l){let g=u;u=c=>{if(c.target){if(t.isString(l)){let p=c.target.closest(l);p&&(!p||g.call(p,c))}else if(t.isElements(l)){for(let d of l)if(c.target==d)return g.call(d,c)}}}}if(y[a]){let g=y[a];m.removeEventListener(g.eventType,g.callback,g.options)}y[a]={eventType:s,callback:u,options:h},m.addEventListener(s,u,h)}),this})},removeEvent:function(n){return f(this,()=>{let s=t.isArray(n)?n:[n];return this.for(a=>{let{events:l}=a[t.expando];for(let u of s){let h=l[u];h&&a.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(n){return f(this,()=>b(this,r(n,i(this))))},empty:function(){return f(this,()=>b(this,i(this)))},append:function(n){return f(this,()=>{r(n,this)})},remove:function(){return f(this,()=>(this.for((n,s)=>{n&&t.isElement(n)&&(n.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...n){return f(this,()=>b(this,o(this,"before",...n)))},after:function(...n){return f(this,()=>b(this,o(this,"after",...n)))},find:function(n){return f(this,()=>{let s=[],a=this[0];a||b(this,t()),(t.isElement(a)||t.isShadowRoot(a))&&(t.isString(n)?s=a.querySelectorAll(n):t.isElement(a)&&t(n).for(l=>{let u=a.childNodes;for(let h of u)if(h===l){s.push(h);break}else h.childNodes.length&&(s=[...s,...t(h).find(l).for(m=>m)])})),b(this,t(s))})},parent:function(n){return f(this,()=>{var a,l;let s=t(n?(a=this[0])==null?void 0:a.closest(n):(l=this[0])==null?void 0:l.parentNode);b(this,s)})},children:function(n){return f(this,()=>{let s=this[0].children;t.isExist(n)&&(n=String(n).replace(/^ : /,""),s=n=="first"?s[0]:n=="last"?s[s.length-1]:s[Number(n)]);let a=t(s);return b(this,a)})},addClass:function(...n){return f(this,()=>{let s=n.join(" ").split(/\s+/).filter(a=>a.trim()!=="");return s.length&&this.for(a=>{a&&t.isElement(a)&&a.classList.add(...s)}),this})},removeClass:function(...n){return f(this,()=>{let s=n.join(" ").split(/\s+/).filter(a=>a.trim()!=="");return s.length&&this.for(a=>{a&&t.isElement(a)&&a.classList.remove(...s)}),this})},toggleClass:function(n){return f(this,()=>(n&&this.for(s=>{s.classList.toggle(n)}),this))},hasClass:function(n=""){return this[0]?this[0].classList.contains(n.replace(/^\./,"")):!1},findClass:function(n){let s=[];return t.scope(()=>{this[0]&&(s=[...this[0].classList||[]].filter(a=>a.match(n)))}),s},css:function(n){return f(this,()=>(this.for(s=>{if(t.isElement(s))for(let[a,l]of Object.entries(n)){if(t.isNumber(l)&&a.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[a]=l+"px";continue}s.style[a]=String(l)}}),this))},getAttribute:function(n){return this[0].getAttribute(String(n))||""},setAttribute:function(n,s){return f(this,()=>(this.for(a=>a.setAttribute(n,s)),this))},getStyleProperty:function(n){let s=this[0];return s&&t.isElement(s)?getComputedStyle(s).getPropertyValue(n):""},setStyleProperty:function(n,s){let a=this[0];return a&&t.isElement(a)&&a.style.setProperty(n,s),this},val:function(){var s;let n=this[0];return(n==null?void 0:n.value)||((s=n==null?void 0:n.dataset)==null?void 0:s.value)},position:function(){return t.isElement(this[0])?this[0].getBoundingClientRect():{x:0,y:0,width:0,height:0,top:0,right:0,bottom:0,left:0,toJSON:()=>{}}}})}t.uniqueArray=(e,i)=>i?Array.from(new Map(e.map(r=>[t.getRecord(r,i||"0"),r])).values()):Array.from(new Set(e)),t.getRecord=(e,i)=>{let r={},o=e;return i.split(".").forEach(n=>{o=o==null?void 0:o[n],r=o}),r},t.Arrayify=t.flatArray=(e,i)=>{if(!t.isArray(e))return[e];let r=[];for(let o of e)r.push(...i=="-R"?t.Arrayify(o,"-R"):[o]);return r},t.Stringify=(...e)=>{let[i,r,o]=e;return JSON.stringify(i,r!=null?r:(()=>{const n=new WeakSet;return(s,a)=>{if(typeof a=="object"&&a!==null){if(n.has(a))return"[Circular Reference]";n.add(a)}return a}})(),o)},t.Objectify=(e,i)=>{try{return JSON.parse(e)}catch(r){return i!=null?i:null}},t.SortifyObject=(e,i)=>{let r={};return!e||!t.isArray(e)&&!t.isRecord(e)?null:(Object.keys(e).sort().forEach(o=>{let n=e[o];if(i){if(t.isRecord(n)){r[o]=t.SortifyObject(n,i);return}if(t.isArray(n)){r[o]=n.map(s=>t.isRecord(s)||t.isArray(s)?t.SortifyObject(s,i):s);return}}r[o]=n}),r)},t.randomNumber=(e=0,i=100,r)=>{if(e>i)return NaN;let o=Math.round(Math.random()*(i-e))+e;return r&&r.length&&r.includes(o)?t.randomNumber(e,i,r):o},t.try=e=>{try{return[e(),!0]}catch(i){return[i,!1]}},t.trySync=e=>E(void 0,null,function*(){try{return[yield e(),!0]}catch(i){return[i,!1]}}),t.scope=e=>e(),t.scopeSync=e=>E(void 0,null,function*(){return yield e()}),t.createElement=function(e){var y;let{tag:i,className:r="",id:o,html:n,attr:s,style:a,parent:l}=e,u=document.createElement(i||"div");if(r&&u.classList.add(...r.split(" ")),o&&(u.id=o),s)for(let g of Object.entries(s)){let c=g[0],d=(y=g[1])!=null?y:"";if(c=="data"&&t.isRecord(d))for(let[p,C]of Object.entries(d))u.dataset[p]=C;else c=="for"?c="htmlFor":c=="tabindex"?c="tabIndex":c=="aria-label"&&(c="ariaLabel"),u[c]=d}if(n&&t(u).append(n),a)for(var[h,m]of Object.entries(a))u.style[h]=m;return l&&t(l).append(u),u},t.setCookie=e=>{let{hostname:i}=new URL(location.toString()),{name:r,value:o="",age:n=60*60*24*365,path:s="/",domain:a=i,secure:l=!1}=e,u=`${r}=${o}max-age=${n}path=${s}domain=${a}`;l&&(u+=" Secure"),document.cookie=u},t.getCookie=e=>{let i=document.cookie.match(new RegExp(e+"=[^]*"));return i?i[0].replace(new RegExp(e+"="),""):""},t.localStorage={set:(e,i)=>{localStorage.setItem(e,t.Stringify(i))},get:e=>{let i=localStorage.getItem(e);return t.Objectify(i,i)}},t.deleteCookie=e=>{document.cookie=e+"=max-age=0"},t.getScreenSize=()=>{let{innerHeight:e,innerWidth:i,scrollY:r,scrollX:o,pageXOffset:n,pageYOffset:s}=window,a=Number(t(document.body).getStyleProperty("--sat").removeLetters()),l=Number(t(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:i,pageHeight:e-a-l,scrollY:r,scrollX:o,pageXOffset:n,pageYOffset:s,safeAreaTop:a,safeAreaBottom:l}},t.getCursor=e=>{var o,n,s,a,l,u,h,m;let i=(a=e.pageX)!=null?a:(s=(o=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:o.pageX)!=null?s:(((n=e==null?void 0:e.originalEvent)==null?void 0:n.touches)||[])[0].pageX,r=(m=e.pageY)!=null?m:(h=(l=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:l.pageY)!=null?h:(((u=e==null?void 0:e.originalEvent)==null?void 0:u.touches)||[])[0].pageY;return{x:i,y:r}},t.pending=(e,i)=>{var o;let r=(o=i||Number(e))!=null?o:-1;return new Promise((n,s)=>{t.isFunction(e)&&e(n),!(r<0)&&setTimeout(()=>{n(!0)},r)})},t.deepMerge=(e,...i)=>{if(!i.length)return e;const r=i.shift();if(t.isRecord(e)&&t.isRecord(r))for(const o in r)t.isRecord(r[o])?(e[o]||Object.assign(e,{[o]:{}}),t.deepMerge(e[o],r[o])):Object.assign(e,{[o]:r[o]});return t.deepMerge(e,...i)},t.deepCopy=e=>{const i=(r,o)=>{if(t.isArray(r))return o.has(r)?r:(o.add(r),r.map(n=>i(n,o)));if(t.isRecord(r)){if(o.has(r))return r;o.add(r);let n={};return Object.entries(r).forEach(([s,a])=>{n[s]=i(a,o)}),n}return r};return i(e,new WeakSet)},t.url={path:{get:e=>{let r=new URL(e||location.href).pathname||"";return r=r.replace(/^\//,"").replace(/\/$/,""),r.split("/")},set:(e,i)=>{const r=new URL(i||location.href);if(t.isString(e))r.pathname=e;else{let o=t.url.path.get();Object.entries(e).forEach(([n,s])=>{o[Number(n)]=s}),r.pathname="/"+o.filter(n=>n!=null).join("/")}return i||history.replaceState({},"",r.pathname+r.search),r.toString()}},search:{get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((o,n)=>r[n]=o),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([o,n])=>{r.searchParams.set(o,String(n))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(o=>{r.searchParams.delete(o)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}}},t.queryParams={get:e=>{let i=new URL(e||location.href),r={};return i.searchParams.forEach((o,n)=>r[n]=o),r},set:(e,i)=>{const r=new URL(i||location.href);return Object.entries(e).forEach(([o,n])=>{r.searchParams.set(o,String(n))}),i||history.replaceState({},"",r.pathname+r.search),r.toString()},delete:(e,i)=>{const r=new URL(i||location.href);return e.forEach(o=>{r.searchParams.delete(o)}),i||history.replaceState({},"",r.pathname+r.search),r.toString()}},t.ellipsisText=(e,i)=>{let r=String(e);return r.length>i&&(r=r.slice(0,i)+" ..."),r},t.isEqual=(e,i,r)=>r==null||r?t.Stringify(e)===t.Stringify(i):e===i,t.isExist=e=>e===(e!=null?e:!e),t.isNullish=e=>!t.isExist(e),t.isJmini=e=>{var i,r;return((i=e||{})==null?void 0:i.constructor)===t||((r=e||{})==null?void 0:r.__classAlias)===t.__classAlias},t.isString=e=>typeof e=="string",t.isBoolean=e=>typeof e=="boolean",t.isNumber=e=>!isNaN(e)&&typeof e=="number",t.isArray=e=>{let i={}.toString.call(e);return Array.isArray(e)||e instanceof Array||i=="[object NodeList]"||i=="[object HTMLCollection]"},t.isFunction=e=>typeof e=="function",t.isRecord=e=>({}).toString.call(e)==="[object Object]"&&!t.isJmini(e),t.isElement=e=>e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e)),t.isElements=e=>{let i={}.toString.call(e),r=Number(!!e&&!t.isString(e)&&t.isArray(e)&&i!=="[object Text]");if(r&&t.isArray(e)&&i!=="[object NodeList]")for(var o of e)r&=Number(t.isElement(o));return!!r},t.isShadowRoot=e=>e instanceof ShadowRoot,t.isDate=e=>t.isNumber(new Date(e).getTime()),t.isInRange=(e,i,r,o=!0)=>o?i<=e&&e<=r:i<e&&e<r,t.isOneOf=(e,...i)=>{if(!(i!=null&&i.length))return!1;let r=t.isArray(e),o=t.isRecord(e);return r||o?i==null?void 0:i.some(n=>t.isEqual(e,n)):i==null?void 0:i.includes(e)},t.isWhat=e=>{let i="other";return t.isJmini(e)?i="jmini":t.isElement(e)?i="element":t.isElements(e)?i="elements":t.isShadowRoot(e)?i="shadowRoot":t.isString(e)?i="string":t.isNumber(e)?i="number":t.isArray(e)?i="array":t.isFunction(e)?i="function":t.isDate(e)?i="date":typeof e=="undefined"?i="undefined":t.isRecord(e)?i="record":e==null?i="null":isNaN(e)&&(i="NaN"),i},t.is={equal:t.isEqual,exist:t.isExist,nullish:t.isNullish,jmini:t.isJmini,string:t.isString,boolean:t.isBoolean,number:t.isNumber,array:t.isArray,function:t.isFunction,record:t.isRecord,element:t.isElement,elements:t.isElements,shadowRoot:t.isShadowRoot,date:t.isDate,inRange:t.isInRange,oneOf:t.isOneOf,what:t.isWhat};export{t as Jmini,t as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmini",
3
- "version": "0.0.120",
3
+ "version": "0.0.121",
4
4
  "description": "minified JavaScript Framework",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",