fix price and modular

This commit is contained in:
2026-02-01 17:38:39 +03:30
parent 55f34aa15d
commit 164542d3e2
801 changed files with 16129 additions and 14478 deletions
@@ -1,4 +1,4 @@
import process from 'node:process';globalThis._importMeta_=globalThis._importMeta_||{url:"file:///_entry.js",env:process.env};import { u as useRuntimeConfig, c as defineSitemapEventHandler } from '../../../nitro/nitro.mjs';
import { c as defineSitemapEventHandler } from '../../../nitro/nitro.mjs';
import { createClient } from '@supabase/supabase-js';
import 'node:http';
import 'node:https';
@@ -10,16 +10,18 @@ import 'node:crypto';
import 'vue';
import 'node:url';
import 'consola';
import 'fast-xml-parser';
import 'ipx';
let _client = null;
function ensureClient() {
if (_client) return _client;
const cfg = useRuntimeConfig().public;
if (!(cfg == null ? void 0 : cfg.SUPABASE_URL) || !(cfg == null ? void 0 : cfg.SUPABASE_KEY)) {
console.warn("[supabase] Missing SUPABASE_URL/KEY in runtimeConfig.public");
const SUPABASE_URL = useState("supabase-url").value;
const SUPABASE_KEY = useState("supabase-key").value;
if (!SUPABASE_URL || !SUPABASE_KEY) {
console.warn("[supabase] Missing SUPABASE_URL/KEY");
}
_client = createClient(cfg.SUPABASE_URL, cfg.SUPABASE_KEY);
_client = createClient(SUPABASE_URL, SUPABASE_KEY);
return _client;
}
const supabase = new Proxy({}, {
@@ -33,19 +35,13 @@ const supabase = new Proxy({}, {
}
});
function resolveBaseURL() {
var _a, _b;
const envFallback = ((_b = (_a = globalThis._importMeta_) == null ? void 0 : _a.env) == null ? void 0 : _b.NUXT_PUBLIC_DOMAIN_URL) || process.env.NUXT_PUBLIC_DOMAIN_URL || "";
const { public: pub } = useRuntimeConfig();
return envFallback;
}
const urls = defineSitemapEventHandler(async () => {
const urls = [];
try {
const { data: categorys, error } = await supabase.from("collections").select(`title`);
if (categorys && categorys.length) {
categorys.forEach((item) => {
urls.push(`${resolveBaseURL()}/search/main?category=${item.title}`);
urls.push(`/search/main?category=${item.title}`);
});
}
} catch (e) {
@@ -55,7 +51,7 @@ const urls = defineSitemapEventHandler(async () => {
const { data: brands, error } = await supabase.from("brands").select(`title`);
if (brands && brands.length) {
brands.forEach((item) => {
urls.push(`${resolveBaseURL()}/search/main?brand=${item.title}`);
urls.push(`/search/main?brand=${item.title}`);
});
}
} catch (e) {
@@ -65,17 +61,17 @@ const urls = defineSitemapEventHandler(async () => {
const { data: products, error } = await supabase.from("products").select(`title`);
if (products && products.length) {
products.forEach((item) => {
urls.push(`${resolveBaseURL()}/product_detail/${item.title}`);
urls.push(`/product_detail/${item.title}`);
});
}
} catch (e) {
console.log(e);
}
urls.push(`${resolveBaseURL()}/`);
urls.push(`${resolveBaseURL()}/home`);
urls.push(`${resolveBaseURL()}/search`);
urls.push(`${resolveBaseURL()}/search/main`);
urls.push(`${resolveBaseURL()}/user`);
urls.push(`/`);
urls.push(`/home`);
urls.push(`/search`);
urls.push(`/search/main`);
urls.push(`/user`);
return urls;
});