1"use strict";
2var __importDefault = (this && this.__importDefault) || function (mod) {
3    return (mod && mod.__esModule) ? mod : { "default": mod };
4};
5Object.defineProperty(exports, "__esModule", { value: true });
6const qs_1 = __importDefault(require("qs"));
7const getDevServer = () => {
8    // Disable for SSR
9    if (typeof window === 'undefined') {
10        return {
11            bundleLoadedFromServer: true,
12            fullBundleUrl: '',
13            url: '',
14        };
15    }
16    return {
17        // The bundle is always loaded from a server in the browser.
18        bundleLoadedFromServer: true,
19        /** URL but ensures that platform query param is added. */
20        get fullBundleUrl() {
21            if (document?.currentScript && 'src' in document.currentScript) {
22                return document.currentScript.src;
23            }
24            const url = window.location.toString();
25            const query = qs_1.default.parse(url);
26            return (location.origin + location.pathname + '?' + qs_1.default.stringify({ ...query, platform: 'web' }));
27        },
28        url: location.origin + location.pathname,
29    };
30};
31exports.default = getDevServer;
32//# sourceMappingURL=getDevServer.js.map