(function() { var take = function() { window.AqurBaseURL = 'https://pr.aqur.com'; //Inserted Start ! const url_cart="https://www.sukkiri-life.com/lp/ac-rc-h-teiki/tu-cart/"; const url_cart_st="https://www.sukkiri-life.com/lp/hrm-rc_qua/s402_to_test250729/"; const url_thanks_rc="https://www.sukkiri-life.com/lp/qua_thanks_ac_rc_mn/"; const url_thanks_upsell_rc="https://www.sukkiri-life.com/lp/qua_thanks_ac_rc_mn/?rc_complete_upsell=1"; const url_thanks_upsell="https://www.sukkiri-life.com/lp/qua_thanks_ac_n_mn/"; var url_thanks_normal = ""; var vframe; window.addEventListener("chatform_initialized", (event) => { const elements = document.querySelectorAll('.bot_open'); elements.forEach(element => { element.removeAttribute('href'); }); const url = window.location.href; if ( url.includes("engagement_1_wt_quatest")|| url.includes("engagement_1_wt")|| url.includes("engagement_1_to")) { activateChatformWidget(); } const urlParams = new URLSearchParams(window.location.search); if (urlParams.has('rc_kiji_direct') && urlParams.get('rc_kiji_direct') === '1') { activateChatformWidget(); } createAqurBinding() // location.hrefに@https://www-st.sukkiri-life.comが含まれているかチェック const currentUrl = window.location.href; const targetUrl = currentUrl.includes('https://www-st.sukkiri-life.com') ? url_cart_st : url_cart; createVframe(targetUrl); window.aqur.vframe=vframe; }) function createVframe(linkURL){ var url = new URL(window.location.href); let userChatbot = url.searchParams.get('usechatbot') if(userChatbot){ return } vframe = document.createElement("iframe"); vframe.id="vframe"; vframe.sandbox.add('allow-storage-access-by-user-activation'); vframe.sandbox.add('allow-forms'); vframe.sandbox.add('allow-top-navigation'); vframe.sandbox.add('allow-scripts'); vframe.sandbox.add('allow-same-origin'); vframe.sandbox.add('allow-modals') vframe.width="1px"; vframe.height="1px"; var REF = new URL(linkURL); REF.searchParams.append('usechatbot', "no"); vframe.src = REF; document.body.appendChild(vframe); vframe.addEventListener("load", (e) => { //console.log(e.target.src) try{ var insertDDP =()=>{ var script = vframe.contentWindow.document.createElement('script'); script.src = `${window.AqurBaseURL}/mhbc/client/ddp`; console.log("ddp inserted") vframe.contentWindow.document.head.appendChild(script); } var url = new URL(vframe.contentWindow.location.href) console.log(url.href) if (vfmode!="debug") { vframe.width="1px"; vframe.height="1px"; } const target = document.querySelector('.chatform_widget'); if(target){ var param={ event: "chatform_vframeLoaded", url:url.href } target.contentWindow.postMessage(param, "*"); } switch (url.origin) { default: insertDDP() } }catch(error){ if (error instanceof DOMException && error.name === 'SecurityError') { console.log("クロスオリジンアクセスエラーが発生しました:", error.message); if (!location.href.includes("pr.aqur.com")) { setTimeout(() => { vframe.width="100%"; vframe.height="100%"; vframe.style.display= "block"; vframe.style.zIndex= 9999999999; vframe.style.position= "fixed"; vframe.style.backgroundColor= "white"; vframe.style.top=0; vframe.style.left=0; vframe.style.border="none"; }, 3000); } return; } throw error; } }) let vfmode = url.searchParams.get('vfmode') if(vfmode=="debug"){ vframe.classList.add('debug'); vframe.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" }); if(device=="mobile"){ vframe.height="50%" } const target = document.querySelector('.chatform_widget'); if (target) { target.style.height = "50%"; // 高さを50%に設定 } var param={ event: "chatform_vframe_debug" } vframe.contentWindow.postMessage(param, "*"); } } //Inserted End //Default function render(template, data){ //console.log("render",template,data) return template.replace(/{{(.*?)}}/g, (match) => { return data[match.split(/{{|}}/).filter(Boolean)[0].trim()] }) } function activateChatformWidget(){ if(!chatform_initialized){ console.log("Aqur is not ready") return } const w = document.querySelector('.chatform_widget'); w.classList.toggle("close"); if(w.classList.contains("close")){ document.body.classList.remove("chat_open"); }else{ document.body.classList.add("chat_open"); } } var chatform_initialized = false const pid = "mhbc"; const target = "production"; const mode = "release"; const device = JSON.parse("false".toLowerCase())?"mobile":"pc"; const launch = "click"; const client = "https://form.aqur.com/"; let REF = new URL(window.location); let userChatbot = REF.searchParams.get('usechatbot') if(userChatbot=="no"){ //console.log("no chatbot") return } REF.searchParams.append('pid', pid); REF.searchParams.append('mode', mode); REF.searchParams.append('target', target); REF.searchParams.append('hash', "be241b9b-2a88-4ec0-ba5a-004430f95b50"); REF.searchParams.append('browser', "undefined"); REF.searchParams.append('device', device); REF.searchParams.append('os', "undefined"); REF.searchParams.append('ua', "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"); REF.searchParams.append('ip', "216.73.216.88"); REF.searchParams.append('ref', REF.href); REF.searchParams.append('path', REF.pathname); //for UI REF.searchParams.append('CLIENT_ID', 'PR'); REF.searchParams.append('BASE_URL', 'https://pr.aqur.com'); REF.searchParams.append('HEADER_LABEL', ''); REF.searchParams.append('HEADER_BG_COLOR', '#fff'); REF.searchParams.append('HEADER_LABEL_COLOR', '#fff'); REF.searchParams.append('SHOW_TIMER', 'false'); REF.searchParams.append('ICON_PATH', 'https://res.cloudinary.com/dts6mbw86/image/upload/v1713319985/aqur/common/icon_azvikf.png'); const params = new URLSearchParams(REF.search.slice(1)); var sid = params.get('qu_sid'); if(sid){ REF.searchParams.append('sid', sid); } let search = REF.search.slice(1) //console.log(search) let widget = render( ''+ '', { device : device, client : client, search : (search)?"&"+search:"" } ); let creationComplete = function(){ const body = document.body; if(body){ var filterid; const chatbotProgressBar = "
" body.insertAdjacentHTML('beforeend', chatbotProgressBar); body.classList.add(device) body.insertAdjacentHTML('beforeend', widget); const target = document.querySelector('.chatform_widget'); const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if(!target.classList.contains("close")){ var contentWindow = target.contentWindow; if(contentWindow){ contentWindow.postMessage("chat_open", "*"); contentWindow.postMessage( { type:"filterIdChanged", data:filterid }, "*"); } } }); }); const config = { characterData: true, attributes:true, subtree: true }; observer.observe(target, config); } if(device=="pc"){ var resize=()=>{ let zoom_level = window.devicePixelRatio || window.screen.availWidth / document.documentElement.clientWidth * 100; const targets = document.querySelectorAll('body,.chatform_widget'); if(zoom_level>=3){ targets[0].classList.add("mobile") targets[0].classList.remove("pc") targets[1].classList.add("mobile") targets[1].classList.remove("pc") }else{ targets[0].classList.add("pc") targets[0].classList.remove("mobile") targets[1].classList.add("pc") targets[1].classList.remove("mobile") } } resize() window.addEventListener("resize", () => { resize() }) } document.addEventListener('click', (event) => { if (event.target && event.target.closest('.chatformBtn ') || event.target.classList.contains("chatformBtn") || event.target.closest('.bot_open ') || event.target.classList.contains("bot_open") || event.target.closest('.rc_openBtn ') || event.target.classList.contains("rc_openBtn") || event.target.id == "chatform_widget_cancelbtn" ) { activateChatformWidget() filterid = event.target.closest(".chatformBtn").dataset.filterid } }); document.dispatchEvent(new CustomEvent("chatform_widget_creation_complete")); }; // 重複実行防止フラグ let creationCompleteExecuted = false; // 安全なcreationComplete実行関数 const safeCreationComplete = function() { if (creationCompleteExecuted) { return; // 既に実行済みの場合は何もしない } creationCompleteExecuted = true; creationComplete(); }; // DOMContentLoadedイベントでcreationCompleteを実行 if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', safeCreationComplete); } else { safeCreationComplete(); } // 30秒後に実行されていない場合は強制実行 setTimeout(() => { if (!creationCompleteExecuted) { console.log('creationCompleteが30秒以内に実行されませんでした。強制実行します。'); safeCreationComplete(); } }, 30000); window.addEventListener("message", (event) => { //console.log("event.data.event", event) if(event.data.event == "chatform_start"){ console.log(event.data.uuId) } if(event.data.event == "chatform_close"){ activateChatformWidget(); } if(event.data.event == "chatform_evalScript"){ window.eval(event.data.script) } if(event.data.event == "chatform_insertTag"){ body.insertAdjacentHTML( "beforeend", event.data.tag ); event.data.scripts.forEach((item)=>{ eval(item.textContent)}) } if(event.data.event == "chatform_initialized"){ //console.log("Aqur Initialized") document.getElementById("chatbotProgressBar").style.width = "100%"; var opacity = function(){ document.getElementById("chatbotProgressBar").style.opacity = "0"; }; setTimeout(opacity, 1000); chatform_initialized = true; if(launch=="auto"){ activateChatformWidget(); } window.dispatchEvent(new CustomEvent("chatform_initialized")); } //Hormo特別処理 //エラー検知 if(event.data.event == "chatform_bindFormErrorFound"){ //console.log("chatform_bindFormErrorFound") const target = document.querySelector('.chatform_widget'); var param={ event: "chatform_bindFormErrorFound", text:event.data.text } target.contentWindow.postMessage(param, "*"); } //通常注文確定ボタン押下 if(event.data.event == "chatform_vframe_submit"){ //console.log("chatform_vframe_submit") var param={ event: "chatform_bindFormSubmit" } vframe.contentWindow.postMessage(param, "*"); window.dataLayer = window.dataLayer || []; window.dataLayer.push({ "event" : "rc_matsuge_qualva_buy" }); } //通常注文成功時 if(event.data.event == "chatform_bindFormConversion"){ //console.log("chatform_bindFormConversion") // 重複防止フラグのチェック if(window.aqur && window.aqur.conversionProcessed) { console.log('chatform_bindFormConversion: 既に処理済みのためスキップします'); return; } // 処理開始フラグを設定 if(!window.aqur) window.aqur = {}; window.aqur.conversionProcessed = true; const target = document.querySelector('.chatform_widget'); const order_id = event.data.order_id const orderId = event.data.orderId var param={ event: "chatform_bindFormConversion", order_id:order_id } target.contentWindow.postMessage(param, "*"); // 名寄せエラーが発生していた場合の特別処理 if(window.aqur && window.aqur.alreadyPurchasedError){ // 名寄せ購入完了時のリダイレクト var redirectUrl = window.location.href.includes('rc') ? url_thanks_rc : url_thanks_upsell; setTimeout(() => { window.location.href = redirectUrl; }, 2000); return; // 通常の処理をスキップ } // 1回目購入完了時dataLayerに追加 window.dataLayer = window.dataLayer || []; window.dataLayer.push({'event': 'buy_mori_coffee'}); // 通常の処理(名寄せエラーが発生していない場合) // クエリパラメータの値を取得する関数 function getQueryParam(param) { var urlParams = new URLSearchParams(window.location.search); return urlParams.get(param) || ''; } // タグ発火処理 // r_ad=gdnの場合のGoogle Adsタグ if(getQueryParam('r_ad') === 'gdn'){ if(typeof gtag !== 'undefined'){ gtag('event', 'conversion', { 'send_to': 'AW-11327206681/u4zyCOTgu-AYEJnqnZkq', 'value': 10000.0, 'currency': 'JPY', 'transaction_id': orderId }); gtag('event', 'conversion', { 'send_to': 'AW-16804696386/Rnj3CKrpifUZEMKijc0-', 'value': 10000.0, 'currency': 'JPY', 'transaction_id': orderId }); } } // Smartnews Adsタグ(URL条件無し) (function(){ try { var SmartnewsAds = { 'id' : '1bdlyi', 'event' : '' }; var script = document.createElement('script'); script.src = '//api.smartnews-ads.com/assets/conv.js?' + (new Date()).getTime(); script.type = 'text/javascript'; script.id = '_smartnews_ads_conversion_script_' + SmartnewsAds['id']; script.setAttribute('data-smartnews-ads', JSON.stringify(SmartnewsAds)); (document.body||document.head).appendChild(script); } catch (e) {} })(); // テンプレート var template = `https://www.sukkiri-life.com/lp/qua_thanks_ac_rc_mn/?upsell=0&order_id={{orderId}}&price={{order_sub_total}}&r_ad={{r_ad}}{{sb_tracking}}{{gclid}}{{wbraid}}{{gbraid}}{{yclid}}{{fbclid}}{{ldtag_cl}}{{msclkid}}`; // SquadBeyondのクエリパラメータを取得 var rc_tmp_sb1 = getQueryParam('squadbeyond_uid'); var rc_tmp_sb2 = getQueryParam('sb_article_uid'); // SquadBeyondのパラメータがある場合の処理 var sb_tracking = ''; if (rc_tmp_sb1 && rc_tmp_sb2) { sb_tracking = '&sb_tracking=true&squadbeyond_uid=' + rc_tmp_sb1 + '&sb_article_uid=' + rc_tmp_sb2; } // render関数でテンプレートを置き換え var rc_next_url = render(template, { orderId: orderId, order_sub_total: getQueryParam('order_sub_total'), r_ad: getQueryParam('r_ad'), sb_tracking: sb_tracking, gclid: getQueryParam('gclid') ? '&gclid=' + getQueryParam('gclid') : '', wbraid: getQueryParam('wbraid') ? '&wbraid=' + getQueryParam('wbraid') : '', gbraid: getQueryParam('gbraid') ? '&gbraid=' + getQueryParam('gbraid') : '', yclid: getQueryParam('yclid') ? '&yclid=' + getQueryParam('yclid') : '', fbclid: getQueryParam('fbclid') ? '&fbclid=' + getQueryParam('fbclid') : '', ldtag_cl: getQueryParam('ldtag_cl') ? '&ldtag_cl=' + getQueryParam('ldtag_cl') : '', msclkid: getQueryParam('msclkid') ? '&msclkid=' + getQueryParam('msclkid') : '' }); console.log(rc_next_url) //R社用特別Whitepage url_thanks_normal = rc_next_url var ifrm = document.createElement("iframe"); ifrm.setAttribute("src", url_thanks_normal); ifrm.style.width = "0px"; ifrm.style.height = "0px"; document.body.appendChild(ifrm); } //アップセル注文成功時 if(event.data.event == "chatform_bindUpsellConversion"){ //console.log("chatform_bindFormErrorFound") const target = document.querySelector('.chatform_widget'); var param2={ event: "chatform_bindUpsellConversion" } target.contentWindow.postMessage(param2, "*"); setTimeout(() => { // location.hrefにrcが含まれているかチェック const redirectUrl = window.location.href.includes('rc') ? url_thanks_upsell_rc : url_thanks_upsell; window.location.href = redirectUrl; }, 2000); } //アップセル確定ボタンをクリック if(event.data.event == "chatform_bindFormUpcellComplete"){ //console.log("chatform_bindCheck",event.data) var param={ event: "chatform_bindFormUpcellComplete" } vframe.contentWindow.postMessage(param, "*"); } //名寄せ確認時 if(event.data.event == "already_purchased"){ //console.log("chatform already_purchased") const target = document.querySelector('.chatform_widget'); var param={ event: "already_purchased", message:event.data.message } target.contentWindow.postMessage(param, "*"); // 名寄せエラーが発生したことを記録 window.aqur.alreadyPurchasedError = true; } //自動遷移 if(event.data.event == "chatform_endupTimer"){ //window.location.href = url_thanks_normal; } window.aqur.bind(event) },false) function createAqurBinding(){ //console.log("AqurBindingCreated") //aqur bind start window.aqur = {} window.aqur.debug = false; window.aqur.save = (key, value) => { window.aqur[key] = value; } window.aqur.reset = () => { //console.log("do reset",window.aqur) window.aqur.setLastName(window.aqur.LastName) window.aqur.setFirstName(window.aqur.FirstName) window.aqur.setLastNameKana(window.aqur.LastNameKana) window.aqur.setFirstNameKana(window.aqur.FirstNameKana) window.aqur.setTel(window.aqur.Tel) window.aqur.setEmail(window.aqur.Email) window.aqur.setBirthdayYear(window.aqur.Year) window.aqur.setBirthdayMonth(window.aqur.Month) window.aqur.setBirthdayDay(window.aqur.Day) } window.aqur.bind = (event) => { //console.log("waq",event.data.event) if(event.data.track){ var track = { pid:event.data.track.pid, sid:event.data.track.sid, uuId:event.data.track.uuId, customId:"conversion" } window.aqur.setTrack(track); window.aqur.save("Track", track); } if (event.data.event == "name") { var FullName = event.data.value.values[0].value + event.data.value.values[1].value + event.data.value.values[2].value + event.data.value.values[3].value if(FullName!=window.aqur.FullName){ window.aqur.setLastName(event.data.value.values[0].value) window.aqur.setFirstName(event.data.value.values[1].value) window.aqur.setLastNameKana(event.data.value.values[2].value) window.aqur.setFirstNameKana(event.data.value.values[3].value) window.aqur.save("LastName", event.data.value.values[0].value) window.aqur.save("FirstName", event.data.value.values[1].value) window.aqur.save("LastNameKana", event.data.value.values[2].value) window.aqur.save("FirstNameKana", event.data.value.values[3].value) window.aqur.save("FullName", event.data.value.values[0].value + event.data.value.values[1].value + event.data.value.values[2].value + event.data.value.values[3].value ) } } if (event.data.event == "gender") { var item = window.aqur.getCheckedOptionSA(event.data.value.options) if(item){ window.aqur.setGender(item.value) window.aqur.save("Gender", item.value) } } if (event.data.event == "birthday") { window.aqur.setBirthdayYear(Number(event.data.value.values[0].value)) window.aqur.setBirthdayMonth(Number(event.data.value.values[1].value)) window.aqur.setBirthdayDay(Number(event.data.value.values[2].value)) window.aqur.save("Year", event.data.value.values[0].value) window.aqur.save("Month", event.data.value.values[1].value) window.aqur.save("Day", event.data.value.values[2].value) } if (event.data.event == "tel") { window.aqur.setTel(event.data.value.values[0].value) window.aqur.save("Tel", event.data.value.values[0].value) } if (event.data.event == "email") { window.aqur.setEmail(event.data.value.values[0].value) window.aqur.save("Email", event.data.value.values[0].value) } if (event.data.event == "address") { var FullAddress = event.data.value.values[0].value + event.data.value.values[1].value + event.data.value.values[2].value + event.data.value.values[3].value + event.data.value.values[4].value; if(FullAddress!=window.aqur.FullAddress){ if (window.aqur.PostalCode !== event.data.value.values[0].value) { window.aqur.setPostalCode(event.data.value.values[0].value) } if (window.aqur.Pref !== event.data.value.values[1].value) { window.aqur.setPref(event.data.value.values[1].value) } if (window.aqur.City !== event.data.value.values[2].value) { window.aqur.setCity(event.data.value.values[2].value) } if (window.aqur.Street !== event.data.value.values[3].value) { window.aqur.setStreet(event.data.value.values[3].value) } if (window.aqur.Building !== event.data.value.values[4].value) { window.aqur.setBuilding(event.data.value.values[4].value) } window.aqur.save("PostalCode", event.data.value.values[0].value) window.aqur.save("Pref", event.data.value.values[1].value) window.aqur.save("City", event.data.value.values[2].value) window.aqur.save("Street", event.data.value.values[3].value.replace(/[−ー―‐-〜]/g, '-')) window.aqur.save("Building", event.data.value.values[4].value.replace(/[−ー―‐-〜]/g, '-')) window.aqur.save("FullAddress", event.data.value.values[0].value + event.data.value.values[1].value + event.data.value.values[2].value + event.data.value.values[3].value + event.data.value.values[4].value ) } } if (event.data.event == "payment") { var item = window.aqur.getCheckedOptionSA(event.data.value.options) if(item){ if (window.aqur.PaymentMethod !== item.value) { window.aqur.setPaymentMethod(item.value) } window.aqur.save("PaymentMethod", item.value) } } if (event.data.event == "cc") { window.aqur.setCardNumber(event.data.value.values[0].value) window.aqur.setCardExpirationYear(event.data.value.values[1].value) window.aqur.setCardExpirationMonth(event.data.value.values[2].value) window.aqur.setCardCvc(event.data.value.values[3].value) window.aqur.setCardHolderName(event.data.value.values[4].value) window.aqur.save("CardNumber", event.data.value.values[0].value) window.aqur.save("CardExpirationYear", event.data.value.values[1].value) window.aqur.save("CardExpirationMonth", event.data.value.values[2].value) window.aqur.save("CardExpirationCvc", event.data.value.values[3].value) window.aqur.save("CardExpirationHolderName", event.data.value.values[4].value) } } window.aqur.setTrack = (value) => { window.aqur.debug && console.log("debug setTrack"); localStorage.setItem('chatform', JSON.stringify(value)); } window.aqur.setLastName = (value) => { window.aqur.debug && console.log("debug setLastName", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setLastName",value:value}, "*"); } } window.aqur.setFirstName = (value) => { window.aqur.debug && console.log("debug setFirstName", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setFirstName",value:value}, "*"); } } window.aqur.setLastNameKana = (value) => { window.aqur.debug && console.log("debug setLastNameKana", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setLastNameKana",value:value}, "*"); } } window.aqur.setFirstNameKana = (value) => { window.aqur.debug && console.log("debug setFirstNameKana", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setFirstNameKana",value:value}, "*"); } } window.aqur.setBirthdayYear = (value) => { window.aqur.debug && console.log("debug setBirthdayYear", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setBirthdayYear",value:value}, "*"); } } window.aqur.setBirthdayMonth = (value) => { window.aqur.debug && console.log("debug setBirthdayMonth", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setBirthdayMonth",value:value}, "*"); } } window.aqur.setBirthdayDay = (value) => { window.aqur.debug && console.log("debug setBirthdayDay", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setBirthdayDay",value:value}, "*"); } } window.aqur.setGender = (value) => { window.aqur.debug && console.log("debug setGender", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setGender",value:value}, "*"); } } window.aqur.setTel = (value) => { window.aqur.debug && console.log("debug setTel", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setTel",value:value}, "*"); } } window.aqur.setEmail = (value) => { window.aqur.debug && console.log("debug setEmail", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setEmail",value:value}, "*"); } } window.aqur.setPostalCode = (value) => { window.aqur.debug && console.log("debug setPostalCode", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setPostalCode",value:value}, "*"); } } window.aqur.setPref = (value) => { window.aqur.debug && console.log("debug setPref", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setPref",value:value}, "*"); } } window.aqur.setCity = (value) => { window.aqur.debug && console.log("debug setCity", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setCity",value:value}, "*"); } } window.aqur.setStreet = (value) => { window.aqur.debug && console.log("debug setStreet", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setStreet",value:value}, "*"); } } window.aqur.setBuilding = (value) => { window.aqur.debug && console.log("debug setBuilding", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setBuilding",value:value}, "*"); } } window.aqur.setPaymentMethod = (value) => { window.aqur.debug && console.log("debug setPaymentMethod", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setPaymentMethod",value:value}, "*"); } } window.aqur.setCardNumber = (value) => { window.aqur.debug && console.log("debug setCardNumber", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setCardNumber",value:value}, "*"); } } window.aqur.setCardHolderName = (value) => { window.aqur.debug && console.log("debug setCardHolderName", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setCardHolderName",value:value}, "*"); } } window.aqur.setCardCvc = (value) => { window.aqur.debug && console.log("debug setCardCvc", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setCardCvc",value:value}, "*"); } } window.aqur.setCardExpirationYear = (value) => { window.aqur.debug && console.log("debug setCardExpirationYear", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setCardExpirationYear",value:value}, "*"); } } window.aqur.setCardExpirationMonth = (value) => { window.aqur.debug && console.log("debug setCardExpirationMonth", value); if(value&&window.aqur.vframe){ window.aqur.vframe.contentWindow.postMessage({ event: "setCardExpirationMonth",value:value}, "*"); } } //Helper Method window.aqur.getCheckedOptionSA = (options) => { var rtn = options.find((v) => v.checked) return rtn } window.aqur.getCheckedOptionMA = (options) => { var checkedOptions = options.filter((v) => v.checked); var rtn = checkedOptions.map((v) => v.value); return rtn.join(", "); } } } setTimeout(take, 0); }())