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



// Autoloader for Web Components used in the plugin for scoping styles and scripts from the WordPress backend.







\NeoLibraryFull\NeoGlobal\add_action_hook("current_screen", function () {
    $web_components = [];
    foreach (\NeoLibraryFull\NeoGlobal\fs_glob(\NeoLibraryFull\NeoGlobal\plugin_path() . "/_global-web-component-*.js") ?: [] as $file) {
        $file = basename($file);
        if ($file === "_global-web-component-importer.js" || $file === "_global-web-component-importer.php") { continue; }
        $web_component_name = str_replace(["_global-web-component-", ".js"], ["", ""], $file);
        $web_component_name .= "-neo-library-full";
        $web_components[] = $web_component_name;
        \NeoLibraryFull\NeoGlobal\add_action_hook("admin_head", function () use ($web_component_name) {
            ?>
            <style id="<?php echo esc_attr("neo-web-component-hide-neo-library-full-$web_component_name") ?>">
                <?php echo esc_attr($web_component_name) ?> { <?php echo $web_component_name === "neo-info-tooltip-neo-library-full" ? "display: none;" : "visibility: hidden" ?> }
            </style><?php
        });
    }
    \NeoLibraryFull\NeoGlobal\enqueue_js_variable_backend("neoGlobalWebComponentImporterWebComponents", $web_components);
    \NeoLibraryFull\NeoGlobal\enqueue_js("_global-web-component-importer.js");
});
