// 1. Create the container var qc_container = document.createElement( 'div' ); qc_container.id = 'qc-container'; document.body.appendChild( qc_container ); var widget_script = ''; var origin_url = window.document.location.origin; // 2. Create a iframe to load the react App var qc_iframe = document.createElement( 'iframe' ); qc_iframe.id = 'qc-frame'; // position: fixed; remove a white space which was added at the bottom of the page qc_iframe.style.position = 'fixed'; // Cannot use display: none; otherwise the autogrow textarea will not work qc_iframe.style.visibility = 'hidden'; document.body.appendChild( qc_iframe ); qc_iframe.contentWindow.document.write( '' + widget_script + '' ); qc_iframe.contentWindow.document.close(); qc_iframe.contentWindow.context = { baseUrl: 'https://onelocal.com', environment: 'production', merchantId: '63c036b3d204e0aea9861dd1', merchantName: 'Total Rehabilitation and Sports Injuries Clinic (Parent Account)', originUrl: origin_url, sentry: 'https://ec0b927b3ee742b1ac32f546edbe3cad@app.getsentry.com/20033', widgetSettings: {"hipaa_enabled":false,"auto_response":{"enabled":true,"text":"Hey! Thanks for texting Total Rehabilitation & Sports Injury Clinic. We'll get back to you as soon as we can."},"intro":{"enabled":true,"text":"Hi there! Send us a message if you want to know more about our service."},"message_form":{"name_optional":false,"title":"Message Us","text":"Send us a message and we will get back to you shortly by text message.","cta_text":"Send"},"mobile":{"call_cta_enabled":true,"title":"Contact Total Rehabilitation and Sports Injuries Clinic (Parent Account)","text":"How would you like to contact us?"},"style":{"primary_color":"#33acdb"},"chatbot":{"auto_load":true,"enabled":false,"name":"SparkAI","intro":{"enabled":false,"text":"Have a question? Ask our chatbot, SparkAI"}},"locations":[{"id":"67e2acb179d9f9503c67cfc5","name":"Total Rehabilitation and Sports Injuries Clinic (Nassau St N)","phone_number":{"national_format":"(431) 831-3672","value":"+14318313672"},"call_phone_number":null,"enabled":true,"mobile":{"call_cta_enabled":false,"text":"How would you like to contact us?","title":"Contact Total Rehabilitation and Sports Injuries Clinic (Nassau St N)"}},{"id":"67e2ad2779d9f9503c67cff6","name":"Total Rehabilitation and Sports Injuries Clinic (Provencher)","phone_number":{"national_format":"(431) 814-5622","value":"+14318145622"},"call_phone_number":null,"enabled":true,"mobile":{"call_cta_enabled":false,"text":"How would you like to contact us?","title":"Contact Total Rehabilitation and Sports Injuries Clinic (Provencher)"}}],"phone_number":{"national_format":"(431) 816-3381","value":"+14318163381"},"location_selection":{"title":"Location Selection","text":"Select the location which you would like to contact","skip_text":"Skip","is_optional":false},"confirmation":{"title":"Thanks for your message","text":"We will follow up with you shortly by text message."}} }; window.addEventListener( "message", ( event ) => { if( event.origin.indexOf( origin_url ) === -1 || ! event.data?.event_name ) { return; } if( typeof gtag !== "undefined" ) { gtag( "event", event.data.event_name, { name: event.data.event_name } ); } }, false );