message: chore: update sort
diff: @@ -5,26 +5,33 @@ const collator = new Intl.Collator(undefined, {
  sensitivity: "base",
  })
  -const cssOrder = ["&", "@media", "&:hover", "&:active", "&:focus"]
  +const pseudoOrder = [
  + "&",
  + "@media",
  + "&:focus-within",
  + "&:hover",
  + "&:focus",
  + "&:focus-visible",
  + "&:active",
  + "&:disabled",
  +]
  -function findLastIndex<T>(
  - haystack: T[],
  +function getLastIndex<T>(
  + arr: T[],
  predicate: (value: T, index: number, obj: T[]) => unknown,
  ) {
  - const reversedIndex = haystack.slice().reverse().findIndex(predicate)
  - const maxIndex = haystack.length - 1
  - return reversedIndex < 0 ? reversedIndex : maxIndex - reversedIndex
  + const reversedIndex = arr.slice().reverse().findIndex(predicate)
  + const lastIndex = arr.length - 1
  + const index = reversedIndex < 0 ? reversedIndex : lastIndex - reversedIndex
  + return index === -1 ? Number.MAX_SAFE_INTEGER : index
  }
  -function byOrder([keyA]: [string, any], [keyB]: [string, any]) {
  - const aSortIndex = findLastIndex(cssOrder, (key) => keyA.startsWith(key))
  - const bSortIndex = findLastIndex(cssOrder, (key) => keyB.startsWith(key))
  - const aOrder = aSortIndex === -1 ? Number.MAX_SAFE_INTEGER : aSortIndex
  - const bOrder = bSortIndex === -1 ? Number.MAX_SAFE_INTEGER : bSortIndex
  -
  - const indexDiff = aOrder - bOrder
  - if (indexDiff !== 0) return indexDiff
  - return collator.compare(keyA, keyB)
  +function byOrder([a]: [string, any], [b]: [string, any]) {
  + const aIndex = getLastIndex(pseudoOrder, (key) => a.startsWith(key))
  + const bIndex = getLastIndex(pseudoOrder, (key) => b.startsWith(key))
  + const diff = aIndex - bIndex
  + if (diff !== 0) return diff
  + return collator.compare(a, b)
  }
  function sort(styles: Dict) {
  