import { a as subscribe, h as set_store_value, c as compute_rest_props } from './lifecycle-px-3doLe.js'; import { c as create_ssr_component, b as add_attribute, v as validate_component, e as escape, s as spread, f as escape_object } from './ssr-ipqebOFl.js'; import { F as Form_field, C as Control, a as Form_label, I as Input, b as Form_field_errors, S as Switch, T as Textarea, g as getFormField, d as getDataFsError, e as generateId } from './textarea-CILqUx6U.js'; import './stores-Cv0rQqhp.js'; import { g as superForm } from './index-CUXxL1oq.js'; import './index-Ddp2AB5f.js'; import { b as zodClient } from './zod-D1iX83g6.js'; import { s as schema } from './7-Dp-Cc2Cj.js'; import { f as toast } from './index-pRP-dlMc.js'; import './index3-4H3SMWet.js'; import 'clsx'; import { c as config } from './config-BHx687w1.js'; import { c as cn, B as Button } from './button-CeH7Xj2c.js'; import './index2-D4yenS_5.js'; import './exports-DuWZopOC.js'; import './stringify-D5iWhcfN.js'; import './scheduler-1Ju9dhbL.js'; import 'zod'; import 'tailwind-variants'; import './ssr2-BVSPLo1E.js'; import './shared-server-i79vVjEm.js'; import 'tailwind-merge'; const Description = create_ssr_component(($$result, $$props, $$bindings, slots) => { let descriptionAttrs; let $$restProps = compute_rest_props($$props, ["id", "asChild", "el"]); let $errors, $$unsubscribe_errors; let $descriptionId, $$unsubscribe_descriptionId; const { descriptionId, errors } = getFormField(); $$unsubscribe_descriptionId = subscribe(descriptionId, (value) => $descriptionId = value); $$unsubscribe_errors = subscribe(errors, (value) => $errors = value); let { id = generateId() } = $$props; let { asChild = false } = $$props; let { el = void 0 } = $$props; if ($$props.id === void 0 && $$bindings.id && id !== void 0) $$bindings.id(id); if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0) $$bindings.asChild(asChild); if ($$props.el === void 0 && $$bindings.el && el !== void 0) $$bindings.el(el); { descriptionId.set(id); } descriptionAttrs = { id: $descriptionId, "data-fs-error": getDataFsError($errors), "data-fs-description": "", ...$$restProps }; $$unsubscribe_errors(); $$unsubscribe_descriptionId(); return ` ${asChild ? `${slots.default ? slots.default({ descriptionAttrs }) : ``}` : `${slots.default ? slots.default({ descriptionAttrs }) : ``}`}`; }); const Form_description = create_ssr_component(($$result, $$props, $$bindings, slots) => { let $$restProps = compute_rest_props($$props, ["class"]); let { class: className = void 0 } = $$props; if ($$props.class === void 0 && $$bindings.class && className !== void 0) $$bindings.class(className); return `${validate_component(Description, "FormPrimitive.Description").$$render( $$result, Object.assign( {}, { class: cn("text-sm text-muted-foreground", className) }, $$restProps ), {}, { default: ({ descriptionAttrs }) => { return `${slots.default ? slots.default({ descriptionAttrs }) : ``}`; } } )}`; }); const Form_button = create_ssr_component(($$result, $$props, $$bindings, slots) => { let $$restProps = compute_rest_props($$props, []); return `${validate_component(Button, "Button.Root").$$render($$result, Object.assign({}, { type: "submit" }, $$restProps), {}, { default: () => { return `${slots.default ? slots.default({}) : ``}`; } })}`; }); const Page = create_ssr_component(($$result, $$props, $$bindings, slots) => { let $formData, $$unsubscribe_formData; let $tainted, $$unsubscribe_tainted; let { data } = $$props; const form = superForm(data.form, { validators: zodClient(schema), resetForm: false, onResult: (e) => { if (e.result.type == "success") { toast.success("Website configuration successfully updated!"); } else { if (e.result.type === "error") { console.log(e.result.error); toast.error("Error when updating website. Message from server: " + e.result.error.message); } } } }); const { form: formData, enhance, tainted, isTainted } = form; $$unsubscribe_formData = subscribe(formData, (value) => $formData = value); $$unsubscribe_tainted = subscribe(tainted, (value) => $tainted = value); set_store_value(formData, $formData.id = data.blog_info.id, $formData); let disable_freebies = !$formData.use_freebie; !$formData.auto_publish; if ($$props.data === void 0 && $$bindings.data && data !== void 0) $$bindings.data(data); let $$settled; let $$rendered; let previous_head = $$result.head; do { $$settled = true; $$result.head = previous_head; disable_freebies = !$formData.use_freebie; !$formData.auto_publish; $$rendered = `

Basics

${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "name" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, {}, {}, { default: () => { return `Blog name`; } })} ${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { value: $formData.name }), { value: ($$value) => { $formData.name = $$value; $$settled = false; } }, {} )}`; } })} ${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, {})} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "title" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, {}, {}, { default: () => { return `Blog title`; } })} ${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { value: $formData.title }), { value: ($$value) => { $formData.title = $$value; $$settled = false; } }, {} )}`; } })} ${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, {})} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "subtitle" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, {}, {}, { default: () => { return `Blog subtitle`; } })} ${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { value: $formData.subtitle }), { value: ($$value) => { $formData.subtitle = $$value; $$settled = false; } }, {} )}`; } })} ${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, {})} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "domain" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, {}, {}, { default: () => { return `Custom domain`; } })} ${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { value: $formData.domain }), { value: ($$value) => { $formData.domain = $$value; $$settled = false; } }, {} )}`; } })} ${data.blog_info.subdomain_slug ? `${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, { default: () => { return `You can also access your website at ${escape(data.blog_info.subdomain_slug)}.${escape(config.sites_url)}`; } })}` : ``} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })}

Auto publish

${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "auto_publish" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, {}, {}, { default: () => { return `Auto Publish`; } })}
${validate_component(Switch, "Switch").$$render( $$result, Object.assign({}, attrs, { checked: $formData.auto_publish }), { checked: ($$value) => { $formData.auto_publish = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})} ${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, { default: () => { return `Automatically creates a blog post for you when you upload a video`; } })}`; } })}

Freebies

${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "freebie_title" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Freebie title`; } })}
${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { value: $formData.freebie_title }), { value: ($$value) => { $formData.freebie_title = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "use_freebie" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Send freebie`; } })}
${validate_component(Switch, "Switch").$$render( $$result, Object.assign({}, attrs, { checked: $formData.use_freebie }), { checked: ($$value) => { $formData.use_freebie = $$value; $$settled = false; } }, {} )}
${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, { default: () => { return `Whether to send a freebie when a new person enters their email on your website.`; } })}`; } })}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "freebie_url" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Freebie file`; } })}
${validate_component(Input, "Input").$$render( $$result, { type: "file", disabled: disable_freebies }, { disabled: ($$value) => { disable_freebies = $$value; $$settled = false; } }, {} )} ${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { class: "hidden" }, { readonly: true }, { value: $formData.freebie_url }), { value: ($$value) => { $formData.freebie_url = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, { default: () => { return `Maximum size of 5MB (TEMPORARY)`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "freebie_text" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Freebie text`; } })}
${validate_component(Textarea, "Textarea").$$render( $$result, Object.assign({}, attrs, { value: $formData.freebie_text }), { value: ($$value) => { $formData.freebie_text = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})} ${validate_component(Form_description, "Form.Description").$$render($$result, {}, {}, { default: () => { return `The text displayed next to the signup form on your blog.`; } })}`; } })}

Pages

${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "use_contact_page" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Use contact page`; } })}
${validate_component(Switch, "Switch").$$render( $$result, Object.assign({}, attrs, { checked: $formData.use_contact_page }), { checked: ($$value) => { $formData.use_contact_page = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "contact_email" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Contact email`; } })}
${validate_component(Input, "Input").$$render( $$result, Object.assign({}, attrs, { readonly: !$formData.use_contact_page }, { value: $formData.contact_email }), { value: ($$value) => { $formData.contact_email = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "use_about_page" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `Use about page`; } })}
${validate_component(Switch, "Switch").$$render( $$result, Object.assign({}, attrs, { checked: $formData.use_about_page }), { checked: ($$value) => { $formData.use_about_page = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })} ${validate_component(Form_field, "Form.Field").$$render($$result, { form, name: "about_text" }, {}, { default: () => { return `${validate_component(Control, "Form.Control").$$render($$result, {}, {}, { default: ({ attrs }) => { return `${validate_component(Form_label, "Form.Label").$$render($$result, { class: "text-right" }, {}, { default: () => { return `About text`; } })}
${validate_component(Textarea, "Textarea").$$render( $$result, Object.assign({}, attrs, { readonly: !$formData.use_about_page }, { value: $formData.about_text }), { value: ($$value) => { $formData.about_text = $$value; $$settled = false; } }, {} )}
`; } })} ${validate_component(Form_field_errors, "Form.FieldErrors").$$render($$result, {}, {}, {})}`; } })}
${validate_component(Form_button, "Form.Button").$$render($$result, { disabled: !isTainted($tainted) }, {}, { default: () => { return `Submit`; } })}
`; } while (!$$settled); $$unsubscribe_formData(); $$unsubscribe_tainted(); return $$rendered; }); export { Page as default }; //# sourceMappingURL=_page.svelte-A2oJFCiL.js.map