youtuber-blog-frontend/build/server/chunks/index-pRP-dlMc.js.map

1 line
18 KiB
Plaintext
Raw Normal View History

2024-06-23 09:25:48 +00:00
{"version":3,"file":"index-pRP-dlMc.js","sources":["../../../.svelte-kit/adapter-node/chunks/Toaster.svelte_svelte_type_style_lang.js","../../../node_modules/nanoid/non-secure/index.js"],"sourcesContent":["import { w as withGet } from \"./index3.js\";\nimport { w as writable } from \"./index2.js\";\nimport { f as createEventDispatcher, b as get_store_value } from \"./lifecycle.js\";\nconst overridable = (_store, onChange) => {\n const store = withGet(_store);\n const update = (updater, sideEffect) => {\n store.update((curr) => {\n const next = updater(curr);\n let res = next;\n if (onChange) {\n res = onChange({ curr, next });\n }\n sideEffect?.(res);\n return res;\n });\n };\n const set = (curr) => {\n update(() => curr);\n };\n return {\n ...store,\n update,\n set\n };\n};\nfunction toWritableStores(properties) {\n const result = {};\n Object.keys(properties).forEach((key) => {\n const propertyKey = key;\n const value = properties[propertyKey];\n result[propertyKey] = withGet(writable(value));\n });\n return result;\n}\nfunction createBitAttrs(bit, parts) {\n const attrs = {};\n parts.forEach((part) => {\n attrs[part] = {\n [`data-${bit}-${part}`]: \"\"\n };\n });\n return (part) => attrs[part];\n}\nfunction disabledAttrs(disabled) {\n return disabled ? { \"aria-disabled\": \"true\", \"data-disabled\": \"\" } : { \"aria-disabled\": void 0, \"data-disabled\": void 0 };\n}\nfunction createDispatcher() {\n const dispatch = createEventDispatcher();\n return (e) => {\n const { originalEvent } = e.detail;\n const { cancelable } = e;\n const type = originalEvent.type;\n const shouldContinue = dispatch(type, { originalEvent, currentTarget: originalEvent.currentTarget }, { cancelable });\n if (!shouldContinue) {\n e.preventDefault();\n }\n };\n}\nfunction removeUndefined(obj) {\n const result = {};\n for (const key in obj) {\n const value = obj[key];\n if (value !== void 0) {\n result[key] = value;\n }\n }\n return result;\n}\nfunction getOptionUpdater(options) {\n return function(key, value) {\n if (value === void 0)\n return;\n const store = options[key];\n if (store) {\n store.set(value);\n }\n };\n}\nfunction cn(...classes) {\n return classes.filter(Boolean).join(\" \");\n}\nconst isBrowser = typeof document !== \"undefined\";\nfunction clientWritable(initialValue) {\n const store = writable(initialValue);\n function set(value) {\n if (isBrowser) {\n store.set(value);\n }\n }\n function update(updater) {\n if (isBrowser) {\n store.update(updater);\n }\n }\n return {\n subscribe: store.subscribe,\n set,\n update\n };\n}\nlet toastsCounter = 0;\nfunction createToastState() {\n const toasts = clientWritable([]);\n const heights = clientWritable([]);\n function addToast(data) {\n toasts.update((prev) => [data, ...prev]);\n }\n function create(data) {\n const { message: message2, ...rest } = data;\n const id = typeof data?.id === \"number\" || data.id && data.id?.length > 0 ? data.id : toastsCounter++;\n const dismissable = data.dismissable === void 0 ? true : data.dismissable;\n const type = data.type === void 0 ? \"default\" : data.type;\n const $toasts = get_store_value(toasts);\n const alreadyExists = $toasts.find((toast2) => {\n return toast2.id === id;\n });\n if (alreadyExists) {\n toasts.update((prev) => prev.map((toast2) => {\n if (toast2.id === id) {\n return {\n ...toast2,\n ...data,\n id,\n title: message2,\n dismissable,\n type,\n updated: true\n };\n }\n return {\n ...toast2,\n updated: false\n };\n }));\n } else {\n addToast({ ...rest, id, title: message2, dismissable, type });\n }\n return id;\n }\n function dismiss(id) {\n if (id === void 0) {\n toasts.set([]);\n return;\n }\n toasts.update((prev)