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 } from './ssr-ipqebOFl.js'; import { F as Form_field, C as Control, b as Form_label, I as Input, c as Form_description, d as Form_field_errors, R as Root, T as Trigger, a as Tooltip_content, S as Switch, e as Textarea } from './textarea-bqlfV9dO.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-BgL-yaFE.js'; import { k as toast } from './Toaster.svelte_svelte_type_style_lang-Bhmi0dH5.js'; import { c as config } from './config-BHx687w1.js'; import { B as Button, I as Icon$1 } from './button-JMjD_Bg6.js'; import './index3-JA_ucGjW.js'; import './index2-D4yenS_5.js'; import './scheduler-1Ju9dhbL.js'; import 'clsx'; import './exports-DuWZopOC.js'; import './stringify-D5iWhcfN.js'; import 'zod'; import './shared-server-i79vVjEm.js'; import 'tailwind-merge'; import 'tailwind-variants'; import './ssr2-BVSPLo1E.js'; const Circle_help = create_ssr_component(($$result, $$props, $$bindings, slots) => { const iconNode = [ ["circle", { "cx": "12", "cy": "12", "r": "10" }], [ "path", { "d": "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" } ], ["path", { "d": "M12 17h.01" }] ]; return `${validate_component(Icon$1, "Icon").$$render($$result, Object.assign({}, { name: "circle-help" }, $$props, { iconNode }), {}, { default: () => { return `${slots.default ? slots.default({}) : ``}`; } })}`; }); const CircleQuestion = Circle_help; 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(Root, "Tooltip.Root").$$render($$result, {}, {}, { default: () => { return `${validate_component(Trigger, "Tooltip.Trigger").$$render($$result, {}, {}, { default: () => { return `${validate_component(Form_label, "Form.Label").$$render($$result, {}, {}, { default: () => { return `Custom domain ${validate_component(CircleQuestion, "CircleQuestion").$$render($$result, { class: "inline size-4" }, {}, {})}`; } })}`; } })} ${validate_component(Tooltip_content, "Tooltip.Content").$$render($$result, {}, {}, { default: () => { return `

To connect your own domain to your blog, create a CNAME record pointing your domain to target.youpage.ai

If you're having trouble doing it yourself, please feel free to contact us at our support email for assistance.

`; } })}`; } })} ${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, {}, {}, {})}`; } })}

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-BjcGCX-7.js.map