jmini 0.0.19 → 0.0.20

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 I=Object.defineProperty,W=Object.defineProperties,z=Object.getOwnPropertyDescriptor,X=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertyNames,F=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var B=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var k=Math.pow,Y=(e,t,n)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,x=(e,t)=>{for(var n in t||(t={}))O.call(t,n)&&Y(e,n,t[n]);if(F)for(var n of F(t))U.call(t,n)&&Y(e,n,t[n]);return e},A=(e,t)=>W(e,X(t));var j=(e,t)=>{var n={};for(var i in e)O.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&F)for(var i of F(e))t.indexOf(i)<0&&U.call(e,i)&&(n[i]=e[i]);return n};var Q=(e,t)=>{for(var n in t)I(e,n,{get:t[n],enumerable:!0})},Z=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of G(t))!O.call(e,r)&&r!==n&&I(e,r,{get:()=>t[r],enumerable:!(i=z(t,r))||i.enumerable});return e};var ee=e=>Z(I({},"__esModule",{value:!0}),e);var d=(e,t,n)=>new Promise((i,r)=>{var s=l=>{try{u(n.next(l))}catch(h){r(h)}},o=l=>{try{u(n.throw(l))}catch(h){r(h)}},u=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);u((n=n.apply(e,t)).next())}),J=function(e,t){this[0]=e,this[1]=t},V=(e,t,n)=>{var i=(o,u,l,h)=>{try{var c=n[o](u),g=(u=c.value)instanceof J,C=c.done;Promise.resolve(g?u[0]:u).then(m=>g?i(o==="return"?o:"next",u[1]?{done:m.done,value:m.value}:m,l,h):l({value:m,done:C})).catch(m=>i("throw",m,l,h))}catch(m){h(m)}},r=o=>s[o]=u=>new Promise((l,h)=>i(o,u,l,h)),s={};return n=n.apply(e,t),s[B("asyncIterator")]=()=>s,r("next"),r("throw"),r("return"),s};var $=(e,t,n)=>(t=e[B("asyncIterator")])?t.call(e):(e=e[B("iterator")](),t={},n=(i,r)=>(r=e[i])&&(t[i]=s=>new Promise((o,u,l)=>(s=r.call(e,s),l=s.done,Promise.resolve(s.value).then(h=>o({value:h,done:l}),u)))),n("next"),n("return"),t);var pe={};Q(pe,{Fetcher:()=>p,Filer:()=>b,Server:()=>L,Time:()=>f,UUID:()=>v,default:()=>fe,useStore:()=>P});module.exports=ee(pe);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,t){return this.slice(0,e)+t+this.slice(e+t.length)},String.prototype.toBlob=function(e){let t=atob(this.replace(/^.*,/,"")),n=new Uint8Array(t.length);for(var i=0;i<t.length;i++)n[i]=t.charCodeAt(i);try{var r=new Blob([n.buffer],{type:e})}catch(s){return!1}return r},String.prototype.toNumber=function(){return Number(this.removeLetters())},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(/+/,"+")});typeof Number!="undefined"&&(Number.prototype.zeroEmbed=function(e){return String(this).padStart(e||2,"0")},Number.prototype.ratio=function(e,t=2){let n=k(10,t);return Math.round(this/e*n*100)/n},Number.prototype.rate=function(e,t=2){let n=k(10,t);return Math.round(this/e*n)/n},Number.prototype.rank=function(e=1){let t=k(10,e),n=Number(this),i=n.toLocaleString().replace(/\d/ig,"").length;return Math.round(n/k(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),n=t.slice(0,4),i=t.slice(4,6),r=t.slice(6,8),s=[];return n.length!=4||s.push(n),i.length!=2||s.push(i),r.length!=2||s.push(r),s.join(e)});if(typeof Array!="undefined"){let e=(t,n)=>{if(!t)return;let i=t;for(let r of n){if(!i)break;i=i[r]}return i};Array.prototype.order=function(t){let{direction:n="ASC",keys:i=[],numeral:r=!1}=t,s=[];return i.length?r?s=this.sort((o,u)=>+(Number(e(o,i))>Number(e(u,i)))*2-1):s=this.sort((o,u)=>{let l=String(e(o,i)).replace(/(\d+)/g,c=>c.padStart(18,"0")),h=String(e(u,i)).replace(/(\d+)/g,c=>c.padStart(18,"0"));return+(l>h)*2-1}):r?s=this.sort((o,u)=>+(o>u)*2-1):s=this.sort((o,u)=>{let l=String(o).replace(/(\d+)/g,c=>c.padStart(18,"0")),h=String(u).replace(/(\d+)/g,c=>c.padStart(18,"0"));return+(l>h)*2-1}),n=="DESC"&&(s=s.reverse()),s},Array.prototype.getLastChild=function(){let t=this.length-1;return this[t]}}typeof File!="undefined"&&(File.prototype.convert=function(e){return e=e||"dataURL",new Promise((t,n)=>{let i=new FileReader;i.onload=s=>t(s),i.onerror=s=>n(s);let r="readAs"+(e==null?void 0:e.toCapital());i[r](this)})});var te=(e=24)=>Array.from({length:e}).map((t,n)=>{let i=n==0?25:35,r=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*i)][r?"toUpper":"toLower"]()}).join(""),v=te;v.gen128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");v.gen32Hex=(e="Formatted",t="-")=>{let n=Array.from({length:32}).map((i,r)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(n=[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20,32)].join(t)),n};v.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 re=e=>new a.prototype.jmini(e),a=re;a.prototype={};a.extend=function(e,t=a){for(var[n,i]of Object.entries(e))t.prototype[n]=i};a.expando="__jmini_"+v();var y=(e,t)=>(e.queue.push(t),N(e),e),N=e=>d(void 0,null,function*(){if(!e.queueProcess&&e.queue.length){e.queueProcess=!0;let t=e.queue.shift();t&&(yield t()),e.queueProcess=!1,N(e)}}),R=(e,t)=>{for(let n=0;n<e.length;n++)e[n]=null;for(let[n,i]of Object.entries(t))n.match(/queue/)||(e[n]=i);return e},ne=(e,t)=>{if(t.length){for(var n=0;n<t.length;n++){let i=t[n];i&&(i[a.expando]||(a.is.element(i)||a.is.shadowRoot(i))&&(i[a.expando]={events:{}})),e[n]=i}e.length=t.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,N(e),e};a.extend({constructor:a,jmini:function(e){return this.src=e,this.srcType=a.is.what(e),this.queueProcess=!0,this.queue=[],ne(this,a.is.jmini(e)?e.get():a.is.element(e)?[e]:a.is.elements(e)?e:a.is.shadowRoot(e)?[e]:a.is.string(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}});a.prototype[String(Symbol.iterator)]=[][Symbol.iterator];a.prototype.jmini.prototype=a.prototype;{let e=function(r,s,o){let u=[];for(let l=0;l<(r.length||0);l++)u.push(s(r[l],l));return o&&(u=u.filter(l=>l!=null)),u},t=r=>(r.for((s,o)=>{if(!(a.is.element(s)||a.is.shadowRoot(s)))return;let u=s.cloneNode(),l=s.parentNode;l&&l.replaceChild(u,s),r[o]=u}),r),n=(r,s)=>(a(s).for(o=>{if(r&&(a.is.element(o)||a.is.shadowRoot(o)))if(a.is.string(r)||a.is.number(r))r=String(r),o.insertAdjacentHTML("beforeend",String(r));else if(a.is.element(r))o.appendChild(r);else{a.is.jmini(r)?r=r.get():a.is.element(r)?r=[r]:a.is.keyValueDictionary(r)&&(r=[a(r)]);for(var u=0;u<r.length;u++)n(r[u],o)}}),s),i=(r,s,...o)=>{let{p:u,s:l}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return r.for(h=>{if(a.is.string(o[0]))h.insertAdjacentHTML(u,o[0]);else{if(!h.parentNode)return;a(o[0]).for(g=>{o[1]&&(g=g.cloneNode(!0)),h.parentNode.insertBefore(g,h[l]||h)})}}),r};a.extend({get:function(r){return r?this[0]:e(this,s=>s)},for:function(r,s=1){let o=e(this,(u,l)=>r(u,l),1);return s?o:[]},await:function(r){return y(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},r)}))},abort:function(){return y(this,()=>d(this,null,function*(){return this.queue=[],this}))},callback:function(r){return y(this,()=>d(this,null,function*(){return yield r(this),this}))},click:function(){return y(this,()=>{for(var r=0;r<this.length;r++){let s=this[r];a.is.element(s)&&s.click()}return this})},focus:function(){return y(this,()=>{for(var r=0;r<this.length;r++){let s=this[r];a.is.element(s)&&s.focus()}return this})},addEvent:function(r){return y(this,()=>{let{eventType:s,eventID:o=v(),target:u,callback:l,options:h}=r;return h=x({passive:!0,capture:!1},h),this.for(c=>{if(!(a.is.element(c)||a.is.shadowRoot(c)))return;let{events:g}=c[a.expando];if(u){let C=l;l=m=>{if(m.target){if(a.is.string(u)){let S=m.target.closest(u);S&&(!S||C.call(S,m))}else if(a.is.elements(u)){for(let T of u)if(m.target==T)return C.call(T,m)}}}}if(g[o]){let C=g[o];c.removeEventListener(C.eventType,C.callback,C.options)}g[o]={eventType:s,callback:l,options:h},c.addEventListener(s,l,h)}),this})},removeEvent:function(r){return y(this,()=>{let s=a.is.array(r)?r:[r];return this.for(o=>{let{events:u}=o[a.expando];for(let l of s){let h=u[l];h&&o.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(r){return y(this,()=>R(this,n(r,t(this))))},empty:function(){return y(this,()=>R(this,t(this)))},append:function(r){return y(this,()=>{n(r,this)})},remove:function(){return y(this,()=>(this.for((r,s)=>{r&&a.is.element(r)&&(r.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...r){return y(this,()=>R(this,i(this,"before",...r)))},after:function(...r){return y(this,()=>R(this,i(this,"after",...r)))},find:function(r){return y(this,()=>{let s=[],o=this[0];o||R(this,a()),(a.is.element(o)||a.is.shadowRoot(o))&&(a.is.string(r)?s=o.querySelectorAll(r):a.is.element(o)&&a(r).for(u=>{let l=o.childNodes;for(let h of l)if(h===u){s.push(h);break}else h.childNodes.length&&(s=[...s,...a(h).find(u).for(c=>c)])})),R(this,a(s))})},parent:function(r){return y(this,()=>{var o,u;let s=a(r?(o=this[0])==null?void 0:o.closest(r):(u=this[0])==null?void 0:u.parentNode);R(this,s)})},children:function(r){return y(this,()=>{let s=this[0].children;a.is.exist(r)&&(r=String(r).replace(/^ : /,""),s=r=="first"?s[0]:r=="last"?s[s.length-1]:s[Number(r)]);let o=a(s);return R(this,o)})},addClass:function(r){return y(this,()=>(r&&this.for(s=>{let o=a.is.string(r)?r.split(" "):r;s&&a.is.element(s)&&s.classList.add(...o)}),this))},removeClass:function(r){return y(this,()=>(r&&this.for(s=>{let o=a.is.string(r)?r.split(" "):r;s&&a.is.element(s)&&s.classList.remove(...o)}),this))},toggleClass:function(r){return y(this,()=>(r&&this.for(s=>{s.classList.toggle(r)}),this))},hasClass:function(r=""){if(this[0])return this[0].classList.contains(r.replace(/^\./,""))},findClass:function(r){let s=[];return this[0]&&(s=[...this[0].classList].filter(o=>o.match(r))),s},css:function(r){return y(this,()=>(this.for(s=>{if(a.is.element(s))for(let[o,u]of Object.entries(r)){if(a.is.number(u)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[o]=u+"px";continue}s.style[o]=String(u)}}),this))},getAttribute:function(r){return this[0].getAttribute(String(r))},setAttribute:function(r,s){return y(this,()=>(this.for(o=>o.setAttribute(r,s)),this))},getStyleProperty:function(r){let s=this[0];return s&&a.is.element(s)?getComputedStyle(s).getPropertyValue(r):""},setStyleProperty:function(r,s){let o=this[0];return o&&a.is.element(o)&&o.style.setProperty(r,s),this},val:function(){var s;let r=this[0];return(r==null?void 0:r.value)||((s=r==null?void 0:r.dataset)==null?void 0:s.value)},position:function(){return a.is.element(this[0])?this[0].getBoundingClientRect():{}}})}a.flatArray=(e,t)=>{if(!a.is.array(e))return[e];let n=[];for(let i of e)n.push(...t=="-R"?a.flatArray(i,"-R"):[i]);return n};a.Stringify=e=>JSON.stringify(e);a.Objectify=(e,t)=>{try{return JSON.parse(e)}catch(n){return t!=null?t:null}};a.randomNumber=(e=0,t=100,n)=>{if(e>t)return NaN;let i=[],r=e;for(;r<=t;){if(n&&n.length&&n.includes(r)){r++;continue}i.push(r),r++}let s=Math.round(Math.random()*(i.length-1))+0;return i[s]};a.try=e=>{try{return[e(),!0]}catch(t){return[t,!1]}};a.trySync=e=>d(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});a.scope=e=>e();a.scopeSync=e=>d(void 0,null,function*(){return yield e()});a.createElement=function(e){var g;let{tag:t,className:n="",id:i,html:r,attr:s,style:o,parent:u}=e,l=document.createElement(t||"div");if(n&&l.classList.add(...n.split(" ")),i&&(l.id=i),s)for(let C of Object.entries(s)){let m=C[0],T=(g=C[1])!=null?g:"";if(m=="data"&&a.is.keyValueDictionary(T))for(let[S,E]of Object.entries(T))l.dataset[S]=E;else m=="for"?m="htmlFor":m=="tabindex"?m="tabIndex":m=="aria-label"&&(m="ariaLabel"),l[m]=T}if(r&&a(l).append(r),o)for(var[h,c]of Object.entries(o))l.style[h]=c;return u&&a(u).append(l),l};a.setCookie=e=>{let{hostname:t}=new URL(location.toString()),{name:n,value:i="",age:r=60*60*24*365,path:s="/",domain:o=t,secure:u=!1}=e,l=`${n}=${i}max-age=${r}path=${s}domain=${o}`;u&&(l+=" Secure"),document.cookie=l};a.getCookie=e=>{let t=document.cookie.match(new RegExp(e+"=[^]*"));return t?t[0].replace(new RegExp(e+"="),""):""};a.localStrage={set:(e,t)=>{localStorage.setItem(e,a.Stringify(t))},get:e=>{let t=localStorage.getItem(e);return a.Objectify(t,t)}};a.deleteCookie=e=>{document.cookie=e+"=max-age=0"};a.getScreenSize=()=>{let{innerHeight:e,innerWidth:t,scrollY:n,scrollX:i,pageXOffset:r,pageYOffset:s}=window,o=Number(a(document.body).getStyleProperty("--sat").removeLetters()),u=Number(a(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:t,pageHeight:e-o-u,scrollY:n,scrollX:i,pageXOffset:r,pageYOffset:s,safeAreaTop:o,safeAreaBottom:u}};a.getCursor=e=>{var i,r,s,o,u,l,h,c;let t=(o=e.pageX)!=null?o:(s=(i=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:i.pageX)!=null?s:(((r=e==null?void 0:e.originalEvent)==null?void 0:r.touches)||[])[0].pageX,n=(c=e.pageY)!=null?c:(h=(u=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:u.pageY)!=null?h:(((l=e==null?void 0:e.originalEvent)==null?void 0:l.touches)||[])[0].pageY;return{x:t,y:n}};a.pending=(e,t)=>new Promise((n,i)=>{e(n),setTimeout(()=>{n(!0)},t)});a.deepMerge=(e,...t)=>{if(!t.length)return e;let n=t.shift();if(a.is.keyValueDictionary(e)&&a.is.keyValueDictionary(n))for(let i in n)a.is.keyValueDictionary(n[i])?(e[i]||Object.assign(e,{[i]:{}}),a.deepMerge(e[i],n[i])):Object.assign(e,{[i]:n[i]});return a.deepMerge(e,...t)};a.queryParams={get:e=>{let t=new URL(e||location.href),n={};return t.searchParams.forEach((i,r)=>n[r]=i),n},set:(e,t)=>{let n=new URL(t||location.href);return Object.entries(e).forEach(([i,r])=>{n.searchParams.set(i,String(r))}),t||history.replaceState({},"",n.pathname+n.search),n.toString()},delete:(e,t)=>{let n=new URL(t||location.href);return e.forEach(i=>{n.searchParams.delete(i)}),t||history.replaceState({},"",n.pathname+n.search),n.toString()}};a.ellipsisText=(e,t)=>{let n=String(e);return n.length>t&&(n=n.slice(0,t)+" ..."),n};a.is={equal:function(e,t,n){return n==null||n?a.Stringify(e)===a.Stringify(t):e===t},what:function(e){let t="other";return this.jmini(e)?t="jmini":this.element(e)?t="element":this.elements(e)?t="elements":this.shadowRoot(e)?t="shadowRoot":this.string(e)?t="string":this.number(e)?t="number":this.array(e)?t="array":this.function(e)?t="function":this.date(e)?t="date":typeof e=="undefined"?t="undefined":this.keyValueDictionary(e)?t="keyValueDictionary":e==null?t="null":isNaN(e)&&(t="NaN"),t},exist:function(e){return e===(e!=null?e:!e)},nullish:function(e){return!this.exist(e)},jmini:function(e){return(e||{}).constructor===a},string:function(e){return typeof e=="string"},boolean:function(e){return typeof e=="boolean"},number:function(e){return!isNaN(e)&&typeof e=="number"},array:function(e){let t={}.toString.call(e);return e instanceof Array||t=="[object NodeList]"||t=="[object HTMLCollection]"},function:function(e){return typeof e=="function"},keyValueDictionary:function(e){return{}.toString.call(e)==="[object Object]"&&!this.jmini(e)},element:function(e){return e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e))},elements:function(e){let t={}.toString.call(e),n=Number(!!e&&typeof e!="string"&&this.array(e)&&t!=="[object Text]");if(n&&t!=="[object NodeList]")for(var i of e)n&=Number(this.element(i));return!!n},shadowRoot:function(e){return e instanceof ShadowRoot},date:function(e){return this.number(new Date(e).getTime())}};var ie=e=>new f.prototype.Time(e),f=ie;f.prototype={};var se=function(e){f.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0&&(e=new Date));let t=new Date(e);return this.set(t)};a.extend({value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,constructor:f,Time:se,clone:function(){return f(this)},set:function(e){this.value=e;let t=a.is.date(e);if(this.validate=t,!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;this.ms=e.getTime(),this.weekday=e.getDay(),this.year=e.getFullYear(),this.month=e.getMonth()+1,this.date=e.getDate();{let n=new Date(this.year,0,1),i=new Date(n.valueOf());i.setDate(i.getDate()-(n.getDay()+1));let r=e.getTime()-i.getTime(),s=Math.ceil(r/(1e3*60*60*24));this.weekInYear=Math.ceil(s/7)}{let n=new Date(this.year,this.month-1,1),i=new Date(n.valueOf());i.setDate(i.getDate()-(n.getDay()+1));let r=e.getTime()-i.getTime(),s=Math.ceil(r/(1e3*60*60*24)),o=Math.ceil(s/7);this.weekInMonth=o}{let n=new Date(this.year,this.month,0),i=n.getDay(),r=new Date(new Date(n).setDate(n.getDate()-i));this.isLastWeekInMonth=this.date>=r.getDate()}return this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this},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},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());return t.setMonth(e-1),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){return this.validate?e.replace(/\%y/ig,this.year.zeroEmbed(4)).replace(/\%m/ig,this.month.zeroEmbed(2)).replace(/\%d/ig,this.date.zeroEmbed(2)).replace(/\%w/ig,this.weekInYear.zeroEmbed(2)).replace(/\%h/ig,this.hours.zeroEmbed(2)).replace(/\%i/ig,this.minutes.zeroEmbed(2)).replace(/\%s/ig,this.seconds.zeroEmbed(2)):""},toFormatYMD:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D"):""},toFormatYM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708"):this.toFormat("%Y/%M"):""},toFormatMD:function(e){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):""},toFormatHM:function(e){return this.validate?e=="JP"?this.toFormat("%h\u6642%m\u5206"):this.toFormat("%h:%i"):""},toFormatYMDHM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206"):this.toFormat("%Y/%M/%D %h:%i"):""},toFormatYMDHMS:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2"):this.toFormat("%Y/%M/%D %h:%i:%s"):""},setFirstOfTheDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfTheDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},getFirstDayOfTheYear:function(){return f(new Date(this.value.getFullYear(),0,1))},getLastDayOfTheYear:function(){return f(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfTheMonth:function(){return f(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfTheMonth:function(){return f(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfTheWeek:function(){let e=f(this.value);return e.addDate(-e.weekday)},getLastDayOfTheWeek:function(){let e=f(this.value);return e.addDate(6-e.weekday)},diff:function(e){let t=this.ms-e.ms;return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:Math.floor(t/(60*60*24*1e3)),hours:Math.floor(t/(60*60*1e3)),minutes:Math.floor(t/(60*1e3)),seconds:Math.floor(t/1e3)}},getAge:function(e){let t=e||f(),n=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&n--,n}},f);f.isTimeObject=e=>{var t;return((t=e||{})==null?void 0:t.constructor)===f};f.getFromNumberYYYYMMDD=e=>{let t=String(e).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return f(t+" 00:00")};f.getPeriodArray=(e,t,n)=>{let i=[],r=t;if(!t.validate||!n.validate)return i;for(;r.toFormatYMDHMS().toNumber()<=n.toFormatYMDHMS().toNumber();)i.push(r),e=="year"?r=f(r).addYear(1):e=="month"?r=f(r).addMonth(1):e=="week"?r=f(r).addWeek(1):e=="day"?r=f(r).addDate(1):e=="hours"?r=f(r).addHours(1):e=="minutes"?r=f(r).addMinutes(1):e=="seconds"&&(r=f(r).addSeconds(1));return i};f.prototype.Time.prototype=f.prototype;var D={},P={set:(e,t)=>{let n=!0;return Object.entries(e).forEach(([i,r])=>{let s=D[i]||{};s&&s.privateKey&&s.privateKey!=t&&(n=!1),D[i]={privateKey:t,value:r}}),n},update:(e,t)=>{let n=!0;return Object.entries(e).forEach(([i,r])=>{var o;let s=D[i]||{};s&&s.privateKey&&s.privateKey!=t&&(n=!1),D[i]=A(x({},D[i]),{value:x(x({},(o=D[i])==null?void 0:o.value),r)})}),n},get:(e,t)=>{let n=D[e];if(!(n&&n.privateKey&&n.privateKey!=t))return n==null?void 0:n.value},delete:(e,t)=>{let n=D[e];return n&&n.privateKey&&n.privateKey!=t?!1:(delete D[e],!0)}};var ae=(...[e,t,n])=>new M.prototype.Cycle(e,t,n),M=ae;M.prototype={};var oe=function(...[e,t,n]){return this.fn=e,this.ms=t,this.key=n,M.abort(this.key),this.store(),this};a.extend({key:"",ms:0,timeoutIndex:-1,fn:null,Cycle:oe,store:function(){P.set({["Cycle_"+this.key]:this})},once:function(){return this.fn&&(this.timeoutIndex=setTimeout(this.fn,this.ms)),this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return M.abort(this.timeoutIndex),this},set_ms:function(e){return this.ms=e,this.store(),this},set_fn:function(e){return this.fn=e,this.store(),this}},M);M.abort=function(e){if(a.is.number(e))return clearInterval(e);let t=P.get("Cycle_"+e);t&&clearInterval(t.timeoutIndex)};M.get=function(e){return P.get("Cycle_"+e)};M.prototype.Cycle.prototype=M.prototype;var ue=(e,t)=>new p.prototype.Fetcher(e,t),p=ue;p.prototype={};p.waitList=[];p.setDefaultTrafficControl=0;p.setDefaultTimeout=1e3*60*10;p.isReadableStream=e=>e instanceof ReadableStream;p.isReadableStreamReader=e=>e instanceof ReadableStreamDefaultReader;p.streamToContext=(e,t)=>d(void 0,null,function*(){try{let n=(t==null?void 0:t.reader)||e.getReader();if(!p.isReadableStreamReader(n))return{ok:!1,done:!0,data:null};if(!n)return{ok:!1,done:!0,data:null};let i=(t==null?void 0:t.decoder)||new TextDecoder("utf-8"),r=yield n.read();return{ok:!0,done:r.done,data:i.decode(r.value)}}catch(n){return{ok:!1,done:!0,data:n}}});var le=function(e,t){var r;t=t||{};let n=t.body;t.body&&!a.is.string(t.body)&&((r=t.bodyStringify)==null||r)&&(n=a.Stringify(t.body||{}));let i=e;return a.is.string(e)&&!e.match(/https?:/)&&(i=location.origin+"/"+e.replace(/^\//,"")),this.url=i,this.method=t.method||"get",this.streamStatus="open",this.params=A(x({key:v(),response_format:"json",timeout:p.setDefaultTimeout,trafficControl:p.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:x(x({"Content-Type":"application/json"},p.setDefaultHeaders&&p.setDefaultHeaders()),t.headers),body:n}),this};a.extend({Fetcher:le,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:()=>{},onCompleteCB:()=>{},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(e){return this.onStartCB=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},onError:function(e){return this.onErrorCB=e,this},onStreamProcess:function(e){return d(this,null,function*(){let{response:t,errorCB:n,streamCB:i,reader:r,decoder:s}=e,o=t.body,u=this,l=function(){return V(this,null,function*(){if(!t.ok){a.scope(()=>d(this,null,function*(){let{ok:T,done:S,data:E}=yield p.streamToContext(o,{reader:r,decoder:s});T&&n(E)}));return}let m=!1;for(;!m;){let{ok:T,done:S,data:E}=yield new J(p.streamToContext(o,{reader:r,decoder:s}));u.streamStatus=="abort"?(u.streamStatus="closed",r.cancel(),S=!0):u.streamStatus=="closed"&&(S=!0),S&&(m=S,r.releaseLock()),i(E,S)}})};try{for(var h=$(l()),c,g,C;c=!(g=yield h.next()).done;c=!1){let m=g.value;;}}catch(g){C=[g]}finally{try{c&&(g=h.return)&&(yield g.call(h))}finally{if(C)throw C[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 d(this,null,function*(){var C;let e=this.params,t=performance.now(),n=0,i=new AbortController,r=setTimeout(()=>{i.abort()},e.timeout);e.signal=i.signal;let s=!1,o=500,u="InternalServerError",l={},h=null;try{p.setDefaultOnStart&&p.setDefaultOnStart(e),this.onStartCB&&this.onStartCB(e);let g=e,{key:m,response_format:T,trafficControl:S,preventMultiRequest:E,timeout:de,queries:K}=g,H=j(g,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);H.method=this.method;let q=p.waitList.includes(m);if(E&&q)throw o=429,new Error("TooManyRequests");p.waitList=[...p.waitList,m];let _=a.queryParams.set(x({},K),String(this.url));l=yield fetch(_,H).then(w=>d(this,null,function*(){return s=w.ok,o=w.status,u=w.statusText,h=w,T=="none"||T=="stream"?w:w[T]()})).catch(w=>{throw new Error(w)})}catch(m){o==200&&(o=500,s=!1),o==429&&(u="TooManyRequests"),i.signal.aborted&&(o=408,u="Timeout"),o==500&&(u=String(m)||u),l={errorCode:String(m)}}finally{clearTimeout(r),n=performance.now()-t}e.trafficControl&&(yield a.pending(()=>{},e.trafficControl)),p.waitList.splice(p.waitList.findIndex(m=>m==e.key),1);let c={ok:s,status:o,statusText:u,body:l,requestTime:n,rawData:h};if(!s&&this.onErrorCB&&this.onErrorCB(c.body),s&&this.onStreamCB&&e.response_format=="stream"){let m=(C=h.body)==null?void 0:C.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:c,reader:m,decoder:new TextDecoder("utf-8")})}return s&&this.onCompleteCB&&this.onCompleteCB(c.body),this.onResultCB&&this.onResultCB(c,e),p.setDefaultOnEnd&&p.setDefaultOnEnd(c,e),c})},abortStream:function(){this.streamStatus="abort"}},p);p.prototype.Fetcher.prototype=p.prototype;var he=e=>new b.prototype.Filer(e),b=he;b.prototype={};var me=function(e){this.ok=!0;try{let[t,n]=e.name.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" ");this.file=e,this.extension=n,this.fileName=t,this.type=e.type}catch(t){console.log(t),this.ok=!1}return this};a.extend({ok:!1,extension:"",type:"",file:{},fileName:"",Filer:me,isValid:function(){return this.ok},toBlob:function(){return d(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return d(this,null,function*(){var t;return(t=(yield this.file.convert("dataURL")).target)==null?void 0:t.result})},toAarrayBuffer:function(){return d(this,null,function*(){var t;return(t=(yield this.file.convert("arrayBuffer")).target)==null?void 0:t.result})},toObjectURL:function(){return d(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}},b);b.fromFile=e=>d(void 0,null,function*(){return b(e)});b.fromBlob=(e,t)=>d(void 0,null,function*(){let n=(t==null?void 0:t.fileName)||"file",i=(t==null?void 0:t.extension)||"",r=new File([e],n+"."+i,{type:t==null?void 0:t.mimeType});return b(r)});b.fromArrayBuffer=(e,t)=>d(void 0,null,function*(){return b.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t)});b.fromObjectURL=(e,t)=>d(void 0,null,function*(){let n=yield p(e,{response_format:"blob"}).get();return n.ok?b.fromBlob(n.body,t):b({})});b.fromDataURL=(e,t)=>d(void 0,null,function*(){let n=yield e.toBlob((t==null?void 0:t.mimeType)||"");return n?b.fromBlob(n,t):b({})});b.prototype.Filer.prototype=b.prototype;var ce=function(e){let t=e,n=null;return t.use((i,r,s)=>{let o=r;o.return=u=>{let{status:l=200,body:h={},bodyStringify:c=!0}=u||{},g=h;return c&&!a.is.string(h)&&(g=a.Stringify(h)),r.status(l).end(g)},s()}),t.onPathRouter=function(i){return n=i,this},t.pathRouter=function(i){if(!n)return;let r=n(i);return r.route(i),t.use(i,r),r},t.exception=function(i){return t.use(i),this},t},L=ce;L.getLocalIP=e=>{let t="";return a.scope(()=>{if(!e)return;let n=e.networkInterfaces();for(let[i,r]of Object.entries(n))r.forEach(s=>{!s.internal&&s.family==="IPv4"&&!s.address.match(/^(169|127)/)&&(t=s.address)})}),t};L.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"};a.copyToClipboard=e=>d(void 0,null,function*(){let t="";a.is.string(e)?t=e:a.is.function(e)&&(t=e());let n={ok:!1,body:"NotSupported"};return yield d(void 0,null,function*(){let i;if(navigator.clipboard){if(i=yield navigator.clipboard.writeText(t).then(()=>!0,()=>!1),!i)return}else{let r=document.createElement("input");if(a(document.body).append(r),r.value=t,r.select(),i=document.execCommand("copy"),document.body.removeChild(r),!i)return}n={ok:!0,body:""}}),n});a.ImageLoader=(e,t)=>new Promise((n,i)=>{let r=t||new Image;r.onload=()=>n(r),r.onerror=s=>i(s),r.src=e});a.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}}};a.transformer={weekday:{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=[],n=[],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(s=>{let{From:o,To:u,name:l}=s;if(o<=e&&e<=u){let h=e-o+1;h==1&&(i=!0,h="\u5143"),n.push(l+h+"\u5E74"),t.push(l)}}),{era:t,value:n,gap:i}}};a.cycle=M;p.setDefaultHeaders=()=>({});var fe=a;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
1
+ "use strict";var F=Object.defineProperty,W=Object.defineProperties,z=Object.getOwnPropertyDescriptor,X=Object.getOwnPropertyDescriptors,G=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var B=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e);var P=Math.pow,Y=(e,t,n)=>t in e?F(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,S=(e,t)=>{for(var n in t||(t={}))O.call(t,n)&&Y(e,n,t[n]);if(k)for(var n of k(t))U.call(t,n)&&Y(e,n,t[n]);return e},A=(e,t)=>W(e,X(t));var j=(e,t)=>{var n={};for(var i in e)O.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&k)for(var i of k(e))t.indexOf(i)<0&&U.call(e,i)&&(n[i]=e[i]);return n};var Q=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},Z=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of G(t))!O.call(e,r)&&r!==n&&F(e,r,{get:()=>t[r],enumerable:!(i=z(t,r))||i.enumerable});return e};var ee=e=>Z(F({},"__esModule",{value:!0}),e);var d=(e,t,n)=>new Promise((i,r)=>{var s=l=>{try{u(n.next(l))}catch(h){r(h)}},o=l=>{try{u(n.throw(l))}catch(h){r(h)}},u=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);u((n=n.apply(e,t)).next())}),J=function(e,t){this[0]=e,this[1]=t},V=(e,t,n)=>{var i=(o,u,l,h)=>{try{var f=n[o](u),g=(u=f.value)instanceof J,C=f.done;Promise.resolve(g?u[0]:u).then(m=>g?i(o==="return"?o:"next",u[1]?{done:m.done,value:m.value}:m,l,h):l({value:m,done:C})).catch(m=>i("throw",m,l,h))}catch(m){h(m)}},r=o=>s[o]=u=>new Promise((l,h)=>i(o,u,l,h)),s={};return n=n.apply(e,t),s[B("asyncIterator")]=()=>s,r("next"),r("throw"),r("return"),s};var $=(e,t,n)=>(t=e[B("asyncIterator")])?t.call(e):(e=e[B("iterator")](),t={},n=(i,r)=>(r=e[i])&&(t[i]=s=>new Promise((o,u,l)=>(s=r.call(e,s),l=s.done,Promise.resolve(s.value).then(h=>o({value:h,done:l}),u)))),n("next"),n("return"),t);var pe={};Q(pe,{Fetcher:()=>p,Filer:()=>b,Server:()=>L,Time:()=>c,UUID:()=>M,default:()=>ce,useStore:()=>E});module.exports=ee(pe);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,t){return this.slice(0,e)+t+this.slice(e+t.length)},String.prototype.toBlob=function(e){let t=atob(this.replace(/^.*,/,"")),n=new Uint8Array(t.length);for(var i=0;i<t.length;i++)n[i]=t.charCodeAt(i);try{var r=new Blob([n.buffer],{type:e})}catch(s){return!1}return r},String.prototype.toNumber=function(){return Number(this.removeLetters())},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(/+/,"+")});typeof Number!="undefined"&&(Number.prototype.zeroEmbed=function(e){return String(this).padStart(e||2,"0")},Number.prototype.ratio=function(e,t=2){let n=P(10,t);return Math.round(this/e*n*100)/n},Number.prototype.rate=function(e,t=2){let n=P(10,t);return Math.round(this/e*n)/n},Number.prototype.rank=function(e=1){let t=P(10,e),n=Number(this),i=n.toLocaleString().replace(/\d/ig,"").length;return Math.round(n/P(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),n=t.slice(0,4),i=t.slice(4,6),r=t.slice(6,8),s=[];return n.length!=4||s.push(n),i.length!=2||s.push(i),r.length!=2||s.push(r),s.join(e)});if(typeof Array!="undefined"){let e=(t,n)=>{if(!t)return;let i=t;for(let r of n){if(!i)break;i=i[r]}return i};Array.prototype.order=function(t){let{direction:n="ASC",keys:i=[],numeral:r=!1}=t,s=[];return i.length?r?s=this.sort((o,u)=>+(Number(e(o,i))>Number(e(u,i)))*2-1):s=this.sort((o,u)=>{let l=String(e(o,i)).replace(/(\d+)/g,f=>f.padStart(18,"0")),h=String(e(u,i)).replace(/(\d+)/g,f=>f.padStart(18,"0"));return+(l>h)*2-1}):r?s=this.sort((o,u)=>+(o>u)*2-1):s=this.sort((o,u)=>{let l=String(o).replace(/(\d+)/g,f=>f.padStart(18,"0")),h=String(u).replace(/(\d+)/g,f=>f.padStart(18,"0"));return+(l>h)*2-1}),n=="DESC"&&(s=s.reverse()),s},Array.prototype.getLastChild=function(){let t=this.length-1;return this[t]}}typeof File!="undefined"&&(File.prototype.convert=function(e){return e=e||"dataURL",new Promise((t,n)=>{let i=new FileReader;i.onload=s=>t(s),i.onerror=s=>n(s);let r="readAs"+(e==null?void 0:e.toCapital());i[r](this)})});var te=(e=24)=>Array.from({length:e}).map((t,n)=>{let i=n==0?25:35,r=Math.round(Math.random());return"abcdefghijkrmnopqrstuvwxyz0123456789"[Math.round(Math.random()*i)][r?"toUpper":"toLower"]()}).join(""),M=te;M.gen128Binary=()=>Array.from({length:128}).map((e,t)=>"01"[Math.round(Math.random()*1)]).join("");M.gen32Hex=(e="Formatted",t="-")=>{let n=Array.from({length:32}).map((i,r)=>"0123456789abcdef"[Math.round(Math.random()*15)]).join("").toUpper();return e=="Formatted"&&(n=[n.slice(0,8),n.slice(8,12),n.slice(12,16),n.slice(16,20),n.slice(20,32)].join(t)),n};M.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 re=e=>new a.prototype.jmini(e),a=re;a.prototype={};a.extend=function(e,t=a){for(var[n,i]of Object.entries(e))t.prototype[n]=i};a.expando="__jmini_"+M();var y=(e,t)=>(e.queue.push(t),N(e),e),N=e=>d(void 0,null,function*(){if(!e.queueProcess&&e.queue.length){e.queueProcess=!0;let t=e.queue.shift();t&&(yield t()),e.queueProcess=!1,N(e)}}),I=(e,t)=>{for(let n=0;n<e.length;n++)e[n]=null;for(let[n,i]of Object.entries(t))n.match(/queue/)||(e[n]=i);return e},ne=(e,t)=>{if(t.length){for(var n=0;n<t.length;n++){let i=t[n];i&&(i[a.expando]||(a.is.element(i)||a.is.shadowRoot(i))&&(i[a.expando]={events:{}})),e[n]=i}e.length=t.length}else e.warn="No Argument(s).",e.length=0;return e.queueProcess=!1,N(e),e};a.extend({constructor:a,jmini:function(e){return this.src=e,this.srcType=a.is.what(e),this.queueProcess=!0,this.queue=[],ne(this,a.is.jmini(e)?e.get():a.is.element(e)?[e]:a.is.elements(e)?e:a.is.shadowRoot(e)?[e]:a.is.string(e)?e.match(/^#[^\.\s]*$/)?[document.getElementById(e.replace(/#/,""))]:document.querySelectorAll(e):[])}});a.prototype[String(Symbol.iterator)]=[][Symbol.iterator];a.prototype.jmini.prototype=a.prototype;{let e=function(r,s,o){let u=[];for(let l=0;l<(r.length||0);l++)u.push(s(r[l],l));return o&&(u=u.filter(l=>l!=null)),u},t=r=>(r.for((s,o)=>{if(!(a.is.element(s)||a.is.shadowRoot(s)))return;let u=s.cloneNode(),l=s.parentNode;l&&l.replaceChild(u,s),r[o]=u}),r),n=(r,s)=>(a(s).for(o=>{if(r&&(a.is.element(o)||a.is.shadowRoot(o)))if(a.is.string(r)||a.is.number(r))r=String(r),o.insertAdjacentHTML("beforeend",String(r));else if(a.is.element(r))o.appendChild(r);else{a.is.jmini(r)?r=r.get():a.is.element(r)?r=[r]:a.is.keyValueDictionary(r)&&(r=[a(r)]);for(var u=0;u<r.length;u++)n(r[u],o)}}),s),i=(r,s,...o)=>{let{p:u,s:l}={before:{p:"beforebegin",s:""},after:{p:"afterend",s:"nextSibling"}}[s]||{p:"",s:""};return r.for(h=>{if(a.is.string(o[0]))h.insertAdjacentHTML(u,o[0]);else{if(!h.parentNode)return;a(o[0]).for(g=>{o[1]&&(g=g.cloneNode(!0)),h.parentNode.insertBefore(g,h[l]||h)})}}),r};a.extend({get:function(r){return r?this[0]:e(this,s=>s)},for:function(r,s=1){let o=e(this,(u,l)=>r(u,l),1);return s?o:[]},await:function(r){return y(this,()=>new Promise((s,o)=>{setTimeout(()=>{s(this)},r)}))},abort:function(){return y(this,()=>d(this,null,function*(){return this.queue=[],this}))},callback:function(r){return y(this,()=>d(this,null,function*(){return yield r(this),this}))},click:function(){return y(this,()=>{for(var r=0;r<this.length;r++){let s=this[r];a.is.element(s)&&s.click()}return this})},focus:function(){return y(this,()=>{for(var r=0;r<this.length;r++){let s=this[r];a.is.element(s)&&s.focus()}return this})},addEvent:function(r){return y(this,()=>{let{eventType:s,eventID:o=M(),target:u,callback:l,options:h}=r;return h=S({passive:!0,capture:!1},h),this.for(f=>{if(!(a.is.element(f)||a.is.shadowRoot(f)))return;let{events:g}=f[a.expando];if(u){let C=l;l=m=>{if(m.target){if(a.is.string(u)){let v=m.target.closest(u);v&&(!v||C.call(v,m))}else if(a.is.elements(u)){for(let T of u)if(m.target==T)return C.call(T,m)}}}}if(g[o]){let C=g[o];f.removeEventListener(C.eventType,C.callback,C.options)}g[o]={eventType:s,callback:l,options:h},f.addEventListener(s,l,h)}),this})},removeEvent:function(r){return y(this,()=>{let s=a.is.array(r)?r:[r];return this.for(o=>{let{events:u}=o[a.expando];for(let l of s){let h=u[l];h&&o.removeEventListener(h.eventType,h.callback,h.options)}}),this})},html:function(r){return y(this,()=>I(this,n(r,t(this))))},empty:function(){return y(this,()=>I(this,t(this)))},append:function(r){return y(this,()=>{n(r,this)})},remove:function(){return y(this,()=>(this.for((r,s)=>{r&&a.is.element(r)&&(r.remove(),delete this[s])}),this.length=0,this.warn="Object(s?) were all removed.",this))},before:function(...r){return y(this,()=>I(this,i(this,"before",...r)))},after:function(...r){return y(this,()=>I(this,i(this,"after",...r)))},find:function(r){return y(this,()=>{let s=[],o=this[0];o||I(this,a()),(a.is.element(o)||a.is.shadowRoot(o))&&(a.is.string(r)?s=o.querySelectorAll(r):a.is.element(o)&&a(r).for(u=>{let l=o.childNodes;for(let h of l)if(h===u){s.push(h);break}else h.childNodes.length&&(s=[...s,...a(h).find(u).for(f=>f)])})),I(this,a(s))})},parent:function(r){return y(this,()=>{var o,u;let s=a(r?(o=this[0])==null?void 0:o.closest(r):(u=this[0])==null?void 0:u.parentNode);I(this,s)})},children:function(r){return y(this,()=>{let s=this[0].children;a.is.exist(r)&&(r=String(r).replace(/^ : /,""),s=r=="first"?s[0]:r=="last"?s[s.length-1]:s[Number(r)]);let o=a(s);return I(this,o)})},addClass:function(r){return y(this,()=>(r&&this.for(s=>{let o=a.is.string(r)?r.split(" "):r;s&&a.is.element(s)&&s.classList.add(...o)}),this))},removeClass:function(r){return y(this,()=>(r&&this.for(s=>{let o=a.is.string(r)?r.split(" "):r;s&&a.is.element(s)&&s.classList.remove(...o)}),this))},toggleClass:function(r){return y(this,()=>(r&&this.for(s=>{s.classList.toggle(r)}),this))},hasClass:function(r=""){if(this[0])return this[0].classList.contains(r.replace(/^\./,""))},findClass:function(r){let s=[];return this[0]&&(s=[...this[0].classList].filter(o=>o.match(r))),s},css:function(r){return y(this,()=>(this.for(s=>{if(a.is.element(s))for(let[o,u]of Object.entries(r)){if(a.is.number(u)&&o.match(/width|height|top|right|bottom|left|padding|margin|gap|border-.*radius/)){s.style[o]=u+"px";continue}s.style[o]=String(u)}}),this))},getAttribute:function(r){return this[0].getAttribute(String(r))},setAttribute:function(r,s){return y(this,()=>(this.for(o=>o.setAttribute(r,s)),this))},getStyleProperty:function(r){let s=this[0];return s&&a.is.element(s)?getComputedStyle(s).getPropertyValue(r):""},setStyleProperty:function(r,s){let o=this[0];return o&&a.is.element(o)&&o.style.setProperty(r,s),this},val:function(){var s;let r=this[0];return(r==null?void 0:r.value)||((s=r==null?void 0:r.dataset)==null?void 0:s.value)},position:function(){return a.is.element(this[0])?this[0].getBoundingClientRect():{}}})}a.flatArray=(e,t)=>{if(!a.is.array(e))return[e];let n=[];for(let i of e)n.push(...t=="-R"?a.flatArray(i,"-R"):[i]);return n};a.Stringify=e=>JSON.stringify(e);a.Objectify=(e,t)=>{try{return JSON.parse(e)}catch(n){return t!=null?t:null}};a.randomNumber=(e=0,t=100,n)=>{if(e>t)return NaN;let i=[],r=e;for(;r<=t;){if(n&&n.length&&n.includes(r)){r++;continue}i.push(r),r++}let s=Math.round(Math.random()*(i.length-1))+0;return i[s]};a.try=e=>{try{return[e(),!0]}catch(t){return[t,!1]}};a.trySync=e=>d(void 0,null,function*(){try{return[yield e(),!0]}catch(t){return[t,!1]}});a.scope=e=>e();a.scopeSync=e=>d(void 0,null,function*(){return yield e()});a.createElement=function(e){var g;let{tag:t,className:n="",id:i,html:r,attr:s,style:o,parent:u}=e,l=document.createElement(t||"div");if(n&&l.classList.add(...n.split(" ")),i&&(l.id=i),s)for(let C of Object.entries(s)){let m=C[0],T=(g=C[1])!=null?g:"";if(m=="data"&&a.is.keyValueDictionary(T))for(let[v,R]of Object.entries(T))l.dataset[v]=R;else m=="for"?m="htmlFor":m=="tabindex"?m="tabIndex":m=="aria-label"&&(m="ariaLabel"),l[m]=T}if(r&&a(l).append(r),o)for(var[h,f]of Object.entries(o))l.style[h]=f;return u&&a(u).append(l),l};a.setCookie=e=>{let{hostname:t}=new URL(location.toString()),{name:n,value:i="",age:r=60*60*24*365,path:s="/",domain:o=t,secure:u=!1}=e,l=`${n}=${i}max-age=${r}path=${s}domain=${o}`;u&&(l+=" Secure"),document.cookie=l};a.getCookie=e=>{let t=document.cookie.match(new RegExp(e+"=[^]*"));return t?t[0].replace(new RegExp(e+"="),""):""};a.localStrage={set:(e,t)=>{localStorage.setItem(e,a.Stringify(t))},get:e=>{let t=localStorage.getItem(e);return a.Objectify(t,t)}};a.deleteCookie=e=>{document.cookie=e+"=max-age=0"};a.getScreenSize=()=>{let{innerHeight:e,innerWidth:t,scrollY:n,scrollX:i,pageXOffset:r,pageYOffset:s}=window,o=Number(a(document.body).getStyleProperty("--sat").removeLetters()),u=Number(a(document.body).getStyleProperty("--sab").removeLetters());return{height:e,width:t,pageHeight:e-o-u,scrollY:n,scrollX:i,pageXOffset:r,pageYOffset:s,safeAreaTop:o,safeAreaBottom:u}};a.getCursor=e=>{var i,r,s,o,u,l,h,f;let t=(o=e.pageX)!=null?o:(s=(i=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:i.pageX)!=null?s:(((r=e==null?void 0:e.originalEvent)==null?void 0:r.touches)||[])[0].pageX,n=(f=e.pageY)!=null?f:(h=(u=((e==null?void 0:e.changedTouches)||[])[0])==null?void 0:u.pageY)!=null?h:(((l=e==null?void 0:e.originalEvent)==null?void 0:l.touches)||[])[0].pageY;return{x:t,y:n}};a.pending=(e,t)=>new Promise((n,i)=>{e(n),setTimeout(()=>{n(!0)},t)});a.deepMerge=(e,...t)=>{if(!t.length)return e;let n=t.shift();if(a.is.keyValueDictionary(e)&&a.is.keyValueDictionary(n))for(let i in n)a.is.keyValueDictionary(n[i])?(e[i]||Object.assign(e,{[i]:{}}),a.deepMerge(e[i],n[i])):Object.assign(e,{[i]:n[i]});return a.deepMerge(e,...t)};a.queryParams={get:e=>{let t=new URL(e||location.href),n={};return t.searchParams.forEach((i,r)=>n[r]=i),n},set:(e,t)=>{let n=new URL(t||location.href);return Object.entries(e).forEach(([i,r])=>{n.searchParams.set(i,String(r))}),t||history.replaceState({},"",n.pathname+n.search),n.toString()},delete:(e,t)=>{let n=new URL(t||location.href);return e.forEach(i=>{n.searchParams.delete(i)}),t||history.replaceState({},"",n.pathname+n.search),n.toString()}};a.ellipsisText=(e,t)=>{let n=String(e);return n.length>t&&(n=n.slice(0,t)+" ..."),n};a.is={equal:function(e,t,n){return n==null||n?a.Stringify(e)===a.Stringify(t):e===t},what:function(e){let t="other";return this.jmini(e)?t="jmini":this.element(e)?t="element":this.elements(e)?t="elements":this.shadowRoot(e)?t="shadowRoot":this.string(e)?t="string":this.number(e)?t="number":this.array(e)?t="array":this.function(e)?t="function":this.date(e)?t="date":typeof e=="undefined"?t="undefined":this.keyValueDictionary(e)?t="keyValueDictionary":e==null?t="null":isNaN(e)&&(t="NaN"),t},exist:function(e){return e===(e!=null?e:!e)},nullish:function(e){return!this.exist(e)},jmini:function(e){return(e||{}).constructor===a},string:function(e){return typeof e=="string"},boolean:function(e){return typeof e=="boolean"},number:function(e){return!isNaN(e)&&typeof e=="number"},array:function(e){let t={}.toString.call(e);return e instanceof Array||t=="[object NodeList]"||t=="[object HTMLCollection]"},function:function(e){return typeof e=="function"},keyValueDictionary:function(e){return{}.toString.call(e)==="[object Object]"&&!this.jmini(e)},element:function(e){return e&&(e.nodeType==1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"||[window,document].includes(e))},elements:function(e){let t={}.toString.call(e),n=Number(!!e&&typeof e!="string"&&this.array(e)&&t!=="[object Text]");if(n&&t!=="[object NodeList]")for(var i of e)n&=Number(this.element(i));return!!n},shadowRoot:function(e){return e instanceof ShadowRoot},date:function(e){return this.number(new Date(e).getTime())}};var ie=e=>new c.prototype.Time(e),c=ie;c.prototype={};var se=function(e){c.isTimeObject(e)&&(e=e.value),e||(e===null?e=void 0:e===void 0&&(e=new Date));let t=new Date(e);return this.set(t)};a.extend({value:new Date,validate:!1,ms:-1,weekday:-1,weekInMonth:-1,weekInYear:-1,isLastWeekInMonth:!1,year:-1,month:-1,date:-1,hours:-1,minutes:-1,seconds:-1,constructor:c,Time:se,clone:function(){return c(this)},set:function(e){this.value=e;let t=a.is.date(e);if(this.validate=t,!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;this.ms=e.getTime(),this.weekday=e.getDay(),this.year=e.getFullYear(),this.month=e.getMonth()+1,this.date=e.getDate();{let n=new Date(this.year,0,1),i=new Date(n.valueOf());i.setDate(i.getDate()-(n.getDay()+1));let r=e.getTime()-i.getTime(),s=Math.ceil(r/(1e3*60*60*24));this.weekInYear=Math.ceil(s/7)}{let n=new Date(this.year,this.month-1,1),i=new Date(n.valueOf());i.setDate(i.getDate()-(n.getDay()+1));let r=e.getTime()-i.getTime(),s=Math.ceil(r/(1e3*60*60*24)),o=Math.ceil(s/7);this.weekInMonth=o}{let n=new Date(this.year,this.month,0),i=n.getDay(),r=new Date(new Date(n).setDate(n.getDate()-i));this.isLastWeekInMonth=this.date>=r.getDate()}return this.hours=e.getHours(),this.minutes=e.getMinutes(),this.seconds=e.getSeconds(),this},isSameYear:function(e){let t=c(e);return this.year==t.year},isSameMonth:function(e){let t=c(e);return this.year==t.year&&this.month==t.month},isSameWeek:function(e){let t=c(e);return this.year==t.year&&this.weekInYear==t.weekInYear},isSameDate:function(e){let t=c(e);return this.year==t.year&&this.month==t.month&&this.date==t.date},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());return t.setMonth(e-1),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){return this.validate?e.replace(/\%y/ig,this.year.zeroEmbed(4)).replace(/\%m/ig,this.month.zeroEmbed(2)).replace(/\%d/ig,this.date.zeroEmbed(2)).replace(/\%w/ig,this.weekInYear.zeroEmbed(2)).replace(/\%h/ig,this.hours.zeroEmbed(2)).replace(/\%i/ig,this.minutes.zeroEmbed(2)).replace(/\%s/ig,this.seconds.zeroEmbed(2)):""},toFormatYMD:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5"):this.toFormat("%Y/%M/%D"):""},toFormatYM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708"):this.toFormat("%Y/%M"):""},toFormatMD:function(e){return this.validate?e=="JP"?this.toFormat("%M\u6708%D\u65E5"):this.toFormat("%M/%D"):""},toFormatHM:function(e){return this.validate?e=="JP"?this.toFormat("%h\u6642%m\u5206"):this.toFormat("%h:%i"):""},toFormatYMDHM:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206"):this.toFormat("%Y/%M/%D %h:%i"):""},toFormatYMDHMS:function(e){return this.validate?e=="JP"?this.toFormat("%Y\u5E74%M\u6708%D\u65E5%h\u6642%m\u5206%s\u79D2"):this.toFormat("%Y/%M/%D %h:%i:%s"):""},setFirstOfTheDay:function(){let e=new Date(this.value.valueOf());return e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0),this.set(e)},setLastOfTheDay:function(){let e=new Date(this.value.valueOf());return e.setHours(23),e.setMinutes(59),e.setSeconds(59),e.setMilliseconds(999),this.set(e)},getFirstDayOfTheYear:function(){return c(new Date(this.value.getFullYear(),0,1))},getLastDayOfTheYear:function(){return c(new Date(this.value.getFullYear()+1,0,0))},getFirstDayOfTheMonth:function(){return c(new Date(this.value.getFullYear(),this.month-1,1))},getLastDayOfTheMonth:function(){return c(new Date(this.value.getFullYear(),this.month,0))},getFirstDayOfTheWeek:function(){let e=c(this.value);return e.addDate(-e.weekday)},getLastDayOfTheWeek:function(){let e=c(this.value);return e.addDate(6-e.weekday)},diff:function(e){let t=this.ms-e.ms;return{years:this.year-e.year,months:(this.year-e.year)*12+(this.month-e.month),dates:Math.floor(t/(60*60*24*1e3)),hours:Math.floor(t/(60*60*1e3)),minutes:Math.floor(t/(60*1e3)),seconds:Math.floor(t/1e3)}},getAge:function(e){let t=e||c(),n=t.year-this.year;return(this.month>t.month||this.month==t.month&&t.date<this.date)&&n--,n}},c);c.isTimeObject=e=>{var t;return((t=e||{})==null?void 0:t.constructor)===c};c.getFromNumberYYYYMMDD=e=>{let t=String(e).replace(/(\d{4})(\d{2})(\d{2})/,"$1/$2/$3");return c(t+" 00:00")};c.getPeriodArray=(e,t,n)=>{let i=[],r=t;if(!t.validate||!n.validate)return i;for(;r.toFormatYMDHMS().toNumber()<=n.toFormatYMDHMS().toNumber();)i.push(r),e=="year"?r=c(r).addYear(1):e=="month"?r=c(r).addMonth(1):e=="week"?r=c(r).addWeek(1):e=="day"?r=c(r).addDate(1):e=="hours"?r=c(r).addHours(1):e=="minutes"?r=c(r).addMinutes(1):e=="seconds"&&(r=c(r).addSeconds(1));return i};c.prototype.Time.prototype=c.prototype;var D={},E={set:(e,t)=>{let n=!0;return Object.entries(e).forEach(([i,r])=>{let s=D[i]||{};s&&s.privateKey&&s.privateKey!=t&&(n=!1),D[i]={privateKey:t,value:r}}),n},update:(e,t)=>{let n=!0;return Object.entries(e).forEach(([i,r])=>{var o;let s=D[i]||{};s&&s.privateKey&&s.privateKey!=t&&(n=!1),D[i]=A(S({},D[i]),{value:S(S({},(o=D[i])==null?void 0:o.value),r)})}),n},get:(e,t)=>{let n=D[e];if(!(n&&n.privateKey&&n.privateKey!=t))return n==null?void 0:n.value},delete:(e,t)=>{let n=D[e];return n&&n.privateKey&&n.privateKey!=t?!1:(delete D[e],!0)}};var ae=(...[e,t,n])=>new x.prototype.Interval(e,t,n),x=ae;x.prototype={};var oe=function(...[e,t,n]){return this.fn=e,this.ms=t,this.key=n,x.abort(this.key),this.store(),this};a.extend({key:"",ms:0,timeoutIndex:-1,fn:null,Interval:oe,store:function(){E.set({["Interval_"+this.key]:this})},once:function(){return this.fn&&(this.timeoutIndex=setTimeout(this.fn,this.ms)),this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return x.abort(this.timeoutIndex),this},set_ms:function(e){return this.ms=e,this.store(),this},set_fn:function(e){return this.fn=e,this.store(),this}},x);x.abort=function(e){if(a.is.number(e))return clearInterval(e);let t=E.get("Interval_"+e);t&&clearInterval(t.timeoutIndex)};x.get=function(e){return E.get("Interval_"+e)};x.prototype.Interval.prototype=x.prototype;var ue=(e,t)=>new p.prototype.Fetcher(e,t),p=ue;p.prototype={};p.waitList=[];p.setDefaultTrafficControl=0;p.setDefaultTimeout=1e3*60*10;p.isReadableStream=e=>e instanceof ReadableStream;p.isReadableStreamReader=e=>e instanceof ReadableStreamDefaultReader;p.streamToContext=(e,t)=>d(void 0,null,function*(){try{let n=(t==null?void 0:t.reader)||e.getReader();if(!p.isReadableStreamReader(n))return{ok:!1,done:!0,data:null};if(!n)return{ok:!1,done:!0,data:null};let i=(t==null?void 0:t.decoder)||new TextDecoder("utf-8"),r=yield n.read();return{ok:!0,done:r.done,data:i.decode(r.value)}}catch(n){return{ok:!1,done:!0,data:n}}});var le=function(e,t){var r;t=t||{};let n=t.body;t.body&&!a.is.string(t.body)&&((r=t.bodyStringify)==null||r)&&(n=a.Stringify(t.body||{}));let i=e;return a.is.string(e)&&!e.match(/https?:/)&&(i=location.origin+"/"+e.replace(/^\//,"")),this.url=i,this.method=t.method||"get",this.streamStatus="open",this.params=A(S({key:M(),response_format:"json",timeout:p.setDefaultTimeout,trafficControl:p.setDefaultTrafficControl,preventMultiRequest:!0},t),{headers:S(S({"Content-Type":"application/json"},p.setDefaultHeaders&&p.setDefaultHeaders()),t.headers),body:n}),this};a.extend({Fetcher:le,params:{},url:"",method:"GET",streamStatus:"closed",onStartCB:()=>{},onCompleteCB:()=>{},onErrorCB:()=>{},onResultCB:()=>{},onStreamCB:()=>{},onStart:function(e){return this.onStartCB=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},onError:function(e){return this.onErrorCB=e,this},onStreamProcess:function(e){return d(this,null,function*(){let{response:t,errorCB:n,streamCB:i,reader:r,decoder:s}=e,o=t.body,u=this,l=function(){return V(this,null,function*(){if(!t.ok){a.scope(()=>d(this,null,function*(){let{ok:T,done:v,data:R}=yield p.streamToContext(o,{reader:r,decoder:s});T&&n(R)}));return}let m=!1;for(;!m;){let{ok:T,done:v,data:R}=yield new J(p.streamToContext(o,{reader:r,decoder:s}));u.streamStatus=="abort"?(u.streamStatus="closed",r.cancel(),v=!0):u.streamStatus=="closed"&&(v=!0),v&&(m=v,r.releaseLock()),i(R,v)}})};try{for(var h=$(l()),f,g,C;f=!(g=yield h.next()).done;f=!1){let m=g.value;;}}catch(g){C=[g]}finally{try{f&&(g=h.return)&&(yield g.call(h))}finally{if(C)throw C[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 d(this,null,function*(){var C;let e=this.params,t=performance.now(),n=0,i=new AbortController,r=setTimeout(()=>{i.abort()},e.timeout);e.signal=i.signal;let s=!1,o=500,u="InternalServerError",l={},h=null;try{p.setDefaultOnStart&&p.setDefaultOnStart(e),this.onStartCB&&this.onStartCB(e);let g=e,{key:m,response_format:T,trafficControl:v,preventMultiRequest:R,timeout:de,queries:K}=g,H=j(g,["key","response_format","trafficControl","preventMultiRequest","timeout","queries"]);H.method=this.method;let q=p.waitList.includes(m);if(R&&q)throw o=429,new Error("TooManyRequests");p.waitList=[...p.waitList,m];let _=a.queryParams.set(S({},K),String(this.url));l=yield fetch(_,H).then(w=>d(this,null,function*(){return s=w.ok,o=w.status,u=w.statusText,h=w,T=="none"||T=="stream"?w:w[T]()})).catch(w=>{throw new Error(w)})}catch(m){o==200&&(o=500,s=!1),o==429&&(u="TooManyRequests"),i.signal.aborted&&(o=408,u="Timeout"),o==500&&(u=String(m)||u),l={errorCode:String(m)}}finally{clearTimeout(r),n=performance.now()-t}e.trafficControl&&(yield a.pending(()=>{},e.trafficControl)),p.waitList.splice(p.waitList.findIndex(m=>m==e.key),1);let f={ok:s,status:o,statusText:u,body:l,requestTime:n,rawData:h};if(!s&&this.onErrorCB&&this.onErrorCB(f.body),s&&this.onStreamCB&&e.response_format=="stream"){let m=(C=h.body)==null?void 0:C.getReader();this.onStreamProcess({errorCB:this.onErrorCB,streamCB:this.onStreamCB,response:f,reader:m,decoder:new TextDecoder("utf-8")})}return s&&this.onCompleteCB&&this.onCompleteCB(f.body),this.onResultCB&&this.onResultCB(f,e),p.setDefaultOnEnd&&p.setDefaultOnEnd(f,e),f})},abortStream:function(){this.streamStatus="abort"}},p);p.prototype.Fetcher.prototype=p.prototype;var he=e=>new b.prototype.Filer(e),b=he;b.prototype={};var me=function(e){this.ok=!0;try{let[t,n]=e.name.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" ");this.file=e,this.extension=n,this.fileName=t,this.type=e.type}catch(t){console.log(t),this.ok=!1}return this};a.extend({ok:!1,extension:"",type:"",file:{},fileName:"",Filer:me,isValid:function(){return this.ok},toBlob:function(){return d(this,null,function*(){return new Blob([this.file,{type:this.type}])})},toDataURL:function(){return d(this,null,function*(){var t;return(t=(yield this.file.convert("dataURL")).target)==null?void 0:t.result})},toAarrayBuffer:function(){return d(this,null,function*(){var t;return(t=(yield this.file.convert("arrayBuffer")).target)==null?void 0:t.result})},toObjectURL:function(){return d(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}},b);b.fromFile=e=>d(void 0,null,function*(){return b(e)});b.fromBlob=(e,t)=>d(void 0,null,function*(){let n=(t==null?void 0:t.fileName)||"file",i=(t==null?void 0:t.extension)||"",r=new File([e],n+"."+i,{type:t==null?void 0:t.mimeType});return b(r)});b.fromArrayBuffer=(e,t)=>d(void 0,null,function*(){return b.fromBlob(new Blob([e],{type:(t==null?void 0:t.mimeType)||""}),t)});b.fromObjectURL=(e,t)=>d(void 0,null,function*(){let n=yield p(e,{response_format:"blob"}).get();return n.ok?b.fromBlob(n.body,t):b({})});b.fromDataURL=(e,t)=>d(void 0,null,function*(){let n=yield e.toBlob((t==null?void 0:t.mimeType)||"");return n?b.fromBlob(n,t):b({})});b.prototype.Filer.prototype=b.prototype;var fe=function(e){let t=e,n=null;return t.use((i,r,s)=>{let o=r;o.return=u=>{let{status:l=200,body:h={},bodyStringify:f=!0}=u||{},g=h;return f&&!a.is.string(h)&&(g=a.Stringify(h)),r.status(l).end(g)},s()}),t.onPathRouter=function(i){return n=i,this},t.pathRouter=function(i){if(!n)return;let r=n(i);return r.route(i),t.use(i,r),r},t.exception=function(i){return t.use(i),this},t},L=fe;L.getLocalIP=e=>{let t="";return a.scope(()=>{if(!e)return;let n=e.networkInterfaces();for(let[i,r]of Object.entries(n))r.forEach(s=>{!s.internal&&s.family==="IPv4"&&!s.address.match(/^(169|127)/)&&(t=s.address)})}),t};L.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"};a.copyToClipboard=e=>d(void 0,null,function*(){let t="";a.is.string(e)?t=e:a.is.function(e)&&(t=e());let n={ok:!1,body:"NotSupported"};return yield d(void 0,null,function*(){let i;if(navigator.clipboard){if(i=yield navigator.clipboard.writeText(t).then(()=>!0,()=>!1),!i)return}else{let r=document.createElement("input");if(a(document.body).append(r),r.value=t,r.select(),i=document.execCommand("copy"),document.body.removeChild(r),!i)return}n={ok:!0,body:""}}),n});a.ImageLoader=(e,t)=>new Promise((n,i)=>{let r=t||new Image;r.onload=()=>n(r),r.onerror=s=>i(s),r.src=e});a.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}}};a.transformer={weekday:{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=[],n=[],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(s=>{let{From:o,To:u,name:l}=s;if(o<=e&&e<=u){let h=e-o+1;h==1&&(i=!0,h="\u5143"),n.push(l+h+"\u5E74"),t.push(l)}}),{era:t,value:n,gap:i}}};a.interval=x;p.setDefaultHeaders=()=>({});var ce=a;0&&(module.exports={Fetcher,Filer,Server,Time,UUID,useStore});
@@ -6,7 +6,7 @@ import './primitiveExtension';
6
6
  import Jmini from './core';
7
7
  import { UUID } from './uuid';
8
8
  import { Time } from './time';
9
- import { Cycle } from './cycle';
9
+ import { Interval } from './interval';
10
10
  import { Fetcher } from './fetcher';
11
11
  import { Filer } from './filer';
12
12
  import { Server } from './server';
@@ -14,7 +14,7 @@ import { useStore } from './useStore';
14
14
  export * from './extension';
15
15
  declare global {
16
16
  interface JminiExtension {
17
- cycle: Cycle.Methods;
17
+ interval: Interval.Methods;
18
18
  }
19
19
  }
20
20
  export { Time, Fetcher, Filer, Server, useStore, UUID };
@@ -1,4 +1,4 @@
1
- declare namespace Cycle {
1
+ declare namespace Interval {
2
2
  type InputArray = [Function, number, string | void];
3
3
  type Input = {
4
4
  fn: Function;
@@ -6,7 +6,7 @@ declare namespace Cycle {
6
6
  key?: string;
7
7
  };
8
8
  type SystemMethods = {
9
- Cycle: {
9
+ Interval: {
10
10
  new (...args: InputArray): Chains;
11
11
  };
12
12
  store(): void;
@@ -30,5 +30,5 @@ declare namespace Cycle {
30
30
  get(key: string): Chains | undefined;
31
31
  };
32
32
  }
33
- declare const Cycle: Cycle.Methods;
34
- export { Cycle, Cycle as default };
33
+ declare const Interval: Interval.Methods;
34
+ export { Interval, Interval as default };
package/esm/index.js CHANGED
@@ -1 +1 @@
1
- import"./chunk-ABA72NWU.js";import"./primitiveExtension";import e from"./core";import{UUID as o}from"./uuid";import{Time as t}from"./time";import{Cycle as i}from"./cycle";import{Fetcher as r}from"./fetcher";import{Filer as m}from"./filer";import{Server as p}from"./server";import{useStore as f}from"./useStore";export*from"./extension";e.cycle=i,r.setDefaultHeaders=()=>({});var u=e;export{r as Fetcher,m as Filer,p as Server,t as Time,o as UUID,u as default,f as useStore};
1
+ import"./chunk-ABA72NWU.js";import"./primitiveExtension";import r from"./core";import{UUID as t}from"./uuid";import{Time as o}from"./time";import{Interval as i}from"./interval";import{Fetcher as e}from"./fetcher";import{Filer as m}from"./filer";import{Server as n}from"./server";import{useStore as a}from"./useStore";export*from"./extension";r.interval=i,e.setDefaultHeaders=()=>({});var c=r;export{e as Fetcher,m as Filer,n as Server,o as Time,t as UUID,c as default,a as useStore};
@@ -0,0 +1 @@
1
+ import"./chunk-ABA72NWU.js";import{useStore as s}from"./useStore";import o from"./core";const i=(...[t,n,r])=>new e.prototype.Interval(t,n,r),e=i;e.prototype={};const a=function(...[t,n,r]){return this.fn=t,this.ms=n,this.key=r,e.abort(this.key),this.store(),this};o.extend({key:"",ms:0,timeoutIndex:-1,fn:null,Interval:a,store:function(){s.set({["Interval_"+this.key]:this})},once:function(){return this.fn&&(this.timeoutIndex=setTimeout(this.fn,this.ms)),this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return e.abort(this.timeoutIndex),this},set_ms:function(t){return this.ms=t,this.store(),this},set_fn:function(t){return this.fn=t,this.store(),this}},e),e.abort=function(t){if(o.is.number(t))return clearInterval(t);let n=s.get("Interval_"+t);n&&clearInterval(n.timeoutIndex)},e.get=function(t){return s.get("Interval_"+t)},e.prototype.Interval.prototype=e.prototype;export{e as Interval,e as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jmini",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "minified JavaScript Framework",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
package/esm/cycle.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-ABA72NWU.js";import{useStore as s}from"./useStore";import o from"./core";const i=(...[t,n,r])=>new e.prototype.Cycle(t,n,r),e=i;e.prototype={};const y=function(...[t,n,r]){return this.fn=t,this.ms=n,this.key=r,e.abort(this.key),this.store(),this};o.extend({key:"",ms:0,timeoutIndex:-1,fn:null,Cycle:y,store:function(){s.set({["Cycle_"+this.key]:this})},once:function(){return this.fn&&(this.timeoutIndex=setTimeout(this.fn,this.ms)),this.store(),this},start:function(){return this.fn&&(this.timeoutIndex=setInterval(this.fn,this.ms)),this.store(),this},abort:function(){return e.abort(this.timeoutIndex),this},set_ms:function(t){return this.ms=t,this.store(),this},set_fn:function(t){return this.fn=t,this.store(),this}},e),e.abort=function(t){if(o.is.number(t))return clearInterval(t);let n=s.get("Cycle_"+t);n&&clearInterval(n.timeoutIndex)},e.get=function(t){return s.get("Cycle_"+t)},e.prototype.Cycle.prototype=e.prototype;export{e as Cycle,e as default};