<!doctype html>
<html>
  <head>
		  </head>

  <body>
    
<script>
       var isAuth = false;
        window.isAuthenticated = isAuth ? 'True' : 'False';

        if (isAuth) {
            var detail = {};
            detail['value'] = {};
            detail['value']['_firstName'] = 'null';
            detail['value']['_lastName'] = 'null';
            detail['value']['_email'] = 'null';
            window.detail= detail;
        }
</script>
<script type='text/javascript'>
   function initEmbeddedMessaging() {
   	try {
                         delete Array.prototype.toJSON;
   		embeddedservice_bootstrap.settings.language = 'en_US'; // For example, enter 'en' or 'en-US'
              if(window.isAuthenticated == 'True'){
   window.addEventListener("onEmbeddedMessagingReady", () => {            
                      //console.log( "Inside Prechat API!!" );
                      embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields( { "isAuthenticated" : window.isAuthenticated } );  // use 
       embeddedservice_bootstrap.prechatAPI.setVisiblePrechatFields({
                      // List the pre-chat field names with the value and whether
                      // it's editable in the pre-chat form.
                      "_firstName": {
                          "value": window.detail.value._firstName,
                          "isEditableByEndUser": false
                      },
                      "_lastName": {
                          "value": window.detail.value._lastName,
                          "isEditableByEndUser": false
                      },
                      "_email": {
                          "value": (window.detail && window.detail.value && window.detail.value._email) ? window.window.detail.value._email : '',
                          "isEditableByEndUser": (window.detail && window.detail.value && window.detail.value._email) ? false : true
                      }
                  });                          
   });
   embeddedservice_bootstrap.init(
   			'00DDF00000XH4Ym',
				'Web_In_App_Messaging_for_Commerce_Cloud',
				'https://publicstorage--jbaldini.sandbox.my.site.com/ESWWebInAppMessagingf1681794698967',
				{
					scrt2URL: 'https://publicstorage--jbaldini.sandbox.my.salesforce-scrt.com'
				}
   		);
   }
   else { window.addEventListener("onEmbeddedMessagingReady", () => {            
   		console.log( "Inside Prechat API!!" );
   		embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields( { "isAuthenticated" : window.isAuthenticated } );  // use True or False 
   		});
   		embeddedservice_bootstrap.init(
'00DDF00000XH4Ym',
				'Web_In_App_Messaging_for_Commerce_Cloud',
				'https://publicstorage--jbaldini.sandbox.my.site.com/ESWWebInAppMessagingf1681794698967',
				{
					scrt2URL: 'https://publicstorage--jbaldini.sandbox.my.salesforce-scrt.com'
				}
   		);
   }
       } catch (err) {
   		console.error('Error loading Embedded Messaging: ', err);
   	}
   };
</script>
<script type='text/javascript' src='https://publicstorage--jbaldini.sandbox.my.site.com/ESWWebInAppMessagingf1681794698967/assets/js/bootstrap.min.js' onload='initEmbeddedMessaging()'></script>


<div class="error-messaging"></div>
<div class="modal-background"></div>

  </body>
</html>
/* Add your styles here */
.container{
  width: 100vw;
  margin: auto;
  padding: auto;
}


/* Try sothing like this */

/* .embeddedMessagingConversationButtonWrapper .embeddedMessagingConversationButton div[class="embeddedMessagingIconContainer"] > svg.embeddedMessagingIconChat {
   visibility: hidden;
}

.embeddedMessagingConversationButtonWrapper .embeddedMessagingConversationButton {
    background-image: url(https://images.publicstorage.com/Branding/logo-brand-crop.png?width=60&height=100) !important;
} */

[lwc-64un2jbuqj8-host] {
background-color: red !important;
}
// Add your code here

<script type='text/javascript'>
	function initEmbeddedMessaging() {
	    try {
	        embeddedservice_bootstrap.settings.language = 'en_US'; // For example, enter 'en' or 'en-US'

	        if (window.isAuthenticated == 'True') {

	            window.addEventListener("onEmbeddedMessagingReady", () => {
	                //console.log( "Inside Prechat API!!" );
                        embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields( { "isAuthenticated" : window.isAuthenticated } );  // use 

	                embeddedservice_bootstrap.prechatAPI.setVisiblePrechatFields({
	                    // List the pre-chat field names with the value and whether
	                    // it's editable in the pre-chat form.
	                    "_firstName": {
	                        "value": window.detail.value._firstName,
	                        "isEditableByEndUser": false
	                    },
	                    "_lastName": {
	                        "value": window.detail.value._lastName,
	                        "isEditableByEndUser": false
	                    },
	                    "_email": {
	                        "value": (window.detail && window.detail.value && window.detail.value._email) ? window.window.detail.value._email : '',
	                        "isEditableByEndUser": (window.detail && window.detail.value && window.detail.value._email) ? false : true
	                    }
	                });

	            });
	            embeddedservice_bootstrap.init(
				'00DU9000002mZOv',
				'Web_In_App_Messaging_for_Commerce_Cloud',
				'https://publicstorage--jbaldini.sandbox.my.site.com/ESWWebInAppMessagingf1681794698967',
				{
					scrt2URL: 'https://publicstorage--jbaldini.sandbox.my.salesforce-scrt.com'
				}
			);

	        } else {
				
	            window.addEventListener("onEmbeddedMessagingReady", () => {
	                // console.log( "Inside Prechat API!!" );
	                embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields({
	                    "isAuthenticated": window.isAuthenticated
	                }); // use True or False 
	            });
	            embeddedservice_bootstrap.init(
				'00DU9000002mZOv',
				'Web_In_App_Messaging_for_Commerce_Cloud',
				'https://publicstorage--jbaldini.sandbox.my.site.com/ESWWebInAppMessagingf1681794698967',
				{
					scrt2URL: 'https://publicstorage--jbaldini.sandbox.my.salesforce-scrt.com'
				}
			);
	        }

	    } catch (err) {
	        console.error('Error loading Embedded Messaging: ', err);
	    }
	};
</script>
<script type='text/javascript' src='https://publicstorage--jbaldini.sandbox.my.site.com/ESWWebInAppMessagingf1681794698967/assets/js/bootstrap.min.js' onload='initEmbeddedMessaging()'></script>