jqx-es 1.1.0 → 1.1.2

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.
@@ -1,15 +1,15 @@
1
- var JQx=(()=>{var se=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var nt=Object.prototype.hasOwnProperty;var ot=(e,t)=>{for(var r in t)se(e,r,{get:t[r],enumerable:!0})},it=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of rt(t))!nt.call(e,i)&&i!==r&&se(e,i,{get:()=>t[i],enumerable:!(n=tt(t,i))||n.enumerable});return e};var lt=e=>it(se({},"__esModule",{value:!0}),e);var yr={};ot(yr,{default:()=>b});var ae=ct(),Le=ut(),J=st(),Z=at();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 at(){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 ct(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function ut(){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 ce=!1,ft={on:()=>ce=!0,off:()=>ce=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ft,isAllowed(e){if(ce)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var de=!1,X=!1,W=!0,me=!1,dt=!0,$e,Q=()=>b("#logBox"),Te="#jqx_logger",mt=e=>{ae?.forEach(t=>e(t))},gt=()=>{ae&&mt($e);let e=dt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return ge(H(t),void 0,F.AfterBegin),b.node(Te)},Ce=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Ce(n)}`));if(!X)return;!W&&!b.node("#logBox")&&($e=b.createStyle("JQxLogCSS"),gt());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
2
- `;e.forEach(n=>W?console.info(`${q()} \u2714 ${Ce(n)}`):b.node("#jqx_logger").insertAdjacentHTML(me?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ue={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},fe={on(){de=!0},off(){de=!1}},N=(...e)=>de&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return b("#jqx_logger").is("visible")},on(){return ue.on(),fe.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(fe.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ue.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ue.off(),fe.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(me=!0,D("Reverse logging set: now logging bottom to top (latest first)"),b("#logBox .legend").addClass("reversed"),$),off:()=>(me=!1,b("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return b(Te).text(""),console.clear(),D("Logging cleared"),$}};var pt=yt(),Fe={html:"innerHTML",text:"textContent",class:"className"},pe=pt;function yt(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case Ct(n):return Ae(t,n,r);default:return Ae(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Ae(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>wt(r):$t(t)}}),e[t]}function bt(e,t,r){return t=t?.isJQx&&t.first()||t,be({trial:n=>Lt(t)?e.append(t):He(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
3
- `,n)})}function ht(e,t,...r){let n=xt(t,e);return r?.forEach(i=>bt(n,i,e)),n}function xt(e,t){switch(e=ye(t)?Et(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,He(e,t)?{html:e}:{text:e});case a(e,Node):return vt(t,e);default:return Y(t,e)}}function St(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Fe&&(e[Fe[r]]=e[t],delete e[t])}),e}function vt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=De(t,{});let r=Object.entries(t.data??{}),n=Object.assign(ye(e)?new Comment(t?.text):document.createElement(e),St(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function De(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function Et(e){return De(e)?e?.text??e?.textContent??"":String(e)}function wt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function He(e,t){return!ye(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function Lt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function ye(e){return e?.constructor===Comment||/comment/i.test(e)}function Ct(e){return!a(Y(e),HTMLUnknownElement)}function $t(e){return(t,...r)=>ht(e,t,...r)}var{IS:a,maybe:be,$Wrap:Ar,xProxy:Dr,isNothing:Hr}=Tt();function Tt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Or,$Wrap:Mr,xProxy:Nr,isNothing:Pr}=Ft();function Ft(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=h(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=At;function At({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=Dt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(je(f)));return}Object.entries(y).forEach(([f,h])=>{f=je(f.trim()),h=h.trim();let C;if(/!important/.test(h)&&(h=h.slice(0,h.indexOf("!important")).trim(),C="important"),!CSS.supports(f,h))return console.error(`StylingFactory ${L} error: '${f}' with value '${h}' not supported (yet)`);Oe(()=>m.style.setProperty(f,h,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let h=n(m,!0),C=h||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,h)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${he(m)}`);let h=It(y.shift());return Oe(()=>E(f,h),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Ht(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function Dt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
4
- => @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Me(m.selectorText||"",d):Mt`${Ot(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,h)=>Me(f.selectorText||"",d)&&y.concat(h)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
5
- ${y.message}
6
- Rule: ${he(d)}
7
- ${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
8
- ${y.message}
9
- Rule: ${he(g)}
10
- ${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Ht(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${jt(n)}`)}`}function he(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function jt(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
- `)}function Ot(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Mt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
12
- `).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function je(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Oe(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Nt(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
- `).replaceAll("\\3b",";").split(`
14
- `)}function Pt(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function It(e){return Pt(Nt(e))}function Me(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Rt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),Bt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),kt=e=>{let t=e.length;for(;t--;){let r=Bt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Jt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Jt(t)}`||t).join(""):e,z=()=>`_${kt(Rt).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/&lt;/g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"&lt;");function Ne(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!b.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!b.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Qt=!0,le={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},Wt=e=>{if(Qt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},qt=function(e){let t=e.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(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(qt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Wt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),zt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},_t=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&ge(i,t,r);return s?[...n,s]:n},[]),ge=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?_t(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=zt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!Je(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},Ut=Ne(),Pe=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Be=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Ie=(e,t)=>e.andThen(t,!0),Re=(e,t)=>e.andThen(t),ke=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Vt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,b.editCssRule(`.${n}`,t),e.classList.add(n)},Gt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Be(e,n);a(n,String)&&ke(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},xe=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Zt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},Xt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},Se=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?Se(e,t,r):t),ve={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Zt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=Se(t,0),r.scrollLeftDistance=Se(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?b(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Ut(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=b(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||b.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&b.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Re,afterMe:Re,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return Xt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?b.virtual(t).collection:b.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?b.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=b(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Gt(n,t),e},before:Ie,beforeMe:Ie,clear:e=>w(e,Pe),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?b(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Vt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=b.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Pe),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?b(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>xe(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(b.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(b.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Qe(e);b.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?b.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=b.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!ke(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=b.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=b.virtual(t)),e),setData:(e,t)=>w(e,r=>Be(r,t)),show:e=>w(e,t=>xe(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?b(e.collection[t]):b(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),xe(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function We(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...Le);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},Yt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],Kt=e=>!!Yt.find(t=>t===e),qe=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,b(p))},r=(n,i)=>{k[n]||addEventListener(n,e,Kt(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var er={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:Je,isNode:re,isHtmlString:Ve,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ze,ElemArray2HtmlString:Xe,input2Collection:Ye,setCollectionFromCssSelector:Ke,addHandlerId:Qe,cssRuleEdit:Ee,addFn:tr,elems4Docs:Sn}=rr();function rr(){let e=K({createWithId:"JQxStylesheet"}),t=(f,h)=>r[f]=(C,...o)=>h(C,...o),r=ve.instanceExtensions,n=ve.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(h=>!L(h)),E=f=>a(f,Array)&&!f?.find(h=>!s(h)),T=f=>f?.filter(h=>h).reduce((h,C)=>h.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,h,C)=>{let o=h!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?h:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let h=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:h}),`[data-hid="${h}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,h)=>f.localeCompare(h));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>ir(t,r,e)})}function nr(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function or(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function ir(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return or(_e[t],r)();case t in ze:return nr(ze[t],r);default:return e[t]}}function et(e){let t=dr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(er,r,n)}),e}function lr(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,we(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,we(t,!1,e))}}}function Ue(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>Ee(t,{removeRule:1}))}function sr(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function ar(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function cr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function ur(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function fr(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(pe[e](...i))):ur(e)},enumerable:!1,configurable:!0}}function we(e,t,r,n){e=e.toLowerCase();let i=fr(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function dr(e){return cr(Object.entries(M.tagsRaw).reduce(mr(e),{}),gr(e))}function mr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,we(r,n,e)),t}}function gr(e){let t=(n,i)=>Ee(n,i),r=lr(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>Ee(i)),editCssRule:t,get setStyle(){return t},delegate:sr(qe()),virtual:ar(e),get fn(){return tr},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:We(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:Ue,removeCssRules:Ue,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var b=et(pr());function pr(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ve(r),v=!p&&Ze(r),L=v||p,x={collection:Ye(r)??[],isVirtual:s,isJQx:!0},E=Ge(x.collection),T=`input =&gt; ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Xe(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
15
- `),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ke(r,n,x);return N(`input => ${d}`),G(x)}}return lt(yr);})();
1
+ var JQx=(()=>{var se=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.prototype.hasOwnProperty;var it=(e,t)=>{for(var r in t)se(e,r,{get:t[r],enumerable:!0})},lt=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of nt(t))!ot.call(e,i)&&i!==r&&se(e,i,{get:()=>t[i],enumerable:!(n=rt(t,i))||n.enumerable});return e};var st=e=>lt(se({},"__esModule",{value:!0}),e);var br={};it(br,{default:()=>y});var ae=ut(),Ce=ft(),k=at(),Z=ct();function at(){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 ct(){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 ut(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function ft(){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 ce=!1,dt={on:()=>ce=!0,off:()=>ce=!1},M={tagsRaw:Z,allowUnknownHtmlTags:dt,isAllowed(e){if(ce)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var de=!1,X=!1,Q=!0,me=!1,mt=!0,$e,J=()=>y("#logBox"),Fe="#jqx_logger",gt=e=>{ae?.forEach(t=>e(t))},pt=()=>{ae&&gt($e);let e=mt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return ge(H(t),void 0,T.AfterBegin),y.node(Fe)},Le=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${W()} \u2714 ${Le(n)}`));if(!X)return;!Q&&!y.node("#logBox")&&($e=y.createStyle("JQxLogCSS"),pt());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
2
+ `;e.forEach(n=>Q?console.info(`${W()} \u2714 ${Le(n)}`):y.node("#jqx_logger").insertAdjacentHTML(me?"afterbegin":"beforeend",`<div class="entry">${W()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ue={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},fe={on(){de=!0},off(){de=!1}},P=(...e)=>de&&D(...e),$={get isConsole(){return Q===!0},get isOn(){return X},isVisible:function(){return y("#jqx_logger").is("visible")},on(){return ue.on(),fe.on(),Q||J()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return J().isEmpty||(fe.off(),D("Debug logging stopped"),J()?.removeClass("visible")),ue.off(),$},toConsole:{on(){return Q=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),Q=!1,$}},remove(){return ue.off(),fe.off(),J()?.remove(),console.clear(),console.log(`${W()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return J()?.removeClass("visible"),$},show:()=>(J()?.addClass("visible"),$),get reversed(){return{on:()=>(me=!0,D("Reverse logging set: now logging bottom to top (latest first)"),y("#logBox .legend").addClass("reversed"),$),off:()=>(me=!1,y("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return y(Fe).text(""),console.clear(),D("Logging cleared"),$}};var yt=bt(),Te={html:"innerHTML",text:"textContent",class:"className"},pe=yt;function bt(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case $t(n):return Ae(t,n,r);default:return Ae(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Ae(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>Ct(r):Ft(t)}}),e[t]}function ht(e,t,r){return t=t?.isJQx&&t.first()||t,be({trial:n=>Lt(t)?e.append(t):He(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
3
+ `,n)})}function xt(e,t,...r){let n=St(t,e);return r?.forEach(i=>ht(n,i,e)),n}function St(e,t){switch(e=ye(t)?wt(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,He(e,t)?{html:e}:{text:e});case a(e,Node):return Et(t,e);default:return Y(t,e)}}function vt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Te&&(e[Te[r]]=e[t],delete e[t])}),e}function Et(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=De(t,{});let r=Object.entries(t.data??{}),n=Object.assign(ye(e)?new Comment(t?.text):document.createElement(e),vt(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function De(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function wt(e){return De(e)?e?.text??e?.textContent??"":String(e)}function Ct(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function He(e,t){return!ye(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function Lt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function ye(e){return e?.constructor===Comment||/comment/i.test(e)}function $t(e){return!a(Y(e),HTMLUnknownElement)}function Ft(e){return(t,...r)=>xt(e,t,...r)}var{IS:a,maybe:be,$Wrap:Dr,xProxy:Hr,isNothing:jr}=Tt();function Tt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),b();let e=F(),[t,r]=[d(),L()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:w,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?p(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?S(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:v,inputCTOR:A,isNaN:N,isInfinity:I,shouldBeFirstElementIsNothing:R}=x(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(v);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case N:return u?"NaN":e({trial:B=>String(v)})===String(o);case I:return u?"Infinity":e({trial:B=>String(v)})===String(o);case c:return u?String(o):String(v)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return E(o,l,u,g(o,A))}}function g(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function x(o,...l){let c=l.length<1,u=!c&&l[0],v=!c&&w(l[0]),A=o==null,N=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:N,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:v}}function E(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:v=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:v=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function S(o,...l){return l.some(c=>n(o,c))}function w(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function F(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function p(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function b(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,v)=>u===Symbol.proxy?c[u]=v:l(c,u,v),o}function L(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let v of c)v.set&&(v=h(v));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Mr,$Wrap:Pr,xProxy:Nr,isNothing:Ir}=At();function At(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),b();let e=F(),[t,r]=[d(),L()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:w,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?p(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?S(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:v,inputCTOR:A,isNaN:N,isInfinity:I,shouldBeFirstElementIsNothing:R}=x(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(v);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case N:return u?"NaN":e({trial:B=>String(v)})===String(o);case I:return u?"Infinity":e({trial:B=>String(v)})===String(o);case c:return u?String(o):String(v)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return E(o,l,u,g(o,A))}}function g(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function x(o,...l){let c=l.length<1,u=!c&&l[0],v=!c&&w(l[0]),A=o==null,N=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:N,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:v}}function E(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:v=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:v=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function S(o,...l){return l.some(c=>n(o,c))}function w(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function F(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function p(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function b(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,v)=>u===Symbol.proxy?c[u]=v:l(c,u,v),o}function L(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let v of c)v.set&&(v=h(v));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=Dt;function Dt({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:g,consider:x,currentSheetID:E}=Ht({styleSheet:e,createWithId:t});function S(m,b){if(m&&b.removeProperties){Object.keys(b.removeProperties).forEach(f=>m.style.removeProperty(je(f)));return}Object.entries(b).forEach(([f,h])=>{f=je(f.trim()),h=h.trim();let L;if(/!important/.test(h)&&(h=h.slice(0,h.indexOf("!important")).trim(),L="important"),!CSS.supports(f,h))return console.error(`StylingFactory ${E} error: '${f}' with value '${h}' not supported (yet)`);Oe(()=>m.style.setProperty(f,h,L),`StylingFactory ${E} (setRule4Selector) failed`)})}function w(m,b,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${E} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(b.removeRule)return g(m);let h=n(m,!0),L=h||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return x(()=>S(L,b),m,h)}function F(m){let b=m.trim().split(/{/,2),f=b.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${E} (doParse): no (valid) selector could be extracted from rule ${he(m)}`);let h=Rt(b.shift());return Oe(()=>w(f,h),`StylingFactory ${E} (setRules) failed`)}function d(m){let b=r(m);return b.done?b.existing:F(m)}function p(m,b){return m.trim().startsWith("@media")?d(jt(m,b)):w(m,b)}return function(m,b={}){return i(m,b)&&(Object.keys(b).length?p(m,b):d(m))}}function Ht({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let p=document.querySelector(`#${d}`)?.sheet;if(p)return p;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
4
+ => @charset, @namespace and @import are not supported here`),{done:!0}}function g(d,p){return[...e.rules].find(m=>p?Me(m.selectorText||"",d):Pt`${Mt(d)}${[..."gim"]}`.test(m.cssText))}function x(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:w(d,1),done:!0}:{done:!1}}function E(d){let p=[...e.cssRules].reduce((b,f,h)=>Me(f.selectorText||"",d)&&b.concat(h)||b,[]),m=p.length;return p.forEach(b=>e.deleteRule(b)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function S(d,p){return d&&ne(d,String)&&d.trim().length>0&&ne(p,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function w(d){d=d.trim();let p=d.slice(0,d.indexOf("{")).trim(),m=!!g(p);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(b){return console.error(`StylingFactory ${n} (tryParse) ${b.name} Error:
5
+ ${b.message}
6
+ Rule: ${he(d)}
7
+ ${r}`),m}}function F(d,p,m){try{return d(),m}catch(b){return console.error(`StylingFactory ${n} (tryAddOrModify) ${b.name} Error:
8
+ ${b.message}
9
+ Rule: ${he(p)}
10
+ ${r}`),m}}return{sheet:e,removeRules:E,tryParseAtOrNestedRules:x,ruleExists:g,checkParams:S,tryParse:w,consider:F,currentSheetID:n}}function jt(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${Ot(n)}`)}`}function he(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function Ot(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
+ `)}function Mt(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Pt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
12
+ `).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function je(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function Oe(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Nt(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
+ `).replaceAll("\\3b",";").split(`
14
+ `)}function It(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function Rt(e){return It(Nt(e))}function Me(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Bt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),kt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Jt=e=>{let t=e.length;for(;t--;){let r=kt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Qt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Qt(t)}`||t).join(""):e,q=()=>`_${Jt(Bt).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/&lt;/g,"<"),W=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var z=e=>e.replace(/</g,"&lt;");function Pe(){let e=function(s){if(!s)return;let g=s.style,x=getComputedStyle(s),E=[g.visibility,x.visibility].includes("hidden"),S=[g.display,x.display].includes("none"),w=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,F=+x.opacity==0||+(g.opacity||1)==0;return!(w||F||S||E)},r=function(s){return s.parentNode?!!y.nodes(":is(:read-write)",s?.parentNode)?.find(g=>g===s):!1},n=function(s){return s.parentNode?!!y.nodes(":is(:modal)",s?.parentNode)?.find(g=>g===s):!1},i={notInDOM:!0,writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"};return s=>{let g=s.node;return g?{get writable(){return r(g)},get modal(){return n(g)},get inDOM(){return g.isConnected},get open(){return g.open??!1},get visible(){return e(g)},get disabled(){return g.hasAttribute("readonly")||g.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Wt=!0,le={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},qt=e=>{if(Wt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${z(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:z(t)}`)}},zt=function(e){let t=e.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(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?k.svg:k.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let g=s.name.trim().toLowerCase(),x=s.value.trim().toLowerCase().replace(le.whiteSpace,""),E=g==="href"?!le.validURL.test(x):le.notAllowedValues.test(x),S=g.startsWith("data")?!le.data.test(g):!!i[g];if(E||S){let w=ie(s.value||"none",60);w+=w.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${w}`,r.removeAttribute(s.name)}})}if(!(zt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),qt(t),e};var T=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),_t=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(T.end,e),t.childNodes.length?te(t):void 0},Ut=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),_=(e=[],t=document.body,r=T.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&ge(i,t,r);return s?[...n,s]:n},[]),ge=(e,t=document.body,r=T.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?Ut(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=_t(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var C=(e,t)=>{let r=e.collection.filter(n=>!Je(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},Vt=Pe(),Ne=e=>e&&(e.textContent="");var U=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Be=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Ie=(e,t)=>e.andThen(t,!0),Re=(e,t)=>e.andThen(t),ke=e=>e.startsWith("data")||k.html.find(t=>e.toLowerCase()===t),Gt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${q().slice(1)}`,y.editCssRule(`.${n}`,t),e.classList.add(n)},Zt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Be(e,n);a(n,String)&&ke(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},xe=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Xt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},Yt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},Se=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?Se(e,t,r):t),ve={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Xt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=Se(t,0),r.scrollLeftDistance=Se(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?z(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?z(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Vt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=y(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||y.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&y.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>C(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Re,afterMe:Re,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return Yt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?y.virtual(t).collection:y.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),g=!/^<(.+)[^>]+>$/m.test(i)?y.text(n):H(n);C(e,x=>x.append(r?g:U(g)))}re(n)&&C(e,i=>i.append(r?n:U(n))),n.isJQx&&!n.is.empty&&C(e,i=>n.collection.forEach(s=>i.append(r?s:U(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=y(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Zt(n,t),e},before:Ie,beforeMe:Ie,clear:e=>C(e,Ne),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?y(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>C(e,n=>Gt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=y.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>C(e,t),empty:e=>C(e,Ne),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?y(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>C(e,t=>xe(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e?.[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return C(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(y.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(g=>{n||(g.textContent=""),g.insertAdjacentHTML(y.at.end,s?.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Qe(e);y.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?y.text(n):H(n);s=r?s:U(s),C(e,g=>g.prepend(s.cloneNode(!0)))}re(n)&&C(e,i=>i.prepend(r?n:U(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),C(e,i=>C(n,s=>i.prepend(r?s:U(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=y.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!ke(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;C(e,x=>{if(i.startsWith("data"))return x.dataset[i.slice(i.indexOf("-")+1)]=s;x[i]=s})}),e},remove:(e,t)=>{P(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(C(i,r),n()),e}return C(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>C(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=y.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>C(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=y.virtual(t)),e),setData:(e,t)=>C(e,r=>Be(r,t)),show:e=>C(e,t=>xe(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?y(e.collection[t]):y(e.collection[0]):e,style:(e,t,r)=>C(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),xe(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?C(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=T.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=_(e.collection,t,r),e),toggleClass:(e,t)=>C(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function We(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...Ce);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>e.delegateCaptured({type:d,handlers:S,name:"genericPopupCloseHandler",capture:!0})),Object.freeze({show:i,removeModal:E});function i(d){if(r.open)return;n={...d};let{content:p}=n;return e.IS(p,String,HTMLElement)||p?.isJQx?g():!0}function s(){return n.modal?F(n.warnMessage):x()}function g(){t.clear();let{content:d,modal:p,closeAfter:m}=n;p=e.IS(p,Boolean)?p:!1;let b=p?"":e.div({id:"closeHandleIcon"});t.append(b,e.IS(d,String)?e.div(d):d),r.showModal(),!p&&e.IS(m,Number)&&w(s,m)}function x(){r.close(n.returnValue),e.IS(n.callback,Function)&&n.callback(n.returnValue),n={}}function E({callback:d,value:p}={}){n.returnValue=p,n.modal=!1,n.callback=d||n.callback,s()}function S(d){if(Object.keys(n).length<1)return;n.activeTimer&&clearTimeout(n.activeTimer);let p=d.key==="Escape";return p&&d.preventDefault(),(p||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function w(d,p){e.IS(d,Function)&&e.IS(p,Number)&&p>0&&(n.activeTimer=setTimeout(d,p*1e3))}function F(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let p=t.find$(".warn");switch(!0){case p.is.empty:p=e.div({class:"warn"},d);default:t.append(p.addClass("active")),w(()=>t.find$(".warn").removeClass("active"),2)}}}var V={},Kt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],qe=e=>!!Kt.find(t=>t===e),ze=()=>{let e=n=>V[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let g=s.target?.closest?.(n);return g&&i(s,y(g))},r=(n,i,s,g)=>{if(V[n]||(V[n]=new Map),!(V[n].has(i)||[...V[n].values()].find(E=>E.name&&E.name===g))){addEventListener(n,i,s||qe(n));let E={name:g||i.name,capture:s||qe(n)};V[n].set(i,E)}};return({eventType:n,selector:i,callback:s,name:g,capture:x=!1}={})=>{if(!(y.IS(n,String)||n?.length<1)||!y.IS(s,Function))return;n=n.toLowerCase(),x=y.IS(x,Boolean)?x:!1;let E=y.IS(i,String)?t(i,s):s;r(n,E,x,g)}};var er={},{instanceMethods:_e,instanceGetters:Ue,isCommentOrTextNode:Je,isNode:re,isHtmlString:Ge,isArrayOfHtmlElements:Ze,isArrayOfHtmlStrings:Xe,ElemArray2HtmlString:Ye,input2Collection:Ke,setCollectionFromCssSelector:et,addHandlerId:Qe,cssRuleEdit:Ee,addFn:tr,elems4Docs:vn}=rr();function rr(){let e=K({createWithId:"JQxStylesheet"}),t=(f,h)=>r[f]=(L,...o)=>h(L,...o),r=ve.instanceExtensions,n=ve.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),g=f=>a(f,Comment),x=f=>a(f,Text),E=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),S=f=>a(f,Array)&&!f?.find(h=>!E(h)),w=f=>a(f,Array)&&!f?.find(h=>!s(h)),F=f=>f?.filter(h=>h).reduce((h,L)=>h.concat(g(L)?`<!--${L.data}-->`:i(L)?L.textContent:L.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:w(f)?f:f.isJQx?f.collection:void 0:[],p=(f,h,L)=>{let o=h!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?h:document,l;try{L.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${L.collection.length} element(s)`},m=f=>{let h=f.data.get("hid")||`HID${q()}`;return f.data.add({hid:h}),`[data-hid="${h}"]`},b=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,h)=>f.localeCompare(h));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:g,isText:x,isHtmlString:E,isArrayOfHtmlElements:w,isArrayOfHtmlStrings:S,ElemArray2HtmlString:F,input2Collection:d,setCollectionFromCssSelector:p,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:b}}function G(e){return new Proxy(e,{get:(t,r)=>ir(t,r,e)})}function nr(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function or(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function ir(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in Ue:return or(Ue[t],r)();case t in _e:return nr(_e[t],r);default:return e[t]}}function tt(e){let t=mr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(er,r,n)}),e}function lr(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,we(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,we(t,!1,e))}}}function Ve(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>Ee(t,{removeRule:1}))}function sr(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e({eventType:t,selector:r,callback:i}))}}function ar(e){return function({type:t,origin:r,handlers:n,name:i,capture:s}={}){if(!a(n,Function,Array))return;n=a(n,Function)?[n]:n;let g={eventType:t,selector:r,capture:s,name:i};n.forEach(x=>{a(x,Function)&&e({...g,callback:x})})}}function cr(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(T).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function ur(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function fr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function dr(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(pe[e](...i))):fr(e)},enumerable:!1,configurable:!0}}function we(e,t,r,n){e=e.toLowerCase();let i=dr(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function mr(e){return ur(Object.entries(M.tagsRaw).reduce(gr(e),{}),pr(e))}function gr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,we(r,n,e)),t}}function pr(e){let t=(i,s)=>Ee(i,s),r=lr(e),n=ze();return{debugLog:$,log:(...i)=>D("fromStatic",...i),insertPositions:T,get at(){return T},editCssRules:(...i)=>i.forEach(s=>Ee(s)),editCssRule:t,get setStyle(){return t},delegate:sr(n),delegateCaptured:ar(n),virtual:cr(e),get fn(){return tr},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:We(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:i=>K({createWithId:i||`jqx${q()}`}),editStylesheet:i=>K({createWithId:i||`jqx${q()}`}),removeCssRule:Ve,removeCssRules:Ve,text:(i,s=!1)=>s?e.comment(i):document.createTextNode(i),node:(i,s=document)=>s.querySelector(i,s),nodes:(i,s=document)=>[...s.querySelectorAll(i,s)]}}var y=tt(yr());function yr(){return function(r,n,i=T.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(T).find(p=>i===p)?i:void 0;let g=Ge(r),x=!g&&Xe(r),E=x||g,S={collection:Ke(r)??[],isVirtual:s,isJQx:!0},w=Ze(S.collection),F=`input =&gt; ${x?`"${j(r.join(", "),70)}"`:!E&&w?`element collection [${j(S.collection.map(p=>`${a(p,Comment,Text)?"Comment|Text @":""} ${p?.outerHTML||p?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(S.collection.length&&w)return P(F),s||S.collection.forEach(p=>{n.contains(p)||_([p],n,i)}),G(S);if(E){if([r].flat().forEach(p=>S.collection.push(H(p))),S.collection.length>0){let p=S.collection.filter(m=>m?.dataset?.jqxcreationerror);S.collection=S.collection.filter(m=>!m?.dataset?.jqxcreationerror),P(`${F}`),P(`*Created ${S.isVirtual?"VIRTUAL ":""}[${j(Ye(S.collection)||"sanitized: no elements remaining",70)}]`),p.length&&console.error(`JQx: illegal html, not rendered: "${p.reduce((m,b)=>m.concat(`${b.textContent}
15
+ `),"").trim()}"`),S.isVirtual||_(S.collection,n,i)}return G(S)}let d=et(r,n,S);return P(`input => ${d}`),G(S)}}return st(br);})();
package/Bundle/jqx.min.js CHANGED
@@ -1,15 +1,15 @@
1
- var se=rt(),we=nt(),J=et(),Z=tt();function et(){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 tt(){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 rt(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function nt(){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 ae=!1,ot={on:()=>ae=!0,off:()=>ae=!1},M={tagsRaw:Z,allowUnknownHtmlTags:ot,isAllowed(e){if(ae)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var fe=!1,X=!1,W=!0,de=!1,it=!0,Ce,Q=()=>h("#logBox"),$e="#jqx_logger",lt=e=>{se?.forEach(t=>e(t))},st=()=>{se&&lt(Ce);let e=it?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return me(H(t),void 0,F.AfterBegin),h.node($e)},Le=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${q()} \u2714 ${Le(n)}`));if(!X)return;!W&&!h.node("#logBox")&&(Ce=h.createStyle("JQxLogCSS"),st());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
2
- `;e.forEach(n=>W?console.info(`${q()} \u2714 ${Le(n)}`):h.node("#jqx_logger").insertAdjacentHTML(de?"afterbegin":"beforeend",`<div class="entry">${q()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ce={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},ue={on(){fe=!0},off(){fe=!1}},N=(...e)=>fe&&D(...e),$={get isConsole(){return W===!0},get isOn(){return X},isVisible:function(){return h("#jqx_logger").is("visible")},on(){return ce.on(),ue.on(),W||Q()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return Q().isEmpty||(ue.off(),D("Debug logging stopped"),Q()?.removeClass("visible")),ce.off(),$},toConsole:{on(){return W=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),W=!1,$}},remove(){return ce.off(),ue.off(),Q()?.remove(),console.clear(),console.log(`${q()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return Q()?.removeClass("visible"),$},show:()=>(Q()?.addClass("visible"),$),get reversed(){return{on:()=>(de=!0,D("Reverse logging set: now logging bottom to top (latest first)"),h("#logBox .legend").addClass("reversed"),$),off:()=>(de=!1,h("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return h($e).text(""),console.clear(),D("Logging cleared"),$}};var at=ct(),Te={html:"innerHTML",text:"textContent",class:"className"},ge=at;function ct(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case ht(n):return Fe(t,n,r);default:return Fe(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Fe(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>yt(r):xt(t)}}),e[t]}function ut(e,t,r){return t=t?.isJQx&&t.first()||t,ye({trial:n=>bt(t)?e.append(t):De(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
3
- `,n)})}function ft(e,t,...r){let n=dt(t,e);return r?.forEach(i=>ut(n,i,e)),n}function dt(e,t){switch(e=pe(t)?pt(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,De(e,t)?{html:e}:{text:e});case a(e,Node):return gt(t,e);default:return Y(t,e)}}function mt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Te&&(e[Te[r]]=e[t],delete e[t])}),e}function gt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=Ae(t,{});let r=Object.entries(t.data??{}),n=Object.assign(pe(e)?new Comment(t?.text):document.createElement(e),mt(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function Ae(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function pt(e){return Ae(e)?e?.text??e?.textContent??"":String(e)}function yt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function De(e,t){return!pe(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function bt(e){return e?.constructor===Comment||e?.constructor===CharacterData}function pe(e){return e?.constructor===Comment||/comment/i.test(e)}function ht(e){return!a(Y(e),HTMLUnknownElement)}function xt(e){return(t,...r)=>ft(e,t,...r)}var{IS:a,maybe:ye,$Wrap:Sr,xProxy:vr,isNothing:Er}=St();function St(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Lr,$Wrap:Cr,xProxy:$r,isNothing:Tr}=vt();function vt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),y();let e=T(),[t,r]=[d(),C()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:E,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?g(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?x(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:S,inputCTOR:A,isNaN:P,isInfinity:I,shouldBeFirstElementIsNothing:R}=v(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(S);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case P:return u?"NaN":e({trial:B=>String(S)})===String(o);case I:return u?"Infinity":e({trial:B=>String(S)})===String(o);case c:return u?String(o):String(S)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return L(o,l,u,p(o,A))}}function p(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function v(o,...l){let c=l.length<1,u=!c&&l[0],S=!c&&E(l[0]),A=o==null,P=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:P,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:S}}function L(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:S=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:S=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function x(o,...l){return l.some(c=>n(o,c))}function E(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function T(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function g(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function y(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function b(o){let l=o.set;return o.set=(c,u,S)=>u===Symbol.proxy?c[u]=S:l(c,u,S),o}function C(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let S of c)S.set&&(S=b(S));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=Et;function Et({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:p,consider:v,currentSheetID:L}=wt({styleSheet:e,createWithId:t});function x(m,y){if(m&&y.removeProperties){Object.keys(y.removeProperties).forEach(f=>m.style.removeProperty(He(f)));return}Object.entries(y).forEach(([f,b])=>{f=He(f.trim()),b=b.trim();let C;if(/!important/.test(b)&&(b=b.slice(0,b.indexOf("!important")).trim(),C="important"),!CSS.supports(f,b))return console.error(`StylingFactory ${L} error: '${f}' with value '${b}' not supported (yet)`);je(()=>m.style.setProperty(f,b,C),`StylingFactory ${L} (setRule4Selector) failed`)})}function E(m,y,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${L} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(y.removeRule)return p(m);let b=n(m,!0),C=b||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return v(()=>x(C,y),m,b)}function T(m){let y=m.trim().split(/{/,2),f=y.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${L} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);let b=Dt(y.shift());return je(()=>E(f,b),`StylingFactory ${L} (setRules) failed`)}function d(m){let y=r(m);return y.done?y.existing:T(m)}function g(m,y){return m.trim().startsWith("@media")?d(Lt(m,y)):E(m,y)}return function(m,y={}){return i(m,y)&&(Object.keys(y).length?g(m,y):d(m))}}function wt({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let g=document.querySelector(`#${d}`)?.sheet;if(g)return g;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
4
- => @charset, @namespace and @import are not supported here`),{done:!0}}function p(d,g){return[...e.rules].find(m=>g?Oe(m.selectorText||"",d):Tt`${$t(d)}${[..."gim"]}`.test(m.cssText))}function v(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:E(d,1),done:!0}:{done:!1}}function L(d){let g=[...e.cssRules].reduce((y,f,b)=>Oe(f.selectorText||"",d)&&y.concat(b)||y,[]),m=g.length;return g.forEach(y=>e.deleteRule(y)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function x(d,g){return d&&ne(d,String)&&d.trim().length>0&&ne(g,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function E(d){d=d.trim();let g=d.slice(0,d.indexOf("{")).trim(),m=!!p(g);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(y){return console.error(`StylingFactory ${n} (tryParse) ${y.name} Error:
5
- ${y.message}
6
- Rule: ${be(d)}
7
- ${r}`),m}}function T(d,g,m){try{return d(),m}catch(y){return console.error(`StylingFactory ${n} (tryAddOrModify) ${y.name} Error:
8
- ${y.message}
9
- Rule: ${be(g)}
10
- ${r}`),m}}return{sheet:e,removeRules:L,tryParseAtOrNestedRules:v,ruleExists:p,checkParams:x,tryParse:E,consider:T,currentSheetID:n}}function Lt(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${Ct(n)}`)}`}function be(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function Ct(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
- `)}function $t(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Tt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
12
- `).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function He(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function je(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function Ft(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
- `).replaceAll("\\3b",";").split(`
14
- `)}function At(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function Dt(e){return At(Ft(e))}function Oe(e,t){return e?.replace("::",":")===t?.replace("::",":")}var Ht=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),jt=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Ot=e=>{let t=e.length;for(;t--;){let r=jt(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Mt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Mt(t)}`||t).join(""):e,z=()=>`_${Ot(Ht).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/&lt;/g,"<"),q=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var _=e=>e.replace(/</g,"&lt;");function Me(){let e=function(s){if(!s)return;let p=s.style,v=getComputedStyle(s),L=[p.visibility,v.visibility].includes("hidden"),x=[p.display,v.display].includes("none"),E=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,T=+v.opacity==0||+(p.opacity||1)==0;return!(E||T||x||L)},t="n/a",r=function(s){return s.parentNode?!!h.nodes(":is(:read-write)",s?.parentNode)?.find(p=>p===s):!1},n=function(s){return s.parentNode?!!h.nodes(":is(:modal)",s?.parentNode)?.find(p=>p===s):!1},i={notInDOM:!0,writable:t,modal:t,empty:!0,open:t,visible:t};return s=>{let p=s.node;return p?{get writable(){return r(p)},get modal(){return n(p)},get inDOM(){return p.isConnected},get open(){return p.open??!1},get visible(){return e(p)},get disabled(){return p.hasAttribute("readonly")||p.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Nt=!0,le={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},Pt=e=>{if(Nt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${_(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:_(t)}`)}},It=function(e){let t=e.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(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?J.svg:J.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let p=s.name.trim().toLowerCase(),v=s.value.trim().toLowerCase().replace(le.whiteSpace,""),L=p==="href"?!le.validURL.test(v):le.notAllowedValues.test(v),x=p.startsWith("data")?!le.data.test(p):!!i[p];if(L||x){let E=ie(s.value||"none",60);E+=E.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${E}`,r.removeAttribute(s.name)}})}if(!(It(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),Pt(t),e};var F=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),Rt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(F.end,e),t.childNodes.length?te(t):void 0},Bt=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),U=(e=[],t=document.body,r=F.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&me(i,t,r);return s?[...n,s]:n},[]),me=(e,t=document.body,r=F.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?Bt(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=Rt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var w=(e,t)=>{let r=e.collection.filter(n=>!ke(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},kt=Me(),Ne=e=>e&&(e.textContent="");var V=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Re=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Pe=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Be=e=>e.startsWith("data")||J.html.find(t=>e.toLowerCase()===t),Jt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${z().slice(1)}`,h.editCssRule(`.${n}`,t),e.classList.add(n)},Qt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Re(e,n);a(n,String)&&Be(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},he=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},Wt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},qt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},xe=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?xe(e,t,r):t),Se={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},Wt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=xe(t,0),r.scrollLeftDistance=xe(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?_(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?_(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?h(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>kt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=h(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||h.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&h.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return qt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?h.virtual(t).collection:h.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),p=!/^<(.+)[^>]+>$/m.test(i)?h.text(n):H(n);w(e,v=>v.append(r?p:V(p)))}re(n)&&w(e,i=>i.append(r?n:V(n))),n.isJQx&&!n.is.empty&&w(e,i=>n.collection.forEach(s=>i.append(r?s:V(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=h(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Qt(n,t),e},before:Pe,beforeMe:Pe,clear:e=>w(e,Ne),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?h(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>w(e,n=>Jt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=h.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>w(e,t),empty:e=>w(e,Ne),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?h(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>w(e,t=>he(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return w(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(h.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(p=>{n||(p.textContent=""),p.insertAdjacentHTML(h.at.end,s.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Je(e);h.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?h.text(n):H(n);s=r?s:V(s),w(e,p=>p.prepend(s.cloneNode(!0)))}re(n)&&w(e,i=>i.prepend(r?n:V(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),w(e,i=>w(n,s=>i.prepend(r?s:V(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=h.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!Be(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;w(e,v=>{if(i.startsWith("data"))return v.dataset[i.slice(i.indexOf("-")+1)]=s;v[i]=s})}),e},remove:(e,t)=>{N(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(w(i,r),n()),e}return w(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>w(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=h.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>w(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=h.virtual(t)),e),setData:(e,t)=>w(e,r=>Re(r,t)),show:e=>w(e,t=>he(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?h(e.collection[t]):h(e.collection[0]):e,style:(e,t,r)=>w(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),he(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?w(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=F.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=U(e.collection,t,r),e),toggleClass:(e,t)=>w(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function Qe(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...we);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>document.addEventListener(d,x,!0)),Object.freeze({show:i,removeModal:L});function i(d){if(r.open)return;n={...d};let{content:g}=n;return e.IS(g,String,HTMLElement)||g?.isJQx?p():!0}function s(){return n.modal?T(n.warnMessage):v()}function p(){t.clear();let{content:d,modal:g,closeAfter:m}=n;g=e.IS(g,Boolean)?g:!1;let y=g?"":e.div({id:"closeHandleIcon"});t.append(y,e.IS(d,String)?e.div(d):d),r.showModal(),!g&&e.IS(m,Number)&&E(s,m)}function v(){return r.close(n.returnValue),e.IS(n.callback,Function)?n.callback(n.returnValue):!0}function L({callback:d,value:g}={}){n.returnValue=g,n.modal=!1,n.callback=d||n.callback,s()}function x(d){n.activeTimer&&clearTimeout(n.activeTimer);let g=d.key==="Escape";return g&&d.preventDefault(),(g||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function E(d,g){e.IS(d,Function)&&e.IS(g,Number)&&g>0&&(n.activeTimer=setTimeout(d,g*1e3))}function T(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let g=t.find$(".warn");switch(!0){case g.is.empty:g=e.div({class:"warn"},d);default:t.append(g.addClass("active")),E(()=>t.find$(".warn").removeClass("active"),2)}}}var k={},zt=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],_t=e=>!!zt.find(t=>t===e),We=()=>{let e=n=>k[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let p=s.target?.closest?.(n);return p&&i(s,h(p))},r=(n,i)=>{k[n]||addEventListener(n,e,_t(n))};return(n,i,s,p=!1)=>{r(n,p);let v=i?t(i,s):s;k=k[n]?{...k,[n]:k[n].concat(v)}:{...k,[n]:[v]}}};var Ut={},{instanceMethods:qe,instanceGetters:ze,isCommentOrTextNode:ke,isNode:re,isHtmlString:Ue,isArrayOfHtmlElements:Ve,isArrayOfHtmlStrings:Ge,ElemArray2HtmlString:Ze,input2Collection:Xe,setCollectionFromCssSelector:Ye,addHandlerId:Je,cssRuleEdit:ve,addFn:Vt,elems4Docs:fn}=Gt();function Gt(){let e=K({createWithId:"JQxStylesheet"}),t=(f,b)=>r[f]=(C,...o)=>b(C,...o),r=Se.instanceExtensions,n=Se.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),p=f=>a(f,Comment),v=f=>a(f,Text),L=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),x=f=>a(f,Array)&&!f?.find(b=>!L(b)),E=f=>a(f,Array)&&!f?.find(b=>!s(b)),T=f=>f?.filter(b=>b).reduce((b,C)=>b.concat(p(C)?`<!--${C.data}-->`:i(C)?C.textContent:C.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:E(f)?f:f.isJQx?f.collection:void 0:[],g=(f,b,C)=>{let o=b!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?b:document,l;try{C.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${C.collection.length} element(s)`},m=f=>{let b=f.data.get("hid")||`HID${z()}`;return f.data.add({hid:b}),`[data-hid="${b}"]`},y=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,b)=>f.localeCompare(b));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:p,isText:v,isHtmlString:L,isArrayOfHtmlElements:E,isArrayOfHtmlStrings:x,ElemArray2HtmlString:T,input2Collection:d,setCollectionFromCssSelector:g,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:y}}function G(e){return new Proxy(e,{get:(t,r)=>Yt(t,r,e)})}function Zt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Xt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Yt(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in ze:return Xt(ze[t],r)();case t in qe:return Zt(qe[t],r);default:return e[t]}}function Ke(e){let t=ir(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(Ut,r,n)}),e}function Kt(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function _e(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>ve(t,{removeRule:1}))}function er(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e(t,r,i))}}function tr(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(F).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function rr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function nr(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function or(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(ge[e](...i))):nr(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,n){e=e.toLowerCase();let i=or(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function ir(e){return rr(Object.entries(M.tagsRaw).reduce(lr(e),{}),sr(e))}function lr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,Ee(r,n,e)),t}}function sr(e){let t=(n,i)=>ve(n,i),r=Kt(e);return{debugLog:$,log:(...n)=>D("fromStatic",...n),insertPositions:F,get at(){return F},editCssRules:(...n)=>n.forEach(i=>ve(i)),editCssRule:t,get setStyle(){return t},delegate:er(We()),virtual:tr(e),get fn(){return Vt},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:n=>K({createWithId:n||`jqx${z()}`}),editStylesheet:n=>K({createWithId:n||`jqx${z()}`}),removeCssRule:_e,removeCssRules:_e,text:(n,i=!1)=>i?e.comment(n):document.createTextNode(n),node:(n,i=document)=>i.querySelector(n,i),nodes:(n,i=document)=>[...i.querySelectorAll(n,i)]}}var h=Ke(ar());function ar(){return function(r,n,i=F.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(F).find(g=>i===g)?i:void 0;let p=Ue(r),v=!p&&Ge(r),L=v||p,x={collection:Xe(r)??[],isVirtual:s,isJQx:!0},E=Ve(x.collection),T=`input =&gt; ${v?`"${j(r.join(", "),70)}"`:!L&&E?`element collection [${j(x.collection.map(g=>`${a(g,Comment,Text)?"Comment|Text @":""} ${g?.outerHTML||g?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(x.collection.length&&E)return N(T),s||x.collection.forEach(g=>{n.contains(g)||U([g],n,i)}),G(x);if(L){if([r].flat().forEach(g=>x.collection.push(H(g))),x.collection.length>0){let g=x.collection.filter(m=>m?.dataset?.jqxcreationerror);x.collection=x.collection.filter(m=>!m?.dataset?.jqxcreationerror),N(`${T}`),N(`*Created ${x.isVirtual?"VIRTUAL ":""}[${j(Ze(x.collection)||"sanitized: no elements remaining",70)}]`),g.length&&console.error(`JQx: illegal html, not rendered: "${g.reduce((m,y)=>m.concat(`${y.textContent}
15
- `),"").trim()}"`),x.isVirtual||U(x.collection,n,i)}return G(x)}let d=Ye(r,n,x);return N(`input => ${d}`),G(x)}}export{h as default};
1
+ var se=nt(),we=ot(),k=tt(),Z=rt();function tt(){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 rt(){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 nt(){return["#logBox{min-width:0px;max-width:0px;min-height:0px;max-height:0px;width:0;height:0;z-index:-1;border:none;padding:0px;overflow:hidden;transition:all 0.3s ease;margin-top:-100px;}","#logBox.visible{background-color:rgb(255, 255, 224);z-index:1;position:static;border:1px dotted rgb(153, 153, 153);max-width:50vw;min-width:30vw;min-height:10vh;max-height:90vh;overflow:auto;width:50vw;height:20vh;margin:1rem 0px;padding:0px 8px 19px;resize:both;}","#logBox.visible .legend{position:absolute;}","#logBox .legend{text-align:center;margin-top:-1em;width:inherit;max-width:inherit;}","#logBox .legend div{text-align:center;display:inline-block;max-width:inherit;height:1.2rem;background-color:rgb(119, 119, 119);padding:2px 10px;color:rgb(255, 255, 255);box-shadow:rgb(119 119 119) 2px 1px 10px;border-radius:4px;}","#logBox .legend div:before{content:'JQx Logging (chronological)';}","#logBox .legend.reversed div:before{content:'JQx Logging (reversed)';}","#logBox #jqx_logger{marginTop:0.7rem;lineHeight:1.4em;font-family:consolas,monospace;whiteSpace:pre-wrap;maxWidth:inherit;padding-left:100px;}","#logBox #jqx_logger div.entry{text-indent:-100px;whiteSpace:normal;}"]}function ot(){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 ae=!1,it={on:()=>ae=!0,off:()=>ae=!1},M={tagsRaw:Z,allowUnknownHtmlTags:it,isAllowed(e){if(ae)return!0;let t=a(e,String)?e.toLowerCase():e?.nodeName.toLowerCase()||"none";return t==="#text"||!!Z[t]},allowTag:e=>Z[e.toLowerCase()]=!0,prohibitTag:e=>Z[e.toLowerCase()]=!1};var fe=!1,X=!1,Q=!0,de=!1,lt=!0,Le,J=()=>y("#logBox"),$e="#jqx_logger",st=e=>{se?.forEach(t=>e(t))},at=()=>{se&&st(Le);let e=lt?"div":"pre",t=`<div id="logBox"><div class="legend"><div></div></div><${e} id="jqx_logger"></${e}></div>`;return me(H(t),void 0,T.AfterBegin),y.node($e)},Ce=e=>a(e,String)&&Object.assign(document.createElement("textarea"),{innerHTML:e}).textContent||e,D=(...e)=>{let t=e[0]==="fromStatic";if(e=t?e.slice(1):e,t&&!X)return e.forEach(n=>console.info(`${W()} \u2714 ${Ce(n)}`));if(!X)return;!Q&&!y.node("#logBox")&&(Le=y.createStyle("JQxLogCSS"),at());let r=n=>`${a(n,Object)?JSON.stringify(n,null,2):n}
2
+ `;e.forEach(n=>Q?console.info(`${W()} \u2714 ${Ce(n)}`):y.node("#jqx_logger").insertAdjacentHTML(de?"afterbegin":"beforeend",`<div class="entry">${W()} ${r(n.replace(/\n/g,"<br>"))}</div>`))},ce={on(){X=!0,D("Logging activated")},off(){X=!1,console.log("Logging deactivated")}},ue={on(){fe=!0},off(){fe=!1}},P=(...e)=>fe&&D(...e),$={get isConsole(){return Q===!0},get isOn(){return X},isVisible:function(){return y("#jqx_logger").is("visible")},on(){return ce.on(),ue.on(),Q||J()?.addClass("visible"),D("Debug logging started. Every call to [jqx instance] is logged"),$},off(){return J().isEmpty||(ue.off(),D("Debug logging stopped"),J()?.removeClass("visible")),ce.off(),$},toConsole:{on(){return Q=!0,D("Started logging to console"),$},off(){return D("Stopped logging to console (except error messages)"),Q=!1,$}},remove(){return ce.off(),ue.off(),J()?.remove(),console.clear(),console.log(`${W()} logging completely disabled and all entries removed`),$},log:function(...e){return D(...e),$},hide(){return J()?.removeClass("visible"),$},show:()=>(J()?.addClass("visible"),$),get reversed(){return{on:()=>(de=!0,D("Reverse logging set: now logging bottom to top (latest first)"),y("#logBox .legend").addClass("reversed"),$),off:()=>(de=!1,y("#logBox .legend").removeClass("reversed"),D("Reverse logging reset: now logging chronological (latest last)"),$)}},clear(){return y($e).text(""),console.clear(),D("Logging cleared"),$}};var ct=ut(),Fe={html:"innerHTML",text:"textContent",class:"className"},ge=ct;function ut(){let e={get(t,r){let n=String(r)?.toLowerCase();switch(!0){case n in t:return t[n];case xt(n):return Te(t,n,r);default:return Te(t,n,r,!0)}},enumerable:!1,configurable:!1};return new Proxy({},e)}function Te(e,t,r,n=!1){return Object.defineProperty(e,t,{get(){return n?i=>bt(r):St(t)}}),e[t]}function ft(e,t,r){return t=t?.isJQx&&t.first()||t,ye({trial:n=>ht(t)?e.append(t):De(t)?e.insertAdjacentHTML("beforeend",t):e.append(t),whenError:n=>console.info(`${r} (for root ${e}) not created, reason
3
+ `,n)})}function dt(e,t,...r){let n=mt(t,e);return r?.forEach(i=>ft(n,i,e)),n}function mt(e,t){switch(e=pe(t)?yt(e):e?.isJQx?e.first():e,!0){case a(e,String):return Y(t,De(e,t)?{html:e}:{text:e});case a(e,Node):return pt(t,e);default:return Y(t,e)}}function gt(e){return delete e.data,Object.keys(e).length<1||Object.keys(e).forEach(t=>{let r=t.toLowerCase();r in Fe&&(e[Fe[r]]=e[t],delete e[t])}),e}function pt(e,t){let r=Y(e);return r.append(t),r}function Y(e,t={}){t=Ae(t,{});let r=Object.entries(t.data??{}),n=Object.assign(pe(e)?new Comment(t?.text):document.createElement(e),gt(t));return r.length&&r.forEach(([i,s])=>n.dataset[i]=String(s)),n}function Ae(e,t){return t?a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy],defaultValue:t}):a(e,{isTypes:Object,notTypes:[Array,null,NaN,Proxy]})}function yt(e){return Ae(e)?e?.text??e?.textContent??"":String(e)}function bt(e){return Y("b",{style:"color:red",text:`'${e}' is not a valid HTML-tag`})}function De(e,t){return!pe(t)&&a(e,String)&&/<.*>|&[#|0-9a-z]+[^;];/i.test(e)}function ht(e){return e?.constructor===Comment||e?.constructor===CharacterData}function pe(e){return e?.constructor===Comment||/comment/i.test(e)}function xt(e){return!a(Y(e),HTMLUnknownElement)}function St(e){return(t,...r)=>dt(e,t,...r)}var{IS:a,maybe:ye,$Wrap:vr,xProxy:Er,isNothing:wr}=vt();function vt(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),b();let e=F(),[t,r]=[d(),L()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:w,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?p(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?S(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:v,inputCTOR:A,isNaN:N,isInfinity:I,shouldBeFirstElementIsNothing:R}=x(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(v);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case N:return u?"NaN":e({trial:B=>String(v)})===String(o);case I:return u?"Infinity":e({trial:B=>String(v)})===String(o);case c:return u?String(o):String(v)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return E(o,l,u,g(o,A))}}function g(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function x(o,...l){let c=l.length<1,u=!c&&l[0],v=!c&&w(l[0]),A=o==null,N=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:N,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:v}}function E(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:v=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:v=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function S(o,...l){return l.some(c=>n(o,c))}function w(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function F(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function p(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function b(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,v)=>u===Symbol.proxy?c[u]=v:l(c,u,v),o}function L(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let v of c)v.set&&(v=h(v));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var{IS:ne,maybe:Lr,$Wrap:$r,xProxy:Fr,isNothing:Tr}=Et();function Et(){Symbol.proxy=Symbol.for("toa.proxy"),Symbol.is=Symbol.for("toa.is"),Symbol.type=Symbol.for("toa.type"),Symbol.isSymbol=Symbol.for("toa.isASymbol"),b();let e=F(),[t,r]=[d(),L()];return r.custom(),{IS:n,maybe:e,$Wrap:t,isNothing:w,xProxy:r};function n(o,...l){if(e({trial:u=>"isTypes"in(l?.[0]??{})})){let u=l[0];return"defaultValue"in u?p(o,u):"notTypes"in u?m(o,u):n(o,...[u.isTypes].flat())}let c=typeof o=="symbol"?Symbol.isSymbol:o;return l.length>1?S(c,...l):s(o,...l)}function i(o){return o?.[Symbol.proxy]??n(o)}function s(o,...l){let{noInput:c,noShouldbe:u,compareTo:v,inputCTOR:A,isNaN:N,isInfinity:I,shouldBeFirstElementIsNothing:R}=x(o,...l);switch(l=l.length&&l[0],!0){case R:return String(o)===String(v);case(o?.[Symbol.proxy]&&u):return o[Symbol.proxy];case N:return u?"NaN":e({trial:B=>String(v)})===String(o);case I:return u?"Infinity":e({trial:B=>String(v)})===String(o);case c:return u?String(o):String(v)===String(o);case A===Boolean:return l?A===l:"Boolean";default:return E(o,l,u,g(o,A))}}function g(o,l){return o===0?Number:o===""?String:o?l:{name:String(o)}}function x(o,...l){let c=l.length<1,u=!c&&l[0],v=!c&&w(l[0]),A=o==null,N=!A&&Object.getPrototypeOf(o)?.constructor,I=e({trial:B=>String(o)})==="NaN",R=e({trial:B=>String(o)})==="Infinity";return{noInput:A,noShouldbe:c,compareTo:u,inputCTOR:N,isNaN:I,isInfinity:R,shouldBeFirstElementIsNothing:v}}function E(o,l,c,u){switch(!0){case(!c&&l===o||o?.[Symbol.proxy]&&l===Proxy):return!0;case e({trial:v=>String(l)})==="NaN":return String(o)==="NaN";case(o?.[Symbol.toStringTag]&&n(l,String)):return String(l)===o[Symbol.toStringTag];default:return l?e({trial:v=>o instanceof l})||l===u||l===Object.getPrototypeOf(u)||`${l?.name}`===u?.name:o?.[Symbol.toStringTag]&&`[object ${o?.[Symbol.toStringTag]}]`||u?.name||String(u)}}function S(o,...l){return l.some(c=>n(o,c))}function w(o,l=!1){let c=o==null;return c=l?c||n(o,1/0)||n(o,NaN):c,c}function F(){let o=(l,c)=>l?.constructor===Function?l(c):void 0;return function({trial:l,whenError:c=()=>{}}={}){try{return o(l)}catch(u){return o(c,u)}}}function d(){return function(o){return Object.freeze({get value(){return o},get[Symbol.type](){return i(o)},get type(){return i(o)},[Symbol.is](...l){return n(o,...l)},is(...l){return n(o,...l)}})}}function p(o,{defaultValue:l,isTypes:c=[void 0],notTypes:u}={}){return c=c?.constructor!==Array?[c]:c,u=u&&u?.constructor!==Array?[u]:[],u.length<1?n(o,...c)?o:l:m(o,{isTypes:c,notTypes:u})?o:l}function m(o,{isTypes:l=[void 0],notTypes:c=[void 0]}={}){return l=l?.constructor!==Array?[l]:l,c=c?.constructor!==Array?[c]:c,n(o,...l)&&!n(o,...c)}function b(){Object.getOwnPropertyDescriptors(Object.prototype)[Symbol.is]||(Object.defineProperties(Object.prototype,{[Symbol.type]:{get(){return i(this)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(...o){return n(this,...o)},enumerable:!1,configurable:!1}}),Object.defineProperties(Object,{[Symbol.type]:{value(o){return i(o)},enumerable:!1,configurable:!1},[Symbol.is]:{value:function(o,...l){return n(o,...l)},enumerable:!1,configurable:!1}}))}function f(o){let l=String(Object.getPrototypeOf(o)?.constructor);return l.slice(l.indexOf("ion")+3,l.indexOf("(")).trim()}function h(o){let l=o.set;return o.set=(c,u,v)=>u===Symbol.proxy?c[u]=v:l(c,u,v),o}function L(){let o=Proxy;return{native(){Proxy=o},custom(){Proxy=new o(o,{construct(l,c){for(let v of c)v.set&&(v=h(v));let u=new l(...c);return u[Symbol.proxy]=`Proxy (${f(c[0])})`,u}})}}}}var K=wt;function wt({styleSheet:e,createWithId:t}={}){let{tryParseAtOrNestedRules:r,ruleExists:n,checkParams:i,sheet:s,removeRules:g,consider:x,currentSheetID:E}=Ct({styleSheet:e,createWithId:t});function S(m,b){if(m&&b.removeProperties){Object.keys(b.removeProperties).forEach(f=>m.style.removeProperty(He(f)));return}Object.entries(b).forEach(([f,h])=>{f=He(f.trim()),h=h.trim();let L;if(/!important/.test(h)&&(h=h.slice(0,h.indexOf("!important")).trim(),L="important"),!CSS.supports(f,h))return console.error(`StylingFactory ${E} error: '${f}' with value '${h}' not supported (yet)`);je(()=>m.style.setProperty(f,h,L),`StylingFactory ${E} (setRule4Selector) failed`)})}function w(m,b,f=s){if(m=m?.trim?.(),!ne(m,String)||!m.length||/[;,]$/g.test(m))return console.error(`StylingFactory ${E} (setRules): [${m||"[no selector given]"}] is not a valid selector`);if(b.removeRule)return g(m);let h=n(m,!0),L=h||f.cssRules[f.insertRule(`${m} {}`,f.cssRules.length||0)];return x(()=>S(L,b),m,h)}function F(m){let b=m.trim().split(/{/,2),f=b.shift().trim();if(!ne(f,String)||!f?.trim()?.length)return console.error(`StylingFactory ${E} (doParse): no (valid) selector could be extracted from rule ${be(m)}`);let h=Ht(b.shift());return je(()=>w(f,h),`StylingFactory ${E} (setRules) failed`)}function d(m){let b=r(m);return b.done?b.existing:F(m)}function p(m,b){return m.trim().startsWith("@media")?d(Lt(m,b)):w(m,b)}return function(m,b={}){return i(m,b)&&(Object.keys(b).length?p(m,b):d(m))}}function Ct({styleSheet:e,createWithId:t}){let r="Note: The rule or some of its properties may not be supported by your browser (yet)",n=`for style#${t}`;e=t?i(t):e;function i(d){let p=document.querySelector(`#${d}`)?.sheet;if(p)return p;let m=Object.assign(document.createElement("style"),{id:d});return document.head.insertAdjacentElement("beforeend",m),m.sheet}function s(d){return console.error(`StylingFactory ${n} [rule: ${d}]
4
+ => @charset, @namespace and @import are not supported here`),{done:!0}}function g(d,p){return[...e.rules].find(m=>p?Oe(m.selectorText||"",d):Tt`${Ft(d)}${[..."gim"]}`.test(m.cssText))}function x(d){return/^@charset|@import|namespace/i.test(d.trim())?s(d):d.match(/}/g)?.length>1?{existing:w(d,1),done:!0}:{done:!1}}function E(d){let p=[...e.cssRules].reduce((b,f,h)=>Oe(f.selectorText||"",d)&&b.concat(h)||b,[]),m=p.length;return p.forEach(b=>e.deleteRule(b)),m>0?console.info(`\u2714 Removed ${m} instance${m>1?"s":""} of selector ${d} from ${n.slice(4)}`):console.info(`\u2714 Remove rule: selector ${d} does not exist in ${n.slice(4)}`)}function S(d,p){return d&&ne(d,String)&&d.trim().length>0&&ne(p,Object)||(console.error(`StylingFactory ${n} called with invalid parameters`),!1)}function w(d){d=d.trim();let p=d.slice(0,d.indexOf("{")).trim(),m=!!g(p);try{return e.insertRule(`${d}`,e.cssRules.length),m}catch(b){return console.error(`StylingFactory ${n} (tryParse) ${b.name} Error:
5
+ ${b.message}
6
+ Rule: ${be(d)}
7
+ ${r}`),m}}function F(d,p,m){try{return d(),m}catch(b){return console.error(`StylingFactory ${n} (tryAddOrModify) ${b.name} Error:
8
+ ${b.message}
9
+ Rule: ${be(p)}
10
+ ${r}`),m}}return{sheet:e,removeRules:E,tryParseAtOrNestedRules:x,ruleExists:g,checkParams:S,tryParse:w,consider:F,currentSheetID:n}}function Lt(e,t){return`${e.trim()} ${Object.entries(t).map(([r,n])=>`${r}: { ${$t(n)}`)}`}function be(e){let t=(e||"NO RULE").trim().slice(0,50).replace(/\n/g,"\\n").replace(/\s{2,}/g," ");return e.length>t.length?`${t.trim()}...truncated`:t}function $t(e){return Object.entries(e).map(([t,r])=>`${t}: ${r.trim()}`).join(`;
11
+ `)}function Ft(e){return e.replace(/([*\[\]()-+{}.$?\\])/g,t=>`\\${t}`)}function Tt(e,...t){let r=t.length&&Array.isArray(t.slice(-1))?t.pop().join(""):"";return new RegExp((t.length&&e.raw.reduce((n,i,s)=>n.concat(t[s-1]||"").concat(i),"")||e.raw.join("")).split(`
12
+ `).map(n=>n.replace(/\s|\/\/.*$/g,"").trim().replace(/(@s!)/g," ")).join(""),r)}function He(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/[^--]^-|-$/,"")}function je(e,t){try{return e()}catch(r){console.error(`${t||"an error occured"}: ${r.message}`)}}function At(e){return e.replace(/\/\*.+?\*\//gm,"").replace(/[}{\r\n]/g,"").replace(/(data:.+?);/g,(t,r)=>`${r}\\3b`).split(";").map(t=>t.trim()).join(`;
13
+ `).replaceAll("\\3b",";").split(`
14
+ `)}function Dt(e){return e.reduce((t,r)=>{let[n,i]=[r.slice(0,r.indexOf(":")).trim(),r.slice(r.indexOf(":")+1).trim().replace(/;$|;.+(?=\/*).+\/$/,"")];return n&&i?{...t,[n]:i}:t},{})}function Ht(e){return Dt(At(e))}function Oe(e,t){return e?.replace("::",":")===t?.replace("::",":")}var jt=[...Array(26)].map((e,t)=>String.fromCharCode(t+65)).concat([...Array(26)].map((e,t)=>String.fromCharCode(t+97))).concat([...Array(10)].map((e,t)=>`${t}`)),oe=(e,t=2)=>`${e}`.padStart(t,"0"),Ot=(e,t=0)=>([e,t]=[Math.floor(e),Math.ceil(t)],Math.floor([...crypto.getRandomValues(new Uint32Array(1))].shift()/2**32*(e-t+1)+t)),Mt=e=>{let t=e.length;for(;t--;){let r=Ot(t);[e[t],e[r]]=[e[r],e[t]]}return e};var j=(e,t=120)=>`${e}`.trim().slice(0,t).replace(/>\s+</g,"><").replace(/</g,"&lt;").replace(/\s{2,}/g," ").replace(/\n/g,"\\n")+(e.length>t?" &hellip;":"").trim(),O=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`).replace(/^-|-$/,""),Pt=([e,...t])=>`${e.toUpperCase()}${t.join("")}`,ee=e=>a(e,String)?e.toLowerCase().split("-").map((t,r)=>r&&`${Pt(t)}`||t).join(""):e,q=()=>`_${Mt(jt).slice(0,8).join("")}`,ie=(e,t=120)=>j(e,t).replace(/&lt;/g,"<"),W=()=>(e=>`[${oe(e.getHours())}:${oe(e.getMinutes())}:${oe(e.getSeconds())}.${oe(e.getMilliseconds(),3)}]`)(new Date);var z=e=>e.replace(/</g,"&lt;");function Me(){let e=function(s){if(!s)return;let g=s.style,x=getComputedStyle(s),E=[g.visibility,x.visibility].includes("hidden"),S=[g.display,x.display].includes("none"),w=s.offsetTop<0||s.offsetLeft+s.offsetWidth<0||s.offsetLeft>document.body.offsetWidth,F=+x.opacity==0||+(g.opacity||1)==0;return!(w||F||S||E)},r=function(s){return s.parentNode?!!y.nodes(":is(:read-write)",s?.parentNode)?.find(g=>g===s):!1},n=function(s){return s.parentNode?!!y.nodes(":is(:modal)",s?.parentNode)?.find(g=>g===s):!1},i={notInDOM:!0,writable:"n/a",modal:"n/a",empty:!0,open:"n/a",visible:"n/a"};return s=>{let g=s.node;return g?{get writable(){return r(g)},get modal(){return n(g)},get inDOM(){return g.isConnected},get open(){return g.open??!1},get visible(){return e(g)},get disabled(){return g.hasAttribute("readonly")||g.hasAttribute("disabled")},get empty(){return s.collection.length<1},get virtual(){return s.isVirtual}}:i}}var Nt=!0,le={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},It=e=>{if(Nt&&Object.keys(e.removed).length){let t=Object.entries(e.removed).reduce((r,[n,i])=>[...r,`${z(n)} => ${i}`],[]).join("\\000A");$.log(`JQx HTML creation errors: ${$.isConsole?t:z(t)}`)}},Rt=function(e){let t=e.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(t)&&!r.find(n=>n===t)||M.isAllowed(t)},te=e=>{let t={rawHTML:e?.parentElement?.getHTML()??"no html",removed:{}};return a(e,HTMLElement)&&[...e.childNodes].forEach(r=>{if(r?.children?.length&&te(r),r?.attributes){let i=a(r,SVGElement)?k.svg:k.html;[...(r??{attributes:[]}).attributes].forEach(s=>{let g=s.name.trim().toLowerCase(),x=s.value.trim().toLowerCase().replace(le.whiteSpace,""),E=g==="href"?!le.validURL.test(x):le.notAllowedValues.test(x),S=g.startsWith("data")?!le.data.test(g):!!i[g];if(E||S){let w=ie(s.value||"none",60);w+=w.length===60?"...":"",t.removed[`${s.name}`]=`attribute/property (-value) not allowed, removed. Value: ${w}`,r.removeAttribute(s.name)}})}if(!(Rt(r)||r.constructor===CharacterData||r.constructor===Comment)){let i=(r?.outerHTML||r?.textContent).trim(),s=ie(i,60)??"EMPTY";s+=s.length===60?"...":"",t.removed[`<${r.nodeName?.toLowerCase()}>`]=`not allowed, not rendered. Value: ${s}`,r.remove()}}),It(t),e};var T=new Proxy({start:"afterbegin",afterbegin:"afterbegin",end:"beforeend",beforeend:"beforeend",before:"beforebegin",beforebegin:"beforebegin",after:"afterend",afterend:"afterend"},{get(e,t){return e[String(t).toLowerCase()]??e[t]}}),Bt=e=>{let t=document.createElement("div");return t.insertAdjacentHTML(T.end,e),t.childNodes.length?te(t):void 0},kt=(e,t,r)=>a(e,Comment)?t.insertAdjacentHTML(r,`<!--${e.data}-->`):t.insertAdjacentText(r,e.data),_=(e=[],t=document.body,r=T.BeforeEnd)=>e.reduce((n,i)=>{let s=re(i)&&me(i,t,r);return s?[...n,s]:n},[]),me=(e,t=document.body,r=T.BeforeEnd)=>(t=t?.isJQx?t?.[0]:t,a(e,Comment,Text)?kt(e,t,r):t.insertAdjacentElement(r,e)),H=e=>{if(a(e,Text,Comment))return e;let t=e?.trim(),r=t?.split(/<text>|<\/text>/i)??[];if(r?.length&&(r=r.length>1?r.filter(i=>i.length).shift():void 0),t.startsWith("<!--")&&t.endsWith("-->"))return document.createComment(e.replace(/<!--|-->$/g,""));if(r||!/^<(.+)[^>]+>/m.test(t))return document.createTextNode(r);let n=Bt(e);return n.childNodes.length<1?H(`<span data-jqxcreationerror="1">${j(e,60)}</span>`):n.children[0]};var C=(e,t)=>{let r=e.collection.filter(n=>!ke(n));for(let n=0;n<r.length;n+=1)t(r[n],n);return e},Jt=Me(),Pe=e=>e&&(e.textContent="");var U=e=>{let t=e.cloneNode(!0);return t.removeAttribute&&t.removeAttribute("id"),e.isConnected?e.remove():e=null,t},Re=(e,t)=>{e&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setAttribute(`data-${O(r)}`,n))},Ne=(e,t)=>e.andThen(t,!0),Ie=(e,t)=>e.andThen(t),Be=e=>e.startsWith("data")||k.html.find(t=>e.toLowerCase()===t),Qt=(e,t,r)=>{r&&a(t,String)&&(t={[t]:r==="-"?"":r});let n;t.className&&(n=t.className,delete t.className),n=[...e.classList].find(s=>s.startsWith("JQxClass-")||n&&s===n)||n||`JQxClass-${q().slice(1)}`,y.editCssRule(`.${n}`,t),e.classList.add(n)},Wt=(e,t)=>{e&&Object.entries(t).forEach(([r,n])=>{if(r=O(r),r.startsWith("data"))return Re(e,n);a(n,String)&&Be(r)&&e.setAttribute(r,n.split(/[, ]/)?.join(" "))})},he=(e,t)=>{a(t,Object)&&Object.entries(t).forEach(([r,n])=>{let i;/!important/i.test(n)&&(n=n.slice(0,n.indexOf("!")).trim(),i="important"),e.style.setProperty(O(r),n,i)})},qt={get(e,t){return e[ee(t)]||e[t]},enumerable:!1,configurable:!1},zt=(...e)=>{$.log("\u2757"+e.map(t=>String(t)).join(", "))},xe=(e,t=0,r=!0)=>(e=e?.parentElement,t+=e?e[r?"scrollTop":"scrollLeft"]:0,e?xe(e,t,r):t),Se={factoryExtensions:{data:e=>({get all(){return new Proxy(e[0]?.dataset??{},qt)},set:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),get:(t,r)=>e.data.all[t]??r,add:(t={})=>(!e.is.empty&&a(t,Object)&&Object.entries(t).forEach(([r,n])=>e.setData({[r]:n})),e),remove:t=>(e[0]?.removeAttribute(`data-${O(t)}`),e)}),dimensions:e=>{if(e.is.empty)return{error:"[instance].dimensions: NO ELEMENTS"};let t=e[0],r=e.first()?.getBoundingClientRect().toJSON();return r.scrollTopDistance=xe(t,0),r.scrollLeftDistance=xe(t,0,!1),r},node:e=>e[0],HTML:e=>({get:(t,r)=>{if(e.is.empty)return"NO ELEMENTS IN COLLECTION";let n=t?e.outerHtml:e.html();return r?z(n):n},set:(t,r=!1,n=!1)=>{t=t.isJQx?t.HTML.get(1):t;let i=a(t,String);return t=i&&n?z(t):t,i&&(t||"").trim().length&&e.html(t,r),e},replace:(t,r=!1)=>e.HTML.set(t,!1,r),append:(t,r=!1)=>(t=a(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t,!0,r)),insert:(t,r=!1)=>(t=a(t,HTMLElement)?y(t).HTML.get(1):t.isJQx?t.HTML.get(1):t,e.HTML.set(t+e.HTML.get(),!1,r))}),is:e=>Jt(e),length:e=>e.collection.length,outerHtml:e=>(e.first()||{outerHTML:void 0}).outerHTML,parent:e=>{let t=y(e[0]?.parentNode);return t.is.empty?e:t},render:e=>(!e.is.empty&&e.toDOM()||y.log("[JQx.render]: empty collection"),e),Style:e=>({get computed(){return e.is.empty?{}:getComputedStyle(e[0])},inline:t=>e.style(t),inSheet:t=>e.css(t),valueOf:t=>e.is.empty?void 0:getComputedStyle(e[0])[O(t)],nwRule:t=>e.Style.byRule({rules:t}),byRule:({classes2Apply:t=[],rules:r=[]}={})=>{let i=a(r,String)&&!t.length?r.split("{")[0].trim():"";return r=r&&a(r,String)?[r]:r,t=t&&a(t,String)?[t]:t,(r?.length||t?.length)&&(r?.length&&y.editCssRules(...r),t?.forEach(s=>e.addClass(s))),i?.startsWith(".")&&e.addClass(i.slice(1)),i?.startsWith("#")&&!e.attr("id")&&e.prop({id:i.slice(1)}),e}})},instanceExtensions:{addClass:(e,...t)=>C(e,r=>r&&t.forEach(n=>r.classList.add(n))),after:Ie,afterMe:Ie,andThen:(e,t,r=!1)=>{if(!t||!a(t,String,Node,Proxy))return zt(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${t}]`),e;t=t?.isJQx?t.collection:a(t,Node)?y.virtual(t).collection:y.virtual(H(t)).collection;let[n,i,s]=r?[0,"before",t.concat(e.collection)]:[e.collection.length-1,"after",e.collection.concat(t)];return e[n][i](...t),e.collection=s,e},append:(e,...t)=>{if(!e.is.empty&&t.length){let r=e.length===1;for(let n of t){if(!n.isJQx&&a(n,String)){let i=n.trim(),g=!/^<(.+)[^>]+>$/m.test(i)?y.text(n):H(n);C(e,x=>x.append(r?g:U(g)))}re(n)&&C(e,i=>i.append(r?n:U(n))),n.isJQx&&!n.is.empty&&C(e,i=>n.collection.forEach(s=>i.append(r?s:U(s))))}}return e},appendTo:(e,t)=>(t.isJQx||(t=y(t)),t.append(e),e),attr:(e,t,r)=>{let n=e[0];if(!n)return e;if(!r&&a(t,String))return t=O(t),t==="class"?[...n?.classList].join(" "):n?.getAttribute(t);if(a(t,String)&&r)switch(t=O(t),!0){case t.startsWith("data-"):t={data:{[t.replace("data-","")]:r}};break;default:t={[t]:r}}return a(t,Object)&&!e.is.empty&&Wt(n,t),e},before:Ne,beforeMe:Ne,clear:e=>C(e,Pe),closest:(e,t)=>{let r=a(t,String)?e[0].closest(t):null;return r?y(r):e},computedStyle:(e,t)=>e.first()&&getComputedStyle(e.first())[t],css:(e,t,r)=>C(e,n=>Qt(n,t,r)),duplicate:(e,t=!1,r=document.body)=>{let n=e.toNodeList().map(s=>s.removeAttribute&&s.removeAttribute("id")||s),i=y.virtual(n);return t?i.toDOM(r):i},each:(e,t)=>C(e,t),empty:e=>C(e,Pe),find:(e,t)=>e.collection.length>0?[...e.first()?.querySelectorAll(t)]:[],find$:(e,t)=>e.collection.length>0?y(t,e):e,first:(e,t=!1)=>{if(e.collection.length>0)return t?e.single():e.collection[0]},first$:(e,t)=>e.single(t),getData:(e,t,r)=>e.first()&&e.first().dataset?.[t]||r,hasClass:(e,...t)=>{let r=e[0];return!r||!r.classList.length?!1:t.find(n=>r.classList.contains(n))&&!0||!1},hide:e=>C(e,t=>he(t,{display:"none !important"})),html:(e,t,r)=>{if(t===void 0)return e?.[0]?.getHTML();if(!e.isEmpty()){let n=H(`<div>${t.isJQx?t.HTML.get(!0):t}</div>`);if(!a(n,Comment))return C(e,s=>(r||(s.textContent=""),s.insertAdjacentHTML(y.at.end,n.getHTML())))}return e},htmlFor:(e,t,r="",n=!1)=>{if(t&&e.collection.length){if(!t||!a(r,String))return e;let i=e.find$(t);if(i.length<1)return e;let s=H(`<span>${r}</span>`);i.each(g=>{n||(g.textContent=""),g.insertAdjacentHTML(y.at.end,s?.getHTML())})}return e},isEmpty:e=>e.collection.length<1,nth$:(e,t)=>e.single(t),on:(e,t,...r)=>(e.collection.length&&r?.forEach(n=>{let i=Je(e);y.delegate(t,i,n)}),e),prepend:(e,...t)=>{if(!e.is.empty&&t){let r=e.length===1;for(let n of t){if(a(n,String)){n=n.trim();let s=!/^<(.+)[^>]+>$/m.test(n)?y.text(n):H(n);s=r?s:U(s),C(e,g=>g.prepend(s.cloneNode(!0)))}re(n)&&C(e,i=>i.prepend(r?n:U(n))),n.isJQx&&!n.is.empty&&(n.collection.length>1&&n.collection.reverse(),C(e,i=>C(n,s=>i.prepend(r?s:U(s)))),n.collection.reverse())}}return e},prependTo:(e,t)=>(t.isJQx||(t=y.virtual(t)),t.prepend(e),e),prop:(e,t,r)=>{if(a(t,String)&&!r)return t.startsWith("data")?e[0]?.dataset[t.slice(t.indexOf("-")+1)]:e[0]?.[t];let n=a(t,Object)?t:{[t]:r};return Object.entries(n).forEach(([i,s])=>{if(i=i.trim(),s&&!Be(i)||!s)return!1;if(i.toLowerCase()==="id")return e[0].id=s;C(e,x=>{if(i.startsWith("data"))return x.dataset[i.slice(i.indexOf("-")+1)]=s;x[i]=s})}),e},remove:(e,t)=>{P(`remove ${j(e.HTML.get(1),40)}${t?` /w selector ${t}`:""}`);let r=i=>i.remove(),n=()=>e.collection=e.collection.filter(i=>document.documentElement.contains(i));if(t){let i=e.find$(t);return i.is.empty||(C(i,r),n()),e}return C(e,r),n(),e},rmAttr:(e,...t)=>(t.forEach(r=>e.node.removeAttribute(r)),e),removeClass:(e,...t)=>C(e,r=>r&&t.forEach(n=>r.classList.remove(n))),renderTo:(e,t=document.body,r=y.insertPositions.end)=>(e.toDOM(t,r),e),replace:(e,t,r)=>{let n=e[0];return!t||!r||!a(r,HTMLElement)&&!r.isJQx?(console.error("JQx replace: invalid replacement value"),e):(r.isJQx&&(r=r[0]),a(r,NodeList)&&(r=r[0]),n&&t&&(t=a(t,String)?n.querySelectorAll(t):t.isJQx?t.collection:t,a(t,HTMLElement,NodeList,Array)&&a(r,HTMLElement)&&(a(t,HTMLElement)?[t]:[...t]).forEach(i=>i.replaceWith(r.cloneNode(!0)))),e)},replaceClass:(e,t,...r)=>C(e,n=>{n.classList.remove(t),r.forEach(i=>n.classList.add(i))}),replaceMe:(e,t)=>e.replaceWith(t),replaceWith:(e,t)=>(t=a(t,Element)?t:t.isJQx?t[0]:void 0,t&&(e[0].replaceWith(t),e=y.virtual(t)),e),setData:(e,t)=>C(e,r=>Re(r,t)),show:e=>C(e,t=>he(t,{display:"revert-layer !important"})),single:(e,t)=>e.collection.length>0?a(t,String)?e.find$(t):a(t,Number)?y(e.collection[t]):y(e.collection[0]):e,style:(e,t,r)=>C(e,i=>{r&&a(t,String)&&(t={[t]:r||"none"}),he(i,t)}),text:(e,t,r=!1)=>e.isEmpty()?e:a(t,String)?C(e,i=>i.textContent=r?i.textContent+t:t):e.first().textContent,toDOM:(e,t=document.body,r=T.BeforeEnd)=>(e.isVirtual&&(e.isVirtual=!1),e.collection=_(e.collection,t,r),e),toggleClass:(e,t)=>C(e,r=>r.classList.toggle(t)),toNodeList:e=>[...e.collection].map(t=>document.importNode(t,!0)),trigger:(e,t,r=Event,n={})=>{if(e.collection.length){let i=new r(t,{...n,bubbles:n.bubbles??!0});for(let s of e.collection)s.dispatchEvent(i)}return e},val:(e,t)=>{let r=e[0];return!r||!a(r,HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement)?e:t===void 0?r.value:(r.value=a(t,String)?t:"",e)}}};function Qe(e){if(!e("#jqxPopup").isEmpty())return;e.dialog({id:"jqxPopup"},e.div({id:"jqxPopupContent"})).render,e.editCssRules(...we);let[t,r]=[e("#jqxPopupContent"),e.node("#jqxPopup")],n={};return["click","keydown"].forEach(d=>e.delegateCaptured({type:d,handlers:S,name:"genericPopupCloseHandler",capture:!0})),Object.freeze({show:i,removeModal:E});function i(d){if(r.open)return;n={...d};let{content:p}=n;return e.IS(p,String,HTMLElement)||p?.isJQx?g():!0}function s(){return n.modal?F(n.warnMessage):x()}function g(){t.clear();let{content:d,modal:p,closeAfter:m}=n;p=e.IS(p,Boolean)?p:!1;let b=p?"":e.div({id:"closeHandleIcon"});t.append(b,e.IS(d,String)?e.div(d):d),r.showModal(),!p&&e.IS(m,Number)&&w(s,m)}function x(){r.close(n.returnValue),e.IS(n.callback,Function)&&n.callback(n.returnValue),n={}}function E({callback:d,value:p}={}){n.returnValue=p,n.modal=!1,n.callback=d||n.callback,s()}function S(d){if(Object.keys(n).length<1)return;n.activeTimer&&clearTimeout(n.activeTimer);let p=d.key==="Escape";return p&&d.preventDefault(),(p||d.target.closest("#closeHandleIcon")||d.type!=="keydown"&&!d.target.closest("#jqxPopupContent"))&&s(),document.activeElement.blur()}function w(d,p){e.IS(d,Function)&&e.IS(p,Number)&&p>0&&(n.activeTimer=setTimeout(d,p*1e3))}function F(d){if(!e.IS(d,String,HTMLElement,Proxy))return;let p=t.find$(".warn");switch(!0){case p.is.empty:p=e.div({class:"warn"},d);default:t.append(p.addClass("active")),w(()=>t.find$(".warn").removeClass("active"),2)}}}var V={},_t=["load","unload","scroll","focus","blur","DOMNodeRemovedFromDocument","DOMNodeInsertedIntoDocument","loadstart","progress","error","abort","load","loadend","pointerenter","pointerleave","readystatechange"],We=e=>!!_t.find(t=>t===e),qe=()=>{let e=n=>V[n.type].forEach(i=>i(n)),t=(n,i)=>s=>{let g=s.target?.closest?.(n);return g&&i(s,y(g))},r=(n,i,s,g)=>{if(V[n]||(V[n]=new Map),!(V[n].has(i)||[...V[n].values()].find(E=>E.name&&E.name===g))){addEventListener(n,i,s||We(n));let E={name:g||i.name,capture:s||We(n)};V[n].set(i,E)}};return({eventType:n,selector:i,callback:s,name:g,capture:x=!1}={})=>{if(!(y.IS(n,String)||n?.length<1)||!y.IS(s,Function))return;n=n.toLowerCase(),x=y.IS(x,Boolean)?x:!1;let E=y.IS(i,String)?t(i,s):s;r(n,E,x,g)}};var Ut={},{instanceMethods:ze,instanceGetters:_e,isCommentOrTextNode:ke,isNode:re,isHtmlString:Ve,isArrayOfHtmlElements:Ge,isArrayOfHtmlStrings:Ze,ElemArray2HtmlString:Xe,input2Collection:Ye,setCollectionFromCssSelector:Ke,addHandlerId:Je,cssRuleEdit:ve,addFn:Vt,elems4Docs:dn}=Gt();function Gt(){let e=K({createWithId:"JQxStylesheet"}),t=(f,h)=>r[f]=(L,...o)=>h(L,...o),r=Se.instanceExtensions,n=Se.factoryExtensions,i=f=>a(f,Comment,Text),s=f=>a(f,Text,HTMLElement,Comment),g=f=>a(f,Comment),x=f=>a(f,Text),E=f=>a(f,String)&&/^<|>$/.test(`${f}`.trim()),S=f=>a(f,Array)&&!f?.find(h=>!E(h)),w=f=>a(f,Array)&&!f?.find(h=>!s(h)),F=f=>f?.filter(h=>h).reduce((h,L)=>h.concat(g(L)?`<!--${L.data}-->`:i(L)?L.textContent:L.outerHTML),""),d=f=>f?a(f,Proxy)?[f.EL]:a(f,NodeList)?[...f]:s(f)?[f]:w(f)?f:f.isJQx?f.collection:void 0:[],p=(f,h,L)=>{let o=h!==document.body&&a(f,String)&&f.toLowerCase()!=="body"?h:document,l;try{L.collection=[...o.querySelectorAll(f)]}catch{l=`Invalid CSS querySelector. [${a(f,String)?f:"Nothing valid given!"}]`}return l??`CSS querySelector "${f}", output ${L.collection.length} element(s)`},m=f=>{let h=f.data.get("hid")||`HID${q()}`;return f.data.add({hid:h}),`[data-hid="${h}"]`},b=Object.entries(M.tagsRaw).filter(([,f])=>f).map(([f])=>f).sort((f,h)=>f.localeCompare(h));return{instanceMethods:r,instanceGetters:n,isCommentOrTextNode:i,isNode:s,isComment:g,isText:x,isHtmlString:E,isArrayOfHtmlElements:w,isArrayOfHtmlStrings:S,ElemArray2HtmlString:F,input2Collection:d,setCollectionFromCssSelector:p,addHandlerId:m,cssRuleEdit:e,addFn:t,elems4Docs:b}}function G(e){return new Proxy(e,{get:(t,r)=>Yt(t,r,e)})}function Zt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Xt(e,t){return(...r)=>a(e,Function)&&e(G(t),...r)}function Yt(e,t,r){switch(!0){case a(t,Symbol):return e;case a(+t,Number):return e.collection?.[t]||`ELEMENT WITH INDEX ${t} NOT FOUND`;case t in _e:return Xt(_e[t],r)();case t in ze:return Zt(ze[t],r);default:return e[t]}}function et(e){let t=lr(e);return Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([r,n])=>{Object.defineProperty(e,r,n),Object.defineProperty(Ut,r,n)}),e}function Kt(e){return{allow:t=>{let r=/-/.test(t),n=r&&t;t=r?ee(t):t.toLowerCase(),M.allowTag(t),a(e[t],Function)||Object.defineProperties(e,Ee(t,!0,e,n))},prohibit:t=>{t=t.toLowerCase(),M.prohibitTag(t),a(e[t],Function)&&Object.defineProperties(e,Ee(t,!1,e))}}}function Ue(...e){if(e.length===1){let t=String(e.shift().trim());e=t.startsWith("!")?[t.slice(1,-1)]:t.split(",").map(r=>r.trim())}e.map(t=>t.startsWith("!")?t.slice(1,-1):t).forEach(t=>ve(t,{removeRule:1}))}function er(e){return function(t,r,...n){return a(r,Function)&&(n.push(r),r=void 0),n.forEach(i=>e({eventType:t,selector:r,callback:i}))}}function tr(e){return function({type:t,origin:r,handlers:n,name:i,capture:s}={}){if(!a(n,Function,Array))return;n=a(n,Function)?[n]:n;let g={eventType:t,selector:r,capture:s,name:i};n.forEach(x=>{a(x,Function)&&e({...g,callback:x})})}}function rr(e){return function(t,r,n){r=r?.isJQx?r?.[0]:r,n=n&&Object.values(T).find(s=>n===s)?n:void 0;let i=e(t,document.createElement("br"));return r&&!a(r,HTMLBRElement)&&i.collection.forEach(s=>n?r.insertAdjacentElement(n,s):r.append(s)),i}}function nr(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.entries(n).forEach(([i,s])=>!(i in t)&&Object.defineProperty(t,i,s))}return t}function or(e){console.error(`JQx: "${e}" not allowed, not rendered`)}function ir(e,t,r,n){return e=O(n||e.toLowerCase()),{get(){return(...i)=>t?r.virtual(te(ge[e](...i))):or(e)},enumerable:!1,configurable:!0}}function Ee(e,t,r,n){e=e.toLowerCase();let i=ir(e,t,r,n);return n?{[n]:i,[ee(n)]:i}:{[e]:i,[e.toUpperCase()]:i}}function lr(e){return nr(Object.entries(M.tagsRaw).reduce(sr(e),{}),ar(e))}function sr(e){return function(t,[r,n]){return n&&Object.defineProperties(t,Ee(r,n,e)),t}}function ar(e){let t=(i,s)=>ve(i,s),r=Kt(e),n=qe();return{debugLog:$,log:(...i)=>D("fromStatic",...i),insertPositions:T,get at(){return T},editCssRules:(...i)=>i.forEach(s=>ve(s)),editCssRule:t,get setStyle(){return t},delegate:er(n),delegateCaptured:tr(n),virtual:rr(e),get fn(){return Vt},allowTag:r.allow,prohibitTag:r.prohibit,get lenient(){return M.allowUnknownHtmlTags},get IS(){return a},get Popup(){return e.activePopup||Object.defineProperty(e,"activePopup",{value:Qe(e),enumerable:!1}),e.activePopup},popup:()=>e.Popup,createStyle:i=>K({createWithId:i||`jqx${q()}`}),editStylesheet:i=>K({createWithId:i||`jqx${q()}`}),removeCssRule:Ue,removeCssRules:Ue,text:(i,s=!1)=>s?e.comment(i):document.createTextNode(i),node:(i,s=document)=>s.querySelector(i,s),nodes:(i,s=document)=>[...s.querySelectorAll(i,s)]}}var y=et(cr());function cr(){return function(r,n,i=T.BeforeEnd){if(r?.isJQx)return r;let s=a(n,HTMLBRElement);n=(!s&&n&&n.isJQx?n[0]:n)||document.body,i=i&&Object.values(T).find(p=>i===p)?i:void 0;let g=Ve(r),x=!g&&Ze(r),E=x||g,S={collection:Ye(r)??[],isVirtual:s,isJQx:!0},w=Ge(S.collection),F=`input =&gt; ${x?`"${j(r.join(", "),70)}"`:!E&&w?`element collection [${j(S.collection.map(p=>`${a(p,Comment,Text)?"Comment|Text @":""} ${p?.outerHTML||p?.textContent}`).join(", "),70)}]`:`"${j(r,70)}"`}`;if(S.collection.length&&w)return P(F),s||S.collection.forEach(p=>{n.contains(p)||_([p],n,i)}),G(S);if(E){if([r].flat().forEach(p=>S.collection.push(H(p))),S.collection.length>0){let p=S.collection.filter(m=>m?.dataset?.jqxcreationerror);S.collection=S.collection.filter(m=>!m?.dataset?.jqxcreationerror),P(`${F}`),P(`*Created ${S.isVirtual?"VIRTUAL ":""}[${j(Xe(S.collection)||"sanitized: no elements remaining",70)}]`),p.length&&console.error(`JQx: illegal html, not rendered: "${p.reduce((m,b)=>m.concat(`${b.textContent}
15
+ `),"").trim()}"`),S.isVirtual||_(S.collection,n,i)}return G(S)}let d=Ke(r,n,S);return P(`input => ${d}`),G(S)}}export{y as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jqx-es",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "The good parts of JQuery",
@@ -1,5 +1,5 @@
1
1
  import jqx from "../index.js";
2
- let handlers = {};
2
+ const handlers = {};
3
3
  const shouldCaptureEventTypes = [
4
4
  `load`, `unload`, `scroll`, `focus`, `blur`, `DOMNodeRemovedFromDocument`,
5
5
  `DOMNodeInsertedIntoDocument`, `loadstart`, `progress`, `error`, `abort`,
@@ -15,17 +15,23 @@ export default () => {
15
15
  };
16
16
  };
17
17
 
18
- const addListenerIfNotExisting = (eventType, capture) => {
19
- if (!handlers[eventType]) {
20
- addEventListener(eventType, metaHandler, getCapture(eventType));
18
+ const addAndStoreListener = (eventType, handler, capture, name) => {
19
+ if (!handlers[eventType]) { handlers[eventType] = new Map(); }
20
+ const delegateExists = handlers[eventType].has(handler) ||
21
+ [...handlers[eventType].values()].find(h => h.name && h.name === name);
22
+
23
+ if (!delegateExists) {
24
+ addEventListener(eventType, handler, capture || getCapture(eventType));
25
+ const handlerValue = { name: name || handler.name, capture: capture || getCapture(eventType) };
26
+ handlers[eventType].set(handler, handlerValue);
21
27
  }
22
28
  };
23
29
 
24
- return (eventType, HIDselector, callback, capture = false) => { /*NODOC*/
25
- addListenerIfNotExisting(eventType, capture);
26
- const fn = !HIDselector ? callback : createHandlerForHID(HIDselector, callback);
27
- handlers = handlers[eventType]
28
- ? {...handlers, [eventType]: handlers[eventType].concat(fn)}
29
- : {...handlers, [eventType]: [fn]};
30
+ return ( {eventType, selector, callback, name, capture = false} = {} ) => { /*NODOC*/
31
+ if (!(jqx.IS(eventType, String) || eventType?.length < 1) || !jqx.IS(callback, Function)) { return; }
32
+ eventType = eventType.toLowerCase();
33
+ capture = jqx.IS(capture, Boolean) ? capture : false;
34
+ const fn = !jqx.IS(selector, String) ? callback : createHandlerForHID(selector, callback);
35
+ addAndStoreListener(eventType, fn, capture, name);
30
36
  };
31
37
  };
@@ -131,13 +131,25 @@ function cssRemove(...rules) {
131
131
  }
132
132
 
133
133
  function delegateFactory(handle) {
134
- return function(type, origin, ...handlers) {
134
+ return function(type, origin, ...eventHandlers) {
135
135
  if (IS(origin, Function)) {
136
- handlers.push(origin);
136
+ eventHandlers.push(origin);
137
137
  origin = undefined;
138
138
  }
139
139
 
140
- return handlers.forEach(handler => handle(type, origin, handler));
140
+ return eventHandlers.forEach(handler => handle({eventType: type, selector: origin, callback: handler}));
141
+ }
142
+ }
143
+
144
+ function delegateCaptureFactory(handle) {
145
+ return function({type, origin, handlers, name, capture} = {}) {
146
+ if (!IS(handlers, Function, Array)) { return; }
147
+ handlers = IS(handlers, Function) ? [handlers] : handlers;
148
+ const params = {eventType: type, selector: origin, capture, name};
149
+
150
+ handlers.forEach(handler => {
151
+ if (IS(handler, Function)) { handle({...params, callback: handler}) }
152
+ });
141
153
  }
142
154
  }
143
155
 
@@ -211,6 +223,7 @@ function staticTagsLambda(jqx) {
211
223
  function staticMethodsFactory(jqx) {
212
224
  const editCssRule = (ruleOrSelector, ruleObject) => cssRuleEdit(ruleOrSelector, ruleObject);
213
225
  const allowProhibit = allowances(jqx);
226
+ const handle = HandleFactory();
214
227
  return {
215
228
  debugLog,
216
229
  log: (...args) => Log(`fromStatic`, ...args),
@@ -219,7 +232,8 @@ function staticMethodsFactory(jqx) {
219
232
  editCssRules: (...rules) => rules.forEach(rule => cssRuleEdit(rule)),
220
233
  editCssRule,
221
234
  get setStyle() { /*deprecated*/return editCssRule; },
222
- delegate: delegateFactory(HandleFactory()),
235
+ delegate: delegateFactory(handle),
236
+ delegateCaptured: delegateCaptureFactory(handle),
223
237
  virtual: virtualFactory(jqx),
224
238
  get fn() { return addFn; },
225
239
  allowTag: allowProhibit.allow,
package/src/JQxMethods.js CHANGED
@@ -18,7 +18,7 @@ const loop = (instance, callback) => {
18
18
  for (let i = 0; i < cleanCollection.length; i += 1) {
19
19
  callback(cleanCollection[i], i);
20
20
  }
21
-
21
+
22
22
  return instance;
23
23
  };
24
24
  const isIt = ExamineElementFeatureFactory();
@@ -64,7 +64,7 @@ const assignAttrValues = (/*NODOC*/el, keyValuePairs) => {
64
64
  if (key.startsWith(`data`)) {
65
65
  return setData(el, value);
66
66
  }
67
-
67
+
68
68
  if (IS(value, String) && checkProp(key)) {
69
69
  el.setAttribute(key, value.split(/[, ]/)?.join(` `));
70
70
  }
@@ -164,7 +164,7 @@ export default {
164
164
  !instance.is.empty && instance.toDOM() || (jqx.log(`[JQx.render]: empty collection`), undefined);
165
165
  return instance;
166
166
  },
167
-
167
+
168
168
  Style: instance => ({
169
169
  get computed() { return !instance.is.empty ? getComputedStyle(instance[0]) : {}; },
170
170
  inline: styleObj => instance.style(styleObj),
@@ -178,20 +178,20 @@ export default {
178
178
  const addClassNameOrID = isSingleRule && !classes2Apply.length ? rules.split(`{`)[0].trim() : ``;
179
179
  rules = rules && IS(rules, String) ? [rules] : rules;
180
180
  classes2Apply = classes2Apply && IS(classes2Apply, String) ? [classes2Apply] : classes2Apply;
181
-
181
+
182
182
  if (rules?.length || classes2Apply?.length) {
183
183
  rules?.length && jqx.editCssRules(...rules);
184
184
  classes2Apply?.forEach(selector => instance.addClass(selector));
185
185
  }
186
-
186
+
187
187
  if (addClassNameOrID?.startsWith(`.`)) {
188
188
  instance.addClass(addClassNameOrID.slice(1));
189
189
  }
190
-
190
+
191
191
  if (addClassNameOrID?.startsWith(`#`) && !instance.attr(`id`)) {
192
192
  instance.prop({id: addClassNameOrID.slice(1)});
193
193
  }
194
-
194
+
195
195
  return instance;
196
196
  },
197
197
  }),
@@ -205,16 +205,16 @@ export default {
205
205
  logDebug(`[JQx instance].[beforeMe | afterMe | andThen]: insufficient input [${elem2Add}]`, );
206
206
  return instance;
207
207
  }
208
-
208
+
209
209
  elem2Add = elem2Add?.isJQx
210
210
  ? elem2Add.collection
211
211
  : IS(elem2Add, Node) ? jqx.virtual(elem2Add).collection
212
212
  : jqx.virtual(createElementFromHtmlString(elem2Add)).collection;
213
-
213
+
214
214
  const [index, method, reCollected] = before
215
215
  ? [0, `before`, elem2Add.concat(instance.collection)]
216
216
  : [instance.collection.length - 1, `after`, instance.collection.concat(elem2Add)];
217
-
217
+
218
218
  instance[index][method](...elem2Add);
219
219
  instance.collection = reCollected;
220
220
  return instance;
@@ -222,7 +222,7 @@ export default {
222
222
  append: (instance, ...elems2Append) => {
223
223
  if (!instance.is.empty && elems2Append.length) {
224
224
  const shouldMove = instance.length === 1;
225
-
225
+
226
226
  for (let elem2Append of elems2Append) {
227
227
  if (!elem2Append.isJQx && IS(elem2Append, String)) {
228
228
  const elem2Append4Test = elem2Append.trim();
@@ -230,11 +230,11 @@ export default {
230
230
  let toAppend = isPlainString ? jqx.text(elem2Append) : createElementFromHtmlString(elem2Append);
231
231
  loop(instance, el => el.append(shouldMove ? toAppend : cloneAndDestroy(toAppend)));
232
232
  }
233
-
233
+
234
234
  if (isNode(elem2Append)) {
235
235
  loop(instance, el => el.append(shouldMove ? elem2Append : cloneAndDestroy(elem2Append)));
236
236
  }
237
-
237
+
238
238
  if (elem2Append.isJQx && !elem2Append.is.empty) {
239
239
  loop(instance, el =>
240
240
  elem2Append.collection.forEach(elem =>
@@ -254,22 +254,22 @@ export default {
254
254
  },
255
255
  attr: (instance, keyOrObj, value) => {
256
256
  const firstElem = instance[0];
257
-
257
+
258
258
  if (!firstElem) { return instance }
259
-
259
+
260
260
  if (!value && IS(keyOrObj, String)) {
261
261
  keyOrObj = toDashedNotation(keyOrObj);
262
-
262
+
263
263
  if (keyOrObj === `class`) {
264
264
  return [...firstElem?.classList]?.join(` `);
265
265
  }
266
-
266
+
267
267
  return firstElem?.getAttribute(keyOrObj);
268
268
  }
269
-
269
+
270
270
  if (IS(keyOrObj, String) && value) {
271
271
  keyOrObj = toDashedNotation(keyOrObj);
272
-
272
+
273
273
  switch(true) {
274
274
  case keyOrObj.startsWith(`data-`):
275
275
  keyOrObj = { data: {[keyOrObj.replace(`data-`, ``)]: value } };
@@ -277,11 +277,11 @@ export default {
277
277
  default: keyOrObj = { [keyOrObj]: value };
278
278
  }
279
279
  }
280
-
280
+
281
281
  if (IS(keyOrObj, Object) && !instance.is.empty) {
282
282
  assignAttrValues(firstElem, keyOrObj);
283
283
  }
284
-
284
+
285
285
  return instance;
286
286
  },
287
287
  before,
@@ -322,41 +322,41 @@ export default {
322
322
  hide: instance => loop(instance, el => applyStyle(el, {display: `none !important`})),
323
323
  html: (instance, htmlValue, append) => {
324
324
  if (htmlValue === undefined) {
325
- return instance[0]?.getHTML();
325
+ return instance?.[0]?.getHTML();
326
326
  }
327
-
327
+
328
328
  if (!instance.isEmpty()) {
329
329
  const nwElement = createElementFromHtmlString(`<div>${htmlValue.isJQx ? htmlValue.HTML.get(true) : htmlValue}</div>`);
330
-
330
+
331
331
  if (!IS(nwElement, Comment)) {
332
332
  const cb = el => {
333
333
  if (!append) { el.textContent = ``; }
334
-
334
+
335
335
  return el.insertAdjacentHTML(jqx.at.end, nwElement.getHTML());
336
336
  }
337
337
  return loop(instance, cb);
338
338
  }
339
339
  }
340
-
340
+
341
341
  return instance;
342
342
  },
343
343
  htmlFor: (instance, forQuery, htmlString = "", append = false) => {
344
344
  if (forQuery && instance.collection.length) {
345
345
  if (!forQuery || !IS(htmlString, String)) { return instance; }
346
-
346
+
347
347
  const el2Change = instance.find$(forQuery);
348
-
348
+
349
349
  if (el2Change.length < 1) { return instance; }
350
-
350
+
351
351
  const nwElement = createElementFromHtmlString(`<span>${htmlString}</span>`);
352
-
352
+
353
353
  el2Change.each(el => {
354
354
  if (!append) { el.textContent = ``; }
355
- el.insertAdjacentHTML(jqx.at.end, nwElement.getHTML());
355
+ el.insertAdjacentHTML(jqx.at.end, nwElement?.getHTML());
356
356
  });
357
-
357
+
358
358
  }
359
-
359
+
360
360
  return instance;
361
361
  },
362
362
  isEmpty: instance => instance.collection.length < 1,
@@ -368,13 +368,13 @@ export default {
368
368
  jqx.delegate(type, cssSelector4Handler, cb);
369
369
  });
370
370
  }
371
-
371
+
372
372
  return instance;
373
373
  },
374
374
  prepend: (instance, ...elems2Prepend) => {
375
375
  if (!instance.is.empty && elems2Prepend) {
376
376
  const shouldMove = instance.length === 1;
377
-
377
+
378
378
  for (let elem2Prepend of elems2Prepend) {
379
379
  if (IS(elem2Prepend, String)) {
380
380
  elem2Prepend = elem2Prepend.trim();
@@ -383,11 +383,11 @@ export default {
383
383
  toPrepend = shouldMove ? toPrepend : cloneAndDestroy(toPrepend);
384
384
  loop(instance, el => el.prepend(toPrepend.cloneNode(true)));
385
385
  }
386
-
386
+
387
387
  if (isNode(elem2Prepend)) {
388
388
  loop(instance, el => el.prepend(shouldMove ? elem2Prepend : cloneAndDestroy(elem2Prepend)));
389
389
  }
390
-
390
+
391
391
  if (elem2Prepend.isJQx && !elem2Prepend.is.empty) {
392
392
  elem2Prepend.collection.length > 1 && elem2Prepend.collection.reverse();
393
393
  loop(instance, el => loop( elem2Prepend, elem => el.prepend(shouldMove ? elem : cloneAndDestroy(elem)) ) );
@@ -395,14 +395,14 @@ export default {
395
395
  }
396
396
  }
397
397
  }
398
-
398
+
399
399
  return instance;
400
400
  },
401
401
  prependTo: (instance, prependTo) => {
402
402
  if (!prependTo.isJQx) {
403
403
  prependTo = jqx.virtual(prependTo);
404
404
  }
405
-
405
+
406
406
  prependTo.prepend(instance);
407
407
  return instance;
408
408
  },
@@ -412,28 +412,28 @@ export default {
412
412
  ? instance[0]?.dataset[nameOrProperties.slice(nameOrProperties.indexOf(`-`)+1)]
413
413
  : instance[0]?.[nameOrProperties];
414
414
  }
415
-
415
+
416
416
  const props = !IS(nameOrProperties, Object) ? { [nameOrProperties]: value } : nameOrProperties;
417
417
  Object.entries(props).forEach( ([propName, propValue]) => {
418
418
  propName = propName.trim();
419
-
419
+
420
420
  if (propValue && !checkProp(propName) || !propValue) {
421
421
  return false;
422
422
  }
423
-
423
+
424
424
  const isId = propName.toLowerCase() === `id`;
425
-
425
+
426
426
  if (isId) { return instance[0].id = propValue; }
427
-
427
+
428
428
  loop(instance, el => {
429
429
  if (propName.startsWith(`data`)) {
430
430
  return el.dataset[propName.slice(propName.indexOf(`-`)+1)] = propValue;
431
431
  }
432
-
432
+
433
433
  el[propName] = propValue;
434
434
  });
435
435
  });
436
-
436
+
437
437
  return instance;
438
438
  },
439
439
  remove: (instance, selector) => {
@@ -441,7 +441,7 @@ export default {
441
441
  const remover = el => el.remove();
442
442
  const removeFromCollection = () =>
443
443
  instance.collection = instance.collection.filter(el => document.documentElement.contains(el));
444
-
444
+
445
445
  if (selector) {
446
446
  const selectedElements = instance.find$(selector);
447
447
  if (!selectedElements.is.empty) {
@@ -466,33 +466,33 @@ export default {
466
466
  },
467
467
  replace: (instance, oldChild, newChild) => {
468
468
  const firstElem = instance[0];
469
-
469
+
470
470
  if (!oldChild || (!newChild || !IS(newChild, HTMLElement) && !newChild.isJQx)) {
471
471
  console.error(`JQx replace: invalid replacement value`);
472
472
  return instance;
473
473
  }
474
-
474
+
475
475
  if (newChild.isJQx) {
476
476
  newChild = newChild[0];
477
477
  }
478
-
478
+
479
479
  if (IS(newChild, NodeList)) {
480
480
  newChild = newChild[0];
481
481
  }
482
-
482
+
483
483
  if (firstElem && oldChild) {
484
484
  oldChild = IS(oldChild, String)
485
485
  ? firstElem.querySelectorAll(oldChild)
486
486
  : oldChild.isJQx
487
487
  ? oldChild.collection
488
488
  : oldChild;
489
-
489
+
490
490
  if (IS(oldChild, HTMLElement, NodeList, Array) && IS(newChild, HTMLElement)) {
491
491
  (IS(oldChild, HTMLElement) ? [oldChild] : [...oldChild])
492
492
  .forEach(chld => chld.replaceWith(newChild.cloneNode(true)));
493
493
  }
494
494
  }
495
-
495
+
496
496
  return instance;
497
497
  },
498
498
  replaceClass: (instance, className, ...nwClassNames) => loop( instance, el => {
@@ -502,12 +502,12 @@ export default {
502
502
  replaceMe: (instance, newChild) => /*NODOC*/ instance.replaceWith(newChild),
503
503
  replaceWith: (instance, newChild) => {
504
504
  newChild = IS(newChild, Element) ? newChild : newChild.isJQx ? newChild[0] : undefined;
505
-
505
+
506
506
  if (newChild) {
507
507
  instance[0].replaceWith(newChild);
508
508
  instance = jqx.virtual(newChild);
509
509
  }
510
-
510
+
511
511
  return instance;
512
512
  },
513
513
  setData: (instance, keyValuePairs) => loop(instance, el => setData(el, keyValuePairs)),
@@ -517,14 +517,14 @@ export default {
517
517
  if (IS(indexOrSelector, String)) {
518
518
  return instance.find$(indexOrSelector);
519
519
  }
520
-
520
+
521
521
  if (IS(indexOrSelector, Number)) {
522
522
  return jqx(instance.collection[indexOrSelector]);
523
523
  }
524
-
524
+
525
525
  return jqx(instance.collection[0]);
526
526
  }
527
-
527
+
528
528
  return instance;
529
529
  },
530
530
  style: (instance, keyOrKvPairs, value) => {
@@ -532,7 +532,7 @@ export default {
532
532
  if (value && IS(keyOrKvPairs, String)) {
533
533
  keyOrKvPairs = { [keyOrKvPairs]: value || `none` };
534
534
  }
535
-
535
+
536
536
  applyStyle(el, keyOrKvPairs);
537
537
  };
538
538
  return loop(instance, loopCollectionLambda);
@@ -546,7 +546,7 @@ export default {
546
546
  toDOM: (instance, root = document.body, position = insertPositions.BeforeEnd) => {
547
547
  if (instance.isVirtual) { instance.isVirtual = false; }
548
548
  instance.collection = inject2DOMTree(instance.collection, root, position);
549
-
549
+
550
550
  return instance;
551
551
  },
552
552
  toggleClass: (instance, className) => loop(instance, el => el.classList.toggle(className)),
@@ -560,17 +560,17 @@ export default {
560
560
  },
561
561
  val: (instance, newValue) => {
562
562
  const firstElem = instance[0];
563
-
563
+
564
564
  if (!firstElem || !IS(firstElem, HTMLInputElement, HTMLSelectElement, HTMLTextAreaElement)) {
565
565
  return instance;
566
566
  }
567
-
567
+
568
568
  if (newValue === undefined) {
569
569
  return firstElem.value;
570
570
  }
571
-
571
+
572
572
  firstElem.value = !IS(newValue, String) ? "" : newValue;
573
-
573
+
574
574
  return instance;
575
575
  },
576
576
  },
package/src/Popup.js CHANGED
@@ -7,8 +7,11 @@ export default function($) {
7
7
  $.editCssRules(...styleRules);
8
8
  const [popupContent, popupNode] = [$(`#jqxPopupContent`), $.node(`#jqxPopup`)];
9
9
  let currentProps = {};
10
- [`click`, `keydown`].forEach(evtType =>
11
- document.addEventListener(evtType, genericPopupCloseHandler, true));
10
+ [`click`, `keydown`].forEach( evtType => $.delegateCaptured({
11
+ type: evtType,
12
+ handlers: genericPopupCloseHandler,
13
+ name: "genericPopupCloseHandler",
14
+ capture: true }) );
12
15
  return Object.freeze({show: initPopup, removeModal});
13
16
 
14
17
  function initPopup(props) {
@@ -34,7 +37,8 @@ export default function($) {
34
37
 
35
38
  function hidePopup() {
36
39
  popupNode.close(currentProps.returnValue);
37
- return $.IS(currentProps.callback, Function) ? currentProps.callback(currentProps.returnValue) : true;
40
+ if ($.IS(currentProps.callback, Function)) { currentProps.callback(currentProps.returnValue); }
41
+ currentProps = {};
38
42
  }
39
43
 
40
44
  function removeModal({callback, value} = {}) {
@@ -45,6 +49,7 @@ export default function($) {
45
49
  }
46
50
 
47
51
  function genericPopupCloseHandler(evt) {
52
+ if ( Object.keys(currentProps).length < 1 ) { return; }
48
53
  currentProps.activeTimer && clearTimeout(currentProps.activeTimer);
49
54
  const escPressed = evt.key === `Escape`;
50
55
  escPressed && evt.preventDefault();