jsf.js_next_gen
Version:
A next generation typescript reimplementation of jsf.js
1 lines • 102 kB
JavaScript
(()=>{var e={105:(e,t)=>{!function(){"use strict";var e={585:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)},a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,u)}l((r=r.apply(e,t||[])).next())}))},u=this&&this.__generator||function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},l=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},s=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},c=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.DQ=t.DomQueryCollector=t.DomQuery=t.ElementAttribute=void 0;var f,p=n(152),h=n(551),v=n(255),d=n(805),E=d.Lang.trim,y=d.Lang.objToArray,_=d.Lang.isString,m=d.Lang.equalsIgnoreCase;function g(e,t,n){return void 0===n&&(n={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}),new Promise((function(r,o){var a=new Error("Mutation observer timeout");if(void 0!==window.MutationObserver){var u=setTimeout((function(){return o(a)}),n.timeout),l=new window.MutationObserver((function(e,n){var o=new A(e.map((function(e){return e.target}))).first(t);o.isPresent()&&(clearTimeout(u),r(o))})),s=i({},n);delete s.timeout,e.eachElem((function(e){l.observe(e,s)}))}else var c=setInterval((function(){var o=null;(o=n.childList?t(e)?e:e.childNodes.first(t):n.subtree?t(e)?e:e.querySelectorAll(" * ").first(t):t(e)?e:A.absent).isPresent()&&f&&(clearTimeout(f),clearInterval(c),c=null,r(o))}),n.interval),f=setTimeout((function(){c&&(clearInterval(c),o(a))}),n.timeout)}))}!function(e){e.SELECT="select",e.BUTTON="button",e.SUBMIT="submit",e.RESET="reset",e.IMAGE="image",e.RADIO="radio",e.CHECKBOX="checkbox"}(f||(f={}));var T=function(e){function t(t,n,r){void 0===r&&(r=null);var o=e.call(this,t,n)||this;return o.element=t,o.name=n,o.defaultVal=r,o}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){var e,t=(e=this.element.get(0)).orElse.apply(e,[]).values;return t.length?t[0].getAttribute(this.name):this.defaultVal},set:function(e){for(var t,n=(t=this.element.get(0)).orElse.apply(t,[]).values,r=0;r<n.length;r++)n[r].setAttribute(this.name,e);n[0].setAttribute(this.name,e)},enumerable:!1,configurable:!0}),t.prototype.getClass=function(){return t},t.fromNullable=function(e,n){return void 0===n&&(n="value"),new t(e,n)},t}(p.ValueEmbedder);t.ElementAttribute=T;var S=function(e){return-1==e.indexOf("ln=scripts")&&-1==e.indexOf("ln=javax.faces")||-1==e.indexOf("/jsf.js")&&-1==e.indexOf("/jsf-uncompressed.js")},A=function(){function e(){for(var t,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(this.rootNode=[],this.pos=-1,this._limits=-1,!p.Optional.fromNullable(n).isAbsent()&&n.length)for(var o=0;o<n.length;o++)if(_(n[o])){var i=e.querySelectorAll(n[o]);i.isAbsent()||n.push.apply(n,s([],l(i.values),!1))}else n[o]instanceof e?(t=this.rootNode).push.apply(t,s([],l(n[o].values),!1)):this.rootNode.push(n[o])}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getAsElem(0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"values",{get:function(){return this.allElems()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return new T(this.get(0),"id")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this.rootNode.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tagName",{get:function(){return this.getAsElem(0).getIf("tagName")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nodeName",{get:function(){return this.getAsElem(0).getIf("nodeName")},enumerable:!1,configurable:!0}),e.prototype.isTag=function(e){return!this.isAbsent()&&(this.nodeName.orElse("__none___").value.toLowerCase()==e.toLowerCase()||this.tagName.orElse("__none___").value.toLowerCase()==e.toLowerCase())},Object.defineProperty(e.prototype,"type",{get:function(){return this.getAsElem(0).getIf("type")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return new p.ValueEmbedder(this.getAsElem(0).value,"name")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"inputValue",{get:function(){return this.getAsElem(0).getIf("value").isPresent()?new p.ValueEmbedder(this.getAsElem(0).value):p.ValueEmbedder.absent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return h.Stream.of.apply(h.Stream,s([],l(this.values),!1)).allMatch((function(e){return!!e.checked}))},set:function(e){this.eachElem((function(t){return t.checked=e}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"elements",{get:function(){return this.querySelectorAll("input, checkbox, select, textarea, fieldset")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"deepElements",{get:function(){return this.querySelectorAllDeep("input, select, textarea, checkbox, fieldset")},enumerable:!1,configurable:!0}),e.prototype.querySelectorAllDeep=function(t){var n=[],r=this.querySelectorAll(t);r.length&&n.push(r);var o=this.querySelectorAll("*").shadowRoot;if(o.length){var i=o.querySelectorAllDeep(t);i.length&&n.push(i)}return new(e.bind.apply(e,s([void 0],l(n),!1)))},Object.defineProperty(e.prototype,"disabled",{get:function(){return this.attr("disabled").isPresent()},set:function(e){e?this.attr("disabled").value="disabled":this.removeAttribute("disabled")},enumerable:!1,configurable:!0}),e.prototype.removeAttribute=function(e){this.eachElem((function(t){return t.removeAttribute(e)}))},Object.defineProperty(e.prototype,"childNodes",{get:function(){var t=[];return this.eachElem((function(e){t=t.concat(y(e.childNodes))})),new(e.bind.apply(e,s([void 0],l(t),!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"stream",{get:function(){return new(h.Stream.bind.apply(h.Stream,s([void 0],l(this.asArray),!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"lazyStream",{get:function(){return h.LazyStream.of.apply(h.LazyStream,s([],l(this.asArray),!1))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"asArray",{get:function(){return[].concat(h.LazyStream.of.apply(h.LazyStream,s([],l(this.rootNode),!1)).filter((function(e){return null!=e})).map((function(t){return e.byId(t)})).collect(new v.ArrayCollector))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"asNodeArray",{get:function(){return[].concat(h.Stream.of(this.rootNode).filter((function(e){return null!=e})).collect(new v.ArrayCollector))},enumerable:!1,configurable:!0}),e.querySelectorAllDeep=function(t){return new e(document).querySelectorAllDeep(t)},e.querySelectorAll=function(t){return-1!=t.indexOf("/shadow/")?new e(document)._querySelectorAllDeep(t):new e(document)._querySelectorAll(t)},e.byId=function(t,n){return void 0===n&&(n=!1),_(t)?n?new e(document).byIdDeep(t):new e(document).byId(t):new e(t)},e.byTagName=function(t){return _(t)?new e(document).byTagName(t):new e(t)},e.globalEval=function(t,n){return new e(document).globalEval(t,n)},e.fromMarkup=function(t){var n=document.implementation.createHTMLDocument(""),r=(t=E(t)).toLowerCase();if(-1!=r.indexOf("<!doctype")||-1!=r.indexOf("<html")||-1!=r.indexOf("<head")||-1!=r.indexOf("<body"))return n.documentElement.innerHTML=t,new e(n.documentElement);var o=function(e,t){var n=["<",t,">"].join(""),r=["<",t," "].join("");return 0==e.indexOf(n)||0==e.indexOf(r)},i=new e(document.createElement("div"));return o(r,"thead")||o(r,"tbody")?(i.html("<table>".concat(t,"</table>")),i.querySelectorAll("table").get(0).childNodes.detach()):o(r,"tfoot")?(i.html("<table><thead></thead><tbody><tbody".concat(t,"</table>")),i.querySelectorAll("table").get(2).childNodes.detach()):o(r,"tr")?(i.html("<table><tbody>".concat(t,"</tbody></table>")),i.querySelectorAll("tbody").get(0).childNodes.detach()):o(r,"td")?(i.html("<table><tbody><tr>".concat(t,"</tr></tbody></table>")),i.querySelectorAll("tr").get(0).childNodes.detach()):(i.html(t),i.childNodes.detach())},e.prototype.get=function(t){return t<this.rootNode.length?new e(this.rootNode[t]):e.absent},e.prototype.getAsElem=function(e,t){return void 0===t&&(t=p.Optional.absent),e<this.rootNode.length?p.Optional.fromNullable(this.rootNode[e]):t},e.prototype.filesFromElem=function(e){var t;return e<this.rootNode.length&&(null===(t=this.rootNode[e])||void 0===t?void 0:t.files)?this.rootNode[e].files:[]},e.prototype.allElems=function(){return this.rootNode},e.prototype.isAbsent=function(){return 0==this.length},e.prototype.isPresent=function(e){var t=this.isAbsent();return!t&&e&&e.call(this,this),!t},e.prototype.ifPresentLazy=function(e){return void 0===e&&(e=function(){}),this.isPresent.call(this,e),this},e.prototype.delete=function(){this.eachElem((function(e){e.parentNode&&e.parentNode.removeChild(e)}))},e.prototype.querySelectorAll=function(e){return-1!=e.indexOf("/shadow/")?this._querySelectorAllDeep(e):this._querySelectorAll(e)},e.prototype._querySelectorAll=function(t){var n,r;if(!(null===(n=null==this?void 0:this.rootNode)||void 0===n?void 0:n.length))return this;for(var o=[],i=0;i<this.rootNode.length;i++)if(null===(r=this.rootNode[i])||void 0===r?void 0:r.querySelectorAll){var a=this.rootNode[i].querySelectorAll(t);o=o.concat(y(a))}return new(e.bind.apply(e,s([void 0],l(o),!1)))},e.prototype._querySelectorAllDeep=function(t){var n;if(!(null===(n=null==this?void 0:this.rootNode)||void 0===n?void 0:n.length))return this;for(var r=new(e.bind.apply(e,s([void 0],l(this.rootNode),!1))),o=t.split(/\/shadow\//),i=0;i<o.length;i++)if(""!=o[i]){var a=o[i];r=r.querySelectorAll(a),i<o.length-1&&(r=r.shadowRoot)}return r},e.prototype.byId=function(t,n){var r=[];return n&&(r=r.concat(h.LazyStream.of.apply(h.LazyStream,s([],l((null==this?void 0:this.rootNode)||[]),!1)).filter((function(e){return t==e.id})).map((function(t){return new e(t)})).collect(new v.ArrayCollector))),r=r.concat(this.querySelectorAll('[id="'.concat(t,'"]'))),new(e.bind.apply(e,s([void 0],l(r),!1)))},e.prototype.byIdDeep=function(t,n){var r=[];n&&(r=r.concat(h.LazyStream.of.apply(h.LazyStream,s([],l((null==this?void 0:this.rootNode)||[]),!1)).filter((function(e){return t==e.id})).map((function(t){return new e(t)})).collect(new v.ArrayCollector)));var o=this.querySelectorAllDeep('[id="'.concat(t,'"]'));return o.length&&r.push(o),new(e.bind.apply(e,s([void 0],l(r),!1)))},e.prototype.byTagName=function(t,n,r){var o,i=[];return n&&(i=h.LazyStream.of.apply(h.LazyStream,s([],l(null!==(o=null==this?void 0:this.rootNode)&&void 0!==o?o:[]),!1)).filter((function(e){return(null==e?void 0:e.tagName)==t})).reduce((function(e,t){return e.concat([t])}),i).orElse(i).value),r?i.push(this.querySelectorAllDeep(t)):i.push(this.querySelectorAll(t)),new(e.bind.apply(e,s([void 0],l(i),!1)))},e.prototype.attr=function(e,t){return void 0===t&&(t=null),new T(this,e,t)},e.prototype.hasClass=function(e){var t=!1;return this.eachElem((function(n){if(t=n.classList.contains(e))return!1})),t},e.prototype.addClass=function(e){return this.eachElem((function(t){return t.classList.add(e)})),this},e.prototype.removeClass=function(e){return this.eachElem((function(t){return t.classList.remove(e)})),this},e.prototype.isMultipartCandidate=function(e){var t=this;return void 0===e&&(e=!1),this.stream.filter((function(n){return function(n){var r;return 0!=n.length&&(1==n.length?"input"==n.tagName.get("booga").value.toLowerCase()&&"file"==((null===(r=n.attr("type"))||void 0===r?void 0:r.value)||"").toLowerCase()||(e?t.querySelectorAllDeep("input[type='file']").firstElem().isPresent():t.querySelectorAll("input[type='file']").firstElem().isPresent()):n.isMultipartCandidate(e))}(n)})).first().isPresent()},e.prototype.html=function(e){return p.Optional.fromNullable(e).isAbsent()?this.isPresent()?p.Optional.fromNullable(this.innerHtml):p.Optional.absent:(this.innerHtml=e,this)},e.prototype.dispatchEvent=function(e){return this.eachElem((function(t){return t.dispatchEvent(e)})),this},Object.defineProperty(e.prototype,"innerHtml",{get:function(){var e=[];return this.eachElem((function(t){return e.push(t.innerHTML)})),e.join("")},set:function(e){this.eachElem((function(t){return t.innerHTML=e}))},enumerable:!1,configurable:!0}),e.prototype._mozMatchesSelector=function(e,t){var n=e,r=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(t){for(var n=(document||window.ownerDocument).querySelectorAll(t),r=n.length;--r>=0&&n.item(r)!==e;);return r>-1};return r.call(e,t)},e.prototype.filterSelector=function(t){var n=this,r=[];return this.eachElem((function(e){n._mozMatchesSelector(e,t)&&r.push(e)})),new(e.bind.apply(e,s([void 0],l(r),!1)))},e.prototype.matchesSelector=function(e){var t=this;return this.eachElem((function(n){if(!t._mozMatchesSelector(n,e))return!1})),!0},e.prototype.getIf=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this.childNodes,r=0;r<e.length;r++)if((n=n.filterSelector(e[r])).isAbsent())return n;return n},e.prototype.eachElem=function(e){for(var t=0,n=this.rootNode.length;t<n&&!1!==e(this.rootNode[t],t);t++);return this},e.prototype.firstElem=function(e){return void 0===e&&(e=function(e){return e}),this.rootNode.length>1&&e(this.rootNode[0],0),this},e.prototype.each=function(t){return h.Stream.of.apply(h.Stream,s([],l(this.rootNode),!1)).each((function(n,r){if(null!=n)return t(e.byId(n),r)})),this},e.prototype.first=function(e){return void 0===e&&(e=function(e){return e}),this.rootNode.length>=1?(e(this.get(0),0),this.get(0)):this},e.prototype.filter=function(t){var n=[];return this.each((function(e){t(e)&&n.push(e)})),new(e.bind.apply(e,s([void 0],l(n),!1)))},e.prototype.globalEval=function(e,t){var n=document.getElementsByTagName("head")[0]||document.documentElement,r=document.createElement("script");t&&r.setAttribute("nonce",t),r.type="text/javascript",r.innerHTML=e;var o=n.appendChild(r);return n.removeChild(o),this},e.prototype.detach=function(){return this.eachElem((function(e){e.parentNode.removeChild(e)})),this},e.prototype.appendTo=function(e){this.eachElem((function(t){e.getAsElem(0).orElseLazy((function(){return{appendChild:function(e){}}})).value.appendChild(t)}))},e.prototype.loadScriptEval=function(e,t,n){var r=this;void 0===t&&(t=0),void 0===n&&(n="utf-8");var o=new XMLHttpRequest;return o.open("GET",e,!1),n&&o.setRequestHeader("Content-Type","application/x-javascript; charset:"+n),o.send(null),o.onload=function(n){t?setTimeout((function(){r.globalEval(o.responseText+"\r\n//@ sourceURL="+e)}),t):r.globalEval(o.responseText.replace(/\n/g,"\r\n")+"\r\n//@ sourceURL="+e)},o.onerror=function(e){throw Error(e)},this},e.prototype.insertAfter=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.each((function(e){for(var n=e.getAsElem(0).value,r=n.parentNode,o=function(e){var o=n.nextSibling;t[e].eachElem((function(e){o?(r.insertBefore(e,o),n=o):r.appendChild(e)}))},i=0;i<t.length;i++)o(i)}));var r=[];return r.push(this),r=r.concat(t),new(e.bind.apply(e,s([void 0],l(r),!1)))},e.prototype.insertBefore=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.each((function(e){for(var n=e.getAsElem(0).value,r=n.parentNode,o=0;o<t.length;o++)t[o].eachElem((function(e){r.insertBefore(e,n)}))}));var r=[];return r.push(this),r=r.concat(t),new(e.bind.apply(e,s([void 0],l(r),!1)))},e.prototype.orElse=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.isPresent()?this:new(e.bind.apply(e,s([void 0],l(t),!1)))},e.prototype.orElseLazy=function(t){return this.isPresent()?this:new e(t())},e.prototype.parents=function(t){var n=new Set,r=[],o=t.toLowerCase(),i=function(e){(e.tagName||"").toLowerCase()!=o||n.has(e)||(n.add(e),r.push(e))};return this.eachElem((function(e){for(var n;e.parentNode||e.host;)if(e=null!==(n=null==e?void 0:e.parentNode)&&void 0!==n?n:null==e?void 0:e.host,i(e),"form"==t&&r.length)return!1})),new(e.bind.apply(e,s([void 0],l(r),!1)))},e.prototype.copyAttrs=function(e){var t=this;return e.eachElem((function(e){var n,r,o=y(e.attributes);try{for(var i=c(o),a=i.next();!a.done;a=i.next()){var u=a.value,l=u.value,s=u.name;switch(s){case"id":t.id.value=l;break;case"disabled":t.resolveAttributeHolder("disabled").disabled=l;break;case"checked":t.resolveAttributeHolder("checked").checked=l;break;default:t.attr(s).value=l}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}})),this},e.prototype.resolveAttributeHolder=function(e){void 0===e&&(e="value");var t=[];return t[e]=null,e in this.getAsElem(0).value?this.getAsElem(0).value:t},e.prototype.outerHTML=function(t,n,r,o){var i;if(void 0===o&&(o=!1),!this.isAbsent()){var a=null===(i=null===document||void 0===document?void 0:document.activeElement)||void 0===i?void 0:i.id,u=a?e.getCaretPosition(document.activeElement):null,c=e.fromMarkup(t),f=[],p=this.getAsElem(0).value,h=c.get(0),v=p.parentNode,d=h.getAsElem(0).value;if(v.replaceChild(d,p),f.push(new e(d)),this.isAbsent())return this;var E=[];c.length>1&&(E=E.concat.apply(E,s([],l(c.values.slice(1)),!1)),f.push(e.byId(d).insertAfter(new(e.bind.apply(e,s([void 0],l(E),!1)))))),n&&this.runScripts(),r&&this.runCss();var y=e.byId(a);return a&&y.isPresent()&&null!=u&&void 0!==u&&y.eachElem((function(t){return e.setCaretPosition(t,u)})),c}},e.prototype.runScripts=function(t){var n=this;void 0===t&&(t=S);var r=[],o=m,i=function(e){var i=e.tagName,a=e.type||"";if(i&&o(i,"script")&&(""===a||o(a,"text/javascript")||o(a,"javascript")||o(a,"text/ecmascript")||o(a,"ecmascript"))){var u=e.getAttribute("src");if(void 0!==u&&null!=u&&u.length>0)t(u)&&(r.length&&(n.globalEval(r.join("\n")),r=[]),n.loadScriptEval(u,0,"UTF-8"));else{for(var l=E(e.text||e.innerText||e.innerHTML),s=!0;s;)s=!1,"\x3c!--"==l.substring(0,4)&&(l=l.substring(4),s=!0),"//\x3c!--"==l.substring(0,4)&&(l=l.substring(6),s=!0),"//<![CDATA["==l.substring(0,11)&&(l=l.substring(11),s=!0);r.push(l)}}};try{new e(this.filterSelector("script"),this.querySelectorAll("script")).stream.flatMap((function(e){return h.Stream.of(e.values)})).sort((function(e,t){return e.compareDocumentPosition(t)-3})).each((function(e){return i(e)})),r.length&&this.globalEval(r.join("\n"))}catch(e){window.console&&window.console.error&&console.error(e.message||e.description)}finally{i=null}return this},e.prototype.runCss=function(){var t=function(e,t){var n,r,o,i,a=document.createElement("style");document.getElementsByTagName("head")[0].appendChild(a);var u=null!==(n=a.sheet)&&void 0!==n?n:a.styleSheet;a.setAttribute("rel",null!==(r=e.getAttribute("rel"))&&void 0!==r?r:"stylesheet"),a.setAttribute("type",null!==(o=e.getAttribute("type"))&&void 0!==o?o:"text/css"),null!==(i=null==u?void 0:u.cssText)&&void 0!==i&&i?u.cssText=t:a.appendChild(document.createTextNode(t))};return new e(this.filterSelector("link, style"),this.querySelectorAll("link, style")).stream.flatMap((function(e){return h.Stream.of(e.values)})).sort((function(e,t){return e.compareDocumentPosition(t)-3})).each((function(e){return function(e){var n=e.tagName;if(n&&m(n,"link")&&m(e.getAttribute("type"),"text/css"))t(e,"@import url('"+e.getAttribute("href")+"');");else if(n&&m(n,"style")&&m(e.getAttribute("type"),"text/css")){var r=[],o=Array.prototype.slice.call(e.childNodes);o?o.forEach((function(e){return r.push(e.innerHTML||e.data)})):e.innerHTML&&r.push(e.innerHTML),t(e,r.join(""))}}(e)})),this},e.prototype.click=function(){return this.fireEvent("click"),this},e.prototype.addEventListener=function(e,t,n){return this.eachElem((function(r){return r.addEventListener(e,t,n)})),this},e.prototype.removeEventListener=function(e,t,n){return this.eachElem((function(r){return r.removeEventListener(e,t,n)})),this},e.prototype.fireEvent=function(e){this.eachElem((function(t){var n;if(t.ownerDocument)n=t.ownerDocument;else{if(9!=t.nodeType)throw new Error("Invalid node passed to fireEvent: "+t.id);n=t}if(t.dispatchEvent){var r="";switch(e){case"click":case"mousedown":case"mouseup":r="MouseEvents";break;case"focus":case"change":case"blur":case"select":r="HTMLEvents";break;default:throw"fireEvent: Couldn't find an event class for event '"+e+"'."}var o=n.createEvent(r);o.initEvent(e,!0,!0),o.synthetic=!0,t.dispatchEvent(o)}else if(t.fireEvent){var i=n.createEventObject();i.synthetic=!0,t.fireEvent("on"+e,i)}}))},e.prototype.textContent=function(e){return void 0===e&&(e=""),this.stream.map((function(e){return e.getAsElem(0).orElseLazy((function(){return{textContent:""}})).value.textContent||""})).reduce((function(t,n){return t+e+n}),"").value},e.prototype.innerText=function(e){return void 0===e&&(e=""),this.stream.map((function(e){return e.getAsElem(0).orElseLazy((function(){return{innerText:""}})).value.innerText||""})).reduce((function(t,n){return[t,n].join(e)}),"").value},e.prototype.encodeFormElement=function(e){if(void 0===e&&(e=new p.Config({})),!this.name.isAbsent()){var t=e.shallowCopy;return this.each((function(e){var n,r;if(!e.name.isAbsent()){var o=e.name.value,i=e.tagName.orElse("__none__").value.toLowerCase(),a=e.type.orElse("__none__").value.toLowerCase();if(a=a.toLowerCase(),("input"==i||"textarea"==i||"select"==i)&&null!=o&&""!=o&&!e.disabled){if("select"==i){var u=e.getAsElem(0).value;if(u.selectedIndex>=0)for(var l=u.options.length,s=0;s<l;s++)if(u.options[s].selected){var c=u.options[s];t.append(o).value=null!=c.getAttribute("value")?c.value:c.text}}if(i!=f.SELECT&&a!=f.BUTTON&&a!=f.RESET&&a!=f.SUBMIT&&a!=f.IMAGE&&(a!=f.CHECKBOX&&a!=f.RADIO||e.checked)){var p=null!==(r=null===(n=e.value.value)||void 0===n?void 0:n.files)&&void 0!==r?r:[];(null==p?void 0:p.length)?t.append(o).value=p[0]:t.append(o).value=e.inputValue.value}}}})),t}},Object.defineProperty(e.prototype,"cDATAAsString",{get:function(){return this.lazyStream.flatMap((function(e){return e.childNodes.stream})).filter((function(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((function(e,t){var n,r,o;return e.push(null!==(o=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!==o?o:""),e}),[]).value.join("")},enumerable:!1,configurable:!0}),e.prototype.subNodes=function(t,n){return p.Optional.fromNullable(n).isAbsent()&&(n=this.length),new(e.bind.apply(e,s([void 0],l(this.rootNode.slice(t,Math.min(n,this.length))),!1)))},e.prototype.limits=function(e){return this._limits=e,this},e.prototype.hasNext=function(){var e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.values.length-1;return!(e||t)},e.prototype.next=function(){return this.hasNext()?(this.pos++,new e(this.values[this.pos])):null},e.prototype.reset=function(){this.pos=-1},e.prototype.attachShadow=function(t){void 0===t&&(t={mode:"open"});var n=[];return this.eachElem((function(r){var o;if(!(null==r?void 0:r.attachShadow))throw new Error("Shadow dom creation not supported by the browser, please use a shim, to gain this functionality");o=e.byId(r.attachShadow(t)),n.push(o)})),new(e.bind.apply(e,s([void 0],l(n),!1)))},e.prototype.waitUntilDom=function(e,t){return void 0===t&&(t={attributes:!0,childList:!0,subtree:!0,timeout:500,interval:100}),a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,g(this,e,t)]}))}))},Object.defineProperty(e.prototype,"shadowElements",{get:function(){var t=(this.querySelectorAll("*").filter((function(e){return e.hasShadow})).allElems()||[]).map((function(e){return e.shadowRoot}));return new(e.bind.apply(e,s([void 0],l(t),!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"shadowRoot",{get:function(){for(var t=[],n=0;n<this.rootNode.length;n++)this.rootNode[n].shadowRoot&&t.push(this.rootNode[n].shadowRoot);return new(e.bind.apply(e,s([void 0],l(t),!1)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasShadow",{get:function(){for(var e=0;e<this.rootNode.length;e++)if(this.rootNode[e].shadowRoot)return!0;return!1},enumerable:!1,configurable:!0}),e.getCaretPosition=function(e){var t=0;try{if(null===document||void 0===document?void 0:document.selection){e.focus();var n=document.selection.createRange();n.moveStart("character",-e.value.length),t=n.text.length}}catch(e){}return t},e.setCaretPosition=function(e,t){(null==e?void 0:e.focus)&&(null==e||e.focus()),(null==e?void 0:e.setSelectiongRange)&&(null==e||e.setSelectiongRange(t,t))},e.prototype[Symbol.iterator]=function(){var e=this;return{next:function(){return{done:!e.hasNext(),value:e.next()}}}},e.absent=new e,e}();t.DomQuery=A;var R=function(){function e(){this.data=[]}return e.prototype.collect=function(e){this.data.push(e)},Object.defineProperty(e.prototype,"finalValue",{get:function(){return new(A.bind.apply(A,s([void 0],l(this.data),!1)))},enumerable:!1,configurable:!0}),e}();t.DomQueryCollector=R,t.DQ=A},805:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Lang=void 0;var r=n(152);!function(e){function t(e){for(var t=/\s/,n=(e=e.replace(/^\s\s*/,"")).length;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){void 0===t&&(t=null);try{var n=e();return r.Optional.fromNullable(null!=n?n:t)}catch(e){return r.Optional.absent}},e.saveResolveLazy=function(e,t){void 0===t&&(t=null);try{var n=e();return r.Optional.fromNullable(null!=n?n:t())}catch(e){return r.Optional.absent}},e.strToArray=function(e,n){void 0===n&&(n=/\./gi);var r=[];return e.split(n).forEach((function(e){r.push(t(e))})),r},e.trim=t,e.objToArray=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=[]),"__undefined__"==(null!=e?e:"__undefined__")?null!=n?n:null:e instanceof Array&&!t&&!n?e:n.concat(Array.prototype.slice.call(e,t))},e.equalsIgnoreCase=function(e,t){var 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){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(null==e)throw new TypeError("Cannot convert undefined or null to object");var r=Object(e);return Object.assign?(t.forEach((function(e){return Object.assign(r,e)})),r):(t.filter((function(e){return null!=e})).forEach((function(e){var t=e;Object.keys(t).filter((function(e){return Object.prototype.hasOwnProperty.call(t,e)})).forEach((function(e){return r[e]=t[e]}))})),r)}}(t.Lang||(t.Lang={}))},152:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),i=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},a=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.Config=t.ValueEmbedder=t.Optional=t.Monad=void 0;var u=n(805),l=n(255),s=n(551),c=u.Lang.objAssign,f=function(){function e(e){this._value=e}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),e.prototype.map=function(t){return t||(t=function(e){return e}),new e(t(this.value))},e.prototype.flatMap=function(t){for(var n=this.map(t);(null==n?void 0:n.value)instanceof e;)n=n.value;return n},e}();t.Monad=f;var p=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._value instanceof f?this._value.flatMap().value:this._value},enumerable:!1,configurable:!0}),t.fromNullable=function(e){return new t(e)},t.prototype.isAbsent=function(){return void 0===this.value||null==this.value},t.prototype.isPresent=function(e){var t=this.isAbsent();return!t&&e&&e.call(this,this),!t},t.prototype.ifPresentLazy=function(e){return void 0===e&&(e=function(){}),this.isPresent.call(this,e),this},t.prototype.orElse=function(e){return this.isPresent()?this:null==e?t.absent:this.flatMap((function(){return e}))},t.prototype.orElseLazy=function(e){return this.isPresent()?this:this.flatMap(e)},t.prototype.flatMap=function(n){var r=e.prototype.flatMap.call(this,n);return r instanceof t?r.flatMap():t.fromNullable(r.value)},t.prototype.getIf=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=this,r=0;r<e.length;r++){var o=this.keyVal(e[r]),i=this.arrayIndex(e[r]);if(""===o&&i>=0){if((n=this.getClass().fromNullable(n.value instanceof Array?n.value.length<i?null:n.value[i]:null)).isAbsent())return n}else if(o&&i>=0){if(n.getIfPresent(o).isAbsent())return n;if((n=n.getIfPresent(o).value instanceof Array?this.getClass().fromNullable(n.getIfPresent(o).value[i]):this.getClass().absent).isAbsent())return n}else{if((n=n.getIfPresent(o)).isAbsent())return n;i>-1&&(n=this.getClass().fromNullable(n.value[i]))}}return n},t.prototype.match=function(e){return!this.isAbsent()&&e(this.value)},t.prototype.get=function(e){return void 0===e&&(e=t.absent),this.isAbsent()?this.getClass().fromNullable(e).flatMap():this.getClass().fromNullable(this.value).flatMap()},t.prototype.toJson=function(){return JSON.stringify(this.value)},t.prototype.getClass=function(){return t},t.prototype.arrayIndex=function(e){var t=e.indexOf("["),n=e.indexOf("]");return t>=0&&n>0&&t<n?parseInt(e.substring(t+1,n)):-1},t.prototype.keyVal=function(e){var t=e.indexOf("[");return t>=0?e.substring(0,t):e},t.prototype.getIfPresent=function(e){return this.isAbsent()?this.getClass().absent:this.getClass().fromNullable(this.value[e]).flatMap()},t.prototype.resolve=function(e){if(this.isAbsent())return t.absent;try{return t.fromNullable(e(this.value))}catch(e){return t.absent}},t.absent=t.fromNullable(null),t}(f);t.Optional=p;var h=function(e){function t(t,n){void 0===n&&(n="value");var r=e.call(this,t)||this;return r.key=n,r}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this._value?this._value[this.key]:null},set:function(e){this._value&&(this._value[this.key]=e)},enumerable:!1,configurable:!0}),t.prototype.orElse=function(e){var n={};return n[this.key]=e,this.isPresent()?this:new t(n,this.key)},t.prototype.orElseLazy=function(e){if(this.isPresent())return this;var n={};return n[this.key]=e(),new t(n,this.key)},t.prototype.getClass=function(){return t},t.fromNullable=function(e,n){return void 0===n&&(n="value"),new t(e,n)},t.absent=t.fromNullable(null),t}(p);t.ValueEmbedder=h;var v=function(e){function t(t,n,r){var o=e.call(this,t,n)||this;return o.arrPos=null!=r?r:-1,o}return o(t,e),Object.defineProperty(t.prototype,"value",{get:function(){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:function(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},enumerable:!1,configurable:!0}),t.absent=t.fromNullable(null),t}(h),d=function(e){function t(t){return e.call(this,t)||this}return o(t,e),Object.defineProperty(t.prototype,"shallowCopy",{get:function(){return new t(s.Stream.ofAssoc(this.value).collect(new l.AssocArrayCollector))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deepCopy",{get:function(){return new t(c({},this.value))},enumerable:!1,configurable:!0}),t.fromNullable=function(e){return new t(e)},t.prototype.shallowMerge=function(e,t,n){var r=this;void 0===t&&(t=!0),void 0===n&&(n=!1);var o=function(o){!t&&o in u.value||(n?Array.isArray(e.getIf(o).value)?s.Stream.of.apply(s.Stream,a([],i(e.getIf(o).value),!1)).each((function(e){return r.append(o).value=e})):u.append(o).value=e.getIf(o).value:u.assign(o).value=e.getIf(o).value)},u=this;for(var l in e.value)o(l)},t.prototype.append=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=e.length<1;if(!n){var r=e[e.length-1],o=(this.keyVal(r),this.getIf.apply(this,a([],i(e),!1)).isPresent());this.buildPath(e);var u=this.arrayIndex(r);if(u>-1)throw Error("Append only possible on non array properties, use assign on indexed data");var l=this.getIf.apply(this,a([],i(e),!1)).value;Array.isArray(l)||(l=this.assign.apply(this,a([],i(e),!1)).value=[l]),o&&l.push({}),u=l.length-1;var s=new v(1==e.length?this.value:this.getIf.apply(this,e.slice(0,e.length-1)).value,r,u);return s}},t.prototype.appendIf=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e?this.append.apply(this,a([],i(t),!1)):{value:null}},t.prototype.assign=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(!(e.length<1)){this.buildPath(e);var n=this.keyVal(e[e.length-1]),r=this.arrayIndex(e[e.length-1]),o=new v(1==e.length?this.value:this.getIf.apply(this,e.slice(0,e.length-1)).value,n,r);return o}},t.prototype.assignIf=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return e?this.assign.apply(this,a([],i(t),!1)):{value:null}},t.prototype.getIf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.getClass().fromNullable(e.prototype.getIf.apply(this,t).value)},t.prototype.get=function(t){return this.getClass().fromNullable(e.prototype.get.call(this,t).value)},t.prototype.delete=function(e){return e in this.value&&delete this.value[e],this},t.prototype.toJson=function(){return JSON.stringify(this.value)},t.prototype.getClass=function(){return t},t.prototype.setVal=function(e){this._value=e},t.prototype.buildPath=function(e){for(var t=this,n=this.getClass().fromNullable(null),r=-1,o=function(e,t){for(var n=e.length,r=n+t,o=n;o<r;o++)e.push({})},i=0;i<e.length;i++){var a=this.keyVal(e[i]),u=this.arrayIndex(e[i]);if(""===a&&u>=0)t.setVal(t.value instanceof Array?t.value:[]),o(t.value,u+1),r>=0&&(n.value[r]=t.value),n=t,r=u,t=this.getClass().fromNullable(t.value[u]);else{var l=t.getIf(a);if(-1==u)l.isAbsent()?l=this.getClass().fromNullable(t.value[a]={}):t=l;else{var s=l.value instanceof Array?l.value:[];o(s,u+1),t.value[a]=s,l=this.getClass().fromNullable(s[u])}n=t,r=u,t=l}}return this},t}(p);t.Config=d},255:function(e,t,n){var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.QueryFormStringCollector=t.QueryFormDataCollector=t.FormDataCollector=t.AssocArrayCollector=t.Run=t.ArrayAssocArrayCollector=t.ArrayCollector=t.FlatMapStreamDataSource=t.MappedStreamDataSource=t.FilteredStreamDatasource=t.ArrayStreamDataSource=t.SequenceDataSource=void 0;var i=n(551),a=function(){function e(e,t){this.total=t,this.start=e,this.value=e}return e.prototype.hasNext=function(){return this.value<this.total},e.prototype.next=function(){return Math.min(this.value++,this.total-1)},e.prototype.reset=function(){this.value=0},e}();t.SequenceDataSource=a;var u=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.dataPos=-1,this.value=e}return e.prototype.hasNext=function(){return this.value.length-1>this.dataPos},e.prototype.next=function(){return this.dataPos++,this.value[this.dataPos]},e.prototype.reset=function(){this.dataPos=-1},e}();t.ArrayStreamDataSource=u;var l=function(){function e(e,t){this.filteredNext=null,this.filterFunc=e,this.inputDataSource=t}return e.prototype.hasNext=function(){for(;null==this.filteredNext&&this.inputDataSource.hasNext();){var e=this.inputDataSource.next();if(this.filterFunc(e))return this.filteredNext=e,!0;this.filteredNext=null}return null!=this.filteredNext},e.prototype.next=function(){var e=this.filteredNext;return this.filteredNext=null,this.hasNext(),e},e.prototype.reset=function(){this.filteredNext=null,this.inputDataSource.reset()},e}();t.FilteredStreamDatasource=l;var s=function(){function e(e,t){this.mapFunc=e,this.inputDataSource=t}return e.prototype.hasNext=function(){return this.inputDataSource.hasNext()},e.prototype.next=function(){return this.mapFunc(this.inputDataSource.next())},e.prototype.reset=function(){this.inputDataSource.reset()},e}();t.MappedStreamDataSource=s;var c=function(){function e(e,t){this.mapFunc=e,this.inputDataSource=t}return e.prototype.hasNext=function(){return this.resolveCurrentNext()||this.resolveNextNext()},e.prototype.resolveCurrentNext=function(){var e=!1;return this.activeDataSource&&(e=this.activeDataSource.hasNext()),e},e.prototype.resolveNextNext=function(){for(var e=!1;!e&&this.inputDataSource.hasNext();){var t=this.mapFunc(this.inputDataSource.next());Array.isArray(t)?this.activeDataSource=new(u.bind.apply(u,o([void 0],r(t),!1))):this.activeDataSource=t,e=this.activeDataSource.hasNext()}return e},e.prototype.next=function(){return this.activeDataSource.next()},e.prototype.reset=function(){this.inputDataSource.reset()},e}();t.FlatMapStreamDataSource=c;var f=function(){function e(){this.data=[]}return e.prototype.collect=function(e){this.data.push(e)},Object.defineProperty(e.prototype,"finalValue",{get:function(){return this.data},enumerable:!1,configurable:!0}),e}();t.ArrayCollector=f;var p=function(){function e(){this.finalValue={}}return e.prototype.collect=function(e){var t,n,r,o,i=null!==(t=null==e?void 0:e[0])&&void 0!==t?t:e;this.finalValue[i]=null!==(r=null===(n=this.finalValue)||void 0===n?void 0:n[i])&&void 0!==r?r:[],this.finalValue[i].push(null===(o=null==e?void 0:e[1])||void 0===o||o)},e}();t.ArrayAssocArrayCollector=p;var h=function(){function e(){}return e.prototype.collect=function(e){},Object.defineProperty(e.prototype,"finalValue",{get:function(){return null},enumerable:!1,configurable:!0}),e}();t.Run=h;var v=function(){function e(){this.finalValue={}}return e.prototype.collect=function(e){var t,n;this.finalValue[null!==(t=e[0])&&void 0!==t?t:e]=null===(n=e[1])||void 0===n||n},e}();t.AssocArrayCollector=v;var d=function(){function e(){this.finalValue=new FormData}return e.prototype.collect=function(e){this.finalValue.append(e.key,e.value)},e}();t.FormDataCollector=d;var E=function(){function e(){this.finalValue=new FormData}return e.prototype.collect=function(e){var t=e.encodeFormElement();t.isPresent()&&this.finalValue.append(e.name.value,t.get(e.name).value)},e}();t.QueryFormDataCollector=E;var y=function(){function e(){this.formData=[]}return e.prototype.collect=function(e){var t=e.encodeFormElement();t.isPresent()&&this.formData.push([e.name.value,t.get(e.name).value])},Object.defineProperty(e.prototype,"finalValue",{get:function(){return i.Stream.of.apply(i.Stream,o([],r(this.formData),!1)).map((function(e){return e.join("=")})).reduce((function(e,t){return[e,t].join("&")})).orElse("").value},enumerable:!1,configurable:!0}),e}();t.QueryFormStringCollector=y},551:function(e,t,n){var r=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))};Object.defineProperty(t,"__esModule",{value:!0}),t.LazyStream=t.Stream=void 0;var i=n(152),a=n(255),u=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._limits=-1,this.pos=-1,this.value=e}return e.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new(e.bind.apply(e,o([void 0],r(t),!1)))},e.ofAssoc=function(e){return this.of.apply(this,o([],r(Object.keys(e)),!1)).map((function(t){return[t,e[t]]}))},e.ofDataSource=function(t){for(var n=[];t.hasNext();)n.push(t.next());return new(e.bind.apply(e,o([void 0],r(n),!1)))},e.prototype.limits=function(e){return this._limits=e,this},e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.of.apply(e,o([this],r(t),!1)).flatMap((function(e){return e}))},e.prototype.onElem=function(e){for(var t=0;t<this.value.length&&(-1==this._limits||t<this._limits)&&!1!==e(this.value[t],t);t++);return this},e.prototype.each=function(e){this.onElem(e)},e.prototype.map=function(t){t||(t=function(e){return e});var n=[];return this.each((function(e,r){n.push(t(e))})),new(e.bind.apply(e,o([void 0],r(n),!1)))},e.prototype.flatMap=function(t){var n=[];return this.each((function(e){var i=t(e);n=Array.isArray(i)?n.concat(i):n.concat.apply(n,o([],r(i.value),!1))})),e.of.apply(e,o([],r(n),!1))},e.prototype.filter=function(t){var n=[];return this.each((function(e){t(e)&&n.push(e)})),new(e.bind.apply(e,o([void 0],r(n),!1)))},e.prototype.reduce=function(e,t){void 0===t&&(t=null);for(var n=null!=t?0:1,r=null!=t?t:this.value.length?this.value[0]:null,o=n;o<this.value.length&&(-1==this._limits||o<this._limits);o++)r=e(r,this.value[o]);return i.Optional.fromNullable(r)},e.prototype.first=function(){return this.value&&this.value.length?i.Optional.fromNullable(this.value[0]):i.Optional.absent},e.prototype.last=function(){var e=this._limits>0?Math.min(this._limits,this.value.length):this.value.length;return i.Optional.fromNullable(e?this.value[e-1]:null)},e.prototype.anyMatch=function(e){for(var t=0;t<this.value.length&&(-1==this._limits||t<this._limits);t++)if(e(this.value[t]))return!0;return!1},e.prototype.allMatch=function(e){if(!this.value.length)return!1;for(var t=0,n=0;n<this.value.length;n++)e(this.value[n])&&t++;return t==this.value.length},e.prototype.noneMatch=function(e){for(var t=0,n=0;n<this.value.length;n++)e(this.value[n])||t++;return t==this.value.length},e.prototype.sort=function(t){var n=this.value.slice().sort(t);return e.of.apply(e,o([],r(n),!1))},e.prototype.collect=function(e){return this.each((function(t){return e.collect(t)})),e.finalValue},e.prototype.hasNext=function(){var e=-1!=this._limits&&this.pos>=this._limits-1,t=this.pos>=this.value.length-1;return!(e||t)},e.prototype.next=function(){return this.hasNext()?(this.pos++,this.value[this.pos]):null},e.prototype[Symbol.iterator]=function(){var e=this;return{next:function(){return{done:!e.hasNext(),value:e.next()}}}},e.prototype.reset=function(){this.pos=-1},e}();t.Stream=u;var l=function(){function e(e){this._limits=-1,this.pos=-1,this.dataSource=e}return e.of=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(new(a.ArrayStreamDataSource.bind.apply(a.ArrayStreamDataSource,o([void 0],r(t),!1))))},e.ofAssoc=function(e){return this.of.apply(this,o([],r(Object.keys(e)),!1)).map((function(t){return[t,e[t]]}))},e.ofStreamDataSource=function(t){return new e(t)},e.prototype.hasNext=function(){return!this.isOverLimits()&&this.dataSource.hasNext()},e.prototype.next=function(){var e=this.dataSource.next();return this.pos++,e},e.prototype.reset=function(){this.dataSource.reset(),this.pos=0,this._limits=-1},e.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.of.apply(e,o([this],r(t),!1)).flatMap((function(e){return e}))},e.prototype.nextFilter=function(e){if(this.hasNext()){var t=this.next();return e(t)?t:this.nextFilter(e)}return null},e.prototype.limits=function(e){return this._limits=e,this},e.prototype.collect=function(e){for(;this.hasNext();){var t=this.next();e.collect(t)}return e.finalValue},e.prototype.onElem=function(t){var n=this;return new e(new a.MappedStreamDataSource((function(e){return!1===t(e,n.pos)&&n.stop(),e}),this))},e.prototype.filter=function(t){return new e(new a.FilteredStreamDatasource(t,this))},e.prototype.map=function(t){return new e(new a.MappedStreamDataSource(t,this))},e.prototype.flatMap=function(t){return new e(new a.FlatMapStreamDataSource(t,this))},e.prototype.each=function(e){for(;this.hasNext();)!1===e(this.next())&&this.stop()},e.prototype.reduce=function(e,t){if(void 0===t&&(t=null),!this.hasNext())return i.Optional.absent;var n=null,r=null;if(null!=t)n=t,r=this.next();else{if(n=this.next(),!this.hasNext())return i.Optional.fromNullable(n);r=this.next()}for(n=e(n,r);this.hasNext();)n=e(n,r=this.next());return i.Optional.fromNullable(n)},e.prototype.last=function(){return this.hasNext()?this.reduce((function(e,t){return t})):i.Optional.absent},e.prototype.first=function(){return this.reset(),this.hasNext()?i.Optional.fromNullable(this.next()):i.Optional.absent},e.prototype.anyMatch=function(e){for(;this.hasNext();)if(e(this.next()))return!0;return!1},e.prototype.allMatch=function(e){for(;this.hasNext();)if(!e(this.next()))return!1;return!0},e.prototype.noneMatch=function(e){for(;this.hasNext();)if(e(this.next()))return!1;return!0},e.prototype.sort=function(t){var n=this.collect(new a.ArrayCollector);return n=n.sort(t),e.of.apply(e,o([],r(n),!1))},Object.defineProperty(e.prototype,"value",{get:function(){return this.collect(new a.ArrayCollector)},enumerable:!1,configurable:!0}),e.prototype[Symbol.iterator]=function(){var e=this;return{next:function(){return{done:!e.hasNext(),value:e.next()}}}},e.prototype.stop=function(){this.pos=this._limits+1e9},e.prototype.isOverLimits=function(){return-1!=this._limits&&this.pos>=this._limits-1},e}();t.LazyStream=l},121:function(e,t,n){var r,o=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.XQ=t.XMLQuery=void 0;var i=n(805),a=n(585),u=i.Lang.isString,l=function(e){function t(t,n){var r;return void 0===n&&(n="text/xml"),u(t)?e.call(this,null==(r=t)?null:i.Lang.saveResolveLazy((function(){return new window.DOMParser}),(function(){return(e=new ActiveXObject("Microsoft.XMLDOM")).async=!1,{parseFromString:function(t,n){return e.loadXML(t)}};var e})).value.parseFromString(r,n))||this:e.call(this,t)||this}return o(t,e),t.prototype.isXMLParserError=function(){return this.querySelectorAll("parsererror").isPresent()},t.prototype.toString=function(){var e=[];return this.eachElem((function(t){var n,r,o,i=null!==(o=null===(r=null===