new build

This commit is contained in:
Omer Sabic 2024-06-22 01:07:37 +02:00
parent 2b94f6f241
commit ff0d61a071
17 changed files with 7121 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,188 @@
import { c as create_ssr_component, b as add_attribute } from './ssr-DKhf7yIZ.js';
import { d as derived, w as writable } from './index2-BO_DJNQw.js';
let timeoutAction;
let timeoutEnable;
function withoutTransition(action) {
if (typeof document === "undefined")
return;
clearTimeout(timeoutAction);
clearTimeout(timeoutEnable);
const style = document.createElement("style");
const css = document.createTextNode(`* {
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}`);
style.appendChild(css);
const disable = () => document.head.appendChild(style);
const enable = () => document.head.removeChild(style);
if (typeof window.getComputedStyle !== "undefined") {
disable();
action();
window.getComputedStyle(style).opacity;
enable();
return;
}
if (typeof window.requestAnimationFrame !== "undefined") {
disable();
action();
window.requestAnimationFrame(enable);
return;
}
disable();
timeoutAction = window.setTimeout(() => {
action();
timeoutEnable = window.setTimeout(enable, 120);
}, 120);
}
const noopStorage = {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
getItem: (_key) => null,
// eslint-disable-next-line @typescript-eslint/no-unused-vars
setItem: (_key, _value) => {
}
};
const isBrowser = typeof document !== "undefined";
const modes = ["dark", "light", "system"];
const localStorageKey = "mode-watcher-mode";
const userPrefersMode = createUserPrefersMode();
const systemPrefersMode = createSystemMode();
const themeColors = writable(void 0);
const disableTransitions = writable(true);
const derivedMode = createDerivedMode();
function createUserPrefersMode() {
const defaultValue = "system";
const storage = isBrowser ? localStorage : noopStorage;
const initialValue = storage.getItem(localStorageKey);
let value = isValidMode(initialValue) ? initialValue : defaultValue;
const { subscribe, set: _set } = writable(value, () => {
if (!isBrowser)
return;
const handler = (e) => {
if (e.key !== localStorageKey)
return;
const newValue = e.newValue;
if (isValidMode(newValue)) {
_set(value = newValue);
} else {
_set(value = defaultValue);
}
};
addEventListener("storage", handler);
return () => removeEventListener("storage", handler);
});
function set(v) {
_set(value = v);
storage.setItem(localStorageKey, value);
}
return {
subscribe,
set
};
}
function createSystemMode() {
const defaultValue = void 0;
let track = true;
const { subscribe, set } = writable(defaultValue, () => {
if (!isBrowser)
return;
const handler = (e) => {
if (!track)
return;
set(e.matches ? "light" : "dark");
};
const mediaQueryState = window.matchMedia("(prefers-color-scheme: light)");
mediaQueryState.addEventListener("change", handler);
return () => mediaQueryState.removeEventListener("change", handler);
});
function query() {
if (!isBrowser)
return;
const mediaQueryState = window.matchMedia("(prefers-color-scheme: light)");
set(mediaQueryState.matches ? "light" : "dark");
}
function tracking(active) {
track = active;
}
return {
subscribe,
query,
tracking
};
}
function createDerivedMode() {
const { subscribe } = derived([userPrefersMode, systemPrefersMode, themeColors, disableTransitions], ([$userPrefersMode, $systemPrefersMode, $themeColors, $disableTransitions]) => {
if (!isBrowser)
return void 0;
const derivedMode2 = $userPrefersMode === "system" ? $systemPrefersMode : $userPrefersMode;
function update() {
const htmlEl = document.documentElement;
const themeColorEl = document.querySelector('meta[name="theme-color"]');
if (derivedMode2 === "light") {
htmlEl.classList.remove("dark");
htmlEl.style.colorScheme = "light";
if (themeColorEl && $themeColors) {
themeColorEl.setAttribute("content", $themeColors.light);
}
} else {
htmlEl.classList.add("dark");
htmlEl.style.colorScheme = "dark";
if (themeColorEl && $themeColors) {
themeColorEl.setAttribute("content", $themeColors.dark);
}
}
}
if ($disableTransitions) {
withoutTransition(update);
} else {
update();
}
return derivedMode2;
});
return {
subscribe
};
}
function isValidMode(value) {
if (typeof value !== "string")
return false;
return modes.includes(value);
}
function setInitialMode(defaultMode, themeColors2) {
const rootEl = document.documentElement;
const mode = localStorage.getItem("mode-watcher-mode") || defaultMode;
const light = mode === "light" || mode === "system" && window.matchMedia("(prefers-color-scheme: light)").matches;
rootEl.classList[light ? "remove" : "add"]("dark");
rootEl.style.colorScheme = light ? "light" : "dark";
if (themeColors2) {
const themeMetaEl = document.querySelector('meta[name="theme-color"]');
if (themeMetaEl) {
themeMetaEl.setAttribute("content", mode === "light" ? themeColors2.light : themeColors2.dark);
}
}
localStorage.setItem("mode-watcher-mode", mode);
}
const Mode_watcher = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let { track = true } = $$props;
let { defaultMode = "system" } = $$props;
let { themeColors: themeColors$1 = void 0 } = $$props;
let { disableTransitions: disableTransitions$1 = true } = $$props;
themeColors.set(themeColors$1);
disableTransitions.set(disableTransitions$1);
const args = `"${defaultMode}"${themeColors$1 ? `, ${JSON.stringify(themeColors$1)}` : ""}`;
if ($$props.track === void 0 && $$bindings.track && track !== void 0)
$$bindings.track(track);
if ($$props.defaultMode === void 0 && $$bindings.defaultMode && defaultMode !== void 0)
$$bindings.defaultMode(defaultMode);
if ($$props.themeColors === void 0 && $$bindings.themeColors && themeColors$1 !== void 0)
$$bindings.themeColors(themeColors$1);
if ($$props.disableTransitions === void 0 && $$bindings.disableTransitions && disableTransitions$1 !== void 0)
$$bindings.disableTransitions(disableTransitions$1);
return `${$$result.head += `<!-- HEAD_svelte-cpyj77_START -->${themeColors$1 ? ` <meta name="theme-color"${add_attribute("content", themeColors$1.dark, 0)}>` : ``}<!-- HTML_TAG_START -->${`<script nonce="%sveltekit.nonce%">(` + setInitialMode.toString() + `)(` + args + `);<\/script>`}<!-- HTML_TAG_END --><!-- HEAD_svelte-cpyj77_END -->`, ""}`;
});
export { Mode_watcher as M, derivedMode as d };
//# sourceMappingURL=mode-watcher-DyhmqlyS.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,75 @@
import { d as set_current_component, r as run_all, e as current_component } from './lifecycle-Cykl3Eqn.js';
const dirty_components = [];
const binding_callbacks = [];
let render_callbacks = [];
const flush_callbacks = [];
const resolved_promise = /* @__PURE__ */ Promise.resolve();
let update_scheduled = false;
function schedule_update() {
if (!update_scheduled) {
update_scheduled = true;
resolved_promise.then(flush);
}
}
function tick() {
schedule_update();
return resolved_promise;
}
function add_render_callback(fn) {
render_callbacks.push(fn);
}
const seen_callbacks = /* @__PURE__ */ new Set();
let flushidx = 0;
function flush() {
if (flushidx !== 0) {
return;
}
const saved_component = current_component;
do {
try {
while (flushidx < dirty_components.length) {
const component = dirty_components[flushidx];
flushidx++;
set_current_component(component);
update(component.$$);
}
} catch (e) {
dirty_components.length = 0;
flushidx = 0;
throw e;
}
set_current_component(null);
dirty_components.length = 0;
flushidx = 0;
while (binding_callbacks.length)
binding_callbacks.pop()();
for (let i = 0; i < render_callbacks.length; i += 1) {
const callback = render_callbacks[i];
if (!seen_callbacks.has(callback)) {
seen_callbacks.add(callback);
callback();
}
}
render_callbacks.length = 0;
} while (dirty_components.length);
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
update_scheduled = false;
seen_callbacks.clear();
set_current_component(saved_component);
}
function update($$) {
if ($$.fragment !== null) {
$$.update();
run_all($$.before_update);
const dirty = $$.dirty;
$$.dirty = [-1];
$$.fragment && $$.fragment.p($$.ctx, dirty);
$$.after_update.forEach(add_render_callback);
}
}
export { tick as t };
//# sourceMappingURL=scheduler-e11T_xkt.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"scheduler-e11T_xkt.js","sources":["../../../.svelte-kit/adapter-node/chunks/scheduler.js"],"sourcesContent":["import { j as set_current_component, r as run_all, k as current_component } from \"./lifecycle.js\";\nconst dirty_components = [];\nconst binding_callbacks = [];\nlet render_callbacks = [];\nconst flush_callbacks = [];\nconst resolved_promise = /* @__PURE__ */ Promise.resolve();\nlet update_scheduled = false;\nfunction schedule_update() {\n if (!update_scheduled) {\n update_scheduled = true;\n resolved_promise.then(flush);\n }\n}\nfunction tick() {\n schedule_update();\n return resolved_promise;\n}\nfunction add_render_callback(fn) {\n render_callbacks.push(fn);\n}\nconst seen_callbacks = /* @__PURE__ */ new Set();\nlet flushidx = 0;\nfunction flush() {\n if (flushidx !== 0) {\n return;\n }\n const saved_component = current_component;\n do {\n try {\n while (flushidx < dirty_components.length) {\n const component = dirty_components[flushidx];\n flushidx++;\n set_current_component(component);\n update(component.$$);\n }\n } catch (e) {\n dirty_components.length = 0;\n flushidx = 0;\n throw e;\n }\n set_current_component(null);\n dirty_components.length = 0;\n flushidx = 0;\n while (binding_callbacks.length)\n binding_callbacks.pop()();\n for (let i = 0; i < render_callbacks.length; i += 1) {\n const callback = render_callbacks[i];\n if (!seen_callbacks.has(callback)) {\n seen_callbacks.add(callback);\n callback();\n }\n }\n render_callbacks.length = 0;\n } while (dirty_components.length);\n while (flush_callbacks.length) {\n flush_callbacks.pop()();\n }\n update_scheduled = false;\n seen_callbacks.clear();\n set_current_component(saved_component);\n}\nfunction update($$) {\n if ($$.fragment !== null) {\n $$.update();\n run_all($$.before_update);\n const dirty = $$.dirty;\n $$.dirty = [-1];\n $$.fragment && $$.fragment.p($$.ctx, dirty);\n $$.after_update.forEach(add_render_callback);\n }\n}\nexport {\n tick as t\n};\n"],"names":[],"mappings":"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"}

View File

@ -0,0 +1,196 @@
import { r as run_all, p as blank_object, e as current_component, d as set_current_component } from './lifecycle-Cykl3Eqn.js';
function ensure_array_like(array_like_or_iterator) {
return array_like_or_iterator?.length !== void 0 ? array_like_or_iterator : Array.from(array_like_or_iterator);
}
const _boolean_attributes = (
/** @type {const} */
[
"allowfullscreen",
"allowpaymentrequest",
"async",
"autofocus",
"autoplay",
"checked",
"controls",
"default",
"defer",
"disabled",
"formnovalidate",
"hidden",
"inert",
"ismap",
"loop",
"multiple",
"muted",
"nomodule",
"novalidate",
"open",
"playsinline",
"readonly",
"required",
"reversed",
"selected"
]
);
const boolean_attributes = /* @__PURE__ */ new Set([..._boolean_attributes]);
const invalid_attribute_name_character = /[\s'">/=\u{FDD0}-\u{FDEF}\u{FFFE}\u{FFFF}\u{1FFFE}\u{1FFFF}\u{2FFFE}\u{2FFFF}\u{3FFFE}\u{3FFFF}\u{4FFFE}\u{4FFFF}\u{5FFFE}\u{5FFFF}\u{6FFFE}\u{6FFFF}\u{7FFFE}\u{7FFFF}\u{8FFFE}\u{8FFFF}\u{9FFFE}\u{9FFFF}\u{AFFFE}\u{AFFFF}\u{BFFFE}\u{BFFFF}\u{CFFFE}\u{CFFFF}\u{DFFFE}\u{DFFFF}\u{EFFFE}\u{EFFFF}\u{FFFFE}\u{FFFFF}\u{10FFFE}\u{10FFFF}]/u;
function spread(args, attrs_to_add) {
const attributes = Object.assign({}, ...args);
if (attrs_to_add) {
const classes_to_add = attrs_to_add.classes;
const styles_to_add = attrs_to_add.styles;
if (classes_to_add) {
if (attributes.class == null) {
attributes.class = classes_to_add;
} else {
attributes.class += " " + classes_to_add;
}
}
if (styles_to_add) {
if (attributes.style == null) {
attributes.style = style_object_to_string(styles_to_add);
} else {
attributes.style = style_object_to_string(
merge_ssr_styles(attributes.style, styles_to_add)
);
}
}
}
let str = "";
Object.keys(attributes).forEach((name) => {
if (invalid_attribute_name_character.test(name))
return;
const value = attributes[name];
if (value === true)
str += " " + name;
else if (boolean_attributes.has(name.toLowerCase())) {
if (value)
str += " " + name;
} else if (value != null) {
str += ` ${name}="${value}"`;
}
});
return str;
}
function merge_ssr_styles(style_attribute, style_directive) {
const style_object = {};
for (const individual_style of style_attribute.split(";")) {
const colon_index = individual_style.indexOf(":");
const name = individual_style.slice(0, colon_index).trim();
const value = individual_style.slice(colon_index + 1).trim();
if (!name)
continue;
style_object[name] = value;
}
for (const name in style_directive) {
const value = style_directive[name];
if (value) {
style_object[name] = value;
} else {
delete style_object[name];
}
}
return style_object;
}
const ATTR_REGEX = /[&"]/g;
const CONTENT_REGEX = /[&<]/g;
function escape(value, is_attr = false) {
const str = String(value);
const pattern = is_attr ? ATTR_REGEX : CONTENT_REGEX;
pattern.lastIndex = 0;
let escaped = "";
let last = 0;
while (pattern.test(str)) {
const i = pattern.lastIndex - 1;
const ch = str[i];
escaped += str.substring(last, i) + (ch === "&" ? "&amp;" : ch === '"' ? "&quot;" : "&lt;");
last = i + 1;
}
return escaped + str.substring(last);
}
function escape_attribute_value(value) {
const should_escape = typeof value === "string" || value && typeof value === "object";
return should_escape ? escape(value, true) : value;
}
function escape_object(obj) {
const result = {};
for (const key in obj) {
result[key] = escape_attribute_value(obj[key]);
}
return result;
}
function each(items, fn) {
items = ensure_array_like(items);
let str = "";
for (let i = 0; i < items.length; i += 1) {
str += fn(items[i], i);
}
return str;
}
const missing_component = {
$$render: () => ""
};
function validate_component(component, name) {
if (!component || !component.$$render) {
if (name === "svelte:component")
name += " this={...}";
throw new Error(
`<${name}> is not a valid SSR component. You may need to review your build config to ensure that dependencies are compiled, rather than imported as pre-compiled modules. Otherwise you may need to fix a <${name}>.`
);
}
return component;
}
let on_destroy;
function create_ssr_component(fn) {
function $$render(result, props, bindings, slots, context) {
const parent_component = current_component;
const $$ = {
on_destroy,
context: new Map(context || (parent_component ? parent_component.$$.context : [])),
// these will be immediately discarded
on_mount: [],
before_update: [],
after_update: [],
callbacks: blank_object()
};
set_current_component({ $$ });
const html = fn(result, props, bindings, slots);
set_current_component(parent_component);
return html;
}
return {
render: (props = {}, { $$slots = {}, context = /* @__PURE__ */ new Map() } = {}) => {
on_destroy = [];
const result = { title: "", head: "", css: /* @__PURE__ */ new Set() };
const html = $$render(result, props, {}, $$slots, context);
run_all(on_destroy);
return {
html,
css: {
code: Array.from(result.css).map((css) => css.code).join("\n"),
map: null
// TODO
},
head: result.title + result.head
};
},
$$render
};
}
function add_attribute(name, value, boolean) {
if (value == null || boolean && !value)
return "";
const assignment = boolean && value === true ? "" : `="${escape(value, true)}"`;
return ` ${name}${assignment}`;
}
function style_object_to_string(style_object) {
return Object.keys(style_object).filter((key) => style_object[key]).map((key) => `${key}: ${escape_attribute_value(style_object[key])};`).join(" ");
}
function add_styles(style_object) {
const styles = style_object_to_string(style_object);
return styles ? ` style="${styles}"` : "";
}
export { each as a, add_attribute as b, create_ssr_component as c, escape_attribute_value as d, escape as e, escape_object as f, add_styles as g, merge_ssr_styles as h, missing_component as m, spread as s, validate_component as v };
//# sourceMappingURL=ssr-DKhf7yIZ.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,54 @@
import { b as getContext } from './lifecycle-Cykl3Eqn.js';
import './exports-DuWZopOC.js';
function get(key, parse = JSON.parse) {
try {
return parse(sessionStorage[key]);
} catch {
}
}
const SNAPSHOT_KEY = "sveltekit:snapshot";
const SCROLL_KEY = "sveltekit:scroll";
get(SCROLL_KEY) ?? {};
get(SNAPSHOT_KEY) ?? {};
function invalidateAll() {
{
throw new Error("Cannot call invalidateAll() on the server");
}
}
async function applyAction(result) {
{
throw new Error("Cannot call applyAction(...) on the server");
}
}
const getStores = () => {
const stores = getContext("__svelte__");
return {
/** @type {typeof page} */
page: {
subscribe: stores.page.subscribe
},
/** @type {typeof navigating} */
navigating: {
subscribe: stores.navigating.subscribe
},
/** @type {typeof updated} */
updated: stores.updated
};
};
const page = {
subscribe(fn) {
const store = getStores().page;
return store.subscribe(fn);
}
};
const navigating = {
subscribe(fn) {
const store = getStores().navigating;
return store.subscribe(fn);
}
};
export { applyAction as a, invalidateAll as i, navigating as n, page as p };
//# sourceMappingURL=stores-q_3MsRzq.js.map

View File

@ -0,0 +1 @@
{"version":3,"file":"stores-q_3MsRzq.js","sources":["../../../.svelte-kit/adapter-node/chunks/client.js","../../../.svelte-kit/adapter-node/chunks/stores.js"],"sourcesContent":["import \"./exports.js\";\nimport \"devalue\";\nfunction get(key, parse = JSON.parse) {\n try {\n return parse(sessionStorage[key]);\n } catch {\n }\n}\nconst SNAPSHOT_KEY = \"sveltekit:snapshot\";\nconst SCROLL_KEY = \"sveltekit:scroll\";\nget(SCROLL_KEY) ?? {};\nget(SNAPSHOT_KEY) ?? {};\nfunction invalidateAll() {\n {\n throw new Error(\"Cannot call invalidateAll() on the server\");\n }\n}\nasync function applyAction(result) {\n {\n throw new Error(\"Cannot call applyAction(...) on the server\");\n }\n}\nexport {\n applyAction as a,\n invalidateAll as i\n};\n","import { g as getContext } from \"./lifecycle.js\";\nimport \"./client.js\";\nconst getStores = () => {\n const stores = getContext(\"__svelte__\");\n return {\n /** @type {typeof page} */\n page: {\n subscribe: stores.page.subscribe\n },\n /** @type {typeof navigating} */\n navigating: {\n subscribe: stores.navigating.subscribe\n },\n /** @type {typeof updated} */\n updated: stores.updated\n };\n};\nconst page = {\n subscribe(fn) {\n const store = getStores().page;\n return store.subscribe(fn);\n }\n};\nconst navigating = {\n subscribe(fn) {\n const store = getStores().navigating;\n return store.subscribe(fn);\n }\n};\nexport {\n navigating as n,\n page as p\n};\n"],"names":[],"mappings":";;;AAEA,SAAS,GAAG,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AACtC,EAAE,IAAI;AACN,IAAI,OAAO,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;AACtC,GAAG,CAAC,MAAM;AACV,GAAG;AACH,CAAC;AACD,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAC1C,MAAM,UAAU,GAAG,kBAAkB,CAAC;AACtC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;AACtB,GAAG,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;AACxB,SAAS,aAAa,GAAG;AACzB,EAAE;AACF,IAAI,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;AACjE,GAAG;AACH,CAAC;AACD,eAAe,WAAW,CAAC,MAAM,EAAE;AACnC,EAAE;AACF,IAAI,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAClE,GAAG;AACH;;ACnBA,MAAM,SAAS,GAAG,MAAM;AACxB,EAAE,MAAM,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;AAC1C,EAAE,OAAO;AACT;AACA,IAAI,IAAI,EAAE;AACV,MAAM,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS;AACtC,KAAK;AACL;AACA,IAAI,UAAU,EAAE;AAChB,MAAM,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;AAC5C,KAAK;AACL;AACA,IAAI,OAAO,EAAE,MAAM,CAAC,OAAO;AAC3B,GAAG,CAAC;AACJ,CAAC,CAAC;AACG,MAAC,IAAI,GAAG;AACb,EAAE,SAAS,CAAC,EAAE,EAAE;AAChB,IAAI,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC;AACnC,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC/B,GAAG;AACH,EAAE;AACG,MAAC,UAAU,GAAG;AACnB,EAAE,SAAS,CAAC,EAAE,EAAE;AAChB,IAAI,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC,UAAU,CAAC;AACzC,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AAC/B,GAAG;AACH;;;;"}

View File

@ -0,0 +1,97 @@
import { c as compute_rest_props } from './lifecycle-Cykl3Eqn.js';
import { c as create_ssr_component, s as spread, d as escape_attribute_value, f as escape_object } from './ssr-DKhf7yIZ.js';
import { c as cn } from './button-PuTSnXRo.js';
const Table = 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 `<div class="relative w-full overflow-auto"><table${spread(
[
{
class: escape_attribute_value(cn("w-full caption-bottom text-sm", className))
},
escape_object($$restProps)
],
{}
)}>${slots.default ? slots.default({}) : ``}</table></div>`;
});
const Table_body = 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 `<tbody${spread(
[
{
class: escape_attribute_value(cn("[&_tr:last-child]:border-0", className))
},
escape_object($$restProps)
],
{}
)}>${slots.default ? slots.default({}) : ``}</tbody>`;
});
const Table_cell = 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 `<td${spread(
[
{
class: escape_attribute_value(cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className))
},
escape_object($$restProps)
],
{}
)}>${slots.default ? slots.default({}) : ``}</td>`;
});
const Table_head = 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 `<th${spread(
[
{
class: escape_attribute_value(cn("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0", className))
},
escape_object($$restProps)
],
{}
)}>${slots.default ? slots.default({}) : ``}</th>`;
});
const Table_header = 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 ` <thead${spread(
[
{
class: escape_attribute_value(cn("[&_tr]:border-b", className))
},
escape_object($$restProps)
],
{}
)}>${slots.default ? slots.default({}) : ``}</thead>`;
});
const Table_row = 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 `<tr${spread(
[
{
class: escape_attribute_value(cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className))
},
escape_object($$restProps)
],
{}
)}>${slots.default ? slots.default({}) : ``}</tr>`;
});
export { Table as T, Table_header as a, Table_row as b, Table_head as c, Table_body as d, Table_cell as e };
//# sourceMappingURL=table-row-LZ3Zs8jb.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,738 @@
import { c as compute_rest_props, a as subscribe, i as hasContext, b as getContext, s as setContext, n as noop } from './lifecycle-Cykl3Eqn.js';
import { c as create_ssr_component, s as spread, d as escape_attribute_value, f as escape_object, b as add_attribute, v as validate_component, a as each, e as escape } from './ssr-DKhf7yIZ.js';
import { c as cn } from './button-PuTSnXRo.js';
import { m as makeElement, d as addMeltEventListener, o as omit, l as disabledAttr, b as executeCallbacks, s as styleToString, c as createElHelpers, k as kbd } from './index3-BO7d7Sb-.js';
import { c as createDispatcher, a as createBitAttrs, r as removeUndefined, g as getOptionUpdater, h as toWritableStores, o as overridable, n as nanoid } from './index-De6aia-x.js';
import { w as writable } from './index2-BO_DJNQw.js';
import 'clsx';
const globals = typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : (
// @ts-ignore Node typings have this
global
);
function createLabel() {
const root = makeElement("label", {
action: (node) => {
const mouseDown = addMeltEventListener(node, "mousedown", (e) => {
if (!e.defaultPrevented && e.detail > 1) {
e.preventDefault();
}
});
return {
destroy: mouseDown
};
}
});
return {
elements: {
root
}
};
}
const defaults = {
defaultChecked: false,
disabled: false,
required: false,
name: "",
value: ""
};
const { name } = createElHelpers("switch");
function createSwitch(props) {
const propsWithDefaults = { ...defaults, ...props };
const options = toWritableStores(omit(propsWithDefaults, "checked"));
const { disabled, required, name: nameStore, value } = options;
const checkedWritable = propsWithDefaults.checked ?? writable(propsWithDefaults.defaultChecked);
const checked = overridable(checkedWritable, propsWithDefaults?.onCheckedChange);
function toggleSwitch() {
if (disabled.get())
return;
checked.update((prev) => !prev);
}
const root = makeElement(name(), {
stores: [checked, disabled, required],
returned: ([$checked, $disabled, $required]) => {
return {
"data-disabled": disabledAttr($disabled),
disabled: disabledAttr($disabled),
"data-state": $checked ? "checked" : "unchecked",
type: "button",
role: "switch",
"aria-checked": $checked ? "true" : "false",
"aria-required": $required ? "true" : void 0
};
},
action(node) {
const unsub = executeCallbacks(addMeltEventListener(node, "click", () => {
toggleSwitch();
}), addMeltEventListener(node, "keydown", (e) => {
if (e.key !== kbd.ENTER && e.key !== kbd.SPACE)
return;
e.preventDefault();
toggleSwitch();
}));
return {
destroy: unsub
};
}
});
const input = makeElement(name("input"), {
stores: [checked, nameStore, required, disabled, value],
returned: ([$checked, $name, $required, $disabled, $value]) => {
return {
type: "checkbox",
"aria-hidden": true,
hidden: true,
tabindex: -1,
name: $name,
value: $value,
checked: $checked,
required: $required,
disabled: disabledAttr($disabled),
style: styleToString({
position: "absolute",
opacity: 0,
"pointer-events": "none",
margin: 0,
transform: "translateX(-100%)"
})
};
}
});
return {
elements: {
root,
input
},
states: {
checked
},
options
};
}
function getLabelData() {
const NAME = "label";
const PARTS = ["root"];
const getAttrs = createBitAttrs(NAME, PARTS);
return {
NAME,
getAttrs
};
}
const Label$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let builder;
let $$restProps = compute_rest_props($$props, ["asChild", "el"]);
let $root, $$unsubscribe_root;
let { asChild = false } = $$props;
let { el = void 0 } = $$props;
const { elements: { root } } = createLabel();
$$unsubscribe_root = subscribe(root, (value) => $root = value);
createDispatcher();
const { getAttrs } = getLabelData();
const attrs = getAttrs("root");
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);
builder = $root;
{
Object.assign(builder, attrs);
}
$$unsubscribe_root();
return `${asChild ? `${slots.default ? slots.default({ builder }) : ``}` : `<label${spread([escape_object(builder), escape_object($$restProps)], {})}${add_attribute("this", el, 0)}>${slots.default ? slots.default({ builder }) : ``}</label>`}`;
});
function getSwitchData() {
const NAME = "switch";
const PARTS = ["root", "input", "thumb"];
return {
NAME,
PARTS
};
}
function setCtx(props) {
const { NAME, PARTS } = getSwitchData();
const getAttrs = createBitAttrs(NAME, PARTS);
const Switch2 = { ...createSwitch(removeUndefined(props)), getAttrs };
setContext(NAME, Switch2);
return {
...Switch2,
updateOption: getOptionUpdater(Switch2.options)
};
}
function getCtx() {
const { NAME } = getSwitchData();
return getContext(NAME);
}
const Switch_input = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let inputValue;
let $$restProps = compute_rest_props($$props, ["el"]);
let $value, $$unsubscribe_value;
let $input, $$unsubscribe_input;
let $name, $$unsubscribe_name;
let $disabled, $$unsubscribe_disabled;
let $required, $$unsubscribe_required;
let { el = void 0 } = $$props;
const { elements: { input }, options: { value, name: name2, disabled, required } } = getCtx();
$$unsubscribe_input = subscribe(input, (value2) => $input = value2);
$$unsubscribe_value = subscribe(value, (value2) => $value = value2);
$$unsubscribe_name = subscribe(name2, (value2) => $name = value2);
$$unsubscribe_disabled = subscribe(disabled, (value2) => $disabled = value2);
$$unsubscribe_required = subscribe(required, (value2) => $required = value2);
if ($$props.el === void 0 && $$bindings.el && el !== void 0)
$$bindings.el(el);
inputValue = $value === void 0 || $value === "" ? "on" : $value;
$$unsubscribe_value();
$$unsubscribe_input();
$$unsubscribe_name();
$$unsubscribe_disabled();
$$unsubscribe_required();
return `<input${spread(
[
escape_object($input),
{ name: escape_attribute_value($name) },
{ disabled: $disabled || null },
{ required: $required || null },
{
value: escape_attribute_value(inputValue)
},
escape_object($$restProps)
],
{}
)}${add_attribute("this", el, 0)}>`;
});
const { Object: Object_1 } = globals;
const Switch$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let builder;
let attrs;
let $$restProps = compute_rest_props($$props, [
"checked",
"onCheckedChange",
"disabled",
"name",
"value",
"includeInput",
"required",
"asChild",
"inputAttrs",
"el"
]);
let $root, $$unsubscribe_root;
let { checked = void 0 } = $$props;
let { onCheckedChange = void 0 } = $$props;
let { disabled = void 0 } = $$props;
let { name: name2 = void 0 } = $$props;
let { value = void 0 } = $$props;
let { includeInput = true } = $$props;
let { required = void 0 } = $$props;
let { asChild = false } = $$props;
let { inputAttrs = void 0 } = $$props;
let { el = void 0 } = $$props;
const { elements: { root }, states: { checked: localChecked }, updateOption, getAttrs } = setCtx({
disabled,
name: name2,
value,
required,
defaultChecked: checked,
onCheckedChange: ({ next }) => {
if (checked !== next) {
onCheckedChange?.(next);
checked = next;
}
return next;
}
});
$$unsubscribe_root = subscribe(root, (value2) => $root = value2);
createDispatcher();
if ($$props.checked === void 0 && $$bindings.checked && checked !== void 0)
$$bindings.checked(checked);
if ($$props.onCheckedChange === void 0 && $$bindings.onCheckedChange && onCheckedChange !== void 0)
$$bindings.onCheckedChange(onCheckedChange);
if ($$props.disabled === void 0 && $$bindings.disabled && disabled !== void 0)
$$bindings.disabled(disabled);
if ($$props.name === void 0 && $$bindings.name && name2 !== void 0)
$$bindings.name(name2);
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
$$bindings.value(value);
if ($$props.includeInput === void 0 && $$bindings.includeInput && includeInput !== void 0)
$$bindings.includeInput(includeInput);
if ($$props.required === void 0 && $$bindings.required && required !== void 0)
$$bindings.required(required);
if ($$props.asChild === void 0 && $$bindings.asChild && asChild !== void 0)
$$bindings.asChild(asChild);
if ($$props.inputAttrs === void 0 && $$bindings.inputAttrs && inputAttrs !== void 0)
$$bindings.inputAttrs(inputAttrs);
if ($$props.el === void 0 && $$bindings.el && el !== void 0)
$$bindings.el(el);
checked !== void 0 && localChecked.set(checked);
{
updateOption("disabled", disabled);
}
{
updateOption("name", name2);
}
{
updateOption("value", value);
}
{
updateOption("required", required);
}
builder = $root;
attrs = {
...getAttrs("root"),
"data-checked": checked ? "" : void 0
};
{
Object.assign(builder, attrs);
}
$$unsubscribe_root();
return `${asChild ? `${slots.default ? slots.default({ builder }) : ``}` : `<button${spread([escape_object(builder), { type: "button" }, escape_object($$restProps)], {})}${add_attribute("this", el, 0)}>${slots.default ? slots.default({ builder }) : ``}</button>`} ${includeInput ? `${validate_component(Switch_input, "SwitchInput").$$render($$result, Object_1.assign({}, inputAttrs), {}, {})}` : ``}`;
});
const Switch_thumb = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let attrs;
let $$restProps = compute_rest_props($$props, ["asChild", "el"]);
let $checked, $$unsubscribe_checked;
let { asChild = false } = $$props;
let { el = void 0 } = $$props;
const { states: { checked }, getAttrs } = getCtx();
$$unsubscribe_checked = subscribe(checked, (value) => $checked = value);
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);
attrs = {
...getAttrs("thumb"),
"data-state": $checked ? "checked" : "unchecked",
"data-checked": $checked ? "" : void 0
};
$$unsubscribe_checked();
return `${asChild ? `${slots.default ? slots.default({ attrs, checked: $checked }) : ``}` : `<span${spread([escape_object($$restProps), escape_object(attrs)], {})}${add_attribute("this", el, 0)}></span>`}`;
});
const Input = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, ["class", "value", "readonly"]);
let { class: className = void 0 } = $$props;
let { value = void 0 } = $$props;
let { readonly = void 0 } = $$props;
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
$$bindings.class(className);
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
$$bindings.value(value);
if ($$props.readonly === void 0 && $$bindings.readonly && readonly !== void 0)
$$bindings.readonly(readonly);
return `<input${spread(
[
{
class: escape_attribute_value(cn("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className))
},
{ readonly: readonly || null },
escape_object($$restProps)
],
{}
)}${add_attribute("value", value, 0)}>`;
});
const FORM_FIELD = Symbol("FORM_FIELD_CTX");
function setFormField(props) {
setContext(FORM_FIELD, props);
return props;
}
function getFormField() {
if (!hasContext(FORM_FIELD)) {
ctxError("Form.Field");
}
return getContext(FORM_FIELD);
}
const FORM_CONTROL = Symbol("FORM_CONTROL_CTX");
function setFormControl(props) {
setContext(FORM_CONTROL, props);
return props;
}
function getFormControl() {
if (!hasContext(FORM_CONTROL)) {
ctxError("<Control />");
}
return getContext(FORM_CONTROL);
}
function ctxError(ctx) {
throw new Error(`Unable to find \`${ctx}\` context. Did you forget to wrap the component in a \`${ctx}\`?`);
}
function getAriaDescribedBy({ fieldErrorsId = void 0, descriptionId = void 0, errors }) {
let describedBy = "";
if (descriptionId) {
describedBy += descriptionId + " ";
}
if (errors.length && fieldErrorsId) {
describedBy += fieldErrorsId;
}
return describedBy ? describedBy.trim() : void 0;
}
function getAriaRequired(constraints) {
if (!("required" in constraints))
return void 0;
return constraints.required ? "true" : void 0;
}
function getAriaInvalid(errors) {
return errors && errors.length ? "true" : void 0;
}
function getDataFsError(errors) {
return errors && errors.length ? "" : void 0;
}
function generateId() {
return nanoid(5);
}
function extractErrorArray(errors) {
if (Array.isArray(errors))
return errors;
if (typeof errors === "object" && "_errors" in errors) {
if (errors._errors !== void 0)
return errors._errors;
}
return [];
}
function getValueAtPath(path, obj) {
const keys = path.split(/[[\].]/).filter(Boolean);
let value = obj;
for (const key of keys) {
if (typeof value !== "object" || value === null) {
return void 0;
}
value = value[key];
}
return value;
}
const Field = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let formErrors;
let formConstraints;
let formTainted;
let formData;
let $formTainted, $$unsubscribe_formTainted = noop, $$subscribe_formTainted = () => ($$unsubscribe_formTainted(), $$unsubscribe_formTainted = subscribe(formTainted, ($$value) => $formTainted = $$value), formTainted);
let $formConstraints, $$unsubscribe_formConstraints = noop, $$subscribe_formConstraints = () => ($$unsubscribe_formConstraints(), $$unsubscribe_formConstraints = subscribe(formConstraints, ($$value) => $formConstraints = $$value), formConstraints);
let $formErrors, $$unsubscribe_formErrors = noop, $$subscribe_formErrors = () => ($$unsubscribe_formErrors(), $$unsubscribe_formErrors = subscribe(formErrors, ($$value) => $formErrors = $$value), formErrors);
let $formData, $$unsubscribe_formData = noop, $$subscribe_formData = () => ($$unsubscribe_formData(), $$unsubscribe_formData = subscribe(formData, ($$value) => $formData = $$value), formData);
let $errors, $$unsubscribe_errors;
let $tainted, $$unsubscribe_tainted;
let { form } = $$props;
let { name: name2 } = $$props;
const field = {
name: writable(name2),
errors: writable([]),
constraints: writable({}),
tainted: writable(false),
fieldErrorsId: writable(),
descriptionId: writable(),
form
};
const { tainted, errors } = field;
$$unsubscribe_tainted = subscribe(tainted, (value) => $tainted = value);
$$unsubscribe_errors = subscribe(errors, (value) => $errors = value);
setFormField(field);
if ($$props.form === void 0 && $$bindings.form && form !== void 0)
$$bindings.form(form);
if ($$props.name === void 0 && $$bindings.name && name2 !== void 0)
$$bindings.name(name2);
$$subscribe_formErrors({ errors: formErrors, constraints: formConstraints, tainted: formTainted, form: formData } = form, $$subscribe_formConstraints(), $$subscribe_formTainted(), $$subscribe_formData());
{
field.name.set(name2);
}
{
field.errors.set(extractErrorArray(getValueAtPath(name2, $formErrors)));
}
{
field.constraints.set(getValueAtPath(name2, $formConstraints) ?? {});
}
{
field.tainted.set($formTainted ? getValueAtPath(name2, $formTainted) === true : false);
}
$$unsubscribe_formTainted();
$$unsubscribe_formConstraints();
$$unsubscribe_formErrors();
$$unsubscribe_formData();
$$unsubscribe_errors();
$$unsubscribe_tainted();
return ` ${slots.default ? slots.default({
value: $formData[name2],
errors: $errors,
tainted: $tainted,
constraints: $formConstraints[name2]
}) : ``}`;
});
const Control$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let errorAttr;
let attrs;
let labelAttrs;
let $idStore, $$unsubscribe_idStore;
let $constraints, $$unsubscribe_constraints;
let $errors, $$unsubscribe_errors;
let $descriptionId, $$unsubscribe_descriptionId;
let $fieldErrorsId, $$unsubscribe_fieldErrorsId;
let $name, $$unsubscribe_name;
let { id = generateId() } = $$props;
const { name: name2, fieldErrorsId, descriptionId, errors, constraints } = getFormField();
$$unsubscribe_name = subscribe(name2, (value) => $name = value);
$$unsubscribe_fieldErrorsId = subscribe(fieldErrorsId, (value) => $fieldErrorsId = value);
$$unsubscribe_descriptionId = subscribe(descriptionId, (value) => $descriptionId = value);
$$unsubscribe_errors = subscribe(errors, (value) => $errors = value);
$$unsubscribe_constraints = subscribe(constraints, (value) => $constraints = value);
const controlContext = {
id: writable(id),
attrs: writable(),
labelAttrs: writable()
};
const { id: idStore } = controlContext;
$$unsubscribe_idStore = subscribe(idStore, (value) => $idStore = value);
setFormControl(controlContext);
if ($$props.id === void 0 && $$bindings.id && id !== void 0)
$$bindings.id(id);
{
controlContext.id.set(id);
}
errorAttr = getDataFsError($errors);
attrs = {
name: $name,
id: $idStore,
"data-fs-error": errorAttr,
"aria-describedby": getAriaDescribedBy({
fieldErrorsId: $fieldErrorsId,
descriptionId: $descriptionId,
errors: $errors
}),
"aria-invalid": getAriaInvalid($errors),
"aria-required": getAriaRequired($constraints),
"data-fs-control": ""
};
labelAttrs = {
for: $idStore,
"data-fs-label": "",
"data-fs-error": errorAttr
};
{
controlContext.attrs.set(attrs);
}
{
controlContext.labelAttrs.set(labelAttrs);
}
$$unsubscribe_idStore();
$$unsubscribe_constraints();
$$unsubscribe_errors();
$$unsubscribe_descriptionId();
$$unsubscribe_fieldErrorsId();
$$unsubscribe_name();
return ` ${slots.default ? slots.default({ attrs }) : ``}`;
});
const Field_errors = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let errorAttr;
let fieldErrorsAttrs;
let errorAttrs;
let $$restProps = compute_rest_props($$props, ["id", "asChild", "el"]);
let $fieldErrorsId, $$unsubscribe_fieldErrorsId;
let $errors, $$unsubscribe_errors;
const { fieldErrorsId, errors } = getFormField();
$$unsubscribe_fieldErrorsId = subscribe(fieldErrorsId, (value) => $fieldErrorsId = 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);
errorAttr = getDataFsError($errors);
{
fieldErrorsId.set(id);
}
fieldErrorsAttrs = {
id: $fieldErrorsId,
"data-fs-error": errorAttr,
"data-fs-field-errors": "",
"aria-live": "assertive",
...$$restProps
};
errorAttrs = {
"data-fs-field-error": "",
"data-fs-error": errorAttr
};
$$unsubscribe_fieldErrorsId();
$$unsubscribe_errors();
return ` ${asChild ? `${slots.default ? slots.default({
errors: $errors,
fieldErrorsAttrs,
errorAttrs
}) : ``}` : `<div${spread([escape_object(fieldErrorsAttrs)], {})}${add_attribute("this", el, 0)}>${slots.default ? slots.default({
errors: $errors,
fieldErrorsAttrs,
errorAttrs
}) : ` ${each($errors, (error) => {
return `<div${spread([escape_object(errorAttrs)], {})}>${escape(error)}</div>`;
})} `}</div>`}`;
});
const Label = 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(Label$1, "LabelPrimitive.Root").$$render(
$$result,
Object.assign(
{},
{
class: cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", className)
},
$$restProps
),
{},
{
default: () => {
return `${slots.default ? slots.default({}) : ``}`;
}
}
)}`;
});
const Form_label = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, ["class"]);
let $labelAttrs, $$unsubscribe_labelAttrs;
let { class: className = void 0 } = $$props;
const { labelAttrs } = getFormControl();
$$unsubscribe_labelAttrs = subscribe(labelAttrs, (value) => $labelAttrs = value);
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
$$bindings.class(className);
$$unsubscribe_labelAttrs();
return `${validate_component(Label, "Label").$$render(
$$result,
Object.assign(
{},
$labelAttrs,
{
class: cn("data-[fs-error]:text-destructive", className)
},
$$restProps
),
{},
{
default: () => {
return `${slots.default ? slots.default({ labelAttrs }) : ``}`;
}
}
)}`;
});
const Form_field_errors = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, ["class", "errorClasses"]);
let { class: className = void 0 } = $$props;
let { errorClasses = void 0 } = $$props;
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
$$bindings.class(className);
if ($$props.errorClasses === void 0 && $$bindings.errorClasses && errorClasses !== void 0)
$$bindings.errorClasses(errorClasses);
return `${validate_component(Field_errors, "FormPrimitive.FieldErrors").$$render(
$$result,
Object.assign(
{},
{
class: cn("text-sm font-medium text-destructive", className)
},
$$restProps
),
{},
{
default: ({ errors, fieldErrorsAttrs, errorAttrs }) => {
return `${slots.default ? slots.default({ errors, fieldErrorsAttrs, errorAttrs }) : ` ${each(errors, (error) => {
return `<div${spread(
[
escape_object(errorAttrs),
{
class: escape_attribute_value(cn(errorClasses))
}
],
{}
)}>${escape(error)}</div>`;
})} `}`;
}
}
)}`;
});
const Form_field = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let { form } = $$props;
let { name: name2 } = $$props;
let { class: className = void 0 } = $$props;
if ($$props.form === void 0 && $$bindings.form && form !== void 0)
$$bindings.form(form);
if ($$props.name === void 0 && $$bindings.name && name2 !== void 0)
$$bindings.name(name2);
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
$$bindings.class(className);
return `${validate_component(Field, "FormPrimitive.Field").$$render($$result, { form, name: name2 }, {}, {
default: ({ constraints, errors, tainted, value }) => {
return `<div${add_attribute("class", cn("space-y-2", className), 0)}>${slots.default ? slots.default({ constraints, errors, tainted, value }) : ``}</div>`;
}
})}`;
});
const Control = Control$1;
const Switch = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, ["class", "checked"]);
let { class: className = void 0 } = $$props;
let { checked = void 0 } = $$props;
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
$$bindings.class(className);
if ($$props.checked === void 0 && $$bindings.checked && checked !== void 0)
$$bindings.checked(checked);
let $$settled;
let $$rendered;
let previous_head = $$result.head;
do {
$$settled = true;
$$result.head = previous_head;
$$rendered = `${validate_component(Switch$1, "SwitchPrimitive.Root").$$render(
$$result,
Object.assign(
{},
{
class: cn("peer inline-flex h-[24px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className)
},
$$restProps,
{ checked }
),
{
checked: ($$value) => {
checked = $$value;
$$settled = false;
}
},
{
default: () => {
return `${validate_component(Switch_thumb, "SwitchPrimitive.Thumb").$$render(
$$result,
{
class: cn("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")
},
{},
{}
)}`;
}
}
)}`;
} while (!$$settled);
return $$rendered;
});
const Textarea = create_ssr_component(($$result, $$props, $$bindings, slots) => {
let $$restProps = compute_rest_props($$props, ["class", "value", "readonly"]);
let { class: className = void 0 } = $$props;
let { value = void 0 } = $$props;
let { readonly = void 0 } = $$props;
if ($$props.class === void 0 && $$bindings.class && className !== void 0)
$$bindings.class(className);
if ($$props.value === void 0 && $$bindings.value && value !== void 0)
$$bindings.value(value);
if ($$props.readonly === void 0 && $$bindings.readonly && readonly !== void 0)
$$bindings.readonly(readonly);
return `<textarea${spread(
[
{
class: escape_attribute_value(cn("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", className))
},
{ readonly: readonly || null },
escape_object($$restProps)
],
{}
)}>${escape(value || "")}</textarea>`;
});
export { Control as C, Form_field as F, Input as I, Label as L, Switch as S, Textarea as T, Form_label as a, Form_field_errors as b, createLabel as c, getDataFsError as d, generateId as e, getFormField as g };
//# sourceMappingURL=textarea-BkmEvMLa.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long