youtuber-blog-frontend/build/server/chunks/button-DV8DKkH_.js.map

1 line
12 KiB
Plaintext
Raw Normal View History

2024-05-29 18:43:41 +00:00
{"version":3,"file":"button-DV8DKkH_.js","sources":["../../../.svelte-kit/adapter-node/chunks/button.js"],"sourcesContent":["import { c as compute_rest_props } from \"./lifecycle.js\";\nimport { c as create_ssr_component, s as spread, a as escape_attribute_value, b as escape_object, d as add_attribute, v as validate_component } from \"./ssr.js\";\nimport \"dequal\";\nimport { l as is_void, E as buttonVariants } from \"./index3.js\";\nimport { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\nfunction getAttrs(builders) {\n const attrs = {};\n builders.forEach((builder) => {\n Object.keys(builder).forEach((key) => {\n if (key !== \"action\") {\n attrs[key] = builder[key];\n }\n });\n });\n return attrs;\n}\nconst Button$1 = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let $$restProps = compute_rest_props($$props, [\"href\", \"type\", \"builders\", \"el\"]);\n let { href = void 0 } = $$props;\n let { type = void 0 } = $$props;\n let { builders = [] } = $$props;\n let { el = void 0 } = $$props;\n const attrs = { \"data-button-root\": \"\" };\n if ($$props.href === void 0 && $$bindings.href && href !== void 0)\n $$bindings.href(href);\n if ($$props.type === void 0 && $$bindings.type && type !== void 0)\n $$bindings.type(type);\n if ($$props.builders === void 0 && $$bindings.builders && builders !== void 0)\n $$bindings.builders(builders);\n if ($$props.el === void 0 && $$bindings.el && el !== void 0)\n $$bindings.el(el);\n return `${builders && builders.length ? ` ${((tag) => {\n return tag ? `<${href ? \"a\" : \"button\"}${spread(\n [\n {\n type: escape_attribute_value(href ? void 0 : type)\n },\n { href: escape_attribute_value(href) },\n { tabindex: \"0\" },\n escape_object(getAttrs(builders)),\n escape_object($$restProps),\n escape_object(attrs)\n ],\n {}\n )}${add_attribute(\"this\", el, 0)}>${is_void(tag) ? \"\" : `${slots.default ? slots.default({}) : ``}`}${is_void(tag) ? \"\" : `</${tag}>`}` : \"\";\n })(href ? \"a\" : \"button\")}` : ` ${((tag) => {\n return tag ? `<${href ? \"a\" : \"button\"}${spread(\n [\n {\n type: escape_attribute_value(href ? void 0 : type)\n },\n { href: escape_attribute_value(href) },\n { tabindex: \"0\" },\n escape_object($$restProps),\n escape_object(attrs)\n ],\n {}\n )}${add_attribute(\"this\", el, 0)}>${is_void(tag) ? \"\" : `${slots.default ? slots.default({}) : ``}`}${is_void(tag) ? \"\" : `</${tag}>`}` : \"\";\n })(href ? \"a\" : \"button\")}`}`;\n});\nfunction cubicOut(t) {\n const f = t - 1;\n return f * f * f + 1;\n}\nfunction cn(...inputs) {\n return twMerge(clsx(inputs));\n}\nconst flyAndScale = (node, params = { y: -8, x: 0, start: 0.95, duration: 150 }) => {\n const style = getComputedStyle(node);\n const transform = style.transform === \"none\" ? \"\" : style.transform;\n const scaleConversion = (valueA, scaleA, scaleB) => {\n const [minA, maxA] = scaleA;\n const [minB, maxB] = scaleB;\n const percentage = (valueA - minA) / (maxA - minA);\n const valueB = percentage * (maxB - minB) + minB;\n return valueB;\n };\n const styleToString = (style2) => {\n return Object.keys(style2).reduce((str, key) => {\n if (style2[key] === void 0)\n return str;\n return str + `${key}:${style2[key]};`;\n }, \"\");\n };\n return {\n duration: params.duration ?? 200,\n delay: 0,\n css: (t) => {\n const y = scaleConversion(t, [0, 1], [params.y ?? 5, 0]);\n const x = scaleConversion(t, [0, 1], [params.x ?? 0, 0]);\n const scale = scaleConversion(t, [0, 1], [params.start ?? 0.95, 1]);\n return styleToString({\n transform: `${transform} translate3d(${x}px, ${y}px, 0) scale(${scale})`,\n opacity: t\n });\n },\n easing: cubicOut\n };\n};\nconst Button = create_ssr_component(($$result, $$props, $$bindings, slots) => {\n let $$restProps = compute_rest_props($$prop