jqx-es 1.6.0 → 1.6.1
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/Bundle/jqx.browser.min.js +14 -14
- package/Bundle/jqx.min.js +14 -14
- package/Resource/Common/TypeofAnything.js +154 -137
- package/package.json +1 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var JQx=(()=>{var xe=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var dt=Object.getOwnPropertyNames;var mt=Object.prototype.hasOwnProperty;var gt=(t,e)=>{for(var r in e)xe(t,r,{get:e[r],enumerable:!0})},pt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of dt(e))!mt.call(t,o)&&o!==r&&xe(t,o,{get:()=>e[o],enumerable:!(n=ft(e,o))||n.enumerable});return t};var yt=t=>pt(xe({},"__esModule",{value:!0}),t);var Er={};gt(Er,{default:()=>wr});var{IS:s,maybe:W,$Wrap:Lr,isNothing:Tr,xProxy:Fr,addSymbolicExtensions:$r}=bt({useSymbolicExtensions:!1});function bt(t={}){let{useSymbolicExtensions:e}=t,{xProxy:r,addSymbolicExtensions:n}=ht(a,f,e),o=C(),[i]=[N()];return r.custom(),e&&n(),{IS:a,maybe:o,$Wrap:i,isNothing:b,xProxy:r,addSymbolicExtensions:n};function a(l,...d){let v=typeof l=="symbol"?Symbol.isSymbol:l;switch(!0){case!!o({trial:L=>"isTypes"in(d?.[0]??{})}):return w(l,d[0]);default:return d.length>1?m(v,...d):E(l,...d)}}function w(l,d){switch(!0){case"defaultValue"in d:return u(l,d);case"notTypes"in d:return y(l,d);default:return a(l,...[d.isTypes].flat())}}function f(l){return l?.[Symbol.proxy]??a(l)}function E(l,...d){let{noInput:v,noShouldbe:L,compareTo:O,inputCTOR:J,isNaN:B,isInfinity:ut,shouldBeFirstElementIsNothing:ct}=c(l,...d);switch(d=d.length&&d[0],!0){case ct:return String(l)===String(O);case(l?.[Symbol.proxy]&&L):return l[Symbol.proxy];case B:return L?"NaN":String(O)===String(l);case ut:return L?"Infinity":String(O)===String(l);case v:return L?String(l):String(O)===String(l);case J===Boolean:return d?J===d:"Boolean";default:return g(l,d,L,h(l,J))}}function c(l,...d){let v=d.length<1,L=l==null;return{noInput:L,noShouldbe:v,compareTo:!v&&d[0],inputCTOR:!L&&Object.getPrototypeOf(l)?.constructor,isNaN:Number.isNaN(l)||o({trial:O=>String(l)==="NaN"}),isInfinity:o({trial:O=>String(l)})==="Infinity",shouldBeFirstElementIsNothing:!v&&b(d[0])}}function h(l,d){switch(!0){case l===0:return Number;case l==="":return String;case!l:return{name:String(l)};default:return d}}function g(l,d,v,L){switch(!0){case(!v&&d===l||l?.[Symbol.proxy]&&d===Proxy):return!0;case String(d)==="NaN":return String(l)==="NaN";case(l?.[Symbol.toStringTag]&&typeof d=="string"):return String(d)===l[Symbol.toStringTag];default:return d?p(l,d,L):S(l,L)}}function S(l,d){return(l?.[Symbol.toStringTag]??l?.prototype?.[Symbol.toStringTag])||d?.name||String(d)}function p(l,d,v){return o({trial:L=>l instanceof d})||d===v||d===Object.getPrototypeOf(v)||`${d?.name}`===v?.name}function m(l,...d){return d.some(v=>a(l,v))}function b(l,d=!1){let v=l==null;return v=d?v||a(l,1/0)||a(l,NaN):v,v}function C(){let l=d=>{};return function({trial:d,whenError:v=l}={}){try{return d()}catch(L){return v(L)}}}function N(){return function(l){return Object.freeze({get value(){return l},get[Symbol.type](){return f(l)},get type(){return f(l)},[Symbol.is](...d){return a(l,...d)},is(...d){return a(l,...d)}})}}function u(l,{defaultValue:d,isTypes:v=[void 0],notTypes:L}={}){return v=v?.constructor!==Array?[v]:v,L=L&&L?.constructor!==Array?[L]:[],L.length<1?a(l,...v)?l:d:y(l,{isTypes:v,notTypes:L})?l:d}function y(l,{isTypes:d=[void 0],notTypes:v=[void 0]}={}){return d=d?.constructor!==Array?[d]:d,v=v?.constructor!==Array?[v]:v,a(l,...d)&&!a(l,...v)}function x(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return f(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return a(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return f(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...d){return a(l,...d)},enumerable:!1,configurable:!1}}))}}function ht(t,e,r){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for("toa.isASymbol")),{xProxy:w(),addSymbolicExtensions:n};function n(){Symbol.is||(Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type")),Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return e(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...f){return t(this,...f)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(f){return e(f)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(f,...E){return t(f,...E)},enumerable:!1,configurable:!1}}))}function o(f){let E=f.set;return f.set=(c,h,g)=>h===Symbol.proxy?c[h]=g:E(c,h,g),f}function i(f){return Object.getPrototypeOf(f)?.constructor?.name||"Object"}function a(f){return Proxy=new f(f,{construct(E,c){for(let g of c)g.set&&(g=o(g));let h=new E(...c);return h[Symbol.proxy]=`Proxy (${i(c[0])})`,h}}),Proxy}function w(){Symbol.proxy||(Symbol.proxy=Symbol.for("toa.proxy"));let f=Proxy;return{native(){Proxy=f},custom(){Proxy=a(f)}}}}var je=vt(),z=St(),V=xt();function St(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function xt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function vt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var Re={html:"innerHTML",text:"textContent",class:"className"},ee=wt();function wt(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Nt(n):return Je(e,n,r);default:return Je(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function Je(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>At(r):Pt(e)}}),t[e]}function Et(t,e,r){return e=e?.isJQx&&e.first()||e,W({trial:n=>Ht(e)?t.append(e):ke(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
-
`,n)})}function
|
|
3
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function
|
|
4
|
-
${
|
|
5
|
-
Rule: ${we(
|
|
6
|
-
${r}`),
|
|
7
|
-
${
|
|
1
|
+
var JQx=(()=>{var xe=Object.defineProperty;var ut=Object.getOwnPropertyDescriptor;var ct=Object.getOwnPropertyNames;var ft=Object.prototype.hasOwnProperty;var dt=(t,e)=>{for(var r in e)xe(t,r,{get:e[r],enumerable:!0})},mt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ct(e))!ft.call(t,o)&&o!==r&&xe(t,o,{get:()=>e[o],enumerable:!(n=ut(e,o))||n.enumerable});return t};var gt=t=>mt(xe({},"__esModule",{value:!0}),t);var wr={};dt(wr,{default:()=>vr});var{IS:a,maybe:P,$Wrap:Cr,isNothing:Lr,xProxy:Tr,addSymbolicExtensions:Fr}=pt({useSymbolicExtensions:!1});function pt(t={}){let{useSymbolicExtensions:e}=t,{shouldbeIsSingleObject:r,ISOneOf:n,isOrDefault:o,isExcept:s,typeOf:f,SymbolAndCustomProxyFactory:v,WrapAnyFactory:b,verifyNothingness:E,determineType:d,xProxy:h,addSymbolicExtensions:p,maybe:S,$Wrap:g}=yt(c,e);return h.custom(),e&&p(),{IS:c,maybe:S,$Wrap:g,isNothing:E,xProxy:h,addSymbolicExtensions:p};function c(i,...u){let y=typeof i=="symbol"?Symbol.isSymbol:i;switch(!0){case!!S({trial:l=>"isTypes"in(u?.[0]??{})}):return r(i,u[0]);default:return u.length>1?n(y,...u):d(i,...u)}}}function yt(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:o,verifyNothingness:s,determineType:f}=bt(t,h),{xProxy:v,addSymbolicExtensions:b}=r(t,h,e),[E,d]=[n(),o(t,h)];return Object.freeze({shouldbeIsSingleObject:p,ISOneOf:S,isOrDefault:g,isExcept:c,typeOf:h,SymbolAndCustomProxyFactory:r,maybe:E,WrapAnyFactory:o,verifyNothingness:s,determineType:f,xProxy:v,addSymbolicExtensions:b,$Wrap:d});function h(i){return i?.[Symbol.proxy]??t(i)}function p(i,u){switch(!0){case"defaultValue"in u:return g(i,u);case"notTypes"in u:return c(i,u);default:return t(i,...[u.isTypes].flat())}}function S(i,...u){return u.some(y=>t(i,y))}function g(i,{defaultValue:u,isTypes:y=[void 0],notTypes:l}={}){return y=y?.constructor!==Array?[y]:y,l=l&&l?.constructor!==Array?[l]:[],l.length<1?t(i,...y)?i:u:c(i,{isTypes:y,notTypes:l})?i:u}function c(i,{isTypes:u=[void 0],notTypes:y=[void 0]}={}){return u=u?.constructor!==Array?[u]:u,y=y?.constructor!==Array?[y]:y,t(i,...u)&&!t(i,...y)}}function bt(){let t={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},e={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:n,maybeFactory:g,WrapAnyFactory:S,verifyNothingness:c,determineType:b});function r(i,u){Symbol.is||(Symbol.is=Symbol.for(t.IS),Symbol.type=Symbol.for(t.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return u(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...y){return i(this,...y)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(y){return u(y)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(y,...l){return i(y,...l)},enumerable:!1,configurable:!1}}))}function n(i,u,y){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(t.IS_SYMBOL)),{xProxy:f(),addSymbolicExtensions:()=>r(i,u)}}function o(i){return Object.getPrototypeOf(i)?.constructor?.name||e.OBJECT}function s(i){return Proxy=new i(i,{construct(u,y){let l=new u(...y);return l[Symbol.proxy]=`${e.PROXY_PREFIX}${o(y[0])})`,l}}),Proxy}function f(){Symbol.proxy||(Symbol.proxy=Symbol.for(t.PROXY));let i=Proxy;return{native(){Proxy=i},custom(){Proxy=s(i)}}}function v(i,...u){let y=u.length<1,l=i==null;return{noInput:l,noShouldbe:y,compareTo:!y&&u[0],inputCTOR:!l&&Object.getPrototypeOf(i)?.constructor,isNaN:Number.isNaN(i)||P({trial:m=>String(i)===e.NAN}),isInfinity:P({trial:m=>String(i)})===e.INFINITY,shouldBeFirstElementIsNothing:!y&&c(u[0])}}function b(i,...u){let{noInput:y,noShouldbe:l,compareTo:m,inputCTOR:x,isNaN:w,isInfinity:F,shouldBeFirstElementIsNothing:D}=v(i,...u);switch(u=u.length&&u[0],!0){case D:return String(i)===String(m);case(i?.[Symbol.proxy]&&l):return i[Symbol.proxy];case w:return l?e.NAN:String(m)===String(i);case F:return l?e.INFINITY:String(m)===String(i);case y:return l?String(i):String(m)===String(i);case x===Boolean:return u?x===u:e.BOOLEAN;default:return d(i,u,l,E(i,x))}}function E(i,u){switch(!0){case i===0:return Number;case i==="":return String;case!i:return{name:String(i)};default:return u}}function d(i,u,y,l){switch(!0){case(!y&&u===i||i?.[Symbol.proxy]&&u===Proxy):return!0;case String(u)===e.NAN:return String(i)===e.NAN;case(i?.[Symbol.toStringTag]&&typeof u=="string"):return String(u)===i[Symbol.toStringTag];default:return u?p(i,u,l):h(i,l)}}function h(i,u){return(i?.[Symbol.toStringTag]??i?.prototype?.[Symbol.toStringTag])||u?.name||String(u)}function p(i,u,y){return P({trial:l=>i instanceof u})||u===y||u===Object.getPrototypeOf(y)||`${u?.name}`===y?.name}function S(i,u){return function(y){let l={get value(){return y},is(...m){return i(y,...m)},get type(){return u(y)}};return Object[Symbol.type]&&Object.defineProperties(l,{[Symbol.type]:{get(){return u(y)}},[Symbol.is]:{value(...m){return i(y,...m)}}}),Object.freeze(l)}}function g(){let i=u=>{};return function({trial:u,whenError:y=i}={}){try{return u()}catch(l){return y(l)}}}function c(i,u=!1){let y=i==null;return y=u?y||a(i,1/0)||a(i,NaN):y,y}}var Re=xt(),Q=ht(),k=St();function ht(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function St(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function xt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var je={html:"innerHTML",text:"textContent",class:"className"},X=vt();function vt(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Nt(n):return Je(e,n,r);default:return Je(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function Je(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>At(r):Ht(e)}}),t[e]}function wt(t,e,r){return e=e?.isJQx&&e.first()||e,P({trial:n=>$t(e)?t.append(e):ke(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
+
`,n)})}function Et(t,e,...r){let n=Ct(e,t);return r?.forEach(o=>wt(n,o,t)),n}function Ct(t,e){switch(t=ve(e)?Ft(t):t?.isJQx?t.first():t,!0){case a(t,String):return B(e,ke(t,e)?{html:t}:{text:t});case a(t,Node):return Tt(e,t);default:return B(e,t)}}function Lt(t){return delete t.data,Object.keys(t).length<1||Object.keys(t).forEach(e=>{let r=e.toLowerCase();r in je&&(t[je[r]]=t[e],delete t[e])}),t}function Tt(t,e){let r=B(t);return r.append(e),r}function B(t,e={}){e=Qe(e,{});let r=Object.entries(e.data??{}),n=Object.assign(ve(t)?new Comment(e?.text):document.createElement(t),Lt(e));return r.length&&r.forEach(([o,s])=>n.dataset[o]=String(s)),n}function Qe(t,e){return e?a(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:e}):a(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function Ft(t){return Qe(t)?t?.text??t?.textContent??"":String(t)}function At(t){return B("b",{style:"color:red",text:`'${t}' is not a valid HTML-tag`})}function ke(t,e){return!ve(e)&&a(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function $t(t){return t?.constructor===Comment||t?.constructor===CharacterData}function ve(t){return t?.constructor===Comment||/comment/i.test(t)}function Nt(t){return!a(B(t),HTMLUnknownElement)}function Ht(t){return(e,...r)=>Et(t,e,...r)}var{IS:Z,maybe:Pr,$Wrap:Or,xProxy:Mr,isNothing:Dr}=Pt();function Pt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),c();let t=h(),[e,r]=[p(),y()];return r.custom(),{IS:n,maybe:t,$Wrap:e,isNothing:d,xProxy:r};function n(l,...m){if(t({trial:w=>"isTypes"in(m?.[0]??{})})){let w=m[0];return"defaultValue"in w?S(l,w):"notTypes"in w?g(l,w):n(l,...[w.isTypes].flat())}let x=typeof l=="symbol"?Symbol.isSymbol:l;return m.length>1?E(x,...m):s(l,...m)}function o(l){return l?.[Symbol.proxy]??n(l)}function s(l,...m){let{noInput:x,noShouldbe:w,compareTo:F,inputCTOR:D,isNaN:ye,isInfinity:be,shouldBeFirstElementIsNothing:he}=v(l,...m);switch(m=m.length&&m[0],!0){case he:return String(l)===String(F);case(l?.[Symbol.proxy]&&w):return l[Symbol.proxy];case ye:return w?"NaN":t({trial:Se=>String(F)})===String(l);case be:return w?"Infinity":t({trial:Se=>String(F)})===String(l);case x:return w?String(l):String(F)===String(l);case D===Boolean:return m?D===m:"Boolean";default:return b(l,m,w,f(l,D))}}function f(l,m){return l===0?Number:l===""?String:l?m:{name:String(l)}}function v(l,...m){let x=m.length<1,w=!x&&m[0],F=!x&&d(m[0]),D=l==null,ye=!D&&Object.getPrototypeOf(l)?.constructor,be=t({trial:Se=>String(l)})==="NaN",he=t({trial:Se=>String(l)})==="Infinity";return{noInput:D,noShouldbe:x,compareTo:w,inputCTOR:ye,isNaN:be,isInfinity:he,shouldBeFirstElementIsNothing:F}}function b(l,m,x,w){switch(!0){case(!x&&m===l||l?.[Symbol.proxy]&&m===Proxy):return!0;case t({trial:F=>String(m)})==="NaN":return String(l)==="NaN";case(l?.[Symbol.toStringTag]&&n(m,String)):return String(m)===l[Symbol.toStringTag];default:return m?t({trial:F=>l instanceof m})||m===w||m===Object.getPrototypeOf(w)||`${m?.name}`===w?.name:l?.[Symbol.toStringTag]&&`[object ${l?.[Symbol.toStringTag]}]`||w?.name||String(w)}}function E(l,...m){return m.some(x=>n(l,x))}function d(l,m=!1){let x=l==null;return x=m?x||n(l,1/0)||n(l,NaN):x,x}function h(){let l=(m,x)=>m?.constructor===Function?m(x):void 0;return function({trial:m,whenError:x=()=>{}}={}){try{return l(m)}catch(w){return l(x,w)}}}function p(){return function(l){return Object.freeze({get value(){return l},get[Symbol.type](){return o(l)},get type(){return o(l)},[Symbol.is](...m){return n(l,...m)},is(...m){return n(l,...m)}})}}function S(l,{defaultValue:m,isTypes:x=[void 0],notTypes:w}={}){return x=x?.constructor!==Array?[x]:x,w=w&&w?.constructor!==Array?[w]:[],w.length<1?n(l,...x)?l:m:g(l,{isTypes:x,notTypes:w})?l:m}function g(l,{isTypes:m=[void 0],notTypes:x=[void 0]}={}){return m=m?.constructor!==Array?[m]:m,x=x?.constructor!==Array?[x]:x,n(l,...m)&&!n(l,...x)}function c(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return o(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return n(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return o(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...m){return n(l,...m)},enumerable:!1,configurable:!1}}))}function i(l){let m=String(Object.getPrototypeOf(l)?.constructor);return m.slice(m.indexOf("ion")+3,m.indexOf("(")).trim()}function u(l){let m=l.set;return l.set=(x,w,F)=>w===Symbol.proxy?x[w]=F:m(x,w,F),l}function y(){let l=Proxy;return{native(){Proxy=l},custom(){Proxy=new l(l,{construct(m,x){for(let F of x)F.set&&(F=u(F));let w=new m(...x);return w[Symbol.proxy]=`Proxy (${i(x[0])})`,w}})}}}}var W=Ot;function Ot({styleSheet:t,createWithId:e}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:o,sheet:s,removeRules:f,consider:v,currentSheetID:b}=Mt({styleSheet:t,createWithId:e});function E(g,c){if(g&&c.removeProperties){Object.keys(c.removeProperties).forEach(i=>g.style.removeProperty(Be(i)));return}Object.entries(c).forEach(([i,u])=>{i=Be(i.trim()),u=u.trim();let y;if(/!important/.test(u)&&(u=u.slice(0,u.indexOf("!important")).trim(),y="important"),!CSS.supports(i,u))return console.error(`StylingFactory ${b} error: '${i}' with value '${u}' not supported (yet)`);We(()=>g.style.setProperty(i,u,y),`StylingFactory ${b} (setRule4Selector) failed`)})}function d(g,c,i=s){if(g=g?.trim?.(),!Z(g,String)||!g.length||/[;,]$/g.test(g))return console.error(`StylingFactory ${b} (setRules): [${g||"[no selector given]"}] is not a valid selector`);if(c.removeRule)return f(g);let u=n(g,!0),y=u||i.cssRules[i.insertRule(`${g} {}`,i.cssRules.length||0)];return v(()=>E(y,c),g,u)}function h(g){let c=g.trim().split(/{/,2),i=c.shift().trim();if(!Z(i,String)||!i?.trim()?.length)return console.error(`StylingFactory ${b} (doParse): no (valid) selector could be extracted from rule ${we(g)}`);let u=kt(c.shift());return We(()=>d(i,u),`StylingFactory ${b} (setRules) failed`)}function p(g){let c=r(g);return c.done?c.existing:h(g)}function S(g,c){return g.trim().startsWith("@media")?p(Dt(g,c)):d(g,c)}return function(g,c={}){return o(g,c)&&(Object.keys(c).length?S(g,c):p(g))}}function Mt({styleSheet:t,createWithId:e}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${e}`;t=e?o(e):t;function o(p){let S=document.querySelector(`#${p}`)?.sheet;if(S)return S;let g=Object.assign(document.createElement("style"),{id:p});return document.head.insertAdjacentElement("beforeend",g),g.sheet}function s(p){return console.error(`StylingFactory ${n} [rule: ${p}]
|
|
3
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function f(p,S){return[...t.rules].find(g=>S?ze(g.selectorText||"",p):jt`${Rt(p)}${[..."gim"]}`.test(g.cssText))}function v(p){return/^@charset|@import|namespace/i.test(p.trim())?s(p):p.match(/}/g)?.length>1?{existing:d(p,1),done:!0}:{done:!1}}function b(p){let S=[...t.cssRules].reduce((c,i,u)=>ze(i.selectorText||"",p)&&c.concat(u)||c,[]),g=S.length;return S.forEach(c=>t.deleteRule(c)),g>0?console.info(`\u2714 Removed ${g} instance${g>1?"s":""} of selector ${p} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${p} does not exist in ${n.slice(4)}`)}function E(p,S){return p&&Z(p,String)&&p.trim().length>0&&Z(S,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function d(p){p=p.trim();let S=p.slice(0,p.indexOf("{")).trim(),g=!!f(S);try{return t.insertRule(`${p}`,t.cssRules.length),g}catch(c){return console.error(`StylingFactory ${n} (tryParse) ${c.name} Error:
|
|
4
|
+
${c.message}
|
|
5
|
+
Rule: ${we(p)}
|
|
6
|
+
${r}`),g}}function h(p,S,g){try{return p(),g}catch(c){return console.error(`StylingFactory ${n} (tryAddOrModify) ${c.name} Error:
|
|
7
|
+
${c.message}
|
|
8
8
|
Rule: ${we(S)}
|
|
9
|
-
${r}`),
|
|
10
|
-
`)}function Rt(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function
|
|
11
|
-
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function
|
|
9
|
+
${r}`),g}}return{sheet:t,removeRules:b,tryParseAtOrNestedRules:v,ruleExists:f,checkParams:E,tryParse:d,consider:h,currentSheetID:n}}function Dt(t,e){return`${t.trim()} ${Object.entries(e).map(([r,n])=>`${r}: { ${It(n)}`)}`}function we(t){let e=(t||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return t.length>e.length?`${e.trim()}...truncated`:e}function It(t){return Object.entries(t).map(([e,r])=>`${e}: ${r.trim()}`).join(`;
|
|
10
|
+
`)}function Rt(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function jt(t,...e){let r=e.length&&Array.isArray(e.slice(-1))?e.pop().join(""):"";return new RegExp((e.length&&t.raw.reduce((n,o,s)=>n.concat(e[s-1]||"").concat(o),"")||t.raw.join("")).split(`
|
|
11
|
+
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function Be(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function We(t,e){try{return t()}catch(r){console.error(`${e||"an error occured"}: ${r.message}`)}}function Jt(t){return t.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(e,r)=>`${r}\\3b`).split(";").map(e=>e.trim()).join(`;
|
|
12
12
|
`).replaceAll("\\3b",";").split(`
|
|
13
|
-
`)}function
|
|
14
|
-
`)),n}function
|
|
15
|
-
`)),n}function
|
|
16
|
-
`));default:return n}}return Object.defineProperties(n,{log:{value:f,enumerable:!1},error:{value:a,enumerable:!1},warn:{value:w,enumerable:!1}}),Object.freeze(n)}function ue(){return(t=>`[${ae(t.getHours())}:${ae(t.getMinutes())}:${ae(t.getSeconds())}.${ae(t.getMilliseconds(),3)}]`)(new Date)}function Ae(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=M(r),r.startsWith("data"))return de(t,n);s(n,String)&&ce(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function de(t,e){if(t&&s(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${M(r)}`,n)}function me(t){return t?s(t,Proxy)?[t.EL]:s(t,NodeList)?[...t]:I(t)?[t]:K(t)?t:t.isJQx?t.collection:void 0:[]}function ge(t,e){return t.andThen(e)}function pe(t,e){return t.andThen(e,!0)}function I(t){return s(t,Text,HTMLElement,Comment)}function Z(t,e){if(s(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(M(r),n,o)}}function R(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function _e(t){if(!s(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),i=!!t.hidden,a=parseInt(r.height)<1||parseInt(r.width)<1,w=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,f=+r.opacity==0||+(e.opacity||1)==0;return!(i||w||f||o||n||a)}function Ge(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ze(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Pe(r)?`<!--${r.data}-->`:be(r)?r.textContent:r.outerHTML),"")}function ae(t,e=2){return`${t}`.padStart(e,"0")}function Ye(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function ye(){return`_${qt(Xt).slice(0,8).join("")}`}function He(t){return t=s(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,s(t,Array)?t:s(t,String)&&t?.trim().toLowerCase()||""}function Xe(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Ne(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function qt(t){let e=t.length;for(;e--;){let r=Ye(e);[t[e],t[r]]=[t[r],t[e]]}return t}function Y(t){return s(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${er(e)}`||e).join(""):t}function M(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function er([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function be(t){return s(t,Comment,Text)}function Pe(t){s(t,Comment)}function Ke(t){return s(t,Text)}function X(t){return s(t,String)&&/^<|>$/.test(`${t}`.trim())}function K(t){return s(t,Array)&&!t?.find(e=>!I(e))}function he(t){return s(t,Array)&&!t?.find(e=>!X(e))}function T(t,e){let r=t.collection.filter(n=>!be(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function qe(t){return t.node?s(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Me(t,e,r){let n=e!==document.body&&s(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{F.warn(`JQx: Invalid CSS querySelector. [${s(t,String)?t:"Not a string!"}]`)}}function et(){return{isCommentOrTextNode:be,isNode:I,isComment:Pe,isText:Ke,isHtmlString:X,isArrayOfHtmlElements:K,isArrayOfHtmlStrings:he,ElemArray2HtmlString:Ze,input2Collection:me,setCollectionFromCssSelector:Me,cssRuleEdit:_({createWithId:"JQxStylesheet"})}}function tt(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return s(n,Node)?Object.freeze({get writable(){return Ge(n)},get modal(){return Xe(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return _e(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function rt(t,e,r,n){r&&s(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(a=>a.startsWith("JQxClass-")||o&&a===o)||o||`JQxClass-${ye().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var tr=tt();function nt(t){return{factoryExtensions:rr(t),instanceExtensions:nr(t)}}function rr(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Te)},set(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${M(r)}`),e}}},dimensions(e){if(e.is.empty)return F.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=G(r,0),n.scrollLeftDistance=G(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?j(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let i=s(r,String);return r=i&&o?j(r):r,i&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return tr(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[M(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let i=s(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&s(n,String)?[n]:n,r=r&&s(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let a of r)e.addClass(a);return i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}}}}}function nr(t){return{addClass(e,...r){return T(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after:ge,afterMe:ge,andThen(e,r,n=!1){if(!r||!s(r,String,Node,Proxy))return F.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:s(r,Node)?t.virtual(r):t.virtual(P(r));let[o,i,a]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[o][i](...r.collection),e.collection=a,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&A(o)){let i=o.trim(),w=!/^<(.+)[^>]+>$/m.test(i)?t.text(o):P(o);T(e,f=>f.append(n?w:R(w)))}I(o)&&T(e,i=>i.append(n?o:R(o))),o.isJQx&&!o.is.empty&&T(e,i=>o.collection.forEach(a=>i.append(n?a:R(a))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!s(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||s(e.node,Text,Comment))return e;if(!n&&A(r))return r=M(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(A(r)&&n)switch(r=M(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return s(r,Object)&&!e.is.empty&&Ae(e.node,r),e},before:pe,beforeMe:pe,clear(e){return T(e,fe)},closest(e,r){let n=A(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return T(e,o=>rt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return F.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(i=>{i.removeAttribute&&i?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return T(e,r)},empty(e){return T(e,fe)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return T(e,r=>Z(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!A(r)):return"";case!A(r):return e.node?.getHTML()??"";default:let o=P(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return T(e,a=>(a.textContent=n?a.textContent:"",a.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!A(r)||!A(n))return e;let i=e.find$(r);if(i.length<1)return e;let a=P(`<span>${n}</span>`);return i.each(w=>{o||(w.textContent=""),w.insertAdjacentHTML(t.at.end,a?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(A(o)){o=o.trim();let a=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):P(o);a=n?a:R(a),T(e,w=>w.prepend(a.cloneNode(!0)))}I(o)&&T(e,i=>i.prepend(n?o:R(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),T(e,i=>T(o,a=>i.prepend(n?a:R(a)))),o.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(s(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=s(r,Object)?r:{[r]:n};for(let[i,a]of Object.entries(o)){if(i=i.trim(),a&&!ce(i)||!a)return!1;if(i.toLowerCase()==="id")return e[0].id=a;T(e,f=>{if(i.startsWith("data"))return f.dataset[i.slice(i.indexOf("-")+1)]=a;f[i]=a})}return e},remove(e,r){let n=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(r){let i=e.find$(r);return i.is.empty||(T(i,n),o()),e}return T(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return T(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=s(r,HTMLElement)||r.isJQx?r:document.body,n=s(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!s(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||s(n,NodeList))&&(n=n[0]),o&&r&&(r=s(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,s(r,HTMLElement,NodeList,Array)&&s(n,HTMLElement)&&(s(r,HTMLElement)?[r]:[...r]).forEach(i=>i.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return T(e,o=>{o.classList.remove(r);for(let i of n)o.classList.add(i)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=s(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return T(e,n=>de(n,r))},show(e){return T(e,r=>Z(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&s(r,String)):return e.find$(r);case(n&&s(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return T(e,i=>{n&&s(r,String)&&(r={[r]:n||"none"}),Z(i,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!s(r,String):return e.node.textContent;default:return T(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=H.BeforeEnd){return e.isVirtual=!1,k(e.collection,r,n),e},toggleClass(e,r){return T(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=s(n,Function)?n:Event,o=s(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let i=new n(r,o);return e.is.empty||e.each(a=>a.dispatchEvent(i)),e},val(e,r){switch(!0){case(e.is.empty||!s(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!s(r,String):return e.node.value;default:return e.node.value=s(r,String)?r:"",e}}}}var Oe,Se,{isComment:gn,isText:pn,isHtmlString:yn,isArrayOfHtmlElements:bn,isArrayOfHtmlStrings:hn,ElemArray2HtmlString:Sn,cssRuleEdit:De,addFn:or}=ir();function ir(){return{...et(),addFn:lr}}function lr(t,e){return t=t?.trim(),!A(t)||!s(e,Function)?F.error("JQx.fn: method invalid parameter(s)"):Se[t]=(r,...n)=>e(r,...n)}function sr(t){return function(e,r,n){if(e=e?.trim(),!A(e)||!s(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...i){return r(...i)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return F.log(`JQx: added static extension function [${e}]`)}}function q(t){return new Proxy(t,Object.freeze({get:(e,r)=>ar(e,r,t)}))}function ot(t,e){return(...r)=>s(t,Function)&&t(q(e),...r)}function ar(t,e,r){switch(!0){case s(e,Symbol):return W({trial:()=>t[e],whenError:()=>t});case s(+e,Number):return t.collection?.[e]||void 0;case e in Oe:return ot(Oe[e],r)();case e in Se:return ot(Se[e],r);default:return t[e]}}function st(t){let e=mr(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function ur(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?Y(e):e.toLowerCase(),D.allowTag(e),Object.defineProperties(t,Ie(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),D.prohibitTag(e),Object.defineProperties(t,Ie(e,!1,t))}}}function it(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))De(e,{removeRule:1})}function cr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(H).find(i=>n===i);let o=t(e,document.createElement("br"));if(r&&!s(r,HTMLBRElement))for(let i of o.collection)n?r.insertAdjacentElement(n,i):r.append(i);return o}}function fr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,i]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...i,enumerable:!1})}return e}function dr(t,e,r,n){return t=M(n||t.toLowerCase()),{get(){return(...o)=>{let i=e&&r.virtual(Q(ee[t](...o)))||void 0,w=!s(i?.node,Comment,Text,void 0)?$e(i):"";return F.log(e?`JQx: created (virtual) instance from [JQx].${t} ${w}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),i}},enumerable:!1,configurable:!0}}function Ie(t,e,r,n){t=t.toLowerCase();let o=dr(t,e,r,n);return n?{[n]:o,[Y(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function mr(t){return fr(Object.entries(D.tagsRaw).reduce(gr(t),{}),xr(t))}function gr(t){return function(e,[r,n]){return Object.defineProperties(e,Ie(r,n,t)),e}}function pr(t){return function(e,r,...n){s(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function yr(t){return function(e){let{type:r,types:n,origin:o,selector:i,handler:a,handlers:w,node:f,name:E,capture:c,once:h,about:g}=e;a=w||a,r=n||r,i=o||i;let S=He(r),p=E;a=s(a,Function)?[a]:a;let m={type:S,selector:i||o,capture:c,name:p,once:h,node:f,about:g};switch(!0){case(s(S,Array)&&S.length>0):for(let b of S)m.type=b,lt(a,m,t);break;default:return lt(a,m,t)}}}function lt(t,e,r){for(let n of t)r.listen({...e,handler:n})}function br(t){return function(e,r){return r=A(r)&&r,e=A(e)&&e,r&&e&&t.listenerStore[e][r]}}function hr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:ie(t),enumerable:!1}),t.activePopup}function Sr(t){let e=(c,h)=>De(c,h),r=function(c){return _({createWithId:c||`jqx${ye()}`})},n=function(...c){for(let h of c)De(h)},o=ur(t),i=le(t),a=yr(i);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:a,capturedHandling:a,log:(...c)=>F.on.log(...c).off,warn:(...c)=>F.on.warn(...c).off,error:(...c)=>F.on.error(...c).off,handlerWrapper:i}}function xr(t){let{factoryExtensions:e,instanceExtensions:r}=nt(t);Oe=e,Se=r;let{editCssRule:n,createStyle:o,editCssRules:i,allowProhibit:a,handle:w,capturedHandling:f,log:E,warn:c,error:h,handlerWrapper:g}=Sr(t),S=br(t),p=sr(t);return{log:E,warn:c,error:h,editCssRules:i,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:j,logger:F,text(m,b=!1){return b?t.comment(m):document.createTextNode(m)},node(m,b=document){return b.querySelector(m,b)},nodes(m,b=document){return[...b.querySelectorAll(m,b)]},clearAllTimers:Fe,get staticFn(){return function(m,b,C){return p(m,b,C)}},get toBool(){return Ne},get getNamedListener(){return S},get virtual(){return cr(t)},get allowTag(){return a.allow},get prohibitTag(){return a.prohibit},get removeCssRule(){return it},get removeCssRules(){return it},get delegate(){return pr(f)},get delegateCaptured(){return f},get handle(){return f},get listen(){return g.listen},get at(){return H},get setStyle(){return n},get fn(){return or},get lenient(){return D.allowUnknownHtmlTags},get IS(){return s},get Popup(){return hr(t)},get listenerStore(){return g.ListenerStore}}}var at=st(vr());function vr(){return function(e,r,n=H.BeforeEnd){if(e?.isJQx)return e;let o=s(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(H).find(c=>n===c)?n:void 0;let i=X(e),w=!i&&he(e)||i,f={collection:me(e)??[],isVirtual:o,isJQx:!0},E=K(f.collection);if(f.collection.length&&E)return o||f.collection.forEach(c=>{r.contains(c)||k([c],r,n)}),q(f);if(w){if([e].flat().forEach(c=>f.collection.push(P(c))),f.collection.length>0){let c=f.collection.filter(p=>p?.dataset?.jqxcreationerror);f.collection=f.collection.filter(p=>!p?.dataset?.jqxcreationerror);let g=f.collection.map(p=>`${String(p.constructor).split(/function|\(/)[1].trim()}`).length>1;f=q(f);let S=f.collection.length>0?qe(f):"sanitized: no elements remaining";F.log(`JQx: created ${f.isVirtual?"(virtual)":""} instance from ${g?"array of ":""}HTML string${g?"s":""} ${S}`),f.isVirtual||k(f.collection,r,n)}return f}return Me(e,r,f),q(f)}}var wr=at;return yt(Er);})();
|
|
13
|
+
`)}function Qt(t){return t.reduce((e,r)=>{let[n,o]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&o?{...e,[n]:o}:e},{})}function kt(t){return Qt(Jt(t))}function ze(t,e){return t?.replace("::",":")===e?.replace("::",":")}var Ee=!1,Bt={on:()=>Ee=!0,off:()=>Ee=!1},O={tagsRaw:k,allowUnknownHtmlTags:Bt,isAllowed(t){if(Ee)return!0;let e=a(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!k[e]},allowTag:t=>k[t.toLowerCase()]=!0,prohibitTag:t=>k[t.toLowerCase()]=!1};var Wt=!0,K={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/^javascript|injected|noreferrer|alert|DataURL/gi};function zt(t){if(Wt&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,o])=>[...r,`${I(n)} => ${o}`],[]).join("\\000A");L.error(`JQx: HTML creation error(s): ${e}`)}}function Vt(t){let e=t.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(e)&&!r.find(n=>n===e)||O.isAllowed(e)}function j(t){let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return a(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&&j(r),r?.attributes){let o=a(r,SVGElement)?Q.svg:Q.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let f=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(K.whiteSpace,""),b=f==="href"?!K.validURL.test(v):K.notAllowedValues.test(v),E=f.startsWith("data")?!K.data.test(f):!!o[f];if(b||E){let d=q(s.value||"none",60);d+=d.length===60?"...":"",e.removed[`${s.name}`]=`attribute/property/value not allowed, removed. Value: ${d}`,r.removeAttribute(s.name)}})}if(!(Vt(r)||r.constructor===CharacterData||r.constructor===Comment)){let o=(r?.outerHTML||r?.textContent).trim(),s=q(o,60)??"EMPTY";s+=s.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),zt(e),t}function _t(t){let e=document.createElement("div");return e.insertAdjacentHTML(A.end,t),e.childNodes.length?j(e):void 0}function Ut(t,e,r){switch(!0){case a(t,Comment):return e.insertAdjacentHTML(r,`<!--${t.data}-->`);case a(t,Text):return e.insertAdjacentText(r,t.data||t.textContent);default:return}}function J(t=[],e=document.body,r=A.BeforeEnd){return r=r||A.BeforeEnd,e=e?.isJQx?e.node:e||document.body,t.reduce((n,o)=>{let s=M(o)&&Yt(o,e,r);return s?[...n,s]:n},[])}function Yt(t,e=document.body,r=A.BeforeEnd){return r=r||A.BeforeEnd,e=e?.isJQx?e?.[0]:e,a(t,Comment,Text)?Ut(t,e,r):a(t,HTMLElement)?e.insertAdjacentElement(r,t):void 0}function N(t){if(a(t,Text,Comment))return t;let e=t?.trim(),r=e?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(o=>o.length).shift():void 0),e.startsWith("<!--")&&e.endsWith("-->"))return document.createComment(t.replace(/<!--|-->$/g,""));if(r||a(e,String)&&!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r??e);let n=_t(t);return n.childNodes.length<1?N(`<span data-jqxcreationerror="1">${ee(t,60)}</span>`):n.children[0]}function te(t){if(t.node("#jqxPopup"))return;t.logger.log("JQx: [JQx].Popup first call. Dialog element created."),t.dialog({id:"jqxPopup"},t.div({id:"jqxPopupContent"})).render,t.editCssRules(...Re);let e=[],[r,n]=[t("#jqxPopupContent"),t.node("#jqxPopup")],o={};return t.handle({type:"click, cancel",handlers:p,name:"genericPopupCloseHandler",capture:!0,about:"A generic handler for JQx popups"}),Object.freeze({show:s,remove:f,removeModal:h});function s(c){if(n.open)switch(!0){case v(c):return;default:return f(),setTimeout(()=>s(c),200)}o={...c};let{content:i}=o;return t.IS(i,String,HTMLElement)||i?.isJQx?b():!0}function f(){return o.modal?g(o.warnMessage):E()}function v(c){for(let[i,u]of Object.entries(o))if(u!==c[i])return!1;return!0}function b(){r.clear();let{content:c,modal:i,closeAfter:u}=o;i=t.IS(i,Boolean)?i:!1;let y=i?"":t.div({id:"closeHandleIcon"});r.append(y,t.IS(c,String)?t.div(c):c),n.showModal(),!i&&t.IS(u,Number)&&S(f,u)}function E(){if(n.close(o.returnValue),d(),t.IS(o.callback,Function))return e.push(setTimeout(()=>o.callback(o.returnValue),200));o={}}function d(){e.forEach(c=>clearTimeout(c)),e=[]}function h({callback:c,value:i}={}){o.returnValue=i,o.modal=!1,o.callback=c||o.callback,f()}function p({evt:c}){if(!(Object.keys(o).length<1||!n.open)&&(c.type==="cancel"&&o.modal&&c.preventDefault(),c.target.closest("#closeHandleIcon")||!c.target.closest("#jqxPopupContent")))return o.activeTimer&&clearTimeout(o.activeTimer),f()}function S(c,i){t.IS(c,Function)&&t.IS(i,Number)&&i>0&&(d(),e.push(setTimeout(c,i*1e3)))}function g(c){if(!t.IS(c,String,HTMLElement,Proxy))return;let i=r.find$(".warn");switch(!0){case i.is.empty:i=t.div({class:"warn"},c);default:r.append(i.addClass("active")),S(()=>r.find$(".warn").removeClass("active"),2)}}}function re(t){let e={},r="anonymous_";function n(d){if(d){let{handler:h,capture:p,type:S}=d;document.addEventListener(S,h,{capture:p})}}function o(d){if(d){let{type:h,handler:p,capture:S}=d;document.removeEventListener(h,p,{capture:S})}}function s(d,h,p,S){return function(g){if(!T(h))return d({evt:g});let c=g.target.closest(h);if(c){let i=t(c);d({self:i,me:i,evt:g}),p&&b(g.type,S)}return!0}}function f(d){return e[d]=e[d]||{},e[d]}function v(d,h){return Object.entries(f(d)).find(([p])=>p===h)}function b(d,h){let p=v(d,h);p&&(o(p[1]),delete e[d][h],delete ne[h],L.warn(`Removed listener [${h}] for event type [${d}].`))}function E(d){let{type:h,handler:p,name:S,capture:g,once:c,selector:i,node:u,about:y}=d;e[h]=e[h]||{};let l=Ce(S||p.name),m=p;if(u instanceof HTMLElement){let x=u.dataset.hid||l;u.dataset.hid=x,i=`[data-hid=${x}]`}switch(!0){case!e[h][l]:return L.log(`JQx: created listener for event type ${h}, with handler name ${l}`),e[h][l]={name:l,handler:s(p,i,c,l),capture:Ve(h,g),once:!!c,type:h,initialHandler:m,selector:!!i&&i||!1,about:!!y&&y||!1,unListen(){b(h,l)}},e[h][l];default:return console.warn(`The listener [${l}] for [${h}] exists, it is not re-assigned.`)}}return{remove(...d){return b(...d)},listen:function(d){let{type:h,handler:p}=d;if(!T(h)||!a(p,Function))return;let S=E(d);if(S)return n(S),{type:h,name:S.name,unListen(){b(h,S.name)}}},get ListenerStore(){return Object.freeze({...e})}}}var L=Zt(),Gt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],A=Object.freeze(new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(t,e){return t[String(e).toLowerCase()]??t[e]}})),Xt=[...Array(26)].map((t,e)=>String.fromCharCode(e+65)).concat([...Array(26)].map((t,e)=>String.fromCharCode(e+97))).concat([...Array(10)].map((t,e)=>`${e}`)),Te=Object.freeze({get(t,e){return t[_(e)]||t[e]},enumerable:!1,configurable:!1}),ne={};function Fe(){let t=setTimeout(()=>{});for(;t>=0;)clearTimeout(t--)}function Ce(t){return T(t)&&!/^handler|handlers$/gi.test(t.trim())?t.trim():_e()}function Ae(t){let e=!!t.node&&!a(t,Text,Comment);switch(!0){case e:let r=t.node.dataset?Object.keys(t.node.dataset).map(s=>`[data-${s}]`):[],o=[t.attr("id")&&`#${t?.attr("id")}`||void 0,t.attr("class")&&t?.attr("class").split(" ").map(s=>`.${s}`).join(", ")||void 0,r.length>0&&r.join(", ")||void 0].filter(s=>!!s).join(", ")||[];return o.length?`(${o})`:"";default:return""}}function _e(t){let e=`anonymous_${Math.random().toString(36).slice(2)}`;return ne[e]?_e():(ne[e]=e,e)}function Ve(t,e){return!!Gt.find(r=>r===t)||!!e}function se(t){return t.startsWith("data")||Q.html.find(e=>t.toLowerCase()===e)}function le(t){return t&&(t.textContent="")}function z(t,e=0,r=!0){return t=t?.parentElement,e+=t?t[r?"scrollTop":"scrollLeft"]:0,t?z(t,e,r):e}function T(t,e=1){return e=a(e,Number)&&e||1,a(t,String)&&t.length>=e}function q(t,e=120){return ee(t,e).replace(/</g,"<")}function ee(t,e=120){return`${t}`.trim().slice(0,e).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(t.length>e?" …":"").trim()}function I(t){switch(!0){case a(t,String):let e=document.createElement("div");return e.append(t),e.innerHTML;default:return t}}function Le(t){return a(t,String)&&Object.assign(document.createElement("textarea"),{innerHTML:t}).textContent||t}function Zt(){let[t,e]=[!1,!0],r=[],n={get on(){return t=!0,n},get off(){return t=!1,n},get disable(){return e=!0,n},get enable(){return e=!1,n},get backLog(){return r}};function o(){e=!0}function s(){e=!1}function f(...E){return r.unshift(...E.map(d=>`${ie()} \u2A3B ${Le(d)}`)),console.error(r.slice(0,E.length).join(`
|
|
14
|
+
`)),n}function v(...E){return r.unshift(...E.map(d=>`${ie()} \u26A0 ${Le(d)}`)),console.warn(r.slice(0,E.length).join(`
|
|
15
|
+
`)),n}function b(...E){let d=E.map(h=>`${ie()} \u2714 ${Le(h)}`);switch(!e&&r.unshift(...d),t){case!0:console.log(d.join(`
|
|
16
|
+
`));default:return n}}return Object.defineProperties(n,{log:{value:b,enumerable:!1},error:{value:f,enumerable:!1},warn:{value:v,enumerable:!1}}),Object.freeze(n)}function ie(){return(t=>`[${oe(t.getHours())}:${oe(t.getMinutes())}:${oe(t.getSeconds())}.${oe(t.getMilliseconds(),3)}]`)(new Date)}function $e(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=H(r),r.startsWith("data"))return ae(t,n);a(n,String)&&se(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function ae(t,e){if(t&&a(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${H(r)}`,n)}function ue(t){return t?a(t,Proxy)?[t.EL]:a(t,NodeList)?[...t]:M(t)?[t]:Y(t)?t:t.isJQx?t.collection:void 0:[]}function ce(t,e){return t.andThen(e)}function fe(t,e){return t.andThen(e,!0)}function M(t){return a(t,Text,HTMLElement,Comment)}function V(t,e){if(a(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(H(r),n,o)}}function R(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function Ue(t){if(!a(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),s=!!t.hidden,f=parseInt(r.height)<1||parseInt(r.width)<1,v=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,b=+r.opacity==0||+(e.opacity||1)==0;return!(s||v||b||o||n||f)}function Ye(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ge(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Pe(r)?`<!--${r.data}-->`:me(r)?r.textContent:r.outerHTML),"")}function oe(t,e=2){return`${t}`.padStart(e,"0")}function Xe(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function de(){return`_${Kt(Xt).slice(0,8).join("")}`}function Ne(t){return t=a(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,a(t,Array)?t:a(t,String)&&t?.trim().toLowerCase()||""}function Ze(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function He(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function Kt(t){let e=t.length;for(;e--;){let r=Xe(e);[t[e],t[r]]=[t[r],t[e]]}return t}function _(t){return a(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${qt(e)}`||e).join(""):t}function H(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function qt([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function me(t){return a(t,Comment,Text)}function Pe(t){a(t,Comment)}function Ke(t){return a(t,Text)}function U(t){return a(t,String)&&/^<|>$/.test(`${t}`.trim())}function Y(t){return a(t,Array)&&!t?.find(e=>!M(e))}function ge(t){return a(t,Array)&&!t?.find(e=>!U(e))}function C(t,e){let r=t.collection.filter(n=>!me(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function qe(t){return t.node?a(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Oe(t,e,r){let n=e!==document.body&&a(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{L.warn(`JQx: Invalid CSS querySelector. [${a(t,String)?t:"Not a string!"}]`)}}function et(){return{isCommentOrTextNode:me,isNode:M,isComment:Pe,isText:Ke,isHtmlString:U,isArrayOfHtmlElements:Y,isArrayOfHtmlStrings:ge,ElemArray2HtmlString:Ge,input2Collection:ue,setCollectionFromCssSelector:Oe,cssRuleEdit:W({createWithId:"JQxStylesheet"})}}function tt(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return a(n,Node)?Object.freeze({get writable(){return Ye(n)},get modal(){return Ze(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return Ue(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function rt(t,e,r,n){r&&a(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(f=>f.startsWith("JQxClass-")||o&&f===o)||o||`JQxClass-${de().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var er=tt();function nt(t){return{factoryExtensions:tr(t),instanceExtensions:rr(t)}}function tr(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Te)},set(r={}){if(!e.is.empty&&a(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&a(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${H(r)}`),e}}},dimensions(e){if(e.is.empty)return L.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=z(r,0),n.scrollLeftDistance=z(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?I(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let s=a(r,String);return r=s&&o?I(r):r,s&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=a(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=a(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return er(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[H(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let s=a(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&a(n,String)?[n]:n,r=r&&a(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let f of r)e.addClass(f);return s?.startsWith(".")&&e.addClass(s.slice(1)),s?.startsWith("#")&&!e.attr("id")&&e.prop({id:s.slice(1)}),e}}}}}function rr(t){return{addClass(e,...r){return C(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after:ce,afterMe:ce,andThen(e,r,n=!1){if(!r||!a(r,String,Node,Proxy))return L.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:a(r,Node)?t.virtual(r):t.virtual(N(r));let[o,s,f]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[o][s](...r.collection),e.collection=f,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&T(o)){let s=o.trim(),v=!/^<(.+)[^>]+>$/m.test(s)?t.text(o):N(o);C(e,b=>b.append(n?v:R(v)))}M(o)&&C(e,s=>s.append(n?o:R(o))),o.isJQx&&!o.is.empty&&C(e,s=>o.collection.forEach(f=>s.append(n?f:R(f))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!a(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||a(e.node,Text,Comment))return e;if(!n&&T(r))return r=H(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(T(r)&&n)switch(r=H(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return a(r,Object)&&!e.is.empty&&$e(e.node,r),e},before:fe,beforeMe:fe,clear(e){return C(e,le)},closest(e,r){let n=T(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return C(e,o=>rt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return L.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(s=>{s.removeAttribute&&s?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return C(e,r)},empty(e){return C(e,le)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return C(e,r=>V(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!T(r)):return"";case!T(r):return e.node?.getHTML()??"";default:let o=N(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return C(e,f=>(f.textContent=n?f.textContent:"",f.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!T(r)||!T(n))return e;let s=e.find$(r);if(s.length<1)return e;let f=N(`<span>${n}</span>`);return s.each(v=>{o||(v.textContent=""),v.insertAdjacentHTML(t.at.end,f?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!a(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!a(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(T(o)){o=o.trim();let f=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):N(o);f=n?f:R(f),C(e,v=>v.prepend(f.cloneNode(!0)))}M(o)&&C(e,s=>s.prepend(n?o:R(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),C(e,s=>C(o,f=>s.prepend(n?f:R(f)))),o.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(a(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=a(r,Object)?r:{[r]:n};for(let[s,f]of Object.entries(o)){if(s=s.trim(),f&&!se(s)||!f)return!1;if(s.toLowerCase()==="id")return e[0].id=f;C(e,b=>{if(s.startsWith("data"))return b.dataset[s.slice(s.indexOf("-")+1)]=f;b[s]=f})}return e},remove(e,r){let n=s=>s.remove(),o=()=>e.collection=e.collection.filter(s=>document.documentElement.contains(s));if(r){let s=e.find$(r);return s.is.empty||(C(s,n),o()),e}return C(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return C(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=a(r,HTMLElement)||r.isJQx?r:document.body,n=a(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!a(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||a(n,NodeList))&&(n=n[0]),o&&r&&(r=a(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,a(r,HTMLElement,NodeList,Array)&&a(n,HTMLElement)&&(a(r,HTMLElement)?[r]:[...r]).forEach(s=>s.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return C(e,o=>{o.classList.remove(r);for(let s of n)o.classList.add(s)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=a(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return C(e,n=>ae(n,r))},show(e){return C(e,r=>V(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&a(r,String)):return e.find$(r);case(n&&a(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return C(e,s=>{n&&a(r,String)&&(r={[r]:n||"none"}),V(s,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!a(r,String):return e.node.textContent;default:return C(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=A.BeforeEnd){return e.isVirtual=!1,J(e.collection,r,n),e},toggleClass(e,r){return C(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=a(n,Function)?n:Event,o=a(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let s=new n(r,o);return e.is.empty||e.each(f=>f.dispatchEvent(s)),e},val(e,r){switch(!0){case(e.is.empty||!a(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!a(r,String):return e.node.value;default:return e.node.value=a(r,String)?r:"",e}}}}var Me,pe,{isComment:mn,isText:gn,isHtmlString:pn,isArrayOfHtmlElements:yn,isArrayOfHtmlStrings:bn,ElemArray2HtmlString:hn,cssRuleEdit:De,addFn:nr}=or();function or(){return{...et(),addFn:ir}}function ir(t,e){return t=t?.trim(),!T(t)||!a(e,Function)?L.error("JQx.fn: method invalid parameter(s)"):pe[t]=(r,...n)=>e(r,...n)}function sr(t){return function(e,r,n){if(e=e?.trim(),!T(e)||!a(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...s){return r(...s)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return L.log(`JQx: added static extension function [${e}]`)}}function G(t){return new Proxy(t,Object.freeze({get:(e,r)=>lr(e,r,t)}))}function ot(t,e){return(...r)=>a(t,Function)&&t(G(e),...r)}function lr(t,e,r){switch(!0){case a(e,Symbol):return P({trial:()=>t[e],whenError:()=>t});case a(+e,Number):return t.collection?.[e]||void 0;case e in Me:return ot(Me[e],r)();case e in pe:return ot(pe[e],r);default:return t[e]}}function lt(t){let e=dr(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function ar(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?_(e):e.toLowerCase(),O.allowTag(e),Object.defineProperties(t,Ie(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),O.prohibitTag(e),Object.defineProperties(t,Ie(e,!1,t))}}}function it(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))De(e,{removeRule:1})}function ur(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(A).find(s=>n===s);let o=t(e,document.createElement("br"));if(r&&!a(r,HTMLBRElement))for(let s of o.collection)n?r.insertAdjacentElement(n,s):r.append(s);return o}}function cr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,s]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...s,enumerable:!1})}return e}function fr(t,e,r,n){return t=H(n||t.toLowerCase()),{get(){return(...o)=>{let s=e&&r.virtual(j(X[t](...o)))||void 0,v=!a(s?.node,Comment,Text,void 0)?Ae(s):"";return L.log(e?`JQx: created (virtual) instance from [JQx].${t} ${v}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),s}},enumerable:!1,configurable:!0}}function Ie(t,e,r,n){t=t.toLowerCase();let o=fr(t,e,r,n);return n?{[n]:o,[_(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function dr(t){return cr(Object.entries(O.tagsRaw).reduce(mr(t),{}),Sr(t))}function mr(t){return function(e,[r,n]){return Object.defineProperties(e,Ie(r,n,t)),e}}function gr(t){return function(e,r,...n){a(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function pr(t){return function(e){let{type:r,types:n,origin:o,selector:s,handler:f,handlers:v,node:b,name:E,capture:d,once:h,about:p}=e;f=v||f,r=n||r,s=o||s;let S=Ne(r),g=E;f=a(f,Function)?[f]:f;let c={type:S,selector:s||o,capture:d,name:g,once:h,node:b,about:p};switch(!0){case(a(S,Array)&&S.length>0):for(let i of S)c.type=i,st(f,c,t);break;default:return st(f,c,t)}}}function st(t,e,r){for(let n of t)r.listen({...e,handler:n})}function yr(t){return function(e,r){return r=T(r)&&r,e=T(e)&&e,r&&e&&t.listenerStore[e][r]}}function br(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:te(t),enumerable:!1}),t.activePopup}function hr(t){let e=(d,h)=>De(d,h),r=function(d){return W({createWithId:d||`jqx${de()}`})},n=function(...d){for(let h of d)De(h)},o=ar(t),s=re(t),f=pr(s);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:f,capturedHandling:f,log:(...d)=>L.on.log(...d).off,warn:(...d)=>L.on.warn(...d).off,error:(...d)=>L.on.error(...d).off,handlerWrapper:s}}function Sr(t){let{factoryExtensions:e,instanceExtensions:r}=nt(t);Me=e,pe=r;let{editCssRule:n,createStyle:o,editCssRules:s,allowProhibit:f,handle:v,capturedHandling:b,log:E,warn:d,error:h,handlerWrapper:p}=hr(t),S=yr(t),g=sr(t);return{log:E,warn:d,error:h,editCssRules:s,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:I,logger:L,text(c,i=!1){return i?t.comment(c):document.createTextNode(c)},node(c,i=document){return i.querySelector(c,i)},nodes(c,i=document){return[...i.querySelectorAll(c,i)]},clearAllTimers:Fe,get staticFn(){return function(c,i,u){return g(c,i,u)}},get toBool(){return He},get getNamedListener(){return S},get virtual(){return ur(t)},get allowTag(){return f.allow},get prohibitTag(){return f.prohibit},get removeCssRule(){return it},get removeCssRules(){return it},get delegate(){return gr(b)},get delegateCaptured(){return b},get handle(){return b},get listen(){return p.listen},get at(){return A},get setStyle(){return n},get fn(){return nr},get lenient(){return O.allowUnknownHtmlTags},get IS(){return a},get Popup(){return br(t)},get listenerStore(){return p.ListenerStore}}}var at=lt(xr());function xr(){return function(e,r,n=A.BeforeEnd){if(e?.isJQx)return e;let o=a(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(A).find(d=>n===d)?n:void 0;let s=U(e),v=!s&&ge(e)||s,b={collection:ue(e)??[],isVirtual:o,isJQx:!0},E=Y(b.collection);if(b.collection.length&&E)return o||b.collection.forEach(d=>{r.contains(d)||J([d],r,n)}),G(b);if(v){if([e].flat().forEach(d=>b.collection.push(N(d))),b.collection.length>0){let d=b.collection.filter(g=>g?.dataset?.jqxcreationerror);b.collection=b.collection.filter(g=>!g?.dataset?.jqxcreationerror);let p=b.collection.map(g=>`${String(g.constructor).split(/function|\(/)[1].trim()}`).length>1;b=G(b);let S=b.collection.length>0?qe(b):"sanitized: no elements remaining";L.log(`JQx: created ${b.isVirtual?"(virtual)":""} instance from ${p?"array of ":""}HTML string${p?"s":""} ${S}`),b.isVirtual||J(b.collection,r,n)}return b}return Oe(e,r,b),G(b)}}var vr=at;return gt(wr);})();
|
package/Bundle/jqx.min.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var{IS:s,maybe:W,$Wrap:pr,isNothing:yr,xProxy:br,addSymbolicExtensions:hr}=ct({useSymbolicExtensions:!1});function ct(t={}){let{useSymbolicExtensions:e}=t,{xProxy:r,addSymbolicExtensions:n}=ft(a,f,e),o=C(),[i]=[N()];return r.custom(),e&&n(),{IS:a,maybe:o,$Wrap:i,isNothing:b,xProxy:r,addSymbolicExtensions:n};function a(l,...d){let v=typeof l=="symbol"?Symbol.isSymbol:l;switch(!0){case!!o({trial:L=>"isTypes"in(d?.[0]??{})}):return w(l,d[0]);default:return d.length>1?m(v,...d):E(l,...d)}}function w(l,d){switch(!0){case"defaultValue"in d:return u(l,d);case"notTypes"in d:return y(l,d);default:return a(l,...[d.isTypes].flat())}}function f(l){return l?.[Symbol.proxy]??a(l)}function E(l,...d){let{noInput:v,noShouldbe:L,compareTo:O,inputCTOR:J,isNaN:B,isInfinity:at,shouldBeFirstElementIsNothing:ut}=c(l,...d);switch(d=d.length&&d[0],!0){case ut:return String(l)===String(O);case(l?.[Symbol.proxy]&&L):return l[Symbol.proxy];case B:return L?"NaN":String(O)===String(l);case at:return L?"Infinity":String(O)===String(l);case v:return L?String(l):String(O)===String(l);case J===Boolean:return d?J===d:"Boolean";default:return g(l,d,L,h(l,J))}}function c(l,...d){let v=d.length<1,L=l==null;return{noInput:L,noShouldbe:v,compareTo:!v&&d[0],inputCTOR:!L&&Object.getPrototypeOf(l)?.constructor,isNaN:Number.isNaN(l)||o({trial:O=>String(l)==="NaN"}),isInfinity:o({trial:O=>String(l)})==="Infinity",shouldBeFirstElementIsNothing:!v&&b(d[0])}}function h(l,d){switch(!0){case l===0:return Number;case l==="":return String;case!l:return{name:String(l)};default:return d}}function g(l,d,v,L){switch(!0){case(!v&&d===l||l?.[Symbol.proxy]&&d===Proxy):return!0;case String(d)==="NaN":return String(l)==="NaN";case(l?.[Symbol.toStringTag]&&typeof d=="string"):return String(d)===l[Symbol.toStringTag];default:return d?p(l,d,L):S(l,L)}}function S(l,d){return(l?.[Symbol.toStringTag]??l?.prototype?.[Symbol.toStringTag])||d?.name||String(d)}function p(l,d,v){return o({trial:L=>l instanceof d})||d===v||d===Object.getPrototypeOf(v)||`${d?.name}`===v?.name}function m(l,...d){return d.some(v=>a(l,v))}function b(l,d=!1){let v=l==null;return v=d?v||a(l,1/0)||a(l,NaN):v,v}function C(){let l=d=>{};return function({trial:d,whenError:v=l}={}){try{return d()}catch(L){return v(L)}}}function N(){return function(l){return Object.freeze({get value(){return l},get[Symbol.type](){return f(l)},get type(){return f(l)},[Symbol.is](...d){return a(l,...d)},is(...d){return a(l,...d)}})}}function u(l,{defaultValue:d,isTypes:v=[void 0],notTypes:L}={}){return v=v?.constructor!==Array?[v]:v,L=L&&L?.constructor!==Array?[L]:[],L.length<1?a(l,...v)?l:d:y(l,{isTypes:v,notTypes:L})?l:d}function y(l,{isTypes:d=[void 0],notTypes:v=[void 0]}={}){return d=d?.constructor!==Array?[d]:d,v=v?.constructor!==Array?[v]:v,a(l,...d)&&!a(l,...v)}function x(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return f(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return a(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return f(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...d){return a(l,...d)},enumerable:!1,configurable:!1}}))}}function ft(t,e,r){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for("toa.isASymbol")),{xProxy:w(),addSymbolicExtensions:n};function n(){Symbol.is||(Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type")),Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return e(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...f){return t(this,...f)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(f){return e(f)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(f,...E){return t(f,...E)},enumerable:!1,configurable:!1}}))}function o(f){let E=f.set;return f.set=(c,h,g)=>h===Symbol.proxy?c[h]=g:E(c,h,g),f}function i(f){return Object.getPrototypeOf(f)?.constructor?.name||"Object"}function a(f){return Proxy=new f(f,{construct(E,c){for(let g of c)g.set&&(g=o(g));let h=new E(...c);return h[Symbol.proxy]=`Proxy (${i(c[0])})`,h}}),Proxy}function w(){Symbol.proxy||(Symbol.proxy=Symbol.for("toa.proxy"));let f=Proxy;return{native(){Proxy=f},custom(){Proxy=a(f)}}}}var Ie=gt(),z=dt(),V=mt();function dt(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function mt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function gt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var je={html:"innerHTML",text:"textContent",class:"className"},ee=pt();function pt(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Ct(n):return Re(e,n,r);default:return Re(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function Re(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>wt(r):Lt(e)}}),t[e]}function yt(t,e,r){return e=e?.isJQx&&e.first()||e,W({trial:n=>Et(e)?t.append(e):Qe(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
-
`,n)})}function
|
|
3
|
-
=> @charset, @namespace and @import are not supported here`),{done:!0}}function
|
|
4
|
-
${
|
|
5
|
-
Rule: ${ve(
|
|
6
|
-
${r}`),
|
|
7
|
-
${
|
|
1
|
+
var{IS:a,maybe:P,$Wrap:gr,isNothing:pr,xProxy:yr,addSymbolicExtensions:br}=at({useSymbolicExtensions:!1});function at(t={}){let{useSymbolicExtensions:e}=t,{shouldbeIsSingleObject:r,ISOneOf:n,isOrDefault:o,isExcept:s,typeOf:f,SymbolAndCustomProxyFactory:v,WrapAnyFactory:b,verifyNothingness:E,determineType:d,xProxy:h,addSymbolicExtensions:p,maybe:S,$Wrap:g}=ut(c,e);return h.custom(),e&&p(),{IS:c,maybe:S,$Wrap:g,isNothing:E,xProxy:h,addSymbolicExtensions:p};function c(i,...u){let y=typeof i=="symbol"?Symbol.isSymbol:i;switch(!0){case!!S({trial:l=>"isTypes"in(u?.[0]??{})}):return r(i,u[0]);default:return u.length>1?n(y,...u):d(i,...u)}}}function ut(t,e){let{SymbolAndCustomProxyFactory:r,maybeFactory:n,WrapAnyFactory:o,verifyNothingness:s,determineType:f}=ct(t,h),{xProxy:v,addSymbolicExtensions:b}=r(t,h,e),[E,d]=[n(),o(t,h)];return Object.freeze({shouldbeIsSingleObject:p,ISOneOf:S,isOrDefault:g,isExcept:c,typeOf:h,SymbolAndCustomProxyFactory:r,maybe:E,WrapAnyFactory:o,verifyNothingness:s,determineType:f,xProxy:v,addSymbolicExtensions:b,$Wrap:d});function h(i){return i?.[Symbol.proxy]??t(i)}function p(i,u){switch(!0){case"defaultValue"in u:return g(i,u);case"notTypes"in u:return c(i,u);default:return t(i,...[u.isTypes].flat())}}function S(i,...u){return u.some(y=>t(i,y))}function g(i,{defaultValue:u,isTypes:y=[void 0],notTypes:l}={}){return y=y?.constructor!==Array?[y]:y,l=l&&l?.constructor!==Array?[l]:[],l.length<1?t(i,...y)?i:u:c(i,{isTypes:y,notTypes:l})?i:u}function c(i,{isTypes:u=[void 0],notTypes:y=[void 0]}={}){return u=u?.constructor!==Array?[u]:u,y=y?.constructor!==Array?[y]:y,t(i,...u)&&!t(i,...y)}}function ct(){let t={IS:"toa.is",TYPE:"toa.type",IS_SYMBOL:"toa.isASymbol",PROXY:"toa.proxy"},e={NAN:"NaN",INFINITY:"Infinity",BOOLEAN:"Boolean",OBJECT:"Object",PROXY_PREFIX:"Proxy ("};return Object.freeze({SymbolAndCustomProxyFactory:n,maybeFactory:g,WrapAnyFactory:S,verifyNothingness:c,determineType:b});function r(i,u){Symbol.is||(Symbol.is=Symbol.for(t.IS),Symbol.type=Symbol.for(t.TYPE),Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return u(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...y){return i(this,...y)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(y){return u(y)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(y,...l){return i(y,...l)},enumerable:!1,configurable:!1}}))}function n(i,u,y){return Symbol.isSymbol||(Symbol.isSymbol=Symbol.for(t.IS_SYMBOL)),{xProxy:f(),addSymbolicExtensions:()=>r(i,u)}}function o(i){return Object.getPrototypeOf(i)?.constructor?.name||e.OBJECT}function s(i){return Proxy=new i(i,{construct(u,y){let l=new u(...y);return l[Symbol.proxy]=`${e.PROXY_PREFIX}${o(y[0])})`,l}}),Proxy}function f(){Symbol.proxy||(Symbol.proxy=Symbol.for(t.PROXY));let i=Proxy;return{native(){Proxy=i},custom(){Proxy=s(i)}}}function v(i,...u){let y=u.length<1,l=i==null;return{noInput:l,noShouldbe:y,compareTo:!y&&u[0],inputCTOR:!l&&Object.getPrototypeOf(i)?.constructor,isNaN:Number.isNaN(i)||P({trial:m=>String(i)===e.NAN}),isInfinity:P({trial:m=>String(i)})===e.INFINITY,shouldBeFirstElementIsNothing:!y&&c(u[0])}}function b(i,...u){let{noInput:y,noShouldbe:l,compareTo:m,inputCTOR:x,isNaN:w,isInfinity:F,shouldBeFirstElementIsNothing:D}=v(i,...u);switch(u=u.length&&u[0],!0){case D:return String(i)===String(m);case(i?.[Symbol.proxy]&&l):return i[Symbol.proxy];case w:return l?e.NAN:String(m)===String(i);case F:return l?e.INFINITY:String(m)===String(i);case y:return l?String(i):String(m)===String(i);case x===Boolean:return u?x===u:e.BOOLEAN;default:return d(i,u,l,E(i,x))}}function E(i,u){switch(!0){case i===0:return Number;case i==="":return String;case!i:return{name:String(i)};default:return u}}function d(i,u,y,l){switch(!0){case(!y&&u===i||i?.[Symbol.proxy]&&u===Proxy):return!0;case String(u)===e.NAN:return String(i)===e.NAN;case(i?.[Symbol.toStringTag]&&typeof u=="string"):return String(u)===i[Symbol.toStringTag];default:return u?p(i,u,l):h(i,l)}}function h(i,u){return(i?.[Symbol.toStringTag]??i?.prototype?.[Symbol.toStringTag])||u?.name||String(u)}function p(i,u,y){return P({trial:l=>i instanceof u})||u===y||u===Object.getPrototypeOf(y)||`${u?.name}`===y?.name}function S(i,u){return function(y){let l={get value(){return y},is(...m){return i(y,...m)},get type(){return u(y)}};return Object[Symbol.type]&&Object.defineProperties(l,{[Symbol.type]:{get(){return u(y)}},[Symbol.is]:{value(...m){return i(y,...m)}}}),Object.freeze(l)}}function g(){let i=u=>{};return function({trial:u,whenError:y=i}={}){try{return u()}catch(l){return y(l)}}}function c(i,u=!1){let y=i==null;return y=u?y||a(i,1/0)||a(i,NaN):y,y}}var Ie=mt(),Q=ft(),k=dt();function ft(){return{html:Object.freeze("accept,action,align,alt,autocapitalize,autocomplete,autopictureinpicture,autoplay,background,bgcolor,border,capture,cellpadding,cellspacing,checked,cite,class,clear,contenteditable,color,cols,colspan,controls,controlslist,coords,crossorigin,datetime,decoding,default,dir,disabled,disablepictureinpicture,disableremoteplayback,download,draggable,enctype,enterkeyhint,face,for,headers,height,hidden,high,href,hreflang,id,inputmode,integrity,is,ismap,kind,label,lang,list,loading,loop,low,max,maxlength,media,method,min,minlength,multiple,muted,name,nonce,noshade,novalidate,nowrap,open,optimum,pattern,placeholder,playsinline,poster,preload,pubdate,radiogroup,readonly,rel,required,rev,reversed,role,rows,rowspan,spellcheck,scope,selected,shape,size,sizes,span,srclang,start,src,srcset,step,style,summary,tabindex,target,title,translate,type,usemap,valign,value,width,xmlns,slot".split(",")),svg:Object.freeze("accent-height,accumulate,additive,alignment-baseline,ascent,attributename,attributetype,azimuth,basefrequency,baseline-shift,begin,bias,by,class,clip,clippathunits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,cx,cy,d,dx,dy,diffuseconstant,direction,display,divisor,dur,edgemode,elevation,end,fill,fill-opacity,fill-rule,filter,filterunits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,fx,fy,g1,g2,glyph-name,glyphref,gradientunits,gradienttransform,height,href,id,image-rendering,in,in2,k,k1,k2,k3,k4,kerning,keypoints,keysplines,keytimes,lang,lengthadjust,letter-spacing,kernelmatrix,kernelunitlength,lighting-color,local,marker-end,marker-mid,marker-start,markerheight,markerunits,markerwidth,maskcontentunits,maskunits,max,mask,media,method,mode,min,name,numoctaves,offset,operator,opacity,order,orient,orientation,origin,overflow,paint-order,path,pathlength,patterncontentunits,patterntransform,patternunits,points,preservealpha,preserveaspectratio,primitiveunits,r,rx,ry,radius,refx,refy,repeatcount,repeatdur,restart,result,rotate,scale,seed,shape-rendering,specularconstant,specularexponent,spreadmethod,startoffset,stddeviation,stitchtiles,stop-color,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke,stroke-width,style,surfacescale,systemlanguage,tabindex,targetx,targety,transform,text-anchor,text-decoration,text-rendering,textlength,type,u1,u2,unicode,values,viewbox,visibility,version,vert-adv-y,vert-origin-x,vert-origin-y,width,word-spacing,wrap,writing-mode,xchannelselector,ychannelselector,x,x1,x2,xmlns,y,y1,y2,z,zoomandpan".split(","))}}function dt(){return{a:!0,area:!0,audio:!1,br:!0,base:!0,body:!0,button:!0,canvas:!0,comment:!0,dl:!0,data:!0,datalist:!0,div:!0,em:!0,embed:!1,fieldset:!0,font:!0,footer:!0,form:!1,hr:!0,head:!0,header:!0,output:!0,iframe:!1,frameset:!1,img:!0,input:!0,li:!0,label:!0,legend:!0,link:!0,map:!0,mark:!0,menu:!0,media:!0,meta:!0,nav:!0,meter:!0,ol:!0,object:!1,optgroup:!0,option:!0,p:!0,param:!0,picture:!0,pre:!0,progress:!1,quote:!0,script:!1,select:!0,source:!0,span:!0,style:!0,caption:!0,td:!0,col:!0,table:!0,tr:!0,template:!1,textarea:!0,time:!0,title:!0,track:!0,details:!0,ul:!0,video:!0,del:!0,ins:!0,slot:!0,blockquote:!0,svg:!0,dialog:!0,summary:!0,main:!0,address:!0,colgroup:!0,tbody:!0,tfoot:!0,thead:!0,th:!0,dd:!0,dt:!0,figcaption:!0,figure:!0,i:!0,b:!0,code:!0,h1:!0,h2:!0,h3:!0,h4:!0,abbr:!0,bdo:!0,dfn:!0,kbd:!0,q:!0,rb:!0,rp:!0,rt:!0,ruby:!0,s:!0,strike:!0,samp:!0,small:!0,strong:!0,sup:!0,sub:!0,u:!0,var:!0,wbr:!0,nobr:!0,tt:!0,noscript:!0}}function mt(){return["::backdrop{background-color:grey;opacity:0.2;}",`#jqxPopup{overflow:hidden;background-color:transparent;outline:none;border:none;inset:0;animation:fade-out 0.5s ease-out;&[open]{display:flex;align-items:center;justify-content:center;animation:fade-in 0.5s ease;}#jqxPopupContent{background-color:white;border:solid 1px #eee;box-shadow:1px 2px 8px #999;border-radius:4px;padding:12px;vertical-align:middle;max-height:40vh;max-width:50vw;overflow:auto;margin:0 auto;div:not(#closeHandleIcon){clear:both;}@media (width <= 640px){max-width:80vw;max-height:60vh;}#closeHandleIcon{cursor:pointer;width:24px;height:24px;display:inline;position:absolute;top:4px;right:4px;justify-content:right;background-image:url("data:image/svg+xml;utf8,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22iso-8859-1%22%3F%3E%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20version%3D%221.1%22%20id%3D%22Layer_1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20128%20128%22%20style%3D%22enable-background%3Anew%200%200%20128%20128%3B%22%20xml%3Aspace%3D%22preserve%22%3E%3Crect%20x%3D%22-368%22%20y%3D%226%22%20style%3D%22display%3Anone%3Bfill%3A%23E0E0E0%3B%22%20width%3D%22866%22%20height%3D%221018%22%2F%3E%3Ccircle%20style%3D%22fill%3A%23FFFFFF%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Ccircle%20style%3D%22fill%3A%238CCFB9%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2239%22%2F%3E%3Ccircle%20style%3D%22fill%3Anone%3Bstroke%3A%23444B54%3Bstroke-width%3A6%3Bstroke-miterlimit%3A10%3B%22%20cx%3D%2264%22%20cy%3D%2264%22%20r%3D%2248%22%2F%3E%3Cpolyline%20style%3D%22fill%3Anone%3Bstroke%3A%23FFFFFF%3Bstroke-width%3A6%3Bstroke-linecap%3Around%3Bstroke-miterlimit%3A10%3B%22%20points%3D%2242%2C69%2055.55%2C81%20%20%2086%2C46%20%22%2F%3E%3C%2Fsvg%3E");@media (width <= 640px){background-image:none;position:relative;margin:-15px -15px 4px 0;float:right;vertical-align:middle;border:1px solid #AAA;padding:2px;border-radius:50%;width:12px;height:12px;font-size:12px;line-height:12px;font-weight:bold;text-align:center;&:after{content:'\\2714';color:green;}}}.warn{display:none;text-align:center;color:red;border-top:1px solid #999;margin-top:1em;padding-top:3px;animation:warn-fade-out 0.2s ease-out;}.warn.active{opacity:1;display:block;animation:warn-fade-in 0.2s ease-in;}}}`,"@keyframes fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1, 1);display:flex;}}","@keyframes fade-out{0%{opacity:1;transform:scale(1, 1);display:flex;}100%{opacity:0;transform:scale(0, 0);display:none;}}","@keyframes warn-fade-in{0%{opacity:0;transform:scale(0, 0);display:none;}100%{opacity:1;transform:scale(1,1 );display:block;}}","@keyframes warn-fade-out{0%{opacity:1;transform:scale(1, 1);display:block;}100%{opacity:0;transform:scale(0, 0);display:none;}}"]}var Re={html:"innerHTML",text:"textContent",class:"className"},X=gt();function gt(){let t={get(e,r){let n=String(r)?.toLowerCase();switch(!0){case n in e:return e[n];case Et(n):return je(e,n,r);default:return je(e,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},t)}function je(t,e,r,n=!1){return Object.defineProperty(t,e,{get(){return n?o=>vt(r):Ct(e)}}),t[e]}function pt(t,e,r){return e=e?.isJQx&&e.first()||e,P({trial:n=>wt(e)?t.append(e):Qe(e)?t.insertAdjacentHTML("beforeend",e):t.append(e),whenError:n=>console.info(`${r} (for root ${t}) not created, reason
|
|
2
|
+
`,n)})}function yt(t,e,...r){let n=bt(e,t);return r?.forEach(o=>pt(n,o,t)),n}function bt(t,e){switch(t=xe(e)?xt(t):t?.isJQx?t.first():t,!0){case a(t,String):return B(e,Qe(t,e)?{html:t}:{text:t});case a(t,Node):return St(e,t);default:return B(e,t)}}function ht(t){return delete t.data,Object.keys(t).length<1||Object.keys(t).forEach(e=>{let r=e.toLowerCase();r in Re&&(t[Re[r]]=t[e],delete t[e])}),t}function St(t,e){let r=B(t);return r.append(e),r}function B(t,e={}){e=Je(e,{});let r=Object.entries(e.data??{}),n=Object.assign(xe(t)?new Comment(e?.text):document.createElement(t),ht(e));return r.length&&r.forEach(([o,s])=>n.dataset[o]=String(s)),n}function Je(t,e){return e?a(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:e}):a(t,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function xt(t){return Je(t)?t?.text??t?.textContent??"":String(t)}function vt(t){return B("b",{style:"color:red",text:`'${t}' is not a valid HTML-tag`})}function Qe(t,e){return!xe(e)&&a(t,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(t)}function wt(t){return t?.constructor===Comment||t?.constructor===CharacterData}function xe(t){return t?.constructor===Comment||/comment/i.test(t)}function Et(t){return!a(B(t),HTMLUnknownElement)}function Ct(t){return(e,...r)=>yt(t,e,...r)}var{IS:Z,maybe:wr,$Wrap:Er,xProxy:Cr,isNothing:Lr}=Lt();function Lt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),c();let t=h(),[e,r]=[p(),y()];return r.custom(),{IS:n,maybe:t,$Wrap:e,isNothing:d,xProxy:r};function n(l,...m){if(t({trial:w=>"isTypes"in(m?.[0]??{})})){let w=m[0];return"defaultValue"in w?S(l,w):"notTypes"in w?g(l,w):n(l,...[w.isTypes].flat())}let x=typeof l=="symbol"?Symbol.isSymbol:l;return m.length>1?E(x,...m):s(l,...m)}function o(l){return l?.[Symbol.proxy]??n(l)}function s(l,...m){let{noInput:x,noShouldbe:w,compareTo:F,inputCTOR:D,isNaN:ye,isInfinity:be,shouldBeFirstElementIsNothing:he}=v(l,...m);switch(m=m.length&&m[0],!0){case he:return String(l)===String(F);case(l?.[Symbol.proxy]&&w):return l[Symbol.proxy];case ye:return w?"NaN":t({trial:Se=>String(F)})===String(l);case be:return w?"Infinity":t({trial:Se=>String(F)})===String(l);case x:return w?String(l):String(F)===String(l);case D===Boolean:return m?D===m:"Boolean";default:return b(l,m,w,f(l,D))}}function f(l,m){return l===0?Number:l===""?String:l?m:{name:String(l)}}function v(l,...m){let x=m.length<1,w=!x&&m[0],F=!x&&d(m[0]),D=l==null,ye=!D&&Object.getPrototypeOf(l)?.constructor,be=t({trial:Se=>String(l)})==="NaN",he=t({trial:Se=>String(l)})==="Infinity";return{noInput:D,noShouldbe:x,compareTo:w,inputCTOR:ye,isNaN:be,isInfinity:he,shouldBeFirstElementIsNothing:F}}function b(l,m,x,w){switch(!0){case(!x&&m===l||l?.[Symbol.proxy]&&m===Proxy):return!0;case t({trial:F=>String(m)})==="NaN":return String(l)==="NaN";case(l?.[Symbol.toStringTag]&&n(m,String)):return String(m)===l[Symbol.toStringTag];default:return m?t({trial:F=>l instanceof m})||m===w||m===Object.getPrototypeOf(w)||`${m?.name}`===w?.name:l?.[Symbol.toStringTag]&&`[object ${l?.[Symbol.toStringTag]}]`||w?.name||String(w)}}function E(l,...m){return m.some(x=>n(l,x))}function d(l,m=!1){let x=l==null;return x=m?x||n(l,1/0)||n(l,NaN):x,x}function h(){let l=(m,x)=>m?.constructor===Function?m(x):void 0;return function({trial:m,whenError:x=()=>{}}={}){try{return l(m)}catch(w){return l(x,w)}}}function p(){return function(l){return Object.freeze({get value(){return l},get[Symbol.type](){return o(l)},get type(){return o(l)},[Symbol.is](...m){return n(l,...m)},is(...m){return n(l,...m)}})}}function S(l,{defaultValue:m,isTypes:x=[void 0],notTypes:w}={}){return x=x?.constructor!==Array?[x]:x,w=w&&w?.constructor!==Array?[w]:[],w.length<1?n(l,...x)?l:m:g(l,{isTypes:x,notTypes:w})?l:m}function g(l,{isTypes:m=[void 0],notTypes:x=[void 0]}={}){return m=m?.constructor!==Array?[m]:m,x=x?.constructor!==Array?[x]:x,n(l,...m)&&!n(l,...x)}function c(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return o(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...l){return n(this,...l)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(l){return o(l)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(l,...m){return n(l,...m)},enumerable:!1,configurable:!1}}))}function i(l){let m=String(Object.getPrototypeOf(l)?.constructor);return m.slice(m.indexOf("ion")+3,m.indexOf("(")).trim()}function u(l){let m=l.set;return l.set=(x,w,F)=>w===Symbol.proxy?x[w]=F:m(x,w,F),l}function y(){let l=Proxy;return{native(){Proxy=l},custom(){Proxy=new l(l,{construct(m,x){for(let F of x)F.set&&(F=u(F));let w=new m(...x);return w[Symbol.proxy]=`Proxy (${i(x[0])})`,w}})}}}}var W=Tt;function Tt({styleSheet:t,createWithId:e}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:o,sheet:s,removeRules:f,consider:v,currentSheetID:b}=Ft({styleSheet:t,createWithId:e});function E(g,c){if(g&&c.removeProperties){Object.keys(c.removeProperties).forEach(i=>g.style.removeProperty(ke(i)));return}Object.entries(c).forEach(([i,u])=>{i=ke(i.trim()),u=u.trim();let y;if(/!important/.test(u)&&(u=u.slice(0,u.indexOf("!important")).trim(),y="important"),!CSS.supports(i,u))return console.error(`StylingFactory ${b} error: '${i}' with value '${u}' not supported (yet)`);Be(()=>g.style.setProperty(i,u,y),`StylingFactory ${b} (setRule4Selector) failed`)})}function d(g,c,i=s){if(g=g?.trim?.(),!Z(g,String)||!g.length||/[;,]$/g.test(g))return console.error(`StylingFactory ${b} (setRules): [${g||"[no selector given]"}] is not a valid selector`);if(c.removeRule)return f(g);let u=n(g,!0),y=u||i.cssRules[i.insertRule(`${g} {}`,i.cssRules.length||0)];return v(()=>E(y,c),g,u)}function h(g){let c=g.trim().split(/{/,2),i=c.shift().trim();if(!Z(i,String)||!i?.trim()?.length)return console.error(`StylingFactory ${b} (doParse): no (valid) selector could be extracted from rule ${ve(g)}`);let u=Mt(c.shift());return Be(()=>d(i,u),`StylingFactory ${b} (setRules) failed`)}function p(g){let c=r(g);return c.done?c.existing:h(g)}function S(g,c){return g.trim().startsWith("@media")?p(At(g,c)):d(g,c)}return function(g,c={}){return o(g,c)&&(Object.keys(c).length?S(g,c):p(g))}}function Ft({styleSheet:t,createWithId:e}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${e}`;t=e?o(e):t;function o(p){let S=document.querySelector(`#${p}`)?.sheet;if(S)return S;let g=Object.assign(document.createElement("style"),{id:p});return document.head.insertAdjacentElement("beforeend",g),g.sheet}function s(p){return console.error(`StylingFactory ${n} [rule: ${p}]
|
|
3
|
+
=> @charset, @namespace and @import are not supported here`),{done:!0}}function f(p,S){return[...t.rules].find(g=>S?We(g.selectorText||"",p):Ht`${Nt(p)}${[..."gim"]}`.test(g.cssText))}function v(p){return/^@charset|@import|namespace/i.test(p.trim())?s(p):p.match(/}/g)?.length>1?{existing:d(p,1),done:!0}:{done:!1}}function b(p){let S=[...t.cssRules].reduce((c,i,u)=>We(i.selectorText||"",p)&&c.concat(u)||c,[]),g=S.length;return S.forEach(c=>t.deleteRule(c)),g>0?console.info(`\u2714 Removed ${g} instance${g>1?"s":""} of selector ${p} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${p} does not exist in ${n.slice(4)}`)}function E(p,S){return p&&Z(p,String)&&p.trim().length>0&&Z(S,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function d(p){p=p.trim();let S=p.slice(0,p.indexOf("{")).trim(),g=!!f(S);try{return t.insertRule(`${p}`,t.cssRules.length),g}catch(c){return console.error(`StylingFactory ${n} (tryParse) ${c.name} Error:
|
|
4
|
+
${c.message}
|
|
5
|
+
Rule: ${ve(p)}
|
|
6
|
+
${r}`),g}}function h(p,S,g){try{return p(),g}catch(c){return console.error(`StylingFactory ${n} (tryAddOrModify) ${c.name} Error:
|
|
7
|
+
${c.message}
|
|
8
8
|
Rule: ${ve(S)}
|
|
9
|
-
${r}`),
|
|
10
|
-
`)}function Nt(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function
|
|
11
|
-
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function ke(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function
|
|
9
|
+
${r}`),g}}return{sheet:t,removeRules:b,tryParseAtOrNestedRules:v,ruleExists:f,checkParams:E,tryParse:d,consider:h,currentSheetID:n}}function At(t,e){return`${t.trim()} ${Object.entries(e).map(([r,n])=>`${r}: { ${$t(n)}`)}`}function ve(t){let e=(t||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return t.length>e.length?`${e.trim()}...truncated`:e}function $t(t){return Object.entries(t).map(([e,r])=>`${e}: ${r.trim()}`).join(`;
|
|
10
|
+
`)}function Nt(t){return t.replace(/([*\[\]()-+{}.$?\\])/g,e=>`\\${e}`)}function Ht(t,...e){let r=e.length&&Array.isArray(e.slice(-1))?e.pop().join(""):"";return new RegExp((e.length&&t.raw.reduce((n,o,s)=>n.concat(e[s-1]||"").concat(o),"")||t.raw.join("")).split(`
|
|
11
|
+
`).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function ke(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Be(t,e){try{return t()}catch(r){console.error(`${e||"an error occured"}: ${r.message}`)}}function Pt(t){return t.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(e,r)=>`${r}\\3b`).split(";").map(e=>e.trim()).join(`;
|
|
12
12
|
`).replaceAll("\\3b",";").split(`
|
|
13
|
-
`)}function Ot(t){return t.reduce((e,r)=>{let[n,o]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&o?{...e,[n]:o}:e},{})}function
|
|
14
|
-
`)),n}function
|
|
15
|
-
`)),n}function
|
|
16
|
-
`));default:return n}}return Object.defineProperties(n,{log:{value:f,enumerable:!1},error:{value:a,enumerable:!1},warn:{value:w,enumerable:!1}}),Object.freeze(n)}function ue(){return(t=>`[${ae(t.getHours())}:${ae(t.getMinutes())}:${ae(t.getSeconds())}.${ae(t.getMilliseconds(),3)}]`)(new Date)}function $e(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=M(r),r.startsWith("data"))return de(t,n);s(n,String)&&ce(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function de(t,e){if(t&&s(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${M(r)}`,n)}function me(t){return t?s(t,Proxy)?[t.EL]:s(t,NodeList)?[...t]:I(t)?[t]:K(t)?t:t.isJQx?t.collection:void 0:[]}function ge(t,e){return t.andThen(e)}function pe(t,e){return t.andThen(e,!0)}function I(t){return s(t,Text,HTMLElement,Comment)}function Z(t,e){if(s(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(M(r),n,o)}}function R(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function Ue(t){if(!s(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),i=!!t.hidden,a=parseInt(r.height)<1||parseInt(r.width)<1,w=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,f=+r.opacity==0||+(e.opacity||1)==0;return!(i||w||f||o||n||a)}function _e(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ge(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(Ne(r)?`<!--${r.data}-->`:be(r)?r.textContent:r.outerHTML),"")}function ae(t,e=2){return`${t}`.padStart(e,"0")}function Ze(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function ye(){return`_${Ut(Bt).slice(0,8).join("")}`}function Ae(t){return t=s(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,s(t,Array)?t:s(t,String)&&t?.trim().toLowerCase()||""}function Ye(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function He(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function Ut(t){let e=t.length;for(;e--;){let r=Ze(e);[t[e],t[r]]=[t[r],t[e]]}return t}function Y(t){return s(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${_t(e)}`||e).join(""):t}function M(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function _t([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function be(t){return s(t,Comment,Text)}function Ne(t){s(t,Comment)}function Xe(t){return s(t,Text)}function X(t){return s(t,String)&&/^<|>$/.test(`${t}`.trim())}function K(t){return s(t,Array)&&!t?.find(e=>!I(e))}function he(t){return s(t,Array)&&!t?.find(e=>!X(e))}function T(t,e){let r=t.collection.filter(n=>!be(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Ke(t){return t.node?s(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Pe(t,e,r){let n=e!==document.body&&s(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{F.warn(`JQx: Invalid CSS querySelector. [${s(t,String)?t:"Not a string!"}]`)}}function qe(){return{isCommentOrTextNode:be,isNode:I,isComment:Ne,isText:Xe,isHtmlString:X,isArrayOfHtmlElements:K,isArrayOfHtmlStrings:he,ElemArray2HtmlString:Ge,input2Collection:me,setCollectionFromCssSelector:Pe,cssRuleEdit:_({createWithId:"JQxStylesheet"})}}function et(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return s(n,Node)?Object.freeze({get writable(){return _e(n)},get modal(){return Ye(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return Ue(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function tt(t,e,r,n){r&&s(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(a=>a.startsWith("JQxClass-")||o&&a===o)||o||`JQxClass-${ye().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var Gt=et();function rt(t){return{factoryExtensions:Zt(t),instanceExtensions:Yt(t)}}function Zt(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Le)},set(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&s(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${M(r)}`),e}}},dimensions(e){if(e.is.empty)return F.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=G(r,0),n.scrollLeftDistance=G(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?j(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let i=s(r,String);return r=i&&o?j(r):r,i&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=s(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return Gt(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[M(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let i=s(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&s(n,String)?[n]:n,r=r&&s(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let a of r)e.addClass(a);return i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}}}}}function Yt(t){return{addClass(e,...r){return T(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after:ge,afterMe:ge,andThen(e,r,n=!1){if(!r||!s(r,String,Node,Proxy))return F.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:s(r,Node)?t.virtual(r):t.virtual(P(r));let[o,i,a]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[o][i](...r.collection),e.collection=a,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&A(o)){let i=o.trim(),w=!/^<(.+)[^>]+>$/m.test(i)?t.text(o):P(o);T(e,f=>f.append(n?w:R(w)))}I(o)&&T(e,i=>i.append(n?o:R(o))),o.isJQx&&!o.is.empty&&T(e,i=>o.collection.forEach(a=>i.append(n?a:R(a))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!s(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||s(e.node,Text,Comment))return e;if(!n&&A(r))return r=M(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(A(r)&&n)switch(r=M(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return s(r,Object)&&!e.is.empty&&$e(e.node,r),e},before:pe,beforeMe:pe,clear(e){return T(e,fe)},closest(e,r){let n=A(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return T(e,o=>tt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return F.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(i=>{i.removeAttribute&&i?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return T(e,r)},empty(e){return T(e,fe)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return T(e,r=>Z(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!A(r)):return"";case!A(r):return e.node?.getHTML()??"";default:let o=P(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return T(e,a=>(a.textContent=n?a.textContent:"",a.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!A(r)||!A(n))return e;let i=e.find$(r);if(i.length<1)return e;let a=P(`<span>${n}</span>`);return i.each(w=>{o||(w.textContent=""),w.insertAdjacentHTML(t.at.end,a?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!s(r,String,Array)||!A(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(A(o)){o=o.trim();let a=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):P(o);a=n?a:R(a),T(e,w=>w.prepend(a.cloneNode(!0)))}I(o)&&T(e,i=>i.prepend(n?o:R(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),T(e,i=>T(o,a=>i.prepend(n?a:R(a)))),o.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(s(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=s(r,Object)?r:{[r]:n};for(let[i,a]of Object.entries(o)){if(i=i.trim(),a&&!ce(i)||!a)return!1;if(i.toLowerCase()==="id")return e[0].id=a;T(e,f=>{if(i.startsWith("data"))return f.dataset[i.slice(i.indexOf("-")+1)]=a;f[i]=a})}return e},remove(e,r){let n=i=>i.remove(),o=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(r){let i=e.find$(r);return i.is.empty||(T(i,n),o()),e}return T(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return T(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=s(r,HTMLElement)||r.isJQx?r:document.body,n=s(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!s(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||s(n,NodeList))&&(n=n[0]),o&&r&&(r=s(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,s(r,HTMLElement,NodeList,Array)&&s(n,HTMLElement)&&(s(r,HTMLElement)?[r]:[...r]).forEach(i=>i.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return T(e,o=>{o.classList.remove(r);for(let i of n)o.classList.add(i)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=s(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return T(e,n=>de(n,r))},show(e){return T(e,r=>Z(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&s(r,String)):return e.find$(r);case(n&&s(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return T(e,i=>{n&&s(r,String)&&(r={[r]:n||"none"}),Z(i,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!s(r,String):return e.node.textContent;default:return T(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=H.BeforeEnd){return e.isVirtual=!1,k(e.collection,r,n),e},toggleClass(e,r){return T(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=s(n,Function)?n:Event,o=s(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let i=new n(r,o);return e.is.empty||e.each(a=>a.dispatchEvent(i)),e},val(e,r){switch(!0){case(e.is.empty||!s(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!s(r,String):return e.node.value;default:return e.node.value=s(r,String)?r:"",e}}}}var Me,Se,{isComment:nn,isText:on,isHtmlString:ln,isArrayOfHtmlElements:sn,isArrayOfHtmlStrings:an,ElemArray2HtmlString:un,cssRuleEdit:Oe,addFn:Xt}=Kt();function Kt(){return{...qe(),addFn:qt}}function qt(t,e){return t=t?.trim(),!A(t)||!s(e,Function)?F.error("JQx.fn: method invalid parameter(s)"):Se[t]=(r,...n)=>e(r,...n)}function er(t){return function(e,r,n){if(e=e?.trim(),!A(e)||!s(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...i){return r(...i)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return F.log(`JQx: added static extension function [${e}]`)}}function q(t){return new Proxy(t,Object.freeze({get:(e,r)=>tr(e,r,t)}))}function nt(t,e){return(...r)=>s(t,Function)&&t(q(e),...r)}function tr(t,e,r){switch(!0){case s(e,Symbol):return W({trial:()=>t[e],whenError:()=>t});case s(+e,Number):return t.collection?.[e]||void 0;case e in Me:return nt(Me[e],r)();case e in Se:return nt(Se[e],r);default:return t[e]}}function lt(t){let e=lr(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function rr(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?Y(e):e.toLowerCase(),D.allowTag(e),Object.defineProperties(t,De(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),D.prohibitTag(e),Object.defineProperties(t,De(e,!1,t))}}}function ot(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Oe(e,{removeRule:1})}function nr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(H).find(i=>n===i);let o=t(e,document.createElement("br"));if(r&&!s(r,HTMLBRElement))for(let i of o.collection)n?r.insertAdjacentElement(n,i):r.append(i);return o}}function or(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,i]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...i,enumerable:!1})}return e}function ir(t,e,r,n){return t=M(n||t.toLowerCase()),{get(){return(...o)=>{let i=e&&r.virtual(Q(ee[t](...o)))||void 0,w=!s(i?.node,Comment,Text,void 0)?Fe(i):"";return F.log(e?`JQx: created (virtual) instance from [JQx].${t} ${w}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),i}},enumerable:!1,configurable:!0}}function De(t,e,r,n){t=t.toLowerCase();let o=ir(t,e,r,n);return n?{[n]:o,[Y(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function lr(t){return or(Object.entries(D.tagsRaw).reduce(sr(t),{}),mr(t))}function sr(t){return function(e,[r,n]){return Object.defineProperties(e,De(r,n,t)),e}}function ar(t){return function(e,r,...n){s(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function ur(t){return function(e){let{type:r,types:n,origin:o,selector:i,handler:a,handlers:w,node:f,name:E,capture:c,once:h,about:g}=e;a=w||a,r=n||r,i=o||i;let S=Ae(r),p=E;a=s(a,Function)?[a]:a;let m={type:S,selector:i||o,capture:c,name:p,once:h,node:f,about:g};switch(!0){case(s(S,Array)&&S.length>0):for(let b of S)m.type=b,it(a,m,t);break;default:return it(a,m,t)}}}function it(t,e,r){for(let n of t)r.listen({...e,handler:n})}function cr(t){return function(e,r){return r=A(r)&&r,e=A(e)&&e,r&&e&&t.listenerStore[e][r]}}function fr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:ie(t),enumerable:!1}),t.activePopup}function dr(t){let e=(c,h)=>Oe(c,h),r=function(c){return _({createWithId:c||`jqx${ye()}`})},n=function(...c){for(let h of c)Oe(h)},o=rr(t),i=le(t),a=ur(i);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:a,capturedHandling:a,log:(...c)=>F.on.log(...c).off,warn:(...c)=>F.on.warn(...c).off,error:(...c)=>F.on.error(...c).off,handlerWrapper:i}}function mr(t){let{factoryExtensions:e,instanceExtensions:r}=rt(t);Me=e,Se=r;let{editCssRule:n,createStyle:o,editCssRules:i,allowProhibit:a,handle:w,capturedHandling:f,log:E,warn:c,error:h,handlerWrapper:g}=dr(t),S=cr(t),p=er(t);return{log:E,warn:c,error:h,editCssRules:i,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:j,logger:F,text(m,b=!1){return b?t.comment(m):document.createTextNode(m)},node(m,b=document){return b.querySelector(m,b)},nodes(m,b=document){return[...b.querySelectorAll(m,b)]},clearAllTimers:Te,get staticFn(){return function(m,b,C){return p(m,b,C)}},get toBool(){return He},get getNamedListener(){return S},get virtual(){return nr(t)},get allowTag(){return a.allow},get prohibitTag(){return a.prohibit},get removeCssRule(){return ot},get removeCssRules(){return ot},get delegate(){return ar(f)},get delegateCaptured(){return f},get handle(){return f},get listen(){return g.listen},get at(){return H},get setStyle(){return n},get fn(){return Xt},get lenient(){return D.allowUnknownHtmlTags},get IS(){return s},get Popup(){return fr(t)},get listenerStore(){return g.ListenerStore}}}var st=lt(gr());function gr(){return function(e,r,n=H.BeforeEnd){if(e?.isJQx)return e;let o=s(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(H).find(c=>n===c)?n:void 0;let i=X(e),w=!i&&he(e)||i,f={collection:me(e)??[],isVirtual:o,isJQx:!0},E=K(f.collection);if(f.collection.length&&E)return o||f.collection.forEach(c=>{r.contains(c)||k([c],r,n)}),q(f);if(w){if([e].flat().forEach(c=>f.collection.push(P(c))),f.collection.length>0){let c=f.collection.filter(p=>p?.dataset?.jqxcreationerror);f.collection=f.collection.filter(p=>!p?.dataset?.jqxcreationerror);let g=f.collection.map(p=>`${String(p.constructor).split(/function|\(/)[1].trim()}`).length>1;f=q(f);let S=f.collection.length>0?Ke(f):"sanitized: no elements remaining";F.log(`JQx: created ${f.isVirtual?"(virtual)":""} instance from ${g?"array of ":""}HTML string${g?"s":""} ${S}`),f.isVirtual||k(f.collection,r,n)}return f}return Pe(e,r,f),q(f)}}var pn=st;export{pn as default};
|
|
13
|
+
`)}function Ot(t){return t.reduce((e,r)=>{let[n,o]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&o?{...e,[n]:o}:e},{})}function Mt(t){return Ot(Pt(t))}function We(t,e){return t?.replace("::",":")===e?.replace("::",":")}var we=!1,Dt={on:()=>we=!0,off:()=>we=!1},O={tagsRaw:k,allowUnknownHtmlTags:Dt,isAllowed(t){if(we)return!0;let e=a(t,String)?t.toLowerCase():t?.nodeName.toLowerCase()||"none";return e==="#text"||!!k[e]},allowTag:t=>k[t.toLowerCase()]=!0,prohibitTag:t=>k[t.toLowerCase()]=!1};var It=!0,K={data:/data-[\-\w.\p{L}]/ui,validURL:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,whiteSpace:/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g,notAllowedValues:/^javascript|injected|noreferrer|alert|DataURL/gi};function Rt(t){if(It&&Object.keys(t.removed).length){let e=Object.entries(t.removed).reduce((r,[n,o])=>[...r,`${I(n)} => ${o}`],[]).join("\\000A");L.error(`JQx: HTML creation error(s): ${e}`)}}function jt(t){let e=t.nodeName.toLowerCase(),r=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"];return/-/.test(e)&&!r.find(n=>n===e)||O.isAllowed(e)}function j(t){let e={rawHTML:t?.parentElement?.getHTML()??"no html",removed:{}};return a(t,HTMLElement)&&[...t.childNodes].forEach(r=>{if(r?.children?.length&&j(r),r?.attributes){let o=a(r,SVGElement)?Q.svg:Q.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let f=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(K.whiteSpace,""),b=f==="href"?!K.validURL.test(v):K.notAllowedValues.test(v),E=f.startsWith("data")?!K.data.test(f):!!o[f];if(b||E){let d=q(s.value||"none",60);d+=d.length===60?"...":"",e.removed[`${s.name}`]=`attribute/property/value not allowed, removed. Value: ${d}`,r.removeAttribute(s.name)}})}if(!(jt(r)||r.constructor===CharacterData||r.constructor===Comment)){let o=(r?.outerHTML||r?.textContent).trim(),s=q(o,60)??"EMPTY";s+=s.length===60?"...":"",e.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Rt(e),t}function Jt(t){let e=document.createElement("div");return e.insertAdjacentHTML(A.end,t),e.childNodes.length?j(e):void 0}function Qt(t,e,r){switch(!0){case a(t,Comment):return e.insertAdjacentHTML(r,`<!--${t.data}-->`);case a(t,Text):return e.insertAdjacentText(r,t.data||t.textContent);default:return}}function J(t=[],e=document.body,r=A.BeforeEnd){return r=r||A.BeforeEnd,e=e?.isJQx?e.node:e||document.body,t.reduce((n,o)=>{let s=M(o)&&kt(o,e,r);return s?[...n,s]:n},[])}function kt(t,e=document.body,r=A.BeforeEnd){return r=r||A.BeforeEnd,e=e?.isJQx?e?.[0]:e,a(t,Comment,Text)?Qt(t,e,r):a(t,HTMLElement)?e.insertAdjacentElement(r,t):void 0}function N(t){if(a(t,Text,Comment))return t;let e=t?.trim(),r=e?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(o=>o.length).shift():void 0),e.startsWith("<!--")&&e.endsWith("-->"))return document.createComment(t.replace(/<!--|-->$/g,""));if(r||a(e,String)&&!/^<(.+)[^>]+>/m.test(e))return document.createTextNode(r??e);let n=Jt(t);return n.childNodes.length<1?N(`<span data-jqxcreationerror="1">${ee(t,60)}</span>`):n.children[0]}function te(t){if(t.node("#jqxPopup"))return;t.logger.log("JQx: [JQx].Popup first call. Dialog element created."),t.dialog({id:"jqxPopup"},t.div({id:"jqxPopupContent"})).render,t.editCssRules(...Ie);let e=[],[r,n]=[t("#jqxPopupContent"),t.node("#jqxPopup")],o={};return t.handle({type:"click, cancel",handlers:p,name:"genericPopupCloseHandler",capture:!0,about:"A generic handler for JQx popups"}),Object.freeze({show:s,remove:f,removeModal:h});function s(c){if(n.open)switch(!0){case v(c):return;default:return f(),setTimeout(()=>s(c),200)}o={...c};let{content:i}=o;return t.IS(i,String,HTMLElement)||i?.isJQx?b():!0}function f(){return o.modal?g(o.warnMessage):E()}function v(c){for(let[i,u]of Object.entries(o))if(u!==c[i])return!1;return!0}function b(){r.clear();let{content:c,modal:i,closeAfter:u}=o;i=t.IS(i,Boolean)?i:!1;let y=i?"":t.div({id:"closeHandleIcon"});r.append(y,t.IS(c,String)?t.div(c):c),n.showModal(),!i&&t.IS(u,Number)&&S(f,u)}function E(){if(n.close(o.returnValue),d(),t.IS(o.callback,Function))return e.push(setTimeout(()=>o.callback(o.returnValue),200));o={}}function d(){e.forEach(c=>clearTimeout(c)),e=[]}function h({callback:c,value:i}={}){o.returnValue=i,o.modal=!1,o.callback=c||o.callback,f()}function p({evt:c}){if(!(Object.keys(o).length<1||!n.open)&&(c.type==="cancel"&&o.modal&&c.preventDefault(),c.target.closest("#closeHandleIcon")||!c.target.closest("#jqxPopupContent")))return o.activeTimer&&clearTimeout(o.activeTimer),f()}function S(c,i){t.IS(c,Function)&&t.IS(i,Number)&&i>0&&(d(),e.push(setTimeout(c,i*1e3)))}function g(c){if(!t.IS(c,String,HTMLElement,Proxy))return;let i=r.find$(".warn");switch(!0){case i.is.empty:i=t.div({class:"warn"},c);default:r.append(i.addClass("active")),S(()=>r.find$(".warn").removeClass("active"),2)}}}function re(t){let e={},r="anonymous_";function n(d){if(d){let{handler:h,capture:p,type:S}=d;document.addEventListener(S,h,{capture:p})}}function o(d){if(d){let{type:h,handler:p,capture:S}=d;document.removeEventListener(h,p,{capture:S})}}function s(d,h,p,S){return function(g){if(!T(h))return d({evt:g});let c=g.target.closest(h);if(c){let i=t(c);d({self:i,me:i,evt:g}),p&&b(g.type,S)}return!0}}function f(d){return e[d]=e[d]||{},e[d]}function v(d,h){return Object.entries(f(d)).find(([p])=>p===h)}function b(d,h){let p=v(d,h);p&&(o(p[1]),delete e[d][h],delete ne[h],L.warn(`Removed listener [${h}] for event type [${d}].`))}function E(d){let{type:h,handler:p,name:S,capture:g,once:c,selector:i,node:u,about:y}=d;e[h]=e[h]||{};let l=Ee(S||p.name),m=p;if(u instanceof HTMLElement){let x=u.dataset.hid||l;u.dataset.hid=x,i=`[data-hid=${x}]`}switch(!0){case!e[h][l]:return L.log(`JQx: created listener for event type ${h}, with handler name ${l}`),e[h][l]={name:l,handler:s(p,i,c,l),capture:ze(h,g),once:!!c,type:h,initialHandler:m,selector:!!i&&i||!1,about:!!y&&y||!1,unListen(){b(h,l)}},e[h][l];default:return console.warn(`The listener [${l}] for [${h}] exists, it is not re-assigned.`)}}return{remove(...d){return b(...d)},listen:function(d){let{type:h,handler:p}=d;if(!T(h)||!a(p,Function))return;let S=E(d);if(S)return n(S),{type:h,name:S.name,unListen(){b(h,S.name)}}},get ListenerStore(){return Object.freeze({...e})}}}var L=zt(),Bt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],A=Object.freeze(new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(t,e){return t[String(e).toLowerCase()]??t[e]}})),Wt=[...Array(26)].map((t,e)=>String.fromCharCode(e+65)).concat([...Array(26)].map((t,e)=>String.fromCharCode(e+97))).concat([...Array(10)].map((t,e)=>`${e}`)),Le=Object.freeze({get(t,e){return t[_(e)]||t[e]},enumerable:!1,configurable:!1}),ne={};function Te(){let t=setTimeout(()=>{});for(;t>=0;)clearTimeout(t--)}function Ee(t){return T(t)&&!/^handler|handlers$/gi.test(t.trim())?t.trim():Ve()}function Fe(t){let e=!!t.node&&!a(t,Text,Comment);switch(!0){case e:let r=t.node.dataset?Object.keys(t.node.dataset).map(s=>`[data-${s}]`):[],o=[t.attr("id")&&`#${t?.attr("id")}`||void 0,t.attr("class")&&t?.attr("class").split(" ").map(s=>`.${s}`).join(", ")||void 0,r.length>0&&r.join(", ")||void 0].filter(s=>!!s).join(", ")||[];return o.length?`(${o})`:"";default:return""}}function Ve(t){let e=`anonymous_${Math.random().toString(36).slice(2)}`;return ne[e]?Ve():(ne[e]=e,e)}function ze(t,e){return!!Bt.find(r=>r===t)||!!e}function se(t){return t.startsWith("data")||Q.html.find(e=>t.toLowerCase()===e)}function le(t){return t&&(t.textContent="")}function z(t,e=0,r=!0){return t=t?.parentElement,e+=t?t[r?"scrollTop":"scrollLeft"]:0,t?z(t,e,r):e}function T(t,e=1){return e=a(e,Number)&&e||1,a(t,String)&&t.length>=e}function q(t,e=120){return ee(t,e).replace(/</g,"<")}function ee(t,e=120){return`${t}`.trim().slice(0,e).replace(/>\s+</g,"><").replace(/</g,"<").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(t.length>e?" …":"").trim()}function I(t){switch(!0){case a(t,String):let e=document.createElement("div");return e.append(t),e.innerHTML;default:return t}}function Ce(t){return a(t,String)&&Object.assign(document.createElement("textarea"),{innerHTML:t}).textContent||t}function zt(){let[t,e]=[!1,!0],r=[],n={get on(){return t=!0,n},get off(){return t=!1,n},get disable(){return e=!0,n},get enable(){return e=!1,n},get backLog(){return r}};function o(){e=!0}function s(){e=!1}function f(...E){return r.unshift(...E.map(d=>`${ie()} \u2A3B ${Ce(d)}`)),console.error(r.slice(0,E.length).join(`
|
|
14
|
+
`)),n}function v(...E){return r.unshift(...E.map(d=>`${ie()} \u26A0 ${Ce(d)}`)),console.warn(r.slice(0,E.length).join(`
|
|
15
|
+
`)),n}function b(...E){let d=E.map(h=>`${ie()} \u2714 ${Ce(h)}`);switch(!e&&r.unshift(...d),t){case!0:console.log(d.join(`
|
|
16
|
+
`));default:return n}}return Object.defineProperties(n,{log:{value:b,enumerable:!1},error:{value:f,enumerable:!1},warn:{value:v,enumerable:!1}}),Object.freeze(n)}function ie(){return(t=>`[${oe(t.getHours())}:${oe(t.getMinutes())}:${oe(t.getSeconds())}.${oe(t.getMilliseconds(),3)}]`)(new Date)}function Ae(t,e){if(t)for(let[r,n]of Object.entries(e)){if(r=H(r),r.startsWith("data"))return ae(t,n);a(n,String)&&se(r)&&t.setAttribute(r,n.split(/[, ]/)?.join(" "))}}function ae(t,e){if(t&&a(e,Object))for(let[r,n]of Object.entries(e))t.setAttribute(`data-${H(r)}`,n)}function ue(t){return t?a(t,Proxy)?[t.EL]:a(t,NodeList)?[...t]:M(t)?[t]:Y(t)?t:t.isJQx?t.collection:void 0:[]}function ce(t,e){return t.andThen(e)}function fe(t,e){return t.andThen(e,!0)}function M(t){return a(t,Text,HTMLElement,Comment)}function V(t,e){if(a(e,Object))for(let[r,n]of Object.entries(e)){let o;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),o="important"),t.style.setProperty(H(r),n,o)}}function R(t){let e=t.cloneNode(!0);return e.removeAttribute&&e.removeAttribute("id"),t.isConnected?t.remove():t=null,e}function _e(t){if(!a(t,HTMLElement))return;let e=t.style,r=getComputedStyle(t),n=!![e.visibility,r.visibility].includes("hidden"),o=!![e.display,r.display].includes("none"),s=!!t.hidden,f=parseInt(r.height)<1||parseInt(r.width)<1,v=t.offsetTop<0||t.offsetLeft+t.offsetWidth<0||t.offsetLeft>document.body.offsetWidth,b=+r.opacity==0||+(e.opacity||1)==0;return!(s||v||b||o||n||f)}function Ue(t){return t?.isConnected?!![...document.querySelectorAll(":is(:read-write)")].find(e=>e===t):!1}function Ye(t){return t?.filter(e=>e).reduce((e,r)=>e.concat(He(r)?`<!--${r.data}-->`:me(r)?r.textContent:r.outerHTML),"")}function oe(t,e=2){return`${t}`.padStart(e,"0")}function Ge(t,e=0){return[t,e]=[Math.floor(t),Math.ceil(e)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(t-e+1)+e)}function de(){return`_${Vt(Wt).slice(0,8).join("")}`}function $e(t){return t=a(t,String)&&/,/.test(t)?t.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e.length>0):t,a(t,Array)?t:a(t,String)&&t?.trim().toLowerCase()||""}function Xe(t){return t?.isConnected?!![...document.querySelectorAll(":is(:modal)")].find(e=>e===t):!1}function Ne(t,e){switch(t=String(t).trim(),!0){case/^(0|false|f)$/i.test(t):return!1;case/^(1|true|t)$/i.test(t):return!0;default:return e}}function Vt(t){let e=t.length;for(;e--;){let r=Ge(e);[t[e],t[r]]=[t[r],t[e]]}return t}function _(t){return a(t,String)?t.toLowerCase().split("-").map((e,r)=>r&&`${_t(e)}`||e).join(""):t}function H(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`).replace(/^-|-$/,"")}function _t([t,...e]){return`${t.toUpperCase()}${e.join("")}`}function me(t){return a(t,Comment,Text)}function He(t){a(t,Comment)}function Ze(t){return a(t,Text)}function U(t){return a(t,String)&&/^<|>$/.test(`${t}`.trim())}function Y(t){return a(t,Array)&&!t?.find(e=>!M(e))}function ge(t){return a(t,Array)&&!t?.find(e=>!U(e))}function C(t,e){let r=t.collection.filter(n=>!me(n));for(let n=0;n<r.length;n+=1)e(r[n],n);return t}function Ke(t){return t.node?a(t.node,Comment)?`<!--${t.node.textContent}-->`:t.HTML.get(1).split(">")[0]+">...":""}function Pe(t,e,r){let n=e!==document.body&&a(t,String)&&t.toLowerCase()!=="body"?e:document;try{r.collection=[...n.querySelectorAll(t)]}catch{L.warn(`JQx: Invalid CSS querySelector. [${a(t,String)?t:"Not a string!"}]`)}}function qe(){return{isCommentOrTextNode:me,isNode:M,isComment:He,isText:Ze,isHtmlString:U,isArrayOfHtmlElements:Y,isArrayOfHtmlStrings:ge,ElemArray2HtmlString:Ye,input2Collection:ue,setCollectionFromCssSelector:Pe,cssRuleEdit:W({createWithId:"JQxStylesheet"})}}function et(){let e=Object.freeze({notInDOM:"n/a",writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"});return r=>{let n=r.node;return a(n,Node)?Object.freeze({get writable(){return Ue(n)},get modal(){return Xe(n)},get inDOM(){return n.isConnected},get open(){return n.open??!1},get visible(){return _e(n)},get disabled(){return n.hasAttribute("readonly")||n.hasAttribute("disabled")},get empty(){return r.collection.length<1},get virtual(){return r.isVirtual}}):e}}function tt(t,e,r,n){r&&a(e,String)&&(e={[e]:r==="-"?"":r});let o;e.className&&(o=e.className,delete e.className),o=[...t.classList].find(f=>f.startsWith("JQxClass-")||o&&f===o)||o||`JQxClass-${de().slice(1)}`,n.editCssRule(`.${o}`,e),t.classList.add(o)}var Ut=et();function rt(t){return{factoryExtensions:Yt(t),instanceExtensions:Gt(t)}}function Yt(t){return{data(e){return{get all(){return new Proxy(e[0]?.dataset??{},Le)},set(r={}){if(!e.is.empty&&a(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},get(r,n){return e.data.all[r]??n},add(r={}){if(!e.is.empty&&a(r,Object))for(let[n,o]of Object.entries(r))e.setData({[n]:o});return e},remove(r){return e[0]?.removeAttribute(`data-${H(r)}`),e}}},dimensions(e){if(e.is.empty)return L.error("[JQx instance].dimensions called on empty instance"),{error:"[JQx instance].dimensions: NO ELEMENTS"};let{node:r}=e,n=r.getBoundingClientRect().toJSON();return n.scrollTopDistance=z(r,0),n.scrollLeftDistance=z(r,0,!1),n},node(e){return e[0]},HTML(e){return{get(r,n){if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let o=r?e.outerHtml:e.html();return n?I(o):o},set(r,n=!1,o=!1){r=r.isJQx?r.HTML.get(1):r;let s=a(r,String);return r=s&&o?I(r):r,s&&(r||"").trim().length&&e.html(r,n),e},replace(r,n=!1){return e.HTML.set(r,!1,n)},append(r,n=!1){return r=a(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r,!0,n)},insert(r,n=!1){return r=a(r,HTMLElement)?t(r).HTML.get(1):r.isJQx?r.HTML.get(1):r,e.HTML.set(r+e.HTML.get(),!1,n)}}},is(e){return Ut(e)},length(e){return e.collection.length},outerHtml(e){return(e.first()||{outerHTML:void 0}).outerHTML},parent(e){let r=t(e[0]?.parentNode);return r.is.empty?e:r},render(e){switch(!0){case!e.is.empty:return e.toDOM();default:return t.logger.warn("[JQx.render]: empty collection"),e}},Style(e){return{get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline(r){return e.style(r)},inSheet(r){return e.css(r)},valueOf(r){return e.is.empty?void 0:getComputedStyle(e[0])[H(r)]},nwRule(r){return e.Style.byRule({rules:r})},byRule({classes2Apply:r=[],rules:n=[]}={}){let s=a(n,String)&&!r.length?n.split("{")[0].trim():"";if(n=n&&a(n,String)?[n]:n,r=r&&a(r,String)?[r]:r,(n?.length||r?.length)&&(n?.length&&t.editCssRules(...n),r))for(let f of r)e.addClass(f);return s?.startsWith(".")&&e.addClass(s.slice(1)),s?.startsWith("#")&&!e.attr("id")&&e.prop({id:s.slice(1)}),e}}}}}function Gt(t){return{addClass(e,...r){return C(e,n=>n&&r.forEach(o=>n.classList.add(o)))},after:ce,afterMe:ce,andThen(e,r,n=!1){if(!r||!a(r,String,Node,Proxy))return L.log("[JQx instance].[before(Me) | after(Me) | andThen]: invalid/-sufficient input."),e;r=r?.isJQx?r:a(r,Node)?t.virtual(r):t.virtual(N(r));let[o,s,f]=n?[0,"before",r.collection.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(r.collection)];return e[o][s](...r.collection),e.collection=f,e},append(e,...r){if(e.is.empty||r.length<1)return e;let n=e.length===1;for(let o of r){if(!o.isJQx&&T(o)){let s=o.trim(),v=!/^<(.+)[^>]+>$/m.test(s)?t.text(o):N(o);C(e,b=>b.append(n?v:R(v)))}M(o)&&C(e,s=>s.append(n?o:R(o))),o.isJQx&&!o.is.empty&&C(e,s=>o.collection.forEach(f=>s.append(n?f:R(f))))}return e},appendTo(e,r){switch(!0){case(!r.isJQx&&!a(r,HTMLElement)):return $.warn("[JQx instance].appendTo: invalid input"),e;default:return(r.isJQx?r:t(r)).append(e),e}},attr(e,r,n){if(!e.node||a(e.node,Text,Comment))return e;if(!n&&T(r))return r=H(r),r==="class"?[...e.node.classList].join(" "):e.node.getAttribute(r);if(T(r)&&n)switch(r=H(r),!0){case r.startsWith("data-"):r={data:{[r.replace("data-","")]:n}};break;default:r={[r]:n}}return a(r,Object)&&!e.is.empty&&Ae(e.node,r),e},before:fe,beforeMe:fe,clear(e){return C(e,le)},closest(e,r){let n=T(r)?e.node?.closest(r):void 0;return n?t(n):e},computedStyle(e,r){let{node:n}=e;return n&&getComputedStyle(n)[r]},css(e,r,n){return C(e,o=>tt(o,r,n,t))},duplicate(e,r=!1,n=document.body){switch(!0){case e.is.empty:return L.error("Duplicating an empty JQx instance is not possible"),e;default:let o=e.collection[0].cloneNode(!0);return o.childNodes.forEach(s=>{s.removeAttribute&&s?.removeAttribute("id")}),r?t(o).toDOM(n):t.virtual(o)}},each(e,r){return C(e,r)},empty(e){return C(e,le)},find(e,r){return e.collection.length>0?[...e.first()?.querySelectorAll(r)]:[]},find$(e,r){return e.collection.length>0?t(r,e):e},first(e,r=!1){return e.collection.length>0?r?e.single():e.collection[0]:void 0},first$(e,r){return e.single(r)},getData(e,r,n){return e.node?.dataset?.[r]||n},hasClass(e,...r){return e.is.empty||!e.node.classList.length?!1:r.find(n=>e.node.classList.contains(n))&&!0||!1},hide(e){return C(e,r=>V(r,{display:"none !important"}))},html(e,r,n){switch(!0){case(e.is.empty&&!T(r)):return"";case!T(r):return e.node?.getHTML()??"";default:let o=N(`<div>${r.isJQx?r.HTML.get(!0):r}</div>`);return C(e,f=>(f.textContent=n?f.textContent:"",f.insertAdjacentHTML(t.at.end,o.getHTML())))}},htmlFor(e,r,n="",o=!1){if(e.is.empty||!T(r)||!T(n))return e;let s=e.find$(r);if(s.length<1)return e;let f=N(`<span>${n}</span>`);return s.each(v=>{o||(v.textContent=""),v.insertAdjacentHTML(t.at.end,f?.getHTML())}),e},isEmpty(e){return!e.node},nth$(e,r){return e.single(r)},on(e,r,...n){switch(!0){case(e.is.empty||!a(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,node:e.node,handler:n}),e}},once(e,r,...n){switch(!0){case(e.is.empty||!a(r,String,Array)||!T(r)||n.length<1):return e;default:return t.handle({type:r,once:!0,node:e.node,handler:n}),e}},prepend(e,...r){if(e.is.empty||!r)return;let n=e.length===1;for(let o of r){if(T(o)){o=o.trim();let f=!/^<(.+)[^>]+>$/m.test(o)?t.text(o):N(o);f=n?f:R(f),C(e,v=>v.prepend(f.cloneNode(!0)))}M(o)&&C(e,s=>s.prepend(n?o:R(o))),o.isJQx&&!o.is.empty&&(o.collection.length>1&&o.collection.reverse(),C(e,s=>C(o,f=>s.prepend(n?f:R(f)))),o.collection.reverse())}return e},prependTo(e,r){return r.isJQx||(r=t.virtual(r)),r.prepend(e),e},prop(e,r,n){if(a(r,String)&&!n)return r.startsWith("data")?e[0]?.dataset[r.slice(r.indexOf("-")+1)]:e[0]?.[r];let o=a(r,Object)?r:{[r]:n};for(let[s,f]of Object.entries(o)){if(s=s.trim(),f&&!se(s)||!f)return!1;if(s.toLowerCase()==="id")return e[0].id=f;C(e,b=>{if(s.startsWith("data"))return b.dataset[s.slice(s.indexOf("-")+1)]=f;b[s]=f})}return e},remove(e,r){let n=s=>s.remove(),o=()=>e.collection=e.collection.filter(s=>document.documentElement.contains(s));if(r){let s=e.find$(r);return s.is.empty||(C(s,n),o()),e}return C(e,n),o(),e},rmAttr(e,...r){for(let n of r)e.node.removeAttribute(n);return e},removeClass(e,...r){return C(e,n=>{if(n)for(let o of r)n.classList.remove(o)})},renderTo(e,r,n){return r=a(r,HTMLElement)||r.isJQx?r:document.body,n=a(n,String)&&t.at[n]?n:t.at.end,e.first$().toDOM(r,n),e},replace(e,r,n){let o=e.node;return!r||!a(n,HTMLElement)&&!n?.isJQx?(t.logger.error("JQx replace: invalid replacement value"),e):((n.isJQx||a(n,NodeList))&&(n=n[0]),o&&r&&(r=a(r,String)?o.querySelectorAll(r):r.isJQx?r.collection:r,a(r,HTMLElement,NodeList,Array)&&a(n,HTMLElement)&&(a(r,HTMLElement)?[r]:[...r]).forEach(s=>s.replaceWith(n.cloneNode(!0)))),e)},replaceClass(e,r,...n){return C(e,o=>{o.classList.remove(r);for(let s of n)o.classList.add(s)})},replaceMe(e,r){return e.replaceWith(r)},replaceWith(e,r){return r=a(r,Element)?r:r.isJQx?r[0]:void 0,r&&(e[0].replaceWith(r),e=t.virtual(r)),e},setData(e,r){return C(e,n=>ae(n,r))},show(e){return C(e,r=>V(r,{display:"revert-layer !important"}))},single(e,r){let n=e.collection.length>0;switch(r=r??0,!0){case(n&&a(r,String)):return e.find$(r);case(n&&a(r,Number)):return t(e.collection[r]);case n:return e.collection[0];default:return e}},style(e,r,n){return C(e,s=>{n&&a(r,String)&&(r={[r]:n||"none"}),V(s,r)})},text(e,r,n=!1){switch(!0){case e.isEmpty():return e;case!a(r,String):return e.node.textContent;default:return C(e,o=>o.textContent=n?o.textContent+r:r)}},toDOM(e,r=document.body,n=A.BeforeEnd){return e.isVirtual=!1,J(e.collection,r,n),e},toggleClass(e,r){return C(e,n=>n.classList.toggle(r))},toNodeList(e){return[...e.collection].map(r=>document.importNode(r,!0))},trigger(e,r,n,o){n=a(n,Function)?n:Event,o=a(o,Object)?{...o,bubbles:o.bubbles??!0}:{bubbles:!0};let s=new n(r,o);return e.is.empty||e.each(f=>f.dispatchEvent(s)),e},val(e,r){switch(!0){case(e.is.empty||!a(e.node,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)):return e;case!a(r,String):return e.node.value;default:return e.node.value=a(r,String)?r:"",e}}}}var Oe,pe,{isComment:rn,isText:nn,isHtmlString:on,isArrayOfHtmlElements:sn,isArrayOfHtmlStrings:ln,ElemArray2HtmlString:an,cssRuleEdit:Me,addFn:Xt}=Zt();function Zt(){return{...qe(),addFn:Kt}}function Kt(t,e){return t=t?.trim(),!T(t)||!a(e,Function)?L.error("JQx.fn: method invalid parameter(s)"):pe[t]=(r,...n)=>e(r,...n)}function qt(t){return function(e,r,n){if(e=e?.trim(),!T(e)||!a(r,Function))return t.error("JQx.staticFn: invalid parameter(s)");let o=n?{get(){return r()}}:{value(...s){return r(...s)}};try{Object.defineProperty(t,e,o)}catch{return t.warn(`JQx.staticFn: extension [${e}] already exists`)}return L.log(`JQx: added static extension function [${e}]`)}}function G(t){return new Proxy(t,Object.freeze({get:(e,r)=>er(e,r,t)}))}function nt(t,e){return(...r)=>a(t,Function)&&t(G(e),...r)}function er(t,e,r){switch(!0){case a(e,Symbol):return P({trial:()=>t[e],whenError:()=>t});case a(+e,Number):return t.collection?.[e]||void 0;case e in Oe:return nt(Oe[e],r)();case e in pe:return nt(pe[e],r);default:return t[e]}}function st(t){let e=ir(t);for(let[r,n]of Object.entries(Object.getOwnPropertyDescriptors(e)))Object.defineProperty(t,r,n);return t}function tr(t){return{allow(e){let r=/-/.test(e),n=r&&e;e=r?_(e):e.toLowerCase(),O.allowTag(e),Object.defineProperties(t,De(e,!0,t,n))},prohibit(e){e=e.toLowerCase(),O.prohibitTag(e),Object.defineProperties(t,De(e,!1,t))}}}function ot(...t){if(t.length===1){let e=String(t.shift().trim());t=e.startsWith("!")?[e.slice(1,-1)]:e.split(",").map(r=>r.trim())}for(let e of t.map(r=>r.startsWith("!")?r.slice(1,-1):r))Me(e,{removeRule:1})}function rr(t){return function(e,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(A).find(s=>n===s);let o=t(e,document.createElement("br"));if(r&&!a(r,HTMLBRElement))for(let s of o.collection)n?r.insertAdjacentElement(n,s):r.append(s);return o}}function nr(...t){let e={};for(let r of t){let n=Object.getOwnPropertyDescriptors(r);for(let[o,s]of Object.entries(n))!(o in e)&&Object.defineProperty(e,o,{...s,enumerable:!1})}return e}function or(t,e,r,n){return t=H(n||t.toLowerCase()),{get(){return(...o)=>{let s=e&&r.virtual(j(X[t](...o)))||void 0,v=!a(s?.node,Comment,Text,void 0)?Fe(s):"";return L.log(e?`JQx: created (virtual) instance from [JQx].${t} ${v}`:`JQx: ${t.toUpperCase()} is prohibited. Use [JQx].allowTag if necessary.`),s}},enumerable:!1,configurable:!0}}function De(t,e,r,n){t=t.toLowerCase();let o=or(t,e,r,n);return n?{[n]:o,[_(n)]:o}:{[t]:o,[t.toUpperCase()]:o}}function ir(t){return nr(Object.entries(O.tagsRaw).reduce(sr(t),{}),dr(t))}function sr(t){return function(e,[r,n]){return Object.defineProperties(e,De(r,n,t)),e}}function lr(t){return function(e,r,...n){a(r,Function)&&(n.push(r),r=void 0),t({type:e,selector:r,handlers:n})}}function ar(t){return function(e){let{type:r,types:n,origin:o,selector:s,handler:f,handlers:v,node:b,name:E,capture:d,once:h,about:p}=e;f=v||f,r=n||r,s=o||s;let S=$e(r),g=E;f=a(f,Function)?[f]:f;let c={type:S,selector:s||o,capture:d,name:g,once:h,node:b,about:p};switch(!0){case(a(S,Array)&&S.length>0):for(let i of S)c.type=i,it(f,c,t);break;default:return it(f,c,t)}}}function it(t,e,r){for(let n of t)r.listen({...e,handler:n})}function ur(t){return function(e,r){return r=T(r)&&r,e=T(e)&&e,r&&e&&t.listenerStore[e][r]}}function cr(t){return t.activePopup||Object.defineProperty(t,"activePopup",{value:te(t),enumerable:!1}),t.activePopup}function fr(t){let e=(d,h)=>Me(d,h),r=function(d){return W({createWithId:d||`jqx${de()}`})},n=function(...d){for(let h of d)Me(h)},o=tr(t),s=re(t),f=ar(s);return{editCssRule:e,createStyle:r,editCssRules:n,allowProhibit:o,handle:f,capturedHandling:f,log:(...d)=>L.on.log(...d).off,warn:(...d)=>L.on.warn(...d).off,error:(...d)=>L.on.error(...d).off,handlerWrapper:s}}function dr(t){let{factoryExtensions:e,instanceExtensions:r}=rt(t);Oe=e,pe=r;let{editCssRule:n,createStyle:o,editCssRules:s,allowProhibit:f,handle:v,capturedHandling:b,log:E,warn:d,error:h,handlerWrapper:p}=fr(t),S=ur(t),g=qt(t);return{log:E,warn:d,error:h,editCssRules:s,createStyle:o,editStylesheet:o,editCssRule:n,escHtml:I,logger:L,text(c,i=!1){return i?t.comment(c):document.createTextNode(c)},node(c,i=document){return i.querySelector(c,i)},nodes(c,i=document){return[...i.querySelectorAll(c,i)]},clearAllTimers:Te,get staticFn(){return function(c,i,u){return g(c,i,u)}},get toBool(){return Ne},get getNamedListener(){return S},get virtual(){return rr(t)},get allowTag(){return f.allow},get prohibitTag(){return f.prohibit},get removeCssRule(){return ot},get removeCssRules(){return ot},get delegate(){return lr(b)},get delegateCaptured(){return b},get handle(){return b},get listen(){return p.listen},get at(){return A},get setStyle(){return n},get fn(){return Xt},get lenient(){return O.allowUnknownHtmlTags},get IS(){return a},get Popup(){return cr(t)},get listenerStore(){return p.ListenerStore}}}var lt=st(mr());function mr(){return function(e,r,n=A.BeforeEnd){if(e?.isJQx)return e;let o=a(r,HTMLBRElement);r=(!o&&r&&r.isJQx?r[0]:r)||document.body,n=n&&Object.values(A).find(d=>n===d)?n:void 0;let s=U(e),v=!s&&ge(e)||s,b={collection:ue(e)??[],isVirtual:o,isJQx:!0},E=Y(b.collection);if(b.collection.length&&E)return o||b.collection.forEach(d=>{r.contains(d)||J([d],r,n)}),G(b);if(v){if([e].flat().forEach(d=>b.collection.push(N(d))),b.collection.length>0){let d=b.collection.filter(g=>g?.dataset?.jqxcreationerror);b.collection=b.collection.filter(g=>!g?.dataset?.jqxcreationerror);let p=b.collection.map(g=>`${String(g.constructor).split(/function|\(/)[1].trim()}`).length>1;b=G(b);let S=b.collection.length>0?Ke(b):"sanitized: no elements remaining";L.log(`JQx: created ${b.isVirtual?"(virtual)":""} instance from ${p?"array of ":""}HTML string${p?"s":""} ${S}`),b.isVirtual||J(b.collection,r,n)}return b}return Pe(e,r,b),G(b)}}var gn=lt;export{gn as default};
|
|
@@ -1,129 +1,54 @@
|
|
|
1
1
|
const { IS, maybe, $Wrap, isNothing, xProxy, addSymbolicExtensions } =
|
|
2
2
|
TOAFactory({useSymbolicExtensions: false});
|
|
3
|
+
|
|
3
4
|
export { IS as default, maybe, $Wrap, xProxy, isNothing, addSymbolicExtensions };
|
|
4
5
|
|
|
5
6
|
function TOAFactory(specs = {}) {
|
|
6
|
-
const {useSymbolicExtensions} = specs;
|
|
7
|
-
const {
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const { useSymbolicExtensions } = specs;
|
|
8
|
+
const { shouldbeIsSingleObject, ISOneOf, isOrDefault, isExcept, typeOf, SymbolAndCustomProxyFactory,
|
|
9
|
+
WrapAnyFactory, verifyNothingness, determineType, xProxy, addSymbolicExtensions,
|
|
10
|
+
maybe, $Wrap } = TOAHelpers(IS, useSymbolicExtensions);
|
|
10
11
|
xProxy.custom();
|
|
11
|
-
!!useSymbolicExtensions && addSymbolicExtensions();
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
if (!!useSymbolicExtensions) { addSymbolicExtensions(); }
|
|
14
|
+
|
|
15
|
+
return {IS, maybe, $Wrap, isNothing: verifyNothingness, xProxy, addSymbolicExtensions};
|
|
14
16
|
|
|
15
17
|
function IS(anything, ...shouldBe) {
|
|
16
18
|
const input = typeof anything === `symbol` ? Symbol.isSymbol : anything;
|
|
17
19
|
switch(true) {
|
|
18
|
-
case !!maybe({trial: _ => `isTypes` in (shouldBe?.[0] ?? {})}): return
|
|
20
|
+
case !!maybe({trial: _ => `isTypes` in (shouldBe?.[0] ?? {})}): return shouldbeIsSingleObject(anything, shouldBe[0]);
|
|
19
21
|
default: return shouldBe.length > 1 ? ISOneOf(input, ...shouldBe) : determineType(anything, ...shouldBe);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function TOAHelpers(IS, useSymbolicExtensions) {
|
|
27
|
+
const { SymbolAndCustomProxyFactory, maybeFactory, WrapAnyFactory,
|
|
28
|
+
verifyNothingness, determineType } = AUXHelperFactory(IS, typeOf);
|
|
29
|
+
const {xProxy, addSymbolicExtensions} = SymbolAndCustomProxyFactory(IS, typeOf, useSymbolicExtensions);
|
|
30
|
+
const [maybe, $Wrap] = [maybeFactory(), WrapAnyFactory(IS, typeOf)];
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
case `notTypes` in isTypeObj: return isExcept(anything, isTypeObj);
|
|
27
|
-
default: return IS(anything, ...[isTypeObj.isTypes].flat());
|
|
28
|
-
}
|
|
29
|
-
}
|
|
32
|
+
return Object.freeze({
|
|
33
|
+
shouldbeIsSingleObject, ISOneOf, isOrDefault, isExcept, typeOf, SymbolAndCustomProxyFactory,
|
|
34
|
+
maybe, WrapAnyFactory, verifyNothingness, determineType, xProxy, addSymbolicExtensions, $Wrap });
|
|
30
35
|
|
|
31
36
|
function typeOf(anything) {
|
|
32
37
|
return anything?.[Symbol.proxy] ?? IS(anything);
|
|
33
38
|
}
|
|
34
39
|
|
|
35
|
-
function
|
|
36
|
-
let { noInput, noShouldbe, compareTo, inputCTOR, isNaN, isInfinity, shouldBeFirstElementIsNothing } =
|
|
37
|
-
processInput(input, ...shouldBe);
|
|
38
|
-
shouldBe = shouldBe.length && shouldBe[0];
|
|
39
|
-
|
|
40
|
-
switch (true) {
|
|
41
|
-
case shouldBeFirstElementIsNothing: return String(input) === String(compareTo);
|
|
42
|
-
case input?.[Symbol.proxy] && noShouldbe: return input[Symbol.proxy];
|
|
43
|
-
case isNaN: return noShouldbe ? `NaN` : String(compareTo) === String(input);
|
|
44
|
-
case isInfinity: return noShouldbe ? `Infinity` : String(compareTo) === String(input);
|
|
45
|
-
case noInput: return noShouldbe ? String(input) : String(compareTo) === String(input);
|
|
46
|
-
case inputCTOR === Boolean: return !shouldBe ? `Boolean` : inputCTOR === shouldBe;
|
|
47
|
-
default: return getResult(input, shouldBe, noShouldbe, getMe(input, inputCTOR));
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function processInput(input, ...shouldBe) {
|
|
52
|
-
const noShouldbe = shouldBe.length < 1;
|
|
53
|
-
const noInput = input === undefined || input === null;
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
noInput,
|
|
57
|
-
noShouldbe,
|
|
58
|
-
compareTo: !noShouldbe && shouldBe[0],
|
|
59
|
-
inputCTOR: !noInput && Object.getPrototypeOf(input)?.constructor,
|
|
60
|
-
isNaN: Number.isNaN(input) || maybe({trial: _ => String(input) === `NaN`}),
|
|
61
|
-
isInfinity: maybe({trial: _ => String(input)}) === `Infinity`,
|
|
62
|
-
shouldBeFirstElementIsNothing: !noShouldbe && isNothing(shouldBe[0])
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function getMe(input, inputCTOR) {
|
|
40
|
+
function shouldbeIsSingleObject(anything, isTypeObj) {
|
|
67
41
|
switch(true) {
|
|
68
|
-
case
|
|
69
|
-
case
|
|
70
|
-
|
|
71
|
-
default: return inputCTOR;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function getResult(input, compareWith, noShouldbe, me) {
|
|
76
|
-
switch(true) {
|
|
77
|
-
case (!noShouldbe && compareWith === input) || (input?.[Symbol.proxy] && compareWith === Proxy): return true;
|
|
78
|
-
case String(compareWith) === `NaN`: return String(input) === `NaN`;
|
|
79
|
-
case input?.[Symbol.toStringTag] && typeof compareWith === `string`:
|
|
80
|
-
return String(compareWith) === input[Symbol.toStringTag];
|
|
81
|
-
default: return compareWith ? resultWithComparison(input, compareWith, me) : resultWithoutComparison(input, me);
|
|
42
|
+
case `defaultValue` in isTypeObj: return isOrDefault(anything, isTypeObj);
|
|
43
|
+
case `notTypes` in isTypeObj: return isExcept(anything, isTypeObj);
|
|
44
|
+
default: return IS(anything, ...[isTypeObj.isTypes].flat());
|
|
82
45
|
}
|
|
83
46
|
}
|
|
84
47
|
|
|
85
|
-
function resultWithoutComparison(input, me) {
|
|
86
|
-
const toStringTag = input?.[Symbol.toStringTag] ?? input?.prototype?.[Symbol.toStringTag];
|
|
87
|
-
return toStringTag || me?.name || String(me);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function resultWithComparison(input, compareWith, me) {
|
|
91
|
-
return maybe({trial: _ =>
|
|
92
|
-
input instanceof compareWith}) ||
|
|
93
|
-
compareWith === me ||
|
|
94
|
-
compareWith === Object.getPrototypeOf(me) ||
|
|
95
|
-
`${compareWith?.name}` === me?.name;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
48
|
function ISOneOf(obj, ...params) {
|
|
99
49
|
return params.some(param => IS(obj, param));
|
|
100
50
|
}
|
|
101
51
|
|
|
102
|
-
function isNothing(maybeNothing, all = false) {
|
|
103
|
-
let nada = maybeNothing === null || maybeNothing === undefined;
|
|
104
|
-
nada = all ? nada || IS(maybeNothing, Infinity) || IS(maybeNothing, NaN) : nada;
|
|
105
|
-
return nada;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function maybeFactory() {
|
|
109
|
-
const errFn = err => undefined;
|
|
110
|
-
return function({trial, whenError = errFn } = {}) {
|
|
111
|
-
try { return trial(); } catch (err) { return whenError(err); }
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function WrapAnyFactory() {
|
|
116
|
-
return function (someObj) {
|
|
117
|
-
return Object.freeze({
|
|
118
|
-
get value() { return someObj; },
|
|
119
|
-
get [Symbol.type]() { return typeOf(someObj); },
|
|
120
|
-
get type() { return typeOf(someObj); },
|
|
121
|
-
[Symbol.is](...args) { return IS(someObj, ...args); },
|
|
122
|
-
is(...args) { return IS(someObj, ...args); }
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
52
|
function isOrDefault(input, {defaultValue, isTypes = [undefined], notTypes} = {}) {
|
|
128
53
|
isTypes = isTypes?.constructor !== Array ? [isTypes] : isTypes;
|
|
129
54
|
notTypes = notTypes && notTypes?.constructor !== Array ? [notTypes] : [];
|
|
@@ -137,33 +62,33 @@ function TOAFactory(specs = {}) {
|
|
|
137
62
|
notTypes = notTypes?.constructor !== Array ? [notTypes] : notTypes;
|
|
138
63
|
return IS(input, ...isTypes) && !IS(input, ...notTypes);
|
|
139
64
|
}
|
|
140
|
-
|
|
141
|
-
function addSymbols2Anything() {
|
|
142
|
-
if (!Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]) {
|
|
143
|
-
Object.defineProperties(Object.prototype, {
|
|
144
|
-
[Symbol.type]: { get() { return typeOf(this); }, enumerable: false, configurable: false },
|
|
145
|
-
[Symbol.is]: { value: function (...args) { return IS(this, ...args); }, enumerable: false, configurable: false },
|
|
146
|
-
});
|
|
147
|
-
Object.defineProperties(Object, {
|
|
148
|
-
[Symbol.type]: { value(obj) { return typeOf(obj); }, enumerable: false, configurable: false },
|
|
149
|
-
[Symbol.is]: { value: function (obj, ...args) { return IS(obj, ...args); }, enumerable: false, configurable: false },
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
65
|
}
|
|
154
66
|
|
|
155
|
-
function
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
67
|
+
function AUXHelperFactory() {
|
|
68
|
+
const SYMBOL_KEYS = {
|
|
69
|
+
IS: 'toa.is',
|
|
70
|
+
TYPE: 'toa.type',
|
|
71
|
+
IS_SYMBOL: 'toa.isASymbol',
|
|
72
|
+
PROXY: 'toa.proxy'
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const TYPE_STRINGS = {
|
|
76
|
+
NAN: 'NaN',
|
|
77
|
+
INFINITY: 'Infinity',
|
|
78
|
+
BOOLEAN: 'Boolean',
|
|
79
|
+
OBJECT: 'Object',
|
|
80
|
+
PROXY_PREFIX: 'Proxy ('
|
|
81
|
+
};
|
|
82
|
+
return Object.freeze({
|
|
83
|
+
SymbolAndCustomProxyFactory, maybeFactory, WrapAnyFactory, verifyNothingness, determineType
|
|
84
|
+
}
|
|
85
|
+
);
|
|
159
86
|
|
|
160
|
-
function addSymbols2Anything() {
|
|
87
|
+
function addSymbols2Anything(IS, typeOf) {
|
|
161
88
|
if (!Symbol.is) {
|
|
162
|
-
Symbol.is = Symbol.for(
|
|
163
|
-
Symbol.type = Symbol.for(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (!Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]) {
|
|
89
|
+
Symbol.is = Symbol.for(SYMBOL_KEYS.IS);
|
|
90
|
+
Symbol.type = Symbol.for(SYMBOL_KEYS.TYPE);
|
|
91
|
+
|
|
167
92
|
Object.defineProperties(Object.prototype, {
|
|
168
93
|
[Symbol.type]: { get() { return typeOf(this); }, enumerable: false, configurable: false },
|
|
169
94
|
[Symbol.is]: { value: function (...args) { return IS(this, ...args); }, enumerable: false, configurable: false },
|
|
@@ -175,38 +100,130 @@ function SymbolAndCustomProxyFactory(IS, typeOf, useSymbolicExtension) {
|
|
|
175
100
|
}
|
|
176
101
|
}
|
|
177
102
|
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
return oldSetter(target, key, value);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
return setterMethod2Modify;
|
|
103
|
+
function SymbolAndCustomProxyFactory(IS, typeOf, useSymbolicExtension) {
|
|
104
|
+
if (!Symbol.isSymbol) { Symbol.isSymbol = Symbol.for(SYMBOL_KEYS.IS_SYMBOL); }
|
|
105
|
+
|
|
106
|
+
return {xProxy: setCustomOrDefaultProxyFactory(), addSymbolicExtensions: () => addSymbols2Anything(IS, typeOf)};
|
|
186
107
|
}
|
|
187
108
|
|
|
188
|
-
function
|
|
109
|
+
function constructor2String(obj) {
|
|
189
110
|
const ctor = Object.getPrototypeOf(obj)?.constructor;
|
|
190
|
-
return ctor?.name ||
|
|
111
|
+
return ctor?.name || TYPE_STRINGS.OBJECT;
|
|
191
112
|
}
|
|
192
113
|
|
|
193
|
-
function
|
|
114
|
+
function createCustomProxy(nativeProxy) {
|
|
194
115
|
Proxy = new nativeProxy(nativeProxy, {
|
|
195
116
|
construct(target, args) {
|
|
196
|
-
for (let item of args) { if (item.set) { item = modifySetter(item); } }
|
|
197
117
|
const wrappedProxy = new target(...args);
|
|
198
|
-
wrappedProxy[Symbol.proxy] =
|
|
118
|
+
wrappedProxy[Symbol.proxy] = `${TYPE_STRINGS.PROXY_PREFIX}${constructor2String(args[0])})`;
|
|
199
119
|
return wrappedProxy;
|
|
200
120
|
}
|
|
201
121
|
});
|
|
202
122
|
return Proxy;
|
|
203
123
|
}
|
|
204
124
|
|
|
205
|
-
function
|
|
206
|
-
if (!Symbol.proxy) { Symbol.proxy = Symbol.for(
|
|
125
|
+
function setCustomOrDefaultProxyFactory() {
|
|
126
|
+
if (!Symbol.proxy) { Symbol.proxy = Symbol.for(SYMBOL_KEYS.PROXY); }
|
|
207
127
|
const nativeProxy = Proxy;
|
|
208
128
|
return {
|
|
209
129
|
native() { Proxy = nativeProxy; },
|
|
210
|
-
custom() { Proxy =
|
|
130
|
+
custom() { Proxy = createCustomProxy(nativeProxy); } };
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function processInput(input, ...shouldBe) {
|
|
134
|
+
const noShouldbe = shouldBe.length < 1;
|
|
135
|
+
const noInput = input === undefined || input === null;
|
|
136
|
+
|
|
137
|
+
return {
|
|
138
|
+
noInput,
|
|
139
|
+
noShouldbe,
|
|
140
|
+
compareTo: !noShouldbe && shouldBe[0],
|
|
141
|
+
inputCTOR: !noInput && Object.getPrototypeOf(input)?.constructor,
|
|
142
|
+
isNaN: Number.isNaN(input) || maybe({trial: _ => String(input) === TYPE_STRINGS.NAN}),
|
|
143
|
+
isInfinity: maybe({trial: _ => String(input)}) === TYPE_STRINGS.INFINITY,
|
|
144
|
+
shouldBeFirstElementIsNothing: !noShouldbe && verifyNothingness(shouldBe[0])
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function determineType(input, ...shouldBe) {
|
|
149
|
+
let { noInput, noShouldbe, compareTo, inputCTOR, isNaN, isInfinity, shouldBeFirstElementIsNothing } =
|
|
150
|
+
processInput(input, ...shouldBe);
|
|
151
|
+
shouldBe = shouldBe.length && shouldBe[0];
|
|
152
|
+
|
|
153
|
+
switch (true) {
|
|
154
|
+
case shouldBeFirstElementIsNothing: return String(input) === String(compareTo);
|
|
155
|
+
case input?.[Symbol.proxy] && noShouldbe: return input[Symbol.proxy];
|
|
156
|
+
case isNaN: return noShouldbe ? TYPE_STRINGS.NAN : String(compareTo) === String(input);
|
|
157
|
+
case isInfinity: return noShouldbe ? TYPE_STRINGS.INFINITY : String(compareTo) === String(input);
|
|
158
|
+
case noInput: return noShouldbe ? String(input) : String(compareTo) === String(input);
|
|
159
|
+
case inputCTOR === Boolean: return !shouldBe ? TYPE_STRINGS.BOOLEAN : inputCTOR === shouldBe;
|
|
160
|
+
default: return getResult(input, shouldBe, noShouldbe, finalInputResolver(input, inputCTOR));
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function finalInputResolver(input, inputCTOR) {
|
|
165
|
+
switch(true) {
|
|
166
|
+
case input === 0: return Number;
|
|
167
|
+
case input === ``: return String;
|
|
168
|
+
case !input: return {name: String(input)};
|
|
169
|
+
default: return inputCTOR;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function getResult(input, compareWith, noShouldbe, maybeResult) {
|
|
174
|
+
switch (true) {
|
|
175
|
+
case (!noShouldbe && compareWith === input) || (input?.[Symbol.proxy] && compareWith === Proxy):
|
|
176
|
+
return true;
|
|
177
|
+
case String(compareWith) === TYPE_STRINGS.NAN:
|
|
178
|
+
return String(input) === TYPE_STRINGS.NAN;
|
|
179
|
+
case input?.[Symbol.toStringTag] && typeof compareWith === `string`:
|
|
180
|
+
return String(compareWith) === input[Symbol.toStringTag];
|
|
181
|
+
default:
|
|
182
|
+
return compareWith ? resultWithComparison(input, compareWith, maybeResult) : resultWithoutComparison(input, maybeResult);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function resultWithoutComparison(input, maybeResult) {
|
|
187
|
+
const toStringTag = input?.[Symbol.toStringTag] ?? input?.prototype?.[Symbol.toStringTag];
|
|
188
|
+
return toStringTag || maybeResult?.name || String(maybeResult);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function resultWithComparison(input, compareWith, maybeResult) {
|
|
192
|
+
return maybe({trial: _ =>
|
|
193
|
+
input instanceof compareWith}) ||
|
|
194
|
+
compareWith === maybeResult ||
|
|
195
|
+
compareWith === Object.getPrototypeOf(maybeResult) ||
|
|
196
|
+
`${compareWith?.name}` === maybeResult?.name;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function WrapAnyFactory(IS, typeOf) {
|
|
200
|
+
return function (someObj) {
|
|
201
|
+
const wrapper = {
|
|
202
|
+
get value() { return someObj; },
|
|
203
|
+
is(...args) { return IS(someObj, ...args); },
|
|
204
|
+
get type() { return typeOf(someObj); },
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
if (Object[Symbol.type]) {
|
|
208
|
+
Object.defineProperties(wrapper, {
|
|
209
|
+
[Symbol.type]: { get() { return typeOf(someObj);} },
|
|
210
|
+
[Symbol.is]: { value(...args) { return IS(someObj, ...args); }}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
return Object.freeze(wrapper);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function maybeFactory() {
|
|
218
|
+
const errFn = err => undefined;
|
|
219
|
+
return function({trial, whenError = errFn } = {}) {
|
|
220
|
+
try { return trial(); } catch (err) { return whenError(err); }
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function verifyNothingness(maybeNothing, all = false) {
|
|
225
|
+
let nada = maybeNothing === null || maybeNothing === undefined;
|
|
226
|
+
nada = all ? nada || IS(maybeNothing, Infinity) || IS(maybeNothing, NaN) : nada;
|
|
227
|
+
return nada;
|
|
211
228
|
}
|
|
212
229
|
}
|