{"version":3,"file":"index-B69vzT9q.js","sources":["../../node_modules/.pnpm/@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/core/core.js","../../node_modules/.pnpm/style-vendorizer@2.2.3/node_modules/style-vendorizer/dist/esm/bundle.min.mjs","../../node_modules/.pnpm/@twind+preset-autoprefix@1.0.7_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-autoprefix/preset-autoprefix.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/baseTheme.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/preflight.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/rules.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/variants.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/base.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/_/colors-16fd59b8.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/preset-tailwind.js","../../node_modules/.pnpm/@twind+preset-tailwind@1.1.4_@twind+core@1.1.3_typescript@5.4.2/node_modules/@twind/preset-tailwind/defaultTheme.js","../../node_modules/.pnpm/@twind+preset-tailwind-forms@1.1.2_@twind+core@1.1.3_@twind+preset-tailwind@1.1.4_typescript@5.4.2/node_modules/@twind/preset-tailwind-forms/preset-tailwind-forms.js","../../src/util/twind.ts","../../node_modules/.pnpm/anylogger@1.0.11/node_modules/anylogger/anylogger.cjs.js","../../node_modules/.pnpm/loglevel@1.9.1/node_modules/loglevel/lib/loglevel.js","../../node_modules/.pnpm/anylogger-loglevel@1.0.0_anylogger@1.0.11_loglevel@1.9.1/node_modules/anylogger-loglevel/anylogger-loglevel.esm.js","../../node_modules/.pnpm/@vue+shared@3.4.21/node_modules/@vue/shared/dist/shared.esm-bundler.js","../../node_modules/.pnpm/@vue+reactivity@3.4.21/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js","../../node_modules/.pnpm/@vue+runtime-core@3.4.21/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js","../../node_modules/.pnpm/@vue+runtime-dom@3.4.21/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-bundler.js","../../node_modules/.pnpm/@vueuse+shared@10.9.0_vue@3.4.21/node_modules/@vueuse/shared/index.mjs","../../node_modules/.pnpm/@vueuse+core@10.9.0_vue@3.4.21/node_modules/@vueuse/core/index.mjs","../../node_modules/.pnpm/@vueuse+components@10.9.0_vue@3.4.21/node_modules/@vueuse/components/index.mjs","../../node_modules/.pnpm/vue-router@4.3.0_vue@3.4.21/node_modules/vue-router/dist/vue-router.mjs","../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js","../../node_modules/.pnpm/reflect-metadata@0.2.1/node_modules/reflect-metadata/Reflect.js","../../node_modules/.pnpm/tslib@2.6.2/node_modules/tslib/tslib.es6.mjs","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/type-descriptor.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/helpers.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/metadata.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/options-base.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/deserializer.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/json-array-member.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/serializer.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/parser.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/json-object.js","../../node_modules/.pnpm/typedjson@1.8.0/node_modules/typedjson/lib/esm5/json-member.js","../../src/app/appstate.ts","../../node_modules/.pnpm/universal-cookie@7.1.0/node_modules/universal-cookie/esm/index.mjs","../../node_modules/.pnpm/@vueuse+integrations@10.9.0_focus-trap@7.5.4_universal-cookie@7.1.0_vue@3.4.21/node_modules/@vueuse/integrations/useCookies.mjs","../../src/util/function.ts","../../src/app/auth.ts","../../src/util/link.ts","../../src/App.vue","../../src/components/createorganization.vue","../../src/components/remoterepos.vue","../../src/util/remotesource.ts","../../node_modules/.pnpm/uuidjs@5.0.1/node_modules/uuidjs/dist/uuid.js","../../src/util/validator.ts","../../src/components/createproject.vue","../../src/components/createprojectgroup.vue","../../src/app/types.ts","../../src/components/createupdatesecret.vue","../../src/components/createupdatevariable.vue","../../src/components/orgmembers.vue","../../node_modules/.pnpm/tabbable@6.2.0/node_modules/tabbable/dist/index.esm.js","../../node_modules/.pnpm/focus-trap@7.5.4/node_modules/focus-trap/dist/focus-trap.esm.js","../../node_modules/.pnpm/@vueuse+integrations@10.9.0_focus-trap@7.5.4_universal-cookie@7.1.0_vue@3.4.21/node_modules/@vueuse/integrations/useFocusTrap/component.mjs","../../src/components/modals/confirmationDialog.vue","../../src/components/secrets.vue","../../src/components/projectsecrets.vue","../../src/components/vars.vue","../../src/components/projectvars.vue","../../src/components/projectgroupsettings.vue","../../src/components/projects.vue","../../src/components/userorgs.vue","../../src/components/projectsettings.vue","../../src/util/run.ts","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/errors.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/formats.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/zone.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/zones/systemZone.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/zones/IANAZone.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/locale.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/zones/fixedOffsetZone.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/zones/invalidZone.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/zoneUtil.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/settings.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/invalid.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/conversions.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/util.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/english.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/formatter.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/regexParser.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/duration.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/interval.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/info.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/diff.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/digits.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/impl/tokenParser.js","../../node_modules/.pnpm/luxon@3.4.4/node_modules/luxon/src/datetime.js","../../src/util/time.ts","../../src/components/runs.vue","../../src/components/rundetail.vue","../../src/components/tasks.vue","../../src/components/tasksgraph.vue","../../src/components/runsummary.vue","../../node_modules/.pnpm/ansi_up@6.0.2/node_modules/ansi_up/ansi_up.js","../../src/components/log.vue","../../src/components/step.vue","../../src/components/tasksummary.vue","../../src/components/usersettings.vue","../../src/components/loginform.vue","../../src/views/AddLinkedAccount.vue","../../src/components/createsourceform.vue","../../src/views/CreateSource.vue","../../src/views/Home.vue","../../src/views/Login.vue","../../src/views/Logout.vue","../../src/views/Oauth2.vue","../../src/components/createprojectbutton.vue","../../src/views/Org.vue","../../src/components/projbreadcrumbs.vue","../../src/components/tabarrow.vue","../../src/views/Project.vue","../../src/views/ProjectGroup.vue","../../src/components/registerform.vue","../../src/views/Register.vue","../../src/views/User.vue","../../src/router/index.ts","../../src/components/delay.vue","../../src/main.ts"],"sourcesContent":["let active;\nfunction toClassName(rule) {\n return [\n ...rule.v,\n (rule.i ? '!' : '') + rule.n\n ].join(':');\n}\nfunction format(rules, seperator = ',') {\n return rules.map(toClassName).join(seperator);\n}\n/**\n * @internal\n */ let escape = 'undefined' != typeof CSS && CSS.escape || // Simplified: escaping only special characters\n// Needed for NodeJS and Edge <79 (https://caniuse.com/mdn-api_css_escape)\n((className)=>className.// Simplifed escape testing only for chars that we know happen to be in tailwind directives\n replace(/[!\"'`*+.,;:\\\\/<=>?@#$%&^|~()[\\]{}]/g, '\\\\$&').// If the character is the first character and is in the range [0-9] (2xl, ...)\n // https://drafts.csswg.org/cssom/#escape-a-character-as-code-point\n replace(/^\\d/, '\\\\3$& '));\n// Based on https://stackoverflow.com/a/52171480\n/**\n * @group Configuration\n * @param value\n * @returns\n */ function hash(value) {\n // eslint-disable-next-line no-var\n for(var h = 9, index = value.length; index--;)h = Math.imul(h ^ value.charCodeAt(index), 0x5f356495);\n return '#' + ((h ^ h >>> 9) >>> 0).toString(36);\n}\n/**\n * @internal\n * @param screen\n * @param prefix\n * @returns\n */ function mql(screen, prefix = '@media ') {\n return prefix + asArray(screen).map((screen)=>{\n return 'string' == typeof screen && (screen = {\n min: screen\n }), screen.raw || Object.keys(screen).map((feature)=>`(${feature}-width:${screen[feature]})`).join(' and ');\n }).join(',');\n}\n/**\n * @internal\n * @param value\n * @returns\n */ function asArray(value = []) {\n return Array.isArray(value) ? value : null == value ? [] : [\n value\n ];\n}\n/**\n * @internal\n * @param value\n * @returns\n */ function identity(value) {\n return value;\n}\n/**\n * @internal\n */ function noop() {}\n// no-op\n// Based on https://github.com/kripod/otion\n// License MIT\n// export const enum Shifts {\n// darkMode = 30,\n// layer = 27,\n// screens = 26,\n// responsive = 22,\n// atRules = 18,\n// variants = 0,\n// }\nlet Layer = {\n /**\n * 1. `default` (public)\n */ d: /* efaults */ 0,\n /* Shifts.layer */ /**\n * 2. `base` (public) — for things like reset rules or default styles applied to plain HTML elements.\n */ b: /* ase */ 134217728,\n /* Shifts.layer */ /**\n * 3. `components` (public, used by `style()`) — is for class-based styles that you want to be able to override with utilities.\n */ c: /* omponents */ 268435456,\n /* Shifts.layer */ // reserved for style():\n // - props: 0b011\n // - when: 0b100\n /**\n * 6. `aliases` (public, used by `apply()`) — `~(...)`\n */ a: /* liases */ 671088640,\n /* Shifts.layer */ /**\n * 6. `utilities` (public) — for small, single-purpose classes\n */ u: /* tilities */ 805306368,\n /* Shifts.layer */ /**\n * 7. `overrides` (public, used by `css()`)\n */ o: /* verrides */ 939524096\n};\n/*\nTo set a bit: n |= mask;\nTo clear a bit: n &= ~mask;\nTo test if a bit is set: (n & mask)\n\nBit shifts for the primary bits:\n\n| bits | trait | shift |\n| ---- | ------------------------------------------------------- | ----- |\n| 1 | dark mode | 30 |\n| 3 | layer: preflight, global, components, utilities, css | 27 |\n| 1 | screens: is this a responsive variation of a rule | 26 |\n| 4 | responsive based on min-width, max-width or width | 22 |\n| 4 | at-rules | 18 |\n| 18 | pseudo and group variants | 0 |\n\nLayer: 0 - 7: 3 bits\n - defaults: 0 << 27\n - base: 1 << 27\n - components: 2 << 27\n - variants: 3 << 27\n - joints: 4 << 27\n - aliases: 5 << 27\n - utilities: 6 << 27\n - overrides: 7 << 27\n\nThese are calculated by serialize and added afterwards:\n\n| bits | trait |\n| ---- | ----------------------------------- |\n| 4 | number of selectors (descending) |\n| 4 | number of declarations (descending) |\n| 4 | greatest precedence of properties |\n\nThese are added by shifting the primary bits using multiplication as js only\nsupports bit shift up to 32 bits.\n*/ // Colon and dash count of string (ascending)\nfunction seperatorPrecedence(string) {\n return string.match(/[-=:;]/g)?.length || 0;\n}\nfunction atRulePrecedence(css) {\n // 0 - 15: 4 bits (max 144rem or 2304px)\n // rem -> bit\n // <20 -> 0 (<320px)\n // 20 -> 1 (320px)\n // 24 -> 2 (384px)\n // 28 -> 3 (448px)\n // 32 -> 4 (512px)\n // 36 -> 5 (576px)\n // 42 -> 6 (672px)\n // 48 -> 7 (768px)\n // 56 -> 8 (896px)\n // 64 -> 9 (1024px)\n // 72 -> 10 (1152px)\n // 80 -> 11 (1280px)\n // 96 -> 12 (1536px)\n // 112 -> 13 (1792px)\n // 128 -> 14 (2048px)\n // 144 -> 15 (2304px)\n // https://www.dcode.fr/function-equation-finder\n return Math.min(/(?:^|width[^\\d]+)(\\d+(?:.\\d+)?)(p)?/.test(css) ? Math.max(0, 29.63 * (+RegExp.$1 / (RegExp.$2 ? 15 : 1)) ** 0.137 - 43) : 0, 15) << 22 | /* Shifts.responsive */ Math.min(seperatorPrecedence(css), 15) << 18;\n}\n/* Shifts.atRules */ // Pesudo variant presedence\n// Chars 3 - 8: Uniquely identifies a pseudo selector\n// represented as a bit set for each relevant value\n// 18 bits: one for each variant plus one for unknown variants\n//\n// ':group-*' variants are normalized to their native pseudo class (':group-hover' -> ':hover')\n// as they already have a higher selector presedence due to the add '.group' ('.group:hover .group-hover:...')\n// Sources:\n// - https://bitsofco.de/when-do-the-hover-focus-and-active-pseudo-classes-apply/#orderofstyleshoverthenfocusthenactive\n// - https://developer.mozilla.org/docs/Web/CSS/:active#Active_links\n// - https://github.com/tailwindlabs/tailwindcss/blob/master/stubs/defaultConfig.stub.js#L931\nlet PRECEDENCES_BY_PSEUDO_CLASS = [\n /* fi */ 'rst-c',\n /* hild: 0 */ /* la */ 'st-ch',\n /* ild: 1 */ // even and odd use: nth-child\n /* nt */ 'h-chi',\n /* ld: 2 */ /* an */ 'y-lin',\n /* k: 3 */ /* li */ 'nk',\n /* : 4 */ /* vi */ 'sited',\n /* : 5 */ /* ch */ 'ecked',\n /* : 6 */ /* em */ 'pty',\n /* : 7 */ /* re */ 'ad-on',\n /* ly: 8 */ /* fo */ 'cus-w',\n /* ithin : 9 */ /* ho */ 'ver',\n /* : 10 */ /* fo */ 'cus',\n /* : 11 */ /* fo */ 'cus-v',\n /* isible : 12 */ /* ac */ 'tive',\n /* : 13 */ /* di */ 'sable',\n /* d : 14 */ /* op */ 'tiona',\n /* l: 15 */ /* re */ 'quire'\n];\n/** The name to use for `&` expansion in selectors. Maybe empty for at-rules like `@import`, `@font-face`, `@media`, ... */ /** The calculated precedence taking all variants into account. */ /** The rulesets (selectors and at-rules). expanded variants `@media ...`, `@supports ...`, `&:focus`, `.dark &` */ /** Is this rule `!important` eg something like `!underline` or `!bg-red-500` or `!red-500` */ function convert({ n: name , i: important , v: variants = [] }, context, precedence, conditions) {\n name && (name = toClassName({\n n: name,\n i: important,\n v: variants\n }));\n conditions = [\n ...asArray(conditions)\n ];\n for (let variant of variants){\n let screen = context.theme('screens', variant);\n for (let condition of asArray(screen && mql(screen) || context.v(variant))){\n var /* d: 16 */ selector;\n conditions.push(condition);\n precedence |= screen ? 67108864 | /* Shifts.screens */ atRulePrecedence(condition) : 'dark' == variant ? 1073741824 : /* Shifts.darkMode */ '@' == condition[0] ? atRulePrecedence(condition) : (selector = condition, // use first found pseudo-class\n 1 << ~(/:([a-z-]+)/.test(selector) && ~PRECEDENCES_BY_PSEUDO_CLASS.indexOf(RegExp.$1.slice(2, 7)) || -18));\n }\n }\n return {\n n: name,\n p: precedence,\n r: conditions,\n i: important\n };\n}\nlet registry = new Map();\nfunction stringify$1(rule) {\n if (rule.d) {\n let groups = [], selector = replaceEach(// merge all conditions into a selector string\n rule.r.reduce((selector, condition)=>{\n return '@' == condition[0] ? (groups.push(condition), selector) : // Go over the selector and replace the matching multiple selectors if any\n condition ? replaceEach(selector, (selectorPart)=>replaceEach(condition, // If the current condition has a nested selector replace it\n (conditionPart)=>{\n let mergeMatch = /(:merge\\(.+?\\))(:[a-z-]+|\\\\[.+])/.exec(conditionPart);\n if (mergeMatch) {\n let selectorIndex = selectorPart.indexOf(mergeMatch[1]);\n return ~selectorIndex ? // [':merge(.group):hover .rule', ':merge(.group):focus &'] -> ':merge(.group):focus:hover .rule'\n // ':merge(.group)' + ':focus' + ':hover .rule'\n selectorPart.slice(0, selectorIndex) + mergeMatch[0] + selectorPart.slice(selectorIndex + mergeMatch[1].length) : // [':merge(.peer):focus~&', ':merge(.group):hover &'] -> ':merge(.peer):focus~:merge(.group):hover &'\n replaceReference(selectorPart, conditionPart);\n }\n // Return the current selector with the key matching multiple selectors if any\n return replaceReference(conditionPart, selectorPart);\n })) : selector;\n }, '&'), // replace '&' with rule name or an empty string\n (selectorPart)=>replaceReference(selectorPart, rule.n ? '.' + escape(rule.n) : ''));\n return selector && groups.push(selector.replace(/:merge\\((.+?)\\)/g, '$1')), groups.reduceRight((body, grouping)=>grouping + '{' + body + '}', rule.d);\n }\n}\nfunction replaceEach(selector, iteratee) {\n return selector.replace(/ *((?:\\(.+?\\)|\\[.+?\\]|[^,])+) *(,|$)/g, (_, selectorPart, comma)=>iteratee(selectorPart) + comma);\n}\nfunction replaceReference(selector, reference) {\n return selector.replace(/&/g, reference);\n}\nlet collator = new Intl.Collator('en', {\n numeric: true\n});\n/** The calculated precedence taking all variants into account. */ /* The precedence of the properties within {@link d}. */ /** The name to use for `&` expansion in selectors. Maybe empty for at-rules like `@import`, `@font-face`, `@media`, ... */ /**\n * Find the array index of where to add an element to keep it sorted.\n *\n * @returns The insertion index\n */ function sortedInsertionIndex(array, element) {\n // Find position using binary search\n // eslint-disable-next-line no-var\n for(var low = 0, high = array.length; low < high;){\n let pivot = high + low >> 1;\n 0 >= compareTwindRules(array[pivot], element) ? low = pivot + 1 : high = pivot;\n }\n return high;\n}\nfunction compareTwindRules(a, b) {\n // base and overrides (css) layers are kept in order they are declared\n let layer = a.p & Layer.o;\n return layer == (b.p & Layer.o) && (layer == Layer.b || layer == Layer.o) ? 0 : a.p - b.p || a.o - b.o || collator.compare(byModifier(a.n), byModifier(b.n)) || collator.compare(byName(a.n), byName(b.n));\n}\nfunction byModifier(s) {\n return (s || '').split(/:/).pop().split('/').pop() || '\\x00';\n}\nfunction byName(s) {\n return (s || '').replace(/\\W/g, (c)=>String.fromCharCode(127 + c.charCodeAt(0))) + '\\x00';\n}\nfunction parseColorComponent(chars, factor) {\n return Math.round(parseInt(chars, 16) * factor);\n}\n/**\n * @internal\n * @param color\n * @param options\n * @returns\n */ function toColorValue(color, options = {}) {\n if ('function' == typeof color) return color(options);\n let { opacityValue ='1' , opacityVariable } = options, opacity = opacityVariable ? `var(${opacityVariable})` : opacityValue;\n if (color.includes('')) return color.replace('', opacity);\n // rgb hex: #0123 and #001122\n if ('#' == color[0] && (4 == color.length || 7 == color.length)) {\n let size = (color.length - 1) / 3, factor = [\n 17,\n 1,\n 0.062272\n ][size - 1];\n return `rgba(${[\n parseColorComponent(color.substr(1, size), factor),\n parseColorComponent(color.substr(1 + size, size), factor),\n parseColorComponent(color.substr(1 + 2 * size, size), factor),\n opacity\n ]})`;\n }\n return '1' == opacity ? color : '0' == opacity ? '#0000' : // convert rgb and hsl to alpha variant\n color.replace(/^(rgb|hsl)(\\([^)]+)\\)$/, `$1a$2,${opacity})`);\n}\n/**\n * Looks for a matching dark color within a [tailwind color palette](https://tailwindcss.com/docs/customizing-colors) (`50`, `100`, `200`, ..., `800`, `900`).\n *\n * ```js\n * defineConfig({\n * darkColor: autoDarkColor,\n * })\n * ```\n *\n * **Note**: Does not work for arbitrary values like `[theme(colors.gray.500)]` or `[theme(colors.gray.500, #ccc)]`.\n *\n * @group Configuration\n * @param section within theme to use\n * @param key of the light color or an arbitrary value\n * @param context to use\n * @returns the dark color if found\n */ function autoDarkColor(section, key, { theme }) {\n return theme(section, // 50 -> 900, 100 -> 800, ..., 800 -> 100, 900 -> 50\n // key: gray-50, gray.50\n key = key.replace(/\\d+$/, (shade)=>// ~~(parseInt(shade, 10) / 100): 50 -> 0, 900 -> 9\n 100 * // (9 - 0) -> 900, (9 - 9) -> 50\n (9 - ~~(parseInt(shade, 10) / 100) || 0.5)));\n}\nfunction serialize(style, rule, context, precedence, conditions = []) {\n return function serialize$(style, { n: name , p: precedence , r: conditions = [] , i: important }, context) {\n let rules = [], // The generated declaration block eg body of the css rule\n declarations = '', // This ensures that 'border-top-width' has a higher precedence than 'border-top'\n maxPropertyPrecedence = 0, // More specific utilities have less declarations and a higher precedence\n numberOfDeclarations = 0;\n for(let key in style || {}){\n var layer, // https://github.com/kripod/otion/blob/main/packages/otion/src/propertyMatchers.ts\n // \"+1\": [\n // \t/* ^border-.*(w|c|sty) */\n // \t\"border-.*(width,color,style)\",\n // \t/* ^[tlbr].{2,4}m?$ */\n // \t\"top\",\n // \t\"left\",\n // \t\"bottom\",\n // \t\"right\",\n // \t/* ^c.{7}$ */\n // \t\"continue\",\n // \t/* ^c.{8}$ */\n // \t\"container\",\n // ],\n // \"-1\": [\n // \t/* ^[fl].{5}l */\n // \t\"flex-flow\",\n // \t\"line-clamp\",\n // \t/* ^g.{8}$ */\n // \t\"grid-area\",\n // \t/* ^pl */\n // \t\"place-content\",\n // \t\"place-items\",\n // \t\"place-self\",\n // ],\n // group: 1 => +1\n // group: 2 => -1\n // 0 - 15 => 4 bits\n // Ignore vendor prefixed and custom properties\n property;\n let value = style[key];\n if ('@' == key[0]) {\n // at rules: https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule\n if (!value) continue;\n // @apply ...;\n if ('a' == key[1]) {\n rules.push(...translateWith(name, precedence, parse('' + value), context, precedence, conditions, important, true));\n continue;\n }\n // @layer \n if ('l' == key[1]) {\n for (let css of asArray(value))rules.push(...serialize$(css, {\n n: name,\n p: (layer = Layer[key[7]], // Set layer (first reset, than set)\n precedence & ~Layer.o | layer),\n r: 'd' == key[7] ? [] : conditions,\n i: important\n }, context));\n continue;\n }\n // @import\n if ('i' == key[1]) {\n rules.push(...asArray(value).map((value)=>({\n // before all layers\n p: -1,\n o: 0,\n r: [],\n d: key + ' ' + value\n })));\n continue;\n }\n // @keyframes\n if ('k' == key[1]) {\n // Use defaults layer\n rules.push({\n p: Layer.d,\n o: 0,\n r: [\n key\n ],\n d: serialize$(value, {\n p: Layer.d\n }, context).map(stringify$1).join('')\n });\n continue;\n }\n // @font-face\n // TODO @font-feature-values\n if ('f' == key[1]) {\n // Use defaults layer\n rules.push(...asArray(value).map((value)=>({\n p: Layer.d,\n o: 0,\n r: [\n key\n ],\n d: serialize$(value, {\n p: Layer.d\n }, context).map(stringify$1).join('')\n })));\n continue;\n }\n }\n // -> All other are handled below; same as selector\n // @media\n // @supports\n // selector\n if ('object' != typeof value || Array.isArray(value)) {\n if ('label' == key && value) name = value + hash(JSON.stringify([\n precedence,\n important,\n style\n ]));\n else if (value || 0 === value) {\n // property -> hyphenate\n key = key.replace(/[A-Z]/g, (_)=>'-' + _.toLowerCase());\n // Update precedence\n numberOfDeclarations += 1;\n maxPropertyPrecedence = Math.max(maxPropertyPrecedence, '-' == (property = key)[0] ? 0 : seperatorPrecedence(property) + (/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(property) ? +!!RegExp.$1 || /* +1 */ -!!RegExp.$2 : /* -1 */ 0) + 1);\n declarations += (declarations ? ';' : '') + asArray(value).map((value)=>context.s(key, // support theme(...) function in values\n // calc(100vh - theme('spacing.12'))\n resolveThemeFunction('' + value, context.theme) + (important ? ' !important' : ''))).join(';');\n }\n } else // at-rule or non-global selector\n if ('@' == key[0] || key.includes('&')) {\n let rulePrecedence = precedence;\n if ('@' == key[0]) {\n // Handle `@media screen(sm)` and `@media (screen(sm) or ...)`\n key = key.replace(/\\bscreen\\(([^)]+)\\)/g, (_, screenKey)=>{\n let screen = context.theme('screens', screenKey);\n return screen ? (rulePrecedence |= 67108864, /* Shifts.screens */ mql(screen, '')) : _;\n });\n rulePrecedence |= atRulePrecedence(key);\n }\n rules.push(...serialize$(value, {\n n: name,\n p: rulePrecedence,\n r: [\n ...conditions,\n key\n ],\n i: important\n }, context));\n } else // global selector\n rules.push(...serialize$(value, {\n p: precedence,\n r: [\n ...conditions,\n key\n ]\n }, context));\n }\n return(// PERF: prevent unshift using `rules = [{}]` above and then `rules[0] = {...}`\n rules.unshift({\n n: name,\n p: precedence,\n o: // number of declarations (descending)\n Math.max(0, 15 - numberOfDeclarations) + // greatest precedence of properties\n // if there is no property precedence this is most likely a custom property only declaration\n // these have the highest precedence\n 1.5 * Math.min(maxPropertyPrecedence || 15, 15),\n r: conditions,\n // stringified declarations\n d: declarations\n }), rules.sort(compareTwindRules));\n }(style, convert(rule, context, precedence, conditions), context);\n}\nfunction resolveThemeFunction(value, theme) {\n // support theme(...) function in values\n // calc(100vh - theme('spacing.12'))\n // theme('borderColor.DEFAULT', 'currentColor')\n // PERF: check for theme before running the regexp\n // if (value.includes('theme')) {\n return value.replace(/theme\\(([\"'`])?(.+?)\\1(?:\\s*,\\s*([\"'`])?(.+?)\\3)?\\)/g, (_, __, key, ___, defaultValue = '')=>{\n let value = theme(key, defaultValue);\n return 'function' == typeof value && /color|fill|stroke/i.test(key) ? toColorValue(value) : '' + asArray(value).filter((v)=>Object(v) !== v);\n });\n}\n// }\n// return value\nfunction merge(rules, name) {\n let current;\n // merge:\n // - same conditions\n // - replace name with hash of name + condititions + declarations\n // - precedence:\n // - combine bits or use max precendence\n // - set layer bit to merged\n let result = [];\n for (let rule of rules)// only merge rules with declarations and names (eg no global rules)\n if (rule.d && rule.n) {\n if (current?.p == rule.p && '' + current.r == '' + rule.r) {\n current.c = [\n current.c,\n rule.c\n ].filter(Boolean).join(' ');\n current.d = current.d + ';' + rule.d;\n } else // only set name for named rules eg not for global or className propagation rules\n result.push(current = {\n ...rule,\n n: rule.n && name\n });\n } else result.push({\n ...rule,\n n: rule.n && name\n });\n return result;\n}\nfunction translate(rules, context, precedence = Layer.u, conditions, important) {\n // Sorted by precedence\n let result = [];\n for (let rule of rules)for (let cssRule of function(rule, context, precedence, conditions, important) {\n rule = {\n ...rule,\n i: rule.i || important\n };\n let resolved = function(rule, context) {\n let factory = registry.get(rule.n);\n return factory ? factory(rule, context) : context.r(rule.n, 'dark' == rule.v[0]);\n }(rule, context);\n return resolved ? // a list of class names\n 'string' == typeof resolved ? ({ r: conditions , p: precedence } = convert(rule, context, precedence, conditions), merge(translate(parse(resolved), context, precedence, conditions, rule.i), rule.n)) : Array.isArray(resolved) ? resolved.map((rule)=>{\n var /* Shifts.layer */ /*\nTo have a predictable styling the styles must be ordered.\n\nThis order is represented by a precedence number. The lower values\nare inserted before higher values. Meaning higher precedence styles\noverwrite lower precedence styles.\n\nEach rule has some traits that are put into a bit set which form\nthe precedence:\n\n| bits | trait |\n| ---- | ---------------------------------------------------- |\n| 1 | dark mode |\n| 2 | layer: preflight, global, components, utilities, css |\n| 1 | screens: is this a responsive variation of a rule |\n| 5 | responsive based on min-width |\n| 4 | at-rules |\n| 18 | pseudo and group variants |\n| 4 | number of declarations (descending) |\n| 4 | greatest precedence of properties |\n\n**Dark Mode: 1 bit**\n\nFlag for dark mode rules.\n\n**Layer: 3 bits**\n\n- defaults = 0: The preflight styles and any base styles registered by plugins.\n- base = 1: The global styles registered by plugins.\n- components = 2\n- variants = 3\n- compounds = 4\n- aliases = 5\n- utilities = 6: Utility classes and any utility classes registered by plugins.\n- css = 7: Styles generated by css\n\n**Screens: 1 bit**\n\nFlag for screen variants. They may not always have a `min-width` to be detected by _Responsive_ below.\n\n**Responsive: 4 bits**\n\nBased on extracted `min-width` value:\n\n- 576px -> 3\n- 1536px -> 10\n- 36rem -> 3\n- 96rem -> 9\n\n**At-Rules: 4 bits**\n\nBased on the count of special chars (`-:,`) within the at-rule.\n\n**Pseudo and group variants: 18 bits**\n\nEnsures predictable order of pseudo classes.\n\n- https://bitsofco.de/when-do-the-hover-focus-and-active-pseudo-classes-apply/#orderofstyleshoverthenfocusthenactive\n- https://developer.mozilla.org/docs/Web/CSS/:active#Active_links\n- https://github.com/tailwindlabs/tailwindcss/blob/master/stubs/defaultConfig.stub.js#L718\n\n**Number of declarations (descending): 4 bits**\n\nAllows single declaration styles to overwrite styles from multi declaration styles.\n\n**Greatest precedence of properties: 4 bits**\n\nEnsure shorthand properties are inserted before longhand properties; eg longhand override shorthand\n*/ precedence1, layer;\n return {\n o: 0,\n ...rule,\n r: [\n ...asArray(conditions),\n ...asArray(rule.r)\n ],\n p: (precedence1 = precedence, layer = rule.p ?? precedence, precedence1 & ~Layer.o | layer)\n };\n }) : serialize(resolved, rule, context, precedence, conditions) : // propagate className as is\n [\n {\n c: toClassName(rule),\n p: 0,\n o: 0,\n r: []\n }\n ];\n }(rule, context, precedence, conditions, important))result.splice(sortedInsertionIndex(result, cssRule), 0, cssRule);\n return result;\n}\nfunction translateWith(name, layer, rules, context, precedence, conditions, important, useOrderOfRules) {\n return merge((useOrderOfRules ? rules.flatMap((rule)=>translate([\n rule\n ], context, precedence, conditions, important)) : translate(rules, context, precedence, conditions, important)).map((rule)=>{\n return(// do not move defaults\n // move only rules with a name unless they are in the base layer\n rule.p & Layer.o && (rule.n || layer == Layer.b) ? {\n ...rule,\n p: rule.p & ~Layer.o | layer,\n o: 0\n } : rule);\n }), name);\n}\nfunction define(className, layer, rules, useOrderOfRules) {\n var factory;\n return factory = (rule, context)=>{\n let { n: name , p: precedence , r: conditions , i: important } = convert(rule, context, layer);\n return rules && translateWith(name, layer, rules, context, precedence, conditions, important, useOrderOfRules);\n }, registry.set(className, factory), className;\n}\n/**\n * The utility name including `-` if set, but without `!` and variants\n */ /**\n * All variants without trailing colon: `hover`, `after:`, `[...]`\n */ /**\n * Something like `!underline` or `!bg-red-500` or `!red-500`\n */ function createRule(active, current, loc) {\n if ('(' != active[active.length - 1]) {\n let variants = [], important = false, negated = false, name = '';\n for (let value of active)if (!('(' == value || /[~@]$/.test(value))) {\n if ('!' == value[0]) {\n value = value.slice(1);\n important = !important;\n }\n if (value.endsWith(':')) {\n variants['dark:' == value ? 'unshift' : 'push'](value.slice(0, -1));\n continue;\n }\n if ('-' == value[0]) {\n value = value.slice(1);\n negated = !negated;\n }\n value.endsWith('-') && (value = value.slice(0, -1));\n value && '&' != value && (name += (name && '-') + value);\n }\n if (name) {\n negated && (name = '-' + name);\n current[0].push({\n n: name,\n v: variants.filter(uniq),\n i: important\n });\n }\n }\n}\nfunction uniq(value, index, values) {\n return values.indexOf(value) == index;\n}\nlet cache = new Map();\n/**\n * @internal\n * @param token\n * @returns\n */ function parse(token) {\n let parsed = cache.get(token);\n if (!parsed) {\n // Stack of active groupings (`(`), variants, or nested (`~` or `@`)\n let active = [], // Stack of current rule list to put new rules in\n // the first `0` element is the current list\n current = [\n []\n ], startIndex = 0, skip = 0, comment = null, position = 0, // eslint-disable-next-line no-inner-declarations\n commit = (isRule, endOffset = 0)=>{\n if (startIndex != position) {\n active.push(token.slice(startIndex, position + endOffset));\n isRule && createRule(active, current);\n }\n startIndex = position + 1;\n };\n for(; position < token.length; position++){\n let char = token[position];\n if (skip) '\\\\' != token[position - 1] && (skip += +('[' == char) || -(']' == char));\n else if ('[' == char) // start to skip\n skip += 1;\n else if (comment) {\n if ('\\\\' != token[position - 1] && comment.test(token.slice(position))) {\n comment = null;\n startIndex = position + RegExp.lastMatch.length;\n }\n } else if ('/' == char && '\\\\' != token[position - 1] && ('*' == token[position + 1] || '/' == token[position + 1])) // multiline or single line comment\n comment = '*' == token[position + 1] ? /^\\*\\// : /^[\\r\\n]/;\n else if ('(' == char) {\n // hover:(...) or utilitity-(...)\n commit();\n active.push(char);\n } else if (':' == char) ':' != token[position + 1] && commit(false, 1);\n else if (/[\\s,)]/.test(char)) {\n // whitespace, comma or closing brace\n commit(true);\n let lastGroup = active.lastIndexOf('(');\n if (')' == char) {\n // Close nested block\n let nested = active[lastGroup - 1];\n if (/[~@]$/.test(nested)) {\n let rules = current.shift();\n active.length = lastGroup;\n // remove variants that are already applied through active\n createRule([\n ...active,\n '#'\n ], current);\n let { v } = current[0].pop();\n for (let rule of rules)// if a rule has dark we need to splice after the first entry eg dark\n rule.v.splice(+('dark' == rule.v[0]) - +('dark' == v[0]), v.length);\n createRule([\n ...active,\n define(// named nested\n nested.length > 1 ? nested.slice(0, -1) + hash(JSON.stringify([\n nested,\n rules\n ])) : nested + '(' + format(rules) + ')', Layer.a, rules, /@$/.test(nested))\n ], current);\n }\n lastGroup = active.lastIndexOf('(', lastGroup - 1);\n }\n active.length = lastGroup + 1;\n } else /[~@]/.test(char) && '(' == token[position + 1] && // start nested block\n // ~(...) or button~(...)\n // @(...) or button@(...)\n current.unshift([]);\n }\n // Consume remaining stack\n commit(true);\n cache.set(token, parsed = current[0]);\n }\n return parsed;\n}\nfunction interleave(strings, interpolations, handle) {\n return interpolations.reduce((result, interpolation, index)=>result + handle(interpolation) + strings[index + 1], strings[0]);\n}\n// based on https://github.com/lukeed/clsx and https://github.com/jorgebucaran/classcat\nfunction interpolate(strings, interpolations) {\n return Array.isArray(strings) && Array.isArray(strings.raw) ? interleave(strings, interpolations, (value)=>toString(value).trim()) : interpolations.filter(Boolean).reduce((result, value)=>result + toString(value), strings ? toString(strings) : '');\n}\nfunction toString(value) {\n let tmp, result = '';\n if (value && 'object' == typeof value) {\n if (Array.isArray(value)) (tmp = interpolate(value[0], value.slice(1))) && (result += ' ' + tmp);\n else for(let key in value)value[key] && (result += ' ' + key);\n } else null != value && 'boolean' != typeof value && (result += ' ' + value);\n return result;\n}\n/**\n * @group Class Name Generators\n */ let apply = /* #__PURE__ */ alias('@'), /**\n * @group Class Name Generators\n */ shortcut = /* #__PURE__ */ alias('~');\nfunction alias(marker) {\n return new Proxy(function alias(strings, ...interpolations) {\n return alias$('', strings, interpolations);\n }, {\n get (target, name) {\n return name in target ? target[name] : function namedAlias(strings, ...interpolations) {\n return alias$(name, strings, interpolations);\n };\n }\n });\n function alias$(name, strings, interpolations) {\n return format(parse(name + marker + '(' + interpolate(strings, interpolations) + ')'));\n }\n}\nfunction astish(strings, interpolations) {\n return Array.isArray(strings) ? astish$(interleave(strings, interpolations, (interpolation)=>null != interpolation && 'boolean' != typeof interpolation ? interpolation : '')) : 'string' == typeof strings ? astish$(strings) : [\n strings\n ];\n}\n// Based on https://github.com/cristianbote/goober/blob/master/src/core/astish.js\nlet newRule = / *(?:(?:([\\u0080-\\uFFFF\\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}))/g;\n/**\n * Convert a css style string into a object\n */ function astish$(css) {\n let block;\n css = // Remove comments (multiline and single line)\n css.replace(/\\/\\*[^]*?\\*\\/|\\s\\s+|\\n/gm, ' ');\n let tree = [\n {}\n ], rules = [\n tree[0]\n ], conditions = [];\n for(; block = newRule.exec(css);){\n // Remove the current entry\n if (block[4]) {\n tree.shift();\n conditions.shift();\n }\n if (block[3]) {\n // new nested\n conditions.unshift(block[3]);\n tree.unshift({});\n rules.push(conditions.reduce((body, condition)=>({\n [condition]: body\n }), tree[0]));\n } else if (!block[4]) {\n // if we already have that property — start a new CSSObject\n if (tree[0][block[1]]) {\n tree.unshift({});\n rules.push(conditions.reduce((body, condition)=>({\n [condition]: body\n }), tree[0]));\n }\n tree[0][block[1]] = block[2];\n }\n }\n // console.log(rules)\n return rules;\n}\n/**\n * @group Class Name Generators\n * @param strings\n * @param interpolations\n */ function css(strings, ...interpolations) {\n var factory;\n let ast = astish(strings, interpolations), className = (ast.find((o)=>o.label)?.label || 'css') + hash(JSON.stringify(ast));\n return factory = (rule, context)=>merge(ast.flatMap((css)=>serialize(css, rule, context, Layer.o)), className), registry.set(className, factory), className;\n}\n/**\n * @group Class Name Generators\n */ let animation = /* #__PURE__ */ new Proxy(function animation(animation, waypoints) {\n return animation$('animation', animation, waypoints);\n}, {\n get (target, name) {\n return name in target ? target[name] : function namedAnimation(animation, waypoints) {\n return animation$(name, animation, waypoints);\n };\n }\n});\nfunction animation$(label, animation, waypoints) {\n return {\n toString () {\n return css({\n label,\n '@layer components': {\n ...'object' == typeof animation ? animation : {\n animation\n },\n animationName: '' + waypoints\n }\n });\n }\n };\n}\n/** The found theme value */ // indirection wrapper to remove autocomplete functions from production bundles\n/**\n * @group Configuration\n * @param pattern\n */ /**\n * @group Configuration\n * @param pattern\n * @param resolver\n */ /**\n * @group Configuration\n * @param pattern\n * @param resolve\n */ // eslint-disable-next-line @typescript-eslint/ban-types\n/**\n * @group Configuration\n * @param pattern\n * @param resolve\n * @param convert\n */ function match(pattern, // eslint-disable-next-line @typescript-eslint/ban-types\nresolve, convert) {\n return [\n pattern,\n fromMatch(resolve, convert)\n ];\n}\n/**\n * @group Configuration\n * @internal\n * @deprecated Use {@link match} instead.\n */ /**\n * @group Configuration\n * @internal\n * @deprecated Use {@link match} instead.\n */ /**\n * @group Configuration\n * @internal\n * @deprecated Use {@link match} instead.\n */ /**\n * @group Configuration\n * @internal\n * @deprecated Use {@link match} instead.\n */ function fromMatch(resolve, convert) {\n return 'function' == typeof resolve ? resolve : 'string' == typeof resolve && /^[\\w-]+$/.test(resolve) ? // a CSS property alias\n (match, context)=>({\n [resolve]: convert ? convert(match, context) : maybeNegate(match, 1)\n }) : (match)=>// CSSObject, shortcut or apply\n resolve || {\n [match[1]]: maybeNegate(match, 2)\n };\n}\nfunction maybeNegate(match, offset, value = match.slice(offset).find(Boolean) || match.$$ || match.input) {\n return '-' == match.input[0] ? `calc(${value} * -1)` : value;\n}\n/**\n * @group Configuration\n * @param pattern\n * @param section\n * @param resolve\n * @param convert\n * @returns\n */ function matchTheme(pattern, /** Theme section to use (default: `$1` — The first matched group) */ section, /** The css property (default: value of {@link section}) */ resolve, convert) {\n return [\n pattern,\n fromTheme(section, resolve, convert)\n ];\n}\n/**\n * @group Configuration\n * @internal\n * @deprecated Use {@link matchTheme} instead.\n * @param section\n * @param resolve\n * @param convert\n * @returns\n */ function fromTheme(/** Theme section to use (default: `$1` — The first matched group) */ section, /** The css property (default: value of {@link section}) */ resolve, convert) {\n let factory = 'string' == typeof resolve ? (match, context)=>({\n [resolve]: convert ? convert(match, context) : match._\n }) : resolve || (({ 1: $1 , _ }, context, section)=>({\n [$1 || section]: _\n }));\n return (match, context)=>{\n let themeSection = camelize(section || match[1]), value = context.theme(themeSection, match.$$) ?? arbitrary(match.$$, themeSection, context);\n if (null != value) return match._ = maybeNegate(match, 0, value), factory(match, context, themeSection);\n };\n}\n/** Theme section to use (default: `$0.replace('-', 'Color')` — The matched string with `Color` appended) */ /** The css property (default: value of {@link section}) */ /** `--tw-${$0}opacity` -> '--tw-text-opacity' */ /** `section.replace('Color', 'Opacity')` -> 'textOpacity' */ /**\n * @group Configuration\n * @param pattern\n * @param options\n * @param resolve\n * @returns\n */ function matchColor(pattern, options = {}, resolve) {\n return [\n pattern,\n colorFromTheme(options, resolve)\n ];\n}\n/**\n * @group Configuration\n * @internal\n * @deprecated Use {@link matchColor} instead.\n * @param options\n * @param resolve\n * @returns\n */ function colorFromTheme(options = {}, resolve) {\n return (match, context)=>{\n // text- -> textColor\n // ring-offset(?:-|$) -> ringOffsetColor\n let { section =camelize(match[0]).replace('-', '') + 'Color' } = options, // extract color and opacity\n // rose-500 -> ['rose-500']\n // [hsl(0_100%_/_50%)] -> ['[hsl(0_100%_/_50%)]']\n // indigo-500/100 -> ['indigo-500', '100']\n // [hsl(0_100%_/_50%)]/[.25] -> ['[hsl(0_100%_/_50%)]', '[.25]']\n [colorMatch, opacityMatch] = parseValue(match.$$);\n if (!colorMatch) return;\n let colorValue = context.theme(section, colorMatch) || arbitrary(colorMatch, section, context);\n if (!colorValue || 'object' == typeof colorValue) return;\n let { // text- -> --tw-text-opacity\n // ring-offset(?:-|$) -> --tw-ring-offset-opacity\n // TODO move this default into preset-tailwind?\n opacityVariable =`--tw-${match[0].replace(/-$/, '')}-opacity` , opacitySection =section.replace('Color', 'Opacity') , property =section , selector } = options, opacityValue = context.theme(opacitySection, opacityMatch || 'DEFAULT') || opacityMatch && arbitrary(opacityMatch, opacitySection, context), // if (typeof color != 'string') {\n // console.warn(`Invalid color ${colorMatch} (from ${match.input}):`, color)\n // return\n // }\n create = resolve || (({ _ })=>{\n let properties = toCSS(property, _);\n return selector ? {\n [selector]: properties\n } : properties;\n });\n match._ = {\n value: toColorValue(colorValue, {\n opacityVariable: opacityVariable || void 0,\n opacityValue: opacityValue || void 0\n }),\n color: (options)=>toColorValue(colorValue, options),\n opacityVariable: opacityVariable || void 0,\n opacityValue: opacityValue || void 0\n };\n let properties = create(match, context);\n // auto support dark mode colors\n if (!match.dark) {\n let darkColorValue = context.d(section, colorMatch, colorValue);\n if (darkColorValue && darkColorValue !== colorValue) {\n match._ = {\n value: toColorValue(darkColorValue, {\n opacityVariable: opacityVariable || void 0,\n opacityValue: opacityValue || '1'\n }),\n color: (options)=>toColorValue(darkColorValue, options),\n opacityVariable: opacityVariable || void 0,\n opacityValue: opacityValue || void 0\n };\n properties = {\n '&': properties,\n [context.v('dark')]: create(match, context)\n };\n }\n }\n return properties;\n };\n}\n/**\n * @internal\n * @param input\n */ function parseValue(input) {\n // extract color and opacity\n // rose-500 -> ['rose-500']\n // [hsl(0_100%_/_50%)] -> ['[hsl(0_100%_/_50%)]']\n // indigo-500/100 -> ['indigo-500', '100']\n // [hsl(0_100%_/_50%)]/[.25] -> ['[hsl(0_100%_/_50%)]', '[.25]']\n return (input.match(/^(\\[[^\\]]+]|[^/]+?)(?:\\/(.+))?$/) || []).slice(1);\n}\n/**\n * @internal\n * @param property\n * @param value\n * @returns\n */ function toCSS(property, value) {\n let properties = {};\n if ('string' == typeof value) properties[property] = value;\n else {\n value.opacityVariable && value.value.includes(value.opacityVariable) && (properties[value.opacityVariable] = value.opacityValue || '1');\n properties[property] = value.value;\n }\n return properties;\n}\n/**\n * @internal\n * @param value\n * @param section\n * @param context\n * @returns\n */ function arbitrary(value, section, context) {\n if ('[' == value[0] && ']' == value.slice(-1)) {\n value = normalize(resolveThemeFunction(value.slice(1, -1), context.theme));\n if (!section) return value;\n if (// Respect type hints from the user on ambiguous arbitrary values - https://tailwindcss.com/docs/adding-custom-styles#resolving-ambiguities\n !// If this is a color section and the value is a hex color, color function or color name\n (/color|fill|stroke/i.test(section) && !(/^color:/.test(value) || /^(#|((hsl|rgb)a?|hwb|lab|lch|color)\\(|[a-z]+$)/.test(value)) || // url(, [a-z]-gradient(, image(, cross-fade(, image-set(\n /image/i.test(section) && !(/^image:/.test(value) || /^[a-z-]+\\(/.test(value)) || // font-*\n // - fontWeight (type: ['lookup', 'number', 'any'])\n // - fontFamily (type: ['lookup', 'generic-name', 'family-name'])\n /weight/i.test(section) && !(/^(number|any):/.test(value) || /^\\d+$/.test(value)) || // bg-*\n // - backgroundPosition (type: ['lookup', ['position', { preferOnConflict: true }]])\n // - backgroundSize (type: ['lookup', 'length', 'percentage', 'size'])\n /position/i.test(section) && /^(length|size):/.test(value))) // remove arbitrary type prefix — we do not need it but user may use it\n // https://github.com/tailwindlabs/tailwindcss/blob/master/src/util/dataTypes.js\n // url, number, percentage, length, line-width, shadow, color, image, gradient, position, family-name, lookup, any, generic-name, absolute-size, relative-size\n return value.replace(/^[a-z-]+:/, '');\n }\n}\nfunction camelize(value) {\n return value.replace(/-./g, (x)=>x[1].toUpperCase());\n}\n/**\n * @internal\n * @param value\n * @returns\n */ function normalize(value) {\n return(// Keep raw strings if it starts with `url(`\n value.includes('url(') ? value.replace(/(.*?)(url\\(.*?\\))(.*?)/g, (_, before = '', url, after = '')=>normalize(before) + url + normalize(after)) : value.// Convert `_` to ` `, except for escaped underscores `\\_`\n replace(/(^|[^\\\\])_+/g, (fullMatch, characterBefore)=>characterBefore + ' '.repeat(fullMatch.length - characterBefore.length)).replace(/\\\\_/g, '_').// Add spaces around operators inside math functions like calc() that do not follow an operator\n // or '('.\n replace(/(calc|min|max|clamp)\\(.+\\)/g, (match)=>match.replace(/(-?\\d*\\.?\\d(?!\\b-.+[,)](?![^+\\-/*])\\D)(?:%|[a-z]+)?|\\))([+\\-/*])/g, '$1 $2 ')));\n}\n/** Allows to resolve theme values. */ let kAutocomplete = /* #__PURE__ */ Symbol();\n/**\n * @experimental\n * @group Configuration\n * @param resolver\n * @param autocomplete\n */ function withAutocomplete(rule, autocomplete) {\n return rule;\n}\n/**\n * @internal\n * @param resolver\n * @returns\n */ function getAutocompleteProvider(resolver) {\n return resolver[kAutocomplete];\n}\n/**\n * Constructs `class` strings conditionally.\n *\n * Twinds version of popular libraries like [classnames](https://github.com/JedWatson/classnames) or [clsx](https://github.com/lukeed/clsx).\n * The key advantage of `cx` is that it supports twinds enhanced class name syntax like grouping and aliases.\n *\n * @group Class Name Generators\n * @param strings\n * @param interpolations\n * @returns\n */ /**\n * Constructs `class` strings conditionally.\n *\n * Twinds version of popular libraries like [classnames](https://github.com/JedWatson/classnames) or [clsx](https://github.com/lukeed/clsx).\n * The key advantage of `cx` is that it supports twinds enhanced class name syntax like grouping and aliases.\n *\n * @group Class Name Generators\n * @param input\n */ function cx(strings, ...interpolations) {\n return format(parse(interpolate(strings, interpolations)), ' ');\n}\n/**\n * @group Configuration\n * @param param0\n * @returns\n */ function defineConfig({ presets =[] , ...userConfig }) {\n // most user config values go first to have precendence over preset config\n // only `preflight` and `theme` are applied as last preset to override all presets\n let config = {\n darkMode: void 0,\n darkColor: void 0,\n preflight: false !== userConfig.preflight && [],\n theme: {},\n variants: asArray(userConfig.variants),\n rules: asArray(userConfig.rules),\n ignorelist: asArray(userConfig.ignorelist),\n hash: void 0,\n stringify: (property, value)=>property + ':' + value,\n finalize: []\n };\n for (let preset of asArray([\n ...presets,\n {\n darkMode: userConfig.darkMode,\n darkColor: userConfig.darkColor,\n preflight: false !== userConfig.preflight && asArray(userConfig.preflight),\n theme: userConfig.theme,\n hash: userConfig.hash,\n stringify: userConfig.stringify,\n finalize: userConfig.finalize\n }\n ])){\n let { preflight , darkMode =config.darkMode , darkColor =config.darkColor , theme , variants , rules , ignorelist , hash =config.hash , stringify =config.stringify , finalize } = 'function' == typeof preset ? preset(config) : preset;\n config = {\n // values defined by user or previous presets take precedence\n preflight: false !== config.preflight && false !== preflight && [\n ...config.preflight,\n ...asArray(preflight)\n ],\n darkMode,\n darkColor,\n theme: {\n ...config.theme,\n ...theme,\n extend: {\n ...config.theme.extend,\n ...theme?.extend\n }\n },\n variants: [\n ...config.variants,\n ...asArray(variants)\n ],\n rules: [\n ...config.rules,\n ...asArray(rules)\n ],\n ignorelist: [\n ...config.ignorelist,\n ...asArray(ignorelist)\n ],\n hash,\n stringify,\n finalize: [\n ...config.finalize,\n ...asArray(finalize)\n ]\n };\n }\n return config;\n}\nfunction find(value, list, cache, getResolver, context, isDark) {\n for (let item of list){\n let resolver = cache.get(item);\n resolver || cache.set(item, resolver = getResolver(item));\n let resolved = resolver(value, context, isDark);\n if (resolved) return resolved;\n }\n}\nfunction getVariantResolver(variant) {\n var resolve;\n return createResolve(variant[0], 'function' == typeof (resolve = variant[1]) ? resolve : ()=>resolve);\n}\nfunction getRuleResolver(rule) {\n var resolve, convert;\n return Array.isArray(rule) ? createResolve(rule[0], fromMatch(rule[1], rule[2])) : createResolve(rule, fromMatch(resolve, convert));\n}\nfunction createResolve(patterns, resolve) {\n return createRegExpExecutor(patterns, (value, condition, context, isDark)=>{\n let match = condition.exec(value);\n if (match) return(// MATCH.$_ = value\n match.$$ = value.slice(match[0].length), match.dark = isDark, resolve(match, context));\n });\n}\nfunction createRegExpExecutor(patterns, run) {\n let conditions = asArray(patterns).map(toCondition);\n return (value, context, isDark)=>{\n for (let condition of conditions){\n let result = run(value, condition, context, isDark);\n if (result) return result;\n }\n };\n}\nfunction toCondition(value) {\n // \"visible\" -> /^visible$/\n // \"(float)-(left|right|none)\" -> /^(float)-(left|right|none)$/\n // \"auto-rows-\" -> /^auto-rows-/\n // \"gap(-|$)\" -> /^gap(-|$)/\n return 'string' == typeof value ? RegExp('^' + value + (value.includes('$') || '-' == value.slice(-1) ? '' : '$')) : value;\n}\n/**\n * @group Runtime\n * @param config\n * @param sheet\n */ function twind(userConfig, sheet) {\n let config = defineConfig(userConfig), context = function({ theme , darkMode , darkColor =noop , variants , rules , hash: hash$1 , stringify , ignorelist , finalize }) {\n // Used to cache resolved rule values\n let variantCache = new Map(), // lazy created resolve functions\n variantResolvers = new Map(), // Used to cache resolved rule values\n ruleCache = new Map(), // lazy created resolve functions\n ruleResolvers = new Map(), ignored = createRegExpExecutor(ignorelist, (value, condition)=>condition.test(value));\n // add dark as last variant to allow user to override it\n // we can modify variants as it has been passed through defineConfig which already made a copy\n variants.push([\n 'dark',\n Array.isArray(darkMode) || 'class' == darkMode ? `${asArray(darkMode)[1] || '.dark'} &` : 'string' == typeof darkMode && 'media' != darkMode ? darkMode : // a custom selector\n '@media (prefers-color-scheme:dark)'\n ]);\n let h = 'function' == typeof hash$1 ? (value)=>hash$1(value, hash) : hash$1 ? hash : identity;\n h !== identity && finalize.push((rule)=>({\n ...rule,\n n: rule.n && h(rule.n),\n d: rule.d?.replace(/--(tw(?:-[\\w-]+)?)\\b/g, (_, property)=>'--' + h(property).replace('#', ''))\n }));\n let ctx = {\n theme: function({ extend ={} , ...base }) {\n let resolved = {}, resolveContext = {\n get colors () {\n return theme('colors');\n },\n theme,\n // Stub implementation as negated values are automatically infered and do _not_ need to be in the theme\n negative () {\n return {};\n },\n breakpoints (screens) {\n let breakpoints = {};\n for(let key in screens)'string' == typeof screens[key] && (breakpoints['screen-' + key] = screens[key]);\n return breakpoints;\n }\n };\n return theme;\n function theme(sectionKey, key, defaultValue, opacityValue) {\n if (sectionKey) {\n ({ 1: sectionKey , 2: opacityValue } = // eslint-disable-next-line no-sparse-arrays\n /^(\\S+?)(?:\\s*\\/\\s*([^/]+))?$/.exec(sectionKey) || [\n ,\n sectionKey\n ]);\n if (/[.[]/.test(sectionKey)) {\n let path = [];\n // dotted deep access: colors.gray.500 or spacing[2.5]\n sectionKey.replace(/\\[([^\\]]+)\\]|([^.[]+)/g, (_, $1, $2 = $1)=>path.push($2));\n sectionKey = path.shift();\n defaultValue = key;\n key = path.join('-');\n }\n let section = resolved[sectionKey] || // two-step deref to allow extend section to reference base section\n Object.assign(Object.assign(// Make sure to not get into recursive calls\n resolved[sectionKey] = {}, deref(base, sectionKey)), deref(extend, sectionKey));\n if (null == key) return section;\n key || (key = 'DEFAULT');\n let value = section[key] ?? key.split('-').reduce((obj, prop)=>obj?.[prop], section) ?? defaultValue;\n return opacityValue ? toColorValue(value, {\n opacityValue: resolveThemeFunction(opacityValue, theme)\n }) : value;\n }\n // Collect the whole theme\n let result = {};\n for (let section1 of [\n ...Object.keys(base),\n ...Object.keys(extend)\n ])result[section1] = theme(section1);\n return result;\n }\n function deref(source, section) {\n let value = source[section];\n return ('function' == typeof value && (value = value(resolveContext)), value && /color|fill|stroke/i.test(section)) ? function flattenColorPalette(colors, path = []) {\n let flattend = {};\n for(let key in colors){\n let value = colors[key], keyPath = [\n ...path,\n key\n ];\n flattend[keyPath.join('-')] = value;\n if ('DEFAULT' == key) {\n keyPath = path;\n flattend[path.join('-')] = value;\n }\n 'object' == typeof value && Object.assign(flattend, flattenColorPalette(value, keyPath));\n }\n return flattend;\n }(value) : value;\n }\n }(theme),\n e: escape,\n h,\n s (property, value) {\n return stringify(property, value, ctx);\n },\n d (section, key, color) {\n return darkColor(section, key, ctx, color);\n },\n v (value) {\n return variantCache.has(value) || variantCache.set(value, find(value, variants, variantResolvers, getVariantResolver, ctx) || '&:' + value), variantCache.get(value);\n },\n r (className, isDark) {\n let key = JSON.stringify([\n className,\n isDark\n ]);\n return ruleCache.has(key) || ruleCache.set(key, !ignored(className, ctx) && find(className, rules, ruleResolvers, getRuleResolver, ctx, isDark)), ruleCache.get(key);\n },\n f (rule) {\n return finalize.reduce((rule, p)=>p(rule, ctx), rule);\n }\n };\n return ctx;\n }(config), // Map of tokens to generated className\n cache = new Map(), // An array of precedence by index within the sheet\n // always sorted\n sortedPrecedences = [], // Cache for already inserted css rules\n // to prevent double insertions\n insertedRules = new Set();\n sheet.resume((className)=>cache.set(className, className), (cssText, rule)=>{\n sheet.insert(cssText, sortedPrecedences.length, rule);\n sortedPrecedences.push(rule);\n insertedRules.add(cssText);\n });\n function insert(rule) {\n let finalRule = context.f(rule), cssText = stringify$1(finalRule);\n // If not already inserted\n if (cssText && !insertedRules.has(cssText)) {\n // Mark rule as inserted\n insertedRules.add(cssText);\n // Find the correct position\n let index = sortedInsertionIndex(sortedPrecedences, rule);\n // Insert\n sheet.insert(cssText, index, rule);\n // Update sorted index\n sortedPrecedences.splice(index, 0, rule);\n }\n return finalRule.n;\n }\n return Object.defineProperties(function tw(tokens) {\n if (!cache.size) for (let preflight of asArray(config.preflight)){\n 'function' == typeof preflight && (preflight = preflight(context));\n preflight && ('string' == typeof preflight ? translateWith('', Layer.b, parse(preflight), context, Layer.b, [], false, true) : serialize(preflight, {}, context, Layer.b)).forEach(insert);\n }\n tokens = '' + tokens;\n let className = cache.get(tokens);\n if (!className) {\n let classNames = new Set();\n for (let rule of translate(parse(tokens), context))classNames.add(rule.c).add(insert(rule));\n className = [\n ...classNames\n ].filter(Boolean).join(' ');\n // Remember the generated class name\n cache.set(tokens, className).set(className, className);\n }\n return className;\n }, Object.getOwnPropertyDescriptors({\n get target () {\n return sheet.target;\n },\n theme: context.theme,\n config,\n snapshot () {\n let restoreSheet = sheet.snapshot(), insertedRules$ = new Set(insertedRules), cache$ = new Map(cache), sortedPrecedences$ = [\n ...sortedPrecedences\n ];\n return ()=>{\n restoreSheet();\n insertedRules = insertedRules$;\n cache = cache$;\n sortedPrecedences = sortedPrecedences$;\n };\n },\n clear () {\n sheet.clear();\n insertedRules = new Set();\n cache = new Map();\n sortedPrecedences = [];\n },\n destroy () {\n this.clear();\n sheet.destroy();\n }\n }));\n}\n/**\n * Determines if two class name strings contain the same classes.\n *\n * @param a first class names\n * @param b second class names\n * @returns are they different\n */ function changed(a, b) {\n return a != b && '' + a.split(' ').sort() != '' + b.split(' ').sort();\n}\n/**\n * @group Runtime\n * @param tw\n * @param target\n * @returns\n * @internal\n */ function mo(tw) {\n let observer = new MutationObserver(handleMutationRecords);\n return {\n observe (target) {\n observer.observe(target, {\n attributeFilter: [\n 'class'\n ],\n subtree: true,\n childList: true\n });\n // handle class attribute on target\n handleClassAttributeChange(target);\n // handle children of target\n handleMutationRecords([\n {\n target,\n type: ''\n }\n ]);\n },\n disconnect () {\n observer.disconnect();\n }\n };\n function handleMutationRecords(records) {\n for (let { type , target } of records)if ('a' == type[0]) /* attribute */ // class attribute has been changed\n handleClassAttributeChange(target);\n else /* childList */ // some nodes have been added — find all with a class attribute\n for (let el of target.querySelectorAll('[class]'))handleClassAttributeChange(el);\n // remove pending mutations — these are triggered by updating the class attributes\n observer.takeRecords();\n }\n // XXX maybe we need to handle all pending mutations\n // observer.takeRecords().forEach(handleMutation)\n function handleClassAttributeChange(target) {\n let className;\n // Not using target.classList.value (not supported in all browsers) or target.class (this is an SVGAnimatedString for svg)\n // safe guard access to getAttribute because ShadowRoot does not have attribute but child nodes\n let tokens = target.getAttribute?.('class');\n tokens && changed(tokens, className = tw(tokens)) && // Not using `target.className = ...` as that is read-only for SVGElements\n target.setAttribute('class', className);\n }\n}\n/**\n * @group Runtime\n * @param tw\n * @param target\n * @returns\n */ function observe(tw$1 = tw, target = 'undefined' != typeof document && document.documentElement) {\n if (target) {\n let observer = mo(tw$1);\n observer.observe(target);\n // monkey patch tw.destroy to disconnect this observer\n // eslint-disable-next-line @typescript-eslint/unbound-method\n let { destroy } = tw$1;\n tw$1.destroy = ()=>{\n observer.disconnect();\n destroy.call(tw$1);\n };\n }\n return tw$1;\n}\n/**\n * Simplified MutationRecord which allows us to pass an\n * ArrayLike (compatible with Array and NodeList) `addedNodes` and\n * omit other properties we are not interested in.\n */ function getStyleElement(selector) {\n let style = document.querySelector(selector || 'style[data-twind=\"\"]');\n if (!style || 'STYLE' != style.tagName) {\n style = document.createElement('style');\n document.head.prepend(style);\n }\n return style.dataset.twind = 'claimed', style;\n}\n/**\n * @group Sheets\n * @param element\n * @returns\n */ function cssom(element) {\n let target = element?.cssRules ? element : (element && 'string' != typeof element ? element : getStyleElement(element)).sheet;\n return {\n target,\n snapshot () {\n // collect current rules\n let rules = Array.from(target.cssRules, (rule)=>rule.cssText);\n return ()=>{\n // remove all existing rules\n this.clear();\n // add all snapshot rules back\n // eslint-disable-next-line @typescript-eslint/unbound-method\n rules.forEach(this.insert);\n };\n },\n clear () {\n // remove all added rules\n for(let index = target.cssRules.length; index--;)target.deleteRule(index);\n },\n destroy () {\n target.ownerNode?.remove();\n },\n insert (cssText, index) {\n try {\n // Insert\n target.insertRule(cssText, index);\n } catch (error) {\n // Empty rule to keep index valid — not using `*{}` as that would show up in all rules (DX)\n target.insertRule(':root{}', index);\n }\n },\n resume: noop\n };\n}\n/**\n * @group Sheets\n * @param element\n * @returns\n */ function dom(element) {\n let target = element && 'string' != typeof element ? element : getStyleElement(element);\n return {\n target,\n snapshot () {\n // collect current rules\n let rules = Array.from(target.childNodes, (node)=>node.textContent);\n return ()=>{\n // remove all existing rules\n this.clear();\n // add all snapshot rules back\n // eslint-disable-next-line @typescript-eslint/unbound-method\n rules.forEach(this.insert);\n };\n },\n clear () {\n target.textContent = '';\n },\n destroy () {\n target.remove();\n },\n insert (cssText, index) {\n target.insertBefore(document.createTextNode(cssText), target.childNodes[index] || null);\n },\n resume: noop\n };\n}\n/**\n * @group Sheets\n * @param includeResumeData\n * @returns\n */ function virtual(includeResumeData) {\n let target = [];\n return {\n target,\n snapshot () {\n // collect current rules\n let rules = [\n ...target\n ];\n return ()=>{\n // remove all existing rules and add all snapshot rules back\n target.splice(0, target.length, ...rules);\n };\n },\n clear () {\n target.length = 0;\n },\n destroy () {\n this.clear();\n },\n insert (css, index, rule) {\n target.splice(index, 0, includeResumeData ? `/*!${rule.p.toString(36)},${(2 * rule.o).toString(36)}${rule.n ? ',' + rule.n : ''}*/${css}` : css);\n },\n resume: noop\n };\n}\n/**\n * Returns a sheet useable in the current environment.\n *\n * @group Sheets\n * @param useDOMSheet usually something like `process.env.NODE_ENV != 'production'` or `import.meta.env.DEV` (default: browser={@link cssom}, server={@link virtual})\n * @param disableResume to not include or use resume data\n * @returns a sheet to use\n */ function getSheet(useDOMSheet, disableResume) {\n let sheet = 'undefined' == typeof document ? virtual(!disableResume) : useDOMSheet ? dom() : cssom();\n return disableResume || (sheet.resume = resume), sheet;\n}\n/**\n * @group Sheets\n * @param target\n * @returns\n */ function stringify(target) {\n // string[] | CSSStyleSheet | HTMLStyleElement\n return(// prefer the raw text content of a CSSStyleSheet as it may include the resume data\n (target.ownerNode || target).textContent || (target.cssRules ? Array.from(target.cssRules, (rule)=>rule.cssText) : asArray(target)).join(''));\n}\nfunction resume(addClassName, insert) {\n // hydration from SSR sheet\n let textContent = stringify(this.target), RE = /\\/\\*!([\\da-z]+),([\\da-z]+)(?:,(.+?))?\\*\\//g;\n // only if this is a hydratable sheet\n if (RE.test(textContent)) {\n var match;\n let // 3. parse SSR styles\n lastMatch;\n // RE has global flag — reset index to get the first match as well\n RE.lastIndex = 0;\n // 1. start with a fresh sheet\n this.clear();\n // 2. add all existing class attributes to the token/className cache\n if ('undefined' != typeof document) for (let el of document.querySelectorAll('[class]'))addClassName(el.getAttribute('class'));\n for(; match = RE.exec(textContent), lastMatch && insert(// grep the cssText from the previous match end up to this match start\n textContent.slice(lastMatch.index + lastMatch[0].length, match?.index), {\n p: parseInt(lastMatch[1], 36),\n o: parseInt(lastMatch[2], 36) / 2,\n n: lastMatch[3]\n }), lastMatch = match;);\n }\n}\n/* no-op */ /**\n * @group Runtime\n * @param install\n * @returns\n */ function auto(install) {\n // If we run in the browser we call install at latest when the body is inserted\n // This algorith works well for _normal_ scripts (``)\n // but not for modules because those are executed __after__ the DOM is ready\n // and we would have FOUC\n if ('undefined' != typeof document && document.currentScript) {\n let cancelAutoInstall = ()=>observer.disconnect(), observer = new MutationObserver((mutationsList)=>{\n for (let { target } of mutationsList)// If we reach the body we immediately run the install to prevent FOUC\n if (target === document.body) {\n install();\n return cancelAutoInstall();\n }\n });\n return observer.observe(document.documentElement, {\n childList: true,\n subtree: true\n }), cancelAutoInstall;\n }\n return noop;\n}\n/**\n * A proxy to the currently active Twind instance.\n * @group Style Injectors\n */ let tw = /* #__PURE__ */ new Proxy(// just exposing the active as tw should work with most bundlers\n// as ES module export can be re-assigned BUT some bundlers to not honor this\n// -> using a delegation proxy here\nnoop, {\n apply (_target, _thisArg, args) {\n return active(args[0]);\n },\n get (target, property) {\n let value = active[property];\n return 'function' == typeof value ? function() {\n // eslint-disable-next-line prefer-rest-params\n return value.apply(active, arguments);\n } : value;\n }\n});\n/**\n * Manages a single Twind instance — works in browser, Node.js, Deno, workers...\n *\n * @group Runtime\n * @param config\n * @param sheet\n * @param target\n * @returns\n */ function setup(config = {}, sheet = getSheet, target) {\n return active?.destroy(), active = observe(twind(config, 'function' == typeof sheet ? sheet() : sheet), target);\n}\n/**\n * Injects styles into the global scope and is useful for applications such as gloabl styles, CSS resets or font faces.\n *\n * It **does not** return a class name, but adds the styles within the base layer to the stylesheet directly.\n *\n * @group Style Injectors\n */ let injectGlobal = function(strings, ...interpolations) {\n ('function' == typeof this ? this : tw)(css({\n '@layer base': astish(strings, interpolations)\n }));\n};\n/**\n * @group Runtime\n * @param config\n * @param isProduction\n */ function install(config, isProduction = true) {\n let config$ = defineConfig(config);\n return setup({\n ...config$,\n // in production use short hashed class names\n hash: config$.hash ?? isProduction\n }, ()=>getSheet(!isProduction));\n}\n/**\n * **Note**: The styles will be injected on first use.\n *\n * @group Style Injectors\n */ let keyframes = /* #__PURE__ */ function bind(thisArg) {\n return new Proxy(function keyframes(strings, ...interpolations) {\n return keyframes$(thisArg, '', strings, interpolations);\n }, {\n get (target, name) {\n return 'bind' === name ? bind : name in target ? target[name] : function namedKeyframes(strings, ...interpolations) {\n return keyframes$(thisArg, name, strings, interpolations);\n };\n }\n });\n}();\nfunction keyframes$(thisArg, name, strings, interpolations) {\n // lazy inject keyframes\n return {\n toString () {\n let ast = astish(strings, interpolations), keyframeName = escape(name + hash(JSON.stringify([\n name,\n ast\n ])));\n return(// lazy access tw\n ('function' == typeof thisArg ? thisArg : tw)(css({\n [`@keyframes ${keyframeName}`]: astish(strings, interpolations)\n })), keyframeName);\n }\n };\n}\n/**\n * Options for {@link inline}\n */ /**\n * {@link Twind} instance to use (default: {@link @twind/core.tw})\n */ /**\n * Allows to minify the resulting CSS.\n */ /**\n * Called to minify the CSS.\n *\n * @param css the CSS to minify\n * @param html the HTML that will be used — allows to only include above-the-fold CSS\n * @return the resulting CSS\n */ /**\n * Used for static HTML processing (usually to provide SSR support for your javascript-powered web apps)\n *\n * 1. parse the markup and process element classes with the provided Twind instance\n * 2. update the class attributes _if_ necessary\n * 3. inject a style element with the CSS as last element into the head\n * 4. return the HTML string with the final element classes\n *\n * ```js\n * import { inline } from '@twind/core'\n *\n * function render() {\n * return inline(renderApp())\n * }\n * ```\n *\n * Minify CSS with [@parcel/css](https://www.npmjs.com/package/@parcel/css):\n *\n * ```js\n * import { inline } from '@twind/core'\n * import { transform } from '@parcel/css'\n *\n * function render() {\n * return inline(renderApp(), { minify: (css) => transform({ filename: 'twind.css', code: Buffer.from(css), minify: true }) })\n * }\n * ```\n *\n * You can provide your own Twind instance:\n *\n * ```js\n * import { inline } from '@twind/core'\n * import { tw } from './custom/twind/instance'\n *\n * function render() {\n * return inline(renderApp(), { tw })\n * }\n * ```\n *\n * @group Static Extraction\n * @param markup HTML to process\n * @param options to customize the processing\n * @returns the resulting HTML\n */ function inline(markup, options = {}) {\n let { tw: tw$1 = tw , minify =identity } = 'function' == typeof options ? {\n tw: options\n } : options, { html , css } = extract(markup, tw$1);\n // inject as last element into the head\n return html.replace('', ``);\n}\n/**\n * Result of {@link extract}\n */ /** The possibly modified HTML */ /** The generated CSS */ /**\n * Used for static HTML processing (usually to provide SSR support for your javascript-powered web apps)\n *\n * **Note**: Consider using {@link inline} instead.\n *\n * 1. parse the markup and process element classes with the provided Twind instance\n * 2. update the class attributes _if_ necessary\n * 3. return the HTML string with the final element classes\n *\n * ```js\n * import { extract } from '@twind/core'\n *\n * function render() {\n * const { html, css } = extract(renderApp())\n *\n * // inject as last element into the head\n * return html.replace('', ``)\n * }\n * ```\n *\n * You can provide your own Twind instance:\n *\n * ```js\n * import { extract } from '@twind/core'\n * import { tw } from './custom/twind/instance'\n *\n * function render() {\n * const { html, css } = extract(renderApp(), tw)\n *\n * // inject as last element into the head\n * return html.replace('', ``)\n * }\n * ```\n *\n * @group Static Extraction\n * @param markup HTML to process\n * @param tw a {@link Twind} instance (default: twind managed tw)\n * @returns the possibly modified html and css\n */ function extract(html, tw$1 = tw) {\n let restore = tw$1.snapshot(), result = {\n html: consume(html, tw$1),\n css: stringify(tw$1.target)\n };\n return restore(), result;\n}\n/**\n * Used for static HTML processing (usually to provide SSR support for your javascript-powered web apps)\n *\n * **Note**: Consider using {@link inline} or {@link extract} instead.\n *\n * 1. parse the markup and process element classes with the provided Twind instance\n * 2. update the class attributes _if_ necessary\n * 3. return the HTML string with the final element classes\n *\n * ```js\n * import { consume, stringify, tw } from '@twind/core'\n *\n * function render() {\n * const html = renderApp()\n *\n * // remember global classes\n * const restore = tw.snapshot()\n *\n * // generated markup\n * const markup = consume(html)\n *\n * // create CSS\n * const css = stringify(tw.target)\n *\n * // restore global classes\n * restore()\n *\n * // inject as last element into the head\n * return markup.replace('', ``)\n * }\n * ```\n *\n * You can provide your own Twind instance:\n *\n * ```js\n * import { consume, stringify } from '@twind/core'\n * import { tw } from './custom/twind/instance'\n *\n * function render() {\n * const html = renderApp()\n *\n * // remember global classes\n * const restore = snapshot(tw.target)\n *\n * // generated markup\n * const markup = consume(html)\n *\n * // restore global classes\n * restore()\n *\n * // create CSS\n * const css = stringify(tw.target)\n *\n * // inject as last element into the head\n * return markup.replace('', ``)\n * }\n * ```\n *\n * @group Static Extraction\n * @param markup HTML to process\n * @param tw a {@link Twind} instance\n * @returns possibly modified HTML\n */ function consume(markup, tw$1 = tw) {\n let result = '', lastChunkStart = 0;\n return !function(markup, onClass) {\n let mode = 1, startIndex = 0, quote = '', attributeName = '', commit = (currentIndex)=>{\n 5 == mode && 'class' == attributeName && false === onClass(startIndex, currentIndex, quote) && (markup = '');\n };\n for(let position = 0; position < markup.length; position++){\n let char = markup[position];\n if (1 == mode) '<' == char && (mode = '!--' == markup.substr(position + 1, 3) ? 4 : 3);\n else if (4 == mode) '>' == char && '--' == markup.slice(position - 2, position) && (mode = 1);\n else if (quote) {\n if (char == quote && '\\\\' != markup[position - 1]) {\n commit(position);\n mode = 2;\n quote = '';\n }\n } else if ('\"' == char || \"'\" == char) {\n quote = char;\n startIndex += 1;\n } else if ('>' == char) {\n commit(position);\n mode = 1;\n } else if (mode) {\n // MODE_SLASH\n // Ignore everything until the tag ends\n if ('=' == char) {\n attributeName = markup.slice(startIndex, position);\n mode = 5;\n startIndex = position + 1;\n } else if ('/' == char && (mode < 5 || '>' == markup[position + 1])) {\n commit(position);\n mode = // For now we are using a simple parser adapted from htm (https://github.com/developit/htm/blob/master/src/build.mjs)\n // If we find any issues we can switch to something more sophisticated like\n // - https://github.com/acrazing/html5parser\n // - https://github.com/fb55/htmlparser2\n 0;\n } else if (/\\s/.test(char)) {\n // \n commit(position);\n mode = 2;\n startIndex = position + 1;\n }\n }\n }\n }(markup, (startIndex, endIndex, quote)=>{\n var quote1;\n let value = markup.slice(startIndex, endIndex), className = tw$1(// const value = markup.slice(startIndex, endIndex)\n // Lets handle some special react cases:\n // * arbitrary values for `content-`\n // \n // \n //\n // * self-referenced groups\n // \n //\n // If a class name contains `'`, `\"`, or `&` those will be replaced with HTML entities\n // To fix this we replace those for depending on the actual symbol that is being used\n // As an alternative we could always escape class names direcly in twind like react does\n // but this works for now\n ('\"' == (quote1 = quote) ? // `'` -> ' ' '\n value.replace(/(=|\\[)(?:'|'|')|(?:'|'|')(])/g, \"$1'$2\") : \"'\" == quote1 ? // `\"` -> " " "\n value.replace(/(=|\\[)(?:"|"|")|(?:"|"|")(])/g, '$1\"$2') : value).replace(/(&|&|&)/g, '&'));\n // We only need to shift things around if we need to actually change the markup\n if (changed(value, className)) {\n // We've hit another mutation boundary\n // Add quote if necessary\n quote = quote ? '' : '\"';\n result += markup.slice(lastChunkStart, startIndex) + quote + className + quote;\n lastChunkStart = endIndex;\n }\n }), // Combine the current result with the tail-end of the input\n result + markup.slice(lastChunkStart, markup.length);\n}\n// Based on https://github.com/modulz/stitches\n// No support for thunks yet — these may use props that are not in the generated class name\n// and may therefore override each other\n/**\n * Allows to extract the supported properties of a style function.\n *\n * Here is an example for `react`\n * ```js\n * import { HTMLAttributes } from \"react\";\n * import { style, PropsOf } from \"@twind/core\";\n * const button = style({ ... })\n * type ButtonProps = PropsOf\n * export const Button = (props: ButtonProps & HTMLAttributes) => {\n * return