kss-modern 0.0.1

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 (28) hide show
  1. package/README.md +15 -0
  2. package/dist/node/lib/index.d.mts +86 -0
  3. package/dist/node/lib/index.d.ts +86 -0
  4. package/dist/node/lib/index.mjs +1900 -0
  5. package/dist/node/lib/vite-pug/worker.d.mts +24 -0
  6. package/dist/node/lib/vite-pug/worker.d.ts +24 -0
  7. package/dist/node/lib/vite-pug/worker.mjs +107 -0
  8. package/dist/styleguide-assets/.vite/manifest.json +63 -0
  9. package/dist/styleguide-assets/assets/worker-D4V8OS0H.js +12 -0
  10. package/dist/styleguide-assets/browser-BSX_g1yp.js +22671 -0
  11. package/dist/styleguide-assets/client-BZlkq2d8.js +1 -0
  12. package/dist/styleguide-assets/client-fullpage-1rKiNQVN.js +62 -0
  13. package/dist/styleguide-assets/clipboard-DhKzwemV.js +19 -0
  14. package/dist/styleguide-assets/fonts/geist-mono-latin-300-normal.woff2 +0 -0
  15. package/dist/styleguide-assets/fonts/geist-mono-latin-400-normal.woff2 +0 -0
  16. package/dist/styleguide-assets/fonts/geist-mono-latin-600-normal.woff2 +0 -0
  17. package/dist/styleguide-assets/fonts/geist-sans-latin-300-normal.woff2 +0 -0
  18. package/dist/styleguide-assets/fonts/geist-sans-latin-400-normal.woff2 +0 -0
  19. package/dist/styleguide-assets/fonts/geist-sans-latin-600-normal.woff2 +0 -0
  20. package/dist/styleguide-assets/html-validator-DqoaRE1y.js +136 -0
  21. package/dist/styleguide-assets/icons/external-link.svg +4 -0
  22. package/dist/styleguide-assets/icons/figma.svg +1 -0
  23. package/dist/styleguide-assets/icons/phpstorm.svg +1 -0
  24. package/dist/styleguide-assets/icons/vscode.svg +1 -0
  25. package/dist/styleguide-assets/icons-oK5xUF8R.js +37 -0
  26. package/dist/styleguide-assets/main-B97JcbYk.js +3603 -0
  27. package/dist/styleguide-assets/styleguide-BQbUioN5.css +1 -0
  28. package/package.json +42 -0
@@ -0,0 +1 @@
1
+ import "./main-B97JcbYk.js";
@@ -0,0 +1,62 @@
1
+ var s = Object.defineProperty;
2
+ var d = (o, e, t) => e in o ? s(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
+ var l = (o, e, t) => d(o, typeof e != "symbol" ? e + "" : e, t);
4
+ class n {
5
+ constructor(e) {
6
+ l(this, "modifier");
7
+ l(this, "placeholder");
8
+ this.modifier = e.modifier, this.placeholder = e.placeholder || "{{modifier_class}}";
9
+ }
10
+ initialize(e = document) {
11
+ this.modifier && this.replaceInDocument(e);
12
+ }
13
+ static fromIframe(e = document) {
14
+ if (!window.frameElement)
15
+ throw new Error("ModifierReplacer can only be initialized from an iframe context.");
16
+ const t = window.frameElement.getAttribute("data-modifier");
17
+ if (!t)
18
+ return null;
19
+ const i = t.split(".").filter((a) => a.length > 0).join(" "), r = new n({ modifier: i });
20
+ return r.initialize(e), r;
21
+ }
22
+ static fromUrl(e = document) {
23
+ const i = new URLSearchParams(window.location.search).get("modifier");
24
+ if (!i)
25
+ return null;
26
+ const r = i.split(".").filter((c) => c.length > 0).join(" "), a = new n({ modifier: r });
27
+ return a.initialize(e), a;
28
+ }
29
+ replaceAll(e) {
30
+ const t = encodeURIComponent(JSON.stringify(this.placeholder)), i = JSON.stringify({ modifierClass: this.placeholder }), r = encodeURIComponent(i);
31
+ return e.replace(new RegExp(this.escapeRegExp(this.placeholder), "g"), this.modifier).replace(new RegExp(this.escapeRegExp(t), "g"), this.modifier).replace(new RegExp(this.escapeRegExp(r), "g"), this.modifier);
32
+ }
33
+ escapeRegExp(e) {
34
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
35
+ }
36
+ replaceInDocument(e) {
37
+ const t = e.createTreeWalker(
38
+ e.body,
39
+ NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT,
40
+ {
41
+ acceptNode: () => NodeFilter.FILTER_ACCEPT
42
+ }
43
+ );
44
+ for (; t.nextNode(); ) {
45
+ const i = t.currentNode;
46
+ i.nodeType === Node.TEXT_NODE ? this.replaceInTextNode(i) : i.nodeType === Node.ELEMENT_NODE && this.replaceInElementAttributes(i);
47
+ }
48
+ }
49
+ replaceInTextNode(e) {
50
+ if (e.textContent) {
51
+ const t = e.textContent, i = this.replaceAll(t);
52
+ t !== i && (e.textContent = i);
53
+ }
54
+ }
55
+ replaceInElementAttributes(e) {
56
+ Array.from(e.attributes).forEach((t) => {
57
+ const i = t.value, r = this.replaceAll(i);
58
+ i !== r && (t.value = r);
59
+ });
60
+ }
61
+ }
62
+ window.frameElement ? (window.frameElement.getAttribute("data-preview") === "true" && document.documentElement.classList.add("styleguide-preview"), window.frameElement.hasAttribute("data-modifier") && n.fromIframe()) : new URLSearchParams(window.location.search).get("modifier") && n.fromUrl();
@@ -0,0 +1,19 @@
1
+ import { r as o } from "./main-B97JcbYk.js";
2
+ const c = (t, a) => {
3
+ t.forEach((e) => {
4
+ let r = e.getAttribute(a);
5
+ if (!r)
6
+ return;
7
+ e.getAttribute("data-clipboard-uri-encoded") === "true" && (r = decodeURIComponent(r)), e.addEventListener("click", async () => {
8
+ await navigator.clipboard.writeText(r).catch(console.error);
9
+ const i = e.getAttribute("data-clipboard-alert-message");
10
+ o(
11
+ i ?? "Copied to clipboard!",
12
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4"><path fill-rule="evenodd" d="M8 15A7 7 0 1 0 8 1a7 7 0 0 0 0 14Zm3.844-8.791a.75.75 0 0 0-1.188-.918l-3.7 4.79-1.649-1.833a.75.75 0 1 0-1.114 1.004l2.25 2.5a.75.75 0 0 0 1.15-.043l4.25-5.5Z" clip-rule="evenodd" /></svg>'
13
+ );
14
+ });
15
+ });
16
+ };
17
+ export {
18
+ c as default
19
+ };
@@ -0,0 +1,136 @@
1
+ const u = {
2
+ header: [
3
+ "background: #ff5757",
4
+ "color: white",
5
+ "padding: 8px 12px",
6
+ "border-radius: 4px 4px 0 0",
7
+ "font-weight: bold",
8
+ "font-size: 14px"
9
+ ].join(";"),
10
+ elementStyle: [
11
+ "color: #d32f2f",
12
+ "font-weight: bold",
13
+ "font-family: monospace"
14
+ ].join(";"),
15
+ messageStyle: [
16
+ "color: #333",
17
+ "font-style: italic"
18
+ ].join(";")
19
+ };
20
+ let n;
21
+ function y(o, l) {
22
+ console.group("%cValidation Error", u.header), console.info(
23
+ "%c%o",
24
+ u.elementStyle,
25
+ l
26
+ ), console.info(
27
+ "%c%s",
28
+ u.messageStyle,
29
+ o
30
+ ), console.groupEnd();
31
+ }
32
+ async function v() {
33
+ const { HtmlValidate: o, StaticConfigLoader: l } = await import("./browser-BSX_g1yp.js");
34
+ if (n)
35
+ return n;
36
+ const i = new l();
37
+ return n = new o(i), n;
38
+ }
39
+ function m(o) {
40
+ return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
41
+ }
42
+ async function E(o, l, i) {
43
+ const p = o.getAttribute("data-code-audit-iframe");
44
+ if (!p)
45
+ throw new Error("No code audit template selector provided");
46
+ const c = document.querySelector(`#${p}`);
47
+ if (!c)
48
+ throw new Error("Code audit template not found");
49
+ const b = await v(), w = await (await fetch(c.src)).text(), d = l.querySelector(".audit-results");
50
+ if (!d)
51
+ throw new Error("No audit results list found");
52
+ const { results: g, valid: f } = await b.validateString(w, {
53
+ rules: {
54
+ "no-trailing-whitespace": "off",
55
+ "no-inline-style": "off"
56
+ }
57
+ });
58
+ if (f || g.length === 0)
59
+ return { isValid: !0 };
60
+ const x = g[0].messages.sort((t, e) => t.severity - e.severity).reduce((t, e) => {
61
+ const r = t.find((s) => s.ruleId === e.ruleId);
62
+ return r ? (e.selector && !r.selectors.includes(e.selector) && r.selectors.push(e.selector), t) : (t.push({
63
+ // escape possible html entities
64
+ ruleId: e.ruleId.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"),
65
+ message: e.message,
66
+ ruleUrl: e.ruleUrl || `https://html-validate.org/rules/${e.ruleId}.html`,
67
+ selectors: e.selector ? [e.selector] : [],
68
+ context: e.context
69
+ }), t);
70
+ }, []);
71
+ return d.innerHTML = `
72
+ ${x.map((t) => `
73
+ <li class="border-b border-styleguide-border first:border-t last:border-none">
74
+ <details class="group">
75
+ <summary class="flex cursor-pointer justify-start items-center px-6 py-4 text-sm bg-styleguide-bg transition hover:bg-[rgb(242,242,242)] focus:bg-[rgb(242,242,242)] dark:hover:bg-[rgb(26,26,26)] dark:focus:bg-[rgb(26,26,26)]">
76
+ <svg class="h-4 w-4 group-open:rotate-90 transition-transform mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true">
77
+ <path fill-rule="evenodd" d="M6.22 4.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1 0 1.06l-3.25 3.25a.75.75 0 0 1-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 0 1 0-1.06Z" clip-rule="evenodd"></path>
78
+ </svg>
79
+ <span>
80
+ <span class="font-semibold mr-1">${t.ruleId}:</span><span>${m(t.message)}</span>
81
+ </span>
82
+ </summary>
83
+
84
+ <div class="border-t pl-12 pr-6 py-6 text-sm bg-styleguide-bg-highlight border-styleguide-border">
85
+ <p class="mb-3 pb-3 border-b border-styleguide-border">
86
+ <a class="flex gap-1 group/link items-center text-sm text-blue-600" href="${t.ruleUrl}" target="_blank">
87
+ Learn more about the rule
88
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="h-3 w-3">
89
+ <path class="transition group-hover/link:translate-x-px group-hover/link:-translate-y-px group-focus/link:translate-x-px group-focus/link:-translate-y-px" d="M6.22 8.72a.75.75 0 0 0 1.06 1.06l5.22-5.22v1.69a.75.75 0 0 0 1.5 0v-3.5a.75.75 0 0 0-.75-.75h-3.5a.75.75 0 0 0 0 1.5h1.69L6.22 8.72Z"></path>
90
+ <path d="M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 0 0 7 4H4.75A2.75 2.75 0 0 0 2 6.75v4.5A2.75 2.75 0 0 0 4.75 14h4.5A2.75 2.75 0 0 0 12 11.25V9a.75.75 0 0 0-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5Z"></path>
91
+ </svg>
92
+ </a>
93
+ </p>
94
+
95
+ <h3 class="font-bold text-sm text-styleguide-highlight">Selectors</h3>
96
+ <ul>
97
+ ${t.selectors.map((e) => `
98
+ <li>
99
+ <button
100
+ class="block font-mono py-1.5 text-[13px] text-blue-600 text-sm cursor-pointer text-left"
101
+ data-iframe-selector="${m(`${t.ruleId}: ${t.message}`)}"
102
+ >
103
+ ${e}
104
+ </button>
105
+ </li>
106
+ `).join(`
107
+ `)}
108
+ </ul>
109
+ </div>
110
+ </details>
111
+ </li>
112
+ `).join(`
113
+ `)}
114
+ `, d.querySelectorAll("[data-iframe-selector]").forEach((t) => {
115
+ const e = t.getAttribute("data-iframe-selector");
116
+ if (!e)
117
+ throw new Error("No message found");
118
+ t.addEventListener("click", async () => {
119
+ var h;
120
+ await i();
121
+ const r = t.textContent;
122
+ if (!r)
123
+ throw new Error("No selector found");
124
+ const s = (h = c.contentDocument) == null ? void 0 : h.querySelectorAll(r);
125
+ if (!s)
126
+ throw new Error("No elements found");
127
+ s.forEach((a) => {
128
+ y(e, a), a.style.outline = "2px solid red", a.scrollIntoView({ behavior: "smooth", block: "center" }), setTimeout(() => a.style.outline = "", 5e3);
129
+ });
130
+ });
131
+ }), { isValid: f };
132
+ }
133
+ export {
134
+ E as auditCode,
135
+ v as createHtmlValidator
136
+ };
@@ -0,0 +1,4 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" class="size-4">
2
+ <path d="M6.22 8.72a.75.75 0 0 0 1.06 1.06l5.22-5.22v1.69a.75.75 0 0 0 1.5 0v-3.5a.75.75 0 0 0-.75-.75h-3.5a.75.75 0 0 0 0 1.5h1.69L6.22 8.72Z" />
3
+ <path d="M3.5 6.75c0-.69.56-1.25 1.25-1.25H7A.75.75 0 0 0 7 4H4.75A2.75 2.75 0 0 0 2 6.75v4.5A2.75 2.75 0 0 0 4.75 14h4.5A2.75 2.75 0 0 0 12 11.25V9a.75.75 0 0 0-1.5 0v2.25c0 .69-.56 1.25-1.25 1.25h-4.5c-.69 0-1.25-.56-1.25-1.25v-4.5Z" />
4
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 600 600"><g transform="translate(100)" fill-rule="nonzero" fill="none"><path d="M0 500c0-55.228 44.772-100 100-100h100v100c0 55.228-44.772 100-100 100S0 555.228 0 500Z" fill="#24CB71"/><path d="M200 0v200h100c55.228 0 100-44.772 100-100S355.228 0 300 0H200Z" fill="#FF7237"/><circle fill="#00B6FF" cx="299.167" cy="300" r="100"/><path d="M0 100c0 55.228 44.772 100 100 100h100V0H100C44.772 0 0 44.772 0 100Z" fill="#FF3737"/><path d="M0 300c0 55.228 44.772 100 100 100h100V200H100C44.772 200 0 244.772 0 300Z" fill="#874FFF"/></g></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 70 70" style="enable-background:new 0 0 70 70" xml:space="preserve"><linearGradient id="a" gradientUnits="userSpaceOnUse" x1=".558" y1="46.846" x2="29.947" y2="8.026"><stop offset=".016" style="stop-color:#765af8"/><stop offset=".382" style="stop-color:#b345f1"/><stop offset=".758" style="stop-color:#fa3293"/><stop offset=".941" style="stop-color:#ff318c"/></linearGradient><path style="fill:url(#a)" d="m39.6 15.2-3.3-10L11.9 0 0 13.5l37.2 19z"/><linearGradient id="b" gradientUnits="userSpaceOnUse" x1="2.73" y1="48.379" x2="32.072" y2="9.621"><stop offset=".016" style="stop-color:#765af8"/><stop offset=".382" style="stop-color:#b345f1"/><stop offset=".758" style="stop-color:#fa3293"/><stop offset=".941" style="stop-color:#ff318c"/></linearGradient><path style="fill:url(#b)" d="m28 41.4-.7-20.8L0 13.5l6.7 40.1 21.3-.2z"/><linearGradient id="c" gradientUnits="userSpaceOnUse" x1="50.857" y1="46.405" x2="34.274" y2="7.048"><stop offset=".183" style="stop-color:#765af8"/><stop offset=".238" style="stop-color:#8655f6"/><stop offset=".345" style="stop-color:#9f4cf3"/><stop offset=".443" style="stop-color:#ae47f2"/><stop offset=".522" style="stop-color:#b345f1"/></linearGradient><path style="fill:url(#c)" d="m22.1 41 1.3-16.5L43.2 4.2l17.7 3.2L70 30.1l-9.5 9.4L45 37l-9.6 10.1z"/><linearGradient id="d" gradientUnits="userSpaceOnUse" x1="63.266" y1="57.339" x2="24.698" y2="27.516"><stop offset=".016" style="stop-color:#765af8"/><stop offset=".382" style="stop-color:#b345f1"/></linearGradient><path style="fill:url(#d)" d="M43.2 4.2 14.8 29.4l5.5 32.4L43.9 70 70 54.4z"/><path style="fill:#000" d="M13.4 13.4h43.2v43.2H13.4z"/><path style="fill:#fff" d="M17.5 48.5h16.2v2.7H17.5zM17.3 19h7.3c4.3 0 6.9 2.5 6.9 6.2v.1c0 4.2-3.2 6.3-7.3 6.3h-3V37h-3.9V19zm7.1 9c2 0 3.1-1.2 3.1-2.7v-.1c0-1.8-1.2-2.7-3.2-2.7h-3V28h3.1zM32.5 34.4l2.3-2.8c1.6 1.3 3.3 2.2 5.4 2.2 1.6 0 2.6-.6 2.6-1.7V32c0-1-.6-1.5-3.6-2.3-3.6-.9-6-1.9-6-5.5v-.1c0-3.3 2.6-5.4 6.3-5.4 2.6 0 4.9.8 6.7 2.3l-2.1 3c-1.6-1.1-3.2-1.8-4.7-1.8s-2.3.7-2.3 1.6v.1c0 1.2.8 1.6 3.9 2.4 3.6 1 5.7 2.3 5.7 5.4v.1c0 3.6-2.7 5.6-6.6 5.6-2.7-.1-5.4-1.1-7.6-3"/></svg>
@@ -0,0 +1 @@
1
+ <svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><mask id="a" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100"><path fill-rule="evenodd" clip-rule="evenodd" d="M70.912 99.317a6.223 6.223 0 0 0 4.96-.19l20.589-9.907A6.25 6.25 0 0 0 100 83.587V16.413a6.25 6.25 0 0 0-3.54-5.632L75.874.874a6.226 6.226 0 0 0-7.104 1.21L29.355 38.04 12.187 25.01a4.162 4.162 0 0 0-5.318.236l-5.506 5.009a4.168 4.168 0 0 0-.004 6.162L16.247 50 1.36 63.583a4.168 4.168 0 0 0 .004 6.162l5.506 5.01a4.162 4.162 0 0 0 5.318.236l17.168-13.032L68.77 97.917a6.217 6.217 0 0 0 2.143 1.4ZM75.015 27.3 45.11 50l29.906 22.701V27.3Z" fill="#fff"/></mask><g mask="url(#a)"><path d="M96.461 10.796 75.857.876a6.23 6.23 0 0 0-7.107 1.207l-67.451 61.5a4.167 4.167 0 0 0 .004 6.162l5.51 5.009a4.167 4.167 0 0 0 5.32.236l81.228-61.62c2.725-2.067 6.639-.124 6.639 3.297v-.24a6.25 6.25 0 0 0-3.539-5.63Z" fill="#0065A9"/><g filter="url(#b)"><path d="m96.461 89.204-20.604 9.92a6.229 6.229 0 0 1-7.107-1.207l-67.451-61.5a4.167 4.167 0 0 1 .004-6.162l5.51-5.009a4.167 4.167 0 0 1 5.32-.236l81.228 61.62c2.725 2.067 6.639.124 6.639-3.297v.24a6.25 6.25 0 0 1-3.539 5.63Z" fill="#007ACC"/></g><g filter="url(#c)"><path d="M75.858 99.126a6.232 6.232 0 0 1-7.108-1.21c2.306 2.307 6.25.674 6.25-2.588V4.672c0-3.262-3.944-4.895-6.25-2.589a6.232 6.232 0 0 1 7.108-1.21l20.6 9.908A6.25 6.25 0 0 1 100 16.413v67.174a6.25 6.25 0 0 1-3.541 5.633l-20.601 9.906Z" fill="#1F9CF0"/></g><path fill-rule="evenodd" clip-rule="evenodd" d="M70.851 99.317a6.224 6.224 0 0 0 4.96-.19L96.4 89.22a6.25 6.25 0 0 0 3.54-5.633V16.413a6.25 6.25 0 0 0-3.54-5.632L75.812.874a6.226 6.226 0 0 0-7.104 1.21L29.294 38.04 12.126 25.01a4.162 4.162 0 0 0-5.317.236l-5.507 5.009a4.168 4.168 0 0 0-.004 6.162L16.186 50 1.298 63.583a4.168 4.168 0 0 0 .004 6.162l5.507 5.009a4.162 4.162 0 0 0 5.317.236L29.294 61.96l39.414 35.958a6.218 6.218 0 0 0 2.143 1.4ZM74.954 27.3 45.048 50l29.906 22.701V27.3Z" fill="url(#d)" style="mix-blend-mode:overlay" opacity=".25"/></g><defs><filter id="b" x="-8.394" y="15.829" width="116.727" height="92.246" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset/><feGaussianBlur stdDeviation="4.167"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/><feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/></filter><filter id="c" x="60.417" y="-8.076" width="47.917" height="116.151" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feColorMatrix in="SourceAlpha" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"/><feOffset/><feGaussianBlur stdDeviation="4.167"/><feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/><feBlend mode="overlay" in2="BackgroundImageFix" result="effect1_dropShadow"/><feBlend in="SourceGraphic" in2="effect1_dropShadow" result="shape"/></filter><linearGradient id="d" x1="49.939" y1=".258" x2="49.939" y2="99.742" gradientUnits="userSpaceOnUse"><stop stop-color="#fff"/><stop offset="1" stop-color="#fff" stop-opacity="0"/></linearGradient></defs></svg>
@@ -0,0 +1,37 @@
1
+ import { a as r, s as l } from "./main-B97JcbYk.js";
2
+ const p = (c, s, a) => {
3
+ c.addEventListener("input", () => {
4
+ const o = c.value.toLowerCase();
5
+ s.querySelectorAll("li").forEach((e) => {
6
+ var t;
7
+ const n = (t = e.textContent) == null ? void 0 : t.trim().toLowerCase();
8
+ e.classList.toggle("hidden", !(n != null && n.includes(o)));
9
+ }), a.classList.toggle("hidden", o.length === 0);
10
+ }), a.addEventListener("click", () => {
11
+ c.value = "", c.dispatchEvent(new Event("input")), c.focus();
12
+ }), s.querySelectorAll(".icon-search-list__item").forEach((o) => {
13
+ const i = o.querySelector(".icon-search-list__item-copy");
14
+ if (!i)
15
+ throw new Error("No copy button found");
16
+ const e = o.querySelector("svg:not(.icon-search-list__item-copy-icon), i");
17
+ if (!e)
18
+ throw new Error("No icon found");
19
+ const n = e.outerHTML.replace(/\n/g, "").replace(/\s{2,}/g, " ").trim(), t = o.querySelector(".icon-search-list__item-copy-icon");
20
+ if (!t)
21
+ throw new Error("No copy icon found");
22
+ i.addEventListener("click", async () => {
23
+ i.setAttribute("disabled", ""), await navigator.clipboard.writeText(n).catch(console.error), r(e, { scale: [1, 0.5], opacity: [1, 0] }, { duration: 0.3 }), r(
24
+ t,
25
+ { scale: [0, 1], opacity: [0, 1] },
26
+ { duration: 0.5, delay: 0.2, type: l, bounce: 0.4 }
27
+ ), await new Promise((d) => setTimeout(d, 800)), r(t, { scale: [1, 0.5], opacity: [1, 0] }, { duration: 0.3 }), r(
28
+ e,
29
+ { scale: [0, 1], opacity: [0, 1] },
30
+ { duration: 1, delay: 0.1, type: l, bounce: 0.2 }
31
+ ), i.removeAttribute("disabled");
32
+ });
33
+ });
34
+ };
35
+ export {
36
+ p as default
37
+ };