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d,GAA8B,oBAAX,SACtB,OAAO,iBAAmB,EACtB,OAAO,6BACV,OAAO,2BAA2B,SAAW,IApQjD,SAAoB,EAAY,GAE/B,GAAI,OAAO,OACV,OAOD,GADuB,SAAS,cAAc,2BAE7C,OAGD,MAAM,EAAS,SAAS,cAAc,UACtC,EAAO,IAAM,EAGb,SAAS,KAAK,YAAY,EAC3B,CAoPE,EApRwB,EAoRI,EAAO,QAlRhC,EAAW,WAAW,QAAgB,EACnC,yCAAyC,oBAFxB,EAmRoB,EAG5C,EACD,CACA,CA1hBD","file":"/npm/mnfst@0.5.58/lib/manifest.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/mnfst@0.5.58/lib/manifest.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*  Manifest JS\n/*  By Andrew Matlock under MIT license\n/*  https://manifestjs.org\n/*\n/*  Lightweight loader that dynamically loads Alpine.js and Manifest plugins\n/*  from jsDelivr CDN. Loads all plugins by default, or a subset if specified.\n/*\n/*  Some plugins use Manifest CSS styles.\n*/\n\n(function () {\n\t'use strict';\n\n\t/*\n\t * Hydration contract runtime\n\t * --------------------------\n\t * Prerendered MPA pages carry a `<script type=\"application/json\"\n\t * id=\"__manifest_hydrate__\">` blob containing the source-authored\n\t * attributes (and, for explicit `data-hydrate` subtrees, the source\n\t * innerHTML) of every element that needs runtime hydration.  This\n\t * function runs once on page load BEFORE any plugin or Alpine starts —\n\t * it walks the contract, restores source state, and removes its own\n\t * markers.  Every downstream plugin (themes, router, data, markdown,\n\t * icons, …) then sees exactly the DOM the user authored, exactly as it\n\t * would in a live SPA.  No plugin needs a \"prerender mode\" branch.\n\t *\n\t * Implementation notes:\n\t *  - We use a temp-div HTML parse to set attributes because `setAttribute`\n\t *    throws InvalidCharacterError on Alpine special names like `@click`.\n\t *    The HTML parser is lenient and accepts them.\n\t *  - The contract is a compact diff: only attributes whose values drifted\n\t *    from source during prerender appear.  An entry's `attrs` object maps\n\t *    attribute name -> source value, or null to mean \"remove\".\n\t */\n\tfunction hydratePrerenderedPage() {\n\t\tif (typeof document === 'undefined' || !document.querySelector) return;\n\t\t// Only run on pages the prerender marked as static MPA output.\n\t\tconst prerenderMeta = document.querySelector('meta[name=\"manifest:prerendered\"]');\n\t\tif (!prerenderMeta || prerenderMeta.getAttribute('content') === '0') return;\n\t\tconst blob = document.getElementById('__manifest_hydrate__');\n\t\tif (!blob) return;\n\t\tlet entries;\n\t\ttry {\n\t\t\tentries = JSON.parse(blob.textContent || '[]');\n\t\t} catch (_) {\n\t\t\tentries = [];\n\t\t}\n\t\tif (!Array.isArray(entries) || entries.length === 0) {\n\t\t\tblob.remove();\n\t\t\treturn;\n\t\t}\n\t\tconst escAttr = (s) => String(s == null ? '' : s)\n\t\t\t.replace(/&/g, '&amp;')\n\t\t\t.replace(/\"/g, '&quot;');\n\t\tconst voidEls = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']);\n\n\t\t// Restore deepest-first so that when an ancestor rebuilds its innerHTML,\n\t\t// its children have already been restored and their source state is what\n\t\t// the ancestor captures.\n\t\tconst items = [];\n\t\tfor (const entry of entries) {\n\t\t\tconst el = document.querySelector('[data-hydrate-id=\"' + entry.id + '\"]');\n\t\t\tif (!el) continue;\n\t\t\tlet depth = 0;\n\t\t\tfor (let p = el.parentNode; p; p = p.parentNode) depth++;\n\t\t\titems.push({ entry, el, depth });\n\t\t}\n\t\titems.sort((a, b) => b.depth - a.depth);\n\n\t\tfor (const { entry, el: initialEl } of items) {\n\t\t\tconst el = document.querySelector('[data-hydrate-id=\"' + entry.id + '\"]') || initialEl;\n\t\t\tif (!el || !el.parentNode) continue;\n\n\t\t\t// Case 1: explicit subtree restoration (entry.html present).\n\t\t\t// Rebuild the element from scratch via outerHTML replacement so the\n\t\t\t// entire subtree mirrors the authored source.\n\t\t\tif (typeof entry.html === 'string') {\n\t\t\t\tconst tag = el.tagName.toLowerCase();\n\t\t\t\tconst finalAttrs = {};\n\t\t\t\t// Start from current attrs, then apply the contract diff.\n\t\t\t\tconst cur = el.attributes;\n\t\t\t\tfor (let i = 0; i < cur.length; i++) {\n\t\t\t\t\tif (cur[i].name !== 'data-hydrate-id') finalAttrs[cur[i].name] = cur[i].value;\n\t\t\t\t}\n\t\t\t\tif (entry.attrs) {\n\t\t\t\t\tfor (const name in entry.attrs) {\n\t\t\t\t\t\tconst v = entry.attrs[name];\n\t\t\t\t\t\tif (v === null) delete finalAttrs[name];\n\t\t\t\t\t\telse finalAttrs[name] = v;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst attrString = Object.keys(finalAttrs)\n\t\t\t\t\t.map((n) => n + '=\"' + escAttr(finalAttrs[n]) + '\"')\n\t\t\t\t\t.join(' ');\n\t\t\t\tconst isVoid = voidEls.has(tag);\n\t\t\t\tconst newHTML = isVoid\n\t\t\t\t\t? '<' + tag + ' ' + attrString + '>'\n\t\t\t\t\t: '<' + tag + ' ' + attrString + '>' + entry.html + '</' + tag + '>';\n\t\t\t\tconst tmp = document.createElement('div');\n\t\t\t\ttmp.innerHTML = newHTML;\n\t\t\t\tconst parsed = tmp.firstElementChild;\n\t\t\t\tif (parsed) {\n\t\t\t\t\ttry { el.parentNode.replaceChild(parsed, el); } catch (_) {}\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Case 2: attribute-only diff.  Reparse the element with the merged\n\t\t\t// attribute set (current attrs overlaid by source diff) so that\n\t\t\t// special-name attributes like @click work.  Preserve innerHTML.\n\t\t\tif (!entry.attrs) continue;\n\t\t\tconst tag = el.tagName.toLowerCase();\n\t\t\tconst finalAttrs = {};\n\t\t\tconst cur = el.attributes;\n\t\t\tfor (let i = 0; i < cur.length; i++) {\n\t\t\t\tif (cur[i].name !== 'data-hydrate-id') finalAttrs[cur[i].name] = cur[i].value;\n\t\t\t}\n\t\t\tfor (const name in entry.attrs) {\n\t\t\t\tconst v = entry.attrs[name];\n\t\t\t\tif (v === null) delete finalAttrs[name];\n\t\t\t\telse finalAttrs[name] = v;\n\t\t\t}\n\t\t\tconst attrString = Object.keys(finalAttrs)\n\t\t\t\t.map((n) => n + '=\"' + escAttr(finalAttrs[n]) + '\"')\n\t\t\t\t.join(' ');\n\t\t\tconst isVoid = voidEls.has(tag);\n\t\t\tconst innerHTML = isVoid ? '' : el.innerHTML;\n\t\t\tconst newHTML = isVoid\n\t\t\t\t? '<' + tag + ' ' + attrString + '>'\n\t\t\t\t: '<' + tag + ' ' + attrString + '>' + innerHTML + '</' + tag + '>';\n\t\t\tconst tmp = document.createElement('div');\n\t\t\ttmp.innerHTML = newHTML;\n\t\t\tconst parsed = tmp.firstElementChild;\n\t\t\tif (parsed) {\n\t\t\t\ttry { el.parentNode.replaceChild(parsed, el); } catch (_) {}\n\t\t\t}\n\t\t}\n\n\t\tblob.remove();\n\t}\n\n\t// Run hydration BEFORE Alpine's deferred script executes.\n\t//\n\t// Timing: `<script defer>` runs AFTER HTML parsing finishes but BEFORE\n\t// `DOMContentLoaded` fires.  So listening for DOMContentLoaded is too late —\n\t// Alpine has already walked the tree and attached directives by then, and\n\t// our `replaceChild`-based restore would destroy the Alpine-bound nodes.\n\t//\n\t// The only earlier hook is `readystatechange → 'interactive'`, which is\n\t// dispatched the moment the parser finishes and BEFORE deferred scripts run.\n\t// We also run synchronously if readyState is already 'interactive' or later\n\t// (e.g. if manifest.js was injected dynamically after page load).\n\tfunction tryHydrate() {\n\t\ttry { hydratePrerenderedPage(); } catch (e) { /* graceful */ }\n\t}\n\tif (typeof document !== 'undefined') {\n\t\tif (document.readyState === 'loading') {\n\t\t\t// We're still parsing.  Listen for 'interactive' via readystatechange\n\t\t\t// — this is the earliest moment document.body is guaranteed to exist\n\t\t\t// but deferred scripts haven't run yet.\n\t\t\tlet hydrated = false;\n\t\t\tdocument.addEventListener('readystatechange', () => {\n\t\t\t\tif (!hydrated && document.readyState !== 'loading') {\n\t\t\t\t\thydrated = true;\n\t\t\t\t\ttryHydrate();\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\t// Parser already done (interactive or complete).  Hydrate immediately.\n\t\t\ttryHydrate();\n\t\t}\n\t}\n\n\t// Configuration\n\tconst DEFAULT_VERSION = 'latest';\n\tconst ALPINE_CDN_URL = 'https://cdn.jsdelivr.net/npm/alpinejs@3/dist/cdn.min.js';\n\n\t// Get base URL for a given version\n\tfunction getBaseUrl(version = DEFAULT_VERSION) {\n\t\treturn `https://cdn.jsdelivr.net/npm/mnfst@${version}/lib`;\n\t}\n\n\t// Available core plugins (auto-loaded if no data-plugins specified)\n\tconst AVAILABLE_PLUGINS = [\n\t\t'components',\n\t\t'router',\n\t\t'utilities',\n\t\t'data',\n\t\t'icons',\n\t\t'localization',\n\t\t'markdown',\n\t\t'svg',\n\t\t'code',\n\t\t'themes',\n\t\t'toasts',\n\t\t'tooltips',\n\t\t'dropdowns',\n\t\t'tabs',\n\t\t'slides',\n\t\t'resize',\n\t\t'colorpicker'\n\t];\n\n\t// Appwrite integration plugins (opt-in only, never auto-loaded)\n\tconst APPWRITE_PLUGINS = [\n\t\t'appwrite-auth',\n\t\t'appwrite-data',\n\t\t'appwrite-presence'\n\t];\n\n\t// Plugin dependencies: plugins that require other plugins to be loaded first\n\tconst PLUGIN_DEPENDENCIES = {\n\t\t'appwrite-data': ['data'],\n\t\t'appwrite-presence': ['data']\n\t};\n\n\t// Derive default plugin list from manifest (only load data/localization/components when manifest needs them)\n\tfunction getDefaultPluginsFromManifest(manifest) {\n\t\tif (!manifest || typeof manifest !== 'object') {\n\t\t\treturn AVAILABLE_PLUGINS.slice();\n\t\t}\n\t\tconst hasData = manifest.data && typeof manifest.data === 'object' && Object.keys(manifest.data).length > 0;\n\t\tconst hasComponents = (manifest.components?.length > 0) || (manifest.preloadedComponents?.length > 0);\n\t\tconst hasLocalization = (() => {\n\t\t\tif (!manifest.data || typeof manifest.data !== 'object') return false;\n\t\t\tfor (const collection of Object.values(manifest.data)) {\n\t\t\t\tif (!collection || typeof collection !== 'object') continue;\n\t\t\t\tif (typeof collection.locales === 'string') return true;\n\t\t\t\tfor (const key of Object.keys(collection)) {\n\t\t\t\t\tif (['url', 'headers', 'params', 'transform', 'defaultValue', 'locales'].includes(key)) continue;\n\t\t\t\t\tif (/^[a-zA-Z]{2}(-[a-zA-Z]{2})?$/.test(key)) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t})();\n\t\treturn AVAILABLE_PLUGINS.filter(p => {\n\t\t\tif (p === 'data') return hasData;\n\t\t\tif (p === 'localization') return hasLocalization;\n\t\t\tif (p === 'components') return hasComponents;\n\t\t\treturn true;\n\t\t});\n\t}\n\n\t// Get plugin URL from CDN or the `data-plugin-base` override.  When the\n\t// loader's <script> tag carries `data-plugin-base=\"/scripts\"` (or an\n\t// absolute URL), plugins are loaded from that base as unminified `.js`\n\t// files.  Otherwise they come from the jsDelivr CDN as `.min.js`.\n\tlet _pluginBase = null;\n\tfunction setPluginBase(b) { _pluginBase = b || null; }\n\tfunction getPluginUrl(pluginName, version = DEFAULT_VERSION) {\n\t\tif (_pluginBase) {\n\t\t\tconst base = _pluginBase.replace(/\\/$/, '');\n\t\t\tif (pluginName.startsWith('appwrite-')) {\n\t\t\t\tconst appwriteName = pluginName.replace('appwrite-', 'appwrite.');\n\t\t\t\treturn `${base}/manifest.${appwriteName}.js`;\n\t\t\t}\n\t\t\treturn `${base}/manifest.${pluginName}.js`;\n\t\t}\n\t\tconst base = getBaseUrl(version);\n\t\tif (pluginName.startsWith('appwrite-')) {\n\t\t\tconst appwriteName = pluginName.replace('appwrite-', 'appwrite.');\n\t\t\treturn `${base}/manifest.${appwriteName}.min.js`;\n\t\t}\n\t\treturn `${base}/manifest.${pluginName}.min.js`;\n\t}\n\n\t// Resolve Alpine CDN URL from a data-alpine value (version tag or full URL)\n\tfunction resolveAlpineUrl(dataAlpine) {\n\t\tif (!dataAlpine) return ALPINE_CDN_URL;\n\t\tif (dataAlpine.startsWith('http')) return dataAlpine;\n\t\treturn `https://cdn.jsdelivr.net/npm/alpinejs@${dataAlpine}/dist/cdn.min.js`;\n\t}\n\n\t// Load Alpine.js from CDN.  Called by the loader AFTER all plugin scripts\n\t// have finished loading and registered their directives/magics.  We do\n\t// NOT use `defer` here — defer fires at DOMContentLoaded, which may race\n\t// the plugin loads; instead we wait for every plugin script's load event\n\t// explicitly and then append Alpine synchronously (the script downloads\n\t// but Alpine's `auto-start` hooks DOMContentLoaded if still loading, or\n\t// runs immediately if past it).\n\tfunction loadAlpine(alpineUrl = ALPINE_CDN_URL) {\n\t\t// Fast check: Alpine already initialized\n\t\tif (window.Alpine) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Fallback: if an existing Alpine <script> tag is already in the DOM\n\t\t// (e.g. the fixture explicitly added one), wait for it — don't inject\n\t\t// a second copy.\n\t\tconst existingAlpine = document.querySelector('script[src*=\"alpinejs\"]');\n\t\tif (existingAlpine) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst script = document.createElement('script');\n\t\tscript.src = alpineUrl;\n\t\t// No `defer` — we're already past plugin registration, so Alpine\n\t\t// should load and execute as soon as it arrives.\n\t\tdocument.head.appendChild(script);\n\t}\n\n\t// Add a script tag to the head and wait for it to load and execute\n\tfunction addScript(pluginName, version = DEFAULT_VERSION) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst url = getPluginUrl(pluginName, version);\n\n\t\t\t// Skip if script with same src already in DOM (e.g. prerendered HTML or second loader run)\n\t\t\tconst existing = document.querySelector(`script[src=\"${url}\"]`);\n\t\t\tif (existing) {\n\t\t\t\tif (existing.complete) return resolve();\n\t\t\t\texisting.addEventListener('load', () => resolve());\n\t\t\t\texisting.addEventListener('error', () => reject(new Error(`Failed to load ${pluginName} from ${url}`)));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst script = document.createElement('script');\n\t\t\tscript.src = url;\n\t\t\tscript.async = false; // Ensure scripts execute in order\n\t\t\tscript.onload = () => resolve();\n\t\t\tscript.onerror = () => reject(new Error(`Failed to load ${pluginName} from ${url}`));\n\t\t\tdocument.head.appendChild(script);\n\t\t});\n\t}\n\n\t// Resolve plugin dependencies (auto-inject required dependencies)\n\tfunction resolveDependencies(pluginList) {\n\t\tconst resolved = [];\n\t\tconst added = new Set();\n\n\t\t// Helper to add a plugin and its dependencies in correct order\n\t\tfunction addPluginWithDeps(plugin) {\n\t\t\tif (added.has(plugin)) return;\n\n\t\t\t// First, add all dependencies\n\t\t\tconst deps = PLUGIN_DEPENDENCIES[plugin];\n\t\t\tif (deps) {\n\t\t\t\tfor (const dep of deps) {\n\t\t\t\t\tif (!added.has(dep)) {\n\t\t\t\t\t\taddPluginWithDeps(dep);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Then add the plugin itself\n\t\t\tresolved.push(plugin);\n\t\t\tadded.add(plugin);\n\t\t}\n\n\t\t// Process all plugins in order, ensuring dependencies come first\n\t\tfor (const plugin of pluginList) {\n\t\t\taddPluginWithDeps(plugin);\n\t\t}\n\n\t\treturn resolved;\n\t}\n\n\t// Detect Appwrite usage from manifest.json (non-blocking, just suggests)\n\tfunction detectAppwriteFromManifest() {\n\t\t// Check if manifest link exists\n\t\tconst manifestLink = document.querySelector('link[rel=\"manifest\"]');\n\t\tif (!manifestLink) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst manifestUrl = manifestLink.getAttribute('href') || '/manifest.json';\n\n\t\t// Fetch manifest asynchronously (don't block plugin loading)\n\t\tfetch(manifestUrl)\n\t\t\t.then(response => response.json())\n\t\t\t.then(manifest => {\n\t\t\t\tconst hasAppwrite = manifest.appwrite ||\n\t\t\t\t\t(manifest.data && Object.values(manifest.data).some(\n\t\t\t\t\t\titem => item && typeof item === 'object' &&\n\t\t\t\t\t\t\t(item.appwriteTableId || item.appwriteDatabaseId || item.appwriteBucketId)\n\t\t\t\t\t));\n\n\t\t\t\tif (hasAppwrite) {\n\t\t\t\t\tconst suggestedPlugins = [];\n\t\t\t\t\tif (manifest.appwrite?.auth) suggestedPlugins.push('appwrite-auth');\n\t\t\t\t\tif (manifest.appwrite || (manifest.data && Object.values(manifest.data).some(\n\t\t\t\t\t\titem => item && typeof item === 'object' && item.appwriteTableId\n\t\t\t\t\t))) {\n\t\t\t\t\t\tsuggestedPlugins.push('appwrite-data');\n\t\t\t\t\t}\n\t\t\t\t\tif (manifest.data?.presence?.appwriteTableId) {\n\t\t\t\t\t\tsuggestedPlugins.push('appwrite-presence');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\t\t\t.catch(() => {\n\t\t\t\t// Silently fail - manifest might not be available yet or CORS issue\n\t\t\t});\n\t}\n\n\t// Parse data attributes\n\tfunction parseDataAttributes() {\n\t\t// Try to get current script first, then fall back to querySelector\n\t\tlet script = document.currentScript;\n\t\tif (!script) {\n\t\t\t// Look for manifest.js script tag\n\t\t\tscript = document.querySelector('script[src*=\"manifest.js\"]');\n\t\t}\n\t\tif (!script) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst plugins = script.getAttribute('data-plugins');\n\t\tconst omit = script.getAttribute('data-omit');\n\t\tconst tailwind = script.getAttribute('data-tailwind') !== null;\n\t\tconst version = script.getAttribute('data-version') || DEFAULT_VERSION;\n\t\tconst alpine = script.getAttribute('data-alpine');\n\t\t// Optional override: when present, plugin URLs are resolved against\n\t\t// this base instead of the CDN.  Useful for self-hosted deployments\n\t\t// and for the e2e harness which needs to load locally-built plugins.\n\t\t// The base should point at a directory that serves `manifest.<name>.js`\n\t\t// files.  It can be relative (e.g. \"/scripts\") or absolute.\n\t\tconst pluginBase = script.getAttribute('data-plugin-base');\n\n\t\tlet pluginList = [];\n\t\tconst deriveFromManifest = !plugins;\n\n\t\tif (plugins) {\n\t\t\t// Explicit declaration - load only specified plugins (core + Appwrite)\n\t\t\tpluginList = plugins.split(',').map(p => p.trim()).filter(p => p);\n\t\t} else {\n\t\t\t// Default: start with all core plugins; loader will trim by manifest when manifest is available\n\t\t\tpluginList = AVAILABLE_PLUGINS.slice();\n\t\t}\n\n\t\t// Remove omitted plugins (supports both core and Appwrite plugins)\n\t\tif (omit && pluginList.length > 0) {\n\t\t\tconst omitted = omit.split(',').map(p => p.trim());\n\t\t\tpluginList = pluginList.filter(p => !omitted.includes(p));\n\t\t}\n\n\t\t// Resolve dependencies (auto-inject required plugins)\n\t\tpluginList = resolveDependencies(pluginList);\n\n\t\treturn {\n\t\t\tplugins: pluginList,\n\t\t\tderiveFromManifest,\n\t\t\ttailwind,\n\t\t\tversion,\n\t\t\talpine,\n\t\t\tpluginBase,\n\t\t};\n\t}\n\n\t// Load custom Tailwind CDN script\n\tfunction loadTailwind(version = DEFAULT_VERSION) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst base = getBaseUrl(version);\n\t\t\tconst tailwindUrl = `${base}/manifest.tailwind.min.js`;\n\n\t\t\t// Check if already loaded\n\t\t\tconst existing = document.querySelector(`script[src=\"${tailwindUrl}\"]`);\n\t\t\tif (existing && existing.complete) {\n\t\t\t\treturn resolve();\n\t\t\t}\n\n\t\t\tconst script = document.createElement('script');\n\t\t\tscript.src = tailwindUrl;\n\t\t\tscript.async = false;\n\t\t\tscript.onload = () => resolve();\n\t\t\tscript.onerror = () => {\n\t\t\t\tconsole.warn(`[Manifest Loader] Tailwind plugin not yet published to CDN. Load it directly: <script src=\"/scripts/tailwind.v4.1.js\"></script>`);\n\t\t\t\treject(new Error(`Tailwind plugin not available from CDN. Load it directly from your project.`));\n\t\t\t};\n\t\t\tdocument.head.appendChild(script);\n\t\t});\n\t}\n\n\t// Expose API\n\twindow.Manifest = {\n\t\tloadPlugin: function (pluginName, version = DEFAULT_VERSION) {\n\t\t\tconst allPlugins = [...AVAILABLE_PLUGINS, ...APPWRITE_PLUGINS];\n\t\t\tif (!allPlugins.includes(pluginName)) {\n\t\t\t\tconsole.warn(`[Manifest Loader] Unknown plugin: ${pluginName}`);\n\t\t\t\treturn Promise.reject(new Error(`Unknown plugin: ${pluginName}`));\n\t\t\t}\n\n\t\t\t// Resolve dependencies for single plugin load\n\t\t\tconst pluginList = resolveDependencies([pluginName]);\n\n\t\t\t// Load plugin and its dependencies\n\t\t\treturn Promise.all(pluginList.map(plugin => addScript(plugin, version)));\n\t\t},\n\t\tloadTailwind: loadTailwind,\n\t\tgetPluginUrl: getPluginUrl\n\t};\n\n\t// Parse config and load plugins\n\tconst config = parseDataAttributes();\n\tif (config && config.pluginBase) setPluginBase(config.pluginBase);\n\n\t// Detect Appwrite usage from manifest (non-blocking, just suggests)\n\tdetectAppwriteFromManifest();\n\n\tif (config && config.plugins.length > 0) {\n\t\tif (window.__manifestLoaderStarted) {\n\t\t\treturn;\n\t\t}\n\t\twindow.__manifestLoaderStarted = true;\n\n\t\tconst MANIFEST_DEPENDENT_PLUGINS = [\n\t\t\t'data', 'localization', 'components',\n\t\t\t'appwrite-auth', 'appwrite-data', 'appwrite-presence'\n\t\t];\n\t\tconst manifestUrl = (document.querySelector('link[rel=\"manifest\"]')?.getAttribute('href')) || '/manifest.json';\n\n\t\tconst loadPlugins = async () => {\n\t\t\tlet manifest = null;\n\t\t\tlet pluginsToLoad = config.plugins;\n\t\t\tlet manifestPromise = null;\n\n\t\t\tif (config.deriveFromManifest) {\n\t\t\t\tmanifest = await fetch(manifestUrl).then(r => r.ok ? r.json() : null).catch(() => null);\n\t\t\t\tpluginsToLoad = resolveDependencies(getDefaultPluginsFromManifest(manifest));\n\t\t\t} else {\n\t\t\t\tconst needsManifest = config.plugins.some(p => MANIFEST_DEPENDENT_PLUGINS.includes(p));\n\t\t\t\tif (needsManifest) {\n\t\t\t\t\tmanifestPromise = fetch(manifestUrl).then(r => r.ok ? r.json() : null).catch(() => null);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst pluginPromises = pluginsToLoad.map(pluginName => {\n\t\t\t\treturn addScript(pluginName, config.version).catch(error => {\n\t\t\t\t\tconsole.warn(`[Manifest Loader] Failed to load plugin ${pluginName}:`, error);\n\t\t\t\t});\n\t\t\t});\n\t\t\tif (config.tailwind) {\n\t\t\t\tpluginPromises.push(loadTailwind(config.version).catch(() => { }));\n\t\t\t}\n\t\t\tawait Promise.all(pluginPromises);\n\t\t\tif (manifestPromise) {\n\t\t\t\tmanifest = await manifestPromise;\n\t\t\t}\n\t\t\tif (manifest && typeof window !== 'undefined') {\n\t\t\t\twindow.__manifestLoaded = manifest;\n\t\t\t\tif (window.ManifestComponentsRegistry) {\n\t\t\t\t\twindow.ManifestComponentsRegistry.manifest = manifest;\n\t\t\t\t}\n\t\t\t}\n\t\t\tloadAlpine(resolveAlpineUrl(config.alpine));\n\t\t};\n\n\t\tloadPlugins();\n\t}\n})();\n"]}