@betterstore/react 0.5.17 → 0.5.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -27,8 +27,8 @@ const createStoreImpl = (createState) => {
27
27
  };
28
28
  const createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
29
29
 
30
- const identity = (arg) => arg;
31
- function useStore(api, selector = identity) {
30
+ const identity$1 = (arg) => arg;
31
+ function useStore(api, selector = identity$1) {
32
32
  const slice = React__default.useSyncExternalStore(
33
33
  api.subscribe,
34
34
  () => selector(api.getState()),
@@ -7497,9 +7497,9 @@ function createStoreHelpers(config) {
7497
7497
  return new helpers_default(config?.proxy);
7498
7498
  }
7499
7499
 
7500
- var css_248z = "/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-sans: var(--font-sans), Helvetica, Arial, apple-system, sans-serif;\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --container-lg: 32rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-tight: -0.025em;\n --tracking-widest: 0.1em;\n --radius-xs: 0.125rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans), Helvetica, Arial, apple-system, sans-serif;\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .-top-2 {\n top: calc(var(--spacing) * -2);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-0\\.5 {\n top: calc(var(--spacing) * 0.5);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .top-4 {\n top: calc(var(--spacing) * 4);\n }\n .top-\\[50\\%\\] {\n top: 50%;\n }\n .top-full {\n top: 100%;\n }\n .-right-2 {\n right: calc(var(--spacing) * -2);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-4 {\n right: calc(var(--spacing) * 4);\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .left-2 {\n left: calc(var(--spacing) * 2);\n }\n .left-\\[50\\%\\] {\n left: 50%;\n }\n .z-0 {\n z-index: 0;\n }\n .z-10 {\n z-index: 10;\n }\n .z-50 {\n z-index: 50;\n }\n .order-3 {\n order: 3;\n }\n .order-4 {\n order: 4;\n }\n .order-5 {\n order: 5;\n }\n .order-6 {\n order: 6;\n }\n .order-7 {\n order: 7;\n }\n .order-first {\n order: -9999;\n }\n .-m-0\\.5 {\n margin: calc(var(--spacing) * -0.5);\n }\n .m-0 {\n margin: calc(var(--spacing) * 0);\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1);\n }\n .my-1 {\n margin-block: calc(var(--spacing) * 1);\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2);\n }\n .-mt-1 {\n margin-top: calc(var(--spacing) * -1);\n }\n .-mt-2 {\n margin-top: calc(var(--spacing) * -2);\n }\n .-mt-4 {\n margin-top: calc(var(--spacing) * -4);\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mt-8 {\n margin-top: calc(var(--spacing) * 8);\n }\n .-mb-0\\.5 {\n margin-bottom: calc(var(--spacing) * -0.5);\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .ml-4 {\n margin-left: calc(var(--spacing) * 4);\n }\n .ml-auto {\n margin-left: auto;\n }\n .line-clamp-1 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .grid {\n display: grid;\n }\n .hidden {\n display: none;\n }\n .inline-flex {\n display: inline-flex;\n }\n .aspect-square {\n aspect-ratio: 1 / 1;\n }\n .size-2 {\n width: calc(var(--spacing) * 2);\n height: calc(var(--spacing) * 2);\n }\n .size-3 {\n width: calc(var(--spacing) * 3);\n height: calc(var(--spacing) * 3);\n }\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5);\n height: calc(var(--spacing) * 3.5);\n }\n .size-4 {\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n }\n .size-5 {\n width: calc(var(--spacing) * 5);\n height: calc(var(--spacing) * 5);\n }\n .size-9 {\n width: calc(var(--spacing) * 9);\n height: calc(var(--spacing) * 9);\n }\n .size-16 {\n width: calc(var(--spacing) * 16);\n height: calc(var(--spacing) * 16);\n }\n .h-0 {\n height: calc(var(--spacing) * 0);\n }\n .h-3\\.5 {\n height: calc(var(--spacing) * 3.5);\n }\n .h-4 {\n height: calc(var(--spacing) * 4);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-6 {\n height: calc(var(--spacing) * 6);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-9 {\n height: calc(var(--spacing) * 9);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-12 {\n height: calc(var(--spacing) * 12);\n }\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n .h-\\[18px\\] {\n height: 18px;\n }\n .h-\\[20px\\] {\n height: 20px;\n }\n .h-\\[44px\\] {\n height: 44px;\n }\n .h-auto {\n height: auto;\n }\n .h-auto\\! {\n height: auto !important;\n }\n .h-full {\n height: 100%;\n }\n .h-max {\n height: max-content;\n }\n .h-px {\n height: 1px;\n }\n .max-h-\\(--radix-dropdown-menu-content-available-height\\) {\n max-height: var(--radix-dropdown-menu-content-available-height);\n }\n .max-h-0 {\n max-height: calc(var(--spacing) * 0);\n }\n .max-h-60 {\n max-height: calc(var(--spacing) * 60);\n }\n .max-h-\\[300px\\] {\n max-height: 300px;\n }\n .min-h-full {\n min-height: 100%;\n }\n .w-0 {\n width: calc(var(--spacing) * 0);\n }\n .w-4 {\n width: calc(var(--spacing) * 4);\n }\n .w-6 {\n width: calc(var(--spacing) * 6);\n }\n .w-12 {\n width: calc(var(--spacing) * 12);\n }\n .w-16 {\n width: calc(var(--spacing) * 16);\n }\n .w-20 {\n width: calc(var(--spacing) * 20);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-28 {\n width: calc(var(--spacing) * 28);\n }\n .w-32 {\n width: calc(var(--spacing) * 32);\n }\n .w-40 {\n width: calc(var(--spacing) * 40);\n }\n .w-72 {\n width: calc(var(--spacing) * 72);\n }\n .w-full {\n width: 100%;\n }\n .max-w-0 {\n max-width: calc(var(--spacing) * 0);\n }\n .max-w-\\[calc\\(100\\%-2rem\\)\\] {\n max-width: calc(100% - 2rem);\n }\n .min-w-0 {\n min-width: calc(var(--spacing) * 0);\n }\n .min-w-\\[8rem\\] {\n min-width: 8rem;\n }\n .flex-1 {\n flex: 1;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .origin-\\(--radix-dropdown-menu-content-transform-origin\\) {\n transform-origin: var(--radix-dropdown-menu-content-transform-origin);\n }\n .origin-\\(--radix-popover-content-transform-origin\\) {\n transform-origin: var(--radix-popover-content-transform-origin);\n }\n .-translate-x-0 {\n --tw-translate-x: calc(var(--spacing) * -0);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-x-3 {\n --tw-translate-x: calc(var(--spacing) * -3);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-x-2 {\n --tw-translate-x: calc(var(--spacing) * 2);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50%;\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50%;\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .rotate-180 {\n rotate: 180deg;\n }\n .animate-pulse {\n animation: var(--animate-pulse);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .cursor-default {\n cursor: default;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .scroll-py-1 {\n scroll-padding-block: calc(var(--spacing) * 1);\n }\n .grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-col-reverse {\n flex-direction: column-reverse;\n }\n .items-center {\n align-items: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-end {\n justify-content: flex-end;\n }\n .gap-0 {\n gap: calc(var(--spacing) * 0);\n }\n .gap-0\\.5 {\n gap: calc(var(--spacing) * 0.5);\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4);\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5);\n }\n .gap-6 {\n gap: calc(var(--spacing) * 6);\n }\n .gap-\\[10px\\] {\n gap: 10px;\n }\n .space-y-2 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-5 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-6 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-x-hidden {\n overflow-x: hidden;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded-\\[4px\\] {\n border-radius: 4px;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-lg {\n border-radius: var(--radius);\n }\n .rounded-md {\n border-radius: calc(var(--radius) - 2px);\n }\n .rounded-sm {\n border-radius: calc(var(--radius) - 4px);\n }\n .rounded-xs {\n border-radius: var(--radius-xs);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-border {\n border-color: var(--border);\n }\n .border-input {\n border-color: var(--input);\n }\n .border-primary {\n border-color: var(--primary);\n }\n .bg-accent {\n background-color: var(--accent);\n }\n .bg-background {\n background-color: var(--background);\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .bg-border {\n background-color: var(--border);\n }\n .bg-destructive {\n background-color: var(--destructive);\n }\n .bg-muted {\n background-color: var(--muted);\n }\n .bg-popover {\n background-color: var(--popover);\n }\n .bg-primary {\n background-color: var(--primary);\n }\n .bg-secondary {\n background-color: var(--secondary);\n }\n .bg-transparent {\n background-color: transparent;\n }\n .fill-current {\n fill: currentcolor;\n }\n .fill-primary {\n fill: var(--primary);\n }\n .object-cover {\n object-fit: cover;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0);\n }\n .p-1 {\n padding: calc(var(--spacing) * 1);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .p-6 {\n padding: calc(var(--spacing) * 6);\n }\n .px-1 {\n padding-inline: calc(var(--spacing) * 1);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4);\n }\n .py-6 {\n padding-block: calc(var(--spacing) * 6);\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2);\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4);\n }\n .pr-2 {\n padding-right: calc(var(--spacing) * 2);\n }\n .pb-1 {\n padding-bottom: calc(var(--spacing) * 1);\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2);\n }\n .pl-8 {\n padding-left: calc(var(--spacing) * 8);\n }\n .text-center {\n text-align: center;\n }\n .text-left {\n text-align: left;\n }\n .text-right {\n text-align: right;\n }\n .text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .text-\\[13px\\] {\n font-size: 13px;\n }\n .leading-none {\n --tw-leading: 1;\n line-height: 1;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .tracking-tight {\n --tw-tracking: var(--tracking-tight);\n letter-spacing: var(--tracking-tight);\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest);\n letter-spacing: var(--tracking-widest);\n }\n .text-ellipsis {\n text-overflow: ellipsis;\n }\n .whitespace-nowrap {\n white-space: nowrap;\n }\n .text-background {\n color: var(--background);\n }\n .text-current {\n color: currentcolor;\n }\n .text-destructive {\n color: var(--destructive);\n }\n .text-destructive-foreground {\n color: var(--destructive-foreground);\n }\n .text-foreground {\n color: var(--foreground);\n }\n .text-input {\n color: var(--input);\n }\n .text-muted-foreground {\n color: var(--muted-foreground);\n }\n .text-popover-foreground {\n color: var(--popover-foreground);\n }\n .text-primary {\n color: var(--primary);\n }\n .text-primary-foreground {\n color: var(--primary-foreground);\n }\n .text-red-500 {\n color: var(--color-red-500);\n }\n .text-ring {\n color: var(--ring);\n }\n .text-secondary-foreground {\n color: var(--secondary-foreground);\n }\n .text-white {\n color: var(--color-white);\n }\n .line-through {\n text-decoration-line: line-through;\n }\n .underline {\n text-decoration-line: underline;\n }\n .underline-offset-4 {\n text-underline-offset: 4px;\n }\n .opacity-0 {\n opacity: 0%;\n }\n .opacity-50 {\n opacity: 50%;\n }\n .opacity-70 {\n opacity: 70%;\n }\n .opacity-100 {\n opacity: 100%;\n }\n .shadow {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-xs {\n --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .ring-offset-background {\n --tw-ring-offset-color: var(--background);\n }\n .outline-hidden {\n --tw-outline-style: none;\n outline-style: none;\n @media (forced-colors: active) {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n }\n .outline {\n outline-style: var(--tw-outline-style);\n outline-width: 1px;\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-\\[color\\,box-shadow\\] {\n transition-property: color,box-shadow;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-shadow {\n transition-property: box-shadow;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-none {\n transition-property: none;\n }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .outline-none {\n --tw-outline-style: none;\n outline-style: none;\n }\n .select-none {\n -webkit-user-select: none;\n user-select: none;\n }\n .duration-200 {\n animation-duration: 200ms;\n }\n .ease-in-out {\n animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n }\n .group-data-\\[disabled\\=true\\]\\:pointer-events-none {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n pointer-events: none;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:opacity-50 {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n opacity: 50%;\n }\n }\n .peer-disabled\\:cursor-not-allowed {\n &:is(:where(.peer):disabled ~ *) {\n cursor: not-allowed;\n }\n }\n .peer-disabled\\:opacity-50 {\n &:is(:where(.peer):disabled ~ *) {\n opacity: 50%;\n }\n }\n .file\\:inline-flex {\n &::file-selector-button {\n display: inline-flex;\n }\n }\n .file\\:h-7 {\n &::file-selector-button {\n height: calc(var(--spacing) * 7);\n }\n }\n .file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style);\n border-width: 0px;\n }\n }\n .file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent;\n }\n }\n .file\\:text-sm {\n &::file-selector-button {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n }\n .file\\:font-medium {\n &::file-selector-button {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n }\n .file\\:text-foreground {\n &::file-selector-button {\n color: var(--foreground);\n }\n }\n .placeholder\\:text-muted-foreground {\n &::placeholder {\n color: var(--muted-foreground);\n }\n }\n .after\\:absolute {\n &::after {\n content: var(--tw-content);\n position: absolute;\n }\n }\n .after\\:top-1\\/2 {\n &::after {\n content: var(--tw-content);\n top: calc(1/2 * 100%);\n }\n }\n .after\\:right-0 {\n &::after {\n content: var(--tw-content);\n right: calc(var(--spacing) * 0);\n }\n }\n .after\\:left-0 {\n &::after {\n content: var(--tw-content);\n left: calc(var(--spacing) * 0);\n }\n }\n .after\\:z-0 {\n &::after {\n content: var(--tw-content);\n z-index: 0;\n }\n }\n .after\\:h-px {\n &::after {\n content: var(--tw-content);\n height: 1px;\n }\n }\n .after\\:-translate-y-1\\/2 {\n &::after {\n content: var(--tw-content);\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n }\n .after\\:bg-background {\n &::after {\n content: var(--tw-content);\n background-color: var(--background);\n }\n }\n .after\\:content-\\[\\'\\'\\] {\n &::after {\n content: var(--tw-content);\n --tw-content: '';\n content: var(--tw-content);\n }\n }\n .last\\:border-b-0 {\n &:last-child {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 0px;\n }\n }\n .hover\\:bg-accent {\n &:hover {\n @media (hover: hover) {\n background-color: var(--accent);\n }\n }\n }\n .hover\\:bg-destructive\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--destructive) 90%, transparent);\n }\n }\n }\n }\n .hover\\:bg-muted {\n &:hover {\n @media (hover: hover) {\n background-color: var(--muted);\n }\n }\n }\n .hover\\:bg-primary\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--primary);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--primary) 90%, transparent);\n }\n }\n }\n }\n .hover\\:bg-secondary\\/80 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--secondary);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--secondary) 80%, transparent);\n }\n }\n }\n }\n .hover\\:text-accent-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--accent-foreground);\n }\n }\n }\n .hover\\:text-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--foreground);\n }\n }\n }\n .hover\\:text-muted-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--muted-foreground);\n }\n }\n }\n .hover\\:underline {\n &:hover {\n @media (hover: hover) {\n text-decoration-line: underline;\n }\n }\n }\n .hover\\:opacity-100 {\n &:hover {\n @media (hover: hover) {\n opacity: 100%;\n }\n }\n }\n .focus\\:bg-accent {\n &:focus {\n background-color: var(--accent);\n }\n }\n .focus\\:text-accent-foreground {\n &:focus {\n color: var(--accent-foreground);\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus\\:ring-ring {\n &:focus {\n --tw-ring-color: var(--ring);\n }\n }\n .focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n }\n .focus\\:outline-hidden {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n @media (forced-colors: active) {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n }\n }\n .focus-visible\\:border-ring {\n &:focus-visible {\n border-color: var(--ring);\n }\n }\n .focus-visible\\:ring-\\[3px\\] {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus-visible\\:ring-destructive\\/20 {\n &:focus-visible {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent);\n }\n }\n }\n .focus-visible\\:ring-ring\\/50 {\n &:focus-visible {\n --tw-ring-color: var(--ring);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent);\n }\n }\n }\n .disabled\\:pointer-events-none {\n &:disabled {\n pointer-events: none;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n }\n .has-\\[\\>svg\\]\\:px-2\\.5 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 2.5);\n }\n }\n .has-\\[\\>svg\\]\\:px-3 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 3);\n }\n }\n .has-\\[\\>svg\\]\\:px-4 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 4);\n }\n }\n .aria-invalid\\:border-destructive {\n &[aria-invalid=\"true\"] {\n border-color: var(--destructive);\n }\n }\n .aria-invalid\\:ring-destructive\\/20 {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent);\n }\n }\n }\n .data-\\[disabled\\]\\:pointer-events-none {\n &[data-disabled] {\n pointer-events: none;\n }\n }\n .data-\\[disabled\\]\\:opacity-50 {\n &[data-disabled] {\n opacity: 50%;\n }\n }\n .data-\\[disabled\\=true\\]\\:pointer-events-none {\n &[data-disabled=\"true\"] {\n pointer-events: none;\n }\n }\n .data-\\[disabled\\=true\\]\\:opacity-50 {\n &[data-disabled=\"true\"] {\n opacity: 50%;\n }\n }\n .data-\\[error\\=true\\]\\:text-destructive-foreground {\n &[data-error=\"true\"] {\n color: var(--destructive-foreground);\n }\n }\n .data-\\[inset\\]\\:pl-8 {\n &[data-inset] {\n padding-left: calc(var(--spacing) * 8);\n }\n }\n .data-\\[selected\\=true\\]\\:bg-accent {\n &[data-selected=\"true\"] {\n background-color: var(--accent);\n }\n }\n .data-\\[selected\\=true\\]\\:text-accent-foreground {\n &[data-selected=\"true\"] {\n color: var(--accent-foreground);\n }\n }\n .data-\\[side\\=bottom\\]\\:slide-in-from-top-2 {\n &[data-side=\"bottom\"] {\n --tw-enter-translate-y: -0.5rem;\n }\n }\n .data-\\[side\\=left\\]\\:slide-in-from-right-2 {\n &[data-side=\"left\"] {\n --tw-enter-translate-x: 0.5rem;\n }\n }\n .data-\\[side\\=right\\]\\:slide-in-from-left-2 {\n &[data-side=\"right\"] {\n --tw-enter-translate-x: -0.5rem;\n }\n }\n .data-\\[side\\=top\\]\\:slide-in-from-bottom-2 {\n &[data-side=\"top\"] {\n --tw-enter-translate-y: 0.5rem;\n }\n }\n .\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 {\n :is(& *) {\n &[data-slot=\"command-input-wrapper\"] {\n height: calc(var(--spacing) * 12);\n }\n }\n }\n .data-\\[state\\=checked\\]\\:border-primary {\n &[data-state=\"checked\"] {\n border-color: var(--primary);\n }\n }\n .data-\\[state\\=checked\\]\\:bg-primary {\n &[data-state=\"checked\"] {\n background-color: var(--primary);\n }\n }\n .data-\\[state\\=checked\\]\\:text-primary-foreground {\n &[data-state=\"checked\"] {\n color: var(--primary-foreground);\n }\n }\n .data-\\[state\\=closed\\]\\:animate-out {\n &[data-state=\"closed\"] {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n }\n }\n .data-\\[state\\=closed\\]\\:fade-out-0 {\n &[data-state=\"closed\"] {\n --tw-exit-opacity: 0;\n }\n }\n .data-\\[state\\=closed\\]\\:zoom-out-95 {\n &[data-state=\"closed\"] {\n --tw-exit-scale: .95;\n }\n }\n .data-\\[state\\=open\\]\\:bg-accent {\n &[data-state=\"open\"] {\n background-color: var(--accent);\n }\n }\n .data-\\[state\\=open\\]\\:text-accent-foreground {\n &[data-state=\"open\"] {\n color: var(--accent-foreground);\n }\n }\n .data-\\[state\\=open\\]\\:text-muted-foreground {\n &[data-state=\"open\"] {\n color: var(--muted-foreground);\n }\n }\n .data-\\[state\\=open\\]\\:animate-in {\n &[data-state=\"open\"] {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n }\n }\n .data-\\[state\\=open\\]\\:fade-in-0 {\n &[data-state=\"open\"] {\n --tw-enter-opacity: 0;\n }\n }\n .data-\\[state\\=open\\]\\:zoom-in-95 {\n &[data-state=\"open\"] {\n --tw-enter-scale: .95;\n }\n }\n .data-\\[variant\\=destructive\\]\\:text-destructive {\n &[data-variant=\"destructive\"] {\n color: var(--destructive);\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10 {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--destructive) 10%, transparent);\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:text-destructive {\n &[data-variant=\"destructive\"] {\n &:focus {\n color: var(--destructive);\n }\n }\n }\n .max-md\\:cursor-pointer {\n @media (width < 48rem) {\n cursor: pointer;\n }\n }\n .max-sm\\:hidden {\n @media (width < 40rem) {\n display: none;\n }\n }\n .sm\\:max-w-lg {\n @media (width >= 40rem) {\n max-width: var(--container-lg);\n }\n }\n .sm\\:flex-row {\n @media (width >= 40rem) {\n flex-direction: row;\n }\n }\n .sm\\:justify-end {\n @media (width >= 40rem) {\n justify-content: flex-end;\n }\n }\n .sm\\:text-left {\n @media (width >= 40rem) {\n text-align: left;\n }\n }\n .md\\:order-last {\n @media (width >= 48rem) {\n order: 9999;\n }\n }\n .md\\:order-none {\n @media (width >= 48rem) {\n order: 0;\n }\n }\n .md\\:col-span-2 {\n @media (width >= 48rem) {\n grid-column: span 2 / span 2;\n }\n }\n .md\\:col-span-3 {\n @media (width >= 48rem) {\n grid-column: span 3 / span 3;\n }\n }\n .md\\:col-span-4 {\n @media (width >= 48rem) {\n grid-column: span 4 / span 4;\n }\n }\n .md\\:block {\n @media (width >= 48rem) {\n display: block;\n }\n }\n .md\\:flex {\n @media (width >= 48rem) {\n display: flex;\n }\n }\n .md\\:grid {\n @media (width >= 48rem) {\n display: grid;\n }\n }\n .md\\:hidden {\n @media (width >= 48rem) {\n display: none;\n }\n }\n .md\\:max-w-\\[75\\%\\] {\n @media (width >= 48rem) {\n max-width: 75%;\n }\n }\n .md\\:grid-cols-2 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n }\n .md\\:grid-cols-3 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n }\n .md\\:grid-cols-7 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(7, minmax(0, 1fr));\n }\n }\n .md\\:gap-0 {\n @media (width >= 48rem) {\n gap: calc(var(--spacing) * 0);\n }\n }\n .md\\:px-8 {\n @media (width >= 48rem) {\n padding-inline: calc(var(--spacing) * 8);\n }\n }\n .md\\:py-12 {\n @media (width >= 48rem) {\n padding-block: calc(var(--spacing) * 12);\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n }\n .dark\\:focus-visible\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &:focus-visible {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent);\n }\n }\n }\n }\n .dark\\:aria-invalid\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent);\n }\n }\n }\n }\n .dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20 {\n @media (prefers-color-scheme: dark) {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--destructive) 20%, transparent);\n }\n }\n }\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 {\n & [cmdk-group-heading] {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 {\n & [cmdk-group-heading] {\n padding-block: calc(var(--spacing) * 1.5);\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs {\n & [cmdk-group-heading] {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium {\n & [cmdk-group-heading] {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground {\n & [cmdk-group-heading] {\n color: var(--muted-foreground);\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\]\\:px-2 {\n & [cmdk-group] {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 {\n & [cmdk-group]:not([hidden]) ~[cmdk-group] {\n padding-top: calc(var(--spacing) * 0);\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 {\n & [cmdk-input-wrapper] svg {\n height: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 {\n & [cmdk-input-wrapper] svg {\n width: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_\\[cmdk-input\\]\\]\\:h-12 {\n & [cmdk-input] {\n height: calc(var(--spacing) * 12);\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:px-2 {\n & [cmdk-item] {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:py-3 {\n & [cmdk-item] {\n padding-block: calc(var(--spacing) * 3);\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 {\n & [cmdk-item] svg {\n height: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 {\n & [cmdk-item] svg {\n width: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_svg\\]\\:pointer-events-none {\n & svg {\n pointer-events: none;\n }\n }\n .\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 {\n & svg:not([class*='size-']) {\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground {\n & svg:not([class*='text-']) {\n color: var(--muted-foreground);\n }\n }\n .data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive {\n &[data-variant=\"destructive\"] {\n :is(& > *) {\n &:is(svg) {\n color: var(--destructive) !important;\n }\n }\n }\n }\n}\n@layer base {\n ::selection {\n background-color: var(--primary);\n color: var(--primary-foreground);\n }\n * {\n --tw-border-style: solid;\n border-style: solid;\n border-color: var(--border);\n outline-color: var(--ring);\n @supports (color: color-mix(in lab, red, red)) {\n outline-color: color-mix(in oklab, var(--ring) 50%, transparent);\n }\n }\n .checkout-embed {\n background-color: var(--background);\n font-family: var(--font-sans), Helvetica, Arial, apple-system, sans-serif;\n color: var(--foreground);\n }\n h2 {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n --tw-tracking: var(--tracking-tight);\n letter-spacing: var(--tracking-tight);\n }\n p {\n --tw-tracking: var(--tracking-tight);\n letter-spacing: var(--tracking-tight);\n }\n}\n@layer utilities {\n .scrollbar-hidden {\n scrollbar-width: none;\n }\n .scrollbar-hidden::-webkit-scrollbar {\n display: none;\n }\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-tracking {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-outline-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ease {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-content {\n syntax: \"*\";\n initial-value: \"\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-outline-style: solid;\n --tw-duration: initial;\n --tw-ease: initial;\n --tw-content: \"\";\n }\n }\n}\n";
7500
+ var css_248z = "/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n :root, :host {\n --font-sans: var(--font-sans), Helvetica, Arial, apple-system, sans-serif;\n --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\",\n \"Courier New\", monospace;\n --color-red-500: oklch(63.7% 0.237 25.331);\n --color-black: #000;\n --color-white: #fff;\n --spacing: 0.25rem;\n --container-lg: 32rem;\n --text-xs: 0.75rem;\n --text-xs--line-height: calc(1 / 0.75);\n --text-sm: 0.875rem;\n --text-sm--line-height: calc(1.25 / 0.875);\n --text-base: 1rem;\n --text-base--line-height: calc(1.5 / 1);\n --text-lg: 1.125rem;\n --text-lg--line-height: calc(1.75 / 1.125);\n --text-2xl: 1.5rem;\n --text-2xl--line-height: calc(2 / 1.5);\n --font-weight-medium: 500;\n --font-weight-semibold: 600;\n --font-weight-bold: 700;\n --tracking-tight: -0.025em;\n --tracking-widest: 0.1em;\n --radius-xs: 0.125rem;\n --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);\n --animate-spin: spin 1s linear infinite;\n --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n --default-transition-duration: 150ms;\n --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n --default-font-family: var(--font-sans), Helvetica, Arial, apple-system, sans-serif;\n --default-mono-font-family: var(--font-mono);\n }\n}\n@layer base {\n *, ::after, ::before, ::backdrop, ::file-selector-button {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n border: 0 solid;\n }\n html, :host {\n line-height: 1.5;\n -webkit-text-size-adjust: 100%;\n tab-size: 4;\n font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\");\n font-feature-settings: var(--default-font-feature-settings, normal);\n font-variation-settings: var(--default-font-variation-settings, normal);\n -webkit-tap-highlight-color: transparent;\n }\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n abbr:where([title]) {\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n }\n h1, h2, h3, h4, h5, h6 {\n font-size: inherit;\n font-weight: inherit;\n }\n a {\n color: inherit;\n -webkit-text-decoration: inherit;\n text-decoration: inherit;\n }\n b, strong {\n font-weight: bolder;\n }\n code, kbd, samp, pre {\n font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace);\n font-feature-settings: var(--default-mono-font-feature-settings, normal);\n font-variation-settings: var(--default-mono-font-variation-settings, normal);\n font-size: 1em;\n }\n small {\n font-size: 80%;\n }\n sub, sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n sub {\n bottom: -0.25em;\n }\n sup {\n top: -0.5em;\n }\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n :-moz-focusring {\n outline: auto;\n }\n progress {\n vertical-align: baseline;\n }\n summary {\n display: list-item;\n }\n ol, ul, menu {\n list-style: none;\n }\n img, svg, video, canvas, audio, iframe, embed, object {\n display: block;\n vertical-align: middle;\n }\n img, video {\n max-width: 100%;\n height: auto;\n }\n button, input, select, optgroup, textarea, ::file-selector-button {\n font: inherit;\n font-feature-settings: inherit;\n font-variation-settings: inherit;\n letter-spacing: inherit;\n color: inherit;\n border-radius: 0;\n background-color: transparent;\n opacity: 1;\n }\n :where(select:is([multiple], [size])) optgroup {\n font-weight: bolder;\n }\n :where(select:is([multiple], [size])) optgroup option {\n padding-inline-start: 20px;\n }\n ::file-selector-button {\n margin-inline-end: 4px;\n }\n ::placeholder {\n opacity: 1;\n }\n @supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px) {\n ::placeholder {\n color: currentcolor;\n @supports (color: color-mix(in lab, red, red)) {\n color: color-mix(in oklab, currentcolor 50%, transparent);\n }\n }\n }\n textarea {\n resize: vertical;\n }\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n ::-webkit-date-and-time-value {\n min-height: 1lh;\n text-align: inherit;\n }\n ::-webkit-datetime-edit {\n display: inline-flex;\n }\n ::-webkit-datetime-edit-fields-wrapper {\n padding: 0;\n }\n ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n padding-block: 0;\n }\n :-moz-ui-invalid {\n box-shadow: none;\n }\n button, input:where([type=\"button\"], [type=\"reset\"], [type=\"submit\"]), ::file-selector-button {\n appearance: button;\n }\n ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n height: auto;\n }\n [hidden]:where(:not([hidden=\"until-found\"])) {\n display: none !important;\n }\n}\n@layer utilities {\n .pointer-events-none {\n pointer-events: none;\n }\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n .absolute {\n position: absolute;\n }\n .fixed {\n position: fixed;\n }\n .relative {\n position: relative;\n }\n .inset-0 {\n inset: calc(var(--spacing) * 0);\n }\n .-top-2 {\n top: calc(var(--spacing) * -2);\n }\n .top-0 {\n top: calc(var(--spacing) * 0);\n }\n .top-0\\.5 {\n top: calc(var(--spacing) * 0.5);\n }\n .top-1\\/2 {\n top: calc(1/2 * 100%);\n }\n .top-4 {\n top: calc(var(--spacing) * 4);\n }\n .top-\\[50\\%\\] {\n top: 50%;\n }\n .top-full {\n top: 100%;\n }\n .-right-2 {\n right: calc(var(--spacing) * -2);\n }\n .right-0 {\n right: calc(var(--spacing) * 0);\n }\n .right-4 {\n right: calc(var(--spacing) * 4);\n }\n .left-0 {\n left: calc(var(--spacing) * 0);\n }\n .left-1\\/2 {\n left: calc(1/2 * 100%);\n }\n .left-2 {\n left: calc(var(--spacing) * 2);\n }\n .left-\\[50\\%\\] {\n left: 50%;\n }\n .z-0 {\n z-index: 0;\n }\n .z-10 {\n z-index: 10;\n }\n .z-50 {\n z-index: 50;\n }\n .order-3 {\n order: 3;\n }\n .order-4 {\n order: 4;\n }\n .order-5 {\n order: 5;\n }\n .order-6 {\n order: 6;\n }\n .order-7 {\n order: 7;\n }\n .order-first {\n order: -9999;\n }\n .-m-0\\.5 {\n margin: calc(var(--spacing) * -0.5);\n }\n .m-0 {\n margin: calc(var(--spacing) * 0);\n }\n .-mx-1 {\n margin-inline: calc(var(--spacing) * -1);\n }\n .my-1 {\n margin-block: calc(var(--spacing) * 1);\n }\n .my-2 {\n margin-block: calc(var(--spacing) * 2);\n }\n .-mt-1 {\n margin-top: calc(var(--spacing) * -1);\n }\n .-mt-2 {\n margin-top: calc(var(--spacing) * -2);\n }\n .-mt-4 {\n margin-top: calc(var(--spacing) * -4);\n }\n .mt-1 {\n margin-top: calc(var(--spacing) * 1);\n }\n .mt-2 {\n margin-top: calc(var(--spacing) * 2);\n }\n .mt-8 {\n margin-top: calc(var(--spacing) * 8);\n }\n .-mb-0\\.5 {\n margin-bottom: calc(var(--spacing) * -0.5);\n }\n .-mb-2 {\n margin-bottom: calc(var(--spacing) * -2);\n }\n .mb-1 {\n margin-bottom: calc(var(--spacing) * 1);\n }\n .mb-2 {\n margin-bottom: calc(var(--spacing) * 2);\n }\n .mb-4 {\n margin-bottom: calc(var(--spacing) * 4);\n }\n .ml-4 {\n margin-left: calc(var(--spacing) * 4);\n }\n .ml-auto {\n margin-left: auto;\n }\n .line-clamp-1 {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 1;\n }\n .block {\n display: block;\n }\n .flex {\n display: flex;\n }\n .grid {\n display: grid;\n }\n .hidden {\n display: none;\n }\n .inline-flex {\n display: inline-flex;\n }\n .aspect-square {\n aspect-ratio: 1 / 1;\n }\n .size-2 {\n width: calc(var(--spacing) * 2);\n height: calc(var(--spacing) * 2);\n }\n .size-3 {\n width: calc(var(--spacing) * 3);\n height: calc(var(--spacing) * 3);\n }\n .size-3\\.5 {\n width: calc(var(--spacing) * 3.5);\n height: calc(var(--spacing) * 3.5);\n }\n .size-4 {\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n }\n .size-5 {\n width: calc(var(--spacing) * 5);\n height: calc(var(--spacing) * 5);\n }\n .size-9 {\n width: calc(var(--spacing) * 9);\n height: calc(var(--spacing) * 9);\n }\n .size-16 {\n width: calc(var(--spacing) * 16);\n height: calc(var(--spacing) * 16);\n }\n .h-0 {\n height: calc(var(--spacing) * 0);\n }\n .h-3\\.5 {\n height: calc(var(--spacing) * 3.5);\n }\n .h-4 {\n height: calc(var(--spacing) * 4);\n }\n .h-5 {\n height: calc(var(--spacing) * 5);\n }\n .h-6 {\n height: calc(var(--spacing) * 6);\n }\n .h-8 {\n height: calc(var(--spacing) * 8);\n }\n .h-9 {\n height: calc(var(--spacing) * 9);\n }\n .h-10 {\n height: calc(var(--spacing) * 10);\n }\n .h-12 {\n height: calc(var(--spacing) * 12);\n }\n .h-16 {\n height: calc(var(--spacing) * 16);\n }\n .h-\\[18px\\] {\n height: 18px;\n }\n .h-\\[20px\\] {\n height: 20px;\n }\n .h-\\[44px\\] {\n height: 44px;\n }\n .h-\\[310px\\] {\n height: 310px;\n }\n .h-auto {\n height: auto;\n }\n .h-auto\\! {\n height: auto !important;\n }\n .h-full {\n height: 100%;\n }\n .h-max {\n height: max-content;\n }\n .h-px {\n height: 1px;\n }\n .max-h-\\(--radix-dropdown-menu-content-available-height\\) {\n max-height: var(--radix-dropdown-menu-content-available-height);\n }\n .max-h-0 {\n max-height: calc(var(--spacing) * 0);\n }\n .max-h-60 {\n max-height: calc(var(--spacing) * 60);\n }\n .max-h-\\[300px\\] {\n max-height: 300px;\n }\n .min-h-full {\n min-height: 100%;\n }\n .w-0 {\n width: calc(var(--spacing) * 0);\n }\n .w-4 {\n width: calc(var(--spacing) * 4);\n }\n .w-6 {\n width: calc(var(--spacing) * 6);\n }\n .w-12 {\n width: calc(var(--spacing) * 12);\n }\n .w-16 {\n width: calc(var(--spacing) * 16);\n }\n .w-20 {\n width: calc(var(--spacing) * 20);\n }\n .w-24 {\n width: calc(var(--spacing) * 24);\n }\n .w-28 {\n width: calc(var(--spacing) * 28);\n }\n .w-32 {\n width: calc(var(--spacing) * 32);\n }\n .w-40 {\n width: calc(var(--spacing) * 40);\n }\n .w-72 {\n width: calc(var(--spacing) * 72);\n }\n .w-full {\n width: 100%;\n }\n .max-w-0 {\n max-width: calc(var(--spacing) * 0);\n }\n .max-w-\\[calc\\(100\\%-2rem\\)\\] {\n max-width: calc(100% - 2rem);\n }\n .min-w-0 {\n min-width: calc(var(--spacing) * 0);\n }\n .min-w-\\[8rem\\] {\n min-width: 8rem;\n }\n .flex-1 {\n flex: 1;\n }\n .shrink-0 {\n flex-shrink: 0;\n }\n .origin-\\(--radix-dropdown-menu-content-transform-origin\\) {\n transform-origin: var(--radix-dropdown-menu-content-transform-origin);\n }\n .origin-\\(--radix-popover-content-transform-origin\\) {\n transform-origin: var(--radix-popover-content-transform-origin);\n }\n .-translate-x-0 {\n --tw-translate-x: calc(var(--spacing) * -0);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-x-1\\/2 {\n --tw-translate-x: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-x-3 {\n --tw-translate-x: calc(var(--spacing) * -3);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-x-2 {\n --tw-translate-x: calc(var(--spacing) * 2);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-x-\\[-50\\%\\] {\n --tw-translate-x: -50%;\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .-translate-y-1\\/2 {\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .translate-y-\\[-50\\%\\] {\n --tw-translate-y: -50%;\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n .rotate-180 {\n rotate: 180deg;\n }\n .animate-pulse {\n animation: var(--animate-pulse);\n }\n .animate-spin {\n animation: var(--animate-spin);\n }\n .cursor-default {\n cursor: default;\n }\n .cursor-pointer {\n cursor: pointer;\n }\n .resize {\n resize: both;\n }\n .scroll-py-1 {\n scroll-padding-block: calc(var(--spacing) * 1);\n }\n .grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n .flex-col {\n flex-direction: column;\n }\n .flex-col-reverse {\n flex-direction: column-reverse;\n }\n .items-center {\n align-items: center;\n }\n .justify-between {\n justify-content: space-between;\n }\n .justify-center {\n justify-content: center;\n }\n .justify-end {\n justify-content: flex-end;\n }\n .gap-0 {\n gap: calc(var(--spacing) * 0);\n }\n .gap-0\\.5 {\n gap: calc(var(--spacing) * 0.5);\n }\n .gap-1\\.5 {\n gap: calc(var(--spacing) * 1.5);\n }\n .gap-2 {\n gap: calc(var(--spacing) * 2);\n }\n .gap-3 {\n gap: calc(var(--spacing) * 3);\n }\n .gap-4 {\n gap: calc(var(--spacing) * 4);\n }\n .gap-5 {\n gap: calc(var(--spacing) * 5);\n }\n .gap-6 {\n gap: calc(var(--spacing) * 6);\n }\n .gap-\\[10px\\] {\n gap: 10px;\n }\n .space-y-2 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-4 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-5 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .space-y-6 {\n :where(& > :not(:last-child)) {\n --tw-space-y-reverse: 0;\n margin-block-start: calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));\n margin-block-end: calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)));\n }\n }\n .overflow-hidden {\n overflow: hidden;\n }\n .overflow-x-hidden {\n overflow-x: hidden;\n }\n .overflow-y-auto {\n overflow-y: auto;\n }\n .rounded-\\[4px\\] {\n border-radius: 4px;\n }\n .rounded-full {\n border-radius: calc(infinity * 1px);\n }\n .rounded-lg {\n border-radius: var(--radius);\n }\n .rounded-md {\n border-radius: calc(var(--radius) - 2px);\n }\n .rounded-sm {\n border-radius: calc(var(--radius) - 4px);\n }\n .rounded-xs {\n border-radius: var(--radius-xs);\n }\n .border {\n border-style: var(--tw-border-style);\n border-width: 1px;\n }\n .border-b {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 1px;\n }\n .border-border {\n border-color: var(--border);\n }\n .border-input {\n border-color: var(--input);\n }\n .border-primary {\n border-color: var(--primary);\n }\n .bg-accent {\n background-color: var(--accent);\n }\n .bg-background {\n background-color: var(--background);\n }\n .bg-black\\/50 {\n background-color: color-mix(in srgb, #000 50%, transparent);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--color-black) 50%, transparent);\n }\n }\n .bg-border {\n background-color: var(--border);\n }\n .bg-destructive {\n background-color: var(--destructive);\n }\n .bg-muted {\n background-color: var(--muted);\n }\n .bg-popover {\n background-color: var(--popover);\n }\n .bg-primary {\n background-color: var(--primary);\n }\n .bg-secondary {\n background-color: var(--secondary);\n }\n .bg-transparent {\n background-color: transparent;\n }\n .fill-current {\n fill: currentcolor;\n }\n .fill-primary {\n fill: var(--primary);\n }\n .object-cover {\n object-fit: cover;\n }\n .p-0 {\n padding: calc(var(--spacing) * 0);\n }\n .p-1 {\n padding: calc(var(--spacing) * 1);\n }\n .p-3 {\n padding: calc(var(--spacing) * 3);\n }\n .p-4 {\n padding: calc(var(--spacing) * 4);\n }\n .p-6 {\n padding: calc(var(--spacing) * 6);\n }\n .px-1 {\n padding-inline: calc(var(--spacing) * 1);\n }\n .px-2 {\n padding-inline: calc(var(--spacing) * 2);\n }\n .px-3 {\n padding-inline: calc(var(--spacing) * 3);\n }\n .px-4 {\n padding-inline: calc(var(--spacing) * 4);\n }\n .px-6 {\n padding-inline: calc(var(--spacing) * 6);\n }\n .py-1 {\n padding-block: calc(var(--spacing) * 1);\n }\n .py-1\\.5 {\n padding-block: calc(var(--spacing) * 1.5);\n }\n .py-2 {\n padding-block: calc(var(--spacing) * 2);\n }\n .py-3 {\n padding-block: calc(var(--spacing) * 3);\n }\n .py-4 {\n padding-block: calc(var(--spacing) * 4);\n }\n .py-6 {\n padding-block: calc(var(--spacing) * 6);\n }\n .pt-2 {\n padding-top: calc(var(--spacing) * 2);\n }\n .pt-4 {\n padding-top: calc(var(--spacing) * 4);\n }\n .pr-2 {\n padding-right: calc(var(--spacing) * 2);\n }\n .pb-1 {\n padding-bottom: calc(var(--spacing) * 1);\n }\n .pb-2 {\n padding-bottom: calc(var(--spacing) * 2);\n }\n .pl-8 {\n padding-left: calc(var(--spacing) * 8);\n }\n .text-center {\n text-align: center;\n }\n .text-left {\n text-align: left;\n }\n .text-right {\n text-align: right;\n }\n .text-base {\n font-size: var(--text-base);\n line-height: var(--tw-leading, var(--text-base--line-height));\n }\n .text-lg {\n font-size: var(--text-lg);\n line-height: var(--tw-leading, var(--text-lg--line-height));\n }\n .text-sm {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n .text-xs {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n .text-\\[13px\\] {\n font-size: 13px;\n }\n .leading-none {\n --tw-leading: 1;\n line-height: 1;\n }\n .font-bold {\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n }\n .font-medium {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n .font-semibold {\n --tw-font-weight: var(--font-weight-semibold);\n font-weight: var(--font-weight-semibold);\n }\n .tracking-tight {\n --tw-tracking: var(--tracking-tight);\n letter-spacing: var(--tracking-tight);\n }\n .tracking-widest {\n --tw-tracking: var(--tracking-widest);\n letter-spacing: var(--tracking-widest);\n }\n .text-ellipsis {\n text-overflow: ellipsis;\n }\n .whitespace-nowrap {\n white-space: nowrap;\n }\n .text-background {\n color: var(--background);\n }\n .text-current {\n color: currentcolor;\n }\n .text-destructive {\n color: var(--destructive);\n }\n .text-destructive-foreground {\n color: var(--destructive-foreground);\n }\n .text-foreground {\n color: var(--foreground);\n }\n .text-input {\n color: var(--input);\n }\n .text-muted-foreground {\n color: var(--muted-foreground);\n }\n .text-popover-foreground {\n color: var(--popover-foreground);\n }\n .text-primary {\n color: var(--primary);\n }\n .text-primary-foreground {\n color: var(--primary-foreground);\n }\n .text-red-500 {\n color: var(--color-red-500);\n }\n .text-ring {\n color: var(--ring);\n }\n .text-secondary-foreground {\n color: var(--secondary-foreground);\n }\n .text-white {\n color: var(--color-white);\n }\n .line-through {\n text-decoration-line: line-through;\n }\n .underline {\n text-decoration-line: underline;\n }\n .underline-offset-4 {\n text-underline-offset: 4px;\n }\n .opacity-0 {\n opacity: 0%;\n }\n .opacity-50 {\n opacity: 50%;\n }\n .opacity-70 {\n opacity: 70%;\n }\n .opacity-100 {\n opacity: 100%;\n }\n .shadow {\n --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-lg {\n --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-md {\n --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .shadow-xs {\n --tw-shadow: 0 1px 2px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.05));\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .ring {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n .ring-offset-background {\n --tw-ring-offset-color: var(--background);\n }\n .outline-hidden {\n --tw-outline-style: none;\n outline-style: none;\n @media (forced-colors: active) {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n }\n .outline {\n outline-style: var(--tw-outline-style);\n outline-width: 1px;\n }\n .transition {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, visibility, content-visibility, overlay, pointer-events;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-\\[color\\,box-shadow\\] {\n transition-property: color,box-shadow;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-colors {\n transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-opacity {\n transition-property: opacity;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-shadow {\n transition-property: box-shadow;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-transform {\n transition-property: transform, translate, scale, rotate;\n transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n transition-duration: var(--tw-duration, var(--default-transition-duration));\n }\n .transition-none {\n transition-property: none;\n }\n .duration-200 {\n --tw-duration: 200ms;\n transition-duration: 200ms;\n }\n .ease-in-out {\n --tw-ease: var(--ease-in-out);\n transition-timing-function: var(--ease-in-out);\n }\n .outline-none {\n --tw-outline-style: none;\n outline-style: none;\n }\n .select-none {\n -webkit-user-select: none;\n user-select: none;\n }\n .duration-200 {\n animation-duration: 200ms;\n }\n .ease-in-out {\n animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n }\n .group-data-\\[disabled\\=true\\]\\:pointer-events-none {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n pointer-events: none;\n }\n }\n .group-data-\\[disabled\\=true\\]\\:opacity-50 {\n &:is(:where(.group)[data-disabled=\"true\"] *) {\n opacity: 50%;\n }\n }\n .peer-disabled\\:cursor-not-allowed {\n &:is(:where(.peer):disabled ~ *) {\n cursor: not-allowed;\n }\n }\n .peer-disabled\\:opacity-50 {\n &:is(:where(.peer):disabled ~ *) {\n opacity: 50%;\n }\n }\n .file\\:inline-flex {\n &::file-selector-button {\n display: inline-flex;\n }\n }\n .file\\:h-7 {\n &::file-selector-button {\n height: calc(var(--spacing) * 7);\n }\n }\n .file\\:border-0 {\n &::file-selector-button {\n border-style: var(--tw-border-style);\n border-width: 0px;\n }\n }\n .file\\:bg-transparent {\n &::file-selector-button {\n background-color: transparent;\n }\n }\n .file\\:text-sm {\n &::file-selector-button {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n }\n .file\\:font-medium {\n &::file-selector-button {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n }\n .file\\:text-foreground {\n &::file-selector-button {\n color: var(--foreground);\n }\n }\n .placeholder\\:text-muted-foreground {\n &::placeholder {\n color: var(--muted-foreground);\n }\n }\n .after\\:absolute {\n &::after {\n content: var(--tw-content);\n position: absolute;\n }\n }\n .after\\:top-1\\/2 {\n &::after {\n content: var(--tw-content);\n top: calc(1/2 * 100%);\n }\n }\n .after\\:right-0 {\n &::after {\n content: var(--tw-content);\n right: calc(var(--spacing) * 0);\n }\n }\n .after\\:left-0 {\n &::after {\n content: var(--tw-content);\n left: calc(var(--spacing) * 0);\n }\n }\n .after\\:z-0 {\n &::after {\n content: var(--tw-content);\n z-index: 0;\n }\n }\n .after\\:h-px {\n &::after {\n content: var(--tw-content);\n height: 1px;\n }\n }\n .after\\:-translate-y-1\\/2 {\n &::after {\n content: var(--tw-content);\n --tw-translate-y: calc(calc(1/2 * 100%) * -1);\n translate: var(--tw-translate-x) var(--tw-translate-y);\n }\n }\n .after\\:bg-background {\n &::after {\n content: var(--tw-content);\n background-color: var(--background);\n }\n }\n .after\\:content-\\[\\'\\'\\] {\n &::after {\n content: var(--tw-content);\n --tw-content: '';\n content: var(--tw-content);\n }\n }\n .last\\:border-b-0 {\n &:last-child {\n border-bottom-style: var(--tw-border-style);\n border-bottom-width: 0px;\n }\n }\n .hover\\:bg-accent {\n &:hover {\n @media (hover: hover) {\n background-color: var(--accent);\n }\n }\n }\n .hover\\:bg-destructive\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--destructive) 90%, transparent);\n }\n }\n }\n }\n .hover\\:bg-muted {\n &:hover {\n @media (hover: hover) {\n background-color: var(--muted);\n }\n }\n }\n .hover\\:bg-primary\\/90 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--primary);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--primary) 90%, transparent);\n }\n }\n }\n }\n .hover\\:bg-secondary\\/80 {\n &:hover {\n @media (hover: hover) {\n background-color: var(--secondary);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--secondary) 80%, transparent);\n }\n }\n }\n }\n .hover\\:text-accent-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--accent-foreground);\n }\n }\n }\n .hover\\:text-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--foreground);\n }\n }\n }\n .hover\\:text-muted-foreground {\n &:hover {\n @media (hover: hover) {\n color: var(--muted-foreground);\n }\n }\n }\n .hover\\:underline {\n &:hover {\n @media (hover: hover) {\n text-decoration-line: underline;\n }\n }\n }\n .hover\\:opacity-100 {\n &:hover {\n @media (hover: hover) {\n opacity: 100%;\n }\n }\n }\n .focus\\:bg-accent {\n &:focus {\n background-color: var(--accent);\n }\n }\n .focus\\:text-accent-foreground {\n &:focus {\n color: var(--accent-foreground);\n }\n }\n .focus\\:ring-2 {\n &:focus {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus\\:ring-ring {\n &:focus {\n --tw-ring-color: var(--ring);\n }\n }\n .focus\\:ring-offset-2 {\n &:focus {\n --tw-ring-offset-width: 2px;\n --tw-ring-offset-shadow: var(--tw-ring-inset,) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n }\n }\n .focus\\:outline-hidden {\n &:focus {\n --tw-outline-style: none;\n outline-style: none;\n @media (forced-colors: active) {\n outline: 2px solid transparent;\n outline-offset: 2px;\n }\n }\n }\n .focus-visible\\:border-ring {\n &:focus-visible {\n border-color: var(--ring);\n }\n }\n .focus-visible\\:ring-\\[3px\\] {\n &:focus-visible {\n --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);\n box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n }\n }\n .focus-visible\\:ring-destructive\\/20 {\n &:focus-visible {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent);\n }\n }\n }\n .focus-visible\\:ring-ring\\/50 {\n &:focus-visible {\n --tw-ring-color: var(--ring);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent);\n }\n }\n }\n .disabled\\:pointer-events-none {\n &:disabled {\n pointer-events: none;\n }\n }\n .disabled\\:cursor-not-allowed {\n &:disabled {\n cursor: not-allowed;\n }\n }\n .disabled\\:opacity-50 {\n &:disabled {\n opacity: 50%;\n }\n }\n .has-\\[\\>svg\\]\\:px-2\\.5 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 2.5);\n }\n }\n .has-\\[\\>svg\\]\\:px-3 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 3);\n }\n }\n .has-\\[\\>svg\\]\\:px-4 {\n &:has(>svg) {\n padding-inline: calc(var(--spacing) * 4);\n }\n }\n .aria-invalid\\:border-destructive {\n &[aria-invalid=\"true\"] {\n border-color: var(--destructive);\n }\n }\n .aria-invalid\\:ring-destructive\\/20 {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent);\n }\n }\n }\n .data-\\[disabled\\]\\:pointer-events-none {\n &[data-disabled] {\n pointer-events: none;\n }\n }\n .data-\\[disabled\\]\\:opacity-50 {\n &[data-disabled] {\n opacity: 50%;\n }\n }\n .data-\\[disabled\\=true\\]\\:pointer-events-none {\n &[data-disabled=\"true\"] {\n pointer-events: none;\n }\n }\n .data-\\[disabled\\=true\\]\\:opacity-50 {\n &[data-disabled=\"true\"] {\n opacity: 50%;\n }\n }\n .data-\\[error\\=true\\]\\:text-destructive-foreground {\n &[data-error=\"true\"] {\n color: var(--destructive-foreground);\n }\n }\n .data-\\[inset\\]\\:pl-8 {\n &[data-inset] {\n padding-left: calc(var(--spacing) * 8);\n }\n }\n .data-\\[selected\\=true\\]\\:bg-accent {\n &[data-selected=\"true\"] {\n background-color: var(--accent);\n }\n }\n .data-\\[selected\\=true\\]\\:text-accent-foreground {\n &[data-selected=\"true\"] {\n color: var(--accent-foreground);\n }\n }\n .data-\\[side\\=bottom\\]\\:slide-in-from-top-2 {\n &[data-side=\"bottom\"] {\n --tw-enter-translate-y: -0.5rem;\n }\n }\n .data-\\[side\\=left\\]\\:slide-in-from-right-2 {\n &[data-side=\"left\"] {\n --tw-enter-translate-x: 0.5rem;\n }\n }\n .data-\\[side\\=right\\]\\:slide-in-from-left-2 {\n &[data-side=\"right\"] {\n --tw-enter-translate-x: -0.5rem;\n }\n }\n .data-\\[side\\=top\\]\\:slide-in-from-bottom-2 {\n &[data-side=\"top\"] {\n --tw-enter-translate-y: 0.5rem;\n }\n }\n .\\*\\*\\:data-\\[slot\\=command-input-wrapper\\]\\:h-12 {\n :is(& *) {\n &[data-slot=\"command-input-wrapper\"] {\n height: calc(var(--spacing) * 12);\n }\n }\n }\n .data-\\[state\\=checked\\]\\:border-primary {\n &[data-state=\"checked\"] {\n border-color: var(--primary);\n }\n }\n .data-\\[state\\=checked\\]\\:bg-primary {\n &[data-state=\"checked\"] {\n background-color: var(--primary);\n }\n }\n .data-\\[state\\=checked\\]\\:text-primary-foreground {\n &[data-state=\"checked\"] {\n color: var(--primary-foreground);\n }\n }\n .data-\\[state\\=closed\\]\\:animate-out {\n &[data-state=\"closed\"] {\n animation-name: exit;\n animation-duration: 150ms;\n --tw-exit-opacity: initial;\n --tw-exit-scale: initial;\n --tw-exit-rotate: initial;\n --tw-exit-translate-x: initial;\n --tw-exit-translate-y: initial;\n }\n }\n .data-\\[state\\=closed\\]\\:fade-out-0 {\n &[data-state=\"closed\"] {\n --tw-exit-opacity: 0;\n }\n }\n .data-\\[state\\=closed\\]\\:zoom-out-95 {\n &[data-state=\"closed\"] {\n --tw-exit-scale: .95;\n }\n }\n .data-\\[state\\=open\\]\\:bg-accent {\n &[data-state=\"open\"] {\n background-color: var(--accent);\n }\n }\n .data-\\[state\\=open\\]\\:text-accent-foreground {\n &[data-state=\"open\"] {\n color: var(--accent-foreground);\n }\n }\n .data-\\[state\\=open\\]\\:text-muted-foreground {\n &[data-state=\"open\"] {\n color: var(--muted-foreground);\n }\n }\n .data-\\[state\\=open\\]\\:animate-in {\n &[data-state=\"open\"] {\n animation-name: enter;\n animation-duration: 150ms;\n --tw-enter-opacity: initial;\n --tw-enter-scale: initial;\n --tw-enter-rotate: initial;\n --tw-enter-translate-x: initial;\n --tw-enter-translate-y: initial;\n }\n }\n .data-\\[state\\=open\\]\\:fade-in-0 {\n &[data-state=\"open\"] {\n --tw-enter-opacity: 0;\n }\n }\n .data-\\[state\\=open\\]\\:zoom-in-95 {\n &[data-state=\"open\"] {\n --tw-enter-scale: .95;\n }\n }\n .data-\\[variant\\=destructive\\]\\:text-destructive {\n &[data-variant=\"destructive\"] {\n color: var(--destructive);\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/10 {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--destructive) 10%, transparent);\n }\n }\n }\n }\n .data-\\[variant\\=destructive\\]\\:focus\\:text-destructive {\n &[data-variant=\"destructive\"] {\n &:focus {\n color: var(--destructive);\n }\n }\n }\n .max-md\\:cursor-pointer {\n @media (width < 48rem) {\n cursor: pointer;\n }\n }\n .max-sm\\:hidden {\n @media (width < 40rem) {\n display: none;\n }\n }\n .sm\\:h-\\[230px\\] {\n @media (width >= 40rem) {\n height: 230px;\n }\n }\n .sm\\:max-w-lg {\n @media (width >= 40rem) {\n max-width: var(--container-lg);\n }\n }\n .sm\\:flex-row {\n @media (width >= 40rem) {\n flex-direction: row;\n }\n }\n .sm\\:justify-end {\n @media (width >= 40rem) {\n justify-content: flex-end;\n }\n }\n .sm\\:text-left {\n @media (width >= 40rem) {\n text-align: left;\n }\n }\n .md\\:order-last {\n @media (width >= 48rem) {\n order: 9999;\n }\n }\n .md\\:order-none {\n @media (width >= 48rem) {\n order: 0;\n }\n }\n .md\\:col-span-2 {\n @media (width >= 48rem) {\n grid-column: span 2 / span 2;\n }\n }\n .md\\:col-span-3 {\n @media (width >= 48rem) {\n grid-column: span 3 / span 3;\n }\n }\n .md\\:col-span-4 {\n @media (width >= 48rem) {\n grid-column: span 4 / span 4;\n }\n }\n .md\\:block {\n @media (width >= 48rem) {\n display: block;\n }\n }\n .md\\:flex {\n @media (width >= 48rem) {\n display: flex;\n }\n }\n .md\\:grid {\n @media (width >= 48rem) {\n display: grid;\n }\n }\n .md\\:hidden {\n @media (width >= 48rem) {\n display: none;\n }\n }\n .md\\:max-w-\\[75\\%\\] {\n @media (width >= 48rem) {\n max-width: 75%;\n }\n }\n .md\\:grid-cols-2 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n }\n }\n .md\\:grid-cols-3 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n }\n .md\\:grid-cols-7 {\n @media (width >= 48rem) {\n grid-template-columns: repeat(7, minmax(0, 1fr));\n }\n }\n .md\\:gap-0 {\n @media (width >= 48rem) {\n gap: calc(var(--spacing) * 0);\n }\n }\n .md\\:px-8 {\n @media (width >= 48rem) {\n padding-inline: calc(var(--spacing) * 8);\n }\n }\n .md\\:py-12 {\n @media (width >= 48rem) {\n padding-block: calc(var(--spacing) * 12);\n }\n }\n .md\\:text-sm {\n @media (width >= 48rem) {\n font-size: var(--text-sm);\n line-height: var(--tw-leading, var(--text-sm--line-height));\n }\n }\n .dark\\:focus-visible\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &:focus-visible {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent);\n }\n }\n }\n }\n .dark\\:aria-invalid\\:ring-destructive\\/40 {\n @media (prefers-color-scheme: dark) {\n &[aria-invalid=\"true\"] {\n --tw-ring-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n --tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent);\n }\n }\n }\n }\n .dark\\:data-\\[variant\\=destructive\\]\\:focus\\:bg-destructive\\/20 {\n @media (prefers-color-scheme: dark) {\n &[data-variant=\"destructive\"] {\n &:focus {\n background-color: var(--destructive);\n @supports (color: color-mix(in lab, red, red)) {\n background-color: color-mix(in oklab, var(--destructive) 20%, transparent);\n }\n }\n }\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:px-2 {\n & [cmdk-group-heading] {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:py-1\\.5 {\n & [cmdk-group-heading] {\n padding-block: calc(var(--spacing) * 1.5);\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-xs {\n & [cmdk-group-heading] {\n font-size: var(--text-xs);\n line-height: var(--tw-leading, var(--text-xs--line-height));\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:font-medium {\n & [cmdk-group-heading] {\n --tw-font-weight: var(--font-weight-medium);\n font-weight: var(--font-weight-medium);\n }\n }\n .\\[\\&_\\[cmdk-group-heading\\]\\]\\:text-muted-foreground {\n & [cmdk-group-heading] {\n color: var(--muted-foreground);\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\]\\:px-2 {\n & [cmdk-group] {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&_\\[cmdk-group\\]\\:not\\(\\[hidden\\]\\)_\\~\\[cmdk-group\\]\\]\\:pt-0 {\n & [cmdk-group]:not([hidden]) ~[cmdk-group] {\n padding-top: calc(var(--spacing) * 0);\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:h-5 {\n & [cmdk-input-wrapper] svg {\n height: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_\\[cmdk-input-wrapper\\]_svg\\]\\:w-5 {\n & [cmdk-input-wrapper] svg {\n width: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_\\[cmdk-input\\]\\]\\:h-12 {\n & [cmdk-input] {\n height: calc(var(--spacing) * 12);\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:px-2 {\n & [cmdk-item] {\n padding-inline: calc(var(--spacing) * 2);\n }\n }\n .\\[\\&_\\[cmdk-item\\]\\]\\:py-3 {\n & [cmdk-item] {\n padding-block: calc(var(--spacing) * 3);\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:h-5 {\n & [cmdk-item] svg {\n height: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_\\[cmdk-item\\]_svg\\]\\:w-5 {\n & [cmdk-item] svg {\n width: calc(var(--spacing) * 5);\n }\n }\n .\\[\\&_svg\\]\\:pointer-events-none {\n & svg {\n pointer-events: none;\n }\n }\n .\\[\\&_svg\\]\\:shrink-0 {\n & svg {\n flex-shrink: 0;\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'size-\\'\\]\\)\\]\\:size-4 {\n & svg:not([class*='size-']) {\n width: calc(var(--spacing) * 4);\n height: calc(var(--spacing) * 4);\n }\n }\n .\\[\\&_svg\\:not\\(\\[class\\*\\=\\'text-\\'\\]\\)\\]\\:text-muted-foreground {\n & svg:not([class*='text-']) {\n color: var(--muted-foreground);\n }\n }\n .data-\\[variant\\=destructive\\]\\:\\*\\:\\[svg\\]\\:\\!text-destructive {\n &[data-variant=\"destructive\"] {\n :is(& > *) {\n &:is(svg) {\n color: var(--destructive) !important;\n }\n }\n }\n }\n}\n@layer base {\n ::selection {\n background-color: var(--primary);\n color: var(--primary-foreground);\n }\n * {\n --tw-border-style: solid;\n border-style: solid;\n border-color: var(--border);\n outline-color: var(--ring);\n @supports (color: color-mix(in lab, red, red)) {\n outline-color: color-mix(in oklab, var(--ring) 50%, transparent);\n }\n }\n .checkout-embed {\n background-color: var(--background);\n font-family: var(--font-sans), Helvetica, Arial, apple-system, sans-serif;\n color: var(--foreground);\n }\n h2 {\n font-size: var(--text-2xl);\n line-height: var(--tw-leading, var(--text-2xl--line-height));\n --tw-font-weight: var(--font-weight-bold);\n font-weight: var(--font-weight-bold);\n --tw-tracking: var(--tracking-tight);\n letter-spacing: var(--tracking-tight);\n }\n p {\n --tw-tracking: var(--tracking-tight);\n letter-spacing: var(--tracking-tight);\n }\n}\n@layer utilities {\n .scrollbar-hidden {\n scrollbar-width: none;\n }\n .scrollbar-hidden::-webkit-scrollbar {\n display: none;\n }\n}\n@keyframes enter {\n from {\n opacity: var(--tw-enter-opacity, 1);\n transform: translate3d(var(--tw-enter-translate-x, 0), var(--tw-enter-translate-y, 0), 0) scale3d(var(--tw-enter-scale, 1), var(--tw-enter-scale, 1), var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0));\n }\n}\n@keyframes exit {\n to {\n opacity: var(--tw-exit-opacity, 1);\n transform: translate3d(var(--tw-exit-translate-x, 0), var(--tw-exit-translate-y, 0), 0) scale3d(var(--tw-exit-scale, 1), var(--tw-exit-scale, 1), var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0));\n }\n}\n@property --tw-translate-x {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-y {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-translate-z {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-space-y-reverse {\n syntax: \"*\";\n inherits: false;\n initial-value: 0;\n}\n@property --tw-border-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-leading {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-font-weight {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-tracking {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-inset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n syntax: \"<percentage>\";\n inherits: false;\n initial-value: 100%;\n}\n@property --tw-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-inset-ring-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ring-offset-width {\n syntax: \"<length>\";\n inherits: false;\n initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n syntax: \"*\";\n inherits: false;\n initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n syntax: \"*\";\n inherits: false;\n initial-value: 0 0 #0000;\n}\n@property --tw-outline-style {\n syntax: \"*\";\n inherits: false;\n initial-value: solid;\n}\n@property --tw-duration {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-ease {\n syntax: \"*\";\n inherits: false;\n}\n@property --tw-content {\n syntax: \"*\";\n initial-value: \"\";\n inherits: false;\n}\n@keyframes spin {\n to {\n transform: rotate(360deg);\n }\n}\n@keyframes pulse {\n 50% {\n opacity: 0.5;\n }\n}\n@layer properties {\n @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n *, ::before, ::after, ::backdrop {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-translate-z: 0;\n --tw-space-y-reverse: 0;\n --tw-border-style: solid;\n --tw-leading: initial;\n --tw-font-weight: initial;\n --tw-tracking: initial;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-color: initial;\n --tw-shadow-alpha: 100%;\n --tw-inset-shadow: 0 0 #0000;\n --tw-inset-shadow-color: initial;\n --tw-inset-shadow-alpha: 100%;\n --tw-ring-color: initial;\n --tw-ring-shadow: 0 0 #0000;\n --tw-inset-ring-color: initial;\n --tw-inset-ring-shadow: 0 0 #0000;\n --tw-ring-inset: initial;\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-outline-style: solid;\n --tw-duration: initial;\n --tw-ease: initial;\n --tw-content: \"\";\n }\n }\n}\n";
7501
7501
 
7502
- var M=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x))!=null?e:U$1};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M.toString()})(${p})`}})});
7502
+ var M$1=(e,i,s,u,m,a,l,h)=>{let d=document.documentElement,w=["light","dark"];function p(n){(Array.isArray(e)?e:[e]).forEach(y=>{let k=y==="class",S=k&&a?m.map(f=>a[f]||f):m;k?(d.classList.remove(...S),d.classList.add(a&&a[n]?a[n]:n)):d.setAttribute(y,n);}),R(n);}function R(n){h&&w.includes(n)&&(d.style.colorScheme=n);}function c(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(u)p(u);else try{let n=localStorage.getItem(i)||s,y=l&&n==="system"?c():n;p(y);}catch(n){}};var x=React.createContext(void 0),U$1={setTheme:e=>{},themes:[]},z=()=>{var e;return (e=React.useContext(x))!=null?e:U$1};React.memo(({forcedTheme:e,storageKey:i,attribute:s,enableSystem:u,enableColorScheme:m,defaultTheme:a,value:l,themes:h,nonce:d,scriptProps:w})=>{let p=JSON.stringify([s,i,a,e,h,l,u,m]).slice(1,-1);return React.createElement("script",{...w,suppressHydrationWarning:true,nonce:typeof window=="undefined"?d:"",dangerouslySetInnerHTML:{__html:`(${M$1.toString()})(${p})`}})});
7503
7503
 
7504
7504
  function __insertCSS(code) {
7505
7505
  if (typeof document == 'undefined') return
@@ -8646,45 +8646,4521 @@ const ShadowWrapper = React__default.memo(({ children, shadowRef }) => {
8646
8646
  });
8647
8647
  ShadowWrapper.displayName = "ShadowWrapper";
8648
8648
 
8649
- // Utility function to format colors (converts oklch to hex, keeps other formats as-is)
8649
+ const parseNumber = (color, len) => {
8650
+ if (typeof color !== 'number') return;
8651
+
8652
+ // hex3: #c93 -> #cc9933
8653
+ if (len === 3) {
8654
+ return {
8655
+ mode: 'rgb',
8656
+ r: (((color >> 8) & 0xf) | ((color >> 4) & 0xf0)) / 255,
8657
+ g: (((color >> 4) & 0xf) | (color & 0xf0)) / 255,
8658
+ b: ((color & 0xf) | ((color << 4) & 0xf0)) / 255
8659
+ };
8660
+ }
8661
+
8662
+ // hex4: #c931 -> #cc993311
8663
+ if (len === 4) {
8664
+ return {
8665
+ mode: 'rgb',
8666
+ r: (((color >> 12) & 0xf) | ((color >> 8) & 0xf0)) / 255,
8667
+ g: (((color >> 8) & 0xf) | ((color >> 4) & 0xf0)) / 255,
8668
+ b: (((color >> 4) & 0xf) | (color & 0xf0)) / 255,
8669
+ alpha: ((color & 0xf) | ((color << 4) & 0xf0)) / 255
8670
+ };
8671
+ }
8672
+
8673
+ // hex6: #f0f1f2
8674
+ if (len === 6) {
8675
+ return {
8676
+ mode: 'rgb',
8677
+ r: ((color >> 16) & 0xff) / 255,
8678
+ g: ((color >> 8) & 0xff) / 255,
8679
+ b: (color & 0xff) / 255
8680
+ };
8681
+ }
8682
+
8683
+ // hex8: #f0f1f2ff
8684
+ if (len === 8) {
8685
+ return {
8686
+ mode: 'rgb',
8687
+ r: ((color >> 24) & 0xff) / 255,
8688
+ g: ((color >> 16) & 0xff) / 255,
8689
+ b: ((color >> 8) & 0xff) / 255,
8690
+ alpha: (color & 0xff) / 255
8691
+ };
8692
+ }
8693
+ };
8694
+
8695
+ const named = {
8696
+ aliceblue: 0xf0f8ff,
8697
+ antiquewhite: 0xfaebd7,
8698
+ aqua: 0x00ffff,
8699
+ aquamarine: 0x7fffd4,
8700
+ azure: 0xf0ffff,
8701
+ beige: 0xf5f5dc,
8702
+ bisque: 0xffe4c4,
8703
+ black: 0x000000,
8704
+ blanchedalmond: 0xffebcd,
8705
+ blue: 0x0000ff,
8706
+ blueviolet: 0x8a2be2,
8707
+ brown: 0xa52a2a,
8708
+ burlywood: 0xdeb887,
8709
+ cadetblue: 0x5f9ea0,
8710
+ chartreuse: 0x7fff00,
8711
+ chocolate: 0xd2691e,
8712
+ coral: 0xff7f50,
8713
+ cornflowerblue: 0x6495ed,
8714
+ cornsilk: 0xfff8dc,
8715
+ crimson: 0xdc143c,
8716
+ cyan: 0x00ffff,
8717
+ darkblue: 0x00008b,
8718
+ darkcyan: 0x008b8b,
8719
+ darkgoldenrod: 0xb8860b,
8720
+ darkgray: 0xa9a9a9,
8721
+ darkgreen: 0x006400,
8722
+ darkgrey: 0xa9a9a9,
8723
+ darkkhaki: 0xbdb76b,
8724
+ darkmagenta: 0x8b008b,
8725
+ darkolivegreen: 0x556b2f,
8726
+ darkorange: 0xff8c00,
8727
+ darkorchid: 0x9932cc,
8728
+ darkred: 0x8b0000,
8729
+ darksalmon: 0xe9967a,
8730
+ darkseagreen: 0x8fbc8f,
8731
+ darkslateblue: 0x483d8b,
8732
+ darkslategray: 0x2f4f4f,
8733
+ darkslategrey: 0x2f4f4f,
8734
+ darkturquoise: 0x00ced1,
8735
+ darkviolet: 0x9400d3,
8736
+ deeppink: 0xff1493,
8737
+ deepskyblue: 0x00bfff,
8738
+ dimgray: 0x696969,
8739
+ dimgrey: 0x696969,
8740
+ dodgerblue: 0x1e90ff,
8741
+ firebrick: 0xb22222,
8742
+ floralwhite: 0xfffaf0,
8743
+ forestgreen: 0x228b22,
8744
+ fuchsia: 0xff00ff,
8745
+ gainsboro: 0xdcdcdc,
8746
+ ghostwhite: 0xf8f8ff,
8747
+ gold: 0xffd700,
8748
+ goldenrod: 0xdaa520,
8749
+ gray: 0x808080,
8750
+ green: 0x008000,
8751
+ greenyellow: 0xadff2f,
8752
+ grey: 0x808080,
8753
+ honeydew: 0xf0fff0,
8754
+ hotpink: 0xff69b4,
8755
+ indianred: 0xcd5c5c,
8756
+ indigo: 0x4b0082,
8757
+ ivory: 0xfffff0,
8758
+ khaki: 0xf0e68c,
8759
+ lavender: 0xe6e6fa,
8760
+ lavenderblush: 0xfff0f5,
8761
+ lawngreen: 0x7cfc00,
8762
+ lemonchiffon: 0xfffacd,
8763
+ lightblue: 0xadd8e6,
8764
+ lightcoral: 0xf08080,
8765
+ lightcyan: 0xe0ffff,
8766
+ lightgoldenrodyellow: 0xfafad2,
8767
+ lightgray: 0xd3d3d3,
8768
+ lightgreen: 0x90ee90,
8769
+ lightgrey: 0xd3d3d3,
8770
+ lightpink: 0xffb6c1,
8771
+ lightsalmon: 0xffa07a,
8772
+ lightseagreen: 0x20b2aa,
8773
+ lightskyblue: 0x87cefa,
8774
+ lightslategray: 0x778899,
8775
+ lightslategrey: 0x778899,
8776
+ lightsteelblue: 0xb0c4de,
8777
+ lightyellow: 0xffffe0,
8778
+ lime: 0x00ff00,
8779
+ limegreen: 0x32cd32,
8780
+ linen: 0xfaf0e6,
8781
+ magenta: 0xff00ff,
8782
+ maroon: 0x800000,
8783
+ mediumaquamarine: 0x66cdaa,
8784
+ mediumblue: 0x0000cd,
8785
+ mediumorchid: 0xba55d3,
8786
+ mediumpurple: 0x9370db,
8787
+ mediumseagreen: 0x3cb371,
8788
+ mediumslateblue: 0x7b68ee,
8789
+ mediumspringgreen: 0x00fa9a,
8790
+ mediumturquoise: 0x48d1cc,
8791
+ mediumvioletred: 0xc71585,
8792
+ midnightblue: 0x191970,
8793
+ mintcream: 0xf5fffa,
8794
+ mistyrose: 0xffe4e1,
8795
+ moccasin: 0xffe4b5,
8796
+ navajowhite: 0xffdead,
8797
+ navy: 0x000080,
8798
+ oldlace: 0xfdf5e6,
8799
+ olive: 0x808000,
8800
+ olivedrab: 0x6b8e23,
8801
+ orange: 0xffa500,
8802
+ orangered: 0xff4500,
8803
+ orchid: 0xda70d6,
8804
+ palegoldenrod: 0xeee8aa,
8805
+ palegreen: 0x98fb98,
8806
+ paleturquoise: 0xafeeee,
8807
+ palevioletred: 0xdb7093,
8808
+ papayawhip: 0xffefd5,
8809
+ peachpuff: 0xffdab9,
8810
+ peru: 0xcd853f,
8811
+ pink: 0xffc0cb,
8812
+ plum: 0xdda0dd,
8813
+ powderblue: 0xb0e0e6,
8814
+ purple: 0x800080,
8815
+
8816
+ // Added in CSS Colors Level 4:
8817
+ // https://drafts.csswg.org/css-color/#changes-from-3
8818
+ rebeccapurple: 0x663399,
8819
+
8820
+ red: 0xff0000,
8821
+ rosybrown: 0xbc8f8f,
8822
+ royalblue: 0x4169e1,
8823
+ saddlebrown: 0x8b4513,
8824
+ salmon: 0xfa8072,
8825
+ sandybrown: 0xf4a460,
8826
+ seagreen: 0x2e8b57,
8827
+ seashell: 0xfff5ee,
8828
+ sienna: 0xa0522d,
8829
+ silver: 0xc0c0c0,
8830
+ skyblue: 0x87ceeb,
8831
+ slateblue: 0x6a5acd,
8832
+ slategray: 0x708090,
8833
+ slategrey: 0x708090,
8834
+ snow: 0xfffafa,
8835
+ springgreen: 0x00ff7f,
8836
+ steelblue: 0x4682b4,
8837
+ tan: 0xd2b48c,
8838
+ teal: 0x008080,
8839
+ thistle: 0xd8bfd8,
8840
+ tomato: 0xff6347,
8841
+ turquoise: 0x40e0d0,
8842
+ violet: 0xee82ee,
8843
+ wheat: 0xf5deb3,
8844
+ white: 0xffffff,
8845
+ whitesmoke: 0xf5f5f5,
8846
+ yellow: 0xffff00,
8847
+ yellowgreen: 0x9acd32
8848
+ };
8849
+
8850
+ // Also supports the `transparent` color as defined in:
8851
+ // https://drafts.csswg.org/css-color/#transparent-black
8852
+ const parseNamed = color => {
8853
+ return parseNumber(named[color.toLowerCase()], 6);
8854
+ };
8855
+
8856
+ const hex = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
8857
+
8858
+ const parseHex = color => {
8859
+ let match;
8860
+ // eslint-disable-next-line no-cond-assign
8861
+ return (match = color.match(hex))
8862
+ ? parseNumber(parseInt(match[1], 16), match[1].length)
8863
+ : undefined;
8864
+ };
8865
+
8866
+ /*
8867
+ Basic building blocks for color regexes
8868
+ ---------------------------------------
8869
+
8870
+ These regexes are expressed as strings
8871
+ to be interpolated in the color regexes.
8872
+ */
8873
+
8874
+ // <number>
8875
+ const num$1 = '([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)';
8876
+
8877
+ // <percentage>
8878
+ const per = `${num$1}%`;
8879
+
8880
+ // <number-percentage> (<alpha-value>)
8881
+ const num_per = `(?:${num$1}%|${num$1})`;
8882
+
8883
+ // <hue>
8884
+ const hue$1 = `(?:${num$1}(deg|grad|rad|turn)|${num$1})`;
8885
+
8886
+ const c = `\\s*,\\s*`; // comma
8887
+
8888
+ /*
8889
+ rgb() regular expressions for legacy format
8890
+ Reference: https://drafts.csswg.org/css-color/#rgb-functions
8891
+ */
8892
+ const rgb_num_old = new RegExp(
8893
+ `^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`
8894
+ );
8895
+
8896
+ const rgb_per_old = new RegExp(
8897
+ `^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`
8898
+ );
8899
+
8900
+ const parseRgbLegacy = color => {
8901
+ let res = { mode: 'rgb' };
8902
+ let match;
8903
+ if ((match = color.match(rgb_num_old))) {
8904
+ if (match[1] !== undefined) {
8905
+ res.r = match[1] / 255;
8906
+ }
8907
+ if (match[2] !== undefined) {
8908
+ res.g = match[2] / 255;
8909
+ }
8910
+ if (match[3] !== undefined) {
8911
+ res.b = match[3] / 255;
8912
+ }
8913
+ } else if ((match = color.match(rgb_per_old))) {
8914
+ if (match[1] !== undefined) {
8915
+ res.r = match[1] / 100;
8916
+ }
8917
+ if (match[2] !== undefined) {
8918
+ res.g = match[2] / 100;
8919
+ }
8920
+ if (match[3] !== undefined) {
8921
+ res.b = match[3] / 100;
8922
+ }
8923
+ } else {
8924
+ return undefined;
8925
+ }
8926
+
8927
+ if (match[4] !== undefined) {
8928
+ res.alpha = Math.max(0, Math.min(1, match[4] / 100));
8929
+ } else if (match[5] !== undefined) {
8930
+ res.alpha = Math.max(0, Math.min(1, +match[5]));
8931
+ }
8932
+
8933
+ return res;
8934
+ };
8935
+
8936
+ const prepare = (color, mode) =>
8937
+ color === undefined
8938
+ ? undefined
8939
+ : typeof color !== 'object'
8940
+ ? parse$1(color)
8941
+ : color.mode !== undefined
8942
+ ? color
8943
+ : mode
8944
+ ? { ...color, mode }
8945
+ : undefined;
8946
+
8947
+ const converter =
8948
+ (target_mode = 'rgb') =>
8949
+ color =>
8950
+ (color = prepare(color, target_mode)) !== undefined
8951
+ ? // if the color's mode corresponds to our target mode
8952
+ color.mode === target_mode
8953
+ ? // then just return the color
8954
+ color
8955
+ : // otherwise check to see if we have a dedicated
8956
+ // converter for the target mode
8957
+ converters[color.mode][target_mode]
8958
+ ? // and return its result...
8959
+ converters[color.mode][target_mode](color)
8960
+ : // ...otherwise pass through RGB as an intermediary step.
8961
+ // if the target mode is RGB...
8962
+ target_mode === 'rgb'
8963
+ ? // just return the RGB
8964
+ converters[color.mode].rgb(color)
8965
+ : // otherwise convert color.mode -> RGB -> target_mode
8966
+ converters.rgb[target_mode](converters[color.mode].rgb(color))
8967
+ : undefined;
8968
+
8969
+ const converters = {};
8970
+ const modes = {};
8971
+
8972
+ const parsers = [];
8973
+ const colorProfiles = {};
8974
+
8975
+ const identity = v => v;
8976
+
8977
+ const useMode = definition => {
8978
+ converters[definition.mode] = {
8979
+ ...converters[definition.mode],
8980
+ ...definition.toMode
8981
+ };
8982
+
8983
+ Object.keys(definition.fromMode || {}).forEach(k => {
8984
+ if (!converters[k]) {
8985
+ converters[k] = {};
8986
+ }
8987
+ converters[k][definition.mode] = definition.fromMode[k];
8988
+ });
8989
+
8990
+ // Color space channel ranges
8991
+ if (!definition.ranges) {
8992
+ definition.ranges = {};
8993
+ }
8994
+
8995
+ if (!definition.difference) {
8996
+ definition.difference = {};
8997
+ }
8998
+
8999
+ definition.channels.forEach(channel => {
9000
+ // undefined channel ranges default to the [0, 1] interval
9001
+ if (definition.ranges[channel] === undefined) {
9002
+ definition.ranges[channel] = [0, 1];
9003
+ }
9004
+
9005
+ if (!definition.interpolate[channel]) {
9006
+ throw new Error(`Missing interpolator for: ${channel}`);
9007
+ }
9008
+
9009
+ if (typeof definition.interpolate[channel] === 'function') {
9010
+ definition.interpolate[channel] = {
9011
+ use: definition.interpolate[channel]
9012
+ };
9013
+ }
9014
+
9015
+ if (!definition.interpolate[channel].fixup) {
9016
+ definition.interpolate[channel].fixup = identity;
9017
+ }
9018
+ });
9019
+
9020
+ modes[definition.mode] = definition;
9021
+ (definition.parse || []).forEach(parser => {
9022
+ useParser(parser, definition.mode);
9023
+ });
9024
+
9025
+ return converter(definition.mode);
9026
+ };
9027
+
9028
+ const getMode = mode => modes[mode];
9029
+
9030
+ const useParser = (parser, mode) => {
9031
+ if (typeof parser === 'string') {
9032
+ if (!mode) {
9033
+ throw new Error(`'mode' required when 'parser' is a string`);
9034
+ }
9035
+ colorProfiles[parser] = mode;
9036
+ } else if (typeof parser === 'function') {
9037
+ if (parsers.indexOf(parser) < 0) {
9038
+ parsers.push(parser);
9039
+ }
9040
+ }
9041
+ };
9042
+
9043
+ /* eslint-disable-next-line no-control-regex */
9044
+ const IdentStartCodePoint = /[^\x00-\x7F]|[a-zA-Z_]/;
9045
+
9046
+ /* eslint-disable-next-line no-control-regex */
9047
+ const IdentCodePoint = /[^\x00-\x7F]|[-\w]/;
9048
+
9049
+ const Tok = {
9050
+ Function: 'function',
9051
+ Ident: 'ident',
9052
+ Number: 'number',
9053
+ Percentage: 'percentage',
9054
+ ParenClose: ')',
9055
+ None: 'none',
9056
+ Hue: 'hue',
9057
+ Alpha: 'alpha'
9058
+ };
9059
+
9060
+ let _i = 0;
9061
+
9062
+ /*
9063
+ 4.3.10. Check if three code points would start a number
9064
+ https://drafts.csswg.org/css-syntax/#starts-with-a-number
9065
+ */
9066
+ function is_num(chars) {
9067
+ let ch = chars[_i];
9068
+ let ch1 = chars[_i + 1];
9069
+ if (ch === '-' || ch === '+') {
9070
+ return /\d/.test(ch1) || (ch1 === '.' && /\d/.test(chars[_i + 2]));
9071
+ }
9072
+ if (ch === '.') {
9073
+ return /\d/.test(ch1);
9074
+ }
9075
+ return /\d/.test(ch);
9076
+ }
9077
+
9078
+ /*
9079
+ Check if the stream starts with an identifier.
9080
+ */
9081
+
9082
+ function is_ident(chars) {
9083
+ if (_i >= chars.length) {
9084
+ return false;
9085
+ }
9086
+ let ch = chars[_i];
9087
+ if (IdentStartCodePoint.test(ch)) {
9088
+ return true;
9089
+ }
9090
+ if (ch === '-') {
9091
+ if (chars.length - _i < 2) {
9092
+ return false;
9093
+ }
9094
+ let ch1 = chars[_i + 1];
9095
+ if (ch1 === '-' || IdentStartCodePoint.test(ch1)) {
9096
+ return true;
9097
+ }
9098
+ return false;
9099
+ }
9100
+ return false;
9101
+ }
9102
+
9103
+ /*
9104
+ 4.3.3. Consume a numeric token
9105
+ https://drafts.csswg.org/css-syntax/#consume-numeric-token
9106
+ */
9107
+
9108
+ const huenits = {
9109
+ deg: 1,
9110
+ rad: 180 / Math.PI,
9111
+ grad: 9 / 10,
9112
+ turn: 360
9113
+ };
9114
+
9115
+ function num(chars) {
9116
+ let value = '';
9117
+ if (chars[_i] === '-' || chars[_i] === '+') {
9118
+ value += chars[_i++];
9119
+ }
9120
+ value += digits(chars);
9121
+ if (chars[_i] === '.' && /\d/.test(chars[_i + 1])) {
9122
+ value += chars[_i++] + digits(chars);
9123
+ }
9124
+ if (chars[_i] === 'e' || chars[_i] === 'E') {
9125
+ if (
9126
+ (chars[_i + 1] === '-' || chars[_i + 1] === '+') &&
9127
+ /\d/.test(chars[_i + 2])
9128
+ ) {
9129
+ value += chars[_i++] + chars[_i++] + digits(chars);
9130
+ } else if (/\d/.test(chars[_i + 1])) {
9131
+ value += chars[_i++] + digits(chars);
9132
+ }
9133
+ }
9134
+ if (is_ident(chars)) {
9135
+ let id = ident(chars);
9136
+ if (id === 'deg' || id === 'rad' || id === 'turn' || id === 'grad') {
9137
+ return { type: Tok.Hue, value: value * huenits[id] };
9138
+ }
9139
+ return undefined;
9140
+ }
9141
+ if (chars[_i] === '%') {
9142
+ _i++;
9143
+ return { type: Tok.Percentage, value: +value };
9144
+ }
9145
+ return { type: Tok.Number, value: +value };
9146
+ }
9147
+
9148
+ /*
9149
+ Consume digits.
9150
+ */
9151
+ function digits(chars) {
9152
+ let v = '';
9153
+ while (/\d/.test(chars[_i])) {
9154
+ v += chars[_i++];
9155
+ }
9156
+ return v;
9157
+ }
9158
+
9159
+ /*
9160
+ Consume an identifier.
9161
+ */
9162
+ function ident(chars) {
9163
+ let v = '';
9164
+ while (_i < chars.length && IdentCodePoint.test(chars[_i])) {
9165
+ v += chars[_i++];
9166
+ }
9167
+ return v;
9168
+ }
9169
+
9170
+ /*
9171
+ Consume an ident-like token.
9172
+ */
9173
+ function identlike(chars) {
9174
+ let v = ident(chars);
9175
+ if (chars[_i] === '(') {
9176
+ _i++;
9177
+ return { type: Tok.Function, value: v };
9178
+ }
9179
+ if (v === 'none') {
9180
+ return { type: Tok.None, value: undefined };
9181
+ }
9182
+ return { type: Tok.Ident, value: v };
9183
+ }
9184
+
9185
+ function tokenize(str = '') {
9186
+ let chars = str.trim();
9187
+ let tokens = [];
9188
+ let ch;
9189
+
9190
+ /* reset counter */
9191
+ _i = 0;
9192
+
9193
+ while (_i < chars.length) {
9194
+ ch = chars[_i++];
9195
+
9196
+ /*
9197
+ Consume whitespace without emitting it
9198
+ */
9199
+ if (ch === '\n' || ch === '\t' || ch === ' ') {
9200
+ while (
9201
+ _i < chars.length &&
9202
+ (chars[_i] === '\n' || chars[_i] === '\t' || chars[_i] === ' ')
9203
+ ) {
9204
+ _i++;
9205
+ }
9206
+ continue;
9207
+ }
9208
+
9209
+ if (ch === ',') {
9210
+ return undefined;
9211
+ }
9212
+
9213
+ if (ch === ')') {
9214
+ tokens.push({ type: Tok.ParenClose });
9215
+ continue;
9216
+ }
9217
+
9218
+ if (ch === '+') {
9219
+ _i--;
9220
+ if (is_num(chars)) {
9221
+ tokens.push(num(chars));
9222
+ continue;
9223
+ }
9224
+ return undefined;
9225
+ }
9226
+
9227
+ if (ch === '-') {
9228
+ _i--;
9229
+ if (is_num(chars)) {
9230
+ tokens.push(num(chars));
9231
+ continue;
9232
+ }
9233
+ if (is_ident(chars)) {
9234
+ tokens.push({ type: Tok.Ident, value: ident(chars) });
9235
+ continue;
9236
+ }
9237
+ return undefined;
9238
+ }
9239
+
9240
+ if (ch === '.') {
9241
+ _i--;
9242
+ if (is_num(chars)) {
9243
+ tokens.push(num(chars));
9244
+ continue;
9245
+ }
9246
+ return undefined;
9247
+ }
9248
+
9249
+ if (ch === '/') {
9250
+ while (
9251
+ _i < chars.length &&
9252
+ (chars[_i] === '\n' || chars[_i] === '\t' || chars[_i] === ' ')
9253
+ ) {
9254
+ _i++;
9255
+ }
9256
+ let alpha;
9257
+ if (is_num(chars)) {
9258
+ alpha = num(chars);
9259
+ if (alpha.type !== Tok.Hue) {
9260
+ tokens.push({ type: Tok.Alpha, value: alpha });
9261
+ continue;
9262
+ }
9263
+ }
9264
+ if (is_ident(chars)) {
9265
+ if (ident(chars) === 'none') {
9266
+ tokens.push({
9267
+ type: Tok.Alpha,
9268
+ value: { type: Tok.None, value: undefined }
9269
+ });
9270
+ continue;
9271
+ }
9272
+ }
9273
+ return undefined;
9274
+ }
9275
+
9276
+ if (/\d/.test(ch)) {
9277
+ _i--;
9278
+ tokens.push(num(chars));
9279
+ continue;
9280
+ }
9281
+
9282
+ if (IdentStartCodePoint.test(ch)) {
9283
+ _i--;
9284
+ tokens.push(identlike(chars));
9285
+ continue;
9286
+ }
9287
+
9288
+ /*
9289
+ Treat everything not already handled as an error.
9290
+ */
9291
+ return undefined;
9292
+ }
9293
+
9294
+ return tokens;
9295
+ }
9296
+
9297
+ function parseColorSyntax(tokens) {
9298
+ tokens._i = 0;
9299
+ let token = tokens[tokens._i++];
9300
+ if (!token || token.type !== Tok.Function || token.value !== 'color') {
9301
+ return undefined;
9302
+ }
9303
+ token = tokens[tokens._i++];
9304
+ if (token.type !== Tok.Ident) {
9305
+ return undefined;
9306
+ }
9307
+ const mode = colorProfiles[token.value];
9308
+ if (!mode) {
9309
+ return undefined;
9310
+ }
9311
+ const res = { mode };
9312
+ const coords = consumeCoords(tokens, false);
9313
+ if (!coords) {
9314
+ return undefined;
9315
+ }
9316
+ const channels = getMode(mode).channels;
9317
+ for (let ii = 0, c, ch; ii < channels.length; ii++) {
9318
+ c = coords[ii];
9319
+ ch = channels[ii];
9320
+ if (c.type !== Tok.None) {
9321
+ res[ch] = c.type === Tok.Number ? c.value : c.value / 100;
9322
+ if (ch === 'alpha') {
9323
+ res[ch] = Math.max(0, Math.min(1, res[ch]));
9324
+ }
9325
+ }
9326
+ }
9327
+ return res;
9328
+ }
9329
+
9330
+ function consumeCoords(tokens, includeHue) {
9331
+ const coords = [];
9332
+ let token;
9333
+ while (tokens._i < tokens.length) {
9334
+ token = tokens[tokens._i++];
9335
+ if (
9336
+ token.type === Tok.None ||
9337
+ token.type === Tok.Number ||
9338
+ token.type === Tok.Alpha ||
9339
+ token.type === Tok.Percentage ||
9340
+ (includeHue && token.type === Tok.Hue)
9341
+ ) {
9342
+ coords.push(token);
9343
+ continue;
9344
+ }
9345
+ if (token.type === Tok.ParenClose) {
9346
+ if (tokens._i < tokens.length) {
9347
+ return undefined;
9348
+ }
9349
+ continue;
9350
+ }
9351
+ return undefined;
9352
+ }
9353
+
9354
+ if (coords.length < 3 || coords.length > 4) {
9355
+ return undefined;
9356
+ }
9357
+
9358
+ if (coords.length === 4) {
9359
+ if (coords[3].type !== Tok.Alpha) {
9360
+ return undefined;
9361
+ }
9362
+ coords[3] = coords[3].value;
9363
+ }
9364
+ if (coords.length === 3) {
9365
+ coords.push({ type: Tok.None, value: undefined });
9366
+ }
9367
+
9368
+ return coords.every(c => c.type !== Tok.Alpha) ? coords : undefined;
9369
+ }
9370
+
9371
+ function parseModernSyntax(tokens, includeHue) {
9372
+ tokens._i = 0;
9373
+ let token = tokens[tokens._i++];
9374
+ if (!token || token.type !== Tok.Function) {
9375
+ return undefined;
9376
+ }
9377
+ let coords = consumeCoords(tokens, includeHue);
9378
+ if (!coords) {
9379
+ return undefined;
9380
+ }
9381
+ coords.unshift(token.value);
9382
+ return coords;
9383
+ }
9384
+
9385
+ const parse$1 = color => {
9386
+ if (typeof color !== 'string') {
9387
+ return undefined;
9388
+ }
9389
+ const tokens = tokenize(color);
9390
+ const parsed = tokens ? parseModernSyntax(tokens, true) : undefined;
9391
+ let result = undefined;
9392
+ let i = 0;
9393
+ let len = parsers.length;
9394
+ while (i < len) {
9395
+ if ((result = parsers[i++](color, parsed)) !== undefined) {
9396
+ return result;
9397
+ }
9398
+ }
9399
+ return tokens ? parseColorSyntax(tokens) : undefined;
9400
+ };
9401
+
9402
+ function parseRgb(color, parsed) {
9403
+ if (!parsed || (parsed[0] !== 'rgb' && parsed[0] !== 'rgba')) {
9404
+ return undefined;
9405
+ }
9406
+ const res = { mode: 'rgb' };
9407
+ const [, r, g, b, alpha] = parsed;
9408
+ if (r.type === Tok.Hue || g.type === Tok.Hue || b.type === Tok.Hue) {
9409
+ return undefined;
9410
+ }
9411
+ if (r.type !== Tok.None) {
9412
+ res.r = r.type === Tok.Number ? r.value / 255 : r.value / 100;
9413
+ }
9414
+ if (g.type !== Tok.None) {
9415
+ res.g = g.type === Tok.Number ? g.value / 255 : g.value / 100;
9416
+ }
9417
+ if (b.type !== Tok.None) {
9418
+ res.b = b.type === Tok.Number ? b.value / 255 : b.value / 100;
9419
+ }
9420
+ if (alpha.type !== Tok.None) {
9421
+ res.alpha = Math.min(
9422
+ 1,
9423
+ Math.max(
9424
+ 0,
9425
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
9426
+ )
9427
+ );
9428
+ }
9429
+
9430
+ return res;
9431
+ }
9432
+
9433
+ const parseTransparent = c =>
9434
+ c === 'transparent'
9435
+ ? { mode: 'rgb', r: 0, g: 0, b: 0, alpha: 0 }
9436
+ : undefined;
9437
+
9438
+ const lerp = (a, b, t) => a + t * (b - a);
9439
+
9440
+ const get_classes = arr => {
9441
+ let classes = [];
9442
+ for (let i = 0; i < arr.length - 1; i++) {
9443
+ let a = arr[i];
9444
+ let b = arr[i + 1];
9445
+ if (a === undefined && b === undefined) {
9446
+ classes.push(undefined);
9447
+ } else if (a !== undefined && b !== undefined) {
9448
+ classes.push([a, b]);
9449
+ } else {
9450
+ classes.push(a !== undefined ? [a, a] : [b, b]);
9451
+ }
9452
+ }
9453
+ return classes;
9454
+ };
9455
+
9456
+ const interpolatorPiecewise = interpolator => arr => {
9457
+ let classes = get_classes(arr);
9458
+ return t => {
9459
+ let cls = t * classes.length;
9460
+ let idx = t >= 1 ? classes.length - 1 : Math.max(Math.floor(cls), 0);
9461
+ let pair = classes[idx];
9462
+ return pair === undefined
9463
+ ? undefined
9464
+ : interpolator(pair[0], pair[1], cls - idx);
9465
+ };
9466
+ };
9467
+
9468
+ const interpolatorLinear = interpolatorPiecewise(lerp);
9469
+
9470
+ const fixupAlpha = arr => {
9471
+ let some_defined = false;
9472
+ let res = arr.map(v => {
9473
+ if (v !== undefined) {
9474
+ some_defined = true;
9475
+ return v;
9476
+ }
9477
+ return 1;
9478
+ });
9479
+ return some_defined ? res : arr;
9480
+ };
9481
+
9482
+ /*
9483
+ sRGB color space
9484
+ */
9485
+
9486
+ const definition$r = {
9487
+ mode: 'rgb',
9488
+ channels: ['r', 'g', 'b', 'alpha'],
9489
+ parse: [
9490
+ parseRgb,
9491
+ parseHex,
9492
+ parseRgbLegacy,
9493
+ parseNamed,
9494
+ parseTransparent,
9495
+ 'srgb'
9496
+ ],
9497
+ serialize: 'srgb',
9498
+ interpolate: {
9499
+ r: interpolatorLinear,
9500
+ g: interpolatorLinear,
9501
+ b: interpolatorLinear,
9502
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
9503
+ },
9504
+ gamut: true,
9505
+ white: { r: 1, g: 1, b: 1 },
9506
+ black: { r: 0, g: 0, b: 0 }
9507
+ };
9508
+
9509
+ /*
9510
+ Convert A98 RGB values to CIE XYZ D65
9511
+
9512
+ References:
9513
+ * https://drafts.csswg.org/css-color/#color-conversion-code
9514
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
9515
+ * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf
9516
+ */
9517
+
9518
+ const linearize$2 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
9519
+
9520
+ const convertA98ToXyz65 = a98 => {
9521
+ let r = linearize$2(a98.r);
9522
+ let g = linearize$2(a98.g);
9523
+ let b = linearize$2(a98.b);
9524
+ let res = {
9525
+ mode: 'xyz65',
9526
+ x:
9527
+ 0.5766690429101305 * r +
9528
+ 0.1855582379065463 * g +
9529
+ 0.1882286462349947 * b,
9530
+ y:
9531
+ 0.297344975250536 * r +
9532
+ 0.6273635662554661 * g +
9533
+ 0.0752914584939979 * b,
9534
+ z:
9535
+ 0.0270313613864123 * r +
9536
+ 0.0706888525358272 * g +
9537
+ 0.9913375368376386 * b
9538
+ };
9539
+ if (a98.alpha !== undefined) {
9540
+ res.alpha = a98.alpha;
9541
+ }
9542
+ return res;
9543
+ };
9544
+
9545
+ /*
9546
+ Convert CIE XYZ D65 values to A98 RGB
9547
+
9548
+ References:
9549
+ * https://drafts.csswg.org/css-color/#color-conversion-code
9550
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
9551
+ */
9552
+
9553
+ const gamma$2 = v => Math.pow(Math.abs(v), 256 / 563) * Math.sign(v);
9554
+
9555
+ const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
9556
+ if (x === undefined) x = 0;
9557
+ if (y === undefined) y = 0;
9558
+ if (z === undefined) z = 0;
9559
+ let res = {
9560
+ mode: 'a98',
9561
+ r: gamma$2(
9562
+ x * 2.0415879038107465 -
9563
+ y * 0.5650069742788597 -
9564
+ 0.3447313507783297 * z
9565
+ ),
9566
+ g: gamma$2(
9567
+ x * -0.9692436362808798 +
9568
+ y * 1.8759675015077206 +
9569
+ 0.0415550574071756 * z
9570
+ ),
9571
+ b: gamma$2(
9572
+ x * 0.0134442806320312 -
9573
+ y * 0.1183623922310184 +
9574
+ 1.0151749943912058 * z
9575
+ )
9576
+ };
9577
+ if (alpha !== undefined) {
9578
+ res.alpha = alpha;
9579
+ }
9580
+ return res;
9581
+ };
9582
+
9583
+ const fn$3 = (c = 0) => {
9584
+ const abs = Math.abs(c);
9585
+ if (abs <= 0.04045) {
9586
+ return c / 12.92;
9587
+ }
9588
+ return (Math.sign(c) || 1) * Math.pow((abs + 0.055) / 1.055, 2.4);
9589
+ };
9590
+
9591
+ const convertRgbToLrgb = ({ r, g, b, alpha }) => {
9592
+ let res = {
9593
+ mode: 'lrgb',
9594
+ r: fn$3(r),
9595
+ g: fn$3(g),
9596
+ b: fn$3(b)
9597
+ };
9598
+ if (alpha !== undefined) res.alpha = alpha;
9599
+ return res;
9600
+ };
9601
+
9602
+ /*
9603
+ Convert sRGB values to CIE XYZ D65
9604
+
9605
+ References:
9606
+ * https://drafts.csswg.org/css-color/#color-conversion-code
9607
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
9608
+ * https://observablehq.com/@danburzo/color-matrix-calculator
9609
+ */
9610
+
9611
+
9612
+ const convertRgbToXyz65 = rgb => {
9613
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb);
9614
+ let res = {
9615
+ mode: 'xyz65',
9616
+ x:
9617
+ 0.4123907992659593 * r +
9618
+ 0.357584339383878 * g +
9619
+ 0.1804807884018343 * b,
9620
+ y:
9621
+ 0.2126390058715102 * r +
9622
+ 0.715168678767756 * g +
9623
+ 0.0721923153607337 * b,
9624
+ z:
9625
+ 0.0193308187155918 * r +
9626
+ 0.119194779794626 * g +
9627
+ 0.9505321522496607 * b
9628
+ };
9629
+ if (alpha !== undefined) {
9630
+ res.alpha = alpha;
9631
+ }
9632
+ return res;
9633
+ };
9634
+
9635
+ const fn$2 = (c = 0) => {
9636
+ const abs = Math.abs(c);
9637
+ if (abs > 0.0031308) {
9638
+ return (Math.sign(c) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - 0.055);
9639
+ }
9640
+ return c * 12.92;
9641
+ };
9642
+
9643
+ const convertLrgbToRgb = ({ r, g, b, alpha }, mode = 'rgb') => {
9644
+ let res = {
9645
+ mode,
9646
+ r: fn$2(r),
9647
+ g: fn$2(g),
9648
+ b: fn$2(b)
9649
+ };
9650
+ if (alpha !== undefined) res.alpha = alpha;
9651
+ return res;
9652
+ };
9653
+
9654
+ /*
9655
+ CIE XYZ D65 values to sRGB.
9656
+
9657
+ References:
9658
+ * https://drafts.csswg.org/css-color/#color-conversion-code
9659
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
9660
+ * https://observablehq.com/@danburzo/color-matrix-calculator
9661
+ */
9662
+
9663
+
9664
+ const convertXyz65ToRgb = ({ x, y, z, alpha }) => {
9665
+ if (x === undefined) x = 0;
9666
+ if (y === undefined) y = 0;
9667
+ if (z === undefined) z = 0;
9668
+ let res = convertLrgbToRgb({
9669
+ r:
9670
+ x * 3.2409699419045226 -
9671
+ y * 1.5373831775700939 -
9672
+ 0.4986107602930034 * z,
9673
+ g:
9674
+ x * -0.9692436362808796 +
9675
+ y * 1.8759675015077204 +
9676
+ 0.0415550574071756 * z,
9677
+ b:
9678
+ x * 0.0556300796969936 -
9679
+ y * 0.2039769588889765 +
9680
+ 1.0569715142428784 * z
9681
+ });
9682
+ if (alpha !== undefined) {
9683
+ res.alpha = alpha;
9684
+ }
9685
+ return res;
9686
+ };
9687
+
9688
+ const definition$q = {
9689
+ ...definition$r,
9690
+ mode: 'a98',
9691
+ parse: ['a98-rgb'],
9692
+ serialize: 'a98-rgb',
9693
+
9694
+ fromMode: {
9695
+ rgb: color => convertXyz65ToA98(convertRgbToXyz65(color)),
9696
+ xyz65: convertXyz65ToA98
9697
+ },
9698
+
9699
+ toMode: {
9700
+ rgb: color => convertXyz65ToRgb(convertA98ToXyz65(color)),
9701
+ xyz65: convertA98ToXyz65
9702
+ }
9703
+ };
9704
+
9705
+ const normalizeHue = hue => ((hue = hue % 360) < 0 ? hue + 360 : hue);
9706
+
9707
+ const hue = (hues, fn) => {
9708
+ return hues
9709
+ .map((hue, idx, arr) => {
9710
+ if (hue === undefined) {
9711
+ return hue;
9712
+ }
9713
+ let normalized = normalizeHue(hue);
9714
+ if (idx === 0 || hues[idx - 1] === undefined) {
9715
+ return normalized;
9716
+ }
9717
+ return fn(normalized - normalizeHue(arr[idx - 1]));
9718
+ })
9719
+ .reduce((acc, curr) => {
9720
+ if (
9721
+ !acc.length ||
9722
+ curr === undefined ||
9723
+ acc[acc.length - 1] === undefined
9724
+ ) {
9725
+ acc.push(curr);
9726
+ return acc;
9727
+ }
9728
+ acc.push(curr + acc[acc.length - 1]);
9729
+ return acc;
9730
+ }, []);
9731
+ };
9732
+
9733
+ const fixupHueShorter = arr =>
9734
+ hue(arr, d => (Math.abs(d) <= 180 ? d : d - 360 * Math.sign(d)));
9735
+
9736
+ const M = [-0.14861, 1.78277, -0.29227, -0.90649, 1.97294, 0];
9737
+
9738
+ const degToRad = Math.PI / 180;
9739
+ const radToDeg = 180 / Math.PI;
9740
+
9741
+ /*
9742
+ Convert a RGB color to the Cubehelix HSL color space.
9743
+
9744
+ This computation is not present in Green's paper:
9745
+ https://arxiv.org/pdf/1108.5083.pdf
9746
+
9747
+ ...but can be derived from the inverse, HSL to RGB conversion.
9748
+
9749
+ It matches the math in Mike Bostock's D3 implementation:
9750
+
9751
+ https://github.com/d3/d3-color/blob/master/src/cubehelix.js
9752
+ */
9753
+
9754
+
9755
+ let DE = M[3] * M[4];
9756
+ let BE = M[1] * M[4];
9757
+ let BCAD = M[1] * M[2] - M[0] * M[3];
9758
+
9759
+ const convertRgbToCubehelix = ({ r, g, b, alpha }) => {
9760
+ if (r === undefined) r = 0;
9761
+ if (g === undefined) g = 0;
9762
+ if (b === undefined) b = 0;
9763
+ let l = (BCAD * b + r * DE - g * BE) / (BCAD + DE - BE);
9764
+ let x = b - l;
9765
+ let y = (M[4] * (g - l) - M[2] * x) / M[3];
9766
+
9767
+ let res = {
9768
+ mode: 'cubehelix',
9769
+ l: l,
9770
+ s:
9771
+ l === 0 || l === 1
9772
+ ? undefined
9773
+ : Math.sqrt(x * x + y * y) / (M[4] * l * (1 - l))
9774
+ };
9775
+
9776
+ if (res.s) res.h = Math.atan2(y, x) * radToDeg - 120;
9777
+ if (alpha !== undefined) res.alpha = alpha;
9778
+
9779
+ return res;
9780
+ };
9781
+
9782
+ const convertCubehelixToRgb = ({ h, s, l, alpha }) => {
9783
+ let res = { mode: 'rgb' };
9784
+
9785
+ h = (h === undefined ? 0 : h + 120) * degToRad;
9786
+ if (l === undefined) l = 0;
9787
+
9788
+ let amp = s === undefined ? 0 : s * l * (1 - l);
9789
+
9790
+ let cosh = Math.cos(h);
9791
+ let sinh = Math.sin(h);
9792
+
9793
+ res.r = l + amp * (M[0] * cosh + M[1] * sinh);
9794
+ res.g = l + amp * (M[2] * cosh + M[3] * sinh);
9795
+ res.b = l + amp * (M[4] * cosh + M[5] * sinh);
9796
+
9797
+ if (alpha !== undefined) res.alpha = alpha;
9798
+ return res;
9799
+ };
9800
+
9801
+ const differenceHueSaturation = (std, smp) => {
9802
+ if (std.h === undefined || smp.h === undefined || !std.s || !smp.s) {
9803
+ return 0;
9804
+ }
9805
+ let std_h = normalizeHue(std.h);
9806
+ let smp_h = normalizeHue(smp.h);
9807
+ let dH = Math.sin((((smp_h - std_h + 360) / 2) * Math.PI) / 180);
9808
+ return 2 * Math.sqrt(std.s * smp.s) * dH;
9809
+ };
9810
+
9811
+ const differenceHueNaive = (std, smp) => {
9812
+ if (std.h === undefined || smp.h === undefined) {
9813
+ return 0;
9814
+ }
9815
+ let std_h = normalizeHue(std.h);
9816
+ let smp_h = normalizeHue(smp.h);
9817
+ if (Math.abs(smp_h - std_h) > 180) {
9818
+ // todo should this be normalized once again?
9819
+ return std_h - (smp_h - 360 * Math.sign(smp_h - std_h));
9820
+ }
9821
+ return smp_h - std_h;
9822
+ };
9823
+
9824
+ const differenceHueChroma = (std, smp) => {
9825
+ if (std.h === undefined || smp.h === undefined || !std.c || !smp.c) {
9826
+ return 0;
9827
+ }
9828
+ let std_h = normalizeHue(std.h);
9829
+ let smp_h = normalizeHue(smp.h);
9830
+ let dH = Math.sin((((smp_h - std_h + 360) / 2) * Math.PI) / 180);
9831
+ return 2 * Math.sqrt(std.c * smp.c) * dH;
9832
+ };
9833
+
9834
+ const averageAngle = val => {
9835
+ // See: https://en.wikipedia.org/wiki/Mean_of_circular_quantities
9836
+ let sum = val.reduce(
9837
+ (sum, val) => {
9838
+ if (val !== undefined) {
9839
+ let rad = (val * Math.PI) / 180;
9840
+ sum.sin += Math.sin(rad);
9841
+ sum.cos += Math.cos(rad);
9842
+ }
9843
+ return sum;
9844
+ },
9845
+ { sin: 0, cos: 0 }
9846
+ );
9847
+ let angle = (Math.atan2(sum.sin, sum.cos) * 180) / Math.PI;
9848
+ return angle < 0 ? 360 + angle : angle;
9849
+ };
9850
+
9851
+ /*
9852
+ Dave Green's Cubehelix
9853
+ ----------------------
9854
+
9855
+ Green, D. A., 2011, "A colour scheme for the display of astronomical intensity images",
9856
+ Bulletin of the Astronomical Society of India, 39, 289. (2011BASI...39..289G at ADS.)
9857
+
9858
+ https://www.mrao.cam.ac.uk/%7Edag/CUBEHELIX/
9859
+ https://arxiv.org/pdf/1108.5083.pdf
9860
+
9861
+ Although Cubehelix was defined to be a method to obtain a colour scheme,
9862
+ it actually contains a definition of a colour space, as identified by
9863
+ Mike Bostock and implemented in D3.js.
9864
+
9865
+ Green's paper introduces the following terminology:
9866
+
9867
+ * a `lightness` dimension in the interval [0, 1]
9868
+ on which we interpolate to obtain the colour scheme
9869
+ * a `start` colour that is analogous to a Hue in HSL space
9870
+ * a number of `rotations` around the Hue cylinder.
9871
+ * a `hue` parameter which should more appropriately be called `saturation`
9872
+
9873
+ As such, the original definition of the Cubehelix scheme is actually an
9874
+ interpolation between two colors in the Cubehelix space:
9875
+
9876
+ H: start H: start + 360 * rotations
9877
+ S: hue -> S: hue
9878
+ L: 0 L: 1
9879
+
9880
+ We can therefore extend the interpolation to any two colors in this space,
9881
+ with a variable Saturation and a Lightness interval other than the fixed 0 -> 1.
9882
+ */
9883
+
9884
+
9885
+ const definition$p = {
9886
+ mode: 'cubehelix',
9887
+ channels: ['h', 's', 'l', 'alpha'],
9888
+ parse: ['--cubehelix'],
9889
+ serialize: '--cubehelix',
9890
+
9891
+ ranges: {
9892
+ h: [0, 360],
9893
+ s: [0, 4.614],
9894
+ l: [0, 1]
9895
+ },
9896
+
9897
+ fromMode: {
9898
+ rgb: convertRgbToCubehelix
9899
+ },
9900
+
9901
+ toMode: {
9902
+ rgb: convertCubehelixToRgb
9903
+ },
9904
+
9905
+ interpolate: {
9906
+ h: {
9907
+ use: interpolatorLinear,
9908
+ fixup: fixupHueShorter
9909
+ },
9910
+ s: interpolatorLinear,
9911
+ l: interpolatorLinear,
9912
+ alpha: {
9913
+ use: interpolatorLinear,
9914
+ fixup: fixupAlpha
9915
+ }
9916
+ },
9917
+
9918
+ difference: {
9919
+ h: differenceHueSaturation
9920
+ },
9921
+
9922
+ average: {
9923
+ h: averageAngle
9924
+ }
9925
+ };
9926
+
9927
+ /*
9928
+ References:
9929
+ * https://drafts.csswg.org/css-color/#lab-to-lch
9930
+ * https://drafts.csswg.org/css-color/#color-conversion-code
9931
+ */
9932
+ const convertLabToLch = ({ l, a, b, alpha }, mode = 'lch') => {
9933
+ if (a === undefined) a = 0;
9934
+ if (b === undefined) b = 0;
9935
+ let c = Math.sqrt(a * a + b * b);
9936
+ let res = { mode, l, c };
9937
+ if (c) res.h = normalizeHue((Math.atan2(b, a) * 180) / Math.PI);
9938
+ if (alpha !== undefined) res.alpha = alpha;
9939
+ return res;
9940
+ };
9941
+
9942
+ /*
9943
+ References:
9944
+ * https://drafts.csswg.org/css-color/#lch-to-lab
9945
+ * https://drafts.csswg.org/css-color/#color-conversion-code
9946
+ */
9947
+ const convertLchToLab = ({ l, c, h, alpha }, mode = 'lab') => {
9948
+ if (h === undefined) h = 0;
9949
+ let res = {
9950
+ mode,
9951
+ l,
9952
+ a: c ? c * Math.cos((h / 180) * Math.PI) : 0,
9953
+ b: c ? c * Math.sin((h / 180) * Math.PI) : 0
9954
+ };
9955
+ if (alpha !== undefined) res.alpha = alpha;
9956
+ return res;
9957
+ };
9958
+
9959
+ const k$3 = Math.pow(29, 3) / Math.pow(3, 3);
9960
+ const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
9961
+
9962
+ /*
9963
+ The XYZ tristimulus values (white point)
9964
+ of standard illuminants for the CIE 1931 2°
9965
+ standard observer.
9966
+
9967
+ See: https://en.wikipedia.org/wiki/Standard_illuminant
9968
+ */
9969
+
9970
+ const D50 = {
9971
+ X: 0.3457 / 0.3585,
9972
+ Y: 1,
9973
+ Z: (1 - 0.3457 - 0.3585) / 0.3585
9974
+ };
9975
+
9976
+ const D65 = {
9977
+ X: 0.3127 / 0.329,
9978
+ Y: 1,
9979
+ Z: (1 - 0.3127 - 0.329) / 0.329
9980
+ };
9981
+
9982
+ let fn$1 = v => (Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$3);
9983
+
9984
+ const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
9985
+ if (l === undefined) l = 0;
9986
+ if (a === undefined) a = 0;
9987
+ if (b === undefined) b = 0;
9988
+
9989
+ let fy = (l + 16) / 116;
9990
+ let fx = a / 500 + fy;
9991
+ let fz = fy - b / 200;
9992
+
9993
+ let res = {
9994
+ mode: 'xyz65',
9995
+ x: fn$1(fx) * D65.X,
9996
+ y: fn$1(fy) * D65.Y,
9997
+ z: fn$1(fz) * D65.Z
9998
+ };
9999
+
10000
+ if (alpha !== undefined) {
10001
+ res.alpha = alpha;
10002
+ }
10003
+
10004
+ return res;
10005
+ };
10006
+
10007
+ const convertLab65ToRgb = lab => convertXyz65ToRgb(convertLab65ToXyz65(lab));
10008
+
10009
+ const f$1 = value => (value > e$1 ? Math.cbrt(value) : (k$3 * value + 16) / 116);
10010
+
10011
+ const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
10012
+ if (x === undefined) x = 0;
10013
+ if (y === undefined) y = 0;
10014
+ if (z === undefined) z = 0;
10015
+ let f0 = f$1(x / D65.X);
10016
+ let f1 = f$1(y / D65.Y);
10017
+ let f2 = f$1(z / D65.Z);
10018
+
10019
+ let res = {
10020
+ mode: 'lab65',
10021
+ l: 116 * f1 - 16,
10022
+ a: 500 * (f0 - f1),
10023
+ b: 200 * (f1 - f2)
10024
+ };
10025
+
10026
+ if (alpha !== undefined) {
10027
+ res.alpha = alpha;
10028
+ }
10029
+
10030
+ return res;
10031
+ };
10032
+
10033
+ const convertRgbToLab65 = rgb => {
10034
+ let res = convertXyz65ToLab65(convertRgbToXyz65(rgb));
10035
+
10036
+ // Fixes achromatic RGB colors having a _slight_ chroma due to floating-point errors
10037
+ // and approximated computations in sRGB <-> CIELab.
10038
+ // See: https://github.com/d3/d3-color/pull/46
10039
+ if (rgb.r === rgb.b && rgb.b === rgb.g) {
10040
+ res.a = res.b = 0;
10041
+ }
10042
+ return res;
10043
+ };
10044
+
10045
+ const kE = 1;
10046
+ const kCH = 1;
10047
+ const θ = (26 / 180) * Math.PI;
10048
+ const cosθ = Math.cos(θ);
10049
+ const sinθ = Math.sin(θ);
10050
+ const factor = 100 / Math.log(139 / 100); // ~ 303.67
10051
+
10052
+ /*
10053
+ Convert DIN99o LCh to CIELab D65
10054
+ --------------------------------
10055
+ */
10056
+
10057
+ const convertDlchToLab65 = ({ l, c, h, alpha }) => {
10058
+ if (l === undefined) l = 0;
10059
+ if (c === undefined) c = 0;
10060
+ if (h === undefined) h = 0;
10061
+ let res = {
10062
+ mode: 'lab65',
10063
+ l: (Math.exp((l * kE) / factor) - 1) / 0.0039
10064
+ };
10065
+
10066
+ let G = (Math.exp(0.0435 * c * kCH * kE) - 1) / 0.075;
10067
+ let e = G * Math.cos((h / 180) * Math.PI - θ);
10068
+ let f = G * Math.sin((h / 180) * Math.PI - θ);
10069
+ res.a = e * cosθ - (f / 0.83) * sinθ;
10070
+ res.b = e * sinθ + (f / 0.83) * cosθ;
10071
+
10072
+ if (alpha !== undefined) res.alpha = alpha;
10073
+ return res;
10074
+ };
10075
+
10076
+ /*
10077
+ Convert CIELab D65 to DIN99o LCh
10078
+ ================================
10079
+ */
10080
+
10081
+ const convertLab65ToDlch = ({ l, a, b, alpha }) => {
10082
+ if (l === undefined) l = 0;
10083
+ if (a === undefined) a = 0;
10084
+ if (b === undefined) b = 0;
10085
+ let e = a * cosθ + b * sinθ;
10086
+ let f = 0.83 * (b * cosθ - a * sinθ);
10087
+ let G = Math.sqrt(e * e + f * f);
10088
+ let res = {
10089
+ mode: 'dlch',
10090
+ l: (factor / kE) * Math.log(1 + 0.0039 * l),
10091
+ c: Math.log(1 + 0.075 * G) / (0.0435 * kCH * kE)
10092
+ };
10093
+
10094
+ if (res.c) {
10095
+ res.h = normalizeHue(((Math.atan2(f, e) + θ) / Math.PI) * 180);
10096
+ }
10097
+
10098
+ if (alpha !== undefined) res.alpha = alpha;
10099
+ return res;
10100
+ };
10101
+
10102
+ const convertDlabToLab65 = c => convertDlchToLab65(convertLabToLch(c, 'dlch'));
10103
+ const convertLab65ToDlab = c => convertLchToLab(convertLab65ToDlch(c), 'dlab');
10104
+
10105
+ const definition$o = {
10106
+ mode: 'dlab',
10107
+
10108
+ parse: ['--din99o-lab'],
10109
+ serialize: '--din99o-lab',
10110
+
10111
+ toMode: {
10112
+ lab65: convertDlabToLab65,
10113
+ rgb: c => convertLab65ToRgb(convertDlabToLab65(c))
10114
+ },
10115
+
10116
+ fromMode: {
10117
+ lab65: convertLab65ToDlab,
10118
+ rgb: c => convertLab65ToDlab(convertRgbToLab65(c))
10119
+ },
10120
+
10121
+ channels: ['l', 'a', 'b', 'alpha'],
10122
+
10123
+ ranges: {
10124
+ l: [0, 100],
10125
+ a: [-40.09, 45.501],
10126
+ b: [-40.469, 44.344]
10127
+ },
10128
+
10129
+ interpolate: {
10130
+ l: interpolatorLinear,
10131
+ a: interpolatorLinear,
10132
+ b: interpolatorLinear,
10133
+ alpha: {
10134
+ use: interpolatorLinear,
10135
+ fixup: fixupAlpha
10136
+ }
10137
+ }
10138
+ };
10139
+
10140
+ const definition$n = {
10141
+ mode: 'dlch',
10142
+
10143
+ parse: ['--din99o-lch'],
10144
+ serialize: '--din99o-lch',
10145
+
10146
+ toMode: {
10147
+ lab65: convertDlchToLab65,
10148
+ dlab: c => convertLchToLab(c, 'dlab'),
10149
+ rgb: c => convertLab65ToRgb(convertDlchToLab65(c))
10150
+ },
10151
+
10152
+ fromMode: {
10153
+ lab65: convertLab65ToDlch,
10154
+ dlab: c => convertLabToLch(c, 'dlch'),
10155
+ rgb: c => convertLab65ToDlch(convertRgbToLab65(c))
10156
+ },
10157
+
10158
+ channels: ['l', 'c', 'h', 'alpha'],
10159
+
10160
+ ranges: {
10161
+ l: [0, 100],
10162
+ c: [0, 51.484],
10163
+ h: [0, 360]
10164
+ },
10165
+
10166
+ interpolate: {
10167
+ l: interpolatorLinear,
10168
+ c: interpolatorLinear,
10169
+ h: {
10170
+ use: interpolatorLinear,
10171
+ fixup: fixupHueShorter
10172
+ },
10173
+ alpha: {
10174
+ use: interpolatorLinear,
10175
+ fixup: fixupAlpha
10176
+ }
10177
+ },
10178
+
10179
+ difference: {
10180
+ h: differenceHueChroma
10181
+ },
10182
+
10183
+ average: {
10184
+ h: averageAngle
10185
+ }
10186
+ };
10187
+
10188
+ // Based on: https://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB
10189
+
10190
+ function convertHsiToRgb({ h, s, i, alpha }) {
10191
+ h = normalizeHue(h !== undefined ? h : 0);
10192
+ if (s === undefined) s = 0;
10193
+ if (i === undefined) i = 0;
10194
+ let f = Math.abs(((h / 60) % 2) - 1);
10195
+ let res;
10196
+ switch (Math.floor(h / 60)) {
10197
+ case 0:
10198
+ res = {
10199
+ r: i * (1 + s * (3 / (2 - f) - 1)),
10200
+ g: i * (1 + s * ((3 * (1 - f)) / (2 - f) - 1)),
10201
+ b: i * (1 - s)
10202
+ };
10203
+ break;
10204
+ case 1:
10205
+ res = {
10206
+ r: i * (1 + s * ((3 * (1 - f)) / (2 - f) - 1)),
10207
+ g: i * (1 + s * (3 / (2 - f) - 1)),
10208
+ b: i * (1 - s)
10209
+ };
10210
+ break;
10211
+ case 2:
10212
+ res = {
10213
+ r: i * (1 - s),
10214
+ g: i * (1 + s * (3 / (2 - f) - 1)),
10215
+ b: i * (1 + s * ((3 * (1 - f)) / (2 - f) - 1))
10216
+ };
10217
+ break;
10218
+ case 3:
10219
+ res = {
10220
+ r: i * (1 - s),
10221
+ g: i * (1 + s * ((3 * (1 - f)) / (2 - f) - 1)),
10222
+ b: i * (1 + s * (3 / (2 - f) - 1))
10223
+ };
10224
+ break;
10225
+ case 4:
10226
+ res = {
10227
+ r: i * (1 + s * ((3 * (1 - f)) / (2 - f) - 1)),
10228
+ g: i * (1 - s),
10229
+ b: i * (1 + s * (3 / (2 - f) - 1))
10230
+ };
10231
+ break;
10232
+ case 5:
10233
+ res = {
10234
+ r: i * (1 + s * (3 / (2 - f) - 1)),
10235
+ g: i * (1 - s),
10236
+ b: i * (1 + s * ((3 * (1 - f)) / (2 - f) - 1))
10237
+ };
10238
+ break;
10239
+ default:
10240
+ res = { r: i * (1 - s), g: i * (1 - s), b: i * (1 - s) };
10241
+ }
10242
+
10243
+ res.mode = 'rgb';
10244
+ if (alpha !== undefined) res.alpha = alpha;
10245
+ return res;
10246
+ }
10247
+
10248
+ // Based on: https://en.wikipedia.org/wiki/HSL_and_HSV#Formal_derivation
10249
+
10250
+ function convertRgbToHsi({ r, g, b, alpha }) {
10251
+ if (r === undefined) r = 0;
10252
+ if (g === undefined) g = 0;
10253
+ if (b === undefined) b = 0;
10254
+ let M = Math.max(r, g, b),
10255
+ m = Math.min(r, g, b);
10256
+ let res = {
10257
+ mode: 'hsi',
10258
+ s: r + g + b === 0 ? 0 : 1 - (3 * m) / (r + g + b),
10259
+ i: (r + g + b) / 3
10260
+ };
10261
+ if (M - m !== 0)
10262
+ res.h =
10263
+ (M === r
10264
+ ? (g - b) / (M - m) + (g < b) * 6
10265
+ : M === g
10266
+ ? (b - r) / (M - m) + 2
10267
+ : (r - g) / (M - m) + 4) * 60;
10268
+ if (alpha !== undefined) res.alpha = alpha;
10269
+ return res;
10270
+ }
10271
+
10272
+ const definition$m = {
10273
+ mode: 'hsi',
10274
+
10275
+ toMode: {
10276
+ rgb: convertHsiToRgb
10277
+ },
10278
+
10279
+ parse: ['--hsi'],
10280
+ serialize: '--hsi',
10281
+
10282
+ fromMode: {
10283
+ rgb: convertRgbToHsi
10284
+ },
10285
+
10286
+ channels: ['h', 's', 'i', 'alpha'],
10287
+
10288
+ ranges: {
10289
+ h: [0, 360]
10290
+ },
10291
+
10292
+ gamut: 'rgb',
10293
+
10294
+ interpolate: {
10295
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
10296
+ s: interpolatorLinear,
10297
+ i: interpolatorLinear,
10298
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
10299
+ },
10300
+
10301
+ difference: {
10302
+ h: differenceHueSaturation
10303
+ },
10304
+
10305
+ average: {
10306
+ h: averageAngle
10307
+ }
10308
+ };
10309
+
10310
+ // Based on: https://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB
10311
+
10312
+ function convertHslToRgb({ h, s, l, alpha }) {
10313
+ h = normalizeHue(h !== undefined ? h : 0);
10314
+ if (s === undefined) s = 0;
10315
+ if (l === undefined) l = 0;
10316
+ let m1 = l + s * (l < 0.5 ? l : 1 - l);
10317
+ let m2 = m1 - (m1 - l) * 2 * Math.abs(((h / 60) % 2) - 1);
10318
+ let res;
10319
+ switch (Math.floor(h / 60)) {
10320
+ case 0:
10321
+ res = { r: m1, g: m2, b: 2 * l - m1 };
10322
+ break;
10323
+ case 1:
10324
+ res = { r: m2, g: m1, b: 2 * l - m1 };
10325
+ break;
10326
+ case 2:
10327
+ res = { r: 2 * l - m1, g: m1, b: m2 };
10328
+ break;
10329
+ case 3:
10330
+ res = { r: 2 * l - m1, g: m2, b: m1 };
10331
+ break;
10332
+ case 4:
10333
+ res = { r: m2, g: 2 * l - m1, b: m1 };
10334
+ break;
10335
+ case 5:
10336
+ res = { r: m1, g: 2 * l - m1, b: m2 };
10337
+ break;
10338
+ default:
10339
+ res = { r: 2 * l - m1, g: 2 * l - m1, b: 2 * l - m1 };
10340
+ }
10341
+ res.mode = 'rgb';
10342
+ if (alpha !== undefined) res.alpha = alpha;
10343
+ return res;
10344
+ }
10345
+
10346
+ // Based on: https://en.wikipedia.org/wiki/HSL_and_HSV#Formal_derivation
10347
+
10348
+ function convertRgbToHsl({ r, g, b, alpha }) {
10349
+ if (r === undefined) r = 0;
10350
+ if (g === undefined) g = 0;
10351
+ if (b === undefined) b = 0;
10352
+ let M = Math.max(r, g, b),
10353
+ m = Math.min(r, g, b);
10354
+ let res = {
10355
+ mode: 'hsl',
10356
+ s: M === m ? 0 : (M - m) / (1 - Math.abs(M + m - 1)),
10357
+ l: 0.5 * (M + m)
10358
+ };
10359
+ if (M - m !== 0)
10360
+ res.h =
10361
+ (M === r
10362
+ ? (g - b) / (M - m) + (g < b) * 6
10363
+ : M === g
10364
+ ? (b - r) / (M - m) + 2
10365
+ : (r - g) / (M - m) + 4) * 60;
10366
+ if (alpha !== undefined) res.alpha = alpha;
10367
+ return res;
10368
+ }
10369
+
10370
+ const hueToDeg = (val, unit) => {
10371
+ switch (unit) {
10372
+ case 'deg':
10373
+ return +val;
10374
+ case 'rad':
10375
+ return (val / Math.PI) * 180;
10376
+ case 'grad':
10377
+ return (val / 10) * 9;
10378
+ case 'turn':
10379
+ return val * 360;
10380
+ }
10381
+ };
10382
+
10383
+ /*
10384
+ hsl() regular expressions for legacy format
10385
+ Reference: https://drafts.csswg.org/css-color/#the-hsl-notation
10386
+ */
10387
+ const hsl_old = new RegExp(
10388
+ `^hsla?\\(\\s*${hue$1}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`
10389
+ );
10390
+
10391
+ const parseHslLegacy = color => {
10392
+ let match = color.match(hsl_old);
10393
+ if (!match) return;
10394
+ let res = { mode: 'hsl' };
10395
+
10396
+ if (match[3] !== undefined) {
10397
+ res.h = +match[3];
10398
+ } else if (match[1] !== undefined && match[2] !== undefined) {
10399
+ res.h = hueToDeg(match[1], match[2]);
10400
+ }
10401
+
10402
+ if (match[4] !== undefined) {
10403
+ res.s = Math.min(Math.max(0, match[4] / 100), 1);
10404
+ }
10405
+
10406
+ if (match[5] !== undefined) {
10407
+ res.l = Math.min(Math.max(0, match[5] / 100), 1);
10408
+ }
10409
+
10410
+ if (match[6] !== undefined) {
10411
+ res.alpha = Math.max(0, Math.min(1, match[6] / 100));
10412
+ } else if (match[7] !== undefined) {
10413
+ res.alpha = Math.max(0, Math.min(1, +match[7]));
10414
+ }
10415
+ return res;
10416
+ };
10417
+
10418
+ function parseHsl(color, parsed) {
10419
+ if (!parsed || (parsed[0] !== 'hsl' && parsed[0] !== 'hsla')) {
10420
+ return undefined;
10421
+ }
10422
+ const res = { mode: 'hsl' };
10423
+ const [, h, s, l, alpha] = parsed;
10424
+
10425
+ if (h.type !== Tok.None) {
10426
+ if (h.type === Tok.Percentage) {
10427
+ return undefined;
10428
+ }
10429
+ res.h = h.value;
10430
+ }
10431
+
10432
+ if (s.type !== Tok.None) {
10433
+ if (s.type === Tok.Hue) {
10434
+ return undefined;
10435
+ }
10436
+ res.s = s.value / 100;
10437
+ }
10438
+
10439
+ if (l.type !== Tok.None) {
10440
+ if (l.type === Tok.Hue) {
10441
+ return undefined;
10442
+ }
10443
+ res.l = l.value / 100;
10444
+ }
10445
+
10446
+ if (alpha.type !== Tok.None) {
10447
+ res.alpha = Math.min(
10448
+ 1,
10449
+ Math.max(
10450
+ 0,
10451
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
10452
+ )
10453
+ );
10454
+ }
10455
+
10456
+ return res;
10457
+ }
10458
+
10459
+ const definition$l = {
10460
+ mode: 'hsl',
10461
+
10462
+ toMode: {
10463
+ rgb: convertHslToRgb
10464
+ },
10465
+
10466
+ fromMode: {
10467
+ rgb: convertRgbToHsl
10468
+ },
10469
+
10470
+ channels: ['h', 's', 'l', 'alpha'],
10471
+
10472
+ ranges: {
10473
+ h: [0, 360]
10474
+ },
10475
+
10476
+ gamut: 'rgb',
10477
+
10478
+ parse: [parseHsl, parseHslLegacy],
10479
+ serialize: c =>
10480
+ `hsl(${c.h !== undefined ? c.h : 'none'} ${
10481
+ c.s !== undefined ? c.s * 100 + '%' : 'none'
10482
+ } ${c.l !== undefined ? c.l * 100 + '%' : 'none'}${
10483
+ c.alpha < 1 ? ` / ${c.alpha}` : ''
10484
+ })`,
10485
+
10486
+ interpolate: {
10487
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
10488
+ s: interpolatorLinear,
10489
+ l: interpolatorLinear,
10490
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
10491
+ },
10492
+
10493
+ difference: {
10494
+ h: differenceHueSaturation
10495
+ },
10496
+
10497
+ average: {
10498
+ h: averageAngle
10499
+ }
10500
+ };
10501
+
10502
+ // Based on: https://en.wikipedia.org/wiki/HSL_and_HSV#Converting_to_RGB
10503
+
10504
+ function convertHsvToRgb({ h, s, v, alpha }) {
10505
+ h = normalizeHue(h !== undefined ? h : 0);
10506
+ if (s === undefined) s = 0;
10507
+ if (v === undefined) v = 0;
10508
+ let f = Math.abs(((h / 60) % 2) - 1);
10509
+ let res;
10510
+ switch (Math.floor(h / 60)) {
10511
+ case 0:
10512
+ res = { r: v, g: v * (1 - s * f), b: v * (1 - s) };
10513
+ break;
10514
+ case 1:
10515
+ res = { r: v * (1 - s * f), g: v, b: v * (1 - s) };
10516
+ break;
10517
+ case 2:
10518
+ res = { r: v * (1 - s), g: v, b: v * (1 - s * f) };
10519
+ break;
10520
+ case 3:
10521
+ res = { r: v * (1 - s), g: v * (1 - s * f), b: v };
10522
+ break;
10523
+ case 4:
10524
+ res = { r: v * (1 - s * f), g: v * (1 - s), b: v };
10525
+ break;
10526
+ case 5:
10527
+ res = { r: v, g: v * (1 - s), b: v * (1 - s * f) };
10528
+ break;
10529
+ default:
10530
+ res = { r: v * (1 - s), g: v * (1 - s), b: v * (1 - s) };
10531
+ }
10532
+ res.mode = 'rgb';
10533
+ if (alpha !== undefined) res.alpha = alpha;
10534
+ return res;
10535
+ }
10536
+
10537
+ // Based on: https://en.wikipedia.org/wiki/HSL_and_HSV#Formal_derivation
10538
+
10539
+ function convertRgbToHsv({ r, g, b, alpha }) {
10540
+ if (r === undefined) r = 0;
10541
+ if (g === undefined) g = 0;
10542
+ if (b === undefined) b = 0;
10543
+ let M = Math.max(r, g, b),
10544
+ m = Math.min(r, g, b);
10545
+ let res = {
10546
+ mode: 'hsv',
10547
+ s: M === 0 ? 0 : 1 - m / M,
10548
+ v: M
10549
+ };
10550
+ if (M - m !== 0)
10551
+ res.h =
10552
+ (M === r
10553
+ ? (g - b) / (M - m) + (g < b) * 6
10554
+ : M === g
10555
+ ? (b - r) / (M - m) + 2
10556
+ : (r - g) / (M - m) + 4) * 60;
10557
+ if (alpha !== undefined) res.alpha = alpha;
10558
+ return res;
10559
+ }
10560
+
10561
+ const definition$k = {
10562
+ mode: 'hsv',
10563
+
10564
+ toMode: {
10565
+ rgb: convertHsvToRgb
10566
+ },
10567
+
10568
+ parse: ['--hsv'],
10569
+ serialize: '--hsv',
10570
+
10571
+ fromMode: {
10572
+ rgb: convertRgbToHsv
10573
+ },
10574
+
10575
+ channels: ['h', 's', 'v', 'alpha'],
10576
+
10577
+ ranges: {
10578
+ h: [0, 360]
10579
+ },
10580
+
10581
+ gamut: 'rgb',
10582
+
10583
+ interpolate: {
10584
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
10585
+ s: interpolatorLinear,
10586
+ v: interpolatorLinear,
10587
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
10588
+ },
10589
+
10590
+ difference: {
10591
+ h: differenceHueSaturation
10592
+ },
10593
+
10594
+ average: {
10595
+ h: averageAngle
10596
+ }
10597
+ };
10598
+
10599
+ /*
10600
+ HWB to RGB converter
10601
+ --------------------
10602
+
10603
+ References:
10604
+ * https://drafts.csswg.org/css-color/#hwb-to-rgb
10605
+ * https://en.wikipedia.org/wiki/HWB_color_model
10606
+ * http://alvyray.com/Papers/CG/HWB_JGTv208.pdf
10607
+ */
10608
+
10609
+
10610
+ function convertHwbToRgb({ h, w, b, alpha }) {
10611
+ if (w === undefined) w = 0;
10612
+ if (b === undefined) b = 0;
10613
+ // normalize w + b to 1
10614
+ if (w + b > 1) {
10615
+ let s = w + b;
10616
+ w /= s;
10617
+ b /= s;
10618
+ }
10619
+ return convertHsvToRgb({
10620
+ h: h,
10621
+ s: b === 1 ? 1 : 1 - w / (1 - b),
10622
+ v: 1 - b,
10623
+ alpha: alpha
10624
+ });
10625
+ }
10626
+
10627
+ /*
10628
+ RGB to HWB converter
10629
+ --------------------
10630
+
10631
+ References:
10632
+ * https://drafts.csswg.org/css-color/#hwb-to-rgb
10633
+ * https://en.wikipedia.org/wiki/HWB_color_model
10634
+ * http://alvyray.com/Papers/CG/HWB_JGTv208.pdf
10635
+ */
10636
+
10637
+
10638
+ function convertRgbToHwb(rgba) {
10639
+ let hsv = convertRgbToHsv(rgba);
10640
+ if (hsv === undefined) return undefined;
10641
+ let s = hsv.s !== undefined ? hsv.s : 0;
10642
+ let v = hsv.v !== undefined ? hsv.v : 0;
10643
+ let res = {
10644
+ mode: 'hwb',
10645
+ w: (1 - s) * v,
10646
+ b: 1 - v
10647
+ };
10648
+ if (hsv.h !== undefined) res.h = hsv.h;
10649
+ if (hsv.alpha !== undefined) res.alpha = hsv.alpha;
10650
+ return res;
10651
+ }
10652
+
10653
+ function ParseHwb(color, parsed) {
10654
+ if (!parsed || parsed[0] !== 'hwb') {
10655
+ return undefined;
10656
+ }
10657
+ const res = { mode: 'hwb' };
10658
+ const [, h, w, b, alpha] = parsed;
10659
+
10660
+ if (h.type !== Tok.None) {
10661
+ if (h.type === Tok.Percentage) {
10662
+ return undefined;
10663
+ }
10664
+ res.h = h.value;
10665
+ }
10666
+
10667
+ if (w.type !== Tok.None) {
10668
+ if (w.type === Tok.Hue) {
10669
+ return undefined;
10670
+ }
10671
+ res.w = w.value / 100;
10672
+ }
10673
+
10674
+ if (b.type !== Tok.None) {
10675
+ if (b.type === Tok.Hue) {
10676
+ return undefined;
10677
+ }
10678
+ res.b = b.value / 100;
10679
+ }
10680
+
10681
+ if (alpha.type !== Tok.None) {
10682
+ res.alpha = Math.min(
10683
+ 1,
10684
+ Math.max(
10685
+ 0,
10686
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
10687
+ )
10688
+ );
10689
+ }
10690
+
10691
+ return res;
10692
+ }
10693
+
10694
+ const definition$j = {
10695
+ mode: 'hwb',
10696
+
10697
+ toMode: {
10698
+ rgb: convertHwbToRgb
10699
+ },
10700
+
10701
+ fromMode: {
10702
+ rgb: convertRgbToHwb
10703
+ },
10704
+
10705
+ channels: ['h', 'w', 'b', 'alpha'],
10706
+
10707
+ ranges: {
10708
+ h: [0, 360]
10709
+ },
10710
+
10711
+ gamut: 'rgb',
10712
+
10713
+ parse: [ParseHwb],
10714
+ serialize: c =>
10715
+ `hwb(${c.h !== undefined ? c.h : 'none'} ${
10716
+ c.w !== undefined ? c.w * 100 + '%' : 'none'
10717
+ } ${c.b !== undefined ? c.b * 100 + '%' : 'none'}${
10718
+ c.alpha < 1 ? ` / ${c.alpha}` : ''
10719
+ })`,
10720
+
10721
+ interpolate: {
10722
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
10723
+ w: interpolatorLinear,
10724
+ b: interpolatorLinear,
10725
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
10726
+ },
10727
+
10728
+ difference: {
10729
+ h: differenceHueNaive
10730
+ },
10731
+
10732
+ average: {
10733
+ h: averageAngle
10734
+ }
10735
+ };
10736
+
10737
+ /*
10738
+ Relative XYZ has Y=1 for media white,
10739
+ BT.2048 says media white Y=203 (at PQ 58).
10740
+ See: https://www.itu.int/dms_pub/itu-r/opb/rep/R-REP-BT.2408-3-2019-PDF-E.pdf
10741
+ */
10742
+ const YW = 203;
10743
+
10744
+ /*
10745
+ https://en.wikipedia.org/wiki/Transfer_functions_in_imaging
10746
+ */
10747
+
10748
+ const M1 = 0.1593017578125;
10749
+ const M2 = 78.84375;
10750
+ const C1 = 0.8359375;
10751
+ const C2 = 18.8515625;
10752
+ const C3 = 18.6875;
10753
+
10754
+ /*
10755
+ Perceptual Quantizer, as defined in Rec. BT 2100-2 (2018)
10756
+
10757
+ * https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en
10758
+ * https://en.wikipedia.org/wiki/Perceptual_quantizer
10759
+ */
10760
+
10761
+ /* PQ EOTF, defined for `v` in [0,1]. */
10762
+ function transferPqDecode(v) {
10763
+ if (v < 0) return 0;
10764
+ const c = Math.pow(v, 1 / M2);
10765
+ return 1e4 * Math.pow(Math.max(0, c - C1) / (C2 - C3 * c), 1 / M1);
10766
+ }
10767
+
10768
+ /* PQ EOTF^-1, defined for `v` in [0, 1e4]. */
10769
+ function transferPqEncode(v) {
10770
+ if (v < 0) return 0;
10771
+ const c = Math.pow(v / 1e4, M1);
10772
+ return Math.pow((C1 + C2 * c) / (1 + C3 * c), M2);
10773
+ }
10774
+
10775
+ const toRel = c => Math.max(c / YW, 0);
10776
+
10777
+ const convertItpToXyz65 = ({ i, t, p, alpha }) => {
10778
+ if (i === undefined) i = 0;
10779
+ if (t === undefined) t = 0;
10780
+ if (p === undefined) p = 0;
10781
+
10782
+ const l = transferPqDecode(
10783
+ i + 0.008609037037932761 * t + 0.11102962500302593 * p
10784
+ );
10785
+ const m = transferPqDecode(
10786
+ i - 0.00860903703793275 * t - 0.11102962500302599 * p
10787
+ );
10788
+ const s = transferPqDecode(
10789
+ i + 0.5600313357106791 * t - 0.32062717498731885 * p
10790
+ );
10791
+
10792
+ const res = {
10793
+ mode: 'xyz65',
10794
+ x: toRel(
10795
+ 2.0701522183894219 * l -
10796
+ 1.3263473389671556 * m +
10797
+ 0.2066510476294051 * s
10798
+ ),
10799
+ y: toRel(
10800
+ 0.3647385209748074 * l +
10801
+ 0.680566024947227 * m -
10802
+ 0.0453045459220346 * s
10803
+ ),
10804
+ z: toRel(
10805
+ -0.049747207535812 * l -
10806
+ 0.0492609666966138 * m +
10807
+ 1.1880659249923042 * s
10808
+ )
10809
+ };
10810
+
10811
+ if (alpha !== undefined) {
10812
+ res.alpha = alpha;
10813
+ }
10814
+
10815
+ return res;
10816
+ };
10817
+
10818
+ const toAbs = (c = 0) => Math.max(c * YW, 0);
10819
+
10820
+ const convertXyz65ToItp = ({ x, y, z, alpha }) => {
10821
+ const absX = toAbs(x);
10822
+ const absY = toAbs(y);
10823
+ const absZ = toAbs(z);
10824
+ const l = transferPqEncode(
10825
+ 0.3592832590121217 * absX +
10826
+ 0.6976051147779502 * absY -
10827
+ 0.0358915932320289 * absZ
10828
+ );
10829
+ const m = transferPqEncode(
10830
+ -0.1920808463704995 * absX +
10831
+ 1.1004767970374323 * absY +
10832
+ 0.0753748658519118 * absZ
10833
+ );
10834
+ const s = transferPqEncode(
10835
+ 0.0070797844607477 * absX +
10836
+ 0.0748396662186366 * absY +
10837
+ 0.8433265453898765 * absZ
10838
+ );
10839
+
10840
+ const i = 0.5 * l + 0.5 * m;
10841
+ const t = 1.61376953125 * l - 3.323486328125 * m + 1.709716796875 * s;
10842
+ const p = 4.378173828125 * l - 4.24560546875 * m - 0.132568359375 * s;
10843
+
10844
+ const res = { mode: 'itp', i, t, p };
10845
+ if (alpha !== undefined) {
10846
+ res.alpha = alpha;
10847
+ }
10848
+
10849
+ return res;
10850
+ };
10851
+
10852
+ /*
10853
+ ICtCp (or ITP) color space, as defined in ITU-R Recommendation BT.2100.
10854
+
10855
+ ICtCp is drafted to be supported in CSS within
10856
+ [CSS Color HDR Module Level 1](https://drafts.csswg.org/css-color-hdr/#ICtCp) spec.
10857
+ */
10858
+
10859
+ const definition$i = {
10860
+ mode: 'itp',
10861
+ channels: ['i', 't', 'p', 'alpha'],
10862
+ parse: ['--ictcp'],
10863
+ serialize: '--ictcp',
10864
+
10865
+ toMode: {
10866
+ xyz65: convertItpToXyz65,
10867
+ rgb: color => convertXyz65ToRgb(convertItpToXyz65(color))
10868
+ },
10869
+
10870
+ fromMode: {
10871
+ xyz65: convertXyz65ToItp,
10872
+ rgb: color => convertXyz65ToItp(convertRgbToXyz65(color))
10873
+ },
10874
+
10875
+ ranges: {
10876
+ i: [0, 0.581],
10877
+ t: [-0.369, 0.272],
10878
+ p: [-0.164, 0.331]
10879
+ },
10880
+
10881
+ interpolate: {
10882
+ i: interpolatorLinear,
10883
+ t: interpolatorLinear,
10884
+ p: interpolatorLinear,
10885
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
10886
+ }
10887
+ };
10888
+
10889
+ const p$2 = 134.03437499999998; // = 1.7 * 2523 / Math.pow(2, 5);
10890
+ const d0$1 = 1.6295499532821566e-11;
10891
+
10892
+ /*
10893
+ The encoding function is derived from Perceptual Quantizer.
10894
+ */
10895
+ const jabPqEncode = v => {
10896
+ if (v < 0) return 0;
10897
+ let vn = Math.pow(v / 10000, M1);
10898
+ return Math.pow((C1 + C2 * vn) / (1 + C3 * vn), p$2);
10899
+ };
10900
+
10901
+ // Convert to Absolute XYZ
10902
+ const abs = (v = 0) => Math.max(v * 203, 0);
10903
+
10904
+ const convertXyz65ToJab = ({ x, y, z, alpha }) => {
10905
+ x = abs(x);
10906
+ y = abs(y);
10907
+ z = abs(z);
10908
+
10909
+ let xp = 1.15 * x - 0.15 * z;
10910
+ let yp = 0.66 * y + 0.34 * x;
10911
+
10912
+ let l = jabPqEncode(0.41478972 * xp + 0.579999 * yp + 0.014648 * z);
10913
+ let m = jabPqEncode(-0.20151 * xp + 1.120649 * yp + 0.0531008 * z);
10914
+ let s = jabPqEncode(-0.0166008 * xp + 0.2648 * yp + 0.6684799 * z);
10915
+
10916
+ let i = (l + m) / 2;
10917
+
10918
+ let res = {
10919
+ mode: 'jab',
10920
+ j: (0.44 * i) / (1 - 0.56 * i) - d0$1,
10921
+ a: 3.524 * l - 4.066708 * m + 0.542708 * s,
10922
+ b: 0.199076 * l + 1.096799 * m - 1.295875 * s
10923
+ };
10924
+
10925
+ if (alpha !== undefined) {
10926
+ res.alpha = alpha;
10927
+ }
10928
+
10929
+ return res;
10930
+ };
10931
+
10932
+ const p$1 = 134.03437499999998; // = 1.7 * 2523 / Math.pow(2, 5);
10933
+ const d0 = 1.6295499532821566e-11;
10934
+
10935
+ /*
10936
+ The encoding function is derived from Perceptual Quantizer.
10937
+ */
10938
+ const jabPqDecode = v => {
10939
+ if (v < 0) return 0;
10940
+ let vp = Math.pow(v, 1 / p$1);
10941
+ return 10000 * Math.pow((C1 - vp) / (C3 * vp - C2), 1 / M1);
10942
+ };
10943
+
10944
+ const rel = v => v / 203;
10945
+
10946
+ const convertJabToXyz65 = ({ j, a, b, alpha }) => {
10947
+ if (j === undefined) j = 0;
10948
+ if (a === undefined) a = 0;
10949
+ if (b === undefined) b = 0;
10950
+ let i = (j + d0) / (0.44 + 0.56 * (j + d0));
10951
+
10952
+ let l = jabPqDecode(i + 0.13860504 * a + 0.058047316 * b);
10953
+ let m = jabPqDecode(i - 0.13860504 * a - 0.058047316 * b);
10954
+ let s = jabPqDecode(i - 0.096019242 * a - 0.8118919 * b);
10955
+
10956
+ let res = {
10957
+ mode: 'xyz65',
10958
+ x: rel(
10959
+ 1.661373024652174 * l -
10960
+ 0.914523081304348 * m +
10961
+ 0.23136208173913045 * s
10962
+ ),
10963
+ y: rel(
10964
+ -0.3250758611844533 * l +
10965
+ 1.571847026732543 * m -
10966
+ 0.21825383453227928 * s
10967
+ ),
10968
+ z: rel(-0.090982811 * l - 0.31272829 * m + 1.5227666 * s)
10969
+ };
10970
+
10971
+ if (alpha !== undefined) {
10972
+ res.alpha = alpha;
10973
+ }
10974
+
10975
+ return res;
10976
+ };
10977
+
10978
+ /*
10979
+ Convert sRGB to JzAzBz.
10980
+
10981
+ For achromatic sRGB colors, adjust the equivalent JzAzBz color
10982
+ to be achromatic as well, insteading of having a very slight chroma.
10983
+ */
10984
+
10985
+
10986
+ const convertRgbToJab = rgb => {
10987
+ let res = convertXyz65ToJab(convertRgbToXyz65(rgb));
10988
+ if (rgb.r === rgb.b && rgb.b === rgb.g) {
10989
+ res.a = res.b = 0;
10990
+ }
10991
+ return res;
10992
+ };
10993
+
10994
+ const convertJabToRgb = color => convertXyz65ToRgb(convertJabToXyz65(color));
10995
+
10996
+ /*
10997
+ The JzAzBz color space.
10998
+
10999
+ Based on:
11000
+
11001
+ Muhammad Safdar, Guihua Cui, Youn Jin Kim, and Ming Ronnier Luo,
11002
+ "Perceptually uniform color space for image signals
11003
+ including high dynamic range and wide gamut,"
11004
+ Opt. Express 25, 15131-15151 (2017)
11005
+
11006
+ https://doi.org/10.1364/OE.25.015131
11007
+ */
11008
+
11009
+
11010
+ const definition$h = {
11011
+ mode: 'jab',
11012
+ channels: ['j', 'a', 'b', 'alpha'],
11013
+
11014
+ parse: ['--jzazbz'],
11015
+ serialize: '--jzazbz',
11016
+
11017
+ fromMode: {
11018
+ rgb: convertRgbToJab,
11019
+ xyz65: convertXyz65ToJab
11020
+ },
11021
+
11022
+ toMode: {
11023
+ rgb: convertJabToRgb,
11024
+ xyz65: convertJabToXyz65
11025
+ },
11026
+
11027
+ ranges: {
11028
+ j: [0, 0.222],
11029
+ a: [-0.109, 0.129],
11030
+ b: [-0.185, 0.134]
11031
+ },
11032
+
11033
+ interpolate: {
11034
+ j: interpolatorLinear,
11035
+ a: interpolatorLinear,
11036
+ b: interpolatorLinear,
11037
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
11038
+ }
11039
+ };
11040
+
11041
+ const convertJabToJch = ({ j, a, b, alpha }) => {
11042
+ if (a === undefined) a = 0;
11043
+ if (b === undefined) b = 0;
11044
+ let c = Math.sqrt(a * a + b * b);
11045
+ let res = {
11046
+ mode: 'jch',
11047
+ j,
11048
+ c
11049
+ };
11050
+ if (c) {
11051
+ res.h = normalizeHue((Math.atan2(b, a) * 180) / Math.PI);
11052
+ }
11053
+ if (alpha !== undefined) {
11054
+ res.alpha = alpha;
11055
+ }
11056
+ return res;
11057
+ };
11058
+
11059
+ const convertJchToJab = ({ j, c, h, alpha }) => {
11060
+ if (h === undefined) h = 0;
11061
+ let res = {
11062
+ mode: 'jab',
11063
+ j,
11064
+ a: c ? c * Math.cos((h / 180) * Math.PI) : 0,
11065
+ b: c ? c * Math.sin((h / 180) * Math.PI) : 0
11066
+ };
11067
+ if (alpha !== undefined) res.alpha = alpha;
11068
+ return res;
11069
+ };
11070
+
11071
+ const definition$g = {
11072
+ mode: 'jch',
11073
+
11074
+ parse: ['--jzczhz'],
11075
+ serialize: '--jzczhz',
11076
+
11077
+ toMode: {
11078
+ jab: convertJchToJab,
11079
+ rgb: c => convertJabToRgb(convertJchToJab(c))
11080
+ },
11081
+
11082
+ fromMode: {
11083
+ rgb: c => convertJabToJch(convertRgbToJab(c)),
11084
+ jab: convertJabToJch
11085
+ },
11086
+
11087
+ channels: ['j', 'c', 'h', 'alpha'],
11088
+
11089
+ ranges: {
11090
+ j: [0, 0.221],
11091
+ c: [0, 0.19],
11092
+ h: [0, 360]
11093
+ },
11094
+
11095
+ interpolate: {
11096
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
11097
+ c: interpolatorLinear,
11098
+ j: interpolatorLinear,
11099
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
11100
+ },
11101
+
11102
+ difference: {
11103
+ h: differenceHueChroma
11104
+ },
11105
+
11106
+ average: {
11107
+ h: averageAngle
11108
+ }
11109
+ };
11110
+
11111
+ const k$2 = Math.pow(29, 3) / Math.pow(3, 3);
11112
+ const e = Math.pow(6, 3) / Math.pow(29, 3);
11113
+
11114
+ let fn = v => (Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k$2);
11115
+
11116
+ const convertLabToXyz50 = ({ l, a, b, alpha }) => {
11117
+ if (l === undefined) l = 0;
11118
+ if (a === undefined) a = 0;
11119
+ if (b === undefined) b = 0;
11120
+ let fy = (l + 16) / 116;
11121
+ let fx = a / 500 + fy;
11122
+ let fz = fy - b / 200;
11123
+
11124
+ let res = {
11125
+ mode: 'xyz50',
11126
+ x: fn(fx) * D50.X,
11127
+ y: fn(fy) * D50.Y,
11128
+ z: fn(fz) * D50.Z
11129
+ };
11130
+
11131
+ if (alpha !== undefined) {
11132
+ res.alpha = alpha;
11133
+ }
11134
+
11135
+ return res;
11136
+ };
11137
+
11138
+ /*
11139
+ CIE XYZ D50 values to sRGB.
11140
+
11141
+ References:
11142
+ * https://drafts.csswg.org/css-color/#color-conversion-code
11143
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
11144
+ */
11145
+
11146
+
11147
+ const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
11148
+ if (x === undefined) x = 0;
11149
+ if (y === undefined) y = 0;
11150
+ if (z === undefined) z = 0;
11151
+ let res = convertLrgbToRgb({
11152
+ r:
11153
+ x * 3.1341359569958707 -
11154
+ y * 1.6173863321612538 -
11155
+ 0.4906619460083532 * z,
11156
+ g:
11157
+ x * -0.978795502912089 +
11158
+ y * 1.916254567259524 +
11159
+ 0.03344273116131949 * z,
11160
+ b:
11161
+ x * 0.07195537988411677 -
11162
+ y * 0.2289768264158322 +
11163
+ 1.405386058324125 * z
11164
+ });
11165
+ if (alpha !== undefined) {
11166
+ res.alpha = alpha;
11167
+ }
11168
+ return res;
11169
+ };
11170
+
11171
+ const convertLabToRgb = lab => convertXyz50ToRgb(convertLabToXyz50(lab));
11172
+
11173
+ /*
11174
+ Convert sRGB values to CIE XYZ D50
11175
+
11176
+ References:
11177
+ * https://drafts.csswg.org/css-color/#color-conversion-code
11178
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
11179
+
11180
+ */
11181
+
11182
+
11183
+ const convertRgbToXyz50 = rgb => {
11184
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb);
11185
+ let res = {
11186
+ mode: 'xyz50',
11187
+ x:
11188
+ 0.436065742824811 * r +
11189
+ 0.3851514688337912 * g +
11190
+ 0.14307845442264197 * b,
11191
+ y:
11192
+ 0.22249319175623702 * r +
11193
+ 0.7168870538238823 * g +
11194
+ 0.06061979053616537 * b,
11195
+ z:
11196
+ 0.013923904500943465 * r +
11197
+ 0.09708128566574634 * g +
11198
+ 0.7140993584005155 * b
11199
+ };
11200
+ if (alpha !== undefined) {
11201
+ res.alpha = alpha;
11202
+ }
11203
+ return res;
11204
+ };
11205
+
11206
+ const f = value => (value > e ? Math.cbrt(value) : (k$2 * value + 16) / 116);
11207
+
11208
+ const convertXyz50ToLab = ({ x, y, z, alpha }) => {
11209
+ if (x === undefined) x = 0;
11210
+ if (y === undefined) y = 0;
11211
+ if (z === undefined) z = 0;
11212
+ let f0 = f(x / D50.X);
11213
+ let f1 = f(y / D50.Y);
11214
+ let f2 = f(z / D50.Z);
11215
+
11216
+ let res = {
11217
+ mode: 'lab',
11218
+ l: 116 * f1 - 16,
11219
+ a: 500 * (f0 - f1),
11220
+ b: 200 * (f1 - f2)
11221
+ };
11222
+
11223
+ if (alpha !== undefined) {
11224
+ res.alpha = alpha;
11225
+ }
11226
+
11227
+ return res;
11228
+ };
11229
+
11230
+ const convertRgbToLab = rgb => {
11231
+ let res = convertXyz50ToLab(convertRgbToXyz50(rgb));
11232
+
11233
+ // Fixes achromatic RGB colors having a _slight_ chroma due to floating-point errors
11234
+ // and approximated computations in sRGB <-> CIELab.
11235
+ // See: https://github.com/d3/d3-color/pull/46
11236
+ if (rgb.r === rgb.b && rgb.b === rgb.g) {
11237
+ res.a = res.b = 0;
11238
+ }
11239
+ return res;
11240
+ };
11241
+
11242
+ function parseLab(color, parsed) {
11243
+ if (!parsed || parsed[0] !== 'lab') {
11244
+ return undefined;
11245
+ }
11246
+ const res = { mode: 'lab' };
11247
+ const [, l, a, b, alpha] = parsed;
11248
+ if (l.type === Tok.Hue || a.type === Tok.Hue || b.type === Tok.Hue) {
11249
+ return undefined;
11250
+ }
11251
+ if (l.type !== Tok.None) {
11252
+ res.l = Math.min(Math.max(0, l.value), 100);
11253
+ }
11254
+ if (a.type !== Tok.None) {
11255
+ res.a = a.type === Tok.Number ? a.value : (a.value * 125) / 100;
11256
+ }
11257
+ if (b.type !== Tok.None) {
11258
+ res.b = b.type === Tok.Number ? b.value : (b.value * 125) / 100;
11259
+ }
11260
+ if (alpha.type !== Tok.None) {
11261
+ res.alpha = Math.min(
11262
+ 1,
11263
+ Math.max(
11264
+ 0,
11265
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
11266
+ )
11267
+ );
11268
+ }
11269
+
11270
+ return res;
11271
+ }
11272
+
11273
+ const definition$f = {
11274
+ mode: 'lab',
11275
+
11276
+ toMode: {
11277
+ xyz50: convertLabToXyz50,
11278
+ rgb: convertLabToRgb
11279
+ },
11280
+
11281
+ fromMode: {
11282
+ xyz50: convertXyz50ToLab,
11283
+ rgb: convertRgbToLab
11284
+ },
11285
+
11286
+ channels: ['l', 'a', 'b', 'alpha'],
11287
+
11288
+ ranges: {
11289
+ l: [0, 100],
11290
+ a: [-125, 125],
11291
+ b: [-125, 125]
11292
+ },
11293
+
11294
+ parse: [parseLab],
11295
+ serialize: c =>
11296
+ `lab(${c.l !== undefined ? c.l : 'none'} ${
11297
+ c.a !== undefined ? c.a : 'none'
11298
+ } ${c.b !== undefined ? c.b : 'none'}${
11299
+ c.alpha < 1 ? ` / ${c.alpha}` : ''
11300
+ })`,
11301
+
11302
+ interpolate: {
11303
+ l: interpolatorLinear,
11304
+ a: interpolatorLinear,
11305
+ b: interpolatorLinear,
11306
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
11307
+ }
11308
+ };
11309
+
11310
+ const definition$e = {
11311
+ ...definition$f,
11312
+ mode: 'lab65',
11313
+
11314
+ parse: ['--lab-d65'],
11315
+ serialize: '--lab-d65',
11316
+
11317
+ toMode: {
11318
+ xyz65: convertLab65ToXyz65,
11319
+ rgb: convertLab65ToRgb
11320
+ },
11321
+
11322
+ fromMode: {
11323
+ xyz65: convertXyz65ToLab65,
11324
+ rgb: convertRgbToLab65
11325
+ },
11326
+
11327
+ ranges: {
11328
+ l: [0, 100],
11329
+ a: [-125, 125],
11330
+ b: [-125, 125]
11331
+ }
11332
+ };
11333
+
11334
+ function parseLch(color, parsed) {
11335
+ if (!parsed || parsed[0] !== 'lch') {
11336
+ return undefined;
11337
+ }
11338
+ const res = { mode: 'lch' };
11339
+ const [, l, c, h, alpha] = parsed;
11340
+ if (l.type !== Tok.None) {
11341
+ if (l.type === Tok.Hue) {
11342
+ return undefined;
11343
+ }
11344
+ res.l = Math.min(Math.max(0, l.value), 100);
11345
+ }
11346
+ if (c.type !== Tok.None) {
11347
+ res.c = Math.max(
11348
+ 0,
11349
+ c.type === Tok.Number ? c.value : (c.value * 150) / 100
11350
+ );
11351
+ }
11352
+ if (h.type !== Tok.None) {
11353
+ if (h.type === Tok.Percentage) {
11354
+ return undefined;
11355
+ }
11356
+ res.h = h.value;
11357
+ }
11358
+ if (alpha.type !== Tok.None) {
11359
+ res.alpha = Math.min(
11360
+ 1,
11361
+ Math.max(
11362
+ 0,
11363
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
11364
+ )
11365
+ );
11366
+ }
11367
+
11368
+ return res;
11369
+ }
11370
+
11371
+ const definition$d = {
11372
+ mode: 'lch',
11373
+
11374
+ toMode: {
11375
+ lab: convertLchToLab,
11376
+ rgb: c => convertLabToRgb(convertLchToLab(c))
11377
+ },
11378
+
11379
+ fromMode: {
11380
+ rgb: c => convertLabToLch(convertRgbToLab(c)),
11381
+ lab: convertLabToLch
11382
+ },
11383
+
11384
+ channels: ['l', 'c', 'h', 'alpha'],
11385
+
11386
+ ranges: {
11387
+ l: [0, 100],
11388
+ c: [0, 150],
11389
+ h: [0, 360]
11390
+ },
11391
+
11392
+ parse: [parseLch],
11393
+ serialize: c =>
11394
+ `lch(${c.l !== undefined ? c.l : 'none'} ${
11395
+ c.c !== undefined ? c.c : 'none'
11396
+ } ${c.h !== undefined ? c.h : 'none'}${
11397
+ c.alpha < 1 ? ` / ${c.alpha}` : ''
11398
+ })`,
11399
+
11400
+ interpolate: {
11401
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
11402
+ c: interpolatorLinear,
11403
+ l: interpolatorLinear,
11404
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
11405
+ },
11406
+
11407
+ difference: {
11408
+ h: differenceHueChroma
11409
+ },
11410
+
11411
+ average: {
11412
+ h: averageAngle
11413
+ }
11414
+ };
11415
+
11416
+ const definition$c = {
11417
+ ...definition$d,
11418
+ mode: 'lch65',
11419
+
11420
+ parse: ['--lch-d65'],
11421
+ serialize: '--lch-d65',
11422
+
11423
+ toMode: {
11424
+ lab65: c => convertLchToLab(c, 'lab65'),
11425
+ rgb: c => convertLab65ToRgb(convertLchToLab(c, 'lab65'))
11426
+ },
11427
+
11428
+ fromMode: {
11429
+ rgb: c => convertLabToLch(convertRgbToLab65(c), 'lch65'),
11430
+ lab65: c => convertLabToLch(c, 'lch65')
11431
+ },
11432
+
11433
+ ranges: {
11434
+ l: [0, 100],
11435
+ c: [0, 150],
11436
+ h: [0, 360]
11437
+ }
11438
+ };
11439
+
11440
+ const convertLuvToLchuv = ({ l, u, v, alpha }) => {
11441
+ if (u === undefined) u = 0;
11442
+ if (v === undefined) v = 0;
11443
+ let c = Math.sqrt(u * u + v * v);
11444
+ let res = {
11445
+ mode: 'lchuv',
11446
+ l: l,
11447
+ c: c
11448
+ };
11449
+ if (c) {
11450
+ res.h = normalizeHue((Math.atan2(v, u) * 180) / Math.PI);
11451
+ }
11452
+ if (alpha !== undefined) {
11453
+ res.alpha = alpha;
11454
+ }
11455
+ return res;
11456
+ };
11457
+
11458
+ const convertLchuvToLuv = ({ l, c, h, alpha }) => {
11459
+ if (h === undefined) h = 0;
11460
+ let res = {
11461
+ mode: 'luv',
11462
+ l: l,
11463
+ u: c ? c * Math.cos((h / 180) * Math.PI) : 0,
11464
+ v: c ? c * Math.sin((h / 180) * Math.PI) : 0
11465
+ };
11466
+ if (alpha !== undefined) {
11467
+ res.alpha = alpha;
11468
+ }
11469
+ return res;
11470
+ };
11471
+
11472
+ const u_fn$1 = (x, y, z) => (4 * x) / (x + 15 * y + 3 * z);
11473
+ const v_fn$1 = (x, y, z) => (9 * y) / (x + 15 * y + 3 * z);
11474
+
11475
+ const un$1 = u_fn$1(D50.X, D50.Y, D50.Z);
11476
+ const vn$1 = v_fn$1(D50.X, D50.Y, D50.Z);
11477
+
11478
+ const l_fn = value => (value <= e ? k$2 * value : 116 * Math.cbrt(value) - 16);
11479
+
11480
+ const convertXyz50ToLuv = ({ x, y, z, alpha }) => {
11481
+ if (x === undefined) x = 0;
11482
+ if (y === undefined) y = 0;
11483
+ if (z === undefined) z = 0;
11484
+ let l = l_fn(y / D50.Y);
11485
+ let u = u_fn$1(x, y, z);
11486
+ let v = v_fn$1(x, y, z);
11487
+
11488
+ // guard against NaNs produced by `xyz(0 0 0)` black
11489
+ if (!isFinite(u) || !isFinite(v)) {
11490
+ l = u = v = 0;
11491
+ } else {
11492
+ u = 13 * l * (u - un$1);
11493
+ v = 13 * l * (v - vn$1);
11494
+ }
11495
+
11496
+ let res = {
11497
+ mode: 'luv',
11498
+ l,
11499
+ u,
11500
+ v
11501
+ };
11502
+
11503
+ if (alpha !== undefined) {
11504
+ res.alpha = alpha;
11505
+ }
11506
+
11507
+ return res;
11508
+ };
11509
+
11510
+ const u_fn = (x, y, z) => (4 * x) / (x + 15 * y + 3 * z);
11511
+ const v_fn = (x, y, z) => (9 * y) / (x + 15 * y + 3 * z);
11512
+
11513
+ const un = u_fn(D50.X, D50.Y, D50.Z);
11514
+ const vn = v_fn(D50.X, D50.Y, D50.Z);
11515
+
11516
+ const convertLuvToXyz50 = ({ l, u, v, alpha }) => {
11517
+ if (l === undefined) l = 0;
11518
+ if (l === 0) {
11519
+ return { mode: 'xyz50', x: 0, y: 0, z: 0 };
11520
+ }
11521
+
11522
+ if (u === undefined) u = 0;
11523
+ if (v === undefined) v = 0;
11524
+
11525
+ let up = u / (13 * l) + un;
11526
+ let vp = v / (13 * l) + vn;
11527
+ let y = D50.Y * (l <= 8 ? l / k$2 : Math.pow((l + 16) / 116, 3));
11528
+ let x = (y * (9 * up)) / (4 * vp);
11529
+ let z = (y * (12 - 3 * up - 20 * vp)) / (4 * vp);
11530
+
11531
+ let res = { mode: 'xyz50', x, y, z };
11532
+ if (alpha !== undefined) {
11533
+ res.alpha = alpha;
11534
+ }
11535
+
11536
+ return res;
11537
+ };
11538
+
11539
+ /*
11540
+ CIELChuv color space
11541
+ --------------------
11542
+
11543
+ Reference:
11544
+
11545
+ https://en.wikipedia.org/wiki/CIELUV
11546
+ */
11547
+
11548
+
11549
+ const convertRgbToLchuv = rgb =>
11550
+ convertLuvToLchuv(convertXyz50ToLuv(convertRgbToXyz50(rgb)));
11551
+ const convertLchuvToRgb = lchuv =>
11552
+ convertXyz50ToRgb(convertLuvToXyz50(convertLchuvToLuv(lchuv)));
11553
+
11554
+ const definition$b = {
11555
+ mode: 'lchuv',
11556
+
11557
+ toMode: {
11558
+ luv: convertLchuvToLuv,
11559
+ rgb: convertLchuvToRgb
11560
+ },
11561
+
11562
+ fromMode: {
11563
+ rgb: convertRgbToLchuv,
11564
+ luv: convertLuvToLchuv
11565
+ },
11566
+
11567
+ channels: ['l', 'c', 'h', 'alpha'],
11568
+
11569
+ parse: ['--lchuv'],
11570
+ serialize: '--lchuv',
11571
+
11572
+ ranges: {
11573
+ l: [0, 100],
11574
+ c: [0, 176.956],
11575
+ h: [0, 360]
11576
+ },
11577
+
11578
+ interpolate: {
11579
+ h: { use: interpolatorLinear, fixup: fixupHueShorter },
11580
+ c: interpolatorLinear,
11581
+ l: interpolatorLinear,
11582
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
11583
+ },
11584
+
11585
+ difference: {
11586
+ h: differenceHueChroma
11587
+ },
11588
+
11589
+ average: {
11590
+ h: averageAngle
11591
+ }
11592
+ };
11593
+
11594
+ const definition$a = {
11595
+ ...definition$r,
11596
+ mode: 'lrgb',
11597
+
11598
+ toMode: {
11599
+ rgb: convertLrgbToRgb
11600
+ },
11601
+
11602
+ fromMode: {
11603
+ rgb: convertRgbToLrgb
11604
+ },
11605
+
11606
+ parse: ['srgb-linear'],
11607
+ serialize: 'srgb-linear'
11608
+ };
11609
+
11610
+ /*
11611
+ CIELUV color space
11612
+ ------------------
11613
+
11614
+ Reference:
11615
+
11616
+ https://en.wikipedia.org/wiki/CIELUV
11617
+ */
11618
+
11619
+
11620
+ const definition$9 = {
11621
+ mode: 'luv',
11622
+
11623
+ toMode: {
11624
+ xyz50: convertLuvToXyz50,
11625
+ rgb: luv => convertXyz50ToRgb(convertLuvToXyz50(luv))
11626
+ },
11627
+
11628
+ fromMode: {
11629
+ xyz50: convertXyz50ToLuv,
11630
+ rgb: rgb => convertXyz50ToLuv(convertRgbToXyz50(rgb))
11631
+ },
11632
+
11633
+ channels: ['l', 'u', 'v', 'alpha'],
11634
+
11635
+ parse: ['--luv'],
11636
+ serialize: '--luv',
11637
+
11638
+ ranges: {
11639
+ l: [0, 100],
11640
+ u: [-84.936, 175.042],
11641
+ v: [-125.882, 87.243]
11642
+ },
11643
+
11644
+ interpolate: {
11645
+ l: interpolatorLinear,
11646
+ u: interpolatorLinear,
11647
+ v: interpolatorLinear,
11648
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
11649
+ }
11650
+ };
11651
+
11652
+ const convertLrgbToOklab = ({ r, g, b, alpha }) => {
11653
+ if (r === undefined) r = 0;
11654
+ if (g === undefined) g = 0;
11655
+ if (b === undefined) b = 0;
11656
+
11657
+ let L = Math.cbrt(
11658
+ 0.412221469470763 * r + 0.5363325372617348 * g + 0.0514459932675022 * b
11659
+ );
11660
+ let M = Math.cbrt(
11661
+ 0.2119034958178252 * r + 0.6806995506452344 * g + 0.1073969535369406 * b
11662
+ );
11663
+ let S = Math.cbrt(
11664
+ 0.0883024591900564 * r + 0.2817188391361215 * g + 0.6299787016738222 * b
11665
+ );
11666
+
11667
+ let res = {
11668
+ mode: 'oklab',
11669
+ l:
11670
+ 0.210454268309314 * L +
11671
+ 0.7936177747023054 * M -
11672
+ 0.0040720430116193 * S,
11673
+ a:
11674
+ 1.9779985324311684 * L -
11675
+ 2.4285922420485799 * M +
11676
+ 0.450593709617411 * S,
11677
+ b:
11678
+ 0.0259040424655478 * L +
11679
+ 0.7827717124575296 * M -
11680
+ 0.8086757549230774 * S
11681
+ };
11682
+
11683
+ if (alpha !== undefined) {
11684
+ res.alpha = alpha;
11685
+ }
11686
+
11687
+ return res;
11688
+ };
11689
+
11690
+ const convertRgbToOklab = rgb => {
11691
+ let res = convertLrgbToOklab(convertRgbToLrgb(rgb));
11692
+ if (rgb.r === rgb.b && rgb.b === rgb.g) {
11693
+ res.a = res.b = 0;
11694
+ }
11695
+ return res;
11696
+ };
11697
+
11698
+ const convertOklabToLrgb = ({ l, a, b, alpha }) => {
11699
+ if (l === undefined) l = 0;
11700
+ if (a === undefined) a = 0;
11701
+ if (b === undefined) b = 0;
11702
+
11703
+ let L = Math.pow(l + 0.3963377773761749 * a + 0.2158037573099136 * b, 3);
11704
+ let M = Math.pow(l - 0.1055613458156586 * a - 0.0638541728258133 * b, 3);
11705
+ let S = Math.pow(l - 0.0894841775298119 * a - 1.2914855480194092 * b, 3);
11706
+
11707
+ let res = {
11708
+ mode: 'lrgb',
11709
+ r:
11710
+ 4.0767416360759574 * L -
11711
+ 3.3077115392580616 * M +
11712
+ 0.2309699031821044 * S,
11713
+ g:
11714
+ -1.2684379732850317 * L +
11715
+ 2.6097573492876887 * M -
11716
+ 0.3413193760026573 * S,
11717
+ b:
11718
+ -0.0041960761386756 * L -
11719
+ 0.7034186179359362 * M +
11720
+ 1.7076146940746117 * S
11721
+ };
11722
+
11723
+ if (alpha !== undefined) {
11724
+ res.alpha = alpha;
11725
+ }
11726
+
11727
+ return res;
11728
+ };
11729
+
11730
+ const convertOklabToRgb = c => convertLrgbToRgb(convertOklabToLrgb(c));
11731
+
11732
+ /*
11733
+ Adapted from code by Björn Ottosson,
11734
+ released under the MIT license:
11735
+
11736
+ Copyright (c) 2021 Björn Ottosson
11737
+
11738
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
11739
+ this software and associated documentation files (the "Software"), to deal in
11740
+ the Software without restriction, including without limitation the rights to
11741
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
11742
+ of the Software, and to permit persons to whom the Software is furnished to do
11743
+ so, subject to the following conditions:
11744
+
11745
+ The above copyright notice and this permission notice shall be included in all
11746
+ copies or substantial portions of the Software.
11747
+
11748
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11749
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11750
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
11751
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11752
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11753
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
11754
+ SOFTWARE.
11755
+ */
11756
+
11757
+
11758
+ function toe(x) {
11759
+ const k_1 = 0.206;
11760
+ const k_2 = 0.03;
11761
+ const k_3 = (1 + k_1) / (1 + k_2);
11762
+ return (
11763
+ 0.5 *
11764
+ (k_3 * x -
11765
+ k_1 +
11766
+ Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x))
11767
+ );
11768
+ }
11769
+
11770
+ function toe_inv(x) {
11771
+ const k_1 = 0.206;
11772
+ const k_2 = 0.03;
11773
+ const k_3 = (1 + k_1) / (1 + k_2);
11774
+ return (x * x + k_1 * x) / (k_3 * (x + k_2));
11775
+ }
11776
+
11777
+ // Finds the maximum saturation possible for a given hue that fits in sRGB
11778
+ // Saturation here is defined as S = C/L
11779
+ // a and b must be normalized so a^2 + b^2 == 1
11780
+ function compute_max_saturation(a, b) {
11781
+ // Max saturation will be when one of r, g or b goes below zero.
11782
+
11783
+ // Select different coefficients depending on which component goes below zero first
11784
+ let k0, k1, k2, k3, k4, wl, wm, ws;
11785
+
11786
+ if (-1.88170328 * a - 0.80936493 * b > 1) {
11787
+ // Red component
11788
+ k0 = 1.19086277;
11789
+ k1 = 1.76576728;
11790
+ k2 = 0.59662641;
11791
+ k3 = 0.75515197;
11792
+ k4 = 0.56771245;
11793
+ wl = 4.0767416621;
11794
+ wm = -3.3077115913;
11795
+ ws = 0.2309699292;
11796
+ } else if (1.81444104 * a - 1.19445276 * b > 1) {
11797
+ // Green component
11798
+ k0 = 0.73956515;
11799
+ k1 = -0.45954404;
11800
+ k2 = 0.08285427;
11801
+ k3 = 0.1254107;
11802
+ k4 = 0.14503204;
11803
+ wl = -1.2684380046;
11804
+ wm = 2.6097574011;
11805
+ ws = -0.3413193965;
11806
+ } else {
11807
+ // Blue component
11808
+ k0 = 1.35733652;
11809
+ k1 = -915799e-8;
11810
+ k2 = -1.1513021;
11811
+ k3 = -0.50559606;
11812
+ k4 = 692167e-8;
11813
+ wl = -0.0041960863;
11814
+ wm = -0.7034186147;
11815
+ ws = 1.707614701;
11816
+ }
11817
+
11818
+ // Approximate max saturation using a polynomial:
11819
+ let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
11820
+
11821
+ // Do one step Halley's method to get closer
11822
+ // this gives an error less than 10e6, except for some blue hues where the dS/dh is close to infinite
11823
+ // this should be sufficient for most applications, otherwise do two/three steps
11824
+
11825
+ let k_l = 0.3963377774 * a + 0.2158037573 * b;
11826
+ let k_m = -0.1055613458 * a - 0.0638541728 * b;
11827
+ let k_s = -0.0894841775 * a - 1.291485548 * b;
11828
+
11829
+ {
11830
+ let l_ = 1 + S * k_l;
11831
+ let m_ = 1 + S * k_m;
11832
+ let s_ = 1 + S * k_s;
11833
+
11834
+ let l = l_ * l_ * l_;
11835
+ let m = m_ * m_ * m_;
11836
+ let s = s_ * s_ * s_;
11837
+
11838
+ let l_dS = 3 * k_l * l_ * l_;
11839
+ let m_dS = 3 * k_m * m_ * m_;
11840
+ let s_dS = 3 * k_s * s_ * s_;
11841
+
11842
+ let l_dS2 = 6 * k_l * k_l * l_;
11843
+ let m_dS2 = 6 * k_m * k_m * m_;
11844
+ let s_dS2 = 6 * k_s * k_s * s_;
11845
+
11846
+ let f = wl * l + wm * m + ws * s;
11847
+ let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
11848
+ let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
11849
+
11850
+ S = S - (f * f1) / (f1 * f1 - 0.5 * f * f2);
11851
+ }
11852
+
11853
+ return S;
11854
+ }
11855
+
11856
+ function find_cusp(a, b) {
11857
+ // First, find the maximum saturation (saturation S = C/L)
11858
+ let S_cusp = compute_max_saturation(a, b);
11859
+
11860
+ // Convert to linear sRGB to find the first point where at least one of r,g or b >= 1:
11861
+ let rgb = convertOklabToLrgb({ l: 1, a: S_cusp * a, b: S_cusp * b });
11862
+ let L_cusp = Math.cbrt(1 / Math.max(rgb.r, rgb.g, rgb.b));
11863
+ let C_cusp = L_cusp * S_cusp;
11864
+
11865
+ return [L_cusp, C_cusp];
11866
+ }
11867
+
11868
+ // Finds intersection of the line defined by
11869
+ // L = L0 * (1 - t) + t * L1;
11870
+ // C = t * C1;
11871
+ // a and b must be normalized so a^2 + b^2 == 1
11872
+ function find_gamut_intersection(a, b, L1, C1, L0, cusp = null) {
11873
+ if (!cusp) {
11874
+ // Find the cusp of the gamut triangle
11875
+ cusp = find_cusp(a, b);
11876
+ }
11877
+
11878
+ // Find the intersection for upper and lower half seprately
11879
+ let t;
11880
+ if ((L1 - L0) * cusp[1] - (cusp[0] - L0) * C1 <= 0) {
11881
+ // Lower half
11882
+
11883
+ t = (cusp[1] * L0) / (C1 * cusp[0] + cusp[1] * (L0 - L1));
11884
+ } else {
11885
+ // Upper half
11886
+
11887
+ // First intersect with triangle
11888
+ t = (cusp[1] * (L0 - 1)) / (C1 * (cusp[0] - 1) + cusp[1] * (L0 - L1));
11889
+
11890
+ // Then one step Halley's method
11891
+ {
11892
+ let dL = L1 - L0;
11893
+ let dC = C1;
11894
+
11895
+ let k_l = 0.3963377774 * a + 0.2158037573 * b;
11896
+ let k_m = -0.1055613458 * a - 0.0638541728 * b;
11897
+ let k_s = -0.0894841775 * a - 1.291485548 * b;
11898
+
11899
+ let l_dt = dL + dC * k_l;
11900
+ let m_dt = dL + dC * k_m;
11901
+ let s_dt = dL + dC * k_s;
11902
+
11903
+ // If higher accuracy is required, 2 or 3 iterations of the following block can be used:
11904
+ {
11905
+ let L = L0 * (1 - t) + t * L1;
11906
+ let C = t * C1;
11907
+
11908
+ let l_ = L + C * k_l;
11909
+ let m_ = L + C * k_m;
11910
+ let s_ = L + C * k_s;
11911
+
11912
+ let l = l_ * l_ * l_;
11913
+ let m = m_ * m_ * m_;
11914
+ let s = s_ * s_ * s_;
11915
+
11916
+ let ldt = 3 * l_dt * l_ * l_;
11917
+ let mdt = 3 * m_dt * m_ * m_;
11918
+ let sdt = 3 * s_dt * s_ * s_;
11919
+
11920
+ let ldt2 = 6 * l_dt * l_dt * l_;
11921
+ let mdt2 = 6 * m_dt * m_dt * m_;
11922
+ let sdt2 = 6 * s_dt * s_dt * s_;
11923
+
11924
+ let r =
11925
+ 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s - 1;
11926
+ let r1 =
11927
+ 4.0767416621 * ldt -
11928
+ 3.3077115913 * mdt +
11929
+ 0.2309699292 * sdt;
11930
+ let r2 =
11931
+ 4.0767416621 * ldt2 -
11932
+ 3.3077115913 * mdt2 +
11933
+ 0.2309699292 * sdt2;
11934
+
11935
+ let u_r = r1 / (r1 * r1 - 0.5 * r * r2);
11936
+ let t_r = -r * u_r;
11937
+
11938
+ let g =
11939
+ -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s - 1;
11940
+ let g1 =
11941
+ -1.2684380046 * ldt +
11942
+ 2.6097574011 * mdt -
11943
+ 0.3413193965 * sdt;
11944
+ let g2 =
11945
+ -1.2684380046 * ldt2 +
11946
+ 2.6097574011 * mdt2 -
11947
+ 0.3413193965 * sdt2;
11948
+
11949
+ let u_g = g1 / (g1 * g1 - 0.5 * g * g2);
11950
+ let t_g = -g * u_g;
11951
+
11952
+ let b =
11953
+ -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s - 1;
11954
+ let b1 =
11955
+ -0.0041960863 * ldt -
11956
+ 0.7034186147 * mdt +
11957
+ 1.707614701 * sdt;
11958
+ let b2 =
11959
+ -0.0041960863 * ldt2 -
11960
+ 0.7034186147 * mdt2 +
11961
+ 1.707614701 * sdt2;
11962
+
11963
+ let u_b = b1 / (b1 * b1 - 0.5 * b * b2);
11964
+ let t_b = -b * u_b;
11965
+
11966
+ t_r = u_r >= 0 ? t_r : 10e5;
11967
+ t_g = u_g >= 0 ? t_g : 10e5;
11968
+ t_b = u_b >= 0 ? t_b : 10e5;
11969
+
11970
+ t += Math.min(t_r, Math.min(t_g, t_b));
11971
+ }
11972
+ }
11973
+ }
11974
+
11975
+ return t;
11976
+ }
11977
+
11978
+ function get_ST_max(a_, b_, cusp = null) {
11979
+ if (!cusp) {
11980
+ cusp = find_cusp(a_, b_);
11981
+ }
11982
+ let L = cusp[0];
11983
+ let C = cusp[1];
11984
+ return [C / L, C / (1 - L)];
11985
+ }
11986
+
11987
+ function get_Cs(L, a_, b_) {
11988
+ let cusp = find_cusp(a_, b_);
11989
+
11990
+ let C_max = find_gamut_intersection(a_, b_, L, 1, L, cusp);
11991
+ let ST_max = get_ST_max(a_, b_, cusp);
11992
+
11993
+ let S_mid =
11994
+ 0.11516993 +
11995
+ 1 /
11996
+ (7.4477897 +
11997
+ 4.1590124 * b_ +
11998
+ a_ *
11999
+ (-2.19557347 +
12000
+ 1.75198401 * b_ +
12001
+ a_ *
12002
+ (-2.13704948 -
12003
+ 10.02301043 * b_ +
12004
+ a_ *
12005
+ (-4.24894561 +
12006
+ 5.38770819 * b_ +
12007
+ 4.69891013 * a_))));
12008
+
12009
+ let T_mid =
12010
+ 0.11239642 +
12011
+ 1 /
12012
+ (1.6132032 -
12013
+ 0.68124379 * b_ +
12014
+ a_ *
12015
+ (0.40370612 +
12016
+ 0.90148123 * b_ +
12017
+ a_ *
12018
+ (-0.27087943 +
12019
+ 0.6122399 * b_ +
12020
+ a_ *
12021
+ (299215e-8 -
12022
+ 0.45399568 * b_ -
12023
+ 0.14661872 * a_))));
12024
+
12025
+ let k = C_max / Math.min(L * ST_max[0], (1 - L) * ST_max[1]);
12026
+
12027
+ let C_a = L * S_mid;
12028
+ let C_b = (1 - L) * T_mid;
12029
+ let C_mid =
12030
+ 0.9 *
12031
+ k *
12032
+ Math.sqrt(
12033
+ Math.sqrt(
12034
+ 1 / (1 / (C_a * C_a * C_a * C_a) + 1 / (C_b * C_b * C_b * C_b))
12035
+ )
12036
+ );
12037
+
12038
+ C_a = L * 0.4;
12039
+ C_b = (1 - L) * 0.8;
12040
+ let C_0 = Math.sqrt(1 / (1 / (C_a * C_a) + 1 / (C_b * C_b)));
12041
+ return [C_0, C_mid, C_max];
12042
+ }
12043
+
12044
+ /*
12045
+ Adapted from code by Björn Ottosson,
12046
+ released under the MIT license:
12047
+
12048
+ Copyright (c) 2021 Björn Ottosson
12049
+
12050
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12051
+ this software and associated documentation files (the "Software"), to deal in
12052
+ the Software without restriction, including without limitation the rights to
12053
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12054
+ of the Software, and to permit persons to whom the Software is furnished to do
12055
+ so, subject to the following conditions:
12056
+
12057
+ The above copyright notice and this permission notice shall be included in all
12058
+ copies or substantial portions of the Software.
12059
+
12060
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12061
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12062
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12063
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12064
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12065
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12066
+ SOFTWARE.
12067
+ */
12068
+
12069
+
12070
+ function convertOklabToOkhsl(lab) {
12071
+ const l = lab.l !== undefined ? lab.l : 0;
12072
+ const a = lab.a !== undefined ? lab.a : 0;
12073
+ const b = lab.b !== undefined ? lab.b : 0;
12074
+
12075
+ const ret = { mode: 'okhsl', l: toe(l) };
12076
+
12077
+ if (lab.alpha !== undefined) {
12078
+ ret.alpha = lab.alpha;
12079
+ }
12080
+ let c = Math.sqrt(a * a + b * b);
12081
+ if (!c) {
12082
+ ret.s = 0;
12083
+ return ret;
12084
+ }
12085
+ let [C_0, C_mid, C_max] = get_Cs(l, a / c, b / c);
12086
+ let s;
12087
+ if (c < C_mid) {
12088
+ let k_0 = 0;
12089
+ let k_1 = 0.8 * C_0;
12090
+ let k_2 = 1 - k_1 / C_mid;
12091
+ let t = (c - k_0) / (k_1 + k_2 * (c - k_0));
12092
+ s = t * 0.8;
12093
+ } else {
12094
+ let k_0 = C_mid;
12095
+ let k_1 = (0.2 * C_mid * C_mid * 1.25 * 1.25) / C_0;
12096
+ let k_2 = 1 - k_1 / (C_max - C_mid);
12097
+ let t = (c - k_0) / (k_1 + k_2 * (c - k_0));
12098
+ s = 0.8 + 0.2 * t;
12099
+ }
12100
+ if (s) {
12101
+ ret.s = s;
12102
+ ret.h = normalizeHue((Math.atan2(b, a) * 180) / Math.PI);
12103
+ }
12104
+ return ret;
12105
+ }
12106
+
12107
+ /*
12108
+ Adapted from code by Björn Ottosson,
12109
+ released under the MIT license:
12110
+
12111
+ Copyright (c) 2021 Björn Ottosson
12112
+
12113
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12114
+ this software and associated documentation files (the "Software"), to deal in
12115
+ the Software without restriction, including without limitation the rights to
12116
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12117
+ of the Software, and to permit persons to whom the Software is furnished to do
12118
+ so, subject to the following conditions:
12119
+
12120
+ The above copyright notice and this permission notice shall be included in all
12121
+ copies or substantial portions of the Software.
12122
+
12123
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12124
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12125
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12126
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12127
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12128
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12129
+ SOFTWARE.
12130
+ */
12131
+
12132
+
12133
+ function convertOkhslToOklab(hsl) {
12134
+ let h = hsl.h !== undefined ? hsl.h : 0;
12135
+ let s = hsl.s !== undefined ? hsl.s : 0;
12136
+ let l = hsl.l !== undefined ? hsl.l : 0;
12137
+
12138
+ const ret = { mode: 'oklab', l: toe_inv(l) };
12139
+
12140
+ if (hsl.alpha !== undefined) {
12141
+ ret.alpha = hsl.alpha;
12142
+ }
12143
+
12144
+ if (!s || l === 1) {
12145
+ ret.a = ret.b = 0;
12146
+ return ret;
12147
+ }
12148
+
12149
+ let a_ = Math.cos((h / 180) * Math.PI);
12150
+ let b_ = Math.sin((h / 180) * Math.PI);
12151
+ let [C_0, C_mid, C_max] = get_Cs(ret.l, a_, b_);
12152
+ let t, k_0, k_1, k_2;
12153
+ if (s < 0.8) {
12154
+ t = 1.25 * s;
12155
+ k_0 = 0;
12156
+ k_1 = 0.8 * C_0;
12157
+ k_2 = 1 - k_1 / C_mid;
12158
+ } else {
12159
+ t = 5 * (s - 0.8);
12160
+ k_0 = C_mid;
12161
+ k_1 = (0.2 * C_mid * C_mid * 1.25 * 1.25) / C_0;
12162
+ k_2 = 1 - k_1 / (C_max - C_mid);
12163
+ }
12164
+ let C = k_0 + (t * k_1) / (1 - k_2 * t);
12165
+ ret.a = C * a_;
12166
+ ret.b = C * b_;
12167
+
12168
+ return ret;
12169
+ }
12170
+
12171
+ const modeOkhsl = {
12172
+ ...definition$l,
12173
+ mode: 'okhsl',
12174
+ channels: ['h', 's', 'l', 'alpha'],
12175
+ parse: ['--okhsl'],
12176
+ serialize: '--okhsl',
12177
+ fromMode: {
12178
+ oklab: convertOklabToOkhsl,
12179
+ rgb: c => convertOklabToOkhsl(convertRgbToOklab(c))
12180
+ },
12181
+ toMode: {
12182
+ oklab: convertOkhslToOklab,
12183
+ rgb: c => convertOklabToRgb(convertOkhslToOklab(c))
12184
+ }
12185
+ };
12186
+
12187
+ /*
12188
+ Adapted from code by Björn Ottosson,
12189
+ released under the MIT license:
12190
+
12191
+ Copyright (c) 2021 Björn Ottosson
12192
+
12193
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12194
+ this software and associated documentation files (the "Software"), to deal in
12195
+ the Software without restriction, including without limitation the rights to
12196
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12197
+ of the Software, and to permit persons to whom the Software is furnished to do
12198
+ so, subject to the following conditions:
12199
+
12200
+ The above copyright notice and this permission notice shall be included in all
12201
+ copies or substantial portions of the Software.
12202
+
12203
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12204
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12205
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12206
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12207
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12208
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12209
+ SOFTWARE.
12210
+ */
12211
+
12212
+
12213
+ function convertOklabToOkhsv(lab) {
12214
+ let l = lab.l !== undefined ? lab.l : 0;
12215
+ let a = lab.a !== undefined ? lab.a : 0;
12216
+ let b = lab.b !== undefined ? lab.b : 0;
12217
+
12218
+ let c = Math.sqrt(a * a + b * b);
12219
+
12220
+ // TODO: c = 0
12221
+ let a_ = c ? a / c : 1;
12222
+ let b_ = c ? b / c : 1;
12223
+
12224
+ let [S_max, T] = get_ST_max(a_, b_);
12225
+ let S_0 = 0.5;
12226
+ let k = 1 - S_0 / S_max;
12227
+
12228
+ let t = T / (c + l * T);
12229
+ let L_v = t * l;
12230
+ let C_v = t * c;
12231
+
12232
+ let L_vt = toe_inv(L_v);
12233
+ let C_vt = (C_v * L_vt) / L_v;
12234
+
12235
+ let rgb_scale = convertOklabToLrgb({ l: L_vt, a: a_ * C_vt, b: b_ * C_vt });
12236
+ let scale_L = Math.cbrt(
12237
+ 1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0)
12238
+ );
12239
+
12240
+ l = l / scale_L;
12241
+ c = ((c / scale_L) * toe(l)) / l;
12242
+ l = toe(l);
12243
+
12244
+ const ret = {
12245
+ mode: 'okhsv',
12246
+ s: c ? ((S_0 + T) * C_v) / (T * S_0 + T * k * C_v) : 0,
12247
+ v: l ? l / L_v : 0
12248
+ };
12249
+ if (ret.s) {
12250
+ ret.h = normalizeHue((Math.atan2(b, a) * 180) / Math.PI);
12251
+ }
12252
+ if (lab.alpha !== undefined) {
12253
+ ret.alpha = lab.alpha;
12254
+ }
12255
+ return ret;
12256
+ }
12257
+
12258
+ /*
12259
+ Copyright (c) 2021 Björn Ottosson
12260
+
12261
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
12262
+ this software and associated documentation files (the "Software"), to deal in
12263
+ the Software without restriction, including without limitation the rights to
12264
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12265
+ of the Software, and to permit persons to whom the Software is furnished to do
12266
+ so, subject to the following conditions:
12267
+
12268
+ The above copyright notice and this permission notice shall be included in all
12269
+ copies or substantial portions of the Software.
12270
+
12271
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12272
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12273
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
12274
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
12275
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
12276
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
12277
+ SOFTWARE.
12278
+ */
12279
+
12280
+
12281
+ function convertOkhsvToOklab(hsv) {
12282
+ const ret = { mode: 'oklab' };
12283
+ if (hsv.alpha !== undefined) {
12284
+ ret.alpha = hsv.alpha;
12285
+ }
12286
+
12287
+ const h = hsv.h !== undefined ? hsv.h : 0;
12288
+ const s = hsv.s !== undefined ? hsv.s : 0;
12289
+ const v = hsv.v !== undefined ? hsv.v : 0;
12290
+
12291
+ const a_ = Math.cos((h / 180) * Math.PI);
12292
+ const b_ = Math.sin((h / 180) * Math.PI);
12293
+
12294
+ const [S_max, T] = get_ST_max(a_, b_);
12295
+ const S_0 = 0.5;
12296
+ const k = 1 - S_0 / S_max;
12297
+ const L_v = 1 - (s * S_0) / (S_0 + T - T * k * s);
12298
+ const C_v = (s * T * S_0) / (S_0 + T - T * k * s);
12299
+
12300
+ const L_vt = toe_inv(L_v);
12301
+ const C_vt = (C_v * L_vt) / L_v;
12302
+ const rgb_scale = convertOklabToLrgb({
12303
+ l: L_vt,
12304
+ a: a_ * C_vt,
12305
+ b: b_ * C_vt
12306
+ });
12307
+ const scale_L = Math.cbrt(
12308
+ 1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0)
12309
+ );
12310
+
12311
+ const L_new = toe_inv(v * L_v);
12312
+ const C = (C_v * L_new) / L_v;
12313
+
12314
+ ret.l = L_new * scale_L;
12315
+ ret.a = C * a_ * scale_L;
12316
+ ret.b = C * b_ * scale_L;
12317
+
12318
+ return ret;
12319
+ }
12320
+
12321
+ const modeOkhsv = {
12322
+ ...definition$k,
12323
+ mode: 'okhsv',
12324
+ channels: ['h', 's', 'v', 'alpha'],
12325
+ parse: ['--okhsv'],
12326
+ serialize: '--okhsv',
12327
+ fromMode: {
12328
+ oklab: convertOklabToOkhsv,
12329
+ rgb: c => convertOklabToOkhsv(convertRgbToOklab(c))
12330
+ },
12331
+ toMode: {
12332
+ oklab: convertOkhsvToOklab,
12333
+ rgb: c => convertOklabToRgb(convertOkhsvToOklab(c))
12334
+ }
12335
+ };
12336
+
12337
+ function parseOklab(color, parsed) {
12338
+ if (!parsed || parsed[0] !== 'oklab') {
12339
+ return undefined;
12340
+ }
12341
+ const res = { mode: 'oklab' };
12342
+ const [, l, a, b, alpha] = parsed;
12343
+ if (l.type === Tok.Hue || a.type === Tok.Hue || b.type === Tok.Hue) {
12344
+ return undefined;
12345
+ }
12346
+ if (l.type !== Tok.None) {
12347
+ res.l = Math.min(
12348
+ Math.max(0, l.type === Tok.Number ? l.value : l.value / 100),
12349
+ 1
12350
+ );
12351
+ }
12352
+ if (a.type !== Tok.None) {
12353
+ res.a = a.type === Tok.Number ? a.value : (a.value * 0.4) / 100;
12354
+ }
12355
+ if (b.type !== Tok.None) {
12356
+ res.b = b.type === Tok.Number ? b.value : (b.value * 0.4) / 100;
12357
+ }
12358
+ if (alpha.type !== Tok.None) {
12359
+ res.alpha = Math.min(
12360
+ 1,
12361
+ Math.max(
12362
+ 0,
12363
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
12364
+ )
12365
+ );
12366
+ }
12367
+
12368
+ return res;
12369
+ }
12370
+
12371
+ /*
12372
+ Oklab, a perceptual color space for image processing by Björn Ottosson
12373
+ Reference: https://bottosson.github.io/posts/oklab/
12374
+ */
12375
+
12376
+ const definition$8 = {
12377
+ ...definition$f,
12378
+ mode: 'oklab',
12379
+
12380
+ toMode: {
12381
+ lrgb: convertOklabToLrgb,
12382
+ rgb: convertOklabToRgb
12383
+ },
12384
+
12385
+ fromMode: {
12386
+ lrgb: convertLrgbToOklab,
12387
+ rgb: convertRgbToOklab
12388
+ },
12389
+
12390
+ ranges: {
12391
+ l: [0, 1],
12392
+ a: [-0.4, 0.4],
12393
+ b: [-0.4, 0.4]
12394
+ },
12395
+
12396
+ parse: [parseOklab],
12397
+ serialize: c =>
12398
+ `oklab(${c.l !== undefined ? c.l : 'none'} ${
12399
+ c.a !== undefined ? c.a : 'none'
12400
+ } ${c.b !== undefined ? c.b : 'none'}${
12401
+ c.alpha < 1 ? ` / ${c.alpha}` : ''
12402
+ })`
12403
+ };
12404
+
12405
+ function parseOklch(color, parsed) {
12406
+ if (!parsed || parsed[0] !== 'oklch') {
12407
+ return undefined;
12408
+ }
12409
+ const res = { mode: 'oklch' };
12410
+ const [, l, c, h, alpha] = parsed;
12411
+ if (l.type !== Tok.None) {
12412
+ if (l.type === Tok.Hue) {
12413
+ return undefined;
12414
+ }
12415
+ res.l = Math.min(
12416
+ Math.max(0, l.type === Tok.Number ? l.value : l.value / 100),
12417
+ 1
12418
+ );
12419
+ }
12420
+ if (c.type !== Tok.None) {
12421
+ res.c = Math.max(
12422
+ 0,
12423
+ c.type === Tok.Number ? c.value : (c.value * 0.4) / 100
12424
+ );
12425
+ }
12426
+ if (h.type !== Tok.None) {
12427
+ if (h.type === Tok.Percentage) {
12428
+ return undefined;
12429
+ }
12430
+ res.h = h.value;
12431
+ }
12432
+ if (alpha.type !== Tok.None) {
12433
+ res.alpha = Math.min(
12434
+ 1,
12435
+ Math.max(
12436
+ 0,
12437
+ alpha.type === Tok.Number ? alpha.value : alpha.value / 100
12438
+ )
12439
+ );
12440
+ }
12441
+
12442
+ return res;
12443
+ }
12444
+
12445
+ const definition$7 = {
12446
+ ...definition$d,
12447
+ mode: 'oklch',
12448
+
12449
+ toMode: {
12450
+ oklab: c => convertLchToLab(c, 'oklab'),
12451
+ rgb: c => convertOklabToRgb(convertLchToLab(c, 'oklab'))
12452
+ },
12453
+
12454
+ fromMode: {
12455
+ rgb: c => convertLabToLch(convertRgbToOklab(c), 'oklch'),
12456
+ oklab: c => convertLabToLch(c, 'oklch')
12457
+ },
12458
+
12459
+ parse: [parseOklch],
12460
+ serialize: c =>
12461
+ `oklch(${c.l !== undefined ? c.l : 'none'} ${
12462
+ c.c !== undefined ? c.c : 'none'
12463
+ } ${c.h !== undefined ? c.h : 'none'}${
12464
+ c.alpha < 1 ? ` / ${c.alpha}` : ''
12465
+ })`,
12466
+
12467
+ ranges: {
12468
+ l: [0, 1],
12469
+ c: [0, 0.4],
12470
+ h: [0, 360]
12471
+ }
12472
+ };
12473
+
12474
+ /*
12475
+ Convert Display P3 values to CIE XYZ D65
12476
+
12477
+ References:
12478
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12479
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
12480
+ */
12481
+
12482
+
12483
+ const convertP3ToXyz65 = rgb => {
12484
+ let { r, g, b, alpha } = convertRgbToLrgb(rgb);
12485
+ let res = {
12486
+ mode: 'xyz65',
12487
+ x:
12488
+ 0.486570948648216 * r +
12489
+ 0.265667693169093 * g +
12490
+ 0.1982172852343625 * b,
12491
+ y:
12492
+ 0.2289745640697487 * r +
12493
+ 0.6917385218365062 * g +
12494
+ 0.079286914093745 * b,
12495
+ z: 0.0 * r + 0.0451133818589026 * g + 1.043944368900976 * b
12496
+ };
12497
+ if (alpha !== undefined) {
12498
+ res.alpha = alpha;
12499
+ }
12500
+ return res;
12501
+ };
12502
+
12503
+ /*
12504
+ CIE XYZ D65 values to Display P3.
12505
+
12506
+ References:
12507
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12508
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
12509
+ */
12510
+
12511
+
12512
+ const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
12513
+ if (x === undefined) x = 0;
12514
+ if (y === undefined) y = 0;
12515
+ if (z === undefined) z = 0;
12516
+ let res = convertLrgbToRgb(
12517
+ {
12518
+ r:
12519
+ x * 2.4934969119414263 -
12520
+ y * 0.9313836179191242 -
12521
+ 0.402710784450717 * z,
12522
+ g:
12523
+ x * -0.8294889695615749 +
12524
+ y * 1.7626640603183465 +
12525
+ 0.0236246858419436 * z,
12526
+ b:
12527
+ x * 0.0358458302437845 -
12528
+ y * 0.0761723892680418 +
12529
+ 0.9568845240076871 * z
12530
+ },
12531
+ 'p3'
12532
+ );
12533
+ if (alpha !== undefined) {
12534
+ res.alpha = alpha;
12535
+ }
12536
+ return res;
12537
+ };
12538
+
12539
+ const definition$6 = {
12540
+ ...definition$r,
12541
+ mode: 'p3',
12542
+ parse: ['display-p3'],
12543
+ serialize: 'display-p3',
12544
+
12545
+ fromMode: {
12546
+ rgb: color => convertXyz65ToP3(convertRgbToXyz65(color)),
12547
+ xyz65: convertXyz65ToP3
12548
+ },
12549
+
12550
+ toMode: {
12551
+ rgb: color => convertXyz65ToRgb(convertP3ToXyz65(color)),
12552
+ xyz65: convertP3ToXyz65
12553
+ }
12554
+ };
12555
+
12556
+ /*
12557
+ Convert CIE XYZ D50 values to ProPhoto RGB
12558
+
12559
+ References:
12560
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12561
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
12562
+ */
12563
+
12564
+ const gamma$1 = v => {
12565
+ let abs = Math.abs(v);
12566
+ if (abs >= 1 / 512) {
12567
+ return Math.sign(v) * Math.pow(abs, 1 / 1.8);
12568
+ }
12569
+ return 16 * v;
12570
+ };
12571
+
12572
+ const convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
12573
+ if (x === undefined) x = 0;
12574
+ if (y === undefined) y = 0;
12575
+ if (z === undefined) z = 0;
12576
+ let res = {
12577
+ mode: 'prophoto',
12578
+ r: gamma$1(
12579
+ x * 1.3457868816471585 -
12580
+ y * 0.2555720873797946 -
12581
+ 0.0511018649755453 * z
12582
+ ),
12583
+ g: gamma$1(
12584
+ x * -0.5446307051249019 +
12585
+ y * 1.5082477428451466 +
12586
+ 0.0205274474364214 * z
12587
+ ),
12588
+ b: gamma$1(x * 0.0 + y * 0.0 + 1.2119675456389452 * z)
12589
+ };
12590
+ if (alpha !== undefined) {
12591
+ res.alpha = alpha;
12592
+ }
12593
+ return res;
12594
+ };
12595
+
12596
+ /*
12597
+ Convert ProPhoto RGB values to CIE XYZ D50
12598
+
12599
+ References:
12600
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12601
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
12602
+ */
12603
+
12604
+ const linearize$1 = (v = 0) => {
12605
+ let abs = Math.abs(v);
12606
+ if (abs >= 16 / 512) {
12607
+ return Math.sign(v) * Math.pow(abs, 1.8);
12608
+ }
12609
+ return v / 16;
12610
+ };
12611
+
12612
+ const convertProphotoToXyz50 = prophoto => {
12613
+ let r = linearize$1(prophoto.r);
12614
+ let g = linearize$1(prophoto.g);
12615
+ let b = linearize$1(prophoto.b);
12616
+ let res = {
12617
+ mode: 'xyz50',
12618
+ x:
12619
+ 0.7977666449006423 * r +
12620
+ 0.1351812974005331 * g +
12621
+ 0.0313477341283922 * b,
12622
+ y:
12623
+ 0.2880748288194013 * r +
12624
+ 0.7118352342418731 * g +
12625
+ 0.0000899369387256 * b,
12626
+ z: 0 * r + 0 * g + 0.8251046025104602 * b
12627
+ };
12628
+ if (prophoto.alpha !== undefined) {
12629
+ res.alpha = prophoto.alpha;
12630
+ }
12631
+ return res;
12632
+ };
12633
+
12634
+ /*
12635
+ ProPhoto RGB Color space
12636
+
12637
+ References:
12638
+ * https://en.wikipedia.org/wiki/ProPhoto_RGB_color_space
12639
+ */
12640
+
12641
+ const definition$5 = {
12642
+ ...definition$r,
12643
+ mode: 'prophoto',
12644
+ parse: ['prophoto-rgb'],
12645
+ serialize: 'prophoto-rgb',
12646
+
12647
+ fromMode: {
12648
+ xyz50: convertXyz50ToProphoto,
12649
+ rgb: color => convertXyz50ToProphoto(convertRgbToXyz50(color))
12650
+ },
12651
+
12652
+ toMode: {
12653
+ xyz50: convertProphotoToXyz50,
12654
+ rgb: color => convertXyz50ToRgb(convertProphotoToXyz50(color))
12655
+ }
12656
+ };
12657
+
12658
+ /*
12659
+ Convert CIE XYZ D65 values to Rec. 2020
12660
+
12661
+ References:
12662
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12663
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
12664
+ * https://www.itu.int/rec/R-REC-BT.2020/en
12665
+ */
12666
+
12667
+ const α$1 = 1.09929682680944;
12668
+ const β$1 = 0.018053968510807;
12669
+ const gamma = v => {
12670
+ const abs = Math.abs(v);
12671
+ if (abs > β$1) {
12672
+ return (Math.sign(v) || 1) * (α$1 * Math.pow(abs, 0.45) - (α$1 - 1));
12673
+ }
12674
+ return 4.5 * v;
12675
+ };
12676
+
12677
+ const convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
12678
+ if (x === undefined) x = 0;
12679
+ if (y === undefined) y = 0;
12680
+ if (z === undefined) z = 0;
12681
+ let res = {
12682
+ mode: 'rec2020',
12683
+ r: gamma(
12684
+ x * 1.7166511879712683 -
12685
+ y * 0.3556707837763925 -
12686
+ 0.2533662813736599 * z
12687
+ ),
12688
+ g: gamma(
12689
+ x * -0.6666843518324893 +
12690
+ y * 1.6164812366349395 +
12691
+ 0.0157685458139111 * z
12692
+ ),
12693
+ b: gamma(
12694
+ x * 0.0176398574453108 -
12695
+ y * 0.0427706132578085 +
12696
+ 0.9421031212354739 * z
12697
+ )
12698
+ };
12699
+ if (alpha !== undefined) {
12700
+ res.alpha = alpha;
12701
+ }
12702
+ return res;
12703
+ };
12704
+
12705
+ /*
12706
+ Convert Rec. 2020 values to CIE XYZ D65
12707
+
12708
+ References:
12709
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12710
+ * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
12711
+ * https://www.itu.int/rec/R-REC-BT.2020/en
12712
+ */
12713
+
12714
+ const α = 1.09929682680944;
12715
+ const β = 0.018053968510807;
12716
+
12717
+ const linearize = (v = 0) => {
12718
+ let abs = Math.abs(v);
12719
+ if (abs < β * 4.5) {
12720
+ return v / 4.5;
12721
+ }
12722
+ return (Math.sign(v) || 1) * Math.pow((abs + α - 1) / α, 1 / 0.45);
12723
+ };
12724
+
12725
+ const convertRec2020ToXyz65 = rec2020 => {
12726
+ let r = linearize(rec2020.r);
12727
+ let g = linearize(rec2020.g);
12728
+ let b = linearize(rec2020.b);
12729
+ let res = {
12730
+ mode: 'xyz65',
12731
+ x:
12732
+ 0.6369580483012911 * r +
12733
+ 0.1446169035862083 * g +
12734
+ 0.1688809751641721 * b,
12735
+ y:
12736
+ 0.262700212011267 * r +
12737
+ 0.6779980715188708 * g +
12738
+ 0.059301716469862 * b,
12739
+ z: 0 * r + 0.0280726930490874 * g + 1.0609850577107909 * b
12740
+ };
12741
+ if (rec2020.alpha !== undefined) {
12742
+ res.alpha = rec2020.alpha;
12743
+ }
12744
+ return res;
12745
+ };
12746
+
12747
+ const definition$4 = {
12748
+ ...definition$r,
12749
+ mode: 'rec2020',
12750
+
12751
+ fromMode: {
12752
+ xyz65: convertXyz65ToRec2020,
12753
+ rgb: color => convertXyz65ToRec2020(convertRgbToXyz65(color))
12754
+ },
12755
+
12756
+ toMode: {
12757
+ xyz65: convertRec2020ToXyz65,
12758
+ rgb: color => convertXyz65ToRgb(convertRec2020ToXyz65(color))
12759
+ },
12760
+
12761
+ parse: ['rec2020'],
12762
+ serialize: 'rec2020'
12763
+ };
12764
+
12765
+ const bias = 0.00379307325527544933;
12766
+ const bias_cbrt = Math.cbrt(bias);
12767
+
12768
+ const transfer$1 = v => Math.cbrt(v) - bias_cbrt;
12769
+
12770
+ const convertRgbToXyb = color => {
12771
+ const { r, g, b, alpha } = convertRgbToLrgb(color);
12772
+ const l = transfer$1(0.3 * r + 0.622 * g + 0.078 * b + bias);
12773
+ const m = transfer$1(0.23 * r + 0.692 * g + 0.078 * b + bias);
12774
+ const s = transfer$1(
12775
+ 0.24342268924547819 * r +
12776
+ 0.20476744424496821 * g +
12777
+ 0.5518098665095536 * b +
12778
+ bias
12779
+ );
12780
+ const res = {
12781
+ mode: 'xyb',
12782
+ x: (l - m) / 2,
12783
+ y: (l + m) / 2,
12784
+ /* Apply default chroma from luma (subtract Y from B) */
12785
+ b: s - (l + m) / 2
12786
+ };
12787
+ if (alpha !== undefined) res.alpha = alpha;
12788
+ return res;
12789
+ };
12790
+
12791
+ const transfer = v => Math.pow(v + bias_cbrt, 3);
12792
+
12793
+ const convertXybToRgb = ({ x, y, b, alpha }) => {
12794
+ if (x === undefined) x = 0;
12795
+ if (y === undefined) y = 0;
12796
+ if (b === undefined) b = 0;
12797
+ const l = transfer(x + y) - bias;
12798
+ const m = transfer(y - x) - bias;
12799
+ /* Account for chroma from luma: add Y back to B */
12800
+ const s = transfer(b + y) - bias;
12801
+
12802
+ const res = convertLrgbToRgb({
12803
+ r:
12804
+ 11.031566904639861 * l -
12805
+ 9.866943908131562 * m -
12806
+ 0.16462299650829934 * s,
12807
+ g:
12808
+ -3.2541473810744237 * l +
12809
+ 4.418770377582723 * m -
12810
+ 0.16462299650829934 * s,
12811
+ b:
12812
+ -3.6588512867136815 * l +
12813
+ 2.7129230459360922 * m +
12814
+ 1.9459282407775895 * s
12815
+ });
12816
+ if (alpha !== undefined) res.alpha = alpha;
12817
+ return res;
12818
+ };
12819
+
12820
+ /*
12821
+ The XYB color space, used in JPEG XL.
12822
+ Reference: https://ds.jpeg.org/whitepapers/jpeg-xl-whitepaper.pdf
12823
+ */
12824
+
12825
+ const definition$3 = {
12826
+ mode: 'xyb',
12827
+ channels: ['x', 'y', 'b', 'alpha'],
12828
+ parse: ['--xyb'],
12829
+ serialize: '--xyb',
12830
+
12831
+ toMode: {
12832
+ rgb: convertXybToRgb
12833
+ },
12834
+
12835
+ fromMode: {
12836
+ rgb: convertRgbToXyb
12837
+ },
12838
+
12839
+ ranges: {
12840
+ x: [-0.0154, 0.0281],
12841
+ y: [0, 0.8453],
12842
+ b: [-0.2778, 0.388]
12843
+ },
12844
+
12845
+ interpolate: {
12846
+ x: interpolatorLinear,
12847
+ y: interpolatorLinear,
12848
+ b: interpolatorLinear,
12849
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
12850
+ }
12851
+ };
12852
+
12853
+ /*
12854
+ The XYZ D50 color space
12855
+ -----------------------
12856
+ */
12857
+
12858
+
12859
+ const definition$2 = {
12860
+ mode: 'xyz50',
12861
+ parse: ['xyz-d50'],
12862
+ serialize: 'xyz-d50',
12863
+
12864
+ toMode: {
12865
+ rgb: convertXyz50ToRgb,
12866
+ lab: convertXyz50ToLab
12867
+ },
12868
+
12869
+ fromMode: {
12870
+ rgb: convertRgbToXyz50,
12871
+ lab: convertLabToXyz50
12872
+ },
12873
+
12874
+ channels: ['x', 'y', 'z', 'alpha'],
12875
+
12876
+ ranges: {
12877
+ x: [0, 0.964],
12878
+ y: [0, 0.999],
12879
+ z: [0, 0.825]
12880
+ },
12881
+
12882
+ interpolate: {
12883
+ x: interpolatorLinear,
12884
+ y: interpolatorLinear,
12885
+ z: interpolatorLinear,
12886
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
12887
+ }
12888
+ };
12889
+
12890
+ /*
12891
+ Chromatic adaptation of CIE XYZ from D65 to D50 white point
12892
+ using the Bradford method.
12893
+
12894
+ References:
12895
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12896
+ * http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
12897
+ */
12898
+
12899
+ const convertXyz65ToXyz50 = xyz65 => {
12900
+ let { x, y, z, alpha } = xyz65;
12901
+ if (x === undefined) x = 0;
12902
+ if (y === undefined) y = 0;
12903
+ if (z === undefined) z = 0;
12904
+ let res = {
12905
+ mode: 'xyz50',
12906
+ x:
12907
+ 1.0479298208405488 * x +
12908
+ 0.0229467933410191 * y -
12909
+ 0.0501922295431356 * z,
12910
+ y:
12911
+ 0.0296278156881593 * x +
12912
+ 0.990434484573249 * y -
12913
+ 0.0170738250293851 * z,
12914
+ z:
12915
+ -0.0092430581525912 * x +
12916
+ 0.0150551448965779 * y +
12917
+ 0.7518742899580008 * z
12918
+ };
12919
+ if (alpha !== undefined) {
12920
+ res.alpha = alpha;
12921
+ }
12922
+ return res;
12923
+ };
12924
+
12925
+ /*
12926
+ Chromatic adaptation of CIE XYZ from D50 to D65 white point
12927
+ using the Bradford method.
12928
+
12929
+ References:
12930
+ * https://drafts.csswg.org/css-color/#color-conversion-code
12931
+ * http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html
12932
+ */
12933
+
12934
+ const convertXyz50ToXyz65 = xyz50 => {
12935
+ let { x, y, z, alpha } = xyz50;
12936
+ if (x === undefined) x = 0;
12937
+ if (y === undefined) y = 0;
12938
+ if (z === undefined) z = 0;
12939
+ let res = {
12940
+ mode: 'xyz65',
12941
+ x:
12942
+ 0.9554734527042182 * x -
12943
+ 0.0230985368742614 * y +
12944
+ 0.0632593086610217 * z,
12945
+ y:
12946
+ -0.0283697069632081 * x +
12947
+ 1.0099954580058226 * y +
12948
+ 0.021041398966943 * z,
12949
+ z:
12950
+ 0.0123140016883199 * x -
12951
+ 0.0205076964334779 * y +
12952
+ 1.3303659366080753 * z
12953
+ };
12954
+ if (alpha !== undefined) {
12955
+ res.alpha = alpha;
12956
+ }
12957
+ return res;
12958
+ };
12959
+
12960
+ /*
12961
+ The XYZ D65 color space
12962
+ -----------------------
12963
+ */
12964
+
12965
+
12966
+ const definition$1 = {
12967
+ mode: 'xyz65',
12968
+
12969
+ toMode: {
12970
+ rgb: convertXyz65ToRgb,
12971
+ xyz50: convertXyz65ToXyz50
12972
+ },
12973
+
12974
+ fromMode: {
12975
+ rgb: convertRgbToXyz65,
12976
+ xyz50: convertXyz50ToXyz65
12977
+ },
12978
+
12979
+ ranges: {
12980
+ x: [0, 0.95],
12981
+ y: [0, 1],
12982
+ z: [0, 1.088]
12983
+ },
12984
+
12985
+ channels: ['x', 'y', 'z', 'alpha'],
12986
+
12987
+ parse: ['xyz', 'xyz-d65'],
12988
+ serialize: 'xyz-d65',
12989
+
12990
+ interpolate: {
12991
+ x: interpolatorLinear,
12992
+ y: interpolatorLinear,
12993
+ z: interpolatorLinear,
12994
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
12995
+ }
12996
+ };
12997
+
12998
+ const convertRgbToYiq = ({ r, g, b, alpha }) => {
12999
+ if (r === undefined) r = 0;
13000
+ if (g === undefined) g = 0;
13001
+ if (b === undefined) b = 0;
13002
+ const res = {
13003
+ mode: 'yiq',
13004
+ y: 0.29889531 * r + 0.58662247 * g + 0.11448223 * b,
13005
+ i: 0.59597799 * r - 0.2741761 * g - 0.32180189 * b,
13006
+ q: 0.21147017 * r - 0.52261711 * g + 0.31114694 * b
13007
+ };
13008
+ if (alpha !== undefined) res.alpha = alpha;
13009
+ return res;
13010
+ };
13011
+
13012
+ const convertYiqToRgb = ({ y, i, q, alpha }) => {
13013
+ if (y === undefined) y = 0;
13014
+ if (i === undefined) i = 0;
13015
+ if (q === undefined) q = 0;
13016
+ const res = {
13017
+ mode: 'rgb',
13018
+ r: y + 0.95608445 * i + 0.6208885 * q,
13019
+ g: y - 0.27137664 * i - 0.6486059 * q,
13020
+ b: y - 1.10561724 * i + 1.70250126 * q
13021
+ };
13022
+ if (alpha !== undefined) res.alpha = alpha;
13023
+ return res;
13024
+ };
13025
+
13026
+ /*
13027
+ YIQ Color Space
13028
+
13029
+ References
13030
+ ----------
13031
+
13032
+ Wikipedia:
13033
+ https://en.wikipedia.org/wiki/YIQ
13034
+
13035
+ "Measuring perceived color difference using YIQ NTSC
13036
+ transmission color space in mobile applications"
13037
+
13038
+ by Yuriy Kotsarenko, Fernando Ramos in:
13039
+ Programación Matemática y Software (2010)
13040
+
13041
+ Available at:
13042
+
13043
+ http://www.progmat.uaem.mx:8080/artVol2Num2/Articulo3Vol2Num2.pdf
13044
+ */
13045
+
13046
+ const definition = {
13047
+ mode: 'yiq',
13048
+
13049
+ toMode: {
13050
+ rgb: convertYiqToRgb
13051
+ },
13052
+
13053
+ fromMode: {
13054
+ rgb: convertRgbToYiq
13055
+ },
13056
+
13057
+ channels: ['y', 'i', 'q', 'alpha'],
13058
+
13059
+ parse: ['--yiq'],
13060
+ serialize: '--yiq',
13061
+
13062
+ ranges: {
13063
+ i: [-0.595, 0.595],
13064
+ q: [-0.522, 0.522]
13065
+ },
13066
+
13067
+ interpolate: {
13068
+ y: interpolatorLinear,
13069
+ i: interpolatorLinear,
13070
+ q: interpolatorLinear,
13071
+ alpha: { use: interpolatorLinear, fixup: fixupAlpha }
13072
+ }
13073
+ };
13074
+
13075
+ // From: https://github.com/d3/d3-format/issues/32
13076
+
13077
+ const r$2 = (value, precision) =>
13078
+ Math.round(value * (precision = Math.pow(10, precision))) / precision;
13079
+
13080
+ const round$1 =
13081
+ (precision = 4) =>
13082
+ value =>
13083
+ typeof value === 'number' ? r$2(value, precision) : value;
13084
+
13085
+ let twoDecimals = round$1(2);
13086
+
13087
+ const clamp$1 = value => Math.max(0, Math.min(1, value || 0));
13088
+ const fixup = value => Math.round(clamp$1(value) * 255);
13089
+
13090
+ const rgb = converter('rgb');
13091
+
13092
+ const serializeRgb = color => {
13093
+ if (color === undefined) {
13094
+ return undefined;
13095
+ }
13096
+
13097
+ let r = fixup(color.r);
13098
+ let g = fixup(color.g);
13099
+ let b = fixup(color.b);
13100
+
13101
+ if (color.alpha === undefined || color.alpha === 1) {
13102
+ // opaque color
13103
+ return `rgb(${r}, ${g}, ${b})`;
13104
+ } else {
13105
+ // transparent color
13106
+ return `rgba(${r}, ${g}, ${b}, ${twoDecimals(clamp$1(color.alpha))})`;
13107
+ }
13108
+ };
13109
+ const formatRgb = c => serializeRgb(rgb(c));
13110
+
13111
+ // Color space definitions
13112
+
13113
+ useMode(definition$q);
13114
+ useMode(definition$p);
13115
+ useMode(definition$o);
13116
+ useMode(definition$n);
13117
+ useMode(definition$m);
13118
+ useMode(definition$l);
13119
+ useMode(definition$k);
13120
+ useMode(definition$j);
13121
+ useMode(definition$i);
13122
+ useMode(definition$h);
13123
+ useMode(definition$g);
13124
+ useMode(definition$f);
13125
+ useMode(definition$e);
13126
+ useMode(definition$d);
13127
+ useMode(definition$c);
13128
+ useMode(definition$b);
13129
+ useMode(definition$a);
13130
+ useMode(definition$9);
13131
+ useMode(modeOkhsl);
13132
+ useMode(modeOkhsv);
13133
+ useMode(definition$8);
13134
+ useMode(definition$7);
13135
+ useMode(definition$6);
13136
+ useMode(definition$5);
13137
+ useMode(definition$4);
13138
+ useMode(definition$r);
13139
+ useMode(definition$3);
13140
+ useMode(definition$2);
13141
+ useMode(definition$1);
13142
+ useMode(definition);
13143
+
8650
13144
  const formatColor = (color) => {
8651
- var _a, _b, _c;
8652
- // If color is undefined, return a default
8653
- if (!color) {
8654
- return "#000000";
8655
- }
8656
- // If it's already a hex, rgb, or hsl color, return as is
13145
+ var _a;
8657
13146
  if (color.startsWith("#") ||
8658
13147
  color.startsWith("rgb") ||
8659
13148
  color.startsWith("hsl")) {
8660
13149
  return color;
8661
13150
  }
8662
- // If it's an oklch color, convert it
8663
- if (color.startsWith("oklch")) {
8664
- try {
8665
- // Create a temporary element to use CSS color conversion
8666
- const tempElement = document.createElement("div");
8667
- tempElement.style.color = color;
8668
- document.body.appendChild(tempElement);
8669
- // Get computed style to convert to rgb
8670
- const computedColor = window.getComputedStyle(tempElement).color;
8671
- document.body.removeChild(tempElement);
8672
- // Convert rgb to hex
8673
- const rgbMatch = computedColor.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/);
8674
- if (rgbMatch) {
8675
- const r = parseInt((_a = rgbMatch[1]) !== null && _a !== void 0 ? _a : "0");
8676
- const g = parseInt((_b = rgbMatch[2]) !== null && _b !== void 0 ? _b : "0");
8677
- const b = parseInt((_c = rgbMatch[3]) !== null && _c !== void 0 ? _c : "0");
8678
- return `#${r.toString(16).padStart(2, "0")}${g.toString(16).padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
8679
- }
8680
- }
8681
- catch (error) {
8682
- console.warn("Failed to convert oklch color to hex:", color, error);
13151
+ try {
13152
+ const parsedColor = parse$1(color);
13153
+ if (!parsedColor) {
13154
+ return color;
8683
13155
  }
13156
+ return (_a = formatRgb(parsedColor)) !== null && _a !== void 0 ? _a : color;
13157
+ }
13158
+ catch (error) {
13159
+ console.warn("Failed to format color:", color, error);
13160
+ return color;
8684
13161
  }
8685
- // Fallback to a default color if conversion fails
8686
- return "#000000";
8687
13162
  };
13163
+
8688
13164
  function Appearance({ appearance, fonts, shadowRef, }) {
8689
13165
  useEffect(() => {
8690
13166
  var _a;
@@ -8815,17 +13291,17 @@ const convertCheckoutAppearanceToStripeAppearance = (appearance, fonts) => {
8815
13291
  rules: {
8816
13292
  ".Input": {
8817
13293
  padding: "12px",
8818
- border: `1px solid ${currentVariables["--border"]}`,
8819
- backgroundColor: currentVariables["--background"],
13294
+ border: `1px solid ${formatColor(currentVariables["--border"])}`,
13295
+ backgroundColor: formatColor(currentVariables["--background"]),
8820
13296
  fontSize: "14px",
8821
13297
  outline: "none",
8822
13298
  },
8823
13299
  ".Input:focus": {
8824
- backgroundColor: currentVariables["--secondary"],
13300
+ backgroundColor: formatColor(currentVariables["--secondary"]),
8825
13301
  },
8826
13302
  ".Input::placeholder": {
8827
13303
  fontSize: "14px",
8828
- color: currentVariables["--muted-foreground"],
13304
+ color: formatColor(currentVariables["--muted-foreground"]),
8829
13305
  },
8830
13306
  ".Label": {
8831
13307
  marginBottom: "8px",
@@ -8843,16 +13319,16 @@ const convertCheckoutAppearanceToStripeAppearance = (appearance, fonts) => {
8843
13319
  // },
8844
13320
  ".Tab": {
8845
13321
  padding: "10px 12px 8px 12px",
8846
- border: `1px solid ${currentVariables["--border"]}`,
8847
- backgroundColor: currentVariables["--background"],
13322
+ border: `1px solid ${formatColor(currentVariables["--border"])}`,
13323
+ backgroundColor: formatColor(currentVariables["--background"]),
8848
13324
  },
8849
13325
  ".Tab:hover": {
8850
- backgroundColor: currentVariables["--secondary"],
13326
+ backgroundColor: formatColor(currentVariables["--secondary"]),
8851
13327
  },
8852
13328
  ".Tab--selected, .Tab--selected:focus, .Tab--selected:hover": {
8853
- border: `1px solid ${currentVariables["--border"]}`,
8854
- backgroundColor: currentVariables["--secondary"],
8855
- color: currentVariables["--foreground"],
13329
+ border: `1px solid ${formatColor(currentVariables["--border"])}`,
13330
+ backgroundColor: formatColor(currentVariables["--secondary"]),
13331
+ color: formatColor(currentVariables["--foreground"]),
8856
13332
  },
8857
13333
  },
8858
13334
  variables: {
@@ -35076,7 +39552,7 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
35076
39552
  }
35077
39553
  // eslint-disable-next-line react-hooks/exhaustive-deps
35078
39554
  }, [cityInput]);
35079
- return (jsxs("div", { className: cn("space-y-5", className), children: [jsx(CountryInput, { form: form, prefix: "address", label: t("CheckoutEmbed.CustomerForm.address.country"), emptyText: t("CheckoutEmbed.CustomerForm.address.countryNoCountry"), searchText: t("CheckoutEmbed.CustomerForm.address.countrySearch"), locale: locale }), jsxs("div", { className: "relative", children: [jsx(InputGroup, { name: "address.line1", label: showAllInputs
39555
+ return (jsxs("div", { className: cn("space-y-5", className), children: [jsx(CountryInput, { form: form, prefix: "address", label: t("CheckoutEmbed.CustomerForm.address.country"), emptyText: t("CheckoutEmbed.CustomerForm.address.countryNoCountry"), searchText: t("CheckoutEmbed.CustomerForm.address.countrySearch"), locale: locale }), jsxs("div", { className: "relative", children: [jsx(InputGroup, { autoComplete: "address-line1", name: "address.line1", label: showAllInputs
35080
39556
  ? t("CheckoutEmbed.CustomerForm.address.line1")
35081
39557
  : t("CheckoutEmbed.CustomerForm.address.line1-autocomplete"), required: showAllInputs, icon: jsx(Search, { className: "h-4 w-4" }), showIcon: !showAllInputs, onFocus: () => setShowSuggestions(true), onBlur: () => setTimeout(() => setShowSuggestions(false), 200) }), !showAllInputs &&
35082
39558
  (showSuggestions || isLoading || isLoadingLookup) && (jsx("div", { className: "bg-background border-border absolute left-0 right-0 top-full z-50 mt-1 rounded-md border shadow-lg", "data-dropdown": "suggestions", children: isLoading || isLoadingLookup ? (jsxs("div", { className: "text-muted-foreground border-border flex gap-2 border-b p-3 text-sm", children: [isLoadingLookup
@@ -35085,7 +39561,7 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
35085
39561
  setShowApartmentField(true);
35086
39562
  form.setValue("address.line2", "");
35087
39563
  form.setFocus("address.line2");
35088
- }, className: "text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-2 text-sm transition-colors", children: [jsx(Plus, { className: "h-4 w-4" }), t("CheckoutEmbed.CustomerForm.address.addLine2")] }) }), jsx("div", { className: cn(!showApartmentField && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: jsx(InputGroup, { name: "address.line2", label: t("CheckoutEmbed.CustomerForm.address.line2") }) }), jsxs("div", { className: cn("grid gap-4", renderProvinceInput ? "md:grid-cols-3" : "grid-cols-2"), children: [jsx(InputGroup, { name: "address.city", label: "City", required: true }), renderProvinceInput && (jsx(CompoboxGroup, { form: form, name: "address.provinceCode", label: t("CheckoutEmbed.CustomerForm.address.province"), options: availableProvinces.map((state) => ({
39564
+ }, className: "text-muted-foreground hover:text-foreground flex cursor-pointer items-center gap-2 text-sm transition-colors", children: [jsx(Plus, { className: "h-4 w-4" }), t("CheckoutEmbed.CustomerForm.address.addLine2")] }) }), jsx("div", { className: cn(!showApartmentField && "-mt-4 h-0 max-h-0 w-0 max-w-0 opacity-0"), children: jsx(InputGroup, { autoComplete: "address-line2", name: "address.line2", label: t("CheckoutEmbed.CustomerForm.address.line2") }) }), jsxs("div", { className: cn("grid gap-4", renderProvinceInput ? "md:grid-cols-3" : "grid-cols-2"), children: [jsx(InputGroup, { name: "address.city", label: "City", required: true }), renderProvinceInput && (jsx(CompoboxGroup, { form: form, name: "address.provinceCode", label: t("CheckoutEmbed.CustomerForm.address.province"), options: availableProvinces.map((state) => ({
35089
39565
  value: state.code,
35090
39566
  label: state.name,
35091
39567
  })), onSelect: (value) => {
@@ -35094,7 +39570,7 @@ function AddressInput({ className = "", proxy, clientSecret, latitude, longitude
35094
39570
  if (provinceName) {
35095
39571
  form.setValue("address.province", provinceName);
35096
39572
  }
35097
- }, searchText: t("CheckoutEmbed.CustomerForm.address.provinceSearch"), emptyText: t("CheckoutEmbed.CustomerForm.address.provinceNoProvinces"), required: true })), jsx(InputGroup, { name: "address.zipCode", label: t("CheckoutEmbed.CustomerForm.address.zipCode"), required: true })] })] })] }));
39573
+ }, searchText: t("CheckoutEmbed.CustomerForm.address.provinceSearch"), emptyText: t("CheckoutEmbed.CustomerForm.address.provinceNoProvinces"), required: true })), jsx(InputGroup, { autoComplete: "postal-code", name: "address.zipCode", label: t("CheckoutEmbed.CustomerForm.address.zipCode"), required: true })] })] })] }));
35098
39574
  }
35099
39575
 
35100
39576
  function SubmitButton(_a) {
@@ -36620,6 +41096,20 @@ const CheckoutForm$1 = ({ onSuccess, onError, children, setSubmitting, }) => {
36620
41096
  const elements = reactStripe_umdExports.useElements();
36621
41097
  const { setIsSubmitting } = useCheckout();
36622
41098
  const [errorMessage, setErrorMessage] = useState(undefined);
41099
+ const containerRef = useRef(null);
41100
+ const [rect, setRect] = useState(null);
41101
+ useEffect(() => {
41102
+ const updateRect = () => {
41103
+ if (containerRef.current) {
41104
+ setRect(containerRef.current.getBoundingClientRect());
41105
+ }
41106
+ };
41107
+ updateRect();
41108
+ window.addEventListener("resize", updateRect);
41109
+ return () => {
41110
+ window.removeEventListener("resize", updateRect);
41111
+ };
41112
+ }, []);
36623
41113
  const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
36624
41114
  event.preventDefault();
36625
41115
  if (!stripe || !elements) {
@@ -36644,7 +41134,15 @@ const CheckoutForm$1 = ({ onSuccess, onError, children, setSubmitting, }) => {
36644
41134
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess();
36645
41135
  }
36646
41136
  });
36647
- return (jsxs("form", { onSubmit: handleSubmit, children: [jsxs("div", { children: [jsx(reactStripe_umdExports.PaymentElement, {}), errorMessage && (jsx("p", { className: "text-destructive mt-2 text-sm", children: errorMessage }))] }), children] }));
41137
+ return (jsxs(Fragment, { children: [jsxs("div", { children: [jsx("div", { ref: containerRef, className: "h-[310px] w-full sm:h-[230px]" }), errorMessage && (jsx("p", { className: "text-destructive -mb-2 mt-2 text-sm", children: errorMessage })), jsx("form", { className: "w-full", onSubmit: handleSubmit, children: children })] }), ReactDOM__default.createPortal(jsx("div", { style: {
41138
+ display: "block",
41139
+ zIndex: 20,
41140
+ position: "absolute",
41141
+ top: rect === null || rect === void 0 ? void 0 : rect.top,
41142
+ left: rect === null || rect === void 0 ? void 0 : rect.left,
41143
+ width: rect === null || rect === void 0 ? void 0 : rect.width,
41144
+ height: rect === null || rect === void 0 ? void 0 : rect.height,
41145
+ }, children: jsx(reactStripe_umdExports.PaymentElement, {}) }), document.body)] }));
36648
41146
  };
36649
41147
  var CheckoutForm$2 = memo(CheckoutForm$1);
36650
41148