<?php
namespace NeoDrawFull\NeoDraw; if (!defined("ABSPATH")) { die("neoWP direct access not allowed"); }




\NeoDrawFull\NeoGlobal\register_backend_page("neo-draw--icon-library", fn () => \NeoDrawFull\NeoGlobal\current_user_can__neo_draw(), function () {
    ?>
    <html>
    <head>
        <title>Add Library</title>
        <script type="module">
            import { domLoaded } from "<?php echo esc_url(\NeoDrawFull\NeoGlobal\plugin_url()) ?>/_global--observer.js";






            const channel = new BroadcastChannel("neo-draw--iframe");

            channel.addEventListener("message", (event) => {
                if (event.data.action === "addLibraryConfirm") {
                    window.close();
                }
            });

            domLoaded(() => {
                channel.postMessage({
                    action: "addLibrary",
                    hash: location.hash
                });
            });
        </script>
    </head>

    <body>
        Adding the library...
    </body>

    </html>
<?php });
