{"version":3,"sources":["jsdelivr-header.js","/npm/free-style@5.0.1/src/index.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACHA,IAAI,SAAW,EAoBf,MAAM,WAAa,IAAI,IAOjB,gBAAkB,CACtB,4BACA,sBACA,qBACA,qBACA,WACA,iBACA,oBACA,eACA,UACA,oBACA,gBACA,OACA,YACA,gBACA,cACA,gBACA,aACA,cACA,YACA,cACA,kBACA,mBACA,oBACA,WACA,eACA,gBACA,iBACA,aACA,cACA,UACA,QACA,UACA,WACA,SACA,UACA,OAEA,eACA,gBACA,eACA,mBACA,oBACA,oBACA,iBACA,gBAIF,IAAK,MAAM,KAAY,gBACrB,IAAK,MAAM,IAAU,CAAC,WAAY,OAAQ,QAAS,MAAO,IACxD,WAAW,IAAI,EAAS,GAO5B,SAAS,OAAO,GACd,OAAO,EAAI,QAAQ,sCAAuC,OAC5D,CAKA,SAAS,YAAY,EAAkB,GACrC,OAAO,EAAS,QAAQ,KAAM,EAChC,CAKA,SAAS,UAAU,GACjB,OAAO,EACJ,QAAQ,UAAW,GAAc,IAAI,EAAE,kBACvC,QAAQ,OAAQ,OACrB,CAKA,SAAS,WAAW,GAClB,IAAI,EAAQ,KACR,EAAM,EAAI,OACd,KAAO,KAAO,EAAiB,GAAR,EAAc,EAAI,WAAW,GACpD,OAAQ,IAAU,GAAG,SAAS,GAChC,CAKA,SAAS,MAAM,EAAkB,GAC/B,OAA+B,IAA3B,EAAS,QAAQ,KAAoB,GAAG,KAAU,IAC/C,YAAY,EAAU,EAC/B,CAiCA,SAAS,cAAc,EAAM,IAC3B,MAAqB,iBAAV,GAAsB,IAAU,WAAW,IAAI,GACjD,GAAG,KAAQ,MAGb,GAAG,KAAQ,OAAO,IAC3B,CAKA,SAAS,QACP,EACA,EACA,EACA,EACA,GAEA,MAAM,EAAuD,GACvD,EAAqC,GAG3C,IAAK,MAAO,EAAK,KAAU,OAAO,QAAQ,GACxC,GAA0B,KAAtB,EAAI,WA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AS,YAAa,CACjE,MAAM,EAAO,GAAG,EAAS,eAAe,IAExC,OADA,QAAQ,KAAM,EAAS,MAAO,EAAS,OAAQ,EAAS,GAAI,OAAO,IAC5D,CACT,CAGA,OADA,QAAQ,KAAM,EAAS,MAAO,EAAS,OAAQ,EAAS,GAAI,GACrD,CACT,CAEA,aAAA,CAAc,GACZ,OAAO,KAAK,SAAS,QAAQ,GAC/B,CAEA,SAAA,GACE,OAAO,KAAK,KAAK,MACnB,SAMI,SAAU,OAAO,EAAmB,EAAS,IACjD,OAAO,IAAI,MAAM,EAAQ,EAC3B,QAKM,SAAU,QAAQ,GACtB,MAAM,EAA2B,GAC3B,EAA6B,GAEnC,MAAO,CACL,GAAI,WAFM,QAAQ,EAAU,EAAW,GAAI,EAAQ,OAGnD,MAAO,EACP,OAAQ,EACR,YAAa,EAAO,aAExB","file":"/npm/free-style@5.0.1/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/free-style@5.0.1/dist/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * The unique id is used for unique hashes.\n */\nlet uniqueId = 0;\n\n/**\n * Valid CSS property values.\n */\nexport type PropertyValue = number | boolean | string | null | undefined;\n\n/**\n * Input styles object.\n */\nexport interface Styles {\n  $unique?: boolean;\n  $global?: boolean;\n  $displayName?: string;\n  [selector: string]: PropertyValue | PropertyValue[] | Styles;\n}\n\n/**\n * Quick dictionary lookup for unit-less numbers.\n */\nconst CSS_NUMBER = new Set<string>();\n\n/**\n * CSS properties that are valid unit-less numbers.\n *\n * Ref: https://github.com/facebook/react/blob/master/packages/react-dom/src/shared/CSSProperty.js\n */\nconst CSS_NUMBER_KEYS = [\n  \"animation-iteration-count\",\n  \"border-image-outset\",\n  \"border-image-slice\",\n  \"border-image-width\",\n  \"box-flex\",\n  \"box-flex-group\",\n  \"box-ordinal-group\",\n  \"column-count\",\n  \"columns\",\n  \"counter-increment\",\n  \"counter-reset\",\n  \"flex\",\n  \"flex-grow\",\n  \"flex-positive\",\n  \"flex-shrink\",\n  \"flex-negative\",\n  \"flex-order\",\n  \"font-weight\",\n  \"grid-area\",\n  \"grid-column\",\n  \"grid-column-end\",\n  \"grid-column-span\",\n  \"grid-column-start\",\n  \"grid-row\",\n  \"grid-row-end\",\n  \"grid-row-span\",\n  \"grid-row-start\",\n  \"line-clamp\",\n  \"line-height\",\n  \"opacity\",\n  \"order\",\n  \"orphans\",\n  \"tab-size\",\n  \"widows\",\n  \"z-index\",\n  \"zoom\",\n  // SVG properties.\n  \"fill-opacity\",\n  \"flood-opacity\",\n  \"stop-opacity\",\n  \"stroke-dasharray\",\n  \"stroke-dashoffset\",\n  \"stroke-miterlimit\",\n  \"stroke-opacity\",\n  \"stroke-width\",\n];\n\n// Add vendor prefixes to all unit-less properties.\nfor (const property of CSS_NUMBER_KEYS) {\n  for (const prefix of [\"-webkit-\", \"-ms-\", \"-moz-\", \"-o-\", \"\"]) {\n    CSS_NUMBER.add(prefix + property);\n  }\n}\n\n/**\n * Escape a CSS class name.\n */\nfunction escape(str: string) {\n  return str.replace(/[ !#$%&()*+,./;<=>?@[\\]^`{|}~\"'\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Interpolate the `&` with style name.\n */\nfunction interpolate(selector: string, styleName: string) {\n  return selector.replace(/&/g, styleName);\n}\n\n/**\n * Transform a JavaScript property into a CSS property.\n */\nfunction hyphenate(propertyName: string): string {\n  return propertyName\n    .replace(/[A-Z]/g, (m: string) => `-${m.toLowerCase()}`)\n    .replace(/^ms-/, \"-ms-\"); // Internet Explorer vendor prefix.\n}\n\n/**\n * Generate a hash value from a string.\n */\nfunction stringHash(str: string): string {\n  let value = 5381;\n  let len = str.length;\n  while (len--) value = (value * 33) ^ str.charCodeAt(len);\n  return (value >>> 0).toString(36);\n}\n\n/**\n * Interpolate CSS selectors.\n */\nfunction child(selector: string, parent: string) {\n  if (selector.indexOf(\"&\") === -1) return `${parent} ${selector}`;\n  return interpolate(selector, parent);\n}\n\nexport interface CompiledStyle {\n  selector: string;\n  style: string;\n  isUnique: boolean;\n}\n\nexport interface CompiledRule {\n  selector: string;\n  style: string;\n  rules: CompiledRule[];\n  styles: CompiledStyle[];\n}\n\n/**\n * Pre-registered container for cached styles and rules.\n */\nexport interface Compiled {\n  id: string;\n  rules: CompiledRule[];\n  styles: CompiledStyle[];\n  displayName: string | undefined;\n}\n\n/**\n * Sorted set of values used for style ordering.\n */\ntype Tuple<T> = [string, T];\n\n/**\n * Transform a style string to a CSS string.\n */\nfunction tupleToStyle([name, value]: Tuple<NonNullable<PropertyValue>>) {\n  if (typeof value === \"number\" && value && !CSS_NUMBER.has(name)) {\n    return `${name}:${value}px`;\n  }\n\n  return `${name}:${String(value)}`;\n}\n\n/**\n * Recursive loop building styles with deferred selectors.\n */\nfunction stylize(\n  rulesList: CompiledRule[],\n  stylesList: CompiledStyle[],\n  key: string,\n  styles: Styles,\n  parentClassName: string,\n) {\n  const properties: Array<Tuple<NonNullable<PropertyValue>>> = [];\n  const nestedStyles: Array<Tuple<Styles>> = [];\n\n  // Sort keys before adding to styles.\n  for (const [key, value] of Object.entries(styles)) {\n    if (key.charCodeAt(0) !== 36 /* $ */ && value != null) {\n      if (Array.isArray(value)) {\n        const name = hyphenate(key);\n        for (let i = 0; i < value.length; i++) {\n          const style = value[i];\n          if (style != null) properties.push([name, style]);\n        }\n      } else if (typeof value === \"object\") {\n        nestedStyles.push([key, value]);\n      } else {\n        properties.push([hyphenate(key), value]);\n      }\n    }\n  }\n\n  const isUnique = !!styles.$unique;\n  const parent = styles.$global ? \"\" : parentClassName;\n  const style = properties.map(tupleToStyle).join(\";\");\n  let pid = style;\n  let selector = parent;\n  let childRules = rulesList;\n  let childStyles = stylesList;\n\n  if (key.charCodeAt(0) === 64 /* @ */) {\n    childRules = [];\n    childStyles = [];\n\n    // Nested styles support (e.g. `.foo > @media`).\n    if (parent && style) {\n      childStyles.push({ selector, style, isUnique });\n    }\n\n    // Add new rule to parent.\n    rulesList.push({\n      selector: key,\n      style: parent ? \"\" : style,\n      rules: childRules,\n      styles: childStyles,\n    });\n  } else {\n    selector = parent ? (key ? child(key, parent) : parent) : key;\n\n    if (style) {\n      stylesList.push({ selector, style, isUnique });\n    }\n  }\n\n  for (const [name, value] of nestedStyles) {\n    pid += `|${name}#${stylize(\n      childRules,\n      childStyles,\n      name,\n      value,\n      selector,\n    )}`;\n  }\n\n  return pid;\n}\n\n/**\n * Transform `stylize` tree into style objects.\n */\nfunction compose(\n  cache: Cache<Rule | Style>,\n  rulesList: CompiledRule[],\n  stylesList: CompiledStyle[],\n  id: string,\n  name: string,\n) {\n  for (const { selector, style, isUnique } of stylesList) {\n    const key = interpolate(selector, name);\n    const item = new Style(style, isUnique ? String(++uniqueId) : id);\n    item.add(new Selector(key));\n    cache.add(item);\n  }\n\n  for (const { selector, style, rules, styles } of rulesList) {\n    const key = interpolate(selector, name);\n    const item = new Rule(key, style, id);\n    compose(item, rules, styles, id, name);\n    cache.add(item);\n  }\n}\n\n/**\n * Cache to list to styles.\n */\nfunction join(arr: string[]): string {\n  let res = \"\";\n  for (let i = 0; i < arr.length; i++) res += arr[i];\n  return res;\n}\n\n/**\n * Propagate change events.\n */\nexport interface Changes {\n  add(style: Container<any>, index: number): void;\n  remove(style: Container<any>, index: number): void;\n  change(style: Container<any>, index: number): void;\n}\n\n/**\n * Cache-able interface.\n */\nexport interface Container<T> {\n  /** Unique identifier for the cache, used for merging styles. */\n  cid(): string;\n  clone(): T;\n  getStyles(): string;\n}\n\n/**\n * Implement a cache/event emitter.\n */\nexport class Cache<T extends Container<any>> {\n  changeId = 0;\n\n  protected sheet: string[] = [];\n  protected children: T[] = [];\n  protected counters = new Map<string, number>();\n\n  constructor(public changes?: Changes) {}\n\n  add(style: T): void {\n    const id = style.cid();\n    const count = this.counters.get(id) ?? 0;\n\n    this.counters.set(id, count + 1);\n\n    if (count === 0) {\n      const item = style.clone();\n      const index = this.children.push(item);\n      this.sheet.push(item.getStyles());\n      this.changeId++;\n      if (this.changes) this.changes.add(item, index);\n    } else if (style instanceof Cache) {\n      const index = this.children.findIndex((x) => x.cid() === id);\n      const item = this.children[index] as T & Cache<any>;\n      const prevChangeId = item.changeId;\n\n      item.merge(style);\n\n      if (item.changeId !== prevChangeId) {\n        this.sheet[index] = item.getStyles();\n        this.changeId++;\n        if (this.changes) this.changes.change(item, index);\n      }\n    }\n  }\n\n  remove(style: T): void {\n    const id = style.cid();\n    const count = this.counters.get(id);\n\n    if (count) {\n      const index = this.children.findIndex((x) => x.cid() === id);\n\n      if (count === 1) {\n        const item = this.children[index];\n        this.counters.delete(id);\n        this.children.splice(index, 1);\n        this.sheet.splice(index, 1);\n        this.changeId++;\n        if (this.changes) this.changes.remove(item, index);\n      } else if (style instanceof Cache) {\n        const item = this.children[index] as T & Cache<any>;\n        const prevChangeId = item.changeId;\n\n        this.counters.set(id, count - 1);\n        item.unmerge(style);\n\n        if (item.changeId !== prevChangeId) {\n          this.sheet[index] = item.getStyles();\n          this.changeId++;\n          if (this.changes) this.changes.change(item, index);\n        }\n      }\n    }\n  }\n\n  merge(cache: Cache<any>) {\n    for (const item of cache.children) this.add(item);\n    return this;\n  }\n\n  unmerge(cache: Cache<any>) {\n    for (const item of cache.children) this.remove(item);\n    return this;\n  }\n}\n\n/**\n * Selector is a dumb class made to represent nested CSS selectors.\n */\nexport class Selector implements Container<Selector> {\n  constructor(public selector: string) {}\n\n  cid() {\n    return this.selector;\n  }\n\n  getStyles() {\n    return this.selector;\n  }\n\n  clone(): Selector {\n    return this;\n  }\n}\n\n/**\n * The style container registers a style string with selectors.\n */\nexport class Style extends Cache<Selector> implements Container<Style> {\n  constructor(\n    public style: string,\n    public id: string,\n  ) {\n    super();\n  }\n\n  cid() {\n    return `${this.id}|${this.style}`;\n  }\n\n  getStyles(): string {\n    return `${this.sheet.join(\",\")}{${this.style}}`;\n  }\n\n  clone(): Style {\n    return new Style(this.style, this.id).merge(this);\n  }\n}\n\n/**\n * Implement rule logic for style output.\n */\nexport class Rule extends Cache<Rule | Style> implements Container<Rule> {\n  constructor(\n    public rule: string,\n    public style: string,\n    public id: string,\n  ) {\n    super();\n  }\n\n  cid() {\n    return `${this.id}|${this.rule}|${this.style}`;\n  }\n\n  getStyles(): string {\n    return `${this.rule}{${this.style}${join(this.sheet)}}`;\n  }\n\n  clone(): Rule {\n    return new Rule(this.rule, this.style, this.id).merge(this);\n  }\n}\n\n/**\n * The FreeStyle class implements the API for everything else.\n */\nexport class Sheet extends Cache<Rule | Style> {\n  constructor(\n    public prefix: string,\n    changes?: Changes,\n  ) {\n    super(changes);\n  }\n\n  register(compiled: Compiled) {\n    const className = `${this.prefix}${compiled.id}`;\n\n    if (process.env.NODE_ENV !== \"production\" && compiled.displayName) {\n      const name = `${compiled.displayName}_${className}`;\n      compose(this, compiled.rules, compiled.styles, compiled.id, escape(name));\n      return name;\n    }\n\n    compose(this, compiled.rules, compiled.styles, compiled.id, className);\n    return className;\n  }\n\n  registerStyle(styles: Styles) {\n    return this.register(compile(styles));\n  }\n\n  getStyles(): string {\n    return join(this.sheet);\n  }\n}\n\n/**\n * Exports a simple function to create a new instance.\n */\nexport function create(changes?: Changes, prefix = \"\") {\n  return new Sheet(prefix, changes);\n}\n\n/**\n * Compile styles into a registerable object.\n */\nexport function compile(styles: Styles): Compiled {\n  const ruleList: CompiledRule[] = [];\n  const styleList: CompiledStyle[] = [];\n  const pid = stylize(ruleList, styleList, \"\", styles, \".&\");\n  return {\n    id: stringHash(pid),\n    rules: ruleList,\n    styles: styleList,\n    displayName: styles.$displayName,\n  };\n}\n"]}