const d = {
  all: {
    name: "All",
    emojis: [
      /* Symbols */
      "❤️",
      "💔",
      "💙",
      "💚",
      "💛",
      "🖤",
      "🤍",
      "🤎",
      "✔️",
      "❌",
      "☑️",
      "❗",
      "❓",
      "⚠️",
      "💯",
      "➕",
      "➖",
      "✖️",
      "➗",
      "♻️",
      "⚡",
      "🔥",
      "✨",
      "⭐",
      "⭕",
      "🚫",
      /* People */
      "😀",
      "😃",
      "😄",
      "😁",
      "😆",
      "😅",
      "😂",
      "🤣",
      "😊",
      "😇",
      "🙂",
      "🙃",
      "😉",
      "😍",
      "😘",
      "😎",
      "🤓",
      "😐",
      "😑",
      "😬",
      "🙄",
      "😏",
      "😌",
      "🤩",
      "🥳",
      "🤔",
      "😴",
      "😭",
      "😢",
      "😡",
      "🤯",
      "👍",
      "👎",
      "👌",
      "✌️",
      "🤞",
      "🙏",
      "👏",
      "🙌",
      "💪",
      /* Animals & Nature */
      "🐶",
      "🐱",
      "🐭",
      "🐹",
      "🐰",
      "🦊",
      "🐻",
      "🐼",
      "🐨",
      "🐯",
      "🦁",
      "🐮",
      "🐷",
      "🐸",
      "🐵",
      "🐔",
      "🐧",
      "🐦",
      "🦆",
      "🦅",
      "🦄",
      "🐝",
      "🦋",
      "🌲",
      "🌳",
      "🌴",
      "🌵",
      "🌸",
      "🌼",
      "🌻",
      "☀️",
      "🌙",
      "⭐",
      "🌈",
      "🌧️",
      "❄️",
      "🌊",
      /* Food & Drink */
      "🍎",
      "🍌",
      "🍉",
      "🍇",
      "🍓",
      "🍒",
      "🍍",
      "🥭",
      "🍐",
      "🍊",
      "🍋",
      "🍑",
      "🥝",
      "🥑",
      "🍔",
      "🍟",
      "🍕",
      "🌭",
      "🥪",
      "🌮",
      "🌯",
      "🍣",
      "🍜",
      "🍰",
      "🧁",
      "🍩",
      "🍪",
      "🍫",
      "☕",
      "🍵",
      "🥤",
      "🍺",
      "🍷",
      "🍸",
      "🍹",
      "🥂",
      /* Activity */
      "⚽",
      "🏀",
      "🏈",
      "⚾",
      "🎾",
      "🏐",
      "🏉",
      "🎮",
      "🎯",
      "🎳",
      "🎲",
      "♟️",
      "🏃",
      "🚴",
      "🏊",
      "🏋️",
      "🧘",
      "🎸",
      "🎹",
      "🥁",
      "🎺",
      "🎤",
      "🏆",
      "🥇",
      /* Travel & Places */
      "🚗",
      "🚕",
      "🚌",
      "🚎",
      "🚓",
      "🚑",
      "🚒",
      "✈️",
      "🚀",
      "🚁",
      "🚤",
      "🛳️",
      "🚢",
      "🏠",
      "🏢",
      "🏬",
      "🏫",
      "🏥",
      "🏰",
      "🗼",
      "🗽",
      "⛩️",
      "🕌",
      "🌍",
      "🌎",
      "🌏",
      "🏖️",
      "🏝️",
      /* Objects */
      "📱",
      "💻",
      "🖥️",
      "⌨️",
      "🖱️",
      "📷",
      "📸",
      "🎥",
      "📹",
      "📚",
      "📖",
      "📝",
      "📄",
      "📂",
      "🔒",
      "🔑",
      "🗝️",
      "💡",
      "🔦",
      "🕯️",
      "🧰",
      "🛠️",
      "🔧",
      "⚙️",
      "📦",
      "💳",
      "💰",
      "🔋",
      "🔌",
      /* Flags */
      "🇮🇳",
      "🇺🇸",
      "🇬🇧",
      "🇨🇦",
      "🇦🇺",
      "🇩🇪",
      "🇫🇷",
      "🇪🇸",
      "🇮🇹",
      "🇯🇵",
      "🇰🇷",
      "🇨🇳",
      "🇧🇷",
      "🇲🇽",
      "🇷🇺",
      "🇿🇦",
      "🇳🇿"
    ]
  },
  symbols: {
    name: "Symbols",
    emojis: [
      "❤️",
      "💔",
      "💙",
      "💚",
      "💛",
      "🖤",
      "🤍",
      "🤎",
      "✔️",
      "❌",
      "☑️",
      "❗",
      "❓",
      "⚠️",
      "💯",
      "➕",
      "➖",
      "✖️",
      "➗",
      "♻️",
      "⚡",
      "🔥",
      "✨",
      "⭐",
      "⭕",
      "🚫",
      "⬆️",
      "⬇️",
      "⬅️",
      "➡️",
      "🔄",
      "🔁",
      "🔀",
      "🔔",
      "🔕",
      "⏰",
      "⌛",
      "⏳"
    ]
  },
  people: {
    name: "People",
    emojis: [
      "😀",
      "😃",
      "😄",
      "😁",
      "😆",
      "😅",
      "😂",
      "🤣",
      "😊",
      "😇",
      "🙂",
      "🙃",
      "😉",
      "😍",
      "😘",
      "😎",
      "🤓",
      "😐",
      "😑",
      "😬",
      "🙄",
      "😏",
      "😌",
      "🤩",
      "🥳",
      "🤔",
      "😴",
      "😭",
      "😢",
      "😡",
      "🤯",
      "👍",
      "👎",
      "👌",
      "✌️",
      "🤞",
      "🙏",
      "👏",
      "🙌",
      "💪"
    ]
  },
  "animals-nature": {
    name: "Animals & Nature",
    emojis: [
      "🐶",
      "🐱",
      "🐭",
      "🐹",
      "🐰",
      "🦊",
      "🐻",
      "🐼",
      "🐨",
      "🐯",
      "🦁",
      "🐮",
      "🐷",
      "🐸",
      "🐵",
      "🐔",
      "🐧",
      "🐦",
      "🦆",
      "🦅",
      "🦄",
      "🐝",
      "🦋",
      "🌲",
      "🌳",
      "🌴",
      "🌵",
      "🌸",
      "🌼",
      "🌻",
      "☀️",
      "🌙",
      "⭐",
      "🌈",
      "🌧️",
      "❄️",
      "🌊"
    ]
  },
  "food-drink": {
    name: "Food & Drink",
    emojis: [
      "🍎",
      "🍌",
      "🍉",
      "🍇",
      "🍓",
      "🍒",
      "🍍",
      "🥭",
      "🍐",
      "🍊",
      "🍋",
      "🍑",
      "🥝",
      "🥑",
      "🍔",
      "🍟",
      "🍕",
      "🌭",
      "🥪",
      "🌮",
      "🌯",
      "🍣",
      "🍜",
      "🍰",
      "🧁",
      "🍩",
      "🍪",
      "🍫",
      "☕",
      "🍵",
      "🥤",
      "🍺",
      "🍷",
      "🍸",
      "🍹",
      "🥂"
    ]
  },
  activity: {
    name: "Activity",
    emojis: [
      "⚽",
      "🏀",
      "🏈",
      "⚾",
      "🎾",
      "🏐",
      "🏉",
      "🎮",
      "🎯",
      "🎳",
      "🎲",
      "♟️",
      "🏃",
      "🚴",
      "🏊",
      "🏋️",
      "🧘",
      "🎸",
      "🎹",
      "🥁",
      "🎺",
      "🎤",
      "🏆",
      "🥇",
      "🥈",
      "🥉"
    ]
  },
  "travel-places": {
    name: "Travel & Places",
    emojis: [
      "🚗",
      "🚕",
      "🚌",
      "🚎",
      "🚓",
      "🚑",
      "🚒",
      "✈️",
      "🚀",
      "🚁",
      "🚤",
      "🛳️",
      "🚢",
      "🏠",
      "🏢",
      "🏬",
      "🏫",
      "🏥",
      "🏰",
      "🗼",
      "🗽",
      "⛩️",
      "🕌",
      "🌍",
      "🌎",
      "🌏",
      "🏖️",
      "🏝️"
    ]
  },
  objects: {
    name: "Objects",
    emojis: [
      "📱",
      "💻",
      "🖥️",
      "⌨️",
      "🖱️",
      "📷",
      "📸",
      "🎥",
      "📹",
      "📚",
      "📖",
      "📝",
      "📄",
      "📂",
      "🔒",
      "🔑",
      "🗝️",
      "💡",
      "🔦",
      "🕯️",
      "🧰",
      "🛠️",
      "🔧",
      "⚙️",
      "📦",
      "💳",
      "💰",
      "🔋",
      "🔌"
    ]
  },
  flags: {
    name: "Flags",
    emojis: [
      "🇮🇳",
      "🇺🇸",
      "🇬🇧",
      "🇨🇦",
      "🇦🇺",
      "🇩🇪",
      "🇫🇷",
      "🇪🇸",
      "🇮🇹",
      "🇯🇵",
      "🇰🇷",
      "🇨🇳",
      "🇧🇷",
      "🇲🇽",
      "🇷🇺",
      "🇿🇦",
      "🇳🇿"
    ]
  }
}, b = {
  "💙": "blue heart",
  "💚": "green heart",
  "💛": "yellow heart",
  "🖤": "black heart",
  "🤍": "white heart",
  "🤎": "brown heart",
  "☑️": "check box with check",
  "🔴": "red circle",
  "🟢": "green circle",
  "🟡": "yellow circle",
  "🔵": "blue circle",
  "⬆️": "up arrow",
  "⬇️": "down arrow",
  "⬅️": "left arrow",
  "➡️": "right arrow",
  "🔄": "counterclockwise arrows",
  "🔁": "repeat button",
  "🔀": "shuffle tracks",
  "🔔": "bell",
  "🔕": "muted bell",
  "⏰": "alarm clock",
  "⏳": "hourglass not done",
  "⌛": "hourglass done",
  "♠️": "spade suit",
  "♥️": "heart suit",
  "♦️": "diamond suit",
  "♣️": "club suit",
  "🚫": "prohibited",
  "⭕": "hollow red circle",
  "❎": "cross mark button",
  "😐": "neutral face",
  "😑": "expressionless face",
  "😬": "grimacing face",
  "🙄": "face with rolling eyes",
  "😏": "smirking face",
  "😌": "relieved face",
  "🤩": "star struck",
  "😜": "winking face with tongue",
  "😝": "squinting face with tongue",
  "🤪": "zany face",
  "😢": "crying face",
  "😥": "sad but relieved face",
  "😓": "downcast face with sweat",
  "😱": "face screaming in fear",
  "😨": "fearful face",
  "🤗": "hugging face",
  "🤭": "face with hand over mouth",
  "🤫": "shushing face",
  "🤥": "lying face",
  "👌": "ok hand",
  "✌️": "victory hand",
  "🤞": "crossed fingers",
  "🙌": "raising hands",
  "💪": "flexed biceps",
  "🐔": "chicken",
  "🐧": "penguin",
  "🐦": "bird",
  "🐤": "baby chick",
  "🦆": "duck",
  "🦅": "eagle",
  "🐺": "wolf",
  "🦄": "unicorn",
  "🐝": "honeybee",
  "🐞": "lady beetle",
  "🦋": "butterfly",
  "🐢": "turtle",
  "🐍": "snake",
  "🦖": "t-rex",
  "🌿": "herb",
  "🍀": "four leaf clover",
  "🍁": "maple leaf",
  "🍂": "fallen leaf",
  "🌊": "water wave",
  "❄️": "snowflake",
  "☁️": "cloud",
  "⛈️": "cloud with lightning and rain",
  "🌪️": "tornado",
  "🍐": "pear",
  "🍊": "tangerine",
  "🍋": "lemon",
  "🍑": "peach",
  "🥝": "kiwi fruit",
  "🥑": "avocado",
  "🍆": "eggplant",
  "🌽": "ear of corn",
  "🥕": "carrot",
  "🥔": "potato",
  "🍞": "bread",
  "🥐": "croissant",
  "🥖": "baguette bread",
  "🧀": "cheese wedge",
  "🍖": "meat on bone",
  "🍗": "poultry leg",
  "🥩": "cut of meat",
  "🍦": "soft ice cream",
  "🍨": "ice cream",
  "🍫": "chocolate bar",
  "🍬": "candy",
  "🥛": "glass of milk",
  "🧃": "beverage box",
  "🍹": "tropical drink",
  "🥂": "clinking glasses",
  "🏓": "ping pong",
  "🥊": "boxing glove",
  "🥋": "martial arts uniform",
  "⛳": "flag in hole",
  "🏹": "bow and arrow",
  "🎿": "skis",
  "⛷️": "skier",
  "🏂": "snowboarder",
  "🎤": "microphone",
  "🎬": "clapper board",
  "🎨": "artist palette",
  "🧩": "puzzle piece",
  "🪀": "yo-yo",
  "🚇": "metro",
  "🚉": "station",
  "🚊": "tram",
  "🚝": "monorail",
  "🛻": "pickup truck",
  "🚐": "minibus",
  "🗺️": "world map",
  "🧭": "compass",
  "⛰️": "mountain",
  "🏔️": "snow capped mountain",
  "🌋": "volcano",
  "🏜️": "desert",
  "🏕️": "camping",
  "🏙️": "cityscape",
  "🌆": "city at dusk",
  "🌃": "night with stars",
  "📦": "package",
  "📫": "closed mailbox with raised flag",
  "📬": "open mailbox with raised flag",
  "📭": "open mailbox with lowered flag",
  "🧾": "receipt",
  "💳": "credit card",
  "💰": "money bag",
  "🪙": "coin",
  "🔋": "battery",
  "🔌": "electric plug",
  "🧯": "fire extinguisher",
  "🪜": "ladder",
  "🪞": "mirror",
  "🧹": "broom",
  "🧸": "teddy bear"
};
let c = null, n = "all", l = "", s = null;
const y = () => ({
  name: "emojis",
  toolbar: [
    {
      label: "Insert Emoji",
      command: "openEmojiDialog",
      icon: '<svg width="24" height="24" focusable="false"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"></path></svg>',
      shortcut: "Mod-Shift-j",
      type: "button"
    }
  ],
  commands: {
    openEmojiDialog: (o, t) => {
      const e = (t == null ? void 0 : t.contentElement) || g();
      return e ? (j(e), !0) : !1;
    },
    insertEmoji: (o, t) => {
      if (!o) return !1;
      const e = (t == null ? void 0 : t.contentElement) || g();
      if (!e) return !1;
      try {
        return h(o, e), !0;
      } catch (i) {
        return !1;
      }
    }
  },
  keymap: {
    "Mod-Shift-j": "openEmojiDialog"
  }
});
function j(o) {
  n = "all", l = "";
  const t = window.getSelection();
  s = null, t && t.rangeCount > 0 && o.contains(t.anchorNode) && (s = t.getRangeAt(0).cloneRange());
  const e = document.createElement("div");
  e.className = "emojis-overlay", e.onclick = u;
  const i = document.createElement("div");
  i.className = "emojis-dialog", i.onclick = (a) => a.stopPropagation();
  const r = Object.keys(d);
  i.innerHTML = `
    <div class="rte-dialog-header emojis-header">
      <h3>Insert Emojis</h3>
      <button class="rte-dialog-close emojis-close">×</button>
    </div>
    <div class="rte-dialog-body emojis-content">
      <div class="emojis-tabs">
        ${r.map((a) => `
          <button class="emojis-tab ${a === n ? "active" : ""}" data-category="${a}">
            ${d[a].name}
          </button>
        `).join("")}
      </div>
      <div class="emojis-main-content">
        <div class="emojis-search">
          <svg class="emojis-search-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
            <circle cx="11" cy="11" r="8"/>
            <path d="m21 21-4.35-4.35"/>
          </svg>
          <input 
            type="text" 
            placeholder="Search emojis..." 
            class="emojis-search-input"
            id="emoji-search-input"
          />
        </div>
        <div class="emojis-grid" id="emojis-grid">
          ${f(n, l)}
        </div>
      </div>
    </div>
  `, e.appendChild(i), document.body.appendChild(e), c = e, x(i, o), v(), setTimeout(() => {
    var a;
    (a = i.querySelector("#emoji-search-input")) == null || a.focus();
  }, 100);
}
function x(o, t) {
  var i;
  (i = o.querySelector(".emojis-close")) == null || i.addEventListener("click", u), o.querySelectorAll(".emojis-tab").forEach((r) => {
    r.addEventListener("click", (a) => {
      const p = a.target.getAttribute("data-category");
      p && w(o, p, t);
    });
  });
  const e = o.querySelector("#emoji-search-input");
  e == null || e.addEventListener("input", (r) => {
    l = r.target.value, m(o, t);
  }), m(o, t);
}
function w(o, t, e) {
  n = t, o.querySelectorAll(".emojis-tab").forEach((i) => {
    i.classList.toggle("active", i.getAttribute("data-category") === t);
  }), m(o, e);
}
function m(o, t) {
  const e = o.querySelector("#emojis-grid");
  e && (e.innerHTML = f(n, l), e.querySelectorAll(".emojis-item").forEach((i) => {
    i.addEventListener("click", () => {
      var a;
      const r = ((a = i.textContent) == null ? void 0 : a.trim()) || "";
      r && (h(r, t), u());
    });
  }));
}
function f(o, t) {
  let e = d[o].emojis;
  return t.trim() && (e = e.filter((i) => i.toLowerCase().includes(t.toLowerCase()) ? !0 : (b[i] || "").toLowerCase().includes(t.toLowerCase()))), e.length === 0 && t.trim() ? `<div class="emojis-no-results">No emojis found for "${t}"</div>` : e.map((i, r) => `
    <button 
      class="emojis-item" 
      title="Insert ${i}"
      data-emoji="${i}"
    >
      ${i}
    </button>
  `).join("");
}
function u() {
  c && (document.body.removeChild(c), c = null);
}
function h(o, t) {
  t.focus();
  let e = window.getSelection();
  if (s && (e == null || e.removeAllRanges(), e == null || e.addRange(s), s = null), e = window.getSelection(), e && e.rangeCount > 0) {
    const i = e.getRangeAt(0);
    i.deleteContents();
    const r = document.createTextNode(o);
    i.insertNode(r), i.setStartAfter(r), i.setEndAfter(r), e.removeAllRanges(), e.addRange(i);
  }
}
function g() {
  const o = document.activeElement;
  return o && (o.classList.contains("editora-content") || o.classList.contains("rte-content")) ? o : document.querySelector(".editora-content, .rte-content");
}
function v() {
  if (document.getElementById("emojis-dialog-styles")) return;
  const o = document.createElement("style");
  o.id = "emojis-dialog-styles", o.textContent = `
    /* Emojis Dialog Styles */
    .emojis-overlay {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 1000;
    }

    .emojis-dialog {
      background: white;
      border-radius: 8px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
      max-width: 800px;
      width: 90%;
      max-height: 80vh;
      display: flex;
      flex-direction: column;
    }

    .emojis-header h3 {
      color: #1a202c;
    }

    .emojis-content {
      display: flex;
      flex: 1;
      overflow: hidden;
      padding: 0;
    }

    .emojis-main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .emojis-search {
      padding: 16px 16px 0 16px;
      position: relative;
    }

    .emojis-search-icon {
      position: absolute;
      left: 28px;
      top: 27px;
      color: #a0aec0;
      pointer-events: none;
      z-index: 1;
    }

    .emojis-search-input {
      width: calc(100% - 24px);
      padding: 10px 12px 10px 40px;
      border: 1px solid #e1e5e9;
      border-radius: 6px;
      font-size: 14px;
      color: #2d3748;
      background-color: #ffffff;
      transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .emojis-search-input:focus {
      outline: none;
      border-color: #4299e1;
      box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
    }

    .emojis-search-input:focus + .emojis-search-icon {
      color: #4299e1;
    }

    .emojis-search-input::placeholder {
      color: #a0aec0;
    }

    .emojis-tabs {
      display: flex;
      flex-direction: column;
      width: 180px;
      border-right: 1px solid #e1e5e9;
      background-color: #f8fafc;
    }

    .emojis-tab {
      padding: 12px 16px;
      border: none;
      background: none;
      text-align: left;
      cursor: pointer;
      font-size: 14px;
      color: #4a5568;
      border-bottom: 1px solid #e1e5e9;
      transition: all 0.2s ease;
    }

    .emojis-tab:hover {
      background-color: #edf2f7;
      color: #2d3748;
    }

    .emojis-tab.active {
      background-color: #4299e1;
      color: white;
      font-weight: 500;
    }

    .emojis-tab.active:hover {
      background-color: #3182ce;
    }

    .emojis-grid {
      padding: 16px;
      overflow-y: auto;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
      gap: 8px;
    }

    .emojis-item {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #e1e5e9;
      background: white;
      border-radius: 4px;
      cursor: pointer;
      font-size: 18px;
      transition: all 0.2s ease;
      color: #2d3748;
    }

    .emojis-item:hover {
      background-color: #4299e1;
      border-color: #4299e1;
      color: white;
      transform: scale(1.05);
    }

    .emojis-item:active {
      transform: scale(0.95);
    }

    .emojis-no-results {
      grid-column: 1 / -1;
      text-align: center;
      color: #718096;
      font-size: 14px;
      padding: 40px 20px;
      background-color: #f8fafc;
      border-radius: 6px;
      border: 1px solid #e1e5e9;
    }

    /* Responsive design */
    @media (max-width: 768px) {
      .emojis-dialog {
        width: 95%;
        max-height: 90vh;
      }

      .emojis-content {
        flex-direction: column;
      }

      .emojis-tabs {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e1e5e9;
        flex-direction: row;
        overflow-x: auto;
      }

      .emojis-tab {
        border-bottom: none;
        border-right: 1px solid #e1e5e9;
        white-space: nowrap;
        min-width: 80px;
      }

      .emojis-grid {
        grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
        gap: 6px;
      }

      .emojis-item {
        width: 36px;
        height: 36px;
        font-size: 16px;
      }
    }
  `, document.head.appendChild(o);
}
export {
  y as EmojisPlugin
};
//# sourceMappingURL=EmojisPlugin.native-D6mJSnSR.mjs.map
