/**
 * Editor registration for the wrenchpress/visit-form dynamic block.
 *
 * Hand-written, build-free script. It registers the block client-side so it
 * appears in the inserter, and uses the core ServerSideRender component for the
 * editor preview so the editor shows the exact same PHP-rendered form as the
 * front end. The block is server-rendered, so save returns null and the markup
 * comes from the PHP render_callback at display time.
 *
 * APIs are pulled off the global wp object (no JSX, no import, no bundler).
 * Title, icon, category, and keywords come from block.json.
 */
( function ( wp ) {
	var registerBlockType = wp.blocks.registerBlockType;
	var ServerSideRender = wp.serverSideRender;
	var createElement = wp.element.createElement;

	registerBlockType( 'wrenchpress/visit-form', {
		edit: function () {
			return createElement( ServerSideRender, {
				block: 'wrenchpress/visit-form'
			} );
		},
		save: function () {
			return null;
		}
	} );
} )( window.wp );
