1(()=>{"use strict";var e={156:e=>{var t=function(e){var t;return!!e&&"object"==typeof e&&"[object RegExp]"!==(t=Object.prototype.toString.call(e))&&"[object Date]"!==t&&e.$$typeof!==i},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?o(Array.isArray(e)?[]:{},e,t):e}function n(e,t,i){return e.concat(t).map(function(e){return s(e,i)})}function r(e){return Object.keys(e).concat(Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[])}function a(e,t){try{return t in e}catch(e){return!1}}function o(e,i,l){(l=l||{}).arrayMerge=l.arrayMerge||n,l.isMergeableObject=l.isMergeableObject||t,l.cloneUnlessOtherwiseSpecified=s;var d,h,c=Array.isArray(i);return c!==Array.isArray(e)?s(i,l):c?l.arrayMerge(e,i,l):(h={},(d=l).isMergeableObject(e)&&r(e).forEach(function(t){h[t]=s(e[t],d)}),r(i).forEach(function(t){(!a(e,t)||Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))&&(a(e,t)&&d.isMergeableObject(i[t])?h[t]=(function(e,t){if(!t.customMerge)return o;var i=t.customMerge(e);return"function"==typeof i?i:o})(t,d)(e[t],i[t],d):h[t]=s(i[t],d))}),h)}o.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,i){return o(e,i,t)},{})},e.exports=o}},t={};function i(s){var n=t[s];if(void 0!==n)return n.exports;var r=t[s]={exports:{}};return e[s](r,r.exports,i),r.exports}i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var s in t)i.o(t,s)&&!i.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var s=i(156),n=i.n(s);class r{static ucFirst(e){return e.charAt(0).toUpperCase()+e.slice(1)}static lcFirst(e){return e.charAt(0).toLowerCase()+e.slice(1)}static toDashCase(e){return e.replace(/([A-Z])/g,"-$1").replace(/^-/,"").toLowerCase()}static toLowerCamelCase(e,t){let i=r.toUpperCamelCase(e,t);return r.lcFirst(i)}static toUpperCamelCase(e,t){return t?e.split(t).map(e=>r.ucFirst(e.toLowerCase())).join(""):r.ucFirst(e.toLowerCase())}static parsePrimitive(e){try{return/^\d+(.|,)\d+$/.test(e)&&(e=e.replace(",",".")),JSON.parse(e)}catch(t){return e.toString()}}}class a{constructor(e=document){this._el=e,e.$emitter=this,this._listeners=[]}publish(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=new CustomEvent(e,{detail:t,cancelable:i});return this.el.dispatchEvent(s),s}subscribe(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=this,n=e.split("."),r=i.scope?t.bind(i.scope):t;if(i.once&&!0===i.once){let t=r;r=function(i){s.unsubscribe(e),t(i)}}return this.el.addEventListener(n[0],r),this.listeners.push({splitEventName:n,opts:i,cb:r}),!0}unsubscribe(e){let t=e.split(".");return this.listeners=this.listeners.reduce((e,i)=>([...i.splitEventName].sort().toString()===t.sort().toString()?this.el.removeEventListener(i.splitEventName[0],i.cb):e.push(i),e),[]),!0}reset(){return this.listeners.forEach(e=>{this.el.removeEventListener(e.splitEventName[0],e.cb)}),this.listeners=[],!0}get el(){return this._el}set el(e){this._el=e}get listeners(){return this._listeners}set listeners(e){this._listeners=e}}class o{constructor(e,t={},i=!1){if(!(e instanceof Node)){console.warn(`There is no valid element given while trying to create a plugin instance for "${i}".`);return}this.el=e,this.$emitter=new a(this.el),this._pluginName=this._getPluginName(i),this.options=this._mergeOptions(t),this._initialized=!1,this._registerInstance(),this._init()}init(){console.warn(`The "init" method for the plugin "${this._pluginName}" is not defined. The plugin will not be initialized.`)}update(){}_init(){this._initialized||(this.init(),this._initialized=!0)}_update(){this._initialized&&this.update()}_mergeOptions(e){let t=[this.constructor.options,this.options,e];return t.push(this._getConfigFromDataAttribute()),t.push(this._getOptionsFromDataAttribute()),n().all(t.filter(e=>e instanceof Object&&!(e instanceof Array)).map(e=>e||{}))}_getConfigFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=r.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-config`);return i?window.PluginConfigManager.get(this._pluginName,i):e}_getOptionsFromDataAttribute(){let e={};if("function"!=typeof this.el.getAttribute)return e;let t=r.toDashCase(this._pluginName),i=this.el.getAttribute(`data-${t}-options`);if(i)try{return JSON.parse(i)}catch(e){console.error(`The data attribute "data-${t}-options" could not be parsed to json: ${e.message}`)}return e}_registerInstance(){window.PluginManager.getPluginInstancesFromElement(this.el).set(this._pluginName,this),window.PluginManager.getPlugin(this._pluginName,!1).get("instances").push(this)}_getPluginName(e){return e||(e=this.constructor.name),e}}class l extends o{static #e=this.options={storageKey:"loyaltyOptInChecked"};init(){this._storageKey=this.options.storageKey,this._restoreCheckboxState(),this._attachEventListeners()}_attachEventListeners(){document.addEventListener("change",e=>
1{if(e.target&&"loyaltyOptIn"===e.target.name){try{sessionStorage.setItem(this._storageKey+"_userInteracted","true")}catch(e){console.warn("Could not save user interaction state:",e)}this._saveCheckboxState(e.target.checked),this._syncAllCheckboxes(e.target)}})}_saveCheckboxState(e){try{e?sessionStorage.setItem(this._storageKey,"true"):sessionStorage.removeItem(this._storageKey)}catch(e){console.warn("Could not save loyalty opt-in state:",e)}}_restoreCheckboxState(){try{let e=sessionStorage.getItem(this._storageKey+"_userInteracted"),t=sessionStorage.getItem(this._storageKey);if("true"===e){let e=document.querySelectorAll('input[name="loyaltyOptIn"]'),i="true"===t;e.forEach(e=>{e.checked=i})}}catch(e){console.warn("Could not restore loyalty opt-in state:",e)}}_syncAllCheckboxes(e){document.querySelectorAll('input[name="loyaltyOptIn"]').forEach(t=>{t!==e&&(t.checked=e.checked)})}}class d extends o{static #e=this.options={checkboxSelector:'input[name="loyaltyOptInProfile"]',formSelector:'form[name="loyaltyOptIn"]',modalSelector:".loyalty-opt-in-confirm-modal",confirmButtonSelector:'[id^="loyaltyOptInConfirmButton"]',modalTextSelector:'[id^="loyaltyOptInConfirmModal"][id$="Text"]',modalWarningSelector:'[id^="loyaltyOptInConfirmModal"][id$="Warning"]'};init(){this._checkbox=this.el.querySelector(this.options.checkboxSelector),this._form=this.el.querySelector(this.options.formSelector),this._modal=this.el.querySelector(this.options.modalSelector)||document.querySelector(this.options.modalSelector),this._confirmButton=this._modal?this._modal.querySelector(this.options.confirmButtonSelector):null,this._modalText=this._modal?this._modal.querySelector(this.options.modalTextSelector):null,this._modalWarning=this._modal?this._modal.querySelector(this.options.modalWarningSelector):null,this._pendingSubmit=!1,this._checkbox&&this._form&&this._attachEventListener(),this._modal&&this._confirmButton&&this._attachModalListeners()}_attachEventListener(){this._checkbox.addEventListener("change",e=>{e.preventDefault(),this._pendingSubmit=!0;let t=this._checkbox.checked;if(this._modalText){let e=t?this._modalText.getAttribute("data-text-activate"):this._modalText.getAttribute("data-text-deactivate");e&&(this._modalText.textContent=e)}if(this._modalWarning){let e=this._modalWarning.querySelector("span[data-warning-deactivate]");if(t)this._modalWarning.style.display="none",e&&(e.textContent="");else{let t=e?e.getAttribute("data-warning-deactivate"):null;t&&e&&(e.textContent=t,this._modalWarning.style.display="flex")}}if(this._modal){let e=bootstrap.Modal.getInstance(this._modal);e||(e=new bootstrap.Modal(this._modal)),e.show()}else this._form.submit()})}_attachModalListeners(){this._confirmButton.addEventListener("click",()=>{this._pendingSubmit&&this._form.submit()}),this._modal.addEventListener("hidden.bs.modal",()=>{if(this._pendingSubmit&&(this._checkbox.checked=!this._checkbox.checked,this._pendingSubmit=!1,this._modalWarning)){this._modalWarning.style.display="none";let e=this._modalWarning.querySelector("span[data-warning-deactivate]");e&&(e.textContent="")}})}}class h{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,i);return this._sendRequest(s,null,t)}post(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("POST",e,s);return this._sendRequest(n,t,i)}delete(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(n,t,i)}patch(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let n=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(n,t,i)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,i){return this._registerOnLoaded(e,i),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,i){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),i&&this._request.setRequestHeader("Content-type",i),this._request}}class c extends o{static #e=this.options={redemptionEndpoint:"/loyalty/points/redeem",infoEndpoint:"/loyalty/points/redemption-info",sliderSelector:".loyalty-points-slider",redeemButtonSelector:".loyalty-redeem-btn",selectedPointsSelector:"[data-selected-points]",discountAmountSelector:"[data-discount-amount]",redemptionTypeSelector:".loyalty-redemption-type-input",conversionRateLabelSelector:"[data-conversion-rate-label]"};init(){this._httpClient=new h,this._redemptionRate=parseFloat(this.el.dataset.redemptionRate||25),this._percentageRedemptionRate=parseFloat(this.el.dataset.percentageRedemptionRate||50),this._percentageMaxDiscount=parseFloat(this.el.dataset.percentageMaxDiscount||20),this._availablePoints=parseInt(this.el.dataset.availablePoints||0),this._cartTotal=parseFloat(this.el.dataset.cartTotal||0),this._maxPerOrder=parseInt(this.el.dataset.maxPerOrder||0),this._redemptionType="percentage"===this.el.dataset.redemptionType?"percentage":"fixed",this._fixedEnabled="false"!==this.el.dataset.f
1ixedEnabled,this._percentageEnabled="true"===this.el.dataset.percentageEnabled,this._pointName=this.el.dataset.pointName||"Punkte",this._currentPoints=0,this._isLoading=!1,this._maxRedeemableFromServer=null,this._maxRedeemableFixedFromServer=null,this._maxRedeemablePercentageFromServer=null,this._slider=this.el.querySelector(this.options.sliderSelector),this._redeemButton=this.el.querySelector(this.options.redeemButtonSelector),this._selectedPointsDisplay=this.el.querySelector(this.options.selectedPointsSelector),this._discountAmountDisplay=this.el.querySelector(this.options.discountAmountSelector),this._maxRedeemableValueEl=this.el.querySelector("[data-max-redeemable-value]"),this._redemptionTypeInputs=this.el.querySelectorAll(this.options.redemptionTypeSelector),this._conversionRateLabel=this.el.querySelector(this.options.conversionRateLabelSelector),this._alertContainer=this.el.querySelector(".loyalty-redemption-alert"),this._slider&&this._redeemButton&&(this._attachEventListeners(),this._updateDisplay(),this._syncMaxRedeemableHint(),this._loadRedemptionInfo())}_attachEventListeners(){this._slider.addEventListener("input",e=>{this._onSliderChange(parseInt(e.target.value))}),this._redeemButton.addEventListener("click",()=>{this._redeemPoints()}),this._redemptionTypeInputs.forEach(e=>{e.addEventListener("change",e=>{this._setRedemptionType(e.target.value)})})}_onSliderChange(e){this._hideError(),this._currentPoints=e,this._updateDisplay()}_updateDisplay(){let e=this._currentPoints/this._redemptionRate,t=this._currentPoints/this._percentageRedemptionRate,i=e.toFixed(2).replace(".",","),s=t.toFixed(2).replace(".",","),n=this._pointName;if(this._selectedPointsDisplay){let e=this._currentPoints.toLocaleString("de-DE");this._selectedPointsDisplay.textContent=`${e} ${n}`,this._selectedPointsDisplay.dataset.selectedPoints=this._currentPoints}this._discountAmountDisplay&&(this._discountAmountDisplay.textContent="percentage"===this._redemptionType?`${s} %`:`${i} â¬`,this._discountAmountDisplay.dataset.discountAmount=e,this._discountAmountDisplay.dataset.discountPercentage=t),this._conversionRateLabel&&(this._conversionRateLabel.textContent="percentage"===this._redemptionType?`${this._formatPointsInteger(this._percentageRedemptionRate)} ${n} = 1 %`:`${this._formatPointsInteger(this._redemptionRate)} ${n} = 1 â¬`),this._slider&&(this._slider.value=this._currentPoints,this._updateSliderProgress())}_formatPointsInteger(e){let t="undefined"!=typeof document?document.documentElement.lang:"";try{return Math.max(0,Math.floor(Number(e))).toLocaleString(t||void 0)}catch(t){return String(Math.max(0,Math.floor(Number(e))))}}_syncMaxRedeemableHint(){this._maxRedeemableValueEl&&(this._maxRedeemableValueEl.textContent=this._formatPointsInteger(this._getMaxRedeemable()))}_setRedemptionType(e){this._hideError();let t="percentage"===e?"percentage":"fixed";("fixed"!==t||this._fixedEnabled)&&("percentage"!==t||this._percentageEnabled)&&(this._redemptionType=t,this.el.dataset.redemptionType=t,this._redemptionTypeInputs.forEach(e=>{e.checked=e.value===t,e.closest(".loyalty-redemption-mode__option")?.classList.toggle("is-active",e.checked)}),this._slider&&(this._slider.max=this._getMaxRedeemable()),this._setPoints(Math.min(this._currentPoints,this._getMaxRedeemable())),this._syncMaxRedeemableHint())}_updateSliderProgress(){if(!this._slider)return;let e=parseInt(this._slider.max,10),t=parseInt(this._slider.value,10)||0,i=e>0?t/e*100:0,s="var(--loyalty-slider-progress-color, #06c167)",n="var(--loyalty-slider-track-color, #e5e7eb)";this._slider.style.background=`linear-gradient(to right, ${s} 0%, ${s} ${i}%, ${n} ${i}%, ${n} 100%)`}_setPoints(e){e<0&&(e=0);let t=this._getMaxRedeemable();e>t&&(e=t),this._currentPoints=e,this._updateDisplay()}_getMaxRedeemable(){if("fixed"===this._redemptionType&&null!==this._maxRedeemableFixedFromServer)return this._maxRedeemableFixedFromServer;if("percentage"===this._redemptionType&&null!==this._maxRedeemablePercentageFromServer)return this._maxRedeemablePercentageFromServer;if("percentage"===this._redemptionType){let e=Math.floor(Math.min(this._percentageMaxDiscount,100)*this._percentageRedemptionRate);return e=Math.min(this._availablePoints,e),this._maxPerOrder>0&&(e=Math.min(e,this._maxPerOrder)),e}let e=Math.floor(this._cartTotal*this._redemptionRate),t=Math.min(this._availablePoints,e);return this._maxPerOrder>0&&(t=Math.min(t,this._maxPerOrder)),t}_loadRedemptionInfo(){this._isLoading||(this._isLoading=!0,this._httpClient.get(this.options.infoEndpoint,e=>{try{let t=JSON.parse(e);if(t.enabled){if(this._availablePoints=t.availablePoints||0,this._redemptionRate=t.redemptionRate||25,this._percentageRedemptionRate=t.percentageRedemptionRate||50,this._percentageMaxDiscount=t.percentageMaxDiscount||20,this._fixedEnabled=!1!==t.fixedEnabled,this._percentageEnabled=!0===t.percentageEnabled,this._cartTotal=t.cartTotal||0,this._maxPerOrder=t.maxPerOrder||0,this._maxRedeemableFromServer=void 0!==t.maxRedeemable&&null!==t.maxRedeemable?t.maxRedeemable:null,this._maxRedeemableFixedFromServer=void 0!==t.maxRedeemableFixed&&null!==t.maxRedeemableFixed?t.maxRedeemableFixed:null,this._maxRedeemablePercentageFromServer=void 0!==t.maxRedeemablePercentage&&null!==t.maxRedeemablePercentage?t.maxRedeemablePercentage:null,t.currentRedemptionType&&(this._redemptionType="percentage"===t.currentRedemptionType?"percentage":"fixed"),"fixed"===this._redemptionType&&!this._fixedEnabled&&this._percentageEnabled&&(this._redemptionType="percentage"),"percentage"===this._redemptionType&&!this._percentageEnabled&&this._fixedEnabled&&(this._redemptionType="fixed"),this._slider){let e=this._getMaxRedeemable();this._slider.max=e}this._syncMaxRedeemableHint(),t.currentlyRedeemed&&this._setPoints(t.currentlyRedeemed),this._setRedemptionType(this._redemptionType),this._updateSliderProgress()}}catch(e){console.error("Failed to parse redemption info:",e)}finally{this._isLoading=!1}},"application/json",!1))}_redeemPoints(){if(this._isLoading)return;this._isLoading=!0,this._redeemButton.disabled=!0,this._redeemButton.classList.add("is-loading");let e=new FormData;e.append("points",this._currentPoints),e.append("redemptionType",this._redemptionType),this._httpClient.post(this.options.redemptionEndpoint,e,e=>{try{let t=JSON.parse(e);t.success?window.location.reload():(this._showError(t.message||"Ein Fehler ist aufgetreten."),this._isLoading=!1,this._redeemButton.disabled=!1,this._redeemButton.classList.remove("is-loading"))}catch(e){console.error("Failed to parse redemption response:",e),this._showError("Ein Fehler ist aufgetreten."),this._isLoading=!1,this._redeemButton.disabled=!1,this._redeemButton.classList.remove("is-loading")}},"application/json",!1)}_showError(e){if(this._alertContainer){let t=this._alertContainer.querySelector(".alert-content");t||(t=this._alertContainer.querySelector(".alert-content-container")),t||(t=this._alertContainer.querySelector(".alert")),t?t.textContent=e:this._alertContainer.textContent=e,this._alertContainer.classList.remove("d-none")}else alert(e)}_hideError(){this._alertContainer&&this._alertContainer.classList.add("d-none")}}class p extends o{static #e=this.options={detailUrl:"",modalSelector:"#loyaltyTransactionDetailModal",modalContentSelector:".modal-body"};init(){this._client=new h,this._registerEvents()}_registerEvents(){this.el.addEventListener("click",this._onClick.bind(this))}_onClick(e){e.preventDefault();let t=this.options.detailUrl;if(!t)return;let i="loyaltyTransactionDetailModal_"+Math.floor(1e4*Math.random()),s=` 2 <div class="modal fade loyalty-transaction-detail-modal" id="${i}" tabindex="-1"> 3 <div class="modal-dialog modal-dialog-centered modal
3-lg modal-fullscreen-sm-down"> 4 <div class="modal-content"> 5 <div class="modal-header"> 6 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> 7 </div> 8 <div class="modal-body"> 9 <div class="d-flex justify-content-center py-4"> 10 <div class="spinner-border" role="status"> 11 <span class="visually-hidden">Loading...</span> 12 </div> 13 </div> 14 </div> 15 </div> 16 </div> 17 </div> 18 `;document.body.insertAdjacentHTML("beforeend",s);let n=document.getElementById(i),r=new bootstrap.Modal(n,{backdrop:!0,keyboard:!0});n.addEventListener("hidden.bs.modal",function(){r.dispose(),n.remove()});let a=n.querySelector(".modal-body");this._client.get(t,e=>{a.innerHTML=e,this._initUsedForCollapse(a),this._initGotoLinks(a,n)}),r.show()}_initUsedForCollapse(e){let t=e.querySelector("#loyaltyUsedForDetails"),i=e.querySelector(".loyalty-used-for-toggle");if(!t||!i)return;let s=i.getAttribute("data-show-more")||"mehr anzeigen",n=i.getAttribute("data-show-less")||"weniger anzeigen",r=i.querySelector(".loyalty-used-for-toggle__text");t.addEventListener("show.bs.collapse",()=>{r&&(r.textContent=n),i.classList.add("loyalty-used-for-toggle--expanded")}),t.addEventListener("hide.bs.collapse",()=>{r&&(r.textContent=s),i.classList.remove("loyalty-used-for-toggle--expanded")})}_initGotoLinks(e,t){e.querySelectorAll("a.loyalty-transaction-goto-link").forEach(e=>{e.addEventListener("click",i=>{i.preventDefault();let s=e.getAttribute("href"),n=bootstrap.Modal.getInstance(t);n?(t.addEventListener("hidden.bs.modal",function e(){t.removeEventListener("hidden.bs.modal",e),s.startsWith("#")||""===s?window.location.hash=s:window.location.href=s},{once:!0}),n.hide()):s.startsWith("#")||""===s?window.location.hash=s:window.location.href=s})})}}let u=window.PluginManager;u.register("LoyaltyOptIn",l,"body"),u.register("LoyaltyProfileOptIn",d,"[data-loyalty-profile-opt-in]"),u.register("LoyaltyPointsRedemption",c,"[data-loyalty-redemption]"),u.register("LoyaltyAnchorHighlight",class extends o{init(){this.handleInitialHash(),this.registerEvents()}registerEvents(){window.addEventListener("hashchange",this.onHashChange.bind(this)),document.addEventListener("click",this.onClick.bind(this))}handleInitialHash(){window.location.hash&&this.highlightTransaction(window.location.hash)}onHashChange(){this.highlightTransaction(window.location.hash)}onClick(e){let t=e.target.closest("a");if(!t)return;let i=t.getAttribute("href");if(!i)return;let s="";if(i.startsWith("#transaction-")?s=i:i.includes("#transaction-")&&(s="#"+i.split("#")[1]),s){let e=s.substring(1);document.getElementById(e)&&this.highlightTransaction(s)}}highlightTransaction(e){if(!e||!e.startsWith("#transaction-"))return;let t=e.substring(1),i=document.getElementById(t);i&&(i.classList.remove("loyalty-flash-active"),i.offsetWidth,i.classList.add("loyalty-flash-active"))}},"body"),u.register("LoyaltyTransactionDetail",p,"[data-loyalty-transaction-detail]"),u.register("LoyaltyRemainingPointsTooltip",class extends o{init(){this._initTooltips(),this._initToggle()}_initTooltips(){this.el.querySelectorAll('[data-bs-toggle="tooltip"]').forEach(e=>{bootstrap.Tooltip.getInstance(e)||new bootstrap.Tooltip(e)})}_initToggle(){this._toggles=Array.from(this.el.querySelectorAll("[data-loyalty-remaining-points-toggle]")),0!==this._toggles.length&&(this._applyToggleState(!1),this._toggles.forEach(e=>{e.addEventListener("change",()=>{this._applyToggleState(e.checked)})}))}_applyToggleState(e){this._toggles.forEach(t=>{t.checked=e}),this.el.querySelectorAll("[data-loyalty-remaining-points]").forEach(t=>{t.classList.toggle("d-none",!e)})}},"[data-loyalty-transaction-overview]"),u.register("LoyaltyEarnPointsAccordion",class extends o{init(){this._abort=new AbortController;let e=this._abort.signal,t={capture:!0,signal:e};this._suppressClickForInputId=null,this.el.addEventListener("mousedown",this._onAccordionMouseDown.bind(this),t),this.el.addEventListener("click",this._onAccordionCl
18ick.bind(this),t),this.el.addEventListener("click",this._onReferralCopyClick.bind(this),{signal:e})}_getHeaderLabelFromEventTarget(e){if(!e||!e.closest)return null;let t=e.closest(".cogi-loyalty-earn-points__header");return t&&this.el.contains(t)?t:null}_getRadioForLabel(e){let t=e.getAttribute("for")||e.htmlFor;if(!t)return null;let i=document.getElementById(t);return i&&"radio"===i.type&&this.el.contains(i)?i:null}_onAccordionMouseDown(e){if(0!==e.button)return;let t=this._getHeaderLabelFromEventTarget(e.target);if(!t)return;let i=this._getRadioForLabel(t);i&&i.checked&&(this._suppressClickForInputId=i.id,i.checked=!1,e.preventDefault(),e.stopPropagation())}_onReferralCopyClick(e){let t=e.target&&e.target.closest?e.target.closest("[data-cogi-loyalty-referral-copy]"):null;if(!t||!this.el.contains(t))return;let i=t.getAttribute("data-copy-target"),s=i?document.getElementById(i):null;if(!s||"INPUT"!==s.tagName)return;e.preventDefault(),e.stopPropagation(),s.focus(),s.select(),s.setSelectionRange(0,s.value.length);let n=s.value;navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(n).catch(()=>{document.execCommand("copy")}):document.execCommand("copy")}_onAccordionClick(e){if(null===this._suppressClickForInputId)return;let t=this._getHeaderLabelFromEventTarget(e.target);if(!t){this._suppressClickForInputId=null;return}let i=this._getRadioForLabel(t);if(!i||i.id!==this._suppressClickForInputId){this._suppressClickForInputId=null;return}e.preventDefault(),e.stopImmediatePropagation(),e.stopPropagation(),this._suppressClickForInputId=null}destroy(){this._abort.abort()}},"[data-cogi-loyalty-earn-points]")})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.