Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@htmlguyllc/jpack

Package Overview
Dependencies
Maintainers
1
Versions
191
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@htmlguyllc/jpack - npm Package Compare versions

Comparing version 9.0.27 to 9.0.28

2

dist/jpack.bundled.min.js

@@ -1,2 +0,2 @@

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=23)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e)throw"".concat(e," must be a string");var r=this.getElement(t,n);if(!t)return null;var o=(new DOMParser).parseFromString(e,"text/html");return o=r.parentNode.insertBefore(o.documentElement.querySelector("body").childNodes[0],r),r.remove(),o},isVisible(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===(t=this.getElement(t,e,n)))return!1;var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var o=t.getBoundingClientRect(),i={"top-left":{x:o.left,y:o.top},"top-right":{x:o.right,y:o.top},"bottom-left":{x:o.left,y:o.bottom},"bottom-right":{x:o.right,y:o.bottom},center:{x:o.left+t.offsetWidth/2,y:o.top+t.offsetHeight/2}},s=!0;return Object.keys(i).forEach(function(t){var e=i[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return i});var i={getValueOrClone:function(t){var e=typeof t;return"undefined"===e||null===t?null:"object"===e?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach(function(e){o(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t):Array.isArray(t)?[...t]:t}}},function(t,e,n){"use strict";var r=n(12),o=n(25),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";n.d(e,"a",function(){return d});var r=n(6),o=n.n(r),i=n(0),s=n(7),a=n(1),u=n(4);function c(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h={trackHistory:!1,pushState:!0,loaderEnabled:!0,loaderDelay:300,incomingElement:"body",replaceElement:"body",loaderClasses:"progress page-navigation-loader",loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated"},d={setConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=l({},this.getConfig(),{},t),this.trackHistory=t.trackHistory,this.pushState=t.pushState,this.loaderEnabled=t.loaderEnabled,this.setLoaderDelay(t.loaderDelay),this.setIncomingElement(t.incomingElement),this.setReplaceElement(t.replaceElement),this._loaderClasses=t.loaderClasses,this._loaderInnerDivClasses=t.loaderInnerDivClasses,this},resetConfig:function(){return this.setConfig(h),this},getConfig:function(){return{trackHistory:this.trackHistory,pushState:this.pushState,loaderEnabled:this.loaderEnabled,loaderDelay:this.getLoaderDelay(),incomingElement:this.getIncomingElement(),replaceElement:this.getReplaceElement(),loaderClasses:this._loaderClasses,loaderInnerDivClasses:this._loaderInnerDivClasses}},trackHistory:h.trackHistory,getHistory:function(){return a.a.getValueOrClone(this._history)},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t,e){if(!this.trackHistory)return!1;if("string"!=typeof t)throw"".concat(t," must be a string");return e=void 0===e?this.getRouteFromMeta():e,this._history.push({url:t,route:e}),this},_history:[],setData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof t||null===t)throw"".concat(t," must be an object");return this._data=a.a.getValueOrClone(t),this},getData:function(){return a.a.getValueOrClone(this._data)},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._data[t]=a.a.getValueOrClone(e),this},getDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._data[t]||null===this._data[t]?null:a.a.getValueOrClone(this._data[t])},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._incomingElement=t},_incomingElement:h.incomingElement,getIncomingElement:function(){return this._incomingElement},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._replaceElement=t},_replaceElement:h.replaceElement,getReplaceElement:function(){return this._replaceElement},pushState:h.pushState,load:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=this;u.a.isDataObject(r,["incomingElement","replaceElement","pushState"],!1,!0,!0),e=l({},s.getData(),{},e);var a=void 0!==r.incomingElement?r.incomingElement:this.getIncomingElement(),c=void 0!==r.replaceElement?r.replaceElement:this.getReplaceElement(),f=i.a.getElement(c,!0),h=void 0!==r.pushState?r.pushState:this.pushState,d=s.getRouteFromMeta();return!!s._triggerOnBeforeRequest(f,c,a,d,e)&&(s.showLoader(),o.a.get(t).then(function(r){s.hideLoader(),s._replacePageContent(r.data,t,a,c,h,d,e,n)}).catch(function(n){s.hideLoader();var r="object"==typeof n&&null!==n&&n.isAxiosError?n:null;throw n=null!==r?r.response.statusText:n,s._triggerFail(n,t,e,r),n}),this)},loaderEnabled:h.loaderEnabled,setLoaderDelay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;if("number"!=typeof t)throw"".concat(t," must be an integer");return this._loaderDelay=t,this},_loaderDelay:h.loaderDelay,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:h.loaderClasses,_loaderInnerDivClasses:h.loaderInnerDivClasses,_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=i.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.head,e=t.querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),{},t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onloadCallbacks.push(t),this},removeOnload:function(t){return this._onloadCallbacks.filter(function(e){return e!==t}),this},_onUnloadCallbacks:[],onUnload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){return this._onUnloadCallbacks.filter(function(e){return e!==t}),this},_onFailCallbacks:[],onFail:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onFailCallbacks.push(t),this},removeOnFail:function(t){return this._onFailCallbacks.filter(function(e){return e!==t}),this},onBeforeRequest:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onBeforeRequestCallbacks.push(t),this},removeOnBeforeRequest:function(t){return this._onBeforeRequestCallbacks.filter(function(e){return e!==t}),this},_onBeforeRequestCallbacks:[],_triggerOnload:function(t,e,n,r,o){return this._onloadCallbacks.forEach(function(e){e(t,o,{selector:t,replacedSelector:n,route:r})}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(o){o(t,r,{selector:e,route:n})}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(o){o(t,e,n,r)}),this},_triggerOnBeforeRequest:function(t,e,n,r,o){var i=!1;return this._onBeforeRequestCallbacks.forEach(function(s){var a=s(t,o,{selector:e,incomingSelector:n,route:r});"boolean"!=typeof a||a||(i=!0)}),!i},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),{},null,{pushState:!1})},this},_replacePageContent(t,e,n,r){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(n=void 0===n?this.getIncomingElement():n,r=void 0===r?this.getReplaceElement():r,"string"!=typeof e)throw"Provided url (".concat(e,") must be a string");if("string"!=typeof n)throw"incoming_el_selector (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el_selector (".concat(r,") must be a string");var c=i.a.getElement(r,!0);this._triggerUnload(c,r,s,a);var l=this._parseHTML(t,n);if(l.html.length){i.a.remove("meta"),document.head.append(l.metas),i.a.remove('[rel="canonical"]'),Array.from(l.links).forEach(function(t){document.head.append(t)}),document.body.classList=l.body_classes,o&&history.pushState({url:e},l.title,e),this._setTitle(l.title);var f=i.a.replaceElWithHTML(c,l.html);this._triggerOnload(f,n,r,l.route,a),"function"==typeof u&&u(f,n,r,s,a),this._addHistoryItem(e,l.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!=typeof e&&null!==e)throw"Provided parent_el (".concat(e,") must be a string or null");if(l=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(l=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),o=r.querySelector("title");o=o?o.innerText:null;var i=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList.toString(),u=t;if(e){var c=r.querySelector(e);if(!c)throw"Could not find parent selector ".concat(e);u=c.outerHTML}var l=l||this.getRouteFromMeta(r);return n=r=null,{title:o,route:l,metas:i,links:s,body_classes:a,html:u}},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=JSON.stringify(t),s="".concat(i," must be an object");if(void 0===t){if(o)throw s;return!1}var a="object"==typeof t&&null!==t;if(!a||Array.isArray(t)){if(o)throw s;return!1}if(Array.isArray(e)){var u=!1,c=[],l=Object.keys(t);if(!l.length&&!n)return!0;if(e.forEach(function(t){l.includes(t)?u=!0:c.push(t)}),!u){if(o)throw"".concat(i," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&c.length){if(o)throw"".concat(i," is missing data: ")+c.join(", ");return!1}if(r){var f=[];if(l.forEach(function(t){e.includes(t)||f.push(t)}),f.length){if(o)throw"".concat(i," contains invalid data: ")+f.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),o={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return o.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return o.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var o=r.a.getElements(t);if(!o.length)return t;var i=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return o.forEach(function(t){t.addEventListener(e,i,!1)}),i},on:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.addEventListener(e,n)}),o):t},off:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.removeEventListener(e,n)}),o):t},trigger:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.a.getElements(t);return i.length?(o.detail=n,e=new CustomEvent(e,o),i.forEach(function(t){t.dispatchEvent(e)}),i):t}}},function(t,e,n){t.exports=n(24)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(41);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return this.requireWindowLocation(),"https:"===window.location.protocol},getDomain:function(){return this.requireWindowLocation(),window.location.hostname||window.location.host},getDomainWithProtocol:function(){return this.requireWindowLocation(),window.location.origin},getURI:function(){return this.requireWindowLocation(),window.location.pathname},getURIWithQueryString:function(){return this.requireWindowLocation(),window.location.pathname+window.location.search},getFullURL:function(){return this.requireWindowLocation(),window.location.href},appendSlash:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"!==t[t.length-1]?t+"/":t},requireWindowLocation:function(){if(void 0===window.location||!window.location)throw"Window.Location is required for jpack.request"}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(4),o=n(9);class i{constructor(){}populate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[o.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"get"+this.ucfirst(t)},setter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"set"+this.ucfirst(t)},ucfirst:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(0),o=n(3),i=n(6),s=n.n(i);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(42);var c={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class l{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof e||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},c,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," must be a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;o.a.showLoader();var i=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:i}).then(function(n){o.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var i=o.a._parseHTML(r,e.getIncomingElementSelector());return i.html.length?e.insertForm(i,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw o.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function f(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class p extends l{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(null,e),"string"!=typeof t)throw"".concat(t," must be a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," must be a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;o.a.showLoader(),s.a.get(this.getURL()).then(function(e){o.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=o.a._parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw o.a.hideLoader(),t})}insertForm(t,e,n){var o=this.getInsertIntoElement();if(null===o)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(o=r.a.getElement(o,!0)).innerHTML=t.html,n=o.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),o}onload(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return l}),n.d(e,"a",function(){return p})},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(2);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))}))}),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(2),o=n(31),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=n(16):"undefined"!=typeof XMLHttpRequest&&(a=n(16)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(i)}),t.exports=u}).call(this,n(30))},function(t,e,n){"use strict";var r=n(2),o=n(32),i=n(13),s=n(34),a=n(35),u=n(17);t.exports=function(t){return new Promise(function(e,c){var l=t.data,f=t.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+p)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,c,r),h=null}},h.onabort=function(){h&&(c(u("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){c(u("Network Error",t,null,h)),h=null},h.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(36),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(f[t.xsrfHeaderName]=g)}if("setRequestHeader"in h&&r.forEach(f,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),c(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(33);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(4),o=n(8),i=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={id:null,name:null,config:{}};class c extends o.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","name","config"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},t),this.populate(t)}getId(){return this._id}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getName(){return this._name}setName(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._name=t,this}getConfig(){return i.a.getValueOrClone(this._config)}setConfig(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._config=i.a.getValueOrClone(t),this}getConfigItem(t){return void 0===this._config[t]?null:i.a.getValueOrClone(this._config[t])}setConfigItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._config[t]=i.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(4),o=n(8),i=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class c extends o.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},t),this.populate(t)}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getId(){return this._id}setIsGuest(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._fname=t,this}getLname(){return this._lname}setLname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._email=t,this}getPhone(){return this._phone}setPhone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._phone=t,this}getPermissions(){return i.a.getValueOrClone(this._permissions)}setPermissions(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=i.a.getValueOrClone(t),this}addPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._permissions.push(t),this}removePermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.getPermissions().includes(t)}getAdditionalData(){return i.a.getValueOrClone(this._additionalData)}setAdditionalData(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=i.a.getValueOrClone(t),this}getDataItem(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._additionalData[t]?null:i.a.getValueOrClone(this._additionalData[t])}setDataItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._additionalData[t]=i.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(5),o=n(0);class i{constructor(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visible",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.btn=o.a.getElement(t,!0,!0),this.toggle_el=o.a.getElement(e,!0,!0),this.toggle_class=n,this.hide_on_outside_click=r}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){o.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return v});var r=n(0),o=n(5),i=n(11),s=n(3),a=n(7),u=n(20),c=n(9),l=n(4),f=n(21),h=n(22),d=n(1);function p(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g={dom:r.a,events:o.a,XHRForm:i.b,FormFromURL:i.a,navigation:s.a,request:a.a,Site:u.a,strings:c.a,type_checks:l.a,User:f.a,ToggleOnMobile:h.a,clone:d.a},v=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(n,!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},g,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,g)t?(void 0===window[t]&&(window[t]={}),window[t][e]=g[e]):window[e]=g[e]}});t.jpack=v}.call(this,n(10))},function(t,e,n){"use strict";var r=n(2),o=n(12),i=n(26),s=n(18);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=a(n(15));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(19),u.CancelToken=n(39),u.isCancel=n(14),u.all=function(t){return Promise.all(t)},u.spread=n(40),t.exports=u,t.exports.default=u},function(t,e){
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=23)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e)throw"".concat(e," must be a string");var r=this.getElement(t,n);if(!t)return null;var o=(new DOMParser).parseFromString(e,"text/html");return o=r.parentNode.insertBefore(o.documentElement.querySelector("body").childNodes[0],r),r.remove(),o},isVisible(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===(t=this.getElement(t,e,n)))return!1;var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var o=t.getBoundingClientRect(),i={"top-left":{x:o.left,y:o.top},"top-right":{x:o.right,y:o.top},"bottom-left":{x:o.left,y:o.bottom},"bottom-right":{x:o.right,y:o.bottom},center:{x:o.left+t.offsetWidth/2,y:o.top+t.offsetHeight/2}},s=!0;return Object.keys(i).forEach(function(t){var e=i[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return i});var i={getValueOrClone:function(t){var e=typeof t;return"undefined"===e||null===t?null:"object"===e?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach(function(e){o(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t):Array.isArray(t)?[...t]:t}}},function(t,e,n){"use strict";var r=n(12),o=n(25),i=Object.prototype.toString;function s(t){return"[object Array]"===i.call(t)}function a(t){return null!==t&&"object"==typeof t}function u(t){return"[object Function]"===i.call(t)}function c(t,e){if(null!=t)if("object"!=typeof t&&(t=[t]),s(t))for(var n=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:s,isArrayBuffer:function(t){return"[object ArrayBuffer]"===i.call(t)},isBuffer:o,isFormData:function(t){return"undefined"!=typeof FormData&&t instanceof FormData},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:a,isUndefined:function(t){return void 0===t},isDate:function(t){return"[object Date]"===i.call(t)},isFile:function(t){return"[object File]"===i.call(t)},isBlob:function(t){return"[object Blob]"===i.call(t)},isFunction:u,isStream:function(t){return a(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeof URLSearchParams&&t instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]=n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},deepMerge:function t(){var e={};function n(n,r){"object"==typeof e[r]&&"object"==typeof n?e[r]=t(e[r],n):e[r]="object"==typeof n?t({},n):n}for(var r=0,o=arguments.length;r<o;r++)c(arguments[r],n);return e},extend:function(t,e,n){return c(e,function(e,o){t[o]=n&&"function"==typeof e?r(e,n):e}),t},trim:function(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}}},function(t,e,n){"use strict";n.d(e,"a",function(){return d});var r=n(6),o=n.n(r),i=n(0),s=n(7),a=n(1),u=n(4);function c(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function l(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var h={trackHistory:!1,pushState:!0,loaderEnabled:!0,loaderDelay:300,incomingElement:"body",replaceElement:"body",loaderClasses:"progress page-navigation-loader",loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated"},d={setConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=l({},this.getConfig(),{},t),this.trackHistory=t.trackHistory,this.pushState=t.pushState,this.loaderEnabled=t.loaderEnabled,this.setLoaderDelay(t.loaderDelay),this.setIncomingElement(t.incomingElement),this.setReplaceElement(t.replaceElement),this._loaderClasses=t.loaderClasses,this._loaderInnerDivClasses=t.loaderInnerDivClasses,this},resetConfig:function(){return this.setConfig(h),this},getConfig:function(){return{trackHistory:this.trackHistory,pushState:this.pushState,loaderEnabled:this.loaderEnabled,loaderDelay:this.getLoaderDelay(),incomingElement:this.getIncomingElement(),replaceElement:this.getReplaceElement(),loaderClasses:this._loaderClasses,loaderInnerDivClasses:this._loaderInnerDivClasses}},trackHistory:h.trackHistory,getHistory:function(){return a.a.getValueOrClone(this._history)},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t,e){if(!this.trackHistory)return!1;if("string"!=typeof t)throw"".concat(t," must be a string");return e=void 0===e?this.getRouteFromMeta():e,this._history.push({url:t,route:e}),this},_history:[],setData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof t||null===t)throw"".concat(t," must be an object");return this._data=a.a.getValueOrClone(t),this},getData:function(){return a.a.getValueOrClone(this._data)},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._data[t]=a.a.getValueOrClone(e),this},getDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._data[t]||null===this._data[t]?null:a.a.getValueOrClone(this._data[t])},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._incomingElement=t},_incomingElement:h.incomingElement,getIncomingElement:function(){return this._incomingElement},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._replaceElement=t},_replaceElement:h.replaceElement,getReplaceElement:function(){return this._replaceElement},pushState:h.pushState,load:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=this;u.a.isDataObject(r,["incomingElement","replaceElement","pushState"],!1,!0,!0),e=l({},s.getData(),{},e);var a=void 0!==r.incomingElement?r.incomingElement:this.getIncomingElement(),c=void 0!==r.replaceElement?r.replaceElement:this.getReplaceElement(),f=i.a.getElement(c,!0),h=void 0!==r.pushState?r.pushState:this.pushState,d=s.getRouteFromMeta();return!!s._triggerOnBeforeRequest(f,c,a,d,e)&&(s.showLoader(),o.a.get(t).then(function(r){s.hideLoader(),s._replacePageContent(r.data,t,a,c,h,d,e,n)}).catch(function(n){s.hideLoader();var r="object"==typeof n&&null!==n&&n.isAxiosError?n:null;throw n=null!==r?r.response.statusText:n,s._triggerFail(n,t,e,r),n}),this)},loaderEnabled:h.loaderEnabled,setLoaderDelay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;if("number"!=typeof t)throw"".concat(t," must be an integer");return this._loaderDelay=t,this},_loaderDelay:h.loaderDelay,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:h.loaderClasses,_loaderInnerDivClasses:h.loaderInnerDivClasses,_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=i.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.head,e=t.querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),{},t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onloadCallbacks.push(t),this},removeOnload:function(t){return this._onloadCallbacks.filter(function(e){return e!==t}),this},_onUnloadCallbacks:[],onUnload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){return this._onUnloadCallbacks.filter(function(e){return e!==t}),this},_onFailCallbacks:[],onFail:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onFailCallbacks.push(t),this},removeOnFail:function(t){return this._onFailCallbacks.filter(function(e){return e!==t}),this},onBeforeRequest:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onBeforeRequestCallbacks.push(t),this},removeOnBeforeRequest:function(t){return this._onBeforeRequestCallbacks.filter(function(e){return e!==t}),this},_onBeforeRequestCallbacks:[],_triggerOnload:function(t,e,n,r,o){return this._onloadCallbacks.forEach(function(e){e(t,o,{selector:t,replacedSelector:n,route:r})}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(o){o(t,r,{selector:e,route:n})}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(o){o(t,e,n,r)}),this},_triggerOnBeforeRequest:function(t,e,n,r,o){var i=!1;return this._onBeforeRequestCallbacks.forEach(function(s){var a=s(t,o,{selector:e,incomingSelector:n,route:r});"boolean"!=typeof a||a||(i=!0)}),!i},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),{},null,{pushState:!1})},this},_replacePageContent(t,e,n,r){var o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(n=void 0===n?this.getIncomingElement():n,r=void 0===r?this.getReplaceElement():r,"string"!=typeof e)throw"Provided url (".concat(e,") must be a string");if("string"!=typeof n)throw"incoming_el_selector (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el_selector (".concat(r,") must be a string");var c=i.a.getElement(r,!0);this._triggerUnload(c,r,s,a);var l=this._parseHTML(t,n);if(l.html.length){i.a.remove("meta"),document.head.append(l.metas),i.a.remove('[rel="canonical"]'),Array.from(l.links).forEach(function(t){document.head.append(t)}),document.body.classList=l.body_classes,o&&history.pushState({url:e},l.title,e),this._setTitle(l.title);var f=i.a.replaceElWithHTML(c,l.html);this._triggerOnload(f,n,r,l.route,a),"function"==typeof u&&u(f,n,r,s,a),this._addHistoryItem(e,l.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!=typeof e&&null!==e)throw"Provided parent_el (".concat(e,") must be a string or null");if(l=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(l=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),o=r.querySelector("title");o=o?o.innerText:null;var i=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList.toString(),u=t;if(e){var c=r.querySelector(e);if(!c)throw"Could not find parent selector ".concat(e);u=c.outerHTML}var l=l||this.getRouteFromMeta(r);return n=r=null,{title:o,route:l,metas:i,links:s,body_classes:a,html:u}},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=JSON.stringify(t),s="".concat(i," must be an object");if(void 0===t){if(o)throw s;return!1}var a="object"==typeof t&&null!==t;if(!a||Array.isArray(t)){if(o)throw s;return!1}if(Array.isArray(e)){var u=!1,c=[],l=Object.keys(t);if(!l.length&&!n)return!0;if(e.forEach(function(t){l.includes(t)?u=!0:c.push(t)}),!u){if(o)throw"".concat(i," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&c.length){if(o)throw"".concat(i," is missing data: ")+c.join(", ");return!1}if(r){var f=[];if(l.forEach(function(t){e.includes(t)||f.push(t)}),f.length){if(o)throw"".concat(i," contains invalid data: ")+f.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),o={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return o.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return o.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var o=r.a.getElements(t);if(!o.length)return t;var i=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return o.forEach(function(t){t.addEventListener(e,i,!1)}),i},on:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.addEventListener(e,n)}),o):t},off:function(t,e,n){var o=r.a.getElements(t);return o.length?(o.forEach(function(t){t.removeEventListener(e,n)}),o):t},trigger:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.a.getElements(t);return i.length?(o.detail=n,e=new CustomEvent(e,o),i.forEach(function(t){t.dispatchEvent(e)}),i):t}}},function(t,e,n){t.exports=n(24)},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(41);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return this.requireWindowLocation(),"https:"===window.location.protocol},getDomain:function(){return this.requireWindowLocation(),window.location.hostname||window.location.host},getDomainWithProtocol:function(){return this.requireWindowLocation(),window.location.origin},getURI:function(){return this.requireWindowLocation(),window.location.pathname},getURIWithQueryString:function(){return this.requireWindowLocation(),window.location.pathname+window.location.search},getFullURL:function(){return this.requireWindowLocation(),window.location.href},appendSlash:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"!==t[t.length-1]?t+"/":t},requireWindowLocation:function(){if(void 0===window.location||!window.location)throw"Window.Location is required for jpack.request"}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(4),o=n(9);class i{constructor(){}populate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[o.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"get"+this.ucfirst(t)},setter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"set"+this.ucfirst(t)},ucfirst:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var r=n(0),o=n(3),i=n(6),s=n.n(i);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function u(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(42);var c={xhrSubmit:!0,submitURL:null,submitMethod:null,onPreSubmit:function(t,e,n,r){return{form_values:e,url:n,method:r}},onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class l{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof e||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){u(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},c,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setPreSubmitCallback(e.onPreSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._validateCallback=t,this}setPreSubmitCallback(t){if("function"!=typeof t&&null!==t)throw"".concat(t," must be a function or null");return this._preSubmit=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," must be a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}onError(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}_triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}_triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;o.a.showLoader();var i=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");if("function"==typeof this._preSubmit){var a=this._preSubmit(t,i,n,r);if("boolean"==typeof a&&!a)return!1;"object"==typeof a&&a.url&&(n=a.url),"object"==typeof a&&a.method&&(r=a.method),"object"==typeof a&&a.form_values&&(i=a.form_values)}return s()({url:n,method:r,data:i}).then(function(n){o.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var i=o.a._parseHTML(r,e.getIncomingElementSelector());return i.html.length?e.insertForm(i,r,t):e._triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e._triggerOnError(r.error,r,t):e._triggerOnSuccess(r,t)}).catch(function(n){throw o.a.hideLoader(),e._processing=!1,"object"==typeof n&&n.isAxiosError&&(n=n.response.statusText),e._triggerOnError(n,data,t),n}),this}getFormValues(t){return new FormData(t)}}function f(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class p extends l{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(null,e),"string"!=typeof t)throw"".concat(t," must be a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?f(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):f(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," must be a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;o.a.showLoader(),s.a.get(this.getURL()).then(function(e){o.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=o.a._parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw o.a.hideLoader(),t})}insertForm(t,e,n){var o=this.getInsertIntoElement();if(null===o)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(o=r.a.getElement(o,!0)).innerHTML=t.html,n=o.querySelector("form"),this.attachSubmitHandler(n),this._triggerOnload(n),o}onload(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}_triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return l}),n.d(e,"a",function(){return p})},function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return t.apply(e,n)}}},function(t,e,n){"use strict";var r=n(2);function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var s=[];r.forEach(e,function(t,e){null!=t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),s.push(o(e)+"="+o(t))}))}),i=s.join("&")}if(i){var a=t.indexOf("#");-1!==a&&(t=t.slice(0,a)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}},function(t,e,n){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,n){"use strict";(function(e){var r=n(2),o=n(31),i={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var a,u={adapter:(void 0!==e&&"[object process]"===Object.prototype.toString.call(e)?a=n(16):"undefined"!=typeof XMLHttpRequest&&(a=n(16)),a),transformRequest:[function(t,e){return o(e,"Accept"),o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(s(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"==typeof t)try{t=JSON.parse(t)}catch(t){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},r.forEach(["delete","get","head"],function(t){u.headers[t]={}}),r.forEach(["post","put","patch"],function(t){u.headers[t]=r.merge(i)}),t.exports=u}).call(this,n(30))},function(t,e,n){"use strict";var r=n(2),o=n(32),i=n(13),s=n(34),a=n(35),u=n(17);t.exports=function(t){return new Promise(function(e,c){var l=t.data,f=t.headers;r.isFormData(l)&&delete f["Content-Type"];var h=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";f.Authorization="Basic "+btoa(d+":"+p)}if(h.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),h.timeout=t.timeout,h.onreadystatechange=function(){if(h&&4===h.readyState&&(0!==h.status||h.responseURL&&0===h.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in h?s(h.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?h.response:h.responseText,status:h.status,statusText:h.statusText,headers:n,config:t,request:h};o(e,c,r),h=null}},h.onabort=function(){h&&(c(u("Request aborted",t,"ECONNABORTED",h)),h=null)},h.onerror=function(){c(u("Network Error",t,null,h)),h=null},h.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",h)),h=null},r.isStandardBrowserEnv()){var m=n(36),g=(t.withCredentials||a(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(f[t.xsrfHeaderName]=g)}if("setRequestHeader"in h&&r.forEach(f,function(t,e){void 0===l&&"content-type"===e.toLowerCase()?delete f[e]:h.setRequestHeader(e,t)}),t.withCredentials&&(h.withCredentials=!0),t.responseType)try{h.responseType=t.responseType}catch(e){if("json"!==t.responseType)throw e}"function"==typeof t.onDownloadProgress&&h.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&h.upload&&h.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){h&&(h.abort(),c(t),h=null)}),void 0===l&&(l=null),h.send(l)})}},function(t,e,n){"use strict";var r=n(33);t.exports=function(t,e,n,o,i){var s=new Error(t);return r(s,e,n,o,i)}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t,e){e=e||{};var n={};return r.forEach(["url","method","params","data"],function(t){void 0!==e[t]&&(n[t]=e[t])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(e[o])?n[o]=r.deepMerge(t[o],e[o]):void 0!==e[o]?n[o]=e[o]:r.isObject(t[o])?n[o]=r.deepMerge(t[o]):void 0!==t[o]&&(n[o]=t[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){void 0!==e[r]?n[r]=e[r]:void 0!==t[r]&&(n[r]=t[r])}),n}},function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(4),o=n(8),i=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={id:null,name:null,config:{}};class c extends o.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","name","config"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},t),this.populate(t)}getId(){return this._id}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getName(){return this._name}setName(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._name=t,this}getConfig(){return i.a.getValueOrClone(this._config)}setConfig(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._config=i.a.getValueOrClone(t),this}getConfigItem(t){return void 0===this._config[t]?null:i.a.getValueOrClone(this._config[t])}setConfigItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._config[t]=i.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(4),o=n(8),i=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class c extends o.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},t),this.populate(t)}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getId(){return this._id}setIsGuest(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._fname=t,this}getLname(){return this._lname}setLname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._email=t,this}getPhone(){return this._phone}setPhone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._phone=t,this}getPermissions(){return i.a.getValueOrClone(this._permissions)}setPermissions(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=i.a.getValueOrClone(t),this}addPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._permissions.push(t),this}removePermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.getPermissions().includes(t)}getAdditionalData(){return i.a.getValueOrClone(this._additionalData)}setAdditionalData(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=i.a.getValueOrClone(t),this}getDataItem(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._additionalData[t]?null:i.a.getValueOrClone(this._additionalData[t])}setDataItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._additionalData[t]=i.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(5),o=n(0);class i{constructor(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visible",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.btn=o.a.getElement(t,!0,!0),this.toggle_el=o.a.getElement(e,!0,!0),this.toggle_class=n,this.hide_on_outside_click=r}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){o.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return v});var r=n(0),o=n(5),i=n(11),s=n(3),a=n(7),u=n(20),c=n(9),l=n(4),f=n(21),h=n(22),d=n(1);function p(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g={dom:r.a,events:o.a,XHRForm:i.b,FormFromURL:i.a,navigation:s.a,request:a.a,Site:u.a,strings:c.a,type_checks:l.a,User:f.a,ToggleOnMobile:h.a,clone:d.a},v=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(n,!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},g,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,g)t?(void 0===window[t]&&(window[t]={}),window[t][e]=g[e]):window[e]=g[e]}});t.jpack=v}.call(this,n(10))},function(t,e,n){"use strict";var r=n(2),o=n(12),i=n(26),s=n(18);function a(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var u=a(n(15));u.Axios=i,u.create=function(t){return a(s(u.defaults,t))},u.Cancel=n(19),u.CancelToken=n(39),u.isCancel=n(14),u.all=function(t){return Promise.all(t)},u.spread=n(40),t.exports=u,t.exports.default=u},function(t,e){
/*!

@@ -3,0 +3,0 @@ * Determine if an object is a Buffer

@@ -1,1 +0,1 @@

!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e)throw"".concat(e," must be a string");var r=this.getElement(t,n);if(!t)return null;var i=(new DOMParser).parseFromString(e,"text/html");return i=r.parentNode.insertBefore(i.documentElement.querySelector("body").childNodes[0],r),r.remove(),i},isVisible(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===(t=this.getElement(t,e,n)))return!1;var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var i=t.getBoundingClientRect(),o={"top-left":{x:i.left,y:i.top},"top-right":{x:i.right,y:i.top},"bottom-left":{x:i.left,y:i.bottom},"bottom-right":{x:i.right,y:i.bottom},center:{x:i.left+t.offsetWidth/2,y:i.top+t.offsetHeight/2}},s=!0;return Object.keys(o).forEach(function(t){var e=o[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return o});var o={getValueOrClone:function(t){var e=typeof t;return"undefined"===e||null===t?null:"object"===e?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t):Array.isArray(t)?[...t]:t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return d});var r=n(5),i=n.n(r),o=n(0),s=n(6),a=n(1),l=n(3);function u(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={trackHistory:!1,pushState:!0,loaderEnabled:!0,loaderDelay:300,incomingElement:"body",replaceElement:"body",loaderClasses:"progress page-navigation-loader",loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated"},d={setConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=c({},this.getConfig(),{},t),this.trackHistory=t.trackHistory,this.pushState=t.pushState,this.loaderEnabled=t.loaderEnabled,this.setLoaderDelay(t.loaderDelay),this.setIncomingElement(t.incomingElement),this.setReplaceElement(t.replaceElement),this._loaderClasses=t.loaderClasses,this._loaderInnerDivClasses=t.loaderInnerDivClasses,this},resetConfig:function(){return this.setConfig(f),this},getConfig:function(){return{trackHistory:this.trackHistory,pushState:this.pushState,loaderEnabled:this.loaderEnabled,loaderDelay:this.getLoaderDelay(),incomingElement:this.getIncomingElement(),replaceElement:this.getReplaceElement(),loaderClasses:this._loaderClasses,loaderInnerDivClasses:this._loaderInnerDivClasses}},trackHistory:f.trackHistory,getHistory:function(){return a.a.getValueOrClone(this._history)},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t,e){if(!this.trackHistory)return!1;if("string"!=typeof t)throw"".concat(t," must be a string");return e=void 0===e?this.getRouteFromMeta():e,this._history.push({url:t,route:e}),this},_history:[],setData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof t||null===t)throw"".concat(t," must be an object");return this._data=a.a.getValueOrClone(t),this},getData:function(){return a.a.getValueOrClone(this._data)},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._data[t]=a.a.getValueOrClone(e),this},getDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._data[t]||null===this._data[t]?null:a.a.getValueOrClone(this._data[t])},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._incomingElement=t},_incomingElement:f.incomingElement,getIncomingElement:function(){return this._incomingElement},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._replaceElement=t},_replaceElement:f.replaceElement,getReplaceElement:function(){return this._replaceElement},pushState:f.pushState,load:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=this;l.a.isDataObject(r,["incomingElement","replaceElement","pushState"],!1,!0,!0),e=c({},s.getData(),{},e);var a=void 0!==r.incomingElement?r.incomingElement:this.getIncomingElement(),u=void 0!==r.replaceElement?r.replaceElement:this.getReplaceElement(),h=o.a.getElement(u,!0),f=void 0!==r.pushState?r.pushState:this.pushState,d=s.getRouteFromMeta();return!!s._triggerOnBeforeRequest(h,u,a,d,e)&&(s.showLoader(),i.a.get(t).then(function(r){s.hideLoader(),s._replacePageContent(r.data,t,a,u,f,d,e,n)}).catch(function(n){s.hideLoader();var r="object"==typeof n&&null!==n&&n.isAxiosError?n:null;throw n=null!==r?r.response.statusText:n,s._triggerFail(n,t,e,r),n}),this)},loaderEnabled:f.loaderEnabled,setLoaderDelay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;if("number"!=typeof t)throw"".concat(t," must be an integer");return this._loaderDelay=t,this},_loaderDelay:f.loaderDelay,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:f.loaderClasses,_loaderInnerDivClasses:f.loaderInnerDivClasses,_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=o.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.head,e=t.querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),{},t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onloadCallbacks.push(t),this},removeOnload:function(t){return this._onloadCallbacks.filter(function(e){return e!==t}),this},_onUnloadCallbacks:[],onUnload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){return this._onUnloadCallbacks.filter(function(e){return e!==t}),this},_onFailCallbacks:[],onFail:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onFailCallbacks.push(t),this},removeOnFail:function(t){return this._onFailCallbacks.filter(function(e){return e!==t}),this},onBeforeRequest:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onBeforeRequestCallbacks.push(t),this},removeOnBeforeRequest:function(t){return this._onBeforeRequestCallbacks.filter(function(e){return e!==t}),this},_onBeforeRequestCallbacks:[],_triggerOnload:function(t,e,n,r,i){return this._onloadCallbacks.forEach(function(e){e(t,i,{selector:t,replacedSelector:n,route:r})}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(i){i(t,r,{selector:e,route:n})}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(i){i(t,e,n,r)}),this},_triggerOnBeforeRequest:function(t,e,n,r,i){var o=!1;return this._onBeforeRequestCallbacks.forEach(function(s){var a=s(t,i,{selector:e,incomingSelector:n,route:r});"boolean"!=typeof a||a||(o=!0)}),!o},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),{},null,{pushState:!1})},this},_replacePageContent(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(n=void 0===n?this.getIncomingElement():n,r=void 0===r?this.getReplaceElement():r,"string"!=typeof e)throw"Provided url (".concat(e,") must be a string");if("string"!=typeof n)throw"incoming_el_selector (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el_selector (".concat(r,") must be a string");var u=o.a.getElement(r,!0);this._triggerUnload(u,r,s,a);var c=this._parseHTML(t,n);if(c.html.length){o.a.remove("meta"),document.head.append(c.metas),o.a.remove('[rel="canonical"]'),Array.from(c.links).forEach(function(t){document.head.append(t)}),document.body.classList=c.body_classes,i&&history.pushState({url:e},c.title,e),this._setTitle(c.title);var h=o.a.replaceElWithHTML(u,c.html);this._triggerOnload(h,n,r,c.route,a),"function"==typeof l&&l(h,n,r,s,a),this._addHistoryItem(e,c.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!=typeof e&&null!==e)throw"Provided parent_el (".concat(e,") must be a string or null");if(c=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(c=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),i=r.querySelector("title");i=i?i.innerText:null;var o=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList.toString(),l=t;if(e){var u=r.querySelector(e);if(!u)throw"Could not find parent selector ".concat(e);l=u.outerHTML}var c=c||this.getRouteFromMeta(r);return n=r=null,{title:i,route:c,metas:o,links:s,body_classes:a,html:l}},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=JSON.stringify(t),s="".concat(o," must be an object");if(void 0===t){if(i)throw s;return!1}var a="object"==typeof t&&null!==t;if(!a||Array.isArray(t)){if(i)throw s;return!1}if(Array.isArray(e)){var l=!1,u=[],c=Object.keys(t);if(!c.length&&!n)return!0;if(e.forEach(function(t){c.includes(t)?l=!0:u.push(t)}),!l){if(i)throw"".concat(o," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&u.length){if(i)throw"".concat(o," is missing data: ")+u.join(", ");return!1}if(r){var h=[];if(c.forEach(function(t){e.includes(t)||h.push(t)}),h.length){if(i)throw"".concat(o," contains invalid data: ")+h.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return i.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return i.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var i=r.a.getElements(t);if(!i.length)return t;var o=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return i.forEach(function(t){t.addEventListener(e,o,!1)}),o},on:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.addEventListener(e,n)}),i):t},off:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.removeEventListener(e,n)}),i):t},trigger:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.a.getElements(t);return o.length?(i.detail=n,e=new CustomEvent(e,i),o.forEach(function(t){t.dispatchEvent(e)}),o):t}}},function(t,e){t.exports=axios},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(15);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return this.requireWindowLocation(),"https:"===window.location.protocol},getDomain:function(){return this.requireWindowLocation(),window.location.hostname||window.location.host},getDomainWithProtocol:function(){return this.requireWindowLocation(),window.location.origin},getURI:function(){return this.requireWindowLocation(),window.location.pathname},getURIWithQueryString:function(){return this.requireWindowLocation(),window.location.pathname+window.location.search},getFullURL:function(){return this.requireWindowLocation(),window.location.href},appendSlash:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"!==t[t.length-1]?t+"/":t},requireWindowLocation:function(){if(void 0===window.location||!window.location)throw"Window.Location is required for jpack.request"}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n(8);class o{constructor(){}populate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[i.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"get"+this.ucfirst(t)},setter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"set"+this.ucfirst(t)},ucfirst:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(5),s=n.n(o);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(16);var u={xhrSubmit:!0,submitURL:null,submitMethod:null,onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class c{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof e||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._validateCallback=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," must be a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}onError(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;i.a.showLoader();var o=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");return s()({url:n,method:r,data:o}).then(function(n){i.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var o=i.a._parseHTML(r,e.getIncomingElementSelector());return o.html.length?e.insertForm(o,r,t):e.triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e.triggerOnError(r.error,r,t):e.triggerOnSuccess(r,t)}).catch(function(t){throw i.a.hideLoader(),e._processing=!1,t}),this}getFormValues(t){return new FormData(t)}}function h(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class g extends c{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(null,e),"string"!=typeof t)throw"".concat(t," must be a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," must be a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;i.a.showLoader(),s.a.get(this.getURL()).then(function(e){i.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=i.a._parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw i.a.hideLoader(),t})}insertForm(t,e,n){var i=this.getInsertIntoElement();if(null===i)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(i=r.a.getElement(i,!0)).innerHTML=t.html,n=i.querySelector("form"),this.attachSubmitHandler(n),this.triggerOnload(n),i}onload(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return c}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),i=n(7),o=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={id:null,name:null,config:{}};class u extends i.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","name","config"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},t),this.populate(t)}getId(){return this._id}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getName(){return this._name}setName(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._name=t,this}getConfig(){return o.a.getValueOrClone(this._config)}setConfig(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._config=o.a.getValueOrClone(t),this}getConfigItem(t){return void 0===this._config[t]?null:o.a.getValueOrClone(this._config[t])}setConfigItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._config[t]=o.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),i=n(7),o=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class u extends i.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},t),this.populate(t)}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getId(){return this._id}setIsGuest(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._fname=t,this}getLname(){return this._lname}setLname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._email=t,this}getPhone(){return this._phone}setPhone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._phone=t,this}getPermissions(){return o.a.getValueOrClone(this._permissions)}setPermissions(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=o.a.getValueOrClone(t),this}addPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._permissions.push(t),this}removePermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.getPermissions().includes(t)}getAdditionalData(){return o.a.getValueOrClone(this._additionalData)}setAdditionalData(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=o.a.getValueOrClone(t),this}getDataItem(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._additionalData[t]?null:o.a.getValueOrClone(this._additionalData[t])}setDataItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._additionalData[t]=o.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(4),i=n(0);class o{constructor(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visible",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.btn=i.a.getElement(t,!0,!0),this.toggle_el=i.a.getElement(e,!0,!0),this.toggle_class=n,this.hide_on_outside_click=r}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){i.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return b});var r=n(0),i=n(4),o=n(9),s=n(2),a=n(6),l=n(10),u=n(8),c=n(3),h=n(11),f=n(12),d=n(1);function g(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p={dom:r.a,events:i.a,XHRForm:o.b,FormFromURL:o.a,navigation:s.a,request:a.a,Site:l.a,strings:u.a,type_checks:c.a,User:h.a,ToggleOnMobile:f.a,clone:d.a},b=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(n,!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},p,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,p)t?(void 0===window[t]&&(window[t]={}),window[t][e]=p[e]):window[e]=p[e]}});t.jpack=b}.call(this,n(14))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=url-search-params-polyfill},function(t,e){t.exports=formdata-polyfill}]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=13)}([function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getElement:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this.getElements(t,e);if(r.length>1&&n)throw'More than 1 result found for "'.concat(t,'"');return r.length?r[0]:null},getElements:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[];if(void 0!==t&&t)if(t instanceof Element||t instanceof HTMLDocument)n.push(t);else if("string"==typeof t)n=(n=document.querySelectorAll(t))?Array.from(n):n;else if(t instanceof jQuery)t.length&&(n=t.toArray());else if(t instanceof NodeList||t instanceof HTMLCollection)n=Array.from(t);else{if(!Array.isArray(t))throw'Invalid value: "'.concat(t,'"');t.forEach(function(t){(t=r.getElement(t))&&n.push(t)})}else;if(!n.length&&e)throw'Failed to find "'.concat(t,'"');return n},remove:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getElements(t);if(!n.length){if(e)throw'Could not find "'.concat(t,'"');return this}return n.forEach(function(t){t.parentNode.removeChild(t)}),this},replaceElWithHTML:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"!=typeof e)throw"".concat(e," must be a string");var r=this.getElement(t,n);if(!t)return null;var i=(new DOMParser).parseFromString(e,"text/html");return i=r.parentNode.insertBefore(i.documentElement.querySelector("body").childNodes[0],r),r.remove(),i},isVisible(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===(t=this.getElement(t,e,n)))return!1;var r=getComputedStyle(t);if("none"===r.display)return!1;if("visible"!==r.visibility)return!1;if(0===r.opacity)return!1;if(t.offsetWidth+t.offsetHeight+t.getBoundingClientRect().height+t.getBoundingClientRect().width===0)return!1;var i=t.getBoundingClientRect(),o={"top-left":{x:i.left,y:i.top},"top-right":{x:i.right,y:i.top},"bottom-left":{x:i.left,y:i.bottom},"bottom-right":{x:i.right,y:i.bottom},center:{x:i.left+t.offsetWidth/2,y:i.top+t.offsetHeight/2}},s=!0;return Object.keys(o).forEach(function(t){var e=o[t];return e.x<0&&(s=!1),!1}),s},exists:function(t){return this.getElements(t).length},multipleExist:function(t){return this.getElements(t).length>1}}},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",function(){return o});var o={getValueOrClone:function(t){var e=typeof t;return"undefined"===e||null===t?null:"object"===e?function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(n,!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},t):Array.isArray(t)?[...t]:t}}},function(t,e,n){"use strict";n.d(e,"a",function(){return d});var r=n(5),i=n.n(r),o=n(0),s=n(6),a=n(1),l=n(3);function u(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?u(n,!0).forEach(function(e){h(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):u(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var f={trackHistory:!1,pushState:!0,loaderEnabled:!0,loaderDelay:300,incomingElement:"body",replaceElement:"body",loaderClasses:"progress page-navigation-loader",loaderInnerDivClasses:"progress-bar progress-bar-striped progress-bar-animated"},d={setConfig:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=c({},this.getConfig(),{},t),this.trackHistory=t.trackHistory,this.pushState=t.pushState,this.loaderEnabled=t.loaderEnabled,this.setLoaderDelay(t.loaderDelay),this.setIncomingElement(t.incomingElement),this.setReplaceElement(t.replaceElement),this._loaderClasses=t.loaderClasses,this._loaderInnerDivClasses=t.loaderInnerDivClasses,this},resetConfig:function(){return this.setConfig(f),this},getConfig:function(){return{trackHistory:this.trackHistory,pushState:this.pushState,loaderEnabled:this.loaderEnabled,loaderDelay:this.getLoaderDelay(),incomingElement:this.getIncomingElement(),replaceElement:this.getReplaceElement(),loaderClasses:this._loaderClasses,loaderInnerDivClasses:this._loaderInnerDivClasses}},trackHistory:f.trackHistory,getHistory:function(){return a.a.getValueOrClone(this._history)},getLastHistoryRecord(){return this._history.pop()},_addHistoryItem(t,e){if(!this.trackHistory)return!1;if("string"!=typeof t)throw"".concat(t," must be a string");return e=void 0===e?this.getRouteFromMeta():e,this._history.push({url:t,route:e}),this},_history:[],setData:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("object"!=typeof t||null===t)throw"".concat(t," must be an object");return this._data=a.a.getValueOrClone(t),this},getData:function(){return a.a.getValueOrClone(this._data)},setDataItem:function(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._data[t]=a.a.getValueOrClone(e),this},getDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._data[t]||null===this._data[t]?null:a.a.getValueOrClone(this._data[t])},clearData:function(){return this.setData({}),this},clearDataItem:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0!==this._data[t]&&delete this._data[t],this},_data:{},setIncomingElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._incomingElement=t},_incomingElement:f.incomingElement,getIncomingElement:function(){return this._incomingElement},setReplaceElement:function(t){if("string"!=typeof t)throw"".concat(t," must be a string");this._replaceElement=t},_replaceElement:f.replaceElement,getReplaceElement:function(){return this._replaceElement},pushState:f.pushState,load:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=this;l.a.isDataObject(r,["incomingElement","replaceElement","pushState"],!1,!0,!0),e=c({},s.getData(),{},e);var a=void 0!==r.incomingElement?r.incomingElement:this.getIncomingElement(),u=void 0!==r.replaceElement?r.replaceElement:this.getReplaceElement(),h=o.a.getElement(u,!0),f=void 0!==r.pushState?r.pushState:this.pushState,d=s.getRouteFromMeta();return!!s._triggerOnBeforeRequest(h,u,a,d,e)&&(s.showLoader(),i.a.get(t).then(function(r){s.hideLoader(),s._replacePageContent(r.data,t,a,u,f,d,e,n)}).catch(function(n){s.hideLoader();var r="object"==typeof n&&null!==n&&n.isAxiosError?n:null;throw n=null!==r?r.response.statusText:n,s._triggerFail(n,t,e,r),n}),this)},loaderEnabled:f.loaderEnabled,setLoaderDelay:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300;if("number"!=typeof t)throw"".concat(t," must be an integer");return this._loaderDelay=t,this},_loaderDelay:f.loaderDelay,getLoaderDelay:function(){return this._loaderDelay},showLoader:function(){var t=this;if(t.loaderEnabled)return t.loader_timeout=window.setTimeout(function(){t._getLoaderEl().classList.add("active")},t.getLoaderDelay()),this},hideLoader:function(){if(this.loaderEnabled)return window.clearTimeout(this.loader_timeout),this._getLoaderEl().classList.remove("active"),this},_loaderClasses:f.loaderClasses,_loaderInnerDivClasses:f.loaderInnerDivClasses,_getLoaderEl:function(){if(this.loaderEnabled){if(this.navLoaderCached)return this.navLoaderCached;var t=document.createElement("div");t.classList=this._loaderClasses;var e=document.createElement("div");return e.classList=this._loaderInnerDivClasses,t.append(e),document.body.prepend(t),this.navLoaderCached=o.a.getElement(".page-navigation-loader"),this.navLoaderCached}},getRouteFromMeta:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.head,e=t.querySelector('[name="current_route"]');return e=e?e.content:null},reload:function(t){return t="function"!=typeof t?null:t,this.load(s.a.getFullURL(),{},t),this},fullReload:function(){this.showLoader(),window.location.reload()},redirect:function(t){this.showLoader(),window.location.href=t},_onloadCallbacks:[],onload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onloadCallbacks.push(t),this},removeOnload:function(t){return this._onloadCallbacks.filter(function(e){return e!==t}),this},_onUnloadCallbacks:[],onUnload:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onUnloadCallbacks.push(t),this},removeOnUnload:function(t){return this._onUnloadCallbacks.filter(function(e){return e!==t}),this},_onFailCallbacks:[],onFail:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onFailCallbacks.push(t),this},removeOnFail:function(t){return this._onFailCallbacks.filter(function(e){return e!==t}),this},onBeforeRequest:function(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._onBeforeRequestCallbacks.push(t),this},removeOnBeforeRequest:function(t){return this._onBeforeRequestCallbacks.filter(function(e){return e!==t}),this},_onBeforeRequestCallbacks:[],_triggerOnload:function(t,e,n,r,i){return this._onloadCallbacks.forEach(function(e){e(t,i,{selector:t,replacedSelector:n,route:r})}),this},_triggerUnload:function(t,e,n,r){return this._onUnloadCallbacks.forEach(function(i){i(t,r,{selector:e,route:n})}),this},_triggerFail:function(t,e,n,r){return this._onFailCallbacks.forEach(function(i){i(t,e,n,r)}),this},_triggerOnBeforeRequest:function(t,e,n,r,i){var o=!1;return this._onBeforeRequestCallbacks.forEach(function(s){var a=s(t,i,{selector:e,incomingSelector:n,route:r});"boolean"!=typeof a||a||(o=!0)}),!o},initHistoryHandlers:function(){var t=this;return window.onpushstate=function(e){t.load(s.a.getURIWithQueryString())},window.onpopstate=function(e){t.load(s.a.getURIWithQueryString(),{},null,{pushState:!1})},this},_replacePageContent(t,e,n,r){var i=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{},l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;if(n=void 0===n?this.getIncomingElement():n,r=void 0===r?this.getReplaceElement():r,"string"!=typeof e)throw"Provided url (".concat(e,") must be a string");if("string"!=typeof n)throw"incoming_el_selector (".concat(n,") must be a string");if("string"!=typeof r)throw"replace_el_selector (".concat(r,") must be a string");var u=o.a.getElement(r,!0);this._triggerUnload(u,r,s,a);var c=this._parseHTML(t,n);if(c.html.length){o.a.remove("meta"),document.head.append(c.metas),o.a.remove('[rel="canonical"]'),Array.from(c.links).forEach(function(t){document.head.append(t)}),document.body.classList=c.body_classes,i&&history.pushState({url:e},c.title,e),this._setTitle(c.title);var h=o.a.replaceElWithHTML(u,c.html);this._triggerOnload(h,n,r,c.route,a),"function"==typeof l&&l(h,n,r,s,a),this._addHistoryItem(e,c.route),this.getReplaceElement()!==r&&this.setReplaceElement(n)}return this},_parseHTML(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"!=typeof e&&null!==e)throw"Provided parent_el (".concat(e,") must be a string or null");if(c=null,"object"==typeof t&&null!==t){if(!t.html)throw"Incoming JSON object does not contain HTML key";t.route&&(c=t.route),t=t.html}var n=new DOMParser,r=n.parseFromString(t,"text/html"),i=r.querySelector("title");i=i?i.innerText:null;var o=r.head.getElementsByTagName("meta"),s=r.querySelectorAll('link[rel="canonical"]'),a=r.body.classList.toString(),l=t;if(e){var u=r.querySelector(e);if(!u)throw"Could not find parent selector ".concat(e);l=u.outerHTML}var c=c||this.getRouteFromMeta(r);return n=r=null,{title:i,route:c,metas:o,links:s,body_classes:a,html:l}},_setTitle:function(t){return document.title=t,this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={isDataObject:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=JSON.stringify(t),s="".concat(o," must be an object");if(void 0===t){if(i)throw s;return!1}var a="object"==typeof t&&null!==t;if(!a||Array.isArray(t)){if(i)throw s;return!1}if(Array.isArray(e)){var l=!1,u=[],c=Object.keys(t);if(!c.length&&!n)return!0;if(e.forEach(function(t){c.includes(t)?l=!0:u.push(t)}),!l){if(i)throw"".concat(o," does not contain at least one of the following: ")+e.join(", ");return!1}if(n&&u.length){if(i)throw"".concat(o," is missing data: ")+u.join(", ");return!1}if(r){var h=[];if(c.forEach(function(t){e.includes(t)||h.push(t)}),h.length){if(i)throw"".concat(o," contains invalid data: ")+h.join(", ");return!1}}}return!0}}},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i={setGlobal:function(t){for(var e in t="string"==typeof t?t:null,this)this.hasOwnProperty(e)&&"setGlobal"!==e&&(t?(void 0===window[t]&&(window[t]={}),window[t][e]=this[e]):window[e]=this[e])},onClick:function(t,e){return i.onEventPreventDefault(t,"click",e)},onSubmit:function(t,e){return i.onEventPreventDefault(t,"submit",e)},onEventPreventDefault:function(t,e,n){var i=r.a.getElements(t);if(!i.length)return t;var o=function(t){return Array.isArray(t)&&(t=t[0]),t.preventDefault(),n.call(this,t),!1};return i.forEach(function(t){t.addEventListener(e,o,!1)}),o},on:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.addEventListener(e,n)}),i):t},off:function(t,e,n){var i=r.a.getElements(t);return i.length?(i.forEach(function(t){t.removeEventListener(e,n)}),i):t},trigger:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.a.getElements(t);return o.length?(i.detail=n,e=new CustomEvent(e,i),o.forEach(function(t){t.dispatchEvent(e)}),o):t}}},function(t,e){t.exports=axios},function(t,e,n){"use strict";n.d(e,"a",function(){return r}),n(15);var r={query:new URLSearchParams(window.location.search),isHttps:function(){return this.requireWindowLocation(),"https:"===window.location.protocol},getDomain:function(){return this.requireWindowLocation(),window.location.hostname||window.location.host},getDomainWithProtocol:function(){return this.requireWindowLocation(),window.location.origin},getURI:function(){return this.requireWindowLocation(),window.location.pathname},getURIWithQueryString:function(){return this.requireWindowLocation(),window.location.pathname+window.location.search},getFullURL:function(){return this.requireWindowLocation(),window.location.href},appendSlash:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"/"!==t[t.length-1]?t+"/":t},requireWindowLocation:function(){if(void 0===window.location||!window.location)throw"Window.Location is required for jpack.request"}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(3),i=n(8);class o{constructor(){}populate(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this;if(void 0===this._keys)throw"Cannot populate object if _keys property is not set";return r.a.isDataObject(t,this._keys,!1,!0,!0),this._keys.forEach(function(n){void 0!==t[n]&&e[i.a.setter(n)](t[n])}),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r={getter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"get"+this.ucfirst(t)},setter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"set"+this.ucfirst(t)},ucfirst:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t&&t[0].toUpperCase()+t.slice(1)}}},function(t,e,n){"use strict";var r=n(0),i=n(2),o=n(5),s=n.n(o);function a(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(16);var u={xhrSubmit:!0,submitURL:null,submitMethod:null,onPreSubmit:function(t,e,n,r){return{form_values:e,url:n,method:r}},onError:function(t,e,n){alert(t)},onSuccess:function(t,e){"string"==typeof t.success?alert(t.success):alert("Your submission has been received")},validateForm:function(t){t.classList.add("was-validated");var e=!t.querySelector(":invalid");return e&&t.classList.remove("was-validated"),e}};class c{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if("object"!=typeof e||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?a(n,!0).forEach(function(e){l(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},u,{},e),this.setForm(t),this.setValidateCallback(e.validateForm),this.setXHRSubmit(e.xhrSubmit),this.setPreSubmitCallback(e.onPreSubmit),this.setSubmitMethod(e.submitMethod),this.setSubmitURL(e.submitURL),this.onSuccess(e.onSuccess),this.onError(e.onError)}setValidateCallback(t){if("function"!=typeof t)throw"".concat(t," must be a function");return this._validateCallback=t,this}setPreSubmitCallback(t){if("function"!=typeof t&&null!==t)throw"".concat(t," must be a function or null");return this._preSubmit=t,this}validate(t){return void 0===t&&(t=this.getForm()),this._validateCallback(t)}setForm(t){if(!t||void 0===t)throw"Form element is required";if(!(t=r.a.getElement(t,!0,!0)))throw"Invalid form element received";return this._form=t,this}getForm(){return this._form}setXHRSubmit(t){return this._xhrSubmit=!!t,this}setSubmitMethod(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._submitMethod=t,this}getSubmitMethod(){return this._submitMethod}setSubmitURL(t){if("string"!=typeof t&&"function"!=typeof t&&null!==t)throw"".concat(t," must be a string, function, or null");return this._submitURL=t,this}getSubmitURL(){return this._submitURL}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):null===e?t.action:e}attachSubmitHandler(t){if(this._xhrSubmit){if(!(t=void 0===t?this.getForm():r.a.getElement(t)))throw"Form element not received, cannot attach submit handler";var e=this;return t.addEventListener("submit",function(n){return!e._xhrSubmit||(n.preventDefault(),e.submitForm(t),!1)}),this}}onSuccess(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onSuccess&&(this._onSuccess=[]),this._onSuccess.push(t),this}clearOnSuccessCallbacks(){return this._onSuccess=[],this}onError(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onError&&(this._onError=[]),this._onError.push(t),this}clearOnErrorCallbacks(){return this._onError=[],this}_triggerOnSuccess(t,e){return void 0!==this._onSuccess&&(this._onSuccess.forEach(function(n){n(t,e)}),this)}_triggerOnError(t,e,n){return void 0!==this._onError&&(this._onError.forEach(function(r){r(t,e,n)}),this)}submitForm(t){if(void 0===this._processing&&(this._processing=!1),this._processing)return!1;this._processing=!0;var e=this,n=this.getFinalSubmitURL(t),r=this.getSubmitMethod();if(null===r&&void 0!==t.attributes.method&&(r=t.method),r=r?r.toLowerCase():"post",!this.validate(t))return this._processing=!1,!1;i.a.showLoader();var o=Array.from(this.getFormValues(t),t=>t.map(encodeURIComponent).join("=")).join("&");if("function"==typeof this._preSubmit){var a=this._preSubmit(t,o,n,r);if("boolean"==typeof a&&!a)return!1;"object"==typeof a&&a.url&&(n=a.url),"object"==typeof a&&a.method&&(r=a.method),"object"==typeof a&&a.form_values&&(o=a.form_values)}return s()({url:n,method:r,data:o}).then(function(n){i.a.hideLoader(),e._processing=!1;var r=n.data;try{r="string"==typeof r?JSON.parse(r):r}catch(t){}if("string"==typeof r){if("string"==typeof e.getIncomingElementSelector()){var o=i.a._parseHTML(r,e.getIncomingElementSelector());return o.html.length?e.insertForm(o,r,t):e._triggerOnError("".concat(e.getIncomingElementSelector()," could not be found in response from the server"),r,t)}return e.insertForm({html:r},r,t)}if("object"==typeof r&&null!==r)return r.html?e.insertForm({html:r.html},r,t):r.error?e._triggerOnError(r.error,r,t):e._triggerOnSuccess(r,t)}).catch(function(n){throw i.a.hideLoader(),e._processing=!1,"object"==typeof n&&n.isAxiosError&&(n=n.response.statusText),e._triggerOnError(n,data,t),n}),this}getFormValues(t){return new FormData(t)}}function h(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d={incomingElementSelector:null,insertIntoElement:null,onload:function(t){return this}};class g extends c{constructor(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(null,e),"string"!=typeof t)throw"".concat(t," must be a string");if("object"!=typeof(e=void 0===e?{}:e)||null===e)throw"".concat(e," must be an object");e=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(n,!0).forEach(function(e){f(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},d,{},e),this.setURL(t),this.setIncomingElementSelector(e.incomingElementSelector),this.setInsertIntoElement(e.insertIntoElement),this.onload(e.onload)}setForm(t){return this._form=t,this}setURL(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._url=t,this}getURL(){return this._url}getFinalSubmitURL(t){var e=this.getSubmitURL(t);return"function"==typeof this._submitURL?this._submitURL(t):(null===e&&t.attributes.action&&(e=t.action),null===(e=e||this.getURL())&&(e=t.action),e)}setIncomingElementSelector(t){if(null!==t&&"string"!=typeof t)throw"".concat(t," must be a string or null value");return this._incomingElementSelector=t,this}getIncomingElementSelector(){return this._incomingElementSelector}setInsertIntoElement(t){this._insertIntoElement=t}getInsertIntoElement(){return this._insertIntoElement}getForm(){var t=this;i.a.showLoader(),s.a.get(this.getURL()).then(function(e){i.a.hideLoader();var n=e.data;try{n="string"==typeof n?JSON.parse(n):n}catch(t){}if("string"==typeof n){if("string"==typeof t.getIncomingElementSelector()){var r=i.a._parseHTML(n,t.getIncomingElementSelector());return t.insertForm(r,n)}return t.insertForm({html:n})}if("object"==typeof n&&null!==n&&void 0!==n.html)return t.insertForm({html:n.html},n);throw"Unexpected server response ".concat(n)}).catch(function(t){throw i.a.hideLoader(),t})}insertForm(t,e,n){var i=this.getInsertIntoElement();if(null===i)throw"Cannot determine where to insert form. Overwrite insertForm() or provide insertIntoElement";return(i=r.a.getElement(i,!0)).innerHTML=t.html,n=i.querySelector("form"),this.attachSubmitHandler(n),this._triggerOnload(n),i}onload(t){if("function"!=typeof t)throw"".concat(t," must be a function");return void 0===this._onload&&(this._onload=[]),this._onload.push(t),this}clearOnloadCallbacks(){return this._onload=[],this}_triggerOnload(t){return void 0!==this._onload&&(this._onload.forEach(function(e){e(t)}),this)}}n.d(e,"b",function(){return c}),n.d(e,"a",function(){return g})},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),i=n(7),o=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={id:null,name:null,config:{}};class u extends i.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","name","config"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},t),this.populate(t)}getId(){return this._id}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getName(){return this._name}setName(t){if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._name=t,this}getConfig(){return o.a.getValueOrClone(this._config)}setConfig(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._config=o.a.getValueOrClone(t),this}getConfigItem(t){return void 0===this._config[t]?null:o.a.getValueOrClone(this._config[t])}setConfigItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._config[t]=o.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return u});var r=n(3),i=n(7),o=n(1);function s(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var l={id:null,isGuest:!1,isAdmin:!1,username:null,fname:null,lname:null,email:null,phone:null,permissions:[],additionalData:{}};class u extends i.a{constructor(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this._keys=["id","isGuest","isAdmin","username","fname","lname","email","phone","permissions","additionalData"],t=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(n,!0).forEach(function(e){a(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},l,{},t),this.populate(t)}setId(t){if("number"!=typeof t&&null!==t)throw"".concat(t," must be a number or null");return this._id=t,this}getId(){return this._id}setIsGuest(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isGuest=t,this}getIsGuest(){return this._isGuest}setIsAdmin(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this._isAdmin=t,this}getIsAdmin(){return this._isAdmin}setUsername(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._username=t,this}getUsername(){return this._username}getFname(){return this._fname}setFname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._fname=t,this}getLname(){return this._lname}setLname(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._lname=t,this}getName(){return this.getFname()+" "+this.getLname()}getEmail(){return this._email}setEmail(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._email=t,this}getPhone(){return this._phone}setPhone(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if("string"!=typeof t&&null!==t)throw"".concat(t," must be a string or null");return this._phone=t,this}getPermissions(){return o.a.getValueOrClone(this._permissions)}setPermissions(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw"setPermissions requires an array";return this._permissions=o.a.getValueOrClone(t),this}addPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this._permissions.push(t),this}removePermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.setPermissions(this._permissions.filter(function(e){return e!==t})),this}hasPermission(t){if("string"!=typeof t)throw"".concat(t," must be a string");return this.getPermissions().includes(t)}getAdditionalData(){return o.a.getValueOrClone(this._additionalData)}setAdditionalData(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r.a.isDataObject(t,null,!1,!1,!0),this._additionalData=o.a.getValueOrClone(t),this}getDataItem(t){if("string"!=typeof t)throw"".concat(t," must be a string");return void 0===this._additionalData[t]?null:o.a.getValueOrClone(this._additionalData[t])}setDataItem(t,e){if("string"!=typeof t)throw"".concat(t," must be a string");return this._additionalData[t]=o.a.getValueOrClone(e),this}}},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(4),i=n(0);class o{constructor(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"visible",r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];this.btn=i.a.getElement(t,!0,!0),this.toggle_el=i.a.getElement(e,!0,!0),this.toggle_class=n,this.hide_on_outside_click=r}init(){var t=this;return this.onWindowResize=function(){window.clearTimeout(void 0),window.setTimeout(function(){i.a.isVisible(t.btn)?t.toggle_el.classList.remove(t.toggle_class):t.toggle_el.classList.add(t.toggle_class)},200)},this.hide_on_outside_click&&(this.onClickOutside=function(e){var n=e.target;if(n===t.btn)return!1;do{if(t.btn===n)return!1}while(n=n.parentNode);if((n=e.target)===t.toggle_el)return!1;do{if(t.toggle_el===n)return!1}while(n=n.parentNode);t.toggle_el.classList.remove(t.toggle_class)},r.a.on("body","click",this.onClickOutside)),this.onClickToggleBtn=r.a.onClick(this.btn,function(){t.toggle_el.classList.toggle(t.toggle_class)}),window.addEventListener("resize",this.onWindowResize),this.onWindowResize(),this}destroy(){this.hide_on_outside_click&&r.a.off("body","click",this.onClickOutside),r.a.off(this.btn,"click",this.onClickToggleBtn),window.removeEventListener("resize",this.onWindowResize)}}},function(t,e,n){"use strict";n.r(e),function(t){n.d(e,"jpack",function(){return b});var r=n(0),i=n(4),o=n(9),s=n(2),a=n(6),l=n(10),u=n(8),c=n(3),h=n(11),f=n(12),d=n(1);function g(t,e){var n=Object.keys(t);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(t)),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n}function m(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p={dom:r.a,events:i.a,XHRForm:o.b,FormFromURL:o.a,navigation:s.a,request:a.a,Site:l.a,strings:u.a,type_checks:c.a,User:h.a,ToggleOnMobile:f.a,clone:d.a},b=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(n,!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(n).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},p,{},{setGlobal:function(t){for(var e in t="string"==typeof t?t:null,p)t?(void 0===window[t]&&(window[t]={}),window[t][e]=p[e]):window[e]=p[e]}});t.jpack=b}.call(this,n(14))},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=url-search-params-polyfill},function(t,e){t.exports=formdata-polyfill}]);

@@ -243,3 +243,3 @@ import {navigation} from "../navigation";

//run the onload callback now that the form is there
this.triggerOnload(form);
this._triggerOnload(form);

@@ -277,3 +277,3 @@ return el;

*/
triggerOnload(form){
_triggerOnload(form){
if(typeof this._onload === "undefined" ) return false;

@@ -280,0 +280,0 @@

@@ -12,2 +12,6 @@ import {dom} from "../dom";

submitMethod:null, //will be grabbed from the form's method attribute, or fallback to "POST"
onPreSubmit: function(form, form_values, url, method){ //called right before the request to the server
//return false; //you can return false to stop submission
return {form_values:form_values, url:url, method:method}; //you can return these if you want to override them (optional)
},
onError: function(error, response, form){ alert(error); }, //called when the form is submitted and fails

@@ -46,6 +50,6 @@ onSuccess: function(response, form){ //called when the form is submitted successfully

*/
constructor(form, options = {}){
constructor(form, options = {}) {
//if options are undefined, set them
if( typeof options !== "object" || options === null ) throw `${options} must be an object`;
if (typeof options !== "object" || options === null) throw `${options} must be an object`;

@@ -58,2 +62,3 @@ //extend defaults with provided options

this.setXHRSubmit(options.xhrSubmit);
this.setPreSubmitCallback(options.onPreSubmit);
this.setSubmitMethod(options.submitMethod);

@@ -77,2 +82,11 @@ this.setSubmitURL(options.submitURL);

/**
* Attach a pre-submit handler (only one allowed)
*/
setPreSubmitCallback(callback){
if( typeof callback !== 'function' && callback !== null ) throw `${callback} must be a function or null`;
this._preSubmit = callback;
return this;
}
/**
* Runs the validate callback and passes the form

@@ -248,16 +262,2 @@ *

/**
* Triggers all onSuccess callbacks
*
* @param response
* @param form
*/
triggerOnSuccess(response, form){
if(typeof this._onSuccess === "undefined" ) return false;
this._onSuccess.forEach(function(onSuccess){
onSuccess(response, form);
});
return this;
}
/**
* Add a callback function to run when the form is submitted successfully

@@ -285,2 +285,16 @@ *

/**
* Triggers all onSuccess callbacks
*
* @param response
* @param form
*/
_triggerOnSuccess(response, form){
if(typeof this._onSuccess === "undefined" ) return false;
this._onSuccess.forEach(function(onSuccess){
onSuccess(response, form);
});
return this;
}
/**
* Triggers the onError callbacks

@@ -293,3 +307,3 @@ *

*/
triggerOnError(error, response, form){
_triggerOnError(error, response, form){
if(typeof this._onError === "undefined" ) return false;

@@ -355,3 +369,3 @@ this._onError.forEach(function(onError){

//get form values
const form_values = Array.from(
let form_values = Array.from(
this.getFormValues(form),

@@ -361,2 +375,11 @@ e => e.map(encodeURIComponent).join('=')

//run the preSubmit callback (if it exists), and stop if it returns false
if( typeof this._preSubmit === 'function' ) {
let result = this._preSubmit(form, form_values, url, method);
if (typeof result === 'boolean' && !result) return false;
if (typeof result === 'object' && result.url) url = result.url;
if (typeof result === 'object' && result.method) method = result.method;
if (typeof result === 'object' && result.form_values) form_values = result.form_values;
}
axios({

@@ -383,3 +406,3 @@ url: url,

if( !parsed.html.length ){
return self.triggerOnError(`${self.getIncomingElementSelector()} could not be found in response from the server`, data, form);
return self._triggerOnError(`${self.getIncomingElementSelector()} could not be found in response from the server`, data, form);
}

@@ -400,7 +423,7 @@ //provide the form's HTML in an object containing other details like the route and the full response to insertForm

if( data.error ){
return self.triggerOnError(data.error, data, form);
return self._triggerOnError(data.error, data, form);
}
//if it doesn't APPEAR to be the form again, or an error, let's call it a success
return self.triggerOnSuccess(data, form)
return self._triggerOnSuccess(data, form)
}

@@ -411,2 +434,4 @@ })

self._processing = false;
if( typeof error === 'object' && error.isAxiosError ) error = error.response.statusText;
self._triggerOnError(error, data, form);
throw error;

@@ -413,0 +438,0 @@ });

{
"name": "@htmlguyllc/jpack",
"version": "9.0.27",
"version": "9.0.28",
"description": "Core Javascript Library of Everyday Objects, Events, and Utilities",

@@ -5,0 +5,0 @@ "keywords": [

@@ -314,23 +314,29 @@ Build Status

Method/Property | Params (name:type) | Return | Notes
Primary Methods | Params (name:type) | Return | Notes
--- | --- | --- | ---
constructor|form:Element,options:object |self|
attachSubmitHandler|form:mixed|self|attaches the event listener to on submit of the passed form
validate|form:Element|bool|passes the form to the validate callback and returns the response
submitForm|form:Element|self|gets URL and method, checks form validity using .validate(), gets values, submits, and kicks off callbacks
Event Methods | Params (name:type) | Return | Callback Params (name:type) | Notes
--- | --- | --- | --- | ---
onSuccess|callback:function|self|response:mixed, form:Element|adds an onSuccess callback (you can add as many as you'd like)
clearOnSuccessCallbacks| |self||
onError|callback:function|self|error:string, response:mixed, form:Element|adds an onError callback (you can add as many as you'd like)
clearOnErrorCallbacks| |self||
setPreSubmitCallback|callback:function|self|form:Element, form_values:string, url:string, method:string|pass a function you want to run right before the server request is sent - return false to prevent submission, return an object with form_values, url, or method if you want to override them
setValidateCallback|callback:function|is_valid:bool|form:Element|pass a function to validate the form and return true if it's valid, false if it's not. False prevents form submission so you must display errors for the user within here. The default callback uses Bootstrap 4's "was-validated" class to show errors and HTML5's :invalid attribute to validate
Setters/Getters | Params (name:type) | Return | Notes
--- | --- | --- | ---
setXHRSubmit|enabled:bool|self|enable/disable the XHR submission of the form
setSubmitMethod|method:string|self|override the form and provide a method (GET, POST, PATCH)
getSubmitMethod| |method:string|
setSubmitURL|url:mixed|self|pass null to use the form's action, function to dynamically generate the URL (receives the form as a param), or string
getSubmitURL| |url:string|returns whatever was set in the constructor or using setSubmitURL, not the final URL
getFinalSubmitURL|form:Element|url:string|returns the URL the form will be submitted to after running the function (if it is one) and using all fallbacks
attachSubmitHandler|form:mixed|self|attaches the event listener to on submit of the passed form
onSuccess|callback:function|self|adds an onSuccess callback (you can add as many as you'd like)
clearOnSuccessCallbacks| |self|
triggerOnSuccess|response:mixed, form:Element|self|runs all onSuccess callbacks and passes the server's response and the form element
onError|callback:function|self|adds an onError callback (you can add as many as you'd like)
clearOnErrorCallbacks| |self|
triggerOnError|error:string, response:mixed, form:Element|self|triggers all onError callbacks and passes the error string, server response, and form Element
submitForm|form:Element|self|gets URL and method, checks form validity using .validate(), gets values, submits, and kicks off callbacks
setSubmitMethod|method:string|self|override the form and provide a method (GET, POST, PATCH)
getSubmitMethod| |method:string|
getFormValues|form:Element|self|returns data from the form to be submitted - override this if you want to manipulate it first
setValidateCallback|callback:function|is_valid:bool|pass a function to validate the form and return true if it's valid, false if it's not. False prevents form submission so you must display errors for the user within here. The default callback uses Bootstrap 4's "was-validated" class to show errors and HTML5's :invalid attribute to validate
validate|form:Element|bool|passes the form to the validate callback and returns the response
##### To use:

@@ -345,2 +351,6 @@ ```javascript

submitMethod:null, //when null, the form's method will be used (if explicitly defined), otherwise it falls back to POST
onPreSubmit: function(form, form_values, url, method){ //called right before the request to the server
//return false; //you can return false to stop submission
return {form_values:form_values, url:url, method:method}; //you can return these if you want to override them (optional)
},
onError: function(error, response, form){ alert(error); }, //although you can add more, you can only pass 1 to start with in the constructor

@@ -390,3 +400,2 @@ onSuccess: function(response, form){ //although you can add more, you can only pass 1 to start with in the constructor

clearOnloadCallbacks| |self|removes all onload callbacks
triggerOnload|form:Element|self|runs all onload callbacks and passes the form to them

@@ -408,2 +417,6 @@ __There are several methods and properties inherited from XHRForm that are not listed here.

submitMethod:null, //when null, the form's method will be used (if explicitly defined), otherwise it falls back to POST
onPreSubmit: function(form, form_values, url, method){ //called right before the request to the server
//return false; //you can return false to stop submission
return {form_values:form_values, url:url, method:method}; //you can return these if you want to override them (optional)
},
onError: function(error, response, form){ alert(error); }, //although you can add more, you can only pass 1 to start with in the constructor

@@ -410,0 +423,0 @@ onSuccess: function(response, form){ //although you can add more, you can only pass 1 to start with in the constructor

@@ -314,23 +314,29 @@ Build Status

Method/Property | Params (name:type) | Return | Notes
Primary Methods | Params (name:type) | Return | Notes
--- | --- | --- | ---
constructor|form:Element,options:object |self|
attachSubmitHandler|form:mixed|self|attaches the event listener to on submit of the passed form
validate|form:Element|bool|passes the form to the validate callback and returns the response
submitForm|form:Element|self|gets URL and method, checks form validity using .validate(), gets values, submits, and kicks off callbacks
Event Methods | Params (name:type) | Return | Callback Params (name:type) | Notes
--- | --- | --- | --- | ---
onSuccess|callback:function|self|response:mixed, form:Element|adds an onSuccess callback (you can add as many as you'd like)
clearOnSuccessCallbacks| |self||
onError|callback:function|self|error:string, response:mixed, form:Element|adds an onError callback (you can add as many as you'd like)
clearOnErrorCallbacks| |self||
setPreSubmitCallback|callback:function|self|form:Element, form_values:string, url:string, method:string|pass a function you want to run right before the server request is sent - return false to prevent submission, return an object with form_values, url, or method if you want to override them
setValidateCallback|callback:function|is_valid:bool|form:Element|pass a function to validate the form and return true if it's valid, false if it's not. False prevents form submission so you must display errors for the user within here. The default callback uses Bootstrap 4's "was-validated" class to show errors and HTML5's :invalid attribute to validate
Setters/Getters | Params (name:type) | Return | Notes
--- | --- | --- | ---
setXHRSubmit|enabled:bool|self|enable/disable the XHR submission of the form
setSubmitMethod|method:string|self|override the form and provide a method (GET, POST, PATCH)
getSubmitMethod| |method:string|
setSubmitURL|url:mixed|self|pass null to use the form's action, function to dynamically generate the URL (receives the form as a param), or string
getSubmitURL| |url:string|returns whatever was set in the constructor or using setSubmitURL, not the final URL
getFinalSubmitURL|form:Element|url:string|returns the URL the form will be submitted to after running the function (if it is one) and using all fallbacks
attachSubmitHandler|form:mixed|self|attaches the event listener to on submit of the passed form
onSuccess|callback:function|self|adds an onSuccess callback (you can add as many as you'd like)
clearOnSuccessCallbacks| |self|
triggerOnSuccess|response:mixed, form:Element|self|runs all onSuccess callbacks and passes the server's response and the form element
onError|callback:function|self|adds an onError callback (you can add as many as you'd like)
clearOnErrorCallbacks| |self|
triggerOnError|error:string, response:mixed, form:Element|self|triggers all onError callbacks and passes the error string, server response, and form Element
submitForm|form:Element|self|gets URL and method, checks form validity using .validate(), gets values, submits, and kicks off callbacks
setSubmitMethod|method:string|self|override the form and provide a method (GET, POST, PATCH)
getSubmitMethod| |method:string|
getFormValues|form:Element|self|returns data from the form to be submitted - override this if you want to manipulate it first
setValidateCallback|callback:function|is_valid:bool|pass a function to validate the form and return true if it's valid, false if it's not. False prevents form submission so you must display errors for the user within here. The default callback uses Bootstrap 4's "was-validated" class to show errors and HTML5's :invalid attribute to validate
validate|form:Element|bool|passes the form to the validate callback and returns the response
##### To use:

@@ -345,2 +351,6 @@ ```javascript

submitMethod:null, //when null, the form's method will be used (if explicitly defined), otherwise it falls back to POST
onPreSubmit: function(form, form_values, url, method){ //called right before the request to the server
//return false; //you can return false to stop submission
return {form_values:form_values, url:url, method:method}; //you can return these if you want to override them (optional)
},
onError: function(error, response, form){ alert(error); }, //although you can add more, you can only pass 1 to start with in the constructor

@@ -390,3 +400,2 @@ onSuccess: function(response, form){ //although you can add more, you can only pass 1 to start with in the constructor

clearOnloadCallbacks| |self|removes all onload callbacks
triggerOnload|form:Element|self|runs all onload callbacks and passes the form to them

@@ -408,2 +417,6 @@ __There are several methods and properties inherited from XHRForm that are not listed here.

submitMethod:null, //when null, the form's method will be used (if explicitly defined), otherwise it falls back to POST
onPreSubmit: function(form, form_values, url, method){ //called right before the request to the server
//return false; //you can return false to stop submission
return {form_values:form_values, url:url, method:method}; //you can return these if you want to override them (optional)
},
onError: function(error, response, form){ alert(error); }, //although you can add more, you can only pass 1 to start with in the constructor

@@ -410,0 +423,0 @@ onSuccess: function(response, form){ //although you can add more, you can only pass 1 to start with in the constructor

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc