import { route } from 'quasar/wrappers'; import { createMemoryHistory, createRouter, createWebHashHistory, createWebHistory, } from 'vue-router'; import routes from './routes'; /* * If not building with SSR mode, you can * directly export the Router instantiation; * * The function below can be async too; either use * async/await or return a Promise which resolves * with the Router instance. */ /** * Set by the [vtables] embed document (includes/Classes/Embed.php) — present * only inside the public iframe, never in wp-admin. */ interface EmbedContext { tableId: number; } /** Classes\Embed::QUERY_VAR — the plain-permalinks form of the embed URL. */ const EMBED_QUERY_VAR = 'vtables_embed'; function parseTableId(raw: unknown): EmbedContext | undefined { const tableId = Number(raw); return Number.isInteger(tableId) && tableId > 0 ? { tableId } : undefined; } /** * The table id, from whichever of the embed document's three carriers survived. * * The inline global alone was a single point of failure. That document is now * emitted by WordPress rather than served as a static file, so page optimisers * (WP Rocket, LiteSpeed, Autoptimize) get to rewrite it, and deferring or moving * inline