1import{aM as u,b9 as _,S as d,C as c}from"./storefrontApp.CsApItsi.min.js";import{f as p,$ as o,w as b,e as m,t as y}from"./chunk-vendor-lit.NvY0u02.js";import{B as f}from"./chunk-buy_button.BI4wooO.js";import{t as h}from"./chunk-translations_directive.DWSzkd6.js";import"./chunk-vendor-di.Bh23gdA.js";import"./chunk-storefront_settings_constants.DIF02Gz.js";import"./chunk-vendor-rxjs.Dp7kflo.js";import"./chunk-vendor-lodash.CWHFt7Z.js";import"./chunk-vendor-phoenix.cdKS79L.js";import"./chunk-storefront_base_lit_element.lX23Jvc.js";import"./chunk-product_stock_changed_handler.C3zWS6V.js";import"./chunk-product_events_constants.BHFu5GP.js";import"./chunk-product_quantity_changed_handler.cEVLdGq.js";import"./chunk-bundle_item_mapper.C6saoi-.js";import"./chunk-product_variants_validator.3TFbf28.js";var g=Object.defineProperty,l=(i,t,e,E)=>{for(var s=void 0,n=i.length-1,r;n>=0;n--)(r=i[n])&&(s=r(t,e,s)||s);return s&&g(t,e,s),s};class a extends f{constructor(){super(),this.pointsCost=0,this._hasEnoughPoints=!1,this._subscribeToLoyaltyPoints=()=>{this._userApi?.selectLoyaltyPoints$().subscribe(t=>{this._hasEnoughPoints=t?t>=this.pointsCost:!1,this._shouldBlock=!this._hasEnoughPoints})},this.getApi(u.api).then(t=>{this._userApi=t,this._subscribeToLoyaltyPoints()}),this.isExchangedWithLoyaltyPoints=!0}static{this.moduleName=_.component}render(){return o`${p(this._hasEnoughPoints,()=>o`<div class="product-actions__add-to-basket loyalty-product-actions__add-to-basket"> 2 <button 3 type="button" 4 class="btn btn_full-width btn_s btn_primary" 5 > 6 ${h("Add to cart")} 7 </button> 8 </div>`,()=>o`<span class="btn btn_full-width btn_s btn_special btn_special-disabled">${h("Not enough points")}</span>`)} 9 ${p(this._isAddingToBasketPending,()=>o`<span 10 style="width: ${this._btnWidth}px; height: ${this._btnHeight}px" 11 class="btn btn_primary" 12 > 13 <div class="loader"> 14 <div class="loader__spinner loader__spinner_xs"></div> 15 </div> 16 </span>`,()=>b)}`}}l([m({type:Number,attribute:"points-cost"})],a.prototype,"pointsCost");l([y()],a.prototype,"_hasEnoughPoints");class I extends d{static{this.featureName=_.component}init(){return{cores:[{type:c,instance:[a]}]}}}export{I as LoyaltyBuyButtonInitializer};
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.