@mhmo91/schmancy 0.4.51 → 0.4.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/autocomplete-CkycjWy4.js +267 -0
  2. package/dist/autocomplete-CkycjWy4.js.map +1 -0
  3. package/dist/autocomplete-CrhgxhFI.cjs +73 -0
  4. package/dist/autocomplete-CrhgxhFI.cjs.map +1 -0
  5. package/dist/autocomplete.cjs +1 -1
  6. package/dist/autocomplete.js +1 -1
  7. package/dist/{avatar-DUhxMuv0.js → avatar-BXx1oJMG.js} +7 -7
  8. package/dist/{avatar-DUhxMuv0.js.map → avatar-BXx1oJMG.js.map} +1 -1
  9. package/dist/{avatar-QK4twwTM.cjs → avatar-nwqyt3uc.cjs} +2 -2
  10. package/dist/{avatar-QK4twwTM.cjs.map → avatar-nwqyt3uc.cjs.map} +1 -1
  11. package/dist/badge.cjs +1 -1
  12. package/dist/badge.js +1 -1
  13. package/dist/{checkbox-BSYgpRsc.js → checkbox-c3DzDvWH.js} +5 -5
  14. package/dist/{checkbox-BSYgpRsc.js.map → checkbox-c3DzDvWH.js.map} +1 -1
  15. package/dist/checkbox.js +1 -1
  16. package/dist/content-drawer.cjs +1 -1
  17. package/dist/content-drawer.js +1 -1
  18. package/dist/{delay-D415_oVH.js → delay-DtVBjjLV.js} +11 -11
  19. package/dist/{delay-D415_oVH.js.map → delay-DtVBjjLV.js.map} +1 -1
  20. package/dist/delay.js +1 -1
  21. package/dist/{dropdown-content-DOnGrBxV.js → dropdown-content-DNJhJCdV.js} +4 -4
  22. package/dist/{dropdown-content-DOnGrBxV.js.map → dropdown-content-DNJhJCdV.js.map} +1 -1
  23. package/dist/dropdown.js +1 -1
  24. package/dist/index.cjs +1 -1
  25. package/dist/index.js +46 -42
  26. package/dist/index.js.map +1 -1
  27. package/dist/nav-drawer.cjs +1 -1
  28. package/dist/nav-drawer.js +1 -1
  29. package/dist/number-B7aCRYnH.cjs +2 -0
  30. package/dist/number-B7aCRYnH.cjs.map +1 -0
  31. package/dist/number-BhTiptLA.js +99 -0
  32. package/dist/number-BhTiptLA.js.map +1 -0
  33. package/dist/search-6Hr7K1gh.js +53 -0
  34. package/dist/search-6Hr7K1gh.js.map +1 -0
  35. package/dist/search-DWW8IoOp.cjs +2 -0
  36. package/dist/search-DWW8IoOp.cjs.map +1 -0
  37. package/dist/{tabs-compatibility-DsOH4PSw.js → tabs-compatibility-BEXurIiZ.js} +6 -6
  38. package/dist/{tabs-compatibility-DsOH4PSw.js.map → tabs-compatibility-BEXurIiZ.js.map} +1 -1
  39. package/dist/tabs.js +1 -1
  40. package/dist/teleport.cjs +1 -1
  41. package/dist/teleport.js +1 -1
  42. package/dist/{typewriter-CnloNIdN.js → typewriter-CXadCi-4.js} +7 -7
  43. package/dist/{typewriter-CnloNIdN.js.map → typewriter-CXadCi-4.js.map} +1 -1
  44. package/dist/{typewriter-DwLZUKKQ.cjs → typewriter-Fq4uV6Gm.cjs} +2 -2
  45. package/dist/{typewriter-DwLZUKKQ.cjs.map → typewriter-Fq4uV6Gm.cjs.map} +1 -1
  46. package/dist/typewriter.cjs +1 -1
  47. package/dist/typewriter.js +1 -1
  48. package/dist/utils.cjs +1 -1
  49. package/dist/utils.js +6 -2
  50. package/dist/utils.js.map +1 -1
  51. package/package.json +1 -1
  52. package/types/src/index.d.ts +0 -1
  53. package/types/src/utils/index.d.ts +2 -0
  54. package/types/src/utils/number.d.ts +105 -0
  55. package/dist/autocomplete-CHObbMzK.js +0 -315
  56. package/dist/autocomplete-CHObbMzK.js.map +0 -1
  57. package/dist/autocomplete-PHnzqAII.cjs +0 -73
  58. package/dist/autocomplete-PHnzqAII.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number-BhTiptLA.js","sources":["../src/utils/number.ts"],"sourcesContent":["export class Numbers {\n /**\n * Rounds a number to the specified number of decimal places.\n * @param {number} number - The number to round.\n * @param {number} [decimalPlaces=2] - The number of decimal places to round to.\n * @returns {number} - The rounded number.\n */\n roundNumber(number: number, decimalPlaces: number = 2): number {\n const factor = Math.pow(10, decimalPlaces);\n return Math.round(number * factor) / factor;\n }\n\n /**\n * Formats a number according to the specified locale and options.\n * @param {number} number - The number to format.\n * @param {string} [locale='de-DE'] - The locale string (e.g., 'de-DE' for German).\n * @param {Intl.NumberFormatOptions} [options={}] - Additional formatting options.\n * @returns {string} - The formatted number as a string.\n */\n formatNumber(\n number: number,\n locale: string = \"de-DE\",\n options: Intl.NumberFormatOptions = {},\n ): string {\n return new Intl.NumberFormat(locale, options).format(number);\n }\n\n /**\n * Parses a string with a specified decimal separator into a number.\n * @param {string} numberString - The string to parse.\n * @param {string} [decimalSeparator=','] - The decimal separator used in the string.\n * @returns {number} - The parsed number.\n */\n parseToPureNumber(\n numberString: string,\n decimalSeparator: string = \",\",\n ): number {\n const normalizedString = numberString.replace(decimalSeparator, \".\");\n return parseFloat(normalizedString);\n }\n\n /**\n * Rounds a number to the specified decimal places and formats it according to the specified locale and options.\n * @param {number} number - The number to process.\n * @param {number} [decimalPlaces=2] - The number of decimal places to round to.\n * @param {string} [locale='de-DE'] - The locale string.\n * @param {Intl.NumberFormatOptions} [options={}] - Additional formatting options.\n * @returns {string} - The formatted number as a string.\n */\n doIt(\n number: number,\n decimalPlaces: number = 2,\n locale: string = \"de-DE\",\n options: Intl.NumberFormatOptions = {},\n ): string {\n const roundedNumber = this.roundNumber(number, decimalPlaces);\n return this.formatNumber(roundedNumber, locale, options);\n }\n\n /**\n * Format a currency amount consistently across the application\n *\n * @param amount The amount to format\n * @param currency The currency symbol to display (default: '€')\n * @returns Formatted amount with currency symbol\n */\n formatCurrency(amount: number, currency: string = \"€\"): string {\n return `${currency}${this.doIt(amount)}`;\n }\n\n /**\n * Format a delta value with appropriate directional indicator\n *\n * @param delta The delta amount to format\n * @param currency The currency symbol to display (default: '€')\n * @returns Formatted delta with direction indicator and currency symbol\n */\n formatDelta(delta: number, currency: string = \"€\"): string {\n const symbol = delta > 0 ? \"↑\" : delta < 0 ? \"↓\" : \"→\";\n return `${symbol} ${currency}${this.doIt(Math.abs(delta))}`;\n }\n\n /**\n * Get CSS class for delta value\n *\n * @param delta The delta amount\n * @returns CSS class based on delta direction\n */\n getDeltaClass(delta: number): string {\n return delta > 0\n ? \"text-error-default\"\n : delta < 0\n ? \"text-primary-default\"\n : \"text-neutral\";\n }\n\n /**\n * Converts a decimal number to a mixed fraction string\n * For example: 1.5 becomes \"1 1/2\", 2.25 becomes \"2 1/4\"\n *\n * @param number The decimal number to convert\n * @param precision The precision level for fraction approximation (default: 16)\n * @param maxDenominator The maximum allowed denominator (default: 4)\n * @returns A string representing the mixed fraction\n */\n toMixedFraction(\n number: number,\n precision: number = 16,\n maxDenominator: number = 4,\n ): string {\n // Handle negative numbers\n const isNegative = number < 0;\n number = Math.abs(number);\n\n // Extract whole number part\n const wholePart = Math.floor(number);\n\n // Extract decimal part and convert to fraction\n let decimalPart = number - wholePart;\n\n // If the decimal part is very small or zero, just return the whole number\n if (decimalPart < 1 / Math.pow(10, precision)) {\n return isNegative ? `-${wholePart}` : `${wholePart}`;\n }\n\n // Find the best fraction approximation using precision and max denominator\n const { numerator, denominator } = this.decimalToFraction(\n decimalPart,\n precision,\n maxDenominator,\n );\n\n // Format based on whether there's a whole part\n if (wholePart === 0) {\n return isNegative\n ? `-${numerator}/${denominator}`\n : `${numerator}/${denominator}`;\n } else {\n return isNegative\n ? `-${wholePart} ${numerator}/${denominator}`\n : `${wholePart} ${numerator}/${denominator}`;\n }\n }\n\n /**\n * Converts a decimal to a simplified fraction with a maximum denominator\n *\n * @param decimal The decimal part to convert (0 <= decimal < 1)\n * @param precision The precision level for approximation\n * @param maxDenominator The maximum allowed denominator (default: 4)\n * @returns Object containing numerator and denominator\n */\n private decimalToFraction(\n decimal: number,\n precision: number,\n maxDenominator: number = 4,\n ): { numerator: number; denominator: number } {\n if (decimal === 0) {\n return { numerator: 0, denominator: 1 };\n }\n\n // Initialize best approximation\n let bestError = Infinity;\n let bestNumerator = 0;\n let bestDenominator = 1;\n\n // Check common fractions first for better user experience\n // Filter to only include fractions with denominators <= maxDenominator\n const commonFractions = [\n { n: 1, d: 2 }, // 1/2\n { n: 1, d: 3 }, // 1/3\n { n: 2, d: 3 }, // 2/3\n { n: 1, d: 4 }, // 1/4\n { n: 3, d: 4 }, // 3/4\n ];\n\n // Add additional fractions only if maxDenominator allows\n const additionalFractions = [];\n if (maxDenominator >= 5) {\n additionalFractions.push(\n { n: 1, d: 5 }, // 1/5\n { n: 2, d: 5 }, // 2/5\n { n: 3, d: 5 }, // 3/5\n { n: 4, d: 5 }, // 4/5\n );\n }\n if (maxDenominator >= 6) {\n additionalFractions.push(\n { n: 1, d: 6 }, // 1/6\n { n: 5, d: 6 }, // 5/6\n );\n }\n if (maxDenominator >= 8) {\n additionalFractions.push(\n { n: 1, d: 8 }, // 1/8\n { n: 3, d: 8 }, // 3/8\n { n: 5, d: 8 }, // 5/8\n { n: 7, d: 8 }, // 7/8\n );\n }\n if (maxDenominator >= 10) {\n additionalFractions.push(\n { n: 1, d: 10 }, // 1/10\n { n: 3, d: 10 }, // 3/10\n { n: 7, d: 10 }, // 7/10\n { n: 9, d: 10 }, // 9/10\n );\n }\n if (maxDenominator >= 12) {\n additionalFractions.push(\n { n: 1, d: 12 }, // 1/12\n { n: 5, d: 12 }, // 5/12\n { n: 7, d: 12 }, // 7/12\n { n: 11, d: 12 }, // 11/12\n );\n }\n if (maxDenominator >= 16) {\n additionalFractions.push(\n { n: 1, d: 16 }, // 1/16\n { n: 3, d: 16 }, // 3/16\n { n: 5, d: 16 }, // 5/16\n { n: 7, d: 16 }, // 7/16\n { n: 9, d: 16 }, // 9/16\n { n: 11, d: 16 }, // 11/16\n { n: 13, d: 16 }, // 13/16\n { n: 15, d: 16 }, // 15/16\n );\n }\n\n // Combine all applicable fractions\n const allFractions = [...commonFractions, ...additionalFractions];\n\n // Check common fractions first\n for (const frac of allFractions) {\n if (frac.d <= maxDenominator) {\n const error = Math.abs(decimal - frac.n / frac.d);\n if (error < bestError) {\n bestError = error;\n bestNumerator = frac.n;\n bestDenominator = frac.d;\n\n // If we're very close to a common fraction, just use it\n if (error < 1 / Math.pow(10, precision)) {\n return { numerator: frac.n, denominator: frac.d };\n }\n }\n }\n }\n\n // If no suitable common fraction found, use a more sophisticated approach\n // for denominators up to maxDenominator\n\n // Find the best approximation with denominator <= maxDenominator\n for (let d = 1; d <= maxDenominator; d++) {\n // Find best numerator for this denominator\n const n = Math.round(decimal * d);\n const error = Math.abs(decimal - n / d);\n\n if (error < bestError) {\n bestError = error;\n bestNumerator = n;\n bestDenominator = d;\n }\n }\n\n // Only use continued fraction expansion if we're significantly off\n // and maxDenominator allows for larger denominators\n if (bestError > 1 / Math.pow(10, precision / 2) && maxDenominator > 4) {\n // Implementation of continued fraction expansion\n let n1 = 1,\n n2 = 0;\n let d1 = 0,\n d2 = 1;\n let b = decimal;\n\n do {\n let a = Math.floor(b);\n let aux = n1;\n n1 = a * n1 + n2;\n n2 = aux;\n\n aux = d1;\n d1 = a * d1 + d2;\n d2 = aux;\n\n b = 1 / (b - a);\n\n // Calculate the current approximation\n const currentError = Math.abs(decimal - n1 / d1);\n\n // If we hit the precision limit or if the denominator gets too large, use this approximation\n if (currentError < 1 / Math.pow(10, precision) || d1 > maxDenominator) {\n // If d1 exceeds maxDenominator, return the previous best result\n if (d1 > maxDenominator) {\n return { numerator: bestNumerator, denominator: bestDenominator };\n }\n\n // Otherwise return this result\n return { numerator: n1, denominator: d1 };\n }\n } while (b !== Infinity);\n\n bestNumerator = n1;\n bestDenominator = d1;\n }\n\n // Simplify the fraction\n const gcd = this.findGCD(bestNumerator, bestDenominator);\n return {\n numerator: bestNumerator / gcd,\n denominator: bestDenominator / gcd,\n };\n }\n\n /**\n * Calculates the greatest common divisor of two numbers\n */\n private findGCD(a: number, b: number): number {\n return b === 0 ? a : this.findGCD(b, a % b);\n }\n\n /**\n * Alternative method to get a formatted mixed fraction with a specified format\n *\n * @param number The decimal number to convert\n * @param format The format specification ('unicode', 'ascii', 'superscript')\n * @param precision The precision level for fraction approximation\n * @param maxDenominator The maximum allowed denominator (default: 4)\n * @returns A formatted string representing the mixed fraction\n */\n formatMixedFraction(\n number: number,\n format: \"unicode\" | \"ascii\" | \"superscript\" = \"ascii\",\n precision: number = 16,\n maxDenominator: number = 4,\n ): string {\n // Get the basic mixed fraction\n const basicFraction = this.toMixedFraction(\n number,\n precision,\n maxDenominator,\n );\n\n // If the format is ascii, just return the basic fraction\n if (format === \"ascii\") {\n return basicFraction;\n }\n\n // For unicode and superscript formats, we need to parse the basic fraction\n const isNegative = basicFraction.startsWith(\"-\");\n const withoutSign = isNegative ? basicFraction.substring(1) : basicFraction;\n\n // Check if it's a pure fraction or mixed fraction\n const hasMixedPart = withoutSign.includes(\" \");\n\n if (!withoutSign.includes(\"/\")) {\n // If there's no fraction part, just return the number\n return basicFraction;\n }\n\n let wholePart = \"\";\n let fractionPart = withoutSign;\n\n if (hasMixedPart) {\n // Split the whole and fraction parts\n const parts = withoutSign.split(\" \");\n wholePart = parts[0];\n fractionPart = parts[1];\n }\n\n // Split the fraction part into numerator and denominator\n const [numerator, denominator] = fractionPart.split(\"/\");\n\n if (format === \"unicode\") {\n // Try to find a unicode fraction character\n const unicodeFraction = this.getUnicodeFraction(\n parseInt(numerator),\n parseInt(denominator),\n );\n\n if (unicodeFraction) {\n return isNegative\n ? `-${wholePart}${hasMixedPart ? \" \" : \"\"}${unicodeFraction}`\n : `${wholePart}${hasMixedPart ? \" \" : \"\"}${unicodeFraction}`;\n }\n\n // Fallback to basic format if no unicode fraction is available\n return basicFraction;\n }\n\n // Handle superscript format\n if (format === \"superscript\") {\n const superNumerator = this.toSuperscript(numerator);\n const subDenominator = this.toSubscript(denominator);\n\n if (hasMixedPart) {\n return isNegative\n ? `-${wholePart} ${superNumerator}⁄${subDenominator}`\n : `${wholePart} ${superNumerator}⁄${subDenominator}`;\n } else {\n return isNegative\n ? `-${superNumerator}⁄${subDenominator}`\n : `${superNumerator}⁄${subDenominator}`;\n }\n }\n\n // Fallback to basic format\n return basicFraction;\n }\n\n /**\n * Gets the Unicode fraction character if available\n *\n * @param numerator The numerator\n * @param denominator The denominator\n * @returns Unicode fraction character or null if not available\n */\n private getUnicodeFraction(\n numerator: number,\n denominator: number,\n ): string | null {\n // Map common fractions to their Unicode characters\n const fractionMap: Record<string, string> = {\n \"1/4\": \"¼\",\n \"1/2\": \"½\",\n \"3/4\": \"¾\",\n \"1/3\": \"⅓\",\n \"2/3\": \"⅔\",\n \"1/5\": \"⅕\",\n \"2/5\": \"⅖\",\n \"3/5\": \"⅗\",\n \"4/5\": \"⅘\",\n \"1/6\": \"⅙\",\n \"5/6\": \"⅚\",\n \"1/7\": \"⅐\",\n \"1/8\": \"⅛\",\n \"3/8\": \"⅜\",\n \"5/8\": \"⅝\",\n \"7/8\": \"⅞\",\n \"1/9\": \"⅑\",\n \"1/10\": \"⅒\",\n };\n\n const key = `${numerator}/${denominator}`;\n return fractionMap[key] || null;\n }\n\n /**\n * Converts digits to superscript\n */\n private toSuperscript(str: string): string {\n const superscriptMap: Record<string, string> = {\n \"0\": \"⁰\",\n \"1\": \"¹\",\n \"2\": \"²\",\n \"3\": \"³\",\n \"4\": \"⁴\",\n \"5\": \"⁵\",\n \"6\": \"⁶\",\n \"7\": \"⁷\",\n \"8\": \"⁸\",\n \"9\": \"⁹\",\n \"-\": \"⁻\",\n };\n\n return str\n .split(\"\")\n .map((char) => superscriptMap[char] || char)\n .join(\"\");\n }\n\n /**\n * Converts digits to subscript\n */\n private toSubscript(str: string): string {\n const subscriptMap: Record<string, string> = {\n \"0\": \"₀\",\n \"1\": \"₁\",\n \"2\": \"₂\",\n \"3\": \"₃\",\n \"4\": \"₄\",\n \"5\": \"₅\",\n \"6\": \"₆\",\n \"7\": \"₇\",\n \"8\": \"₈\",\n \"9\": \"₉\",\n \"-\": \"₋\",\n };\n\n return str\n .split(\"\")\n .map((char) => subscriptMap[char] || char)\n .join(\"\");\n }\n}\n\n"],"names":["Numbers","number","decimalPlaces","factor","Math","pow","round","locale","options","Intl","NumberFormat","format","numberString","decimalSeparator","normalizedString","replace","parseFloat","roundedNumber","this","roundNumber","formatNumber","amount","currency","doIt","delta","abs","precision","maxDenominator","isNegative","wholePart","floor","decimalPart","numerator","denominator","decimalToFraction","decimal","bestError","Infinity","bestNumerator","bestDenominator","additionalFractions","push","n","d","allFractions","frac","error","n1","n2","d1","d2","b","a","aux","gcd","findGCD","basicFraction","toMixedFraction","startsWith","withoutSign","substring","hasMixedPart","includes","fractionPart","parts","split","unicodeFraction","getUnicodeFraction","parseInt","superNumerator","toSuperscript","subDenominator","toSubscript","str","superscriptMap","map","char","join","subscriptMap"],"mappings":"AAAO,MAAMA,EAAAA;AAAAA,EAOX,YAAYC,GAAgBC,IAAwB,GAAA;AAClD,UAAMC,IAASC,KAAKC,IAAI,IAAIH;AAC5B,WAAOE,KAAKE,MAAML,IAASE,CAAAA,IAAUA;AAAAA,EACvC;AAAA,EASA,aACEF,GACAM,IAAiB,SACjBC,IAAoC,CAAA,GAAA;AAEpC,WAAO,IAAIC,KAAKC,aAAaH,GAAQC,CAAAA,EAASG,OAAOV,CAAAA;AAAAA,EACvD;AAAA,EAQA,kBACEW,GACAC,IAA2B;AAE3B,UAAMC,IAAmBF,EAAaG,QAAQF,GAAkB,GAAA;AAChE,WAAOG,WAAWF,CAAAA;AAAAA,EACpB;AAAA,EAUA,KACEb,GACAC,IAAwB,GACxBK,IAAiB,SACjBC,IAAoC;AAEpC,UAAMS,IAAgBC,KAAKC,YAAYlB,GAAQC;AAC/C,WAAOgB,KAAKE,aAAaH,GAAeV,GAAQC,CAAAA;AAAAA,EAClD;AAAA,EASA,eAAea,GAAgBC,IAAmB,KAAA;AAChD,WAAO,GAAGA,CAAAA,GAAWJ,KAAKK,KAAKF,CAAAA,CAAAA;AAAAA,EACjC;AAAA,EASA,YAAYG,GAAeF,IAAmB,KAAA;AAE5C,WAAO,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Of;AAAAA,EACT;AAAA,EASQ,mBACNxB,GACAC,GAAAA;AAyBA,WAtB4C,EAC1C,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,OAAO,KACP,QAAQ,MAGE,GAAGD,CAAAA,IAAaC,CAAAA,EAAAA,KACD;AAAA,EAC7B;AAAA,EAKQ,cAAcwC,GAAAA;AACpB,UAAMC,IAAyC,EAC7C,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,KAAK,IAAA;AAGP,WAAOD,EACJR,MAAM,IACNU,IAAKC,CAAAA,MAASF,EAAeE,CAAAA,KAASA,CAAAA,EACtCC,KAAK,EAAA;AAAA,EACV;AAAA,EAKQ,YAAYJ,GAAAA;AAClB,UAAMK,IAAuC,EAC3C,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,GAAK,KACL,KAAK;AAGP,WAAOL,EACJR,MAAM,EAAA,EACNU,IAAKC,CAAAA,MAASE,EAAaF,CAAAA,KAASA,CAAAA,EACpCC,KAAK,EAAA;AAAA,EACV;AAAA;"}
@@ -0,0 +1,53 @@
1
+ function w(s, u) {
2
+ if (!s || !u) return 0;
3
+ if (s === u) return 1;
4
+ const r = s.toLowerCase().trim(), o = u.toLowerCase().trim();
5
+ if (r === o) return 1;
6
+ if (o.startsWith(r))
7
+ return 0.95 + 0.05 * (r.length / o.length);
8
+ const c = o.split(/[\s\-_]+/);
9
+ for (const n of c) if (n.startsWith(r))
10
+ return 0.85 * (1 - c.indexOf(n) / c.length * 0.1);
11
+ if (o.includes(r))
12
+ return 0.7 * (1 - o.indexOf(r) / o.length * 0.2);
13
+ if (function(n, l) {
14
+ let e = 0, t = 0;
15
+ for (; e < n.length && t < l.length; ) n[e] === l[t] && e++, t++;
16
+ return e === n.length;
17
+ }(r, o)) return 0.5;
18
+ const x = function(n, l) {
19
+ if (n.length < 2 || l.length < 2) return 0;
20
+ const e = m(n), t = m(l);
21
+ let f = 0;
22
+ const h = new Array(t.length).fill(!1);
23
+ for (const g of e) for (let i = 0; i < t.length; i++) if (!h[i] && t[i] === g) {
24
+ f++, h[i] = !0;
25
+ break;
26
+ }
27
+ return 2 * f / (e.length + t.length);
28
+ }(r, o), a = Math.max(r.length, o.length), d = function(n, l) {
29
+ if (n.length === 0) return l.length;
30
+ if (l.length === 0) return n.length;
31
+ const e = [];
32
+ for (let t = 0; t <= l.length; t++) e[t] = [t];
33
+ for (let t = 0; t <= n.length; t++) e[0][t] = t;
34
+ for (let t = 1; t <= l.length; t++) for (let f = 1; f <= n.length; f++) {
35
+ const h = n[f - 1] === l[t - 1] ? 0 : 1;
36
+ e[t][f] = Math.min(e[t - 1][f] + 1, e[t][f - 1] + 1, e[t - 1][f - 1] + h);
37
+ }
38
+ return e[l.length][n.length];
39
+ }(r, o), p = a ? 1 - d / a : 0, b = function(n, l) {
40
+ const e = (h) => h.split("").reduce((g, i) => (g[i] = (g[i] || 0) + 1, g), {}), t = e(n), f = e(l);
41
+ return Object.keys(t).every((h) => (f[h] || 0) >= t[h]);
42
+ }(r, o) ? 0.3 : 0;
43
+ return Math.max(0.4 * x, 0.4 * p, b);
44
+ }
45
+ function m(s) {
46
+ const u = [];
47
+ for (let r = 0; r < s.length - 1; r++) u.push(s.substring(r, r + 2));
48
+ return u;
49
+ }
50
+ export {
51
+ w as s
52
+ };
53
+ //# sourceMappingURL=search-6Hr7K1gh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-6Hr7K1gh.js","sources":["../src/utils/search.ts"],"sourcesContent":["/**\n * Calculate similarity score between two strings.\n * Returns a value between 0 (no match) and 1 (exact match).\n * Optimized for autocomplete with prioritization of start matches and whole words.\n *\n * @param query The search query string\n * @param target The target string to compare against\n * @returns A similarity score from 0 to 1\n */\nexport function similarity(query: string, target: string): number {\n\t// Handle edge cases\n\tif (!query || !target) return 0\n\tif (query === target) return 1\n\n\t// Normalize strings for comparison\n\tconst normalizedQuery = query.toLowerCase().trim()\n\tconst normalizedTarget = target.toLowerCase().trim()\n\n\t// 1. Exact match (case-insensitive)\n\tif (normalizedQuery === normalizedTarget) return 1\n\n\t// 2. Target starts with query (highest priority for autocomplete)\n\tif (normalizedTarget.startsWith(normalizedQuery)) {\n\t\t// Give higher score to shorter targets (more precise matches)\n\t\tconst lengthRatio = normalizedQuery.length / normalizedTarget.length\n\t\treturn 0.95 + (lengthRatio * 0.05) // Score between 0.95 and 1.0\n\t}\n\n\t// 3. Word boundary match (query matches start of any word in target)\n\tconst words = normalizedTarget.split(/[\\s\\-_]+/)\n\tfor (const word of words) {\n\t\tif (word.startsWith(normalizedQuery)) {\n\t\t\t// Score based on which word matched (earlier words score higher)\n\t\t\tconst wordIndex = words.indexOf(word)\n\t\t\tconst wordPositionScore = 1 - (wordIndex / words.length) * 0.1\n\t\t\treturn 0.85 * wordPositionScore // Score between 0.765 and 0.85\n\t\t}\n\t}\n\n\t// 4. Direct substring match (query appears anywhere in target)\n\tif (normalizedTarget.includes(normalizedQuery)) {\n\t\t// Score based on position (earlier position scores higher)\n\t\tconst position = normalizedTarget.indexOf(normalizedQuery)\n\t\tconst positionScore = 1 - (position / normalizedTarget.length) * 0.2\n\t\treturn 0.7 * positionScore // Score between 0.56 and 0.7\n\t}\n\n\t// 5. Subsequence check (all query chars appear in order)\n\tif (isSubsequence(normalizedQuery, normalizedTarget)) {\n\t\treturn 0.5\n\t}\n\n\t// 6. Fuzzy matching for typos\n\t// 6a. Dice coefficient (good for similar words)\n\tconst diceScore = diceCoefficient(normalizedQuery, normalizedTarget)\n\t\n\t// 6b. Levenshtein distance (good for typos)\n\tconst maxLength = Math.max(normalizedQuery.length, normalizedTarget.length)\n\tconst levenshteinDistance = calculateLevenshtein(normalizedQuery, normalizedTarget)\n\tconst levenshteinScore = maxLength ? 1 - levenshteinDistance / maxLength : 0\n\n\t// 6c. Character frequency match (anagram-like)\n\tconst anagramScore = hasAllCharacters(normalizedQuery, normalizedTarget) ? 0.3 : 0\n\n\t// Combine fuzzy scores with weights\n\tconst fuzzyScore = Math.max(\n\t\tdiceScore * 0.4,\n\t\tlevenshteinScore * 0.4,\n\t\tanagramScore\n\t)\n\n\treturn fuzzyScore\n}\n\n// Keep the rest of the helper functions as they are...\n/**\n * Check if string 'sub' is a subsequence of string 'str'.\n * All characters in 'sub' must appear in order in 'str'.\n */\nfunction isSubsequence(sub: string, str: string): boolean {\n\tlet i = 0,\n\t\tj = 0\n\twhile (i < sub.length && j < str.length) {\n\t\tif (sub[i] === str[j]) i++\n\t\tj++\n\t}\n\treturn i === sub.length\n}\n\n/**\n * Check if all characters in 'query' are present in 'target'.\n * For example, \"aovc\" matches \"avocados\" (anagram subset matching).\n */\nfunction hasAllCharacters(query: string, target: string): boolean {\n\tconst countChars = (s: string): Record<string, number> => {\n\t\treturn s.split('').reduce(\n\t\t\t(acc, char) => {\n\t\t\t\tacc[char] = (acc[char] || 0) + 1\n\t\t\t\treturn acc\n\t\t\t},\n\t\t\t{} as Record<string, number>,\n\t\t)\n\t}\n\n\tconst queryCount = countChars(query)\n\tconst targetCount = countChars(target)\n\n\treturn Object.keys(queryCount).every(char => (targetCount[char] || 0) >= queryCount[char])\n}\n\n/**\n * Generate bigrams for a string.\n * A bigram is a sequence of two adjacent characters.\n */\nfunction getBigrams(s: string): string[] {\n\tconst bigrams = []\n\tfor (let i = 0; i < s.length - 1; i++) {\n\t\tbigrams.push(s.substring(i, i + 2))\n\t}\n\treturn bigrams\n}\n\n/**\n * Compute Dice's coefficient for two strings based on bigrams.\n * Returns a value between 0 (no similarity) and 1 (perfect match).\n */\nfunction diceCoefficient(s1: string, s2: string): number {\n\tif (s1.length < 2 || s2.length < 2) return 0\n\n\tconst bigrams1 = getBigrams(s1)\n\tconst bigrams2 = getBigrams(s2)\n\n\tlet intersection = 0\n\tconst used = new Array(bigrams2.length).fill(false)\n\n\tfor (const bigram of bigrams1) {\n\t\tfor (let i = 0; i < bigrams2.length; i++) {\n\t\t\tif (!used[i] && bigrams2[i] === bigram) {\n\t\t\t\tintersection++\n\t\t\t\tused[i] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (2 * intersection) / (bigrams1.length + bigrams2.length)\n}\n\n/**\n * Calculate Levenshtein distance between two strings.\n */\nfunction calculateLevenshtein(a: string, b: string): number {\n\tif (a.length === 0) return b.length\n\tif (b.length === 0) return a.length\n\n\tconst matrix: number[][] = []\n\n\t// Initialize the matrix\n\tfor (let i = 0; i <= b.length; i++) {\n\t\tmatrix[i] = [i]\n\t}\n\tfor (let j = 0; j <= a.length; j++) {\n\t\tmatrix[0][j] = j\n\t}\n\n\t// Calculate distances\n\tfor (let i = 1; i <= b.length; i++) {\n\t\tfor (let j = 1; j <= a.length; j++) {\n\t\t\tconst cost = a[j - 1] === b[i - 1] ? 0 : 1\n\t\t\tmatrix[i][j] = Math.min(\n\t\t\t\tmatrix[i - 1][j] + 1, // deletion\n\t\t\t\tmatrix[i][j - 1] + 1, // insertion\n\t\t\t\tmatrix[i - 1][j - 1] + cost, // substitution\n\t\t\t)\n\t\t}\n\t}\n\n\treturn matrix[b.length][a.length]\n}\n"],"names":["similarity","query","target","normalizedQuery","toLowerCase","trim","normalizedTarget","startsWith","length","words","split","word","indexOf","includes","sub","str","i","j","diceScore","s1","s2","bigrams1","getBigrams","bigrams2","intersection","used","Array","fill","bigram","maxLength","Math","max","levenshteinDistance","a","b","matrix","cost","min","levenshteinScore","anagramScore","countChars","s","reduce","acc","char","queryCount","targetCount","Object","keys","every","bigrams","push","substring"],"mappings":"AASO,SAASA,EAAWC,GAAeC,GAAAA;AAEzC,OAAKD,KAAAA,CAAUC,EAAQ,Q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EAAWtC,CAAAA;AAE/B,WAAO6C,OAAOC,KAAKH,CAAAA,EAAYI,MAAML,CAAAA,OAASE,EAAYF,MAAS,MAAMC,EAAWD;EACrF,EA9CuCzC,GAAiBG,CAAAA,IAAoB,MAAM;AASjF,SANmBwB,KAAKC,IACX,MAAZb,GACmB,MAAnBoB,GACAC,CAAAA;AAIF;AA0CA,SAASjB,EAAWmB;AACnB,QAAMS,IAAU;AAChB,WAASlC,IAAI,GAAGA,IAAIyB,EAAEjC,SAAS,GAAGQ,IACjCkC,CAAAA,EAAQC,KAAKV,EAAEW,UAAUpC,GAAGA,IAAI,CAAA,CAAA;AAEjC,SAAOkC;AACR;"}
@@ -0,0 +1,2 @@
1
+ "use strict";function m(s){const u=[];for(let r=0;r<s.length-1;r++)u.push(s.substring(r,r+2));return u}exports.similarity=function(s,u){if(!s||!u)return 0;if(s===u)return 1;const r=s.toLowerCase().trim(),o=u.toLowerCase().trim();if(r===o)return 1;if(o.startsWith(r))return .95+.05*(r.length/o.length);const c=o.split(/[\s\-_]+/);for(const n of c)if(n.startsWith(r))return .85*(1-c.indexOf(n)/c.length*.1);if(o.includes(r))return .7*(1-o.indexOf(r)/o.length*.2);if(function(n,l){let e=0,t=0;for(;e<n.length&&t<l.length;)n[e]===l[t]&&e++,t++;return e===n.length}(r,o))return .5;const d=function(n,l){if(n.length<2||l.length<2)return 0;const e=m(n),t=m(l);let f=0;const i=new Array(t.length).fill(!1);for(const g of e)for(let h=0;h<t.length;h++)if(!i[h]&&t[h]===g){f++,i[h]=!0;break}return 2*f/(e.length+t.length)}(r,o),a=Math.max(r.length,o.length),x=function(n,l){if(n.length===0)return l.length;if(l.length===0)return n.length;const e=[];for(let t=0;t<=l.length;t++)e[t]=[t];for(let t=0;t<=n.length;t++)e[0][t]=t;for(let t=1;t<=l.length;t++)for(let f=1;f<=n.length;f++){const i=n[f-1]===l[t-1]?0:1;e[t][f]=Math.min(e[t-1][f]+1,e[t][f-1]+1,e[t-1][f-1]+i)}return e[l.length][n.length]}(r,o),y=a?1-x/a:0,b=function(n,l){const e=i=>i.split("").reduce((g,h)=>(g[h]=(g[h]||0)+1,g),{}),t=e(n),f=e(l);return Object.keys(t).every(i=>(f[i]||0)>=t[i])}(r,o)?.3:0;return Math.max(.4*d,.4*y,b)};
2
+ //# sourceMappingURL=search-DWW8IoOp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"search-DWW8IoOp.cjs","sources":["../src/utils/search.ts"],"sourcesContent":["/**\n * Calculate similarity score between two strings.\n * Returns a value between 0 (no match) and 1 (exact match).\n * Optimized for autocomplete with prioritization of start matches and whole words.\n *\n * @param query The search query string\n * @param target The target string to compare against\n * @returns A similarity score from 0 to 1\n */\nexport function similarity(query: string, target: string): number {\n\t// Handle edge cases\n\tif (!query || !target) return 0\n\tif (query === target) return 1\n\n\t// Normalize strings for comparison\n\tconst normalizedQuery = query.toLowerCase().trim()\n\tconst normalizedTarget = target.toLowerCase().trim()\n\n\t// 1. Exact match (case-insensitive)\n\tif (normalizedQuery === normalizedTarget) return 1\n\n\t// 2. Target starts with query (highest priority for autocomplete)\n\tif (normalizedTarget.startsWith(normalizedQuery)) {\n\t\t// Give higher score to shorter targets (more precise matches)\n\t\tconst lengthRatio = normalizedQuery.length / normalizedTarget.length\n\t\treturn 0.95 + (lengthRatio * 0.05) // Score between 0.95 and 1.0\n\t}\n\n\t// 3. Word boundary match (query matches start of any word in target)\n\tconst words = normalizedTarget.split(/[\\s\\-_]+/)\n\tfor (const word of words) {\n\t\tif (word.startsWith(normalizedQuery)) {\n\t\t\t// Score based on which word matched (earlier words score higher)\n\t\t\tconst wordIndex = words.indexOf(word)\n\t\t\tconst wordPositionScore = 1 - (wordIndex / words.length) * 0.1\n\t\t\treturn 0.85 * wordPositionScore // Score between 0.765 and 0.85\n\t\t}\n\t}\n\n\t// 4. Direct substring match (query appears anywhere in target)\n\tif (normalizedTarget.includes(normalizedQuery)) {\n\t\t// Score based on position (earlier position scores higher)\n\t\tconst position = normalizedTarget.indexOf(normalizedQuery)\n\t\tconst positionScore = 1 - (position / normalizedTarget.length) * 0.2\n\t\treturn 0.7 * positionScore // Score between 0.56 and 0.7\n\t}\n\n\t// 5. Subsequence check (all query chars appear in order)\n\tif (isSubsequence(normalizedQuery, normalizedTarget)) {\n\t\treturn 0.5\n\t}\n\n\t// 6. Fuzzy matching for typos\n\t// 6a. Dice coefficient (good for similar words)\n\tconst diceScore = diceCoefficient(normalizedQuery, normalizedTarget)\n\t\n\t// 6b. Levenshtein distance (good for typos)\n\tconst maxLength = Math.max(normalizedQuery.length, normalizedTarget.length)\n\tconst levenshteinDistance = calculateLevenshtein(normalizedQuery, normalizedTarget)\n\tconst levenshteinScore = maxLength ? 1 - levenshteinDistance / maxLength : 0\n\n\t// 6c. Character frequency match (anagram-like)\n\tconst anagramScore = hasAllCharacters(normalizedQuery, normalizedTarget) ? 0.3 : 0\n\n\t// Combine fuzzy scores with weights\n\tconst fuzzyScore = Math.max(\n\t\tdiceScore * 0.4,\n\t\tlevenshteinScore * 0.4,\n\t\tanagramScore\n\t)\n\n\treturn fuzzyScore\n}\n\n// Keep the rest of the helper functions as they are...\n/**\n * Check if string 'sub' is a subsequence of string 'str'.\n * All characters in 'sub' must appear in order in 'str'.\n */\nfunction isSubsequence(sub: string, str: string): boolean {\n\tlet i = 0,\n\t\tj = 0\n\twhile (i < sub.length && j < str.length) {\n\t\tif (sub[i] === str[j]) i++\n\t\tj++\n\t}\n\treturn i === sub.length\n}\n\n/**\n * Check if all characters in 'query' are present in 'target'.\n * For example, \"aovc\" matches \"avocados\" (anagram subset matching).\n */\nfunction hasAllCharacters(query: string, target: string): boolean {\n\tconst countChars = (s: string): Record<string, number> => {\n\t\treturn s.split('').reduce(\n\t\t\t(acc, char) => {\n\t\t\t\tacc[char] = (acc[char] || 0) + 1\n\t\t\t\treturn acc\n\t\t\t},\n\t\t\t{} as Record<string, number>,\n\t\t)\n\t}\n\n\tconst queryCount = countChars(query)\n\tconst targetCount = countChars(target)\n\n\treturn Object.keys(queryCount).every(char => (targetCount[char] || 0) >= queryCount[char])\n}\n\n/**\n * Generate bigrams for a string.\n * A bigram is a sequence of two adjacent characters.\n */\nfunction getBigrams(s: string): string[] {\n\tconst bigrams = []\n\tfor (let i = 0; i < s.length - 1; i++) {\n\t\tbigrams.push(s.substring(i, i + 2))\n\t}\n\treturn bigrams\n}\n\n/**\n * Compute Dice's coefficient for two strings based on bigrams.\n * Returns a value between 0 (no similarity) and 1 (perfect match).\n */\nfunction diceCoefficient(s1: string, s2: string): number {\n\tif (s1.length < 2 || s2.length < 2) return 0\n\n\tconst bigrams1 = getBigrams(s1)\n\tconst bigrams2 = getBigrams(s2)\n\n\tlet intersection = 0\n\tconst used = new Array(bigrams2.length).fill(false)\n\n\tfor (const bigram of bigrams1) {\n\t\tfor (let i = 0; i < bigrams2.length; i++) {\n\t\t\tif (!used[i] && bigrams2[i] === bigram) {\n\t\t\t\tintersection++\n\t\t\t\tused[i] = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn (2 * intersection) / (bigrams1.length + bigrams2.length)\n}\n\n/**\n * Calculate Levenshtein distance between two strings.\n */\nfunction calculateLevenshtein(a: string, b: string): number {\n\tif (a.length === 0) return b.length\n\tif (b.length === 0) return a.length\n\n\tconst matrix: number[][] = []\n\n\t// Initialize the matrix\n\tfor (let i = 0; i <= b.length; i++) {\n\t\tmatrix[i] = [i]\n\t}\n\tfor (let j = 0; j <= a.length; j++) {\n\t\tmatrix[0][j] = j\n\t}\n\n\t// Calculate distances\n\tfor (let i = 1; i <= b.length; i++) {\n\t\tfor (let j = 1; j <= a.length; j++) {\n\t\t\tconst cost = a[j - 1] === b[i - 1] ? 0 : 1\n\t\t\tmatrix[i][j] = Math.min(\n\t\t\t\tmatrix[i - 1][j] + 1, // deletion\n\t\t\t\tmatrix[i][j - 1] + 1, // insertion\n\t\t\t\tmatrix[i - 1][j - 1] + cost, // substitution\n\t\t\t)\n\t\t}\n\t}\n\n\treturn matrix[b.length][a.length]\n}\n"],"names":["getBigrams","s","bigrams","i","length","push","substring","query","target","normalizedQuery","toLowerCase","trim","normalizedTarget","startsWith","words","split","word","indexOf","includes","sub","str","j","diceScore","s1","s2","bigrams1","bigrams2","intersection","used","Array","fill","bigram","maxLength","Math","max","levenshteinDistance","a","b","matrix","cost","min","levenshteinScore","anagramScore","countChars","reduce","acc","char","queryCount","targetCount","Object","keys","every"],"mappings":"aAkHA,SAASA,EAAWC,EAAAA,CACnB,MAAMC,EAAU,CAAA,EAChB,QAASC,EAAI,EAAGA,EAAIF,EAAEG,OAAS,EAAGD,IACjCD,EAAQG,KAAKJ,EAAEK,UAAUH,EAAGA,EAAI,IAEjC,OAAOD,CACR,oBA/GO,SAAoBK,EAAeC,EAAAA,CAEzC,IAAKD,GAAAA,CAAUC,EAAQ,MAAO,GAC9B,GAAID,IAAUC,EAAQ,MAAO,GAG7B,MAAMC,EAAkBF,EAAMG,YAAAA,EAAcC,KAAAA,EACtCC,EAAmBJ,EAAOE,YAAAA,EAAcC,OAG9C,GAAIF,IAAoBG,EAAkB,MAAO,GAGjD,GAAIA,EAAiBC,WAAWJ,GAG/B,MAAO,KAAsB,KADTA,EAAgBL,OAASQ,EAAiBR,QAK/D,MAAMU,EAAQF,EAAiBG,MAAM,UAAA,EACrC,UAAWC,KAAQF,EAClB,GAAIE,EAAKH,WAAWJ,CAAAA,EAInB,MAAO,MADmB,EADRK,EAAMG,QAAQD,CAAAA,EACWF,EAAMV,OAAU,IAM7D,GAAIQ,EAAiBM,SAAST,CAAAA,EAI7B,MAAO,KADe,EADLG,EAAiBK,QAAQR,GACJG,EAAiBR,OAAU,IAKlE,GA+BD,SAAuBe,EAAaC,EAAAA,CACnC,IAAIjB,EAAI,EACPkB,EAAI,EACL,KAAOlB,EAAIgB,EAAIf,QAAUiB,EAAID,EAAIhB,QAC5Be,EAAIhB,CAAAA,IAAOiB,EAAIC,IAAIlB,IACvBkB,IAED,OAAOlB,IAAMgB,EA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nC,EAAI,CAAA,EAAGkB,CAAAA,EAAK,EACnBiB,EAAOnC,CAAAA,EAAGkB,EAAI,CAAA,EAAK,EACnBiB,EAAOnC,EAAI,CAAA,EAAGkB,EAAI,CAAA,EAAKkB,CAAAA,CAEzB,CAGD,OAAOD,EAAOD,EAAEjC,MAAAA,EAAQgC,EAAEhC,OAC3B,EAxHkDK,EAAiBG,CAAAA,EAC5D6B,EAAmBT,EAAY,EAAIG,EAAsBH,EAAY,EAGrEU,EA+BP,SAA0BnC,EAAeC,EAAAA,CACxC,MAAMmC,EAAc1C,GACZA,EAAEc,MAAM,EAAA,EAAI6B,OAClB,CAACC,EAAKC,KACLD,EAAIC,CAAAA,GAASD,EAAIC,CAAAA,GAAS,GAAK,EACxBD,GAER,CAAA,GAIIE,EAAaJ,EAAWpC,GACxByC,EAAcL,EAAWnC,GAE/B,OAAOyC,OAAOC,KAAKH,CAAAA,EAAYI,MAAML,IAASE,EAAYF,CAAAA,GAAS,IAAMC,EAAWD,CAAAA,CAAAA,CACrF,EA9CuCrC,EAAiBG,GAAoB,GAAM,EASjF,OANmBqB,KAAKC,IACX,GAAZZ,EACmB,GAAnBmB,EACAC,CAAAA,CAIF"}
@@ -8,9 +8,9 @@ import { css as f, html as b } from "lit";
8
8
  import { n as O, e as j } from "./provide-tcktw8xB.js";
9
9
  import { repeat as H } from "lit/directives/repeat.js";
10
10
  const g = O("tabs");
11
- var S = Object.defineProperty, B = Object.getOwnPropertyDescriptor, p = (t, e, a, s) => {
12
- for (var l, o = s > 1 ? void 0 : s ? B(e, a) : e, n = t.length - 1; n >= 0; n--) (l = t[n]) && (o = (s ? l(e, a, o) : l(o)) || o);
13
- return s && o && S(e, a, o), o;
11
+ var B = Object.defineProperty, P = Object.getOwnPropertyDescriptor, p = (t, e, a, s) => {
12
+ for (var l, o = s > 1 ? void 0 : s ? P(e, a) : e, n = t.length - 1; n >= 0; n--) (l = t[n]) && (o = (s ? l(e, a, o) : l(o)) || o);
13
+ return s && o && B(e, a, o), o;
14
14
  };
15
15
  let c = class extends u(f`
16
16
  :host {
@@ -22,9 +22,9 @@ let c = class extends u(f`
22
22
  }
23
23
  };
24
24
  p([h({ type: String, reflect: !0 })], c.prototype, "label", 2), p([h({ type: String, reflect: !0 })], c.prototype, "value", 2), p([h({ type: Boolean, reflect: !0 })], c.prototype, "active", 2), p([E({ context: g, subscribe: !0 }), v()], c.prototype, "mode", 2), c = p([y("schmancy-tab")], c);
25
- var P = Object.defineProperty, M = Object.getOwnPropertyDescriptor, i = (t, e, a, s) => {
25
+ var S = Object.defineProperty, M = Object.getOwnPropertyDescriptor, i = (t, e, a, s) => {
26
26
  for (var l, o = s > 1 ? void 0 : s ? M(e, a) : e, n = t.length - 1; n >= 0; n--) (l = t[n]) && (o = (s ? l(e, a, o) : l(o)) || o);
27
- return s && o && P(e, a, o), o;
27
+ return s && o && S(e, a, o), o;
28
28
  };
29
29
  let r = class extends u(f`
30
30
  :host {
@@ -101,4 +101,4 @@ let r = class extends u(f`
101
101
  i([j({ context: g }), h({ type: String })], r.prototype, "mode", 2), i([h({ type: Boolean })], r.prototype, "rounded", 2), i([h({ type: String, reflect: !0 })], r.prototype, "activeTab", 2), i([$({ flatten: !0 })], r.prototype, "tabsElements", 2), i([m("#tabsNavigation")], r.prototype, "navElement", 2), i([m("#tabsContent")], r.prototype, "tabsContent", 2), i([v()], r.prototype, "tabs", 2), r = i([y("schmancy-tab-group")], r);
102
102
  customElements.define("schmancy-tabs-group", class extends r {
103
103
  });
104
- //# sourceMappingURL=tabs-compatibility-DsOH4PSw.js.map
104
+ //# sourceMappingURL=tabs-compatibility-BEXurIiZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabs-compatibility-DsOH4PSw.js","sources":["../src/tabs/context.ts","../src/tabs/tab.ts","../src/tabs/tabs-group.ts","../src/tabs/tabs-compatibility.ts"],"sourcesContent":["import { createContext } from '@lit/context'\n\nexport type TSchmancyTabsMode = 'scroll' | 'tabs'\n\nexport const SchmancyTabsModeContext = createContext<TSchmancyTabsMode>('tabs')\n","import { consume } from '@lit/context'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { SchmancyTabsModeContext } from './context'\n\n@customElement('schmancy-tab')\nexport default class SchmancyTab extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\t@property({ type: String, reflect: true }) label\n\t@property({ type: String, reflect: true }) value\n\t@property({ type: Boolean, reflect: true }) active!: boolean\n\n\t@consume({ context: SchmancyTabsModeContext, subscribe: true })\n\t@state()\n\tmode\n\tprotected render(): unknown {\n\t\treturn html` <slot .hidden=${this.mode === 'tabs' ? !this.active : false}></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-tab': SchmancyTab\n\t}\n}\n","import { provide } from '@lit/context'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { filter, fromEvent, interval, map, take, throttleTime } from 'rxjs'\nimport { SchmancyTabsModeContext, TSchmancyTabsMode } from './context'\nimport SchmancyTab from './tab'\n\n/**\n * @slot - The content of the tab group\n * @fires tab-changed - The event fired when the tab is changed\n */\n@customElement('schmancy-tab-group')\nexport default class SchmancyTabGroup extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\t@provide({ context: SchmancyTabsModeContext })\n\t@property({ type: String })\n\tmode: TSchmancyTabsMode = 'tabs'\n\n\t@property({ type: Boolean }) rounded = true\n\n\t@property({ type: String, reflect: true }) activeTab: string\n\t@queryAssignedElements({\n\t\tflatten: true,\n\t})\n\tprivate tabsElements!: Array<SchmancyTab>\n\n\t@query('#tabsNavigation') navElement!: HTMLElement\n\t@query('#tabsContent') tabsContent!: HTMLElement\n\n\t@state()\n\tprivate tabs: Array<SchmancyTab> = []\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(window, 'scroll')\n\t\t\t.pipe(\n\t\t\t\tthrottleTime(1000),\n\t\t\t\tfilter(() => this.mode === 'scroll'),\n\t\t\t\tmap(() => {\n\t\t\t\t\tlet closestDiv = null\n\t\t\t\t\tlet closestDistance = Infinity\n\t\t\t\t\tthis.tabsElements.forEach(div => {\n\t\t\t\t\t\tconst distance =\n\t\t\t\t\t\t\tdiv.getBoundingClientRect().top - this.navElement.clientHeight + document.body.offsetHeight / 3\n\n\t\t\t\t\t\tif (distance < closestDistance && distance > 0) {\n\t\t\t\t\t\t\tclosestDistance = distance\n\t\t\t\t\t\t\tclosestDiv = div\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\treturn closestDiv\n\t\t\t\t}),\n\t\t\t\tfilter((el: SchmancyTab | null) => el !== null),\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (el: SchmancyTab) => {\n\t\t\t\t\tthis.activeTab = el.value\n\t\t\t\t},\n\t\t\t})\n\t}\n\n\tfirstUpdated() {\n\t\tinterval(0)\n\t\t\t.pipe(\n\t\t\t\tfilter(() => !!this.navElement.clientHeight),\n\t\t\t\ttake(1),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.tabsElements.forEach(tab => {\n\t\t\t\t\tif (this.mode === 'scroll') tab.style.paddingTop = this.navElement.clientHeight + 'px'\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\thydrateTabs() {\n\t\tthis.tabs = this.tabsElements\n\t\tif (!this.activeTab && this.tabsElements[0]) {\n\t\t\tthis.activeTab = this.tabsElements[0].value\n\t\t\tthis.tabsElements[0].active = true\n\t\t} else {\n\t\t\tthis.tabsElements.forEach(tab => {\n\t\t\t\tif (tab.value === this.activeTab) tab.active = true\n\t\t\t\telse tab.active = false\n\t\t\t})\n\t\t}\n\t\tconst lastTab = this.tabs?.[-1]\n\t\tif (lastTab) {\n\t\t\tlastTab.style.paddingBottom = lastTab.offsetHeight + 'px'\n\t\t}\n\t}\n\n\ttabChanged(selectedTab: { label: string; value: string }) {\n\t\tlet activeTabElement: SchmancyTab | undefined\n\t\tthis.tabsElements.forEach(tab => {\n\t\t\tif (tab.value === selectedTab.value) {\n\t\t\t\ttab.active = true\n\t\t\t\tactiveTabElement = tab\n\t\t\t\t// scroll to the tab\n\t\t\t\tif (this.mode === 'scroll') {\n\t\t\t\t\t// Scroll the desired element into view\n\t\t\t\t\tactiveTabElement.scrollIntoView({\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\tblock: 'start',\n\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttab.active = false\n\t\t\t}\n\t\t})\n\t\tthis.mode === 'tabs' && (this.activeTab = selectedTab.value)\n\t\tthis.dispatchEvent(new CustomEvent('tab-changed', { detail: this.activeTab }))\n\t}\n\n\tprotected render(): unknown {\n\t\tconst tabs = {\n\t\t\t'bg-surface-default color-surface-on': true,\n\t\t\t'flex z-50': true,\n\t\t\t'sticky top-0 shadow-md': this.mode === 'scroll',\n\t\t\t'rounded-full': this.rounded,\n\t\t}\n\n\t\tconst activeTab = {\n\t\t\t'text-primary-default': true,\n\t\t}\n\n\t\tconst inactiveTab = {\n\t\t\t'border-transparent': true,\n\t\t\t'hover:text-gray-700': true,\n\t\t\t'hover:border-gray-300': true,\n\t\t\t'text-gray-500': true,\n\t\t}\n\n\t\treturn html`\n\t\t\t<section id=\"tabsNavigation\" class=\"${this.classMap(tabs)}\" aria-label=\"Tabs\">\n\t\t\t\t${repeat(\n\t\t\t\t\tthis.tabs,\n\t\t\t\t\ttab => tab.value,\n\t\t\t\t\ttab => html`\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.tabChanged({\n\t\t\t\t\t\t\t\t\tlabel: tab.label,\n\t\t\t\t\t\t\t\t\tvalue: tab.value,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-current=\"page\"\n\t\t\t\t\t\t\tclass=\"h-auto relative\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"px-4 py-3 ${this.activeTab === tab.value\n\t\t\t\t\t\t\t\t\t? this.classMap(activeTab)\n\t\t\t\t\t\t\t\t\t: this.classMap(inactiveTab)}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<schmancy-typography class=\"h-full align-middle flex \" type=\"title\" token=\"md\" weight=\"medium\">\n\t\t\t\t\t\t\t\t\t${tab.label}\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t.hidden=${this.activeTab !== tab.value}\n\t\t\t\t\t\t\t\t\tclass=\"border-primary-default absolute bottom-0 inset-x-6 border-solid border-2 rounded-t-full\"\n\t\t\t\t\t\t\t\t></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</section>\n\t\t\t<schmancy-divider class=\"px-6\"></schmancy-divider>\n\t\t\t<section id=\"tabsContent\">\n\t\t\t\t<slot @slotchange=${() => this.hydrateTabs()}></slot>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-tab-group': SchmancyTabGroup\n\t}\n}\n","/**\n * Compatibility layer for schmancy-tabs-group (which is the more correct plural form)\n * that aliases to schmancy-tab-group for backward compatibility\n */\nimport SchmancyTabGroup from './tabs-group';\n\n// Create a simple class extends the original tab group\nclass SchmancyTabsGroup extends SchmancyTabGroup {}\n\n// Register the alias element\ncustomElements.define('schmancy-tabs-group', SchmancyTabsGroup);\n\nexport default SchmancyTabsGroup;\n\n// Add the type definition to ensure TypeScript recognizes the element\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-tabs-group': SchmancyTabsGroup;\n }\n}"],"names":["SchmancyTabsModeContext","createContext","SchmancyTab","TailwindElement","css","render","html","this","mode","active","__decorateClass","property","type","String","reflect","prototype","Boolean","consume","context","subscribe","state","customElement","SchmancyTabGroup","constructor","super","arguments","rounded","tabs","connectedCallback","fromEvent","window","pipe","throttleTime","filter","map","closestDiv","closestDistance","Infinity","tabsElements","forEach","div","distance","getBoundingClientRect","top","navElement","clientHeight","document","body","offsetHeight","el","next","activeTab","value","firstUpdated","interval","take","tab","style","paddingTop","hydrateTabs","lastTab","paddingBottom","selectedTab","activeTabElement","scrollIntoView","behavior","block","inline","dispatchEvent","CustomEvent","detail","inactiveTab","classMap","repeat","tabChanged","label","provide","queryAssignedElements","flatten","query","customElements","define"],"mappings":";;;;;;;;;AAIO,MAAMA,IAA0BC,EAAiC,MAAA;;;;;ACGxE,IAAqBC,IAArB,cAAyCC,EAAgBC;AAAAA;AAAAA;AAAAA;AAAAA;EAY9C,SAAAC;AACT,WAAOC,mBAAsBC,KAAKC,SAAS,UAATA,CAAmBD,KAAKE,MAAAA;AAAAA,EAC3D;AAAA;AAT2CC,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,GAAS,CAAA,CAAA,GALfZ,EAKuBa,WAAA,SAAA,CAAA,GACAL,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,QANNZ,EAMuBa,WAAA,SAAA,CAAA,GACCL,EAAA,CAA3CC,EAAS,EAAEC,MAAMI,SAASF,SAAAA,GAAS,CAAA,CAAA,GAPhBZ,EAOwBa,WAAA,UAAA,CAAA,GAI5CL,EAAA,CAFCO,EAAQ,EAAEC,SAASlB,GAAyBmB,WAAAA,GAAW,CAAA,GACvDC,EAAAA,CAAAA,GAVmBlB,EAWpBa,WAAA,QAAA,CAAA,GAXoBb,IAArBQ,EAAA,CADCW,EAAc,cAAA,CAAA,GACMnB,CAAAA;;;;;ACOrB,IAAqBoB,IAArB,cAA8CnB,EAAgBC;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EAAIJ,QACvC7C,KAAKiE,SAASrB,CAAAA,IACd5C,KAAKiE,SAASD,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,WAGdf,EAAImB,KAAAA;AAAAA;AAAAA;AAAAA,mBAGIpE,KAAK4C,cAAcK,EAAIJ,KAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;;;;wBAUlB,MAAM7C,KAAKoD,YAAAA,CAAAA;AAAAA;AAAAA;AAAAA,EAGlC;AAAA;AA3JAjD,EAAA,CAFCkE,EAAQ,EAAE1D,SAASlB,MACnBW,EAAS,EAAEC,MAAMC,OAAAA,CAAAA,CAAAA,GANES,EAOpBP,WAAA,QAAA,CAAA,GAE6BL,EAAA,CAA5BC,EAAS,EAAEC,MAAMI,QAAAA,CAAAA,CAAAA,GATEM,EASSP,WAAA,WAAA,CAAA,GAEcL,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,YAAS,CAAA,CAAA,GAXfQ,EAWuBP,WAAA,aAAA,CAAA,GAInCL,EAAA,CAHPmE,EAAsB,EACtBC,SAAAA,QAbmBxD,EAeZP,WAAA,gBAAA,CAAA,GAEkBL,EAAA,CAAzBqE,EAAM,iBAAA,CAAA,GAjBazD,EAiBMP,WAAA,cAAA,CAAA,GACHL,EAAA,CAAtBqE,EAAM,cAAA,CAAA,GAlBazD,EAkBGP,WAAA,eAAA,IAGfL,EAAA,CADPU,EAAAA,CAAAA,GApBmBE,EAqBZP,WAAA,QAAA,CAAA,GArBYO,IAArBZ,EAAA,CADCW,EAAc,oBAAA,CAAA,GACMC;ACJrB0D,eAAeC,OAAO,uBAHtB,cAAgC3D,EAAAA;AAAAA,CAAAA;"}
1
+ {"version":3,"file":"tabs-compatibility-BEXurIiZ.js","sources":["../src/tabs/context.ts","../src/tabs/tab.ts","../src/tabs/tabs-group.ts","../src/tabs/tabs-compatibility.ts"],"sourcesContent":["import { createContext } from '@lit/context'\n\nexport type TSchmancyTabsMode = 'scroll' | 'tabs'\n\nexport const SchmancyTabsModeContext = createContext<TSchmancyTabsMode>('tabs')\n","import { consume } from '@lit/context'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\nimport { SchmancyTabsModeContext } from './context'\n\n@customElement('schmancy-tab')\nexport default class SchmancyTab extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\t@property({ type: String, reflect: true }) label\n\t@property({ type: String, reflect: true }) value\n\t@property({ type: Boolean, reflect: true }) active!: boolean\n\n\t@consume({ context: SchmancyTabsModeContext, subscribe: true })\n\t@state()\n\tmode\n\tprotected render(): unknown {\n\t\treturn html` <slot .hidden=${this.mode === 'tabs' ? !this.active : false}></slot> `\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-tab': SchmancyTab\n\t}\n}\n","import { provide } from '@lit/context'\nimport { TailwindElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query, queryAssignedElements, state } from 'lit/decorators.js'\nimport { repeat } from 'lit/directives/repeat.js'\nimport { filter, fromEvent, interval, map, take, throttleTime } from 'rxjs'\nimport { SchmancyTabsModeContext, TSchmancyTabsMode } from './context'\nimport SchmancyTab from './tab'\n\n/**\n * @slot - The content of the tab group\n * @fires tab-changed - The event fired when the tab is changed\n */\n@customElement('schmancy-tab-group')\nexport default class SchmancyTabGroup extends TailwindElement(css`\n\t:host {\n\t\tdisplay: block;\n\t}\n`) {\n\t@provide({ context: SchmancyTabsModeContext })\n\t@property({ type: String })\n\tmode: TSchmancyTabsMode = 'tabs'\n\n\t@property({ type: Boolean }) rounded = true\n\n\t@property({ type: String, reflect: true }) activeTab: string\n\t@queryAssignedElements({\n\t\tflatten: true,\n\t})\n\tprivate tabsElements!: Array<SchmancyTab>\n\n\t@query('#tabsNavigation') navElement!: HTMLElement\n\t@query('#tabsContent') tabsContent!: HTMLElement\n\n\t@state()\n\tprivate tabs: Array<SchmancyTab> = []\n\n\tconnectedCallback(): void {\n\t\tsuper.connectedCallback()\n\t\tfromEvent(window, 'scroll')\n\t\t\t.pipe(\n\t\t\t\tthrottleTime(1000),\n\t\t\t\tfilter(() => this.mode === 'scroll'),\n\t\t\t\tmap(() => {\n\t\t\t\t\tlet closestDiv = null\n\t\t\t\t\tlet closestDistance = Infinity\n\t\t\t\t\tthis.tabsElements.forEach(div => {\n\t\t\t\t\t\tconst distance =\n\t\t\t\t\t\t\tdiv.getBoundingClientRect().top - this.navElement.clientHeight + document.body.offsetHeight / 3\n\n\t\t\t\t\t\tif (distance < closestDistance && distance > 0) {\n\t\t\t\t\t\t\tclosestDistance = distance\n\t\t\t\t\t\t\tclosestDiv = div\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t\treturn closestDiv\n\t\t\t\t}),\n\t\t\t\tfilter((el: SchmancyTab | null) => el !== null),\n\t\t\t)\n\t\t\t.subscribe({\n\t\t\t\tnext: (el: SchmancyTab) => {\n\t\t\t\t\tthis.activeTab = el.value\n\t\t\t\t},\n\t\t\t})\n\t}\n\n\tfirstUpdated() {\n\t\tinterval(0)\n\t\t\t.pipe(\n\t\t\t\tfilter(() => !!this.navElement.clientHeight),\n\t\t\t\ttake(1),\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis.tabsElements.forEach(tab => {\n\t\t\t\t\tif (this.mode === 'scroll') tab.style.paddingTop = this.navElement.clientHeight + 'px'\n\t\t\t\t})\n\t\t\t})\n\t}\n\n\thydrateTabs() {\n\t\tthis.tabs = this.tabsElements\n\t\tif (!this.activeTab && this.tabsElements[0]) {\n\t\t\tthis.activeTab = this.tabsElements[0].value\n\t\t\tthis.tabsElements[0].active = true\n\t\t} else {\n\t\t\tthis.tabsElements.forEach(tab => {\n\t\t\t\tif (tab.value === this.activeTab) tab.active = true\n\t\t\t\telse tab.active = false\n\t\t\t})\n\t\t}\n\t\tconst lastTab = this.tabs?.[-1]\n\t\tif (lastTab) {\n\t\t\tlastTab.style.paddingBottom = lastTab.offsetHeight + 'px'\n\t\t}\n\t}\n\n\ttabChanged(selectedTab: { label: string; value: string }) {\n\t\tlet activeTabElement: SchmancyTab | undefined\n\t\tthis.tabsElements.forEach(tab => {\n\t\t\tif (tab.value === selectedTab.value) {\n\t\t\t\ttab.active = true\n\t\t\t\tactiveTabElement = tab\n\t\t\t\t// scroll to the tab\n\t\t\t\tif (this.mode === 'scroll') {\n\t\t\t\t\t// Scroll the desired element into view\n\t\t\t\t\tactiveTabElement.scrollIntoView({\n\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\tblock: 'start',\n\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttab.active = false\n\t\t\t}\n\t\t})\n\t\tthis.mode === 'tabs' && (this.activeTab = selectedTab.value)\n\t\tthis.dispatchEvent(new CustomEvent('tab-changed', { detail: this.activeTab }))\n\t}\n\n\tprotected render(): unknown {\n\t\tconst tabs = {\n\t\t\t'bg-surface-default color-surface-on': true,\n\t\t\t'flex z-50': true,\n\t\t\t'sticky top-0 shadow-md': this.mode === 'scroll',\n\t\t\t'rounded-full': this.rounded,\n\t\t}\n\n\t\tconst activeTab = {\n\t\t\t'text-primary-default': true,\n\t\t}\n\n\t\tconst inactiveTab = {\n\t\t\t'border-transparent': true,\n\t\t\t'hover:text-gray-700': true,\n\t\t\t'hover:border-gray-300': true,\n\t\t\t'text-gray-500': true,\n\t\t}\n\n\t\treturn html`\n\t\t\t<section id=\"tabsNavigation\" class=\"${this.classMap(tabs)}\" aria-label=\"Tabs\">\n\t\t\t\t${repeat(\n\t\t\t\t\tthis.tabs,\n\t\t\t\t\ttab => tab.value,\n\t\t\t\t\ttab => html`\n\t\t\t\t\t\t<schmancy-button\n\t\t\t\t\t\t\t@click=${() => {\n\t\t\t\t\t\t\t\tthis.tabChanged({\n\t\t\t\t\t\t\t\t\tlabel: tab.label,\n\t\t\t\t\t\t\t\t\tvalue: tab.value,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\taria-current=\"page\"\n\t\t\t\t\t\t\tclass=\"h-auto relative\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"px-4 py-3 ${this.activeTab === tab.value\n\t\t\t\t\t\t\t\t\t? this.classMap(activeTab)\n\t\t\t\t\t\t\t\t\t: this.classMap(inactiveTab)}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<schmancy-typography class=\"h-full align-middle flex \" type=\"title\" token=\"md\" weight=\"medium\">\n\t\t\t\t\t\t\t\t\t${tab.label}\n\t\t\t\t\t\t\t\t</schmancy-typography>\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t.hidden=${this.activeTab !== tab.value}\n\t\t\t\t\t\t\t\t\tclass=\"border-primary-default absolute bottom-0 inset-x-6 border-solid border-2 rounded-t-full\"\n\t\t\t\t\t\t\t\t></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</schmancy-button>\n\t\t\t\t\t`,\n\t\t\t\t)}\n\t\t\t</section>\n\t\t\t<schmancy-divider class=\"px-6\"></schmancy-divider>\n\t\t\t<section id=\"tabsContent\">\n\t\t\t\t<slot @slotchange=${() => this.hydrateTabs()}></slot>\n\t\t\t</section>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-tab-group': SchmancyTabGroup\n\t}\n}\n","/**\n * Compatibility layer for schmancy-tabs-group (which is the more correct plural form)\n * that aliases to schmancy-tab-group for backward compatibility\n */\nimport SchmancyTabGroup from './tabs-group';\n\n// Create a simple class extends the original tab group\nclass SchmancyTabsGroup extends SchmancyTabGroup {}\n\n// Register the alias element\ncustomElements.define('schmancy-tabs-group', SchmancyTabsGroup);\n\nexport default SchmancyTabsGroup;\n\n// Add the type definition to ensure TypeScript recognizes the element\ndeclare global {\n interface HTMLElementTagNameMap {\n 'schmancy-tabs-group': SchmancyTabsGroup;\n }\n}"],"names":["SchmancyTabsModeContext","createContext","SchmancyTab","TailwindElement","css","render","html","this","mode","active","__decorateClass","property","type","String","reflect","prototype","Boolean","consume","context","subscribe","state","customElement","SchmancyTabGroup","constructor","super","arguments","rounded","tabs","connectedCallback","fromEvent","window","pipe","throttleTime","filter","map","closestDiv","closestDistance","Infinity","tabsElements","forEach","div","distance","getBoundingClientRect","top","navElement","clientHeight","document","body","offsetHeight","el","next","activeTab","value","firstUpdated","interval","take","tab","style","paddingTop","hydrateTabs","lastTab","paddingBottom","selectedTab","activeTabElement","scrollIntoView","behavior","block","inline","dispatchEvent","CustomEvent","detail","inactiveTab","classMap","repeat","tabChanged","label","provide","queryAssignedElements","flatten","query","customElements","define"],"mappings":";;;;;;;;;AAIO,MAAMA,IAA0BC,EAAiC,MAAA;;;;;ACGxE,IAAqBC,IAArB,cAAyCC,EAAgBC;AAAAA;AAAAA;AAAAA;AAAAA;EAY9C,SAAAC;AACT,WAAOC,mBAAsBC,KAAKC,SAAS,UAATA,CAAmBD,KAAKE,MAAAA;AAAAA,EAC3D;AAAA;AAT2CC,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,GAAS,CAAA,CAAA,GALfZ,EAKuBa,WAAA,SAAA,CAAA,GACAL,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,SAAAA,QANNZ,EAMuBa,WAAA,SAAA,CAAA,GACCL,EAAA,CAA3CC,EAAS,EAAEC,MAAMI,SAASF,SAAAA,GAAS,CAAA,CAAA,GAPhBZ,EAOwBa,WAAA,UAAA,CAAA,GAI5CL,EAAA,CAFCO,EAAQ,EAAEC,SAASlB,GAAyBmB,WAAAA,GAAW,CAAA,GACvDC,EAAAA,CAAAA,GAVmBlB,EAWpBa,WAAA,QAAA,CAAA,GAXoBb,IAArBQ,EAAA,CADCW,EAAc,cAAA,CAAA,GACMnB,CAAAA;;;;;ACOrB,IAAqBoB,IAArB,cAA8CnB,EA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AAcK,EAAIJ,QACvC7C,KAAKiE,SAASrB,CAAAA,IACd5C,KAAKiE,SAASD,CAAAA,CAAAA;AAAAA;AAAAA;AAAAA,WAGdf,EAAImB,KAAAA;AAAAA;AAAAA;AAAAA,mBAGIpE,KAAK4C,cAAcK,EAAIJ,KAAAA;AAAAA;AAAAA;AAAAA;AAAAA;AAAAA;;;;wBAUlB,MAAM7C,KAAKoD,YAAAA,CAAAA;AAAAA;AAAAA;AAAAA,EAGlC;AAAA;AA3JAjD,EAAA,CAFCkE,EAAQ,EAAE1D,SAASlB,MACnBW,EAAS,EAAEC,MAAMC,OAAAA,CAAAA,CAAAA,GANES,EAOpBP,WAAA,QAAA,CAAA,GAE6BL,EAAA,CAA5BC,EAAS,EAAEC,MAAMI,QAAAA,CAAAA,CAAAA,GATEM,EASSP,WAAA,WAAA,CAAA,GAEcL,EAAA,CAA1CC,EAAS,EAAEC,MAAMC,QAAQC,YAAS,CAAA,CAAA,GAXfQ,EAWuBP,WAAA,aAAA,CAAA,GAInCL,EAAA,CAHPmE,EAAsB,EACtBC,SAAAA,QAbmBxD,EAeZP,WAAA,gBAAA,CAAA,GAEkBL,EAAA,CAAzBqE,EAAM,iBAAA,CAAA,GAjBazD,EAiBMP,WAAA,cAAA,CAAA,GACHL,EAAA,CAAtBqE,EAAM,cAAA,CAAA,GAlBazD,EAkBGP,WAAA,eAAA,IAGfL,EAAA,CADPU,EAAAA,CAAAA,GApBmBE,EAqBZP,WAAA,QAAA,CAAA,GArBYO,IAArBZ,EAAA,CADCW,EAAc,oBAAA,CAAA,GACMC;ACJrB0D,eAAeC,OAAO,uBAHtB,cAAgC3D,EAAAA;AAAAA,CAAAA;"}
package/dist/tabs.js CHANGED
@@ -1,2 +1,2 @@
1
- import "./tabs-compatibility-DsOH4PSw.js";
1
+ import "./tabs-compatibility-BEXurIiZ.js";
2
2
  //# sourceMappingURL=tabs.js.map
package/dist/teleport.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-QK4twwTM.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./avatar-nwqyt3uc.cjs");exports.HereMorty=e.HereMorty,Object.defineProperty(exports,"SchmancyTeleportation",{enumerable:!0,get:()=>e.SchmancyTeleportation}),exports.WhereAreYouRicky=e.WhereAreYouRicky,exports.teleport=e.teleport;
2
2
  //# sourceMappingURL=teleport.cjs.map
package/dist/teleport.js CHANGED
@@ -1,4 +1,4 @@
1
- import { H as o, q as t, W as a, t as s } from "./avatar-DUhxMuv0.js";
1
+ import { H as o, q as t, W as a, t as s } from "./avatar-BXx1oJMG.js";
2
2
  export {
3
3
  o as HereMorty,
4
4
  t as SchmancyTeleportation,
@@ -1,11 +1,11 @@
1
- import { c as X } from "./consume-5D1qfVWM.js";
1
+ import { c as W } from "./consume-5D1qfVWM.js";
2
2
  import "rxjs";
3
3
  import "lit/directives/class-map.js";
4
4
  import "lit/directives/style-map.js";
5
- import { $ as J } from "./litElement.mixin-BH9PTyUD.js";
5
+ import { $ as X } from "./litElement.mixin-BH9PTyUD.js";
6
6
  import "./tailwind.mixin-CaIkmP6j.js";
7
- import { property as f, query as W, queryAssignedNodes as G, queryAssignedElements as Y, customElement as Z } from "lit/decorators.js";
8
- import { h as tt, d as et } from "./delay-D415_oVH.js";
7
+ import { property as f, query as J, queryAssignedNodes as G, queryAssignedElements as Y, customElement as Z } from "lit/decorators.js";
8
+ import { h as tt, d as et } from "./delay-DtVBjjLV.js";
9
9
  import { i as st } from "./intersection-CJxzz8c-.js";
10
10
  import { css as it, html as rt } from "lit";
11
11
  const F = (s) => Array.isArray(s), k = (s) => F(s) ? s : [s], B = "data-typeit-id", y = "ti-cursor", nt = { started: !1, completed: !1, frozen: !1, destroyed: !1 }, g = { breakLines: !0, cursor: { autoPause: !0, autoPauseDelay: 500, animation: { frames: [0, 0, 1].map((s) => ({ opacity: s })), options: { iterations: 1 / 0, easing: "steps(2, start)", fill: "forwards" } } }, cursorChar: "|", cursorSpeed: 1e3, deleteSpeed: null, html: !0, lifeLike: !0, loop: !1, loopDelay: 750, nextStringDelay: 750, speed: 100, startDelay: 250, startDelete: !1, strings: [], waitUntilVisible: !1, beforeString: () => {
@@ -356,7 +356,7 @@ var dt = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, p = (s, t,
356
356
  for (var r, n = i > 1 ? void 0 : i ? pt(t, e) : t, o = s.length - 1; o >= 0; o--) (r = s[o]) && (n = (i ? r(t, e, n) : r(n)) || n);
357
357
  return i && n && dt(t, e, n), n;
358
358
  };
359
- let d = class extends J(it`
359
+ let d = class extends X(it`
360
360
  :host {
361
361
  display: inherit;
362
362
  }
@@ -430,8 +430,8 @@ let d = class extends J(it`
430
430
  </div> `;
431
431
  }
432
432
  };
433
- p([f({ type: Number })], d.prototype, "speed", 2), p([X({ context: et, subscribe: !0 }), f({ type: Number })], d.prototype, "delay", 2), p([f({ type: Boolean })], d.prototype, "autoStart", 2), p([f({ type: String })], d.prototype, "cursorChar", 2), p([f({ type: Number })], d.prototype, "deleteSpeed", 2), p([f({ type: Boolean })], d.prototype, "once", 2), p([W("#typewriter")], d.prototype, "typewriterContainer", 2), p([G({ flatten: !0 })], d.prototype, "_getSlottedNodes", 2), p([Y({ flatten: !0 })], d.prototype, "_getSlottedElements", 2), d = p([Z("schmancy-typewriter")], d);
433
+ p([f({ type: Number })], d.prototype, "speed", 2), p([W({ context: et, subscribe: !0 }), f({ type: Number })], d.prototype, "delay", 2), p([f({ type: Boolean })], d.prototype, "autoStart", 2), p([f({ type: String })], d.prototype, "cursorChar", 2), p([f({ type: Number })], d.prototype, "deleteSpeed", 2), p([f({ type: Boolean })], d.prototype, "once", 2), p([J("#typewriter")], d.prototype, "typewriterContainer", 2), p([G({ flatten: !0 })], d.prototype, "_getSlottedNodes", 2), p([Y({ flatten: !0 })], d.prototype, "_getSlottedElements", 2), d = p([Z("schmancy-typewriter")], d);
434
434
  export {
435
435
  d as T
436
436
  };
437
- //# sourceMappingURL=typewriter-CnloNIdN.js.map
437
+ //# sourceMappingURL=typewriter-CXadCi-4.js.map