youtuber-blog-frontend/build/server/chunks/7-BgL-yaFE.js.map

1 line
7.4 KiB
Plaintext
Raw Permalink Normal View History

2024-08-25 16:39:31 +00:00
{"version":3,"file":"7-BgL-yaFE.js","sources":["../../../.svelte-kit/adapter-node/chunks/schema3.js","../../../.svelte-kit/adapter-node/entries/pages/(app)/website/_page.server.js","../../../.svelte-kit/adapter-node/nodes/7.js"],"sourcesContent":["import { z } from \"zod\";\nconst schema = z.object({\n id: z.string(),\n name: z.string().min(4).max(32),\n // primary_color_hex: z.string().length(7),\n // secondary_color_hex: z.string().length(7),\n // text_color_hex: z.string().length(7),\n domain: z.string().refine((key) => key === null || /^[a-z0-9\\.\\-]*$/.test(key), {\n message: \"Invalid domain\"\n }).nullable(),\n use_freebie: z.boolean().default(false),\n freebie_title: z.string().nullable(),\n freebie_url: z.string().nullable(),\n freebie_image_url: z.string().nullable(),\n freebie_text: z.string().nullable(),\n title: z.string(),\n subtitle: z.string(),\n auto_publish: z.boolean(),\n use_contact_page: z.boolean(),\n contact_email: z.string().email().nullable(),\n use_about_page: z.boolean(),\n about_text: z.string().nullable()\n}).superRefine((data, ctx) => {\n if (data.use_freebie) {\n if (!data.freebie_url) {\n ctx.addIssue({\n path: [\"freebie_url\"],\n message: \"A freebie file is required when 'Use freebie' is true.\",\n code: \"custom\"\n });\n }\n }\n if (data.use_contact_page && !data.contact_email) {\n ctx.addIssue({\n path: [\"contact_email\"],\n message: \"A contact email is required when the contact page is enabled\",\n code: \"custom\"\n });\n }\n});\nexport {\n schema as s\n};\n","import { c as config } from \"../../../../chunks/config.js\";\nimport \"../../../../chunks/client.js\";\nimport \"../../../../chunks/formData.js\";\nimport \"just-clone\";\nimport \"ts-deepmerge\";\nimport \"../../../../chunks/index.js\";\nimport \"devalue\";\nimport { s as superValidate, f as fail } from \"../../../../chunks/superValidate.js\";\nimport { s as schema } from \"../../../../chunks/schema3.js\";\nimport \"memoize-weak\";\nimport { a as zod } from \"../../../../chunks/zod.js\";\nconst load = async ({ fetch }) => {\n const blogRes = await fetch(config.api_url + \"/blog?mine=true\", {\n credentials: \"include\"\n });\n const { site } = await blogRes.json();\n return {\n blog_info: site,\n form: await superValidate(site, zod(schema))\n };\n};\nconst actions = {\n default: async (event) => {\n const form = await superValidate(event, zod(schema));\n if (!form.valid) {\n return fail(400, {\n form\n });\n }\n let data = structuredClone(form.data);\n const res = await event.fetch(config.api_url + \"/dashboard/website\", {\n method: \"PUT\",\n body: JSON.stringify(data),\n headers: {\n \"content-type\": \"application/json\"\n }\n });\n const res_data = await res.json();\n console.log(res_data);\n if (!res_data.success)\n return fail(res.status, {\n form\n });\n return {\n form\n };\n }\n};\nexport {\n actions,\n load\n};\n","import * as server from '../entries/pages/(app)/website/_page.server.js';\n\nexport const index = 7;\nlet component_cache;\nexport const component = async () => component_cache ??= (await import('../entries/pages/(app)/website/_page.svelte.js')).default;\nexport { server };\nexport const server_id = \"src/routes/(app)/website/+page.server.js\";\nexport const imports = [\"_app/immutable/nodes/7.EOOoGT-D.js\",\"_app/immutable/chunks/scheduler.DhJS7lTB.js\",\"_app/immutable/chunks/index.CsLdTWKk.js\",\"_app/immutable/chunks/spread.CgU5AtxT.js\",\"_app/immutable/chunks/textarea.DRjWiPsk.js\",\"_app/immutable/chunks/index.C-lF7DSK.js\",\"_app/immutable/chunks/index.BksXECXn.js\",\"_app/immutable/chunks/Toaster.svelte_svelte_type_style_lang.DBrjgtAI.js\",\"_app/immutable/chunks/button.C_FZXt9d.js\",\"_app/immutable/chunks/each.DOX4E1Ka.js\",\"_app/immutable/chunks/stores.CYmI1CWU.js\",\"_app/immutable/chunks/entry.CovI40VX.js\",\"_app/immutable/chunks/forms.BiMDMPlu.js\",\"_app/immutable/chunks/config.BCw8