Socket
Socket
Sign inDemoInstall

twind

Package Overview
Dependencies
Maintainers
2
Versions
159
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

twind - npm Package Compare versions

Comparing version 1.0.0-next.32 to 1.0.0-next.33

53

CHANGELOG.md
# twind
## 1.0.0-next.33
### Patch Changes
- server side generated styles are resumed in the browser ([`b223e5bb`](https://github.com/tw-in-js/twind/commit/b223e5bb9f701db03c30e14d3f7b84b705d43ef0))
Server side generated styles now include resume data that allows twind in the browser to know which styles are already included in the stylesheet. This change significantly reduces the time to interactive, supports hashed classes, and prevents missing classes that have been generated by `css` or `style` and are not yet registered.
Resuming styles is enabled by default for `setup` (_Shim Mode_).
```js
import { setup } from 'twind'
import config from './twind.config'
// styles are resumed!
setup(config)
```
If you want to used the `dom` sheet during development or if you currently pass a sheet as the second argument, please switch to the new `getSheet(useDOMSheet?: boolean, disableResume?: boolean)` function. This function returns a `Sheet` for the current environment — `virtual` on server, either `dom` or `cssom` in browsers.
```js
import { setup, getSheet } from 'twind'
import config from './twind.config'
setup(config, getSheet(process.env.NODE_ENV != 'production'))
```
If you want to use resuming styles with _Library Mode_ you need to adjust your code to use `getSheet`:
```js
import { twind, getSheet } from 'twind'
import config from './twind.config'
export const tw = twind(config, getSheet(process.env.NODE_ENV != 'production'))
```
To generate server side styles use either `inline` or `extract`:
```js
import { inline, extract } from 'twind'
// 1. using inline
const html = inline(renderApp())
// 2. using extract
const { html, css } = extract(renderApp())
// add the css to the head using <style data-twind>{css}</style>
```
The signature of `virtual(includeResumeData?: boolean)` has changed as well. This is technically a breaking change, but I doubt anybody has used the previous possible `virtual([])`.
* expose the used config via `tw.config` ([`92037344`](https://github.com/tw-in-js/twind/commit/92037344787e28454ffa688b969244f261d28306))
## 1.0.0-next.32

@@ -4,0 +57,0 @@

2

package.json
{
"name": "twind",
"version": "1.0.0-next.32",
"version": "1.0.0-next.33",
"description": "The core engine without any presets.",

@@ -5,0 +5,0 @@ "type": "module",

@@ -45,3 +45,4 @@ import * as CSS$1 from 'csstype';

readonly target: Target;
theme: ThemeFunction<ExtractUserTheme<Theme>>;
readonly theme: ThemeFunction<ExtractUserTheme<Theme>>;
readonly config: TwindConfig<Theme>;
/** Clears all CSS rules from the sheet. */

@@ -106,8 +107,16 @@ clear(): void;

};
interface SheetRule {
/** The calculated precedence taking all variants into account. */
p: number;
o: number;
/** The name to use for `&` expansion in selectors. Maybe empty for at-rules like `@import`, `@font-face`, `@media`, ... */
n?: string | null;
}
interface Sheet<Target = unknown> {
readonly target: Target;
insert(css: string, index: number, rule: TwindRule): void;
insert(css: string, index: number, rule: SheetRule): void;
/** Clears all CSS rules from the sheet. */
clear(): void;
destroy(): void;
resume(addClassName: (className: string) => void, insert: (rule: SheetRule, cssText: string) => void): void;
}

@@ -657,10 +666,13 @@ declare type StringifyDeclaration<Theme extends BaseTheme = BaseTheme> = (property: string, value: string, context: Context<Theme>) => string;

declare global {
interface Window {
tw?: HTMLStyleElement;
}
}
declare function cssom(target?: CSSStyleSheet): Sheet<CSSStyleSheet>;
declare function dom(target?: HTMLStyleElement): Sheet<HTMLStyleElement>;
declare function virtual(target?: string[]): Sheet<string[]>;
declare function cssom(element?: CSSStyleSheet | Element | null | false): Sheet<CSSStyleSheet>;
declare function dom(element?: Element | null | false): Sheet<HTMLStyleElement>;
declare function virtual(includeResumeData?: boolean): Sheet<string[]>;
/**
* Returns a sheet useable in the current environment.
*
* @param useDOMSheet usually something like `process.env.NODE_ENV != 'production'` (default: browser={@link cssom}, server={@link virtual})
* @param disableResume to not include or use resume data
* @returns a sheet to use
*/
declare function getSheet(useDOMSheet?: boolean, disableResume?: boolean): Sheet<string[] | HTMLStyleElement | CSSStyleSheet>;
declare function stringify(target: unknown): string;

@@ -675,3 +687,3 @@

export { BaseProperties, BaseTheme, CSSBase, CSSFontFace, CSSNested, CSSObject, CSSProperties, CSSValue, Class, ClassObject, ColorFromThemeOptions, ColorFromThemeValue, ColorFunction, ColorFunctionOptions, ColorRecord, ColorValue, Context, CustomProperties, DarkModeConfig, DefaultVariants, ExtractResult, ExtractThemes, Falsey, FilterByThemeValue, HashFunction, InlineMinify, InlineOptions, KebabCase, Keyframes, KeyframesFunction, MatchConverter, MatchResult, MaybeArray, MaybeColorValue, MaybeThunk, MorphVariant, Nested, NestedFunction, PartialTheme, Preflight, PreflightThunk, Preset, PresetThunk, PropsOf, Rule, RuleResolver, RuleResult, ScreenValue, Sheet, StrictMorphVariant, StringLike, StringifyDeclaration, Style, StyleConfig, StyleFunction, StyleProps, StyleToken, StyleTokenValue, ThemeConfig, ThemeFunction, ThemeMatchConverter, ThemeMatchResult, ThemeRuleResolver, ThemeSection, ThemeSectionResolver, ThemeSectionResolverContext, ThemeValue, Twind, TwindConfig, TwindPresetConfig, TwindRule, TwindUserConfig, TypedAtRules, Variant, VariantResolver, VariantResult, VariantsProps, When, apply, arbitrary, asArray, auto, colorFromTheme, consume, css, cssom, cx, defineConfig, dom, escape, extract, fromTheme, hash, identity, injectGlobal, inline, keyframes, mql, noop, observe, setup, shortcut, stringify, style, toColorValue, tw, twind, tx, virtual };
export { BaseProperties, BaseTheme, CSSBase, CSSFontFace, CSSNested, CSSObject, CSSProperties, CSSValue, Class, ClassObject, ColorFromThemeOptions, ColorFromThemeValue, ColorFunction, ColorFunctionOptions, ColorRecord, ColorValue, Context, CustomProperties, DarkModeConfig, DefaultVariants, ExtractResult, ExtractThemes, Falsey, FilterByThemeValue, HashFunction, InlineMinify, InlineOptions, KebabCase, Keyframes, KeyframesFunction, MatchConverter, MatchResult, MaybeArray, MaybeColorValue, MaybeThunk, MorphVariant, Nested, NestedFunction, PartialTheme, Preflight, PreflightThunk, Preset, PresetThunk, PropsOf, Rule, RuleResolver, RuleResult, ScreenValue, Sheet, SheetRule, StrictMorphVariant, StringLike, StringifyDeclaration, Style, StyleConfig, StyleFunction, StyleProps, StyleToken, StyleTokenValue, ThemeConfig, ThemeFunction, ThemeMatchConverter, ThemeMatchResult, ThemeRuleResolver, ThemeSection, ThemeSectionResolver, ThemeSectionResolverContext, ThemeValue, Twind, TwindConfig, TwindPresetConfig, TwindRule, TwindUserConfig, TypedAtRules, Variant, VariantResolver, VariantResult, VariantsProps, When, apply, arbitrary, asArray, auto, colorFromTheme, consume, css, cssom, cx, defineConfig, dom, escape, extract, fromTheme, getSheet, hash, identity, injectGlobal, inline, keyframes, mql, noop, observe, setup, shortcut, stringify, style, toColorValue, tw, twind, tx, virtual };
//# sourceMappingURL=twind.d.ts.map

@@ -1,1 +0,1 @@

const twind=function(a){"use strict";function b(a,b){return Math.round(parseInt(a,16)*b)}function c(a,c={}){if("function"==typeof a)return a(c);const{opacityValue:d="1",opacityVariable:e}=c,f=e?`var(${e})`:d;if("1"==f)return a;if("0"==f)return"#0000";if("#"==a[0]&&(4==a.length||7==a.length)){const g=(a.length-1)/3,h=[17,1,0.062272][g-1];return`rgba(${[b(a.substr(1,g),h),b(a.substr(1+g,g),h),b(a.substr(1+2*g,g),h),f,]})`}return a}function d(a,b){return a!=b&&""+a.split(" ").sort()!=""+b.split(" ").sort()}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{},d=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(d=d.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))),d.forEach(function(b){e(a,b,c[b])})}return a}function g(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],b.indexOf(c)>=0||(e[c]=a[c]);return e}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(b.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}const h="undefined"!=typeof CSS&&CSS.escape||(a=>a.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function i(a){for(var b=9,c=a.length;c--;)b=Math.imul(b^a.charCodeAt(c),1597334677);return"#"+((b^b>>>9)>>>0).toString(36)}function j(a,b="@media "){return b+k(a).map(a=>("string"==typeof a&&(a={min:a}),a.raw||Object.keys(a).map(b=>`(${b}-width:${a[b]})`).join(" and "))).join(",")}function k(a=[]){return Array.isArray(a)?a:null==a?[]:[a]}function l(a){return a}function m(){}function n(a){return[...a.v,(a.i?"!":"")+a.n].join(":")}const o={d:0,b:134217728,c:268435456,s:671088640,u:805306368,o:939524096};function p(a,b){return a& ~o.o|b}function q(a){var b;return(null===(b=a.match(/[-=:;]/g))|| void 0===b?void 0:b.length)||0}function r(a){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(a)?+RegExp.$1/(RegExp.$2?15:1)/10:0,15)<<22|Math.min(q(a),15)<<18}const s=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire",];function t(a){return 1<< ~(/:([a-z-]+)/.test(a)&& ~s.indexOf(RegExp.$1.slice(2,7))|| -18)}function u(a){return"-"==a[0]?0:q(a)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7}$)|([fl].{5}l|g.{8}$|pl))/.test(a)?+!!RegExp.$1||-!!RegExp.$2:0)+1}function v({n:a,i:b,v:c=[]},d,e,f){for(const g of(a&&(a=n({n:a,i:b,v:c})),f=[...k(f)],c)){const h=d.theme("screens",g),i=h&&j(h)||d.v(g);f.push(i),e|=h?67108864|r(i):"dark"==g?1073741824:"@"==i[0]?r(i):t(i)}return{n:a,p:e,r:f,i:b}}const w=new Intl.Collator("en",{numeric:!0});function x(a,b){for(var c=0,d=a.length;c<d;){const e=d+c>>1;0>=y(a[e],b)?c=e+1:d=e}return d}function y(a,b){const c=a.p&o.o;return c==(b.p&o.o)&&(c==o.b||c==o.o)?0:a.p-b.p||a.o-b.o||w.compare(a.n,b.n)}function z(a){if(a.d){const b=[],c=A(a.r.reduce((a,c)=>"@"==c[0]?(b.push(c),a):c?C(a,c):a,"&"),b=>B(b,a.n?"."+h(a.n):""));return c&&b.push(c.replace(/:merge\((.+?)\)/g,"$1")),b.reduceRight((a,b)=>b+"{"+a+"}",a.d)}}function A(a,b){return a.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(a,c,d)=>b(c)+d)}function B(a,b){return a.replace(/&/g,b)}function C(a,b){return A(a,a=>A(b,b=>{const c=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(b);if(c){const d=a.indexOf(c[1]);return~d?a.slice(0,d)+c[0]+a.slice(d+c[1].length):B(a,b)}return B(b,a)}))}function D(a,b=[]){const c={};for(const d in a){const e=a[d],f="DEFAULT"==d?b:[...b,d];"object"==typeof e&&Object.assign(c,D(e,f)),c[f.join("-")]=e,"DEFAULT"==d&&(c[[...b,d].join("-")]=e)}return c}function E(a,b,c,d,e){for(const f of b){let g=c.get(f);g||c.set(f,g=d(f));const h=g(a,e);if(h)return h}}function F(a){return H(a[0],a[1])}function G(a){return Array.isArray(a)?I(a[0],a[1],a[2]):I(a)}function H(a,b){return K(a,"function"==typeof b?b:()=>b)}function I(a,b,c){return K(a,b?"function"==typeof b?b:"string"==typeof b&&/^[\w-]+$/.test(b)?(a,d)=>({[b]:c?c(a,d):J(a.input,a.slice(1).find(Boolean)||a.$$||a.input)}):()=>b:a=>({[a[1]]:J(a.input,a.slice(2).find(Boolean)||a.$$||a.input)}))}function J(a,b){return"-"==a[0]?`calc(${b} * -1)`:b}function K(a,b){return L(a,(a,c,d)=>{const e=c.exec(a);if(e)return e.$$=a.slice(e[0].length),b(e,d)})}function L(a,b){const c=k(a).map(M);return(a,d)=>{for(const e of c){const f=b(a,e,d);if(f)return f}}}function M(a){return"string"==typeof a?new RegExp("^"+a+(a.includes("$")||"-"==a.slice(-1)?"":"$")):a}const N=new Map();function O(a,b){return N.set(a,b),a}function P(a,b,c,d){return O(a,(a,e)=>{const{n:f,p:g,r:h,i:i}=v(a,e,b);return c&&aa(f,b,c,e,g,h,i,d)})}function Q(a,b=","){return a.map(n).join(b)}function R(a,b){if("("!=a[a.length-1]){const c=[];let d=!1,e=!1,f="";for(let g of a)if(!("("==g||/[~@]$/.test(g))){if("!"==g[0]&&(g=g.slice(1),d=!d),g.endsWith(":")){c["dark:"==g?"unshift":"push"](g.slice(0,-1));continue}"-"==g[0]&&(g=g.slice(1),e=!e),g.endsWith("-")&&(g=g.slice(0,-1)),g&&"&"!=g&&(f+=(f&&"-")+g)}f&&(e&&(f="-"+f),b[0].push({n:f,v:c.filter(S),i:d}))}}function S(a,b,c){return c.indexOf(a)==b}function T(a){return a.replace(/\/\*[^]*?\*\/|\/\/[^]*?$|\s\s+|\n/gm," ")}const U=new Map();function V(a){let b=U.get(a);if(!b){a=T(a);const c=[],d=[[]];let e=0,f=0,g=0;const h=(b,f=0)=>{e!=g&&(c.push(a.slice(e,g+f)),b&&R(c,d)),e=g+1};for(;g<a.length;g++){const j=a[g];if(f)"\\"!=a[g-1]&&(f+=+("["==j)||-("]"==j));else if("["==j)f+=1;else if("("==j)h(),c.push(j);else if(":"==j)":"!=a[g+1]&&h(!1,1);else if(/[\s,)]/.test(j)){h(!0);let k=c.lastIndexOf("(");if(")"==j){const l=c[k-1];if(/[~@]$/.test(l)){const m=d.shift();c.length=k,R([...c,"#"],d);const{v:n}=d[0].pop();for(const p of m)p.v.splice(+("dark"==p.v[0])- +("dark"==n[0]),n.length);R([...c,P(l.length>1?l.slice(0,-1)+i(JSON.stringify([l,m])):l+"("+Q(m)+")",o.s,m,/@$/.test(l)),],d)}k=c.lastIndexOf("(",k-1)}c.length=k+1}else/[~@]/.test(j)&&"("==a[g+1]&&d.unshift([])}h(!0),U.set(a,b=d[0])}return b}function W(a,b,c,d,e=[]){return X(a,v(b,c,d,e),c)}function X(a,{n:b,p:c,r:d=[],i:e},f){const g=[];let h="",l=0,m=0;for(let n in a||{}){const q=a[n];if("@"==n[0]){if(!q)continue;if("a"==n[1]){g.push(...aa(b,c,V(q),f,c,d,e,!0));continue}if("l"==n[1]){for(const s of k(q))g.push(...X(s,{n:b,p:p(c,o[n[7]]),r:d,i:e},f));continue}if("i"==n[1]){g.push({p:-1,o:0,r:[],d:k(q).filter(Boolean).map(a=>n+" "+a).join(";")});continue}if("k"==n[1]||"f"==n[1]){g.push({p:o.d,o:0,r:[n],d:X(q,{p:o.d},f).map(z).join("")});continue}}if("object"!=typeof q||Array.isArray(q))"label"==n&&q?b=q+i(JSON.stringify([c,e,a])):(q||0===q)&&(m+=1,l=Math.max(l,u(n=n.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()))),h+=(h?";":"")+k(q).map(a=>f.s(n,Y(""+a,f)+(e?" !important":""))).join(";"));else if("@"==n[0]||n.includes("&")){let t=c;"@"==n[0]&&(t|=r(n=n.replace(/\bscreen\(([^)]+)\)/g,(a,b)=>{const c=f.theme("screens",b);return c?(t|=67108864,j(c,"")):a}))),g.push(...X(q,{n:b,p:t,r:[...d,n],i:e},f))}else g.push(...X(q,{p:c,r:[n]},f))}return g.unshift({n:b&&f.h(b),p:c,o:Math.max(0,15-m)+1.5*Math.min(l||15,15),r:d,d:h}),g.sort(y)}function Y(a,b){return a.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(a,c,d,e,f)=>b.theme(d,f))}function Z(a,b){const c=[];let d;for(const e of a)e.d?(null==d?void 0:d.p)==e.p&&""+d.r==""+e.r?(d.c=[d.c,e.c].filter(Boolean).join(" "),d.d=[d.d,e.d].filter(Boolean).join(";")):c.push(d=f({},e,{n:e.n&&b})):c.push(f({},e,{n:e.n&&b}));return c}function $(a,b,c=o.u,d,e){const f=[];for(const g of a)for(const h of _(g,b,c,d,e))f.splice(x(f,h),0,h);return f}function _(a,b,c,d,e){var g;a=f({},a,{i:a.i||e});const h=function(a,b){const c=N.get(a.n);return c?c(a,b):b.r(a.n)}(a,b);return h?"string"==typeof h?({r:d,p:c}=v(a,b,c,d),Z($(V(h),b,c,d,a.i),a.n)):Array.isArray(h)?h.map(a=>f({o:0},a,{r:[...k(d),...k(a.r)],p:p(c,null!==(g=a.p)&& void 0!==g?g:c)})):W(h,a,b,c,d):[{c:n(a),p:0,o:0,r:[]}]}function aa(a,b,c,d,e,g,h,i){return Z((i?c.flatMap(a=>$([a],d,e,g,h)):$(c,d,e,g,h)).map(a=>a.p&o.o&&(a.n||b==o.b)?f({},a,{p:p(a.p,b),o:0}):a),a)}function ba(a){var{presets:b=[]}=a,c=g(a,["presets"]);let d={preflight:!1!==c.preflight&&[],darkMode:void 0,theme:{},variants:k(c.variants),rules:k(c.rules),ignorelist:k(c.ignorelist),hash:c.hash,stringify:c.stringify||ca};for(const e of k([...b,{darkMode:c.darkMode,preflight:!1!==c.preflight&&k(c.preflight),theme:c.theme},])){const{preflight:h,darkMode:i=d.darkMode,theme:j,variants:l,rules:m,hash:n=d.hash,ignorelist:o,stringify:p=d.stringify}="function"==typeof e?e(d):e;d={preflight:!1!==d.preflight&& !1!==h&&[...d.preflight,...k(h)],darkMode:i,theme:f({},d.theme,j,{extend:f({},d.theme.extend,null==j?void 0:j.extend)}),variants:[...d.variants,...k(l)],rules:[...d.rules,...k(m)],ignorelist:[...d.ignorelist,...k(o)],hash:n,stringify:p}}return d}function ca(a,b){return a+":"+b}function da(a,b){const c=ba(a),d=function({theme:a,darkMode:b,variants:c,rules:d,hash:e,stringify:f,ignorelist:j}){const k=new Map(),m=new Map(),n=new Map(),o=new Map(),p=L(j,(a,b)=>b.test(a));return c.push(["dark","class"==b?".dark &":"string"==typeof b&&"media"!=b?b:"@media (prefers-color-scheme:dark)",]),{theme:(function(a){var{extend:b={}}=a,c=g(a,["extend"]);const d={},e={colors:f("colors"),theme:f,negative(){return{}},breakpoints(a){const b={};for(const c in a)"string"==typeof a[c]&&(b["screen-"+c]=a[c]);return b}};function f(a,e,g){if(a){var i;if(/[.[]/.test(a)){const j=[];a.replace(/\[([^\]]+)\]|([^.[]+)/g,(a,b,c=b)=>j.push(c)),a=j.shift(),g=e,e=j.join("-")}const k=d[a]||Object.assign(Object.assign(d[a]={},h(c,a)),h(b,a));return null==e?k:null!==(i=k[e||"DEFAULT"])&& void 0!==i?i:g}const l={};for(const m in c)l[m]=f(m);return l}function h(a,b){let c=a[b];return("function"==typeof c&&(c=c(e)),c&&/color/i.test(b))?D(c):c}return f})(a),e:h,h:"function"==typeof e?a=>e(a,i):e?i:l,s(a,b){return f(a,b,this)},v(a){return k.has(a)||k.set(a,E(a,c,m,F,this)||"&:"+a),k.get(a)},r(a){return n.has(a)||n.set(a,!p(a,this)&&E(a,d,o,G,this)),n.get(a)}}}(c),e=new Map(),j=[],m=new Set();function n(a){a=f({},a,{n:a.n&&d.h(a.n)});const c=z(a);if(c&&!m.has(c)){m.add(c);const e=x(j,a);b.insert(c,e,a),j.splice(e,0,a)}return a.n}return Object.defineProperties(function(a){if(!e.size)for(let b of k(c.preflight))"function"==typeof b&&(b=b(d)),b&&("string"==typeof b?aa("",o.b,V(b),d,o.b,[],!1,!0):W(b,{},d,o.b)).forEach(n);let f=e.get(a);if(!f){const g=new Set();for(const h of $(V(a),d))g.add(h.c).add(n(h));f=[...g].filter(Boolean).join(" "),e.set(a,f).set(f,f)}return f},Object.getOwnPropertyDescriptors({get target(){return b.target},theme:d.theme,clear(){b.clear(),m.clear(),e.clear(),j.length=0},destroy(){this.clear(),b.destroy()}}))}function ea(a=ja,b=document.documentElement){if(!b)return a;const c=new MutationObserver(f);c.observe(b,{attributeFilter:["class"],subtree:!0,childList:!0}),g(b),f([{target:b,type:""}]);const{destroy:e}=a;function f(a){for(const{type:b,target:d}of a)"a"==b[0]?g(d):d.querySelectorAll("[class]").forEach(g);c.takeRecords()}function g(b){const c=b.getAttribute("class");let e;c&&d(c,e=a(c))&&b.setAttribute("class",e)}return a.destroy=()=>{c.disconnect(),e.call(a)},a}let fa;function ga(a=document.querySelector("style[data-twind]")||document.head.lastChild){return a.parentNode.insertBefore(((fa=document.createElement("style")).dataset.twind="",fa),a.nextSibling)}function ha(a=ga().sheet){return{target:a,clear(){for(let b=a.cssRules.length;b--;)a.deleteRule(b)},destroy(){var b;null===(b=a.ownerNode)|| void 0===b||b.remove()},insert(b,c){try{a.insertRule(b,c)}catch(d){a.insertRule(":root{}",c),/:-[mwo]/.test(b)||console.warn(d,b)}}}}function ia(a){return a.innerHTML||(a.cssRules?Array.from(a.cssRules,a=>a.cssText):k(a)).join("")}const ja=Object.defineProperties(function(...a){return ka(...a)},Object.getOwnPropertyDescriptors({get target(){return ka.target},theme(...a){return ka.theme(...a)},clear(){return ka.clear()},destroy(){return ka.destroy()}}));let ka;function la(a,b=ja){let c="",e=0;return ma(a,(f,g,h)=>{const i=a.slice(f,g),j=b(i);d(i,j)&&(h=h?"":"\"",c+=a.slice(e,f)+h+j+h,e=g)}),c+a.slice(e,a.length)}function ma(a,b){let c=1,d=0,e="",f="";const g=a=>{5==c&&"class"==f&&b(d,a,e)};for(let h=0;h<a.length;h++){const i=a[h];1==c?"<"==i&&(c="!--"==a.substr(h+1,3)?4:3):4==c?">"==i&&"--"==a.slice(h-2,h)&&(c=1):e?i==e&&"\\"!=a[h-1]&&(g(h),c=2,e=""):"\""==i||"'"==i?(e=i,d+=1):">"==i?(g(h),c=1):c&&("="==i?(f=a.slice(d,h),c=5,d=h+1):"/"==i&&(c<5||">"==a[h+1])?(g(h),c=0):/\s/.test(i)&&(g(h),c=2,d=h+1))}}function na(a,b,c){return b.reduce((b,d,e)=>b+c(d)+a[e+1],a[0])}function oa(a,b){return Array.isArray(a)?qa(na(a,b,a=>null!=a&&"boolean"!=typeof a?a:"")):"string"==typeof a?qa(a):[a]}const pa=/ *(?:(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}))/g;function qa(a){a=T(a);const b=[],c=[];let d;for(;d=pa.exec(a);)d[4]&&c.pop(),d[3]?c.push(d[3]):d[4]||b.push(c.reduceRight((a,b)=>({[b]:a}),{[d[1]]:d[2]}));return b}function ra(a,...b){var c;const d=oa(a,b),e=((null===(c=d.find(a=>a.label))|| void 0===c?void 0:c.label)||"css")+i(JSON.stringify(d));return O(e,(a,b)=>Z(d.flatMap(c=>W(c,a,b,o.o)),e))}function sa(a,b){return Array.isArray(a)&&Array.isArray(a.raw)?na(a,b,a=>ta(a).trim()):b.filter(Boolean).reduce((a,b)=>a+ta(b),a?ta(a):"")}function ta(a){let b="",c;if(a&&"object"==typeof a)if(Array.isArray(a))(c=sa(a[0],a.slice(1)))&&(b+=" "+c);else for(const d in a)a[d]&&(b+=" "+d);else null!=a&&"boolean"!=typeof a&&(b+=" "+a);return b}function ua(a,b=ja){return b.clear(),{html:la(a,b),css:ia(b.target)}}const va=wa();function wa(a){return new Proxy(function(b,...c){return xa(a,"",b,c)},{get(b,c){return"bind"===c?wa:c in b?b[c]:function(b,...d){return xa(a,c,b,d)}}})}function xa(a,b,c,d){const e=oa(c,d),f=h(b+i(JSON.stringify([b,e])));return{toString(){return("function"==typeof a?a:ja)(ra({[`@keyframes ${f}`]:oa(c,d)})),f}}}const ya=Aa("@"),za=Aa("~");function Aa(a){function b(b,c,d){return Q(V(b+a+"("+sa(c,d)+")"))}return new Proxy(function(a,...c){return b("",a,c)},{get(a,c){return c in a?a[c]:function(a,...d){return b(c,a,d)}}})}function Ba(a,b,c){if("["==a[0]&&"]"==a.slice(-1)){if(a=Y(a.slice(1,-1),c),/color|fill|stroke/i.test(b)){if(/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(a))return a}else if(!/image/i.test(b))return a.includes("calc(")&&(a=a.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 ")),a.replace(/(^|[^\\])_+(?![^(]*\))/g,(a,b)=>b+" ".repeat(a.length-1)).replace(/\\_(?![^(]*\))/g,"_");else if(/^[a-z-]+\(/.test(a))return a}}function Ca(a){return a.replace(/-./g,a=>a[1].toUpperCase())}function Da(a={},b){const{label:c="style",base:d,props:e={},defaults:g,when:j=[]}=a,k=f({},null==b?void 0:b.defaults,g),l=i(JSON.stringify([c,null==b?void 0:b.className,d,e,k,j])),m=n("",d||"",o.c);function n(a,d,e){return P(((b?b.className.replace(/#.+$/,"~"):"")+c+a+l).replace(/[: ,()[\]]/,""),e,d&&V(d))}return Object.defineProperties(function(a){let c;Array.isArray(a)&&(c=!0,a=Object.fromEntries(new URLSearchParams(a[1]).entries()));const d=f({},k,a);let g=c?"":(b?b(d)+" ":"")+m,h;for(const i in e){const l=e[i],o=d[i];if(o===Object(o)){let p="";for(const q in h="",o){const r=l[o[q]];r&&(p+="@"+q+"-"+o[q],h+=(h&&" ")+("_"==q?r:q+":("+r+")"))}h&&(g+=" "+n("--"+i+"-"+p,h,402653184))}else(h=l[o])&&(g+=" "+n("--"+i+"-"+o,h,402653184))}return j.forEach((a,b)=>{let c="";for(const e in a[0]){const f=d[e];if(f!==Object(f)&&""+f==""+a[0][e])c+=(c&&"_")+e+"-"+f;else{c="";break}}c&&(h=a[1])&&(g+=" "+n("-"+b+"--"+c,h,536870912))}),g},Object.getOwnPropertyDescriptors({className:m,defaults:k,selector:"."+h(m)}))}return a.apply=ya,a.arbitrary=Ba,a.asArray=k,a.auto=function(a){if(document.currentScript){const b=()=>c.disconnect(),c=new MutationObserver(c=>{for(const{target:d}of c)if(d===document.body)return a(),b()});return c.observe(document.documentElement,{childList:!0,subtree:!0}),b}return m},a.colorFromTheme=function(a={},b){return(d,e)=>{const{section:f=Ca(d[0]).replace("-","")+"Color"}=a;if(!/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/.test(d.$$))return;const{$1:g,$2:h}=RegExp,i=e.theme(f,g)||Ba(g,f,e);if(!i)return;const{opacityVariable:j=`--tw-${d[0].replace(/-$/,"")}-opacity`,opacitySection:k=f.replace("Color","Opacity"),property:l=f,selector:m}=a,n=e.theme(k,h||"DEFAULT")||h&&Ba(h,k,e),o=c(i,{opacityVariable:j||void 0,opacityValue:n||void 0});if(b)return d._={value:o,color:a=>c(i,a)},b(d,e);const p={};return j&&o.includes(j)&&(p[j]=n||"1"),p[l]=o,m?{[m]:p}:p}},a.consume=la,a.css=ra,a.cssom=ha,a.cx=function(a,...b){return Q(V(sa(a,b))," ")},a.defineConfig=ba,a.dom=function(a=ga()){return{target:a,clear(){for(;a.childNodes.length;)a.removeChild(a.lastChild)},destroy(){a.remove()},insert(b,c){a.insertBefore(document.createTextNode(b),a.childNodes[c]||null)}}},a.escape=h,a.extract=ua,a.fromTheme=function(a,b,c){const d=b?"string"==typeof b?(a,d)=>({[b]:c?c(a,d):a._}):b:({1:a,_:b},c,d)=>({[a||d]:b});return(b,c)=>{var e;const f=Ca(a||b[1]),g=null!==(e=c.theme(f,b.$$))&& void 0!==e?e:Ba(b.$$,f,c);if(null!=g)return b._="-"==b.input[0]?`calc(${g} * -1)`:g,d(b,c,f)}},a.hash=i,a.identity=l,a.injectGlobal=function(a,...b){("function"==typeof this?this:ja)(ra({"@layer base":oa(a,b)}))},a.inline=function(a,b={}){const{tw:c=ja,minify:d=l}="function"==typeof b?{tw:b}:b,{html:e,css:f}=ua(a,c);return e.replace("</head>",`<style data-twind=ssr>${d(f,e)}</style></head>`)},a.keyframes=va,a.mql=j,a.noop=m,a.observe=ea,a.setup=function(a={},b=ha(),c){const d=!ka;if(d||ka.destroy(),ka=ea(da(a,b),c),d&&1){var e,f;null===(e=document.querySelector("style[data-twind=ssr]"))|| void 0===e||e.remove(),document.activeElement||null===(f=document.querySelector("[autofocus]"))|| void 0===f||f.focus()}return ka},a.shortcut=za,a.stringify=ia,a.style=(a,b)=>"function"==typeof a?Da(b,a):Da(a),a.toColorValue=c,a.tw=ja,a.twind=da,a.tx=function(a,...b){return("function"==typeof this?this:ja)(sa(a,b))},a.virtual=function(a=[]){return{target:a,clear(){a.length=0},destroy(){this.clear()},insert(b,c){a.splice(c,0,b)}}},a}({})//# sourceMappingURL=twind.global.js.map
const twind=function(a){"use strict";function b(a,b){return Math.round(parseInt(a,16)*b)}function c(a,c={}){if("function"==typeof a)return a(c);const{opacityValue:d="1",opacityVariable:e}=c,f=e?`var(${e})`:d;if("1"==f)return a;if("0"==f)return"#0000";if("#"==a[0]&&(4==a.length||7==a.length)){const g=(a.length-1)/3,h=[17,1,0.062272][g-1];return`rgba(${[b(a.substr(1,g),h),b(a.substr(1+g,g),h),b(a.substr(1+2*g,g),h),f,]})`}return a}function d(a,b){return a!=b&&""+a.split(" ").sort()!=""+b.split(" ").sort()}function e(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function f(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{},d=Object.keys(c);"function"==typeof Object.getOwnPropertySymbols&&(d=d.concat(Object.getOwnPropertySymbols(c).filter(function(a){return Object.getOwnPropertyDescriptor(c,a).enumerable}))),d.forEach(function(b){e(a,b,c[b])})}return a}function g(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],b.indexOf(c)>=0||(e[c]=a[c]);return e}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(b.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}const h="undefined"!=typeof CSS&&CSS.escape||(a=>a.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function i(a){for(var b=9,c=a.length;c--;)b=Math.imul(b^a.charCodeAt(c),1597334677);return"#"+((b^b>>>9)>>>0).toString(36)}function j(a,b="@media "){return b+k(a).map(a=>("string"==typeof a&&(a={min:a}),a.raw||Object.keys(a).map(b=>`(${b}-width:${a[b]})`).join(" and "))).join(",")}function k(a=[]){return Array.isArray(a)?a:null==a?[]:[a]}function l(a){return a}function m(){}function n(a){return[...a.v,(a.i?"!":"")+a.n].join(":")}const o={d:0,b:134217728,c:268435456,s:671088640,u:805306368,o:939524096};function p(a,b){return a& ~o.o|b}function q(a){var b;return(null===(b=a.match(/[-=:;]/g))|| void 0===b?void 0:b.length)||0}function r(a){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(a)?+RegExp.$1/(RegExp.$2?15:1)/10:0,15)<<22|Math.min(q(a),15)<<18}const s=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire",];function t(a){return 1<< ~(/:([a-z-]+)/.test(a)&& ~s.indexOf(RegExp.$1.slice(2,7))|| -18)}function u(a){return"-"==a[0]?0:q(a)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7}$)|([fl].{5}l|g.{8}$|pl))/.test(a)?+!!RegExp.$1||-!!RegExp.$2:0)+1}function v({n:a,i:b,v:c=[]},d,e,f){for(const g of(a&&(a=n({n:a,i:b,v:c})),f=[...k(f)],c)){const h=d.theme("screens",g),i=h&&j(h)||d.v(g);f.push(i),e|=h?67108864|r(i):"dark"==g?1073741824:"@"==i[0]?r(i):t(i)}return{n:a,p:e,r:f,i:b}}const w=new Intl.Collator("en",{numeric:!0});function x(a,b){for(var c=0,d=a.length;c<d;){const e=d+c>>1;0>=y(a[e],b)?c=e+1:d=e}return d}function y(a,b){const c=a.p&o.o;return c==(b.p&o.o)&&(c==o.b||c==o.o)?0:a.p-b.p||a.o-b.o||w.compare(a.n,b.n)}function z(a){if(a.d){const b=[],c=A(a.r.reduce((a,c)=>"@"==c[0]?(b.push(c),a):c?C(a,c):a,"&"),b=>B(b,a.n?"."+h(a.n):""));return c&&b.push(c.replace(/:merge\((.+?)\)/g,"$1")),b.reduceRight((a,b)=>b+"{"+a+"}",a.d)}}function A(a,b){return a.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(a,c,d)=>b(c)+d)}function B(a,b){return a.replace(/&/g,b)}function C(a,b){return A(a,a=>A(b,b=>{const c=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(b);if(c){const d=a.indexOf(c[1]);return~d?a.slice(0,d)+c[0]+a.slice(d+c[1].length):B(a,b)}return B(b,a)}))}function D(a,b=[]){const c={};for(const d in a){const e=a[d],f="DEFAULT"==d?b:[...b,d];"object"==typeof e&&Object.assign(c,D(e,f)),c[f.join("-")]=e,"DEFAULT"==d&&(c[[...b,d].join("-")]=e)}return c}function E(a,b,c,d,e){for(const f of b){let g=c.get(f);g||c.set(f,g=d(f));const h=g(a,e);if(h)return h}}function F(a){return H(a[0],a[1])}function G(a){return Array.isArray(a)?I(a[0],a[1],a[2]):I(a)}function H(a,b){return K(a,"function"==typeof b?b:()=>b)}function I(a,b,c){return K(a,b?"function"==typeof b?b:"string"==typeof b&&/^[\w-]+$/.test(b)?(a,d)=>({[b]:c?c(a,d):J(a.input,a.slice(1).find(Boolean)||a.$$||a.input)}):()=>b:a=>({[a[1]]:J(a.input,a.slice(2).find(Boolean)||a.$$||a.input)}))}function J(a,b){return"-"==a[0]?`calc(${b} * -1)`:b}function K(a,b){return L(a,(a,c,d)=>{const e=c.exec(a);if(e)return e.$$=a.slice(e[0].length),b(e,d)})}function L(a,b){const c=k(a).map(M);return(a,d)=>{for(const e of c){const f=b(a,e,d);if(f)return f}}}function M(a){return"string"==typeof a?new RegExp("^"+a+(a.includes("$")||"-"==a.slice(-1)?"":"$")):a}const N=new Map();function O(a,b){return N.set(a,b),a}function P(a,b,c,d){return O(a,(a,e)=>{const{n:f,p:g,r:h,i:i}=v(a,e,b);return c&&aa(f,b,c,e,g,h,i,d)})}function Q(a,b=","){return a.map(n).join(b)}function R(a,b){if("("!=a[a.length-1]){const c=[];let d=!1,e=!1,f="";for(let g of a)if(!("("==g||/[~@]$/.test(g))){if("!"==g[0]&&(g=g.slice(1),d=!d),g.endsWith(":")){c["dark:"==g?"unshift":"push"](g.slice(0,-1));continue}"-"==g[0]&&(g=g.slice(1),e=!e),g.endsWith("-")&&(g=g.slice(0,-1)),g&&"&"!=g&&(f+=(f&&"-")+g)}f&&(e&&(f="-"+f),b[0].push({n:f,v:c.filter(S),i:d}))}}function S(a,b,c){return c.indexOf(a)==b}function T(a){return a.replace(/\/\*[^]*?\*\/|\/\/[^]*?$|\s\s+|\n/gm," ")}const U=new Map();function V(a){let b=U.get(a);if(!b){a=T(a);const c=[],d=[[]];let e=0,f=0,g=0;const h=(b,f=0)=>{e!=g&&(c.push(a.slice(e,g+f)),b&&R(c,d)),e=g+1};for(;g<a.length;g++){const j=a[g];if(f)"\\"!=a[g-1]&&(f+=+("["==j)||-("]"==j));else if("["==j)f+=1;else if("("==j)h(),c.push(j);else if(":"==j)":"!=a[g+1]&&h(!1,1);else if(/[\s,)]/.test(j)){h(!0);let k=c.lastIndexOf("(");if(")"==j){const l=c[k-1];if(/[~@]$/.test(l)){const m=d.shift();c.length=k,R([...c,"#"],d);const{v:n}=d[0].pop();for(const p of m)p.v.splice(+("dark"==p.v[0])- +("dark"==n[0]),n.length);R([...c,P(l.length>1?l.slice(0,-1)+i(JSON.stringify([l,m])):l+"("+Q(m)+")",o.s,m,/@$/.test(l)),],d)}k=c.lastIndexOf("(",k-1)}c.length=k+1}else/[~@]/.test(j)&&"("==a[g+1]&&d.unshift([])}h(!0),U.set(a,b=d[0])}return b}function W(a,b,c,d,e=[]){return X(a,v(b,c,d,e),c)}function X(a,{n:b,p:c,r:d=[],i:e},f){const g=[];let h="",l=0,m=0;for(let n in a||{}){const q=a[n];if("@"==n[0]){if(!q)continue;if("a"==n[1]){g.push(...aa(b,c,V(q),f,c,d,e,!0));continue}if("l"==n[1]){for(const s of k(q))g.push(...X(s,{n:b,p:p(c,o[n[7]]),r:d,i:e},f));continue}if("i"==n[1]){g.push({p:-1,o:0,r:[],d:k(q).filter(Boolean).map(a=>n+" "+a).join(";")});continue}if("k"==n[1]||"f"==n[1]){g.push({p:o.d,o:0,r:[n],d:X(q,{p:o.d},f).map(z).join("")});continue}}if("object"!=typeof q||Array.isArray(q))"label"==n&&q?b=q+i(JSON.stringify([c,e,a])):(q||0===q)&&(m+=1,l=Math.max(l,u(n=n.replace(/[A-Z]/g,a=>"-"+a.toLowerCase()))),h+=(h?";":"")+k(q).map(a=>f.s(n,Y(""+a,f)+(e?" !important":""))).join(";"));else if("@"==n[0]||n.includes("&")){let t=c;"@"==n[0]&&(t|=r(n=n.replace(/\bscreen\(([^)]+)\)/g,(a,b)=>{const c=f.theme("screens",b);return c?(t|=67108864,j(c,"")):a}))),g.push(...X(q,{n:b,p:t,r:[...d,n],i:e},f))}else g.push(...X(q,{p:c,r:[n]},f))}return g.unshift({n:b&&f.h(b),p:c,o:Math.max(0,15-m)+1.5*Math.min(l||15,15),r:d,d:h}),g.sort(y)}function Y(a,b){return a.replace(/theme\((["'`])?(.+?)\1(?:\s*,\s*(["'`])?(.+?)\3)?\)/g,(a,c,d,e,f)=>b.theme(d,f))}function Z(a,b){const c=[];let d;for(const e of a)e.d?(null==d?void 0:d.p)==e.p&&""+d.r==""+e.r?(d.c=[d.c,e.c].filter(Boolean).join(" "),d.d=[d.d,e.d].filter(Boolean).join(";")):c.push(d=f({},e,{n:e.n&&b})):c.push(f({},e,{n:e.n&&b}));return c}function $(a,b,c=o.u,d,e){const f=[];for(const g of a)for(const h of _(g,b,c,d,e))f.splice(x(f,h),0,h);return f}function _(a,b,c,d,e){var g;a=f({},a,{i:a.i||e});const h=function(a,b){const c=N.get(a.n);return c?c(a,b):b.r(a.n)}(a,b);return h?"string"==typeof h?({r:d,p:c}=v(a,b,c,d),Z($(V(h),b,c,d,a.i),a.n)):Array.isArray(h)?h.map(a=>f({o:0},a,{r:[...k(d),...k(a.r)],p:p(c,null!==(g=a.p)&& void 0!==g?g:c)})):W(h,a,b,c,d):[{c:n(a),p:0,o:0,r:[]}]}function aa(a,b,c,d,e,g,h,i){return Z((i?c.flatMap(a=>$([a],d,e,g,h)):$(c,d,e,g,h)).map(a=>a.p&o.o&&(a.n||b==o.b)?f({},a,{p:p(a.p,b),o:0}):a),a)}function ba(a){var{presets:b=[]}=a,c=g(a,["presets"]);let d={preflight:!1!==c.preflight&&[],darkMode:void 0,theme:{},variants:k(c.variants),rules:k(c.rules),ignorelist:k(c.ignorelist),hash:c.hash,stringify:c.stringify||ca};for(const e of k([...b,{darkMode:c.darkMode,preflight:!1!==c.preflight&&k(c.preflight),theme:c.theme},])){const{preflight:h,darkMode:i=d.darkMode,theme:j,variants:l,rules:m,hash:n=d.hash,ignorelist:o,stringify:p=d.stringify}="function"==typeof e?e(d):e;d={preflight:!1!==d.preflight&& !1!==h&&[...d.preflight,...k(h)],darkMode:i,theme:f({},d.theme,j,{extend:f({},d.theme.extend,null==j?void 0:j.extend)}),variants:[...d.variants,...k(l)],rules:[...d.rules,...k(m)],ignorelist:[...d.ignorelist,...k(o)],hash:n,stringify:p}}return d}function ca(a,b){return a+":"+b}function da(a,b){const c=ba(a),d=function({theme:a,darkMode:b,variants:c,rules:d,hash:e,stringify:f,ignorelist:j}){const k=new Map(),m=new Map(),n=new Map(),o=new Map(),p=L(j,(a,b)=>b.test(a));return c.push(["dark","class"==b?".dark &":"string"==typeof b&&"media"!=b?b:"@media (prefers-color-scheme:dark)",]),{theme:(function(a){var{extend:b={}}=a,c=g(a,["extend"]);const d={},e={colors:f("colors"),theme:f,negative(){return{}},breakpoints(a){const b={};for(const c in a)"string"==typeof a[c]&&(b["screen-"+c]=a[c]);return b}};function f(a,e,g){if(a){var i;if(/[.[]/.test(a)){const j=[];a.replace(/\[([^\]]+)\]|([^.[]+)/g,(a,b,c=b)=>j.push(c)),a=j.shift(),g=e,e=j.join("-")}const k=d[a]||Object.assign(Object.assign(d[a]={},h(c,a)),h(b,a));return null==e?k:null!==(i=k[e||"DEFAULT"])&& void 0!==i?i:g}const l={};for(const m in c)l[m]=f(m);return l}function h(a,b){let c=a[b];return("function"==typeof c&&(c=c(e)),c&&/color/i.test(b))?D(c):c}return f})(a),e:h,h:"function"==typeof e?a=>e(a,i):e?i:l,s(a,b){return f(a,b,this)},v(a){return k.has(a)||k.set(a,E(a,c,m,F,this)||"&:"+a),k.get(a)},r(a){return n.has(a)||n.set(a,!p(a,this)&&E(a,d,o,G,this)),n.get(a)}}}(c),e=new Map(),j=[],m=new Set();function n(a){a=f({},a,{n:a.n&&d.h(a.n)});const c=z(a);if(c&&!m.has(c)){m.add(c);const e=x(j,a);b.insert(c,e,a),j.splice(e,0,a)}return a.n}return b.resume(a=>e.set(a,a),(a,c)=>{b.insert(c,j.length,a),j.push(a),m.add(c)}),Object.defineProperties(function(a){if(!e.size)for(let b of k(c.preflight))"function"==typeof b&&(b=b(d)),b&&("string"==typeof b?aa("",o.b,V(b),d,o.b,[],!1,!0):W(b,{},d,o.b)).forEach(n);let f=e.get(a);if(!f){const g=new Set();for(const h of $(V(a),d))g.add(h.c).add(n(h));f=[...g].filter(Boolean).join(" "),e.set(a,f).set(f,f)}return f},Object.getOwnPropertyDescriptors({get target(){return b.target},theme:d.theme,config:c,clear(){b.clear(),m.clear(),e.clear(),j.length=0},destroy(){this.clear(),b.destroy()}}))}function ea(a=la,b=document.documentElement){if(!b)return a;const c=new MutationObserver(f);c.observe(b,{attributeFilter:["class"],subtree:!0,childList:!0}),g(b),f([{target:b,type:""}]);const{destroy:e}=a;function f(a){for(const{type:b,target:d}of a)"a"==b[0]?g(d):d.querySelectorAll("[class]").forEach(g);c.takeRecords()}function g(b){const c=b.getAttribute("class");let e;c&&d(c,e=a(c))&&b.setAttribute("class",e)}return a.destroy=()=>{c.disconnect(),e.call(a)},a}function fa(a){let b=a||document.querySelector("style[data-twind]");return b&&"STYLE"==b.tagName||((b=document.createElement("style")).dataset.twind="",document.head.prepend(b)),b}function ga(a){var b;const c=(null===(b=a)|| void 0===b?void 0:b.cssRules)?a:fa(a).sheet;return{target:c,clear(){for(let a=c.cssRules.length;a--;)c.deleteRule(a)},destroy(){var a;null===(a=c.ownerNode)|| void 0===a||a.remove()},insert(a,b){try{c.insertRule(a,b)}catch(d){c.insertRule(":root{}",b),/:-[mwo]/.test(a)||console.warn(d,a)}},resume:m}}function ha(a){const b=fa(a);return{target:b,clear(){b.innerHTML=""},destroy(){b.remove()},insert(a,c){b.insertBefore(document.createTextNode(a),b.childNodes[c]||null)},resume:m}}function ia(a,b){const c=a?ha():ga();return b||(c.resume=ka),c}function ja(a){var b;return(null===(b=a.ownerNode||a)|| void 0===b?void 0:b.textContent)||(a.cssRules?Array.from(a.cssRules,a=>a.cssText):k(a)).join("")}function ka(a,b){const c=ja(this.target),d=/\/\*!([\da-z]+),([\da-z]+)(?:,(.+?))?\*\//g;if(d.test(c)){for(const e of(d.lastIndex=0,this.clear(),document.querySelectorAll("[class]")))a(e.getAttribute("class"));let f,g=0;for(;(function(a){var d;return f&&b({p:g+=parseInt(f[1],36),o:parseInt(f[2],36)/2,n:null!==(d=f[3])&& void 0!==d?d:void 0},c.slice(f.index+f[0].length,null==a?void 0:a.index)),f=a})(d.exec(c)););}}const la=Object.defineProperties(function(...a){return ma(...a)},Object.getOwnPropertyDescriptors({get target(){return ma.target},theme(...a){return ma.theme(...a)},get config(){return ma.config},clear(){return ma.clear()},destroy(){return ma.destroy()}}));let ma;function na(a,b=la){let c="",e=0;return oa(a,(f,g,h)=>{const i=a.slice(f,g),j=b(i);d(i,j)&&(h=h?"":"\"",c+=a.slice(e,f)+h+j+h,e=g)}),c+a.slice(e,a.length)}function oa(a,b){let c=1,d=0,e="",f="";const g=a=>{5==c&&"class"==f&&b(d,a,e)};for(let h=0;h<a.length;h++){const i=a[h];1==c?"<"==i&&(c="!--"==a.substr(h+1,3)?4:3):4==c?">"==i&&"--"==a.slice(h-2,h)&&(c=1):e?i==e&&"\\"!=a[h-1]&&(g(h),c=2,e=""):"\""==i||"'"==i?(e=i,d+=1):">"==i?(g(h),c=1):c&&("="==i?(f=a.slice(d,h),c=5,d=h+1):"/"==i&&(c<5||">"==a[h+1])?(g(h),c=0):/\s/.test(i)&&(g(h),c=2,d=h+1))}}function pa(a,b,c){return b.reduce((b,d,e)=>b+c(d)+a[e+1],a[0])}function qa(a,b){return Array.isArray(a)?sa(pa(a,b,a=>null!=a&&"boolean"!=typeof a?a:"")):"string"==typeof a?sa(a):[a]}const ra=/ *(?:(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}))/g;function sa(a){a=T(a);const b=[],c=[];let d;for(;d=ra.exec(a);)d[4]&&c.pop(),d[3]?c.push(d[3]):d[4]||b.push(c.reduceRight((a,b)=>({[b]:a}),{[d[1]]:d[2]}));return b}function ta(a,...b){var c;const d=qa(a,b),e=((null===(c=d.find(a=>a.label))|| void 0===c?void 0:c.label)||"css")+i(JSON.stringify(d));return O(e,(a,b)=>Z(d.flatMap(c=>W(c,a,b,o.o)),e))}function ua(a,b){return Array.isArray(a)&&Array.isArray(a.raw)?pa(a,b,a=>va(a).trim()):b.filter(Boolean).reduce((a,b)=>a+va(b),a?va(a):"")}function va(a){let b="",c;if(a&&"object"==typeof a)if(Array.isArray(a))(c=ua(a[0],a.slice(1)))&&(b+=" "+c);else for(const d in a)a[d]&&(b+=" "+d);else null!=a&&"boolean"!=typeof a&&(b+=" "+a);return b}function wa(a,b=la){return b.clear(),{html:na(a,b),css:ja(b.target)}}const xa=ya();function ya(a){return new Proxy(function(b,...c){return za(a,"",b,c)},{get(b,c){return"bind"===c?ya:c in b?b[c]:function(b,...d){return za(a,c,b,d)}}})}function za(a,b,c,d){const e=qa(c,d),f=h(b+i(JSON.stringify([b,e])));return{toString(){return("function"==typeof a?a:la)(ta({[`@keyframes ${f}`]:qa(c,d)})),f}}}const Aa=Ca("@"),Ba=Ca("~");function Ca(a){function b(b,c,d){return Q(V(b+a+"("+ua(c,d)+")"))}return new Proxy(function(a,...c){return b("",a,c)},{get(a,c){return c in a?a[c]:function(a,...d){return b(c,a,d)}}})}function Da(a,b,c){if("["==a[0]&&"]"==a.slice(-1)){if(a=Y(a.slice(1,-1),c),/color|fill|stroke/i.test(b)){if(/^(#|((hsl|rgb)a?|hwb|lab|lch|color)\(|[a-z]+$)/.test(a))return a}else if(!/image/i.test(b))return a.includes("calc(")&&(a=a.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g,"$1 $2 ")),a.replace(/(^|[^\\])_+(?![^(]*\))/g,(a,b)=>b+" ".repeat(a.length-1)).replace(/\\_(?![^(]*\))/g,"_");else if(/^[a-z-]+\(/.test(a))return a}}function Ea(a){return a.replace(/-./g,a=>a[1].toUpperCase())}function Fa(a={},b){const{label:c="style",base:d,props:e={},defaults:g,when:j=[]}=a,k=f({},null==b?void 0:b.defaults,g),l=i(JSON.stringify([c,null==b?void 0:b.className,d,e,k,j])),m=n("",d||"",o.c);function n(a,d,e){return P(((b?b.className.replace(/#.+$/,"~"):"")+c+a+l).replace(/[: ,()[\]]/,""),e,d&&V(d))}return Object.defineProperties(function(a){let c;Array.isArray(a)&&(c=!0,a=Object.fromEntries(new URLSearchParams(a[1]).entries()));const d=f({},k,a);let g=c?"":(b?b(d)+" ":"")+m,h;for(const i in e){const l=e[i],o=d[i];if(o===Object(o)){let p="";for(const q in h="",o){const r=l[o[q]];r&&(p+="@"+q+"-"+o[q],h+=(h&&" ")+("_"==q?r:q+":("+r+")"))}h&&(g+=" "+n("--"+i+"-"+p,h,402653184))}else(h=l[o])&&(g+=" "+n("--"+i+"-"+o,h,402653184))}return j.forEach((a,b)=>{let c="";for(const e in a[0]){const f=d[e];if(f!==Object(f)&&""+f==""+a[0][e])c+=(c&&"_")+e+"-"+f;else{c="";break}}c&&(h=a[1])&&(g+=" "+n("-"+b+"--"+c,h,536870912))}),g},Object.getOwnPropertyDescriptors({className:m,defaults:k,selector:"."+h(m)}))}return a.apply=Aa,a.arbitrary=Da,a.asArray=k,a.auto=function(a){if(document.currentScript){const b=()=>c.disconnect(),c=new MutationObserver(c=>{for(const{target:d}of c)if(d===document.body)return a(),b()});return c.observe(document.documentElement,{childList:!0,subtree:!0}),b}return m},a.colorFromTheme=function(a={},b){return(d,e)=>{const{section:f=Ea(d[0]).replace("-","")+"Color"}=a;if(!/^(\[[^\]]+]|[^/]+?)(?:\/(.+))?$/.test(d.$$))return;const{$1:g,$2:h}=RegExp,i=e.theme(f,g)||Da(g,f,e);if(!i)return;const{opacityVariable:j=`--tw-${d[0].replace(/-$/,"")}-opacity`,opacitySection:k=f.replace("Color","Opacity"),property:l=f,selector:m}=a,n=e.theme(k,h||"DEFAULT")||h&&Da(h,k,e),o=c(i,{opacityVariable:j||void 0,opacityValue:n||void 0});if(b)return d._={value:o,color:a=>c(i,a)},b(d,e);const p={};return j&&o.includes(j)&&(p[j]=n||"1"),p[l]=o,m?{[m]:p}:p}},a.consume=na,a.css=ta,a.cssom=ga,a.cx=function(a,...b){return Q(V(ua(a,b))," ")},a.defineConfig=ba,a.dom=ha,a.escape=h,a.extract=wa,a.fromTheme=function(a,b,c){const d=b?"string"==typeof b?(a,d)=>({[b]:c?c(a,d):a._}):b:({1:a,_:b},c,d)=>({[a||d]:b});return(b,c)=>{var e;const f=Ea(a||b[1]),g=null!==(e=c.theme(f,b.$$))&& void 0!==e?e:Da(b.$$,f,c);if(null!=g)return b._="-"==b.input[0]?`calc(${g} * -1)`:g,d(b,c,f)}},a.getSheet=ia,a.hash=i,a.identity=l,a.injectGlobal=function(a,...b){("function"==typeof this?this:la)(ta({"@layer base":qa(a,b)}))},a.inline=function(a,b={}){const{tw:c=la,minify:d=l}="function"==typeof b?{tw:b}:b,{html:e,css:f}=wa(a,c);return e.replace("</head>",`<style data-twind>${d(f,e)}</style></head>`)},a.keyframes=xa,a.mql=j,a.noop=m,a.observe=ea,a.setup=function(a={},b=ia(),c){var d;const e=!ma;return e||ma.destroy(),ma=ea(da(a,b),c),e&&(document.activeElement||null===(d=document.querySelector("[autofocus]"))|| void 0===d||d.focus()),ma},a.shortcut=Ba,a.stringify=ja,a.style=(a,b)=>"function"==typeof a?Fa(b,a):Fa(a),a.toColorValue=c,a.tw=la,a.twind=da,a.tx=function(a,...b){return("function"==typeof this?this:la)(ua(a,b))},a.virtual=function(a){const b=[],c=[];return{get target(){return a?b.map((a,b)=>{var d;const e=c[b],f=e.p-((null===(d=c[b-1])|| void 0===d?void 0:d.p)||0);return`/*!${f.toString(36)},${(2*e.o).toString(36)}${e.n?","+e.n:""}*/${a}`}):b},clear(){b.length=0},destroy(){this.clear()},insert(a,d,e){b.splice(d,0,a),c.splice(d,0,e)},resume:m}},a}({})//# sourceMappingURL=twind.global.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc