jsf.js_next_gen
Version:
A next generation typescript reimplementation of jsf.js
2 lines • 94.8 kB
JavaScript
/*! For license information please see jsf.js.LICENSE.txt */
(()=>{"use strict";var e={563(e,t,n){n.d(t,{J:()=>en,$:()=>tn});const r=3e4;function s(e,t){for(let n=0,s=t.length;n<s;n+=r)Array.prototype.push.apply(e,Array.prototype.slice.call(t,n,n+r));return e}class i extends Array{constructor(e=[]){super(),(e=Array.isArray(e)?e:[e])._another?this._another=e._another:this._another=e,s(this,e),this.flatMap=e=>this._flatMap(e),this.flat=(e=1)=>this._flat(e)}map(e,t){return l(Array.prototype.map.call(this._another,e,t))}concat(...e){return l(Array.prototype.concat.apply(this._another,e))}reverse(){return l(Array.prototype.reverse.call(this._another))}slice(e,t){return l(Array.prototype.slice.call(this._another,e,t))}splice(e,t){return l(Array.prototype.splice.call(this._another,e,null!=t?t:0))}filter(e,t){return l(Array.prototype.filter.call(this._another,e,t))}reduce(e,t){return Array.prototype.reduce.call(this._another,e,t)}_flat(e=1){return this._flatResolve(this._another,e)}_flatResolve(e,t=1){if(0==t)return e;let n=[];return e.forEach((e=>{e=Array.isArray(e)?e:[e];let r=this._flatResolve(e,t-1);n=n.concat(r)})),u(n)}_flatMap(e){let t=this.map((t=>e(t)));return this._flatResolve(t)}}function l(e){let t=new i(e);return new Proxy(t,{get:(e,t,n)=>"symbol"==typeof t?e._another[t]:isNaN(parseInt(t))?e[t]:e._another[t],set:(e,t,n)=>(e[t]=n,e._another[t]=n,!0)})}var o,a=Array.prototype.flatMap?function(...e){return(null==e?void 0:e.flatMap)?e:l(e)}:function(...e){return l(e)};function u(e){const t=s([],e);return Array.prototype.flatMap?t:l(t)}class c{constructor(e){this._value=e}get value(){return this._value}map(e){e||(e=e=>e);let t=e(this.value);return new c(t)}flatMap(e){let t=this.map(e);for(;(null==t?void 0:t.value)instanceof c;)t=t.value;return t}}class h extends c{constructor(e){super(e)}get value(){return this._value instanceof c?this._value.flatMap().value:this._value}static fromNullable(e){return new h(e)}isAbsent(){return void 0===this.value||null==this.value}isPresent(e){let t=this.isAbsent();return!t&&e&&e.call(this,this),!t}ifPresentLazy(e=()=>{}){return this.isPresent.call(this,e),this}orElse(e){return this.isPresent()?this:null==e?h.absent:this.flatMap((()=>e))}orElseLazy(e){return this.isPresent()?this:this.flatMap(e)}flatMap(e){let t=super.flatMap(e);return t instanceof h?t.flatMap():h.fromNullable(t.value)}getIf(...e){e=this.preprocessKeys(...e);let t=this;for(let n=0;n<e.length;n++){let r=this.keyVal(e[n]),s=this.arrayIndex(e[n]);if(""===r&&s>=0){if(t=this.getClass().fromNullable(t.value instanceof Array?t.value.length<s?null:t.value[s]:null),t.isAbsent())return t}else if(r&&s>=0){if(t.getIfPresent(r).isAbsent())return t;if(t=t.getIfPresent(r).value instanceof Array?this.getClass().fromNullable(t.getIfPresent(r).value[s]):this.getClass().absent,t.isAbsent())return t}else{if(t=t.getIfPresent(r),t.isAbsent())return t;s>-1&&(t=this.getClass().fromNullable(t.value[s]))}}return t}match(e){return!this.isAbsent()&&e(this.value)}get(e=h.absent){return this.isAbsent()?this.getClass().fromNullable(e).flatMap():this.getClass().fromNullable(this.value).flatMap()}toJson(){return JSON.stringify(this.value)}getClass(){return h}arrayIndex(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}keyVal(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}getIfPresent(e){return this.isAbsent()?this.getClass().absent:this.getClass().fromNullable(this.value[e]).flatMap()}resolve(e){if(this.isAbsent())return h.absent;try{return h.fromNullable(e(this.value))}catch(e){return h.absent}}preprocessKeys(...e){return new a(...e).flatMap((e=>new a(...e.split(/]\s*\[/gi)).map((e=>(-1==(e=e.replace(/^\s+|\s+$/g,"")).indexOf("[")&&-1!=e.indexOf("]")&&(e="["+e),-1==e.indexOf("]")&&-1!=e.indexOf("[")&&(e+="]"),e)))))}}h.absent=h.fromNullable(null);class d extends h{constructor(e,t="value"){super(e),this.key=t}get value(){return this._value?this._value[this.key]:null}set value(e){this._value&&(this._value[this.key]=e)}orElse(e){let t={};return t[this.key]=e,this.isPresent()?this:new d(t,this.key)}orElseLazy(e){if(this.isPresent())return this;{let t={};return t[this.key]=e(),new d(t,this.key)}}getClass(){return d}static fromNullable(e,t="value"){return new d(e,t)}}d.absent=d.fromNullable(null),function(e){function t(e){let t=/\s/,n=(e=e.replace(/^\s\s*/,"")).length;for(;t.test(e.charAt(--n)););return e.slice(0,n+1)}function n(e){return!!arguments.length&&null!=e&&("string"==typeof e||e instanceof String)}e.saveResolve=function(e,t=null){try{let n=e();return h.fromNullable(null!=n?n:t)}catch(e){return h.absent}},e.saveResolveLazy=function(e,t=null){try{let n=e();return h.fromNullable(null!=n?n:t())}catch(e){return h.absent}},e.strToArray=function(e,n=/\./gi){let r=[];return e.split(n).forEach((e=>{r.push(t(e))})),r},e.trim=t,e.objToArray=function(e,t=0,n=[]){return"__undefined__"==(null!=e?e:"__undefined__")?null!=n?n:null:e instanceof Array&&!t&&!n?e:u(n.concat(Array.prototype.slice.call(e,t)))},e.equalsIgnoreCase=function(e,t){let n=null!=t?t:"___no_value__";return(null!=e?e:"___no_value__").toLowerCase()===n.toLowerCase()},e.assertType=function(e,t){return n(t)?typeof e==t:e instanceof t},e.isString=n,e.isFunc=function(e){return e instanceof Function||"function"==typeof e},e.objAssign=function(e,...t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");let n=Object(e);return Object.assign?(t.forEach((e=>Object.assign(n,e))),n):(t.filter((e=>null!=e)).forEach((e=>{let t=e;[...Object.keys(t),...Object.getOwnPropertySymbols(t).filter((e=>Object.prototype.propertyIsEnumerable.call(t,e)))].forEach((e=>n[e]=t[e]))})),n)}}(o||(o={}));class v{constructor(e){this.parent=e}set value(e){}get value(){return this.parent}}function f(e,...t){if(t.length<1)return new v(e);const n=w(e,...t);return new class{set value(e){n.target[n.key]=e}get value(){return n.target[n.key]}}}function p(e,...t){if(t.length<1)return new v(e);const n=w(e,...t);return new class{set value(e){Array.isArray(e)||(e=[e]),n.target[n.key]?(Array.isArray(n.target[n.key])||(n.target[n.key]=[n.target[n.key]]),s(n.target[n.key],e)):n.target[n.key]=e}}}function m(e){let t=e.indexOf("[");return t>=0?e.substring(0,t):e}function g(e){let t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1}function y(e,t,n={}){let r=[];r.length=t,r[t-1]=n,s(e,r)}function E(e){return new a(...e).flatMap((e=>e.split("["))).map((e=>-1!=e.indexOf("]")?"["+e:e)).filter((e=>""!=e))}function w(e,...t){t=E(t);let n=e,r=null,s=null,i=-1;for(let e=0;e<t.length;e++)if(s=m(t[e]),i=g(t[e]),-1!=i){if(!Array.isArray(n))throw Error("Associative array referenced as index array in path reference");let s=-1;e<t.length-1&&(s=g(t[e+1]));let l=void 0!==(null==n?void 0:n[i]);y(n,i+1,-1!=s?[]:{}),r=i,e==t.length-1?n[i]=l?n[i]:null:n=n[i]}else{if(Array.isArray(n))throw Error("Index array referenced as associative array in path reference");let i=-1;e<t.length-1&&(i=g(t[e+1])),r=s;let l=void 0!==(null==n?void 0:n[s]);e==t.length-1?l||(n[s]=null):(l||(n[s]=-1==i?{}:[]),n=n[s])}return{target:n,key:r}}function b(...e){return A(!0,!1,...e)}function A(e=!0,t=!1,...n){let r={};return new a(...n).map((e=>({arr:e,keys:Object.keys(e)}))).forEach((({arr:n,keys:i})=>{i.forEach((i=>{let l=n[i];!Array.isArray(l)&&t&&(l=new a(...[l])),e||!(null==r?void 0:r[i])?function(e,t,n,r,i){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=i;else if(Array.isArray(t[n])){let e=t[n],r=[];i.forEach((t=>{-1==e.indexOf(t)&&r.push(t)})),s(t[n],r)}else{let e=t[n],r=[];i.forEach((t=>{e!=t&&r.push(t)})),t[n]=new a(...[]),t[n].push(e),s(t[n],r)}else t[n]=r[n]}(t,r,i,n,l):!e&&(null==r?void 0:r[i])&&function(e,t,n,r,i){if(e)if(void 0===(null==t?void 0:t[n]))t[n]=i;else if(Array.isArray(t[n]))s(t[n],i);else{let e=t[n];t[n]=new a(...[]),t[n].push(e),s(t[n],i)}}(t,r,i,0,l)}))})),r}const S=o.objAssign;class x extends d{constructor(e,t,n){super(e,t),this.arrPos=null!=n?n:-1}get value(){return""==this.key&&this.arrPos>=0?this._value[this.arrPos]:this.key&&this.arrPos>=0?this._value[this.key][this.arrPos]:this._value[this.key]}set value(e){""==this.key&&this.arrPos>=0?this._value[this.arrPos]=e:this.key&&this.arrPos>=0?this._value[this.key][this.arrPos]=e:this._value[this.key]=e}}x.absent=x.fromNullable(null);class _ extends h{constructor(e,t){super(e),this.configDef=t}get shallowCopy(){return this.shallowCopy$()}shallowCopy$(){let e=new _({});return e.shallowMerge(this.value),e}get deepCopy(){return this.deepCopy$()}deepCopy$(){return new _(S({},this.value))}static fromNullable(e){return new _(e)}shallowMerge(e,t=!0,n=!1){let r=A(t,n,this.value,e.value);Array.isArray(this._value)?(this._value.length=0,s(this._value,r)):(Object.getOwnPropertyNames(this._value).forEach((e=>delete this._value[e])),Object.getOwnPropertyNames(r).forEach((e=>this._value[e]=r[e])))}append(...e){return p(this._value,...e)}appendIf(e,...t){return function(e,t,...n){return!e||n.length<1?new v(t):p(t,...n)}(e,this._value,...t)}assign(...e){return f(this.value,...e)}assignIf(e,...t){return function(e,t,...n){return!e||n.length<1?new v(t):f(t,...n)}(e,this._value,...t)}getIf(...e){return this.assertAccessPath(...e),this.getClass().fromNullable(function(e,...t){let n=null;t=E(t);let r=e;for(let e=0;e<t.length;e++){let s=t[e];if(s=-1!=g(s)?g(s):s,r=null==r?void 0:r[s],void 0===r)return null;n=r}return r}(this.value,...e))}get(e){return this.getClass().fromNullable(super.get(e).value)}delete(e){return e in this.value&&delete this.value[e],this}toJson(){return JSON.stringify(this.value)}getClass(){return _}setVal(e){this._value=e}assertAccessPath(...e){var t,n,r,s,i,l,o,a,c;if(e=this.preprocessKeys(...e),!this.configDef)return;let d=h.fromNullable(Object.keys(this.configDef).map((e=>{let t={};return t[e]=this.configDef[e],t})));for(let v=0;v<e.length;v++){let f=this.keyVal(e[v]),p=this.arrayIndex(e[v]);if(d=this.isArray(p)?""!=f?Array.isArray(d.value)?h.fromNullable(null===(n=null===(t=u(d.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[f])||void 0===t||!t)})))||void 0===t?void 0:t[f])||void 0===n?void 0:n[p]):h.fromNullable(null!==(i=null===(s=null===(r=d.value)||void 0===r?void 0:r[f])||void 0===s?void 0:s[p])&&void 0!==i?i:null):Array.isArray(d.value)?h.fromNullable(null===(l=d.value)||void 0===l?void 0:l[p]):h.absent:Array.isArray(d.value)?h.fromNullable(null===(o=u(d.value).find((e=>{var t;return!(null===(t=null==e?void 0:e[f])||void 0===t||!t)})))||void 0===o?void 0:o[f]):h.fromNullable(null!==(c=null===(a=d.value)||void 0===a?void 0:a[f])&&void 0!==c?c:null),!d.isPresent())throw Error("Access Path to config invalid");if("__ANY_POINT__"==d.value)return}}isNoArray(e){return-1==e}isArray(e){return!this.isNoArray(e)}}var R;function N(e){let t=1;for(;e.lookAhead(t)!=R.EO_STRM;)t++;return--t}!function(e){e.EO_STRM="__EO_STRM__",e.BEF_STRM="___BEF_STRM__"}(R||(R={}));class I{constructor(e,...t){this.first=e,this.selectedPos=0,this.strms=[e],t.forEach((e=>{Array.isArray(e)?s(this.strms,e):this.strms.push(e)})),this.activeStrm=this.strms[this.selectedPos]}current(){return this.activeStrm.current()}hasNext(){return!!this.activeStrm.hasNext()||!(this.selectedPos>=this.strms.length)&&-1!=this.findNextStrm()}findNextStrm(){let e=!1,t=this.selectedPos;for(;!e&&t<this.strms.length;)e=this.strms[t].hasNext(),e||t++;return e?t:-1}lookAhead(e=1){const t=this.strms.slice(this.selectedPos);if(!t.length)return R.EO_STRM;const n=[...t];for(;n.length;){let t=n.shift(),r=t.lookAhead(e);if(r!=R.EO_STRM)return r;e-=N(t)}return R.EO_STRM}next(){return this.activeStrm.hasNext()?this.activeStrm.next():(this.selectedPos=this.findNextStrm(),-1==this.selectedPos?R.EO_STRM:(this.activeStrm=this.strms[this.selectedPos],this.activeStrm.next()))}reset(){this.activeStrm=this.strms[0],this.selectedPos=0;for(let e=0;e<this.strms.length;e++)this.strms[e].reset()}}class C{constructor(...e){this.dataPos=-1,this.value=e}static ofArray(e){const t=new C;return t.value=null!=e?e:[],t}lookAhead(e=1){return this.dataPos+e>this.value.length-1?R.EO_STRM:this.value[this.dataPos+e]}hasNext(){return this.value.length-1>this.dataPos}next(){var e;return this.dataPos++,null!==(e=null==this?void 0:this.value[this.dataPos])&&void 0!==e?e:R.EO_STRM}reset(){this.dataPos=-1}current(){return this.value[Math.max(0,this.dataPos)]}}class T{constructor(e,t){this._current=R.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.filterFunc=e,this.inputDataSource=t}hasNext(){let e,t=1,n=!1;for(;!n&&(e=this.inputDataSource.lookAhead(t))!=R.EO_STRM;)this.filterFunc(e)?(this._filterIdx[this._unfilteredPos+t]=!0,n=!0):t++;return n}next(){var e,t;let n=R.EO_STRM;for(;this.inputDataSource.hasNext();){this._unfilteredPos++;let r=this.inputDataSource.next();if(r!=R.EO_STRM&&(null!==(t=null===(e=this._filterIdx)||void 0===e?void 0:e[this._unfilteredPos])&&void 0!==t&&t||this.filterFunc(r))){this._filterIdx[this._unfilteredPos]=!0,n=r;break}}return this._current=n,n}lookAhead(e=1){var t;let n=R.EO_STRM;for(let r=1;e>0&&(n=this.inputDataSource.lookAhead(r))!=R.EO_STRM;r++)((null===(t=this._filterIdx)||void 0===t?void 0:t[this._unfilteredPos+r])||this.filterFunc(n))&&(e--,this._filterIdx[this._unfilteredPos+r]=!0);return n}current(){return this._current}reset(){this._current=R.BEF_STRM,this._filterIdx={},this._unfilteredPos=0,this.inputDataSource.reset()}}class O{constructor(e,t){this.mapFunc=e,this.inputDataSource=t}hasNext(){return this.inputDataSource.hasNext()}next(){return this.mapFunc(this.inputDataSource.next())}reset(){this.inputDataSource.reset()}current(){return this.mapFunc(this.inputDataSource.current())}lookAhead(e=1){const t=this.inputDataSource.lookAhead(e);return t==R.EO_STRM?t:this.mapFunc(t)}}class M{constructor(){this.data=[]}collect(e){this.data.push(e)}get finalValue(){return this.data}}function k(){var e;let t="undefined"!=typeof globalThis&&globalThis.window?globalThis.window:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:void 0!==n.g&&(null===n.g||void 0===n.g?void 0:n.g.window)?n.g.window:void 0!==n.g?n.g:null;return null!==(e=null==t?void 0:t.window)&&void 0!==e?e:t}const P=o.trim,j=o.isString,D=o.equalsIgnoreCase,L=o.objToArray;function q(e,t){for(let n=t.length;n>0;n-=r){const s=Math.max(0,n-r);e.prepend(...t.slice(s,n))}}class F extends d{constructor(e){super(null==e?void 0:e[0],"nonce"),this.rootElems=e}isAbsent(){const e=this.value;return void 0===e||""==e}get value(){var e,t,n,r,s;return null!==(n=null===(t=null===(e=null==this?void 0:this.rootElems)||void 0===e?void 0:e[0])||void 0===t?void 0:t.nonce)&&void 0!==n?n:null===(s=null===(r=null==this?void 0:this.rootElems)||void 0===r?void 0:r[0])||void 0===s?void 0:s.getAttribute("nonce")}set value(e){var t;(null===(t=null==this?void 0:this.rootElems)||void 0===t?void 0:t.length)&&this.rootElems.forEach((t=>{void 0!==(null==t?void 0:t.nonce)?t.nonce=e:t.setAttribute("nonce",e)}))}}var H;!function(e){e.SELECT="select",e.BUTTON="button",e.SUBMIT="submit",e.RESET="reset",e.IMAGE="image",e.RADIO="radio",e.CHECKBOX="checkbox"}(H||(H={}));class V extends d{constructor(e,t,n=null){super(e,t),this.element=e,this.name=t,this.defaultVal=n}get value(){let e=this.element.get(0).orElse().values;return e.length?e[0].getAttribute(this.name):this.defaultVal}set value(e){let t=this.element.get(0).orElse().values;for(let n=0;n<t.length;n++)t[n].setAttribute(this.name,e)}getClass(){return V}static fromNullable(e,t="value"){return new V(e,t)}}class $ extends d{constructor(e,t,n=null){super(e,t),this.element=e,this.name=t,this.defaultVal=n}get value(){let e=this.element.values;return e.length?e[0].style[this.name]:this.defaultVal}set value(e){let t=this.element.values;for(let n=0;n<t.length;n++)t[n].style[this.name]=e}getClass(){return $}static fromNullable(e,t="value"){return new $(e,t)}}const B=()=>!0;class U{constructor(...e){if(this.rootNode=[],this.pos=-1,this._limits=-1,!h.fromNullable(e).isAbsent()&&e.length)for(let t=0;t<e.length;t++)if(e[t])if(j(e[t])){let n=U.querySelectorAll(e[t]);n.isAbsent()||s(e,n.values)}else e[t]instanceof U?s(this.rootNode,e[t].values):Array.isArray(e[t])?s(e,e[t]):this.rootNode.push(e[t])}get value(){return this.getAsElem(0)}get values(){return this.allElems()}get global(){return k}get stream(){throw Error("Not implemented, include Stream.ts for this to work")}get lazyStream(){throw Error("Not implemented, include Stream.ts for this to work")}get id(){return new V(this.get(0),"id")}get length(){return this.rootNode.length}get tagName(){return this.getAsElem(0).getIf("tagName")}get nodeName(){return this.getAsElem(0).getIf("nodeName")}isTag(e){return!this.isAbsent()&&(this.nodeName.orElse("__none___").value.toLowerCase()==e.toLowerCase()||this.tagName.orElse("__none___").value.toLowerCase()==e.toLowerCase())}get type(){return this.getAsElem(0).getIf("type")}get name(){return new d(this.getAsElem(0).value,"name")}get inputValue(){return this.getAsElem(0).getIf("value").isPresent()?new d(this.getAsElem(0).value):d.absent}get val(){return this.inputValue.value}set val(e){this.inputValue.value=e}get nodeId(){return this.id.value}set nodeId(e){this.id.value=e}get checked(){return u(this.values).every((e=>!!e.checked))}set checked(e){this.eachElem((t=>t.checked=e))}get elements(){return this.querySelectorAll("input, select, textarea, fieldset")}get deepElements(){return this.querySelectorAllDeep("input, select, textarea, fieldset")}querySelectorAllDeep(e){let t=[],n=this.querySelectorAll(e);n.length&&t.push(n);let r=this._collectShadowRoots();if(r.length){let n=new U(r).querySelectorAllDeep(e);n.length&&t.push(n)}return new U(t)}_collectShadowRoots(){var e,t;let n=[];for(let r=0;r<(null!==(t=null===(e=null==this?void 0:this.rootNode)||void 0===e?void 0:e.length)&&void 0!==t?t:0);r++){let e=this.rootNode[r];if(!(null==e?void 0:e.querySelectorAll))continue;let t=e.querySelectorAll("*");for(let e=0,r=t.length;e<r;e++){let r=t[e].shadowRoot;r&&n.push(r)}}return n}get disabled(){return this.attr("disabled").isPresent()}set disabled(e){e?this.attr("disabled").value="disabled":this.removeAttribute("disabled")}removeAttribute(e){this.eachElem((t=>t.removeAttribute(e)))}get childNodes(){let e=[];return this.eachElem((t=>{s(e,t.childNodes)})),new U(e)}get asArray(){return u(this.rootNode).filter((e=>null!=e)).map((e=>U.byId(e)))}get offsetWidth(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetWidth)).reduce(((e,t)=>e+t),0)}get offsetHeight(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetHeight)).reduce(((e,t)=>e+t),0)}get offsetLeft(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetLeft)).reduce(((e,t)=>e+t),0)}get offsetTop(){return u(this.rootNode).filter((e=>null!=e)).map((e=>e.offsetTop)).reduce(((e,t)=>e+t),0)}get asNodeArray(){return u(this.rootNode.filter((e=>null!=e)))}get nonce(){return new F(this.rootNode)}static querySelectorAllDeep(e){return new U(document).querySelectorAllDeep(e)}static querySelectorAll(e){return-1!=e.indexOf("/shadow/")?new U(document)._querySelectorAllDeep(e):new U(document)._querySelectorAll(e)}static byId(e,t=!1){return j(e)?t?new U(document).byIdDeep(e):new U(document).byId(e):new U(e)}static byTagName(e){return j(e)?new U(document).byTagName(e):new U(e)}static globalEval(e,t){return new U(document).globalEval(e,t)}static globalEvalSticky(e,t){return new U(document).globalEvalSticky(e,t)}static fromMarkup(e){const t=document.implementation.createHTMLDocument("");let n=(e=P(e)).toLowerCase();if(-1!=n.search(/<!doctype[^\w\-]+/gi)||-1!=n.search(/<html[^\w\-]+/gi)||-1!=n.search(/<head[^\w\-]+/gi)||-1!=n.search(/<body[^\w\-]+/gi))return t.documentElement.innerHTML=e,new U(t.documentElement);{let t=function(e,t){let n=["<",t,">"].join(""),r=["<",t," "].join("");return 0==e.indexOf(n)||0==e.indexOf(r)},r=new U(document.createElement("div"));return t(n,"thead")||t(n,"tbody")||t(n,"tfoot")?(r.html(`<table>${e}</table>`),r.querySelectorAll("table").get(0).childNodes.detach()):t(n,"tr")?(r.html(`<table><tbody>${e}</tbody></table>`),r.querySelectorAll("tbody").get(0).childNodes.detach()):t(n,"td")||t(n,"th")?(r.html(`<table><tbody><tr>${e}</tr></tbody></table>`),r.querySelectorAll("tr").get(0).childNodes.detach()):(r.html(e),r.childNodes.detach())}}get(e){return e<this.rootNode.length?new U(this.rootNode[e]):U.absent}getAsElem(e,t=h.absent){return e<this.rootNode.length?h.fromNullable(this.rootNode[e]):t}filesFromElem(e){var t;return e<this.rootNode.length&&(null===(t=this.rootNode[e])||void 0===t?void 0:t.files)?this.rootNode[e].files:[]}allElems(){return this.rootNode}isAbsent(){return 0==this.length}isPresent(e){let t=this.isAbsent();return!t&&e&&e.call(this,this),!t}ifPresentLazy(e=function(){}){return this.isPresent.call(this,e),this}delete(){this.eachElem((e=>{e.parentNode&&e.parentNode.removeChild(e)}))}querySelectorAll(e){return-1!=e.indexOf("/shadow/")?this._querySelectorAllDeep(e):this._querySelectorAll(e)}closest(e){return-1!=e.indexOf("/shadow/")?this._closestDeep(e):this._closest(e)}byId(e,t){let n=[];return t&&(n=n.concat(u((null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new U(e))))),n=n.concat(this.querySelectorAll(`[id="${e}"]`)),new U(n)}byIdDeep(e,t){let n=[];t&&(n=n.concat(u((null==this?void 0:this.rootNode)||[]).filter((t=>e==t.id)).map((e=>new U(e)))));let r=this.querySelectorAllDeep(`[id="${e}"]`);return r.length&&n.push(r),new U(n)}byTagName(e,t,n){var r;let i=[];return t&&s(i,u(null!==(r=null==this?void 0:this.rootNode)&&void 0!==r?r:[]).filter((t=>(null==t?void 0:t.tagName)==e))),n?i.push(this.querySelectorAllDeep(e)):i.push(this.querySelectorAll(e)),new U(i)}attr(e,t=null){return new V(this,e,t)}style(e,t=null){return new $(this,e,t)}hasClass(e){let t=!1;return this.eachElem((n=>{if(t=n.classList.contains(e),t)return!1})),t}addClass(e){return this.eachElem((t=>t.classList.add(e))),this}removeClass(e){return this.eachElem((t=>t.classList.remove(e))),this}isMultipartCandidate(e=!1){const t="input[type='file']";return this.matchesSelector(t)||(e?this.querySelectorAllDeep(t):this.querySelectorAll(t)).first().isPresent()}html(e){return h.fromNullable(e).isAbsent()?this.isPresent()?h.fromNullable(this.innerHTML):h.absent:(this.innerHTML=e,this)}dispatchEvent(e){return this.eachElem((t=>t.dispatchEvent(e))),this}set innerHTML(e){this.eachElem((t=>t.innerHTML=e))}get innerHTML(){let e=[];return this.eachElem((t=>e.push(t.innerHTML))),e.join("")}set innerHtml(e){this.innerHTML=e}get innerHtml(){return this.innerHTML}filterSelector(e){let t=[];return this.eachElem((n=>{this._matchesSelector(n,e)&&t.push(n)})),new U(t)}matchesSelector(e){return this.asArray.some((t=>this._matchesSelector(t.getAsElem(0).value,e)))}getIf(...e){let t=this.childNodes;for(let n=0;n<e.length;n++)if(t=t.filterSelector(e[n]),t.isAbsent())return t;return t}eachElem(e){for(let t=0,n=this.rootNode.length;t<n&&!1!==e(this.rootNode[t],t);t++);return this}firstElem(e=e=>e){return this.rootNode.length>0&&e(this.rootNode[0],0),this}lastElem(e=e=>e){return this.rootNode.length>0&&e(this.rootNode[this.rootNode.length-1],this.rootNode.length-1),this}each(e){return u(this.rootNode).forEach(((t,n)=>{if(null!=t)return e(U.byId(t),n)})),this}replace(e){return this.each((t=>{let n=t.getAsElem(0).value,r=n.parentElement,s=n.nextElementSibling,i=n.previousElementSibling;null!=s?new U(s).insertBefore(e):i?new U(i).insertAfter(e):new U(r).append(e),t.delete()})),e}first(e=e=>e){return this.rootNode.length>=1?(e(this.get(0),0),this.get(0)):this}last(e=e=>e){if(this.rootNode.length>=1){let t=this.get(this.rootNode.length-1);return e(t,0),t}return this}filter(e){let t=[];return this.each((n=>{e(n)&&t.push(n)})),new U(t)}globalEval(e,t){var n,r,s;const i=null!==(r=null===(n=document.getElementsByTagName("head"))||void 0===n?void 0:n[0])&&void 0!==r?r:null===(s=document.documentElement.getElementsByTagName("head"))||void 0===s?void 0:s[0],l=document.createElement("script");t&&(void 0!==(null==l?void 0:l.nonce)?l.nonce=t:l.setAttribute("nonce",t)),l.type="text/javascript",l.innerHTML=e;let o=i.appendChild(l);return i.removeChild(o),this}globalEvalSticky(e,t){let n=document.getElementsByTagName("head")[0]||document.documentElement,r=document.createElement("script");return this.applyNonce(t,r),r.type="text/javascript",r.innerHTML=e,n.appendChild(r),this}detach(){return this.eachElem((e=>{e.parentNode.removeChild(e)})),this}appendTo(e){return o.isString(e)?(this.appendTo(U.querySelectorAll(e)),this):(this.eachElem((t=>{e.getAsElem(0).orElseLazy((()=>({appendChild:()=>{}}))).value.appendChild(t)})),this)}loadScriptEval(e,t=0,n){return this._loadScriptEval(!1,e,t,n),this}loadScriptEvalSticky(e,t=0,n){return this._loadScriptEval(!0,e,t,n),this}insertAfter(...e){this.each((t=>{let n=t.getAsElem(0).value,r=n.parentNode;for(let t=0;t<e.length;t++){let s=n.nextSibling;e[t].eachElem((e=>{s?(r.insertBefore(e,s),n=s):r.appendChild(e)}))}}));let t=[];return t.push(this),t=t.concat(e),new U(t)}insertBefore(...e){this.each((t=>{let n=t.getAsElem(0).value,r=n.parentNode;for(let t=0;t<e.length;t++)e[t].eachElem((e=>{r.insertBefore(e,n)}))}));let t=[];return t.push(this),t=t.concat(e),new U(t)}orElse(...e){return this.isPresent()?this:new U(...e)}orElseLazy(e){return this.isPresent()?this:new U(e())}allParents(e){let t=this.parent(),n=[];for(;t.isPresent();)t.matchesSelector(e)&&n.push(t),t=t.parent();return new U(n)}firstParent(e){let t=this.parent();for(;t.isPresent();){if(t.matchesSelector(e))return t;t=t.parent()}return U.absent}parentsWhileMatch(e){const t=[];let n=this.parent().filter((t=>t.matchesSelector(e)));for(;n.isPresent();)t.push(n),n=n.parent().filter((t=>t.matchesSelector(e)));return new U(t)}parent(){let e=[];return this.eachElem((t=>{let n=t.parentNode||t.host||t.shadowRoot;n&&-1==e.indexOf(n)&&e.push(n)})),new U(e)}copyAttrs(e){return e.eachElem((e=>{let t=L(e.attributes);for(let e of t){let t=e.value,n=e.name;switch(n){case"id":this.id.value=t;break;case"disabled":this.resolveAttributeHolder("disabled").disabled=t;break;case"checked":this.resolveAttributeHolder("checked").checked=t;break;case"nonce":break;default:this.attr(n).value=t}}})),e.nonce.isPresent((()=>{this.nonce.value=e.nonce.value})),this}outerHTML(e,t,n,r=!1){var s;if(this.isAbsent())return;let i=this.getAsElem(0).value,l=null===document||void 0===document?void 0:document.activeElement,o=null==l?void 0:l.id,a=!!o&&!!(null===(s=null==i?void 0:i.contains)||void 0===s?void 0:s.call(i,l)),u=a?U.getCaretPosition(l):null,c=U.fromMarkup(e),h=[],d=c.get(0),v=i.parentNode,f=d.getAsElem(0).value;if(v.replaceChild(f,i),h.push(new U(f)),this.isAbsent())return this;let p=[];if(c.length>1&&(p=p.concat(c.values.slice(1)),h.push(U.byId(f).insertAfter(new U(p)))),t&&this.runScripts(),n&&this.runCss(),a){let e=U.byId(o);e.isPresent()&&null!=u&&void 0!==u&&e.eachElem((e=>U.setCaretPosition(e,u)))}return c}runScripts(e=!1,t=B){const n=t=>{if(t.length){let n=[];u(t).forEach((t=>{t.nonce?(n.length&&(this.globalEval(n.join("\n")),n.length=0),e?this.globalEvalSticky(t.evalText,t.nonce):this.globalEval(t.evalText,t.nonce)):n.push(t.evalText)})),n.length&&(e?this.globalEvalSticky(n.join("\n")):this.globalEval(n.join("\n")),n.length=0),t=[]}return t};let r=[],s=["","script","text/javascript","text/ecmascript","ecmascript"],i=i=>{var l,o,a,u;let c=i.tagName,h=(null!==(l=null==i?void 0:i.type)&&void 0!==l?l:"").toLowerCase();if(c&&D(c,"script")&&-1!=s.indexOf(h)){let s=i.getAttribute("src");if(void 0!==s&&null!=s&&s.length>0){let l=null!==(o=null==i?void 0:i.nonce)&&void 0!==o?o:i.getAttribute("nonce").value;t(s)&&(r=n(r),e?l?this.loadScriptEvalSticky(s,0,l):this.loadScriptEvalSticky(s,0):l?this.loadScriptEval(s,0,l):this.loadScriptEval(s,0))}else{let e=P(i.text||i.innerText||i.innerHTML),t=!0;for(;t;)t=!1,"\x3c!--"==e.substring(0,4)&&(e=e.substring(4),t=!0),"//\x3c!--"==e.substring(0,4)&&(e=e.substring(6),t=!0),"//<![CDATA["==e.substring(0,11)&&(e=e.substring(11),t=!0);let n=null!==(u=null!==(a=null==i?void 0:i.nonce)&&void 0!==a?a:i.getAttribute("nonce").value)&&void 0!==u?u:"";r.push({nonce:n,evalText:e})}}};try{new U(this.filterSelector("script"),this.querySelectorAll("script")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>t.compareDocumentPosition(e)-3)).forEach((e=>i(e))),n(r)}catch(e){if(console&&console.error){const t=e;console.error(t.message||t.description)}}finally{i=null}return this}runCss(){return new U(this.filterSelector("link, style"),this.querySelectorAll("link, style")).asArray.flatMap((e=>[...e.values])).sort(((e,t)=>e.compareDocumentPosition(t)-3)).forEach((e=>(e=>{const t=U.byId(e),n=t.tagName.orElse("").value;let r=U.fromMarkup(`<${n.toLowerCase()} />`);r=r.copyAttrs(t),r.innerHTML=e.innerHTML,t.replace(r)})(e))),this}click(){return this.fireEvent("click"),this}addEventListener(e,t,n){return this.eachElem((r=>r.addEventListener(e,t,n))),this}removeEventListener(e,t,n){return this.eachElem((r=>r.removeEventListener(e,t,n))),this}fireEvent(e,t={}){let n={bubbles:!0,cancelable:!0};n=b(n,t),this.eachElem((t=>{let r;if(t.ownerDocument)r=t.ownerDocument;else{if(9!=t.nodeType)throw new Error("Invalid node passed to fireEvent: "+t.id);r=t}if(t.dispatchEvent){let r=Event;switch(e){case"click":case"mousedown":case"mouseup":case"mousemove":r=this.global().MouseEvent;break;case"keyup":case"keydown":case"keypress":r=this.global().KeyboardEvent;break;case"focus":case"change":case"blur":case"select":break;default:throw"fireEvent: Couldn't find an event class for event '"+e+"'."}let s=new r(e,n);s.synthetic=!0,t.dispatchEvent(s)}else if(t.fireEvent){let s=r.createEventObject();s.synthetic=!0,Object.keys(n).forEach((e=>s[e]=n[e])),t.fireEvent("on"+e,s)}}))}textContent(e=""){return this.asArray.map((e=>e.getAsElem(0).orElseLazy((()=>({textContent:""}))).value.textContent||"")).reduce(((t,n)=>[t,e,n].join("")),"")}innerText(e=""){return this.asArray.map((e=>e.getAsElem(0).orElseLazy((()=>({innerText:""}))).value.innerText||"")).reduce(((t,n)=>[t,n].join(e)),"")}encodeFormElement(e={}){if(this.name.isAbsent())return;let t=b(e);return this.each((e=>{var n,r;if(e.name.isAbsent())return;let s=e.name.value,i=e.tagName.orElse("__none__").value.toLowerCase(),l=e.type.orElse("__none__").value.toLowerCase();if(l=l.toLowerCase(),("input"==i||"textarea"==i||"select"==i)&&null!=s&&""!=s&&!e.disabled){if("select"==i){let n=e.getAsElem(0).value;if(n.selectedIndex>=0){let e=n.options.length;for(let r=0;r<e;r++)if(n.options[r].selected){let e=n.options[r];p(t,s).value=null!=e.getAttribute("value")?e.value:e.text}}}if(i!=H.SELECT&&l!=H.BUTTON&&l!=H.RESET&&l!=H.SUBMIT&&l!=H.IMAGE&&(l!=H.CHECKBOX&&l!=H.RADIO||e.checked)){let i=null===(r=null===(n=e.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.files,l=null!=i?i:[];if(null==l?void 0:l.length)f(t,s).value=Array.from(l);else{if(i)return;p(t,s).value=e.inputValue.value}}}})),t}get cDATAAsString(){let e=this.asArray.flatMap((e=>e.childNodes.asArray)).filter((e=>{var t,n;return 4==(null===(n=null===(t=null==e?void 0:e.value)||void 0===t?void 0:t.value)||void 0===n?void 0:n.nodeType)})).reduce(((e,t)=>{var n,r,s;return e.push(null!==(s=null===(r=null===(n=null==t?void 0:t.value)||void 0===n?void 0:n.value)||void 0===r?void 0:r.data)&&void 0!==s?s:""),e}),[]);return e.join("")}subNodes(e,t){return h.fromNullable(t).isAbsent()&&(t=this.length),new U(this.rootNode.slice(e,Math.min(t,this.length)))}limits(e){return this._limits=e,this}hasNext(){let e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.values.length-1;return!(e||t)}next(){return this.hasNext()?(this.pos++,new U(this.values[this.pos])):null}lookAhead(e=1){return this.values.length-1<this.pos+e?R.EO_STRM:new U(this.values[this.pos+e])}current(){return-1==this.pos?R.BEF_STRM:new U(this.values[this.pos])}reset(){this.pos=-1}attachShadow(e={mode:"open"}){let t=[];return this.eachElem((n=>{var r;let s;if(!(null===(r=n)||void 0===r?void 0:r.attachShadow))throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");s=U.byId(n.attachShadow(e)),t.push(s)})),new U(t)}waitUntilDom(e){return t=this,n=arguments,s=function*(e,t={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return function(e,t,n={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}){return new Promise(((r,s)=>{let i=null;const l=new Error("Mutation observer timeout");function o(e,t){let r=null;return t(e)?e:(r=n.childList?t(e)?e:e.childNodes.filter((e=>t(e))).first().value.value:n.subtree?t(e)?e:e.querySelectorAll(" * ").filter((e=>t(e))).first().value.value:t(e)?e:null,r)}let a=e;if(a=o(a,t))r(new U(a));else if("undefined"!=typeof MutationObserver){const o=setTimeout((()=>(i.disconnect(),s(l))),n.timeout),a=n=>{const s=new U(n.map((e=>e.target))).filter((e=>t(e))).first();s.isPresent()&&(clearTimeout(o),i.disconnect(),r(new U(s||e)))};i=new MutationObserver(a);let u=Object.assign({},n);delete u.timeout,e.eachElem((e=>{i.observe(e,u)}))}else{let i,a;i=setInterval((()=>{let n=o(e,t);n&&(a&&(clearTimeout(a),clearInterval(i),i=null),r(new U(n||e)))}),n.interval),a=setTimeout((()=>{i&&(clearInterval(i),s(l))}),n.timeout)}}))}(this,e,t)},new((r=void 0)||(r=Promise))((function(e,i){function l(e){try{a(s.next(e))}catch(e){i(e)}}function o(e){try{a(s.throw(e))}catch(e){i(e)}}function a(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(l,o)}a((s=s.apply(t,n||[])).next())}));var t,n,r,s}get shadowElements(){let e=(this.querySelectorAll("*").filter((e=>e.hasShadow)).allElems()||[]).map((e=>e.shadowRoot)).filter((e=>!!e));return new U(e)}get shadowRoot(){let e=[];for(let t=0;t<this.rootNode.length;t++)this.rootNode[t].shadowRoot&&e.push(this.rootNode[t].shadowRoot);return new U(e)}get hasShadow(){for(let e=0;e<this.rootNode.length;e++)if(this.rootNode[e].shadowRoot)return!0;return!1}static getCaretPosition(e){try{if("number"==typeof(null==e?void 0:e.selectionStart))return e.selectionStart}catch(e){}return 0}static setCaretPosition(e,t){(null==e?void 0:e.focus)&&(null==e||e.focus());try{(null==e?void 0:e.setSelectionRange)&&(null==e||e.setSelectionRange(t,t))}catch(e){}}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}concat(e,t=!0){let n=this.asArray;const r=new U(n.concat(e.asArray));if(!t)return r;let s={};return new U(r.asArray.filter((e=>{const t=!(null==s?void 0:s[e.value.value.outerHTML]);return s[e.value.value.outerHTML]=!0,t})))}append(e){return this.each((t=>e.appendTo(t))),this}prependTo(e){return e.eachElem((e=>{q(e,this.allElems())})),this}prepend(e){return this.eachElem((t=>{q(t,e.allElems())})),this}_querySelectorAll(e){var t,n;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let r=[];for(let t=0;t<this.rootNode.length;t++)(null===(n=this.rootNode[t])||void 0===n?void 0:n.querySelectorAll)&&s(r,this.rootNode[t].querySelectorAll(e));return new U(r)}_querySelectorAllDeep(e){var t;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let n=new U(this.rootNode),r=e.split(/\/shadow\//);for(let e=0;e<r.length;e++){if(""==r[e])continue;let t=r[e];n=n.querySelectorAll(t),e<r.length-1&&(n=n.shadowRoot)}return n}_closest(e){var t,n;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let r=[];for(let t=0;t<this.rootNode.length;t++){if(!(null===(n=this.rootNode[t])||void 0===n?void 0:n.closest))continue;let s=[this.rootNode[t].closest(e)];r=r.concat(s)}return new U(r)}_closestDeep(e){var t;if(!(null===(t=null==this?void 0:this.rootNode)||void 0===t?void 0:t.length))return this;let n=new U(this.rootNode),r=e.split(/\/shadow\//);for(let e=0;e<r.length;e++){if(""==r[e])continue;let t=r[e];n=n.closest(t),e<r.length-1&&(n=n.shadowRoot)}return n}_matchesSelector(e,t){if(e.matches)return e.matches(t);var n=(document||ownerDocument).querySelectorAll(t);return-1!==Array.prototype.indexOf.call(n,e)}_loadScriptEval(e,t,n=0,r){let s=this.createSourceNode(t,r),i=this.createSourceNode(null,r),l=`nonce_${Date.now()}_${Math.random()}`;i.innerHTML=`document.head["${l}"] = true`;let o=document.head;if(o.appendChild(i),o.removeChild(i),o[l]){try{n?setTimeout((()=>{o.appendChild(s),e||o.removeChild(s)}),n):(o.appendChild(s),e||o.removeChild(s))}finally{delete o[l]}return this}}resolveAttributeHolder(e="value"){let t=[];return t[e]=null,e in this.getAsElem(0).value?this.getAsElem(0).value:t}createSourceNode(e,t){let n=document.createElement("script");return n.type="text/javascript",t&&(void 0!==(null==n?void 0:n.nonce)?n.nonce=t:n.setAttribute("nonce",t)),e&&(n.src=e),n}applyNonce(e,t){e&&(void 0!==(null==t?void 0:t.nonce)?t.nonce=e:t.setAttribute("nonce",e))}}U.absent=new U,U.global=k;const z=U,W=U.querySelectorAll;var X;!function(e){e[e.PENDING=0]="PENDING",e[e.FULFILLED=1]="FULFILLED",e[e.REJECTED=2]="REJECTED"}(X||(X={}));const G=o.isString;class Q extends U{constructor(e,t="text/xml"){var n;G(e)?super(null==(n=e)?null:o.saveResolveLazy((()=>new(k().DOMParser)),(()=>(()=>{let e=new ActiveXObject("Microsoft.XMLDOM");return e.async=!1,{parseFromString:(t,n)=>e.loadXML(t)}})())).value.parseFromString(n,t)):super(e)}isXMLParserError(){return this.querySelectorAll("parsererror").isPresent()}toString(){let e=[];return this.eachElem((t=>{var n,r,s,i;let l=null!==(i=null===(s=null===(r=null===(n=k())||void 0===n?void 0:n.XMLSerializer)||void 0===r?void 0:r.constructor())||void 0===s?void 0:s.serializeToString(t))&&void 0!==i?i:null==t?void 0:t.xml;l&&e.push(l)})),e.join("")}parserErrorText(e){return this.querySelectorAll("parsererror").textContent(e)}static parseXML(e){return new Q(e)}static parseHTML(e){return new Q(e,"text/html")}static fromString(e,t="text/xml"){return new Q(e,t)}}class J{constructor(e,t){this.activeDataSource=null,this.walkedDataSources=[],this._currPos=0,this.mapFunc=e,this.inputDataSource=t}hasNext(){return this.resolveActiveHasNext()||this.resolveNextHasNext()}resolveActiveHasNext(){let e=!1;return this.activeDataSource&&(e=this.activeDataSource.hasNext()),e}lookAhead(e=1){var t;let n=null===(t=null==this?void 0:this.activeDataSource)||void 0===t?void 0:t.lookAhead(e);if((null==this?void 0:this.activeDataSource)&&n!=R.EO_STRM)return n;this.activeDataSource&&(e-=N(this.activeDataSource));for(let t=1;;t++){let n=this.inputDataSource.lookAhead(t);if(n===R.EO_STRM)return R.EO_STRM;let r=this.mapFunc(n),s=this.toDatasource(r),i=s.lookAhead(e);if(i!=R.EO_STRM)return i;e-=N(s)}}toDatasource(e){let t=Array.isArray(e)?C.ofArray(e):e;return this.walkedDataSources.push(t),t}resolveNextHasNext(){let e=!1;for(;!e&&this.inputDataSource.hasNext();){let t=this.mapFunc(this.inputDataSource.next());this.activeDataSource=this.toDatasource(t),e=this.activeDataSource.hasNext()}return e}next(){if(this.hasNext())return this._currPos++,this.activeDataSource.next()}reset(){this.inputDataSource.reset(),this.walkedDataSources.forEach((e=>e.reset())),this.walkedDataSources=[],this._currPos=0,this.activeDataSource=null}current(){return this.activeDataSource||this.hasNext(),this.activeDataSource.current()}}class K{constructor(...e){this._limits=-1,this.pos=-1,this.value=e}static of(...e){return K.ofArr(e)}static ofArr(e){const t=new K;return t.value=null!=e?e:[],t}static ofAssoc(e){return this.ofArr(Object.keys(e)).map((t=>[t,e[t]]))}static ofDataSource(e){let t=[];for(;e.hasNext();)t.push(e.next());return K.ofArr(t)}static ofDomQuery(e){return K.ofArr(e.asArray)}static ofConfig(e){return K.ofArr(Object.keys(e.value)).map((t=>[t,e.value[t]]))}current(){return-1==this.pos?R.BEF_STRM:this.pos>=this.value.length?R.EO_STRM:this.value[this.pos]}limits(e){return this._limits=e,this}concat(...e){let t=[this].concat(e);return K.ofArr(t).flatMap((e=>e))}onElem(e){for(let t=0;t<this.value.length&&(-1==this._limits||t<this._limits)&&!1!==e(this.value[t],t);t++);return this}each(e){this.onElem(e),this.reset()}map(e){e||(e=e=>e);let t=[];return this.each((n=>{t.push(e(n))})),K.ofArr(t)}flatMap(e){let t=[];return this.each((n=>{let r=e(n);t=Array.isArray(r)?t.concat(r):t.concat(r.value)})),K.ofArr(t)}filter(e){let t=[];return this.each((n=>{e(n)&&t.push(n)})),K.ofArr(t)}reduce(e,t=null){let n=null!=t?0:1,r=null!=t?t:this.value.length?this.value[0]:null;for(let t=n;t<this.value.length&&(-1==this._limits||t<this._limits);t++)r=e(r,this.value[t]);return this.reset(),h.fromNullable(r)}first(){return this.reset(),this.value&&this.value.length?h.fromNullable(this.value[0]):h.absent}last(){let e=this._limits>0?Math.min(this._limits,this.value.length):this.value.length;return this.reset(),h.fromNullable(e?this.value[e-1]:null)}anyMatch(e){for(let t=0;t<this.value.length&&(-1==this._limits||t<this._limits);t++)if(e(this.value[t]))return!0;return this.reset(),!1}allMatch(e){if(!this.value.length)return!1;let t=0;for(let n=0;n<this.value.length;n++)e(this.value[n])&&t++;return this.reset(),t==this.value.length}noneMatch(e){let t=0;for(let n=0;n<this.value.length;n++)e(this.value[n])||t++;return this.reset(),t==this.value.length}sort(e){let t=this.value.slice().sort(e);return K.ofArr(t)}collect(e){return this.each((t=>e.collect(t))),this.reset(),e.finalValue}hasNext(){let e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.value.length-1;return!(e||t)}next(){return this.hasNext()?(this.pos++,this.value[this.pos]):null}lookAhead(e=1){return this.pos+e>=this.value.length?R.EO_STRM:this.value[this.pos+e]}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}reset(){this.pos=-1}}class Y{static of(...e){return Y.ofArr(e)}static ofArr(e){return new Y(C.ofArray(e))}static ofAssoc(e){return this.ofArr(Object.keys(e)).map((t=>[t,e[t]]))}static ofStreamDataSource(e){return new Y(e)}static ofDomQuery(e){return Y.ofArr(e.asArray)}static ofConfig(e){return Y.ofArr(Object.keys(e.value)).map((t=>[t,e.value[t]]))}constructor(e){this._limits=-1,this.pos=-1,this.dataSource=e}hasNext(){return!this.isOverLimits()&&this.dataSource.hasNext()}next(){let e=this.dataSource.next();return this.pos++,e}lookAhead(e=1){return this.dataSource.lookAhead(e)}current(){return this.dataSource.current()}reset(){this.dataSource.reset(),this.pos=-1,this._limits=-1}concat(...e){return Y.ofStreamDataSource(new I(this,e))}nextFilter(e){if(this.hasNext()){let t=this.next();return e(t)?t:this.nextFilter(e)}return null}limits(e){return this._limits=e,this}collect(e){for(;this.hasNext();){let t=this.next();e.collect(t)}return this.reset(),e.finalValue}onElem(e){return new Y(new O((t=>(!1===e(t,this.pos)&&this.stop(),t)),this))}filter(e){return new Y(new T(e,this))}map(e){return new Y(new O(e,this))}flatMap(e){return new Y(new J(e,this))}each(e){for(;this.hasNext();)!1===e(this.next())&&this.stop();this.reset()}reduce(e,t=null){if(!this.hasNext())return h.absent;let n,r=R.EO_STRM;if(null!=t)n=t,r=this.next();else{if(n=this.next(),!this.hasNext())return h.fromNullable(n);r=this.next()}for(n=e(n,r);this.hasNext();)r=this.next(),n=e(n,r);return this.reset(),h.fromNullable(n)}last(){return this.hasNext()?this.reduce(((e,t)=>t)):h.absent}first(){return this.reset(),this.hasNext()?h.fromNullable(this.next()):h.absent}anyMatch(e){for(;this.hasNext();)if(e(this.next()))return!0;return!1}allMatch(e){for(;this.hasNext();)if(!e(this.next()))return!1;return!0}noneMatch(e){for(;this.hasNext();)if(e(this.next()))return!1;return!0}sort(e){let t=this.collect(new M);return t=t.sort(e),Y.ofArr(t)}get value(){return this.collect(new M)}[Symbol.iterator](){return{next:()=>({done:!this.hasNext(),value:this.next()})}}stop(){this.pos=this._limits+1e9,this._limits=0}isOverLimits(){return-1!=this._limits&&this.pos>=this._limits-1}}Object.defineProperty(U.prototype,"stream",{get:function(){return K.ofDomQuery(this)}}),Object.defineProperty(U.prototype,"lazyStream",{get:function(){return Y.ofDomQuery(this)}}),void 0!==k&&function(){if(void 0===k().Reflect||void 0===k().customElements||k().customElements.polyfillWrapFlushCallback)return;const e=HTMLElement;k().HTMLElement={HTMLElement:function(){return Reflect.construct(e,[],this.constructor)}}.HTMLElement,HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}();const Z="namedViewRoot",ee="jakarta.faces.source",te="myfaces.NamingContainerId",ne="myfaces.viewId",re="jakarta.faces.ViewState",se="jakarta.faces.ClientWindow",ie=Object.freeze((()=>{})),le="",oe=(Object.freeze({}),["<input type='hidden'","name='",re,"' value='' />"].join(le)),ae=["<input type='hidden'","' name='",se,"' value='' />"].join(le),ue="@all",ce="@none",he="@this",de="jakarta.faces.partial.execute",ve="jakarta.faces.partial.render",fe="_myfaces.rendeOverride",pe="jakarta.faces.windowId",me="jakarta.faces.behavior.event",ge="render",ye="onerror",Ee="onevent",we="begin",be="source",Ae="error-name",Se="error-message",xe="responseXML",_e="httpError",Re="emptyResponse",Ne="malformedXML",Ie="params",Ce="timeout",Te="execute",Oe="myfaces.internal",Me="myfaces.source.formId",ke="myfaces.upload.progress",Pe="myfaces.upload.preinit",je="myfaces.upload.loadstart",De="myfaces.upload.loadend",Le="myfaces.upload.load",qe="myfaces.upload.error",Fe="myfaces.upload.abort",He="myfaces.upload.timeout",Ve="myfaces.source.controlId",$e="myfaces.request.passThrough",Be="myfaces.request.pps",Ue="jakarta.faces.encodedURL",ze="POST",We="HEAD",Xe="FORM",Ge="BODY",Qe="[name='"+re+"']",Je="[name='"+se+"']",Ke="processResponse",Ye="partial-response",Ze="changes",et="update",tt="delete",nt="insert",rt="eval",st="error",it="attributes",lt="extension",ot="redirect",at="before",ut="after",ct="myfaces.updateForms",ht="myfaces.updateElems",dt="myfaces.headElems",vt="myfaces",ft="myfaces.appliedViewState",pt="myfaces.appliedClientWindow";function mt(){var e;return null!==(e=null===window||void 0===window?void 0:window.faces)&&void 0!==e?e:null===window||void 0===window?void 0:window.jsf}function gt(e){return e&&(null==e?void 0:e.replace)?(null===window||void 0===window?void 0:window.faces)?e.replace(/javax\.faces/gi,"jakarta.faces"):e.replace(/jakarta\.faces/gi,"javax.faces"):e}class yt{constructor(){this.MSG_TEST="Testmessage",this.MSG_DEV_MODE="Note, this message is only sent, because project stage is development and no other error listeners are registered.",this.MSG_AFFECTED_CLASS="Affected Class=",this.MSG_AFFECTED_METHOD="Affected Method=",this.MSG_ERROR_NAME="Error Name=",this.MSG_ERROR_MESSAGE="Error Message=",this.MSG_SERVER_ERROR_NAME="Server Error Name=",this.MSG_ERROR_DESC="Error Description=",this.MSG_ERROR_NO="Error Number=",this.MSG_ERROR_LINENO="Error Line Number=",this.ERR_FORM="Sourceform could not be determined, either because element is not attached to a form or we have multiple forms with named elements of the same identifier or name, stopping the ajax processing",this.ERR_VIEWSTATE="faces.viewState= param value not of type form!",this.ERR_TRANSPORT="Transport type {0} does not exist",this.ERR_EVT_PASS="an event must be passed down (either an event object null or undefined) ",this.ERR_CONSTRUCT="Parts of the response couldn't be retrieved when constructing the event data= {0} ",this.ERR_MALFORMEDXML="The server response could not be parsed, the server has returned with a response which is not xml !",this.ERR_SOURCE_FUNC="source cannot be a function (probably source and event were not defined or set to null",this.ERR_EV_OR_UNKNOWN="An event object or unknown must be passed as second parameter",this.ERR_SOURCE_NOSTR="source cannot be a string",this.ERR_SOURCE_DEF_NULL="source must be defined or null",this.ERR_MUST_STRING="{0}: {1} namespace must be of type String",this.ERR_REF_OR_ID="{0}: {1} a reference node or identifier must be provided",this.ERR_PARAM_GENERIC="{0}: parameter {1} must be of type {2}",this.ERR_PARAM_STR="{0}: {1} param must be of type string",this.ERR_PARAM_STR_RE="{0}: {1} param must be of type string or a regular expression",this.ERR_PARAM_MIXMAPS="{0}: both a source as well as a destination map must be provided",this.ERR_MUST_BE_PROVIDED="{0}: an {1} and a {2} must be provided",this.ERR_MUST_BE_PROVIDED1="{0}: {1} must be set",this.ERR_REPLACE_EL="replaceElements called while evalNodes is not an array",this.ERR_EMPTY_RESPONSE="{0}: The response cannot be null or empty!",this.ERR_ITEM_ID_NOTFOUND="{0}: item with identifier {1} could not be found",this.ERR_PPR_IDREQ="{0}: Error in PPR Insert, id must be present",this.ERR_PPR_INSERTBEFID="{0}: Error in PPR Insert, before id or after id must be present",this.ERR_PPR_INSERTBEFID_1="{0}: Error in PPR Insert, before node of id {1} does not exist in document",this.ERR_PPR_INSERTBEFID_2="{0}: Error in PPR Insert, after node of id {1} does not exist in document",this.ERR_PPR_DELID="{0}: Error in delete, id not in xml markup",this.ERR_PPR_UNKNOWNCID="{0}: Unknown Html-Component-ID= {1}",this.ERR_NO_VIEWROOTATTR="{0}: Changing of ViewRoot attributes is not supported",this.ERR_NO_HEADATTR="{0}: Changing of Head attributes is not supported",this.ERR_RED_URL="{0}: Redirect without url",this.ERR_REQ_FAILED_UNKNOWN="Request failed with unknown status",this.ERR_REQU_FAILED="Request failed with status {0} and reason {1}",this.UNKNOWN="UNKNOWN"}}const Et=e=>!(!e||-1==e.search(/\/jakarta\.faces\.resource.*\/faces\.js.*/)&&-1==(null==e?void 0:e.search(/\/faces-development\.js.*/))&&-1==(null==e?void 0:e.search(/\/faces-uncompressed\.js.*/))&&-1==(null==e?void 0:e.search(/\/faces[^.]*\.js.*ln=jakarta.faces.*/gi))&&-1==(null==e?void 0:e.search(/\/javax\.faces\.resource.*\/jsf\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf-development\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf-uncompressed\.js.*/))&&-1==(null==e?void 0:e.search(/\/jsf[^.]*\.js.*ln=javax.faces.*/gi))),wt="src";function bt(e){return null!=e&&e.length>1}class At extends z{static get windowId(){return new At(document.body).windowId}static get nonce(){return new At(document.body).nonce}get windowId(){const e=function(){let e=window.location.href,t=new RegExp("[\\?&]windowId=([^&#\\;]*)").exec(e);return