How to hide chat widget when agents are offline?

If you want to hide the widget automatically when all agents are offline, go to Manage section >> click Chat Status. 

Toggle ON the option "Hide widget when no agents are available".

Now, the chat widget will be hidden when all agents are offline. 

If you want to show the "Leave us a Message" form to your visitors when all agents are offline, just Toggle OFF the above option.