1/** @jsx h */
2import { renderToString } from "https://esm.sh/preact-render-to-string@6.3.1";
3import { h } from "https://esm.sh/preact@10.19.2";
4
5const RedirectHTML = () => {
14 }
15 this.validateEmoji()
16 ? this.hasReacted()
17 ? this.setReacted()
18 : (this.addEventListener("click", this._send),
19 this.addEventListener("keydown", this._send))
48 return this.hasAttribute("disabled");
49 }
50 hasReacted() {
51 return (localStorage.getItem(this.KEY) || "").split(",").includes(this.key);
52 }
53 setReacted() {
54 this.setAttribute("aria-pressed", "true"),
55 this.toggleAttribute("disabled", !0),
56 this.removeEventListener("click", this._send);
57 }
58 saveReaction() {
59 const t = (localStorage.getItem(this.KEY) || "").split(",").filter(
60 (t) => t,
78 !this.disabled && "true" !== this.getAttribute("aria-busy")
79 ) {
80 if (this.hasReacted()) return this.setReacted();
81 this.setAttribute("aria-busy", "true"),
82 await fetch(this.href, {
86 }),
87 this.setAttribute("aria-busy", "false"),
88 this.saveReaction(),
89 this.setReacted(),
90 this.dispatchEvent(new CustomEvent("open-heart", { bubbles: !0 }));
91 this.getCount();