var _t3,_Class,_t16,_t18,_t19,_t21,_Class2,_t27,_t31,_e14,_e18,_e19,_e20,_s7,_e21,_e25,_e29,_t34,_n4;function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _classPrivateFieldInitSpec(e,t,r){_checkPrivateRedeclaration(e,t),t.set(e,r)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldSet(e,t,r){return e.set(_assertClassBrand(e,t),r),r}function _classPrivateFieldGet(e,t){return e.get(_assertClassBrand(e,t))}function _assertClassBrand(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _regeneratorRuntime(){_regeneratorRuntime=function(){return s};var l,s={},e=Object.prototype,c=e.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",r=t.asyncIterator||"@@asyncIterator",i=t.toStringTag||"@@toStringTag";function a(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{a({},"")}catch(l){a=function(e,t,r){return e[t]=r}}function o(e,t,r,n){var i,a,s,o,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype),n=new k(n||[]);return u(t,"_invoke",{value:(i=e,a=r,s=n,o=_,function(e,t){if(o===d)throw Error("Generator is already running");if(o===f){if("throw"===e)throw t;return{value:l,done:!0}}for(s.method=e,s.arg=t;;){var r=s.delegate;if(r){r=function e(t,r){var n=r.method,i=t.iterator[n];if(i===l)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=l,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;n=h(i,t.iterator,r.arg);if("throw"===n.type)return r.method="throw",r.arg=n.arg,r.delegate=null,v;i=n.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=l),r.delegate=null,v):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}(r,s);if(r){if(r===v)continue;return r}}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if(o===_)throw o=f,s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);o=d;r=h(i,a,s);if("normal"===r.type){if(o=s.done?f:p,r.arg===v)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(o=f,s.method="throw",s.arg=r.arg)}})}),t}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}s.wrap=o;var _="suspendedStart",p="suspendedYield",d="executing",f="completed",v={};function g(){}function y(){}function m(){}var t={},b=(a(t,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(E([]))),N=(b&&b!==e&&c.call(b,n)&&(t=b),m.prototype=g.prototype=Object.create(t));function w(e){["next","throw","return"].forEach(function(t){a(e,t,function(e){return this._invoke(t,e)})})}function S(s,o){var t;u(this,"_invoke",{value:function(r,n){function e(){return new o(function(e,t){!function t(e,r,n,i){var a,e=h(s[e],s,r);if("throw"!==e.type)return(r=(a=e.arg).value)&&"object"==_typeof(r)&&c.call(r,"__await")?o.resolve(r.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):o.resolve(r).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,i)});i(e.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}})}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function E(t){if(t||""===t){var r,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return r=-1,(e=function e(){for(;++r<t.length;)if(c.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=l,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return u(N,"constructor",{value:y.prototype=m,configurable:!0}),u(m,"constructor",{value:y,configurable:!0}),y.displayName=a(m,i,"GeneratorFunction"),s.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},s.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,a(e,i,"GeneratorFunction")),e.prototype=Object.create(N),e},s.awrap=function(e){return{__await:e}},w(S.prototype),a(S.prototype,r,function(){return this}),s.AsyncIterator=S,s.async=function(e,t,r,n,i){void 0===i&&(i=Promise);var a=new S(o(e,t,r,n),i);return s.isGeneratorFunction(t)?a:a.next().then(function(e){return e.done?e.value:a.next()})},w(N),a(N,i,"Generator"),a(N,n,function(){return this}),a(N,"toString",function(){return"[object Generator]"}),s.keys=function(e){var t,r=Object(e),n=[];for(t in r)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},s.values=E,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&c.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return a.type="throw",a.arg=r,n.next=e,t&&(n.method="next",n.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],a=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var s=c.call(i,"catchLoc"),o=c.call(i,"finallyLoc");if(s&&o){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!o)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&c.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}var a=(i=i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc?null:i)?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),v},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r,n,i=this.tryEntries[t];if(i.tryLoc===e)return"throw"===(r=i.completion).type&&(n=r.arg,P(i)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=l),v}},s}function asyncGeneratorStep(e,t,r,n,i,a,s){try{var o=e[a](s),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(n,i)}function _asyncToGenerator(o){return function(){var e=this,s=arguments;return new Promise(function(t,r){var n=o.apply(e,s);function i(e){asyncGeneratorStep(n,t,r,i,a,"next",e)}function a(e){asyncGeneratorStep(n,t,r,i,a,"throw",e)}i(void 0)})}}function _createForOfIteratorHelper(e,t){var r,n,i,a,s="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(s)return i=!(n=!0),{s:function(){s=s.call(e)},n:function(){var e=s.next();return n=e.done,e},e:function(e){i=!0,r=e},f:function(){try{n||null==s.return||s.return()}finally{if(i)throw r}}};if(Array.isArray(e)||(s=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return s&&(e=s),a=0,{s:t=function(){},n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,s,o=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return o}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var MJS={},MarbleJS=_createClass(function e(t){var r;if(_classCallCheck(this,e),this.load_utils=null==(r=(t=t||{}).utils)||r,this.load_namespace=null==(r=t.namespace)||r,this.xhr_options=t.xhr||null,this.mustache_options=t.mustache||null,this.events_options=null!=(r=t.events)?r:{},this.xhr_options)for(var n=0,i=Object.entries(this.xhr_options);n<i.length;n++){var a=_slicedToArray(i[n],2),s=a[0];_XHR[s]=a[1]}if(this.mustache_options)for(var o=0,l=Object.entries(this.mustache_options);o<l.length;o++){var c=_slicedToArray(l[o],2),u=c[0];_MustacheAPI[u]=c[1]}this.load_utils&&MJS.Namespace("Core").import("Utils").setup(),this.load_namespace&&MJS.Namespace.load(),!1!==this.events_options&&MJS.Namespace("Core").import("Events").create(this.events_options)}),templates=(MJS.Namespace=MJS.NS=function(e){return new MJS.NS.Class(e)},MJS.Namespace.Class=MJS.NS.Class=(_t3=(()=>{function o(e){_classCallCheck(this,o),_defineProperty(this,"pointer",{}),_defineProperty(this,"pointer_string",""),_defineProperty(this,"overwrite",!0),this.register(e)}return _createClass(o,[{key:"register",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=(Array.isArray(e)||(e=e.replace(/\//g,"\\").split("\\")),this.pointer=o.NamespaceStructure,[]);return e.forEach(function(e){r.push(e),t.pointer[e]=t.pointer[e]||{pointer:r.join("\\")},t.pointer=t.pointer[e]}),this.pointer_string=e.join("\\"),o}},{key:"setPointer",value:function(){this.pointer=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{}}},{key:"export",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(this.register(this.pointer_string+"\\"+e),!o.NamespaceMap.has(this.pointer_string)||(console.warn("MJS.Namespace Export ("+e+') - Class already existed in specified namespace "'+this.pointer_string+'". Overwrite mode '+(this.overwrite?"enabled":"disabled")),this.overwrite))return o.NamespaceMap.set(this.pointer_string,t),this}},{key:"exportInstance",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.pointer._instance={},o.NamespaceMap.set(this.pointer_string+"\\"+o.instance_key,e),this}},{key:"import",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(o.NamespaceMap.has(this.pointer_string+"\\"+e))return o.NamespaceMap.get(this.pointer_string+"\\"+e);console.warn("MJS.Namespace Import ("+e+') - Class does not exist in specified namespace "'+this.pointer_string+'"')}},{key:"importInstance",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(this.pointer_string+="\\"+e,!o.NamespaceMap.has(this.pointer_string+"\\"+o.instance_key)){if(!o.NamespaceMap.has(this.pointer_string))return void console.warn("MJS.Namespace ImportInstance ("+e+') - Class does not exist in specified namespace "'+this.pointer_string+'".');e=new(o.NamespaceMap.get(this.pointer_string));this.exportInstance(e),o.initInstance(e)}return o.NamespaceMap.get(this.pointer_string+"\\"+o.instance_key)}},{key:"move",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=this.pointer_string;if(this.register(e),!o.NamespaceMap.has(this.pointer_string)||(console.warn("MJS.Namespace Move ("+e+') - Class already existed in specified namespace "'+this.pointer_string+'". Overwrite mode '+(this.overwrite?"enabled":"disabled")),this.overwrite))return e=o.NamespaceMap.get(t),o.NamespaceMap.set(this.pointer_string,e),o.NamespaceMap.delete(t),this}},{key:"moveInstance",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=this.pointer_string;this.register(e),o.NamespaceMap.has(this.pointer_string)&&(console.warn("MJS.Namespace ExportInstance ("+e+') - Class already existed in specified namespace "'+this.pointer_string+'". Overwrite mode '+(this.overwrite?"enabled":"disabled")),!this.overwrite)||(e=o.NamespaceMap.get(t+"\\"+o.instance_key),o.NamespaceMap.set(this.pointer_string+"\\"+o.instance_key,e),o.NamespaceMap.delete(t+"\\"+o.instance_key))}},{key:"extend",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(this.register(this.pointer_string+"\\"+e),o.NamespaceMap.has(this.pointer_string)){var r,n=o.NamespaceMap.get(this.pointer_string),i=_createForOfIteratorHelper(Object.getOwnPropertyNames(t.prototype));try{for(i.s();!(r=i.n()).done;){var a=r.value;if("function"==typeof n.prototype[a])n.prototype[a]=t.prototype[a];else for(var s=0;s<50;s++)if(void 0===n.prototype["".concat(a,"_").concat(s)]){n.prototype["".concat(a,"_").concat(s)]=t.prototype[a];break}}}catch(e){i.e(e)}finally{i.f()}n.prototype.constructor=n,Object.setPrototypeOf(n,t),o.NamespaceMap.set(this.pointer_string,n)}else console.warn("MJS.Namespace Extend ("+e+') - Class does not exist in specified namespace "'+this.pointer_string+'".');return this}},{key:"createInstance",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(o.NamespaceMap.has(this.pointer_string+"\\"+e))return this.pointer_string+="\\"+e,t=new(o.NamespaceMap.get(this.pointer_string))(t),this.exportInstance(t),o.initInstance(t),t;console.warn("MJS.Namespace CreateInstance ("+e+') - Class does not exist in specified namespace "'+this.pointer_string+'".')}}],[{key:"initInstance",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,r,n,i=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:for("function"==typeof(t=0<i.length&&void 0!==i[0]?i[0]:{}).__include&&t.__include(),"function"==typeof t.__constructor&&t.__constructor(),"function"==typeof t.__init_before&&t.__init_before(),r=0;r<50;r++)"function"==typeof t["__constructor_".concat(r)]&&t["__constructor_".concat(r)](),"function"==typeof t["__init_before_".concat(r)]&&t["__init_before_".concat(r)]();for("function"==typeof t.__init&&t.__init(),"function"==typeof t.__init_after&&t.__init_after(),n=0;n<50;n++)"function"==typeof t["__init_after_".concat(n)]&&t["__init_after_".concat(n)]();return e.abrupt("return",this);case 6:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"remove",value:function(){}},{key:"removeInstance",value:function(){}}]);var e})(),_defineProperty(_t3,"NamespaceMap",new Map),_defineProperty(_t3,"NamespaceStructure",{}),_defineProperty(_t3,"NamespaceIncludes",{}),_defineProperty(_t3,"instance_key","_instance"),_t3),MJS.Namespace.load=function(e,t){if((e=e||document.body.getAttribute("js-classes"))&&e.length){var r,n=_createForOfIteratorHelper(e=Array.isArray(e)?e:e.split(" "));try{for(n.s();!(r=n.n()).done;){var i,a,s,o=r.value;""!==o&&(a=(i=MJS.Namespace("Core").import("Format").xhrDecode(o))[i.length-1],i.unshift("Classes"),i.pop(),s=MJS.Namespace(i.join("\\")).importInstance(a),t&&"function"==typeof s.__call)&&s.__call()}}catch(e){n.e(e)}finally{n.f()}}},MJS.Namespace("Core").export("Format",(()=>_createClass(function e(){_classCallCheck(this,e)},null,[{key:"randomString",value:function(e){void 0!==e&&0!==e||(e=10);e=new Uint8Array((e||40)/2);return window.crypto.getRandomValues(e),Array.from(e,function(e){return("0"+e.toString(16)).substr(-2)}).join("")}},{key:"randomPassword",value:function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10,i="",t=0,r=49;t<e;++t)i+="abcdefghjkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ".charAt(Math.floor(Math.random()*r));for(t=0,r=9;t<e;++t)i+="123456789".charAt(Math.floor(Math.random()*r));for(t=0,r=17;t<e;++t)i+="!#$&*+-.=?@_~[]()".charAt(Math.floor(Math.random()*r));return(()=>{for(var e=i.split(""),t=e.length-1;0<t;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e.join("")})().substring(0,e)}},{key:"ucfirst",value:function(e){return e.charAt(0).toUpperCase()+e.slice(1)}},{key:"xhrEncode",value:function(e,t){if(t=t||1,e&&null!=e)for(var r=0;r<t;r++)e=encodeURIComponent(JSON.stringify(e).base64Encode());return e}},{key:"xhrDecode",value:function(e,t){if(t=t||1,e&&null!=e)for(var r=0;r<t;r++)e=JSON.parse(decodeURIComponent(e).base64Decode());return e}},{key:"urlEncode",value:function(e){return e=(e=(e=(e=e.trim()).toLowerCase()).replace(/[&\\#,+()|\[\]$~%^@.'"`:;*?<>!{}]/g,"-")).split(" ").join("-"),encodeURI(e)}},{key:"databaseEncode",value:function(e){return e=(e=(e=(e=e.trim()).toLowerCase()).replace(/[&\\\/#,+\-()|\[\]$~%^@=.'"`:;*?<>!{}]/g,"_")).split(" ").join("_"),encodeURI(e)}},{key:"priceFormat",value:function(e,t,r,n,i){if(null==e)return null;r=r||3,t=t||0,i=i||"";var a,s=null;return((e=(e=String(e)).replace(/[a-zA-Z]/g,"")).includes(".")||e.includes(","))&&(s=(a=e.replace(/[0-9]|\s/g,"")).substr(a.length-1)),e=(e=(e=e.replace(new RegExp("\\"+(s||n),"g"),"DECIMAL")).replace(/\,|\.|\s/g,"")).replace(/DECIMAL/g,"."),isNaN(e)?null:(a="\\d(?=(\\d{"+r+"})+"+(0<t?"\\D":"$")+")",s=Number(e).toFixed(Math.max(0,~~t)),(n?s.replace(".",n):s).replace(new RegExp(a,"g"),"$&"+i))}},{key:"dateFormat",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"d-m-Y H:i:s",r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],n={d:2,m:2,Y:4,H:2,i:2,s:2},i={d:31,m:12,Y:9999,H:23,i:59,s:59},a=["-","/",":"," "],s=t.split(new RegExp(a.join("|"),"gi"));if(void 0!==r&&!0===r){var o,l=[],c=_createForOfIteratorHelper(s);try{for(c.s();!(o=c.n()).done;){var u=o.value;isNaN(u)?l.push(u.repeat(n[u])):l.push(u)}}catch(e){c.e(e)}finally{c.f()}return l.join("-")}if(!e)return e;for(var h=t.match(/\W/g)[0],_=e.slice(e.length-1),p=0,d=a;p<d.length;p++)e=e.replace(new RegExp(d[p],"gi"),"");var f,v,g=0,y={},m=0,b=_createForOfIteratorHelper(s);try{for(b.s();!(v=b.n()).done;){var N,w=v.value,S=n[w];y[m]={},f=S+g,y[m].value=e.substring(g,f),y[m].delimiter=h,y[m].length=S,y[m].filled=S===y[m].value.length,y[m].last=parseInt(m)+1===s.length,y[m].format_part=w,parseInt(y[m].value)>i[w]&&(y[m].value=String(i[w])),g=f,"H"===w&&(y[N=parseInt(m)-1]&&(""!==y[N].value&&!0===y[N].filled&&(y[N].value=y[N].value+" "),y[N].delimiter=""),y[m].delimiter=":"),m++}}catch(e){b.e(e)}finally{b.f()}for(var M="",P=0,k=Object.entries(y);P<k.length;P++){var E=_slicedToArray(k[P],2),I=(E[0],E[1]);if(""!==I.value){if(!1===I.filled&&-1!==a.indexOf(_))switch(I.format_part){case"d":case"m":case"H":case"i":I.value="0"+I.value,I.filled=!0}M+=I.value+(!1===I.last&&I.length===I.value.trim().length?I.delimiter:"")}}return M}},{key:"shortenString",value:function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;return e.length<t||(e=e.substring(0,t),empty(r))||(e+=r),e}}]))()),{}),_MustacheAPI=(()=>{return _createClass(function e(t,r,n,i){var a;if(_classCallCheck(this,e),!Array.isArray(t))return a=r||t,null!==r&&!0===_MustacheAPI.use_cache&&CacheAPI.exists(a)?(void 0!==i&&i(),CacheAPI.get(a)):null===r||!1!==_MustacheAPI.use_cache||empty(templates[a])?new(MJS.Namespace("Core").import("Fetch"))([_MustacheAPI.path],{body:{template:t+".mustache"}}).then(function(e){if(null==e)return!1;CacheAPI.put(a,e),templates[a]=e,null!=n&&n(e)}):(void 0!==i&&i(),templates[a]);this.loadGroup(t,n,i)},[{key:"loadGroup",value:function(n,r,e){__(n).foreach(function(e,t){n[e][0]+=".mustache";var r=t[1]||t[0];(null!==t[1]&&!0===_MustacheAPI.use_cache&&CacheAPI.exists(r)||null!==t[1]&&!1===_MustacheAPI.use_cache&&!empty(templates[r]))&&delete n[e]}),Object.values(n).length||null==r?new _XHR(_MustacheAPI.path,"load_group").setData({templates:n}).on("success",function(e,t){if(empty(e))return!1;__(MJS.Namespace("Core").import("Format").xhrDecode(e)).foreach(function(e,t){var r=t.cache_key||t.name;CacheAPI.put(r,t.template),templates[r]=t.template}),null!=r&&r()}).execute():void 0!==e&&e()}}],[{key:"render",value:function(e,t,r){if(!empty(e)&&(e=!0===_MustacheAPI.use_cache?CacheAPI.get(e):templates[e],!empty(e)))return r=r||"nl",(t=t||{}).__lang=function(){return function(e,t){return _Framework.__lang(t(e),r)}},t.__verify=function(){return function(e,t){return t(e.replace(/\((.*?)\)/i,""))}},Mustache.render(e,t)}},{key:"load",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,r,n){var i,a,s;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:i=this,a=t.length,s=0,this.mustache_batch=[],__(t).foreach(function(e,t){i.mustache_batch.push(t[1])}),!0===_MustacheAPI.group_batch?new _MustacheAPI(t,null,function(){return r?r():null},n):__(t).foreach(function(e,t){new _MustacheAPI(t[0],t[1],function(){if(++s===a)return r?r():null},n)});case 3:case"end":return e.stop()}},e,this)})),function(e,t,r){return n.apply(this,arguments)})},{key:"loaded",value:function(){var r;return!empty(this.mustache_batch)&&(r=!0,__(this.mustache_batch).foreach(function(e,t){(!0===_MustacheAPI.use_cache&&empty(CacheAPI.get(t))||!1===_MustacheAPI.use_cache&&empty(templates[t]))&&(r=!1)}),r)}},{key:"isLoaded",value:function(e){var t=!0;return t=!0===_MustacheAPI.use_cache&&empty(CacheAPI.get(e))||!1===_MustacheAPI.use_cache&&empty(templates[e])?!1:t}}]);var n})(),CacheAPI=(_MustacheAPI.use_cache=!1,_MustacheAPI.group_batch=!1,_MustacheAPI.path="json\\models\\mustache",MJS.Namespace("Core").export("MustacheOld",_MustacheAPI),MJS.Namespace("Core").export("Templates",(_defineProperty(_Class=(()=>{return _createClass(function e(){_classCallCheck(this,e)},null,[{key:"loadTemplate",value:(r=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,r=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=0<r.length&&void 0!==r[0]?r[0]:"",t=this.createTemplatePath(t),e.t0=this.FilesMap.has(t),e.t0){e.next=6;break}return e.next=6,this.fetchTemplates([t]);case 6:return e.abrupt("return",this.FilesMap.get(t));case 7:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"loadTemplates",value:(t=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,r,n,i,a,s,o,l,c,u,h,_=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=0<_.length&&void 0!==_[0]?_[0]:[],r=new Map,t.length){e.next=4;break}return e.abrupt("return",r);case 4:n=[],i=0,a=_createForOfIteratorHelper(t);try{for(a.s();!(s=a.n()).done;)o=s.value,o=t[i++]=this.createTemplatePath(o),this.FilesMap.has(o)||n.push(o)}catch(e){a.e(e)}finally{a.f()}return e.next=10,this.fetchTemplates(n);case 10:l=_createForOfIteratorHelper(t);try{for(l.s();!(c=l.n()).done;)h=/[^/]*$/.exec(u=c.value)[0].split(".")[0],r.set(h,this.FilesMap.get(u))}catch(e){l.e(e)}finally{l.f()}return e.abrupt("return",r);case 13:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"render",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"nl";if(!e.template)return"";switch(!0){case"undefined"!=typeof Mustache&&new String(e.path).includes(".mustache"):return t.__lang=function(){return function(e,t){return _Framework.__lang(t(e),r)}},t.__verify=function(){return function(e,t){return t(e.replace(/\((.*?)\)/i,""))}},Mustache.render(e.template,t);case"undefined"!=typeof Twig&&new String(e.path).includes(".twig"):return Twig.twig({data:e.template}).render(t);default:return e.template}}},{key:"setBasePath",value:function(){return this.base_path=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",this}},{key:"createTemplatePath",value:function(){return this.base_path+(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"")}},{key:"fetchTemplates",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var r,n,t,i,a,s,o,l,c,u,h=this,_=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=0<_.length&&void 0!==_[0]?_[0]:[],n=[],!this.use_cache){e.next=10;break}t=_regeneratorRuntime().mark(function e(t){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:window.sessionStorage.getItem(r[t])&&(n.push(JSON.parse(window.sessionStorage.getItem(r[t]))),r=r.filter(function(e){return e!==r[t]}));case 1:case"end":return e.stop()}},e)}),e.t0=_regeneratorRuntime().keys(r);case 5:if((e.t1=e.t0()).done){e.next=10;break}return i=e.t1.value,e.delegateYield(t(i),"t2",8);case 8:e.next=5;break;case 10:if(r.length)return e.next=13,new(MJS.Namespace("Core").import("Fetch"))([this.model_path,this.model_method],{body:{template_strings:r}}).then(function(e){return e});e.next=16;break;case 13:i=e.sent,a=_createForOfIteratorHelper(i);try{for(a.s();!(s=a.n()).done;)o=s.value,n.push(o)}catch(e){a.e(e)}finally{a.f()}case 16:l=_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=u[c],h.FilesMap.set(t.path,{path:t.path,render:function(){return h.render(t,0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},1<arguments.length&&void 0!==arguments[1]?arguments[1]:"")}}),h.use_cache&&window.sessionStorage.setItem(t.path,JSON.stringify(t));case 2:case"end":return e.stop()}},e)}),c=0,u=n;case 18:if(c<u.length)return e.delegateYield(l(),"t3",20);e.next=23;break;case 20:c++,e.next=18;break;case 23:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t,r})(),"model_path","classes\\json\\models\\templates"),_defineProperty(_Class,"model_method","load_templates"),_defineProperty(_Class,"base_path",""),_defineProperty(_Class,"FilesMap",new Map),_defineProperty(_Class,"use_cache",!0),_Class)),MJS.Namespace("Core").export("Utils",(_defineProperty(_t16=(()=>{function c(){_classCallCheck(this,c)}return _createClass(c,null,[{key:"setup",value:function(){var s=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=MJS.Namespace.Class.NamespaceStructure.Utils;if(Object.keys(e).length)for(var o=0,l=Object.entries(e);o<l.length;o++)(()=>{var e=_slicedToArray(l[o],2),i=e[0];if("pointer"===i)return;if((e=c.getUtil(i))&&(e.configuration&&e.configuration.global&&(window[i]=e),__Instance.prototype[i]=function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=null;return this.foreach(function(e,t){new MJS.Node(t).Utils.get(i)||(n=c.runUtil(i,t,r))}),n},e)&&e.configuration&&e.configuration.identifiers&&e.configuration.autorun){var t,r=_createForOfIteratorHelper(e.configuration.identifiers);try{for(r.s();!(t=r.n()).done;){var n=t.value,a=s?new MJS.Node(s).childNodes(n):MJS.Node.getNodes(n);a.length&&a.foreach(function(e){c.runUtil(i,e)})}}catch(e){r.e(e)}finally{r.f()}}})()}},{key:"setUtil",value:function(){var i=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;MJS.Namespace("Utils").export(i,e),e.configuration&&e.configuration.global&&(window[i]=e),__Instance.prototype[i]=function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},n=null;return this.foreach(function(e,t){new MJS.Node(t).Utils.get(i)||(n=c.runUtil(i,t,r))}),n}}},{key:"getUtil",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return MJS.Namespace("Utils").import(e)||null}},{key:"getUtils",value:function(){var e={},t=MJS.Namespace.Class.NamespaceStructure.Utils;if(Object.keys(t).length){for(var r=0,n=Object.entries(t);r<n.length;r++){var i,a=_slicedToArray(n[r],2),a=a[0];"pointer"!==a&&(i=c.getUtil(a))&&(e[a]=i)}return e}}},{key:"runUtil",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(e&&t){var n,t=new MJS.Node(t),i=c.getUtil(e);if(i)return(r=Object.assign(r,i.configuration.args||{})).name=t.Attributes.get(i.configuration.name_identifier||null)||t.Attributes.get("data-util-name")||i.configuration.name||null,"function"==typeof i.configuration.init&&i.configuration.init(__(t),r,i),(n=new i(__(t),r)).ID=r.name||i.configuration.name||MJS.Namespace("Core").import("Format").randomString(10),n.config=i.configuration.config||{},n.namespace_path="Utils\\"+e+"\\"+n.ID,MJS.Namespace.Class.initInstance(n),!1!==i.configuration.save&&t.Utils.save(n,e),MJS.Namespace("Utils\\"+e+"\\"+n.ID).exportInstance(n),n}}}])})(),"UtilsMap",new Map),_t16)),MJS.Namespace("Core").export("Fetch",(_t18=(()=>{function a(e){var i=this,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t=(_classCallCheck(this,a),_defineProperty(this,"execution_time",{start:0,end:0}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.args=t||{},this.identifier=this.Format.randomString(5),this.uri=window.location.origin+"/"+_XHR.hash,(t=this.args).mode||(t.mode=null),(t=this.args).headers||(t.headers={}),(t=this.args).method||(t.method="POST"),(t=this.args).body||(t.body={}),(t=this.args).query||(t.query={}),(t=this.args).response_type||(t.response_type="text"),this.target={path:e[0]||"",function:e[1]||"",template:this.args.template||null},this.fetch=null,this.promise=null,this.abort_controller=new AbortController,"string"==typeof e?this.uri=e:Array.isArray(e)&&(this.args.headers.XHR=this.Format.xhrEncode({path:e[0]||"",function:e[1]||"",template:this.args.template||null},_XHR.encoding_count),this.args.body=this.args.body instanceof FormData?this.args.body:this.Format.xhrEncode(this.args.body)),"GET"!==this.args.method&&"HEAD"!==this.args.method||(this.args.body=null),{signal:this.abort_controller.signal});this.args.method&&(t.method=this.args.method),this.args.headers&&(t.headers=this.args.headers),this.args.body&&(t.body=this.args.body),this.args.mode&&(t.mode=this.args.mode),this.fetch=fetch(this.uri+(this.args.query?"?"+new URLSearchParams(this.args.query):""),t),this.promise=this.fetch.then(function(e){a.timer_queue[i.identifier].end=performance.now(),a.timer_queue[i.identifier].duration=a.timer_queue[i.identifier].end-a.timer_queue[i.identifier].start;var t,r,n=0;if(1<a.timer_identifiers.length?(t=a.timer_identifiers.indexOf(i.identifier),n=(r=a.timer_identifiers[t-1]||null)?a.timer_queue[i.identifier].duration-a.timer_queue[r].duration:a.timer_queue[i.identifier].duration,a.timer_identifiers.splice(t-1,1)):(n=a.timer_queue[i.identifier].duration,a.timer_identifiers=[]),i.execution_time.duration=n,!e.ok)throw new Error("FETCH("+i.uri+") failed");switch(i.response_headers=e.headers,i.args.response_type){default:case"text":return e.text();case"blob":return e.blob();case"arrayBuffer":return e.arrayBuffer();case"json":return e.json();case"clone":return e.clone()}})}return _createClass(a,[{key:"then",value:(t=_asyncToGenerator(_regeneratorRuntime().mark(function e(r){var n=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(a.timer_identifiers.push(this.identifier),a.timer_queue[this.identifier]={start:performance.now(),end:null,duration:0},this.promise.then(function(t){var e=n.response_headers.get("Content-Type").split(";")[0];if(n.args.headers.XHR&&"text"===n.args.response_type&&e&&a.content_types.includes(e))try{t=n.Format.xhrDecode(t)}catch(e){throw n.Events.run(a,"error",n),console.error({method:n.args.method,mode:n.args.mode,request:n.Format.xhrDecode(n.args.headers.XHR),request_body:n.args.body,response:t,_fetch:n}),new Error("Fetch failed to decode the XHR response. See error log above.")}return n.Events.run(a,"success",n),r?r(t,n.response_headers):t})));case 1:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"abort",value:function(){console.log("Aborted!"),this.abort_controller.abort()}}]);var t})(),_defineProperty(_t18,"content_types",["text/html","application/json"]),_defineProperty(_t18,"timer_identifiers",[]),_defineProperty(_t18,"timer_queue",{}),_t18)),MJS.Namespace("Core").export("Events",(_defineProperty(_t19=(()=>{function s(){_classCallCheck(this,s)}return _createClass(s,null,[{key:"set",value:function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Function,a=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};if(n)return(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=new String(e).split(":"),r=s.EventMap.get(n)||{};r[e]={trigger:null!=(e=t[0])?e:"",method:function(e,t){return i(e,t)},options:a},s.EventMap.set(n,r)}),this}},{key:"remove",value:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];if(r)return(e=Array.isArray(e)?e:[e]).forEach(function(e){var t;s.EventMap.has(r)&&(t=s.EventMap.get(r)||{})[e]&&(t[e]=null,delete t[e],s.EventMap.set(r,t))}),this}},{key:"clear",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;e&&s.EventMap.has(e)&&s.EventMap.delete(e)}},{key:"run",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(e){if(s.EventMap.has(e)){var n=s.EventMap.get(e)||{};if(!n[t])return this;n[t].method(e,r)}return this}}},{key:"setGlobal",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Function,a=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};(e=Array.isArray(e)?e:[e]).forEach(function(e){var t,r=new String(e).split(":"),n=((n=s.events)[t=r[0]]||(n[t]={}),(r[1]?e:null)||a.identifier||MJS.Namespace("Core").import("Format").randomString());s.events[r[0]][n]={callback:i,target:a.target,target_selector:a.target_selector,parent_selector:a.parent_selector}})}},{key:"removeGlobal",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];(e=Array.isArray(e)?e:[e]).forEach(function(e){var t=new String(e).split(":"),e=(t[1]?e:null)||args.identifier||null;e&&s.events[t[0]]&&(s.events[t[0]][e]=null,delete s.events[t[0]][e])})}},{key:"create",value:function(){var e,t=_createForOfIteratorHelper(s.triggers=["mousemove","mouseup","mousedown","click","dblclick","mouseout","scroll","keyup","keydown"]);try{for(t.s();!(e=t.n()).done;)(()=>{var i=e.value;document.addEventListener(i,function(e){if(s.events[i]&&Object.keys(s.events[i]).length)for(var t=0,r=Object.entries(s.events[i]);t<r.length;t++){var n=_slicedToArray(r[t],2),n=(n[0],n[1]);n.target&&n.target!==e.target||n.target_selector&&!1===e.target.matches(n.target_selector)||n.parent_selector&&!e.target.closest(n.parent_selector)||n.callback(e)}})})()}catch(e){t.e(e)}finally{t.f()}}}])})(),"EventMap",new WeakMap),_defineProperty(_t19,"events",{}),_defineProperty(_t19,"triggers",{}),_t19)),MJS.Namespace("Core").export("Proxy",MJS.Proxy=(_defineProperty(_t21=(()=>{function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"track",value:function(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,e=(null!=r||(r={get:function(e,t){return"object"==_typeof(e[t])&&null!==e[t]?new Proxy(e[t],r):Reflect.get(e,t)},set:function(e,t,r){return n.updateInputs(t,r,!0),n.updateElements(t,r),Reflect.set(e,t,r)}}),new Proxy(e,r));return n.proxy_objects.push(e),e}},{key:"updateInputs",value:function(e,r,n){e=MJS.Node.getNodes('input[mjs-proxy="'.concat(e,'"],select[mjs-proxy="').concat(e,'"],textarea[mjs-proxy="').concat(e,'"]'));e.length&&e.foreach((()=>{var t=_asyncToGenerator(_regeneratorRuntime().mark(function e(t){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.Properties.set("pause_events",n),t.Properties.set("value",r),!0===t.Utils.has("Select"))return e.next=3,t.Utils.get("Select").selectOption(r);e.next=3;break;case 3:t.Properties.remove("pause_events");case 4:case"end":return e.stop()}},e)}));return function(e){return t.apply(this,arguments)}})())}},{key:"updateElements",value:function(e,t){e=MJS.Node.getNodes('[mjs-proxy="'.concat(e,'"]:not(input,select,textarea)'));e.length&&e.foreach(function(e){return e.setText(t)})}}])})(),"proxy_objects",[]),_t21)),MJS.Namespace("Utils").export("Proxy",(_defineProperty(_Class2=(()=>{return _createClass(function e(t,r){_classCallCheck(this,e),this.node=new MJS.Node(t),this.args=r||{}},[{key:"__init",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var r=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.node.exists()&&this.node.Events.set(["change","keyup","keydown","blur"],function(){delay(_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r.node.Properties.get("pause_events"))return e.abrupt("return");e.next=2;break;case 2:if(t=r.node.Properties.get("value"),!0===r.node.Utils.has("Select"))return e.next=6,r.node.Utils.get("Select").getOptionLabel(t);e.next=7;break;case 6:t=e.sent;case 7:MJS.Proxy.updateElements(r.node.Attributes.get("mjs-proxy"),t,r.node);case 8:case"end":return e.stop()}},e)})),5,r.ID)});case 1:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e})(),"configuration",{identifiers:["input[mjs-proxy],select[mjs-proxy],textarea[mjs-proxy]"],args:{},autorun:!0,global:!1,save:!1}),_Class2)),MJS.Namespace("Core").export("Functions",(_defineProperty(_t27=_createClass(function e(){_classCallCheck(this,e)}),"createNode",function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstChild}),_defineProperty(_t27,"createNodes",function(e){var t=document.createElement("div");return t.innerHTML=e,t.children}),_defineProperty(_t27,"isNode",function(e){return e&&e.nodeType===Node.ELEMENT_NODE}),_defineProperty(_t27,"empty",function(e){return null==e||""===e||0===e||"0"===e||!1===e||!(void 0===e.target&&!Array.prototype.isPrototypeOf(e.target)||!(null===e.target||e.target.length<1))||e.length<1||e.constructor===Object&&0===Object.keys(e).length}),_defineProperty(_t27,"getParams",function(e){for(var t=e.replace("?","").split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");null!=i[1]&&null!=i[1]&&(r[i[0]]=i[1])}return r}),_defineProperty(_t27,"getParamsAsArray",function(e){return _t27.empty(e)||(e=new URL(e),e=new URLSearchParams(e.search),e=Object.fromEntries(e.entries()),_t27.empty(e))?[]:e}),_defineProperty(_t27,"getURLKey",function(e){for(var t=window.location.search.substring(1).split("&"),r={},n=0;n<t.length;n++){var i=t[n].split("=");r[i[0]]=i[1],n++}return r[e]}),_defineProperty(_t27,"setURLKey",function(e,t){var r=new URL(window.location);_t27.empty(t)?r.searchParams.delete(e):r.searchParams.set(e,t),history.pushState(null,null,r.toString())}),_defineProperty(_t27,"buildQuery",function(e){var t,r="";for(t in e)if(""!=r&&(r+="&"),Array.isArray(e[t]))for(var n=0;n<e[t].length;n++)r+=t+"[]="+encodeURIComponent(e[t][n]);else r+=t+"="+encodeURIComponent(e[t]);return r}),_defineProperty(_t27,"timers",{}),_defineProperty(_t27,"delay",function(e,t,r){return r=r||MJS.Namespace("Core").import("Format").randomString(),_t27.timers[r]=_t27.timers[r]||null,clearTimeout(_t27.timers[r]),_t27.timers[r]=setTimeout(e,t)}),_defineProperty(_t27,"is_visible",function(e){e=e.getBoundingClientRect();return 0<=e.top&&e.bottom<=window.innerHeight}),_defineProperty(_t27,"replaceAll",function(e,t){var r=new RegExp(Object.keys(t).join("|"),"gi");return e.replace(r,function(e){return t[e.toLowerCase()]})}),_defineProperty(_t27,"ObjectFromEntries",function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];if(Object(n)!==n)throw new TypeError("iterable for fromEntries should yield objects");var i=n[0],n=n[1];Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:n}),r++}return t}),_defineProperty(_t27,"assignID",function(e){return MJS.Namespace("Core").import("Format").randomString(parseInt(e)||10)}),_defineProperty(_t27,"getMouseX",function(e,t){var r=document.documentElement,n=document.body,e=e.clientX+(r&&r.scrollLeft||n&&n.scrollLeft||0)-(r&&r.clientLeft||n&&n.clientLeft||0);return _t27.empty(t)||(e-=t.getBoundingClientRect().left),e}),_defineProperty(_t27,"getMouseY",function(e,t){var r=document.documentElement,n=document.body,e=e.clientY+(r&&r.scrollTop||n&&n.scrollTop||0)-(r&&r.clientTop||n&&n.clientTop||0);return _t27.empty(t)||(e-=t.getBoundingClientRect().top),e}),_defineProperty(_t27,"getX",function(e,t,r){var n=(_t27.empty(r)?document:r).documentElement,r=(_t27.empty(r)?document:r).body,e=e+(n&&n.scrollLeft||r&&r.scrollLeft||0)-(n&&n.clientLeft||r&&r.clientLeft||0);return _t27.empty(t)||(e-=t.getBoundingClientRect().left),e}),_defineProperty(_t27,"getY",function(e,t,r){var n=(_t27.empty(r)?document:r).documentElement,r=(_t27.empty(r)?document:r).body,e=e+(n&&n.scrollTop||r&&r.scrollTop||0)-(n&&n.clientTop||r&&r.clientTop||0);return _t27.empty(t)||(e-=t.getBoundingClientRect().top),e}),_t27)),String.prototype.substrSplit=function(e,t){var r=(r=this.split(e)).filter(Boolean);if(null==t)return r;switch(t){case"first":return r[0];case"last":return r.pop()}return isNaN(t)?this.value:r[t]},String.prototype.base64Encode=function(){return btoa(encodeURIComponent(this).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))},String.prototype.base64Decode=function(){return decodeURIComponent(atob(this).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))},{put:function(e,t){return sessionStorage.setItem(e,JSON.stringify(t).base64Encode())},get:function(e){e=sessionStorage.getItem(e);return empty(e)?null:JSON.parse(e.base64Decode())},exists:function(e){return!empty(sessionStorage.getItem(e))},delete:function(e){return sessionStorage.removeItem(e)},clear:function(){return sessionStorage.clear()}}),_XHR=(MJS.Namespace("Core").export("Cache",CacheAPI),function(e,t){return this.Format=MJS.Namespace("Core").import("Format"),this.Functions=MJS.Namespace("Core").import("Functions"),this.core=!1,this.method="POST",this.url="",this.path=e,this.function=t,this.template="",this.response,this.status,this.headers=[],this.callbacks={},!0===_XHR.force_cancel&&!1===_XHR.force_cancel_event_created&&_XHR.force_cancel_event_created,this}),nodeTest=(_XHR.prototype.on=function(e,t){return this.callbacks[e]=t,this},_XHR.prototype.callback=function(e){if(void 0!==this.callbacks&&void 0!==this.callbacks[e])return this.callbacks[e](this.response,this.status,this.request)},_XHR.prototype.setRequest=function(){if(this.Functions.empty(this.url)&&this.Functions.empty(_XHR.hash)&&console.warn("XHR - No hash given! Unable to make requests to system."),this.request=new XMLHttpRequest,this.request.open(this.method,(void 0!==this.url&&""!==this.url?this.url:window.location.origin+(this.Functions.empty(_XHR.hash)?"":"/"+_XHR.hash))+(void 0!==this.query_data?"?"+this.query_data:"")),void 0!==this.response_type&&(this.request.responseType=this.response_type),this.request.setRequestHeader("XHR",this.Format.xhrEncode({path:this.path,function:this.function,core:this.core,template:this.template},_XHR.encoding_count)),0<this.headers.length)for(var e=0;e<this.headers.length;++e){var t=this.headers[e];this.request.setRequestHeader(t.key,t.value)}!0===_XHR.debug&&console.info(this)},_XHR.prototype.execute=_XHR.prototype.run=function(e){var t=this;if(this.core=e||!1,this.setRequest(),1===this.request.readyState||4===this.request.readyState)return(e=null)!=t.data&&(e=!(t.data instanceof FormData)&&!1!==t.use_format?this.Format.xhrEncode(t.data):t.data),this.request.send(e),this.request.onprogress=function(e){t.Functions.empty(t.callbacks.progress)||setInterval(function(){t.callback("progress")},5e3)},this.request.onreadystatechange=function(){3===t.request.readyState&&void 0!==t.onProgress&&t.onProgress(status),4===t.request.readyState&&(200===t.request.status?(t.response=t.request.response,t.status=t.request.status,t.callback("success")):(t.response=t.request.response,t.status=t.request.status,t.callback("error")))},this},_XHR.prototype.cancel=function(){return this.request.abort()},_XHR.prototype.setUrl=function(e){return this.url=e,this},_XHR.prototype.setHost=function(e){return this.xhr_host=e,this},_XHR.prototype.setData=function(e,t){return this.data=e,this.use_format=t,this},_XHR.prototype.setQuery=function(t){var r;return"string"==typeof t?this.query_data=t:(r=encodeURIComponent,this.query_data=Object.keys(t).map(function(e){return r(e)+"="+r(t[e])}).join("&")),this},_XHR.prototype.setMethod=function(e){return this.method=e,this},_XHR.prototype.setTemplate=function(e){return this.template=e||"",this},_XHR.prototype.addHeader=function(e,t){return this.headers.push({key:e,value:t}),this},_XHR.prototype.setResponseType=function(e){return this.response_type=e,this},_XHR.processResponse=function(r,e){var n=this;if(this.Functions=MJS.Namespace("Core").import("Functions"),this.Functions.empty(r))return!1;if(!this.Functions.empty(e)){var t,i,a=e.get("Content-Type").split(";")[0];if(!this.Functions.empty(a)&&!_XHR.content_types.includes(a))return a=new Blob([r],{type:a}),a=window.URL.createObjectURL(a),t=document.createElement("a"),e=e.get("Content-Disposition"),i="unknown-file",null!==(e=/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(e))&&e[1]&&(i=e[1].replace(/['"]/g,"")),t.href=a,t.download=i,document.body.appendChild(t),t.click(),void document.body.removeChild(t)}if(this.Functions.empty(r.sockets)||"undefined"==typeof WSM||__(r.sockets).foreach(function(e,t){var r=t.class,n=t.function,i=t.receivers,a=r.split("\\"),s=a.pop();setTimeout(function(){(new WSM).setReceivers(i||[]).setCallback([s,a.join("\\")],n).execute()},75)}),this.Functions.empty(r.notices)||__(r.notices).foreach(function(e,t){_Framework.Alerts.set(t.message,t.type,!n.Functions.empty(r.redirect))}),this.Functions.empty(r.javascript)||__(r.javascript).foreach(function(e,t){var r=t[0].split("\\"),n=r.pop(),i=t[1],t=t[2]||null;if(Array.isArray(r)){var r=r.join("\\"),a=MJS.Namespace(r).import(n);if(null!=a&&void 0!==a[i])return a[i](t);a=MJS.Namespace(r).importInstance(n);if(a)return a[i](t)}if(void 0!==window[n]&&void 0!==window[n][i])return window[n][i](t)}),!this.Functions.empty(r.redirect)){if(1==r.redirect)return location.reload();window.location.href=r.redirect}},_XHR.debug=!1,_XHR.force_cancel=!1,_XHR.force_cancel_event_created=!1,_XHR.hash="",_XHR.encoding_count=4,_XHR.instances=[],_XHR.content_types=["text/html","application/json"],MJS.Namespace("Core").export("XHR",_XHR),MJS.Namespace("Core\\Node").export("NodeList",MJS.NodeList=(_t31=new WeakMap,(()=>_createClass(function e(){var t=this,r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:NodeList;_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_t31,[]),_defineProperty(this,"length",0),this.length=parseInt(r.length),r.forEach(function(e){_classPrivateFieldGet(_t31,t).push(MJS.Node.NodeMap.has(e)?MJS.Node.NodeMap.get(e):new MJS.Node(e))})},[{key:"childNodes",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=[];return _classPrivateFieldGet(_t31,this).forEach(function(e){r.push.apply(r,_toConsumableArray(e.childNodes(t)))}),new this(new Set(r))}},{key:"firstNode",value:function(){return _classPrivateFieldGet(_t31,this)[0]}},{key:"lastNode",value:function(){return _classPrivateFieldGet(_t31,this)[this.length-1]}},{key:"clear",value:function(){return _classPrivateFieldGet(_t31,this).forEach(function(e){e.clear()}),this}},{key:"remove",value:function(){return _classPrivateFieldGet(_t31,this).forEach(function(e){e.remove()}),_classPrivateFieldSet(_t31,this,null)}},{key:"foreach",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Function,r=[];for(e in _classPrivateFieldGet(_t31,this))r.push(t(_classPrivateFieldGet(_t31,this)[e],e));return r.length?r:null}},{key:"setUtils",value:function(){var e=MJS.Namespace("Core").import("Utils").getUtils();e&&_classPrivateFieldGet(_t31,this).forEach(function(s){for(var o=0,l=Object.entries(e);o<l.length;o++)(()=>{var e=_slicedToArray(l[o],2),r=e[0];if((e=e[1]).configuration&&e.configuration.identifiers){var t,n=_createForOfIteratorHelper(e.configuration.identifiers);try{for(n.s();!(t=n.n()).done;){var i=t.value,a=s.childNodes(i);a.length&&a.foreach(function(e,t){MJS.Namespace("Core").import("Utils").runUtil(r,t)})}}catch(e){n.e(e)}finally{n.f()}}})()})}}]))())),MJS.Namespace("Core\\Node").export("Attributes",(_e14=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e14,null),_classPrivateFieldSet(_e14,this,t)},[{key:"get",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_e14,this).getElement().getAttribute(e)}},{key:"set",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(!Object.prototype.isPrototypeOf(e))return _classPrivateFieldGet(_e14,this).getElement().setAttribute(e,t),this;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=_slicedToArray(n[r],2),a=i[0];this.set(a,i[1])}}},{key:"remove",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(!Array.isArray(e))return _classPrivateFieldGet(_e14,this).getElement().removeAttribute(e),this;var t,r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.remove(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"has",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_e14,this).getElement().hasAttribute(e)}},{key:"foreach",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Function,r=_createForOfIteratorHelper(_classPrivateFieldGet(_e14,this).getElement().attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;t(n.name,n.value)}}catch(e){r.e(e)}finally{r.f()}return this}}]))())),MJS.Namespace("Core\\Node").export("Classes",(_e18=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e18,null),_classPrivateFieldSet(_e18,this,t)},[{key:"set",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return(e=_classPrivateFieldGet(_e18,this).getElement().classList).add.apply(e,_toConsumableArray(Array.isArray(t)?t.filter(function(e){return e}):[t])),this}},{key:"remove",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return(e=_classPrivateFieldGet(_e18,this).getElement().classList).remove.apply(e,_toConsumableArray(Array.isArray(t)?t:[t])),this}},{key:"has",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_e18,this).getElement().classList.contains(e)}},{key:"toggle",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_e18,this).getElement().classList.toggle(e),this}},{key:"replace",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";return _classPrivateFieldGet(_e18,this).getElement().classList.replace(e,t),this}},{key:"foreach",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Function;return _classPrivateFieldGet(_e18,this).getElement().classList.forEach(function(e){t(e)}),this}}]))())),MJS.Namespace("Core\\Node").export("Events",(_e19=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e19,null),_defineProperty(this,"EventMap",new Map),_defineProperty(this,"EventTimersMap",new Map),_classPrivateFieldSet(_e19,this,t)},[{key:"set",value:function(){var i=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Function,s=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return(e=Array.isArray(e)?e:[e]).forEach(function(e){function t(e){if(n[2]&&!isNaN(n[2]))return clearTimeout(i.EventTimersMap.get(r)),i.EventTimersMap.set(r,setTimeout(function(){return a(_classPrivateFieldGet(_e19,i),e)},parseInt(n[2])));a(_classPrivateFieldGet(_e19,i),e)}var r=e,n=new String(e).split(":");n[1]||(n[1]=MJS.Namespace("Core").import("Format").randomString(5)),_classPrivateFieldGet(_e19,i).getElement().addEventListener(null!=(e=n[0])?e:"",t,s),i.EventMap.set(n[0]+(n[1]?":".concat(n[1]):""),{trigger:null!=(e=n[0])?e:"",method:t,options:s})}),this}},{key:"remove",value:function(){var n=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return(e=Array.isArray(e)?e:[e]).forEach(function(r){var e;if(-1===r.search(":")||n.EventMap.has(r))return-1===r.search(":")?(n.EventMap.forEach(function(e,t){-1!==t.search(r)&&n.remove(t)}),n):(e=n.EventMap.get(r),_classPrivateFieldGet(_e19,n).getElement().removeEventListener(e.trigger,e.method,e.options),n.EventMap.delete(r),void n.EventTimersMap.delete(r))}),this}},{key:"clear",value:function(){var r=this;this.EventMap.forEach(function(e,t){_classPrivateFieldGet(_e19,r).getElement().removeEventListener(e.trigger,e.method,e.options),r.EventMap.delete(t),r.EventTimersMap.delete(e)})}},{key:"run",value:function(){var n=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return(e=Array.isArray(e)?e:[e]).forEach(function(r){if(-1===r.search(":")||n.EventMap.has(r))return-1===r.search(":")?(n.EventMap.forEach(function(e,t){-1!==t.search(r)&&n.run(t)}),n):void(n.EventMap.has(r)&&n.EventMap.get(r).method({}))}),this}},{key:"has",value:function(){var r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n=!1;return this.EventMap.forEach(function(e,t){n||-1===t.search(r)||(n=!0)}),n}}]))())),MJS.Namespace("Core\\Node").export("Observers",(_e20=new WeakMap,_s7=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e20,null),_classPrivateFieldInitSpec(this,_s7,new Map),_classPrivateFieldSet(_e20,this,t)},[{key:"set",value:function(){var r=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Function,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,t=new String(e).split(":"),a=null,s=null;switch(t[0]){case"view":i=i||{rootMargin:"0px",threshold:.5},s=function(e){__(e).foreach(function(e,t){if(i.allow_out_of_view||!(t.intersectionRatio<=0))return n(_classPrivateFieldGet(_e20,r),t)})},(a=new IntersectionObserver(s,i)).observe(_classPrivateFieldGet(_e20,this).getElement());break;case"change":i=i||{attributes:!0,childList:!0,characterData:!1,subtree:!1},s=function(e){return n(_classPrivateFieldGet(_e20,r),e)},(a=new MutationObserver(s)).observe(_classPrivateFieldGet(_e20,this).getElement(),i)}return _classPrivateFieldGet(_s7,this).set(e,{trigger:null!=(e=t[0])?e:"",instance:a,method:s,options:i}),this}},{key:"remove",value:function(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];return(e=Array.isArray(e)?e:[e]).forEach(function(e){_classPrivateFieldGet(_s7,t).has(e)&&_classPrivateFieldGet(_s7,t).get(e).instance.disconnect()}),this}},{key:"clear",value:function(){_classPrivateFieldGet(_s7,this).forEach(function(e,t){e.method.disconnect()})}},{key:"run",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_s7,this).has(e)&&_classPrivateFieldGet(_s7,this).get(e).method(_classPrivateFieldGet(_e20,this)),this}},{key:"has",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_s7,this).has(e)}}]))())),MJS.Namespace("Core\\Node").export("Properties",(_e21=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e21,null),_classPrivateFieldSet(_e21,this,t)},[{key:"get",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_e21,this).getElement()[e]}},{key:"set",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(!Object.prototype.isPrototypeOf(e))return _classPrivateFieldGet(_e21,this).getElement()[e]=t,this;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=_slicedToArray(n[r],2),a=i[0];this.set(a,i[1])}}},{key:"remove",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(!Array.isArray(e))return _classPrivateFieldGet(_e21,this).getElement()[e]=null,delete _classPrivateFieldGet(_e21,this).getElement()[e],this;var t,r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.remove(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"has",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return Object.hasOwn(_classPrivateFieldGet(_e21,this).getElement(),e)}},{key:"foreach",value:function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Function,t=0,r=Object.keys(_classPrivateFieldGet(_e21,this).getElement());t<r.length;t++){var n=r[t];e(n,_classPrivateFieldGet(_e21,this).getElement()[n])}return this}}]))())),MJS.Namespace("Core\\Node").export("Style",(_e25=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e25,null),_classPrivateFieldSet(_e25,this,t)},[{key:"get",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return _classPrivateFieldGet(_e25,this).getElement().style[e]}},{key:"set",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"";if(!Object.prototype.isPrototypeOf(e))return _classPrivateFieldGet(_e25,this).getElement().style[e]=t,this;for(var r=0,n=Object.entries(e);r<n.length;r++){var i=_slicedToArray(n[r],2),a=i[0];this.set(a,i[1])}}},{key:"remove",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(!Array.isArray(e))return _classPrivateFieldGet(_e25,this).getElement().style[e]=null,delete _classPrivateFieldGet(_e25,this).getElement().style[e],this;var t,r=_createForOfIteratorHelper(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;this.remove(n)}}catch(e){r.e(e)}finally{r.f()}}},{key:"has",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return Object.hasOwn(_classPrivateFieldGet(_e25,this).getElement().style,e)}},{key:"foreach",value:function(){for(var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Function,t=0,r=Object.keys(_classPrivateFieldGet(_e25,this).getElement().style);t<r.length;t++){var n=r[t];e(n,_classPrivateFieldGet(_e25,this).getElement().style[n])}return this}}]))())),MJS.Namespace("Core\\Node").export("Utils",(_e29=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_e29,null),_defineProperty(this,"UtilMap",new Map),_classPrivateFieldSet(_e29,this,t)},[{key:"get",value:function(){return this.UtilMap.get(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"")||null}},{key:"save",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return this.UtilMap.set(1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",e),this}},{key:"set",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.UtilMap.has(e)?null:MJS.Namespace("Core").import("Utils").getUtil(e)?(t=MJS.Namespace("Core").import("Utils").runUtil(e,_classPrivateFieldGet(_e29,this),t),this.save(t,e),t):void 0}},{key:"setAll",value:function(){var s=this,e=MJS.Namespace("Core").import("Utils").getUtils();if(e)for(var o=0,l=Object.entries(e);o<l.length;o++)(()=>{var e=_slicedToArray(l[o],2),t=e[0];if((e=e[1]).configuration&&e.configuration.identifiers){var r,n=_createForOfIteratorHelper(e.configuration.identifiers);try{for(n.s();!(r=n.n()).done;){var i=r.value,a=_classPrivateFieldGet(_e29,s).childNodes(i);a.length&&a.foreach(function(e){e.Utils.has(t)||(e=MJS.Namespace("Core").import("Utils").runUtil(t,e),s.save(e,t))})}}catch(e){n.e(e)}finally{n.f()}}})()}},{key:"remove",value:function(){var e,t,r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(Array.isArray(r)){var n,i=_createForOfIteratorHelper(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;this.remove(a)}}catch(e){i.e(e)}finally{i.f()}}else if(this.UtilMap.has(r))return e=this.UtilMap.get(r),(t=MJS.Namespace("Core").import("Utils").getUtil(r))&&t.configuration&&"function"==typeof t.configuration.remove&&t.configuration.remove(__(_classPrivateFieldGet(_e29,this)),e),this.UtilMap.delete(r),this}},{key:"clear",value:function(){if(this.UtilMap.size){var e,t=_createForOfIteratorHelper(this.UtilMap.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value;this.remove(r)}}catch(e){t.e(e)}finally{t.f()}}}},{key:"has",value:function(){return this.UtilMap.has(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"")}}]))())),MJS.Namespace("Core").export("Node",MJS.Node=(_n4=new WeakMap,_defineProperty(_t34=(()=>{function a(){var e,r,n=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return _classCallCheck(this,a),_classPrivateFieldInitSpec(this,_n4,null),null!==t&&(NodeList.prototype.isPrototypeOf(t)||(a.prototype.isPrototypeOf(t)?_classPrivateFieldSet(_n4,this,t.getElement()):!t.nodeType||t.nodeType!==Node.ELEMENT_NODE&&t.nodeType!==Node.TEXT_NODE?"string"==typeof t||t instanceof String?/<\/?[a-z][\s\S]*>/i.test(t)?((e=document.createElement("div")).innerHTML=t,_classPrivateFieldSet(_n4,this,e.firstChild)):_classPrivateFieldSet(_n4,this,document.createElement(t)):__Instance.prototype.isPrototypeOf(t)&&_classPrivateFieldSet(_n4,this,t.get(0).nodes()):_classPrivateFieldSet(_n4,this,t)),_classPrivateFieldGet(_n4,this))?(a.NodeMap.has(_classPrivateFieldGet(_n4,this))?(r=a.NodeMap.get(_classPrivateFieldGet(_n4,this)),this.ID=r.ID,a.ModulesMap.forEach(function(e,t){n[t]=r[t]||new(MJS.Namespace(e).import(t))(n)}),a.DynamicModulesMap.forEach(function(e,t){n[t]=r[t]||new(MJS.Namespace(e).import(t))(n)}),a.NodeMap.delete(_classPrivateFieldGet(_n4,this))):(a.ModulesMap.forEach(function(e,t){n[t]=new(MJS.Namespace(e).import(t))(n)}),a.DynamicModulesMap.forEach(function(e,t){n[t]=new(MJS.Namespace(e).import(t))(n)}),this.ID=Math.random().toString(16).slice(2)),a.NodeMap.set(_classPrivateFieldGet(_n4,this),this),void a.processPredefinedProperties(i,this)):null}return _createClass(a,[{key:"parentNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=e?_classPrivateFieldGet(_n4,this).closest(e):null==(e=_classPrivateFieldGet(_n4,this))?void 0:e.parentNode;return e?new a(e):null}},{key:"parentNodes",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return new a(e?_classPrivateFieldGet(_n4,this).closest(e):null==(e=_classPrivateFieldGet(_n4,this))?void 0:e.parentNode)}},{key:"childNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=e?_classPrivateFieldGet(_n4,this).querySelector(e):null==(e=_classPrivateFieldGet(_n4,this))?void 0:e.firstChild;return e?new a(e):null}},{key:"childNodes",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return new MJS.NodeList(e?_classPrivateFieldGet(_n4,this).querySelectorAll(e):(null==(e=_classPrivateFieldGet(_n4,this))?void 0:e.childNodes)||[])}},{key:"nextNode",value:function(){var e;return _classPrivateFieldGet(_n4,this).nextSibling?new a(null==(e=_classPrivateFieldGet(_n4,this))?void 0:e.nextSibling):null}},{key:"previousNode",value:function(){var e;return _classPrivateFieldGet(_n4,this).previousSibling?new a(null==(e=_classPrivateFieldGet(_n4,this))?void 0:e.previousSibling):null}},{key:"insertNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:a,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"append",e=a.convertToNode(e);return"append"===t?_classPrivateFieldGet(_n4,this).append(e.getElement()):_classPrivateFieldGet(_n4,this).prepend(e.getElement()),this}},{key:"moveToNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:a,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"after",e="string"==typeof e||e instanceof String?a.getNode(e):a.convertToNode(e);return"after"===t?e.getElement().after(_classPrivateFieldGet(_n4,this)):e.getElement().before(_classPrivateFieldGet(_n4,this)),this}},{key:"hasNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:a,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"child";return!!(e="string"==typeof e||e instanceof String?this.childNode(e):a.convertToNode(e))&&("child"===t?_classPrivateFieldGet(_n4,this).contains(e.getElement()):e.getElement().contains(_classPrivateFieldGet(_n4,this)))}},{key:"isNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:a;return!!(e=a.convertToNode(e))&&_classPrivateFieldGet(_n4,this)===e.getElement()}},{key:"clear",value:function(){var e=this.childNodes();return e.length&&e.foreach(function(e){return e.remove()}),this}},{key:"replaceWithNode",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:a;return _classPrivateFieldGet(_n4,this).replaceWith(e.getElement()),this}},{key:"setText",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",r=[],n=null,i=_createForOfIteratorHelper(_classPrivateFieldGet(_n4,this).childNodes);try{for(i.s();!(e=i.n()).done;){var a=e.value;a.nodeType===Node.TEXT_NODE&&(r.push(a),n=a)}}catch(e){i.e(e)}finally{i.f()}return!n&&t?this.insertNode(new MJS.Node(document.createTextNode(t))):n&&(n.nodeValue=t),this}},{key:"getText",value:function(){var e,t=[],r=null,n=_createForOfIteratorHelper(_classPrivateFieldGet(_n4,this).childNodes);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.nodeType===Node.TEXT_NODE&&(t.push(i),r=i)}}catch(e){n.e(e)}finally{n.f()}return r?r.textContent.trim():""}},{key:"cloneNode",value:function(){return new a(_classPrivateFieldGet(_n4,this).cloneNode(!0))}},{key:"exists",value:function(){return null!==_classPrivateFieldGet(_n4,this)&&""!==_classPrivateFieldGet(_n4,this)&&0!==_classPrivateFieldGet(_n4,this)}},{key:"toNodeList",value:function(){return new MJS.NodeList([_classPrivateFieldGet(_n4,this)])}},{key:"getElement",value:function(){return _classPrivateFieldGet(_n4,this)}},{key:"remove",value:function(){var e=this.childNodes();return e.length&&e.foreach(function(e){return e.remove()}),null!=(e=this.Utils)&&e.clear(),null!=(e=this.Events)&&e.clear(),a.NodeMap.delete(_classPrivateFieldGet(_n4,this)),null!=(e=_classPrivateFieldGet(_n4,this))&&e.remove(),_classPrivateFieldSet(_n4,this,null),delete this.Attributes,delete this.Classes,delete this.Events,delete this.Observers,delete this.Properties,delete this.Utils,delete this.Style,null}},{key:"linkNode",value:function(){}}],[{key:"getNode",value:function(){var e=document.querySelector(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"");return e?a.NodeMap.has(e)?a.NodeMap.get(e):new a(e):null}},{key:"getNodes",value:function(){return new MJS.NodeList(document.querySelectorAll(0<arguments.length&&void 0!==arguments[0]?arguments[0]:""))}},{key:"loadNode",value:function(e){return this.NodeMap.has(e)?this.NodeMap.get(e):new a(e)}},{key:"convertToNode",value:function(e){return a.prototype.isPrototypeOf(e)?e:e.nodeType&&e.nodeType===Node.ELEMENT_NODE?this.loadNode(e):__Instance.prototype.isPrototypeOf(e)?this.loadNode(e.get(0).nodes()):void 0}},{key:"processPredefinedProperties",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;if(Object.keys(e).length)for(var r=0,n=Object.entries(e);r<n.length;r++){var i=_slicedToArray(n[r],2),a=i[0],s=i[1];switch(a){case"attributes":t.Attributes.set(s);break;case"classes":t.Classes.set(s);break;case"properties":t.Properties.set(s);break;case"events":for(var o=0,l=Object.entries(s);o<l.length;o++){var c=_slicedToArray(l[o],2),u=c[0];t.Events.set(u,c[1])}break;case"observers":for(var h=0,_=Object.entries(s);h<_.length;h++){var p=_slicedToArray(_[h],2),d=p[0];t.Observers.set(d,p[1])}break;case"style":t.Style.set(s);break;case"utils":var f,v=_createForOfIteratorHelper(s);try{for(v.s();!(f=v.n()).done;){var g=f.value;g[0]&&t.Utils.set(g[0],g[1]||{})}}catch(e){v.e(e)}finally{v.f()}break;case"nodes":var y,m=_createForOfIteratorHelper(s);try{for(m.s();!(y=m.n()).done;){var b=y.value;b[0]&&t.insertNode(new MJS.Node(b[0],b[1]))}}catch(e){m.e(e)}finally{m.f()}}}}}])})(),"ModulesMap",new Map([["Attributes","Core\\Node"],["Classes","Core\\Node"],["Events","Core\\Node"],["Observers","Core\\Node"],["Properties","Core\\Node"],["Style","Core\\Node"],["Utils","Core\\Node"]])),_defineProperty(_t34,"DynamicModulesMap",new Map),_defineProperty(_t34,"NodeMap",new WeakMap),_t34)),_createClass(function e(){_classCallCheck(this,e);var t=new MJS.Node("div"),r=t.parentNode();t.parentNodes(),t.childNode(),t.childNodes(),t.nextNode(),t.previousNode(),t.hasNode(r),t.isPartOfNode(r),t.insertNode("append|prepend",new MJS.Node("span")),t.placeNode("before|after",new MJS.Node("span")),t.clear(),t.remove(),t.replaceWithNode(r),t.linkNode(r),t.setText("Text content"),t.getText(),t.cloneNode(),t.getElement(),t.Attributes.get("attribute-1"),t.Attributes.set("attribute-1","value"),t.Attributes.remove("attribute-1"),t.Attributes.has("attribute-1"),t.Attributes.foreach(function(e,t){}),t.Attributes.copyFromNode(r),t.Attributes,t.Classes.set("class-1"),t.Classes.remove("class-1"),t.Classes.has("class-1"),t.Classes.foreach(function(e){}),t.Classes.copyFromNode(r),t.Classes,t.Properties.get("prop-1"),t.Properties.set("prop-1","value"),t.Properties.remove("prop-1"),t.Properties.has("prop-1"),t.Properties.copyFromNode(r),t.Properties,t.on("click:".concat(ID),{}).then(function(e,t){}),t.Events.set(["click:".concat(ID),"change:".concat(ID)],{}).then(function(e,t){}),t.Events.run("click"),t.Events.remove("click:".concat(ID)),t.Events.clear(),t.Events.has("click:".concat(ID)),t.Events,t.observe("view:".concat(ID),{}).then(function(e){}),t.Observers.set(["view:".concat(ID),"change:".concat(ID)],{}).then(function(e){}),t.Observers.run("view"),t.Observers.remove("view:".concat(ID)),t.Observers.clear(),t.Observers.has("view:".concat(ID)),t.Observers,t.Utils.get("Select:".concat(ID)),t.Utils.set("Select:".concat(ID),{}),t.Utils.remove("Select:".concat(ID)),t.Utils.has("Select:".concat(ID)),t.childNodes().setUtils(),t.Utils,MJS.Node.getNode(".class"),MJS.Node.getNodes(".class").foreach(function(e){e.childNode(".class-2").remove()})}));function __(e){return new __Instance(e)}function $_(e,t){return __(document.querySelectorAll(e))}function __Instance(e){this.target=e,this.type=null,this.checkQuery(),this.getType(),this.convertTarget()}__Instance.prototype.checkQuery=function(){if("string"==typeof this.target||this.target instanceof String)return this.target=this.target.replace("!",""),this.target=$_(this.target).nodes()},__Instance.prototype.getType=function(){if(null!=this.target&&""!==this.target&&!1!==this.target)return NodeList.prototype.isPrototypeOf(this.target)?this.type="NodeList":this.target.nodeType&&this.target.nodeType===Node.ELEMENT_NODE?this.type="Element":MJS.Node.prototype.isPrototypeOf(this.target)?this.type="mjsnode":Array.prototype.isPrototypeOf(this.target)?this.type="Array":Object.prototype.isPrototypeOf(this.target)?this.type="Object":"string"==typeof this.target||this.target instanceof String?this.type="String":__Instance.prototype.isPrototypeOf(this.target)?this.type="__Instance":void 0},__Instance.prototype.convertTarget=function(){switch(this.type){case"Element":case"Object":return this.target=[this.target];case"NodeList":for(var e=[],t=0;t<this.target.length;++t)e.push(this.target[t]);return this.target=e,e=null,this.target;case"mjsnode":return this.target=[this.target.getElement()]}},__Instance.prototype.nodes=function(){return null==this.target||this.target.length<1?null:1===this.target.length?this.target[0]:this.target},__Instance.prototype.get=function(e){return null===this.target||this.target.length<1?null:__(this.target[e])},__Instance.prototype.first=function(){return null===this.target||this.target.length<1?null:__(this.target[0])},__Instance.prototype.last=function(){return null===this.target||this.target.length<1?null:__(this.target[this.target.length-1])},__Instance.prototype.foreach=function(t){var r=this;if("Object"===this.type&&(this.target=this.target[0]),"object"!=_typeof(this.target)){if(null!==this.target)for(var e=0;e<this.target.length;++e)t(e,this.target[e])}else Object.keys(this.target).forEach(function(e){"__"!==e&&t(e,r.target[e])})},__Instance.__methods={},__Instance.extend=function(l,e){__Instance.__methods[l]=function(){this.__target=null,this.__type=null,this.__Instance=null,this.result},__Instance.__methods[l].prototype.run=e,__Instance.prototype[l]=function(){if(null!=this.target){for(var e=l,t=[],r=!1,n=0;n<this.target.length;++n)if(null!=this.target[n]&&(!1!==__Instance.prototype.isPrototypeOf(this.target[n])&&(this.target[n]=this.target[n].nodes()),null!=this.target[n])){var i=new __Instance.__methods[e],a=(i.__target=this.target[n],i.__type=this.type,i.__Instance=this,i.run.apply(i,arguments),i.result);if(void 0!==a){if(!1===__Instance.prototype.isPrototypeOf(a)){t.push(a);continue}if(r=!0,null===a.target)continue;for(var s=0;s<a.target.length;++s)t.push(a.target[s])}i.result=null}if(!0===r)return __(t);if(t.length<1)return this;if(1===t.length)return t[0];for(var o=0;o<t.length;++o)null===t[o]&&(delete t[o],t.length--);return 1===t.length?t[0]:t}}},__Instance.extend("setProperties",function(){"String"===this.__type||"string"==typeof this.__target||this.__target instanceof String||"Object"===this.__type&&Object.keys(this.__target).length<1||(this.__target.__=this.__target.__||{},this.__target.__={properties:this.__target.__.properties||{},methods:this.__target.__.methods||{},methods_aliases:this.__target.__.methods_aliases||{},methods_options:this.__target.__.methods_options||{},observers:this.__target.__.observers||{},utils:this.__target.__.utils||{}})}),__Instance.extend("prop",function(e,t){void 0!==t?this.__target[e]=t:this.result=this.__target[e]||null}),__Instance.extend("attribute",function(e,t){e=(e=(e=e||"").replace(/[[\]]/g,"")).replace(".",""),void 0!==t?null!==t&&""!==t||!this.__target.hasAttribute(e)?null!=t&&this.__target.setAttribute(e,t):this.__target.removeAttribute(e):this.result=null!=(t=this.__target.getAttribute(e))?t:null}),__Instance.extend("attributes",function(e){var r=this;MJS.Namespace("Core").import("Functions").empty(e)||__(e).foreach(function(e,t){__(r.__target).attribute(e,t)})}),__Instance.extend("hasAttribute",function(e){this.result=__(this.__target).attribute(e)}),__Instance.extend("method",function(e){this.__target[e]()}),__Instance.extend("remove",function(){if(this.__target)return new MJS.Node(this.__target).remove(),!0}),__Instance.extend("shift",function(){this.__target.shifted_from=this.__target.parentElement,this.__target.remove()}),__Instance.extend("unshift",function(){this.__target.shifted_from.append(this.__target)}),__Instance.extend("removeEvents",function(e,t){if(this.__target){var r=String(e||"").split(" "),e=String(t||"").split(" ");if(!e.length){if(r.length){var n,i=_createForOfIteratorHelper(r);try{for(i.s();!(n=i.n()).done;){var a=n.value;new MJS.Node(this.__target).Events.remove(a)}}catch(e){i.e(e)}finally{i.f()}}return!0}var s,o=_createForOfIteratorHelper(e);try{for(o.s();!(s=o.n()).done;){var l=s.value;if(r.length){var c,u=_createForOfIteratorHelper(r);try{for(u.s();!(c=u.n()).done;){var h=c.value;new MJS.Node(this.__target).Events.remove("".concat(h,":").concat(l))}}catch(e){u.e(e)}finally{u.f()}}r.length||new MJS.Node(this.__target).Events.remove(l)}}catch(e){o.e(e)}finally{o.f()}}}),__Instance.extend("child",function(e){this.result=__(this.__target.querySelector(e))}),__Instance.extend("childs",function(e,t){var r=[];if(null==this.__target.children||this.__target.children.length<1)this.result=__([]);else{if(null==e||""===e)if(void 0!==t&&!0===t)for(var n=0;n<this.__target.children.length;++n){var i=this.__target.children[n];r.push(i)}else for(var a=this.__target.querySelectorAll("*"),n=0;n<a.length;++n){var s=a[n];r.push(s)}if(void 0!==t&&!0===t){var o=this.__target.children,l=this.__target.querySelectorAll(e);for(n=0;n<l.length;++n)for(var c=0;c<o.length;++c)!0===l[n].isSameNode(o[c])&&r.push(l[n])}else{var u=this.__target.querySelectorAll(e);if(0<u.length)for(n=0;n<u.length;++n)r.push(u[n])}this.result=__(r)}}),__Instance.extend("hasChild",function(e){__Instance.prototype.isPrototypeOf(e)&&(e=e.nodes()),this.result=this.__target.contains(e)}),__Instance.extend("parent",function(e){var t=[];if(this.__target.nodeType&&this.__target.nodeType===Node.ELEMENT_NODE)return null==e?(t.push(this.__target.parentNode),void(this.result=__(t))):void(this.result=__(this.__target.parentNode.closest(e)));this.result=null}),__Instance.extend("parents",function(e){var t=[];for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),r=t.length;0<=--r&&t.item(r)!==this;);return-1<r});this.__target&&this.__target!==document;this.__target=this.__target.parentNode)e&&!this.__target.matches(e)||t.push(this.__target);this.result=__(t)}),__Instance.extend("hasParent",function(e){__Instance.prototype.isPrototypeOf(e)&&(e=e.nodes()),this.result=e.contains(this.__target)}),__Instance.extend("addClass",function(e){!1===Array.isArray(e)&&(e=e.split(" "));for(var t=0;t<e.length;++t)class_item=(class_item=e[t].replace(".","")).replace(/[[\]]/g,""),this.__target.classList.add(class_item)}),__Instance.extend("removeClass",function(e){!1===Array.isArray(e)&&(e=e.split(" "));for(var t=0;t<e.length;++t)class_item=(class_item=e[t].replace(".","")).replace(/[[\]]/g,""),this.__target.classList.remove(e[t])}),__Instance.extend("hasClass",function(e){e=(e=e.replace(".","")).replace(/[[\]]/g,""),this.result=this.__target.classList.contains(e)}),__Instance.extend("toggleClass",function(e){var r=this;__(e=!1===Array.isArray(e)?e.split(" "):e).foreach(function(e,t){r.__target.classList.toggle(t)})}),__Instance.extend("text",function(e){var t=MJS.Namespace("Core").import("Functions"),r=this.__target.childNodes,n=[],i=null;if(__(r).foreach(function(e,t){t.nodeType===Node.TEXT_NODE&&(n.push(t),i=t)}),t.empty(i)&&!t.empty(e))return this.__target.appendChild(document.createTextNode(e));t.empty(i)||!t.empty(e)?t.empty(i)&&t.empty(e)?this.result="":i.nodeValue=e:this.result=i.textContent.trim()}),__Instance.extend("hasSelector",function(e){this.result=this.__target.matches(e)}),__Instance.extend("style",function(e){for(var t=Object.keys(e),r=0;r<t.length;++r)this.__target.style[t[r]]=e[t[r]]}),__Instance.extend("show",function(e){this.__target.style.display=e||""}),__Instance.extend("hide",function(){this.__target.style.display="none"}),__Instance.extend("disable",function(){this.__target.disabled=!0}),__Instance.extend("enable",function(){this.__target.disabled=!1}),__Instance.extend("after",function(e){if(null!==this.__target.parentNode){(e=__Instance.prototype.isPrototypeOf(e)?e.nodes():e).nodeType&&e.nodeType===Node.ELEMENT_NODE&&(e=[e]);for(var t=0;t<e.length;++t)try{this.__target.parentNode.insertBefore(e[t],this.__target.nextSibling)}catch(e){}}}),__Instance.extend("before",function(e){if(null!==this.__target.parentNode){(e=__Instance.prototype.isPrototypeOf(e)?e.nodes():e).nodeType&&e.nodeType===Node.ELEMENT_NODE&&(e=[e]);for(var t=0;t<e.length;++t)try{this.__target.parentNode.insertBefore(e[t],this.__target)}catch(e){}}}),__Instance.extend("replace",function(e){if(null!==this.__target.parentNode){(e=__Instance.prototype.isPrototypeOf(e)?e.nodes():e).nodeType&&e.nodeType===Node.ELEMENT_NODE&&(e=[e]);for(var t=0;t<e.length;++t)try{this.__target.parentNode.replaceChild(e[t],this.__target)}catch(e){}}}),__Instance.extend("append",function(e){(e=__Instance.prototype.isPrototypeOf(e)?e.nodes():e).nodeType&&e.nodeType===Node.ELEMENT_NODE&&(e=[e]);for(var t=0;t<e.length;++t)try{this.__target.appendChild(e[t])}catch(e){}}),__Instance.extend("prepend",function(e){(e=__Instance.prototype.isPrototypeOf(e)?e.nodes():e).nodeType&&e.nodeType===Node.ELEMENT_NODE&&(e=[e]);for(var t=0;t<e.length;++t)try{this.__target.prepend(e[t])}catch(e){}}),__Instance.extend("clear",function(e){__(this.__target.querySelectorAll(":not("+e+")")).remove()}),__Instance.extend("copy",function(){this.result=__(this.__target.cloneNode(!0))}),__Instance.extend("getFormData",function(){var e,t={},r=_createForOfIteratorHelper(new FormData(this.__target).entries());try{for(r.s();!(e=r.n()).done;){var n=e.value;t[n[0]]=n[1]}}catch(e){r.e(e)}finally{r.f()}this.result=t}),__Instance.extend("validate",function(e){!0===e?(this.__target.setCustomValidity(""),this.__target.checkValidity(),__(this.__target).parent(".form-group").removeClass("is-invalid").addClass("is-valid")):(this.__target.setCustomValidity("Invalid"),__(this.__target).parent(".form-group").removeClass("is-valid"),this.__target.checkValidity())}),__Instance.extend("getRect",function(){this.result=this.__target.getBoundingClientRect()}),__Instance.extend("getScrollParent",function(e){e=e||"Y";var t=getComputedStyle(this.__target),r="absolute"===t.position;if("fixed"!==t.position)for(var n=this.__target;n=n.parentElement;)if(t=getComputedStyle(n),(!r||"static"!==t.position)&&"HTML"!==n.tagName){var i="Y"===(e=e.toUpperCase())?"Height":"Width",a="overflow"+e,i=n["scroll"+i]>n["client"+i],s=getComputedStyle(n);if(i&&("visible"==s[a]||"auto"==s[a])||"scroll"==s[a])return void(this.result=__(n))}this.result=__(window)}),__Instance.extend("observe",function(e,r,t,n){if(this.__target){switch(e){case"view":new MJS.Node(this.__target).Observers.set("".concat(e).concat(t?":".concat(t):""),function(e,t){r(__(e),t)},n);break;case"change":new MJS.Node(this.__target).Observers.set("".concat(e).concat(t?":".concat(t):""),function(e,t){r(t)},n)}return!0}}),__Instance.extend("removeObservers",function(e,t){if(this.__target)return new MJS.Node(this.__target).Observers.remove("".concat(e).concat(t?":".concat(t):"")),!0}),__Instance.extend("getStyle",function(e){var t=MJS.Namespace("Core").import("Functions"),r=(()=>{function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"getStylesIframe",value:function(){return null!=window.blankIframe&&(window.blankIframe=document.createElement("iframe"),document.body.appendChild(window.blankIframe)),window.blankIframe}},{key:"getStylesObject",value:function(e,t){for(var r=t.getComputedStyle(e),n={},i=0;i<r.length;i++){var a=r[i];n[a]=r[a]}return n}},{key:"getDefaultStyles",value:function(e){var t=n.getStylesIframe(),r=t.contentDocument,e=r.createElement(e.tagName),r=(r.body.appendChild(e),n.getStylesObject(e,t.contentWindow));return e.remove(),r}},{key:"getUserStyles",value:function(e){return n.getStylesObject(e,window)}}])})();this.result=r.getUserStyles(this.__target),t.empty(e)||(this.result=this.result[e]||null)}),__Instance.extend("copyStyleFrom",function(e){for(var r=this,t=(__Instance.prototype.isPrototypeOf(e)&&(e=e.nodes()),__(document.defaultView.getComputedStyle(e,"")).foreach(function(e,t){r.__target.style[e]=t}),e.getElementsByTagName("*")),n=this.__target.getElementsByTagName("*"),i=t.length;i--;)(()=>{var e=t[i],r=n[i];__(document.defaultView.getComputedStyle(e,"")).foreach(function(e,t){r.style[e]=t})})()}),__Instance.extend("on",function(e,r,t,n){if(this.__target){var i=new MJS.Node(this.__target),a=e.split(" ");switch(t&&a.map(function(e){return e+":"+t}),i.exists()){case!0:new MJS.Node(this.__target).Events.set(a,function(e,t){r(e.getElement(),t)},n);break;case!1:MJS.Namespace("Core").import("Events").set(this.__target,a,function(e,t){r(e,t)},n)}return!0}}),__Instance.extend("once",function(e,r){if(this.__target){var t=new MJS.Node(this.__target),n=e.split(" ");switch(t.exists()){case!0:new MJS.Node(this.__target).Events.set(n,function(e,t){r(e.getElement(),t)},{once:!0});break;case!1:MJS.Namespace("Core").import("Events").set(this.__target,n,function(e,t){r(e,t)},{once:!0})}return!0}}),__Instance.extend("execute",function(e){if(this.__target){switch(new MJS.Node(this.__target).exists()){case!0:new MJS.Node(this.__target).Events.run(e);break;case!1:MJS.Namespace("Core").import("Events").run(this.__target,e)}return!0}}),__Instance.extend("assignID",function(e){this.__target.ID=this.result=MJS.Namespace("Core").import("Format").randomString(parseInt(e)||10)}),__Instance.extend("is",function(e){__Instance.prototype.isPrototypeOf(e)&&(e=e.nodes()),this.result=this.__target===e}),__Instance.util=function(e,t,r){r.configuration=t,MJS.Namespace("Core").import("Utils").setUtil(e,r)},__Instance.setUtils=function(e,t,r){MJS.Namespace("Core").import("Utils").setup()},__Instance.prototype.setUtils=function(e,t){for(var r=this.target,n=0;n<r.length;++n){var i=r[n];new MJS.Node(i).Utils.setAll()}},__Instance.extend("util",function(e,t){if(this.__target)return e=new MJS.Node(this.__target).Utils.get(e),this.result=e?t?e:__(e):null}),__Instance.extend("addUtil",function(e,t){if(this.__target)return new MJS.Node(this.__target).Utils.save(e,t||e.constructor.name),!0}),__Instance.extend("disconnectUtil",function(e){if(this.__target)return new MJS.Node(this.__target).Utils.remove(e),!0}),__Instance.extend("removeUtil",function(e){if(this.__target)return new MJS.Node(this.__target).Utils.remove(e),!0}),__Instance.extend("removeUtils",function(){if(this.__target)return new MJS.Node(this.__target).Utils.clear(),!0}),__Instance.extend("setUtil",function(e,t){if(this.__target)return new MJS.Node(this.__target).Utils.save(t,e||t.constructor.name),!0});
var _Class,_Class2,_e5,_Class3,_Class4,_Class5,_Class6,_Class7,_Class8,_Class9,_Class10,_Class11,_Class12,_Class13,_Class14,_Class15,_Class16,_Class17;function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _createForOfIteratorHelper(e,t){var i,n,r,s,o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(o)return r=!(n=!0),{s:function(){o=o.call(e)},n:function(){var e=o.next();return n=e.done,e},e:function(e){r=!0,i=e},f:function(){try{n||null==o.return||o.return()}finally{if(r)throw i}}};if(Array.isArray(e)||(o=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return o&&(e=o),s=0,{s:t=function(){},n:function(){return s>=e.length?{done:!0}:{done:!1,value:e[s++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _regeneratorRuntime(){_regeneratorRuntime=function(){return o};var l,o={},e=Object.prototype,d=e.hasOwnProperty,c=Object.defineProperty||function(e,t,i){e[t]=i.value},t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",i=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function s(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(l){s=function(e,t,i){return e[t]=i}}function a(e,t,i,n){var r,s,o,a,t=t&&t.prototype instanceof m?t:m,t=Object.create(t.prototype),n=new C(n||[]);return c(t,"_invoke",{value:(r=e,s=i,o=n,a=h,function(e,t){if(a===g)throw Error("Generator is already running");if(a===f){if("throw"===e)throw t;return{value:l,done:!0}}for(o.method=e,o.arg=t;;){var i=o.delegate;if(i){i=function e(t,i){var n=i.method,r=t.iterator[n];if(r===l)return i.delegate=null,"throw"===n&&t.iterator.return&&(i.method="return",i.arg=l,e(t,i),"throw"===i.method)||"return"!==n&&(i.method="throw",i.arg=new TypeError("The iterator does not provide a '"+n+"' method")),_;n=u(r,t.iterator,i.arg);if("throw"===n.type)return i.method="throw",i.arg=n.arg,i.delegate=null,_;r=n.arg;return r?r.done?(i[t.resultName]=r.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=l),i.delegate=null,_):r:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,_)}(i,o);if(i){if(i===_)continue;return i}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(a===h)throw a=f,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);a=g;i=u(r,s,o);if("normal"===i.type){if(a=o.done?f:p,i.arg===_)continue;return{value:i.arg,done:o.done}}"throw"===i.type&&(a=f,o.method="throw",o.arg=i.arg)}})}),t}function u(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}o.wrap=a;var h="suspendedStart",p="suspendedYield",g="executing",f="completed",_={};function m(){}function v(){}function y(){}var t={},b=(s(t,n,function(){return this}),Object.getPrototypeOf),b=b&&b(b(S([]))),N=(b&&b!==e&&d.call(b,n)&&(t=b),y.prototype=m.prototype=Object.create(t));function x(e){["next","throw","return"].forEach(function(t){s(e,t,function(e){return this._invoke(t,e)})})}function k(o,a){var t;c(this,"_invoke",{value:function(i,n){function e(){return new a(function(e,t){!function t(e,i,n,r){var s,e=u(o[e],o,i);if("throw"!==e.type)return(i=(s=e.arg).value)&&"object"==_typeof(i)&&d.call(i,"__await")?a.resolve(i.__await).then(function(e){t("next",e,n,r)},function(e){t("throw",e,n,r)}):a.resolve(i).then(function(e){s.value=e,n(s)},function(e){return t("throw",e,n,r)});r(e.arg)}(i,n,e,t)})}return t=t?t.then(e,e):e()}})}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(t){if(t||""===t){var i,e=t[n];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return i=-1,(e=function e(){for(;++i<t.length;)if(d.call(t,i))return e.value=t[i],e.done=!1,e;return e.value=l,e.done=!0,e}).next=e}throw new TypeError(_typeof(t)+" is not iterable")}return c(N,"constructor",{value:v.prototype=y,configurable:!0}),c(y,"constructor",{value:v,configurable:!0}),v.displayName=s(y,r,"GeneratorFunction"),o.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,s(e,r,"GeneratorFunction")),e.prototype=Object.create(N),e},o.awrap=function(e){return{__await:e}},x(k.prototype),s(k.prototype,i,function(){return this}),o.AsyncIterator=k,o.async=function(e,t,i,n,r){void 0===r&&(r=Promise);var s=new k(a(e,t,i,n),r);return o.isGeneratorFunction(t)?s:s.next().then(function(e){return e.done?e.value:s.next()})},x(N),s(N,r,"Generator"),s(N,n,function(){return this}),s(N,"toString",function(){return"[object Generator]"}),o.keys=function(e){var t,i=Object(e),n=[];for(t in i)n.push(t);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in i)return e.value=t,e.done=!1,e}return e.done=!0,e}},o.values=S,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=l,this.done=!1,this.delegate=null,this.method="next",this.arg=l,this.tryEntries.forEach(P),!e)for(var t in this)"t"===t.charAt(0)&&d.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=l)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var n=this;function e(e,t){return s.type="throw",s.arg=i,n.next=e,t&&(n.method="next",n.arg=l),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t],s=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var o=d.call(r,"catchLoc"),a=d.call(r,"finallyLoc");if(o&&a){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(o){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!a)throw Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.finallyLoc)}}}},abrupt:function(e,t){for(var i=this.tryEntries.length-1;0<=i;--i){var n=this.tryEntries[i];if(n.tryLoc<=this.prev&&d.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var r=n;break}}var s=(r=r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc?null:r)?r.completion:{};return s.type=e,s.arg=t,r?(this.method="next",this.next=r.finallyLoc,_):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),_},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),P(i),_}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var i,n,r=this.tryEntries[t];if(r.tryLoc===e)return"throw"===(i=r.completion).type&&(n=i.arg,P(r)),n}throw Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:S(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=l),_}},o}function asyncGeneratorStep(e,t,i,n,r,s,o){try{var a=e[s](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(n,r)}function _asyncToGenerator(a){return function(){var e=this,o=arguments;return new Promise(function(t,i){var n=a.apply(e,o);function r(e){asyncGeneratorStep(n,t,i,r,s,"next",e)}function s(e){asyncGeneratorStep(n,t,i,r,s,"throw",e)}r(void 0)})}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var i;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(i="Object"===(i={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function _iterableToArrayLimit(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s,o,a=[],l=!0,d=!1;try{if(s=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=s.call(i)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){d=!0,r=e}finally{try{if(!l&&null!=i.return&&(o=i.return(),Object(o)!==o))return}finally{if(d)throw r}}return a}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,i){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0===i)return("string"===t?String:Number)(e);i=i.call(e,t||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}MJS.Namespace("Utils").export("Form",(_Class=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"submit_button",null),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Functions",MJS.Namespace("Core").import("Functions")),_defineProperty(this,"Fetch",MJS.Namespace("Core").import("Fetch")),_defineProperty(this,"XHR",MJS.Namespace("Core").import("XHR")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var r=this;this.language=this.node.Attributes.get("lang")||null,this.node.Events.set("click:".concat(this.ID),function(e,t){"submit"===t.target.type&&(r.submit_button=t.target.name)}),this.node.Events.remove("submit:".concat(this.ID)),this.node.Events.set("submit:".concat(this.ID),function(e,t){var i,n=r.node.childNodes('[data-util="duplicator"]');n.length&&null!=(i=r.node.Utils.get("FormValidation"))&&i.validateForm()&&(i=n.lastNode()).Utils.get("Duplicator")&&i.Utils.get("Duplicator").automatic_rows&&i.childNodes().foreach(function(e){return e.Properties.set("disabled",!0)})}),this.setDataMatch(),this.setFieldPolicy(),this.setTriggers()}},{key:"setDataMatch",value:function(){var n=this,e=this.node.childNodes("[data-match]");e.length&&e.foreach(function(t){function e(){var e;i.Properties.get("value")!==t.Properties.get("value")?(null!=(e=i.parentNode(".form-group"))&&e.Classes.set("is-invalid"),i.getElement().setCustomValidity("Error"),null!=(e=t.parentNode(".form-group"))&&e.Classes.set("is-invalid"),t.getElement().setCustomValidity("Error")):(null!=(e=i.parentNode(".form-group"))&&e.Classes.remove("is-invalid"),i.getElement().setCustomValidity(""),null!=(e=t.parentNode(".form-group"))&&e.Classes.remove("is-invalid"),t.getElement().setCustomValidity(""))}var i=n.node.childNode(t.Attributes.get("data-match"));t.Events.set("blur",e),i.Events.set("blur",e)})}},{key:"setFieldPolicy",value:function(){var a=this,e=this.node.childNodes("[data-policy]");e.length&&e.foreach(function(s){if(o=s.Attributes.get("data-policy")||null){for(var o=a.Format.xhrDecode(o),e=0,t=Object.entries(o);e<t.length;e++){var i=_slicedToArray(t[e],2),n=i[0],i=i[1],n=new MJS.Node('<div policy-key="'.concat(a.Format.xhrEncode(n),'" class="policy-feedback">').concat(i,"</div>"));s.parentNode(".form-group").insertNode(n)}s.Properties.set("policy-invalid",!0),s.Events.set(["change:".concat(a.ID),"keyup:".concat(a.ID),"input:".concat(a.ID)],function(){var e=!0;s.Properties.set("policy-valid",!0),s.Properties.set("policy-invalid",!1);for(var t=0,i=Object.entries(o);t<i.length;t++){var n=_slicedToArray(i[t],2),n=n[0],r=new RegExp(n).test(s.Properties.get("value")),n=s.parentNode(".form-group").childNode('[policy-key="'.concat(a.Format.xhrEncode(n),'"]'));n.Classes.remove("valid"),!0!==r?e=!1:n.Classes.set("valid")}if(!1===e)return s.Properties.set("policy-valid",!1),s.Properties.set("policy-invalid",!0),__(s).validate(!1);__(s).validate(!0)})}})}},{key:"setTriggers",value:function(){var u=this,e=this.node.childNodes("[data-class]");e.length&&e.foreach(function(o){var e=o.Attributes.get("data-triggers")||"change",a=o.Attributes.get("data-class"),l=o.Attributes.get("data-function"),d=o.Attributes.get("data-params")||"";if(!e||!a)return!1;var c=o.parentNode(".form-group");o.Events.set(e.split(","),function(){u.Functions.delay(_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t={form_data:__(u.node).getFormData(),value:o.Properties.get("value")},i=u.node.Attributes.get("params")||u.Functions.getParams(window.location.search)||"",i+=(i?"&":"")+d,e.next=5,new u.Fetch([a,null!=l?l:null],{body:t,query:i}).then(function(e,t){return[e,t]});case 5:t=e.sent,i=_slicedToArray(t,2),n=i[0],r=i[1],console.warn(n,r),n.invalid_feedback&&(c.childNode(".invalid-feedback")||c.insertNode(new MJS.Node('<div class="invalid-feedback"></div>')),(s=c.childNode(".invalid-feedback")).Properties.set("innerHTML",n.invalid_feedback||""),s.Utils.setAll()),n.valid_feedback&&(c.childNode(".valid-feedback")||c.insertNode(new MJS.Node('<div class="valid-feedback"></div>')),(s=c.childNode(".valid-feedback")).Properties.set("innerHTML",n.valid_feedback),s.Utils.setAll()),u.XHR.processResponse(n,r),__(o).validate(n.validation||!1),o.Properties.remove("trigger-invalid"),n.validation||o.Properties.set("trigger-invalid",!0),null!=n.value&&o.Properties.set("value",n.value);case 12:case"end":return e.stop()}},e)})),500,"field-trigger-delay")})})}}]))(),_defineProperty(_Class,"configuration",{identifiers:['[data-util~="form"]',"form"],args:{},autorun:!0,global:!1,save:!0}),_Class)),MJS.Namespace("Utils").export("FormFormat",(_Class2=(()=>{return _createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"type",null),_defineProperty(this,"triggers",null),_defineProperty(this,"format_aliases",{time:"date",datetime:"date"}),_defineProperty(this,"format_triggers",{price:"change",date:"change keyup keydown"}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var o,t,i,n,a=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.node.exists()){e.next=2;break}return e.abrupt("return");case 2:if(this.type=this.node.Attributes.get("data-format")||this.node.Properties.get("type"),this.triggers=this.node.Attributes.get("data-format-triggers")||null,o=this.format_aliases[this.type]||this.type){e.next=6;break}return e.abrupt("return");case 6:t=["format"],i=_createForOfIteratorHelper((this.triggers||this.format_triggers[o]||"change").split(" "));try{for(i.s();!(n=i.n()).done;)t.push("".concat(n.value,":").concat(this.ID))}catch(e){i.e(e)}finally{i.f()}this.node.Events.set(t,function(e,t){switch(o){case"date":var i=e.Attributes.get("data-date-format")||e.Attributes.get("data-"+a.type+"-format")||("time"===a.type?"H:i":"datetime"===a.type?"d-m-Y H:i":"d-m-Y"),n=a.Format.dateFormat(null,i,!0);switch(t.type){case"keyup":if(8===t.keyCode||e.getElement().selectionStart!==e.getElement().selectionEnd)return;break;case"keydown":if(8===t.keyCode)return;e.Properties.get("selectionStart")===e.Properties.get("selectionEnd")&&e.Properties.get("value").length>=n.length&&8!==t.keyCode&&46!==t.keyCode&&(t.keyCode<37||40<t.keyCode)&&t.preventDefault()}e.Properties.set("value",a.Format.dateFormat(e.Properties.get("value"),i));break;case"price":var r=e.Properties.get("value"),i=e.Attributes.get("data-country")||null;if(r){var s=null;switch(i){case"PL":case"CZ":case"HU":s=a.Format.priceFormat(r,2,null,","," ");break;case"US":s=a.Format.priceFormat(r,2,null,".",",");break;default:s=a.Format.priceFormat(r,2,null,",",".")}e.Properties.set("value",s)}}});case 10:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e})(),_defineProperty(_Class2,"configuration",{identifiers:["[data-format]"],args:{},autorun:!0,global:!1,save:!1}),_Class2)),MJS.Namespace("Utils").export("FormHotkeys",(_e5=(()=>{function l(e,t){_classCallCheck(this,l),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"active_keys",{}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Functions",MJS.Namespace("Core").import("Functions")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(e),this.args=t||{}}return _createClass(l,[{key:"__init",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o,a=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.node.exists()){e.next=2;break}return e.abrupt("return");case 2:if(t=this.node.Attributes.get("data-hotkeys")){e.next=5;break}return e.abrupt("return");case 5:i=[];try{i=this.Format.xhrDecode(t)}catch(e){i.push(t)}n=_createForOfIteratorHelper(i);try{for(n.s();!(r=n.n()).done;)s=r.value,(o=l.HotkeysMap.get(s)||{})[this.ID]=function(){return a.node.getElement().click()},l.HotkeysMap.set(s,o)}catch(e){n.e(e)}finally{n.f()}this.Events.removeGlobal("keydown:FormHotkeys"),this.Events.setGlobal("keydown:FormHotkeys",function(e){var t=String(e.key).toLowerCase(),i=(a.active_keys[t]=!0,[]);if(l.HotkeysMap.forEach(function(e,t){t.split("+").filter(function(e){return!Object.keys(a.active_keys).includes(e)}).length||i.push(t)}),i.length&&(i=i.reduce(function(e,t){return e.length>t.length?e:t})).length){e.preventDefault(),e.stopPropagation();for(var t=l.HotkeysMap.get(Array.isArray(i)?i[0]:i),n=0,r=Object.entries(t);n<r.length;n++){var s=_slicedToArray(r[n],2);s[0];(0,s[1])()}}}),this.Events.removeGlobal("keyup:FormHotkeys"),this.Events.setGlobal("keyup:FormHotkeys",function(e){e=String(e.key).toLowerCase();delete a.active_keys[e]});case 10:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e})(),_defineProperty(_e5,"configuration",{identifiers:["button[data-hotkeys]"],args:{},autorun:!0,global:!1,save:!0,remove:function(e,i){_e5.HotkeysMap.forEach(function(e,t){delete e[i.ID],_e5.HotkeysMap.set(t,e)})}}),_defineProperty(_e5,"HotkeysMap",new Map),_e5)),MJS.Namespace("Utils").export("FormLanguages",(_Class3=(()=>{return _createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"input_node",null),_defineProperty(this,"args",{}),_defineProperty(this,"active_language",null),_defineProperty(this,"available_languages",[]),_defineProperty(this,"editable_languages",[]),_defineProperty(this,"required_languages",[]),_defineProperty(this,"languages_value",null),_defineProperty(this,"languages_default_value",null),_defineProperty(this,"identifiers",{language_field:"language-field"}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.input_node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.input_node.exists()){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,new Promise(function(e){return setTimeout(e,100)});case 4:if(this.available_languages=this.args.languages||this.input_node.Attributes.get("data-languages")||[],this.editable_languages=this.args.languages_editable||this.input_node.Attributes.get("data-languages-editable")||[],this.required_languages=this.args.languages_required||this.input_node.Attributes.get("data-languages-required")||[],this.active_language=this.args.language||this.input_node.Attributes.get("data-language")||null,this.has_dropdown=null===this.input_node.Attributes.get("data-language-dropdown")||!!this.input_node.Attributes.get("data-language-dropdown"),this.languages_value=this.args.languages_value||null,this.input_node.Attributes.get("data-languages-value")&&(this.languages_value=this.Format.xhrDecode(this.input_node.Attributes.get("data-languages-value")),this.input_node.Attributes.remove("data-languages-value")),this.languages_default_value=this.args.languages_default_value||null,this.available_languages&&this.available_languages.length){e.next=14;break}return e.abrupt("return");case 14:("string"==typeof this.available_languages||this.available_languages instanceof String)&&(this.available_languages=this.Format.xhrDecode(this.available_languages)),("string"==typeof this.required_languages||this.required_languages instanceof String)&&(this.required_languages=this.Format.xhrDecode(this.required_languages||"")||[]),("string"==typeof this.editable_languages||this.editable_languages instanceof String)&&(this.editable_languages=this.Format.xhrDecode(this.editable_languages||"")||[]),t=_createForOfIteratorHelper(this.available_languages);try{for(t.s();!(i=t.n()).done;)n=i.value,r="".concat(this.input_node.Properties.get("name"),"[").concat(n,"]"),this.input_node.Properties.get("name").includes("[{{lang}}]")&&(r=this.input_node.Properties.get("name").replace("[{{lang}}]","[".concat(n,"]"))),this.input_node.parentNode().childNode('[data-identifier="'.concat(this.identifiers.language_field,'"][language="').concat(n,'"]'))||new MJS.Node("textarea",{classes:["form-control"],attributes:{"data-identifier":this.identifiers.language_field,language:n},properties:{name:r,required:this.input_node.Properties.get("required")&&this.required_languages.includes(n),disabled:!1,value:this.languages_value&&this.languages_value[n]?this.languages_value[n]:this.languages_value&&null!=this.languages_value[n]?"":this.languages_default_value},style:{display:"none"}}).moveToNode(this.input_node,"after")}catch(e){t.e(e)}finally{t.f()}(s=this.input_node.parentNode().childNodes('[data-identifier="'.concat(this.identifiers.language_field,'"]'))).length&&(this.input_node.Attributes.set("name","--".concat(this.input_node.Attributes.get("name"))),this.input_node.Events.set(["change:".concat(this.ID),"keyup:".concat(this.ID)],function(){o.ignore_change||o.saveLanguage(o.active_language)}),this.input_node.Properties.get("required")&&(this.input_node.parentNode("form").Events.set("submit:".concat(this.ID),function(){return s.foreach(function(e){!e.Properties.get("value")&&e.Properties.get("required")&&!e.Attributes.get("no-validate")&&o.has_dropdown&&(null!=(e=MJS.Node.getNode('.dropdown[data-id="'.concat(o.ID,'"] [value="').concat(e.Attributes.get("language"),'"]')))&&e.Events.run("click"),setTimeout(function(){return o.input_node.parentNode(".form-group").Classes.set("is-invalid")},100))})}),this.has_dropdown||s.foreach(function(e){return e.Properties.remove("required")}),this.required_languages.length)&&s.foreach(function(e){o.required_languages.includes(e.Attributes.get("language"))||e.Attributes.remove("required")}),this.skip_change=!0,this.setLanguage(this.active_language,!0),this.has_dropdown&&1<this.available_languages.length&&this.buildDropdown(),this.skip_change=!1,this.input_node.Utils.has("Editor"))&&this.Events.set(this.input_node.Utils.get("Editor"),"init:2",function(){o.input_node.Properties.get("value")||(o.skip_change=!0),o.setLanguage(o.active_language,!0),o.input_node.Properties.get("value")||(o.skip_change=!1)});case 19:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"setLanguage",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,i=1<arguments.length&&void 0!==arguments[1]&&arguments[1];t&&this.available_languages.includes(t)&&(e=this.input_node.parentNode().childNode('[data-identifier="'.concat(this.identifiers.language_field,'"][language="').concat(t,'"]')),i||this.saveLanguage(this.active_language),this.input_node.Properties.set("value",e.Properties.get("value")),this.input_node.Properties.set("required",e.Properties.get("required")),this.ignore_change=!0,this.skip_change||this.input_node.Events.run(["blur","change","language-switch"]),this.ignore_change=!1,this.active_language=t,null!=(t=(null==(i=this.input_node.parentNode(".input-group"))?void 0:i.childNode('[data-identifier="dropdown"]'))||(null==(e=this.input_node.parentNode())?void 0:e.childNode('[data-identifier="dropdown"]'))))&&t.Attributes.set("data-selected-language",this.active_language)}},{key:"saveLanguage",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;e&&this.available_languages.includes(e)&&((e=this.input_node.parentNode().childNode('[data-identifier="'.concat(this.identifiers.language_field,'"][language="').concat(e,'"]'))).Properties.set({value:this.input_node.Properties.get("value"),innerHTML:this.input_node.Properties.get("value")}),e.getElement().setCustomValidity(""))}},{key:"getLanguages",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t={},e=this.input_node.parentNode().childNodes('[data-identifier="'.concat(this.identifiers.language_field,'"]').concat(e?'[language="'.concat(e,'"]'):""));return e.length&&e.foreach(function(e){return t[e.Attributes.get("language")]=e.Properties.get("value")}),t}},{key:"buildDropdown",value:function(){var e,t=this,i=new MJS.Node("div",{classes:["dropdown","languages-dropdown"],attributes:{"data-id":this.ID,"data-identifier":"dropdown"}}),n=new MJS.Node("div",{classes:["dropdown-toggle"],attributes:{"data-identifier":"dropdown-toggle"},properties:{innerHTML:"NL"}}),r=new MJS.Node("div",{classes:["dropdown-list"],attributes:{"data-identifier":"dropdown-list"}}),s=_createForOfIteratorHelper(this.available_languages);try{for(s.s();!(e=s.n()).done;){var o=e.value;this.editable_languages.length&&!this.editable_languages.includes(o)||r.insertNode(new MJS.Node("a",{attributes:{href:"javascript:void(0)",value:o},properties:{innerHTML:String(o).toUpperCase()}}))}}catch(e){s.e(e)}finally{s.f()}i.insertNode(n),i.insertNode(r),this.input_node.Attributes.set("data-language-dropdown",1);var a=i.Utils.set("Dropdown");switch(!0){case"text"===this.input_node.Attributes.get("type"):i.moveToNode(this.input_node,"after");break;case this.input_node.Utils.has("Editor"):this.Events.set(this.input_node.Utils.get("Editor"),"init:1",function(){t.input_node.parentNode(".input-group").childNode(".tox-toolbar__group").insertNode(i),i.Classes.set("tox-tbtn")});break;case"TEXTAREA"===this.input_node.Properties.get("tagName"):i.moveToNode(this.input_node,"after")}this.Events.set(a,"change",function(){return t.setLanguage(a.selected)}),a.setOption(this.active_language)}}]);var e})(),_defineProperty(_Class3,"configuration",{identifiers:['[data-util~="languages"]'],args:{},autorun:!0,global:!1,save:!0,init:function(e,t,i){},remove:function(e,t){var i;null!=(i=t.input_node.parentNode())&&null!=(i=i.childNode('[data-identifier="dropdown"]'))&&i.remove(),null!=(i=t.input_node)&&null!=(i=i.Events)&&i.remove(["change:".concat(t.ID),"keyup:".concat(t.ID)])}}),_Class3)),MJS.Namespace("Utils").export("FormModel",(_Class4=(()=>{return _createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"submit_button",null),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Functions",MJS.Namespace("Core").import("Functions")),_defineProperty(this,"Fetch",MJS.Namespace("Core").import("Fetch")),_defineProperty(this,"XHR",MJS.Namespace("Core").import("XHR")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var n=this;this.node.Events.set("submit:".concat(this.ID),function(e,t){var i;if(t&&t.preventDefault(),null==(i=n.node.Utils.get("FormValidation"))||!i.validateForm())return n.node.Events.run("submit-error"),t.preventDefault();n.post()})}},{key:"post",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o,a,l,d,c,u,h,p,g,f,_,m;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.node.Events.run("submit-success"),i=new FormData(this.node.getElement()),null!=(t=this.node.Utils.get("Form"))&&t.submit_button&&i.append("submit",null==(t=this.node.Utils.get("Form"))?void 0:t.submit_button),e.next=5,new this.Fetch([this.node.Attributes.get("model"),null!=(t=this.node.Attributes.get("function"))?t:null],{body:i,query:this.node.Attributes.get("params")||this.Functions.getParams(window.location.search)}).then((()=>{var i=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,i){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",[t,i]);case 1:case"end":return e.stop()}},e)}));return function(e,t){return i.apply(this,arguments)}})());case 5:if(t=e.sent,i=_slicedToArray(t,2),n=i[0],r=i[1],this.response=n||{},this.node.Properties.get("submit-disable-timeout")&&clearTimeout(this.node.Properties.get("submit-disable-timeout")),this.node.childNodes(".submitting").length&&this.node.childNodes(".submitting").foreach(function(e){e.Properties.remove("disabled"),e.Classes.remove("submitting")}),this.Events.run(this,"xhr-success"),this.Events.run(this.node.Utils.get("Form"),"xhr-success"),this.XHR.processResponse(n,r),n.form&&(r=new MJS.Node(n.form),this.node.replaceWithNode(r),r.Utils.setAll()),r=this.node.parentNode(".dialog"),r=r?r.Properties.get("dialog"):null,n.controller&&r&&(s=null==(s=n.controller)?void 0:s.path,a=null==(a=n.controller)?void 0:a.function,o=null==(o=n.controller)?void 0:o.params,l={body:r.xhr.body,query:r.xhr.query,data:r.xhr.data,function:r.xhr.function},r.xhr.body=s,r.xhr.query=o,r.xhr.data=null,r.xhr.function=a,r.reload(),r.xhr=l),n.dialog&&r)return r.temp_xhr_data||(r.temp_xhr_data={}),r.old_xhr_data={xhr:{body:r.xhr.body,query:r.xhr.query,data:r.xhr.data,function:r.xhr.function,post:r.xhr.post,template:r.xhr.template},title:r.title,size:r.size,class:r.class,js_classes:r.js_classes},d=null==(s=n.dialog)?void 0:s.title,c=null==(o=n.dialog)?void 0:o.size,u=null==(a=n.dialog)?void 0:a.class,h=this.Format.xhrDecode((null==(l=n.dialog)?void 0:l.js_classes)||""),p=null!=(p=n.dialog)&&p.params?this.Functions.getParams((null==(p=n.dialog)?void 0:p.params)||""):null,g=null==(g=n.dialog)?void 0:g.function,f=null==(f=n.dialog)?void 0:f.controller,_=null==(_=n.dialog)?void 0:_.template,m=null==(m=n.dialog)?void 0:m.post,r.title=d||r.title,r.size=c||r.size,r.class=u||r.class,r.js_classes=h||r.js_classes,r.xhr.query=p||r.xhr.query,r.xhr.function=g||r.xhr.function,r.xhr.body=f||r.xhr.body,r.xhr.template=_||r.xhr.template,r.xhr.post=m||r.xhr.post,e.next=26,r.reload();e.next=42;break;case 26:r.temp_xhr_data={xhr:{}},d&&(r.temp_xhr_data.title=d),c&&(r.temp_xhr_data.size=c),u&&(r.temp_xhr_data.class=u),h&&(r.temp_xhr_data.js_classes=h),p&&(r.temp_xhr_data.xhr.query=p),g&&(r.temp_xhr_data.xhr.function=g),f&&(r.temp_xhr_data.xhr.body=f),_&&(r.temp_xhr_data.xhr.template=_),m&&(r.temp_xhr_data.xhr.post=m),r.xhr=r.old_xhr_data.xhr,r.title=r.old_xhr_data.title,r.size=r.old_xhr_data.size,r.class=r.old_xhr_data.class,r.js_classes=r.old_xhr_data.js_classes,r.old_xhr_data=null;case 42:n.refresh&&r&&null!=r&&r.refresh(),n.reload&&r&&null!=r&&r.reload(),n.close&&r&&null!=r&&r.close(),this.node.Attributes.get("auto-submit")&&this.node.Events.run("submit");case 43:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})}]);var e})(),_defineProperty(_Class4,"configuration",{identifiers:["form[model]"],args:{},autorun:!0,global:!1,save:!0}),_Class4)),MJS.Namespace("Utils").export("FormSteps",(_Class5=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"submit_button",null),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Functions",MJS.Namespace("Core").import("Functions")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var o,a=this,e=(this.form=__(this.node),this.form.childs(".form-steps-nav .step-link"));this.Functions.empty(e)||(o={steps:{},active_step:0,next:function(){this.activate(parseInt(this.active_step)+1)},prev:function(){this.activate(parseInt(this.active_step)-1)},activate:function(e,t){null==t&&(t=!0);var i=this.steps[e],n=parseInt(a.form.attribute("data-transition-delay")||0),r=a.form.child('.step-link[data-step="'+i+'"]').parent(".step"),s=a.form.child('.form-step[id="'+i+'"]'),i=a.form.child(".form-step.active");t&&(a.form.addClass("was-validated"),i.childs(".is-invalid").removeClass("is-invalid"),i.childs("input, select, textarea").foreach(function(e,t){t.hasAttribute("no-validate")?t.setCustomValidity(""):t.checkValidity()}),!a.Functions.empty(i.childs(".is-invalid")))||(a.form.removeClass("was-validated"),setTimeout(function(){o.deactivate(o.active_step),r.addClass("active"),s.addClass("active"),s.execute("active"),s.execute("activated"),o.active_step=e},n))},deactivate:function(e){var t;""!==e&&(e=this.steps[e],t=a.form.child('.step-link[data-step="'+e+'"]').parent(".step"),e=a.form.child('.form-step[id="'+e+'"]'),t.removeClass("active"),e.removeClass("active"),e.execute("deactivated"),this.active_step=0)}},e.foreach(function(i,e){var t,n;!0===e.hasHandlers||(i=parseInt(i),e.hasHandlers=!0,t=__(e).parent(".step"),a.Functions.empty(t))||(t=e.getAttribute("data-step"),n=a.form.child('.form-step[id="'+t+'"]'),o.steps[i]=t,__(e).on("click",function(e,t){!a.form.attribute("data-free-steps")&&i>parseInt(o.active_step)&&i!==parseInt(o.active_step)+1||o.activate(i)}),n.childs("button[data-next-step]").on("click",function(e,t){t.preventDefault(),o.next()}),n.childs("input[data-next-step]").on("change",function(e,t){null!=t&&"function"==typeof t.preventDefault&&t.preventDefault(),o.next()}),n.childs('input[type="radio"][data-next-step]').on("click",function(e,t){!1!==e.checked&&__(e).execute("change")}),n.childs("[data-previous-step]").on("click",function(e,t){t.preventDefault(),o.prev()}))}),o.activate(o.active_step,!1))}}]))(),_defineProperty(_Class5,"configuration",{identifiers:["form"],args:{},autorun:!0,global:!1,save:!0}),_Class5)),MJS.Namespace("Utils").export("FormValidation",(_Class6=(()=>{return _createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"ValidationMap",new Map),_defineProperty(this,"form_node",null),_defineProperty(this,"args",{}),_defineProperty(this,"submit_button",null),_defineProperty(this,"lang",null),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.form_node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var i=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.form_node.exists()&&(this.lang=this.form_node.Attributes.get("lang")||null,this.form_node.Events.set("click:".concat(this.ID),function(e,t){i.submit_button="submit"===t.target.type?e:null}),this.form_node.Events.set("submit:".concat(this.ID),function(e,t){if(i.form_node.Classes.set("was-validated"),!i.validateForm())return i.form_node.Events.run("submit-error"),t.preventDefault();i.form_node.Events.run("submit-success");t=i.form_node.childNodes('button[type="submit"]');t.length&&t.foreach(function(e){e.Classes.set("submitting");var t=setTimeout(function(){e.Properties.set("disabled",!0)});i.form_node.Properties.set("submit-disable-timeout",t)})}),this.setFormFieldValidations());case 1:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"validateForm",value:function(){var t,i=this,e=this.form_node.childNodes('input:not([type="hidden"]), select, textarea');return!e.length||(t=!0,e.foreach(function(e){if(!t)return i.validateFormField(e);t=i.validateFormField(e)}),t)}},{key:"setFormFieldValidations",value:function(){var n=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;(e=e||this.form_node.childNodes(".form-control, .custom-control-input"))&&(e=MJS.Node.prototype.isPrototypeOf(e)?e.toNodeList():e).foreach(function(i){i.Events.set("invalid:".concat(n.ID),function(){i.parentNode(".form-group").Classes.set("is-invalid"),i.getElement().setCustomValidity("Invalid")}),i.Events.set(["blur:".concat(n.ID),"input:".concat(n.ID)],function(e,t){n.validateFormField(i,t)})})}},{key:"validateFormField",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},i=!0;if("function"==typeof e.Properties.get("setCustomValidity")&&(!e.parentNode('[data-type="select"]')||e.Classes.has("custom-select"))&&!("blur"===t.type&&"file"===e.Properties.get("type")||(null!=(t=e.parentNode(".is-invalid"))&&t.Classes.remove("is-invalid"),e.getElement().setCustomValidity(""),e.Attributes.get("no-validate"))||e.Properties.get("disabled"))){t=e.Attributes.get("validation-type")||e.Properties.get("type");if(this.ValidationMap.has(t)){var n,r=_createForOfIteratorHelper(this.ValidationMap.get(t));try{for(r.s();!(n=r.n()).done;)i=(0,n.value)(e)}catch(e){r.e(e)}finally{r.f()}}i=!!i&&e.getElement().checkValidity(),e.Properties.get("policy-invalid")&&(i=!1),e.Properties.get("trigger-invalid")&&(i=!1),(i=e.Properties.get("force-invalid")?!1:i)||(e.parentNode(".form-group").Classes.set("is-invalid"),e.getElement().setCustomValidity("error"))}return i}},{key:"registerValidation",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null;t&&i&&((e=this.ValidationMap.has(t)?this.ValidationMap.get(t):[]).push(i),this.ValidationMap.set(t,e))}}]);var e})(),_defineProperty(_Class6,"configuration",{identifiers:["form"],args:{},autorun:!0,global:!1,save:!0}),_Class6)),MJS.Namespace("Utils").extend("FormValidation",(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"__constructor",value:function(){this.registerValidation("checkbox",function(e){var t,i,n,r=e.Attributes.get("name"),s=MJS.Node.getNodes('input[type="checkbox"][name="'.concat(r,'"]'));return!(s.length&&(t=MJS.Node.getNodes('input[type="checkbox"][name="'.concat(r,'"]:checked')),r=MJS.Node.getNodes('input[type="checkbox"][name="'.concat(r,'"]:not(:checked)')),s.foreach(function(e){if(void 0===e.Properties.get("is-required")&&e.Properties.set("is-required",e.Properties.get("required")),!0===e.Properties.get("disabled")&&!0!==e.Properties.get("internally_disabled"))return e.Properties.set("externally_disabled",!0);e.Properties.remove("disabled"),e.getElement().setCustomValidity("")}),(i=e.Attributes.get("max-checked")||null)&&parseInt(t.length)>=parseInt(i)&&r.foreach(function(e){e.Properties.set("disabled",!0),e.Properties.set("internally_disabled",!e.Properties.get("externally_disabled",!0))}),(i=e.Attributes.get("min-checked")||null)&&parseInt(t.length)<parseInt(i)?(r.foreach(function(e){return e.getElement().setCustomValidity("error")}),1):t.length?(s.foreach(function(e){e.getElement().setCustomValidity(""),e.Properties.remove("required")}),0):(n=!1,s.foreach(function(e){n=n||e.Properties.get("is-required"),e.Properties.set("required",e.Properties.get("is-required"))}),n)))})}}]))()),MJS.Namespace("Utils").export("Color",(_Class7=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"identifiers",{input:"color-input",input_colorpicker:"colorpicker-input"}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Functions",MJS.Namespace("Core").import("Functions")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var n=this,r=this.node.childNode('[data-identifier="'.concat(this.identifiers.input,'"]')),s=this.node.childNode('[data-identifier="'.concat(this.identifiers.input_colorpicker,'"]'));s&&s.Events.set("input:".concat(this.ID),function(e){return r.Properties.set("value",null==(e=e.Properties.get("value"))?void 0:e.toUpperCase())}),r&&r.Events.set("keyup:".concat(this.ID),function(e,t){var i=r.Properties.get("value");i=(i="#"+(i=i.replaceAll("#",""))).toUpperCase(),r.Properties.set("value",i),7===e.Properties.get("value").length&&n.Functions.delay(function(){return s.Properties.set("value",r.Properties.get("value"))},100)})}}]))(),_defineProperty(_Class7,"configuration",{identifiers:['[data-util="color"]'],args:{},autorun:!0,global:!1,save:!0}),_Class7)),MJS.Namespace("Utils").export("Editor",(_Class8=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"tinymce_instance",null),_defineProperty(this,"options",{}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){this.node.exists()&&(this.node.Attributes.set("plugin-id",this.ID),this.getOptions(),this.setFunctions(),tinymce.init(this.options))}},{key:"getOptions",value:function(){this.options.plugins=(this.node.Attributes.get("texteditor-plugins")||"")+" autoresize lists link table code",this.options.toolbar="undo "+(this.node.Attributes.get("texteditor-toolbar")||"bold italic numlist bullist table link code"),this.options.min_height=parseInt(this.node.Attributes.get("texteditor-height")||150),this.options.templates=this.node.Attributes.has("texteditor-templates")?this.Format.xhrDecode(this.node.Attributes.get("texteditor-templates")):{},this.options.language=this.node.Attributes.get("texteditor-language")||"en",this.options.language_url=this.node.Attributes.get("texteditor-language-url")||"",this.options.skin=!1,this.options.content_css=!1,this.options.contextmenu=!1,this.options.selector='[plugin-id="'+this.ID+'"]',this.options.statusbar=!1,this.options.autoresize_bottom_margin=0,this.options.convert_urls=!1,this.options.menubar=!1,this.options.relative_urls=!1,this.options.remove_script_host=!0,this.options.visualblocks_default_state=!0,this.options.paste_as_text=!0,this.node.Attributes.has("texteditor-paste-image")&&(this.options.paste_data_image=!0,this.options.paste_data_images=!0),this.options.content_style='body { font-family:"Arial"; font-size:14px;line-height:1.3; }'}},{key:"setFunctions",value:function(){var t=this;this.options.setup=function(e){e.on("blur",function(){t.node.Properties.set("value",e.getContent()),t.node.Properties.set("innerHTML",e.getContent()),e.iframeElement&&e.iframeElement.closest(".is-invalid")&&e.iframeElement.closest(".is-invalid").classList.remove("is-invalid"),t.node.Events.run(["change","blur","tinymce-change"])},t.ID),e.on("keyup",function(){t.node.Properties.set("value",e.getContent()),t.node.Events.run(["keyup","change"])}),e.on("init",function(){t.tinymce_instance=e,t.node.Events.set("language-switch",function(){"Array"!==t.node.Properties.get("value")&&t.tinymce_instance.setContent(t.node.Properties.get("value"))}),setTimeout(function(){t.Events.run(t,"init:1"),t.Events.run(t,"init:2")},200)})}}}]))(),_defineProperty(_Class8,"configuration",{identifiers:["[texteditor]"],args:{},autorun:!0,global:!1,save:!0,remove:function(e,t){t&&t.tinymce_instance&&t.tinymce_instance.destroy()}}),_Class8)),MJS.Namespace("Utils").export("Datepicker",(_Class9=(()=>{return _createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"input_node",null),_defineProperty(this,"alt_input_node",null),_defineProperty(this,"args",{}),_defineProperty(this,"options",{}),_defineProperty(this,"default_locale","nl"),_defineProperty(this,"default_type","date"),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),this.input_node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var n,t,r=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:this.options=this.getFlatpickrOptions(),this.flatpickr=flatpickr(this.input_node.getElement(),this.options),this.alt_input_node=new MJS.Node(this.input_node.getElement().nextSibling),(t=null==(t=this.input_node.parentNode("form"))?void 0:t.Utils.get("FormValidation"))&&t.setFormFieldValidations(this.alt_input_node),this.input_node.Events.set("change:".concat(this.ID),function(e){return e.Attributes.set({"data-value":e.Properties.get("value"),value:e.Properties.get("value")})}),n=this.Format.dateFormat(null,this.options.altFormat,!0),this.alt_input_node.Events.set("keyup:".concat(this.ID),function(e,t){var i=e.getElement();"Backspace"!==t.key&&i.selectionStart===i.selectionEnd&&(t=r.Format.dateFormat(e.Properties.get("value"),r.options.altFormat),e.Properties.set("value",t),t.length>=n.length)&&r.flatpickr.setDate(t,null,r.options.altFormat)}),this.alt_input_node.Events.set("keydown:".concat(this.ID),function(e,t){var i=e.getElement();"Tab"!==t.key&&i.selectionStart===i.selectionEnd&&e.Properties.get("value").length>=n.length&&"Backspace"!==t.key&&"Delete"!==t.key&&(t.keyCode<37||40<t.keyCode)&&t.preventDefault()}),(t=null==(t=this.input_node.parentNode().childNode("[data-toggle]"))?void 0:t.parentNode(".input-group-append"))&&t.Events.set("click:".concat(this.ID),function(){return r.flatpickr.toggle()}),(t=null==(t=this.input_node.parentNode().childNode("[data-clear]"))?void 0:t.parentNode(".input-group-append"))&&t.Events.set("click:".concat(this.ID),function(){return r.flatpickr.clear()});case 9:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"getFlatpickrOptions",value:function(){var e=Object.assign({},this.args.options);switch(e.locale=this.input_node.Attributes.get("datepicker-locale")||document.documentElement.getAttribute("lang")||this.default_locale,this.type=this.input_node.Attributes.get("datepicker-type")||this.default_type,this.type){case"date":e.altFormat="d-m-Y";break;case"datetime":e.enableTime=!0,e.altFormat="d-m-Y H:i";break;case"time":e.enableTime=!0,e.noCalendar=!0,e.altFormat="H:i",e.dateFormat="H:i"}return"en"===e.locale&&(e.locale="default",e.altFormat="Y-m-d"),e.altInput=this.input_node.Attributes.get("datepicker-altinput")||!0,e.dateFormat=this.input_node.Attributes.get("datepicker-format")||e.dateFormat||"Y-m-d H:i:S",e.altFormat=this.input_node.Attributes.get("datepicker-altformat")||e.altFormat||"d-m-Y",e.minTime=this.input_node.Attributes.get("datepicker-mintime")||"",e.maxtime=this.input_node.Attributes.get("datepicker-maxtime")||"",e.minDate=this.input_node.Attributes.get("datepicker-mindate")||"",e.maxDate=this.input_node.Attributes.get("datepicker-maxdate")||"",e.animate=!1,e.weekNumbers=!0,e.allowInput=!0,e.time_24hr=!0,e.clickOpens=this.input_node.Attributes.get("datepicker-clickopen")||!1,e.defaultHour=this.input_node.Attributes.get("datepicker-defaulthour")||e.defaultHour||12,e.monthSelectorType="static",e}}]);var e})(),_defineProperty(_Class9,"configuration",{identifiers:['[data-util="datepicker"]'],args:{},autorun:!0,global:!1,save:!0,init:function(e,t,i){},remove:function(e,t){t&&null!=(t=t.flatpickr)&&t.destroy()}}),_Class9)),MJS.Namespace("Utils").export("File",(_Class10=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"classes",{clear:"file-clear"}),_defineProperty(this,"icons",{clear:"fal fa-times"}),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var n=this;this.label_node=this.node.parentNode().childNode(".custom-control-label"),this.label_default_placeholder=this.label_node.Properties.get("innerHTML")||"",this.node.Events.set("change:".concat(this.ID),function(e,t){if(!n.validateInput(t))return __(n.node.getElement()).validate(!1),n.node.Properties.set("force-invalid",!0),n.clearInput(),t.preventDefault();__(n.node.getElement()).validate(!0),n.node.Properties.remove("force-invalid");var i=n.node.parentNode().childNode(".".concat(n.classes.clear));i.Style.set("display","none"),e.Properties.get("value")&&i.Style.remove("display"),n.label_node.Properties.set("innerHTML",t.target.files[0].name)}),this.node.parentNode().childNode(".input-group-append").Events.set("click",function(){return n.node.getElement().click()}),new MJS.Node("div",{attributes:{ID:this.ID},properties:{innerHTML:'<i class="'.concat(this.icons.clear,'"></i>')},classes:this.classes.clear,style:{display:"none"},events:{click:function(e){return n.clearInput()}}}).moveToNode(this.node,"after")}},{key:"clearInput",value:function(){var e=this.node.parentNode().childNode(".".concat(this.classes.clear));this.node.Properties.remove("value"),e.Style.set("display","none"),this.label_node.Properties.set("innerHTML",this.label_default_placeholder)}},{key:"validateInput",value:function(e){var t=this.node.Attributes.get("accept")||this.node.Properties.get("accept");if(t){"string"==typeof t&&(t=t.split(","));var i,n=_createForOfIteratorHelper(e.target.files);try{for(n.s();!(i=n.n()).done;){var r=i.value,s=r.name.split(".").pop();if(!t.includes(r.type)&&!t.includes(s))return!1}}catch(e){n.e(e)}finally{n.f()}}return!0}}]))(),_defineProperty(_Class10,"configuration",{identifiers:['[data-util="file"]'],args:{},autorun:!0,global:!1,save:!0,remove:function(e,t){var i=null==(i=t.node.parentNode())?void 0:i.childNode(".".concat(t.classes.clear)),t=(i&&i.remove(),null==(i=t.node.parentNode())?void 0:i.childNode(".input-group-append"));t&&t.Events.clear()}}),_Class10)),MJS.Namespace("Utils").export("Phone",(_Class11=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"identifiers",{country_codes:"phone-country-codes",input:"phone-input",input_hidden:"phone-input-hidden"}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var e=this.node.childNode('[data-identifier="'.concat(this.identifiers.country_codes,'"]')),t=this.node.childNode('[data-identifier="'.concat(this.identifiers.input_hidden,'"]')),i=this.node.childNode('[data-identifier="'.concat(this.identifiers.input,'"]'));e&&i&&t&&(e.Events.set("change:".concat(this.ID),function(){t.Properties.set("value",i.Properties.get("value")?e.Properties.get("value")+i.Properties.get("value"):"")}),i.Events.set(["change:".concat(this.ID),"keydown:".concat(this.ID,":500")],function(){t.Properties.set("value",i.Properties.get("value")?e.Properties.get("value")+i.Properties.get("value"):"")}))}}]))(),_defineProperty(_Class11,"configuration",{identifiers:['[data-util~="phone"]'],args:{},autorun:!0,global:!1,save:!0}),_Class11)),__Instance.util("Populator",{identifiers:['[data-util="populator"]'],autorun:!0,global:!1,init:function(e,t){},remove:function(e,t){t=t.populator_container;t.before(e),t.remove()}},(()=>_createClass(function e(t,i){_classCallCheck(this,e),this.element=t||null,this.args=i||{},this.items={},this.items_order=[],this.edit_item=null,this.element_options=null,this.classes={container:"populator-container",list:"populator-list",item:"populator-item",input:"populator-input"},this.icons={remove:"fal fa-times"},this.languages={placeholder:"Type here to add something"},this.xhr={model:null,function:null,params:null,params_elements:null,params_elements_data:{}}},[{key:"__include",value:function(){this._Fetch=MJS.Namespace("Core").import("Fetch"),this._Format=MJS.Namespace("Core").import("Format"),this._Functions=MJS.Namespace("Core").import("Functions")}},{key:"__init",value:function(){var e=this;this.readElementProperties(),this.setElementClasses(),this.setElementAttributes(),this.element.observe("change",function(){e.readElementProperties(),e.setElementState()},this.ID,{attributes:!0,childList:!1,characterData:!1,subtree:!1}),this.render(),this.setEvents(),this.loadStaticOptions(),this.loadDynamicOptions(),this.xhr.params_elements&&this.processParamsElements()}},{key:"loadStaticOptions",value:function(){var n=this;this._Functions.empty(this.element_options)||this.element_options.foreach(function(e,t){var i;n._Functions.empty(n.xhr.model)||n._Functions.empty(n.xhr.function)?(n.addItem(t.value),__(t).remove()):(i=Object.assign({},n.xhr),n._Functions.empty(n.xhr.params_elements_data)||__(n.xhr.params_elements_data).foreach(function(e,t){i[e]=t}),i.value=t.value,__(t).remove(),new n._Fetch([n.xhr.model,n.xhr.function],{body:i,query:n.xhr.params}).then(function(e){__(e).foreach(function(e,t){t.value==i.value&&n.addItem(t.value,t.label)})}))})}},{key:"loadDynamicOptions",value:function(){var i,n=this;this.xhr.model&&(i=Object.assign({},this.xhr),this._Functions.empty(this.xhr.params_elements_data)||__(this.xhr.params_elements_data).foreach(function(e,t){i[e]=t}),new this._Fetch([this.xhr.model,this.xhr.function],{body:i,query:this.xhr.params}).then(function(e){__(e).foreach(function(e,t){n.addItem(t.label)})}))}},{key:"refresh",value:function(){var r=this;this.items={},this.items_order=[],this.populator_list.childs("."+this.classes.item).foreach(function(e,t){var i=__(t).prop("itemID"),n=__(t).prop("value");r.items[i]=__(t),r.items_order.push(i),r.element.child('[data-id="'+i+'"]').remove(),r.element.append(__(new MJS.Node('<option selected data-id="'+i+'" value="'+n+'">'+n+"</option>")))})}},{key:"processParamsElements",value:function(){var n=this;__(this.xhr.params_elements).foreach(function(e,t){var i=n.element.parent("form").childs(t);n._Functions.empty(i)||(n.xhr.params_elements_data[t]=i.prop("value"),i.on("change",function(e){n.xhr.params_elements_data[t]=__(e).prop("value"),__(n.items).foreach(function(e,t){n.removeItem(e)}),n.loadDynamicOptions()}))})}},{key:"setEvents",value:function(){var n=this,e=this.element.parent("form").util("FormValidation",!0),r=(this._Functions.empty(e)||e.setFormFieldValidations(new MJS.Node(this.populator_input)),this.populator_container.on("click",function(e,t){t.stopPropagation(),(__(t.target).hasClass(n.classes.container)||__(t.target).hasClass(n.classes.list))&&n.populator_input.nodes().focus()},this.ID),0),e=(this.populator_input.on("keydown",function(e,t){var i=e.value||"";if(13===t.which){if(t.preventDefault(),t.stopPropagation(),n.populator_input.execute("change"),!1===e.checkValidity())return;n.addItem(i),e.value=""}8===t.which&&n._Functions.empty(i)&&2===++r&&(t.preventDefault(),t.stopPropagation(),n.removeLastItem(),r=0)},this.ID),this.populator_input.on("blur",function(e,t){var i=e.value||"";n.populator_input.execute("change"),!1!==e.checkValidity()&&(n.addItem(i),e.value="")},this.ID),this.element.parent("form"));this._Functions.empty(e)||this._Functions.empty(this.element.prop("required"))||e.on("submit",function(e,t){n._Functions.empty(n.items)&&(n.populator_input.nodes().setCustomValidity("Invalid"),n.populator_input.nodes().checkValidity())})}},{key:"setElementState",value:function(){!0===this.disabled?(this.populator_input.hide(),__(this.items).foreach(function(e,t){t.child("[remove]").hide()})):(this.populator_input.show("inline-block"),__(this.items).foreach(function(e,t){t.child("[remove]").show("inline-block")}))}},{key:"setItemEvents",value:function(e){var i=this,n=e.prop("itemID");e.child("[remove]").on("click",function(e,t){t.stopPropagation(),!0!==i.disabled&&i.removeItem(n)},this.ID),e.on("dblclick",function(e,t){t.stopPropagation(),!0!==i.disabled&&i.editItemStart(n)},this.ID)}},{key:"addItem",value:function(e,t){var i;this._Functions.empty(e)||(e=t||e,i=(t=this.renderItem()).prop("itemID"),t.child("[value]").prop("innerHTML",e),t.prop("value",e),e=__(new MJS.Node('<option selected data-id="'+i+'" value="'+e+'">'+e+"</option>")),this.element.append(e),this.items[i]=t,this.items_order.push(i),this.populator_input.nodes().setCustomValidity(""),this.populator_input.nodes().checkValidity(),__(this).execute("add"))}},{key:"saveItem",value:function(e,t){var i=this.items[t];if(this._Functions.empty(i))return!1;if(this._Functions.empty(e))return this.removeItem(t);i.child("[value]").prop("innerHTML",e),i.prop("value",e);i=this.element.child('[data-id="'+t+'"]');i.attribute("value",e),i.prop("innerHTML",e),__(this).execute("save")}},{key:"removeItem",value:function(e){var t=this.items[e];if(this._Functions.empty(t))return!1;t.remove(),delete this.items[e],this.element.child('[data-id="'+e+'"]').remove(),__(this).execute("remove")}},{key:"editItemStart",value:function(i){var n=this,e=(null!==this.edit_item&&this.editItemFinish(this.edit_item),this.items[i]);if(this._Functions.empty(e))return!1;this.edit_item=i;var t=__(this.populator_input.nodes().cloneNode());t.prop("placeholder","Edit option"),t.prop("value",e.prop("value")),t.attribute("data-edit-id",i),e.child("span").prop("innerHTML",null),e.child("span").append(t),t.nodes().select(),t.on("keydown",function(e,t){13===t.which&&(t.preventDefault(),t.stopPropagation(),n.editItemFinish(i))},this.ID),t.on("blur",function(){n.editItemFinish(i)},this.ID),__(this).execute("edit")}},{key:"editItemFinish",value:function(e){var t=this.items[e],i=this.populator_list.child('[data-edit-id="'+e+'"]');if(this._Functions.empty(t)||this._Functions.empty(i))return!1;t=i.prop("value");i.remove(),this.edit_item=null,this.saveItem(t,e)}},{key:"removeLastItem",value:function(){this.removeItem(this.items_order.pop())}},{key:"render",value:function(){this.populator_container=__(new MJS.Node("<div></div>")),this.populator_container.addClass(this.classes.container),this.populator_container.addClass("form-control"),this.populator_list=__(new MJS.Node("<div></div>")),this.populator_list.addClass(this.classes.list),this.populator_container.append(this.populator_list);var e=this.args.type||"text";this.populator_input=__(new MJS.Node('<input type="input" validation-type="'+e+'" name="'+this.ID+'_input" />')),this.populator_input.addClass(this.classes.input),this.populator_input.prop("placeholder",this.element.attribute("data-placeholder")||this.languages.placeholder),this.populator_list.append(this.populator_input),this.element.before(this.populator_container),this.populator_container.append(this.element),this.element.hide()}},{key:"renderItem",value:function(){var e=__(new MJS.Node("<div><span value></span></div>")),t=(e.addClass(this.classes.item),e.addClass("badge"),e.addClass("badge-primary"),e.assignID(),e.prop("itemID",e.prop("ID")),__(new MJS.Node('<i remove class="remove"></i>')));return t.addClass(this.icons.remove),e.append(t),this.setItemEvents(e),this.populator_input.before(e),e}},{key:"enableDragdrop",value:function(){var e=this;this.populator_container.Dragdrop({container:"."+this.classes.list,item:"."+this.classes.item,key:"data-id",hitboxes:{container:[],item:["left","right"],show:!1},watch:!0}),this.populator_container.util("Dragdrop").on("change",function(){e.refresh()})}},{key:"setElementClasses",value:function(){this.element.addClass("populator")}},{key:"setElementAttributes",value:function(){this.element.attribute("validation-type",null)}},{key:"readElementProperties",value:function(){this.ID=this.element.prop("id")||"",this.name=this.element.prop("name")||"",this.required=this.element.prop("required")||!1,this.disabled=this.element.prop("disabled")||!1,this.args.type=this.element.attribute("validation-type")||null,this.element_options=this.element.childs("option[selected]"),this.xhr.model=this.element.attribute("xhr-model")||null,this.xhr.function=this.element.attribute("xhr-function")||null,this.xhr.params=this.element.attribute("xhr-params")||null,this.xhr.params_elements=this.element.attribute("xhr-params-elements")?this._Format.xhrDecode(this.element.attribute("xhr-params-elements")):null}}]))()),MJS.Namespace("Utils").export("Price",(_Class12=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var e=this;new MJS.Node('<input type="hidden" name="'.concat(this.node.Properties.get("name"),'"/>')).moveToNode(this.node,"before"),this.node.Properties.set("name","--"+this.node.Properties.get("name")),this.node.Events.set(["change:".concat(this.ID),"blur:".concat(this.ID)],function(){return e.save()}),this.node.Properties.get("value")&&setTimeout(function(){return e.node.Events.run("change")},500)}},{key:"save",value:function(){var e;null!=(e=this.node.parentNode().childNode('input[type="hidden"]'))&&e.Properties.set("value",this.Format.priceFormat(this.node.Properties.get("value"),2,null,".",""))}}]))(),_defineProperty(_Class12,"configuration",{identifiers:['[data-util~="price"]'],args:{},autorun:!0,global:!1,save:!0,init:function(e,t,i){var n,e=new MJS.Node(e);"--"===e.Properties.get("name").substring(0,2)&&(null!=(n=e.parentNode().childNode('input[type="hidden"]'))&&n.remove(),e.Properties.set("name",null==(n=e.Properties.get("name"))?void 0:n.substring(2,e.Properties.get("name").length)))},remove:function(e,t){var i,e=new MJS.Node(e);null!=(i=e.parentNode().childNode('input[type="hidden"]'))&&i.remove(),e.Properties.set("name",null==(i=e.Properties.get("name"))?void 0:i.substring(2,e.Properties.get("name").length))}}),_Class12)),MJS.Namespace("Utils").export("Radio",(_Class13=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"checked",null),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var e,t=this;null!=(e=this.node.parentNode())&&null!=(e=e.childNode("label"))&&e.Events.set("mousedown:".concat(this.ID),function(){return t.checked=t.node.getElement().checked}),this.node.Events.set("click:".concat(this.ID),function(){t.node.getElement().checked=!t.checked,t.checked&&t.node.Events.run("change")})}}]))(),_defineProperty(_Class13,"configuration",{identifiers:['input[type="radio"]'],autorun:!0,global:!1,save:!0}),_Class13)),MJS.Namespace("Utils").extend("FormValidation",(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"__constructor",value:function(){this.registerValidation("radio",function(e){var t=e.Properties.get("name"),i=MJS.Node.getNodes('input[type="radio"][name="'.concat(t,'"]'));return!i.length||(e.parentNode(".form-group").childNode('input[type="radio"][name="'.concat(t,'"]:checked'))?(i.foreach(function(e){return e.getElement().setCustomValidity("")}),!0):!e.Properties.get("required"))})}}]))()),MJS.Namespace("Utils").export("Select",(_Class14=(()=>{return _createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"select_node",null),_defineProperty(this,"args",{}),_defineProperty(this,"search_delay",500),_defineProperty(this,"xhr",{limit:0,offset:0,search:"",model:null,function:null,params:null}),_defineProperty(this,"xhr_busy",!1),_defineProperty(this,"xhr_done",!1),_defineProperty(this,"opened",!1),_defineProperty(this,"loading_predefined_values",!1),_defineProperty(this,"selected_values",[]),_defineProperty(this,"last_selected_option",{label:null,value:null}),_defineProperty(this,"filter_values",{}),_defineProperty(this,"scroll_options",{behavior:"auto",block:"nearest",inline:"nearest"}),_defineProperty(this,"classes",{container:"select-container",container_active:"select-open",list:"select-list",toggle:"select-toggle",clear:"select-clear",dropdown:"select-dropdown",dropdown_list:"select-dropdown-list",dropdown_option:"select-dropdown-option",dropdown_option_label:"select-dropdown-option-label",dropdown_option_childs:"select-dropdown-option-childs",badge:"select-badge",input:"select-input"}),_defineProperty(this,"icons",{toggle:"fa fa-chevron-down icon-chevron-down",clear:"fal fa-times icon-times",remove:"fal fa-times icon-times",handle:"fal fa-grip-lines icon-grip-lines"}),_defineProperty(this,"lang",{placeholder:"Search"}),_defineProperty(this,"Fetch",MJS.Namespace("Core").import("Fetch")),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Functions",MJS.Namespace("Core").import("Functions")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.select_node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:(o=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o,a=this;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.ID=this.select_node.Properties.get("id")||this.Format.randomString(10),this.name=this.select_node.Properties.get("name")||"",this.required=!!this.select_node.Properties.get("required"),this.disabled=!!this.select_node.Properties.get("disabled"),this.readonly=!!this.select_node.Properties.get("readonly"),this.multiple=!!this.select_node.Properties.get("multiple"),null!=(t=this.args).open_on_focus||(t.open_on_focus=null===this.select_node.Attributes.get("data-open-on-focus")||!!this.select_node.Attributes.get("data-open-on-focus")),null!=(t=this.args).close_on_option||(t.close_on_option=this.select_node.Attributes.has("data-close-on-option")),null!=(t=this.args).filter_elements||(t.filter_elements=this.select_node.Attributes.has("xhr-params-elements")?this.Format.xhrDecode(this.select_node.Attributes.get("xhr-params-elements")):null),this.args.filter_elements_clear_option=!!this.select_node.Attributes.get("xhr-params-elements-clear-option"),null!=(t=this.args).has_clear||(t.has_clear=this.select_node.Attributes.has("data-clear")),null!=(t=this.args).has_sort||(t.has_sort=this.select_node.Attributes.has("data-sort")),null!=(t=this.args).first_option_selected||(t.first_option_selected=!!this.select_node.Attributes.get("first-option-selected")),null!=(t=this.args).option_render||(t.option_render=this.select_node.Attributes.has("data-option-render")?atob(this.select_node.Attributes.get("data-option-render")):null),this.xhr=this.args.xhr||{},null!=(t=this.xhr).model||(t.model=this.select_node.Attributes.get("xhr-model")),null!=(t=this.xhr).function||(t.function=this.select_node.Attributes.get("xhr-function")),null!=(t=this.xhr).params||(t.params=this.select_node.Attributes.get("xhr-params")),null!=(t=this.xhr).limit||(t.limit=parseInt(this.select_node.Attributes.get("xhr-limit")||0)),null!=(t=this.xhr).offset||(t.offset=parseInt(this.select_node.Attributes.get("xhr-offset")||0)),null!=(t=this.args).label_property||(t.label_property=null),null!=(t=this.args).value_property||(t.value_property=null),this.buildSelect(),this.xhr.model&&this.getSelectContainer()||this.loadPredefinedValue(),this.xhr.model&&this.getSelectContainer()&&(this.loadPredefinedValue(!0),null!=(t=this.getSelectContainer()))&&t.Observers.set("view:".concat(this.ID),function(e){null!=(e=e.Observers)&&e.remove("view:".concat(a.ID)),a.removeOptions(),a.loadPredefinedValue()}),this.select_node.Observers.set("change:".concat(this.ID),function(){var e;MJS.Node.getNode('[name="'.concat(a.ID,'_input"]'))&&(a.required=!(null==(e=a.select_node)||!e.Properties.get("required")),a.disabled=!(null==(e=a.select_node)||!e.Properties.get("disabled")),MJS.Node.getNode('[name="'.concat(a.ID,'_input"]')).Properties.set("disabled",a.disabled),MJS.Node.getNode('[name="'.concat(a.ID,'_input"]')).Properties.set("readonly",a.readonly))},{attributes:!0,childList:!1,characterData:!1,subtree:!1}),this.select_node.Observers.run("change:".concat(this.ID)),this.args.filter_elements&&this.args.filter_elements_clear_option)for(i=0,n=Object.entries(this.args.filter_elements);i<n.length;i++)r=_slicedToArray(n[i],2),r[0],r=r[1],(o=(o=null==(o=this.select_node.parentNode(".row"))?void 0:o.childNodes("".concat(r,':not([data-identifier="default_empty_value"])'))).length?o:null==(s=this.select_node.parentNode("form"))?void 0:s.childNodes("".concat(r,':not([data-identifier="default_empty_value"])'))).length&&o.foreach(function(e){return e.Events.set("change:".concat(a.ID),function(){return a.deselectOptions()})});case 1:case"end":return e.stop()}},e,this)})),function(){return o.apply(this,arguments)})},{key:"buildSelect",value:function(){var i,n,e,r=this,t=new MJS.Node("div",{classes:[this.classes.list],attributes:{ID:this.ID}}),s=new MJS.Node("div",{classes:[this.classes.toggle],properties:{ID:this.ID,innerHTML:'<i class="'.concat(this.icons.toggle,'"></i>')},events:_defineProperty({},"click:".concat(this.ID),function(){return r.opened?r.closeDropdown():r.openDropdown()})}),o=new MJS.Node("input",{classes:[this.classes.input],attributes:{ID:this.ID,name:"".concat(this.ID,"_input"),autocomplete:"off",placeholder:this.select_node.Attributes.get("data-placeholder")||this.lang.placeholder},events:_defineProperty(_defineProperty(_defineProperty(_defineProperty({},"click:".concat(this.ID),function(){return r.openDropdown()}),"focus:".concat(this.ID),function(){return r.args.open_on_focus?r.openDropdown():null}),"keyup:".concat(this.ID),(n=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,i){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Tab","Enter","Shift","Control"].includes(i.key))return e.abrupt("return",i.preventDefault());e.next=2;break;case 2:r.xhr.search!==t.Properties.get("value")&&(r.xhr.search=t.Properties.get("value")||"",r.Functions.delay(function(){r.clearDropdownList(),r.buildDropdownList()},r.search_delay,r.ID));case 3:case"end":return e.stop()}},e)})),function(e,t){return n.apply(this,arguments)})),"keydown:".concat(this.ID),(i=_asyncToGenerator(_regeneratorRuntime().mark(function e(t,i){return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=i.key,e.next="ArrowUp"===e.t0||"ArrowDown"===e.t0?3:"Backspace"===e.t0?10:"Tab"===e.t0?12:"Enter"===e.t0?16:19;break;case 3:if(i.preventDefault(),e.t1=r.opened,e.t1){e.next=8;break}return e.next=8,r.openDropdown();case 8:return r.traverseDropdownList(i.key),e.abrupt("break",19);case 10:return!r.multiple&&r.getSelectedValues().length&&r.deselectOptions(),e.abrupt("break",19);case 12:if(r.opened){e.next=14;break}return e.abrupt("break",19);case 14:return r.traverseDropdownList(i.key),r.closeDropdown(),e.abrupt("break",19);case 16:if(i.preventDefault(),r.opened){e.next=18;break}return e.abrupt("return",r.openDropdown());case 18:r.traverseDropdownList(i.key),r.multiple||r.closeDropdown();case 19:case"end":return e.stop()}},e)})),function(e,t){return i.apply(this,arguments)}))}),a=new MJS.Node("div",{classes:[this.classes.container],attributes:{ID:this.ID}});this.args.has_clear&&(e=new MJS.Node("div",{classes:[this.classes.clear],attributes:{ID:this.ID},properties:{innerHTML:'<i class="'.concat(this.icons.clear,'"></i>')},events:_defineProperty({},"click:".concat(this.ID),function(){return r.deselectOptions()})}),this.getSelectedValues().length||e.Style.set("display","none"),a.insertNode(e)),t.insertNode(o),a.insertNode(t),a.insertNode(s),a.moveToNode(this.select_node,"before"),this.select_node.Style.set("display","none"),this.Events.setGlobal("click:".concat(this.ID),function(e){var t;r.opened&&(e=new MJS.Node(e.target),a.hasNode(e)||null!=(t=r.getDropdown())&&t.hasNode(e)||r.closeDropdown())}),this.args.has_sort&&this.setDragdrop(),null!=(e=this.select_node.childNode("[data-ghost-option]"))&&e.remove(),this.select_node.insertNode(new MJS.Node("<option disabled value selected data-ghost-option></option>"),"prepend")}},{key:"buildDropdown",value:function(){var e=this,t=new MJS.Node("<div></div>",{classes:[this.classes.dropdown],attributes:{ID:this.ID},style:{width:"auto","min-width":MJS.Node.getNode('div[ID="'.concat(this.ID,'"].').concat(this.classes.container)).Properties.get("offsetWidth")+"px"}}),i=new MJS.Node("div",{classes:[this.classes.dropdown_list],attributes:{ID:this.ID}}),n=new MJS.Node("div",{attributes:{autoload:!0,ID:this.ID},style:{height:"1px","margin-top":"-5px",display:"none"}});i.insertNode(n),t.insertNode(i),this.xhr.model&&(n.Observers.set("view:".concat(this.ID),function(){return e.buildDropdownList()},{treshold:0,rootMargin:"150px"}),n.Style.remove("display")),this.getSelectContainer().insertNode(t),this.positionDropdown()}},{key:"positionDropdown",value:function(){var e,t;this.getSearchField()&&(t=this.getSearchField().getElement().getBoundingClientRect(),null!=(e=this.getDropdown()))&&e.Style.set({position:"absolute",top:"".concat(t.height,"px"),left:0})}},{key:"buildDropdownList",value:(s=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,a,s,l=this,o=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=0<o.length&&void 0!==o[0]?o[0]:null,e.t0=(i=i||[]).length,e.t0)e.next=14;else{if(e.t1=this.xhr.model,e.t1)return e.t2=i,e.next=8,this.getXHROptions();e.next=13}break;case 8:if(e.t3=e.sent,e.t3){e.next=11;break}e.t3=[];case 11:e.t4=e.t3,i=e.t2.concat.call(e.t2,e.t4);case 13:i=i.concat(this.getNativeOptions()||[]);case 14:if(i.length){e.next=16;break}return e.abrupt("return");case 16:if(null!=(t=this.getDropdown())&&t.childNode("[autoload]")){e.next=18;break}return e.abrupt("return");case 18:n=this.getDropdownOptions(),r=_createForOfIteratorHelper(i),e.prev=20,s=_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((i=a.value).value=null!=(t=null!=(t=i.value)?t:i[l.args.value_property||""])?t:"",i.label=null!=(t=null!=(t=i.label)?t:i[l.args.label_property||""])?t:"",l.getDropdownOption(i.value))return e.abrupt("return",0);e.next=3;break;case 3:if(!l.xhr.model&&l.xhr.search&&-1===i.label.toLowerCase().search(l.xhr.search.toLowerCase()))return e.abrupt("return",0);e.next=5;break;case 5:if(n=new MJS.Node("div",{classes:[l.classes.dropdown_option],attributes:{value:null!=(t=i.value)?t:""},properties:{label:i.label,parent:i.parent,"has-childs":!!i.childs}}),i.disabled&&n.Classes.set("disabled"),r=new MJS.Node("div",{classes:[l.classes.dropdown_option_label],properties:{innerHTML:l.args.option_render?Mustache.render(l.args.option_render,i):i.label},events:_defineProperty({},"click:".concat(l.ID),function(e){i.disabled||(l.selected_values.includes(i.value)?l.deselectOption(i.value):l.selectOption(i.value,l.args.option_render?i.label:new MJS.Node("<span>".concat(i.label,"</span>")).Properties.get("textContent")))})}),n.insertNode(r),n.moveToNode(null==(r=l.getDropdown())?void 0:r.childNode("[autoload]"),"before"),i.childs){s=_createForOfIteratorHelper(i.childs);try{for(s.s();!(o=s.n()).done;)o.value.parent=i.value}catch(e){s.e(e)}finally{s.f()}l.buildDropdownList(i.childs)}l.getSelectedValues().includes(String(i.value))&&(n.Classes.set("selected"),n.childNode(".".concat(l.classes.dropdown_option_label)).getElement().scrollIntoView(l.scroll_options));case 10:case"end":return e.stop()}},e)}),r.s();case 23:if((a=r.n()).done){e.next=30;break}return e.delegateYield(s(),"t5",25);case 25:if(0===e.t5)return e.abrupt("continue",28);e.next=28;break;case 28:e.next=23;break;case 30:e.next=35;break;case 32:e.prev=32,e.t6=e.catch(20),r.e(e.t6);case 35:return e.prev=35,r.f(),e.finish(35);case 38:this.getDropdownOptions().length&&(n.length&&null!=n&&n.lastNode().childNode(".".concat(this.classes.dropdown_option_label)).getElement().scrollIntoView(this.scroll_options),this.args.first_option_selected&&!this.getSelectedValues().length||this.xhr.search)&&this.getDropdownOptions().firstNode().Classes.set("selected"),this.orderDropdownList();case 39:case"end":return e.stop()}},e,this,[[20,32,35,38]])})),function(){return s.apply(this,arguments)})},{key:"clearDropdownList",value:function(){var e=this.getDropdownList();if(!e)return!1;this.xhr.offset=0,this.xhr_busy=!1,this.xhr_done=!1,null!=(e=e.childNodes(".".concat(this.classes.dropdown_option)))&&e.remove(),this.Events.run(this,"clear")}},{key:"orderDropdownList",value:function(){var n=this,e=this.getDropdownOptions();e.length&&e.foreach(function(e){var t,i=e.Properties.get("parent")||null;i&&(i=n.getDropdownOption(i))&&(t=i.childNode(".".concat(n.classes.dropdown_option_childs))||new MJS.Node("div",{classes:[n.classes.dropdown_option_childs]}),i.insertNode(t),t.insertNode(e))})}},{key:"traverseDropdownList",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i=(null==(n=this.getDropdownList())?void 0:n.childNode(".pre-highlighted"))||(null==(n=this.getDropdownList())?void 0:n.childNode(".highlighted"))||(null==(n=this.getDropdownList())?void 0:n.childNode(".selected"))||(null==(n=this.getDropdownList())?void 0:n.childNode(".".concat(this.classes.dropdown_option,":not(.disabled)")));if(i){var n,r=i,s=null;switch(i.Classes.remove("pre-highlighted"),t){case"ArrowUp":null!=(e=this.getDropdownList())&&e.childNode(".highlighted,.selected")&&(!(r=new MJS.Node(i.getElement().previousSibling)).exists()&&i.parentNode(".".concat(this.classes.dropdown_option_childs))?r=i.parentNode(".".concat(this.classes.dropdown_option_childs)).parentNode(".".concat(this.classes.dropdown_option)):r.exists()&&(s=r.childNode(".".concat(this.classes.dropdown_option_childs)))&&s.childNode()&&s.childNodes(".".concat(this.classes.dropdown_option)).foreach(function(e){return r=e}));break;case"ArrowDown":null!=(e=this.getDropdownList())&&e.childNode(".highlighted,.selected")&&(r=new MJS.Node(i.getElement().nextSibling),s=i.childNode(".".concat(this.classes.dropdown_option_childs)),!(r=s&&s.childNode()?s.childNode(".".concat(this.classes.dropdown_option)):r).exists())&&i.parentNode(".".concat(this.classes.dropdown_option_childs))&&(r=new MJS.Node(i.parentNode(".".concat(this.classes.dropdown_option_childs)).parentNode(".".concat(this.classes.dropdown_option)).getElement().nextSibling));break;case"Tab":case"Enter":return null!=(e=this.getDropdownList())&&e.childNode(".highlighted,.selected")?void this.selectOption(i.Attributes.get("value"),i.Properties.get("label")):void 0}if(r.exists()&&r.Classes.has(this.classes.dropdown_option))return null!=(n=r)&&n.Classes.set("pre-highlighted"),r.Classes.has("disabled")?this.traverseDropdownList(t):((n=this.getDropdownOptions()).length&&n.foreach(function(e){return e.Classes.remove(["highlighted","pre-highlighted"])}),null!=(t=r)&&t.Classes.set("highlighted"),void r.childNode(".".concat(this.classes.dropdown_option_label)).getElement().scrollIntoView(this.scroll_options))}}},{key:"selectOption",value:(r=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o,a=this,l=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=0<l.length&&void 0!==l[0]?l[0]:null,n=1<l.length&&void 0!==l[1]?l[1]:null,r=2<l.length&&void 0!==l[2]&&l[2],null===i)return e.abrupt("return",!1);e.next=5;break;case 5:if(i=(new DOMParser).parseFromString(new String(i),"text/html").documentElement.textContent,e.t0=n,e.t0){e.next=14;break}return e.next=10,this.getOptionLabel(i);case 10:if(e.t1=e.sent,e.t1){e.next=13;break}e.t1=i;case 13:n=e.t1;case 14:if(this.select_node){e.next=16;break}return e.abrupt("return",!1);case 16:if(s=this.select_node.childNode('option[value="'.concat(i,'"]:not([disabled])'))||this.select_node.childNode('option[value="'.concat(i,'"]'))||new MJS.Node("<option selected></option>",{attributes:{value:i},properties:{innerHTML:n}}),r&&s.Attributes.set("preset",!0),this.multiple){if(s.Attributes.get("selected"))return e.abrupt("return",this.deselectOption(i));e.next=20}else e.next=24;break;case 20:(o=new MJS.Node("div",{classes:[this.classes.badge,"badge","badge-primary"],properties:{innerHTML:"<span value>".concat(this.args.has_sort?'<i class="handle '.concat(this.icons.handle,' mr-minimal"></i>'):"").concat(n,"</span>"),value:i},attributes:{ID:this.ID,"data-value":i}})).insertNode(new MJS.Node("i",{attributes:{remove:!0},classes:["remove"].concat(this.icons.remove.split(" ")),events:_defineProperty({},"click:".concat(this.ID),function(e){return a.deselectOption(e.parentNode().Properties.get("value"))})})),o.moveToNode(this.getSearchField(),"before"),e.next=25;break;case 24:this.deselectOptions(!0),null!=(o=this.getSearchField())&&o.Properties.set("value",String(n).replace(/(<([^>]+)>)/gi,"")),null!=(t=this.getSearchField())&&t.Properties.set("last-value",String(n).replace(/(<([^>]+)>)/gi,""));case 25:s.Attributes.set("selected",!0),s.Properties.set("selected",!0),this.select_node.childNode('option[value="'.concat(i,'"]'))||this.select_node.insertNode(s),this.multiple||this.select_node.Properties.set("value",i),this.getDropdownOption(i)&&null!=(t=this.getDropdownOption(i))&&t.Classes.set("selected"),this.select_node.Attributes.set("value",this.Format.xhrEncode(this.getSelectedValues())),this.positionDropdown(),this.multiple||!1!==this.loading_predefined_values||this.closeDropdown(),this.processOptionSelection(),this.last_selected_option={label:n,value:i},this.runChangeEvent(),this.Events.run(this,"add");case 26:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"deselectOption",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,t=1<arguments.length&&void 0!==arguments[1]&&arguments[1],i=this.select_node.childNode('option[value="'.concat(e,'"]')),i=(i&&i.Attributes.remove("selected"),i&&i.Properties.remove("selected"),this.getDropdownOption(e)),i=(i&&i.Classes.remove("selected"),this.getOptionBadge(e));i&&i.remove(),this.last_selected_option={label:null,value:null},this.processOptionSelection(),t||(this.runChangeEvent(),this.Events.run(this,"remove"))}},{key:"deselectOptions",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0],t=this.getSelectedValues();if(t.length){var i,n=_createForOfIteratorHelper(t);try{for(n.s();!(i=n.n()).done;){var r=i.value;this.deselectOption(r,!0)}}catch(e){n.e(e)}finally{n.f()}this.select_node.Properties.remove("value"),e||(this.runChangeEvent(),this.Events.run(this,"remove"))}}},{key:"removeOptions",value:function(){var e=this.getOptionNodes(),e=(e.length&&e.remove(),this.getOptionBadges());e.length&&e.remove(),this.last_selected_option={label:null,value:null},this.processOptionSelection()}},{key:"openDropdown",value:(n=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.t0=this.opened,e.t0){e.next=13;break}return this.opened=!0,this.xhr.offset=0,this.xhr.search="",this.xhr_busy=!1,this.xhr_done=!1,null!=(t=this.getSearchField())&&t.getElement().select(),this.getSelectContainer().Classes.set(this.classes.container_active),this.buildDropdown(),e.next=12,this.buildDropdownList();case 12:this.Events.run(this,"open");case 13:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"closeDropdown",value:function(){var e;this.opened&&(this.opened=!1,this.xhr.offset=0,this.xhr_busy=!1,this.xhr_done=!1,this.getSelectContainer().Classes.remove(this.classes.container_active),this.xhr.search&&null!=(e=this.getSearchField())&&e.Properties.set("value",this.getSelectedValues().length?null==(e=this.getSearchField())?void 0:e.Properties.get("last-value"):""),null!=(e=this.getDropdown())&&e.remove(),this.Events.run(this,"close"))}},{key:"getXHROptions",value:(i=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,o,i,n,r,s,a,l,d,c,u=this,h=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=0<h.length&&void 0!==h[0]?h[0]:null,this.xhr_busy||this.xhr_done)return e.abrupt("return");e.next=3;break;case 3:if(this.xhr_busy=!0,o=Object.assign({},this.xhr),this.filter_values={},!this.args.filter_elements){e.next=23;break}i=0,n=Object.entries(this.args.filter_elements);case 7:if(i<n.length){if(s=_slicedToArray(n[i],2),r=s[0],s=s[1],!(a=(a=null==(a=this.select_node.parentNode(".row"))?void 0:a.childNode("".concat(s,':not([data-identifier="default_empty_value"])')))||(null==(d=this.select_node.parentNode("form"))?void 0:d.childNode("".concat(s,':not([data-identifier="default_empty_value"])'))))||a.Properties.get("disabled"))return e.abrupt("continue",20);e.next=12}else e.next=23;break;case 12:l=null,e.t0=a.Properties.get("type"),e.next="radio"===e.t0||"checkbox"===e.t0?16:18;break;case 16:return l=a.parentNode(".form-group").childNodes("input:checked").foreach(function(e){return e.Properties.get("value")}),e.abrupt("break",19);case 18:l=a.Properties.get("value");case 19:this.filter_values[r]=l||null;case 20:i++,e.next=7;break;case 23:return this.filter_values&&Object.keys(this.filter_values).length&&(o=Object.assign(o,this.filter_values)),t&&(o.value=t),d="string"==typeof this.xhr.params?this.xhr.params:Object.assign({},this.xhr.params),c=new URLSearchParams,d&&("string"!=typeof d&&(d=new URLSearchParams(d).toString()),new URLSearchParams(d).forEach(function(e,t){for(var i=0,n=Object.entries(o);i<n.length;i++){var r=_slicedToArray(n[i],2),s=r[0],r=r[1];String(e).includes("{{".concat(s,"}}"))&&(e=String(e).replace("{{".concat(s,"}}"),r||""))}c.append(t,e)})),e.next=29,new this.Fetch([this.xhr.model,this.xhr.function],{body:o,query:d?c.toString():null}).then(function(e){return u.xhr_busy=!1,t||(u.xhr.offset+=u.xhr.limit),u.xhr.limit||(u.xhr_done=!0),e&&void 0!==e.data&&(e=e.data),(u.last_response=e)||[]});case 29:return e.abrupt("return",e.sent);case 30:case"end":return e.stop()}},e,this)})),function(){return i.apply(this,arguments)})},{key:"getNativeOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null,i=[],e=null==(e=this.select_node.parentNode(".form-group"))?void 0:e.childNode('textarea[id="'.concat(this.ID,'_data"]'));if(e&&e.Properties.get("value"))for(var e=this.Format.xhrDecode(e.Properties.get("value"))||{},n=0,r=Object.entries(e);n<r.length;n++){var s=_slicedToArray(r[n],2);s[0];i.push(s[1])}else this.select_node.childNodes("option").length&&this.select_node.childNodes("option:not([preset]):not([data-ghost-option])").foreach(function(e){i.push({value:e.Attributes.get("value"),label:e.getText(),parent:e.Attributes.get("parent"),disabled:!!e.Properties.get("disabled")})});return i.length&&(t&&(Array.isArray(t)&&(t=t.map(function(e){return String(e)})),i=i.filter(function(e){return(Array.isArray(t)?t:[String(t)]).includes(String(e.value))})),i)||[]}},{key:"getOptionLabel",value:(t=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=0<n.length&&void 0!==n[0]?n[0]:null){e.next=3;break}return e.abrupt("return");case 3:if(this.xhr_busy=this.xhr_done=!1,this.xhr.model)return e.next=7,this.getXHROptions(t);e.next=10;break;case 7:e.t1=e.sent,e.next=11;break;case 10:e.t1=[];case 11:if(e.t0=e.t1,e.t0){e.next=14;break}e.t0=[];case 14:return i=e.t0,e.abrupt("return",(i=i.length?i:this.getNativeOptions(t)||[]).length?i[0].label||"":void 0);case 16:case"end":return e.stop()}},e,this)})),function(){return t.apply(this,arguments)})},{key:"loadPredefinedValue",value:(e=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n,r,s,o,a,l,d,c,u,h,p=this,g=arguments;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=0<g.length&&void 0!==g[0]&&g[0],this.select_node.Attributes.get("value")){e.next=3;break}return e.abrupt("return");case 3:if(i=this.Format.xhrDecode(String(null!=(i=this.select_node.Attributes.get("value"))?i:"")),Array.isArray(i)&&1===i.length&&!i[0])return e.abrupt("return");e.next=6;break;case 6:if((n=Array.isArray(i)?i:[String(i)]).length){e.next=9;break}return e.abrupt("return");case 9:if(!t){e.next=14;break}this.loading_predefined_values=!0,r=_createForOfIteratorHelper(n);try{for(r.s();!(s=r.n()).done;)o=s.value,this.selectOption(o,o,!0)}catch(e){r.e(e)}finally{r.f()}return e.abrupt("return",void setTimeout(function(){return p.loading_predefined_values=!1},75));case 14:if(a=[],e.t0=this.xhr.model,e.t0)return this.xhr_done=!1,e.next=20,this.getXHROptions(1===n.length?n[0]:n);e.next=24;break;case 20:if(e.t1=e.sent,e.t1){e.next=23;break}e.t1=[];case 23:a=e.t1;case 24:this.xhr.model&&(this.xhr.model,a.length)||(a=this.getNativeOptions(n)),this.loading_predefined_values=!0,l=_createForOfIteratorHelper(a);try{for(l.s();!(d=l.n()).done;)h=(u=d.value).label?this.args.option_render?u.label:new MJS.Node("<span>".concat(u.label,"</span>")).Properties.get("textContent"):null,this.selectOption(null!=(c=u.value)?c:u,h||null,!0)}catch(e){l.e(e)}finally{l.f()}setTimeout(function(){return p.loading_predefined_values=!1},75);case 29:case"end":return e.stop()}},e,this)})),function(){return e.apply(this,arguments)})},{key:"processOptionSelection",value:function(){var e;switch(0<this.getSelectedValues().length){case!0:null!=(e=this.getSelectClear())&&e.Style.set("display","block");break;case!1:null!=(e=this.getSelectClear())&&e.Style.set("display","none"),null!=(e=this.getSearchField())&&e.Properties.remove("value")}}},{key:"setDragdrop",value:function(){var c=this,e=__(this.getSelectContainer()).Dragdrop({selectors:{container:".select-list",item:".select-badge",item_key:"data-value",item_handle:".handle"},hitboxes:{positions:["left","right"],height_marge:0,width_offset:15},enable_ghost_trigger:!1,enable_ghost_element:!0,reference_element:this.select_node.parentNode(".dialog-content")?this.select_node.parentNode(".dialog-content").getElement():null,watch:!0});__(e).on("change",function(e){var t=[];e.generateStructure(__(c.getSelectList()));for(var i=0,n=Object.entries(e.structure);i<n.length;i++){var r=_slicedToArray(n[i],2),s=r[0];t[r[1].order]=s}var o,a=_createForOfIteratorHelper(t.reverse());try{for(a.s();!(o=a.n()).done;){var l=o.value,d=c.select_node.childNode('option[value="'.concat(l,'"]'));d&&c.select_node.insertNode(d,"prepend")}}catch(e){a.e(e)}finally{a.f()}})}},{key:"addItem",value:function(e,t){return this.selectOption(e,t)}},{key:"removeItem",value:function(e){return this.deselectOption(e)}},{key:"runChangeEvent",value:function(){var e;this.Events.run(this,"change"),null!=(e=this.select_node)&&e.getElement().dispatchEvent(new Event("change"))}},{key:"getSelectedValues",value:function(){var t=[];return this.select_node.childNodes("option[selected]").length&&this.select_node.childNodes("option[selected]").foreach(function(e){return t.push(e.Attributes.get("value"))}),t}},{key:"getSelectContainer",value:function(){return MJS.Node.getNode('div[ID="'.concat(this.ID,'"].').concat(this.classes.container))}},{key:"getSelectList",value:function(){return MJS.Node.getNode('div[ID="'.concat(this.ID,'"].').concat(this.classes.list))}},{key:"getDropdown",value:function(){return MJS.Node.getNode('div[ID="'.concat(this.ID,'"].').concat(this.classes.dropdown))}},{key:"getDropdownList",value:function(){return MJS.Node.getNode('div[ID="'.concat(this.ID,'"].').concat(this.classes.dropdown_list))}},{key:"getDropdownOptions",value:function(){var e;return(null==(e=this.getDropdownList())?void 0:e.childNodes(".".concat(this.classes.dropdown_option)))||[]}},{key:"getDropdownOption",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return null==(e=this.getDropdownList())?void 0:e.childNode('[value="'.concat(t,'"]'))}},{key:"getSelectedDropdownOption",value:function(){var e;return null==(e=this.getDropdownList())?void 0:e.childNode(".selected")}},{key:"getOptionNodes",value:function(){return this.select_node.childNodes('option[value]:not([value=""])')}},{key:"getOptionBadges",value:function(){return MJS.Node.getNodes('[ID="'.concat(this.ID,'"].').concat(this.classes.badge))}},{key:"getOptionBadge",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";return MJS.Node.getNode('[ID="'.concat(this.ID,'"][data-value="').concat(e,'"].').concat(this.classes.badge))}},{key:"getSearchField",value:function(){return MJS.Node.getNode('input[ID="'.concat(this.ID,'"].').concat(this.classes.input))}},{key:"getSelectClear",value:function(){return MJS.Node.getNode('[ID="'.concat(this.ID,'"].').concat(this.classes.clear))}}]);var e,t,i,n,r,s,o})(),_defineProperty(_Class14,"configuration",{identifiers:['[data-util~="select"]'],args:{},autorun:!0,global:!1,save:!0,init:function(e,t,i){i&&(i=new MJS.Node(e).parentNode().childNode(".select-container"))&&i.remove()},remove:function(e,t){var i;t&&((i=t.getSelectContainer())&&i.remove(),t.select_node=null,t.Events.removeGlobal("click:".concat(t.ID)))}}),_Class14)),MJS.Namespace("Utils").extend("FormValidation",(()=>_createClass(function e(){_classCallCheck(this,e)},[{key:"__constructor",value:function(){this.registerValidation("number",function(e){var t=e.Properties.get("value"),i=e.Properties.get("max"),e=e.Properties.get("min");return!(isNaN(t)||e&&parseInt(t)<parseInt(e)||i&&parseInt(t)>parseInt(i))}),this.registerValidation("email",function(e){e=e.Properties.get("value");return!(e&&!/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(e))})}}]))()),MJS.Namespace("Utils").export("Codemirror",(_Class15=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"height",null),_defineProperty(this,"fullscreen_height",null),_defineProperty(this,"mode",null),_defineProperty(this,"base",null),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var e=this;this.node.exists()&&(this.height=this.node.Attributes.get("data-codemirror-height")||null,this.fullscreen_height=this.node.Attributes.get("data-codemirror-fullscreen-height")||null,this.mode=this.node.Attributes.get("data-codemirror-mode"),this.base=this.node.Attributes.get("data-codemirror-base"),this.base&&(this.mode={name:this.mode,base:this.base}),this.codemirror=CodeMirror.fromTextArea(this.node.getElement(),{styleActiveLine:!0,styleActiveSelected:!0,value:this.node.Properties.get("value")||"",mode:this.mode||this.args.mode||null,lineNumbers:this.args.linenumbers||!0,theme:this.args.theme||"one-dark",indentUnit:4,indentWithTabs:!0,scrollbarStyle:"simple",matchBrackets:!0,autoCloseBrackets:!0,matchTags:!0,extraKeys:{"Ctrl-Space":"autocomplete"},highlightSelectionMatches:!0,foldGutter:!0,gutters:["CodeMirror-lint-markers","CodeMirror-linenumbers","CodeMirror-foldgutter"],lint:!0}),this.codemirror.setSize("100%",this.height),new MJS.Node(this.codemirror.getWrapperElement()).Observers.set("view",function(){e.codemirror.refresh(),e.codemirror.setSize("100%",e.height)}),this.codemirror.on("change",function(){e.codemirror.save(),__(e.node).execute("change"),e.Events.run(e,"change"),__(e).execute("change")}),this.codemirror.on("focus",function(){e.Events.run(e,"focus"),__(e).execute("focus")}),this.codemirror.on("blur",function(){e.Events.run(e,"blur"),__(e).execute("blur")}),this.addFullscreenMode())}},{key:"addFullscreenMode",value:function(){var e,r,t,i,s=this;this.node.parentNode(".form-group")&&(e=this.node.parentNode(".form-group").childNode("label"))&&(r=e.getText(),t=new MJS.Node("a",{attributes:{"data-identifier":"code-fullscreen"},classes:["code-action","code-fullscreen"],properties:{innerHTML:'<i class="fal fa-expand-alt"></i>'},events:{click:(i=_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i,n;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s.codemirror.save(),(t=s.node.cloneNode()).Properties.set("innerHTML",s.node.Properties.get("value")),t.Attributes.set("data-codemirror-height",null),t=new Dialog(null,{title:r,class:"code-editor-fullscreen",size:"fullscreen",body:t.Properties.get("outerHTML")}),e.next=6,t.__init();case 6:i=t.dialog_node.childNode("textarea"),n=__(i).util("Codemirror",!0),setTimeout(function(){return n.codemirror.setSize("100%",s.fullscreen_height||"100%")},250),s.Events.set(t,"close",function(e){e=e.dialog_node.childNode("textarea"),e=__(e).util("Codemirror",!0);s.codemirror.setValue(e.codemirror.getValue())});case 8:case"end":return e.stop()}},e)})),function(){return i.apply(this,arguments)})}}),e.insertNode(t,"append"))}}]))(),_defineProperty(_Class15,"configuration",{identifiers:['[data-util="codemirror"]'],args:{},autorun:!0,global:!1,save:!0,remove:function(e,t){t.codemirror.toTextArea()}}),_Class15)),MJS.Namespace("Utils").export("Toggle",(_Class16=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"identifiers",{input:"toggle-input",input_hidden:"toggle-hidden-input"}),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var t=this.node.childNode('[data-identifier="'.concat(this.identifiers.input_hidden,'"]'));this.node.childNode('[data-identifier="'.concat(this.identifiers.input,'"]')).Events.set("change:".concat(this.ID),function(e){t.Properties.set("value",e.Properties.get("checked")?1:0)})}}]))(),_defineProperty(_Class16,"configuration",{identifiers:['[data-util~="toggle"]'],args:{},autorun:!0,global:!1,save:!0}),_Class16)),MJS.Namespace("Utils").export("Uploader",(_Class17=(()=>_createClass(function e(t,i){_classCallCheck(this,e),_defineProperty(this,"node",null),_defineProperty(this,"args",{}),_defineProperty(this,"name",""),_defineProperty(this,"existing_files",{}),_defineProperty(this,"file_limit",null),_defineProperty(this,"file_count",0),_defineProperty(this,"Format",MJS.Namespace("Core").import("Format")),_defineProperty(this,"Fetch",MJS.Namespace("Core").import("Fetch")),_defineProperty(this,"Events",MJS.Namespace("Core").import("Events")),this.node=new MJS.Node(t),this.args=i||{}},[{key:"__init",value:function(){var i=this,e=(this.name=this.node.Properties.get("name")||this.node.Attributes.get("name")||this.node.Attributes.get("data-name")||this.ID,this.notices=this.node.Attributes.get("notices")?this.Format.xhrDecode(this.node.Attributes.get("notices")):{},this.show_disk_path=!!this.node.Attributes.get("data-show-path"),this.Filedrop=this.node.Utils.set("Filedrop",{name:this.name,types:this.node.Attributes.get("allowed-file-types")?this.Format.xhrDecode(this.node.Attributes.get("allowed-file-types")).join(" "):null,max_size:parseInt(this.node.Attributes.get("max-size")||0),xhr_upload_model:null!=(n=this.node.Attributes.get("data-xhr-upload-model"))?n:"classes/json/models/media",xhr_upload_function:null!=(n=this.node.Attributes.get("data-xhr-upload-function"))?n:"upload_media_parts",xhr_upload_status:null!=(n=this.node.Attributes.get("data-xhr-upload-status"))?n:"media_processing_status",xhr_cancel_model:null!=(n=this.node.Attributes.get("data-xhr-cancel-model"))?n:"classes/json/models/media",xhr_cancel_function:null!=(n=this.node.Attributes.get("data-xhr-cancel-function"))?n:"cancel_media_upload"}),this.file_limit=parseInt(this.node.Attributes.get("data-file-limit")||0),this.processExistingFiles(),this.node.insertNode(new MJS.Node('<div class="uploader-label text-center">'.concat(this.node.Attributes.get("uploader-label"),"</div>"))),this.node.parentNode(".input-group")),t=e.childNode(".input-group-wrapper"),n=parseInt(this.node.parentNode("form").Attributes.get("data-transition-delay")||0);setTimeout(function(){e.Style.set({height:"".concat(t.getElement().clientHeight,"px")})},n),this.setEvents(),this.node.Observers.set("view:".concat(this.ID),function(){var e=i.Filedrop.node.parentNode(".input-group"),t=e.childNode(".input-group-wrapper").getElement().clientHeight||0;e.Style.set({height:"".concat(t,"px")})}),this.testFileCount()}},{key:"setEvents",value:function(){var c=this;this.Events.set(this.Filedrop,"start",function(){var e;null!=(e=c.node.parentNode("form").childNode('button[type="submit"]'))&&e.Properties.set("disabled",!0),1===c.file_limit&&c.node.Style.set("display","none");for(var t=0,i=Object.entries(c.Filedrop.files_queue_new_batch);t<i.length;t++){var n=_slicedToArray(i[t],2),r=n[0],n=n[1];n.id=r,c.renderFile(n,"new")}var s,o=_createForOfIteratorHelper(c.Filedrop.errors);try{for(o.s();!(s=o.n()).done;){var a=s.value,l=a.file,d="";switch(a.reason){case"unsupported":d=(c.notices.error_file_type||"File type is not permitted")+" ("+a.mime+")";break;case"oversized":d=(c.notices.error_file_size||"File size is too large")+" ("+a.mime+")"}l.error_reason=d,c.renderFile(l,"error")}}catch(e){o.e(e)}finally{o.f()}}),this.Events.set(this.Filedrop,"progress",function(){var e="".concat(c.Filedrop.progress,"%"),t=MJS.Node.getNode('div[data-file="'.concat(c.Filedrop.file_uploading.key,'"]'));switch(t.Style.set("background","linear-gradient(to right, #f3f4f8 0%, #f3f4f8 ".concat(e,", white ").concat(e,", white 100%)")),t.childNode("[progress-bar]").Style.set("width",e),c.Filedrop.status){case 1:t.Classes.remove(["uploading","processing"]),t.Classes.set("standby"),t.childNode("[progress-text]").Properties.set("innerHTML","".concat(c.notices.status_idle||""," ").concat(e));break;case 2:t.Classes.remove(["standby","processing"]),t.Classes.set("uploading"),t.childNode("[progress-text]").Properties.set("innerHTML","".concat(c.notices.status_uploading||""," ").concat(e));break;case 3:t.Classes.set("processing"),t.childNode("[progress-text]").Properties.set("innerHTML","".concat(c.notices.status_processing||""));break;case 4:t.Classes.remove(["standby","processing"]),t.Classes.set("uploading"),t.childNode("[progress-text]").Properties.set("innerHTML","".concat(c.notices.status_done||""," ").concat(e))}}),this.Events.set(this.Filedrop,"done-item",function(){var e,t=MJS.Node.getNode('div[data-file="'.concat(c.Filedrop.file_uploading.key,'"]'));null!=(e=t.childNode(".progress-filepath-name"))&&e.setText(c.Filedrop.file_uploading.path_name),t.Classes.set("upload-succes"),c.testFileCount()}),this.Events.set(this.Filedrop,"done-all",function(){var e;null!=(e=c.node.parentNode("form").childNode('button[type="submit"]'))&&e.Properties.remove("disabled"),c.testFileCount()}),this.Events.set(this.Filedrop,"cancel-all",function(){var i=MJS.Node.getNode('div[data-file="'.concat(c.Filedrop.file_uploading.key,'"]'));i.Classes.remove("upload-removed"),console.log("File has been cancelled"),setTimeout(function(){i.remove();var e=c.node.parentNode(".input-group"),t=e.childNode(".input-group-wrapper");e.Style.set({height:"".concat(t.getElement().clientHeight,"px")}),c.testFileCount()},800)})}},{key:"renderFile",value:function(){var n=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"new",r=new MJS.Node('<div data-file="'.concat(e.key,'" class="uploader-file ').concat("error"===t?"upload-error":"",' w-100"></div>')),i=new MJS.Node('<div cancel class="progress-cancel"><i class="fal fa-times"></i></div>',{events:{click:function(){switch(t){case"new":case"error":n.Filedrop.cancel(e.key),r.remove(),n.testFileCount();break;case"existing":n.node.insertNode(new MJS.Node('<input type="hidden" name="'.concat(n.Filedrop.name,'_removed[]" value="').concat(e.id,'" />'))),r.Classes.set("upload-removed"),delete n.existing_files[e.id],setTimeout(function(){r.remove(),n.Filedrop.node.parentNode(".input-group").Style.set({height:"".concat(n.Filedrop.node.parentNode(".input-group-wrapper").getElement().clientHeight,"px")}),n.testFileCount()},800)}}}}),s=new MJS.Node('<div class="progress-info"></div>'),o=new MJS.Node('<div class="progress-title"><strong>'.concat(e.name,"</strong></div>")),a=new MJS.Node('<div class="progress-filepath-name"></div>'),l=new MJS.Node('<div progress-text class="progress-text">'.concat(e.error_reason||"","</div>")),o=(s.insertNode(o),this.show_disk_path&&s.insertNode(a),"existing"!==t&&s.insertNode(l),r.insertNode(s),r.insertNode(i),new MJS.Node('<div class="progress-status d-block w-100"></div>')),a=new MJS.Node('<div progress-bar class="progress-bar w-0"></div>');if(o.insertNode(a),"existing"!==t&&r.insertNode(o),-1===e.type.indexOf("image")){l=new MJS.Node('<div class="progress-image"></div>'),s=new MJS.Node('<span class="progress-image-extension">'.concat(e.extension,"</span>"));r.insertNode(l,"prepend"),l.insertNode(s,"prepend")}else{var i=new MJS.Node('<div class="progress-image"></div>'),d=new MJS.Node('<img src=""></img>');switch(r.insertNode(i,"prepend"),i.insertNode(d,"prepend"),t){case"new":case"error":var c=new FileReader;c.readAsDataURL(e),c.onload=function(e){d.Properties.set("src",e.target.result)};break;case"existing":d.Properties.set("src",e.path)}}this.Filedrop.node.parentNode().insertNode(r),setTimeout(_asyncToGenerator(_regeneratorRuntime().mark(function e(){var t,i;return _regeneratorRuntime().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r.Classes.set(["uploading","upload-succes"]),t=n.Filedrop.node.parentNode(".input-group"),i=t.childNode(".input-group-wrapper").getElement().clientHeight||0,t.Style.set({height:"".concat(i,"px")});case 3:case"end":return e.stop()}},e)})),800)}},{key:"processExistingFiles",value:function(){var a=this,e=this.node.childNodes('input[name^="existing_files"]');if(e.length){e.foreach(function(e){e.Attributes.get("data-mime")||(t=e.Attributes.get("data-name").split("."),e.Attributes.set("data-mime",t[t.length-1]));var t,i=e.Attributes.get("value");if(a.existing_files[i]={id:i,name:e.Attributes.get("data-name"),mime:e.Attributes.get("data-mime"),extension:e.Attributes.get("data-mime"),type:e.Attributes.get("data-type"),path:e.Attributes.get("data-path"),size:e.Attributes.get("data-size")},e.Attributes.get("data-enable-save"))for(var n=0,r=Object.entries(a.existing_files[i]);n<r.length;n++){var s=_slicedToArray(r[n],2),o=s[0],s=s[1];a.node.insertNode(new MJS.Node("input",{attributes:{"data-key":a.existing_files[i].name},properties:{type:"hidden",name:"".concat(a.name,"[").concat(a.existing_files[i].name,"][").concat(o,"]"),value:s}}))}e.remove()});for(var t=0,i=Object.entries(this.existing_files);t<i.length;t++){var n=_slicedToArray(i[t],2);n[0];this.renderFile(n[1],"existing")}}}},{key:"testFileCount",value:function(){var t,i=this,e=(this.file_count=Object.keys(this.existing_files).length,this.node.childNodes('input[type="hidden"][data-key]'));if(e.length&&(t=[],e.foreach(function(e){e=e.Attributes.get("data-key");t.includes(e)||(t.push(e),i.file_count++)})),this.file_limit)return this.file_limit===this.file_count||this.file_count<this.file_count?(this.node.Style.set("display","none"),void this.Filedrop.node.parentNode(".input-group").Style.set({height:"".concat(this.Filedrop.node.parentNode(".input-group-wrapper").getElement().clientHeight,"px")})):void this.node.Style.remove("display")}}]))(),_defineProperty(_Class17,"configuration",{identifiers:['[data-util~="uploader"]'],args:{},autorun:!0,global:!1,save:!0}),_Class17));
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperties(e,t){for(var o=0;o<t.length;o++){var r=t[o];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_toPropertyKey(r.key),r)}}function _createClass(e,t,o){return t&&_defineProperties(e.prototype,t),o&&_defineProperties(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var o=e[Symbol.toPrimitive];if(void 0===o)return("string"===t?String:Number)(e);o=o.call(e,t||"default");if("object"!=_typeof(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Framework=_createClass(function e(){var t;_classCallCheck(this,e);for(var o=document.querySelector("script[framework]").src.split("?")[1].split("&"),r={},n=0;n<o.length;n++){var i=o[n].split("=");r[i[0]]=i[1]}this.hash=r.hash||null,"undefined"!=typeof MarbleJS&&(new MarbleJS({utils:!1,namespace:!0,mustache:{path:"classes\\json\\models\\mustache",use_cache:!1},xhr:{hash:this.hash,encoding_count:1}}),this.Frontend=MJS.Namespace("Classes").importInstance("Frontend"),null!=(t=MJS.Namespace("Core").import("Utils"))&&t.setup(),MJS.Namespace("Classes\\Frontend").import("Plugins").setup(),null!=(t=MJS.Namespace("Utils").import("Lazyload")))&&t.loadAboveViewport()});window.addEventListener("DOMContentLoaded",function(){window._Framework=new Framework}),window.document.addEventListener("refreshBlockExtensions",function(e){e.detail&&(e=MJS.Node.getNode('[data-block-id="'.concat(e.detail.id_block,'"]')))&&(e.Utils&&e.Utils.setAll(),e.Plugins)&&e.Plugins.setAll()});
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var _Node;function _createForOfIteratorHelper(e,t){var r,n,i,o,a="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(a)return i=!(n=!0),{s:function(){a=a.call(e)},n:function(){var e=a.next();return n=e.done,e},e:function(e){i=!0,r=e},f:function(){try{n||null==a.return||a.return()}finally{if(i)throw r}}};if(Array.isArray(e)||(a=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length)return a&&(e=a),o=0,{s:t=function(){},n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){var r;if(e)return"string"==typeof e?_arrayLikeToArray(e,t):"Map"===(r="Object"===(r={}.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,l=[],s=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=o.call(r)).done)&&(l.push(n.value),l.length!==t);s=!0);}catch(e){u=!0,i=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,_toPropertyKey(n.key),n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _toPropertyKey(e){e=_toPrimitive(e,"string");return"symbol"==_typeof(e)?e:e+""}function _toPrimitive(e,t){if("object"!=_typeof(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=_typeof(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}function _classPrivateFieldInitSpec(e,t,r){_checkPrivateRedeclaration(e,t),t.set(e,r)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _classPrivateFieldGet(e,t){return e.get(_assertClassBrand(e,t))}function _classPrivateFieldSet(e,t,r){return e.set(_assertClassBrand(e,t),r),r}function _assertClassBrand(e,t,r){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:r;throw new TypeError("Private element is not present on this object")}MJS.Node.DynamicModulesMap.set("Plugins","Core\\Node"),MJS.Namespace("Core\\Node").export("Plugins",(_Node=new WeakMap,(()=>_createClass(function e(t){_classCallCheck(this,e),_classPrivateFieldInitSpec(this,_Node,null),_defineProperty(this,"PluginMap",new Map),_classPrivateFieldSet(_Node,this,t)},[{key:"get",value:function(){return this.PluginMap.get(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"")||null}},{key:"save",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:null;return this.PluginMap.set(1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",e),this}},{key:"set",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return this.PluginMap.has(e)?null:MJS.Namespace("Classes\\Frontend").import("Plugins").getPlugin(e)?(t=MJS.Namespace("Classes\\Frontend").import("Plugins").runPlugin(e,_classPrivateFieldGet(_Node,this),t),this.save(t,e),t):void 0}},{key:"setAll",value:function(){var a=this,e=MJS.Namespace("Classes\\Frontend").import("Plugins").getPlugins();if(e)for(var l=0,s=Object.entries(e);l<s.length;l++)(()=>{var e=_slicedToArray(s[l],2),t=e[0];if(!(e=e[1]).configuration||!e.configuration.identifiers)return;var r,n=_createForOfIteratorHelper(e.configuration.identifiers);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=_classPrivateFieldGet(_Node,a).childNodes(i);o.length&&o.foreach(function(e){e.Plugins.has(t)||(e=MJS.Namespace("Classes\\Frontend").import("Plugins").runPlugin(t,e),a.save(e,t))})}}catch(e){n.e(e)}finally{n.f()}})()}},{key:"remove",value:function(){var e,t,r=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"";if(Array.isArray(r)){var n,i=_createForOfIteratorHelper(r);try{for(i.s();!(n=i.n()).done;){var o=n.value;this.remove(o)}}catch(e){i.e(e)}finally{i.f()}}else if(this.PluginMap.has(r))return e=this.PluginMap.get(r),(t=MJS.Namespace("Classes\\Frontend").import("Plugins").getPlugin(r))&&t.configuration&&"function"==typeof t.configuration.remove&&t.configuration.remove(__(_classPrivateFieldGet(_Node,this)),e),this.PluginMap.delete(r),this}},{key:"clear",value:function(){if(this.PluginMap.size){var e,t=_createForOfIteratorHelper(this.PluginMap.keys());try{for(t.s();!(e=t.n()).done;){var r=e.value;this.remove(r)}}catch(e){t.e(e)}finally{t.f()}}}},{key:"has",value:function(){return this.PluginMap.has(0<arguments.length&&void 0!==arguments[0]?arguments[0]:"")}}]))()));