"use strict";(self.webpackChunk_wintercms_wn_system_module=self.webpackChunk_wintercms_wn_system_module||[]).push([[38,639,813],{660:function(e,t,s){s.d(t,{A:function(){return n}});class n{constructor(e){this.snowboard=e}construct(){}dependencies(){return[]}listens(){return{}}destruct(){this.detach(),delete this.snowboard}destructor(){this.destruct()}}},373:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(660);class i extends n.A{}},477:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(373);class i extends n.A{listens(){return{ajaxLoadAssets:"load"}}dependencies(){return["url"]}async load(e){if(e.js&&e.js.length>0)for(const t of e.js)try{await this.loadScript(t)}catch(e){return Promise.reject(e)}if(e.css&&e.css.length>0)for(const t of e.css)try{await this.loadStyle(t)}catch(e){return Promise.reject(e)}if(e.img&&e.img.length>0)for(const t of e.img)try{await this.loadImage(t)}catch(e){return Promise.reject(e)}return Promise.resolve()}loadScript(e){return new Promise((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`script[src="${e}"]`))return void t();const n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",e),n.addEventListener("load",()=>{this.snowboard.globalEvent("assetLoader.loaded","script",e,n),t()}),n.addEventListener("error",()=>{this.snowboard.globalEvent("assetLoader.error","script",e,n),s(new Error(`Unable to load script file: "${e}"`))}),document.body.append(n)})}loadStyle(e){return new Promise((t,s)=>{e=this.snowboard.url().asset(e);if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t();const n=document.createElement("link");n.setAttribute("rel","stylesheet"),n.setAttribute("href",e),n.addEventListener("load",()=>{this.snowboard.globalEvent("assetLoader.loaded","style",e,n),t()}),n.addEventListener("error",()=>{this.snowboard.globalEvent("assetLoader.error","style",e,n),s(new Error(`Unable to load stylesheet file: "${e}"`))}),document.head.append(n)})}loadImage(e){return new Promise((t,s)=>{e=this.snowboard.url().asset(e);const n=new Image;n.addEventListener("load",()=>{this.snowboard.globalEvent("assetLoader.loaded","image",e,n),t()}),n.addEventListener("error",()=>{this.snowboard.globalEvent("assetLoader.error","image",e,n),s(new Error(`Unable to load image file: "${e}"`))}),n.src=e})}}},293:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(373);class i extends n.A{dependencies(){return["request"]}listens(){return{ajaxStart:"ajaxStart",ajaxDone:"ajaxDone"}}ajaxStart(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach(e=>{e.classList.add(this.getLoadingClass(e))})}else void 0!==t.element.dataset.attachLoading&&t.element.classList.add(this.getLoadingClass(t.element))}ajaxDone(e,t){if(t.element)if("FORM"===t.element.tagName){const e=t.element.querySelectorAll("[data-attach-loading]");e.length>0&&e.forEach(e=>{e.classList.remove(this.getLoadingClass(e))})}else void 0!==t.element.dataset.attachLoading&&t.element.classList.remove(this.getLoadingClass(t.element))}getLoadingClass(e){return void 0!==e.dataset.attachLoading&&""!==e.dataset.attachLoading?e.dataset.attachLoading:"wn-loading"}}},490:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(660);class i extends n.A{construct(e,t,s){if(e instanceof n.A==!1)throw new Error("You must provide a Snowboard plugin to enable data configuration");if(t instanceof HTMLElement==!1)throw new Error("Data configuration can only be extracted from HTML elements");this.instance=e,this.element=t,this.localConfig=s||{},this.instanceConfig={},this.acceptedConfigs={},this.refresh()}get(e){return void 0===e?this.instanceConfig:void 0!==this.instanceConfig[e]?this.instanceConfig[e]:void 0}set(e,t,s){if(void 0===e)throw new Error("You must provide a configuration key to set");this.instanceConfig[e]=t,!0===s&&(this.element.dataset[e]=t,this.localConfig[e]=t)}refresh(){this.acceptedConfigs=this.getAcceptedConfigs(),this.instanceConfig=this.processConfig()}getAcceptedConfigs(){return void 0!==this.instance.acceptAllDataConfigs&&!0===this.instance.acceptAllDataConfigs||void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()&&Object.keys(this.instance.defaults())}getDefaults(){return void 0!==this.instance.defaults&&"function"==typeof this.instance.defaults&&"object"==typeof this.instance.defaults()?this.instance.defaults():{}}processConfig(){const e=this.getDefaults();if(!1===this.acceptedConfigs)return e;for(const t in this.element.dataset)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.coerceValue(this.element.dataset[t]));for(const t in this.localConfig)(!0===this.acceptedConfigs||this.acceptedConfigs.includes(t))&&(e[t]=this.localConfig[t]);return e}coerceValue(e){const t=String(e);if("null"===t)return null;if("undefined"!==t){if(t.startsWith("base64:")){const e=t.replace(/^base64:/,""),s=atob(e);return this.coerceValue(s)}if(["true","yes"].includes(t.toLowerCase()))return!0;if(["false","no"].includes(t.toLowerCase()))return!1;if(/^[-+]?[0-9]+(\.[0-9]+)?$/.test(t))return Number(t);try{return this.snowboard.jsonParser().parse(t)}catch(e){return""===t||t}}}}},336:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(660);class i extends n.A{construct(e,t,s){if(this.message=e,this.type=t||"default",this.duration=Number(s||7),this.duration<0)throw new Error("Flash duration must be a positive number, or zero");this.clear(),this.timer=null,this.flashTimer=null,this.create()}dependencies(){return["transition"]}destruct(){null!==this.timer&&window.clearTimeout(this.timer),this.flashTimer&&this.flashTimer.remove(),this.flash&&(this.flash.remove(),this.flash=null,this.flashTimer=null),super.destruct()}create(){this.snowboard.globalEvent("flash.create",this),this.flash=document.createElement("DIV"),this.flash.innerHTML=this.message,this.flash.classList.add("flash-message",this.type),this.flash.removeAttribute("data-control"),this.flash.addEventListener("click",()=>this.remove()),this.flash.addEventListener("mouseover",()=>this.stopTimer()),this.flash.addEventListener("mouseout",()=>this.startTimer()),this.duration>0?(this.flashTimer=document.createElement("DIV"),this.flashTimer.classList.add("flash-timer"),this.flash.appendChild(this.flashTimer)):this.flash.classList.add("no-timer"),document.body.appendChild(this.flash),this.snowboard.transition(this.flash,"show",()=>{this.startTimer()})}remove(){this.snowboard.globalEvent("flash.remove",this),this.stopTimer(),this.snowboard.transition(this.flash,"hide",()=>{this.flash.remove(),this.flash=null,this.destruct()})}clear(){document.querySelectorAll("body > div.flash-message").forEach(e=>e.remove())}startTimer(){0!==this.duration&&(this.timerTrans=this.snowboard.transition(this.flashTimer,"timeout",null,`${this.duration}.0s`,!0),this.timer=window.setTimeout(()=>this.remove(),1e3*this.duration))}stopTimer(){this.timerTrans&&this.timerTrans.cancel(),this.timer&&window.clearTimeout(this.timer)}}},758:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(373);class i extends n.A{dependencies(){return["request"]}listens(){return{ready:"ready",ajaxStart:"ajaxStart"}}ready(){this.counter=0,this.createStripe()}ajaxStart(e,t){!1!==t.loading&&!1!==t.options.stripe&&(this.show(),e.then(()=>{this.hide()}).catch(()=>{this.hide()}))}createStripe(){this.indicator=document.createElement("DIV"),this.stripe=document.createElement("DIV"),this.stripeLoaded=document.createElement("DIV"),this.indicator.classList.add("stripe-loading-indicator","loaded"),this.stripe.classList.add("stripe"),this.stripeLoaded.classList.add("stripe-loaded"),this.indicator.appendChild(this.stripe),this.indicator.appendChild(this.stripeLoaded),document.body.appendChild(this.indicator)}show(){this.counter+=1;const e=this.stripe.cloneNode(!0);this.indicator.appendChild(e),this.stripe.remove(),this.stripe=e,this.counter>1||(this.indicator.classList.remove("loaded"),document.body.classList.add("wn-loading"))}hide(e){this.counter-=1,!0===e&&(this.counter=0),this.counter<=0&&(this.indicator.classList.add("loaded"),document.body.classList.remove("wn-loading"))}}},75:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(373);class i extends n.A{listens(){return{ready:"ready"}}ready(){let e=!1;if(document.querySelectorAll('link[rel="stylesheet"]').forEach(t=>{t.href.endsWith("/modules/system/assets/css/snowboard.extras.css")&&(e=!0)}),!e){const e=document.createElement("link");e.setAttribute("rel","stylesheet"),e.setAttribute("href",this.snowboard.url().asset("/modules/system/assets/css/snowboard.extras.css")),document.head.appendChild(e)}}}},843:function(e,t,s){s.d(t,{A:function(){return i}});var n=s(660);class i extends n.A{construct(e,t,s,n,i){if(e instanceof HTMLElement==!1)throw new Error("A HTMLElement must be provided for transitioning");if(this.element=e,"string"!=typeof t)throw new Error("Transition name must be specified as a string");if(this.transition=t,s&&"function"!=typeof s)throw new Error("Callback must be a valid function");this.callback=s,this.duration=n?this.parseDuration(n):null,this.trailTo=!0===i,this.doTransition()}eventClasses(...e){const t={in:`${this.transition}-in`,active:`${this.transition}-active`,out:`${this.transition}-out`};if(0===e.length)return Object.values(t);const s=[];return Object.entries(t).forEach(t=>{const[n,i]=t;-1!==e.indexOf(n)&&s.push(i)}),s}doTransition(){null!==this.duration&&(this.element.style.transitionDuration=this.duration),this.resetClasses(),this.eventClasses("in","active").forEach(e=>{this.element.classList.add(e)}),window.requestAnimationFrame(()=>{"0s"!==window.getComputedStyle(this.element)["transition-duration"]?(this.element.addEventListener("transitionend",()=>this.onTransitionEnd(),{once:!0}),window.requestAnimationFrame(()=>{this.element.classList.remove(this.eventClasses("in")[0]),this.element.classList.add(this.eventClasses("out")[0])})):(this.resetClasses(),this.callback&&this.callback.apply(this.element),this.destruct())})}onTransitionEnd(){this.eventClasses("active",this.trailTo?"":"out").forEach(e=>{this.element.classList.remove(e)}),this.callback&&this.callback.apply(this.element),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}cancel(){this.element.removeEventListener("transitionend",()=>this.onTransitionEnd,{once:!0}),this.resetClasses(),null!==this.duration&&(this.element.style.transitionDuration=null),this.destruct()}resetClasses(){this.eventClasses().forEach(e=>{this.element.classList.remove(e)})}parseDuration(e){const t=/^([0-9]+(\.[0-9]+)?)(m?s)?$/.exec(e),s=Number(t[1]);return"sec"===("s"===t[3]?"sec":"msec")?1e3*s+"ms":`${Math.floor(s)}ms`}}},54:function(e,t){t.A={get(e,t,s){if("string"==typeof t){const s=t.toLowerCase();if(e.hasPlugin(s))return(...t)=>Reflect.get(e,"plugins")[s].getInstance(...t)}return Reflect.get(e,t,s)},has(e,t){if("string"==typeof t){const s=t.toLowerCase();if(e.hasPlugin(s))return!0}return Reflect.has(e,t)}}},160:function(e,t,s){s.d(t,{A:function(){return g}});var n=s(660),i=s(373),r={get(e,t,s){if("string"==typeof t){const s=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))throw new Error(`You cannot use the "${t}" Snowboard method within a plugin.`);if(e.hasPlugin(s))return(...t)=>Reflect.get(e,"plugins")[s].getInstance(...t)}return Reflect.get(e,t,s)},has(e,t){if("string"==typeof t){const s=t.toLowerCase();if(["attachAbstracts","loadUtilities","initialise","initialiseSingletons"].includes(t))return!1;if(e.hasPlugin(s))return!0}return Reflect.has(e,t)}};class o{constructor(e,t,s){this.name=e,this.snowboard=new Proxy(t,r),this.instance=s,Object.freeze(this.instance),this.instances=[],this.singleton={initialised:!1},Object.seal(this.singleton),this.mocks={},this.originalFunctions={},Object.freeze(o.prototype),Object.freeze(this)}hasMethod(e){return!this.isFunction()&&"function"==typeof this.instance.prototype[e]}callMethod(...e){if(this.isFunction())return null;const t=e,s=t.shift();return this.instance.prototype[s](t)}getInstance(...e){if(this.isFunction())return this.instance(...e);if(!this.dependenciesFulfilled()){const e=this.getDependencies().filter(e=>!this.snowboard.getPluginNames().includes(e));throw new Error(`The "${this.name}" plugin requires the following plugins: ${e.join(", ")}`)}if(this.isSingleton())return 0===this.instances.length&&this.initialiseSingleton(...e),Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach(e=>{const[t,s]=e;this.instances[0][t]=s}),Object.entries(this.mocks).forEach(e=>{const[t,s]=e;this.instances[0][t]=(...e)=>s(this,...e)})),this.instances[0];Object.keys(this.mocks).length>0&&(Object.entries(this.originalFunctions).forEach(e=>{const[t,s]=e;this.instance.prototype[t]=s}),Object.entries(this.mocks).forEach(e=>{const[t,s]=e;this.instance.prototype[t]=(...e)=>s(this,...e)}));const t=new this.instance(this.snowboard,...e);return t.detach=()=>this.instances.splice(this.instances.indexOf(t),1),t.construct(...e),this.instances.push(t),t}getInstances(){return this.isFunction()?[]:this.instances}isFunction(){return"function"==typeof this.instance&&this.instance.prototype instanceof n.A==!1}isSingleton(){return this.instance.prototype instanceof i.A==!0}isInitialised(){return!this.isSingleton()||this.singleton.initialised}initialiseSingleton(...e){if(!this.isSingleton())return;const t=new this.instance(this.snowboard,...e);t.detach=()=>this.instances.splice(this.instances.indexOf(t),1),t.construct(...e),this.instances.push(t),this.singleton.initialised=!0}getDependencies(){return this.isFunction()||"function"!=typeof this.instance.prototype.dependencies?[]:this.instance.prototype.dependencies().map(e=>e.toLowerCase())}dependenciesFulfilled(){const e=this.getDependencies();let t=!0;return e.forEach(e=>{this.snowboard.hasPlugin(e)||(t=!1)}),t}mock(e,t){if(!this.isFunction()){if(!this.instance.prototype[e])throw new Error(`Function "${e}" does not exist and cannot be mocked`);this.mocks[e]=t,this.originalFunctions[e]=this.instance.prototype[e],this.isSingleton()&&0===this.instances.length&&(this.initialiseSingleton(),this.instances[0][e]=(...e)=>t(this,...e))}}unmock(e){this.isFunction()||this.mocks[e]&&(this.isSingleton()&&(this.instances[0][e]=this.originalFunctions[e]),delete this.mocks[e],delete this.originalFunctions[e])}}var a=s(478);function l(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function h(e){for(var t=1;t{const[t,s]=e;void 0!==this.defaults[t]&&(this.defaults[t]=s)})}getDefaults(){const e={};return Object.entries(this.defaults).forEach(t=>{const[s,n]=t;null!==this.defaults[s]&&(e[s]=n)}),e}get(e){if(void 0===e){const e=a.A.get();return Object.entries(e).forEach(t=>{const[s,n]=t;this.snowboard.globalEvent("cookie.get",s,n,t=>{e[s]=t})}),e}let t=a.A.get(e);return this.snowboard.globalEvent("cookie.get",e,t,e=>{t=e}),t}set(e,t,s){let n=t;return this.snowboard.globalEvent("cookie.set",e,t,e=>{n=e}),a.A.set(e,n,h(h({},this.getDefaults()),s))}remove(e,t){a.A.remove(e,h(h({},this.getDefaults()),t))}}class u extends i.A{construct(){window.wnJSON=e=>this.parse(e),window.ocJSON=window.wnJSON}parse(e){const t=this.parseString(e);return JSON.parse(t)}parseString(e){let t=e.trim();if(!t.length)throw new Error("Broken JSON object.");let s="",n=null,i=null,r="";for(;t&&","===t[0];)t=t.substr(1);if('"'===t[0]||"'"===t[0]){if(t[t.length-1]!==t[0])throw new Error("Invalid string JSON object.");r='"';for(let e=1;e="0"&&e[t]<="9"){s="";for(let n=t;n="0"&&e[n]<="9"))return{originLength:s.length,body:s};s+=e[n]}throw new Error(`Broken JSON number body near ${s}`)}if("{"===e[t]||"["===e[t]){const n=[e[t]];s=e[t];for(let i=t+1;i=0?t-5:0,50)}`)}parseKey(e,t,s){let n="";for(let i=t;i="a"&&e[0]<="z"||e[0]>="A"&&e[0]<="Z"||"_"===e[0]||(e[0]>="0"&&e[0]<="9"||("$"===e[0]||e.charCodeAt(0)>255)))}isBlankChar(e){return" "===e||"\n"===e||"\t"===e}}class f extends i.A{construct(){window.wnSanitize=e=>this.sanitize(e),window.ocSanitize=window.wnSanitize}sanitize(e,t){const s=(new DOMParser).parseFromString(e,"text/html"),n=void 0===t||"boolean"!=typeof t||t;return this.sanitizeNode(s.getRootNode()),n?s.body.innerHTML:s.innerHTML}sanitizeNode(e){if("SCRIPT"===e.tagName)return void e.remove();this.trimAttributes(e);Array.from(e.children).forEach(e=>{this.sanitizeNode(e)})}trimAttributes(e){if(e.attributes)for(let t=0;t{this.autoInitSingletons&&this.initialiseSingletons(),this.globalEvent("ready"),this.readiness.dom=!0})}initialiseSingletons(){Object.values(this.plugins).forEach(e=>{e.isSingleton()&&e.dependenciesFulfilled()&&e.initialiseSingleton()})}addPlugin(e,t){const s=e.toLowerCase();if(this.hasPlugin(s))throw new Error(`A plugin called "${e}" is already registered.`);if("function"!=typeof t&&t instanceof n.A==!1)throw new Error("The provided plugin must extend the PluginBase class, or must be a callback function.");if(void 0!==this[e]||void 0!==this[s])throw new Error("The given name is already in use for a property or method of the Snowboard class.");this.plugins[s]=new o(s,this,t),this.debug(`Plugin "${e}" registered`),Object.values(this.getPlugins()).forEach(e=>{if(e.isSingleton()&&!e.isInitialised()&&e.dependenciesFulfilled()&&e.hasMethod("listens")&&Object.keys(e.callMethod("listens")).includes("ready")&&this.readiness.dom){const t=e.callMethod("listens").ready;e.callMethod(t)}})}removePlugin(e){const t=e.toLowerCase();this.hasPlugin(t)?(this.plugins[t].getInstances().forEach(e=>{e.destruct()}),delete this.plugins[t],delete this[t],delete this[e],this.debug(`Plugin "${e}" removed`)):this.debug(`Plugin "${e}" already removed`)}hasPlugin(e){const t=e.toLowerCase();return void 0!==this.plugins[t]}getPlugins(){return this.plugins}getPluginNames(){return Object.keys(this.plugins)}getPlugin(e){const t=e.toLowerCase();if(!this.hasPlugin(t))throw new Error(`No plugin called "${t}" has been registered.`);return this.plugins[t]}listensToEvent(e){const t=[];return Object.entries(this.plugins).forEach(s=>{const[n,i]=s;if(i.isFunction())return;if(!i.dependenciesFulfilled())return;if(!i.hasMethod("listens"))return;const r=i.callMethod("listens");"string"!=typeof r[e]&&"function"!=typeof r[e]||t.push(n)}),t}ready(e){this.readiness.dom&&e(),this.on("ready",e)}on(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].includes(t)||this.listeners[e].push(t)}off(e,t){if(!this.listeners[e])return;const s=this.listeners[e].indexOf(t);-1!==s&&this.listeners[e].splice(s,1)}globalEvent(e,...t){this.debug(`Calling global event "${e}"`,...t);const s=this.listensToEvent(e);0===s.length&&this.debug(`No listeners found for global event "${e}"`),this.debug(`Listeners found for global event "${e}": ${s.join(", ")}`);let n=!1;return s.forEach(s=>{const i=this.getPlugin(s);if(i.isFunction())return;i.isSingleton()&&0===i.getInstances().length&&i.initialiseSingleton();const r=i.callMethod("listens")[e];i.getInstances().forEach(i=>{if(!n)if("function"==typeof r)try{!1===r.apply(i,t)&&(n=!0)}catch(t){this.error(`Error thrown in "${e}" event by "${s}" plugin.`,t)}else if("string"==typeof r){if(!i[r])throw new Error(`Missing "${r}" method in "${s}" plugin`);try{!1===i[r](...t)&&(n=!0,this.debug(`Global event "${e}" cancelled by "${s}" plugin`))}catch(t){this.error(`Error thrown in "${e}" event by "${s}" plugin.`,t)}}else this.error(`Listen method for "${e}" event in "${s}" plugin is not a function or string.`)})}),!n&&this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global event "${e}"`),this.listeners[e].forEach(s=>{if(!n)try{!1===s(...t)&&(n=!0,this.debug(`Global event "${e} cancelled by an ad-hoc listener.`))}catch(t){this.error(`Error thrown in "${e}" event by an ad-hoc listener.`,t)}})),!n}globalPromiseEvent(e,...t){this.debug(`Calling global promise event "${e}"`);const s=this.listensToEvent(e);0===s.length&&this.debug(`No listeners found for global promise event "${e}"`),this.debug(`Listeners found for global promise event "${e}": ${s.join(", ")}`);const n=[];return s.forEach(s=>{const i=this.getPlugin(s);if(i.isFunction())return;i.isSingleton()&&0===i.getInstances().length&&i.initialiseSingleton();const r=i.callMethod("listens")[e];i.getInstances().forEach(i=>{if("function"==typeof r)try{const e=r.apply(i,t);if(e instanceof Promise==!1)return;n.push(e)}catch(t){this.error(`Error thrown in "${e}" event by "${s}" plugin.`,t)}else if("string"==typeof r){if(!i[r])throw new Error(`Missing "${r}" method in "${s}" plugin`);try{const e=i[r](...t);if(e instanceof Promise==!1)return;n.push(e)}catch(t){this.error(`Error thrown in "${e}" promise event by "${s}" plugin.`,t)}}else this.error(`Listen method for "${e}" event in "${s}" plugin is not a function or string.`)})}),this.listeners[e]&&this.listeners[e].length>0&&(this.debug(`Found ${this.listeners[e].length} ad-hoc listener(s) for global promise event "${e}"`),this.listeners[e].forEach(s=>{try{const e=s(...t);if(e instanceof Promise==!1)return;n.push(e)}catch(t){this.error(`Error thrown in "${e}" promise event by an ad-hoc listener.`,t)}})),0===n.length?Promise.resolve():Promise.all(n)}logMessage(e,t,s,...n){if(console.groupCollapsed("%c[Snowboard]",`color: ${e}; font-weight: ${t?"bold":"normal"};`,s),n.length){console.groupCollapsed(`%cParameters %c(${n.length})`,"color: rgb(45, 167, 199); font-weight: bold;","color: rgb(88, 88, 88); font-weight: normal;");let e=0;n.forEach(t=>{e+=1,console.log(`%c${e}:`,"color: rgb(88, 88, 88); font-weight: normal;",t)}),console.groupEnd(),console.groupCollapsed("%cTrace","color: rgb(45, 167, 199); font-weight: bold;"),console.trace(),console.groupEnd()}else console.trace();console.groupEnd()}log(e,...t){this.logMessage("rgb(45, 167, 199)",!1,e,...t)}debug(e,...t){this.debugEnabled&&this.logMessage("rgb(45, 167, 199)",!1,e,...t)}error(e,...t){this.logMessage("rgb(229, 35, 35)",!0,e,...t)}}},590:function(e,t,s){var n,i=s(336),r=s(843),o=s(293),a=s(758),l=s(75),h=s(477),c=s(490);if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the extra plugins.");(n=window.Snowboard).addPlugin("assetLoader",h.A),n.addPlugin("dataConfig",c.A),n.addPlugin("extrasStyles",l.A),n.addPlugin("transition",r.A),n.addPlugin("flash",i.A),n.addPlugin("attachLoading",o.A),n.addPlugin("stripeLoader",a.A)},799:function(e,t,s){var n=s(160),i=s(54);(e=>{const t=new Proxy(new n.A(!0,!0),i.A);e.snowboard=t,e.Snowboard=t,e.SnowBoard=t})(window)},59:function(e,t,s){var n=s(660);function i(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,n)}return s}function r(e){for(var t=1;t{e&&this.doAjax().then(e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then(()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)})},e=>{this.responseError=e,this.processError(e)})}):this.doAjax().then(e=>{if(e.cancelled)return this.cancelled=!0,void this.complete();this.responseData=e,this.processUpdate(e).then(()=>{!1===e.X_WINTER_SUCCESS?this.processError(e):this.processResponse(e)})},e=>{this.responseError=e,this.processError(e)}):this.cancelled=!0}else this.cancelled=!0}dependencies(){return["cookie","jsonParser"]}checkRequest(){if(this.element&&this.element instanceof Element==!1)throw new Error("The element provided must be an Element instance");if(void 0===this.handler)throw new Error("The AJAX handler name is not specified.");if(!this.isHandlerName(this.handler))throw new Error('Invalid AJAX handler name. The correct handler name format is: "onEvent".')}getFetch(){return this.fetchOptions=void 0!==this.options.fetchOptions&&"object"==typeof this.options.fetchOptions?this.options.fetchOptions:{method:"POST",headers:this.headers,body:this.data,redirect:"follow",mode:"same-origin"},this.snowboard.globalEvent("ajaxFetchOptions",this.fetchOptions,this),fetch(this.url,this.fetchOptions)}doClientValidation(){return!0!==this.options.browserValidate||!this.form||!1!==this.form.checkValidity()||(this.form.reportValidity(),!1)}doAjax(){if(!1===this.snowboard.globalEvent("ajaxBeforeSend",this))return Promise.resolve({cancelled:!0});const e=new Promise((e,t)=>{this.getFetch().then(s=>{s.ok||406===s.status?s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then(t=>{e(r(r({},t),{},{X_WINTER_SUCCESS:406!==s.status,X_WINTER_RESPONSE_CODE:s.status}))},e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))}):s.text().then(t=>{e(t)},e=>{t(this.renderError(`Unable to process response: ${e}`))}):s.headers.has("Content-Type")&&s.headers.get("Content-Type").includes("/json")?s.json().then(e=>{e.message&&e.exception?t(this.renderError(e.message,e.exception,e.file,e.line,e.trace)):t(e)},e=>{t(this.renderError(`Unable to parse JSON response: ${e}`))}):s.text().then(e=>{t(this.renderError(e))},e=>{t(this.renderError(`Unable to process response: ${e}`))})},e=>{t(this.renderError(`Unable to retrieve a response from the server: ${e}`))})});if(this.snowboard.globalEvent("ajaxStart",e,this),this.element){const t=new Event("ajaxPromise");t.promise=e,this.element.dispatchEvent(t)}return e}processUpdate(e){return new Promise((t,s)=>{if("function"==typeof this.options.beforeUpdate&&!1===this.options.beforeUpdate.apply(this,[e]))return void t();const n={};if(Object.entries(e).forEach(e=>{const[t,s]=e;"X_WINTER"!==t.substr(0,8)&&(n[t]=s)}),0===Object.keys(n).length)return void(e.X_WINTER_ASSETS?this.processAssets(e.X_WINTER_ASSETS).then(()=>{t()},()=>{s()}):t());this.snowboard.globalPromiseEvent("ajaxBeforeUpdate",e,this).then(async()=>{e.X_WINTER_ASSETS&&await this.processAssets(e.X_WINTER_ASSETS),this.doUpdate(n).then(()=>{window.requestAnimationFrame(()=>t())},()=>{s()})},()=>{t()})})}doUpdate(e){return new Promise(t=>{const s=[];Object.entries(e).forEach(e=>{const[t,n]=e;let i=this.options.update&&this.options.update[t]?this.options.update[t]:t,r="replace";"@"===i.substr(0,1)?(r="append",i=i.substr(1)):"^"===i.substr(0,1)?(r="prepend",i=i.substr(1)):"#"!==i.substr(0,1)&&"."!==i.substr(0,1)&&(r="noop");const o=document.querySelectorAll(i);o.length>0&&o.forEach(e=>{switch(r){case"append":e.innerHTML+=n;break;case"prepend":e.innerHTML=n+e.innerHTML;break;case"noop":break;default:e.innerHTML=n}s.push(e),this.snowboard.globalEvent("ajaxUpdate",e,n,this);const t=new Event("ajaxUpdate");t.content=n,e.dispatchEvent(t)})}),this.snowboard.globalEvent("ajaxUpdateComplete",s,this),t()})}processResponse(e){if((!this.options.success||"function"!=typeof this.options.success||!1!==this.options.success(this.responseData,this))&&!1!==this.snowboard.globalEvent("ajaxSuccess",this.responseData,this)){if(this.element){const e=new Event("ajaxDone",{cancelable:!0});if(e.responseData=this.responseData,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}this.flash&&e.X_WINTER_FLASH_MESSAGES&&this.processFlashMessages(e.X_WINTER_FLASH_MESSAGES),this.redirect||e.X_WINTER_REDIRECT?this.processRedirect(this.redirect||e.X_WINTER_REDIRECT):this.complete()}}processError(e){if((!this.options.error||"function"!=typeof this.options.error||!1!==this.options.error(this.responseError,this))&&!1!==this.snowboard.globalEvent("ajaxError",this.responseError,this)){if(this.element){const e=new Event("ajaxFail",{cancelable:!0});if(e.responseError=this.responseError,e.request=this,this.element.dispatchEvent(e),e.defaultPrevented)return}if(e instanceof Error)this.processErrorMessage(e.message);else{let t=!1;e.X_WINTER_ERROR_FIELDS&&(t=this.processValidationErrors(e.X_WINTER_ERROR_FIELDS)),e.X_WINTER_ERROR_MESSAGE&&!t&&this.processErrorMessage(e.X_WINTER_ERROR_MESSAGE)}this.complete()}}processRedirect(e){"function"==typeof this.options.handleRedirectResponse&&!1===this.options.handleRedirectResponse.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxRedirect",e,this)&&(window.addEventListener("popstate",()=>{if(this.element){const e=document.createEvent("CustomEvent");e.eventName="ajaxRedirected",this.element.dispatchEvent(e)}},{once:!0}),window.location.assign(e))}processErrorMessage(e){"function"==typeof this.options.handleErrorMessage&&!1===this.options.handleErrorMessage.apply(this,[e])||!1!==this.snowboard.globalEvent("ajaxErrorMessage",e,this)&&window.alert(e)}processFlashMessages(e){"function"==typeof this.options.handleFlashMessages&&!1===this.options.handleFlashMessages.apply(this,[e])||this.snowboard.globalEvent("ajaxFlashMessages",e,this)}processValidationErrors(e){return"function"==typeof this.options.handleValidationErrors&&!1===this.options.handleValidationErrors.apply(this,[this.form,e])||!1===this.snowboard.globalEvent("ajaxValidationErrors",this.form,e,this)}processAssets(e){return this.snowboard.globalPromiseEvent("ajaxLoadAssets",e)}async doConfirm(){if("function"==typeof this.options.handleConfirmMessage)return!1!==this.options.handleConfirmMessage.apply(this,[this.confirm]);if(0===this.snowboard.listensToEvent("ajaxConfirmMessage").length)return window.confirm(this.confirm);const e=this.snowboard.globalPromiseEvent("ajaxConfirmMessage",this.confirm,this);try{if(await e)return!0}catch(e){return!1}return!1}complete(){if(this.options.complete&&"function"==typeof this.options.complete&&this.options.complete(this.responseData,this),this.snowboard.globalEvent("ajaxDone",this.responseData,this),this.element){const e=new Event("ajaxAlways");e.request=this,e.responseData=this.responseData,e.responseError=this.responseError,this.element.dispatchEvent(e)}this.destruct()}get form(){return this.options.form?"string"==typeof this.options.form?document.querySelector(this.options.form):this.options.form:this.element?"FORM"===this.element.tagName?this.element:this.element.closest("form"):null}get context(){return{handler:this.handler,options:this.options}}get headers(){const e={"X-Requested-With":"XMLHttpRequest","X-WINTER-REQUEST-HANDLER":this.handler,"X-WINTER-REQUEST-PARTIALS":this.extractPartials(this.options.update||[])};return this.flash&&(e["X-WINTER-REQUEST-FLASH"]=1),this.xsrfToken&&(e["X-XSRF-TOKEN"]=this.xsrfToken),e}get loading(){return this.options.loading||!1}get url(){return this.options.url||window.location.href}get redirect(){return this.options.redirect&&this.options.redirect.length?this.options.redirect:null}get flash(){return this.options.flash||!1}get files(){return!0===this.options.files&&(void 0!==FormData||(this.snowboard.debug("This browser does not support file uploads"),!1))}get xsrfToken(){return this.snowboard.cookie().get("XSRF-TOKEN")}get data(){const e="object"==typeof this.options.data?this.options.data:{},t=new FormData(this.form||void 0);return Object.keys(e).length>0&&this.createFormData(t,e),t}createFormData(e,t,s=""){null!=t&&("object"==typeof t?Array.isArray(t)&&""!==s?t.forEach((t,n)=>{this.createFormData(e,t,`${s}[${n}]`)}):Object.entries(t).forEach(t=>{const[n,i]=t;this.createFormData(e,i,""!==s?`${s}[${n}]`:n)}):e.append(s,t))}get confirm(){return this.options.confirm||!1}extractPartials(e){return Object.keys(e).join("&")}renderError(e,t,s,n,i){const r=new Error(e);return r.exception=t||null,r.file=s||null,r.line=n||null,r.trace=i||[],r}isHandlerName(e){return/^(?:\w+:{2})?on[A-Z0-9]/.test(e)}}if(void 0===window.Snowboard)throw new Error("Snowboard must be loaded in order to use the Javascript AJAX request feature.");window.Snowboard.addPlugin("request",a)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[969],function(){return t(799),t(59),t(590)});e.O()}]);