1import{M as t}from"./bluetti.modal.BkmKJNm2.min.js";import{M as e}from"./bluetti.messageapi.xb-dMrlc.min.js";import{x as s}from"./bluetti.utils.BeiRElZ6.min.js";import"./bluetti.vendor.OdbWYEnF.min.js";import"./bluetti.constants.Cyvr9pHy.min.js";class i extends window.HTMLElement{constructor(){super(),this.messageapi=new e,this.gtagConfig={sendTo:this.dataset.gaSendTo||"",value:this.dataset.gaValue||1,currency:this.dataset.gaCurrency||window.Shopify.currency.active||"USD"},this.copySuccessText=this.dataset.copySuccessText||"Copied!",this.copyErrorText=this.dataset.copyErrorText||"Failed to copy code",window.copyBrandSubscribeCode=()=>{navigator.clipboard?navigator.clipboard.writeText(this.dataset.code).then(()=>{s("success",this.dataset.copySuccessText)}).catch(()=>{s("error",this.dataset.copyErrorText)}):s("error",this.dataset.copyErrorText)}}connectedCallback(){const t=this.querySelector(".toast-form-submit");this.modalContent=this.querySelector("[data-modal-content]"),t.addEventListener("submit",this.submitForm.bind(this),!1)}showTipMessage(t,e,s=3e3){const i=this.querySelector(".tip");if(!i)return;const o={success:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20" height="20" viewBox="0 0 20 20"><defs><clipPath id="master_svg0_299_16934"><rect x="0" y="0" width="20" height="20" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_299_16934)"><g><path d="M20,10Q20,10.2455,19.988,10.4907Q19.9759,10.7359,19.9518,10.9802Q19.9278,11.2245,19.8918,11.4673Q19.8557,11.7101,19.8078,11.9509Q19.76,12.1917,19.7003,12.4298Q19.6407,12.6679,19.5694,12.9028Q19.4981,13.1378,19.4154,13.3689Q19.3327,13.6,19.2388,13.8268Q19.1448,14.0536,19.0399,14.2755Q18.9349,14.4975,18.8192,14.714Q18.7035,14.9305,18.5773,15.141Q18.4511,15.3516,18.3147,15.5557Q18.1783,15.7598,18.0321,15.957Q17.8858,16.1542,17.7301,16.3439Q17.5744,16.5337,17.4095,16.7156Q17.2446,16.8975,17.0711,17.0711Q16.8975,17.2446,16.7156,17.4095Q16.5337,17.5744,16.3439,17.7301Q16.1542,17.8858,15.957,18.0321Q15.7598,18.1783,15.5557,18.3147Q15.3516,18.4511,15.141,18.5773Q14.9305,18.7035,14.714,18.8192Q14.4975,18.9349,14.2755,19.0399Q14.0536,19.1448,13.8268,19.2388Q13.6,19.3327,13.3689,19.4154Q13.1378,19.4981,12.9028,19.5694Q12.6679,19.6407,12.4298,19.7003Q12.1917,19.76,11.9509,19.8078Q11.7101,19.8557,11.4673,19.8918Q11.2245,19.9278,10.9802,19.9518Q10.7359,19.9759,10.4907,19.988Q10.2455,20,10,20Q9.75451,20,9.50932,19.988Q9.26413,19.9759,9.01983,19.9518Q8.77552,19.9278,8.53269,19.8918Q8.28987,19.8557,8.0491,19.8078Q7.80833,19.76,7.5702,19.7003Q7.33207,19.6407,7.09715,19.5694Q6.86224,19.4981,6.6311,19.4154Q6.39996,19.3327,6.17316,19.2388Q5.94636,19.1448,5.72445,19.0399Q5.50253,18.9349,5.28603,18.8192Q5.06953,18.7035,4.85897,18.5773Q4.64841,18.4511,4.4443,18.3147Q4.24018,18.1783,4.04301,18.0321Q3.84583,17.8858,3.65607,17.7301Q3.4663,17.5744,3.28441,17.4095Q3.10252,17.2446,2.92893,17.0711Q2.75535,16.8975,2.59049,16.7156Q2.42563,16.5337,2.2699,16.3439Q2.11416,16.1542,1.96792,15.957Q1.82169,15.7598,1.6853,15.5557Q1.54892,15.3516,1.42271,15.141Q1.29651,14.9305,1.18079,14.714Q1.06507,14.4975,0.960107,14.2755Q0.855148,14.0536,0.761205,13.8268Q0.667261,13.6,0.584559,13.3689Q0.501857,13.1378,0.430597,12.9028Q0.359336,12.6679,0.299687,12.4298Q0.240039,12.1917,0.192147,11.9509Q0.144255,11.7101,0.108235,11.4673Q0.0722146,11.2245,0.0481527,10.9802Q0.0240909,10.7359,0.0120454,10.4907Q0,10.2455,0,10Q0,9.75451,0.0120454,9.50932Q0.0240909,9.26413,0.0481527,9.01983Q0.0722146,8.77552,0.108235,8.53269Q0.144255,8.28987,0.192147,8.0491Q0.240039,7.80833,0.299687,7.5702Q0.359336,7.33207,0.430597,7.09715Q0.501857,6.86224,0.584559,6.6311Q0.667261,6.39996,0.761205,6.17316Q0.855148,5.94636,0.960107,5.72445Q1.06507,5.50253,1.18079,5.28603Q1.29651,5.06953,1.42271,4.85897Q1.54892,4.64841,1.6853,4.4443Q1.82169,4.24018,1.96792,4.04301Q2.11416,3.84583,2.2699,3.65607Q2.42563,3.4663,2.59049,3.28441Q2.75535,3.10252,2.92893,2.92893Q3.10252,2.75535,3.28441,2.59049Q3.4663,2.42563,3.65607,2.2699Q3.84583,2.11416,4.04301,1.96792Q4.24018,1.82169,4.4443,1.6853Q4.64841,1.54892,4.85897,1.42271Q5.06953,1.29651,5.28603,1.18079Q5.50253,1.06507,5.72445,0.960107Q5.94636,0.855148,6.17316,0.761205Q6.39996,0.667261,6.6311,0.584559Q6.86224,0.501857,7.09715,0.430597Q7.33207,0.359336,7.5702,0.299687Q7.80833,0.240039,8.0491,0.192147Q8.28987,0.144255,8.53269,0.108235Q8.77552,0.0722146,9.01983,0.0481527Q9.26413,0.0240909,9.50932,0.0120454Q9.75451,0,10,0Q10.2455,0,10.4907,0.0120454Q10.7359,0.0240909,10.9802,0.0481527Q11.2245,0.0722146,11.4673,0.108235Q11.7101,0.144255,11.9509,0.192147Q12.1917,0.240039,12.4298,0.299687Q12.6679,0.359336,12.9028,0.430597Q13.1378,0.501857,13.3689,0.584559Q13.6,0.667261,13.8268,0.761205Q14.0536,0.855148,14.2755,0.960107Q14.4975,1.06507,14.714,1.18079Q14.9305,1.29651,15.141,1.42271Q15.3516,1.54892,15.5557,1.6853Q15.7598,1.82169,15.957,1.96792Q16.1542,2.11416,16.3439,2.2699Q16.5337,2.42563,16.7156,2.59049Q16.8975,2.75535,17.0711,2.92893Q17.2446,3.10252,17.4095,3.28441Q17.5744,3.4663,17.7301,3.65607Q17.8858,3.84583,18.0321,4.04301Q18.1783,4.24018,18.3147,4.4443Q18.4511,4.64841,18.5773,4.85897Q18.7035,5.06953,18.8192,5.28603Q18.9349,5.50253,19.0399,5.72445Q19.1448,5.94636,19.2388,6.17316Q19.3327,6.39996,19.4154,6.6311Q19.4981,6.86224,19.5694,7.09715Q19.6407,7.33207,19.7003,7.5702Q19.76,7.80833,19.8078,8.0491Q19.8557,8.28987,19.8918,8.53269Q19.9278,8.77552,19.9518,9.01983Q19.9759,9.26413,19.988,9.50932Q20,9.75451,20,10Z" fill="#34C759" fill-opacity="1"/></g><g><path d="M15.2984357421875,7.5484879101562505L9.3698757421875,13.477057910156251C9.0867157421875,13.76022791015625,8.627525742187501,
113.76022791015625,8.3443657421875,13.477057910156251L4.7015077421875,9.83420791015625C4.4183446421875,9.55103791015625,4.4183446421875,9.09185791015625,4.7015077421875,8.80869791015625C4.9846717421874995,8.52552791015625,5.4438547421875,8.52552791015625,5.7270157421875005,8.80869791015625L8.8571157421875,11.93879791015625L14.2729357421875,6.52297991015625C14.5561357421875,6.23981681015625,15.0152357421875,6.23981681015625,15.2984357421875,6.52297991015625C15.5816357421875,6.80614291015625,15.5816357421875,7.26532691015625,15.2984357421875,7.5484879101562505Z" fill="#FFFFFF" fill-opacity="1"/></g></g></svg>',error:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="20" height="20" viewBox="0 0 20 20"><defs><clipPath id="master_svg0_299_16800"><rect x="0" y="0" width="20" height="20" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_299_16800)"><g><ellipse cx="10" cy="10" rx="10" ry="10" fill="#FFFFFF" fill-opacity="1"/></g><g><path d="M10,0C4.47693,0,0,4.47693,0,10C0,15.5231,4.47693,20,10,20C15.5231,20,20,15.5231,20,10C20,4.47693,15.5231,0,10,0ZM13.473,12.5309C13.6062,12.6641,13.6062,12.8817,13.473,13.0182L13.0182,13.473C12.885,13.6062,12.6673,13.6062,12.5309,13.473L10,10.9422L7.46914,13.473C7.33593,13.6062,7.11826,13.6062,6.98181,13.473L6.52697,13.0182C6.39376,12.885,6.39376,12.6673,6.52697,12.5309L9.05783,10L6.52697,7.46914C6.39376,7.33593,6.39376,7.11826,6.52697,6.98181L6.98181,6.52697C7.11501,6.39376,7.33268,6.39376,7.46914,6.52697L10,9.05783L12.5309,6.52697C12.6641,6.39376,12.8817,6.39376,13.0182,6.52697L13.473,6.98181C13.6062,7.11501,13.6062,7.33268,13.473,7.46914L10.9422,10L13.473,12.5309Z" fill="#E30100" fill-opacity="1"/></g></g></svg>'},r={success:"#34C759",error:"#E30100"},a=o[t]||o.error,Q=r[t]||r.error;i.innerHTML=`<div class="flex items-center gap-2" style="color: ${Q}">${a}${e}</div>`,s>0&&setTimeout(()=>{i&&(i.innerHTML="")},s)}gtagReportConversion(){const t=(null==window?void 0:window.gtag)||"";if(!t)return;const{sendTo:e,value:s,currency:i}=this.gtagConfig;if(null==e?void 0:e.trim())try{t("event","conversion",{send_to:e,value:Number(s)||0,currency:(null==i?void 0:i.toUpperCase())||"USD"})}catch(o){}}async submitForm(t){t.preventDefault();const e=this.querySelector('[type="email"]').value,i=t.target.querySelector('[name="tags"]').value,o=t.target.querySelector('[name="id"]').value,r=this.querySelector('[type="submit"]');if(""===e)return;this.gtagReportConversion();const a={email:e,shop:window.Shopify.shop.split(".myshopify")[0],tag:i,id:o};r.disabled=!0,r.classList.add("loading");const Q=await this.messageapi.subscribeKlaviyo(a);if(0===Q.code||10001===Q.code)this.interactionSuccess();else{const t=this.getAttribute("data-error-message");"false"===this.getAttribute("data-show-toast")?this.showTipMessage("error",t||Q.msg):s("error",t||Q.msg)}document.querySelector(".toast-form-submit").reset(),r.disabled=!1,r.classList.remove("loading")}interactionSuccess(){switch(this.getAttribute("data-interaction-type")){case"anchor":{const t=this.getAttribute("data-to-link");if(t){const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})}break}case"toast":{const t=this.getAttribute("data-success-message");if("false"===this.getAttribute("data-show-toast")){this.showTipMessage("success",t||"æä½æå");break}s("success",t||"æä½æå");break}case"modal":this.showModal()}}showModal(){new t({className:{content:"w-[335px] max-w-[335px] lg:w-[760px] lg:max-w-[760px] rounded-xl css-subscribe-modal !bg-black",body:"!px-0 !py-0 overflow-hidden w-full"}}).showModal({content:`<div class="overflow-y-auto max-h-[70vh] !pb-0 w-full">${this.modalContent.innerHTML}</div>`})}}window.customElements.define("brand-subscribe",i);
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.