var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
  get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
}) : x2)(function(x2) {
  if (typeof require !== "undefined") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + x2 + '" is not supported');
});
var __esm = (fn, res) => function __init() {
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
};
var __commonJS = (cb, mod) => function __require2() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));

// package-external:@wordpress/date
var require_date = __commonJS({
  "package-external:@wordpress/date"(exports, module) {
    module.exports = window.wp.date;
  }
});

// ../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
var require_ms = __commonJS({
  "../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
    var s2 = 1e3;
    var m2 = s2 * 60;
    var h2 = m2 * 60;
    var d2 = h2 * 24;
    var w2 = d2 * 7;
    var y2 = d2 * 365.25;
    module.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse3(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse3(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match2) {
        return;
      }
      var n2 = parseFloat(match2[1]);
      var type = (match2[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n2 * y2;
        case "weeks":
        case "week":
        case "w":
          return n2 * w2;
        case "days":
        case "day":
        case "d":
          return n2 * d2;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n2 * h2;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n2 * m2;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n2 * s2;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n2;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d2) {
        return Math.round(ms / d2) + "d";
      }
      if (msAbs >= h2) {
        return Math.round(ms / h2) + "h";
      }
      if (msAbs >= m2) {
        return Math.round(ms / m2) + "m";
      }
      if (msAbs >= s2) {
        return Math.round(ms / s2) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d2) {
        return plural(ms, msAbs, d2, "day");
      }
      if (msAbs >= h2) {
        return plural(ms, msAbs, h2, "hour");
      }
      if (msAbs >= m2) {
        return plural(ms, msAbs, m2, "minute");
      }
      if (msAbs >= s2) {
        return plural(ms, msAbs, s2, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n2, name) {
      var isPlural = msAbs >= n2 * 1.5;
      return Math.round(ms / n2) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
var require_common = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
    function setup2(env) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      createDebug.destroy = destroy;
      Object.keys(env).forEach((key) => {
        createDebug[key] = env[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash = 0;
        for (let i2 = 0; i2 < namespace.length; i2++) {
          hash = (hash << 5) - hash + namespace.charCodeAt(i2);
          hash |= 0;
        }
        return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug6(...args) {
          if (!debug6.enabled) {
            return;
          }
          const self2 = debug6;
          const curr = Number(/* @__PURE__ */ new Date());
          const ms = curr - (prevTime || curr);
          self2.diff = ms;
          self2.prev = prevTime;
          self2.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          let index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format7) => {
            if (match2 === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format7];
            if (typeof formatter === "function") {
              const val = args[index];
              match2 = formatter.call(self2, val);
              args.splice(index, 1);
              index--;
            }
            return match2;
          });
          createDebug.formatArgs.call(self2, args);
          const logFn = self2.log || createDebug.log;
          logFn.apply(self2, args);
        }
        debug6.namespace = namespace;
        debug6.useColors = createDebug.useColors();
        debug6.color = createDebug.selectColor(namespace);
        debug6.extend = extend;
        debug6.destroy = createDebug.destroy;
        Object.defineProperty(debug6, "enabled", {
          enumerable: true,
          configurable: false,
          get: () => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          },
          set: (v2) => {
            enableOverride = v2;
          }
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug6);
        }
        return debug6;
      }
      function extend(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.namespaces = namespaces;
        createDebug.names = [];
        createDebug.skips = [];
        const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
        for (const ns of split) {
          if (ns[0] === "-") {
            createDebug.skips.push(ns.slice(1));
          } else {
            createDebug.names.push(ns);
          }
        }
      }
      function matchesTemplate(search, template) {
        let searchIndex = 0;
        let templateIndex = 0;
        let starIndex = -1;
        let matchIndex = 0;
        while (searchIndex < search.length) {
          if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
            if (template[templateIndex] === "*") {
              starIndex = templateIndex;
              matchIndex = searchIndex;
              templateIndex++;
            } else {
              searchIndex++;
              templateIndex++;
            }
          } else if (starIndex !== -1) {
            templateIndex = starIndex + 1;
            matchIndex++;
            searchIndex = matchIndex;
          } else {
            return false;
          }
        }
        while (templateIndex < template.length && template[templateIndex] === "*") {
          templateIndex++;
        }
        return templateIndex === template.length;
      }
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      function enabled(name) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name, ns)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      function destroy() {
        console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module.exports = setup2;
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
    exports.formatArgs = formatArgs;
    exports.save = save;
    exports.load = load;
    exports.useColors = useColors;
    exports.storage = localstorage();
    exports.destroy = /* @__PURE__ */ (() => {
      let warned = false;
      return () => {
        if (!warned) {
          warned = true;
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }
      };
    })();
    exports.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      let m2;
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      const c2 = "color: " + this.color;
      args.splice(1, 0, c2, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match2) => {
        if (match2 === "%%") {
          return;
        }
        index++;
        if (match2 === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c2);
    }
    exports.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports.storage.setItem("debug", namespaces);
        } else {
          exports.storage.removeItem("debug");
        }
      } catch (error2) {
      }
    }
    function load() {
      let r3;
      try {
        r3 = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
      } catch (error2) {
      }
      if (!r3 && typeof process !== "undefined" && "env" in process) {
        r3 = process.env.DEBUG;
      }
      return r3;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error2) {
      }
    }
    module.exports = require_common()(exports);
    var { formatters: formatters2 } = module.exports;
    formatters2.j = function(v2) {
      try {
        return JSON.stringify(v2);
      } catch (error2) {
        return "[UnexpectedJSONParseError]: " + error2.message;
      }
    };
  }
});

// package-external:@wordpress/i18n
var require_i18n = __commonJS({
  "package-external:@wordpress/i18n"(exports, module) {
    module.exports = window.wp.i18n;
  }
});

// package-external:@wordpress/components
var require_components = __commonJS({
  "package-external:@wordpress/components"(exports, module) {
    module.exports = window.wp.components;
  }
});

// vendor-external:react/jsx-runtime
var require_jsx_runtime = __commonJS({
  "vendor-external:react/jsx-runtime"(exports, module) {
    module.exports = window.ReactJSXRuntime;
  }
});

// package-external:@wordpress/element
var require_element = __commonJS({
  "package-external:@wordpress/element"(exports, module) {
    module.exports = window.wp.element;
  }
});

// package-external:@wordpress/data
var require_data = __commonJS({
  "package-external:@wordpress/data"(exports, module) {
    module.exports = window.wp.data;
  }
});

// package-external:@wordpress/compose
var require_compose = __commonJS({
  "package-external:@wordpress/compose"(exports, module) {
    module.exports = window.wp.compose;
  }
});

// vendor-external:react
var require_react = __commonJS({
  "vendor-external:react"(exports, module) {
    module.exports = window.React;
  }
});

// vendor-external:react-dom
var require_react_dom = __commonJS({
  "vendor-external:react-dom"(exports, module) {
    module.exports = window.ReactDOM;
  }
});

// ../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
  "../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
    "use strict";
    (function() {
      function is(x2, y2) {
        return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
      }
      function useSyncExternalStore$2(subscribe2, getSnapshot) {
        didWarnOld18Alpha || void 0 === React34.startTransition || (didWarnOld18Alpha = true, console.error(
          "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
        ));
        var value = getSnapshot();
        if (!didWarnUncachedGetSnapshot) {
          var cachedValue = getSnapshot();
          objectIs(value, cachedValue) || (console.error(
            "The result of getSnapshot should be cached to avoid an infinite loop"
          ), didWarnUncachedGetSnapshot = true);
        }
        cachedValue = useState53({
          inst: { value, getSnapshot }
        });
        var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
        useLayoutEffect4(
          function() {
            inst.value = value;
            inst.getSnapshot = getSnapshot;
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
          },
          [subscribe2, value, getSnapshot]
        );
        useEffect41(
          function() {
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            return subscribe2(function() {
              checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            });
          },
          [subscribe2]
        );
        useDebugValue(value);
        return value;
      }
      function checkIfSnapshotChanged(inst) {
        var latestGetSnapshot = inst.getSnapshot;
        inst = inst.value;
        try {
          var nextValue = latestGetSnapshot();
          return !objectIs(inst, nextValue);
        } catch (error2) {
          return true;
        }
      }
      function useSyncExternalStore$1(subscribe2, getSnapshot) {
        return getSnapshot();
      }
      "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
      var React34 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState53 = React34.useState, useEffect41 = React34.useEffect, useLayoutEffect4 = React34.useLayoutEffect, useDebugValue = React34.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
      exports.useSyncExternalStore = void 0 !== React34.useSyncExternalStore ? React34.useSyncExternalStore : shim;
      "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
    })();
  }
});

// ../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
  "../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_use_sync_external_store_shim_development();
    }
  }
});

// package-external:@wordpress/primitives
var require_primitives = __commonJS({
  "package-external:@wordpress/primitives"(exports, module) {
    module.exports = window.wp.primitives;
  }
});

// package-external:@wordpress/private-apis
var require_private_apis = __commonJS({
  "package-external:@wordpress/private-apis"(exports, module) {
    module.exports = window.wp.privateApis;
  }
});

// package-external:@wordpress/keycodes
var require_keycodes = __commonJS({
  "package-external:@wordpress/keycodes"(exports, module) {
    module.exports = window.wp.keycodes;
  }
});

// ../../../node_modules/.pnpm/remove-accents@0.5.0/node_modules/remove-accents/index.js
var require_remove_accents = __commonJS({
  "../../../node_modules/.pnpm/remove-accents@0.5.0/node_modules/remove-accents/index.js"(exports, module) {
    var characterMap = {
      "\xC0": "A",
      "\xC1": "A",
      "\xC2": "A",
      "\xC3": "A",
      "\xC4": "A",
      "\xC5": "A",
      "\u1EA4": "A",
      "\u1EAE": "A",
      "\u1EB2": "A",
      "\u1EB4": "A",
      "\u1EB6": "A",
      "\xC6": "AE",
      "\u1EA6": "A",
      "\u1EB0": "A",
      "\u0202": "A",
      "\u1EA2": "A",
      "\u1EA0": "A",
      "\u1EA8": "A",
      "\u1EAA": "A",
      "\u1EAC": "A",
      "\xC7": "C",
      "\u1E08": "C",
      "\xC8": "E",
      "\xC9": "E",
      "\xCA": "E",
      "\xCB": "E",
      "\u1EBE": "E",
      "\u1E16": "E",
      "\u1EC0": "E",
      "\u1E14": "E",
      "\u1E1C": "E",
      "\u0206": "E",
      "\u1EBA": "E",
      "\u1EBC": "E",
      "\u1EB8": "E",
      "\u1EC2": "E",
      "\u1EC4": "E",
      "\u1EC6": "E",
      "\xCC": "I",
      "\xCD": "I",
      "\xCE": "I",
      "\xCF": "I",
      "\u1E2E": "I",
      "\u020A": "I",
      "\u1EC8": "I",
      "\u1ECA": "I",
      "\xD0": "D",
      "\xD1": "N",
      "\xD2": "O",
      "\xD3": "O",
      "\xD4": "O",
      "\xD5": "O",
      "\xD6": "O",
      "\xD8": "O",
      "\u1ED0": "O",
      "\u1E4C": "O",
      "\u1E52": "O",
      "\u020E": "O",
      "\u1ECE": "O",
      "\u1ECC": "O",
      "\u1ED4": "O",
      "\u1ED6": "O",
      "\u1ED8": "O",
      "\u1EDC": "O",
      "\u1EDE": "O",
      "\u1EE0": "O",
      "\u1EDA": "O",
      "\u1EE2": "O",
      "\xD9": "U",
      "\xDA": "U",
      "\xDB": "U",
      "\xDC": "U",
      "\u1EE6": "U",
      "\u1EE4": "U",
      "\u1EEC": "U",
      "\u1EEE": "U",
      "\u1EF0": "U",
      "\xDD": "Y",
      "\xE0": "a",
      "\xE1": "a",
      "\xE2": "a",
      "\xE3": "a",
      "\xE4": "a",
      "\xE5": "a",
      "\u1EA5": "a",
      "\u1EAF": "a",
      "\u1EB3": "a",
      "\u1EB5": "a",
      "\u1EB7": "a",
      "\xE6": "ae",
      "\u1EA7": "a",
      "\u1EB1": "a",
      "\u0203": "a",
      "\u1EA3": "a",
      "\u1EA1": "a",
      "\u1EA9": "a",
      "\u1EAB": "a",
      "\u1EAD": "a",
      "\xE7": "c",
      "\u1E09": "c",
      "\xE8": "e",
      "\xE9": "e",
      "\xEA": "e",
      "\xEB": "e",
      "\u1EBF": "e",
      "\u1E17": "e",
      "\u1EC1": "e",
      "\u1E15": "e",
      "\u1E1D": "e",
      "\u0207": "e",
      "\u1EBB": "e",
      "\u1EBD": "e",
      "\u1EB9": "e",
      "\u1EC3": "e",
      "\u1EC5": "e",
      "\u1EC7": "e",
      "\xEC": "i",
      "\xED": "i",
      "\xEE": "i",
      "\xEF": "i",
      "\u1E2F": "i",
      "\u020B": "i",
      "\u1EC9": "i",
      "\u1ECB": "i",
      "\xF0": "d",
      "\xF1": "n",
      "\xF2": "o",
      "\xF3": "o",
      "\xF4": "o",
      "\xF5": "o",
      "\xF6": "o",
      "\xF8": "o",
      "\u1ED1": "o",
      "\u1E4D": "o",
      "\u1E53": "o",
      "\u020F": "o",
      "\u1ECF": "o",
      "\u1ECD": "o",
      "\u1ED5": "o",
      "\u1ED7": "o",
      "\u1ED9": "o",
      "\u1EDD": "o",
      "\u1EDF": "o",
      "\u1EE1": "o",
      "\u1EDB": "o",
      "\u1EE3": "o",
      "\xF9": "u",
      "\xFA": "u",
      "\xFB": "u",
      "\xFC": "u",
      "\u1EE7": "u",
      "\u1EE5": "u",
      "\u1EED": "u",
      "\u1EEF": "u",
      "\u1EF1": "u",
      "\xFD": "y",
      "\xFF": "y",
      "\u0100": "A",
      "\u0101": "a",
      "\u0102": "A",
      "\u0103": "a",
      "\u0104": "A",
      "\u0105": "a",
      "\u0106": "C",
      "\u0107": "c",
      "\u0108": "C",
      "\u0109": "c",
      "\u010A": "C",
      "\u010B": "c",
      "\u010C": "C",
      "\u010D": "c",
      "C\u0306": "C",
      "c\u0306": "c",
      "\u010E": "D",
      "\u010F": "d",
      "\u0110": "D",
      "\u0111": "d",
      "\u0112": "E",
      "\u0113": "e",
      "\u0114": "E",
      "\u0115": "e",
      "\u0116": "E",
      "\u0117": "e",
      "\u0118": "E",
      "\u0119": "e",
      "\u011A": "E",
      "\u011B": "e",
      "\u011C": "G",
      "\u01F4": "G",
      "\u011D": "g",
      "\u01F5": "g",
      "\u011E": "G",
      "\u011F": "g",
      "\u0120": "G",
      "\u0121": "g",
      "\u0122": "G",
      "\u0123": "g",
      "\u0124": "H",
      "\u0125": "h",
      "\u0126": "H",
      "\u0127": "h",
      "\u1E2A": "H",
      "\u1E2B": "h",
      "\u0128": "I",
      "\u0129": "i",
      "\u012A": "I",
      "\u012B": "i",
      "\u012C": "I",
      "\u012D": "i",
      "\u012E": "I",
      "\u012F": "i",
      "\u0130": "I",
      "\u0131": "i",
      "\u0132": "IJ",
      "\u0133": "ij",
      "\u0134": "J",
      "\u0135": "j",
      "\u0136": "K",
      "\u0137": "k",
      "\u1E30": "K",
      "\u1E31": "k",
      "K\u0306": "K",
      "k\u0306": "k",
      "\u0139": "L",
      "\u013A": "l",
      "\u013B": "L",
      "\u013C": "l",
      "\u013D": "L",
      "\u013E": "l",
      "\u013F": "L",
      "\u0140": "l",
      "\u0141": "l",
      "\u0142": "l",
      "\u1E3E": "M",
      "\u1E3F": "m",
      "M\u0306": "M",
      "m\u0306": "m",
      "\u0143": "N",
      "\u0144": "n",
      "\u0145": "N",
      "\u0146": "n",
      "\u0147": "N",
      "\u0148": "n",
      "\u0149": "n",
      "N\u0306": "N",
      "n\u0306": "n",
      "\u014C": "O",
      "\u014D": "o",
      "\u014E": "O",
      "\u014F": "o",
      "\u0150": "O",
      "\u0151": "o",
      "\u0152": "OE",
      "\u0153": "oe",
      "P\u0306": "P",
      "p\u0306": "p",
      "\u0154": "R",
      "\u0155": "r",
      "\u0156": "R",
      "\u0157": "r",
      "\u0158": "R",
      "\u0159": "r",
      "R\u0306": "R",
      "r\u0306": "r",
      "\u0212": "R",
      "\u0213": "r",
      "\u015A": "S",
      "\u015B": "s",
      "\u015C": "S",
      "\u015D": "s",
      "\u015E": "S",
      "\u0218": "S",
      "\u0219": "s",
      "\u015F": "s",
      "\u0160": "S",
      "\u0161": "s",
      "\u0162": "T",
      "\u0163": "t",
      "\u021B": "t",
      "\u021A": "T",
      "\u0164": "T",
      "\u0165": "t",
      "\u0166": "T",
      "\u0167": "t",
      "T\u0306": "T",
      "t\u0306": "t",
      "\u0168": "U",
      "\u0169": "u",
      "\u016A": "U",
      "\u016B": "u",
      "\u016C": "U",
      "\u016D": "u",
      "\u016E": "U",
      "\u016F": "u",
      "\u0170": "U",
      "\u0171": "u",
      "\u0172": "U",
      "\u0173": "u",
      "\u0216": "U",
      "\u0217": "u",
      "V\u0306": "V",
      "v\u0306": "v",
      "\u0174": "W",
      "\u0175": "w",
      "\u1E82": "W",
      "\u1E83": "w",
      "X\u0306": "X",
      "x\u0306": "x",
      "\u0176": "Y",
      "\u0177": "y",
      "\u0178": "Y",
      "Y\u0306": "Y",
      "y\u0306": "y",
      "\u0179": "Z",
      "\u017A": "z",
      "\u017B": "Z",
      "\u017C": "z",
      "\u017D": "Z",
      "\u017E": "z",
      "\u017F": "s",
      "\u0192": "f",
      "\u01A0": "O",
      "\u01A1": "o",
      "\u01AF": "U",
      "\u01B0": "u",
      "\u01CD": "A",
      "\u01CE": "a",
      "\u01CF": "I",
      "\u01D0": "i",
      "\u01D1": "O",
      "\u01D2": "o",
      "\u01D3": "U",
      "\u01D4": "u",
      "\u01D5": "U",
      "\u01D6": "u",
      "\u01D7": "U",
      "\u01D8": "u",
      "\u01D9": "U",
      "\u01DA": "u",
      "\u01DB": "U",
      "\u01DC": "u",
      "\u1EE8": "U",
      "\u1EE9": "u",
      "\u1E78": "U",
      "\u1E79": "u",
      "\u01FA": "A",
      "\u01FB": "a",
      "\u01FC": "AE",
      "\u01FD": "ae",
      "\u01FE": "O",
      "\u01FF": "o",
      "\xDE": "TH",
      "\xFE": "th",
      "\u1E54": "P",
      "\u1E55": "p",
      "\u1E64": "S",
      "\u1E65": "s",
      "X\u0301": "X",
      "x\u0301": "x",
      "\u0403": "\u0413",
      "\u0453": "\u0433",
      "\u040C": "\u041A",
      "\u045C": "\u043A",
      "A\u030B": "A",
      "a\u030B": "a",
      "E\u030B": "E",
      "e\u030B": "e",
      "I\u030B": "I",
      "i\u030B": "i",
      "\u01F8": "N",
      "\u01F9": "n",
      "\u1ED2": "O",
      "\u1ED3": "o",
      "\u1E50": "O",
      "\u1E51": "o",
      "\u1EEA": "U",
      "\u1EEB": "u",
      "\u1E80": "W",
      "\u1E81": "w",
      "\u1EF2": "Y",
      "\u1EF3": "y",
      "\u0200": "A",
      "\u0201": "a",
      "\u0204": "E",
      "\u0205": "e",
      "\u0208": "I",
      "\u0209": "i",
      "\u020C": "O",
      "\u020D": "o",
      "\u0210": "R",
      "\u0211": "r",
      "\u0214": "U",
      "\u0215": "u",
      "B\u030C": "B",
      "b\u030C": "b",
      "\u010C\u0323": "C",
      "\u010D\u0323": "c",
      "\xCA\u030C": "E",
      "\xEA\u030C": "e",
      "F\u030C": "F",
      "f\u030C": "f",
      "\u01E6": "G",
      "\u01E7": "g",
      "\u021E": "H",
      "\u021F": "h",
      "J\u030C": "J",
      "\u01F0": "j",
      "\u01E8": "K",
      "\u01E9": "k",
      "M\u030C": "M",
      "m\u030C": "m",
      "P\u030C": "P",
      "p\u030C": "p",
      "Q\u030C": "Q",
      "q\u030C": "q",
      "\u0158\u0329": "R",
      "\u0159\u0329": "r",
      "\u1E66": "S",
      "\u1E67": "s",
      "V\u030C": "V",
      "v\u030C": "v",
      "W\u030C": "W",
      "w\u030C": "w",
      "X\u030C": "X",
      "x\u030C": "x",
      "Y\u030C": "Y",
      "y\u030C": "y",
      "A\u0327": "A",
      "a\u0327": "a",
      "B\u0327": "B",
      "b\u0327": "b",
      "\u1E10": "D",
      "\u1E11": "d",
      "\u0228": "E",
      "\u0229": "e",
      "\u0190\u0327": "E",
      "\u025B\u0327": "e",
      "\u1E28": "H",
      "\u1E29": "h",
      "I\u0327": "I",
      "i\u0327": "i",
      "\u0197\u0327": "I",
      "\u0268\u0327": "i",
      "M\u0327": "M",
      "m\u0327": "m",
      "O\u0327": "O",
      "o\u0327": "o",
      "Q\u0327": "Q",
      "q\u0327": "q",
      "U\u0327": "U",
      "u\u0327": "u",
      "X\u0327": "X",
      "x\u0327": "x",
      "Z\u0327": "Z",
      "z\u0327": "z",
      "\u0439": "\u0438",
      "\u0419": "\u0418",
      "\u0451": "\u0435",
      "\u0401": "\u0415"
    };
    var chars = Object.keys(characterMap).join("|");
    var allAccents = new RegExp(chars, "g");
    var firstAccent = new RegExp(chars, "");
    function matcher(match2) {
      return characterMap[match2];
    }
    var removeAccents2 = function(string) {
      return string.replace(allAccents, matcher);
    };
    var hasAccents = function(string) {
      return !!string.match(firstAccent);
    };
    module.exports = removeAccents2;
    module.exports.has = hasAccents;
    module.exports.remove = removeAccents2;
  }
});

// ../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js
var require_es6 = __commonJS({
  "../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js"(exports, module) {
    "use strict";
    module.exports = function equal(a2, b2) {
      if (a2 === b2) return true;
      if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
        if (a2.constructor !== b2.constructor) return false;
        var length, i2, keys;
        if (Array.isArray(a2)) {
          length = a2.length;
          if (length != b2.length) return false;
          for (i2 = length; i2-- !== 0; )
            if (!equal(a2[i2], b2[i2])) return false;
          return true;
        }
        if (a2 instanceof Map && b2 instanceof Map) {
          if (a2.size !== b2.size) return false;
          for (i2 of a2.entries())
            if (!b2.has(i2[0])) return false;
          for (i2 of a2.entries())
            if (!equal(i2[1], b2.get(i2[0]))) return false;
          return true;
        }
        if (a2 instanceof Set && b2 instanceof Set) {
          if (a2.size !== b2.size) return false;
          for (i2 of a2.entries())
            if (!b2.has(i2[0])) return false;
          return true;
        }
        if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
          length = a2.length;
          if (length != b2.length) return false;
          for (i2 = length; i2-- !== 0; )
            if (a2[i2] !== b2[i2]) return false;
          return true;
        }
        if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags;
        if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf();
        if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString();
        keys = Object.keys(a2);
        length = keys.length;
        if (length !== Object.keys(b2).length) return false;
        for (i2 = length; i2-- !== 0; )
          if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false;
        for (i2 = length; i2-- !== 0; ) {
          var key = keys[i2];
          if (!equal(a2[key], b2[key])) return false;
        }
        return true;
      }
      return a2 !== a2 && b2 !== b2;
    };
  }
});

// package-external:@wordpress/warning
var require_warning = __commonJS({
  "package-external:@wordpress/warning"(exports, module) {
    module.exports = window.wp.warning;
  }
});

// package-external:@wordpress/html-entities
var require_html_entities = __commonJS({
  "package-external:@wordpress/html-entities"(exports, module) {
    module.exports = window.wp.htmlEntities;
  }
});

// ../../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js
var require_events = __commonJS({
  "../../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(exports, module) {
    "use strict";
    var R = typeof Reflect === "object" ? Reflect : null;
    var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
      return Function.prototype.apply.call(target, receiver, args);
    };
    var ReflectOwnKeys;
    if (R && typeof R.ownKeys === "function") {
      ReflectOwnKeys = R.ownKeys;
    } else if (Object.getOwnPropertySymbols) {
      ReflectOwnKeys = function ReflectOwnKeys2(target) {
        return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
      };
    } else {
      ReflectOwnKeys = function ReflectOwnKeys2(target) {
        return Object.getOwnPropertyNames(target);
      };
    }
    function ProcessEmitWarning(warning2) {
      if (console && console.warn) console.warn(warning2);
    }
    var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
      return value !== value;
    };
    function EventEmitter2() {
      EventEmitter2.init.call(this);
    }
    module.exports = EventEmitter2;
    module.exports.once = once;
    EventEmitter2.EventEmitter = EventEmitter2;
    EventEmitter2.prototype._events = void 0;
    EventEmitter2.prototype._eventsCount = 0;
    EventEmitter2.prototype._maxListeners = void 0;
    var defaultMaxListeners = 10;
    function checkListener(listener) {
      if (typeof listener !== "function") {
        throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
      }
    }
    Object.defineProperty(EventEmitter2, "defaultMaxListeners", {
      enumerable: true,
      get: function() {
        return defaultMaxListeners;
      },
      set: function(arg) {
        if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
          throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
        }
        defaultMaxListeners = arg;
      }
    });
    EventEmitter2.init = function() {
      if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
        this._events = /* @__PURE__ */ Object.create(null);
        this._eventsCount = 0;
      }
      this._maxListeners = this._maxListeners || void 0;
    };
    EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n2) {
      if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) {
        throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + ".");
      }
      this._maxListeners = n2;
      return this;
    };
    function _getMaxListeners(that) {
      if (that._maxListeners === void 0)
        return EventEmitter2.defaultMaxListeners;
      return that._maxListeners;
    }
    EventEmitter2.prototype.getMaxListeners = function getMaxListeners() {
      return _getMaxListeners(this);
    };
    EventEmitter2.prototype.emit = function emit(type) {
      var args = [];
      for (var i2 = 1; i2 < arguments.length; i2++) args.push(arguments[i2]);
      var doError = type === "error";
      var events = this._events;
      if (events !== void 0)
        doError = doError && events.error === void 0;
      else if (!doError)
        return false;
      if (doError) {
        var er;
        if (args.length > 0)
          er = args[0];
        if (er instanceof Error) {
          throw er;
        }
        var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
        err.context = er;
        throw err;
      }
      var handler = events[type];
      if (handler === void 0)
        return false;
      if (typeof handler === "function") {
        ReflectApply(handler, this, args);
      } else {
        var len = handler.length;
        var listeners = arrayClone(handler, len);
        for (var i2 = 0; i2 < len; ++i2)
          ReflectApply(listeners[i2], this, args);
      }
      return true;
    };
    function _addListener(target, type, listener, prepend) {
      var m2;
      var events;
      var existing;
      checkListener(listener);
      events = target._events;
      if (events === void 0) {
        events = target._events = /* @__PURE__ */ Object.create(null);
        target._eventsCount = 0;
      } else {
        if (events.newListener !== void 0) {
          target.emit(
            "newListener",
            type,
            listener.listener ? listener.listener : listener
          );
          events = target._events;
        }
        existing = events[type];
      }
      if (existing === void 0) {
        existing = events[type] = listener;
        ++target._eventsCount;
      } else {
        if (typeof existing === "function") {
          existing = events[type] = prepend ? [listener, existing] : [existing, listener];
        } else if (prepend) {
          existing.unshift(listener);
        } else {
          existing.push(listener);
        }
        m2 = _getMaxListeners(target);
        if (m2 > 0 && existing.length > m2 && !existing.warned) {
          existing.warned = true;
          var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
          w2.name = "MaxListenersExceededWarning";
          w2.emitter = target;
          w2.type = type;
          w2.count = existing.length;
          ProcessEmitWarning(w2);
        }
      }
      return target;
    }
    EventEmitter2.prototype.addListener = function addListener(type, listener) {
      return _addListener(this, type, listener, false);
    };
    EventEmitter2.prototype.on = EventEmitter2.prototype.addListener;
    EventEmitter2.prototype.prependListener = function prependListener(type, listener) {
      return _addListener(this, type, listener, true);
    };
    function onceWrapper() {
      if (!this.fired) {
        this.target.removeListener(this.type, this.wrapFn);
        this.fired = true;
        if (arguments.length === 0)
          return this.listener.call(this.target);
        return this.listener.apply(this.target, arguments);
      }
    }
    function _onceWrap(target, type, listener) {
      var state = { fired: false, wrapFn: void 0, target, type, listener };
      var wrapped = onceWrapper.bind(state);
      wrapped.listener = listener;
      state.wrapFn = wrapped;
      return wrapped;
    }
    EventEmitter2.prototype.once = function once2(type, listener) {
      checkListener(listener);
      this.on(type, _onceWrap(this, type, listener));
      return this;
    };
    EventEmitter2.prototype.prependOnceListener = function prependOnceListener(type, listener) {
      checkListener(listener);
      this.prependListener(type, _onceWrap(this, type, listener));
      return this;
    };
    EventEmitter2.prototype.removeListener = function removeListener(type, listener) {
      var list, events, position, i2, originalListener;
      checkListener(listener);
      events = this._events;
      if (events === void 0)
        return this;
      list = events[type];
      if (list === void 0)
        return this;
      if (list === listener || list.listener === listener) {
        if (--this._eventsCount === 0)
          this._events = /* @__PURE__ */ Object.create(null);
        else {
          delete events[type];
          if (events.removeListener)
            this.emit("removeListener", type, list.listener || listener);
        }
      } else if (typeof list !== "function") {
        position = -1;
        for (i2 = list.length - 1; i2 >= 0; i2--) {
          if (list[i2] === listener || list[i2].listener === listener) {
            originalListener = list[i2].listener;
            position = i2;
            break;
          }
        }
        if (position < 0)
          return this;
        if (position === 0)
          list.shift();
        else {
          spliceOne(list, position);
        }
        if (list.length === 1)
          events[type] = list[0];
        if (events.removeListener !== void 0)
          this.emit("removeListener", type, originalListener || listener);
      }
      return this;
    };
    EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
    EventEmitter2.prototype.removeAllListeners = function removeAllListeners(type) {
      var listeners, events, i2;
      events = this._events;
      if (events === void 0)
        return this;
      if (events.removeListener === void 0) {
        if (arguments.length === 0) {
          this._events = /* @__PURE__ */ Object.create(null);
          this._eventsCount = 0;
        } else if (events[type] !== void 0) {
          if (--this._eventsCount === 0)
            this._events = /* @__PURE__ */ Object.create(null);
          else
            delete events[type];
        }
        return this;
      }
      if (arguments.length === 0) {
        var keys = Object.keys(events);
        var key;
        for (i2 = 0; i2 < keys.length; ++i2) {
          key = keys[i2];
          if (key === "removeListener") continue;
          this.removeAllListeners(key);
        }
        this.removeAllListeners("removeListener");
        this._events = /* @__PURE__ */ Object.create(null);
        this._eventsCount = 0;
        return this;
      }
      listeners = events[type];
      if (typeof listeners === "function") {
        this.removeListener(type, listeners);
      } else if (listeners !== void 0) {
        for (i2 = listeners.length - 1; i2 >= 0; i2--) {
          this.removeListener(type, listeners[i2]);
        }
      }
      return this;
    };
    function _listeners(target, type, unwrap) {
      var events = target._events;
      if (events === void 0)
        return [];
      var evlistener = events[type];
      if (evlistener === void 0)
        return [];
      if (typeof evlistener === "function")
        return unwrap ? [evlistener.listener || evlistener] : [evlistener];
      return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
    }
    EventEmitter2.prototype.listeners = function listeners(type) {
      return _listeners(this, type, true);
    };
    EventEmitter2.prototype.rawListeners = function rawListeners(type) {
      return _listeners(this, type, false);
    };
    EventEmitter2.listenerCount = function(emitter, type) {
      if (typeof emitter.listenerCount === "function") {
        return emitter.listenerCount(type);
      } else {
        return listenerCount.call(emitter, type);
      }
    };
    EventEmitter2.prototype.listenerCount = listenerCount;
    function listenerCount(type) {
      var events = this._events;
      if (events !== void 0) {
        var evlistener = events[type];
        if (typeof evlistener === "function") {
          return 1;
        } else if (evlistener !== void 0) {
          return evlistener.length;
        }
      }
      return 0;
    }
    EventEmitter2.prototype.eventNames = function eventNames() {
      return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
    };
    function arrayClone(arr, n2) {
      var copy = new Array(n2);
      for (var i2 = 0; i2 < n2; ++i2)
        copy[i2] = arr[i2];
      return copy;
    }
    function spliceOne(list, index) {
      for (; index + 1 < list.length; index++)
        list[index] = list[index + 1];
      list.pop();
    }
    function unwrapListeners(arr) {
      var ret = new Array(arr.length);
      for (var i2 = 0; i2 < ret.length; ++i2) {
        ret[i2] = arr[i2].listener || arr[i2];
      }
      return ret;
    }
    function once(emitter, name) {
      return new Promise(function(resolve, reject) {
        function errorListener(err) {
          emitter.removeListener(name, resolver);
          reject(err);
        }
        function resolver() {
          if (typeof emitter.removeListener === "function") {
            emitter.removeListener("error", errorListener);
          }
          resolve([].slice.call(arguments));
        }
        ;
        eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
        if (name !== "error") {
          addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
        }
      });
    }
    function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
      if (typeof emitter.on === "function") {
        eventTargetAgnosticAddListener(emitter, "error", handler, flags);
      }
    }
    function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
      if (typeof emitter.on === "function") {
        if (flags.once) {
          emitter.once(name, listener);
        } else {
          emitter.on(name, listener);
        }
      } else if (typeof emitter.addEventListener === "function") {
        emitter.addEventListener(name, function wrapListener(arg) {
          if (flags.once) {
            emitter.removeEventListener(name, wrapListener);
          }
          listener(arg);
        });
      } else {
        throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
      }
    }
  }
});

// package-external:@wordpress/api-fetch
var require_api_fetch = __commonJS({
  "package-external:@wordpress/api-fetch"(exports, module) {
    module.exports = window.wp.apiFetch;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
var require_constants = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js"(exports, module) {
    "use strict";
    var SEMVER_SPEC_VERSION = "2.0.0";
    var MAX_LENGTH = 256;
    var MAX_SAFE_INTEGER2 = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
    9007199254740991;
    var MAX_SAFE_COMPONENT_LENGTH = 16;
    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
    var RELEASE_TYPES = [
      "major",
      "premajor",
      "minor",
      "preminor",
      "patch",
      "prepatch",
      "prerelease"
    ];
    module.exports = {
      MAX_LENGTH,
      MAX_SAFE_COMPONENT_LENGTH,
      MAX_SAFE_BUILD_LENGTH,
      MAX_SAFE_INTEGER: MAX_SAFE_INTEGER2,
      RELEASE_TYPES,
      SEMVER_SPEC_VERSION,
      FLAG_INCLUDE_PRERELEASE: 1,
      FLAG_LOOSE: 2
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
var require_debug = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js"(exports, module) {
    "use strict";
    var debug6 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
    };
    module.exports = debug6;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
var require_re = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js"(exports, module) {
    "use strict";
    var {
      MAX_SAFE_COMPONENT_LENGTH,
      MAX_SAFE_BUILD_LENGTH,
      MAX_LENGTH
    } = require_constants();
    var debug6 = require_debug();
    exports = module.exports = {};
    var re = exports.re = [];
    var safeRe = exports.safeRe = [];
    var src = exports.src = [];
    var safeSrc = exports.safeSrc = [];
    var t2 = exports.t = {};
    var R = 0;
    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
    var safeRegexReplacements = [
      ["\\s", 1],
      ["\\d", MAX_LENGTH],
      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
    ];
    var makeSafeRegex = (value) => {
      for (const [token, max] of safeRegexReplacements) {
        value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
      }
      return value;
    };
    var createToken = (name, value, isGlobal) => {
      const safe = makeSafeRegex(value);
      const index = R++;
      debug6(name, index, value);
      t2[name] = index;
      src[index] = value;
      safeSrc[index] = safe;
      re[index] = new RegExp(value, isGlobal ? "g" : void 0);
      safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
    };
    createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
    createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
    createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
    createToken("MAINVERSION", `(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})`);
    createToken("MAINVERSIONLOOSE", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);
    createToken("PRERELEASEIDENTIFIER", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIER]})`);
    createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIERLOOSE]})`);
    createToken("PRERELEASE", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);
    createToken("PRERELEASELOOSE", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);
    createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
    createToken("BUILD", `(?:\\+(${src[t2.BUILDIDENTIFIER]}(?:\\.${src[t2.BUILDIDENTIFIER]})*))`);
    createToken("FULLPLAIN", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);
    createToken("FULL", `^${src[t2.FULLPLAIN]}$`);
    createToken("LOOSEPLAIN", `[v=\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);
    createToken("LOOSE", `^${src[t2.LOOSEPLAIN]}$`);
    createToken("GTLT", "((?:<|>)?=?)");
    createToken("XRANGEIDENTIFIERLOOSE", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
    createToken("XRANGEIDENTIFIER", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\*`);
    createToken("XRANGEPLAIN", `[v=\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);
    createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);
    createToken("XRANGE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAIN]}$`);
    createToken("XRANGELOOSE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAINLOOSE]}$`);
    createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
    createToken("COERCE", `${src[t2.COERCEPLAIN]}(?:$|[^\\d])`);
    createToken("COERCEFULL", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\d])`);
    createToken("COERCERTL", src[t2.COERCE], true);
    createToken("COERCERTLFULL", src[t2.COERCEFULL], true);
    createToken("LONETILDE", "(?:~>?)");
    createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true);
    exports.tildeTrimReplace = "$1~";
    createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);
    createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);
    createToken("LONECARET", "(?:\\^)");
    createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true);
    exports.caretTrimReplace = "$1^";
    createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);
    createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);
    createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`);
    createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`);
    createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);
    exports.comparatorTrimReplace = "$1$2$3";
    createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`);
    createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`);
    createToken("STAR", "(<|>)?=?\\s*\\*");
    createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
    createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
var require_parse_options = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js"(exports, module) {
    "use strict";
    var looseOption = Object.freeze({ loose: true });
    var emptyOpts = Object.freeze({});
    var parseOptions = (options) => {
      if (!options) {
        return emptyOpts;
      }
      if (typeof options !== "object") {
        return looseOption;
      }
      return options;
    };
    module.exports = parseOptions;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
var require_identifiers = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js"(exports, module) {
    "use strict";
    var numeric = /^[0-9]+$/;
    var compareIdentifiers = (a2, b2) => {
      if (typeof a2 === "number" && typeof b2 === "number") {
        return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
      }
      const anum = numeric.test(a2);
      const bnum = numeric.test(b2);
      if (anum && bnum) {
        a2 = +a2;
        b2 = +b2;
      }
      return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;
    };
    var rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2);
    module.exports = {
      compareIdentifiers,
      rcompareIdentifiers
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
var require_semver = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js"(exports, module) {
    "use strict";
    var debug6 = require_debug();
    var { MAX_LENGTH, MAX_SAFE_INTEGER: MAX_SAFE_INTEGER2 } = require_constants();
    var { safeRe: re, t: t2 } = require_re();
    var parseOptions = require_parse_options();
    var { compareIdentifiers } = require_identifiers();
    var SemVer = class _SemVer {
      constructor(version2, options) {
        options = parseOptions(options);
        if (version2 instanceof _SemVer) {
          if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
            return version2;
          } else {
            version2 = version2.version;
          }
        } else if (typeof version2 !== "string") {
          throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
        }
        if (version2.length > MAX_LENGTH) {
          throw new TypeError(
            `version is longer than ${MAX_LENGTH} characters`
          );
        }
        debug6("SemVer", version2, options);
        this.options = options;
        this.loose = !!options.loose;
        this.includePrerelease = !!options.includePrerelease;
        const m2 = version2.trim().match(options.loose ? re[t2.LOOSE] : re[t2.FULL]);
        if (!m2) {
          throw new TypeError(`Invalid Version: ${version2}`);
        }
        this.raw = version2;
        this.major = +m2[1];
        this.minor = +m2[2];
        this.patch = +m2[3];
        if (this.major > MAX_SAFE_INTEGER2 || this.major < 0) {
          throw new TypeError("Invalid major version");
        }
        if (this.minor > MAX_SAFE_INTEGER2 || this.minor < 0) {
          throw new TypeError("Invalid minor version");
        }
        if (this.patch > MAX_SAFE_INTEGER2 || this.patch < 0) {
          throw new TypeError("Invalid patch version");
        }
        if (!m2[4]) {
          this.prerelease = [];
        } else {
          this.prerelease = m2[4].split(".").map((id) => {
            if (/^[0-9]+$/.test(id)) {
              const num = +id;
              if (num >= 0 && num < MAX_SAFE_INTEGER2) {
                return num;
              }
            }
            return id;
          });
        }
        this.build = m2[5] ? m2[5].split(".") : [];
        this.format();
      }
      format() {
        this.version = `${this.major}.${this.minor}.${this.patch}`;
        if (this.prerelease.length) {
          this.version += `-${this.prerelease.join(".")}`;
        }
        return this.version;
      }
      toString() {
        return this.version;
      }
      compare(other) {
        debug6("SemVer.compare", this.version, this.options, other);
        if (!(other instanceof _SemVer)) {
          if (typeof other === "string" && other === this.version) {
            return 0;
          }
          other = new _SemVer(other, this.options);
        }
        if (other.version === this.version) {
          return 0;
        }
        return this.compareMain(other) || this.comparePre(other);
      }
      compareMain(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        if (this.major < other.major) {
          return -1;
        }
        if (this.major > other.major) {
          return 1;
        }
        if (this.minor < other.minor) {
          return -1;
        }
        if (this.minor > other.minor) {
          return 1;
        }
        if (this.patch < other.patch) {
          return -1;
        }
        if (this.patch > other.patch) {
          return 1;
        }
        return 0;
      }
      comparePre(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        if (this.prerelease.length && !other.prerelease.length) {
          return -1;
        } else if (!this.prerelease.length && other.prerelease.length) {
          return 1;
        } else if (!this.prerelease.length && !other.prerelease.length) {
          return 0;
        }
        let i2 = 0;
        do {
          const a2 = this.prerelease[i2];
          const b2 = other.prerelease[i2];
          debug6("prerelease compare", i2, a2, b2);
          if (a2 === void 0 && b2 === void 0) {
            return 0;
          } else if (b2 === void 0) {
            return 1;
          } else if (a2 === void 0) {
            return -1;
          } else if (a2 === b2) {
            continue;
          } else {
            return compareIdentifiers(a2, b2);
          }
        } while (++i2);
      }
      compareBuild(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        let i2 = 0;
        do {
          const a2 = this.build[i2];
          const b2 = other.build[i2];
          debug6("build compare", i2, a2, b2);
          if (a2 === void 0 && b2 === void 0) {
            return 0;
          } else if (b2 === void 0) {
            return 1;
          } else if (a2 === void 0) {
            return -1;
          } else if (a2 === b2) {
            continue;
          } else {
            return compareIdentifiers(a2, b2);
          }
        } while (++i2);
      }
      // preminor will bump the version up to the next minor release, and immediately
      // down to pre-release. premajor and prepatch work the same way.
      inc(release, identifier, identifierBase) {
        if (release.startsWith("pre")) {
          if (!identifier && identifierBase === false) {
            throw new Error("invalid increment argument: identifier is empty");
          }
          if (identifier) {
            const match2 = `-${identifier}`.match(this.options.loose ? re[t2.PRERELEASELOOSE] : re[t2.PRERELEASE]);
            if (!match2 || match2[1] !== identifier) {
              throw new Error(`invalid identifier: ${identifier}`);
            }
          }
        }
        switch (release) {
          case "premajor":
            this.prerelease.length = 0;
            this.patch = 0;
            this.minor = 0;
            this.major++;
            this.inc("pre", identifier, identifierBase);
            break;
          case "preminor":
            this.prerelease.length = 0;
            this.patch = 0;
            this.minor++;
            this.inc("pre", identifier, identifierBase);
            break;
          case "prepatch":
            this.prerelease.length = 0;
            this.inc("patch", identifier, identifierBase);
            this.inc("pre", identifier, identifierBase);
            break;
          // If the input is a non-prerelease version, this acts the same as
          // prepatch.
          case "prerelease":
            if (this.prerelease.length === 0) {
              this.inc("patch", identifier, identifierBase);
            }
            this.inc("pre", identifier, identifierBase);
            break;
          case "release":
            if (this.prerelease.length === 0) {
              throw new Error(`version ${this.raw} is not a prerelease`);
            }
            this.prerelease.length = 0;
            break;
          case "major":
            if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
              this.major++;
            }
            this.minor = 0;
            this.patch = 0;
            this.prerelease = [];
            break;
          case "minor":
            if (this.patch !== 0 || this.prerelease.length === 0) {
              this.minor++;
            }
            this.patch = 0;
            this.prerelease = [];
            break;
          case "patch":
            if (this.prerelease.length === 0) {
              this.patch++;
            }
            this.prerelease = [];
            break;
          // This probably shouldn't be used publicly.
          // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
          case "pre": {
            const base = Number(identifierBase) ? 1 : 0;
            if (this.prerelease.length === 0) {
              this.prerelease = [base];
            } else {
              let i2 = this.prerelease.length;
              while (--i2 >= 0) {
                if (typeof this.prerelease[i2] === "number") {
                  this.prerelease[i2]++;
                  i2 = -2;
                }
              }
              if (i2 === -1) {
                if (identifier === this.prerelease.join(".") && identifierBase === false) {
                  throw new Error("invalid increment argument: identifier already exists");
                }
                this.prerelease.push(base);
              }
            }
            if (identifier) {
              let prerelease = [identifier, base];
              if (identifierBase === false) {
                prerelease = [identifier];
              }
              if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
                if (isNaN(this.prerelease[1])) {
                  this.prerelease = prerelease;
                }
              } else {
                this.prerelease = prerelease;
              }
            }
            break;
          }
          default:
            throw new Error(`invalid increment argument: ${release}`);
        }
        this.raw = this.format();
        if (this.build.length) {
          this.raw += `+${this.build.join(".")}`;
        }
        return this;
      }
    };
    module.exports = SemVer;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
var require_parse = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var parse3 = (version2, options, throwErrors = false) => {
      if (version2 instanceof SemVer) {
        return version2;
      }
      try {
        return new SemVer(version2, options);
      } catch (er) {
        if (!throwErrors) {
          return null;
        }
        throw er;
      }
    };
    module.exports = parse3;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
var require_valid = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js"(exports, module) {
    "use strict";
    var parse3 = require_parse();
    var valid = (version2, options) => {
      const v2 = parse3(version2, options);
      return v2 ? v2.version : null;
    };
    module.exports = valid;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
var require_clean = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js"(exports, module) {
    "use strict";
    var parse3 = require_parse();
    var clean = (version2, options) => {
      const s2 = parse3(version2.trim().replace(/^[=v]+/, ""), options);
      return s2 ? s2.version : null;
    };
    module.exports = clean;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js
var require_inc = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var inc = (version2, release, options, identifier, identifierBase) => {
      if (typeof options === "string") {
        identifierBase = identifier;
        identifier = options;
        options = void 0;
      }
      try {
        return new SemVer(
          version2 instanceof SemVer ? version2.version : version2,
          options
        ).inc(release, identifier, identifierBase).version;
      } catch (er) {
        return null;
      }
    };
    module.exports = inc;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
var require_diff = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js"(exports, module) {
    "use strict";
    var parse3 = require_parse();
    var diff = (version1, version2) => {
      const v1 = parse3(version1, null, true);
      const v2 = parse3(version2, null, true);
      const comparison = v1.compare(v2);
      if (comparison === 0) {
        return null;
      }
      const v1Higher = comparison > 0;
      const highVersion = v1Higher ? v1 : v2;
      const lowVersion = v1Higher ? v2 : v1;
      const highHasPre = !!highVersion.prerelease.length;
      const lowHasPre = !!lowVersion.prerelease.length;
      if (lowHasPre && !highHasPre) {
        if (!lowVersion.patch && !lowVersion.minor) {
          return "major";
        }
        if (lowVersion.compareMain(highVersion) === 0) {
          if (lowVersion.minor && !lowVersion.patch) {
            return "minor";
          }
          return "patch";
        }
      }
      const prefix = highHasPre ? "pre" : "";
      if (v1.major !== v2.major) {
        return prefix + "major";
      }
      if (v1.minor !== v2.minor) {
        return prefix + "minor";
      }
      if (v1.patch !== v2.patch) {
        return prefix + "patch";
      }
      return "prerelease";
    };
    module.exports = diff;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js
var require_major = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var major = (a2, loose) => new SemVer(a2, loose).major;
    module.exports = major;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js
var require_minor = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var minor = (a2, loose) => new SemVer(a2, loose).minor;
    module.exports = minor;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js
var require_patch = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var patch = (a2, loose) => new SemVer(a2, loose).patch;
    module.exports = patch;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
var require_prerelease = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js"(exports, module) {
    "use strict";
    var parse3 = require_parse();
    var prerelease = (version2, options) => {
      const parsed = parse3(version2, options);
      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
    };
    module.exports = prerelease;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
var require_compare = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
    module.exports = compare;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js
var require_rcompare = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
    module.exports = rcompare;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js
var require_compare_loose = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var compareLoose = (a2, b2) => compare(a2, b2, true);
    module.exports = compareLoose;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js
var require_compare_build = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var compareBuild = (a2, b2, loose) => {
      const versionA = new SemVer(a2, loose);
      const versionB = new SemVer(b2, loose);
      return versionA.compare(versionB) || versionA.compareBuild(versionB);
    };
    module.exports = compareBuild;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js
var require_sort = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js"(exports, module) {
    "use strict";
    var compareBuild = require_compare_build();
    var sort7 = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
    module.exports = sort7;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js
var require_rsort = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js"(exports, module) {
    "use strict";
    var compareBuild = require_compare_build();
    var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
    module.exports = rsort;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js
var require_gt = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var gt = (a2, b2, loose) => compare(a2, b2, loose) > 0;
    module.exports = gt;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js
var require_lt = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var lt = (a2, b2, loose) => compare(a2, b2, loose) < 0;
    module.exports = lt;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js
var require_eq = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
    module.exports = eq;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js
var require_neq = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
    module.exports = neq;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
var require_gte = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
    module.exports = gte;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js
var require_lte = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
    module.exports = lte;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js
var require_cmp = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js"(exports, module) {
    "use strict";
    var eq = require_eq();
    var neq = require_neq();
    var gt = require_gt();
    var gte = require_gte();
    var lt = require_lt();
    var lte = require_lte();
    var cmp = (a2, op, b2, loose) => {
      switch (op) {
        case "===":
          if (typeof a2 === "object") {
            a2 = a2.version;
          }
          if (typeof b2 === "object") {
            b2 = b2.version;
          }
          return a2 === b2;
        case "!==":
          if (typeof a2 === "object") {
            a2 = a2.version;
          }
          if (typeof b2 === "object") {
            b2 = b2.version;
          }
          return a2 !== b2;
        case "":
        case "=":
        case "==":
          return eq(a2, b2, loose);
        case "!=":
          return neq(a2, b2, loose);
        case ">":
          return gt(a2, b2, loose);
        case ">=":
          return gte(a2, b2, loose);
        case "<":
          return lt(a2, b2, loose);
        case "<=":
          return lte(a2, b2, loose);
        default:
          throw new TypeError(`Invalid operator: ${op}`);
      }
    };
    module.exports = cmp;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
var require_coerce = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var parse3 = require_parse();
    var { safeRe: re, t: t2 } = require_re();
    var coerce = (version2, options) => {
      if (version2 instanceof SemVer) {
        return version2;
      }
      if (typeof version2 === "number") {
        version2 = String(version2);
      }
      if (typeof version2 !== "string") {
        return null;
      }
      options = options || {};
      let match2 = null;
      if (!options.rtl) {
        match2 = version2.match(options.includePrerelease ? re[t2.COERCEFULL] : re[t2.COERCE]);
      } else {
        const coerceRtlRegex = options.includePrerelease ? re[t2.COERCERTLFULL] : re[t2.COERCERTL];
        let next;
        while ((next = coerceRtlRegex.exec(version2)) && (!match2 || match2.index + match2[0].length !== version2.length)) {
          if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
            match2 = next;
          }
          coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
        }
        coerceRtlRegex.lastIndex = -1;
      }
      if (match2 === null) {
        return null;
      }
      const major = match2[2];
      const minor = match2[3] || "0";
      const patch = match2[4] || "0";
      const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
      const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
      return parse3(`${major}.${minor}.${patch}${prerelease}${build}`, options);
    };
    module.exports = coerce;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js
var require_lrucache = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js"(exports, module) {
    "use strict";
    var LRUCache2 = class {
      constructor() {
        this.max = 1e3;
        this.map = /* @__PURE__ */ new Map();
      }
      get(key) {
        const value = this.map.get(key);
        if (value === void 0) {
          return void 0;
        } else {
          this.map.delete(key);
          this.map.set(key, value);
          return value;
        }
      }
      delete(key) {
        return this.map.delete(key);
      }
      set(key, value) {
        const deleted = this.delete(key);
        if (!deleted && value !== void 0) {
          if (this.map.size >= this.max) {
            const firstKey = this.map.keys().next().value;
            this.delete(firstKey);
          }
          this.map.set(key, value);
        }
        return this;
      }
    };
    module.exports = LRUCache2;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js
var require_range = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js"(exports, module) {
    "use strict";
    var SPACE_CHARACTERS = /\s+/g;
    var Range = class _Range {
      constructor(range, options) {
        options = parseOptions(options);
        if (range instanceof _Range) {
          if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
            return range;
          } else {
            return new _Range(range.raw, options);
          }
        }
        if (range instanceof Comparator) {
          this.raw = range.value;
          this.set = [[range]];
          this.formatted = void 0;
          return this;
        }
        this.options = options;
        this.loose = !!options.loose;
        this.includePrerelease = !!options.includePrerelease;
        this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
        this.set = this.raw.split("||").map((r3) => this.parseRange(r3.trim())).filter((c2) => c2.length);
        if (!this.set.length) {
          throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
        }
        if (this.set.length > 1) {
          const first = this.set[0];
          this.set = this.set.filter((c2) => !isNullSet(c2[0]));
          if (this.set.length === 0) {
            this.set = [first];
          } else if (this.set.length > 1) {
            for (const c2 of this.set) {
              if (c2.length === 1 && isAny(c2[0])) {
                this.set = [c2];
                break;
              }
            }
          }
        }
        this.formatted = void 0;
      }
      get range() {
        if (this.formatted === void 0) {
          this.formatted = "";
          for (let i2 = 0; i2 < this.set.length; i2++) {
            if (i2 > 0) {
              this.formatted += "||";
            }
            const comps = this.set[i2];
            for (let k = 0; k < comps.length; k++) {
              if (k > 0) {
                this.formatted += " ";
              }
              this.formatted += comps[k].toString().trim();
            }
          }
        }
        return this.formatted;
      }
      format() {
        return this.range;
      }
      toString() {
        return this.range;
      }
      parseRange(range) {
        const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
        const memoKey = memoOpts + ":" + range;
        const cached = cache.get(memoKey);
        if (cached) {
          return cached;
        }
        const loose = this.options.loose;
        const hr = loose ? re[t2.HYPHENRANGELOOSE] : re[t2.HYPHENRANGE];
        range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
        debug6("hyphen replace", range);
        range = range.replace(re[t2.COMPARATORTRIM], comparatorTrimReplace);
        debug6("comparator trim", range);
        range = range.replace(re[t2.TILDETRIM], tildeTrimReplace);
        debug6("tilde trim", range);
        range = range.replace(re[t2.CARETTRIM], caretTrimReplace);
        debug6("caret trim", range);
        let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
        if (loose) {
          rangeList = rangeList.filter((comp) => {
            debug6("loose invalid filter", comp, this.options);
            return !!comp.match(re[t2.COMPARATORLOOSE]);
          });
        }
        debug6("range list", rangeList);
        const rangeMap = /* @__PURE__ */ new Map();
        const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
        for (const comp of comparators) {
          if (isNullSet(comp)) {
            return [comp];
          }
          rangeMap.set(comp.value, comp);
        }
        if (rangeMap.size > 1 && rangeMap.has("")) {
          rangeMap.delete("");
        }
        const result2 = [...rangeMap.values()];
        cache.set(memoKey, result2);
        return result2;
      }
      intersects(range, options) {
        if (!(range instanceof _Range)) {
          throw new TypeError("a Range is required");
        }
        return this.set.some((thisComparators) => {
          return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
            return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
              return rangeComparators.every((rangeComparator) => {
                return thisComparator.intersects(rangeComparator, options);
              });
            });
          });
        });
      }
      // if ANY of the sets match ALL of its comparators, then pass
      test(version2) {
        if (!version2) {
          return false;
        }
        if (typeof version2 === "string") {
          try {
            version2 = new SemVer(version2, this.options);
          } catch (er) {
            return false;
          }
        }
        for (let i2 = 0; i2 < this.set.length; i2++) {
          if (testSet(this.set[i2], version2, this.options)) {
            return true;
          }
        }
        return false;
      }
    };
    module.exports = Range;
    var LRU = require_lrucache();
    var cache = new LRU();
    var parseOptions = require_parse_options();
    var Comparator = require_comparator();
    var debug6 = require_debug();
    var SemVer = require_semver();
    var {
      safeRe: re,
      t: t2,
      comparatorTrimReplace,
      tildeTrimReplace,
      caretTrimReplace
    } = require_re();
    var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
    var isNullSet = (c2) => c2.value === "<0.0.0-0";
    var isAny = (c2) => c2.value === "";
    var isSatisfiable = (comparators, options) => {
      let result2 = true;
      const remainingComparators = comparators.slice();
      let testComparator = remainingComparators.pop();
      while (result2 && remainingComparators.length) {
        result2 = remainingComparators.every((otherComparator) => {
          return testComparator.intersects(otherComparator, options);
        });
        testComparator = remainingComparators.pop();
      }
      return result2;
    };
    var parseComparator = (comp, options) => {
      comp = comp.replace(re[t2.BUILD], "");
      debug6("comp", comp, options);
      comp = replaceCarets(comp, options);
      debug6("caret", comp);
      comp = replaceTildes(comp, options);
      debug6("tildes", comp);
      comp = replaceXRanges(comp, options);
      debug6("xrange", comp);
      comp = replaceStars(comp, options);
      debug6("stars", comp);
      return comp;
    };
    var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
    var replaceTildes = (comp, options) => {
      return comp.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" ");
    };
    var replaceTilde = (comp, options) => {
      const r3 = options.loose ? re[t2.TILDELOOSE] : re[t2.TILDE];
      return comp.replace(r3, (_, M2, m2, p2, pr) => {
        debug6("tilde", comp, _, M2, m2, p2, pr);
        let ret;
        if (isX(M2)) {
          ret = "";
        } else if (isX(m2)) {
          ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`;
        } else if (isX(p2)) {
          ret = `>=${M2}.${m2}.0 <${M2}.${+m2 + 1}.0-0`;
        } else if (pr) {
          debug6("replaceTilde pr", pr);
          ret = `>=${M2}.${m2}.${p2}-${pr} <${M2}.${+m2 + 1}.0-0`;
        } else {
          ret = `>=${M2}.${m2}.${p2} <${M2}.${+m2 + 1}.0-0`;
        }
        debug6("tilde return", ret);
        return ret;
      });
    };
    var replaceCarets = (comp, options) => {
      return comp.trim().split(/\s+/).map((c2) => replaceCaret(c2, options)).join(" ");
    };
    var replaceCaret = (comp, options) => {
      debug6("caret", comp, options);
      const r3 = options.loose ? re[t2.CARETLOOSE] : re[t2.CARET];
      const z = options.includePrerelease ? "-0" : "";
      return comp.replace(r3, (_, M2, m2, p2, pr) => {
        debug6("caret", comp, _, M2, m2, p2, pr);
        let ret;
        if (isX(M2)) {
          ret = "";
        } else if (isX(m2)) {
          ret = `>=${M2}.0.0${z} <${+M2 + 1}.0.0-0`;
        } else if (isX(p2)) {
          if (M2 === "0") {
            ret = `>=${M2}.${m2}.0${z} <${M2}.${+m2 + 1}.0-0`;
          } else {
            ret = `>=${M2}.${m2}.0${z} <${+M2 + 1}.0.0-0`;
          }
        } else if (pr) {
          debug6("replaceCaret pr", pr);
          if (M2 === "0") {
            if (m2 === "0") {
              ret = `>=${M2}.${m2}.${p2}-${pr} <${M2}.${m2}.${+p2 + 1}-0`;
            } else {
              ret = `>=${M2}.${m2}.${p2}-${pr} <${M2}.${+m2 + 1}.0-0`;
            }
          } else {
            ret = `>=${M2}.${m2}.${p2}-${pr} <${+M2 + 1}.0.0-0`;
          }
        } else {
          debug6("no pr");
          if (M2 === "0") {
            if (m2 === "0") {
              ret = `>=${M2}.${m2}.${p2}${z} <${M2}.${m2}.${+p2 + 1}-0`;
            } else {
              ret = `>=${M2}.${m2}.${p2}${z} <${M2}.${+m2 + 1}.0-0`;
            }
          } else {
            ret = `>=${M2}.${m2}.${p2} <${+M2 + 1}.0.0-0`;
          }
        }
        debug6("caret return", ret);
        return ret;
      });
    };
    var replaceXRanges = (comp, options) => {
      debug6("replaceXRanges", comp, options);
      return comp.split(/\s+/).map((c2) => replaceXRange(c2, options)).join(" ");
    };
    var replaceXRange = (comp, options) => {
      comp = comp.trim();
      const r3 = options.loose ? re[t2.XRANGELOOSE] : re[t2.XRANGE];
      return comp.replace(r3, (ret, gtlt, M2, m2, p2, pr) => {
        debug6("xRange", comp, ret, gtlt, M2, m2, p2, pr);
        const xM = isX(M2);
        const xm = xM || isX(m2);
        const xp = xm || isX(p2);
        const anyX = xp;
        if (gtlt === "=" && anyX) {
          gtlt = "";
        }
        pr = options.includePrerelease ? "-0" : "";
        if (xM) {
          if (gtlt === ">" || gtlt === "<") {
            ret = "<0.0.0-0";
          } else {
            ret = "*";
          }
        } else if (gtlt && anyX) {
          if (xm) {
            m2 = 0;
          }
          p2 = 0;
          if (gtlt === ">") {
            gtlt = ">=";
            if (xm) {
              M2 = +M2 + 1;
              m2 = 0;
              p2 = 0;
            } else {
              m2 = +m2 + 1;
              p2 = 0;
            }
          } else if (gtlt === "<=") {
            gtlt = "<";
            if (xm) {
              M2 = +M2 + 1;
            } else {
              m2 = +m2 + 1;
            }
          }
          if (gtlt === "<") {
            pr = "-0";
          }
          ret = `${gtlt + M2}.${m2}.${p2}${pr}`;
        } else if (xm) {
          ret = `>=${M2}.0.0${pr} <${+M2 + 1}.0.0-0`;
        } else if (xp) {
          ret = `>=${M2}.${m2}.0${pr} <${M2}.${+m2 + 1}.0-0`;
        }
        debug6("xRange return", ret);
        return ret;
      });
    };
    var replaceStars = (comp, options) => {
      debug6("replaceStars", comp, options);
      return comp.trim().replace(re[t2.STAR], "");
    };
    var replaceGTE0 = (comp, options) => {
      debug6("replaceGTE0", comp, options);
      return comp.trim().replace(re[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], "");
    };
    var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
      if (isX(fM)) {
        from = "";
      } else if (isX(fm)) {
        from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
      } else if (isX(fp)) {
        from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
      } else if (fpr) {
        from = `>=${from}`;
      } else {
        from = `>=${from}${incPr ? "-0" : ""}`;
      }
      if (isX(tM)) {
        to = "";
      } else if (isX(tm)) {
        to = `<${+tM + 1}.0.0-0`;
      } else if (isX(tp)) {
        to = `<${tM}.${+tm + 1}.0-0`;
      } else if (tpr) {
        to = `<=${tM}.${tm}.${tp}-${tpr}`;
      } else if (incPr) {
        to = `<${tM}.${tm}.${+tp + 1}-0`;
      } else {
        to = `<=${to}`;
      }
      return `${from} ${to}`.trim();
    };
    var testSet = (set2, version2, options) => {
      for (let i2 = 0; i2 < set2.length; i2++) {
        if (!set2[i2].test(version2)) {
          return false;
        }
      }
      if (version2.prerelease.length && !options.includePrerelease) {
        for (let i2 = 0; i2 < set2.length; i2++) {
          debug6(set2[i2].semver);
          if (set2[i2].semver === Comparator.ANY) {
            continue;
          }
          if (set2[i2].semver.prerelease.length > 0) {
            const allowed = set2[i2].semver;
            if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
              return true;
            }
          }
        }
        return false;
      }
      return true;
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js
var require_comparator = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js"(exports, module) {
    "use strict";
    var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
    var Comparator = class _Comparator {
      static get ANY() {
        return ANY;
      }
      constructor(comp, options) {
        options = parseOptions(options);
        if (comp instanceof _Comparator) {
          if (comp.loose === !!options.loose) {
            return comp;
          } else {
            comp = comp.value;
          }
        }
        comp = comp.trim().split(/\s+/).join(" ");
        debug6("comparator", comp, options);
        this.options = options;
        this.loose = !!options.loose;
        this.parse(comp);
        if (this.semver === ANY) {
          this.value = "";
        } else {
          this.value = this.operator + this.semver.version;
        }
        debug6("comp", this);
      }
      parse(comp) {
        const r3 = this.options.loose ? re[t2.COMPARATORLOOSE] : re[t2.COMPARATOR];
        const m2 = comp.match(r3);
        if (!m2) {
          throw new TypeError(`Invalid comparator: ${comp}`);
        }
        this.operator = m2[1] !== void 0 ? m2[1] : "";
        if (this.operator === "=") {
          this.operator = "";
        }
        if (!m2[2]) {
          this.semver = ANY;
        } else {
          this.semver = new SemVer(m2[2], this.options.loose);
        }
      }
      toString() {
        return this.value;
      }
      test(version2) {
        debug6("Comparator.test", version2, this.options.loose);
        if (this.semver === ANY || version2 === ANY) {
          return true;
        }
        if (typeof version2 === "string") {
          try {
            version2 = new SemVer(version2, this.options);
          } catch (er) {
            return false;
          }
        }
        return cmp(version2, this.operator, this.semver, this.options);
      }
      intersects(comp, options) {
        if (!(comp instanceof _Comparator)) {
          throw new TypeError("a Comparator is required");
        }
        if (this.operator === "") {
          if (this.value === "") {
            return true;
          }
          return new Range(comp.value, options).test(this.value);
        } else if (comp.operator === "") {
          if (comp.value === "") {
            return true;
          }
          return new Range(this.value, options).test(comp.semver);
        }
        options = parseOptions(options);
        if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
          return false;
        }
        if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
          return false;
        }
        if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
          return true;
        }
        if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
          return true;
        }
        if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
          return true;
        }
        if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
          return true;
        }
        if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
          return true;
        }
        return false;
      }
    };
    module.exports = Comparator;
    var parseOptions = require_parse_options();
    var { safeRe: re, t: t2 } = require_re();
    var cmp = require_cmp();
    var debug6 = require_debug();
    var SemVer = require_semver();
    var Range = require_range();
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js
var require_satisfies = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var satisfies = (version2, range, options) => {
      try {
        range = new Range(range, options);
      } catch (er) {
        return false;
      }
      return range.test(version2);
    };
    module.exports = satisfies;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js
var require_to_comparators = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c2) => c2.value).join(" ").trim().split(" "));
    module.exports = toComparators;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js
var require_max_satisfying = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Range = require_range();
    var maxSatisfying = (versions, range, options) => {
      let max = null;
      let maxSV = null;
      let rangeObj = null;
      try {
        rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach((v2) => {
        if (rangeObj.test(v2)) {
          if (!max || maxSV.compare(v2) === -1) {
            max = v2;
            maxSV = new SemVer(max, options);
          }
        }
      });
      return max;
    };
    module.exports = maxSatisfying;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js
var require_min_satisfying = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Range = require_range();
    var minSatisfying = (versions, range, options) => {
      let min = null;
      let minSV = null;
      let rangeObj = null;
      try {
        rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach((v2) => {
        if (rangeObj.test(v2)) {
          if (!min || minSV.compare(v2) === 1) {
            min = v2;
            minSV = new SemVer(min, options);
          }
        }
      });
      return min;
    };
    module.exports = minSatisfying;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js
var require_min_version = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Range = require_range();
    var gt = require_gt();
    var minVersion = (range, loose) => {
      range = new Range(range, loose);
      let minver = new SemVer("0.0.0");
      if (range.test(minver)) {
        return minver;
      }
      minver = new SemVer("0.0.0-0");
      if (range.test(minver)) {
        return minver;
      }
      minver = null;
      for (let i2 = 0; i2 < range.set.length; ++i2) {
        const comparators = range.set[i2];
        let setMin = null;
        comparators.forEach((comparator) => {
          const compver = new SemVer(comparator.semver.version);
          switch (comparator.operator) {
            case ">":
              if (compver.prerelease.length === 0) {
                compver.patch++;
              } else {
                compver.prerelease.push(0);
              }
              compver.raw = compver.format();
            /* fallthrough */
            case "":
            case ">=":
              if (!setMin || gt(compver, setMin)) {
                setMin = compver;
              }
              break;
            case "<":
            case "<=":
              break;
            /* istanbul ignore next */
            default:
              throw new Error(`Unexpected operation: ${comparator.operator}`);
          }
        });
        if (setMin && (!minver || gt(minver, setMin))) {
          minver = setMin;
        }
      }
      if (minver && range.test(minver)) {
        return minver;
      }
      return null;
    };
    module.exports = minVersion;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js
var require_valid2 = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var validRange = (range, options) => {
      try {
        return new Range(range, options).range || "*";
      } catch (er) {
        return null;
      }
    };
    module.exports = validRange;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js
var require_outside = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Comparator = require_comparator();
    var { ANY } = Comparator;
    var Range = require_range();
    var satisfies = require_satisfies();
    var gt = require_gt();
    var lt = require_lt();
    var lte = require_lte();
    var gte = require_gte();
    var outside = (version2, range, hilo, options) => {
      version2 = new SemVer(version2, options);
      range = new Range(range, options);
      let gtfn, ltefn, ltfn, comp, ecomp;
      switch (hilo) {
        case ">":
          gtfn = gt;
          ltefn = lte;
          ltfn = lt;
          comp = ">";
          ecomp = ">=";
          break;
        case "<":
          gtfn = lt;
          ltefn = gte;
          ltfn = gt;
          comp = "<";
          ecomp = "<=";
          break;
        default:
          throw new TypeError('Must provide a hilo val of "<" or ">"');
      }
      if (satisfies(version2, range, options)) {
        return false;
      }
      for (let i2 = 0; i2 < range.set.length; ++i2) {
        const comparators = range.set[i2];
        let high = null;
        let low = null;
        comparators.forEach((comparator) => {
          if (comparator.semver === ANY) {
            comparator = new Comparator(">=0.0.0");
          }
          high = high || comparator;
          low = low || comparator;
          if (gtfn(comparator.semver, high.semver, options)) {
            high = comparator;
          } else if (ltfn(comparator.semver, low.semver, options)) {
            low = comparator;
          }
        });
        if (high.operator === comp || high.operator === ecomp) {
          return false;
        }
        if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
          return false;
        } else if (low.operator === ecomp && ltfn(version2, low.semver)) {
          return false;
        }
      }
      return true;
    };
    module.exports = outside;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js
var require_gtr = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js"(exports, module) {
    "use strict";
    var outside = require_outside();
    var gtr = (version2, range, options) => outside(version2, range, ">", options);
    module.exports = gtr;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js
var require_ltr = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js"(exports, module) {
    "use strict";
    var outside = require_outside();
    var ltr = (version2, range, options) => outside(version2, range, "<", options);
    module.exports = ltr;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js
var require_intersects = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var intersects = (r1, r22, options) => {
      r1 = new Range(r1, options);
      r22 = new Range(r22, options);
      return r1.intersects(r22, options);
    };
    module.exports = intersects;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js
var require_simplify = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js"(exports, module) {
    "use strict";
    var satisfies = require_satisfies();
    var compare = require_compare();
    module.exports = (versions, range, options) => {
      const set2 = [];
      let first = null;
      let prev = null;
      const v2 = versions.sort((a2, b2) => compare(a2, b2, options));
      for (const version2 of v2) {
        const included = satisfies(version2, range, options);
        if (included) {
          prev = version2;
          if (!first) {
            first = version2;
          }
        } else {
          if (prev) {
            set2.push([first, prev]);
          }
          prev = null;
          first = null;
        }
      }
      if (first) {
        set2.push([first, null]);
      }
      const ranges = [];
      for (const [min, max] of set2) {
        if (min === max) {
          ranges.push(min);
        } else if (!max && min === v2[0]) {
          ranges.push("*");
        } else if (!max) {
          ranges.push(`>=${min}`);
        } else if (min === v2[0]) {
          ranges.push(`<=${max}`);
        } else {
          ranges.push(`${min} - ${max}`);
        }
      }
      const simplified = ranges.join(" || ");
      const original = typeof range.raw === "string" ? range.raw : String(range);
      return simplified.length < original.length ? simplified : range;
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js
var require_subset = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var Comparator = require_comparator();
    var { ANY } = Comparator;
    var satisfies = require_satisfies();
    var compare = require_compare();
    var subset = (sub, dom, options = {}) => {
      if (sub === dom) {
        return true;
      }
      sub = new Range(sub, options);
      dom = new Range(dom, options);
      let sawNonNull = false;
      OUTER: for (const simpleSub of sub.set) {
        for (const simpleDom of dom.set) {
          const isSub = simpleSubset(simpleSub, simpleDom, options);
          sawNonNull = sawNonNull || isSub !== null;
          if (isSub) {
            continue OUTER;
          }
        }
        if (sawNonNull) {
          return false;
        }
      }
      return true;
    };
    var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
    var minimumVersion = [new Comparator(">=0.0.0")];
    var simpleSubset = (sub, dom, options) => {
      if (sub === dom) {
        return true;
      }
      if (sub.length === 1 && sub[0].semver === ANY) {
        if (dom.length === 1 && dom[0].semver === ANY) {
          return true;
        } else if (options.includePrerelease) {
          sub = minimumVersionWithPreRelease;
        } else {
          sub = minimumVersion;
        }
      }
      if (dom.length === 1 && dom[0].semver === ANY) {
        if (options.includePrerelease) {
          return true;
        } else {
          dom = minimumVersion;
        }
      }
      const eqSet = /* @__PURE__ */ new Set();
      let gt, lt;
      for (const c2 of sub) {
        if (c2.operator === ">" || c2.operator === ">=") {
          gt = higherGT(gt, c2, options);
        } else if (c2.operator === "<" || c2.operator === "<=") {
          lt = lowerLT(lt, c2, options);
        } else {
          eqSet.add(c2.semver);
        }
      }
      if (eqSet.size > 1) {
        return null;
      }
      let gtltComp;
      if (gt && lt) {
        gtltComp = compare(gt.semver, lt.semver, options);
        if (gtltComp > 0) {
          return null;
        } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
          return null;
        }
      }
      for (const eq of eqSet) {
        if (gt && !satisfies(eq, String(gt), options)) {
          return null;
        }
        if (lt && !satisfies(eq, String(lt), options)) {
          return null;
        }
        for (const c2 of dom) {
          if (!satisfies(eq, String(c2), options)) {
            return false;
          }
        }
        return true;
      }
      let higher, lower;
      let hasDomLT, hasDomGT;
      let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
      let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
      if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
        needDomLTPre = false;
      }
      for (const c2 of dom) {
        hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">=";
        hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<=";
        if (gt) {
          if (needDomGTPre) {
            if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) {
              needDomGTPre = false;
            }
          }
          if (c2.operator === ">" || c2.operator === ">=") {
            higher = higherGT(gt, c2, options);
            if (higher === c2 && higher !== gt) {
              return false;
            }
          } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c2), options)) {
            return false;
          }
        }
        if (lt) {
          if (needDomLTPre) {
            if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) {
              needDomLTPre = false;
            }
          }
          if (c2.operator === "<" || c2.operator === "<=") {
            lower = lowerLT(lt, c2, options);
            if (lower === c2 && lower !== lt) {
              return false;
            }
          } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c2), options)) {
            return false;
          }
        }
        if (!c2.operator && (lt || gt) && gtltComp !== 0) {
          return false;
        }
      }
      if (gt && hasDomLT && !lt && gtltComp !== 0) {
        return false;
      }
      if (lt && hasDomGT && !gt && gtltComp !== 0) {
        return false;
      }
      if (needDomGTPre || needDomLTPre) {
        return false;
      }
      return true;
    };
    var higherGT = (a2, b2, options) => {
      if (!a2) {
        return b2;
      }
      const comp = compare(a2.semver, b2.semver, options);
      return comp > 0 ? a2 : comp < 0 ? b2 : b2.operator === ">" && a2.operator === ">=" ? b2 : a2;
    };
    var lowerLT = (a2, b2, options) => {
      if (!a2) {
        return b2;
      }
      const comp = compare(a2.semver, b2.semver, options);
      return comp < 0 ? a2 : comp > 0 ? b2 : b2.operator === "<" && a2.operator === "<=" ? b2 : a2;
    };
    module.exports = subset;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js
var require_semver2 = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js"(exports, module) {
    "use strict";
    var internalRe = require_re();
    var constants = require_constants();
    var SemVer = require_semver();
    var identifiers = require_identifiers();
    var parse3 = require_parse();
    var valid = require_valid();
    var clean = require_clean();
    var inc = require_inc();
    var diff = require_diff();
    var major = require_major();
    var minor = require_minor();
    var patch = require_patch();
    var prerelease = require_prerelease();
    var compare = require_compare();
    var rcompare = require_rcompare();
    var compareLoose = require_compare_loose();
    var compareBuild = require_compare_build();
    var sort7 = require_sort();
    var rsort = require_rsort();
    var gt = require_gt();
    var lt = require_lt();
    var eq = require_eq();
    var neq = require_neq();
    var gte = require_gte();
    var lte = require_lte();
    var cmp = require_cmp();
    var coerce = require_coerce();
    var Comparator = require_comparator();
    var Range = require_range();
    var satisfies = require_satisfies();
    var toComparators = require_to_comparators();
    var maxSatisfying = require_max_satisfying();
    var minSatisfying = require_min_satisfying();
    var minVersion = require_min_version();
    var validRange = require_valid2();
    var outside = require_outside();
    var gtr = require_gtr();
    var ltr = require_ltr();
    var intersects = require_intersects();
    var simplifyRange = require_simplify();
    var subset = require_subset();
    module.exports = {
      parse: parse3,
      valid,
      clean,
      inc,
      diff,
      major,
      minor,
      patch,
      prerelease,
      compare,
      rcompare,
      compareLoose,
      compareBuild,
      sort: sort7,
      rsort,
      gt,
      lt,
      eq,
      neq,
      gte,
      lte,
      cmp,
      coerce,
      Comparator,
      Range,
      satisfies,
      toComparators,
      maxSatisfying,
      minSatisfying,
      minVersion,
      validRange,
      outside,
      gtr,
      ltr,
      intersects,
      simplifyRange,
      subset,
      SemVer,
      re: internalRe.re,
      src: internalRe.src,
      tokens: internalRe.t,
      SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
      RELEASE_TYPES: constants.RELEASE_TYPES,
      compareIdentifiers: identifiers.compareIdentifiers,
      rcompareIdentifiers: identifiers.rcompareIdentifiers
    };
  }
});

// ../../../node_modules/.pnpm/gridicons@3.4.2_react@18.3.1/node_modules/gridicons/dist/notice-outline.js
var require_notice_outline = __commonJS({
  "../../../node_modules/.pnpm/gridicons@3.4.2_react@18.3.1/node_modules/gridicons/dist/notice-outline.js"(exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true }), exports["default"] = _default;
    var _react = _interopRequireDefault(require_react());
    var _excluded = ["size", "onClick", "icon", "className"];
    function _interopRequireDefault(a2) {
      return a2 && a2.__esModule ? a2 : { default: a2 };
    }
    function _extends2() {
      return _extends2 = Object.assign ? Object.assign.bind() : function(a2) {
        for (var b2, c2 = 1; c2 < arguments.length; c2++) for (var d2 in b2 = arguments[c2], b2) Object.prototype.hasOwnProperty.call(b2, d2) && (a2[d2] = b2[d2]);
        return a2;
      }, _extends2.apply(this, arguments);
    }
    function _objectWithoutProperties(a2, b2) {
      if (null == a2) return {};
      var c2, d2, e2 = _objectWithoutPropertiesLoose(a2, b2);
      if (Object.getOwnPropertySymbols) {
        var f2 = Object.getOwnPropertySymbols(a2);
        for (d2 = 0; d2 < f2.length; d2++) c2 = f2[d2], 0 <= b2.indexOf(c2) || Object.prototype.propertyIsEnumerable.call(a2, c2) && (e2[c2] = a2[c2]);
      }
      return e2;
    }
    function _objectWithoutPropertiesLoose(a2, b2) {
      if (null == a2) return {};
      var c2, d2, e2 = {}, f2 = Object.keys(a2);
      for (d2 = 0; d2 < f2.length; d2++) c2 = f2[d2], 0 <= b2.indexOf(c2) || (e2[c2] = a2[c2]);
      return e2;
    }
    function _default(a2) {
      var b2 = a2.size, c2 = void 0 === b2 ? 24 : b2, d2 = a2.onClick, e2 = a2.icon, f2 = a2.className, g2 = _objectWithoutProperties(a2, _excluded), h2 = ["gridicon", "gridicons-notice-outline", f2, !!(function isModulo18(a3) {
        return 0 == a3 % 18;
      })(c2) && "needs-offset", false, false].filter(Boolean).join(" ");
      return _react["default"].createElement("svg", _extends2({ className: h2, height: c2, width: c2, onClick: d2 }, g2, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }), _react["default"].createElement("g", null, _react["default"].createElement("path", { d: "M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z" })));
    }
  }
});

// package-external:@wordpress/notices
var require_notices = __commonJS({
  "package-external:@wordpress/notices"(exports, module) {
    module.exports = window.wp.notices;
  }
});

// package-external:@wordpress/url
var require_url = __commonJS({
  "package-external:@wordpress/url"(exports, module) {
    module.exports = window.wp.url;
  }
});

// (disabled):crypto
var require_crypto = __commonJS({
  "(disabled):crypto"() {
  }
});

// (disabled):buffer
var require_buffer = __commonJS({
  "(disabled):buffer"() {
  }
});

// ../../../node_modules/.pnpm/js-sha256@0.11.1/node_modules/js-sha256/src/sha256.js
var require_sha256 = __commonJS({
  "../../../node_modules/.pnpm/js-sha256@0.11.1/node_modules/js-sha256/src/sha256.js"(exports, module) {
    (function() {
      "use strict";
      var ERROR = "input is invalid type";
      var WINDOW = typeof window === "object";
      var root = WINDOW ? window : {};
      if (root.JS_SHA256_NO_WINDOW) {
        WINDOW = false;
      }
      var WEB_WORKER = !WINDOW && typeof self === "object";
      var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === "object" && process.versions && process.versions.node && process.type != "renderer";
      if (NODE_JS) {
        root = global;
      } else if (WEB_WORKER) {
        root = self;
      }
      var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && typeof module === "object" && module.exports;
      var AMD = typeof define === "function" && define.amd;
      var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== "undefined";
      var HEX_CHARS = "0123456789abcdef".split("");
      var EXTRA = [-2147483648, 8388608, 32768, 128];
      var SHIFT2 = [24, 16, 8, 0];
      var K = [
        1116352408,
        1899447441,
        3049323471,
        3921009573,
        961987163,
        1508970993,
        2453635748,
        2870763221,
        3624381080,
        310598401,
        607225278,
        1426881987,
        1925078388,
        2162078206,
        2614888103,
        3248222580,
        3835390401,
        4022224774,
        264347078,
        604807628,
        770255983,
        1249150122,
        1555081692,
        1996064986,
        2554220882,
        2821834349,
        2952996808,
        3210313671,
        3336571891,
        3584528711,
        113926993,
        338241895,
        666307205,
        773529912,
        1294757372,
        1396182291,
        1695183700,
        1986661051,
        2177026350,
        2456956037,
        2730485921,
        2820302411,
        3259730800,
        3345764771,
        3516065817,
        3600352804,
        4094571909,
        275423344,
        430227734,
        506948616,
        659060556,
        883997877,
        958139571,
        1322822218,
        1537002063,
        1747873779,
        1955562222,
        2024104815,
        2227730452,
        2361852424,
        2428436474,
        2756734187,
        3204031479,
        3329325298
      ];
      var OUTPUT_TYPES = ["hex", "array", "digest", "arrayBuffer"];
      var blocks = [];
      if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) {
        Array.isArray = function(obj) {
          return Object.prototype.toString.call(obj) === "[object Array]";
        };
      }
      if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) {
        ArrayBuffer.isView = function(obj) {
          return typeof obj === "object" && obj.buffer && obj.buffer.constructor === ArrayBuffer;
        };
      }
      var createOutputMethod = function(outputType, is224) {
        return function(message2) {
          return new Sha256(is224, true).update(message2)[outputType]();
        };
      };
      var createMethod = function(is224) {
        var method = createOutputMethod("hex", is224);
        if (NODE_JS) {
          method = nodeWrap(method, is224);
        }
        method.create = function() {
          return new Sha256(is224);
        };
        method.update = function(message2) {
          return method.create().update(message2);
        };
        for (var i2 = 0; i2 < OUTPUT_TYPES.length; ++i2) {
          var type = OUTPUT_TYPES[i2];
          method[type] = createOutputMethod(type, is224);
        }
        return method;
      };
      var nodeWrap = function(method, is224) {
        var crypto = require_crypto();
        var Buffer2 = require_buffer().Buffer;
        var algorithm = is224 ? "sha224" : "sha256";
        var bufferFrom;
        if (Buffer2.from && !root.JS_SHA256_NO_BUFFER_FROM) {
          bufferFrom = Buffer2.from;
        } else {
          bufferFrom = function(message2) {
            return new Buffer2(message2);
          };
        }
        var nodeMethod = function(message2) {
          if (typeof message2 === "string") {
            return crypto.createHash(algorithm).update(message2, "utf8").digest("hex");
          } else {
            if (message2 === null || message2 === void 0) {
              throw new Error(ERROR);
            } else if (message2.constructor === ArrayBuffer) {
              message2 = new Uint8Array(message2);
            }
          }
          if (Array.isArray(message2) || ArrayBuffer.isView(message2) || message2.constructor === Buffer2) {
            return crypto.createHash(algorithm).update(bufferFrom(message2)).digest("hex");
          } else {
            return method(message2);
          }
        };
        return nodeMethod;
      };
      var createHmacOutputMethod = function(outputType, is224) {
        return function(key, message2) {
          return new HmacSha256(key, is224, true).update(message2)[outputType]();
        };
      };
      var createHmacMethod = function(is224) {
        var method = createHmacOutputMethod("hex", is224);
        method.create = function(key) {
          return new HmacSha256(key, is224);
        };
        method.update = function(key, message2) {
          return method.create(key).update(message2);
        };
        for (var i2 = 0; i2 < OUTPUT_TYPES.length; ++i2) {
          var type = OUTPUT_TYPES[i2];
          method[type] = createHmacOutputMethod(type, is224);
        }
        return method;
      };
      function Sha256(is224, sharedMemory) {
        if (sharedMemory) {
          blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
          this.blocks = blocks;
        } else {
          this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
        }
        if (is224) {
          this.h0 = 3238371032;
          this.h1 = 914150663;
          this.h2 = 812702999;
          this.h3 = 4144912697;
          this.h4 = 4290775857;
          this.h5 = 1750603025;
          this.h6 = 1694076839;
          this.h7 = 3204075428;
        } else {
          this.h0 = 1779033703;
          this.h1 = 3144134277;
          this.h2 = 1013904242;
          this.h3 = 2773480762;
          this.h4 = 1359893119;
          this.h5 = 2600822924;
          this.h6 = 528734635;
          this.h7 = 1541459225;
        }
        this.block = this.start = this.bytes = this.hBytes = 0;
        this.finalized = this.hashed = false;
        this.first = true;
        this.is224 = is224;
      }
      Sha256.prototype.update = function(message2) {
        if (this.finalized) {
          return;
        }
        var notString, type = typeof message2;
        if (type !== "string") {
          if (type === "object") {
            if (message2 === null) {
              throw new Error(ERROR);
            } else if (ARRAY_BUFFER && message2.constructor === ArrayBuffer) {
              message2 = new Uint8Array(message2);
            } else if (!Array.isArray(message2)) {
              if (!ARRAY_BUFFER || !ArrayBuffer.isView(message2)) {
                throw new Error(ERROR);
              }
            }
          } else {
            throw new Error(ERROR);
          }
          notString = true;
        }
        var code, index = 0, i2, length = message2.length, blocks2 = this.blocks;
        while (index < length) {
          if (this.hashed) {
            this.hashed = false;
            blocks2[0] = this.block;
            this.block = blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
          }
          if (notString) {
            for (i2 = this.start; index < length && i2 < 64; ++index) {
              blocks2[i2 >>> 2] |= message2[index] << SHIFT2[i2++ & 3];
            }
          } else {
            for (i2 = this.start; index < length && i2 < 64; ++index) {
              code = message2.charCodeAt(index);
              if (code < 128) {
                blocks2[i2 >>> 2] |= code << SHIFT2[i2++ & 3];
              } else if (code < 2048) {
                blocks2[i2 >>> 2] |= (192 | code >>> 6) << SHIFT2[i2++ & 3];
                blocks2[i2 >>> 2] |= (128 | code & 63) << SHIFT2[i2++ & 3];
              } else if (code < 55296 || code >= 57344) {
                blocks2[i2 >>> 2] |= (224 | code >>> 12) << SHIFT2[i2++ & 3];
                blocks2[i2 >>> 2] |= (128 | code >>> 6 & 63) << SHIFT2[i2++ & 3];
                blocks2[i2 >>> 2] |= (128 | code & 63) << SHIFT2[i2++ & 3];
              } else {
                code = 65536 + ((code & 1023) << 10 | message2.charCodeAt(++index) & 1023);
                blocks2[i2 >>> 2] |= (240 | code >>> 18) << SHIFT2[i2++ & 3];
                blocks2[i2 >>> 2] |= (128 | code >>> 12 & 63) << SHIFT2[i2++ & 3];
                blocks2[i2 >>> 2] |= (128 | code >>> 6 & 63) << SHIFT2[i2++ & 3];
                blocks2[i2 >>> 2] |= (128 | code & 63) << SHIFT2[i2++ & 3];
              }
            }
          }
          this.lastByteIndex = i2;
          this.bytes += i2 - this.start;
          if (i2 >= 64) {
            this.block = blocks2[16];
            this.start = i2 - 64;
            this.hash();
            this.hashed = true;
          } else {
            this.start = i2;
          }
        }
        if (this.bytes > 4294967295) {
          this.hBytes += this.bytes / 4294967296 << 0;
          this.bytes = this.bytes % 4294967296;
        }
        return this;
      };
      Sha256.prototype.finalize = function() {
        if (this.finalized) {
          return;
        }
        this.finalized = true;
        var blocks2 = this.blocks, i2 = this.lastByteIndex;
        blocks2[16] = this.block;
        blocks2[i2 >>> 2] |= EXTRA[i2 & 3];
        this.block = blocks2[16];
        if (i2 >= 56) {
          if (!this.hashed) {
            this.hash();
          }
          blocks2[0] = this.block;
          blocks2[16] = blocks2[1] = blocks2[2] = blocks2[3] = blocks2[4] = blocks2[5] = blocks2[6] = blocks2[7] = blocks2[8] = blocks2[9] = blocks2[10] = blocks2[11] = blocks2[12] = blocks2[13] = blocks2[14] = blocks2[15] = 0;
        }
        blocks2[14] = this.hBytes << 3 | this.bytes >>> 29;
        blocks2[15] = this.bytes << 3;
        this.hash();
      };
      Sha256.prototype.hash = function() {
        var a2 = this.h0, b2 = this.h1, c2 = this.h2, d2 = this.h3, e2 = this.h4, f2 = this.h5, g2 = this.h6, h2 = this.h7, blocks2 = this.blocks, j2, s0, s1, maj, t1, t2, ch, ab, da, cd, bc;
        for (j2 = 16; j2 < 64; ++j2) {
          t1 = blocks2[j2 - 15];
          s0 = (t1 >>> 7 | t1 << 25) ^ (t1 >>> 18 | t1 << 14) ^ t1 >>> 3;
          t1 = blocks2[j2 - 2];
          s1 = (t1 >>> 17 | t1 << 15) ^ (t1 >>> 19 | t1 << 13) ^ t1 >>> 10;
          blocks2[j2] = blocks2[j2 - 16] + s0 + blocks2[j2 - 7] + s1 << 0;
        }
        bc = b2 & c2;
        for (j2 = 0; j2 < 64; j2 += 4) {
          if (this.first) {
            if (this.is224) {
              ab = 300032;
              t1 = blocks2[0] - 1413257819;
              h2 = t1 - 150054599 << 0;
              d2 = t1 + 24177077 << 0;
            } else {
              ab = 704751109;
              t1 = blocks2[0] - 210244248;
              h2 = t1 - 1521486534 << 0;
              d2 = t1 + 143694565 << 0;
            }
            this.first = false;
          } else {
            s0 = (a2 >>> 2 | a2 << 30) ^ (a2 >>> 13 | a2 << 19) ^ (a2 >>> 22 | a2 << 10);
            s1 = (e2 >>> 6 | e2 << 26) ^ (e2 >>> 11 | e2 << 21) ^ (e2 >>> 25 | e2 << 7);
            ab = a2 & b2;
            maj = ab ^ a2 & c2 ^ bc;
            ch = e2 & f2 ^ ~e2 & g2;
            t1 = h2 + s1 + ch + K[j2] + blocks2[j2];
            t2 = s0 + maj;
            h2 = d2 + t1 << 0;
            d2 = t1 + t2 << 0;
          }
          s0 = (d2 >>> 2 | d2 << 30) ^ (d2 >>> 13 | d2 << 19) ^ (d2 >>> 22 | d2 << 10);
          s1 = (h2 >>> 6 | h2 << 26) ^ (h2 >>> 11 | h2 << 21) ^ (h2 >>> 25 | h2 << 7);
          da = d2 & a2;
          maj = da ^ d2 & b2 ^ ab;
          ch = h2 & e2 ^ ~h2 & f2;
          t1 = g2 + s1 + ch + K[j2 + 1] + blocks2[j2 + 1];
          t2 = s0 + maj;
          g2 = c2 + t1 << 0;
          c2 = t1 + t2 << 0;
          s0 = (c2 >>> 2 | c2 << 30) ^ (c2 >>> 13 | c2 << 19) ^ (c2 >>> 22 | c2 << 10);
          s1 = (g2 >>> 6 | g2 << 26) ^ (g2 >>> 11 | g2 << 21) ^ (g2 >>> 25 | g2 << 7);
          cd = c2 & d2;
          maj = cd ^ c2 & a2 ^ da;
          ch = g2 & h2 ^ ~g2 & e2;
          t1 = f2 + s1 + ch + K[j2 + 2] + blocks2[j2 + 2];
          t2 = s0 + maj;
          f2 = b2 + t1 << 0;
          b2 = t1 + t2 << 0;
          s0 = (b2 >>> 2 | b2 << 30) ^ (b2 >>> 13 | b2 << 19) ^ (b2 >>> 22 | b2 << 10);
          s1 = (f2 >>> 6 | f2 << 26) ^ (f2 >>> 11 | f2 << 21) ^ (f2 >>> 25 | f2 << 7);
          bc = b2 & c2;
          maj = bc ^ b2 & d2 ^ cd;
          ch = f2 & g2 ^ ~f2 & h2;
          t1 = e2 + s1 + ch + K[j2 + 3] + blocks2[j2 + 3];
          t2 = s0 + maj;
          e2 = a2 + t1 << 0;
          a2 = t1 + t2 << 0;
          this.chromeBugWorkAround = true;
        }
        this.h0 = this.h0 + a2 << 0;
        this.h1 = this.h1 + b2 << 0;
        this.h2 = this.h2 + c2 << 0;
        this.h3 = this.h3 + d2 << 0;
        this.h4 = this.h4 + e2 << 0;
        this.h5 = this.h5 + f2 << 0;
        this.h6 = this.h6 + g2 << 0;
        this.h7 = this.h7 + h2 << 0;
      };
      Sha256.prototype.hex = function() {
        this.finalize();
        var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7;
        var hex = HEX_CHARS[h0 >>> 28 & 15] + HEX_CHARS[h0 >>> 24 & 15] + HEX_CHARS[h0 >>> 20 & 15] + HEX_CHARS[h0 >>> 16 & 15] + HEX_CHARS[h0 >>> 12 & 15] + HEX_CHARS[h0 >>> 8 & 15] + HEX_CHARS[h0 >>> 4 & 15] + HEX_CHARS[h0 & 15] + HEX_CHARS[h1 >>> 28 & 15] + HEX_CHARS[h1 >>> 24 & 15] + HEX_CHARS[h1 >>> 20 & 15] + HEX_CHARS[h1 >>> 16 & 15] + HEX_CHARS[h1 >>> 12 & 15] + HEX_CHARS[h1 >>> 8 & 15] + HEX_CHARS[h1 >>> 4 & 15] + HEX_CHARS[h1 & 15] + HEX_CHARS[h2 >>> 28 & 15] + HEX_CHARS[h2 >>> 24 & 15] + HEX_CHARS[h2 >>> 20 & 15] + HEX_CHARS[h2 >>> 16 & 15] + HEX_CHARS[h2 >>> 12 & 15] + HEX_CHARS[h2 >>> 8 & 15] + HEX_CHARS[h2 >>> 4 & 15] + HEX_CHARS[h2 & 15] + HEX_CHARS[h3 >>> 28 & 15] + HEX_CHARS[h3 >>> 24 & 15] + HEX_CHARS[h3 >>> 20 & 15] + HEX_CHARS[h3 >>> 16 & 15] + HEX_CHARS[h3 >>> 12 & 15] + HEX_CHARS[h3 >>> 8 & 15] + HEX_CHARS[h3 >>> 4 & 15] + HEX_CHARS[h3 & 15] + HEX_CHARS[h4 >>> 28 & 15] + HEX_CHARS[h4 >>> 24 & 15] + HEX_CHARS[h4 >>> 20 & 15] + HEX_CHARS[h4 >>> 16 & 15] + HEX_CHARS[h4 >>> 12 & 15] + HEX_CHARS[h4 >>> 8 & 15] + HEX_CHARS[h4 >>> 4 & 15] + HEX_CHARS[h4 & 15] + HEX_CHARS[h5 >>> 28 & 15] + HEX_CHARS[h5 >>> 24 & 15] + HEX_CHARS[h5 >>> 20 & 15] + HEX_CHARS[h5 >>> 16 & 15] + HEX_CHARS[h5 >>> 12 & 15] + HEX_CHARS[h5 >>> 8 & 15] + HEX_CHARS[h5 >>> 4 & 15] + HEX_CHARS[h5 & 15] + HEX_CHARS[h6 >>> 28 & 15] + HEX_CHARS[h6 >>> 24 & 15] + HEX_CHARS[h6 >>> 20 & 15] + HEX_CHARS[h6 >>> 16 & 15] + HEX_CHARS[h6 >>> 12 & 15] + HEX_CHARS[h6 >>> 8 & 15] + HEX_CHARS[h6 >>> 4 & 15] + HEX_CHARS[h6 & 15];
        if (!this.is224) {
          hex += HEX_CHARS[h7 >>> 28 & 15] + HEX_CHARS[h7 >>> 24 & 15] + HEX_CHARS[h7 >>> 20 & 15] + HEX_CHARS[h7 >>> 16 & 15] + HEX_CHARS[h7 >>> 12 & 15] + HEX_CHARS[h7 >>> 8 & 15] + HEX_CHARS[h7 >>> 4 & 15] + HEX_CHARS[h7 & 15];
        }
        return hex;
      };
      Sha256.prototype.toString = Sha256.prototype.hex;
      Sha256.prototype.digest = function() {
        this.finalize();
        var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4, h5 = this.h5, h6 = this.h6, h7 = this.h7;
        var arr = [
          h0 >>> 24 & 255,
          h0 >>> 16 & 255,
          h0 >>> 8 & 255,
          h0 & 255,
          h1 >>> 24 & 255,
          h1 >>> 16 & 255,
          h1 >>> 8 & 255,
          h1 & 255,
          h2 >>> 24 & 255,
          h2 >>> 16 & 255,
          h2 >>> 8 & 255,
          h2 & 255,
          h3 >>> 24 & 255,
          h3 >>> 16 & 255,
          h3 >>> 8 & 255,
          h3 & 255,
          h4 >>> 24 & 255,
          h4 >>> 16 & 255,
          h4 >>> 8 & 255,
          h4 & 255,
          h5 >>> 24 & 255,
          h5 >>> 16 & 255,
          h5 >>> 8 & 255,
          h5 & 255,
          h6 >>> 24 & 255,
          h6 >>> 16 & 255,
          h6 >>> 8 & 255,
          h6 & 255
        ];
        if (!this.is224) {
          arr.push(h7 >>> 24 & 255, h7 >>> 16 & 255, h7 >>> 8 & 255, h7 & 255);
        }
        return arr;
      };
      Sha256.prototype.array = Sha256.prototype.digest;
      Sha256.prototype.arrayBuffer = function() {
        this.finalize();
        var buffer = new ArrayBuffer(this.is224 ? 28 : 32);
        var dataView = new DataView(buffer);
        dataView.setUint32(0, this.h0);
        dataView.setUint32(4, this.h1);
        dataView.setUint32(8, this.h2);
        dataView.setUint32(12, this.h3);
        dataView.setUint32(16, this.h4);
        dataView.setUint32(20, this.h5);
        dataView.setUint32(24, this.h6);
        if (!this.is224) {
          dataView.setUint32(28, this.h7);
        }
        return buffer;
      };
      function HmacSha256(key, is224, sharedMemory) {
        var i2, type = typeof key;
        if (type === "string") {
          var bytes = [], length = key.length, index = 0, code;
          for (i2 = 0; i2 < length; ++i2) {
            code = key.charCodeAt(i2);
            if (code < 128) {
              bytes[index++] = code;
            } else if (code < 2048) {
              bytes[index++] = 192 | code >>> 6;
              bytes[index++] = 128 | code & 63;
            } else if (code < 55296 || code >= 57344) {
              bytes[index++] = 224 | code >>> 12;
              bytes[index++] = 128 | code >>> 6 & 63;
              bytes[index++] = 128 | code & 63;
            } else {
              code = 65536 + ((code & 1023) << 10 | key.charCodeAt(++i2) & 1023);
              bytes[index++] = 240 | code >>> 18;
              bytes[index++] = 128 | code >>> 12 & 63;
              bytes[index++] = 128 | code >>> 6 & 63;
              bytes[index++] = 128 | code & 63;
            }
          }
          key = bytes;
        } else {
          if (type === "object") {
            if (key === null) {
              throw new Error(ERROR);
            } else if (ARRAY_BUFFER && key.constructor === ArrayBuffer) {
              key = new Uint8Array(key);
            } else if (!Array.isArray(key)) {
              if (!ARRAY_BUFFER || !ArrayBuffer.isView(key)) {
                throw new Error(ERROR);
              }
            }
          } else {
            throw new Error(ERROR);
          }
        }
        if (key.length > 64) {
          key = new Sha256(is224, true).update(key).array();
        }
        var oKeyPad = [], iKeyPad = [];
        for (i2 = 0; i2 < 64; ++i2) {
          var b2 = key[i2] || 0;
          oKeyPad[i2] = 92 ^ b2;
          iKeyPad[i2] = 54 ^ b2;
        }
        Sha256.call(this, is224, sharedMemory);
        this.update(iKeyPad);
        this.oKeyPad = oKeyPad;
        this.inner = true;
        this.sharedMemory = sharedMemory;
      }
      HmacSha256.prototype = new Sha256();
      HmacSha256.prototype.finalize = function() {
        Sha256.prototype.finalize.call(this);
        if (this.inner) {
          this.inner = false;
          var innerHash = this.array();
          Sha256.call(this, this.is224, this.sharedMemory);
          this.update(this.oKeyPad);
          this.update(innerHash);
          Sha256.prototype.finalize.call(this);
        }
      };
      var exports2 = createMethod();
      exports2.sha256 = exports2;
      exports2.sha224 = createMethod(true);
      exports2.sha256.hmac = createHmacMethod();
      exports2.sha224.hmac = createHmacMethod(true);
      if (COMMON_JS) {
        module.exports = exports2;
      } else {
        root.sha256 = exports2.sha256;
        root.sha224 = exports2.sha224;
        if (AMD) {
          define(function() {
            return exports2;
          });
        }
      }
    })();
  }
});

// package-external:@wordpress/core-data
var require_core_data = __commonJS({
  "package-external:@wordpress/core-data"(exports, module) {
    module.exports = window.wp.coreData;
  }
});

// ../../js-packages/config/src/index.js
var require_src = __commonJS({
  "../../js-packages/config/src/index.js"(exports, module) {
    var jetpackConfig = {};
    try {
      jetpackConfig = __require("jetpackConfig");
    } catch {
      console.error(
        "jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"
      );
      jetpackConfig = { missingConfig: true };
    }
    var jetpackConfigHas2 = (key) => {
      return Object.hasOwn(jetpackConfig, key);
    };
    var jetpackConfigGet2 = (key) => {
      if (!jetpackConfigHas2(key)) {
        throw 'This app requires the "' + key + '" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';
      }
      return jetpackConfig[key];
    };
    module.exports = {
      jetpackConfigHas: jetpackConfigHas2,
      jetpackConfigGet: jetpackConfigGet2
    };
  }
});

// package-external:@wordpress/plugins
var require_plugins = __commonJS({
  "package-external:@wordpress/plugins"(exports, module) {
    module.exports = window.wp.plugins;
  }
});

// package-external:@wordpress/hooks
var require_hooks = __commonJS({
  "package-external:@wordpress/hooks"(exports, module) {
    module.exports = window.wp.hooks;
  }
});

// package-external:@wordpress/dom-ready
var require_dom_ready = __commonJS({
  "package-external:@wordpress/dom-ready"(exports, module) {
    module.exports = window.wp.domReady;
  }
});

// package-external:@wordpress/dom
var require_dom = __commonJS({
  "package-external:@wordpress/dom"(exports, module) {
    module.exports = window.wp.dom;
  }
});

// ../../../node_modules/.pnpm/crc32@0.2.2/node_modules/crc32/lib/crc32.js
var require_crc32 = __commonJS({
  "../../../node_modules/.pnpm/crc32@0.2.2/node_modules/crc32/lib/crc32.js"(exports, module) {
    (function() {
      "use strict";
      var table = [], poly = 3988292384;
      function makeTable() {
        var c2, n2, k;
        for (n2 = 0; n2 < 256; n2 += 1) {
          c2 = n2;
          for (k = 0; k < 8; k += 1) {
            if (c2 & 1) {
              c2 = poly ^ c2 >>> 1;
            } else {
              c2 = c2 >>> 1;
            }
          }
          table[n2] = c2 >>> 0;
        }
      }
      function strToArr(str) {
        return Array.prototype.map.call(str, function(c2) {
          return c2.charCodeAt(0);
        });
      }
      function crcDirect(arr) {
        var crc = -1, i2, j2, l2, temp;
        for (i2 = 0, l2 = arr.length; i2 < l2; i2 += 1) {
          temp = (crc ^ arr[i2]) & 255;
          for (j2 = 0; j2 < 8; j2 += 1) {
            if ((temp & 1) === 1) {
              temp = temp >>> 1 ^ poly;
            } else {
              temp = temp >>> 1;
            }
          }
          crc = crc >>> 8 ^ temp;
        }
        return crc ^ -1;
      }
      function crcTable(arr, append) {
        var crc, i2, l2;
        if (typeof crcTable.crc === "undefined" || !append || !arr) {
          crcTable.crc = 0 ^ -1;
          if (!arr) {
            return;
          }
        }
        crc = crcTable.crc;
        for (i2 = 0, l2 = arr.length; i2 < l2; i2 += 1) {
          crc = crc >>> 8 ^ table[(crc ^ arr[i2]) & 255];
        }
        crcTable.crc = crc;
        return crc ^ -1;
      }
      makeTable();
      module.exports = function(val, direct) {
        var val = typeof val === "string" ? strToArr(val) : val, ret = direct ? crcDirect(val) : crcTable(val);
        return (ret >>> 0).toString(16);
      };
      module.exports.direct = crcDirect;
      module.exports.table = crcTable;
    })();
  }
});

// ../../../node_modules/.pnpm/seed-random@2.2.0/node_modules/seed-random/index.js
var require_seed_random = __commonJS({
  "../../../node_modules/.pnpm/seed-random@2.2.0/node_modules/seed-random/index.js"(exports, module) {
    "use strict";
    var width = 256;
    var chunks = 6;
    var digits = 52;
    var pool = [];
    var GLOBAL = typeof global === "undefined" ? window : global;
    var startdenom = Math.pow(width, chunks);
    var significance = Math.pow(2, digits);
    var overflow = significance * 2;
    var mask = width - 1;
    var oldRandom = Math.random;
    module.exports = function(seed2, options) {
      if (options && options.global === true) {
        options.global = false;
        Math.random = module.exports(seed2, options);
        options.global = true;
        return Math.random;
      }
      var use_entropy = options && options.entropy || false;
      var key = [];
      var shortseed = mixkey(flatten(
        use_entropy ? [seed2, tostring(pool)] : 0 in arguments ? seed2 : autoseed(),
        3
      ), key);
      var arc4 = new ARC4(key);
      mixkey(tostring(arc4.S), pool);
      return function() {
        var n2 = arc4.g(chunks), d2 = startdenom, x2 = 0;
        while (n2 < significance) {
          n2 = (n2 + x2) * width;
          d2 *= width;
          x2 = arc4.g(1);
        }
        while (n2 >= overflow) {
          n2 /= 2;
          d2 /= 2;
          x2 >>>= 1;
        }
        return (n2 + x2) / d2;
      };
    };
    module.exports.resetGlobal = function() {
      Math.random = oldRandom;
    };
    function ARC4(key) {
      var t2, keylen = key.length, me = this, i2 = 0, j2 = me.i = me.j = 0, s2 = me.S = [];
      if (!keylen) {
        key = [keylen++];
      }
      while (i2 < width) {
        s2[i2] = i2++;
      }
      for (i2 = 0; i2 < width; i2++) {
        s2[i2] = s2[j2 = mask & j2 + key[i2 % keylen] + (t2 = s2[i2])];
        s2[j2] = t2;
      }
      (me.g = function(count) {
        var t3, r3 = 0, i3 = me.i, j3 = me.j, s3 = me.S;
        while (count--) {
          t3 = s3[i3 = mask & i3 + 1];
          r3 = r3 * width + s3[mask & (s3[i3] = s3[j3 = mask & j3 + t3]) + (s3[j3] = t3)];
        }
        me.i = i3;
        me.j = j3;
        return r3;
      })(width);
    }
    function flatten(obj, depth) {
      var result2 = [], typ = (typeof obj)[0], prop;
      if (depth && typ == "o") {
        for (prop in obj) {
          try {
            result2.push(flatten(obj[prop], depth - 1));
          } catch (e2) {
          }
        }
      }
      return result2.length ? result2 : typ == "s" ? obj : obj + "\0";
    }
    function mixkey(seed2, key) {
      var stringseed = seed2 + "", smear, j2 = 0;
      while (j2 < stringseed.length) {
        key[mask & j2] = mask & (smear ^= key[mask & j2] * 19) + stringseed.charCodeAt(j2++);
      }
      return tostring(key);
    }
    function autoseed(seed2) {
      try {
        GLOBAL.crypto.getRandomValues(seed2 = new Uint8Array(width));
        return tostring(seed2);
      } catch (e2) {
        return [
          +/* @__PURE__ */ new Date(),
          GLOBAL,
          GLOBAL.navigator && GLOBAL.navigator.plugins,
          GLOBAL.screen,
          tostring(pool)
        ];
      }
    }
    function tostring(a2) {
      return String.fromCharCode.apply(0, a2);
    }
    mixkey(Math.random(), pool);
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/metadata.min.json.js
var metadata_min_json_default;
var init_metadata_min_json = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/metadata.min.json.js"() {
    metadata_min_json_default = { "version": 4, "country_calling_codes": { "1": ["US", "AG", "AI", "AS", "BB", "BM", "BS", "CA", "DM", "DO", "GD", "GU", "JM", "KN", "KY", "LC", "MP", "MS", "PR", "SX", "TC", "TT", "VC", "VG", "VI"], "7": ["RU", "KZ"], "20": ["EG"], "27": ["ZA"], "30": ["GR"], "31": ["NL"], "32": ["BE"], "33": ["FR"], "34": ["ES"], "36": ["HU"], "39": ["IT", "VA"], "40": ["RO"], "41": ["CH"], "43": ["AT"], "44": ["GB", "GG", "IM", "JE"], "45": ["DK"], "46": ["SE"], "47": ["NO", "SJ"], "48": ["PL"], "49": ["DE"], "51": ["PE"], "52": ["MX"], "53": ["CU"], "54": ["AR"], "55": ["BR"], "56": ["CL"], "57": ["CO"], "58": ["VE"], "60": ["MY"], "61": ["AU", "CC", "CX"], "62": ["ID"], "63": ["PH"], "64": ["NZ"], "65": ["SG"], "66": ["TH"], "81": ["JP"], "82": ["KR"], "84": ["VN"], "86": ["CN"], "90": ["TR"], "91": ["IN"], "92": ["PK"], "93": ["AF"], "94": ["LK"], "95": ["MM"], "98": ["IR"], "211": ["SS"], "212": ["MA", "EH"], "213": ["DZ"], "216": ["TN"], "218": ["LY"], "220": ["GM"], "221": ["SN"], "222": ["MR"], "223": ["ML"], "224": ["GN"], "225": ["CI"], "226": ["BF"], "227": ["NE"], "228": ["TG"], "229": ["BJ"], "230": ["MU"], "231": ["LR"], "232": ["SL"], "233": ["GH"], "234": ["NG"], "235": ["TD"], "236": ["CF"], "237": ["CM"], "238": ["CV"], "239": ["ST"], "240": ["GQ"], "241": ["GA"], "242": ["CG"], "243": ["CD"], "244": ["AO"], "245": ["GW"], "246": ["IO"], "247": ["AC"], "248": ["SC"], "249": ["SD"], "250": ["RW"], "251": ["ET"], "252": ["SO"], "253": ["DJ"], "254": ["KE"], "255": ["TZ"], "256": ["UG"], "257": ["BI"], "258": ["MZ"], "260": ["ZM"], "261": ["MG"], "262": ["RE", "YT"], "263": ["ZW"], "264": ["NA"], "265": ["MW"], "266": ["LS"], "267": ["BW"], "268": ["SZ"], "269": ["KM"], "290": ["SH", "TA"], "291": ["ER"], "297": ["AW"], "298": ["FO"], "299": ["GL"], "350": ["GI"], "351": ["PT"], "352": ["LU"], "353": ["IE"], "354": ["IS"], "355": ["AL"], "356": ["MT"], "357": ["CY"], "358": ["FI", "AX"], "359": ["BG"], "370": ["LT"], "371": ["LV"], "372": ["EE"], "373": ["MD"], "374": ["AM"], "375": ["BY"], "376": ["AD"], "377": ["MC"], "378": ["SM"], "380": ["UA"], "381": ["RS"], "382": ["ME"], "383": ["XK"], "385": ["HR"], "386": ["SI"], "387": ["BA"], "389": ["MK"], "420": ["CZ"], "421": ["SK"], "423": ["LI"], "500": ["FK"], "501": ["BZ"], "502": ["GT"], "503": ["SV"], "504": ["HN"], "505": ["NI"], "506": ["CR"], "507": ["PA"], "508": ["PM"], "509": ["HT"], "590": ["GP", "BL", "MF"], "591": ["BO"], "592": ["GY"], "593": ["EC"], "594": ["GF"], "595": ["PY"], "596": ["MQ"], "597": ["SR"], "598": ["UY"], "599": ["CW", "BQ"], "670": ["TL"], "672": ["NF"], "673": ["BN"], "674": ["NR"], "675": ["PG"], "676": ["TO"], "677": ["SB"], "678": ["VU"], "679": ["FJ"], "680": ["PW"], "681": ["WF"], "682": ["CK"], "683": ["NU"], "685": ["WS"], "686": ["KI"], "687": ["NC"], "688": ["TV"], "689": ["PF"], "690": ["TK"], "691": ["FM"], "692": ["MH"], "850": ["KP"], "852": ["HK"], "853": ["MO"], "855": ["KH"], "856": ["LA"], "880": ["BD"], "886": ["TW"], "960": ["MV"], "961": ["LB"], "962": ["JO"], "963": ["SY"], "964": ["IQ"], "965": ["KW"], "966": ["SA"], "967": ["YE"], "968": ["OM"], "970": ["PS"], "971": ["AE"], "972": ["IL"], "973": ["BH"], "974": ["QA"], "975": ["BT"], "976": ["MN"], "977": ["NP"], "992": ["TJ"], "993": ["TM"], "994": ["AZ"], "995": ["GE"], "996": ["KG"], "998": ["UZ"] }, "countries": { "AC": ["247", "00", "(?:[01589]\\d|[46])\\d{4}", [5, 6]], "AD": ["376", "00", "(?:1|6\\d)\\d{7}|[135-9]\\d{5}", [6, 8, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["[135-9]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["1"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]]], "AE": ["971", "00", "(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{2,9})", "$1 $2", ["60|8"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[236]|[479][2-8]"], "0$1"], ["(\\d{3})(\\d)(\\d{5})", "$1 $2 $3", ["[479]"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AF": ["93", "00", "[2-7]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"]], "0"], "AG": ["1", "011", "(?:268|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([457]\\d{6})$|1", "268$1", 0, "268"], "AI": ["1", "011", "(?:264|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2457]\\d{6})$|1", "264$1", 0, "264"], "AL": ["355", "00", "(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}", [6, 7, 8, 9], [["(\\d{3})(\\d{3,4})", "$1 $2", ["80|9"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["4[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2358][2-5]|4"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["[23578]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["6"], "0$1"]], "0"], "AM": ["374", "00", "(?:[1-489]\\d|55|60|77)\\d{6}", [8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[89]0"], "0 $1"], ["(\\d{3})(\\d{5})", "$1 $2", ["2|3[12]"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["1|47"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[3-9]"], "0$1"]], "0"], "AO": ["244", "00", "[29]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[29]"]]]], "AR": ["54", "00", "(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}", [10, 11], [["(\\d{4})(\\d{2})(\\d{4})", "$1 $2-$3", ["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])", "2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["1"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[68]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2-$3", ["[23]"], "0$1", 1], ["(\\d)(\\d{4})(\\d{2})(\\d{4})", "$2 15-$3-$4", ["9(?:2[2-469]|3[3-578])", "9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))", "9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]", "9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d)(\\d{2})(\\d{4})(\\d{4})", "$2 15-$3-$4", ["91"], "0$1", 0, "$1 $2 $3-$4"], ["(\\d{3})(\\d{3})(\\d{5})", "$1-$2-$3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{4})", "$2 15-$3-$4", ["9"], "0$1", 0, "$1 $2 $3-$4"]], "0", 0, "0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?", "9$1"], "AS": ["1", "011", "(?:[58]\\d\\d|684|900)\\d{7}", [10], 0, "1", 0, "([267]\\d{6})$|1", "684$1", 0, "684"], "AT": ["43", "00", "1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{3,12})", "$1 $2", ["1(?:11|[2-9])"], "0$1"], ["(\\d{3})(\\d{2})", "$1 $2", ["517"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["5[079]"], "0$1"], ["(\\d{3})(\\d{3,10})", "$1 $2", ["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]", "(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"], "0$1"], ["(\\d{4})(\\d{3,9})", "$1 $2", ["[2-467]|5[2-6]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,7})", "$1 $2 $3", ["5"], "0$1"]], "0"], "AU": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}", [5, 6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{3,4})", "$1 $2", ["16"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["16"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["14|4"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[2378]"], "(0$1)"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:30|[89])"]]], "0", 0, "(183[12])|0", 0, 0, 0, [["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, ["163\\d{2,6}", [5, 6, 7, 8, 9]], ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "AW": ["297", "00", "(?:[25-79]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[25-9]"]]]], "AX": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}", [5, 6, 7, 8, 9, 10, 11, 12], 0, "0", 0, 0, 0, 0, "18", 0, "00"], "AZ": ["994", "00", "365\\d{6}|(?:[124579]\\d|60|88)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[28]|2|365|46", "1[28]|2|365[45]|46", "1[28]|2|365(?:4|5[02])|46"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[13-9]"], "0$1"]], "0"], "BA": ["387", "00", "6\\d{8}|(?:[35689]\\d|49|70)\\d{6}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[1-3]|[7-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2-$3", ["[3-5]|6[56]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["6"], "0$1"]], "0"], "BB": ["1", "011", "(?:246|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "246$1", 0, "246"], "BD": ["880", "00", "[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{2})(\\d{4,6})", "$1-$2", ["31[5-8]|[459]1"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1-$2", ["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"], "0$1"], ["(\\d{4})(\\d{3,6})", "$1-$2", ["[13-9]|2[23]"], "0$1"], ["(\\d)(\\d{7,8})", "$1-$2", ["2"], "0$1"]], "0"], "BE": ["32", "00", "4\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:80|9)0"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[239]|4[23]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[15-8]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4"], "0$1"]], "0"], "BF": ["226", "00", "(?:[025-7]\\d|44)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[024-7]"]]]], "BG": ["359", "00", "00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}", [6, 7, 8, 9, 12], [["(\\d)(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["43[1-6]|70[1-9]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:70|8)0"], "0$1"], ["(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3", ["43[1-7]|7"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[48]|9[08]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"]], "0"], "BH": ["973", "00", "[136-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[13679]|8[02-4679]"]]]], "BI": ["257", "00", "(?:[267]\\d|31)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2367]"]]]], "BJ": ["229", "00", "(?:01\\d|8)\\d{7}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["0"]]]], "BL": ["590", "00", "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "BM": ["1", "011", "(?:441|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "441$1", 0, "441"], "BN": ["673", "00", "[2-578]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-578]"]]]], "BO": ["591", "00(?:1\\d)?", "8001\\d{5}|(?:[2-467]\\d|50)\\d{6}", [8, 9], [["(\\d)(\\d{7})", "$1 $2", ["[235]|4[46]"]], ["(\\d{8})", "$1", ["[67]"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["8"]]], "0", 0, "0(1\\d)?"], "BQ": ["599", "00", "(?:[34]1|7\\d)\\d{5}", [7], 0, 0, 0, 0, 0, 0, "[347]"], "BR": ["55", "00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)", "[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}", [8, 9, 10, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["300|4(?:0[02]|37|86)", "300|4(?:0(?:0|20)|370|864)"]], ["(\\d{3})(\\d{2,3})(\\d{4})", "$1 $2 $3", ["(?:[358]|90)0"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2-$3", ["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"], "($1)"], ["(\\d{2})(\\d{5})(\\d{4})", "$1 $2-$3", ["[16][1-9]|[2-57-9]"], "($1)"]], "0", 0, "(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?", "$2"], "BS": ["1", "011", "(?:242|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([3-8]\\d{6})$|1", "242$1", 0, "242"], "BT": ["975", "00", "[178]\\d{7}|[2-8]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-6]|7[246]|8[2-4]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[67]|[78]"]]]], "BW": ["267", "00", "(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["90"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[24-6]|3[15-9]"]], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37]"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["8"]]]], "BY": ["375", "810", "(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3})", "$1 $2", ["800"], "8 $1"], ["(\\d{3})(\\d{2})(\\d{2,4})", "$1 $2 $3", ["800"], "8 $1"], ["(\\d{4})(\\d{2})(\\d{3})", "$1 $2-$3", ["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])", "1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"], "8 0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["1(?:[56]|7[467])|2[1-3]"], "8 0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-4]"], "8 0$1"], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[89]"], "8 $1"]], "8", 0, "0|80?", 0, 0, 0, 0, "8~10"], "BZ": ["501", "00", "(?:0800\\d|[2-8])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-8]"]], ["(\\d)(\\d{3})(\\d{4})(\\d{3})", "$1-$2-$3-$4", ["0"]]]], "CA": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [7, 10], 0, "1", 0, 0, 0, 0, 0, [["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}", [10]], ["", [10]], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}", [10]], ["900[2-9]\\d{6}", [10]], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|3[23]|44|66|77|88)|6(?:22|33))[2-9]\\d{6}", [10]], 0, ["310\\d{4}", [7]], 0, ["600[2-9]\\d{6}", [10]]]], "CC": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CD": ["243", "00", "(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["[1-6]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["5"], "0$1"]], "0"], "CF": ["236", "00", "8776\\d{4}|(?:[27]\\d|61)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-8]"]]]], "CG": ["242", "00", "222\\d{6}|(?:0\\d|80)\\d{7}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[02]"]]]], "CH": ["41", "00", "8\\d{11}|[2-9]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8[047]|90"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]|81"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["8"], "0$1"]], "0"], "CI": ["225", "00", "[02]\\d{9}", [10], [["(\\d{2})(\\d{2})(\\d)(\\d{5})", "$1 $2 $3 $4", ["2"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3 $4", ["0"]]]], "CK": ["682", "00", "[2-578]\\d{4}", [5], [["(\\d{2})(\\d{3})", "$1 $2", ["[2-578]"]]]], "CL": ["56", "(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0", "12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}", [9, 10, 11], [["(\\d{5})(\\d{4})", "$1 $2", ["219", "2196"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["60|809"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["44"]], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2[1-36]"], "($1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["9(?:10|[2-9])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"], "($1)"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["60|8"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{3})(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["60"]]]], "CM": ["237", "00", "[26]\\d{8}|88\\d{6,7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["88"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[26]|88"]]]], "CN": ["86", "00|1(?:[12]\\d|79)\\d\\d00", "(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5,6})", "$1 $2", ["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]", "(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123", "10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"], "0$1"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]", "(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]", "85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])", "85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["(?:4|80)0"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|2(?:[02-57-9]|1[1-9])", "10|2(?:[02-57-9]|1[1-9])", "10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"], "0$1", 1], ["(\\d{3})(\\d{7,8})", "$1 $2", ["9"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["80"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[3-578]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["1[3-9]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["[12]"], "0$1", 1]], "0", 0, "(1(?:[12]\\d|79)\\d\\d)|0", 0, 0, 0, 0, "00"], "CO": ["57", "00(?:4(?:[14]4|56)|[579])", "(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["46"]], ["(\\d{3})(\\d{7})", "$1 $2", ["6|90"], "($1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3[0-357]|9[14]"]], ["(\\d)(\\d{3})(\\d{7})", "$1-$2-$3", ["1"], "0$1", 0, "$1 $2 $3"]], "0", 0, "0([3579]|4(?:[14]4|56))?"], "CR": ["506", "00", "(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}", [8, 10], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[3-9]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["[89]"]]], 0, 0, "(19(?:0[0-2468]|1[09]|20|66|77|99))"], "CU": ["53", "119", "(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}", [6, 7, 8, 10], [["(\\d{2})(\\d{4,6})", "$1 $2", ["2[1-4]|[34]"], "(0$1)"], ["(\\d)(\\d{6,7})", "$1 $2", ["7"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["[56]"], "0$1"], ["(\\d{3})(\\d{7})", "$1 $2", ["8"], "0$1"]], "0"], "CV": ["238", "0", "(?:[2-59]\\d\\d|800)\\d{4}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2-589]"]]]], "CW": ["599", "00", "(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[3467]"]], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["9[4-8]"]]], 0, 0, 0, 0, 0, "[69]"], "CX": ["61", "001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011", "1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}", [6, 7, 8, 9, 10, 12], 0, "0", 0, "([59]\\d{7})$|0", "8$1", 0, 0, [["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}", [9]], ["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}", [9]], ["180(?:0\\d{3}|2)\\d{3}", [7, 10]], ["190[0-26]\\d{6}", [10]], 0, 0, 0, 0, ["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}", [9]], ["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}", [6, 8, 10, 12]]], "0011"], "CY": ["357", "00", "(?:[279]\\d|[58]0)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[257-9]"]]]], "CZ": ["420", "00", "(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}", [9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]|9[015-7]"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["96"]], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]]], "DE": ["49", "00", "[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [["(\\d{2})(\\d{3,13})", "$1 $2", ["3[02]|40|[68]9"], "0$1"], ["(\\d{3})(\\d{3,12})", "$1 $2", ["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1", "2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"], "0$1"], ["(\\d{4})(\\d{2,11})", "$1 $2", ["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]", "[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["138"], "0$1"], ["(\\d{5})(\\d{2,10})", "$1 $2", ["3"], "0$1"], ["(\\d{3})(\\d{5,11})", "$1 $2", ["181"], "0$1"], ["(\\d{3})(\\d)(\\d{4,10})", "$1 $2 $3", ["1(?:3|80)|9"], "0$1"], ["(\\d{3})(\\d{7,8})", "$1 $2", ["1[67]"], "0$1"], ["(\\d{3})(\\d{7,12})", "$1 $2", ["8"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["185", "1850", "18500"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["18[68]"], "0$1"], ["(\\d{4})(\\d{7})", "$1 $2", ["15[1279]"], "0$1"], ["(\\d{5})(\\d{6})", "$1 $2", ["15[03568]", "15(?:[0568]|3[13])"], "0$1"], ["(\\d{3})(\\d{8})", "$1 $2", ["18"], "0$1"], ["(\\d{3})(\\d{2})(\\d{7,8})", "$1 $2 $3", ["1(?:6[023]|7)"], "0$1"], ["(\\d{4})(\\d{2})(\\d{7})", "$1 $2 $3", ["15[279]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{8})", "$1 $2 $3", ["15"], "0$1"]], "0"], "DJ": ["253", "00", "(?:2\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[27]"]]]], "DK": ["45", "00", "[2-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-9]"]]]], "DM": ["1", "011", "(?:[58]\\d\\d|767|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "767$1", 0, "767"], "DO": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "8001|8[024]9"], "DZ": ["213", "00", "(?:[1-4]|[5-79]\\d|80)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["9"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-8]"], "0$1"]], "0"], "EC": ["593", "00", "1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}", [8, 9, 10, 11], [["(\\d)(\\d{3})(\\d{4})", "$1 $2-$3", ["[2-7]"], "(0$1)", 0, "$1-$2-$3"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1"]]], "0"], "EE": ["372", "00", "8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88", "[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]], ["(\\d{4})(\\d{3,4})", "$1 $2", ["[45]|8(?:00|[1-49])", "[45]|8(?:00[1-9]|[1-49])"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "EG": ["20", "00", "[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}", [8, 9, 10], [["(\\d)(\\d{7,8})", "$1 $2", ["[23]"], "0$1"], ["(\\d{2})(\\d{6,7})", "$1 $2", ["1[35]|[4-6]|8[2468]|9[235-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{8})", "$1 $2", ["1"], "0$1"]], "0"], "EH": ["212", "00", "[5-8]\\d{8}", [9], 0, "0", 0, 0, 0, 0, 0, [["528[89]\\d{5}"], ["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"], ["80[0-7]\\d{6}"], ["89\\d{7}"], 0, 0, 0, 0, ["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]], "ER": ["291", "00", "[178]\\d{6}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[178]"], "0$1"]], "0"], "ES": ["34", "00", "[5-9]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[89]00"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-9]"]]]], "ET": ["251", "00", "(?:11|[2-579]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-579]"], "0$1"]], "0"], "FI": ["358", "00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))", "[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}", [5, 6, 7, 8, 9, 10, 11, 12], [["(\\d{5})", "$1", ["20[2-59]"], "0$1"], ["(\\d{3})(\\d{3,7})", "$1 $2", ["(?:[1-3]0|[68])0|70[07-9]"], "0$1"], ["(\\d{2})(\\d{4,8})", "$1 $2", ["[14]|2[09]|50|7[135]"], "0$1"], ["(\\d{2})(\\d{6,10})", "$1 $2", ["7"], "0$1"], ["(\\d)(\\d{4,9})", "$1 $2", ["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"], "0$1"]], "0", 0, 0, 0, 0, "1[03-79]|[2-9]", 0, "00"], "FJ": ["679", "0(?:0|52)", "45\\d{5}|(?:0800\\d|[235-9])\\d{6}", [7, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[235-9]|45"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "FK": ["500", "00", "[2-7]\\d{4}", [5]], "FM": ["691", "00", "(?:[39]\\d\\d|820)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[389]"]]]], "FO": ["298", "00", "[2-9]\\d{5}", [6], [["(\\d{6})", "$1", ["[2-9]"]]], 0, 0, "(10(?:01|[12]0|88))"], "FR": ["33", "00", "[1-9]\\d{8}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0 $1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[1-79]"], "0$1"]], "0"], "GA": ["241", "00", "(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}", [7, 8], [["(\\d)(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-7]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["11|[67]"], "0$1"]], 0, 0, "0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})", "$1"], "GB": ["44", "00", "[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}", [7, 9, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["800", "8001", "80011", "800111", "8001111"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["845", "8454", "84546", "845464"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["800"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["1(?:38|5[23]|69|76|94)", "1(?:(?:38|69)7|5(?:24|39)|768|946)", "1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["1(?:[2-69][02-9]|[78])"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[25]|7(?:0|6[02-9])", "[25]|7(?:0|6(?:[03-9]|2[356]))"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1389]"], "0$1"]], "0", 0, "0|180020", 0, 0, 0, [["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}", [9, 10]], ["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]], 0, " x"], "GD": ["1", "011", "(?:473|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "473$1", 0, "473"], "GE": ["995", "00", "(?:[3-57]\\d\\d|800)\\d{6}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["32"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[57]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[348]"], "0$1"]], "0"], "GF": ["594", "00", "(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]|9[47]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[89]"], "0$1"]], "0"], "GG": ["44", "00", "(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?", [7, 9, 10], 0, "0", 0, "([25-9]\\d{5})$|0|180020", "1481$1", 0, 0, [["1481[25-9]\\d{5}", [10]], ["7(?:(?:781|839)\\d|911[17])\\d{5}", [10]], ["80[08]\\d{7}|800\\d{6}|8001111"], ["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d", [7, 10]], ["70\\d{8}", [10]], 0, ["(?:3[0347]|55)\\d{8}", [10]], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}", [10]], ["56\\d{8}", [10]]]], "GH": ["233", "00", "(?:[235]\\d{3}|800)\\d{5}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[235]"], "0$1"]], "0"], "GI": ["350", "00", "(?:[25]\\d|60)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["2"]]]], "GL": ["299", "00", "(?:19|[2-689]\\d|70)\\d{4}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["19|[2-9]"]]]], "GM": ["220", "00", "[2-9]\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "GN": ["224", "00", "722\\d{6}|(?:3|6\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["3"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[67]"]]]], "GP": ["590", "00", "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0", 0, 0, 0, 0, 0, [["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "GQ": ["240", "00", "222\\d{6}|(?:3\\d|55|[89]0)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235]"]], ["(\\d{3})(\\d{6})", "$1 $2", ["[89]"]]]], "GR": ["30", "00", "5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}", [10, 11, 12], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["21|7"]], ["(\\d{4})(\\d{6})", "$1 $2", ["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2689]"]], ["(\\d{3})(\\d{3,4})(\\d{5})", "$1 $2 $3", ["8"]]]], "GT": ["502", "00", "80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[2-8]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "GU": ["1", "011", "(?:[58]\\d\\d|671|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "671$1", 0, "671"], "GW": ["245", "00", "[49]\\d{8}|4\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["40"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"]]]], "GY": ["592", "001", "(?:[2-8]\\d{3}|9008)\\d{3}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "HK": ["852", "00(?:30|5[09]|[126-9]?)", "8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}", [5, 6, 7, 8, 9, 11], [["(\\d{3})(\\d{2,5})", "$1 $2", ["900", "9003"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{3})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["9"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "HN": ["504", "00", "8\\d{10}|[237-9]\\d{7}", [8, 11], [["(\\d{4})(\\d{4})", "$1-$2", ["[237-9]"]]]], "HR": ["385", "00", "[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}", [7, 8, 9], [["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["6[01]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{4})(\\d{3})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6|7[245]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-57]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"]], "0"], "HT": ["509", "00", "[2-589]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[2-589]"]]]], "HU": ["36", "00", "[235-7]\\d{8}|[1-9]\\d{7}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"], "(06 $1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "06 $1"]], "06"], "ID": ["62", "00[89]", "00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}", [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["15"]], ["(\\d{2})(\\d{5,9})", "$1 $2", ["2[124]|[36]1"], "(0$1)"], ["(\\d{3})(\\d{5,7})", "$1 $2", ["800"], "0$1"], ["(\\d{3})(\\d{5,8})", "$1 $2", ["[2-79]"], "(0$1)"], ["(\\d{3})(\\d{3,4})(\\d{3})", "$1-$2-$3", ["8[1-35-9]"], "0$1"], ["(\\d{3})(\\d{6,8})", "$1 $2", ["1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["804"], "0$1"], ["(\\d{3})(\\d)(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["80"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1-$2-$3", ["8"], "0$1"]], "0"], "IE": ["353", "00", "(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["2[24-9]|47|58|6[237-9]|9[35-9]"], "(0$1)"], ["(\\d{3})(\\d{5})", "$1 $2", ["[45]0"], "(0$1)"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2569]|4[1-69]|7[14]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["70"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["81"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["4"], "(0$1)"], ["(\\d{2})(\\d)(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "IL": ["972", "0(?:0|1[2-9])", "1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}", [7, 8, 9, 10, 11, 12], [["(\\d{4})(\\d{3})", "$1-$2", ["125"]], ["(\\d{4})(\\d{2})(\\d{2})", "$1-$2-$3", ["121"]], ["(\\d)(\\d{3})(\\d{4})", "$1-$2-$3", ["[2-489]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1-$2-$3", ["12"]], ["(\\d{4})(\\d{6})", "$1-$2", ["159"]], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3-$4", ["1[7-9]"]], ["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})", "$1-$2 $3-$4", ["15"]]], "0"], "IM": ["44", "00", "1624\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([25-8]\\d{5})$|0|180020", "1624$1", 0, "74576|(?:16|7[56])24"], "IN": ["91", "00", "(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}", [8, 9, 10, 11, 12, 13], [["(\\d{8})", "$1", ["5(?:0|2[23]|3[03]|[67]1|88)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)", "5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"], 0, 1], ["(\\d{4})(\\d{4,5})", "$1 $2", ["180", "1800"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["140"], 0, 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["11|2[02]|33|4[04]|79[1-7]|80[2-46]", "11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])", "11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]", "1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"], "0$1", 1], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807", "1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]", "1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"], "0$1", 1], ["(\\d{5})(\\d{5})", "$1 $2", ["16|[6-9]"], "0$1", 1], ["(\\d{4})(\\d{2,4})(\\d{4})", "$1 $2 $3", ["18[06]", "18[06]0"], 0, 1], ["(\\d{4})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["18"], 0, 1]], "0"], "IO": ["246", "00", "3\\d{6}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["3"]]]], "IQ": ["964", "00", "(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-6]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"]], "0"], "IR": ["98", "00", "[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}", [4, 5, 6, 7, 10], [["(\\d{4,5})", "$1", ["96"], "0$1"], ["(\\d{2})(\\d{4,5})", "$1 $2", ["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["[1-8]"], "0$1"]], "0"], "IS": ["354", "00|1(?:0(?:01|[12]0)|100)", "(?:38\\d|[4-9])\\d{6}", [7, 9], [["(\\d{3})(\\d{4})", "$1 $2", ["[4-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["3"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "IT": ["39", "00", "0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?", [6, 7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{4,6})", "$1 $2", ["0[26]"]], ["(\\d{3})(\\d{3,6})", "$1 $2", ["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])", "0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]], ["(\\d{4})(\\d{2,6})", "$1 $2", ["0(?:[13-579][2-46-8]|8[236-8])"]], ["(\\d{4})(\\d{4})", "$1 $2", ["894"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[26]|5"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["1(?:44|[679])|[378]|43"]], ["(\\d{3})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["0[13-57-9][0159]|14"]], ["(\\d{2})(\\d{4})(\\d{5})", "$1 $2 $3", ["0[26]"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[03]"]]], 0, 0, 0, 0, 0, 0, [["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"], ["3[2-9]\\d{7,8}|(?:31|43)\\d{8}", [9, 10]], ["80(?:0\\d{3}|3)\\d{3}", [6, 9]], ["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}", [6, 8, 9, 10]], ["1(?:78\\d|99)\\d{6}", [9, 10]], ["3[2-8]\\d{9,10}", [11, 12]], 0, 0, ["55\\d{8}", [10]], ["84(?:[08]\\d{3}|[17])\\d{3}", [6, 9]]]], "JE": ["44", "00", "1534\\d{6}|(?:[3578]\\d|90)\\d{8}", [10], 0, "0", 0, "([0-24-8]\\d{5})$|0|180020", "1534$1", 0, 0, [["1534[0-24-8]\\d{5}"], ["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"], ["80(?:07(?:35|81)|8901)\\d{4}"], ["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"], ["701511\\d{4}"], 0, ["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"], ["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"], ["56\\d{8}"]]], "JM": ["1", "011", "(?:[58]\\d\\d|658|900)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "658|876"], "JO": ["962", "00", "(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}", [8, 9], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2356]|87"], "(0$1)"], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["70"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[47]"], "0$1"]], "0"], "JP": ["81", "010", "00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}", [8, 9, 10, 11, 12, 13, 14, 15, 16, 17], [["(\\d{3})(\\d{3})(\\d{3})", "$1-$2-$3", ["(?:12|57|99)0"], "0$1"], ["(\\d{4})(\\d)(\\d{4})", "$1-$2-$3", ["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]", "1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["60"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2-$3", ["3|4(?:2[09]|7[01])|6[1-9]", "3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]", "1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3", ["[14]|[289][2-9]|5[3-9]|7[2-4679]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2-$3", ["800"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[25-9]"], "0$1"]], "0", 0, "(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0", "$1"], "KE": ["254", "000", "(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}", [7, 8, 9, 10], [["(\\d{2})(\\d{5,7})", "$1 $2", ["[24-6]"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[17]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0"], "KG": ["996", "00", "8\\d{9}|[235-9]\\d{8}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["3(?:1[346]|[24-79])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-79]|88"], "0$1"], ["(\\d{3})(\\d{3})(\\d)(\\d{2,3})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "KH": ["855", "00[14-9]", "1\\d{9}|[1-9]\\d{7,8}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "KI": ["686", "00", "(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}", [5, 8], 0, "0"], "KM": ["269", "00", "[3478]\\d{6}", [7], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[3478]"]]]], "KN": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "869$1", 0, "869"], "KP": ["850", "00|99", "85\\d{6}|(?:19\\d|[2-7])\\d{7}", [8, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-7]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"]], "0"], "KR": ["82", "00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))", "00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}", [5, 6, 8, 9, 10, 11, 12, 13, 14], [["(\\d{2})(\\d{3,4})", "$1-$2", ["(?:3[1-3]|[46][1-4]|5[1-5])1"], "0$1"], ["(\\d{4})(\\d{4})", "$1-$2", ["1"]], ["(\\d)(\\d{3,4})(\\d{4})", "$1-$2-$3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1-$2-$3", ["[36]0|8"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1-$2-$3", ["[1346]|5[1-5]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2-$3", ["[57]"], "0$1"], ["(\\d{2})(\\d{5})(\\d{4})", "$1-$2-$3", ["5"], "0$1"]], "0", 0, "0(8(?:[1-46-8]|5\\d\\d))?"], "KW": ["965", "00", "18\\d{5}|(?:[2569]\\d|41)\\d{6}", [7, 8], [["(\\d{4})(\\d{3,4})", "$1 $2", ["[169]|2(?:[235]|4[1-35-9])|52"]], ["(\\d{3})(\\d{5})", "$1 $2", ["[245]"]]]], "KY": ["1", "011", "(?:345|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "345$1", 0, "345"], "KZ": ["7", "810", "8\\d{13}|[78]\\d{9}", [10, 14], 0, "8", 0, 0, 0, 0, "7", 0, "8~10"], "LA": ["856", "00", "[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}", [8, 9, 10], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2[13]|3[14]|[4-8]"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["3"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0"], "LB": ["961", "00", "[27-9]\\d{7}|[13-9]\\d{6}", [7, 8], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[27-9]"]]], "0"], "LC": ["1", "011", "(?:[58]\\d\\d|758|900)\\d{7}", [10], 0, "1", 0, "([2-8]\\d{6})$|1", "758$1", 0, "758"], "LI": ["423", "00", "[68]\\d{8}|(?:[2378]\\d|90)\\d{5}", [7, 9], [["(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3", ["[2379]|8(?:0[09]|7)", "[2379]|8(?:0(?:02|9)|7)"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["69"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]]], "0", 0, "(1001)|0"], "LK": ["94", "00", "[1-9]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[1-689]"], "0$1"]], "0"], "LR": ["231", "00", "(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["4[67]|[56]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-578]"], "0$1"]], "0"], "LS": ["266", "00", "(?:[256]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2568]"]]]], "LT": ["370", "00", "(?:[3469]\\d|52|[78]0)\\d{6}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["52[0-7]"], "(0-$1)", 1], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0 $1", 1], ["(\\d{2})(\\d{6})", "$1 $2", ["37|4(?:[15]|6[1-8])"], "(0-$1)", 1], ["(\\d{3})(\\d{5})", "$1 $2", ["[3-6]"], "(0-$1)", 1]], "0", 0, "[08]"], "LU": ["352", "00", "35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}", [4, 5, 6, 7, 8, 9, 10, 11], [["(\\d{2})(\\d{3})", "$1 $2", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["20[2-689]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4", ["20"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})", "$1 $2 $3 $4", ["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["80[01]|90[015]"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3 $4", ["20"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})", "$1 $2 $3 $4 $5", ["20"]]], 0, 0, "(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"], "LV": ["371", "00", "(?:[268]\\d|78|90)\\d{6}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2679]|8[01]"]]]], "LY": ["218", "00", "[2-9]\\d{8}", [9], [["(\\d{2})(\\d{7})", "$1-$2", ["[2-9]"], "0$1"]], "0"], "MA": ["212", "00", "[5-8]\\d{8}", [9], [["(\\d{4})(\\d{5})", "$1-$2", ["892"], "0$1"], ["(\\d{2})(\\d{7})", "$1-$2", ["8(?:0[0-7]|9)"], "0$1"], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[5-8]"], "0$1"]], "0", 0, 0, 0, 0, "[5-8]"], "MC": ["377", "00", "(?:[3489]|[67]\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["4"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[389]"]], ["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4 $5", ["[67]"], "0$1"]], "0"], "MD": ["373", "00", "(?:[235-7]\\d|[89]0)\\d{6}", [8], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["22|3"], "0$1"], ["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["[25-7]"], "0$1"]], "0"], "ME": ["382", "00", "(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[2-9]"], "0$1"]], "0"], "MF": ["590", "00", "(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}", [9], 0, "0", 0, 0, 0, 0, 0, [["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"], ["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"], ["80[0-5]\\d{6}"], 0, 0, 0, 0, 0, ["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]], "MG": ["261", "00", "[23]\\d{8}", [9], [["(\\d{2})(\\d{2})(\\d{3})(\\d{2})", "$1 $2 $3 $4", ["[23]"], "0$1"]], "0", 0, "([24-9]\\d{6})$|0", "20$1"], "MH": ["692", "011", "329\\d{4}|(?:[256]\\d|45)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1-$2", ["[2-6]"]]], "1"], "MK": ["389", "00", "[2-578]\\d{7}", [8], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2|34[47]|4(?:[37]7|5[47]|64)"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[347]"], "0$1"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[58]"], "0$1"]], "0"], "ML": ["223", "00", "[24-9]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24-9]"]]]], "MM": ["95", "00", "1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}", [6, 7, 8, 9, 10], [["(\\d)(\\d{2})(\\d{3})", "$1 $2 $3", ["16|2"], "0$1"], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"], "0$1"], ["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[12]|452|678|86", "[12]|452|6788|86"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[4-7]|8[1-35]"], "0$1"], ["(\\d)(\\d{3})(\\d{4,6})", "$1 $2 $3", ["9(?:2[0-4]|[35-9]|4[137-9])"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["92"], "0$1"], ["(\\d)(\\d{5})(\\d{4})", "$1 $2 $3", ["9"], "0$1"]], "0"], "MN": ["976", "001", "[12]\\d{7,9}|[5-9]\\d{7}", [8, 9, 10], [["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["[12]1"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[5-9]"]], ["(\\d{3})(\\d{5,6})", "$1 $2", ["[12]2[1-3]"], "0$1"], ["(\\d{4})(\\d{5,6})", "$1 $2", ["[12](?:27|3[2-8]|4[2-68]|5[1-4689])", "[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"], "0$1"], ["(\\d{5})(\\d{4,5})", "$1 $2", ["[12]"], "0$1"]], "0"], "MO": ["853", "00", "0800\\d{3}|(?:28|[68]\\d)\\d{6}", [7, 8], [["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[268]"]]]], "MP": ["1", "011", "[58]\\d{9}|(?:67|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "670$1", 0, "670"], "MQ": ["596", "00", "(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-79]|8(?:0[6-9]|[36])"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "MR": ["222", "00", "(?:[2-4]\\d\\d|800)\\d{5}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-48]"]]]], "MS": ["1", "011", "(?:[58]\\d\\d|664|900)\\d{7}", [10], 0, "1", 0, "([34]\\d{6})$|1", "664$1", 0, "664"], "MT": ["356", "00", "3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[2357-9]"]]]], "MU": ["230", "0(?:0|[24-7]0|3[03])", "(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}", [7, 8, 10], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-46]|8[013]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[57]"]], ["(\\d{5})(\\d{5})", "$1 $2", ["8"]]], 0, 0, 0, 0, 0, 0, 0, "020"], "MV": ["960", "0(?:0|19)", "(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}", [7, 10], [["(\\d{3})(\\d{4})", "$1-$2", ["[34679]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MW": ["265", "00", "(?:[1289]\\d|31|77)\\d{7}|1\\d{6}", [7, 9], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["1[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[137-9]"], "0$1"]], "0"], "MX": ["52", "0[09]", "[2-9]\\d{9}", [10], [["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["33|5[56]|81"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[2-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "MY": ["60", "00", "1\\d{8,9}|(?:3\\d|[4-9])\\d{7}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1-$2 $3", ["[4-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1-$2 $3", ["1(?:[02469]|[378][1-9]|53)|8", "1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"], "0$1"], ["(\\d)(\\d{4})(\\d{4})", "$1-$2 $3", ["3"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{4})", "$1-$2-$3-$4", ["1(?:[367]|80)"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1-$2 $3", ["15"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4})", "$1-$2 $3", ["1"], "0$1"]], "0"], "MZ": ["258", "00", "(?:2|8\\d)\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2|8[2-79]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["8"]]]], "NA": ["264", "00", "[68]\\d{7,8}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["88"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["87"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "NC": ["687", "00", "(?:050|[2-57-9]\\d\\d)\\d{3}", [6], [["(\\d{2})(\\d{2})(\\d{2})", "$1.$2.$3", ["[02-57-9]"]]]], "NE": ["227", "00", "[027-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["08"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[089]|2[013]|7[0467]"]]]], "NF": ["672", "00", "[13]\\d{5}", [6], [["(\\d{2})(\\d{4})", "$1 $2", ["1[0-3]"]], ["(\\d)(\\d{5})", "$1 $2", ["[13]"]]], 0, 0, "([0-258]\\d{4})$", "3$1"], "NG": ["234", "009", "(?:20|9\\d)\\d{8}|[78]\\d{9,13}", [10, 11, 12, 13, 14], [["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[7-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["20[129]"], "0$1"], ["(\\d{4})(\\d{2})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{3})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["[78]"], "0$1"], ["(\\d{3})(\\d{5})(\\d{5,6})", "$1 $2 $3", ["[78]"], "0$1"]], "0"], "NI": ["505", "00", "(?:1800|[25-8]\\d{3})\\d{4}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[125-8]"]]]], "NL": ["31", "00", "(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}", [5, 6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{4,7})", "$1 $2", ["[89]0"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["66"], "0$1"], ["(\\d)(\\d{8})", "$1 $2", ["6"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-578]|91"], "0$1"], ["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3", ["9"], "0$1"]], "0"], "NO": ["47", "00", "(?:0|[2-9]\\d{3})\\d{4}", [5, 8], [["(\\d{3})(\\d{2})(\\d{3})", "$1 $2 $3", ["8"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[2-79]"]]], 0, 0, 0, 0, 0, "[02-689]|7[0-8]"], "NP": ["977", "00", "(?:1\\d|9)\\d{9}|[1-9]\\d{7}", [8, 10, 11], [["(\\d)(\\d{7})", "$1-$2", ["1[2-6]"], "0$1"], ["(\\d{2})(\\d{6})", "$1-$2", ["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"], "0$1"], ["(\\d{3})(\\d{7})", "$1-$2", ["9"]]], "0"], "NR": ["674", "00", "(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[24-9]"]]]], "NU": ["683", "00", "(?:[4-7]|888\\d)\\d{3}", [4, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["8"]]]], "NZ": ["64", "0(?:0|161)", "[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,8})", "$1 $2", ["8[1-79]"], "0$1"], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["50[036-8]|8|90", "50(?:[0367]|88)|8|90"], "0$1"], ["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["24|[346]|7[2-57-9]|9[2-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:10|74)|[589]"], "0$1"], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["1|2[028]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,5})", "$1 $2 $3", ["2(?:[169]|7[0-35-9])|7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "00"], "OM": ["968", "00", "(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}", [7, 8, 9], [["(\\d{3})(\\d{4,6})", "$1 $2", ["[58]"]], ["(\\d{2})(\\d{6})", "$1 $2", ["2"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[179]"]]]], "PA": ["507", "00", "(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}", [7, 8, 10, 11], [["(\\d{3})(\\d{4})", "$1-$2", ["[1-57-9]"]], ["(\\d{4})(\\d{4})", "$1-$2", ["[68]"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]]], "PE": ["51", "00|19(?:1[124]|77|90)00", "(?:[14-8]|9\\d)\\d{7}", [8, 9], [["(\\d{3})(\\d{5})", "$1 $2", ["80"], "(0$1)"], ["(\\d)(\\d{7})", "$1 $2", ["1"], "(0$1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[4-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"]]], "0", 0, 0, 0, 0, 0, 0, "00", " Anexo "], "PF": ["689", "00", "4\\d{5}(?:\\d{2})?|8\\d{7,8}", [6, 8, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["44"]], ["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["4|8[7-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "PG": ["675", "00|140[1-3]", "(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["18|[2-69]|85"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[78]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "PH": ["63", "00", "(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}", [6, 8, 9, 10, 11, 12, 13], [["(\\d)(\\d{5})", "$1 $2", ["2"], "(0$1)"], ["(\\d{4})(\\d{4,6})", "$1 $2", ["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2", "3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"], "(0$1)"], ["(\\d{5})(\\d{4})", "$1 $2", ["346|4(?:27|9[35])|883", "3469|4(?:279|9(?:30|56))|8834"], "(0$1)"], ["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["2"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|8[2-8]"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]], ["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})", "$1 $2 $3 $4", ["1"]]], "0"], "PK": ["92", "00", "122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,7})", "$1 $2 $3", ["[89]0"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["1"]], ["(\\d{3})(\\d{6,7})", "$1 $2", ["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])", "9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"], "(0$1)"], ["(\\d{2})(\\d{7,8})", "$1 $2", ["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"], "(0$1)"], ["(\\d{5})(\\d{5})", "$1 $2", ["58"], "(0$1)"], ["(\\d{3})(\\d{7})", "$1 $2", ["3"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"], "(0$1)"], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[24-9]"], "(0$1)"]], "0"], "PL": ["48", "00", "(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}", [6, 7, 8, 9, 10], [["(\\d{5})", "$1", ["19"]], ["(\\d{3})(\\d{3})", "$1 $2", ["11|20|64"]], ["(\\d{2})(\\d{2})(\\d{3})", "$1 $2 $3", ["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1", "(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]], ["(\\d{3})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["64"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["1[2-8]|[2-7]|8[1-79]|9[145]"]], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["8"]]]], "PM": ["508", "00", "[45]\\d{5}|(?:708|8\\d\\d)\\d{6}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[45]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"], "0$1"]], "0"], "PR": ["1", "011", "(?:[589]\\d\\d|787)\\d{7}", [10], 0, "1", 0, 0, 0, 0, "787|939"], "PS": ["970", "00", "[2489]2\\d{6}|(?:1\\d|5)\\d{8}", [8, 9, 10], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["[2489]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "PT": ["351", "00", "1693\\d{5}|(?:[26-9]\\d|30)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["2[12]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["16|[236-9]"]]]], "PW": ["680", "01[12]", "(?:[24-8]\\d\\d|345|900)\\d{4}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-9]"]]]], "PY": ["595", "00", "[36-8]\\d{5,8}|4\\d{6,8}|59\\d{6}|9\\d{5,10}|(?:2\\d|5[0-8])\\d{6,7}", [6, 7, 8, 9, 10, 11], [["(\\d{3})(\\d{3,6})", "$1 $2", ["[2-9]0"], "0$1"], ["(\\d{2})(\\d{5})", "$1 $2", ["3[289]|4[246-8]|61|7[1-3]|8[1-36]"], "(0$1)"], ["(\\d{3})(\\d{4,5})", "$1 $2", ["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["87"]], ["(\\d{3})(\\d{6})", "$1 $2", ["9(?:[5-79]|8[1-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-8]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["9"]]], "0"], "QA": ["974", "00", "800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}", [7, 8, 9, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["2[136]|8"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[3-7]"]]]], "RE": ["262", "00", "709\\d{6}|(?:26|[689]\\d)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[26-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, [["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"], ["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"], ["80\\d{7}"], ["89[1-37-9]\\d{6}"], 0, 0, 0, 0, ["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"], ["8(?:1[019]|2[0156]|84|90)\\d{6}"]]], "RO": ["40", "00", "(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}", [6, 9], [["(\\d{3})(\\d{3})", "$1 $2", ["2[3-6]", "2[3-6]\\d9"], "0$1"], ["(\\d{2})(\\d{4})", "$1 $2", ["219|31"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[23]1"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[236-9]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, " int "], "RS": ["381", "00", "38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}", [6, 7, 8, 9, 10, 11, 12], [["(\\d{3})(\\d{3,9})", "$1 $2", ["(?:2[389]|39)0|[7-9]"], "0$1"], ["(\\d{2})(\\d{5,10})", "$1 $2", ["[1-36]"], "0$1"]], "0"], "RU": ["7", "810", "8\\d{13}|[347-9]\\d{9}", [10, 14], [["(\\d{4})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-8]|2[1-9])", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))", "7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"], "8 ($1)", 1], ["(\\d{5})(\\d)(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["7(?:1[0-68]|2[1-9])", "7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))", "7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "8 ($1)", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[349]|8(?:[02-7]|1[1-8])"], "8 ($1)", 1], ["(\\d{4})(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["8"], "8 ($1)"]], "8", 0, 0, 0, 0, "[3489]", 0, "8~10"], "RW": ["250", "00", "(?:06|[27]\\d\\d|[89]00)\\d{6}", [8, 9], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[7-9]"], "0$1"]], "0"], "SA": ["966", "00", "(?:[15]\\d|800|92)\\d{7}", [9, 10], [["(\\d{4})(\\d{5})", "$1 $2", ["9"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["5"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]]], "0"], "SB": ["677", "0[01]", "[6-9]\\d{6}|[1-6]\\d{4}", [5, 7], [["(\\d{2})(\\d{5})", "$1 $2", ["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]], "SC": ["248", "010|0[0-2]", "(?:[2489]\\d|64)\\d{5}", [7], [["(\\d)(\\d{3})(\\d{3})", "$1 $2 $3", ["[246]|9[57]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "SD": ["249", "00", "[19]\\d{8}", [9], [["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "SE": ["46", "00", "(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}", [6, 7, 8, 9, 10, 12], [["(\\d{2})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["20"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{4})", "$1-$2", ["9(?:00|39|44|9)"], "0$1", 0, "$1 $2"], ["(\\d{2})(\\d{3})(\\d{2})", "$1-$2 $3", ["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3"], ["(\\d)(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2,3})(\\d{2})", "$1-$2 $3", ["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3"], ["(\\d{3})(\\d{2,3})(\\d{3})", "$1-$2 $3", ["9(?:00|39|44)"], "0$1", 0, "$1 $2 $3"], ["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["10|7"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1-$2 $3 $4", ["8"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1-$2 $3 $4", ["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{2})(\\d{3})", "$1-$2 $3 $4", ["9"], "0$1", 0, "$1 $2 $3 $4"], ["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1-$2 $3 $4 $5", ["[26]"], "0$1", 0, "$1 $2 $3 $4 $5"]], "0"], "SG": ["65", "0[0-3]\\d", "(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}", [8, 10, 11], [["(\\d{4})(\\d{4})", "$1 $2", ["[369]|8(?:0[1-9]|[1-9])"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"]], ["(\\d{4})(\\d{4})(\\d{3})", "$1 $2 $3", ["7"]], ["(\\d{4})(\\d{3})(\\d{4})", "$1 $2 $3", ["1"]]]], "SH": ["290", "00", "(?:[256]\\d|8)\\d{3}", [4, 5], 0, 0, 0, 0, 0, 0, "[256]"], "SI": ["386", "00|10(?:22|66|88|99)", "[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}", [5, 6, 7, 8], [["(\\d{2})(\\d{3,6})", "$1 $2", ["8[09]|9"], "0$1"], ["(\\d{3})(\\d{5})", "$1 $2", ["59|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[37][01]|4[0139]|51|6"], "0$1"], ["(\\d)(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[1-57]"], "(0$1)"]], "0", 0, 0, 0, 0, 0, 0, "00"], "SJ": ["47", "00", "0\\d{4}|(?:[489]\\d|79)\\d{6}", [5, 8], 0, 0, 0, 0, 0, 0, "79"], "SK": ["421", "00", "[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}", [6, 7, 9], [["(\\d)(\\d{2})(\\d{3,4})", "$1 $2 $3", ["21"], "0$1"], ["(\\d{2})(\\d{2})(\\d{2,3})", "$1 $2 $3", ["[3-5][1-8]1", "[3-5][1-8]1[67]"], "0$1"], ["(\\d)(\\d{3})(\\d{3})(\\d{2})", "$1/$2 $3 $4", ["2"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[689]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1/$2 $3 $4", ["[3-5]"], "0$1"]], "0"], "SL": ["232", "00", "(?:[237-9]\\d|66)\\d{6}", [8], [["(\\d{2})(\\d{6})", "$1 $2", ["[236-9]"], "(0$1)"]], "0"], "SM": ["378", "00", "(?:0549|[5-7]\\d)\\d{6}", [8, 10], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[5-7]"]], ["(\\d{4})(\\d{6})", "$1 $2", ["0"]]], 0, 0, "([89]\\d{5})$", "0549$1"], "SN": ["221", "00", "(?:[378]\\d|93)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[379]"]]]], "SO": ["252", "00", "[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}", [6, 7, 8, 9], [["(\\d{2})(\\d{4})", "$1 $2", ["8[125]"]], ["(\\d{6})", "$1", ["[134]"]], ["(\\d)(\\d{6})", "$1 $2", ["[15]|2[0-79]|3[0-46-8]|4[0-7]"]], ["(\\d)(\\d{7})", "$1 $2", ["(?:2|90)4|[67]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[348]|64|79|90"]], ["(\\d{2})(\\d{5,7})", "$1 $2", ["1|28|6[0-35-9]|7[67]|9[2-9]"]]], "0"], "SR": ["597", "00", "(?:[2-5]|[6-8]\\d|90)\\d{5}", [6, 7], [["(\\d{2})(\\d{2})(\\d{2})", "$1-$2-$3", ["56"]], ["(\\d{3})(\\d{3})", "$1-$2", ["[2-5]"]], ["(\\d{3})(\\d{4})", "$1-$2", ["[6-9]"]]]], "SS": ["211", "00", "[19]\\d{8}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[19]"], "0$1"]], "0"], "ST": ["239", "00", "(?:22|9\\d)\\d{5}", [7], [["(\\d{3})(\\d{4})", "$1 $2", ["[29]"]]]], "SV": ["503", "00", "[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?", [7, 8, 11], [["(\\d{3})(\\d{4})", "$1 $2", ["[89]"]], ["(\\d{4})(\\d{4})", "$1 $2", ["[25-7]"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["[89]"]]]], "SX": ["1", "011", "7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "(5\\d{6})$|1", "721$1", 0, "721"], "SY": ["963", "00", "[1-359]\\d{8}|[1-5]\\d{7}", [8, 9], [["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-4]|5[1-3]"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[59]"], "0$1", 1]], "0"], "SZ": ["268", "00", "0800\\d{4}|(?:[237]\\d|900)\\d{6}", [8, 9], [["(\\d{4})(\\d{4})", "$1 $2", ["[0237]"]], ["(\\d{5})(\\d{4})", "$1 $2", ["9"]]]], "TA": ["290", "00", "8\\d{3}", [4], 0, 0, 0, 0, 0, 0, "8"], "TC": ["1", "011", "(?:[58]\\d\\d|649|900)\\d{7}", [10], 0, "1", 0, "([2-479]\\d{6})$|1", "649$1", 0, "649"], "TD": ["235", "00|16", "(?:22|30|[689]\\d|77)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[236-9]"]]], 0, 0, 0, 0, 0, 0, 0, "00"], "TG": ["228", "00", "[279]\\d{7}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[279]"]]]], "TH": ["66", "00[1-9]", "(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}", [8, 9, 10, 13], [["(\\d)(\\d{3})(\\d{4})", "$1 $2 $3", ["2"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[13-9]"], "0$1"], ["(\\d{4})(\\d{3})(\\d{3})", "$1 $2 $3", ["1"]]], "0"], "TJ": ["992", "810", "(?:[0-57-9]\\d|66)\\d{7}", [9], [["(\\d{6})(\\d)(\\d{2})", "$1 $2 $3", ["331", "3317"]], ["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["44[02-479]|[34]7"]], ["(\\d{4})(\\d)(\\d{4})", "$1 $2 $3", ["3(?:[1245]|3[12])"]], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["\\d"]]], 0, 0, 0, 0, 0, 0, 0, "8~10"], "TK": ["690", "00", "[2-47]\\d{3,6}", [4, 5, 6, 7]], "TL": ["670", "00", "7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}", [7, 8], [["(\\d{3})(\\d{4})", "$1 $2", ["[2-489]|70"]], ["(\\d{4})(\\d{4})", "$1 $2", ["7"]]]], "TM": ["993", "810", "(?:[1-6]\\d|71)\\d{6}", [8], [["(\\d{2})(\\d{2})(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["12"], "(8 $1)"], ["(\\d{3})(\\d)(\\d{2})(\\d{2})", "$1 $2-$3-$4", ["[1-5]"], "(8 $1)"], ["(\\d{2})(\\d{6})", "$1 $2", ["[67]"], "8 $1"]], "8", 0, 0, 0, 0, 0, 0, "8~10"], "TN": ["216", "00", "[2-57-9]\\d{7}", [8], [["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-57-9]"]]]], "TO": ["676", "00", "(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}", [5, 7], [["(\\d{2})(\\d{3})", "$1-$2", ["[2-4]|50|6[09]|7[0-24-69]|8[05]"]], ["(\\d{4})(\\d{3})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[5-9]"]]]], "TR": ["90", "00", "4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}", [7, 10, 12, 13], [["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["512|8[01589]|90"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["5(?:[0-59]|61)", "5(?:[0-59]|61[06])", "5(?:[0-59]|61[06]1)"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[24][1-8]|3[1-9]"], "(0$1)", 1], ["(\\d{3})(\\d{3})(\\d{6,7})", "$1 $2 $3", ["80"], "0$1", 1]], "0"], "TT": ["1", "011", "(?:[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-46-8]\\d{6})$|1", "868$1", 0, "868"], "TV": ["688", "00", "(?:2|7\\d\\d|90)\\d{4}", [5, 6, 7], [["(\\d{2})(\\d{3})", "$1 $2", ["2"]], ["(\\d{2})(\\d{4})", "$1 $2", ["90"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "TW": ["886", "0(?:0[25-79]|19)", "[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}", [7, 8, 9, 10, 11], [["(\\d{2})(\\d)(\\d{4})", "$1 $2 $3", ["202"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[258]0"], "0$1"], ["(\\d)(\\d{3,4})(\\d{4})", "$1 $2 $3", ["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]", "[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{2})(\\d{4})(\\d{4,5})", "$1 $2 $3", ["7"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, 0, "#"], "TZ": ["255", "00[056]", "(?:[25-8]\\d|41|90)\\d{7}", [9], [["(\\d{3})(\\d{2})(\\d{4})", "$1 $2 $3", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[24]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["5"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[67]"], "0$1"]], "0"], "UA": ["380", "00", "[89]\\d{9}|[3-9]\\d{8}", [9, 10], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]", "6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"], "0$1"], ["(\\d{4})(\\d{5})", "$1 $2", ["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])", "3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[3-7]|89|9[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[89]"], "0$1"]], "0", 0, 0, 0, 0, 0, 0, "0~0"], "UG": ["256", "00[057]", "800\\d{6}|(?:[29]0|[347]\\d)\\d{7}", [9], [["(\\d{4})(\\d{5})", "$1 $2", ["202", "2024"], "0$1"], ["(\\d{3})(\\d{6})", "$1 $2", ["[27-9]|4(?:6[45]|[7-9])"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[34]"], "0$1"]], "0"], "US": ["1", "011", "[2-9]\\d{9}|3\\d{6}", [10], [["(\\d{3})(\\d{4})", "$1-$2", ["310"], 0, 1], ["(\\d{3})(\\d{3})(\\d{4})", "($1) $2-$3", ["[2-9]"], 0, 1, "$1-$2-$3"]], "1", 0, 0, 0, 0, 0, [["(?:274[27]|(?:472|983)[2-47-9])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"], [""], ["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"], ["900[2-9]\\d{6}"], ["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|3[23]|44|66|77|88)[2-9]\\d{6}"]]], "UY": ["598", "0(?:0|1[3-9]\\d)", "0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}", [4, 5, 6, 7, 8, 9, 10, 11, 12, 13], [["(\\d{4,5})", "$1", ["21"]], ["(\\d{3})(\\d{3,4})", "$1 $2", ["0"]], ["(\\d{3})(\\d{4})", "$1 $2", ["[49]0|8"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["9"], "0$1"], ["(\\d{4})(\\d{4})", "$1 $2", ["[124]"]], ["(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3", ["0"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})", "$1 $2 $3 $4", ["0"]]], "0", 0, 0, 0, 0, 0, 0, "00", " int. "], "UZ": ["998", "00", "(?:20|33|[5-9]\\d)\\d{7}", [9], [["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["[235-9]"]]]], "VA": ["39", "00", "0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}", [6, 7, 8, 9, 10, 11, 12], 0, 0, 0, 0, 0, 0, "06698"], "VC": ["1", "011", "(?:[58]\\d\\d|784|900)\\d{7}", [10], 0, "1", 0, "([2-7]\\d{6})$|1", "784$1", 0, "784"], "VE": ["58", "00", "[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}", [10], [["(\\d{3})(\\d{7})", "$1-$2", ["[24-689]"], "0$1"]], "0"], "VG": ["1", "011", "(?:284|[58]\\d\\d|900)\\d{7}", [10], 0, "1", 0, "([2-578]\\d{6})$|1", "284$1", 0, "284"], "VI": ["1", "011", "[58]\\d{9}|(?:34|90)0\\d{7}", [10], 0, "1", 0, "([2-9]\\d{6})$|1", "340$1", 0, "340"], "VN": ["84", "00", "[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}", [7, 8, 9, 10], [["(\\d{2})(\\d{5})", "$1 $2", ["80"], "0$1", 1], ["(\\d{4})(\\d{4,6})", "$1 $2", ["1"], 0, 1], ["(\\d{2})(\\d{3})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["6"], "0$1", 1], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[357-9]"], "0$1", 1], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["2[48]"], "0$1", 1], ["(\\d{3})(\\d{4})(\\d{3})", "$1 $2 $3", ["2"], "0$1", 1]], "0"], "VU": ["678", "00", "[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}", [5, 7], [["(\\d{3})(\\d{4})", "$1 $2", ["[57-9]"]]]], "WF": ["681", "00", "(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}", [6, 9], [["(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3", ["[47-9]"]], ["(\\d{3})(\\d{2})(\\d{2})(\\d{2})", "$1 $2 $3 $4", ["8"]]]], "WS": ["685", "0", "(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}", [5, 6, 7, 10], [["(\\d{5})", "$1", ["[2-5]|6[1-9]"]], ["(\\d{3})(\\d{3,7})", "$1 $2", ["[68]"]], ["(\\d{2})(\\d{5})", "$1 $2", ["7"]]]], "XK": ["383", "00", "2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{5})", "$1 $2", ["[89]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3})", "$1 $2 $3", ["[2-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["2|39"], "0$1"], ["(\\d{2})(\\d{7,10})", "$1 $2", ["3"], "0$1"]], "0"], "YE": ["967", "00", "(?:1|7\\d)\\d{7}|[1-7]\\d{6}", [7, 8, 9], [["(\\d)(\\d{3})(\\d{3,4})", "$1 $2 $3", ["[1-6]|7(?:[24-6]|8[0-7])"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["7"], "0$1"]], "0"], "YT": ["262", "00", "7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}", [9], 0, "0", 0, 0, 0, 0, 0, [["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"], ["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"], ["80\\d{7}"], 0, 0, 0, 0, 0, ["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]], "ZA": ["27", "00", "[1-79]\\d{8}|8\\d{4,9}", [5, 6, 7, 8, 9, 10], [["(\\d{2})(\\d{3,4})", "$1 $2", ["8[1-4]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{2,3})", "$1 $2 $3", ["8[1-4]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["860"], "0$1"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["[1-9]"], "0$1"], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["8"], "0$1"]], "0"], "ZM": ["260", "00", "800\\d{6}|(?:21|[579]\\d|63)\\d{7}", [9], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[28]"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["[579]"], "0$1"]], "0"], "ZW": ["263", "00", "2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}", [5, 6, 7, 8, 9, 10], [["(\\d{3})(\\d{3,5})", "$1 $2", ["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"], "0$1"], ["(\\d)(\\d{3})(\\d{2,4})", "$1 $2 $3", ["[49]"], "0$1"], ["(\\d{3})(\\d{4})", "$1 $2", ["80"], "0$1"], ["(\\d{2})(\\d{7})", "$1 $2", ["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2", "2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"], "(0$1)"], ["(\\d{2})(\\d{3})(\\d{4})", "$1 $2 $3", ["7"], "0$1"], ["(\\d{3})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)", "2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"], "0$1"], ["(\\d{4})(\\d{6})", "$1 $2", ["8"], "0$1"], ["(\\d{2})(\\d{3,5})", "$1 $2", ["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"], "0$1"], ["(\\d{2})(\\d{3})(\\d{3,4})", "$1 $2 $3", ["29[013-9]|39|54"], "0$1"], ["(\\d{4})(\\d{3,5})", "$1 $2", ["(?:25|54)8", "258|5483"], "0$1"]], "0"] }, "nonGeographic": { "800": ["800", 0, "(?:00|[1-9]\\d)\\d{6}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["\\d"]]], 0, 0, 0, 0, 0, 0, [0, 0, ["(?:00|[1-9]\\d)\\d{6}"]]], "808": ["808", 0, "[1-9]\\d{7}", [8], [["(\\d{4})(\\d{4})", "$1 $2", ["[1-9]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, 0, ["[1-9]\\d{7}"]]], "870": ["870", 0, "7\\d{11}|[235-7]\\d{8}", [9, 12], [["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["[235-7]"]]], 0, 0, 0, 0, 0, 0, [0, ["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"], 0, 0, 0, 0, 0, 0, ["2\\d{8}", [9]]]], "878": ["878", 0, "10\\d{10}", [12], [["(\\d{2})(\\d{5})(\\d{5})", "$1 $2 $3", ["1"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["10\\d{10}"]]], "881": ["881", 0, "6\\d{9}|[0-36-9]\\d{8}", [9, 10], [["(\\d)(\\d{3})(\\d{5})", "$1 $2 $3", ["[0-37-9]"]], ["(\\d)(\\d{3})(\\d{5,6})", "$1 $2 $3", ["6"]]], 0, 0, 0, 0, 0, 0, [0, ["6\\d{9}|[0-36-9]\\d{8}"]]], "882": ["882", 0, "[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?", [7, 8, 9, 10, 11, 12], [["(\\d{2})(\\d{5})", "$1 $2", ["16|342"]], ["(\\d{2})(\\d{6})", "$1 $2", ["49"]], ["(\\d{2})(\\d{2})(\\d{4})", "$1 $2 $3", ["1[36]|9"]], ["(\\d{2})(\\d{4})(\\d{3})", "$1 $2 $3", ["3[23]"]], ["(\\d{2})(\\d{3,4})(\\d{4})", "$1 $2 $3", ["16"]], ["(\\d{2})(\\d{4})(\\d{4})", "$1 $2 $3", ["10|23|3(?:[15]|4[57])|4|51"]], ["(\\d{3})(\\d{4})(\\d{4})", "$1 $2 $3", ["34"]], ["(\\d{2})(\\d{4,5})(\\d{5})", "$1 $2 $3", ["[1-35]"]]], 0, 0, 0, 0, 0, 0, [0, ["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}", [7, 8, 9, 10, 12]], 0, 0, 0, ["348[57]\\d{7}", [11]], 0, 0, ["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]], "883": ["883", 0, "(?:[1-4]\\d|51)\\d{6,10}", [8, 9, 10, 11, 12], [["(\\d{3})(\\d{3})(\\d{2,8})", "$1 $2 $3", ["[14]|2[24-689]|3[02-689]|51[24-9]"]], ["(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3", ["510"]], ["(\\d{3})(\\d{3})(\\d{4})", "$1 $2 $3", ["21"]], ["(\\d{4})(\\d{4})(\\d{4})", "$1 $2 $3", ["51[13]"]], ["(\\d{3})(\\d{3})(\\d{3})(\\d{3})", "$1 $2 $3 $4", ["[235]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, 0, 0, ["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]], "888": ["888", 0, "\\d{11}", [11], [["(\\d{3})(\\d{3})(\\d{5})", "$1 $2 $3"]], 0, 0, 0, 0, 0, 0, [0, 0, 0, 0, 0, 0, ["\\d{11}"]]], "979": ["979", 0, "[1359]\\d{8}", [9], [["(\\d)(\\d{4})(\\d{4})", "$1 $2 $3", ["[1359]"]]], 0, 0, 0, 0, 0, 0, [0, 0, 0, ["[1359]\\d{8}"]]] } };
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js
function withMetadataArgument(func, _arguments) {
  var args = Array.prototype.slice.call(_arguments);
  args.push(metadata_min_json_default);
  return func.apply(this, args);
}
var init_withMetadataArgument = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/withMetadataArgument.js"() {
    init_metadata_min_json();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/tools/semver-compare.js
function semver_compare_default(a2, b2) {
  a2 = a2.split("-");
  b2 = b2.split("-");
  var pa = a2[0].split(".");
  var pb = b2[0].split(".");
  for (var i2 = 0; i2 < 3; i2++) {
    var na = Number(pa[i2]);
    var nb = Number(pb[i2]);
    if (na > nb) return 1;
    if (nb > na) return -1;
    if (!isNaN(na) && isNaN(nb)) return 1;
    if (isNaN(na) && !isNaN(nb)) return -1;
  }
  if (a2[1] && b2[1]) {
    return a2[1] > b2[1] ? 1 : a2[1] < b2[1] ? -1 : 0;
  }
  return !a2[1] && b2[1] ? 1 : a2[1] && !b2[1] ? -1 : 0;
}
var init_semver_compare = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/tools/semver-compare.js"() {
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/isObject.js
function isObject2(object) {
  return object !== void 0 && object !== null && object.constructor === objectConstructor;
}
var objectConstructor;
var init_isObject = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/isObject.js"() {
    objectConstructor = {}.constructor;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/metadata.js
function _typeof(o2) {
  "@babel/helpers - typeof";
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof(o2);
}
function _classCallCheck(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey(o2.key), o2);
  }
}
function _createClass(e2, r3, t2) {
  return r3 && _defineProperties(e2.prototype, r3), t2 && _defineProperties(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey(t2) {
  var i2 = _toPrimitive(t2, "string");
  return "symbol" == _typeof(i2) ? i2 : i2 + "";
}
function _toPrimitive(t2, r3) {
  if ("object" != _typeof(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function getType(types, type) {
  switch (type) {
    case "FIXED_LINE":
      return types[0];
    case "MOBILE":
      return types[1];
    case "TOLL_FREE":
      return types[2];
    case "PREMIUM_RATE":
      return types[3];
    case "PERSONAL_NUMBER":
      return types[4];
    case "VOICEMAIL":
      return types[5];
    case "UAN":
      return types[6];
    case "PAGER":
      return types[7];
    case "VOIP":
      return types[8];
    case "SHARED_COST":
      return types[9];
  }
}
function validateMetadata(metadata) {
  if (!metadata) {
    throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");
  }
  if (!isObject2(metadata) || !isObject2(metadata.countries)) {
    throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(isObject2(metadata) ? "an object of shape: { " + Object.keys(metadata).join(", ") + " }" : "a " + typeOf(metadata) + ": " + metadata, "."));
  }
}
function getExtPrefix(country2, metadata) {
  metadata = new Metadata(metadata);
  if (metadata.hasCountry(country2)) {
    return metadata.selectNumberingPlan(country2).ext();
  }
  return DEFAULT_EXT_PREFIX;
}
function getCountryCallingCode(country2, metadata) {
  metadata = new Metadata(metadata);
  if (metadata.hasCountry(country2)) {
    return metadata.selectNumberingPlan(country2).countryCallingCode();
  }
  throw new Error("Unknown country: ".concat(country2));
}
function isSupportedCountry(country2, metadata) {
  return metadata.countries.hasOwnProperty(country2);
}
function setVersion(metadata) {
  var version2 = metadata.version;
  if (typeof version2 === "number") {
    this.v1 = version2 === 1;
    this.v2 = version2 === 2;
    this.v3 = version2 === 3;
    this.v4 = version2 === 4;
  } else {
    if (!version2) {
      this.v1 = true;
    } else if (semver_compare_default(version2, V3) === -1) {
      this.v2 = true;
    } else if (semver_compare_default(version2, V4) === -1) {
      this.v3 = true;
    } else {
      this.v4 = true;
    }
  }
}
var V3, V4, DEFAULT_EXT_PREFIX, CALLING_CODE_REG_EXP, Metadata, NumberingPlan, Format, FIRST_GROUP_ONLY_PREFIX_PATTERN, Type, typeOf;
var init_metadata = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/metadata.js"() {
    init_semver_compare();
    init_isObject();
    V3 = "1.2.0";
    V4 = "1.7.35";
    DEFAULT_EXT_PREFIX = " ext. ";
    CALLING_CODE_REG_EXP = /^\d+$/;
    Metadata = /* @__PURE__ */ (function() {
      function Metadata3(metadata) {
        _classCallCheck(this, Metadata3);
        validateMetadata(metadata);
        this.metadata = metadata;
        setVersion.call(this, metadata);
      }
      return _createClass(Metadata3, [{
        key: "getCountries",
        value: function getCountries3() {
          return Object.keys(this.metadata.countries).filter(function(_) {
            return _ !== "001";
          });
        }
      }, {
        key: "getCountryMetadata",
        value: function getCountryMetadata(countryCode) {
          return this.metadata.countries[countryCode];
        }
      }, {
        key: "nonGeographic",
        value: function nonGeographic() {
          if (this.v1 || this.v2 || this.v3) return;
          return this.metadata.nonGeographic || this.metadata.nonGeographical;
        }
      }, {
        key: "hasCountry",
        value: function hasCountry(country2) {
          return this.getCountryMetadata(country2) !== void 0;
        }
      }, {
        key: "hasCallingCode",
        value: function hasCallingCode(callingCode) {
          if (this.getCountryCodesForCallingCode(callingCode)) {
            return true;
          }
          if (this.nonGeographic()) {
            if (this.nonGeographic()[callingCode]) {
              return true;
            }
          } else {
            var countryCodes = this.countryCallingCodes()[callingCode];
            if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
              return true;
            }
          }
        }
      }, {
        key: "isNonGeographicCallingCode",
        value: function isNonGeographicCallingCode(callingCode) {
          if (this.nonGeographic()) {
            return this.nonGeographic()[callingCode] ? true : false;
          } else {
            return this.getCountryCodesForCallingCode(callingCode) ? false : true;
          }
        }
        // Deprecated.
      }, {
        key: "country",
        value: function country2(countryCode) {
          return this.selectNumberingPlan(countryCode);
        }
      }, {
        key: "selectNumberingPlan",
        value: function selectNumberingPlan(countryCode, callingCode) {
          if (countryCode && CALLING_CODE_REG_EXP.test(countryCode)) {
            callingCode = countryCode;
            countryCode = null;
          }
          if (countryCode && countryCode !== "001") {
            if (!this.hasCountry(countryCode)) {
              throw new Error("Unknown country: ".concat(countryCode));
            }
            this.numberingPlan = new NumberingPlan(this.getCountryMetadata(countryCode), this);
          } else if (callingCode) {
            if (!this.hasCallingCode(callingCode)) {
              throw new Error("Unknown calling code: ".concat(callingCode));
            }
            this.numberingPlan = new NumberingPlan(this.getNumberingPlanMetadata(callingCode), this);
          } else {
            this.numberingPlan = void 0;
          }
          return this;
        }
      }, {
        key: "getCountryCodesForCallingCode",
        value: function getCountryCodesForCallingCode(callingCode) {
          var countryCodes = this.countryCallingCodes()[callingCode];
          if (countryCodes) {
            if (countryCodes.length === 1 && countryCodes[0].length === 3) {
              return;
            }
            return countryCodes;
          }
        }
      }, {
        key: "getCountryCodeForCallingCode",
        value: function getCountryCodeForCallingCode(callingCode) {
          var countryCodes = this.getCountryCodesForCallingCode(callingCode);
          if (countryCodes) {
            return countryCodes[0];
          }
        }
      }, {
        key: "getNumberingPlanMetadata",
        value: function getNumberingPlanMetadata(callingCode) {
          var countryCode = this.getCountryCodeForCallingCode(callingCode);
          if (countryCode) {
            return this.getCountryMetadata(countryCode);
          }
          if (this.nonGeographic()) {
            var metadata = this.nonGeographic()[callingCode];
            if (metadata) {
              return metadata;
            }
          } else {
            var countryCodes = this.countryCallingCodes()[callingCode];
            if (countryCodes && countryCodes.length === 1 && countryCodes[0] === "001") {
              return this.metadata.countries["001"];
            }
          }
        }
        // Deprecated.
      }, {
        key: "countryCallingCode",
        value: function countryCallingCode() {
          return this.numberingPlan.callingCode();
        }
        // Deprecated.
      }, {
        key: "IDDPrefix",
        value: function IDDPrefix() {
          return this.numberingPlan.IDDPrefix();
        }
        // Deprecated.
      }, {
        key: "defaultIDDPrefix",
        value: function defaultIDDPrefix() {
          return this.numberingPlan.defaultIDDPrefix();
        }
        // Deprecated.
      }, {
        key: "nationalNumberPattern",
        value: function nationalNumberPattern() {
          return this.numberingPlan.nationalNumberPattern();
        }
        // Deprecated.
      }, {
        key: "possibleLengths",
        value: function possibleLengths() {
          return this.numberingPlan.possibleLengths();
        }
        // Deprecated.
      }, {
        key: "formats",
        value: function formats() {
          return this.numberingPlan.formats();
        }
        // Deprecated.
      }, {
        key: "nationalPrefixForParsing",
        value: function nationalPrefixForParsing() {
          return this.numberingPlan.nationalPrefixForParsing();
        }
        // Deprecated.
      }, {
        key: "nationalPrefixTransformRule",
        value: function nationalPrefixTransformRule() {
          return this.numberingPlan.nationalPrefixTransformRule();
        }
        // Deprecated.
      }, {
        key: "leadingDigits",
        value: function leadingDigits() {
          return this.numberingPlan.leadingDigits();
        }
        // Deprecated.
      }, {
        key: "hasTypes",
        value: function hasTypes() {
          return this.numberingPlan.hasTypes();
        }
        // Deprecated.
      }, {
        key: "type",
        value: function type(_type) {
          return this.numberingPlan.type(_type);
        }
        // Deprecated.
      }, {
        key: "ext",
        value: function ext() {
          return this.numberingPlan.ext();
        }
      }, {
        key: "countryCallingCodes",
        value: function countryCallingCodes() {
          if (this.v1) return this.metadata.country_phone_code_to_countries;
          return this.metadata.country_calling_codes;
        }
        // Deprecated.
      }, {
        key: "chooseCountryByCountryCallingCode",
        value: function chooseCountryByCountryCallingCode(callingCode) {
          return this.selectNumberingPlan(callingCode);
        }
      }, {
        key: "hasSelectedNumberingPlan",
        value: function hasSelectedNumberingPlan() {
          return this.numberingPlan !== void 0;
        }
      }]);
    })();
    NumberingPlan = /* @__PURE__ */ (function() {
      function NumberingPlan2(metadata, globalMetadataObject) {
        _classCallCheck(this, NumberingPlan2);
        this.globalMetadataObject = globalMetadataObject;
        this.metadata = metadata;
        setVersion.call(this, globalMetadataObject.metadata);
      }
      return _createClass(NumberingPlan2, [{
        key: "callingCode",
        value: function callingCode() {
          return this.metadata[0];
        }
        // Formatting information for regions which share
        // a country calling code is contained by only one region
        // for performance reasons. For example, for NANPA region
        // ("North American Numbering Plan Administration",
        //  which includes USA, Canada, Cayman Islands, Bahamas, etc)
        // it will be contained in the metadata for `US`.
      }, {
        key: "getDefaultCountryMetadataForRegion",
        value: function getDefaultCountryMetadataForRegion() {
          return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode());
        }
        // Is always present.
      }, {
        key: "IDDPrefix",
        value: function IDDPrefix() {
          if (this.v1 || this.v2) return;
          return this.metadata[1];
        }
        // Is only present when a country supports multiple IDD prefixes.
      }, {
        key: "defaultIDDPrefix",
        value: function defaultIDDPrefix() {
          if (this.v1 || this.v2) return;
          return this.metadata[12];
        }
      }, {
        key: "nationalNumberPattern",
        value: function nationalNumberPattern() {
          if (this.v1 || this.v2) return this.metadata[1];
          return this.metadata[2];
        }
        // "possible length" data is always present in Google's metadata.
      }, {
        key: "possibleLengths",
        value: function possibleLengths() {
          if (this.v1) return;
          return this.metadata[this.v2 ? 2 : 3];
        }
      }, {
        key: "_getFormats",
        value: function _getFormats(metadata) {
          return metadata[this.v1 ? 2 : this.v2 ? 3 : 4];
        }
        // For countries of the same region (e.g. NANPA)
        // formats are all stored in the "main" country for that region.
        // E.g. "RU" and "KZ", "US" and "CA".
      }, {
        key: "formats",
        value: function formats() {
          var _this = this;
          var formats2 = this._getFormats(this.metadata) || this._getFormats(this.getDefaultCountryMetadataForRegion()) || [];
          return formats2.map(function(_) {
            return new Format(_, _this);
          });
        }
      }, {
        key: "nationalPrefix",
        value: function nationalPrefix() {
          return this.metadata[this.v1 ? 3 : this.v2 ? 4 : 5];
        }
      }, {
        key: "_getNationalPrefixFormattingRule",
        value: function _getNationalPrefixFormattingRule(metadata) {
          return metadata[this.v1 ? 4 : this.v2 ? 5 : 6];
        }
        // For countries of the same region (e.g. NANPA)
        // national prefix formatting rule is stored in the "main" country for that region.
        // E.g. "RU" and "KZ", "US" and "CA".
      }, {
        key: "nationalPrefixFormattingRule",
        value: function nationalPrefixFormattingRule() {
          return this._getNationalPrefixFormattingRule(this.metadata) || this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion());
        }
      }, {
        key: "_nationalPrefixForParsing",
        value: function _nationalPrefixForParsing() {
          return this.metadata[this.v1 ? 5 : this.v2 ? 6 : 7];
        }
      }, {
        key: "nationalPrefixForParsing",
        value: function nationalPrefixForParsing() {
          return this._nationalPrefixForParsing() || this.nationalPrefix();
        }
      }, {
        key: "nationalPrefixTransformRule",
        value: function nationalPrefixTransformRule() {
          return this.metadata[this.v1 ? 6 : this.v2 ? 7 : 8];
        }
      }, {
        key: "_getNationalPrefixIsOptionalWhenFormatting",
        value: function _getNationalPrefixIsOptionalWhenFormatting() {
          return !!this.metadata[this.v1 ? 7 : this.v2 ? 8 : 9];
        }
        // For countries of the same region (e.g. NANPA)
        // "national prefix is optional when formatting" flag is
        // stored in the "main" country for that region.
        // E.g. "RU" and "KZ", "US" and "CA".
      }, {
        key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
        value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
          return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata) || this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion());
        }
      }, {
        key: "leadingDigits",
        value: function leadingDigits() {
          return this.metadata[this.v1 ? 8 : this.v2 ? 9 : 10];
        }
      }, {
        key: "types",
        value: function types() {
          return this.metadata[this.v1 ? 9 : this.v2 ? 10 : 11];
        }
      }, {
        key: "hasTypes",
        value: function hasTypes() {
          if (this.types() && this.types().length === 0) {
            return false;
          }
          return !!this.types();
        }
      }, {
        key: "type",
        value: function type(_type2) {
          if (this.hasTypes() && getType(this.types(), _type2)) {
            return new Type(getType(this.types(), _type2), this);
          }
        }
      }, {
        key: "ext",
        value: function ext() {
          if (this.v1 || this.v2) return DEFAULT_EXT_PREFIX;
          return this.metadata[13] || DEFAULT_EXT_PREFIX;
        }
      }]);
    })();
    Format = /* @__PURE__ */ (function() {
      function Format2(format7, metadata) {
        _classCallCheck(this, Format2);
        this._format = format7;
        this.metadata = metadata;
      }
      return _createClass(Format2, [{
        key: "pattern",
        value: function pattern() {
          return this._format[0];
        }
      }, {
        key: "format",
        value: function format7() {
          return this._format[1];
        }
      }, {
        key: "leadingDigitsPatterns",
        value: function leadingDigitsPatterns() {
          return this._format[2] || [];
        }
      }, {
        key: "nationalPrefixFormattingRule",
        value: function nationalPrefixFormattingRule() {
          return this._format[3] || this.metadata.nationalPrefixFormattingRule();
        }
      }, {
        key: "nationalPrefixIsOptionalWhenFormattingInNationalFormat",
        value: function nationalPrefixIsOptionalWhenFormattingInNationalFormat() {
          return !!this._format[4] || this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
        }
      }, {
        key: "nationalPrefixIsMandatoryWhenFormattingInNationalFormat",
        value: function nationalPrefixIsMandatoryWhenFormattingInNationalFormat() {
          return this.usesNationalPrefix() && !this.nationalPrefixIsOptionalWhenFormattingInNationalFormat();
        }
        // Checks whether national prefix formatting rule contains national prefix.
      }, {
        key: "usesNationalPrefix",
        value: function usesNationalPrefix() {
          return this.nationalPrefixFormattingRule() && // Check that national prefix formatting rule is not a "dummy" one.
          !FIRST_GROUP_ONLY_PREFIX_PATTERN.test(this.nationalPrefixFormattingRule()) ? true : false;
        }
      }, {
        key: "internationalFormat",
        value: function internationalFormat() {
          return this._format[5] || this.format();
        }
      }]);
    })();
    FIRST_GROUP_ONLY_PREFIX_PATTERN = /^\(?\$1\)?$/;
    Type = /* @__PURE__ */ (function() {
      function Type2(type, metadata) {
        _classCallCheck(this, Type2);
        this.type = type;
        this.metadata = metadata;
      }
      return _createClass(Type2, [{
        key: "pattern",
        value: function pattern() {
          if (this.metadata.v1) return this.type;
          return this.type[0];
        }
      }, {
        key: "possibleLengths",
        value: function possibleLengths() {
          if (this.metadata.v1) return;
          return this.type[1] || this.metadata.possibleLengths();
        }
      }]);
    })();
    typeOf = function typeOf2(_) {
      return _typeof(_);
    };
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js
function _createForOfIteratorHelperLoose(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray(r3, a2) : void 0;
  }
}
function _arrayLikeToArray(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function mergeArrays(a2, b2) {
  var merged = a2.slice();
  for (var _iterator = _createForOfIteratorHelperLoose(b2), _step; !(_step = _iterator()).done; ) {
    var element = _step.value;
    if (a2.indexOf(element) < 0) {
      merged.push(element);
    }
  }
  return merged.sort(function(a3, b3) {
    return a3 - b3;
  });
}
var init_mergeArrays = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/mergeArrays.js"() {
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js
function checkNumberLength(nationalNumber, country2, metadata) {
  return checkNumberLengthForType(nationalNumber, country2, void 0, metadata);
}
function checkNumberLengthForType(nationalNumber, country2, type, metadata) {
  if (country2) {
    metadata = new Metadata(metadata.metadata);
    metadata.selectNumberingPlan(country2);
  }
  var type_info = metadata.type(type);
  var possible_lengths = type_info && type_info.possibleLengths() || metadata.possibleLengths();
  if (!possible_lengths) {
    return "IS_POSSIBLE";
  }
  if (type === "FIXED_LINE_OR_MOBILE") {
    if (!metadata.type("FIXED_LINE")) {
      return checkNumberLengthForType(nationalNumber, country2, "MOBILE", metadata);
    }
    var mobile_type = metadata.type("MOBILE");
    if (mobile_type) {
      possible_lengths = mergeArrays(possible_lengths, mobile_type.possibleLengths());
    }
  } else if (type && !type_info) {
    return "INVALID_LENGTH";
  }
  var actual_length = nationalNumber.length;
  var minimum_length = possible_lengths[0];
  if (minimum_length === actual_length) {
    return "IS_POSSIBLE";
  }
  if (minimum_length > actual_length) {
    return "TOO_SHORT";
  }
  if (possible_lengths[possible_lengths.length - 1] < actual_length) {
    return "TOO_LONG";
  }
  return possible_lengths.indexOf(actual_length, 1) >= 0 ? "IS_POSSIBLE" : "INVALID_LENGTH";
}
var init_checkNumberLength = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.js"() {
    init_metadata();
    init_mergeArrays();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isPossible.js
function isPossiblePhoneNumber(input, options, metadata) {
  if (options === void 0) {
    options = {};
  }
  metadata = new Metadata(metadata);
  if (options.v2) {
    if (!input.countryCallingCode) {
      throw new Error("Invalid phone number object passed");
    }
    metadata.selectNumberingPlan(input.countryCallingCode);
  } else {
    if (!input.phone) {
      return false;
    }
    if (input.country) {
      if (!metadata.hasCountry(input.country)) {
        throw new Error("Unknown country: ".concat(input.country));
      }
      metadata.selectNumberingPlan(input.country);
    } else {
      if (!input.countryCallingCode) {
        throw new Error("Invalid phone number object passed");
      }
      metadata.selectNumberingPlan(input.countryCallingCode);
    }
  }
  if (metadata.possibleLengths()) {
    return isPossibleNumber(input.phone || input.nationalNumber, input.country, metadata);
  } else {
    if (input.countryCallingCode && metadata.isNonGeographicCallingCode(input.countryCallingCode)) {
      return true;
    } else {
      throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.');
    }
  }
}
function isPossibleNumber(nationalNumber, country2, metadata) {
  switch (checkNumberLength(nationalNumber, country2, metadata)) {
    case "IS_POSSIBLE":
      return true;
    // This library ignores "local-only" phone numbers (for simplicity).
    // See the readme for more info on what are "local-only" phone numbers.
    // case 'IS_POSSIBLE_LOCAL_ONLY':
    // 	return !isInternational
    default:
      return false;
  }
}
var init_isPossible = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isPossible.js"() {
    init_metadata();
    init_checkNumberLength();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js
function matchesEntirely(text, regularExpressionText) {
  text = text || "";
  return new RegExp("^(?:" + regularExpressionText + ")$").test(text);
}
var init_matchesEntirely = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.js"() {
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getNumberType.js
function _createForOfIteratorHelperLoose2(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray2(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray2(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray2(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray2(r3, a2) : void 0;
  }
}
function _arrayLikeToArray2(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function getNumberType(input, options, metadata) {
  options = options || {};
  if (!input.country && !input.countryCallingCode) {
    return;
  }
  metadata = new Metadata(metadata);
  metadata.selectNumberingPlan(input.country, input.countryCallingCode);
  var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern())) {
    return;
  }
  if (isNumberTypeEqualTo(nationalNumber, "FIXED_LINE", metadata)) {
    if (metadata.type("MOBILE") && metadata.type("MOBILE").pattern() === "") {
      return "FIXED_LINE_OR_MOBILE";
    }
    if (!metadata.type("MOBILE")) {
      return "FIXED_LINE_OR_MOBILE";
    }
    if (isNumberTypeEqualTo(nationalNumber, "MOBILE", metadata)) {
      return "FIXED_LINE_OR_MOBILE";
    }
    return "FIXED_LINE";
  }
  for (var _iterator = _createForOfIteratorHelperLoose2(NON_FIXED_LINE_PHONE_TYPES), _step; !(_step = _iterator()).done; ) {
    var type = _step.value;
    if (isNumberTypeEqualTo(nationalNumber, type, metadata)) {
      return type;
    }
  }
}
function isNumberTypeEqualTo(nationalNumber, type, metadata) {
  var typeDefinition = metadata.type(type);
  if (!typeDefinition || !typeDefinition.pattern()) {
    return false;
  }
  if (typeDefinition.possibleLengths() && typeDefinition.possibleLengths().indexOf(nationalNumber.length) < 0) {
    return false;
  }
  return matchesEntirely(nationalNumber, typeDefinition.pattern());
}
var NON_FIXED_LINE_PHONE_TYPES;
var init_getNumberType = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getNumberType.js"() {
    init_metadata();
    init_matchesEntirely();
    NON_FIXED_LINE_PHONE_TYPES = ["MOBILE", "PREMIUM_RATE", "TOLL_FREE", "SHARED_COST", "VOIP", "PERSONAL_NUMBER", "PAGER", "UAN", "VOICEMAIL"];
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isValid.js
function isValidNumber(input, options, metadata) {
  options = options || {};
  metadata = new Metadata(metadata);
  metadata.selectNumberingPlan(input.country, input.countryCallingCode);
  if (metadata.hasTypes()) {
    return getNumberType(input, options, metadata.metadata) !== void 0;
  }
  var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  return matchesEntirely(nationalNumber, metadata.nationalNumberPattern());
}
var init_isValid = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isValid.js"() {
    init_metadata();
    init_matchesEntirely();
    init_getNumberType();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js
function getPossibleCountriesForNumber(callingCode, nationalNumber, metadata) {
  var _metadata = new Metadata(metadata);
  var possibleCountries = _metadata.getCountryCodesForCallingCode(callingCode);
  if (!possibleCountries) {
    return [];
  }
  return possibleCountries.filter(function(country2) {
    return couldNationalNumberBelongToCountry(nationalNumber, country2, metadata);
  });
}
function couldNationalNumberBelongToCountry(nationalNumber, country2, metadata) {
  var _metadata = new Metadata(metadata);
  _metadata.selectNumberingPlan(country2);
  if (_metadata.numberingPlan.possibleLengths().indexOf(nationalNumber.length) >= 0) {
    return true;
  }
  return false;
}
var init_getPossibleCountriesForNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.js"() {
    init_metadata();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/constants.js
var MIN_LENGTH_FOR_NSN, MAX_LENGTH_FOR_NSN, MAX_LENGTH_COUNTRY_CODE, VALID_DIGITS, DASHES, SLASHES, DOTS, WHITESPACE, BRACKETS, TILDES, VALID_PUNCTUATION, PLUS_CHARS;
var init_constants = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/constants.js"() {
    MIN_LENGTH_FOR_NSN = 2;
    MAX_LENGTH_FOR_NSN = 17;
    MAX_LENGTH_COUNTRY_CODE = 3;
    VALID_DIGITS = "0-9\uFF10-\uFF19\u0660-\u0669\u06F0-\u06F9";
    DASHES = "-\u2010-\u2015\u2212\u30FC\uFF0D";
    SLASHES = "\uFF0F/";
    DOTS = "\uFF0E.";
    WHITESPACE = " \xA0\xAD\u200B\u2060\u3000";
    BRACKETS = "()\uFF08\uFF09\uFF3B\uFF3D\\[\\]";
    TILDES = "~\u2053\u223C\uFF5E";
    VALID_PUNCTUATION = "".concat(DASHES).concat(SLASHES).concat(DOTS).concat(WHITESPACE).concat(BRACKETS).concat(TILDES);
    PLUS_CHARS = "+\uFF0B";
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js
function stripIddPrefix(number, country2, callingCode, metadata) {
  if (!country2) {
    return;
  }
  var countryMetadata = new Metadata(metadata);
  countryMetadata.selectNumberingPlan(country2, callingCode);
  var IDDPrefixPattern = new RegExp(countryMetadata.IDDPrefix());
  if (number.search(IDDPrefixPattern) !== 0) {
    return;
  }
  number = number.slice(number.match(IDDPrefixPattern)[0].length);
  var matchedGroups = number.match(CAPTURING_DIGIT_PATTERN);
  if (matchedGroups && matchedGroups[1] != null && matchedGroups[1].length > 0) {
    if (matchedGroups[1] === "0") {
      return;
    }
  }
  return number;
}
var CAPTURING_DIGIT_PATTERN;
var init_stripIddPrefix = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.js"() {
    init_metadata();
    init_constants();
    CAPTURING_DIGIT_PATTERN = new RegExp("([" + VALID_DIGITS + "])");
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js
function extractNationalNumberFromPossiblyIncompleteNumber(number, metadata) {
  if (number && metadata.numberingPlan.nationalPrefixForParsing()) {
    var prefixPattern = new RegExp("^(?:" + metadata.numberingPlan.nationalPrefixForParsing() + ")");
    var prefixMatch = prefixPattern.exec(number);
    if (prefixMatch) {
      var nationalNumber;
      var carrierCode;
      var capturedGroupsCount = prefixMatch.length - 1;
      var hasCapturedGroups = capturedGroupsCount > 0 && prefixMatch[capturedGroupsCount];
      if (metadata.nationalPrefixTransformRule() && hasCapturedGroups) {
        nationalNumber = number.replace(prefixPattern, metadata.nationalPrefixTransformRule());
        if (capturedGroupsCount > 1) {
          carrierCode = prefixMatch[1];
        }
      } else {
        var prefixBeforeNationalNumber = prefixMatch[0];
        nationalNumber = number.slice(prefixBeforeNationalNumber.length);
        if (hasCapturedGroups) {
          carrierCode = prefixMatch[1];
        }
      }
      var nationalPrefix;
      if (hasCapturedGroups) {
        var possiblePositionOfTheFirstCapturedGroup = number.indexOf(prefixMatch[1]);
        var possibleNationalPrefix = number.slice(0, possiblePositionOfTheFirstCapturedGroup);
        if (possibleNationalPrefix === metadata.numberingPlan.nationalPrefix()) {
          nationalPrefix = metadata.numberingPlan.nationalPrefix();
        }
      } else {
        nationalPrefix = prefixMatch[0];
      }
      return {
        nationalNumber,
        nationalPrefix,
        carrierCode
      };
    }
  }
  return {
    nationalNumber: number
  };
}
var init_extractNationalNumberFromPossiblyIncompleteNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.js"() {
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js
function _createForOfIteratorHelperLoose3(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray3(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray3(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray3(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray3(r3, a2) : void 0;
  }
}
function _arrayLikeToArray3(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function getCountryByNationalNumber(nationalPhoneNumber, _ref) {
  var countries = _ref.countries, metadata = _ref.metadata;
  metadata = new Metadata(metadata);
  for (var _iterator = _createForOfIteratorHelperLoose3(countries), _step; !(_step = _iterator()).done; ) {
    var country2 = _step.value;
    metadata.selectNumberingPlan(country2);
    if (metadata.leadingDigits()) {
      if (nationalPhoneNumber && nationalPhoneNumber.search(metadata.leadingDigits()) === 0) {
        return country2;
      }
    } else if (getNumberType({
      phone: nationalPhoneNumber,
      country: country2
    }, void 0, metadata.metadata)) {
      return country2;
    }
  }
}
var init_getCountryByNationalNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.js"() {
    init_metadata();
    init_getNumberType();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js
function getCountryByCallingCode(callingCode, _ref) {
  var nationalPhoneNumber = _ref.nationalNumber, metadata = _ref.metadata;
  if (USE_NON_GEOGRAPHIC_COUNTRY_CODE) {
    if (metadata.isNonGeographicCallingCode(callingCode)) {
      return "001";
    }
  }
  var possibleCountries = metadata.getCountryCodesForCallingCode(callingCode);
  if (!possibleCountries) {
    return;
  }
  if (possibleCountries.length === 1) {
    return possibleCountries[0];
  }
  return getCountryByNationalNumber(nationalPhoneNumber, {
    countries: possibleCountries,
    metadata: metadata.metadata
  });
}
var USE_NON_GEOGRAPHIC_COUNTRY_CODE;
var init_getCountryByCallingCode = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.js"() {
    init_getCountryByNationalNumber();
    USE_NON_GEOGRAPHIC_COUNTRY_CODE = false;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js
function extractNationalNumber(number, country2, metadata) {
  var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(number, metadata), carrierCode = _extractNationalNumbe.carrierCode, nationalNumber = _extractNationalNumbe.nationalNumber;
  if (nationalNumber !== number) {
    if (!shouldHaveExtractedNationalPrefix(number, nationalNumber, metadata)) {
      return {
        nationalNumber: number
      };
    }
    if (metadata.numberingPlan.possibleLengths()) {
      if (!country2) {
        country2 = getCountryByCallingCode(metadata.numberingPlan.callingCode(), {
          nationalNumber,
          metadata
        });
      }
      if (!isPossibleIncompleteNationalNumber(nationalNumber, country2, metadata)) {
        return {
          nationalNumber: number
        };
      }
    }
  }
  return {
    nationalNumber,
    carrierCode
  };
}
function shouldHaveExtractedNationalPrefix(nationalNumberBefore, nationalNumberAfter, metadata) {
  if (matchesEntirely(nationalNumberBefore, metadata.nationalNumberPattern()) && !matchesEntirely(nationalNumberAfter, metadata.nationalNumberPattern())) {
    return false;
  }
  return true;
}
function isPossibleIncompleteNationalNumber(nationalNumber, country2, metadata) {
  switch (checkNumberLength(nationalNumber, country2, metadata)) {
    case "TOO_SHORT":
    case "INVALID_LENGTH":
      return false;
    default:
      return true;
  }
}
var init_extractNationalNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.js"() {
    init_extractNationalNumberFromPossiblyIncompleteNumber();
    init_matchesEntirely();
    init_checkNumberLength();
    init_getCountryByCallingCode();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/getCountryCallingCode.js
var init_getCountryCallingCode = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/getCountryCallingCode.js"() {
    init_metadata();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js
function extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country2, defaultCountry, defaultCallingCode, metadata) {
  var countryCallingCode = country2 || defaultCountry ? getCountryCallingCode(country2 || defaultCountry, metadata) : defaultCallingCode;
  if (number.indexOf(countryCallingCode) === 0) {
    metadata = new Metadata(metadata);
    metadata.selectNumberingPlan(country2 || defaultCountry, countryCallingCode);
    var possibleShorterNumber = number.slice(countryCallingCode.length);
    var _extractNationalNumbe = extractNationalNumber(possibleShorterNumber, country2, metadata), possibleShorterNationalNumber = _extractNationalNumbe.nationalNumber;
    var _extractNationalNumbe2 = extractNationalNumber(number, country2, metadata), nationalNumber = _extractNationalNumbe2.nationalNumber;
    if (!matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) && matchesEntirely(possibleShorterNationalNumber, metadata.nationalNumberPattern()) || checkNumberLength(nationalNumber, country2, metadata) === "TOO_LONG") {
      return {
        countryCallingCode,
        number: possibleShorterNumber
      };
    }
  }
  return {
    number
  };
}
var init_extractCountryCallingCodeFromInternationalNumberWithoutPlusSign = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.js"() {
    init_metadata();
    init_matchesEntirely();
    init_extractNationalNumber();
    init_checkNumberLength();
    init_getCountryCallingCode();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js
function extractCountryCallingCode(number, country2, defaultCountry, defaultCallingCode, metadata) {
  if (!number) {
    return {};
  }
  var isNumberWithIddPrefix;
  if (number[0] !== "+") {
    var numberWithoutIDD = stripIddPrefix(number, country2 || defaultCountry, defaultCallingCode, metadata);
    if (numberWithoutIDD && numberWithoutIDD !== number) {
      isNumberWithIddPrefix = true;
      number = "+" + numberWithoutIDD;
    } else {
      if (country2 || defaultCountry || defaultCallingCode) {
        var _extractCountryCallin = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(number, country2, defaultCountry, defaultCallingCode, metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, shorterNumber = _extractCountryCallin.number;
        if (countryCallingCode) {
          return {
            countryCallingCodeSource: "FROM_NUMBER_WITHOUT_PLUS_SIGN",
            countryCallingCode,
            number: shorterNumber
          };
        }
      }
      return {
        // No need to set it to `UNSPECIFIED`. It can be just `undefined`.
        // countryCallingCodeSource: 'UNSPECIFIED',
        number
      };
    }
  }
  if (number[1] === "0") {
    return {};
  }
  metadata = new Metadata(metadata);
  var i2 = 2;
  while (i2 - 1 <= MAX_LENGTH_COUNTRY_CODE && i2 <= number.length) {
    var _countryCallingCode = number.slice(1, i2);
    if (metadata.hasCallingCode(_countryCallingCode)) {
      metadata.selectNumberingPlan(_countryCallingCode);
      return {
        countryCallingCodeSource: isNumberWithIddPrefix ? "FROM_NUMBER_WITH_IDD" : "FROM_NUMBER_WITH_PLUS_SIGN",
        countryCallingCode: _countryCallingCode,
        number: number.slice(i2)
      };
    }
    i2++;
  }
  return {};
}
var init_extractCountryCallingCode = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.js"() {
    init_stripIddPrefix();
    init_extractCountryCallingCodeFromInternationalNumberWithoutPlusSign();
    init_metadata();
    init_constants();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js
function applyInternationalSeparatorStyle(formattedNumber) {
  return formattedNumber.replace(new RegExp("[".concat(VALID_PUNCTUATION, "]+"), "g"), " ").trim();
}
var init_applyInternationalSeparatorStyle = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.js"() {
    init_constants();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js
function formatNationalNumberUsingFormat(number, format7, _ref) {
  var useInternationalFormat = _ref.useInternationalFormat, withNationalPrefix = _ref.withNationalPrefix, carrierCode = _ref.carrierCode, metadata = _ref.metadata;
  var formattedNumber = number.replace(new RegExp(format7.pattern()), useInternationalFormat ? format7.internationalFormat() : (
    // This library doesn't use `domestic_carrier_code_formatting_rule`,
    // because that one is only used when formatting phone numbers
    // for dialing from a mobile phone, and this is not a dialing library.
    // carrierCode && format.domesticCarrierCodeFormattingRule()
    // 	// First, replace the $CC in the formatting rule with the desired carrier code.
    // 	// Then, replace the $FG in the formatting rule with the first group
    // 	// and the carrier code combined in the appropriate way.
    // 	? format.format().replace(FIRST_GROUP_PATTERN, format.domesticCarrierCodeFormattingRule().replace('$CC', carrierCode))
    // 	: (
    // 		withNationalPrefix && format.nationalPrefixFormattingRule()
    // 			? format.format().replace(FIRST_GROUP_PATTERN, format.nationalPrefixFormattingRule())
    // 			: format.format()
    // 	)
    withNationalPrefix && format7.nationalPrefixFormattingRule() ? format7.format().replace(FIRST_GROUP_PATTERN, format7.nationalPrefixFormattingRule()) : format7.format()
  ));
  if (useInternationalFormat) {
    return applyInternationalSeparatorStyle(formattedNumber);
  }
  return formattedNumber;
}
var FIRST_GROUP_PATTERN;
var init_formatNationalNumberUsingFormat = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.js"() {
    init_applyInternationalSeparatorStyle();
    FIRST_GROUP_PATTERN = /(\$\d)/;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js
function getIddPrefix(country2, callingCode, metadata) {
  var countryMetadata = new Metadata(metadata);
  countryMetadata.selectNumberingPlan(country2, callingCode);
  if (countryMetadata.defaultIDDPrefix()) {
    return countryMetadata.defaultIDDPrefix();
  }
  if (SINGLE_IDD_PREFIX_REG_EXP.test(countryMetadata.IDDPrefix())) {
    return countryMetadata.IDDPrefix();
  }
}
var SINGLE_IDD_PREFIX_REG_EXP;
var init_getIddPrefix = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.js"() {
    init_metadata();
    SINGLE_IDD_PREFIX_REG_EXP = /^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js
function createExtensionPattern(purpose) {
  var extLimitAfterExplicitLabel = "20";
  var extLimitAfterLikelyLabel = "15";
  var extLimitAfterAmbiguousChar = "9";
  var extLimitWhenNotSure = "6";
  var possibleSeparatorsBetweenNumberAndExtLabel = "[ \xA0\\t,]*";
  var possibleCharsAfterExtLabel = "[:\\.\uFF0E]?[ \xA0\\t,-]*";
  var optionalExtnSuffix = "#?";
  var explicitExtLabels = "(?:e?xt(?:ensi(?:o\u0301?|\xF3))?n?|\uFF45?\uFF58\uFF54\uFF4E?|\u0434\u043E\u0431|anexo)";
  var ambiguousExtLabels = "(?:[x\uFF58#\uFF03~\uFF5E]|int|\uFF49\uFF4E\uFF54)";
  var ambiguousSeparator = "[- ]+";
  var possibleSeparatorsNumberExtLabelNoComma = "[ \xA0\\t]*";
  var autoDiallingAndExtLabelsFound = "(?:,{2}|;)";
  var rfcExtn = RFC3966_EXTN_PREFIX + getExtensionDigitsPattern(extLimitAfterExplicitLabel);
  var explicitExtn = possibleSeparatorsBetweenNumberAndExtLabel + explicitExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterExplicitLabel) + optionalExtnSuffix;
  var ambiguousExtn = possibleSeparatorsBetweenNumberAndExtLabel + ambiguousExtLabels + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
  var americanStyleExtnWithSuffix = ambiguousSeparator + getExtensionDigitsPattern(extLimitWhenNotSure) + "#";
  var autoDiallingExtn = possibleSeparatorsNumberExtLabelNoComma + autoDiallingAndExtLabelsFound + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterLikelyLabel) + optionalExtnSuffix;
  var onlyCommasExtn = possibleSeparatorsNumberExtLabelNoComma + "(?:,)+" + possibleCharsAfterExtLabel + getExtensionDigitsPattern(extLimitAfterAmbiguousChar) + optionalExtnSuffix;
  return rfcExtn + "|" + explicitExtn + "|" + ambiguousExtn + "|" + americanStyleExtnWithSuffix + "|" + autoDiallingExtn + "|" + onlyCommasExtn;
}
var RFC3966_EXTN_PREFIX, getExtensionDigitsPattern;
var init_createExtensionPattern = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.js"() {
    init_constants();
    RFC3966_EXTN_PREFIX = ";ext=";
    getExtensionDigitsPattern = function getExtensionDigitsPattern2(maxLength) {
      return "([".concat(VALID_DIGITS, "]{1,").concat(maxLength, "})");
    };
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js
function isViablePhoneNumber(number) {
  return number.length >= MIN_LENGTH_FOR_NSN && VALID_PHONE_NUMBER_PATTERN.test(number);
}
function isViablePhoneNumberStart(number) {
  return VALID_PHONE_NUMBER_START_REG_EXP.test(number);
}
var MIN_LENGTH_PHONE_NUMBER_PATTERN, VALID_PHONE_NUMBER, VALID_PHONE_NUMBER_START_REG_EXP, VALID_PHONE_NUMBER_WITH_EXTENSION, VALID_PHONE_NUMBER_PATTERN;
var init_isViablePhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.js"() {
    init_constants();
    init_createExtensionPattern();
    MIN_LENGTH_PHONE_NUMBER_PATTERN = "[" + VALID_DIGITS + "]{" + MIN_LENGTH_FOR_NSN + "}";
    VALID_PHONE_NUMBER = "[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){3,}[" + VALID_PUNCTUATION + VALID_DIGITS + "]*";
    VALID_PHONE_NUMBER_START_REG_EXP = new RegExp("^[" + PLUS_CHARS + "]{0,1}(?:[" + VALID_PUNCTUATION + "]*[" + VALID_DIGITS + "]){1,2}$", "i");
    VALID_PHONE_NUMBER_WITH_EXTENSION = VALID_PHONE_NUMBER + // Phone number extensions
    "(?:" + createExtensionPattern() + ")?";
    VALID_PHONE_NUMBER_PATTERN = new RegExp(
      // Either a short two-digit-only phone number
      "^" + MIN_LENGTH_PHONE_NUMBER_PATTERN + "$|^" + VALID_PHONE_NUMBER_WITH_EXTENSION + "$",
      "i"
    );
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/RFC3966.js
function _slicedToArray(r3, e2) {
  return _arrayWithHoles(r3) || _iterableToArrayLimit(r3, e2) || _unsupportedIterableToArray4(r3, e2) || _nonIterableRest();
}
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _iterableToArrayLimit(r3, l2) {
  var t2 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t2) {
    var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
    try {
      if (i2 = (t2 = t2.call(r3)).next, 0 === l2) {
        if (Object(t2) !== t2) return;
        f2 = false;
      } else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ;
    } catch (r4) {
      o2 = true, n2 = r4;
    } finally {
      try {
        if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
      } finally {
        if (o2) throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles(r3) {
  if (Array.isArray(r3)) return r3;
}
function _createForOfIteratorHelperLoose4(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray4(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray4(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray4(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray4(r3, a2) : void 0;
  }
}
function _arrayLikeToArray4(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function parseRFC3966(text) {
  var number;
  var ext;
  text = text.replace(/^tel:/, "tel=");
  for (var _iterator = _createForOfIteratorHelperLoose4(text.split(";")), _step; !(_step = _iterator()).done; ) {
    var part = _step.value;
    var _part$split = part.split("="), _part$split2 = _slicedToArray(_part$split, 2), name = _part$split2[0], value = _part$split2[1];
    switch (name) {
      case "tel":
        number = value;
        break;
      case "ext":
        ext = value;
        break;
      case "phone-context":
        if (value[0] === "+") {
          number = value + number;
        }
        break;
    }
  }
  if (!isViablePhoneNumber(number)) {
    return {};
  }
  var result2 = {
    number
  };
  if (ext) {
    result2.ext = ext;
  }
  return result2;
}
function formatRFC3966(_ref) {
  var number = _ref.number, ext = _ref.ext;
  if (!number) {
    return "";
  }
  if (number[0] !== "+") {
    throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');
  }
  return "tel:".concat(number).concat(ext ? ";ext=" + ext : "");
}
var init_RFC3966 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/RFC3966.js"() {
    init_isViablePhoneNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/format.js
function formatNumber3(input, format7, options, metadata) {
  if (options) {
    options = merge({}, DEFAULT_OPTIONS, options);
  } else {
    options = DEFAULT_OPTIONS;
  }
  metadata = new Metadata(metadata);
  if (input.country && input.country !== "001") {
    if (!metadata.hasCountry(input.country)) {
      throw new Error("Unknown country: ".concat(input.country));
    }
    metadata.selectNumberingPlan(input.country);
  } else if (input.countryCallingCode) {
    metadata.selectNumberingPlan(input.countryCallingCode);
  } else return input.phone || "";
  var countryCallingCode = metadata.countryCallingCode();
  var nationalNumber = options.v2 ? input.nationalNumber : input.phone;
  var number;
  switch (format7) {
    case "NATIONAL":
      if (!nationalNumber) {
        return "";
      }
      number = formatNationalNumber(nationalNumber, input.carrierCode, "NATIONAL", metadata, options);
      return addExtension(number, input.ext, metadata, options.formatExtension);
    case "INTERNATIONAL":
      if (!nationalNumber) {
        return "+".concat(countryCallingCode);
      }
      number = formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata, options);
      number = "+".concat(countryCallingCode, " ").concat(number);
      return addExtension(number, input.ext, metadata, options.formatExtension);
    case "E.164":
      return "+".concat(countryCallingCode).concat(nationalNumber);
    case "RFC3966":
      return formatRFC3966({
        number: "+".concat(countryCallingCode).concat(nationalNumber),
        ext: input.ext
      });
    // For reference, here's Google's IDD formatter:
    // https://github.com/google/libphonenumber/blob/32719cf74e68796788d1ca45abc85dcdc63ba5b9/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L1546
    // Not saying that this IDD formatter replicates it 1:1, but it seems to work.
    // Who would even need to format phone numbers in IDD format anyway?
    case "IDD":
      if (!options.fromCountry) {
        return;
      }
      var formattedNumber = formatIDD(nationalNumber, input.carrierCode, countryCallingCode, options.fromCountry, metadata);
      if (!formattedNumber) {
        return;
      }
      return addExtension(formattedNumber, input.ext, metadata, options.formatExtension);
    default:
      throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(format7, '"'));
  }
}
function formatNationalNumber(number, carrierCode, formatAs, metadata, options) {
  var format7 = chooseFormatForNumber(metadata.formats(), number);
  if (!format7) {
    return number;
  }
  return formatNationalNumberUsingFormat(number, format7, {
    useInternationalFormat: formatAs === "INTERNATIONAL",
    withNationalPrefix: format7.nationalPrefixIsOptionalWhenFormattingInNationalFormat() && options && options.nationalPrefix === false ? false : true,
    carrierCode,
    metadata
  });
}
function chooseFormatForNumber(availableFormats, nationalNumber) {
  return pickFirstMatchingElement(availableFormats, function(format7) {
    if (format7.leadingDigitsPatterns().length > 0) {
      var lastLeadingDigitsPattern = format7.leadingDigitsPatterns()[format7.leadingDigitsPatterns().length - 1];
      if (nationalNumber.search(lastLeadingDigitsPattern) !== 0) {
        return false;
      }
    }
    return matchesEntirely(nationalNumber, format7.pattern());
  });
}
function addExtension(formattedNumber, ext, metadata, formatExtension2) {
  return ext ? formatExtension2(formattedNumber, ext, metadata) : formattedNumber;
}
function formatIDD(nationalNumber, carrierCode, countryCallingCode, fromCountry, metadata) {
  var fromCountryCallingCode = getCountryCallingCode(fromCountry, metadata.metadata);
  if (fromCountryCallingCode === countryCallingCode) {
    var formattedNumber = formatNationalNumber(nationalNumber, carrierCode, "NATIONAL", metadata);
    if (countryCallingCode === "1") {
      return countryCallingCode + " " + formattedNumber;
    }
    return formattedNumber;
  }
  var iddPrefix = getIddPrefix(fromCountry, void 0, metadata.metadata);
  if (iddPrefix) {
    return "".concat(iddPrefix, " ").concat(countryCallingCode, " ").concat(formatNationalNumber(nationalNumber, null, "INTERNATIONAL", metadata));
  }
}
function merge() {
  var i2 = 1;
  for (var _len = arguments.length, objects = new Array(_len), _key = 0; _key < _len; _key++) {
    objects[_key] = arguments[_key];
  }
  while (i2 < objects.length) {
    if (objects[i2]) {
      for (var key in objects[i2]) {
        objects[0][key] = objects[i2][key];
      }
    }
    i2++;
  }
  return objects[0];
}
function pickFirstMatchingElement(elements, testFunction) {
  var i2 = 0;
  while (i2 < elements.length) {
    if (testFunction(elements[i2])) {
      return elements[i2];
    }
    i2++;
  }
}
var DEFAULT_OPTIONS;
var init_format = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/format.js"() {
    init_matchesEntirely();
    init_formatNationalNumberUsingFormat();
    init_metadata();
    init_getIddPrefix();
    init_RFC3966();
    DEFAULT_OPTIONS = {
      formatExtension: function formatExtension(formattedNumber, extension, metadata) {
        return "".concat(formattedNumber).concat(metadata.ext()).concat(extension);
      }
    };
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/PhoneNumber.js
function _typeof2(o2) {
  "@babel/helpers - typeof";
  return _typeof2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof2(o2);
}
function ownKeys(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys(Object(t2), true).forEach(function(r4) {
      _defineProperty(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty(e2, r3, t2) {
  return (r3 = _toPropertyKey2(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _classCallCheck2(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties2(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey2(o2.key), o2);
  }
}
function _createClass2(e2, r3, t2) {
  return r3 && _defineProperties2(e2.prototype, r3), t2 && _defineProperties2(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey2(t2) {
  var i2 = _toPrimitive2(t2, "string");
  return "symbol" == _typeof2(i2) ? i2 : i2 + "";
}
function _toPrimitive2(t2, r3) {
  if ("object" != _typeof2(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof2(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadataJson) {
  var country2;
  var countryCallingCode;
  var metadata = new Metadata(metadataJson);
  if (isCountryCode(countryOrCountryCallingCode)) {
    country2 = countryOrCountryCallingCode;
    metadata.selectNumberingPlan(country2);
    countryCallingCode = metadata.countryCallingCode();
  } else {
    countryCallingCode = countryOrCountryCallingCode;
    if (USE_NON_GEOGRAPHIC_COUNTRY_CODE2) {
      if (metadata.isNonGeographicCallingCode(countryCallingCode)) {
        country2 = "001";
      }
    }
  }
  return {
    country: country2,
    countryCallingCode
  };
}
var USE_NON_GEOGRAPHIC_COUNTRY_CODE2, PhoneNumber, isCountryCode, E164_NUMBER_REGEXP;
var init_PhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/PhoneNumber.js"() {
    init_metadata();
    init_isPossible();
    init_isValid();
    init_getNumberType();
    init_getPossibleCountriesForNumber();
    init_extractCountryCallingCode();
    init_isObject();
    init_format();
    USE_NON_GEOGRAPHIC_COUNTRY_CODE2 = false;
    PhoneNumber = /* @__PURE__ */ (function() {
      function PhoneNumber3(countryOrCountryCallingCode, nationalNumber, metadata) {
        _classCallCheck2(this, PhoneNumber3);
        if (!countryOrCountryCallingCode) {
          throw new TypeError("First argument is required");
        }
        if (typeof countryOrCountryCallingCode !== "string") {
          throw new TypeError("First argument must be a string");
        }
        if (countryOrCountryCallingCode[0] === "+" && !nationalNumber) {
          throw new TypeError("`metadata` argument not passed");
        }
        if (isObject2(nationalNumber) && isObject2(nationalNumber.countries)) {
          metadata = nationalNumber;
          var e164Number = countryOrCountryCallingCode;
          if (!E164_NUMBER_REGEXP.test(e164Number)) {
            throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');
          }
          var _extractCountryCallin = extractCountryCallingCode(e164Number, void 0, void 0, void 0, metadata), _countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
          nationalNumber = number;
          countryOrCountryCallingCode = _countryCallingCode;
          if (!nationalNumber) {
            throw new Error("Invalid `number` argument passed: too short");
          }
        }
        if (!nationalNumber) {
          throw new TypeError("`nationalNumber` argument is required");
        }
        if (typeof nationalNumber !== "string") {
          throw new TypeError("`nationalNumber` argument must be a string");
        }
        validateMetadata(metadata);
        var _getCountryAndCountry = getCountryAndCountryCallingCode(countryOrCountryCallingCode, metadata), country2 = _getCountryAndCountry.country, countryCallingCode = _getCountryAndCountry.countryCallingCode;
        this.country = country2;
        this.countryCallingCode = countryCallingCode;
        this.nationalNumber = nationalNumber;
        this.number = "+" + this.countryCallingCode + this.nationalNumber;
        this.getMetadata = function() {
          return metadata;
        };
      }
      return _createClass2(PhoneNumber3, [{
        key: "setExt",
        value: function setExt(ext) {
          this.ext = ext;
        }
      }, {
        key: "getPossibleCountries",
        value: function getPossibleCountries() {
          if (this.country) {
            return [this.country];
          }
          return getPossibleCountriesForNumber(this.countryCallingCode, this.nationalNumber, this.getMetadata());
        }
      }, {
        key: "isPossible",
        value: function isPossible() {
          return isPossiblePhoneNumber(this, {
            v2: true
          }, this.getMetadata());
        }
      }, {
        key: "isValid",
        value: function isValid2() {
          return isValidNumber(this, {
            v2: true
          }, this.getMetadata());
        }
      }, {
        key: "isNonGeographic",
        value: function isNonGeographic() {
          var metadata = new Metadata(this.getMetadata());
          return metadata.isNonGeographicCallingCode(this.countryCallingCode);
        }
      }, {
        key: "isEqual",
        value: function isEqual(phoneNumber) {
          return this.number === phoneNumber.number && this.ext === phoneNumber.ext;
        }
        // This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,
        // but later it was found out that it doesn't include the possible `TOO_SHORT` result
        // returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,
        // so eventually I simply commented out this method from the `PhoneNumber` class
        // and just left the `validatePhoneNumberLength()` function, even though that one would require
        // and additional step to also validate the actual country / calling code of the phone number.
        // validateLength() {
        // 	const metadata = new Metadata(this.getMetadata())
        // 	metadata.selectNumberingPlan(this.countryCallingCode)
        // 	const result = checkNumberLength(this.nationalNumber, metadata)
        // 	if (result !== 'IS_POSSIBLE') {
        // 		return result
        // 	}
        // }
      }, {
        key: "getType",
        value: function getType2() {
          return getNumberType(this, {
            v2: true
          }, this.getMetadata());
        }
      }, {
        key: "format",
        value: function format7(_format, options) {
          return formatNumber3(this, _format, options ? _objectSpread(_objectSpread({}, options), {}, {
            v2: true
          }) : {
            v2: true
          }, this.getMetadata());
        }
      }, {
        key: "formatNational",
        value: function formatNational(options) {
          return this.format("NATIONAL", options);
        }
      }, {
        key: "formatInternational",
        value: function formatInternational(options) {
          return this.format("INTERNATIONAL", options);
        }
      }, {
        key: "getURI",
        value: function getURI(options) {
          return this.format("RFC3966", options);
        }
      }]);
    })();
    isCountryCode = function isCountryCode2(value) {
      return /^[A-Z]{2}$/.test(value);
    };
    E164_NUMBER_REGEXP = /^\+\d+$/;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/ParseError.js
function _typeof3(o2) {
  "@babel/helpers - typeof";
  return _typeof3 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof3(o2);
}
function _defineProperties3(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey3(o2.key), o2);
  }
}
function _createClass3(e2, r3, t2) {
  return r3 && _defineProperties3(e2.prototype, r3), t2 && _defineProperties3(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey3(t2) {
  var i2 = _toPrimitive3(t2, "string");
  return "symbol" == _typeof3(i2) ? i2 : i2 + "";
}
function _toPrimitive3(t2, r3) {
  if ("object" != _typeof3(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof3(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function _classCallCheck3(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _callSuper(t2, o2, e2) {
  return o2 = _getPrototypeOf(o2), _possibleConstructorReturn(t2, _isNativeReflectConstruct() ? Reflect.construct(o2, e2 || [], _getPrototypeOf(t2).constructor) : o2.apply(t2, e2));
}
function _possibleConstructorReturn(t2, e2) {
  if (e2 && ("object" == _typeof3(e2) || "function" == typeof e2)) return e2;
  if (void 0 !== e2) throw new TypeError("Derived constructors may only return object or undefined");
  return _assertThisInitialized(t2);
}
function _assertThisInitialized(e2) {
  if (void 0 === e2) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  return e2;
}
function _inherits(t2, e2) {
  if ("function" != typeof e2 && null !== e2) throw new TypeError("Super expression must either be null or a function");
  t2.prototype = Object.create(e2 && e2.prototype, { constructor: { value: t2, writable: true, configurable: true } }), Object.defineProperty(t2, "prototype", { writable: false }), e2 && _setPrototypeOf(t2, e2);
}
function _wrapNativeSuper(t2) {
  var r3 = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
  return _wrapNativeSuper = function _wrapNativeSuper2(t3) {
    if (null === t3 || !_isNativeFunction(t3)) return t3;
    if ("function" != typeof t3) throw new TypeError("Super expression must either be null or a function");
    if (void 0 !== r3) {
      if (r3.has(t3)) return r3.get(t3);
      r3.set(t3, Wrapper);
    }
    function Wrapper() {
      return _construct(t3, arguments, _getPrototypeOf(this).constructor);
    }
    return Wrapper.prototype = Object.create(t3.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }), _setPrototypeOf(Wrapper, t3);
  }, _wrapNativeSuper(t2);
}
function _construct(t2, e2, r3) {
  if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
  var o2 = [null];
  o2.push.apply(o2, e2);
  var p2 = new (t2.bind.apply(t2, o2))();
  return r3 && _setPrototypeOf(p2, r3.prototype), p2;
}
function _isNativeReflectConstruct() {
  try {
    var t2 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
    }));
  } catch (t3) {
  }
  return (_isNativeReflectConstruct = function _isNativeReflectConstruct2() {
    return !!t2;
  })();
}
function _isNativeFunction(t2) {
  try {
    return -1 !== Function.toString.call(t2).indexOf("[native code]");
  } catch (n2) {
    return "function" == typeof t2;
  }
}
function _setPrototypeOf(t2, e2) {
  return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t3, e3) {
    return t3.__proto__ = e3, t3;
  }, _setPrototypeOf(t2, e2);
}
function _getPrototypeOf(t2) {
  return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t3) {
    return t3.__proto__ || Object.getPrototypeOf(t3);
  }, _getPrototypeOf(t2);
}
var ParseError;
var init_ParseError = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/ParseError.js"() {
    ParseError = /* @__PURE__ */ (function(_Error) {
      function ParseError2(code) {
        var _this;
        _classCallCheck3(this, ParseError2);
        _this = _callSuper(this, ParseError2, [code]);
        Object.setPrototypeOf(_this, ParseError2.prototype);
        _this.name = _this.constructor.name;
        return _this;
      }
      _inherits(ParseError2, _Error);
      return _createClass3(ParseError2);
    })(/* @__PURE__ */ _wrapNativeSuper(Error));
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js
function extractExtension(number) {
  var start = number.search(EXTN_PATTERN);
  if (start < 0) {
    return {};
  }
  var numberWithoutExtension = number.slice(0, start);
  var matches = number.match(EXTN_PATTERN);
  var i2 = 1;
  while (i2 < matches.length) {
    if (matches[i2]) {
      return {
        number: numberWithoutExtension,
        ext: matches[i2]
      };
    }
    i2++;
  }
}
var EXTN_PATTERN;
var init_extractExtension = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.js"() {
    init_createExtensionPattern();
    EXTN_PATTERN = new RegExp("(?:" + createExtensionPattern() + ")$", "i");
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/parseDigits.js
function _createForOfIteratorHelperLoose5(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray5(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray5(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray5(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray5(r3, a2) : void 0;
  }
}
function _arrayLikeToArray5(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function parseDigit(character) {
  return DIGITS[character];
}
function parseDigits(string) {
  var result2 = "";
  for (var _iterator = _createForOfIteratorHelperLoose5(string.split("")), _step; !(_step = _iterator()).done; ) {
    var character = _step.value;
    var digit = parseDigit(character);
    if (digit) {
      result2 += digit;
    }
  }
  return result2;
}
var DIGITS;
var init_parseDigits = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/parseDigits.js"() {
    DIGITS = {
      "0": "0",
      "1": "1",
      "2": "2",
      "3": "3",
      "4": "4",
      "5": "5",
      "6": "6",
      "7": "7",
      "8": "8",
      "9": "9",
      "\uFF10": "0",
      // Fullwidth digit 0
      "\uFF11": "1",
      // Fullwidth digit 1
      "\uFF12": "2",
      // Fullwidth digit 2
      "\uFF13": "3",
      // Fullwidth digit 3
      "\uFF14": "4",
      // Fullwidth digit 4
      "\uFF15": "5",
      // Fullwidth digit 5
      "\uFF16": "6",
      // Fullwidth digit 6
      "\uFF17": "7",
      // Fullwidth digit 7
      "\uFF18": "8",
      // Fullwidth digit 8
      "\uFF19": "9",
      // Fullwidth digit 9
      "\u0660": "0",
      // Arabic-indic digit 0
      "\u0661": "1",
      // Arabic-indic digit 1
      "\u0662": "2",
      // Arabic-indic digit 2
      "\u0663": "3",
      // Arabic-indic digit 3
      "\u0664": "4",
      // Arabic-indic digit 4
      "\u0665": "5",
      // Arabic-indic digit 5
      "\u0666": "6",
      // Arabic-indic digit 6
      "\u0667": "7",
      // Arabic-indic digit 7
      "\u0668": "8",
      // Arabic-indic digit 8
      "\u0669": "9",
      // Arabic-indic digit 9
      "\u06F0": "0",
      // Eastern-Arabic digit 0
      "\u06F1": "1",
      // Eastern-Arabic digit 1
      "\u06F2": "2",
      // Eastern-Arabic digit 2
      "\u06F3": "3",
      // Eastern-Arabic digit 3
      "\u06F4": "4",
      // Eastern-Arabic digit 4
      "\u06F5": "5",
      // Eastern-Arabic digit 5
      "\u06F6": "6",
      // Eastern-Arabic digit 6
      "\u06F7": "7",
      // Eastern-Arabic digit 7
      "\u06F8": "8",
      // Eastern-Arabic digit 8
      "\u06F9": "9"
      // Eastern-Arabic digit 9
    };
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js
function _createForOfIteratorHelperLoose6(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray6(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray6(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray6(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray6(r3, a2) : void 0;
  }
}
function _arrayLikeToArray6(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function parseIncompletePhoneNumber(string) {
  var result2 = "";
  for (var _iterator = _createForOfIteratorHelperLoose6(string.split("")), _step; !(_step = _iterator()).done; ) {
    var character = _step.value;
    result2 += parsePhoneNumberCharacter(character, result2) || "";
  }
  return result2;
}
function parsePhoneNumberCharacter(character, prevParsedCharacters, eventListener) {
  if (character === "+") {
    if (prevParsedCharacters) {
      if (typeof eventListener === "function") {
        eventListener("end");
      }
      return;
    }
    return "+";
  }
  return parseDigit(character);
}
var init_parseIncompletePhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.js"() {
    init_parseDigits();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js
function extractPhoneContext(numberToExtractFrom) {
  var indexOfPhoneContext = numberToExtractFrom.indexOf(RFC3966_PHONE_CONTEXT_);
  if (indexOfPhoneContext < 0) {
    return null;
  }
  var phoneContextStart = indexOfPhoneContext + RFC3966_PHONE_CONTEXT_.length;
  if (phoneContextStart >= numberToExtractFrom.length) {
    return "";
  }
  var phoneContextEnd = numberToExtractFrom.indexOf(";", phoneContextStart);
  if (phoneContextEnd >= 0) {
    return numberToExtractFrom.substring(phoneContextStart, phoneContextEnd);
  } else {
    return numberToExtractFrom.substring(phoneContextStart);
  }
}
function isPhoneContextValid(phoneContext) {
  if (phoneContext === null) {
    return true;
  }
  if (phoneContext.length === 0) {
    return false;
  }
  return RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_.test(phoneContext) || RFC3966_DOMAINNAME_PATTERN_.test(phoneContext);
}
var PLUS_SIGN, RFC3966_VISUAL_SEPARATOR_, RFC3966_PHONE_DIGIT_, RFC3966_GLOBAL_NUMBER_DIGITS_, RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_, ALPHANUM_, RFC3966_DOMAINLABEL_, VALID_ALPHA_, RFC3966_TOPLABEL_, RFC3966_DOMAINNAME_, RFC3966_DOMAINNAME_PATTERN_, RFC3966_PREFIX_, RFC3966_PHONE_CONTEXT_, RFC3966_ISDN_SUBADDRESS_;
var init_extractPhoneContext = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.js"() {
    init_constants();
    PLUS_SIGN = "+";
    RFC3966_VISUAL_SEPARATOR_ = "[\\-\\.\\(\\)]?";
    RFC3966_PHONE_DIGIT_ = "([" + VALID_DIGITS + "]|" + RFC3966_VISUAL_SEPARATOR_ + ")";
    RFC3966_GLOBAL_NUMBER_DIGITS_ = "^\\" + PLUS_SIGN + RFC3966_PHONE_DIGIT_ + "*[" + VALID_DIGITS + "]" + RFC3966_PHONE_DIGIT_ + "*$";
    RFC3966_GLOBAL_NUMBER_DIGITS_PATTERN_ = new RegExp(RFC3966_GLOBAL_NUMBER_DIGITS_, "g");
    ALPHANUM_ = VALID_DIGITS;
    RFC3966_DOMAINLABEL_ = "[" + ALPHANUM_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
    VALID_ALPHA_ = "a-zA-Z";
    RFC3966_TOPLABEL_ = "[" + VALID_ALPHA_ + "]+((\\-)*[" + ALPHANUM_ + "])*";
    RFC3966_DOMAINNAME_ = "^(" + RFC3966_DOMAINLABEL_ + "\\.)*" + RFC3966_TOPLABEL_ + "\\.?$";
    RFC3966_DOMAINNAME_PATTERN_ = new RegExp(RFC3966_DOMAINNAME_, "g");
    RFC3966_PREFIX_ = "tel:";
    RFC3966_PHONE_CONTEXT_ = ";phone-context=";
    RFC3966_ISDN_SUBADDRESS_ = ";isub=";
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js
function extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(numberToParse, _ref) {
  var extractFormattedPhoneNumber2 = _ref.extractFormattedPhoneNumber;
  var phoneContext = extractPhoneContext(numberToParse);
  if (!isPhoneContextValid(phoneContext)) {
    throw new ParseError("NOT_A_NUMBER");
  }
  var phoneNumberString;
  if (phoneContext === null) {
    phoneNumberString = extractFormattedPhoneNumber2(numberToParse) || "";
  } else {
    phoneNumberString = "";
    if (phoneContext.charAt(0) === PLUS_SIGN) {
      phoneNumberString += phoneContext;
    }
    var indexOfRfc3966Prefix = numberToParse.indexOf(RFC3966_PREFIX_);
    var indexOfNationalNumber;
    if (indexOfRfc3966Prefix >= 0) {
      indexOfNationalNumber = indexOfRfc3966Prefix + RFC3966_PREFIX_.length;
    } else {
      indexOfNationalNumber = 0;
    }
    var indexOfPhoneContext = numberToParse.indexOf(RFC3966_PHONE_CONTEXT_);
    phoneNumberString += numberToParse.substring(indexOfNationalNumber, indexOfPhoneContext);
  }
  var indexOfIsdn = phoneNumberString.indexOf(RFC3966_ISDN_SUBADDRESS_);
  if (indexOfIsdn > 0) {
    phoneNumberString = phoneNumberString.substring(0, indexOfIsdn);
  }
  if (phoneNumberString !== "") {
    return phoneNumberString;
  }
}
var init_extractFormattedPhoneNumberFromPossibleRfc3966NumberUri = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.js"() {
    init_extractPhoneContext();
    init_ParseError();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parse.js
function parse(text, options, metadata) {
  options = options || {};
  metadata = new Metadata(metadata);
  if (options.defaultCountry && !metadata.hasCountry(options.defaultCountry)) {
    if (options.v2) {
      throw new ParseError("INVALID_COUNTRY");
    }
    throw new Error("Unknown country: ".concat(options.defaultCountry));
  }
  var _parseInput = parseInput(text, options.v2, options.extract), formattedPhoneNumber = _parseInput.number, ext = _parseInput.ext, error2 = _parseInput.error;
  if (!formattedPhoneNumber) {
    if (options.v2) {
      if (error2 === "TOO_SHORT") {
        throw new ParseError("TOO_SHORT");
      }
      throw new ParseError("NOT_A_NUMBER");
    }
    return {};
  }
  var _parsePhoneNumber = parsePhoneNumber(formattedPhoneNumber, options.defaultCountry, options.defaultCallingCode, metadata), country2 = _parsePhoneNumber.country, nationalNumber = _parsePhoneNumber.nationalNumber, countryCallingCode = _parsePhoneNumber.countryCallingCode, countryCallingCodeSource = _parsePhoneNumber.countryCallingCodeSource, carrierCode = _parsePhoneNumber.carrierCode;
  if (!metadata.hasSelectedNumberingPlan()) {
    if (options.v2) {
      throw new ParseError("INVALID_COUNTRY");
    }
    return {};
  }
  if (!nationalNumber || nationalNumber.length < MIN_LENGTH_FOR_NSN) {
    if (options.v2) {
      throw new ParseError("TOO_SHORT");
    }
    return {};
  }
  if (nationalNumber.length > MAX_LENGTH_FOR_NSN) {
    if (options.v2) {
      throw new ParseError("TOO_LONG");
    }
    return {};
  }
  if (options.v2) {
    var phoneNumber = new PhoneNumber(countryCallingCode, nationalNumber, metadata.metadata);
    if (country2) {
      phoneNumber.country = country2;
    }
    if (carrierCode) {
      phoneNumber.carrierCode = carrierCode;
    }
    if (ext) {
      phoneNumber.ext = ext;
    }
    phoneNumber.__countryCallingCodeSource = countryCallingCodeSource;
    return phoneNumber;
  }
  var valid = (options.extended ? metadata.hasSelectedNumberingPlan() : country2) ? matchesEntirely(nationalNumber, metadata.nationalNumberPattern()) : false;
  if (!options.extended) {
    return valid ? result(country2, nationalNumber, ext) : {};
  }
  return {
    country: country2,
    countryCallingCode,
    carrierCode,
    valid,
    possible: valid ? true : options.extended === true && metadata.possibleLengths() && isPossibleNumber(nationalNumber, country2, metadata) ? true : false,
    phone: nationalNumber,
    ext
  };
}
function _extractFormattedPhoneNumber(text, extract, throwOnError) {
  if (!text) {
    return;
  }
  if (text.length > MAX_INPUT_STRING_LENGTH) {
    if (throwOnError) {
      throw new ParseError("TOO_LONG");
    }
    return;
  }
  if (extract === false) {
    return text;
  }
  var startsAt = text.search(PHONE_NUMBER_START_PATTERN);
  if (startsAt < 0) {
    return;
  }
  return text.slice(startsAt).replace(AFTER_PHONE_NUMBER_END_PATTERN, "");
}
function parseInput(text, v2, extract) {
  var number = extractFormattedPhoneNumberFromPossibleRfc3966NumberUri(text, {
    extractFormattedPhoneNumber: function extractFormattedPhoneNumber2(text2) {
      return _extractFormattedPhoneNumber(text2, extract, v2);
    }
  });
  if (!number) {
    return {};
  }
  if (!isViablePhoneNumber(number)) {
    if (isViablePhoneNumberStart(number)) {
      return {
        error: "TOO_SHORT"
      };
    }
    return {};
  }
  var withExtensionStripped = extractExtension(number);
  if (withExtensionStripped.ext) {
    return withExtensionStripped;
  }
  return {
    number
  };
}
function result(country2, nationalNumber, ext) {
  var result2 = {
    country: country2,
    phone: nationalNumber
  };
  if (ext) {
    result2.ext = ext;
  }
  return result2;
}
function parsePhoneNumber(formattedPhoneNumber, defaultCountry, defaultCallingCode, metadata) {
  var _extractCountryCallin = extractCountryCallingCode(parseIncompletePhoneNumber(formattedPhoneNumber), void 0, defaultCountry, defaultCallingCode, metadata.metadata), countryCallingCodeSource = _extractCountryCallin.countryCallingCodeSource, countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
  var country2;
  if (countryCallingCode) {
    metadata.selectNumberingPlan(countryCallingCode);
  } else if (number && (defaultCountry || defaultCallingCode)) {
    metadata.selectNumberingPlan(defaultCountry, defaultCallingCode);
    if (defaultCountry) {
      country2 = defaultCountry;
    } else {
      if (USE_NON_GEOGRAPHIC_COUNTRY_CODE3) {
        if (metadata.isNonGeographicCallingCode(defaultCallingCode)) {
          country2 = "001";
        }
      }
    }
    countryCallingCode = defaultCallingCode || getCountryCallingCode(defaultCountry, metadata.metadata);
  } else return {};
  if (!number) {
    return {
      countryCallingCodeSource,
      countryCallingCode
    };
  }
  var _extractNationalNumbe = extractNationalNumber(parseIncompletePhoneNumber(number), country2, metadata), nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
  var exactCountry = getCountryByCallingCode(countryCallingCode, {
    nationalNumber,
    metadata
  });
  if (exactCountry) {
    country2 = exactCountry;
    if (exactCountry === "001") {
    } else {
      metadata.selectNumberingPlan(country2);
    }
  }
  return {
    country: country2,
    countryCallingCode,
    countryCallingCodeSource,
    nationalNumber,
    carrierCode
  };
}
var MAX_INPUT_STRING_LENGTH, PHONE_NUMBER_START_PATTERN, AFTER_PHONE_NUMBER_END_PATTERN, USE_NON_GEOGRAPHIC_COUNTRY_CODE3;
var init_parse = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parse.js"() {
    init_constants();
    init_ParseError();
    init_metadata();
    init_isViablePhoneNumber();
    init_extractExtension();
    init_parseIncompletePhoneNumber();
    init_getCountryCallingCode();
    init_isPossible();
    init_PhoneNumber();
    init_matchesEntirely();
    init_extractCountryCallingCode();
    init_extractNationalNumber();
    init_getCountryByCallingCode();
    init_extractFormattedPhoneNumberFromPossibleRfc3966NumberUri();
    MAX_INPUT_STRING_LENGTH = 250;
    PHONE_NUMBER_START_PATTERN = new RegExp("[" + PLUS_CHARS + VALID_DIGITS + "]");
    AFTER_PHONE_NUMBER_END_PATTERN = new RegExp("[^" + VALID_DIGITS + "#]+$");
    USE_NON_GEOGRAPHIC_COUNTRY_CODE3 = false;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js
function _typeof4(o2) {
  "@babel/helpers - typeof";
  return _typeof4 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof4(o2);
}
function ownKeys2(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread2(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys2(Object(t2), true).forEach(function(r4) {
      _defineProperty2(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys2(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty2(e2, r3, t2) {
  return (r3 = _toPropertyKey4(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey4(t2) {
  var i2 = _toPrimitive4(t2, "string");
  return "symbol" == _typeof4(i2) ? i2 : i2 + "";
}
function _toPrimitive4(t2, r3) {
  if ("object" != _typeof4(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof4(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function parsePhoneNumberWithError(text, options, metadata) {
  return parse(text, _objectSpread2(_objectSpread2({}, options), {}, {
    v2: true
  }), metadata);
}
var init_parsePhoneNumberWithError = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.js"() {
    init_parse();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/normalizeArguments.js
function _typeof5(o2) {
  "@babel/helpers - typeof";
  return _typeof5 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof5(o2);
}
function ownKeys3(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread3(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys3(Object(t2), true).forEach(function(r4) {
      _defineProperty3(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys3(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty3(e2, r3, t2) {
  return (r3 = _toPropertyKey5(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey5(t2) {
  var i2 = _toPrimitive5(t2, "string");
  return "symbol" == _typeof5(i2) ? i2 : i2 + "";
}
function _toPrimitive5(t2, r3) {
  if ("object" != _typeof5(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof5(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function _slicedToArray2(r3, e2) {
  return _arrayWithHoles2(r3) || _iterableToArrayLimit2(r3, e2) || _unsupportedIterableToArray7(r3, e2) || _nonIterableRest2();
}
function _nonIterableRest2() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray7(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray7(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray7(r3, a2) : void 0;
  }
}
function _arrayLikeToArray7(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function _iterableToArrayLimit2(r3, l2) {
  var t2 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t2) {
    var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
    try {
      if (i2 = (t2 = t2.call(r3)).next, 0 === l2) {
        if (Object(t2) !== t2) return;
        f2 = false;
      } else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ;
    } catch (r4) {
      o2 = true, n2 = r4;
    } finally {
      try {
        if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
      } finally {
        if (o2) throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles2(r3) {
  if (Array.isArray(r3)) return r3;
}
function normalizeArguments(args) {
  var _Array$prototype$slic = Array.prototype.slice.call(args), _Array$prototype$slic2 = _slicedToArray2(_Array$prototype$slic, 4), arg_1 = _Array$prototype$slic2[0], arg_2 = _Array$prototype$slic2[1], arg_3 = _Array$prototype$slic2[2], arg_4 = _Array$prototype$slic2[3];
  var text;
  var options;
  var metadata;
  if (typeof arg_1 === "string") {
    text = arg_1;
  } else throw new TypeError("A text for parsing must be a string.");
  if (!arg_2 || typeof arg_2 === "string") {
    if (arg_4) {
      options = arg_3;
      metadata = arg_4;
    } else {
      options = void 0;
      metadata = arg_3;
    }
    if (arg_2) {
      options = _objectSpread3({
        defaultCountry: arg_2
      }, options);
    }
  } else if (isObject2(arg_2)) {
    if (arg_3) {
      options = arg_2;
      metadata = arg_3;
    } else {
      metadata = arg_2;
    }
  } else throw new Error("Invalid second argument: ".concat(arg_2));
  return {
    text,
    options,
    metadata
  };
}
var init_normalizeArguments = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/normalizeArguments.js"() {
    init_isObject();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError.js
function parsePhoneNumberWithError2() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  return parsePhoneNumberWithError(text, options, metadata);
}
var init_parsePhoneNumberWithError2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError.js"() {
    init_parsePhoneNumberWithError();
    init_normalizeArguments();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js
function _typeof6(o2) {
  "@babel/helpers - typeof";
  return _typeof6 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof6(o2);
}
function ownKeys4(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread4(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys4(Object(t2), true).forEach(function(r4) {
      _defineProperty4(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys4(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty4(e2, r3, t2) {
  return (r3 = _toPropertyKey6(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey6(t2) {
  var i2 = _toPrimitive6(t2, "string");
  return "symbol" == _typeof6(i2) ? i2 : i2 + "";
}
function _toPrimitive6(t2, r3) {
  if ("object" != _typeof6(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof6(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function parsePhoneNumber2(text, options, metadata) {
  if (options && options.defaultCountry && !isSupportedCountry(options.defaultCountry, metadata)) {
    options = _objectSpread4(_objectSpread4({}, options), {}, {
      defaultCountry: void 0
    });
  }
  try {
    return parsePhoneNumberWithError(text, options, metadata);
  } catch (error2) {
    if (error2 instanceof ParseError) {
    } else {
      throw error2;
    }
  }
}
var init_parsePhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumber_.js"() {
    init_parsePhoneNumberWithError();
    init_ParseError();
    init_metadata();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumber.js
function parsePhoneNumber3() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  return parsePhoneNumber2(text, options, metadata);
}
var init_parsePhoneNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/parsePhoneNumber.js"() {
    init_normalizeArguments();
    init_parsePhoneNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js
function _typeof7(o2) {
  "@babel/helpers - typeof";
  return _typeof7 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof7(o2);
}
function ownKeys5(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread5(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys5(Object(t2), true).forEach(function(r4) {
      _defineProperty5(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys5(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty5(e2, r3, t2) {
  return (r3 = _toPropertyKey7(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey7(t2) {
  var i2 = _toPrimitive7(t2, "string");
  return "symbol" == _typeof7(i2) ? i2 : i2 + "";
}
function _toPrimitive7(t2, r3) {
  if ("object" != _typeof7(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof7(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function isValidPhoneNumber() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  options = _objectSpread5(_objectSpread5({}, options), {}, {
    extract: false
  });
  var phoneNumber = parsePhoneNumber2(text, options, metadata);
  return phoneNumber && phoneNumber.isValid() || false;
}
var init_isValidPhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isValidPhoneNumber.js"() {
    init_normalizeArguments();
    init_parsePhoneNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isPossiblePhoneNumber.js
function _typeof8(o2) {
  "@babel/helpers - typeof";
  return _typeof8 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof8(o2);
}
function ownKeys6(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread6(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys6(Object(t2), true).forEach(function(r4) {
      _defineProperty6(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys6(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty6(e2, r3, t2) {
  return (r3 = _toPropertyKey8(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey8(t2) {
  var i2 = _toPrimitive8(t2, "string");
  return "symbol" == _typeof8(i2) ? i2 : i2 + "";
}
function _toPrimitive8(t2, r3) {
  if ("object" != _typeof8(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof8(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function isPossiblePhoneNumber2() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  options = _objectSpread6(_objectSpread6({}, options), {}, {
    extract: false
  });
  var phoneNumber = parsePhoneNumber2(text, options, metadata);
  return phoneNumber && phoneNumber.isPossible() || false;
}
var init_isPossiblePhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/isPossiblePhoneNumber.js"() {
    init_normalizeArguments();
    init_parsePhoneNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/validatePhoneNumberLength.js
function _typeof9(o2) {
  "@babel/helpers - typeof";
  return _typeof9 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof9(o2);
}
function ownKeys7(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread7(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys7(Object(t2), true).forEach(function(r4) {
      _defineProperty7(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys7(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty7(e2, r3, t2) {
  return (r3 = _toPropertyKey9(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey9(t2) {
  var i2 = _toPrimitive9(t2, "string");
  return "symbol" == _typeof9(i2) ? i2 : i2 + "";
}
function _toPrimitive9(t2, r3) {
  if ("object" != _typeof9(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof9(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function validatePhoneNumberLength() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  options = _objectSpread7(_objectSpread7({}, options), {}, {
    extract: false
  });
  try {
    var phoneNumber = parsePhoneNumberWithError(text, options, metadata);
    metadata = new Metadata(metadata);
    metadata.selectNumberingPlan(phoneNumber.countryCallingCode);
    var result2 = checkNumberLength(phoneNumber.nationalNumber, phoneNumber.country, metadata);
    if (result2 !== "IS_POSSIBLE") {
      return result2;
    }
  } catch (error2) {
    if (error2 instanceof ParseError) {
      return error2.message;
    } else {
      throw error2;
    }
  }
}
var init_validatePhoneNumberLength = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/validatePhoneNumberLength.js"() {
    init_normalizeArguments();
    init_parsePhoneNumberWithError();
    init_ParseError();
    init_metadata();
    init_checkNumberLength();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/LRUCache.js
function _typeof10(o2) {
  "@babel/helpers - typeof";
  return _typeof10 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof10(o2);
}
function _defineProperties4(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey10(o2.key), o2);
  }
}
function _createClass4(e2, r3, t2) {
  return r3 && _defineProperties4(e2.prototype, r3), t2 && _defineProperties4(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey10(t2) {
  var i2 = _toPrimitive10(t2, "string");
  return "symbol" == _typeof10(i2) ? i2 : i2 + "";
}
function _toPrimitive10(t2, r3) {
  if ("object" != _typeof10(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof10(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function _classCallCheck4(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
var Node2, LRUCache;
var init_LRUCache = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/LRUCache.js"() {
    Node2 = /* @__PURE__ */ _createClass4(function Node3(key, value) {
      var next = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
      var prev = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
      _classCallCheck4(this, Node3);
      this.key = key;
      this.value = value;
      this.next = next;
      this.prev = prev;
    });
    LRUCache = /* @__PURE__ */ (function() {
      function LRUCache2() {
        var limit2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 10;
        _classCallCheck4(this, LRUCache2);
        this.size = 0;
        this.limit = limit2;
        this.head = null;
        this.tail = null;
        this.cache = {};
      }
      return _createClass4(LRUCache2, [{
        key: "put",
        value: function put(key, value) {
          this.ensureLimit();
          if (!this.head) {
            this.head = this.tail = new Node2(key, value);
          } else {
            var node = new Node2(key, value, this.head);
            this.head.prev = node;
            this.head = node;
          }
          this.cache[key] = this.head;
          this.size++;
        }
        // Read from cache map and make that node as new Head of LinkedList
      }, {
        key: "get",
        value: function get(key) {
          if (this.cache[key]) {
            var value = this.cache[key].value;
            this.remove(key);
            this.put(key, value);
            return value;
          }
          console.log("Item not available in cache for key ".concat(key));
        }
      }, {
        key: "ensureLimit",
        value: function ensureLimit() {
          if (this.size === this.limit) {
            this.remove(this.tail.key);
          }
        }
      }, {
        key: "remove",
        value: function remove(key) {
          var node = this.cache[key];
          if (node.prev !== null) {
            node.prev.next = node.next;
          } else {
            this.head = node.next;
          }
          if (node.next !== null) {
            node.next.prev = node.prev;
          } else {
            this.tail = node.prev;
          }
          delete this.cache[key];
          this.size--;
        }
      }, {
        key: "clear",
        value: function clear() {
          this.head = null;
          this.tail = null;
          this.size = 0;
          this.cache = {};
        }
        // // Invokes the callback function with every node of the chain and the index of the node.
        // forEach(fn) {
        //   let node = this.head;
        //   let counter = 0;
        //   while (node) {
        //     fn(node, counter);
        //     node = node.next;
        //     counter++;
        //   }
        // }
        // // To iterate over LRU with a 'for...of' loop
        // *[Symbol.iterator]() {
        //   let node = this.head;
        //   while (node) {
        //     yield node;
        //     node = node.next;
        //   }
        // }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/RegExpCache.js
function _typeof11(o2) {
  "@babel/helpers - typeof";
  return _typeof11 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof11(o2);
}
function _classCallCheck5(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties5(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey11(o2.key), o2);
  }
}
function _createClass5(e2, r3, t2) {
  return r3 && _defineProperties5(e2.prototype, r3), t2 && _defineProperties5(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey11(t2) {
  var i2 = _toPrimitive11(t2, "string");
  return "symbol" == _typeof11(i2) ? i2 : i2 + "";
}
function _toPrimitive11(t2, r3) {
  if ("object" != _typeof11(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof11(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
var RegExpCache;
var init_RegExpCache = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/RegExpCache.js"() {
    init_LRUCache();
    RegExpCache = /* @__PURE__ */ (function() {
      function RegExpCache2(size) {
        _classCallCheck5(this, RegExpCache2);
        this.cache = new LRUCache(size);
      }
      return _createClass5(RegExpCache2, [{
        key: "getPatternForRegExp",
        value: function getPatternForRegExp(pattern) {
          var regExp = this.cache.get(pattern);
          if (!regExp) {
            regExp = new RegExp("^" + pattern);
            this.cache.put(pattern, regExp);
          }
          return regExp;
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/util.js
function limit(lower, upper) {
  if (lower < 0 || upper <= 0 || upper < lower) {
    throw new TypeError();
  }
  return "{".concat(lower, ",").concat(upper, "}");
}
function trimAfterFirstMatch(regexp, string) {
  var index = string.search(regexp);
  if (index >= 0) {
    return string.slice(0, index);
  }
  return string;
}
function startsWith(string, substring) {
  return string.indexOf(substring) === 0;
}
function endsWith(string, substring) {
  return string.indexOf(substring, string.length - substring.length) === string.length - substring.length;
}
var init_util = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/util.js"() {
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/utf-8.js
function isLatinLetter(letter) {
  if (!pL_regexp.test(letter) && !pMn_regexp.test(letter)) {
    return false;
  }
  return latinLetterRegexp.test(letter);
}
function isInvalidPunctuationSymbol(character) {
  return character === "%" || pSc_regexp.test(character);
}
var _pZ, pZ, PZ, _pN, _pNd, pNd, _pL, pL, pL_regexp, _pSc, pSc, pSc_regexp, _pMn, pMn, pMn_regexp, _InBasic_Latin, _InLatin_1_Supplement, _InLatin_Extended_A, _InLatin_Extended_Additional, _InLatin_Extended_B, _InCombining_Diacritical_Marks, latinLetterRegexp;
var init_utf_8 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/utf-8.js"() {
    _pZ = " \xA0\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000";
    pZ = "[".concat(_pZ, "]");
    PZ = "[^".concat(_pZ, "]");
    _pN = "0-9\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19";
    _pNd = "0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19";
    pNd = "[".concat(_pNd, "]");
    _pL = "A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
    pL = "[".concat(_pL, "]");
    pL_regexp = new RegExp(pL);
    _pSc = "$\xA2-\xA5\u058F\u060B\u09F2\u09F3\u09FB\u0AF1\u0BF9\u0E3F\u17DB\u20A0-\u20B9\uA838\uFDFC\uFE69\uFF04\uFFE0\uFFE1\uFFE5\uFFE6";
    pSc = "[".concat(_pSc, "]");
    pSc_regexp = new RegExp(pSc);
    _pMn = "\u0300-\u036F\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0902\u093A\u093C\u0941-\u0948\u094D\u0951-\u0957\u0962\u0963\u0981\u09BC\u09C1-\u09C4\u09CD\u09E2\u09E3\u0A01\u0A02\u0A3C\u0A41\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81\u0A82\u0ABC\u0AC1-\u0AC5\u0AC7\u0AC8\u0ACD\u0AE2\u0AE3\u0B01\u0B3C\u0B3F\u0B41-\u0B44\u0B4D\u0B56\u0B62\u0B63\u0B82\u0BC0\u0BCD\u0C3E-\u0C40\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0CBC\u0CBF\u0CC6\u0CCC\u0CCD\u0CE2\u0CE3\u0D41-\u0D44\u0D4D\u0D62\u0D63\u0DCA\u0DD2-\u0DD4\u0DD6\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F71-\u0F7E\u0F80-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102D-\u1030\u1032-\u1037\u1039\u103A\u103D\u103E\u1058\u1059\u105E-\u1060\u1071-\u1074\u1082\u1085\u1086\u108D\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4\u17B5\u17B7-\u17BD\u17C6\u17C9-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193B\u1A17\u1A18\u1A56\u1A58-\u1A5E\u1A60\u1A62\u1A65-\u1A6C\u1A73-\u1A7C\u1A7F\u1B00-\u1B03\u1B34\u1B36-\u1B3A\u1B3C\u1B42\u1B6B-\u1B73\u1B80\u1B81\u1BA2-\u1BA5\u1BA8\u1BA9\u1BAB\u1BE6\u1BE8\u1BE9\u1BED\u1BEF-\u1BF1\u1C2C-\u1C33\u1C36\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE0\u1CE2-\u1CE8\u1CED\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302D\u3099\u309A\uA66F\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA825\uA826\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA951\uA980-\uA982\uA9B3\uA9B6-\uA9B9\uA9BC\uAA29-\uAA2E\uAA31\uAA32\uAA35\uAA36\uAA43\uAA4C\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEC\uAAED\uAAF6\uABE5\uABE8\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26";
    pMn = "[".concat(_pMn, "]");
    pMn_regexp = new RegExp(pMn);
    _InBasic_Latin = "\0-\x7F";
    _InLatin_1_Supplement = "\x80-\xFF";
    _InLatin_Extended_A = "\u0100-\u017F";
    _InLatin_Extended_Additional = "\u1E00-\u1EFF";
    _InLatin_Extended_B = "\u0180-\u024F";
    _InCombining_Diacritical_Marks = "\u0300-\u036F";
    latinLetterRegexp = new RegExp("[" + _InBasic_Latin + _InLatin_1_Supplement + _InLatin_Extended_A + _InLatin_Extended_Additional + _InLatin_Extended_B + _InCombining_Diacritical_Marks + "]");
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js
function matchPhoneNumberStringAgainstPhoneNumber(phoneNumberString, phoneNumber, metadata) {
  var phoneNumberStringContainsCallingCode = true;
  var parsedPhoneNumber = parsePhoneNumber3(phoneNumberString, metadata);
  if (!parsedPhoneNumber) {
    phoneNumberStringContainsCallingCode = false;
    parsedPhoneNumber = parsePhoneNumber3(phoneNumberString, {
      defaultCallingCode: phoneNumber.countryCallingCode
    }, metadata);
  }
  if (!parsedPhoneNumber) {
    return "INVALID_NUMBER";
  }
  if (phoneNumber.ext) {
    if (parsedPhoneNumber.ext !== phoneNumber.ext) {
      return "NO_MATCH";
    }
  } else {
    if (parsedPhoneNumber.ext) {
      return "NO_MATCH";
    }
  }
  if (phoneNumberStringContainsCallingCode) {
    if (phoneNumber.countryCallingCode !== parsedPhoneNumber.countryCallingCode) {
      return "NO_MATCH";
    }
  }
  if (phoneNumber.number === parsedPhoneNumber.number) {
    if (phoneNumberStringContainsCallingCode) {
      return "EXACT_MATCH";
    } else {
      return "NSN_MATCH";
    }
  }
  if (phoneNumber.nationalNumber.indexOf(parsedPhoneNumber.nationalNumber) === 0 || parsedPhoneNumber.nationalNumber.indexOf(phoneNumber.nationalNumber) === 0) {
    return "SHORT_NSN_MATCH";
  }
  return "NO_MATCH";
}
var init_matchPhoneNumberStringAgainstPhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/matchPhoneNumberStringAgainstPhoneNumber.js"() {
    init_parsePhoneNumber2();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/Leniency.js
function _createForOfIteratorHelperLoose7(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray8(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray8(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray8(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray8(r3, a2) : void 0;
  }
}
function _arrayLikeToArray8(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function containsOnlyValidXChars(phoneNumber, candidate, metadata) {
  for (var index = 0; index < candidate.length - 1; index++) {
    var charAtIndex = candidate.charAt(index);
    if (charAtIndex === "x" || charAtIndex === "X") {
      var charAtNextIndex = candidate.charAt(index + 1);
      if (charAtNextIndex === "x" || charAtNextIndex === "X") {
        index++;
        if (matchPhoneNumberStringAgainstPhoneNumber(candidate.substring(index), phoneNumber, metadata) !== "NSN_MATCH") {
          return false;
        }
      } else {
        var ext = parseDigits(candidate.substring(index));
        if (ext) {
          if (phoneNumber.ext !== ext) {
            return false;
          }
        } else {
          if (phoneNumber.ext) {
            return false;
          }
        }
      }
    }
  }
  return true;
}
function isNationalPrefixPresentIfRequired(phoneNumber, _ref5) {
  var defaultCountry = _ref5.defaultCountry, _metadata = _ref5.metadata;
  if (phoneNumber.__countryCallingCodeSource !== "FROM_DEFAULT_COUNTRY") {
    return true;
  }
  var metadata = new Metadata(_metadata);
  metadata.selectNumberingPlan(phoneNumber.countryCallingCode);
  var phoneNumberRegion = phoneNumber.country || getCountryByCallingCode(phoneNumber.countryCallingCode, {
    nationalNumber: phoneNumber.nationalNumber,
    metadata
  });
  var nationalNumber = phoneNumber.nationalNumber;
  var format7 = chooseFormatForNumber(metadata.numberingPlan.formats(), nationalNumber);
  if (format7.nationalPrefixFormattingRule()) {
    if (metadata.numberingPlan.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
      return true;
    }
    if (!format7.usesNationalPrefix()) {
      return true;
    }
    return Boolean(phoneNumber.nationalPrefix);
  }
  return true;
}
function containsMoreThanOneSlashInNationalNumber(phoneNumber, candidate) {
  var firstSlashInBodyIndex = candidate.indexOf("/");
  if (firstSlashInBodyIndex < 0) {
    return false;
  }
  var secondSlashInBodyIndex = candidate.indexOf("/", firstSlashInBodyIndex + 1);
  if (secondSlashInBodyIndex < 0) {
    return false;
  }
  var candidateHasCountryCode = phoneNumber.__countryCallingCodeSource === "FROM_NUMBER_WITH_PLUS_SIGN" || phoneNumber.__countryCallingCodeSource === "FROM_NUMBER_WITHOUT_PLUS_SIGN";
  if (candidateHasCountryCode && parseDigits(candidate.substring(0, firstSlashInBodyIndex)) === phoneNumber.countryCallingCode) {
    return candidate.slice(secondSlashInBodyIndex + 1).indexOf("/") >= 0;
  }
  return true;
}
function checkNumberGroupingIsValid(number, candidate, metadata, checkGroups, regExpCache) {
  throw new Error("This part of code hasn't been ported");
  var normalizedCandidate = normalizeDigits(
    candidate,
    true
    /* keep non-digits */
  );
  var formattedNumberGroups = getNationalNumberGroups(metadata, number, null);
  if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {
    return true;
  }
  var alternateFormats = MetadataManager.getAlternateFormatsForCountry(number.getCountryCode());
  var nationalSignificantNumber = util.getNationalSignificantNumber(number);
  if (alternateFormats) {
    for (var _iterator = _createForOfIteratorHelperLoose7(alternateFormats.numberFormats()), _step; !(_step = _iterator()).done; ) {
      var alternateFormat = _step.value;
      if (alternateFormat.leadingDigitsPatterns().length > 0) {
        var leadingDigitsRegExp = regExpCache.getPatternForRegExp("^" + alternateFormat.leadingDigitsPatterns()[0]);
        if (!leadingDigitsRegExp.test(nationalSignificantNumber)) {
          continue;
        }
      }
      formattedNumberGroups = getNationalNumberGroups(metadata, number, alternateFormat);
      if (checkGroups(metadata, number, normalizedCandidate, formattedNumberGroups)) {
        return true;
      }
    }
  }
  return false;
}
function getNationalNumberGroups(metadata, number, formattingPattern) {
  throw new Error("This part of code hasn't been ported");
  if (formattingPattern) {
    var nationalSignificantNumber = util.getNationalSignificantNumber(number);
    return util.formatNsnUsingPattern(nationalSignificantNumber, formattingPattern, "RFC3966", metadata).split("-");
  }
  var rfc3966Format = formatNumber(number, "RFC3966", metadata);
  var endIndex = rfc3966Format.indexOf(";");
  if (endIndex < 0) {
    endIndex = rfc3966Format.length;
  }
  var startIndex = rfc3966Format.indexOf("-") + 1;
  return rfc3966Format.slice(startIndex, endIndex).split("-");
}
function allNumberGroupsAreExactlyPresent(metadata, number, normalizedCandidate, formattedNumberGroups) {
  throw new Error("This part of code hasn't been ported");
  var candidateGroups = normalizedCandidate.split(NON_DIGITS_PATTERN);
  var candidateNumberGroupIndex = number.hasExtension() ? candidateGroups.length - 2 : candidateGroups.length - 1;
  if (candidateGroups.length == 1 || candidateGroups[candidateNumberGroupIndex].contains(util.getNationalSignificantNumber(number))) {
    return true;
  }
  var formattedNumberGroupIndex = formattedNumberGroups.length - 1;
  while (formattedNumberGroupIndex > 0 && candidateNumberGroupIndex >= 0) {
    if (candidateGroups[candidateNumberGroupIndex] !== formattedNumberGroups[formattedNumberGroupIndex]) {
      return false;
    }
    formattedNumberGroupIndex--;
    candidateNumberGroupIndex--;
  }
  return candidateNumberGroupIndex >= 0 && endsWith(candidateGroups[candidateNumberGroupIndex], formattedNumberGroups[0]);
}
function allNumberGroupsRemainGrouped(metadata, number, normalizedCandidate, formattedNumberGroups) {
  throw new Error("This part of code hasn't been ported");
  var fromIndex = 0;
  if (number.getCountryCodeSource() !== CountryCodeSource.FROM_DEFAULT_COUNTRY) {
    var countryCode = String(number.getCountryCode());
    fromIndex = normalizedCandidate.indexOf(countryCode) + countryCode.length();
  }
  for (var i2 = 0; i2 < formattedNumberGroups.length; i2++) {
    fromIndex = normalizedCandidate.indexOf(formattedNumberGroups[i2], fromIndex);
    if (fromIndex < 0) {
      return false;
    }
    fromIndex += formattedNumberGroups[i2].length();
    if (i2 == 0 && fromIndex < normalizedCandidate.length()) {
      var region = util.getRegionCodeForCountryCode(number.getCountryCode());
      if (util.getNddPrefixForRegion(region, true) != null && Character.isDigit(normalizedCandidate.charAt(fromIndex))) {
        var nationalSignificantNumber = util.getNationalSignificantNumber(number);
        return startsWith(normalizedCandidate.slice(fromIndex - formattedNumberGroups[i2].length), nationalSignificantNumber);
      }
    }
  }
  return normalizedCandidate.slice(fromIndex).contains(number.getExtension());
}
var Leniency_default;
var init_Leniency = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/Leniency.js"() {
    init_parseDigits();
    init_matchPhoneNumberStringAgainstPhoneNumber();
    init_metadata();
    init_getCountryByCallingCode();
    init_format();
    init_util();
    Leniency_default = {
      /**
       * Phone numbers accepted are "possible", but not necessarily "valid".
       */
      POSSIBLE: function POSSIBLE(phoneNumber, _ref) {
        var candidate = _ref.candidate, metadata = _ref.metadata;
        return true;
      },
      /**
       * Phone numbers accepted are "possible" and "valid".
       * Numbers written in national format must have their national-prefix
       * present if it is usually written for a number of this type.
       */
      VALID: function VALID(phoneNumber, _ref2) {
        var candidate = _ref2.candidate, defaultCountry = _ref2.defaultCountry, metadata = _ref2.metadata;
        if (!phoneNumber.isValid() || !containsOnlyValidXChars(phoneNumber, candidate, metadata)) {
          return false;
        }
        return true;
      },
      /**
       * Phone numbers accepted are "valid" and
       * are grouped in a possible way for this locale. For example, a US number written as
       * "65 02 53 00 00" and "650253 0000" are not accepted at this leniency level, whereas
       * "650 253 0000", "650 2530000" or "6502530000" are.
       * Numbers with more than one '/' symbol in the national significant number
       * are also dropped at this level.
       *
       * Warning: This level might result in lower coverage especially for regions outside of
       * country code "+1". If you are not sure about which level to use,
       * email the discussion group libphonenumber-discuss@googlegroups.com.
       */
      STRICT_GROUPING: function STRICT_GROUPING(phoneNumber, _ref3) {
        var candidate = _ref3.candidate, defaultCountry = _ref3.defaultCountry, metadata = _ref3.metadata, regExpCache = _ref3.regExpCache;
        if (!phoneNumber.isValid() || !containsOnlyValidXChars(phoneNumber, candidate, metadata) || containsMoreThanOneSlashInNationalNumber(phoneNumber, candidate) || !isNationalPrefixPresentIfRequired(phoneNumber, {
          defaultCountry,
          metadata
        })) {
          return false;
        }
        return checkNumberGroupingIsValid(phoneNumber, candidate, metadata, allNumberGroupsRemainGrouped, regExpCache);
      },
      /**
       * Phone numbers accepted are "valid" and are grouped in the same way
       * that we would have formatted it, or as a single block.
       * For example, a US number written as "650 2530000" is not accepted
       * at this leniency level, whereas "650 253 0000" or "6502530000" are.
       * Numbers with more than one '/' symbol are also dropped at this level.
       *
       * Warning: This level might result in lower coverage especially for regions outside of
       * country code "+1". If you are not sure about which level to use, email the discussion group
       * libphonenumber-discuss@googlegroups.com.
       */
      EXACT_GROUPING: function EXACT_GROUPING(phoneNumber, _ref4) {
        var candidate = _ref4.candidate, defaultCountry = _ref4.defaultCountry, metadata = _ref4.metadata, regExpCache = _ref4.regExpCache;
        if (!phoneNumber.isValid() || !containsOnlyValidXChars(phoneNumber, candidate, metadata) || containsMoreThanOneSlashInNationalNumber(phoneNumber, candidate) || !isNationalPrefixPresentIfRequired(phoneNumber, {
          defaultCountry,
          metadata
        })) {
          return false;
        }
        return checkNumberGroupingIsValid(phoneNumber, candidate, metadata, allNumberGroupsAreExactlyPresent, regExpCache);
      }
    };
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/parsePreCandidate.js
function parsePreCandidate(candidate) {
  return trimAfterFirstMatch(SECOND_NUMBER_START_PATTERN, candidate);
}
var SECOND_NUMBER_START_PATTERN;
var init_parsePreCandidate = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/parsePreCandidate.js"() {
    init_util();
    SECOND_NUMBER_START_PATTERN = /[\\/] *x/;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js
function isValidPreCandidate(candidate, offset, text) {
  if (SLASH_SEPARATED_DATES.test(candidate)) {
    return false;
  }
  if (TIME_STAMPS.test(candidate)) {
    var followingText = text.slice(offset + candidate.length);
    if (TIME_STAMPS_SUFFIX_LEADING.test(followingText)) {
      return false;
    }
  }
  return true;
}
var SLASH_SEPARATED_DATES, TIME_STAMPS, TIME_STAMPS_SUFFIX_LEADING;
var init_isValidPreCandidate = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/isValidPreCandidate.js"() {
    SLASH_SEPARATED_DATES = /(?:(?:[0-3]?\d\/[01]?\d)|(?:[01]?\d\/[0-3]?\d))\/(?:[12]\d)?\d{2}/;
    TIME_STAMPS = /[12]\d{3}[-/]?[01]\d[-/]?[0-3]\d +[0-2]\d$/;
    TIME_STAMPS_SUFFIX_LEADING = /^:[0-5]\d/;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/isValidCandidate.js
function isValidCandidate(candidate, offset, text, leniency) {
  if (!MATCHING_BRACKETS_ENTIRE.test(candidate) || PUB_PAGES.test(candidate)) {
    return;
  }
  if (leniency !== "POSSIBLE") {
    if (offset > 0 && !LEAD_CLASS_LEADING.test(candidate)) {
      var previousChar = text[offset - 1];
      if (isInvalidPunctuationSymbol(previousChar) || isLatinLetter(previousChar)) {
        return false;
      }
    }
    var lastCharIndex = offset + candidate.length;
    if (lastCharIndex < text.length) {
      var nextChar = text[lastCharIndex];
      if (isInvalidPunctuationSymbol(nextChar) || isLatinLetter(nextChar)) {
        return false;
      }
    }
  }
  return true;
}
var OPENING_PARENS, CLOSING_PARENS, NON_PARENS, LEAD_CLASS, LEAD_CLASS_LEADING, BRACKET_PAIR_LIMIT, MATCHING_BRACKETS_ENTIRE, PUB_PAGES;
var init_isValidCandidate = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findNumbers/isValidCandidate.js"() {
    init_constants();
    init_util();
    init_utf_8();
    OPENING_PARENS = "(\\[\uFF08\uFF3B";
    CLOSING_PARENS = ")\\]\uFF09\uFF3D";
    NON_PARENS = "[^".concat(OPENING_PARENS).concat(CLOSING_PARENS, "]");
    LEAD_CLASS = "[".concat(OPENING_PARENS).concat(PLUS_CHARS, "]");
    LEAD_CLASS_LEADING = new RegExp("^" + LEAD_CLASS);
    BRACKET_PAIR_LIMIT = limit(0, 3);
    MATCHING_BRACKETS_ENTIRE = new RegExp("^(?:[" + OPENING_PARENS + "])?(?:" + NON_PARENS + "+[" + CLOSING_PARENS + "])?" + NON_PARENS + "+(?:[" + OPENING_PARENS + "]" + NON_PARENS + "+[" + CLOSING_PARENS + "])" + BRACKET_PAIR_LIMIT + NON_PARENS + "*$");
    PUB_PAGES = /\d{1,5}-+\d{1,5}\s{0,4}\(\d{1,4}/;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/PhoneNumberMatcher.js
function _typeof12(o2) {
  "@babel/helpers - typeof";
  return _typeof12 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof12(o2);
}
function _createForOfIteratorHelperLoose8(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray9(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray9(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray9(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray9(r3, a2) : void 0;
  }
}
function _arrayLikeToArray9(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function _classCallCheck6(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties6(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey12(o2.key), o2);
  }
}
function _createClass6(e2, r3, t2) {
  return r3 && _defineProperties6(e2.prototype, r3), t2 && _defineProperties6(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey12(t2) {
  var i2 = _toPrimitive12(t2, "string");
  return "symbol" == _typeof12(i2) ? i2 : i2 + "";
}
function _toPrimitive12(t2, r3) {
  if ("object" != _typeof12(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof12(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
var USE_NON_GEOGRAPHIC_COUNTRY_CODE4, EXTN_PATTERNS_FOR_MATCHING, INNER_MATCHES, leadLimit, punctuationLimit, digitBlockLimit, blockLimit, punctuation, digitSequence, PATTERN, UNWANTED_END_CHAR_PATTERN, MAX_SAFE_INTEGER, PhoneNumberMatcher;
var init_PhoneNumberMatcher = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/PhoneNumberMatcher.js"() {
    init_constants();
    init_createExtensionPattern();
    init_RegExpCache();
    init_util();
    init_utf_8();
    init_Leniency();
    init_parsePreCandidate();
    init_isValidPreCandidate();
    init_isValidCandidate();
    init_metadata();
    init_parsePhoneNumber2();
    USE_NON_GEOGRAPHIC_COUNTRY_CODE4 = false;
    EXTN_PATTERNS_FOR_MATCHING = createExtensionPattern("matching");
    INNER_MATCHES = [
      // Breaks on the slash - e.g. "651-234-2345/332-445-1234"
      "/+(.*)",
      // Note that the bracket here is inside the capturing group, since we consider it part of the
      // phone number. Will match a pattern like "(650) 223 3345 (754) 223 3321".
      "(\\([^(]*)",
      // Breaks on a hyphen - e.g. "12345 - 332-445-1234 is my number."
      // We require a space on either side of the hyphen for it to be considered a separator.
      "(?:".concat(pZ, "-|-").concat(pZ, ")").concat(pZ, "*(.+)"),
      // Various types of wide hyphens. Note we have decided not to enforce a space here, since it's
      // possible that it's supposed to be used to break two numbers without spaces, and we haven't
      // seen many instances of it used within a number.
      "[\u2012-\u2015\uFF0D]".concat(pZ, "*(.+)"),
      // Breaks on a full stop - e.g. "12345. 332-445-1234 is my number."
      "\\.+".concat(pZ, "*([^.]+)"),
      // Breaks on space - e.g. "3324451234 8002341234"
      "".concat(pZ, "+(").concat(PZ, "+)")
    ];
    leadLimit = limit(0, 2);
    punctuationLimit = limit(0, 4);
    digitBlockLimit = MAX_LENGTH_FOR_NSN + MAX_LENGTH_COUNTRY_CODE;
    blockLimit = limit(0, digitBlockLimit);
    punctuation = "[".concat(VALID_PUNCTUATION, "]") + punctuationLimit;
    digitSequence = pNd + limit(1, digitBlockLimit);
    PATTERN = "(?:" + LEAD_CLASS + punctuation + ")" + leadLimit + digitSequence + "(?:" + punctuation + digitSequence + ")" + blockLimit + "(?:" + EXTN_PATTERNS_FOR_MATCHING + ")?";
    UNWANTED_END_CHAR_PATTERN = new RegExp("[^".concat(_pN).concat(_pL, "#]+$"));
    MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || Math.pow(2, 53) - 1;
    PhoneNumberMatcher = /* @__PURE__ */ (function() {
      function PhoneNumberMatcher3() {
        var text = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
        var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
        var metadata = arguments.length > 2 ? arguments[2] : void 0;
        _classCallCheck6(this, PhoneNumberMatcher3);
        options = {
          v2: options.v2,
          defaultCallingCode: options.defaultCallingCode,
          defaultCountry: options.defaultCountry && isSupportedCountry(options.defaultCountry, metadata) ? options.defaultCountry : void 0,
          // Here it should've assigned a default value only if `options.leniency === undefined`.
          leniency: options.leniency || (options.extended ? "POSSIBLE" : "VALID"),
          // Here it should've assigned a default value only if `options.maxTries === undefined`.
          maxTries: options.maxTries || MAX_SAFE_INTEGER
        };
        if (!Leniency_default[options.leniency]) {
          throw new TypeError('Unknown leniency: "'.concat(options.leniency, '"'));
        }
        if (options.leniency !== "POSSIBLE" && options.leniency !== "VALID") {
          throw new TypeError('Invalid `leniency`: "'.concat(options.leniency, '". Supported values: "POSSIBLE", "VALID".'));
        }
        if (options.maxTries < 0) {
          throw new TypeError("`maxTries` must be `>= 0`");
        }
        this.text = text;
        this.options = options;
        this.metadata = metadata;
        this.leniency = Leniency_default[options.leniency];
        this.maxTries = options.maxTries;
        this.PATTERN = new RegExp(PATTERN, "ig");
        this.INNER_MATCHES = INNER_MATCHES.map(function(pattern) {
          return new RegExp(pattern, "g");
        });
        this.state = "NOT_READY";
        this.searchIndex = 0;
        this.regExpCache = new RegExpCache(32);
      }
      return _createClass6(PhoneNumberMatcher3, [{
        key: "find",
        value: function find(index) {
          this.PATTERN.lastIndex = index;
          var matches;
          while (this.maxTries > 0 && (matches = this.PATTERN.exec(this.text)) !== null) {
            var candidate = matches[0];
            var offset = matches.index;
            candidate = parsePreCandidate(candidate);
            if (isValidPreCandidate(candidate, offset, this.text)) {
              var match2 = (
                // Try to come up with a valid match given the entire candidate.
                this.parseAndVerify(candidate, offset, this.text) || this.extractInnerMatch(candidate, offset, this.text)
              );
              if (match2) {
                if (this.options.v2) {
                  return {
                    startsAt: match2.startsAt,
                    endsAt: match2.endsAt,
                    number: match2.phoneNumber
                  };
                } else {
                  var phoneNumber = match2.phoneNumber;
                  var result2 = {
                    startsAt: match2.startsAt,
                    endsAt: match2.endsAt,
                    phone: phoneNumber.nationalNumber
                  };
                  if (phoneNumber.country) {
                    if (USE_NON_GEOGRAPHIC_COUNTRY_CODE4 && country === "001") {
                      result2.countryCallingCode = phoneNumber.countryCallingCode;
                    } else {
                      result2.country = phoneNumber.country;
                    }
                  } else {
                    result2.countryCallingCode = phoneNumber.countryCallingCode;
                  }
                  if (phoneNumber.ext) {
                    result2.ext = phoneNumber.ext;
                  }
                  return result2;
                }
              }
            }
            this.maxTries--;
          }
        }
        /**
         * Attempts to extract a match from `substring`
         * if the substring itself does not qualify as a match.
         */
      }, {
        key: "extractInnerMatch",
        value: function extractInnerMatch(substring, offset, text) {
          for (var _iterator = _createForOfIteratorHelperLoose8(this.INNER_MATCHES), _step; !(_step = _iterator()).done; ) {
            var innerMatchRegExp = _step.value;
            innerMatchRegExp.lastIndex = 0;
            var isFirstMatch = true;
            var candidateMatch = void 0;
            while (this.maxTries > 0 && (candidateMatch = innerMatchRegExp.exec(substring)) !== null) {
              if (isFirstMatch) {
                var _candidate = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, substring.slice(0, candidateMatch.index));
                var _match2 = this.parseAndVerify(_candidate, offset, text);
                if (_match2) {
                  return _match2;
                }
                this.maxTries--;
                isFirstMatch = false;
              }
              var candidate = trimAfterFirstMatch(UNWANTED_END_CHAR_PATTERN, candidateMatch[1]);
              var candidateIndexGuess = substring.indexOf(candidate, candidateMatch.index);
              var match2 = this.parseAndVerify(candidate, offset + candidateIndexGuess, text);
              if (match2) {
                return match2;
              }
              this.maxTries--;
            }
          }
        }
        /**
         * Parses a phone number from the `candidate` using `parse` and
         * verifies it matches the requested `leniency`. If parsing and verification succeed,
         * a corresponding `PhoneNumberMatch` is returned, otherwise this method returns `null`.
         *
         * @param candidate  the candidate match
         * @param offset  the offset of {@code candidate} within {@link #text}
         * @return  the parsed and validated phone number match, or null
         */
      }, {
        key: "parseAndVerify",
        value: function parseAndVerify(candidate, offset, text) {
          if (!isValidCandidate(candidate, offset, text, this.options.leniency)) {
            return;
          }
          var phoneNumber = parsePhoneNumber3(candidate, {
            extended: true,
            defaultCountry: this.options.defaultCountry,
            defaultCallingCode: this.options.defaultCallingCode
          }, this.metadata);
          if (!phoneNumber) {
            return;
          }
          if (!phoneNumber.isPossible()) {
            return;
          }
          if (this.leniency(phoneNumber, {
            candidate,
            defaultCountry: this.options.defaultCountry,
            metadata: this.metadata,
            regExpCache: this.regExpCache
          })) {
            return {
              startsAt: offset,
              endsAt: offset + candidate.length,
              phoneNumber
            };
          }
        }
      }, {
        key: "hasNext",
        value: function hasNext() {
          if (this.state === "NOT_READY") {
            this.lastMatch = this.find(this.searchIndex);
            if (this.lastMatch) {
              this.searchIndex = this.lastMatch.endsAt;
              this.state = "READY";
            } else {
              this.state = "DONE";
            }
          }
          return this.state === "READY";
        }
      }, {
        key: "next",
        value: function next() {
          if (!this.hasNext()) {
            throw new Error("No next element");
          }
          var result2 = this.lastMatch;
          this.lastMatch = null;
          this.state = "NOT_READY";
          return result2;
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/findNumbers.js
function findNumbers() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  var matcher = new PhoneNumberMatcher(text, options, metadata);
  var results = [];
  while (matcher.hasNext()) {
    results.push(matcher.next());
  }
  return results;
}
var init_findNumbers = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/findNumbers.js"() {
    init_PhoneNumberMatcher();
    init_normalizeArguments();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/searchNumbers.js
function _typeof13(o2) {
  "@babel/helpers - typeof";
  return _typeof13 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof13(o2);
}
function _defineProperty8(e2, r3, t2) {
  return (r3 = _toPropertyKey13(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey13(t2) {
  var i2 = _toPrimitive13(t2, "string");
  return "symbol" == _typeof13(i2) ? i2 : i2 + "";
}
function _toPrimitive13(t2, r3) {
  if ("object" != _typeof13(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof13(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function searchNumbers() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  var matcher = new PhoneNumberMatcher(text, options, metadata);
  return _defineProperty8({}, Symbol.iterator, function() {
    return {
      next: function next() {
        if (matcher.hasNext()) {
          return {
            done: false,
            value: matcher.next()
          };
        }
        return {
          done: true
        };
      }
    };
  });
}
var init_searchNumbers = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/searchNumbers.js"() {
    init_normalizeArguments();
    init_PhoneNumberMatcher();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findPhoneNumbersInText.js
function _typeof14(o2) {
  "@babel/helpers - typeof";
  return _typeof14 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof14(o2);
}
function ownKeys8(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread8(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys8(Object(t2), true).forEach(function(r4) {
      _defineProperty9(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys8(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty9(e2, r3, t2) {
  return (r3 = _toPropertyKey14(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey14(t2) {
  var i2 = _toPrimitive14(t2, "string");
  return "symbol" == _typeof14(i2) ? i2 : i2 + "";
}
function _toPrimitive14(t2, r3) {
  if ("object" != _typeof14(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof14(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function findPhoneNumbersInText() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  var matcher = new PhoneNumberMatcher(text, _objectSpread8(_objectSpread8({}, options), {}, {
    v2: true
  }), metadata);
  var results = [];
  while (matcher.hasNext()) {
    results.push(matcher.next());
  }
  return results;
}
var init_findPhoneNumbersInText = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/findPhoneNumbersInText.js"() {
    init_PhoneNumberMatcher();
    init_normalizeArguments();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/searchPhoneNumbersInText.js
function _typeof15(o2) {
  "@babel/helpers - typeof";
  return _typeof15 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof15(o2);
}
function ownKeys9(e2, r3) {
  var t2 = Object.keys(e2);
  if (Object.getOwnPropertySymbols) {
    var o2 = Object.getOwnPropertySymbols(e2);
    r3 && (o2 = o2.filter(function(r4) {
      return Object.getOwnPropertyDescriptor(e2, r4).enumerable;
    })), t2.push.apply(t2, o2);
  }
  return t2;
}
function _objectSpread9(e2) {
  for (var r3 = 1; r3 < arguments.length; r3++) {
    var t2 = null != arguments[r3] ? arguments[r3] : {};
    r3 % 2 ? ownKeys9(Object(t2), true).forEach(function(r4) {
      _defineProperty10(e2, r4, t2[r4]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e2, Object.getOwnPropertyDescriptors(t2)) : ownKeys9(Object(t2)).forEach(function(r4) {
      Object.defineProperty(e2, r4, Object.getOwnPropertyDescriptor(t2, r4));
    });
  }
  return e2;
}
function _defineProperty10(e2, r3, t2) {
  return (r3 = _toPropertyKey15(r3)) in e2 ? Object.defineProperty(e2, r3, { value: t2, enumerable: true, configurable: true, writable: true }) : e2[r3] = t2, e2;
}
function _toPropertyKey15(t2) {
  var i2 = _toPrimitive15(t2, "string");
  return "symbol" == _typeof15(i2) ? i2 : i2 + "";
}
function _toPrimitive15(t2, r3) {
  if ("object" != _typeof15(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof15(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function searchPhoneNumbersInText() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  var matcher = new PhoneNumberMatcher(text, _objectSpread9(_objectSpread9({}, options), {}, {
    v2: true
  }), metadata);
  return _defineProperty10({}, Symbol.iterator, function() {
    return {
      next: function next() {
        if (matcher.hasNext()) {
          return {
            done: false,
            value: matcher.next()
          };
        }
        return {
          done: true
        };
      }
    };
  });
}
var init_searchPhoneNumbersInText = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/searchPhoneNumbersInText.js"() {
    init_PhoneNumberMatcher();
    init_normalizeArguments();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeState.js
function _typeof16(o2) {
  "@babel/helpers - typeof";
  return _typeof16 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof16(o2);
}
function _classCallCheck7(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties7(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey16(o2.key), o2);
  }
}
function _createClass7(e2, r3, t2) {
  return r3 && _defineProperties7(e2.prototype, r3), t2 && _defineProperties7(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey16(t2) {
  var i2 = _toPrimitive16(t2, "string");
  return "symbol" == _typeof16(i2) ? i2 : i2 + "";
}
function _toPrimitive16(t2, r3) {
  if ("object" != _typeof16(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof16(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
var AsYouTypeState;
var init_AsYouTypeState = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeState.js"() {
    AsYouTypeState = /* @__PURE__ */ (function() {
      function AsYouTypeState2(_ref) {
        var onCountryChange = _ref.onCountryChange, onCallingCodeChange = _ref.onCallingCodeChange;
        _classCallCheck7(this, AsYouTypeState2);
        this.onCountryChange = onCountryChange;
        this.onCallingCodeChange = onCallingCodeChange;
      }
      return _createClass7(AsYouTypeState2, [{
        key: "reset",
        value: function reset(_ref2) {
          var country2 = _ref2.country, callingCode = _ref2.callingCode;
          this.international = false;
          this.missingPlus = false;
          this.IDDPrefix = void 0;
          this.callingCode = void 0;
          this.digits = "";
          this.resetNationalSignificantNumber();
          this.initCountryAndCallingCode(country2, callingCode);
        }
      }, {
        key: "resetNationalSignificantNumber",
        value: function resetNationalSignificantNumber() {
          this.nationalSignificantNumber = this.getNationalDigits();
          this.nationalSignificantNumberIsModified = false;
          this.nationalPrefix = void 0;
          this.carrierCode = void 0;
          this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = void 0;
        }
      }, {
        key: "update",
        value: function update2(properties) {
          for (var _i = 0, _Object$keys = Object.keys(properties); _i < _Object$keys.length; _i++) {
            var key = _Object$keys[_i];
            this[key] = properties[key];
          }
        }
      }, {
        key: "initCountryAndCallingCode",
        value: function initCountryAndCallingCode(country2, callingCode) {
          this.setCountry(country2);
          this.setCallingCode(callingCode);
        }
      }, {
        key: "setCountry",
        value: function setCountry(country2) {
          this.country = country2;
          this.onCountryChange(country2);
        }
      }, {
        key: "setCallingCode",
        value: function setCallingCode(callingCode) {
          this.callingCode = callingCode;
          this.onCallingCodeChange(callingCode, this.country);
        }
      }, {
        key: "startInternationalNumber",
        value: function startInternationalNumber(country2, callingCode) {
          this.international = true;
          this.initCountryAndCallingCode(country2, callingCode);
        }
      }, {
        key: "appendDigits",
        value: function appendDigits(nextDigits) {
          this.digits += nextDigits;
        }
      }, {
        key: "appendNationalSignificantNumberDigits",
        value: function appendNationalSignificantNumberDigits(nextDigits) {
          this.nationalSignificantNumber += nextDigits;
        }
        /**
         * Returns the part of `this.digits` that corresponds to the national number.
         * Basically, all digits that have been input by the user, except for the
         * international prefix and the country calling code part
         * (if the number is an international one).
         * @return {string}
         */
      }, {
        key: "getNationalDigits",
        value: function getNationalDigits() {
          if (this.international) {
            return this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0));
          }
          return this.digits;
        }
      }, {
        key: "getDigitsWithoutInternationalPrefix",
        value: function getDigitsWithoutInternationalPrefix() {
          if (this.international) {
            if (this.IDDPrefix) {
              return this.digits.slice(this.IDDPrefix.length);
            }
          }
          return this.digits;
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js
function _createForOfIteratorHelperLoose9(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray10(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray10(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray10(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray10(r3, a2) : void 0;
  }
}
function _arrayLikeToArray10(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function repeat(string, times) {
  if (times < 1) {
    return "";
  }
  var result2 = "";
  while (times > 1) {
    if (times & 1) {
      result2 += string;
    }
    times >>= 1;
    string += string;
  }
  return result2 + string;
}
function cutAndStripNonPairedParens(string, cutBeforeIndex) {
  if (string[cutBeforeIndex] === ")") {
    cutBeforeIndex++;
  }
  return stripNonPairedParens(string.slice(0, cutBeforeIndex));
}
function stripNonPairedParens(string) {
  var dangling_braces = [];
  var i2 = 0;
  while (i2 < string.length) {
    if (string[i2] === "(") {
      dangling_braces.push(i2);
    } else if (string[i2] === ")") {
      dangling_braces.pop();
    }
    i2++;
  }
  var start = 0;
  var cleared_string = "";
  dangling_braces.push(string.length);
  for (var _i = 0, _dangling_braces = dangling_braces; _i < _dangling_braces.length; _i++) {
    var index = _dangling_braces[_i];
    cleared_string += string.slice(start, index);
    start = index + 1;
  }
  return cleared_string;
}
function populateTemplateWithDigits(template, position, digits) {
  for (var _iterator2 = _createForOfIteratorHelperLoose9(digits.split("")), _step2; !(_step2 = _iterator2()).done; ) {
    var digit = _step2.value;
    if (template.slice(position + 1).search(DIGIT_PLACEHOLDER_MATCHER) < 0) {
      return;
    }
    position = template.search(DIGIT_PLACEHOLDER_MATCHER);
    template = template.replace(DIGIT_PLACEHOLDER_MATCHER, digit);
  }
  return [template, position];
}
var DIGIT_PLACEHOLDER, DIGIT_PLACEHOLDER_MATCHER;
var init_AsYouTypeFormatter_util = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.js"() {
    DIGIT_PLACEHOLDER = "x";
    DIGIT_PLACEHOLDER_MATCHER = new RegExp(DIGIT_PLACEHOLDER);
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js
function formatCompleteNumber(state, format7, _ref) {
  var metadata = _ref.metadata, shouldTryNationalPrefixFormattingRule = _ref.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref.getSeparatorAfterNationalPrefix;
  var matcher = new RegExp("^(?:".concat(format7.pattern(), ")$"));
  if (matcher.test(state.nationalSignificantNumber)) {
    return formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format7, {
      metadata,
      shouldTryNationalPrefixFormattingRule,
      getSeparatorAfterNationalPrefix
    });
  }
}
function canFormatCompleteNumber(nationalSignificantNumber, country2, metadata) {
  return checkNumberLength(nationalSignificantNumber, country2, metadata) === "IS_POSSIBLE";
}
function formatNationalNumberWithAndWithoutNationalPrefixFormattingRule(state, format7, _ref2) {
  var metadata = _ref2.metadata, shouldTryNationalPrefixFormattingRule = _ref2.shouldTryNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref2.getSeparatorAfterNationalPrefix;
  var nationalSignificantNumber = state.nationalSignificantNumber, international = state.international, nationalPrefix = state.nationalPrefix, carrierCode = state.carrierCode;
  if (shouldTryNationalPrefixFormattingRule(format7)) {
    var formattedNumber = formatNationalNumber2(state, format7, {
      useNationalPrefixFormattingRule: true,
      getSeparatorAfterNationalPrefix,
      metadata
    });
    if (formattedNumber) {
      return formattedNumber;
    }
  }
  return formatNationalNumber2(state, format7, {
    useNationalPrefixFormattingRule: false,
    getSeparatorAfterNationalPrefix,
    metadata
  });
}
function formatNationalNumber2(state, format7, _ref3) {
  var metadata = _ref3.metadata, useNationalPrefixFormattingRule = _ref3.useNationalPrefixFormattingRule, getSeparatorAfterNationalPrefix = _ref3.getSeparatorAfterNationalPrefix;
  var formattedNationalNumber = formatNationalNumberUsingFormat(state.nationalSignificantNumber, format7, {
    carrierCode: state.carrierCode,
    useInternationalFormat: state.international,
    withNationalPrefix: useNationalPrefixFormattingRule,
    metadata
  });
  if (!useNationalPrefixFormattingRule) {
    if (state.nationalPrefix) {
      formattedNationalNumber = state.nationalPrefix + getSeparatorAfterNationalPrefix(format7) + formattedNationalNumber;
    } else if (state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {
      formattedNationalNumber = state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix + " " + formattedNationalNumber;
    }
  }
  if (isValidFormattedNationalNumber(formattedNationalNumber, state)) {
    return formattedNationalNumber;
  }
}
function isValidFormattedNationalNumber(formattedNationalNumber, state) {
  return parseDigits(formattedNationalNumber) === state.getNationalDigits();
}
var init_AsYouTypeFormatter_complete = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.js"() {
    init_checkNumberLength();
    init_parseDigits();
    init_formatNationalNumberUsingFormat();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js
function _typeof17(o2) {
  "@babel/helpers - typeof";
  return _typeof17 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof17(o2);
}
function _classCallCheck8(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties8(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey17(o2.key), o2);
  }
}
function _createClass8(e2, r3, t2) {
  return r3 && _defineProperties8(e2.prototype, r3), t2 && _defineProperties8(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey17(t2) {
  var i2 = _toPrimitive17(t2, "string");
  return "symbol" == _typeof17(i2) ? i2 : i2 + "";
}
function _toPrimitive17(t2, r3) {
  if ("object" != _typeof17(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof17(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function parseOneOfSet(pattern) {
  var values = [];
  var i2 = 0;
  while (i2 < pattern.length) {
    if (pattern[i2] === "-") {
      if (i2 === 0 || i2 === pattern.length - 1) {
        throw new Error("Couldn't parse a one-of set pattern: ".concat(pattern));
      }
      var prevValue = pattern[i2 - 1].charCodeAt(0) + 1;
      var nextValue = pattern[i2 + 1].charCodeAt(0) - 1;
      var value = prevValue;
      while (value <= nextValue) {
        values.push(String.fromCharCode(value));
        value++;
      }
    } else {
      values.push(pattern[i2]);
    }
    i2++;
  }
  return values;
}
function expandSingleElementArray(array) {
  if (array.length === 1) {
    return array[0];
  }
  return array;
}
var PatternParser, ILLEGAL_CHARACTER_REGEXP, OPERATOR;
var init_AsYouTypeFormatter_PatternParser = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.js"() {
    PatternParser = /* @__PURE__ */ (function() {
      function PatternParser2() {
        _classCallCheck8(this, PatternParser2);
      }
      return _createClass8(PatternParser2, [{
        key: "parse",
        value: function parse3(pattern) {
          this.context = [{
            or: true,
            instructions: []
          }];
          this.parsePattern(pattern);
          if (this.context.length !== 1) {
            throw new Error("Non-finalized contexts left when pattern parse ended");
          }
          var _this$context$ = this.context[0], branches = _this$context$.branches, instructions = _this$context$.instructions;
          if (branches) {
            return {
              op: "|",
              args: branches.concat([expandSingleElementArray(instructions)])
            };
          }
          if (instructions.length === 0) {
            throw new Error("Pattern is required");
          }
          if (instructions.length === 1) {
            return instructions[0];
          }
          return instructions;
        }
      }, {
        key: "startContext",
        value: function startContext(context) {
          this.context.push(context);
        }
      }, {
        key: "endContext",
        value: function endContext() {
          this.context.pop();
        }
      }, {
        key: "getContext",
        value: function getContext() {
          return this.context[this.context.length - 1];
        }
      }, {
        key: "parsePattern",
        value: function parsePattern(pattern) {
          if (!pattern) {
            throw new Error("Pattern is required");
          }
          var match2 = pattern.match(OPERATOR);
          if (!match2) {
            if (ILLEGAL_CHARACTER_REGEXP.test(pattern)) {
              throw new Error("Illegal characters found in a pattern: ".concat(pattern));
            }
            this.getContext().instructions = this.getContext().instructions.concat(pattern.split(""));
            return;
          }
          var operator = match2[1];
          var before = pattern.slice(0, match2.index);
          var rightPart = pattern.slice(match2.index + operator.length);
          switch (operator) {
            case "(?:":
              if (before) {
                this.parsePattern(before);
              }
              this.startContext({
                or: true,
                instructions: [],
                branches: []
              });
              break;
            case ")":
              if (!this.getContext().or) {
                throw new Error('")" operator must be preceded by "(?:" operator');
              }
              if (before) {
                this.parsePattern(before);
              }
              if (this.getContext().instructions.length === 0) {
                throw new Error('No instructions found after "|" operator in an "or" group');
              }
              var _this$getContext = this.getContext(), branches = _this$getContext.branches;
              branches.push(expandSingleElementArray(this.getContext().instructions));
              this.endContext();
              this.getContext().instructions.push({
                op: "|",
                args: branches
              });
              break;
            case "|":
              if (!this.getContext().or) {
                throw new Error('"|" operator can only be used inside "or" groups');
              }
              if (before) {
                this.parsePattern(before);
              }
              if (!this.getContext().branches) {
                if (this.context.length === 1) {
                  this.getContext().branches = [];
                } else {
                  throw new Error('"branches" not found in an "or" group context');
                }
              }
              this.getContext().branches.push(expandSingleElementArray(this.getContext().instructions));
              this.getContext().instructions = [];
              break;
            case "[":
              if (before) {
                this.parsePattern(before);
              }
              this.startContext({
                oneOfSet: true
              });
              break;
            case "]":
              if (!this.getContext().oneOfSet) {
                throw new Error('"]" operator must be preceded by "[" operator');
              }
              this.endContext();
              this.getContext().instructions.push({
                op: "[]",
                args: parseOneOfSet(before)
              });
              break;
            /* istanbul ignore next */
            default:
              throw new Error("Unknown operator: ".concat(operator));
          }
          if (rightPart) {
            this.parsePattern(rightPart);
          }
        }
      }]);
    })();
    ILLEGAL_CHARACTER_REGEXP = /[\(\)\[\]\?\:\|]/;
    OPERATOR = new RegExp(
      // any of:
      "(\\||\\(\\?\\:|\\)|\\[|\\])"
    );
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js
function _createForOfIteratorHelperLoose10(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray11(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray11(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray11(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray11(r3, a2) : void 0;
  }
}
function _arrayLikeToArray11(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function _typeof18(o2) {
  "@babel/helpers - typeof";
  return _typeof18 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof18(o2);
}
function _classCallCheck9(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties9(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey18(o2.key), o2);
  }
}
function _createClass9(e2, r3, t2) {
  return r3 && _defineProperties9(e2.prototype, r3), t2 && _defineProperties9(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey18(t2) {
  var i2 = _toPrimitive18(t2, "string");
  return "symbol" == _typeof18(i2) ? i2 : i2 + "";
}
function _toPrimitive18(t2, r3) {
  if ("object" != _typeof18(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof18(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function _match(characters, tree, last) {
  if (typeof tree === "string") {
    var characterString = characters.join("");
    if (tree.indexOf(characterString) === 0) {
      if (characters.length === tree.length) {
        return {
          match: true,
          matchedChars: characters
        };
      }
      return {
        partialMatch: true
        // matchedChars: characters
      };
    }
    if (characterString.indexOf(tree) === 0) {
      if (last) {
        if (characters.length > tree.length) {
          return {
            overflow: true
          };
        }
      }
      return {
        match: true,
        matchedChars: characters.slice(0, tree.length)
      };
    }
    return;
  }
  if (Array.isArray(tree)) {
    var restCharacters = characters.slice();
    var i2 = 0;
    while (i2 < tree.length) {
      var subtree = tree[i2];
      var result2 = _match(restCharacters, subtree, last && i2 === tree.length - 1);
      if (!result2) {
        return;
      } else if (result2.overflow) {
        return result2;
      } else if (result2.match) {
        restCharacters = restCharacters.slice(result2.matchedChars.length);
        if (restCharacters.length === 0) {
          if (i2 === tree.length - 1) {
            return {
              match: true,
              matchedChars: characters
            };
          } else {
            return {
              partialMatch: true
              // matchedChars: characters
            };
          }
        }
      } else {
        if (result2.partialMatch) {
          return {
            partialMatch: true
            // matchedChars: characters
          };
        } else {
          throw new Error("Unsupported match result:\n".concat(JSON.stringify(result2, null, 2)));
        }
      }
      i2++;
    }
    if (last) {
      return {
        overflow: true
      };
    }
    return {
      match: true,
      matchedChars: characters.slice(0, characters.length - restCharacters.length)
    };
  }
  switch (tree.op) {
    case "|":
      var partialMatch;
      for (var _iterator = _createForOfIteratorHelperLoose10(tree.args), _step; !(_step = _iterator()).done; ) {
        var branch = _step.value;
        var _result = _match(characters, branch, last);
        if (_result) {
          if (_result.overflow) {
            return _result;
          } else if (_result.match) {
            return {
              match: true,
              matchedChars: _result.matchedChars
            };
          } else {
            if (_result.partialMatch) {
              partialMatch = true;
            } else {
              throw new Error("Unsupported match result:\n".concat(JSON.stringify(_result, null, 2)));
            }
          }
        }
      }
      if (partialMatch) {
        return {
          partialMatch: true
          // matchedChars: ...
        };
      }
      return;
    case "[]":
      for (var _iterator2 = _createForOfIteratorHelperLoose10(tree.args), _step2; !(_step2 = _iterator2()).done; ) {
        var _char = _step2.value;
        if (characters[0] === _char) {
          if (characters.length === 1) {
            return {
              match: true,
              matchedChars: characters
            };
          }
          if (last) {
            return {
              overflow: true
            };
          }
          return {
            match: true,
            matchedChars: [_char]
          };
        }
      }
      return;
    /* istanbul ignore next */
    default:
      throw new Error("Unsupported instruction tree: ".concat(tree));
  }
}
var PatternMatcher;
var init_AsYouTypeFormatter_PatternMatcher = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.js"() {
    init_AsYouTypeFormatter_PatternParser();
    PatternMatcher = /* @__PURE__ */ (function() {
      function PatternMatcher2(pattern) {
        _classCallCheck9(this, PatternMatcher2);
        this.matchTree = new PatternParser().parse(pattern);
      }
      return _createClass9(PatternMatcher2, [{
        key: "match",
        value: function match2(string) {
          var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, allowOverflow = _ref.allowOverflow;
          if (!string) {
            throw new Error("String is required");
          }
          var result2 = _match(string.split(""), this.matchTree, true);
          if (result2 && result2.match) {
            delete result2.matchedChars;
          }
          if (result2 && result2.overflow) {
            if (!allowOverflow) {
              return;
            }
          }
          return result2;
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js
function _typeof19(o2) {
  "@babel/helpers - typeof";
  return _typeof19 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof19(o2);
}
function _createForOfIteratorHelperLoose11(r3, e2) {
  var t2 = "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (t2) return (t2 = t2.call(r3)).next.bind(t2);
  if (Array.isArray(r3) || (t2 = _unsupportedIterableToArray12(r3)) || e2 && r3 && "number" == typeof r3.length) {
    t2 && (r3 = t2);
    var o2 = 0;
    return function() {
      return o2 >= r3.length ? { done: true } : { done: false, value: r3[o2++] };
    };
  }
  throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray12(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray12(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray12(r3, a2) : void 0;
  }
}
function _arrayLikeToArray12(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function _classCallCheck10(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties10(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey19(o2.key), o2);
  }
}
function _createClass10(e2, r3, t2) {
  return r3 && _defineProperties10(e2.prototype, r3), t2 && _defineProperties10(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey19(t2) {
  var i2 = _toPrimitive19(t2, "string");
  return "symbol" == _typeof19(i2) ? i2 : i2 + "";
}
function _toPrimitive19(t2, r3) {
  if ("object" != _typeof19(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof19(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
var DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH, LONGEST_DUMMY_PHONE_NUMBER, NATIONAL_PREFIX_SEPARATORS_PATTERN, SUPPORT_LEGACY_FORMATTING_PATTERNS, CREATE_CHARACTER_CLASS_PATTERN, CREATE_STANDALONE_DIGIT_PATTERN, NON_ALTERING_FORMAT_REG_EXP, MIN_LEADING_DIGITS_LENGTH, AsYouTypeFormatter;
var init_AsYouTypeFormatter = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.js"() {
    init_AsYouTypeFormatter_util();
    init_AsYouTypeFormatter_complete();
    init_AsYouTypeFormatter_PatternMatcher();
    init_parseDigits();
    init_AsYouTypeFormatter_util();
    init_formatNationalNumberUsingFormat();
    init_constants();
    init_applyInternationalSeparatorStyle();
    DUMMY_DIGIT = "9";
    LONGEST_NATIONAL_PHONE_NUMBER_LENGTH = 15;
    LONGEST_DUMMY_PHONE_NUMBER = repeat(DUMMY_DIGIT, LONGEST_NATIONAL_PHONE_NUMBER_LENGTH);
    NATIONAL_PREFIX_SEPARATORS_PATTERN = /[- ]/;
    SUPPORT_LEGACY_FORMATTING_PATTERNS = true;
    CREATE_CHARACTER_CLASS_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function() {
      return /\[([^\[\]])*\]/g;
    };
    CREATE_STANDALONE_DIGIT_PATTERN = SUPPORT_LEGACY_FORMATTING_PATTERNS && function() {
      return /\d(?=[^,}][^,}])/g;
    };
    NON_ALTERING_FORMAT_REG_EXP = new RegExp("[" + VALID_PUNCTUATION + "]*\\$1[" + VALID_PUNCTUATION + "]*(\\$\\d[" + VALID_PUNCTUATION + "]*)*$");
    MIN_LEADING_DIGITS_LENGTH = 3;
    AsYouTypeFormatter = /* @__PURE__ */ (function() {
      function AsYouTypeFormatter2(_ref) {
        var state = _ref.state, metadata = _ref.metadata;
        _classCallCheck10(this, AsYouTypeFormatter2);
        this.metadata = metadata;
        this.resetFormat();
      }
      return _createClass10(AsYouTypeFormatter2, [{
        key: "resetFormat",
        value: function resetFormat() {
          this.chosenFormat = void 0;
          this.template = void 0;
          this.nationalNumberTemplate = void 0;
          this.populatedNationalNumberTemplate = void 0;
          this.populatedNationalNumberTemplatePosition = -1;
        }
      }, {
        key: "reset",
        value: function reset(numberingPlan, state) {
          this.resetFormat();
          if (numberingPlan) {
            this.isNANP = numberingPlan.callingCode() === "1";
            this.matchingFormats = numberingPlan.formats();
            if (state.nationalSignificantNumber) {
              this.narrowDownMatchingFormats(state);
            }
          } else {
            this.isNANP = void 0;
            this.matchingFormats = [];
          }
        }
        /**
         * Formats an updated phone number.
         * @param  {string} nextDigits — Additional phone number digits.
         * @param  {object} state — `AsYouType` state.
         * @return {[string]} Returns undefined if the updated phone number can't be formatted using any of the available formats.
         */
      }, {
        key: "format",
        value: function format7(nextDigits, state) {
          var _this = this;
          if (canFormatCompleteNumber(state.nationalSignificantNumber, state.country, this.metadata)) {
            for (var _iterator = _createForOfIteratorHelperLoose11(this.matchingFormats), _step; !(_step = _iterator()).done; ) {
              var _format = _step.value;
              var formattedCompleteNumber = formatCompleteNumber(state, _format, {
                metadata: this.metadata,
                shouldTryNationalPrefixFormattingRule: function shouldTryNationalPrefixFormattingRule(format8) {
                  return _this.shouldTryNationalPrefixFormattingRule(format8, {
                    international: state.international,
                    nationalPrefix: state.nationalPrefix
                  });
                },
                getSeparatorAfterNationalPrefix: function getSeparatorAfterNationalPrefix(format8) {
                  return _this.getSeparatorAfterNationalPrefix(format8);
                }
              });
              if (formattedCompleteNumber) {
                this.resetFormat();
                this.chosenFormat = _format;
                this.setNationalNumberTemplate(formattedCompleteNumber.replace(/\d/g, DIGIT_PLACEHOLDER), state);
                this.populatedNationalNumberTemplate = formattedCompleteNumber;
                this.populatedNationalNumberTemplatePosition = this.template.lastIndexOf(DIGIT_PLACEHOLDER);
                return formattedCompleteNumber;
              }
            }
          }
          return this.formatNationalNumberWithNextDigits(nextDigits, state);
        }
        // Formats the next phone number digits.
      }, {
        key: "formatNationalNumberWithNextDigits",
        value: function formatNationalNumberWithNextDigits(nextDigits, state) {
          var previouslyChosenFormat = this.chosenFormat;
          var newlyChosenFormat = this.chooseFormat(state);
          if (newlyChosenFormat) {
            if (newlyChosenFormat === previouslyChosenFormat) {
              return this.formatNextNationalNumberDigits(nextDigits);
            } else {
              return this.formatNextNationalNumberDigits(state.getNationalDigits());
            }
          }
        }
      }, {
        key: "narrowDownMatchingFormats",
        value: function narrowDownMatchingFormats(_ref2) {
          var _this2 = this;
          var nationalSignificantNumber = _ref2.nationalSignificantNumber, nationalPrefix = _ref2.nationalPrefix, international = _ref2.international;
          var leadingDigits = nationalSignificantNumber;
          var leadingDigitsPatternIndex = leadingDigits.length - MIN_LEADING_DIGITS_LENGTH;
          if (leadingDigitsPatternIndex < 0) {
            leadingDigitsPatternIndex = 0;
          }
          this.matchingFormats = this.matchingFormats.filter(function(format7) {
            return _this2.formatSuits(format7, international, nationalPrefix) && _this2.formatMatches(format7, leadingDigits, leadingDigitsPatternIndex);
          });
          if (this.chosenFormat && this.matchingFormats.indexOf(this.chosenFormat) === -1) {
            this.resetFormat();
          }
        }
      }, {
        key: "formatSuits",
        value: function formatSuits(format7, international, nationalPrefix) {
          if (nationalPrefix && !format7.usesNationalPrefix() && // !format.domesticCarrierCodeFormattingRule() &&
          !format7.nationalPrefixIsOptionalWhenFormattingInNationalFormat()) {
            return false;
          }
          if (!international && !nationalPrefix && format7.nationalPrefixIsMandatoryWhenFormattingInNationalFormat()) {
            return false;
          }
          return true;
        }
      }, {
        key: "formatMatches",
        value: function formatMatches(format7, leadingDigits, leadingDigitsPatternIndex) {
          var leadingDigitsPatternsCount = format7.leadingDigitsPatterns().length;
          if (leadingDigitsPatternsCount === 0) {
            return true;
          }
          leadingDigitsPatternIndex = Math.min(leadingDigitsPatternIndex, leadingDigitsPatternsCount - 1);
          var leadingDigitsPattern = format7.leadingDigitsPatterns()[leadingDigitsPatternIndex];
          if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
            try {
              return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {
                allowOverflow: true
              }) !== void 0;
            } catch (error2) {
              console.error(error2);
              return true;
            }
          }
          return new RegExp("^(".concat(leadingDigitsPattern, ")")).test(leadingDigits);
        }
      }, {
        key: "getFormatFormat",
        value: function getFormatFormat(format7, international) {
          return international ? format7.internationalFormat() : format7.format();
        }
      }, {
        key: "chooseFormat",
        value: function chooseFormat(state) {
          var _this3 = this;
          var _loop = function _loop2() {
            var format7 = _step2.value;
            if (_this3.chosenFormat === format7) {
              return 0;
            }
            if (!NON_ALTERING_FORMAT_REG_EXP.test(_this3.getFormatFormat(format7, state.international))) {
              return 1;
            }
            if (!_this3.createTemplateForFormat(format7, state)) {
              _this3.matchingFormats = _this3.matchingFormats.filter(function(_) {
                return _ !== format7;
              });
              return 1;
            }
            _this3.chosenFormat = format7;
            return 0;
          }, _ret;
          for (var _iterator2 = _createForOfIteratorHelperLoose11(this.matchingFormats.slice()), _step2; !(_step2 = _iterator2()).done; ) {
            _ret = _loop();
            if (_ret === 0) break;
            if (_ret === 1) continue;
          }
          if (!this.chosenFormat) {
            this.resetFormat();
          }
          return this.chosenFormat;
        }
      }, {
        key: "createTemplateForFormat",
        value: function createTemplateForFormat(format7, state) {
          if (SUPPORT_LEGACY_FORMATTING_PATTERNS && format7.pattern().indexOf("|") >= 0) {
            return;
          }
          var template = this.getTemplateForFormat(format7, state);
          if (template) {
            this.setNationalNumberTemplate(template, state);
            return true;
          }
        }
      }, {
        key: "getSeparatorAfterNationalPrefix",
        value: function getSeparatorAfterNationalPrefix(format7) {
          if (this.isNANP) {
            return " ";
          }
          if (format7 && format7.nationalPrefixFormattingRule() && NATIONAL_PREFIX_SEPARATORS_PATTERN.test(format7.nationalPrefixFormattingRule())) {
            return " ";
          }
          return "";
        }
      }, {
        key: "getInternationalPrefixBeforeCountryCallingCode",
        value: function getInternationalPrefixBeforeCountryCallingCode(_ref3, options) {
          var IDDPrefix = _ref3.IDDPrefix, missingPlus = _ref3.missingPlus;
          if (IDDPrefix) {
            return options && options.spacing === false ? IDDPrefix : IDDPrefix + " ";
          }
          if (missingPlus) {
            return "";
          }
          return "+";
        }
      }, {
        key: "getTemplate",
        value: function getTemplate(state) {
          if (!this.template) {
            return;
          }
          var index = -1;
          var i2 = 0;
          var internationalPrefix = state.international ? this.getInternationalPrefixBeforeCountryCallingCode(state, {
            spacing: false
          }) : "";
          while (i2 < internationalPrefix.length + state.getDigitsWithoutInternationalPrefix().length) {
            index = this.template.indexOf(DIGIT_PLACEHOLDER, index + 1);
            i2++;
          }
          return cutAndStripNonPairedParens(this.template, index + 1);
        }
      }, {
        key: "setNationalNumberTemplate",
        value: function setNationalNumberTemplate(template, state) {
          this.nationalNumberTemplate = template;
          this.populatedNationalNumberTemplate = template;
          this.populatedNationalNumberTemplatePosition = -1;
          if (state.international) {
            this.template = this.getInternationalPrefixBeforeCountryCallingCode(state).replace(/[\d\+]/g, DIGIT_PLACEHOLDER) + repeat(DIGIT_PLACEHOLDER, state.callingCode.length) + " " + template;
          } else {
            this.template = template;
          }
        }
        /**
         * Generates formatting template for a national phone number,
         * optionally containing a national prefix, for a format.
         * @param  {Format} format
         * @param  {string} nationalPrefix
         * @return {string}
         */
      }, {
        key: "getTemplateForFormat",
        value: function getTemplateForFormat(format7, _ref4) {
          var nationalSignificantNumber = _ref4.nationalSignificantNumber, international = _ref4.international, nationalPrefix = _ref4.nationalPrefix, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _ref4.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;
          var pattern = format7.pattern();
          if (SUPPORT_LEGACY_FORMATTING_PATTERNS) {
            pattern = pattern.replace(CREATE_CHARACTER_CLASS_PATTERN(), "\\d").replace(CREATE_STANDALONE_DIGIT_PATTERN(), "\\d");
          }
          var digits = LONGEST_DUMMY_PHONE_NUMBER.match(pattern)[0];
          if (nationalSignificantNumber.length > digits.length) {
            return;
          }
          var strictPattern = new RegExp("^" + pattern + "$");
          var nationalNumberDummyDigits = nationalSignificantNumber.replace(/\d/g, DUMMY_DIGIT);
          if (strictPattern.test(nationalNumberDummyDigits)) {
            digits = nationalNumberDummyDigits;
          }
          var numberFormat2 = this.getFormatFormat(format7, international);
          var nationalPrefixIncludedInTemplate;
          if (this.shouldTryNationalPrefixFormattingRule(format7, {
            international,
            nationalPrefix
          })) {
            var numberFormatWithNationalPrefix = numberFormat2.replace(FIRST_GROUP_PATTERN, format7.nationalPrefixFormattingRule());
            if (parseDigits(format7.nationalPrefixFormattingRule()) === (nationalPrefix || "") + parseDigits("$1")) {
              numberFormat2 = numberFormatWithNationalPrefix;
              nationalPrefixIncludedInTemplate = true;
              if (nationalPrefix) {
                var i2 = nationalPrefix.length;
                while (i2 > 0) {
                  numberFormat2 = numberFormat2.replace(/\d/, DIGIT_PLACEHOLDER);
                  i2--;
                }
              }
            }
          }
          var template = digits.replace(new RegExp(pattern), numberFormat2).replace(new RegExp(DUMMY_DIGIT, "g"), DIGIT_PLACEHOLDER);
          if (!nationalPrefixIncludedInTemplate) {
            if (prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix) {
              template = repeat(DIGIT_PLACEHOLDER, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix.length) + " " + template;
            } else if (nationalPrefix) {
              template = repeat(DIGIT_PLACEHOLDER, nationalPrefix.length) + this.getSeparatorAfterNationalPrefix(format7) + template;
            }
          }
          if (international) {
            template = applyInternationalSeparatorStyle(template);
          }
          return template;
        }
      }, {
        key: "formatNextNationalNumberDigits",
        value: function formatNextNationalNumberDigits(digits) {
          var result2 = populateTemplateWithDigits(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition, digits);
          if (!result2) {
            this.resetFormat();
            return;
          }
          this.populatedNationalNumberTemplate = result2[0];
          this.populatedNationalNumberTemplatePosition = result2[1];
          return cutAndStripNonPairedParens(this.populatedNationalNumberTemplate, this.populatedNationalNumberTemplatePosition + 1);
        }
      }, {
        key: "shouldTryNationalPrefixFormattingRule",
        value: function shouldTryNationalPrefixFormattingRule(format7, _ref5) {
          var international = _ref5.international, nationalPrefix = _ref5.nationalPrefix;
          if (format7.nationalPrefixFormattingRule()) {
            var usesNationalPrefix = format7.usesNationalPrefix();
            if (usesNationalPrefix && nationalPrefix || !usesNationalPrefix && !international) {
              return true;
            }
          }
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeParser.js
function _typeof20(o2) {
  "@babel/helpers - typeof";
  return _typeof20 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof20(o2);
}
function _slicedToArray3(r3, e2) {
  return _arrayWithHoles3(r3) || _iterableToArrayLimit3(r3, e2) || _unsupportedIterableToArray13(r3, e2) || _nonIterableRest3();
}
function _nonIterableRest3() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray13(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray13(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray13(r3, a2) : void 0;
  }
}
function _arrayLikeToArray13(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function _iterableToArrayLimit3(r3, l2) {
  var t2 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t2) {
    var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
    try {
      if (i2 = (t2 = t2.call(r3)).next, 0 === l2) {
        if (Object(t2) !== t2) return;
        f2 = false;
      } else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ;
    } catch (r4) {
      o2 = true, n2 = r4;
    } finally {
      try {
        if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
      } finally {
        if (o2) throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles3(r3) {
  if (Array.isArray(r3)) return r3;
}
function _classCallCheck11(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties11(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey20(o2.key), o2);
  }
}
function _createClass11(e2, r3, t2) {
  return r3 && _defineProperties11(e2.prototype, r3), t2 && _defineProperties11(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey20(t2) {
  var i2 = _toPrimitive20(t2, "string");
  return "symbol" == _typeof20(i2) ? i2 : i2 + "";
}
function _toPrimitive20(t2, r3) {
  if ("object" != _typeof20(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof20(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
function extractFormattedPhoneNumber(text) {
  var startsAt = text.search(VALID_FORMATTED_PHONE_NUMBER_PART);
  if (startsAt < 0) {
    return;
  }
  text = text.slice(startsAt);
  var hasPlus;
  if (text[0] === "+") {
    hasPlus = true;
    text = text.slice("+".length);
  }
  text = text.replace(AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, "");
  if (hasPlus) {
    text = "+" + text;
  }
  return text;
}
function _extractFormattedDigitsAndPlus(text) {
  var extractedNumber = extractFormattedPhoneNumber(text) || "";
  if (extractedNumber[0] === "+") {
    return [extractedNumber.slice("+".length), true];
  }
  return [extractedNumber];
}
function extractFormattedDigitsAndPlus(text) {
  var _extractFormattedDigi3 = _extractFormattedDigitsAndPlus(text), _extractFormattedDigi4 = _slicedToArray3(_extractFormattedDigi3, 2), formattedDigits = _extractFormattedDigi4[0], hasPlus = _extractFormattedDigi4[1];
  if (!VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN.test(formattedDigits)) {
    formattedDigits = "";
  }
  return [formattedDigits, hasPlus];
}
var VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART, VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN, VALID_FORMATTED_PHONE_NUMBER_PART, AFTER_PHONE_NUMBER_DIGITS_END_PATTERN, COMPLEX_NATIONAL_PREFIX, AsYouTypeParser;
var init_AsYouTypeParser = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouTypeParser.js"() {
    init_extractCountryCallingCode();
    init_extractCountryCallingCodeFromInternationalNumberWithoutPlusSign();
    init_extractNationalNumberFromPossiblyIncompleteNumber();
    init_stripIddPrefix();
    init_parseDigits();
    init_constants();
    VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART = "[" + VALID_PUNCTUATION + VALID_DIGITS + "]+";
    VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART_PATTERN = new RegExp("^" + VALID_FORMATTED_PHONE_NUMBER_DIGITS_PART + "$", "i");
    VALID_FORMATTED_PHONE_NUMBER_PART = "(?:[" + PLUS_CHARS + "][" + VALID_PUNCTUATION + VALID_DIGITS + "]*|[" + VALID_PUNCTUATION + VALID_DIGITS + "]+)";
    AFTER_PHONE_NUMBER_DIGITS_END_PATTERN = new RegExp("[^" + VALID_PUNCTUATION + VALID_DIGITS + "]+.*$");
    COMPLEX_NATIONAL_PREFIX = /[^\d\[\]]/;
    AsYouTypeParser = /* @__PURE__ */ (function() {
      function AsYouTypeParser2(_ref) {
        var defaultCountry = _ref.defaultCountry, defaultCallingCode = _ref.defaultCallingCode, metadata = _ref.metadata, onNationalSignificantNumberChange = _ref.onNationalSignificantNumberChange;
        _classCallCheck11(this, AsYouTypeParser2);
        this.defaultCountry = defaultCountry;
        this.defaultCallingCode = defaultCallingCode;
        this.metadata = metadata;
        this.onNationalSignificantNumberChange = onNationalSignificantNumberChange;
      }
      return _createClass11(AsYouTypeParser2, [{
        key: "input",
        value: function input(text, state) {
          var _extractFormattedDigi = extractFormattedDigitsAndPlus(text), _extractFormattedDigi2 = _slicedToArray3(_extractFormattedDigi, 2), formattedDigits = _extractFormattedDigi2[0], hasPlus = _extractFormattedDigi2[1];
          var digits = parseDigits(formattedDigits);
          var justLeadingPlus;
          if (hasPlus) {
            if (!state.digits) {
              state.startInternationalNumber(void 0, void 0);
              if (!digits) {
                justLeadingPlus = true;
              }
            }
          }
          if (digits) {
            this.inputDigits(digits, state);
          }
          return {
            digits,
            justLeadingPlus
          };
        }
        /**
         * Inputs "next" phone number digits.
         * @param  {string} digits
         * @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
         */
      }, {
        key: "inputDigits",
        value: function inputDigits(nextDigits, state) {
          var digits = state.digits;
          var hasReceivedThreeLeadingDigits = digits.length < 3 && digits.length + nextDigits.length >= 3;
          state.appendDigits(nextDigits);
          if (hasReceivedThreeLeadingDigits) {
            this.extractIddPrefix(state);
          }
          if (this.isWaitingForCountryCallingCode(state)) {
            if (!this.extractCountryCallingCode(state)) {
              return;
            }
          } else {
            state.appendNationalSignificantNumberDigits(nextDigits);
          }
          if (!state.international) {
            if (!this.hasExtractedNationalSignificantNumber) {
              this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
                return state.update(stateUpdate);
              });
            }
          }
        }
      }, {
        key: "isWaitingForCountryCallingCode",
        value: function isWaitingForCountryCallingCode(_ref2) {
          var international = _ref2.international, callingCode = _ref2.callingCode;
          return international && !callingCode;
        }
        // Extracts a country calling code from a number
        // being entered in internatonal format.
      }, {
        key: "extractCountryCallingCode",
        value: function extractCountryCallingCode2(state) {
          var _extractCountryCallin = extractCountryCallingCode("+" + state.getDigitsWithoutInternationalPrefix(), state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), countryCallingCode = _extractCountryCallin.countryCallingCode, number = _extractCountryCallin.number;
          if (countryCallingCode) {
            state.setCallingCode(countryCallingCode);
            state.update({
              nationalSignificantNumber: number
            });
            return true;
          }
        }
      }, {
        key: "reset",
        value: function reset(numberingPlan) {
          if (numberingPlan) {
            this.hasSelectedNumberingPlan = true;
            var nationalPrefixForParsing = numberingPlan._nationalPrefixForParsing();
            this.couldPossiblyExtractAnotherNationalSignificantNumber = nationalPrefixForParsing && COMPLEX_NATIONAL_PREFIX.test(nationalPrefixForParsing);
          } else {
            this.hasSelectedNumberingPlan = void 0;
            this.couldPossiblyExtractAnotherNationalSignificantNumber = void 0;
          }
        }
        /**
         * Extracts a national (significant) number from user input.
         * Google's library is different in that it only applies `national_prefix_for_parsing`
         * and doesn't apply `national_prefix_transform_rule` after that.
         * https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
         * @return {boolean} [extracted]
         */
      }, {
        key: "extractNationalSignificantNumber",
        value: function extractNationalSignificantNumber(nationalDigits, setState) {
          if (!this.hasSelectedNumberingPlan) {
            return;
          }
          var _extractNationalNumbe = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe.nationalPrefix, nationalNumber = _extractNationalNumbe.nationalNumber, carrierCode = _extractNationalNumbe.carrierCode;
          if (nationalNumber === nationalDigits) {
            return;
          }
          this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
          return true;
        }
        /**
         * In Google's code this function is called "attempt to extract longer NDD".
         * "Some national prefixes are a substring of others", they say.
         * @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
         */
      }, {
        key: "extractAnotherNationalSignificantNumber",
        value: function extractAnotherNationalSignificantNumber(nationalDigits, prevNationalSignificantNumber, setState) {
          if (!this.hasExtractedNationalSignificantNumber) {
            return this.extractNationalSignificantNumber(nationalDigits, setState);
          }
          if (!this.couldPossiblyExtractAnotherNationalSignificantNumber) {
            return;
          }
          var _extractNationalNumbe2 = extractNationalNumberFromPossiblyIncompleteNumber(nationalDigits, this.metadata), nationalPrefix = _extractNationalNumbe2.nationalPrefix, nationalNumber = _extractNationalNumbe2.nationalNumber, carrierCode = _extractNationalNumbe2.carrierCode;
          if (nationalNumber === prevNationalSignificantNumber) {
            return;
          }
          this.onExtractedNationalNumber(nationalPrefix, carrierCode, nationalNumber, nationalDigits, setState);
          return true;
        }
      }, {
        key: "onExtractedNationalNumber",
        value: function onExtractedNationalNumber(nationalPrefix, carrierCode, nationalSignificantNumber, nationalDigits, setState) {
          var nationalSignificantNumberIsModified = false;
          var prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix;
          var nationalSignificantNumberIndex = nationalDigits.lastIndexOf(nationalSignificantNumber);
          if (nationalSignificantNumberIndex < 0 || nationalSignificantNumberIndex !== nationalDigits.length - nationalSignificantNumber.length) {
            nationalSignificantNumberIsModified = true;
          } else {
            var prefixBeforeNationalNumber = nationalDigits.slice(0, nationalSignificantNumberIndex);
            if (prefixBeforeNationalNumber) {
              if (prefixBeforeNationalNumber !== nationalPrefix) {
                prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = prefixBeforeNationalNumber;
              }
            }
          }
          setState({
            nationalPrefix,
            carrierCode,
            nationalSignificantNumber,
            nationalSignificantNumberIsModified,
            prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix
          });
          this.hasExtractedNationalSignificantNumber = true;
          this.onNationalSignificantNumberChange();
        }
      }, {
        key: "reExtractNationalSignificantNumber",
        value: function reExtractNationalSignificantNumber(state) {
          if (this.extractAnotherNationalSignificantNumber(state.getNationalDigits(), state.nationalSignificantNumber, function(stateUpdate) {
            return state.update(stateUpdate);
          })) {
            return true;
          }
          if (this.extractIddPrefix(state)) {
            this.extractCallingCodeAndNationalSignificantNumber(state);
            return true;
          }
          if (this.fixMissingPlus(state)) {
            this.extractCallingCodeAndNationalSignificantNumber(state);
            return true;
          }
        }
      }, {
        key: "extractIddPrefix",
        value: function extractIddPrefix(state) {
          var international = state.international, IDDPrefix = state.IDDPrefix, digits = state.digits, nationalSignificantNumber = state.nationalSignificantNumber;
          if (international || IDDPrefix) {
            return;
          }
          var numberWithoutIDD = stripIddPrefix(digits, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
          if (numberWithoutIDD !== void 0 && numberWithoutIDD !== digits) {
            state.update({
              IDDPrefix: digits.slice(0, digits.length - numberWithoutIDD.length)
            });
            this.startInternationalNumber(state, {
              country: void 0,
              callingCode: void 0
            });
            return true;
          }
        }
      }, {
        key: "fixMissingPlus",
        value: function fixMissingPlus(state) {
          if (!state.international) {
            var _extractCountryCallin2 = extractCountryCallingCodeFromInternationalNumberWithoutPlusSign(state.digits, state.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), newCallingCode = _extractCountryCallin2.countryCallingCode;
            if (newCallingCode) {
              state.update({
                missingPlus: true
              });
              this.startInternationalNumber(state, {
                country: state.country,
                callingCode: newCallingCode
              });
              return true;
            }
          }
        }
      }, {
        key: "startInternationalNumber",
        value: function startInternationalNumber(state, _ref3) {
          var country2 = _ref3.country, callingCode = _ref3.callingCode;
          state.startInternationalNumber(country2, callingCode);
          if (state.nationalSignificantNumber) {
            state.resetNationalSignificantNumber();
            this.onNationalSignificantNumberChange();
            this.hasExtractedNationalSignificantNumber = void 0;
          }
        }
      }, {
        key: "extractCallingCodeAndNationalSignificantNumber",
        value: function extractCallingCodeAndNationalSignificantNumber(state) {
          if (this.extractCountryCallingCode(state)) {
            this.extractNationalSignificantNumber(state.getNationalDigits(), function(stateUpdate) {
              return state.update(stateUpdate);
            });
          }
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouType.js
function _typeof21(o2) {
  "@babel/helpers - typeof";
  return _typeof21 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof21(o2);
}
function _slicedToArray4(r3, e2) {
  return _arrayWithHoles4(r3) || _iterableToArrayLimit4(r3, e2) || _unsupportedIterableToArray14(r3, e2) || _nonIterableRest4();
}
function _nonIterableRest4() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _unsupportedIterableToArray14(r3, a2) {
  if (r3) {
    if ("string" == typeof r3) return _arrayLikeToArray14(r3, a2);
    var t2 = {}.toString.call(r3).slice(8, -1);
    return "Object" === t2 && r3.constructor && (t2 = r3.constructor.name), "Map" === t2 || "Set" === t2 ? Array.from(r3) : "Arguments" === t2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t2) ? _arrayLikeToArray14(r3, a2) : void 0;
  }
}
function _arrayLikeToArray14(r3, a2) {
  (null == a2 || a2 > r3.length) && (a2 = r3.length);
  for (var e2 = 0, n2 = Array(a2); e2 < a2; e2++) n2[e2] = r3[e2];
  return n2;
}
function _iterableToArrayLimit4(r3, l2) {
  var t2 = null == r3 ? null : "undefined" != typeof Symbol && r3[Symbol.iterator] || r3["@@iterator"];
  if (null != t2) {
    var e2, n2, i2, u2, a2 = [], f2 = true, o2 = false;
    try {
      if (i2 = (t2 = t2.call(r3)).next, 0 === l2) {
        if (Object(t2) !== t2) return;
        f2 = false;
      } else for (; !(f2 = (e2 = i2.call(t2)).done) && (a2.push(e2.value), a2.length !== l2); f2 = true) ;
    } catch (r4) {
      o2 = true, n2 = r4;
    } finally {
      try {
        if (!f2 && null != t2["return"] && (u2 = t2["return"](), Object(u2) !== u2)) return;
      } finally {
        if (o2) throw n2;
      }
    }
    return a2;
  }
}
function _arrayWithHoles4(r3) {
  if (Array.isArray(r3)) return r3;
}
function _classCallCheck12(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties12(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey21(o2.key), o2);
  }
}
function _createClass12(e2, r3, t2) {
  return r3 && _defineProperties12(e2.prototype, r3), t2 && _defineProperties12(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey21(t2) {
  var i2 = _toPrimitive21(t2, "string");
  return "symbol" == _typeof21(i2) ? i2 : i2 + "";
}
function _toPrimitive21(t2, r3) {
  if ("object" != _typeof21(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof21(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
var USE_NON_GEOGRAPHIC_COUNTRY_CODE5, AsYouType;
var init_AsYouType = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/AsYouType.js"() {
    init_metadata();
    init_PhoneNumber();
    init_AsYouTypeState();
    init_AsYouTypeFormatter();
    init_AsYouTypeParser();
    init_getCountryByCallingCode();
    init_getCountryByNationalNumber();
    init_isObject();
    USE_NON_GEOGRAPHIC_COUNTRY_CODE5 = false;
    AsYouType = /* @__PURE__ */ (function() {
      function AsYouType3(optionsOrDefaultCountry, metadata) {
        _classCallCheck12(this, AsYouType3);
        this.metadata = new Metadata(metadata);
        var _this$getCountryAndCa = this.getCountryAndCallingCode(optionsOrDefaultCountry), _this$getCountryAndCa2 = _slicedToArray4(_this$getCountryAndCa, 2), defaultCountry = _this$getCountryAndCa2[0], defaultCallingCode = _this$getCountryAndCa2[1];
        this.defaultCountry = defaultCountry;
        this.defaultCallingCode = defaultCallingCode;
        this.reset();
      }
      return _createClass12(AsYouType3, [{
        key: "getCountryAndCallingCode",
        value: function getCountryAndCallingCode(optionsOrDefaultCountry) {
          var defaultCountry;
          var defaultCallingCode;
          if (optionsOrDefaultCountry) {
            if (isObject2(optionsOrDefaultCountry)) {
              defaultCountry = optionsOrDefaultCountry.defaultCountry;
              defaultCallingCode = optionsOrDefaultCountry.defaultCallingCode;
            } else {
              defaultCountry = optionsOrDefaultCountry;
            }
          }
          if (defaultCountry && !this.metadata.hasCountry(defaultCountry)) {
            defaultCountry = void 0;
          }
          if (defaultCallingCode) {
            if (USE_NON_GEOGRAPHIC_COUNTRY_CODE5) {
              if (this.metadata.isNonGeographicCallingCode(defaultCallingCode)) {
                defaultCountry = "001";
              }
            }
          }
          return [defaultCountry, defaultCallingCode];
        }
        /**
         * Inputs "next" phone number characters.
         * @param  {string} text
         * @return {string} Formatted phone number characters that have been input so far.
         */
      }, {
        key: "input",
        value: function input(text) {
          var _this$parser$input = this.parser.input(text, this.state), digits = _this$parser$input.digits, justLeadingPlus = _this$parser$input.justLeadingPlus;
          if (justLeadingPlus) {
            this.formattedOutput = "+";
          } else if (digits) {
            this.determineTheCountryIfNeeded();
            if (this.state.nationalSignificantNumber) {
              this.formatter.narrowDownMatchingFormats(this.state);
            }
            var formattedNationalNumber;
            if (this.metadata.hasSelectedNumberingPlan()) {
              formattedNationalNumber = this.formatter.format(digits, this.state);
            }
            if (formattedNationalNumber === void 0) {
              if (this.parser.reExtractNationalSignificantNumber(this.state)) {
                this.determineTheCountryIfNeeded();
                var nationalDigits = this.state.getNationalDigits();
                if (nationalDigits) {
                  formattedNationalNumber = this.formatter.format(nationalDigits, this.state);
                }
              }
            }
            this.formattedOutput = formattedNationalNumber ? this.getFullNumber(formattedNationalNumber) : this.getNonFormattedNumber();
          }
          return this.formattedOutput;
        }
      }, {
        key: "reset",
        value: function reset() {
          var _this = this;
          this.state = new AsYouTypeState({
            onCountryChange: function onCountryChange(country2) {
              _this.country = country2;
            },
            onCallingCodeChange: function onCallingCodeChange(callingCode, country2) {
              _this.metadata.selectNumberingPlan(country2, callingCode);
              _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
              _this.parser.reset(_this.metadata.numberingPlan);
            }
          });
          this.formatter = new AsYouTypeFormatter({
            state: this.state,
            metadata: this.metadata
          });
          this.parser = new AsYouTypeParser({
            defaultCountry: this.defaultCountry,
            defaultCallingCode: this.defaultCallingCode,
            metadata: this.metadata,
            state: this.state,
            onNationalSignificantNumberChange: function onNationalSignificantNumberChange() {
              _this.determineTheCountryIfNeeded();
              _this.formatter.reset(_this.metadata.numberingPlan, _this.state);
            }
          });
          this.state.reset({
            country: this.defaultCountry,
            callingCode: this.defaultCallingCode
          });
          this.formattedOutput = "";
          return this;
        }
        /**
         * Returns `true` if the phone number is being input in international format.
         * In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
         * @return {boolean}
         */
      }, {
        key: "isInternational",
        value: function isInternational() {
          return this.state.international;
        }
        /**
         * Returns the "calling code" part of the phone number when it's being input
         * in an international format.
         * If no valid calling code has been entered so far, returns `undefined`.
         * @return {string} [callingCode]
         */
      }, {
        key: "getCallingCode",
        value: function getCallingCode() {
          if (this.isInternational()) {
            return this.state.callingCode;
          }
        }
        // A legacy alias.
      }, {
        key: "getCountryCallingCode",
        value: function getCountryCallingCode3() {
          return this.getCallingCode();
        }
        /**
         * Returns a two-letter country code of the phone number.
         * Returns `undefined` for "non-geographic" phone numbering plans.
         * Returns `undefined` if no phone number has been input yet.
         * @return {string} [country]
         */
      }, {
        key: "getCountry",
        value: function getCountry() {
          var digits = this.state.digits;
          if (digits) {
            return this._getCountry();
          }
        }
        /**
         * Returns a two-letter country code of the phone number.
         * Returns `undefined` for "non-geographic" phone numbering plans.
         * @return {string} [country]
         */
      }, {
        key: "_getCountry",
        value: function _getCountry() {
          var country2 = this.state.country;
          if (USE_NON_GEOGRAPHIC_COUNTRY_CODE5) {
            if (country2 === "001") {
              return;
            }
          }
          return country2;
        }
      }, {
        key: "determineTheCountryIfNeeded",
        value: function determineTheCountryIfNeeded() {
          if (!this.state.country || this.isCountryCallingCodeAmbiguous()) {
            this.determineTheCountry();
          }
        }
        // Prepends `+CountryCode ` in case of an international phone number
      }, {
        key: "getFullNumber",
        value: function getFullNumber(formattedNationalNumber) {
          var _this2 = this;
          if (this.isInternational()) {
            var prefix = function prefix2(text) {
              return _this2.formatter.getInternationalPrefixBeforeCountryCallingCode(_this2.state, {
                spacing: text ? true : false
              }) + text;
            };
            var callingCode = this.state.callingCode;
            if (!callingCode) {
              return prefix("".concat(this.state.getDigitsWithoutInternationalPrefix()));
            }
            if (!formattedNationalNumber) {
              return prefix(callingCode);
            }
            return prefix("".concat(callingCode, " ").concat(formattedNationalNumber));
          }
          return formattedNationalNumber;
        }
      }, {
        key: "getNonFormattedNationalNumberWithPrefix",
        value: function getNonFormattedNationalNumberWithPrefix() {
          var _this$state = this.state, nationalSignificantNumber = _this$state.nationalSignificantNumber, prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = _this$state.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix, nationalPrefix = _this$state.nationalPrefix;
          var number = nationalSignificantNumber;
          var prefix = prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix || nationalPrefix;
          if (prefix) {
            number = prefix + number;
          }
          return number;
        }
      }, {
        key: "getNonFormattedNumber",
        value: function getNonFormattedNumber() {
          var nationalSignificantNumberIsModified = this.state.nationalSignificantNumberIsModified;
          return this.getFullNumber(nationalSignificantNumberIsModified ? this.state.getNationalDigits() : this.getNonFormattedNationalNumberWithPrefix());
        }
      }, {
        key: "getNonFormattedTemplate",
        value: function getNonFormattedTemplate() {
          var number = this.getNonFormattedNumber();
          if (number) {
            return number.replace(/[\+\d]/g, DIGIT_PLACEHOLDER);
          }
        }
      }, {
        key: "isCountryCallingCodeAmbiguous",
        value: function isCountryCallingCodeAmbiguous() {
          var callingCode = this.state.callingCode;
          var countryCodes = this.metadata.getCountryCodesForCallingCode(callingCode);
          return countryCodes && countryCodes.length > 1;
        }
        // Determines the exact country of the phone number
        // entered so far based on the country phone code
        // and the national phone number.
      }, {
        key: "determineTheCountry",
        value: function determineTheCountry() {
          this.state.setCountry(getCountryByCallingCode(this.isInternational() ? this.state.callingCode : this.defaultCallingCode, {
            nationalNumber: this.state.nationalSignificantNumber,
            metadata: this.metadata
          }));
        }
        /**
         * Returns a E.164 phone number value for the user's input.
         *
         * For example, for country `"US"` and input `"(222) 333-4444"`
         * it will return `"+12223334444"`.
         *
         * For international phone number input, it will also auto-correct
         * some minor errors such as using a national prefix when writing
         * an international phone number. For example, if the user inputs
         * `"+44 0 7400 000000"` then it will return an auto-corrected
         * `"+447400000000"` phone number value.
         *
         * Will return `undefined` if no digits have been input,
         * or when inputting a phone number in national format and no
         * default country or default "country calling code" have been set.
         *
         * @return {string} [value]
         */
      }, {
        key: "getNumberValue",
        value: function getNumberValue() {
          var _this$state2 = this.state, digits = _this$state2.digits, callingCode = _this$state2.callingCode, country2 = _this$state2.country, nationalSignificantNumber = _this$state2.nationalSignificantNumber;
          if (!digits) {
            return;
          }
          if (this.isInternational()) {
            if (callingCode) {
              return "+" + callingCode + nationalSignificantNumber;
            } else {
              return "+" + digits;
            }
          } else {
            if (country2 || callingCode) {
              var callingCode_ = country2 ? this.metadata.countryCallingCode() : callingCode;
              return "+" + callingCode_ + nationalSignificantNumber;
            }
          }
        }
        /**
         * Returns an instance of `PhoneNumber` class.
         * Will return `undefined` if no national (significant) number
         * digits have been entered so far, or if no `defaultCountry` has been
         * set and the user enters a phone number not in international format.
         */
      }, {
        key: "getNumber",
        value: function getNumber() {
          var _this$state3 = this.state, nationalSignificantNumber = _this$state3.nationalSignificantNumber, carrierCode = _this$state3.carrierCode, callingCode = _this$state3.callingCode;
          var country2 = this._getCountry();
          if (!nationalSignificantNumber) {
            return;
          }
          if (!country2 && !callingCode) {
            return;
          }
          if (country2) {
            if (country2 === this.defaultCountry) {
              var metadata = new Metadata(this.metadata.metadata);
              metadata.selectNumberingPlan(country2);
              var _callingCode = metadata.numberingPlan.callingCode();
              var ambiguousCountries = this.metadata.getCountryCodesForCallingCode(_callingCode);
              if (ambiguousCountries.length > 1) {
                var exactCountry = getCountryByNationalNumber(nationalSignificantNumber, {
                  countries: ambiguousCountries,
                  metadata: this.metadata.metadata
                });
                if (exactCountry) {
                  country2 = exactCountry;
                }
              }
            }
          }
          var phoneNumber = new PhoneNumber(country2 || callingCode, nationalSignificantNumber, this.metadata.metadata);
          if (carrierCode) {
            phoneNumber.carrierCode = carrierCode;
          }
          return phoneNumber;
        }
        /**
         * Returns `true` if the phone number is "possible".
         * Is just a shortcut for `PhoneNumber.isPossible()`.
         * @return {boolean}
         */
      }, {
        key: "isPossible",
        value: function isPossible() {
          var phoneNumber = this.getNumber();
          if (!phoneNumber) {
            return false;
          }
          return phoneNumber.isPossible();
        }
        /**
         * Returns `true` if the phone number is "valid".
         * Is just a shortcut for `PhoneNumber.isValid()`.
         * @return {boolean}
         */
      }, {
        key: "isValid",
        value: function isValid2() {
          var phoneNumber = this.getNumber();
          if (!phoneNumber) {
            return false;
          }
          return phoneNumber.isValid();
        }
        /**
         * @deprecated
         * This method is used in `react-phone-number-input/source/input-control.js`
         * in versions before `3.0.16`.
         */
      }, {
        key: "getNationalNumber",
        value: function getNationalNumber() {
          return this.state.nationalSignificantNumber;
        }
        /**
         * Returns the phone number characters entered by the user.
         * @return {string}
         */
      }, {
        key: "getChars",
        value: function getChars() {
          return (this.state.international ? "+" : "") + this.state.digits;
        }
        /**
         * Returns the template for the formatted phone number.
         * @return {string}
         */
      }, {
        key: "getTemplate",
        value: function getTemplate() {
          return this.formatter.getTemplate(this.state) || this.getNonFormattedTemplate() || "";
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/getCountries.js
function getCountries(metadata) {
  return new Metadata(metadata).getCountries();
}
var init_getCountries = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/getCountries.js"() {
    init_metadata();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/getExampleNumber.js
function getExampleNumber(country2, examples, metadata) {
  if (examples[country2]) {
    return new PhoneNumber(country2, examples[country2], metadata);
  }
}
var init_getExampleNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/getExampleNumber.js"() {
    init_PhoneNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js
function formatIncompletePhoneNumber(value, optionsOrDefaultCountry, metadata) {
  if (!metadata) {
    metadata = optionsOrDefaultCountry;
    optionsOrDefaultCountry = void 0;
  }
  return new AsYouType(optionsOrDefaultCountry, metadata).input(value);
}
var init_formatIncompletePhoneNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.js"() {
    init_AsYouType();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/core/index.js
var init_core = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/core/index.js"() {
    init_PhoneNumber();
    init_ParseError();
    init_parsePhoneNumberWithError2();
    init_parsePhoneNumber2();
    init_isValidPhoneNumber();
    init_isPossiblePhoneNumber();
    init_validatePhoneNumberLength();
    init_findNumbers();
    init_searchNumbers();
    init_findPhoneNumbersInText();
    init_searchPhoneNumbersInText();
    init_PhoneNumberMatcher();
    init_AsYouType();
    init_getCountries();
    init_metadata();
    init_getExampleNumber();
    init_formatIncompletePhoneNumber();
    init_parseIncompletePhoneNumber();
    init_parseDigits();
    init_RFC3966();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/parsePhoneNumberWithError.js
function parsePhoneNumberWithError3() {
  return withMetadataArgument(parsePhoneNumberWithError2, arguments);
}
var init_parsePhoneNumberWithError3 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/parsePhoneNumberWithError.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js
function parsePhoneNumber4() {
  return withMetadataArgument(parsePhoneNumber3, arguments);
}
var init_parsePhoneNumber3 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/parsePhoneNumber.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js
function isValidPhoneNumber2() {
  return withMetadataArgument(isValidPhoneNumber, arguments);
}
var init_isValidPhoneNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isValidPhoneNumber.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isPossiblePhoneNumber.js
function isPossiblePhoneNumber3() {
  return withMetadataArgument(isPossiblePhoneNumber2, arguments);
}
var init_isPossiblePhoneNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isPossiblePhoneNumber.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/validatePhoneNumberLength.js
function validatePhoneNumberLength2() {
  return withMetadataArgument(validatePhoneNumberLength, arguments);
}
var init_validatePhoneNumberLength2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/validatePhoneNumberLength.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/findNumbers.js
function findNumbers2() {
  return withMetadataArgument(findNumbers, arguments);
}
var init_findNumbers2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/findNumbers.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/searchNumbers.js
function searchNumbers2() {
  return withMetadataArgument(searchNumbers, arguments);
}
var init_searchNumbers2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/searchNumbers.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/findPhoneNumbersInText.js
function findPhoneNumbersInText2() {
  return withMetadataArgument(findPhoneNumbersInText, arguments);
}
var init_findPhoneNumbersInText2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/findPhoneNumbersInText.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/searchPhoneNumbersInText.js
function searchPhoneNumbersInText2() {
  return withMetadataArgument(searchPhoneNumbersInText, arguments);
}
var init_searchPhoneNumbersInText2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/searchPhoneNumbersInText.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/PhoneNumberMatcher.js
function PhoneNumberMatcher2(text, options) {
  return PhoneNumberMatcher.call(this, text, options, metadata_min_json_default);
}
var init_PhoneNumberMatcher2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/PhoneNumberMatcher.js"() {
    init_metadata_min_json();
    init_core();
    PhoneNumberMatcher2.prototype = Object.create(PhoneNumberMatcher.prototype, {});
    PhoneNumberMatcher2.prototype.constructor = PhoneNumberMatcher2;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/AsYouType.js
function AsYouType2(country2) {
  return AsYouType.call(this, country2, metadata_min_json_default);
}
var init_AsYouType2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/AsYouType.js"() {
    init_metadata_min_json();
    init_core();
    AsYouType2.prototype = Object.create(AsYouType.prototype, {});
    AsYouType2.prototype.constructor = AsYouType2;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js
function isSupportedCountry2() {
  return withMetadataArgument(isSupportedCountry, arguments);
}
var init_isSupportedCountry = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/isSupportedCountry.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getCountries.js
function getCountries2() {
  return withMetadataArgument(getCountries, arguments);
}
var init_getCountries2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getCountries.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js
function getCountryCallingCode2() {
  return withMetadataArgument(getCountryCallingCode, arguments);
}
var init_getCountryCallingCode2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getCountryCallingCode.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getExtPrefix.js
function getExtPrefix2() {
  return withMetadataArgument(getExtPrefix, arguments);
}
var init_getExtPrefix = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getExtPrefix.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/Metadata.js
function Metadata2() {
  return Metadata.call(this, metadata_min_json_default);
}
var init_Metadata = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/Metadata.js"() {
    init_metadata_min_json();
    init_core();
    Metadata2.prototype = Object.create(Metadata.prototype, {});
    Metadata2.prototype.constructor = Metadata2;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getExampleNumber.js
function getExampleNumber2() {
  return withMetadataArgument(getExampleNumber, arguments);
}
var init_getExampleNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/getExampleNumber.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/formatIncompletePhoneNumber.js
function formatIncompletePhoneNumber2() {
  return withMetadataArgument(formatIncompletePhoneNumber, arguments);
}
var init_formatIncompletePhoneNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/formatIncompletePhoneNumber.js"() {
    init_withMetadataArgument();
    init_core();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/PhoneNumber.js
function PhoneNumber2(number) {
  return PhoneNumber.call(this, number, metadata_min_json_default);
}
var init_PhoneNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/min/exports/PhoneNumber.js"() {
    init_metadata_min_json();
    init_core();
    PhoneNumber2.prototype = PhoneNumber.prototype;
    PhoneNumber2.prototype.constructor = PhoneNumber2;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/parse.js
function parseNumber() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  return parse(text, options, metadata);
}
var init_parse2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/parse.js"() {
    init_parse();
    init_normalizeArguments();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/parse.js
function parse2() {
  return withMetadataArgument(parseNumber, arguments);
}
var init_parse3 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/parse.js"() {
    init_withMetadataArgument();
    init_parse2();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/format.js
function formatNumber4() {
  var _normalizeArguments = normalizeArguments2(arguments), input = _normalizeArguments.input, format7 = _normalizeArguments.format, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  return formatNumber3(input, format7, options, metadata);
}
function normalizeArguments2(args) {
  var arg_1 = args[0];
  var arg_2 = args[1];
  var arg_3 = args[2];
  var arg_4 = args[3];
  var arg_5 = args[4];
  var input;
  var format7;
  var options;
  var metadata;
  if (typeof arg_1 === "string") {
    if (typeof arg_3 === "string") {
      format7 = arg_3;
      if (arg_5) {
        options = arg_4;
        metadata = arg_5;
      } else {
        metadata = arg_4;
      }
      input = parse(arg_1, {
        defaultCountry: arg_2,
        extended: true
      }, metadata);
    } else {
      if (typeof arg_2 !== "string") {
        throw new Error("`format` argument not passed to `formatNumber(number, format)`");
      }
      format7 = arg_2;
      if (arg_4) {
        options = arg_3;
        metadata = arg_4;
      } else {
        metadata = arg_3;
      }
      input = parse(arg_1, {
        extended: true
      }, metadata);
    }
  } else if (isObject2(arg_1)) {
    input = arg_1;
    format7 = arg_2;
    if (arg_4) {
      options = arg_3;
      metadata = arg_4;
    } else {
      metadata = arg_3;
    }
  } else throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");
  if (format7 === "International") {
    format7 = "INTERNATIONAL";
  } else if (format7 === "National") {
    format7 = "NATIONAL";
  }
  return {
    input,
    format: format7,
    options,
    metadata
  };
}
var init_format2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/format.js"() {
    init_format();
    init_parse();
    init_isObject();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/format.js
function format6() {
  return withMetadataArgument(formatNumber4, arguments);
}
var init_format3 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/format.js"() {
    init_withMetadataArgument();
    init_format2();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/getNumberType.js
function getNumberType2() {
  var _normalizeArguments = normalizeArguments3(arguments), input = _normalizeArguments.input, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  if (!input.phone) {
    return;
  }
  return getNumberType(input, options, metadata);
}
function normalizeArguments3(args) {
  var arg_1 = args[0];
  var arg_2 = args[1];
  var arg_3 = args[2];
  var arg_4 = args[3];
  var input;
  var options = {};
  var metadata;
  if (typeof arg_1 === "string") {
    if (!isObject2(arg_2)) {
      if (arg_4) {
        options = arg_3;
        metadata = arg_4;
      } else {
        metadata = arg_3;
      }
      if (isViablePhoneNumber(arg_1)) {
        input = parse(arg_1, {
          defaultCountry: arg_2
        }, metadata);
      } else {
        input = {};
      }
    } else {
      if (arg_3) {
        options = arg_2;
        metadata = arg_3;
      } else {
        metadata = arg_2;
      }
      if (isViablePhoneNumber(arg_1)) {
        input = parse(arg_1, void 0, metadata);
      } else {
        input = {};
      }
    }
  } else if (isObject2(arg_1)) {
    input = arg_1;
    if (arg_3) {
      options = arg_2;
      metadata = arg_3;
    } else {
      metadata = arg_2;
    }
  } else throw new TypeError("A phone number must either be a string or an object of shape { phone, [country] }.");
  return {
    input,
    options,
    metadata
  };
}
var init_getNumberType2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/getNumberType.js"() {
    init_isViablePhoneNumber();
    init_getNumberType();
    init_isObject();
    init_parse();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/getNumberType.js
function getNumberType3() {
  return withMetadataArgument(getNumberType2, arguments);
}
var init_getNumberType3 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/getNumberType.js"() {
    init_withMetadataArgument();
    init_getNumberType2();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isPossibleNumber.js
function isPossibleNumber2() {
  var _normalizeArguments = normalizeArguments3(arguments), input = _normalizeArguments.input, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  if (!input.phone && !(options && options.v2)) {
    return false;
  }
  return isPossiblePhoneNumber(input, options, metadata);
}
var init_isPossibleNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isPossibleNumber.js"() {
    init_getNumberType2();
    init_isPossible();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/isPossibleNumber.js
function isPossibleNumber3() {
  return withMetadataArgument(isPossibleNumber2, arguments);
}
var init_isPossibleNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/isPossibleNumber.js"() {
    init_withMetadataArgument();
    init_isPossibleNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isValidNumber.js
function isValidNumber2() {
  var _normalizeArguments = normalizeArguments3(arguments), input = _normalizeArguments.input, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  if (!input.phone) {
    return false;
  }
  return isValidNumber(input, options, metadata);
}
var init_isValidNumber = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isValidNumber.js"() {
    init_isValid();
    init_getNumberType2();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/isValidNumber.js
function isValidNumber3() {
  return withMetadataArgument(isValidNumber2, arguments);
}
var init_isValidNumber2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/isValidNumber.js"() {
    init_withMetadataArgument();
    init_isValidNumber();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isValidNumberForRegion_.js
function isValidNumberForRegion(input, country2, options, metadata) {
  options = options || {};
  return input.country === country2 && isValidNumber(input, options, metadata);
}
var init_isValidNumberForRegion = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isValidNumberForRegion_.js"() {
    init_isValid();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isValidNumberForRegion.js
function isValidNumberForRegion2(number, country2, metadata) {
  if (typeof number !== "string") {
    throw new TypeError("number must be a string");
  }
  if (typeof country2 !== "string") {
    throw new TypeError("country must be a string");
  }
  var input;
  if (isViablePhoneNumber(number)) {
    input = parse(number, {
      defaultCountry: country2
    }, metadata);
  } else {
    input = {};
  }
  return isValidNumberForRegion(input, country2, void 0, metadata);
}
var init_isValidNumberForRegion2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/isValidNumberForRegion.js"() {
    init_isViablePhoneNumber();
    init_parse();
    init_isValidNumberForRegion();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/isValidNumberForRegion.js
function isValidNumberForRegion3() {
  return withMetadataArgument(isValidNumberForRegion2, arguments);
}
var init_isValidNumberForRegion3 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/isValidNumberForRegion.js"() {
    init_withMetadataArgument();
    init_isValidNumberForRegion2();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/PhoneNumberSearch.js
function _typeof22(o2) {
  "@babel/helpers - typeof";
  return _typeof22 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o3) {
    return typeof o3;
  } : function(o3) {
    return o3 && "function" == typeof Symbol && o3.constructor === Symbol && o3 !== Symbol.prototype ? "symbol" : typeof o3;
  }, _typeof22(o2);
}
function _classCallCheck13(a2, n2) {
  if (!(a2 instanceof n2)) throw new TypeError("Cannot call a class as a function");
}
function _defineProperties13(e2, r3) {
  for (var t2 = 0; t2 < r3.length; t2++) {
    var o2 = r3[t2];
    o2.enumerable = o2.enumerable || false, o2.configurable = true, "value" in o2 && (o2.writable = true), Object.defineProperty(e2, _toPropertyKey22(o2.key), o2);
  }
}
function _createClass13(e2, r3, t2) {
  return r3 && _defineProperties13(e2.prototype, r3), t2 && _defineProperties13(e2, t2), Object.defineProperty(e2, "prototype", { writable: false }), e2;
}
function _toPropertyKey22(t2) {
  var i2 = _toPrimitive22(t2, "string");
  return "symbol" == _typeof22(i2) ? i2 : i2 + "";
}
function _toPrimitive22(t2, r3) {
  if ("object" != _typeof22(t2) || !t2) return t2;
  var e2 = t2[Symbol.toPrimitive];
  if (void 0 !== e2) {
    var i2 = e2.call(t2, r3 || "default");
    if ("object" != _typeof22(i2)) return i2;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return ("string" === r3 ? String : Number)(t2);
}
var WHITESPACE_IN_THE_BEGINNING_PATTERN, PUNCTUATION_IN_THE_END_PATTERN, PhoneNumberSearch;
var init_PhoneNumberSearch = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/PhoneNumberSearch.js"() {
    init_parse();
    init_isViablePhoneNumber();
    init_parsePreCandidate();
    init_isValidPreCandidate();
    init_isValidCandidate();
    init_constants();
    WHITESPACE_IN_THE_BEGINNING_PATTERN = new RegExp("^[" + WHITESPACE + "]+");
    PUNCTUATION_IN_THE_END_PATTERN = new RegExp("[" + VALID_PUNCTUATION + "]+$");
    PhoneNumberSearch = /* @__PURE__ */ (function() {
      function PhoneNumberSearch3(text, options, metadata) {
        _classCallCheck13(this, PhoneNumberSearch3);
        this.text = text;
        this.options = options || {};
        this.metadata = metadata;
        this.state = "NOT_READY";
        this.regexp = new RegExp(VALID_PHONE_NUMBER_WITH_EXTENSION, "ig");
      }
      return _createClass13(PhoneNumberSearch3, [{
        key: "find",
        value: function find() {
          var matches = this.regexp.exec(this.text);
          if (!matches) {
            return;
          }
          var number = matches[0];
          var startsAt = matches.index;
          number = number.replace(WHITESPACE_IN_THE_BEGINNING_PATTERN, "");
          startsAt += matches[0].length - number.length;
          number = number.replace(PUNCTUATION_IN_THE_END_PATTERN, "");
          number = parsePreCandidate(number);
          var result2 = this.parseCandidate(number, startsAt);
          if (result2) {
            return result2;
          }
          return this.find();
        }
      }, {
        key: "parseCandidate",
        value: function parseCandidate(number, startsAt) {
          if (!isValidPreCandidate(number, startsAt, this.text)) {
            return;
          }
          if (!isValidCandidate(number, startsAt, this.text, this.options.extended ? "POSSIBLE" : "VALID")) {
            return;
          }
          var result2 = parse(number, this.options, this.metadata);
          if (!result2.phone) {
            return;
          }
          result2.startsAt = startsAt;
          result2.endsAt = startsAt + number.length;
          return result2;
        }
      }, {
        key: "hasNext",
        value: function hasNext() {
          if (this.state === "NOT_READY") {
            this.last_match = this.find();
            if (this.last_match) {
              this.state = "READY";
            } else {
              this.state = "DONE";
            }
          }
          return this.state === "READY";
        }
      }, {
        key: "next",
        value: function next() {
          if (!this.hasNext()) {
            throw new Error("No next element");
          }
          var result2 = this.last_match;
          this.last_match = null;
          this.state = "NOT_READY";
          return result2;
        }
      }]);
    })();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/findPhoneNumbersInitialImplementation.js
function findPhoneNumbers(text, options, metadata) {
  if (options === void 0) {
    options = {};
  }
  var search = new PhoneNumberSearch(text, options, metadata);
  var phones = [];
  while (search.hasNext()) {
    phones.push(search.next());
  }
  return phones;
}
function searchPhoneNumbers(text, options, metadata) {
  if (options === void 0) {
    options = {};
  }
  var search = new PhoneNumberSearch(text, options, metadata);
  var iterator = function iterator2() {
    return {
      next: function next() {
        if (search.hasNext()) {
          return {
            done: false,
            value: search.next()
          };
        }
        return {
          done: true
        };
      }
    };
  };
  var iterable = {};
  iterable[Symbol.iterator] = iterator;
  return iterable;
}
var EXTN_PATTERNS_FOR_PARSING;
var init_findPhoneNumbersInitialImplementation = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/findPhoneNumbersInitialImplementation.js"() {
    init_createExtensionPattern();
    init_PhoneNumberSearch();
    EXTN_PATTERNS_FOR_PARSING = createExtensionPattern("parsing");
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/findPhoneNumbers.js
function findPhoneNumbers2() {
  var _normalizeArguments = normalizeArguments(arguments), text = _normalizeArguments.text, options = _normalizeArguments.options, metadata = _normalizeArguments.metadata;
  return findPhoneNumbers(text, options, metadata);
}
function searchPhoneNumbers2() {
  var _normalizeArguments2 = normalizeArguments(arguments), text = _normalizeArguments2.text, options = _normalizeArguments2.options, metadata = _normalizeArguments2.metadata;
  return searchPhoneNumbers(text, options, metadata);
}
var init_findPhoneNumbers = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/es6/legacy/findPhoneNumbers.js"() {
    init_findPhoneNumbersInitialImplementation();
    init_normalizeArguments();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/findPhoneNumbers.js
function findPhoneNumbers3() {
  return withMetadataArgument(findPhoneNumbers2, arguments);
}
var init_findPhoneNumbers2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/findPhoneNumbers.js"() {
    init_withMetadataArgument();
    init_findPhoneNumbers();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/searchPhoneNumbers.js
function searchPhoneNumbers3() {
  return withMetadataArgument(searchPhoneNumbers2, arguments);
}
var init_searchPhoneNumbers = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/searchPhoneNumbers.js"() {
    init_withMetadataArgument();
    init_findPhoneNumbers();
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js
function PhoneNumberSearch2(text, options) {
  PhoneNumberSearch.call(this, text, options, metadata_min_json_default);
}
var init_PhoneNumberSearch2 = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.es6.exports/PhoneNumberSearch.js"() {
    init_metadata_min_json();
    init_PhoneNumberSearch();
    PhoneNumberSearch2.prototype = Object.create(PhoneNumberSearch.prototype, {});
    PhoneNumberSearch2.prototype.constructor = PhoneNumberSearch2;
  }
});

// ../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.js
var libphonenumber_js_exports = {};
__export(libphonenumber_js_exports, {
  AsYouType: () => AsYouType2,
  AsYouTypeCustom: () => AsYouType,
  DIGITS: () => DIGITS,
  DIGIT_PLACEHOLDER: () => DIGIT_PLACEHOLDER,
  Metadata: () => Metadata2,
  ParseError: () => ParseError,
  PhoneNumber: () => PhoneNumber2,
  PhoneNumberMatcher: () => PhoneNumberMatcher2,
  PhoneNumberSearch: () => PhoneNumberSearch2,
  PhoneNumberSearchCustom: () => PhoneNumberSearch,
  default: () => parsePhoneNumber4,
  findNumbers: () => findNumbers2,
  findPhoneNumbers: () => findPhoneNumbers3,
  findPhoneNumbersCustom: () => findPhoneNumbers2,
  findPhoneNumbersInText: () => findPhoneNumbersInText2,
  format: () => format6,
  formatCustom: () => formatNumber4,
  formatIncompletePhoneNumber: () => formatIncompletePhoneNumber2,
  formatNumber: () => format6,
  formatRFC3966: () => formatRFC3966,
  getCountries: () => getCountries2,
  getCountryCallingCode: () => getCountryCallingCode2,
  getCountryCallingCodeCustom: () => getCountryCallingCode,
  getExampleNumber: () => getExampleNumber2,
  getExtPrefix: () => getExtPrefix2,
  getNumberType: () => getNumberType3,
  getNumberTypeCustom: () => getNumberType2,
  getPhoneCode: () => getCountryCallingCode2,
  getPhoneCodeCustom: () => getCountryCallingCode,
  isPossibleNumber: () => isPossibleNumber3,
  isPossiblePhoneNumber: () => isPossiblePhoneNumber3,
  isSupportedCountry: () => isSupportedCountry2,
  isValidNumber: () => isValidNumber3,
  isValidNumberCustom: () => isValidNumber2,
  isValidNumberForRegion: () => isValidNumberForRegion3,
  isValidPhoneNumber: () => isValidPhoneNumber2,
  parse: () => parse2,
  parseCustom: () => parseNumber,
  parseDigits: () => parseDigits,
  parseIncompletePhoneNumber: () => parseIncompletePhoneNumber,
  parseNumber: () => parse2,
  parsePhoneNumber: () => parsePhoneNumberWithError3,
  parsePhoneNumberCharacter: () => parsePhoneNumberCharacter,
  parsePhoneNumberFromString: () => parsePhoneNumber4,
  parsePhoneNumberWithError: () => parsePhoneNumberWithError3,
  parseRFC3966: () => parseRFC3966,
  searchNumbers: () => searchNumbers2,
  searchPhoneNumbers: () => searchPhoneNumbers3,
  searchPhoneNumbersCustom: () => searchPhoneNumbers2,
  searchPhoneNumbersInText: () => searchPhoneNumbersInText2,
  validatePhoneNumberLength: () => validatePhoneNumberLength2
});
var init_libphonenumber_js = __esm({
  "../../../node_modules/.pnpm/libphonenumber-js@1.12.37/node_modules/libphonenumber-js/index.js"() {
    init_parsePhoneNumberWithError3();
    init_parsePhoneNumber3();
    init_isValidPhoneNumber2();
    init_isPossiblePhoneNumber2();
    init_validatePhoneNumberLength2();
    init_findNumbers2();
    init_searchNumbers2();
    init_findPhoneNumbersInText2();
    init_searchPhoneNumbersInText2();
    init_PhoneNumberMatcher2();
    init_AsYouType2();
    init_AsYouTypeFormatter();
    init_isSupportedCountry();
    init_getCountries2();
    init_getCountryCallingCode2();
    init_getExtPrefix();
    init_Metadata();
    init_getExampleNumber2();
    init_formatIncompletePhoneNumber2();
    init_PhoneNumber2();
    init_core();
    init_parse3();
    init_format3();
    init_getNumberType3();
    init_isPossibleNumber2();
    init_isValidNumber2();
    init_isValidNumberForRegion3();
    init_findPhoneNumbers2();
    init_searchPhoneNumbers();
    init_PhoneNumberSearch2();
    init_parseDigits();
    init_parse2();
    init_format2();
    init_isValidNumber();
    init_findPhoneNumbers();
    init_findPhoneNumbers();
    init_PhoneNumberSearch();
    init_getNumberType2();
    init_getCountryCallingCode();
    init_AsYouType();
  }
});

// ../../js-packages/number-formatters/dist/esm/create-number-formatters.js
var import_date = __toESM(require_date(), 1);

// ../../js-packages/number-formatters/dist/esm/constants.js
var FALLBACK_LOCALE = "en";
var FALLBACK_CURRENCY = "USD";

// ../../js-packages/number-formatters/dist/esm/number-format-currency/index.js
var import_debug2 = __toESM(require_browser(), 1);

// ../../js-packages/number-formatters/dist/esm/get-cached-formatter.js
var import_debug = __toESM(require_browser(), 1);
var debug = (0, import_debug.default)("number-formatters:get-cached-formatter");
var formatterCache = /* @__PURE__ */ new Map();
function getCachedFormatter({ locale, fallbackLocale = FALLBACK_LOCALE, options, retries = 1 }) {
  const cacheKey = JSON.stringify([locale, options]);
  try {
    return formatterCache.get(cacheKey) ?? formatterCache.set(cacheKey, new Intl.NumberFormat(locale, options)).get(cacheKey);
  } catch (error2) {
    debug(`Intl.NumberFormat was called with a non-existent locale "${locale}"; falling back to ${fallbackLocale}`);
    if (retries) {
      return getCachedFormatter({
        locale: fallbackLocale,
        options,
        retries: retries - 1
      });
    }
    throw error2;
  }
}

// ../../js-packages/number-formatters/dist/esm/number-format-currency/currencies.js
var defaultCurrencyOverrides = {
  AED: {
    symbol: "\u062F.\u0625.\u200F"
  },
  AFN: {
    symbol: "\u060B"
  },
  ALL: {
    symbol: "Lek"
  },
  AMD: {
    symbol: "\u058F"
  },
  ANG: {
    symbol: "\u0192"
  },
  AOA: {
    symbol: "Kz"
  },
  ARS: {
    symbol: "$"
  },
  AUD: {
    symbol: "A$"
  },
  AWG: {
    symbol: "\u0192"
  },
  AZN: {
    symbol: "\u20BC"
  },
  BAM: {
    symbol: "\u041A\u041C"
  },
  BBD: {
    symbol: "Bds$"
  },
  BDT: {
    symbol: "\u09F3"
  },
  BGN: {
    symbol: "\u043B\u0432."
  },
  BHD: {
    symbol: "\u062F.\u0628.\u200F"
  },
  BIF: {
    symbol: "FBu"
  },
  BMD: {
    symbol: "$"
  },
  BND: {
    symbol: "$"
  },
  BOB: {
    symbol: "Bs"
  },
  BRL: {
    symbol: "R$"
  },
  BSD: {
    symbol: "$"
  },
  BTC: {
    symbol: "\u0243"
  },
  BTN: {
    symbol: "Nu."
  },
  BWP: {
    symbol: "P"
  },
  BYR: {
    symbol: "\u0440."
  },
  BZD: {
    symbol: "BZ$"
  },
  CAD: {
    symbol: "C$"
  },
  CDF: {
    symbol: "FC"
  },
  CHF: {
    symbol: "CHF"
  },
  CLP: {
    symbol: "$"
  },
  CNY: {
    symbol: "\xA5"
  },
  COP: {
    symbol: "$"
  },
  CRC: {
    symbol: "\u20A1"
  },
  CUC: {
    symbol: "CUC"
  },
  CUP: {
    symbol: "$MN"
  },
  CVE: {
    symbol: "$"
  },
  CZK: {
    symbol: "K\u010D"
  },
  DJF: {
    symbol: "Fdj"
  },
  DKK: {
    symbol: "kr."
  },
  DOP: {
    symbol: "RD$"
  },
  DZD: {
    symbol: "\u062F.\u062C.\u200F"
  },
  EGP: {
    symbol: "\u062C.\u0645.\u200F"
  },
  ERN: {
    symbol: "Nfk"
  },
  ETB: {
    symbol: "ETB"
  },
  EUR: {
    symbol: "\u20AC"
  },
  FJD: {
    symbol: "FJ$"
  },
  FKP: {
    symbol: "\xA3"
  },
  GBP: {
    symbol: "\xA3"
  },
  GEL: {
    symbol: "Lari"
  },
  GHS: {
    symbol: "\u20B5"
  },
  GIP: {
    symbol: "\xA3"
  },
  GMD: {
    symbol: "D"
  },
  GNF: {
    symbol: "FG"
  },
  GTQ: {
    symbol: "Q"
  },
  GYD: {
    symbol: "G$"
  },
  HKD: {
    symbol: "HK$"
  },
  HNL: {
    symbol: "L."
  },
  HRK: {
    symbol: "kn"
  },
  HTG: {
    symbol: "G"
  },
  HUF: {
    symbol: "Ft"
  },
  IDR: {
    symbol: "Rp"
  },
  ILS: {
    symbol: "\u20AA"
  },
  INR: {
    symbol: "\u20B9"
  },
  IQD: {
    symbol: "\u062F.\u0639.\u200F"
  },
  IRR: {
    symbol: "\uFDFC"
  },
  ISK: {
    symbol: "kr."
  },
  JMD: {
    symbol: "J$"
  },
  JOD: {
    symbol: "\u062F.\u0627.\u200F"
  },
  JPY: {
    symbol: "\xA5"
  },
  KES: {
    symbol: "S"
  },
  KGS: {
    symbol: "\u0441\u043E\u043C"
  },
  KHR: {
    symbol: "\u17DB"
  },
  KMF: {
    symbol: "CF"
  },
  KPW: {
    symbol: "\u20A9"
  },
  KRW: {
    symbol: "\u20A9"
  },
  KWD: {
    symbol: "\u062F.\u0643.\u200F"
  },
  KYD: {
    symbol: "$"
  },
  KZT: {
    symbol: "\u20B8"
  },
  LAK: {
    symbol: "\u20AD"
  },
  LBP: {
    symbol: "\u0644.\u0644.\u200F"
  },
  LKR: {
    symbol: "\u20A8"
  },
  LRD: {
    symbol: "L$"
  },
  LSL: {
    symbol: "M"
  },
  LYD: {
    symbol: "\u062F.\u0644.\u200F"
  },
  MAD: {
    symbol: "\u062F.\u0645.\u200F"
  },
  MDL: {
    symbol: "lei"
  },
  MGA: {
    symbol: "Ar"
  },
  MKD: {
    symbol: "\u0434\u0435\u043D."
  },
  MMK: {
    symbol: "K"
  },
  MNT: {
    symbol: "\u20AE"
  },
  MOP: {
    symbol: "MOP$"
  },
  MRO: {
    symbol: "UM"
  },
  MTL: {
    symbol: "\u20A4"
  },
  MUR: {
    symbol: "\u20A8"
  },
  MVR: {
    symbol: "MVR"
  },
  MWK: {
    symbol: "MK"
  },
  MXN: {
    symbol: "MX$"
  },
  MYR: {
    symbol: "RM"
  },
  MZN: {
    symbol: "MT"
  },
  NAD: {
    symbol: "N$"
  },
  NGN: {
    symbol: "\u20A6"
  },
  NIO: {
    symbol: "C$"
  },
  NOK: {
    symbol: "kr"
  },
  NPR: {
    symbol: "\u20A8"
  },
  NZD: {
    symbol: "NZ$"
  },
  OMR: {
    symbol: "\uFDFC"
  },
  PAB: {
    symbol: "B/."
  },
  PEN: {
    symbol: "S/."
  },
  PGK: {
    symbol: "K"
  },
  PHP: {
    symbol: "\u20B1"
  },
  PKR: {
    symbol: "\u20A8"
  },
  PLN: {
    symbol: "z\u0142"
  },
  PYG: {
    symbol: "\u20B2"
  },
  QAR: {
    symbol: "\uFDFC"
  },
  RON: {
    symbol: "lei"
  },
  RSD: {
    symbol: "\u0414\u0438\u043D."
  },
  RUB: {
    symbol: "\u20BD"
  },
  RWF: {
    symbol: "RWF"
  },
  SAR: {
    symbol: "\uFDFC"
  },
  SBD: {
    symbol: "S$"
  },
  SCR: {
    symbol: "\u20A8"
  },
  SDD: {
    symbol: "LSd"
  },
  SDG: {
    symbol: "\xA3\u200F"
  },
  SEK: {
    symbol: "kr"
  },
  SGD: {
    symbol: "S$"
  },
  SHP: {
    symbol: "\xA3"
  },
  SLL: {
    symbol: "Le"
  },
  SOS: {
    symbol: "S"
  },
  SRD: {
    symbol: "$"
  },
  STD: {
    symbol: "Db"
  },
  SVC: {
    symbol: "\u20A1"
  },
  SYP: {
    symbol: "\xA3"
  },
  SZL: {
    symbol: "E"
  },
  THB: {
    symbol: "\u0E3F"
  },
  TJS: {
    symbol: "TJS"
  },
  TMT: {
    symbol: "m"
  },
  TND: {
    symbol: "\u062F.\u062A.\u200F"
  },
  TOP: {
    symbol: "T$"
  },
  TRY: {
    symbol: "TL"
  },
  TTD: {
    symbol: "TT$"
  },
  TVD: {
    symbol: "$T"
  },
  TWD: {
    symbol: "NT$"
  },
  TZS: {
    symbol: "TSh"
  },
  UAH: {
    symbol: "\u20B4"
  },
  UGX: {
    symbol: "USh"
  },
  USD: {
    // No override. Do what the locale thinks is best.
  },
  UYU: {
    symbol: "$U"
  },
  UZS: {
    symbol: "\u0441\u045E\u043C"
  },
  VEB: {
    symbol: "Bs."
  },
  VEF: {
    symbol: "Bs. F."
  },
  VND: {
    symbol: "\u20AB"
  },
  VUV: {
    symbol: "VT"
  },
  WST: {
    symbol: "WS$"
  },
  XAF: {
    symbol: "F"
  },
  XCD: {
    symbol: "$"
  },
  XOF: {
    symbol: "F"
  },
  XPF: {
    symbol: "F"
  },
  YER: {
    symbol: "\uFDFC"
  },
  ZAR: {
    symbol: "R"
  },
  ZMW: {
    symbol: "ZK"
  },
  WON: {
    symbol: "\u20A9"
  }
};

// ../../js-packages/number-formatters/dist/esm/number-format-currency/index.js
var debug2 = (0, import_debug2.default)("number-formatters:number-format-currency");
function getCurrencyOverride(currency, geoLocation) {
  if (currency === "USD" && geoLocation && geoLocation !== "" && geoLocation !== "US") {
    return { symbol: "US$" };
  }
  return defaultCurrencyOverrides[currency];
}
function getValidCurrency(currency, geoLocation) {
  if (!getCurrencyOverride(currency, geoLocation)) {
    debug2(`getValidCurrency was called with a non-existent currency "${currency}"; falling back to ${FALLBACK_CURRENCY}`);
    return FALLBACK_CURRENCY;
  }
  return currency;
}
function getCurrencyFormatter({ number, currency, browserSafeLocale, forceLatin = true, stripZeros, signForPositive }) {
  const locale = `${browserSafeLocale}${forceLatin ? "-u-nu-latn" : ""}`;
  const numberFormatOptions = {
    style: "currency",
    currency,
    ...stripZeros && Number.isInteger(number) && {
      /**
       * There's an option called `trailingZeroDisplay` but it does not yet work
       * in FF so we have to strip zeros manually.
       */
      maximumFractionDigits: 0,
      minimumFractionDigits: 0
    },
    ...signForPositive && { signDisplay: "exceptZero" }
  };
  return getCachedFormatter({
    locale,
    options: numberFormatOptions
  });
}
function getPrecisionForLocaleAndCurrency(browserSafeLocale, currency, forceLatin) {
  const formatter = getCurrencyFormatter({ number: 0, currency, browserSafeLocale, forceLatin });
  return formatter.resolvedOptions().maximumFractionDigits;
}
function scaleNumberForPrecision(number, currencyPrecision) {
  const scale = Math.pow(10, currencyPrecision);
  return Math.round(number * scale) / scale;
}
function prepareNumberForFormatting(number, currencyPrecision, isSmallestUnit) {
  if (isNaN(number)) {
    debug2("formatCurrency was called with NaN");
    return 0;
  }
  if (isSmallestUnit) {
    if (!Number.isInteger(number)) {
      debug2("formatCurrency was called with isSmallestUnit and a float which will be rounded", number);
    }
    const smallestUnitDivisor = 10 ** currencyPrecision;
    return scaleNumberForPrecision(Math.round(number) / smallestUnitDivisor, currencyPrecision);
  }
  return scaleNumberForPrecision(number, currencyPrecision);
}
var numberFormatCurrency = ({ number, browserSafeLocale, currency, stripZeros, isSmallestUnit, signForPositive, geoLocation, forceLatin }) => {
  const validCurrency = getValidCurrency(currency, geoLocation);
  const currencyOverride = getCurrencyOverride(validCurrency, geoLocation);
  const currencyPrecision = getPrecisionForLocaleAndCurrency(browserSafeLocale, validCurrency, forceLatin);
  if (isSmallestUnit && typeof currencyPrecision === "undefined") {
    throw new Error(`Could not determine currency precision for ${validCurrency} in ${browserSafeLocale}`);
  }
  const numberAsFloat = prepareNumberForFormatting(number, currencyPrecision ?? 0, isSmallestUnit);
  const formatter = getCurrencyFormatter({
    number: numberAsFloat,
    currency: validCurrency,
    browserSafeLocale,
    forceLatin,
    stripZeros,
    signForPositive
  });
  const parts = formatter.formatToParts(numberAsFloat);
  return parts.reduce((formatted, part) => {
    switch (part.type) {
      case "currency":
        if (currencyOverride?.symbol) {
          return formatted + currencyOverride.symbol;
        }
        return formatted + part.value;
      default:
        return formatted + part.value;
    }
  }, "");
};
var getCurrencyObject = ({ number, browserSafeLocale, currency, stripZeros, isSmallestUnit, signForPositive, geoLocation, forceLatin }) => {
  const validCurrency = getValidCurrency(currency, geoLocation);
  const currencyOverride = getCurrencyOverride(validCurrency, geoLocation);
  const currencyPrecision = getPrecisionForLocaleAndCurrency(browserSafeLocale, validCurrency, forceLatin);
  const numberAsFloat = prepareNumberForFormatting(number, currencyPrecision ?? 0, isSmallestUnit);
  const formatter = getCurrencyFormatter({
    number: numberAsFloat,
    currency: validCurrency,
    browserSafeLocale,
    forceLatin,
    stripZeros,
    signForPositive
  });
  const parts = formatter.formatToParts(numberAsFloat);
  let sign = "";
  let symbol3 = "$";
  let symbolPosition = "before";
  let hasAmountBeenSet = false;
  let hasDecimalBeenSet = false;
  let integer = "";
  let fraction = "";
  parts.forEach((part) => {
    switch (part.type) {
      case "currency":
        symbol3 = currencyOverride?.symbol ?? part.value;
        if (hasAmountBeenSet) {
          symbolPosition = "after";
        }
        return;
      case "group":
        integer += part.value;
        hasAmountBeenSet = true;
        return;
      case "decimal":
        fraction += part.value;
        hasAmountBeenSet = true;
        hasDecimalBeenSet = true;
        return;
      case "integer":
        integer += part.value;
        hasAmountBeenSet = true;
        return;
      case "fraction":
        fraction += part.value;
        hasAmountBeenSet = true;
        hasDecimalBeenSet = true;
        return;
      case "minusSign":
        sign = "-";
        return;
      case "plusSign":
        sign = "+";
    }
  });
  const hasNonZeroFraction = !Number.isInteger(numberAsFloat) && hasDecimalBeenSet;
  return {
    sign,
    symbol: symbol3,
    symbolPosition,
    integer,
    fraction,
    hasNonZeroFraction,
    floatValue: numberAsFloat
  };
};

// ../../js-packages/number-formatters/dist/esm/number-format.js
var numberFormat = ({ browserSafeLocale, decimals = 0, forceLatin = true, numberFormatOptions = {} }) => {
  const locale = `${browserSafeLocale}${forceLatin ? "-u-nu-latn" : ""}`;
  const options = {
    minimumFractionDigits: decimals,
    // minimumFractionDigits default is 0
    maximumFractionDigits: decimals,
    // maximumFractionDigits default is the greater between minimumFractionDigits and 3
    ...numberFormatOptions
  };
  return getCachedFormatter({ locale, options });
};
var numberFormatCompact = ({ numberFormatOptions = {}, ...params }) => numberFormat({
  ...params,
  numberFormatOptions: {
    notation: "compact",
    maximumFractionDigits: 1,
    ...numberFormatOptions
  }
});

// ../../js-packages/number-formatters/dist/esm/create-number-formatters.js
function createNumberFormatters() {
  let localeState;
  let geoLocationState;
  const setLocale2 = (locale) => {
    localeState = locale;
  };
  const getBrowserSafeLocale = () => {
    const { l10n: { locale: localeFromUserSettings } } = (0, import_date.getSettings)();
    return (localeState ?? (localeFromUserSettings || global?.window?.navigator?.language) ?? FALLBACK_LOCALE).split("_")[0];
  };
  const setGeoLocation2 = (geoLocation) => {
    geoLocationState = geoLocation;
  };
  const formatNumber5 = (number, { decimals = 0, forceLatin = true, numberFormatOptions = {} } = {}) => {
    try {
      const formatter = numberFormat({
        browserSafeLocale: getBrowserSafeLocale(),
        decimals,
        forceLatin,
        numberFormatOptions
      });
      return formatter.format(number);
    } catch {
      return String(number);
    }
  };
  const formatNumberCompact2 = (number, { decimals = 0, forceLatin = true, numberFormatOptions = {} } = {}) => {
    try {
      const formatter = numberFormatCompact({
        browserSafeLocale: getBrowserSafeLocale(),
        decimals,
        forceLatin,
        numberFormatOptions
      });
      return formatter.format(number);
    } catch {
      return String(number);
    }
  };
  const formatCurrency2 = (number, currency, { stripZeros = false, isSmallestUnit = false, signForPositive = false, forceLatin = true } = {}) => {
    return numberFormatCurrency({
      number,
      currency,
      browserSafeLocale: getBrowserSafeLocale(),
      stripZeros,
      isSmallestUnit,
      signForPositive,
      geoLocation: geoLocationState,
      forceLatin
    });
  };
  const getCurrencyObject3 = (number, currency, { stripZeros = false, isSmallestUnit = false, signForPositive = false, forceLatin = true } = {}) => {
    return getCurrencyObject({
      number,
      currency,
      browserSafeLocale: getBrowserSafeLocale(),
      stripZeros,
      isSmallestUnit,
      signForPositive,
      geoLocation: geoLocationState,
      forceLatin
    });
  };
  return {
    setLocale: setLocale2,
    setGeoLocation: setGeoLocation2,
    formatNumber: formatNumber5,
    formatNumberCompact: formatNumberCompact2,
    formatCurrency: formatCurrency2,
    getCurrencyObject: getCurrencyObject3
  };
}
var create_number_formatters_default = createNumberFormatters;

// ../../js-packages/number-formatters/dist/esm/index.js
var defaultFormatter = create_number_formatters_default();
var { setLocale, setGeoLocation, formatNumber: formatNumber2, formatNumberCompact, formatCurrency, getCurrencyObject: getCurrencyObject2 } = defaultFormatter;

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/admin-ui/build-module/breadcrumbs/index.mjs
var import_i18n = __toESM(require_i18n(), 1);
var import_components = __toESM(require_components(), 1);
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
import { Link } from "@wordpress/route";
var BreadcrumbItem = ({
  item: { label, to }
}) => {
  if (!to) {
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHeading, { level: 1, truncate: true, children: label }) });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { to, children: label }) });
};
var Breadcrumbs = ({ items }) => {
  if (!items.length) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { "aria-label": (0, import_i18n.__)("Breadcrumbs"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
    import_components.__experimentalHStack,
    {
      as: "ul",
      className: "admin-ui-breadcrumbs__list",
      spacing: 0,
      justify: "flex-start",
      alignment: "center",
      children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BreadcrumbItem, { item }, index))
    }
  ) });
};
var breadcrumbs_default = Breadcrumbs;

// ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
function r(e2) {
  var t2, f2, n2 = "";
  if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
  else if ("object" == typeof e2) if (Array.isArray(e2)) {
    var o2 = e2.length;
    for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
  } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2);
  return n2;
}
function clsx() {
  for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2);
  return n2;
}
var clsx_default = clsx;

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/admin-ui/build-module/navigable-region/index.mjs
var import_element = __toESM(require_element(), 1);
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
var NavigableRegion = (0, import_element.forwardRef)(
  ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
    return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
      Tag,
      {
        ref,
        className: clsx_default("admin-ui-navigable-region", className),
        "aria-label": ariaLabel,
        role: "region",
        tabIndex: "-1",
        ...props,
        children
      }
    );
  }
);
NavigableRegion.displayName = "NavigableRegion";
var navigable_region_default = NavigableRegion;

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/admin-ui/build-module/page/header.mjs
var import_components3 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/admin-ui/build-module/page/sidebar-toggle-slot.mjs
var import_components2 = __toESM(require_components(), 1);
var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components2.createSlotFill)("SidebarToggle");

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/admin-ui/build-module/page/header.mjs
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
function Header({
  breadcrumbs,
  badges,
  title,
  subTitle,
  actions: actions2,
  showSidebarToggle = true
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_components3.__experimentalVStack, { className: "admin-ui-page__header", as: "header", children: [
    /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_components3.__experimentalHStack, { justify: "space-between", spacing: 2, children: [
      /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_components3.__experimentalHStack, { spacing: 2, justify: "left", children: [
        showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
          SidebarToggleSlot,
          {
            bubblesVirtually: true,
            className: "admin-ui-page__sidebar-toggle-slot"
          }
        ),
        title && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_components3.__experimentalHeading, { as: "h2", level: 3, weight: 500, truncate: true, children: title }),
        breadcrumbs,
        badges
      ] }),
      /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
        import_components3.__experimentalHStack,
        {
          style: { width: "auto", flexShrink: 0 },
          spacing: 2,
          className: "admin-ui-page__header-actions",
          children: actions2
        }
      )
    ] }),
    subTitle && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle })
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.8.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wordpress/admin-ui/build-module/page/index.mjs
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
function Page({
  breadcrumbs,
  badges,
  title,
  subTitle,
  children,
  className,
  actions: actions2,
  hasPadding = false,
  showSidebarToggle = true
}) {
  const classes = clsx_default("admin-ui-page", className);
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(navigable_region_default, { className: classes, ariaLabel: title, children: [
    (title || breadcrumbs || badges) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
      Header,
      {
        breadcrumbs,
        badges,
        title,
        subTitle,
        actions: actions2,
        showSidebarToggle
      }
    ),
    hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children
  ] });
}
Page.SidebarToggleFill = SidebarToggleFill;
var page_default = Page;

// routes/responses/stage.tsx
var import_components78 = __toESM(require_components());
var import_data33 = __toESM(require_data());

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/dataviews/index.mjs
var import_element55 = __toESM(require_element(), 1);
var import_compose12 = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useControlled.js
var React = __toESM(require_react(), 1);
function useControlled({
  controlled,
  default: defaultProp,
  name,
  state = "value"
}) {
  const {
    current: isControlled
  } = React.useRef(controlled !== void 0);
  const [valueState, setValue] = React.useState(defaultProp);
  const value = isControlled ? controlled : valueState;
  if (true) {
    React.useEffect(() => {
      if (isControlled !== (controlled !== void 0)) {
        console.error([`Base UI: A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
      }
    }, [state, name, controlled]);
    const {
      current: defaultValue2
    } = React.useRef(defaultProp);
    React.useEffect(() => {
      if (!isControlled && JSON.stringify(defaultValue2) !== JSON.stringify(defaultProp)) {
        console.error([`Base UI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
      }
    }, [JSON.stringify(defaultProp)]);
  }
  const setValueIfUncontrolled = React.useCallback((newValue) => {
    if (!isControlled) {
      setValue(newValue);
    }
  }, []);
  return [value, setValueIfUncontrolled];
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useStableCallback.js
var React3 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useRefWithInit.js
var React2 = __toESM(require_react(), 1);
var UNINITIALIZED = {};
function useRefWithInit(init2, initArg) {
  const ref = React2.useRef(UNINITIALIZED);
  if (ref.current === UNINITIALIZED) {
    ref.current = init2(initArg);
  }
  return ref;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useStableCallback.js
var useInsertionEffect = React3[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)];
var useSafeInsertionEffect = (
  // React 17 doesn't have useInsertionEffect.
  useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
  useInsertionEffect !== React3.useLayoutEffect ? useInsertionEffect : (fn) => fn()
);
function useStableCallback(callback) {
  const stable = useRefWithInit(createStableCallback).current;
  stable.next = callback;
  useSafeInsertionEffect(stable.effect);
  return stable.trampoline;
}
function createStableCallback() {
  const stable = {
    next: void 0,
    callback: assertNotCalled,
    trampoline: (...args) => stable.callback?.(...args),
    effect: () => {
      stable.callback = stable.next;
    }
  };
  return stable;
}
function assertNotCalled() {
  if (true) {
    throw new Error("Base UI: Cannot call an event handler while rendering.");
  }
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js
var React4 = __toESM(require_react(), 1);
var noop = () => {
};
var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop;

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/CompositeList.js
var React6 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/CompositeListContext.js
var React5 = __toESM(require_react(), 1);
var CompositeListContext = /* @__PURE__ */ React5.createContext({
  register: () => {
  },
  unregister: () => {
  },
  subscribeMapChange: () => {
    return () => {
    };
  },
  elementsRef: {
    current: []
  },
  nextIndexRef: {
    current: 0
  }
});
if (true) CompositeListContext.displayName = "CompositeListContext";
function useCompositeListContext() {
  return React5.useContext(CompositeListContext);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/CompositeList.js
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
function CompositeList(props) {
  const {
    children,
    elementsRef,
    labelsRef,
    onMapChange: onMapChangeProp
  } = props;
  const onMapChange = useStableCallback(onMapChangeProp);
  const nextIndexRef = React6.useRef(0);
  const listeners = useRefWithInit(createListeners).current;
  const map = useRefWithInit(createMap).current;
  const [mapTick, setMapTick] = React6.useState(0);
  const lastTickRef = React6.useRef(mapTick);
  const register6 = useStableCallback((node, metadata) => {
    map.set(node, metadata ?? null);
    lastTickRef.current += 1;
    setMapTick(lastTickRef.current);
  });
  const unregister = useStableCallback((node) => {
    map.delete(node);
    lastTickRef.current += 1;
    setMapTick(lastTickRef.current);
  });
  const sortedMap = React6.useMemo(() => {
    disableEslintWarning(mapTick);
    const newMap = /* @__PURE__ */ new Map();
    const sortedNodes = Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition);
    sortedNodes.forEach((node, index) => {
      const metadata = map.get(node) ?? {};
      newMap.set(node, {
        ...metadata,
        index
      });
    });
    return newMap;
  }, [map, mapTick]);
  useIsoLayoutEffect(() => {
    if (typeof MutationObserver !== "function" || sortedMap.size === 0) {
      return void 0;
    }
    const mutationObserver = new MutationObserver((entries) => {
      const diff = /* @__PURE__ */ new Set();
      const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
      entries.forEach((entry) => {
        entry.removedNodes.forEach(updateDiff);
        entry.addedNodes.forEach(updateDiff);
      });
      if (diff.size === 0) {
        lastTickRef.current += 1;
        setMapTick(lastTickRef.current);
      }
    });
    sortedMap.forEach((_, node) => {
      if (node.parentElement) {
        mutationObserver.observe(node.parentElement, {
          childList: true
        });
      }
    });
    return () => {
      mutationObserver.disconnect();
    };
  }, [sortedMap]);
  useIsoLayoutEffect(() => {
    const shouldUpdateLengths = lastTickRef.current === mapTick;
    if (shouldUpdateLengths) {
      if (elementsRef.current.length !== sortedMap.size) {
        elementsRef.current.length = sortedMap.size;
      }
      if (labelsRef && labelsRef.current.length !== sortedMap.size) {
        labelsRef.current.length = sortedMap.size;
      }
      nextIndexRef.current = sortedMap.size;
    }
    onMapChange(sortedMap);
  }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]);
  useIsoLayoutEffect(() => {
    return () => {
      elementsRef.current = [];
    };
  }, [elementsRef]);
  useIsoLayoutEffect(() => {
    return () => {
      if (labelsRef) {
        labelsRef.current = [];
      }
    };
  }, [labelsRef]);
  const subscribeMapChange = useStableCallback((fn) => {
    listeners.add(fn);
    return () => {
      listeners.delete(fn);
    };
  });
  useIsoLayoutEffect(() => {
    listeners.forEach((l2) => l2(sortedMap));
  }, [listeners, sortedMap]);
  const contextValue = React6.useMemo(() => ({
    register: register6,
    unregister,
    subscribeMapChange,
    elementsRef,
    labelsRef,
    nextIndexRef
  }), [register6, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]);
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CompositeListContext.Provider, {
    value: contextValue,
    children
  });
}
function createMap() {
  return /* @__PURE__ */ new Map();
}
function createListeners() {
  return /* @__PURE__ */ new Set();
}
function sortByDocumentPosition(a2, b2) {
  const position = a2.compareDocumentPosition(b2);
  if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
    return -1;
  }
  if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
    return 1;
  }
  return 0;
}
function disableEslintWarning(_) {
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/direction-provider/DirectionContext.js
var React7 = __toESM(require_react(), 1);
var DirectionContext = /* @__PURE__ */ React7.createContext(void 0);
if (true) DirectionContext.displayName = "DirectionContext";
function useDirection() {
  const context = React7.useContext(DirectionContext);
  return context?.direction ?? "ltr";
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
var React10 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useMergedRefs.js
function useMergedRefs(a2, b2, c2, d2) {
  const forkRef = useRefWithInit(createForkRef).current;
  if (didChange(forkRef, a2, b2, c2, d2)) {
    update(forkRef, [a2, b2, c2, d2]);
  }
  return forkRef.callback;
}
function useMergedRefsN(refs) {
  const forkRef = useRefWithInit(createForkRef).current;
  if (didChangeN(forkRef, refs)) {
    update(forkRef, refs);
  }
  return forkRef.callback;
}
function createForkRef() {
  return {
    callback: null,
    cleanup: null,
    refs: []
  };
}
function didChange(forkRef, a2, b2, c2, d2) {
  return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d2;
}
function didChangeN(forkRef, newRefs) {
  return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
}
function update(forkRef, refs) {
  forkRef.refs = refs;
  if (refs.every((ref) => ref == null)) {
    forkRef.callback = null;
    return;
  }
  forkRef.callback = (instance) => {
    if (forkRef.cleanup) {
      forkRef.cleanup();
      forkRef.cleanup = null;
    }
    if (instance != null) {
      const cleanupCallbacks = Array(refs.length).fill(null);
      for (let i2 = 0; i2 < refs.length; i2 += 1) {
        const ref = refs[i2];
        if (ref == null) {
          continue;
        }
        switch (typeof ref) {
          case "function": {
            const refCleanup = ref(instance);
            if (typeof refCleanup === "function") {
              cleanupCallbacks[i2] = refCleanup;
            }
            break;
          }
          case "object": {
            ref.current = instance;
            break;
          }
          default:
        }
      }
      forkRef.cleanup = () => {
        for (let i2 = 0; i2 < refs.length; i2 += 1) {
          const ref = refs[i2];
          if (ref == null) {
            continue;
          }
          switch (typeof ref) {
            case "function": {
              const cleanupCallback = cleanupCallbacks[i2];
              if (typeof cleanupCallback === "function") {
                cleanupCallback();
              } else {
                ref(null);
              }
              break;
            }
            case "object": {
              ref.current = null;
              break;
            }
            default:
          }
        }
      };
    }
  };
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
var React9 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/reactVersion.js
var React8 = __toESM(require_react(), 1);
var majorVersion = parseInt(React8.version, 10);
function isReactVersionAtLeast(reactVersionToCheck) {
  return majorVersion >= reactVersionToCheck;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
function getReactElementRef(element) {
  if (!/* @__PURE__ */ React9.isValidElement(element)) {
    return null;
  }
  const reactElement = element;
  const propsWithRef = reactElement.props;
  return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/mergeObjects.js
function mergeObjects(a2, b2) {
  if (a2 && !b2) {
    return a2;
  }
  if (!a2 && b2) {
    return b2;
  }
  if (a2 || b2) {
    return {
      ...a2,
      ...b2
    };
  }
  return void 0;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js
function getStateAttributesProps(state, customMapping) {
  const props = {};
  for (const key in state) {
    const value = state[key];
    if (customMapping?.hasOwnProperty(key)) {
      const customProps = customMapping[key](value);
      if (customProps != null) {
        Object.assign(props, customProps);
      }
      continue;
    }
    if (value === true) {
      props[`data-${key.toLowerCase()}`] = "";
    } else if (value) {
      props[`data-${key.toLowerCase()}`] = value.toString();
    }
  }
  return props;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveClassName.js
function resolveClassName(className, state) {
  return typeof className === "function" ? className(state) : className;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveStyle.js
function resolveStyle(style, state) {
  return typeof style === "function" ? style(state) : style;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/merge-props/mergeProps.js
var EMPTY_PROPS = {};
function mergeProps(a2, b2, c2, d2, e2) {
  let merged = {
    ...resolvePropsGetter(a2, EMPTY_PROPS)
  };
  if (b2) {
    merged = mergeOne(merged, b2);
  }
  if (c2) {
    merged = mergeOne(merged, c2);
  }
  if (d2) {
    merged = mergeOne(merged, d2);
  }
  if (e2) {
    merged = mergeOne(merged, e2);
  }
  return merged;
}
function mergePropsN(props) {
  if (props.length === 0) {
    return EMPTY_PROPS;
  }
  if (props.length === 1) {
    return resolvePropsGetter(props[0], EMPTY_PROPS);
  }
  let merged = {
    ...resolvePropsGetter(props[0], EMPTY_PROPS)
  };
  for (let i2 = 1; i2 < props.length; i2 += 1) {
    merged = mergeOne(merged, props[i2]);
  }
  return merged;
}
function mergeOne(merged, inputProps) {
  if (isPropsGetter(inputProps)) {
    return inputProps(merged);
  }
  return mutablyMergeInto(merged, inputProps);
}
function mutablyMergeInto(mergedProps, externalProps) {
  if (!externalProps) {
    return mergedProps;
  }
  for (const propName in externalProps) {
    const externalPropValue = externalProps[propName];
    switch (propName) {
      case "style": {
        mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
        break;
      }
      case "className": {
        mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
        break;
      }
      default: {
        if (isEventHandler(propName, externalPropValue)) {
          mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
        } else {
          mergedProps[propName] = externalPropValue;
        }
      }
    }
  }
  return mergedProps;
}
function isEventHandler(key, value) {
  const code0 = key.charCodeAt(0);
  const code1 = key.charCodeAt(1);
  const code2 = key.charCodeAt(2);
  return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
}
function isPropsGetter(inputProps) {
  return typeof inputProps === "function";
}
function resolvePropsGetter(inputProps, previousProps) {
  if (isPropsGetter(inputProps)) {
    return inputProps(previousProps);
  }
  return inputProps ?? EMPTY_PROPS;
}
function mergeEventHandlers(ourHandler, theirHandler) {
  if (!theirHandler) {
    return ourHandler;
  }
  if (!ourHandler) {
    return theirHandler;
  }
  return (event) => {
    if (isSyntheticEvent(event)) {
      const baseUIEvent = event;
      makeEventPreventable(baseUIEvent);
      const result3 = theirHandler(baseUIEvent);
      if (!baseUIEvent.baseUIHandlerPrevented) {
        ourHandler?.(baseUIEvent);
      }
      return result3;
    }
    const result2 = theirHandler(event);
    ourHandler?.(event);
    return result2;
  };
}
function makeEventPreventable(event) {
  event.preventBaseUIHandler = () => {
    event.baseUIHandlerPrevented = true;
  };
  return event;
}
function mergeClassNames(ourClassName, theirClassName) {
  if (theirClassName) {
    if (ourClassName) {
      return theirClassName + " " + ourClassName;
    }
    return theirClassName;
  }
  return ourClassName;
}
function isSyntheticEvent(event) {
  return event != null && typeof event === "object" && "nativeEvent" in event;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/empty.js
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
var import_react = __toESM(require_react(), 1);
function useRenderElement(element, componentProps, params = {}) {
  const renderProp = componentProps.render;
  const outProps = useRenderElementProps(componentProps, params);
  if (params.enabled === false) {
    return null;
  }
  const state = params.state ?? EMPTY_OBJECT;
  return evaluateRenderProp(element, renderProp, outProps, state);
}
function useRenderElementProps(componentProps, params = {}) {
  const {
    className: classNameProp,
    style: styleProp,
    render: renderProp
  } = componentProps;
  const {
    state = EMPTY_OBJECT,
    ref,
    props,
    stateAttributesMapping: stateAttributesMapping2,
    enabled = true
  } = params;
  const className = enabled ? resolveClassName(classNameProp, state) : void 0;
  const style = enabled ? resolveStyle(styleProp, state) : void 0;
  const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping2) : EMPTY_OBJECT;
  const outProps = enabled ? mergeObjects(stateProps, Array.isArray(props) ? mergePropsN(props) : props) ?? EMPTY_OBJECT : EMPTY_OBJECT;
  if (typeof document !== "undefined") {
    if (!enabled) {
      useMergedRefs(null, null);
    } else if (Array.isArray(ref)) {
      outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
    } else {
      outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
    }
  }
  if (!enabled) {
    return EMPTY_OBJECT;
  }
  if (className !== void 0) {
    outProps.className = mergeClassNames(outProps.className, className);
  }
  if (style !== void 0) {
    outProps.style = mergeObjects(outProps.style, style);
  }
  return outProps;
}
function evaluateRenderProp(element, render4, props, state) {
  if (render4) {
    if (typeof render4 === "function") {
      return render4(props, state);
    }
    const mergedProps = mergeProps(props, render4.props);
    mergedProps.ref = props.ref;
    return /* @__PURE__ */ React10.cloneElement(render4, mergedProps);
  }
  if (element) {
    if (typeof element === "string") {
      return renderTag(element, props);
    }
  }
  throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage(8));
}
function renderTag(Tag, props) {
  if (Tag === "button") {
    return /* @__PURE__ */ (0, import_react.createElement)("button", {
      type: "button",
      ...props,
      key: props.key
    });
  }
  if (Tag === "img") {
    return /* @__PURE__ */ (0, import_react.createElement)("img", {
      alt: "",
      ...props,
      key: props.key
    });
  }
  return /* @__PURE__ */ React10.createElement(Tag, props);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/reason-parts.js
var reason_parts_exports = {};
__export(reason_parts_exports, {
  cancelOpen: () => cancelOpen,
  chipRemovePress: () => chipRemovePress,
  clearPress: () => clearPress,
  closePress: () => closePress,
  decrementPress: () => decrementPress,
  disabled: () => disabled,
  drag: () => drag,
  escapeKey: () => escapeKey,
  focusOut: () => focusOut,
  imperativeAction: () => imperativeAction,
  incrementPress: () => incrementPress,
  inputBlur: () => inputBlur,
  inputChange: () => inputChange,
  inputClear: () => inputClear,
  inputPaste: () => inputPaste,
  itemPress: () => itemPress,
  keyboard: () => keyboard,
  linkPress: () => linkPress,
  listNavigation: () => listNavigation,
  none: () => none,
  outsidePress: () => outsidePress,
  pointer: () => pointer,
  scrub: () => scrub,
  siblingOpen: () => siblingOpen,
  trackPress: () => trackPress,
  triggerFocus: () => triggerFocus,
  triggerHover: () => triggerHover,
  triggerPress: () => triggerPress,
  wheel: () => wheel,
  windowResize: () => windowResize
});
var none = "none";
var triggerPress = "trigger-press";
var triggerHover = "trigger-hover";
var triggerFocus = "trigger-focus";
var outsidePress = "outside-press";
var itemPress = "item-press";
var closePress = "close-press";
var linkPress = "link-press";
var clearPress = "clear-press";
var chipRemovePress = "chip-remove-press";
var trackPress = "track-press";
var incrementPress = "increment-press";
var decrementPress = "decrement-press";
var inputChange = "input-change";
var inputClear = "input-clear";
var inputBlur = "input-blur";
var inputPaste = "input-paste";
var focusOut = "focus-out";
var escapeKey = "escape-key";
var listNavigation = "list-navigation";
var keyboard = "keyboard";
var pointer = "pointer";
var drag = "drag";
var wheel = "wheel";
var scrub = "scrub";
var cancelOpen = "cancel-open";
var siblingOpen = "sibling-open";
var disabled = "disabled";
var imperativeAction = "imperative-action";
var windowResize = "window-resize";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/createBaseUIEventDetails.js
function createChangeEventDetails(reason, event, trigger, customProperties) {
  let canceled = false;
  let allowPropagation = false;
  const custom = customProperties ?? EMPTY_OBJECT;
  const details = {
    reason,
    event: event ?? new Event("base-ui"),
    cancel() {
      canceled = true;
    },
    allowPropagation() {
      allowPropagation = true;
    },
    get isCanceled() {
      return canceled;
    },
    get isPropagationAllowed() {
      return allowPropagation;
    },
    trigger,
    ...custom
  };
  return details;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useId.js
var React12 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/safeReact.js
var React11 = __toESM(require_react(), 1);
var SafeReact = {
  ...React11
};

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useId.js
var globalId = 0;
function useGlobalId(idOverride, prefix = "mui") {
  const [defaultId, setDefaultId] = React12.useState(idOverride);
  const id = idOverride || defaultId;
  React12.useEffect(() => {
    if (defaultId == null) {
      globalId += 1;
      setDefaultId(`${prefix}-${globalId}`);
    }
  }, [defaultId, prefix]);
  return id;
}
var maybeReactUseId = SafeReact.useId;
function useId(idOverride, prefix) {
  if (maybeReactUseId !== void 0) {
    const reactId = maybeReactUseId();
    return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
  }
  return useGlobalId(idOverride, prefix);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useBaseUiId.js
function useBaseUiId(idOverride) {
  return useId(idOverride, "base-ui");
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useOnMount.js
var React13 = __toESM(require_react(), 1);
var EMPTY = [];
function useOnMount(fn) {
  React13.useEffect(fn, EMPTY);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/useCompositeListItem.js
var React14 = __toESM(require_react(), 1);
var IndexGuessBehavior = /* @__PURE__ */ (function(IndexGuessBehavior2) {
  IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None";
  IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder";
  return IndexGuessBehavior2;
})({});
function useCompositeListItem(params = {}) {
  const {
    label,
    metadata,
    textRef,
    indexGuessBehavior,
    index: externalIndex
  } = params;
  const {
    register: register6,
    unregister,
    subscribeMapChange,
    elementsRef,
    labelsRef,
    nextIndexRef
  } = useCompositeListContext();
  const indexRef = React14.useRef(-1);
  const [index, setIndex] = React14.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
    if (indexRef.current === -1) {
      const newIndex = nextIndexRef.current;
      nextIndexRef.current += 1;
      indexRef.current = newIndex;
    }
    return indexRef.current;
  } : -1));
  const componentRef = React14.useRef(null);
  const ref = React14.useCallback((node) => {
    componentRef.current = node;
    if (index !== -1 && node !== null) {
      elementsRef.current[index] = node;
      if (labelsRef) {
        const isLabelDefined = label !== void 0;
        labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
      }
    }
  }, [index, elementsRef, labelsRef, label, textRef]);
  useIsoLayoutEffect(() => {
    if (externalIndex != null) {
      return void 0;
    }
    const node = componentRef.current;
    if (node) {
      register6(node, metadata);
      return () => {
        unregister(node);
      };
    }
    return void 0;
  }, [externalIndex, register6, unregister, metadata]);
  useIsoLayoutEffect(() => {
    if (externalIndex != null) {
      return void 0;
    }
    return subscribeMapChange((map) => {
      const i2 = componentRef.current ? map.get(componentRef.current)?.index : null;
      if (i2 != null) {
        setIndex(i2);
      }
    });
  }, [externalIndex, subscribeMapChange, setIndex]);
  return React14.useMemo(() => ({
    ref,
    index
  }), [index, ref]);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/isElementDisabled.js
function isElementDisabled(element) {
  return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-button/useButton.js
var React17 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
  return typeof window !== "undefined";
}
function getWindow(node) {
  var _node$ownerDocument;
  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function isHTMLElement(value) {
  if (!hasWindow()) {
    return false;
  }
  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
  if (!hasWindow() || typeof ShadowRoot === "undefined") {
    return false;
  }
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
}
function getComputedStyle2(element) {
  return getWindow(element).getComputedStyle(element);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/error.js
var set;
if (true) {
  set = /* @__PURE__ */ new Set();
}
function error(...messages) {
  if (true) {
    const messageKey = messages.join(" ");
    if (!set.has(messageKey)) {
      set.add(messageKey);
      console.error(`Base UI: ${messageKey}`);
    }
  }
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/CompositeRootContext.js
var React15 = __toESM(require_react(), 1);
var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0);
if (true) CompositeRootContext.displayName = "CompositeRootContext";
function useCompositeRootContext(optional = false) {
  const context = React15.useContext(CompositeRootContext);
  if (context === void 0 && !optional) {
    throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage(16));
  }
  return context;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js
var React16 = __toESM(require_react(), 1);
function useFocusableWhenDisabled(parameters) {
  const {
    focusableWhenDisabled,
    disabled: disabled2,
    composite = false,
    tabIndex: tabIndexProp = 0,
    isNativeButton
  } = parameters;
  const isFocusableComposite = composite && focusableWhenDisabled !== false;
  const isNonFocusableComposite = composite && focusableWhenDisabled === false;
  const props = React16.useMemo(() => {
    const additionalProps = {
      // allow Tabbing away from focusableWhenDisabled elements
      onKeyDown(event) {
        if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
          event.preventDefault();
        }
      }
    };
    if (!composite) {
      additionalProps.tabIndex = tabIndexProp;
      if (!isNativeButton && disabled2) {
        additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
      }
    }
    if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) {
      additionalProps["aria-disabled"] = disabled2;
    }
    if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
      additionalProps.disabled = disabled2;
    }
    return additionalProps;
  }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
  return {
    props
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-button/useButton.js
function useButton(parameters = {}) {
  const {
    disabled: disabled2 = false,
    focusableWhenDisabled,
    tabIndex = 0,
    native: isNativeButton = true
  } = parameters;
  const elementRef = React17.useRef(null);
  const isCompositeItem = useCompositeRootContext(true) !== void 0;
  const isValidLink = useStableCallback(() => {
    const element = elementRef.current;
    return Boolean(element?.tagName === "A" && element?.href);
  });
  const {
    props: focusableWhenDisabledProps
  } = useFocusableWhenDisabled({
    focusableWhenDisabled,
    disabled: disabled2,
    composite: isCompositeItem,
    tabIndex,
    isNativeButton
  });
  if (true) {
    React17.useEffect(() => {
      if (!elementRef.current) {
        return;
      }
      const isButtonTag = elementRef.current.tagName === "BUTTON";
      if (isNativeButton) {
        if (!isButtonTag) {
          error("A component that acts as a button was not rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is a real <button>, or set the `nativeButton` prop on the component to `false`.");
        }
      } else if (isButtonTag) {
        error("A component that acts as a button was rendered as a native <button>, which does not match the default. Ensure that the element passed to the `render` prop of the component is not a real <button>, or set the `nativeButton` prop on the component to `true`.");
      }
    }, [isNativeButton]);
  }
  const updateDisabled = React17.useCallback(() => {
    const element = elementRef.current;
    if (!isButtonElement(element)) {
      return;
    }
    if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) {
      element.disabled = false;
    }
  }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
  useIsoLayoutEffect(updateDisabled, [updateDisabled]);
  const getButtonProps = React17.useCallback((externalProps = {}) => {
    const {
      onClick: externalOnClick,
      onMouseDown: externalOnMouseDown,
      onKeyUp: externalOnKeyUp,
      onKeyDown: externalOnKeyDown,
      onPointerDown: externalOnPointerDown,
      ...otherExternalProps
    } = externalProps;
    const type = isNativeButton ? "button" : void 0;
    return mergeProps({
      type,
      onClick(event) {
        if (disabled2) {
          event.preventDefault();
          return;
        }
        externalOnClick?.(event);
      },
      onMouseDown(event) {
        if (!disabled2) {
          externalOnMouseDown?.(event);
        }
      },
      onKeyDown(event) {
        if (!disabled2) {
          makeEventPreventable(event);
          externalOnKeyDown?.(event);
        }
        if (event.baseUIHandlerPrevented) {
          return;
        }
        const shouldClick = event.target === event.currentTarget && !isNativeButton && !isValidLink() && !disabled2;
        const isEnterKey = event.key === "Enter";
        const isSpaceKey = event.key === " ";
        if (shouldClick) {
          if (isSpaceKey || isEnterKey) {
            event.preventDefault();
          }
          if (isEnterKey) {
            externalOnClick?.(event);
          }
        }
      },
      onKeyUp(event) {
        if (!disabled2) {
          makeEventPreventable(event);
          externalOnKeyUp?.(event);
        }
        if (event.baseUIHandlerPrevented) {
          return;
        }
        if (event.target === event.currentTarget && !isNativeButton && !disabled2 && event.key === " ") {
          externalOnClick?.(event);
        }
      },
      onPointerDown(event) {
        if (disabled2) {
          event.preventDefault();
          return;
        }
        externalOnPointerDown?.(event);
      }
    }, !isNativeButton ? {
      role: "button"
    } : void 0, focusableWhenDisabledProps, otherExternalProps);
  }, [disabled2, focusableWhenDisabledProps, isNativeButton, isValidLink]);
  const buttonRef = useStableCallback((element) => {
    elementRef.current = element;
    updateDisabled();
  });
  return {
    getButtonProps,
    buttonRef
  };
}
function isButtonElement(elem) {
  return isHTMLElement(elem) && elem.tagName === "BUTTON";
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js
var ARROW_LEFT = "ArrowLeft";
var ARROW_RIGHT = "ArrowRight";
var ARROW_UP = "ArrowUp";
var ARROW_DOWN = "ArrowDown";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js
function activeElement(doc) {
  let element = doc.activeElement;
  while (element?.shadowRoot?.activeElement != null) {
    element = element.shadowRoot.activeElement;
  }
  return element;
}
function contains(parent, child) {
  if (!parent || !child) {
    return false;
  }
  const rootNode = child.getRootNode?.();
  if (parent.contains(child)) {
    return true;
  }
  if (rootNode && isShadowRoot(rootNode)) {
    let next = child;
    while (next) {
      if (parent === next) {
        return true;
      }
      next = next.parentNode || next.host;
    }
  }
  return false;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/event.js
function stopEvent(event) {
  event.preventDefault();
  event.stopPropagation();
}

// ../../../node_modules/.pnpm/@floating-ui+utils@0.2.10/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var round = Math.round;
var floor = Math.floor;

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js
function isDifferentGridRow(index, cols, prevRow) {
  return Math.floor(index / cols) !== prevRow;
}
function isIndexOutOfListBounds(listRef, index) {
  return index < 0 || index >= listRef.current.length;
}
function getMinListIndex(listRef, disabledIndices) {
  return findNonDisabledListIndex(listRef, {
    disabledIndices
  });
}
function getMaxListIndex(listRef, disabledIndices) {
  return findNonDisabledListIndex(listRef, {
    decrement: true,
    startingIndex: listRef.current.length,
    disabledIndices
  });
}
function findNonDisabledListIndex(listRef, {
  startingIndex = -1,
  decrement = false,
  disabledIndices,
  amount = 1
} = {}) {
  let index = startingIndex;
  do {
    index += decrement ? -amount : amount;
  } while (index >= 0 && index <= listRef.current.length - 1 && isListIndexDisabled(listRef, index, disabledIndices));
  return index;
}
function getGridNavigatedIndex(listRef, {
  event,
  orientation,
  loopFocus,
  rtl,
  cols,
  disabledIndices,
  minIndex,
  maxIndex,
  prevIndex,
  stopEvent: stop = false
}) {
  let nextIndex = prevIndex;
  const rows = [];
  const rowIndexMap = {};
  let hasRoleRow = false;
  {
    let currentRowEl = null;
    let currentRowIndex = -1;
    listRef.current.forEach((el, idx) => {
      if (el == null) {
        return;
      }
      const rowEl = el.closest('[role="row"]');
      if (rowEl) {
        hasRoleRow = true;
      }
      if (rowEl !== currentRowEl || currentRowIndex === -1) {
        currentRowEl = rowEl;
        currentRowIndex += 1;
        rows[currentRowIndex] = [];
      }
      rows[currentRowIndex].push(idx);
      rowIndexMap[idx] = currentRowIndex;
    });
  }
  const hasDomRows = hasRoleRow && rows.length > 0 && rows.some((row) => row.length !== cols);
  function navigateVertically(direction) {
    if (!hasDomRows || prevIndex === -1) {
      return void 0;
    }
    const currentRow = rowIndexMap[prevIndex];
    if (currentRow == null) {
      return void 0;
    }
    const colInRow = rows[currentRow].indexOf(prevIndex);
    let nextRow = direction === "up" ? currentRow - 1 : currentRow + 1;
    if (loopFocus) {
      if (nextRow < 0) {
        nextRow = rows.length - 1;
      } else if (nextRow >= rows.length) {
        nextRow = 0;
      }
    }
    const visited = /* @__PURE__ */ new Set();
    while (nextRow >= 0 && nextRow < rows.length && !visited.has(nextRow)) {
      visited.add(nextRow);
      const targetRow = rows[nextRow];
      if (targetRow.length === 0) {
        nextRow = direction === "up" ? nextRow - 1 : nextRow + 1;
        continue;
      }
      const clampedCol = Math.min(colInRow, targetRow.length - 1);
      for (let col = clampedCol; col >= 0; col -= 1) {
        const candidate = targetRow[col];
        if (!isListIndexDisabled(listRef, candidate, disabledIndices)) {
          return candidate;
        }
      }
      nextRow = direction === "up" ? nextRow - 1 : nextRow + 1;
      if (loopFocus) {
        if (nextRow < 0) {
          nextRow = rows.length - 1;
        } else if (nextRow >= rows.length) {
          nextRow = 0;
        }
      }
    }
    return void 0;
  }
  if (event.key === ARROW_UP) {
    const domBasedCandidate = navigateVertically("up");
    if (domBasedCandidate !== void 0) {
      if (stop) {
        stopEvent(event);
      }
      nextIndex = domBasedCandidate;
    } else {
      if (stop) {
        stopEvent(event);
      }
      if (prevIndex === -1) {
        nextIndex = maxIndex;
      } else {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: nextIndex,
          amount: cols,
          decrement: true,
          disabledIndices
        });
        if (loopFocus && (prevIndex - cols < minIndex || nextIndex < 0)) {
          const col = prevIndex % cols;
          const maxCol = maxIndex % cols;
          const offset = maxIndex - (maxCol - col);
          if (maxCol === col) {
            nextIndex = maxIndex;
          } else {
            nextIndex = maxCol > col ? offset : offset - cols;
          }
        }
      }
      if (isIndexOutOfListBounds(listRef, nextIndex)) {
        nextIndex = prevIndex;
      }
    }
  }
  if (event.key === ARROW_DOWN) {
    const domBasedCandidate = navigateVertically("down");
    if (domBasedCandidate !== void 0) {
      if (stop) {
        stopEvent(event);
      }
      nextIndex = domBasedCandidate;
    } else {
      if (stop) {
        stopEvent(event);
      }
      if (prevIndex === -1) {
        nextIndex = minIndex;
      } else {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex,
          amount: cols,
          disabledIndices
        });
        if (loopFocus && prevIndex + cols > maxIndex) {
          nextIndex = findNonDisabledListIndex(listRef, {
            startingIndex: prevIndex % cols - cols,
            amount: cols,
            disabledIndices
          });
        }
      }
      if (isIndexOutOfListBounds(listRef, nextIndex)) {
        nextIndex = prevIndex;
      }
    }
  }
  if (orientation === "both") {
    const prevRow = floor(prevIndex / cols);
    if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {
      if (stop) {
        stopEvent(event);
      }
      if (prevIndex % cols !== cols - 1) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex,
          disabledIndices
        });
        if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
          nextIndex = findNonDisabledListIndex(listRef, {
            startingIndex: prevIndex - prevIndex % cols - 1,
            disabledIndices
          });
        }
      } else if (loopFocus) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex - prevIndex % cols - 1,
          disabledIndices
        });
      }
      if (isDifferentGridRow(nextIndex, cols, prevRow)) {
        nextIndex = prevIndex;
      }
    }
    if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {
      if (stop) {
        stopEvent(event);
      }
      if (prevIndex % cols !== 0) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex,
          decrement: true,
          disabledIndices
        });
        if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
          nextIndex = findNonDisabledListIndex(listRef, {
            startingIndex: prevIndex + (cols - prevIndex % cols),
            decrement: true,
            disabledIndices
          });
        }
      } else if (loopFocus) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex + (cols - prevIndex % cols),
          decrement: true,
          disabledIndices
        });
      }
      if (isDifferentGridRow(nextIndex, cols, prevRow)) {
        nextIndex = prevIndex;
      }
    }
    const lastRow = floor(maxIndex / cols) === prevRow;
    if (isIndexOutOfListBounds(listRef, nextIndex)) {
      if (loopFocus && lastRow) {
        nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex - prevIndex % cols - 1,
          disabledIndices
        });
      } else {
        nextIndex = prevIndex;
      }
    }
  }
  return nextIndex;
}
function createGridCellMap(sizes, cols, dense) {
  const cellMap = [];
  let startIndex = 0;
  sizes.forEach(({
    width,
    height
  }, index) => {
    if (width > cols) {
      if (true) {
        throw new Error(true ? `[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns` : formatErrorMessage(29, index));
      }
    }
    let itemPlaced = false;
    if (dense) {
      startIndex = 0;
    }
    while (!itemPlaced) {
      const targetCells = [];
      for (let i2 = 0; i2 < width; i2 += 1) {
        for (let j2 = 0; j2 < height; j2 += 1) {
          targetCells.push(startIndex + i2 + j2 * cols);
        }
      }
      if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) {
        targetCells.forEach((cell) => {
          cellMap[cell] = index;
        });
        itemPlaced = true;
      } else {
        startIndex += 1;
      }
    }
  });
  return [...cellMap];
}
function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {
  if (index === -1) {
    return -1;
  }
  const firstCellIndex = cellMap.indexOf(index);
  const sizeItem = sizes[index];
  switch (corner) {
    case "tl":
      return firstCellIndex;
    case "tr":
      if (!sizeItem) {
        return firstCellIndex;
      }
      return firstCellIndex + sizeItem.width - 1;
    case "bl":
      if (!sizeItem) {
        return firstCellIndex;
      }
      return firstCellIndex + (sizeItem.height - 1) * cols;
    case "br":
      return cellMap.lastIndexOf(index);
    default:
      return -1;
  }
}
function getGridCellIndices(indices, cellMap) {
  return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);
}
function isListIndexDisabled(listRef, index, disabledIndices) {
  if (typeof disabledIndices === "function") {
    return disabledIndices(index);
  }
  if (disabledIndices) {
    return disabledIndices.includes(index);
  }
  const element = listRef.current[index];
  if (!element) {
    return false;
  }
  return element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/composite.js
var ARROW_UP2 = "ArrowUp";
var ARROW_DOWN2 = "ArrowDown";
var ARROW_LEFT2 = "ArrowLeft";
var ARROW_RIGHT2 = "ArrowRight";
var HOME = "Home";
var END = "End";
var HORIZONTAL_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT2, ARROW_RIGHT2]);
var HORIZONTAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT2, ARROW_RIGHT2, HOME, END]);
var VERTICAL_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2]);
var VERTICAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2, HOME, END]);
var ARROW_KEYS = /* @__PURE__ */ new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);
var ALL_KEYS = /* @__PURE__ */ new Set([...ARROW_KEYS, HOME, END]);
var SHIFT = "Shift";
var CONTROL = "Control";
var ALT = "Alt";
var META = "Meta";
var MODIFIER_KEYS = /* @__PURE__ */ new Set([SHIFT, CONTROL, ALT, META]);
function isInputElement(element) {
  return isHTMLElement(element) && element.tagName === "INPUT";
}
function isNativeInput(element) {
  if (isInputElement(element) && element.selectionStart != null) {
    return true;
  }
  if (isHTMLElement(element) && element.tagName === "TEXTAREA") {
    return true;
  }
  return false;
}
function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {
  if (!scrollContainer || !element || !element.scrollTo) {
    return;
  }
  let targetX = scrollContainer.scrollLeft;
  let targetY = scrollContainer.scrollTop;
  const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;
  const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;
  if (isOverflowingX && orientation !== "vertical") {
    const elementOffsetLeft = getOffset(scrollContainer, element, "left");
    const containerStyles = getStyles(scrollContainer);
    const elementStyles = getStyles(element);
    if (direction === "ltr") {
      if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
        targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
      } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
        targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
      }
    }
    if (direction === "rtl") {
      if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
        targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
      } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
        targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
      }
    }
  }
  if (isOverflowingY && orientation !== "horizontal") {
    const elementOffsetTop = getOffset(scrollContainer, element, "top");
    const containerStyles = getStyles(scrollContainer);
    const elementStyles = getStyles(element);
    if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {
      targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;
    } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {
      targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;
    }
  }
  scrollContainer.scrollTo({
    left: targetX,
    top: targetY,
    behavior: "auto"
  });
}
function getOffset(ancestor, element, side) {
  const propName = side === "left" ? "offsetLeft" : "offsetTop";
  let result2 = 0;
  while (element.offsetParent) {
    result2 += element[propName];
    if (element.offsetParent === ancestor) {
      break;
    }
    element = element.offsetParent;
  }
  return result2;
}
function getStyles(element) {
  const styles = getComputedStyle(element);
  return {
    scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,
    scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,
    scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,
    scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,
    scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,
    scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,
    scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,
    scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0
  };
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/owner.js
function ownerDocument(node) {
  return node?.ownerDocument || document;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.4_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useForcedRerendering.js
var React18 = __toESM(require_react(), 1);
function useForcedRerendering() {
  const [, setState] = React18.useState({});
  return React18.useCallback(() => {
    setState({});
  }, []);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/item/useCompositeItem.js
var React19 = __toESM(require_react(), 1);
function useCompositeItem(params = {}) {
  const {
    highlightItemOnHover,
    highlightedIndex,
    onHighlightedIndexChange
  } = useCompositeRootContext();
  const {
    ref,
    index
  } = useCompositeListItem(params);
  const isHighlighted = highlightedIndex === index;
  const itemRef = React19.useRef(null);
  const mergedRef = useMergedRefs(ref, itemRef);
  const compositeProps = React19.useMemo(() => ({
    tabIndex: isHighlighted ? 0 : -1,
    onFocus() {
      onHighlightedIndexChange(index);
    },
    onMouseMove() {
      const item = itemRef.current;
      if (!highlightItemOnHover || !item) {
        return;
      }
      const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true";
      if (!isHighlighted && !disabled2) {
        item.focus();
      }
    }
  }), [isHighlighted, onHighlightedIndexChange, index, highlightItemOnHover]);
  return {
    compositeProps,
    compositeRef: mergedRef,
    index
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/csp-provider/CSPContext.js
var React20 = __toESM(require_react(), 1);
var CSPContext = /* @__PURE__ */ React20.createContext(void 0);
if (true) CSPContext.displayName = "CSPContext";
var DEFAULT_CSP_CONTEXT_VALUE = {
  disableStyleElements: false
};
function useCSPContext() {
  return React20.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/CompositeRoot.js
var React22 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/useCompositeRoot.js
var React21 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/constants.js
var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/useCompositeRoot.js
var EMPTY_ARRAY2 = [];
function useCompositeRoot(params) {
  const {
    itemSizes,
    cols = 1,
    loopFocus = true,
    dense = false,
    orientation = "both",
    direction,
    highlightedIndex: externalHighlightedIndex,
    onHighlightedIndexChange: externalSetHighlightedIndex,
    rootRef: externalRef,
    enableHomeAndEndKeys = false,
    stopEventPropagation = false,
    disabledIndices,
    modifierKeys = EMPTY_ARRAY2
  } = params;
  const [internalHighlightedIndex, internalSetHighlightedIndex] = React21.useState(0);
  const isGrid2 = cols > 1;
  const rootRef = React21.useRef(null);
  const mergedRef = useMergedRefs(rootRef, externalRef);
  const elementsRef = React21.useRef([]);
  const hasSetDefaultIndexRef = React21.useRef(false);
  const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
  const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
    (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
    if (shouldScrollIntoView) {
      const newActiveItem = elementsRef.current[index];
      scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
    }
  });
  const onMapChange = useStableCallback((map) => {
    if (map.size === 0 || hasSetDefaultIndexRef.current) {
      return;
    }
    hasSetDefaultIndexRef.current = true;
    const sortedElements = Array.from(map.keys());
    const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
    const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
    if (activeIndex !== -1) {
      onHighlightedIndexChange(activeIndex);
    }
    scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
  });
  const props = React21.useMemo(() => ({
    "aria-orientation": orientation === "both" ? void 0 : orientation,
    ref: mergedRef,
    onFocus(event) {
      const element = rootRef.current;
      if (!element || !isNativeInput(event.target)) {
        return;
      }
      event.target.setSelectionRange(0, event.target.value.length ?? 0);
    },
    onKeyDown(event) {
      const RELEVANT_KEYS = enableHomeAndEndKeys ? ALL_KEYS : ARROW_KEYS;
      if (!RELEVANT_KEYS.has(event.key)) {
        return;
      }
      if (isModifierKeySet(event, modifierKeys)) {
        return;
      }
      const element = rootRef.current;
      if (!element) {
        return;
      }
      const isRtl = direction === "rtl";
      const horizontalForwardKey = isRtl ? ARROW_LEFT2 : ARROW_RIGHT2;
      const forwardKey = {
        horizontal: horizontalForwardKey,
        vertical: ARROW_DOWN2,
        both: horizontalForwardKey
      }[orientation];
      const horizontalBackwardKey = isRtl ? ARROW_RIGHT2 : ARROW_LEFT2;
      const backwardKey = {
        horizontal: horizontalBackwardKey,
        vertical: ARROW_UP2,
        both: horizontalBackwardKey
      }[orientation];
      if (isNativeInput(event.target) && !isElementDisabled(event.target)) {
        const selectionStart = event.target.selectionStart;
        const selectionEnd = event.target.selectionEnd;
        const textContent = event.target.value ?? "";
        if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
          return;
        }
        if (event.key !== backwardKey && selectionStart < textContent.length) {
          return;
        }
        if (event.key !== forwardKey && selectionStart > 0) {
          return;
        }
      }
      let nextIndex = highlightedIndex;
      const minIndex = getMinListIndex(elementsRef, disabledIndices);
      const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
      if (isGrid2) {
        const sizes = itemSizes || Array.from({
          length: elementsRef.current.length
        }, () => ({
          width: 1,
          height: 1
        }));
        const cellMap = createGridCellMap(sizes, cols, dense);
        const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef, index, disabledIndices));
        const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef, index, disabledIndices) ? cellIndex : foundIndex, -1);
        nextIndex = cellMap[getGridNavigatedIndex({
          current: cellMap.map((itemIndex) => itemIndex ? elementsRef.current[itemIndex] : null)
        }, {
          event,
          orientation,
          loopFocus,
          cols,
          // treat undefined (empty grid spaces) as disabled indices so we
          // don't end up in them
          disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef, index) ? index : void 0), void 0], cellMap),
          minIndex: minGridIndex,
          maxIndex: maxGridIndex,
          prevIndex: getGridCellIndexOfCorner(
            highlightedIndex > maxIndex ? minIndex : highlightedIndex,
            sizes,
            cellMap,
            cols,
            // use a corner matching the edge closest to the direction we're
            // moving in so we don't end up in the same item. Prefer
            // top/left over bottom/right.
            // eslint-disable-next-line no-nested-ternary
            event.key === ARROW_DOWN2 ? "bl" : event.key === ARROW_RIGHT2 ? "tr" : "tl"
          ),
          rtl: isRtl
        })];
      }
      const forwardKeys = {
        horizontal: [horizontalForwardKey],
        vertical: [ARROW_DOWN2],
        both: [horizontalForwardKey, ARROW_DOWN2]
      }[orientation];
      const backwardKeys = {
        horizontal: [horizontalBackwardKey],
        vertical: [ARROW_UP2],
        both: [horizontalBackwardKey, ARROW_UP2]
      }[orientation];
      const preventedKeys = isGrid2 ? RELEVANT_KEYS : {
        horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
        vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
        both: RELEVANT_KEYS
      }[orientation];
      if (enableHomeAndEndKeys) {
        if (event.key === HOME) {
          nextIndex = minIndex;
        } else if (event.key === END) {
          nextIndex = maxIndex;
        }
      }
      if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {
        if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
          nextIndex = minIndex;
        } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
          nextIndex = maxIndex;
        } else {
          nextIndex = findNonDisabledListIndex(elementsRef, {
            startingIndex: nextIndex,
            decrement: backwardKeys.includes(event.key),
            disabledIndices
          });
        }
      }
      if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef, nextIndex)) {
        if (stopEventPropagation) {
          event.stopPropagation();
        }
        if (preventedKeys.has(event.key)) {
          event.preventDefault();
        }
        onHighlightedIndexChange(nextIndex, true);
        queueMicrotask(() => {
          elementsRef.current[nextIndex]?.focus();
        });
      }
    }
  }), [cols, dense, direction, disabledIndices, elementsRef, enableHomeAndEndKeys, highlightedIndex, isGrid2, itemSizes, loopFocus, mergedRef, modifierKeys, onHighlightedIndexChange, orientation, stopEventPropagation]);
  return React21.useMemo(() => ({
    props,
    highlightedIndex,
    onHighlightedIndexChange,
    elementsRef,
    disabledIndices,
    onMapChange,
    relayKeyboardEvent: props.onKeyDown
  }), [props, highlightedIndex, onHighlightedIndexChange, elementsRef, disabledIndices, onMapChange]);
}
function isModifierKeySet(event, ignoredModifierKeys) {
  for (const key of MODIFIER_KEYS.values()) {
    if (ignoredModifierKeys.includes(key)) {
      continue;
    }
    if (event.getModifierState(key)) {
      return true;
    }
  }
  return false;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/CompositeRoot.js
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
function CompositeRoot(componentProps) {
  const {
    render: render4,
    className,
    refs = EMPTY_ARRAY,
    props = EMPTY_ARRAY,
    state = EMPTY_OBJECT,
    stateAttributesMapping: stateAttributesMapping2,
    highlightedIndex: highlightedIndexProp,
    onHighlightedIndexChange: onHighlightedIndexChangeProp,
    orientation,
    dense,
    itemSizes,
    loopFocus,
    cols,
    enableHomeAndEndKeys,
    onMapChange: onMapChangeProp,
    stopEventPropagation = true,
    rootRef,
    disabledIndices,
    modifierKeys,
    highlightItemOnHover = false,
    tag = "div",
    ...elementProps
  } = componentProps;
  const direction = useDirection();
  const {
    props: defaultProps,
    highlightedIndex,
    onHighlightedIndexChange,
    elementsRef,
    onMapChange: onMapChangeUnwrapped,
    relayKeyboardEvent
  } = useCompositeRoot({
    itemSizes,
    cols,
    loopFocus,
    dense,
    orientation,
    highlightedIndex: highlightedIndexProp,
    onHighlightedIndexChange: onHighlightedIndexChangeProp,
    rootRef,
    stopEventPropagation,
    enableHomeAndEndKeys,
    direction,
    disabledIndices,
    modifierKeys
  });
  const element = useRenderElement(tag, componentProps, {
    state,
    ref: refs,
    props: [defaultProps, ...props, elementProps],
    stateAttributesMapping: stateAttributesMapping2
  });
  const contextValue = React22.useMemo(() => ({
    highlightedIndex,
    onHighlightedIndexChange,
    highlightItemOnHover,
    relayKeyboardEvent
  }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CompositeRootContext.Provider, {
    value: contextValue,
    children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CompositeList, {
      elementsRef,
      onMapChange: (newMap) => {
        onMapChangeProp?.(newMap);
        onMapChangeUnwrapped(newMap);
      },
      children: element
    })
  });
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getCssDimensions.js
function getCssDimensions(element) {
  const css = getComputedStyle2(element);
  let width = parseFloat(css.width) || 0;
  let height = parseFloat(css.height) || 0;
  const hasOffset = isHTMLElement(element);
  const offsetWidth = hasOffset ? element.offsetWidth : width;
  const offsetHeight = hasOffset ? element.offsetHeight : height;
  const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
  if (shouldFallback) {
    width = offsetWidth;
    height = offsetHeight;
  }
  return {
    width,
    height
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/index.parts.js
var index_parts_exports = {};
__export(index_parts_exports, {
  Indicator: () => TabsIndicator,
  List: () => TabsList,
  Panel: () => TabsPanel,
  Root: () => TabsRoot,
  Tab: () => TabsTab
});

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
var React24 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js
var React23 = __toESM(require_react(), 1);
var TabsRootContext = /* @__PURE__ */ React23.createContext(void 0);
if (true) TabsRootContext.displayName = "TabsRootContext";
function useTabsRootContext() {
  const context = React23.useContext(TabsRootContext);
  if (context === void 0) {
    throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage(64));
  }
  return context;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js
var TabsRootDataAttributes = /* @__PURE__ */ (function(TabsRootDataAttributes2) {
  TabsRootDataAttributes2["activationDirection"] = "data-activation-direction";
  TabsRootDataAttributes2["orientation"] = "data-orientation";
  return TabsRootDataAttributes2;
})({});

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js
var tabsStateAttributesMapping = {
  tabActivationDirection: (dir) => ({
    [TabsRootDataAttributes.activationDirection]: dir
  })
};

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
var TabsRoot = /* @__PURE__ */ React24.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
  const {
    className,
    defaultValue: defaultValueProp = 0,
    onValueChange: onValueChangeProp,
    orientation = "horizontal",
    render: render4,
    value: valueProp,
    ...elementProps
  } = componentProps;
  const direction = useDirection();
  const hasExplicitDefaultValueProp = Object.hasOwn(componentProps, "defaultValue");
  const tabPanelRefs = React24.useRef([]);
  const [mountedTabPanels, setMountedTabPanels] = React24.useState(() => /* @__PURE__ */ new Map());
  const [value, setValue] = useControlled({
    controlled: valueProp,
    default: defaultValueProp,
    name: "Tabs",
    state: "value"
  });
  const isControlled = valueProp !== void 0;
  const [tabMap, setTabMap] = React24.useState(() => /* @__PURE__ */ new Map());
  const [tabActivationDirection, setTabActivationDirection] = React24.useState("none");
  const onValueChange = useStableCallback((newValue, eventDetails) => {
    onValueChangeProp?.(newValue, eventDetails);
    if (eventDetails.isCanceled) {
      return;
    }
    setValue(newValue);
    setTabActivationDirection(eventDetails.activationDirection);
  });
  const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
    setMountedTabPanels((prev) => {
      if (prev.get(panelValue) === panelId) {
        return prev;
      }
      const next = new Map(prev);
      next.set(panelValue, panelId);
      return next;
    });
  });
  const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
    setMountedTabPanels((prev) => {
      if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) {
        return prev;
      }
      const next = new Map(prev);
      next.delete(panelValue);
      return next;
    });
  });
  const getTabPanelIdByValue = React24.useCallback((tabValue) => {
    return mountedTabPanels.get(tabValue);
  }, [mountedTabPanels]);
  const getTabIdByPanelValue = React24.useCallback((tabPanelValue) => {
    for (const tabMetadata of tabMap.values()) {
      if (tabPanelValue === tabMetadata?.value) {
        return tabMetadata?.id;
      }
    }
    return void 0;
  }, [tabMap]);
  const getTabElementBySelectedValue = React24.useCallback((selectedValue) => {
    if (selectedValue === void 0) {
      return null;
    }
    for (const [tabElement, tabMetadata] of tabMap.entries()) {
      if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) {
        return tabElement;
      }
    }
    return null;
  }, [tabMap]);
  const tabsContextValue = React24.useMemo(() => ({
    direction,
    getTabElementBySelectedValue,
    getTabIdByPanelValue,
    getTabPanelIdByValue,
    onValueChange,
    orientation,
    registerMountedTabPanel,
    setTabMap,
    unregisterMountedTabPanel,
    tabActivationDirection,
    value
  }), [direction, getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, unregisterMountedTabPanel, tabActivationDirection, value]);
  const selectedTabMetadata = React24.useMemo(() => {
    for (const tabMetadata of tabMap.values()) {
      if (tabMetadata != null && tabMetadata.value === value) {
        return tabMetadata;
      }
    }
    return void 0;
  }, [tabMap, value]);
  const firstEnabledTabValue = React24.useMemo(() => {
    for (const tabMetadata of tabMap.values()) {
      if (tabMetadata != null && !tabMetadata.disabled) {
        return tabMetadata.value;
      }
    }
    return void 0;
  }, [tabMap]);
  useIsoLayoutEffect(() => {
    if (isControlled || tabMap.size === 0) {
      return;
    }
    const selectionIsDisabled = selectedTabMetadata?.disabled;
    const selectionIsMissing = selectedTabMetadata == null && value !== null;
    const shouldHonorExplicitDefaultSelection = hasExplicitDefaultValueProp && selectionIsDisabled && value === defaultValueProp;
    if (shouldHonorExplicitDefaultSelection) {
      return;
    }
    if (!selectionIsDisabled && !selectionIsMissing) {
      return;
    }
    const fallbackValue = firstEnabledTabValue ?? null;
    if (value === fallbackValue) {
      return;
    }
    setValue(fallbackValue);
    setTabActivationDirection("none");
  }, [defaultValueProp, firstEnabledTabValue, hasExplicitDefaultValueProp, isControlled, selectedTabMetadata, setTabActivationDirection, setValue, tabMap, value]);
  const state = {
    orientation,
    tabActivationDirection
  };
  const element = useRenderElement("div", componentProps, {
    state,
    ref: forwardedRef,
    props: elementProps,
    stateAttributesMapping: tabsStateAttributesMapping
  });
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TabsRootContext.Provider, {
    value: tabsContextValue,
    children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CompositeList, {
      elementsRef: tabPanelRefs,
      children: element
    })
  });
});
if (true) TabsRoot.displayName = "TabsRoot";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
var React26 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js
var React25 = __toESM(require_react(), 1);
var TabsListContext = /* @__PURE__ */ React25.createContext(void 0);
if (true) TabsListContext.displayName = "TabsListContext";
function useTabsListContext() {
  const context = React25.useContext(TabsListContext);
  if (context === void 0) {
    throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage(65));
  }
  return context;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
var TabsTab = /* @__PURE__ */ React26.forwardRef(function TabsTab2(componentProps, forwardedRef) {
  const {
    className,
    disabled: disabled2 = false,
    render: render4,
    value,
    id: idProp,
    nativeButton = true,
    ...elementProps
  } = componentProps;
  const {
    value: activeTabValue,
    getTabPanelIdByValue,
    orientation
  } = useTabsRootContext();
  const {
    activateOnFocus,
    highlightedTabIndex,
    onTabActivation,
    setHighlightedTabIndex,
    tabsListElement
  } = useTabsListContext();
  const id = useBaseUiId(idProp);
  const tabMetadata = React26.useMemo(() => ({
    disabled: disabled2,
    id,
    value
  }), [disabled2, id, value]);
  const {
    compositeProps,
    compositeRef,
    index
    // hook is used instead of the CompositeItem component
    // because the index is needed for Tab internals
  } = useCompositeItem({
    metadata: tabMetadata
  });
  const active = value === activeTabValue;
  const isNavigatingRef = React26.useRef(false);
  useIsoLayoutEffect(() => {
    if (isNavigatingRef.current) {
      isNavigatingRef.current = false;
      return;
    }
    if (!(active && index > -1 && highlightedTabIndex !== index)) {
      return;
    }
    const listElement = tabsListElement;
    if (listElement != null) {
      const activeEl = activeElement(ownerDocument(listElement));
      if (activeEl && contains(listElement, activeEl)) {
        return;
      }
    }
    if (!disabled2) {
      setHighlightedTabIndex(index);
    }
  }, [active, index, highlightedTabIndex, setHighlightedTabIndex, disabled2, tabsListElement]);
  const {
    getButtonProps,
    buttonRef
  } = useButton({
    disabled: disabled2,
    native: nativeButton,
    focusableWhenDisabled: true
  });
  const tabPanelId = getTabPanelIdByValue(value);
  const isPressingRef = React26.useRef(false);
  const isMainButtonRef = React26.useRef(false);
  function onClick(event) {
    if (active || disabled2) {
      return;
    }
    onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
      activationDirection: "none"
    }));
  }
  function onFocus(event) {
    if (active) {
      return;
    }
    if (index > -1 && !disabled2) {
      setHighlightedTabIndex(index);
    }
    if (disabled2) {
      return;
    }
    if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus
    isPressingRef.current && isMainButtonRef.current)) {
      onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
        activationDirection: "none"
      }));
    }
  }
  function onPointerDown(event) {
    if (active || disabled2) {
      return;
    }
    isPressingRef.current = true;
    function handlePointerUp() {
      isPressingRef.current = false;
      isMainButtonRef.current = false;
    }
    if (!event.button || event.button === 0) {
      isMainButtonRef.current = true;
      const doc = ownerDocument(event.currentTarget);
      doc.addEventListener("pointerup", handlePointerUp, {
        once: true
      });
    }
  }
  const state = React26.useMemo(() => ({
    disabled: disabled2,
    active,
    orientation
  }), [disabled2, active, orientation]);
  const element = useRenderElement("button", componentProps, {
    state,
    ref: [forwardedRef, buttonRef, compositeRef],
    props: [compositeProps, {
      role: "tab",
      "aria-controls": tabPanelId,
      "aria-selected": active,
      id,
      onClick,
      onFocus,
      onPointerDown,
      [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
      onKeyDownCapture() {
        isNavigatingRef.current = true;
      }
    }, elementProps, getButtonProps]
  });
  return element;
});
if (true) TabsTab.displayName = "TabsTab";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js
var React27 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/prehydrationScript.min.js
var script = '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();';

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicatorCssVars.js
var TabsIndicatorCssVars = /* @__PURE__ */ (function(TabsIndicatorCssVars2) {
  TabsIndicatorCssVars2["activeTabLeft"] = "--active-tab-left";
  TabsIndicatorCssVars2["activeTabRight"] = "--active-tab-right";
  TabsIndicatorCssVars2["activeTabTop"] = "--active-tab-top";
  TabsIndicatorCssVars2["activeTabBottom"] = "--active-tab-bottom";
  TabsIndicatorCssVars2["activeTabWidth"] = "--active-tab-width";
  TabsIndicatorCssVars2["activeTabHeight"] = "--active-tab-height";
  return TabsIndicatorCssVars2;
})({});

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
var stateAttributesMapping = {
  ...tabsStateAttributesMapping,
  activeTabPosition: () => null,
  activeTabSize: () => null
};
var TabsIndicator = /* @__PURE__ */ React27.forwardRef(function TabIndicator(componentProps, forwardedRef) {
  const {
    className,
    render: render4,
    renderBeforeHydration = false,
    ...elementProps
  } = componentProps;
  const {
    nonce
  } = useCSPContext();
  const {
    getTabElementBySelectedValue,
    orientation,
    tabActivationDirection,
    value
  } = useTabsRootContext();
  const {
    tabsListElement
  } = useTabsListContext();
  const [isMounted, setIsMounted] = React27.useState(false);
  const {
    value: activeTabValue
  } = useTabsRootContext();
  useOnMount(() => setIsMounted(true));
  const rerender = useForcedRerendering();
  React27.useEffect(() => {
    if (value != null && tabsListElement != null && typeof ResizeObserver !== "undefined") {
      const resizeObserver = new ResizeObserver(rerender);
      resizeObserver.observe(tabsListElement);
      return () => {
        resizeObserver.disconnect();
      };
    }
    return void 0;
  }, [value, tabsListElement, rerender]);
  let left = 0;
  let right = 0;
  let top = 0;
  let bottom = 0;
  let width = 0;
  let height = 0;
  let isTabSelected = false;
  if (value != null && tabsListElement != null) {
    const activeTab = getTabElementBySelectedValue(value);
    isTabSelected = true;
    if (activeTab != null) {
      const {
        width: computedWidth,
        height: computedHeight
      } = getCssDimensions(activeTab);
      const {
        width: tabListWidth,
        height: tabListHeight
      } = getCssDimensions(tabsListElement);
      const tabRect = activeTab.getBoundingClientRect();
      const tabsListRect = tabsListElement.getBoundingClientRect();
      const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;
      const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;
      const hasNonZeroScale = Math.abs(scaleX) > Number.EPSILON && Math.abs(scaleY) > Number.EPSILON;
      if (hasNonZeroScale) {
        const tabLeftDelta = tabRect.left - tabsListRect.left;
        const tabTopDelta = tabRect.top - tabsListRect.top;
        left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
        top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
      } else {
        left = activeTab.offsetLeft;
        top = activeTab.offsetTop;
      }
      width = computedWidth;
      height = computedHeight;
      right = tabsListElement.scrollWidth - left - width;
      bottom = tabsListElement.scrollHeight - top - height;
    }
  }
  const activeTabPosition = React27.useMemo(() => isTabSelected ? {
    left,
    right,
    top,
    bottom
  } : null, [left, right, top, bottom, isTabSelected]);
  const activeTabSize = React27.useMemo(() => isTabSelected ? {
    width,
    height
  } : null, [width, height, isTabSelected]);
  const style = React27.useMemo(() => {
    if (!isTabSelected) {
      return void 0;
    }
    return {
      [TabsIndicatorCssVars.activeTabLeft]: `${left}px`,
      [TabsIndicatorCssVars.activeTabRight]: `${right}px`,
      [TabsIndicatorCssVars.activeTabTop]: `${top}px`,
      [TabsIndicatorCssVars.activeTabBottom]: `${bottom}px`,
      [TabsIndicatorCssVars.activeTabWidth]: `${width}px`,
      [TabsIndicatorCssVars.activeTabHeight]: `${height}px`
    };
  }, [left, right, top, bottom, width, height, isTabSelected]);
  const displayIndicator = isTabSelected && width > 0 && height > 0;
  const state = React27.useMemo(() => ({
    orientation,
    activeTabPosition,
    activeTabSize,
    tabActivationDirection
  }), [orientation, activeTabPosition, activeTabSize, tabActivationDirection]);
  const element = useRenderElement("span", componentProps, {
    state,
    ref: forwardedRef,
    props: [{
      role: "presentation",
      style,
      hidden: !displayIndicator
      // do not display the indicator before the layout is settled
    }, elementProps, {
      suppressHydrationWarning: true
    }],
    stateAttributesMapping
  });
  if (activeTabValue == null) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(React27.Fragment, {
    children: [element, !isMounted && renderBeforeHydration && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("script", {
      nonce,
      dangerouslySetInnerHTML: {
        __html: script
      },
      suppressHydrationWarning: true
    })]
  });
});
if (true) TabsIndicator.displayName = "TabsIndicator";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
var React28 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js
var TabsPanelDataAttributes = /* @__PURE__ */ (function(TabsPanelDataAttributes2) {
  TabsPanelDataAttributes2["index"] = "data-index";
  TabsPanelDataAttributes2["activationDirection"] = "data-activation-direction";
  TabsPanelDataAttributes2["orientation"] = "data-orientation";
  TabsPanelDataAttributes2["hidden"] = "data-hidden";
  return TabsPanelDataAttributes2;
})({});

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
var TabsPanel = /* @__PURE__ */ React28.forwardRef(function TabPanel(componentProps, forwardedRef) {
  const {
    className,
    value,
    render: render4,
    keepMounted = false,
    ...elementProps
  } = componentProps;
  const {
    value: selectedValue,
    getTabIdByPanelValue,
    orientation,
    tabActivationDirection,
    registerMountedTabPanel,
    unregisterMountedTabPanel
  } = useTabsRootContext();
  const id = useBaseUiId();
  const metadata = React28.useMemo(() => ({
    id,
    value
  }), [id, value]);
  const {
    ref: listItemRef,
    index
  } = useCompositeListItem({
    metadata
  });
  const hidden = value !== selectedValue;
  const correspondingTabId = getTabIdByPanelValue(value);
  const state = React28.useMemo(() => ({
    hidden,
    orientation,
    tabActivationDirection
  }), [hidden, orientation, tabActivationDirection]);
  const element = useRenderElement("div", componentProps, {
    state,
    ref: [forwardedRef, listItemRef],
    props: [{
      "aria-labelledby": correspondingTabId,
      hidden,
      id: id ?? void 0,
      role: "tabpanel",
      tabIndex: hidden ? -1 : 0,
      [TabsPanelDataAttributes.index]: index
    }, elementProps],
    stateAttributesMapping: tabsStateAttributesMapping
  });
  useIsoLayoutEffect(() => {
    if (hidden && !keepMounted) {
      return void 0;
    }
    if (id == null) {
      return void 0;
    }
    registerMountedTabPanel(value, id);
    return () => {
      unregisterMountedTabPanel(value, id);
    };
  }, [hidden, keepMounted, value, id, registerMountedTabPanel, unregisterMountedTabPanel]);
  const shouldRender = !hidden || keepMounted;
  if (!shouldRender) {
    return null;
  }
  return element;
});
if (true) TabsPanel.displayName = "TabsPanel";

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/list/TabsList.js
var React29 = __toESM(require_react(), 1);
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
var TabsList = /* @__PURE__ */ React29.forwardRef(function TabsList2(componentProps, forwardedRef) {
  const {
    activateOnFocus = false,
    className,
    loopFocus = true,
    render: render4,
    ...elementProps
  } = componentProps;
  const {
    getTabElementBySelectedValue,
    onValueChange,
    orientation,
    value,
    setTabMap,
    tabActivationDirection
  } = useTabsRootContext();
  const [highlightedTabIndex, setHighlightedTabIndex] = React29.useState(0);
  const [tabsListElement, setTabsListElement] = React29.useState(null);
  const detectActivationDirection = useActivationDirectionDetector(
    value,
    // the old value
    orientation,
    tabsListElement,
    getTabElementBySelectedValue
  );
  const onTabActivation = useStableCallback((newValue, eventDetails) => {
    if (newValue !== value) {
      const activationDirection = detectActivationDirection(newValue);
      eventDetails.activationDirection = activationDirection;
      onValueChange(newValue, eventDetails);
    }
  });
  const state = React29.useMemo(() => ({
    orientation,
    tabActivationDirection
  }), [orientation, tabActivationDirection]);
  const defaultProps = {
    "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
    role: "tablist"
  };
  const tabsListContextValue = React29.useMemo(() => ({
    activateOnFocus,
    highlightedTabIndex,
    onTabActivation,
    setHighlightedTabIndex,
    tabsListElement,
    value
  }), [activateOnFocus, highlightedTabIndex, onTabActivation, setHighlightedTabIndex, tabsListElement, value]);
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TabsListContext.Provider, {
    value: tabsListContextValue,
    children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CompositeRoot, {
      render: render4,
      className,
      state,
      refs: [forwardedRef, setTabsListElement],
      props: [defaultProps, elementProps],
      stateAttributesMapping: tabsStateAttributesMapping,
      highlightedIndex: highlightedTabIndex,
      enableHomeAndEndKeys: true,
      loopFocus,
      orientation,
      onHighlightedIndexChange: setHighlightedTabIndex,
      onMapChange: setTabMap,
      disabledIndices: EMPTY_ARRAY
    })
  });
});
if (true) TabsList.displayName = "TabsList";
function getInset(tab, tabsList) {
  const {
    left: tabLeft,
    top: tabTop
  } = tab.getBoundingClientRect();
  const {
    left: listLeft,
    top: listTop
  } = tabsList.getBoundingClientRect();
  const left = tabLeft - listLeft;
  const top = tabTop - listTop;
  return {
    left,
    top
  };
}
function useActivationDirectionDetector(activeTabValue, orientation, tabsListElement, getTabElement) {
  const [previousTabEdge, setPreviousTabEdge] = React29.useState(null);
  useIsoLayoutEffect(() => {
    if (activeTabValue == null || tabsListElement == null) {
      setPreviousTabEdge(null);
      return;
    }
    const activeTab = getTabElement(activeTabValue);
    if (activeTab == null) {
      setPreviousTabEdge(null);
      return;
    }
    const {
      left,
      top
    } = getInset(activeTab, tabsListElement);
    setPreviousTabEdge(orientation === "horizontal" ? left : top);
  }, [orientation, getTabElement, tabsListElement, activeTabValue]);
  return React29.useCallback((newValue) => {
    if (newValue === activeTabValue) {
      return "none";
    }
    if (newValue == null) {
      setPreviousTabEdge(null);
      return "none";
    }
    if (newValue != null && tabsListElement != null) {
      const activeTabElement = getTabElement(newValue);
      if (activeTabElement != null) {
        const {
          left,
          top
        } = getInset(activeTabElement, tabsListElement);
        if (previousTabEdge == null) {
          setPreviousTabEdge(orientation === "horizontal" ? left : top);
          return "none";
        }
        if (orientation === "horizontal") {
          if (left < previousTabEdge) {
            setPreviousTabEdge(left);
            return "left";
          }
          if (left > previousTabEdge) {
            setPreviousTabEdge(left);
            return "right";
          }
        } else if (top < previousTabEdge) {
          setPreviousTabEdge(top);
          return "up";
        } else if (top > previousTabEdge) {
          setPreviousTabEdge(top);
          return "down";
        }
      }
    }
    return "none";
  }, [getTabElement, orientation, previousTabEdge, tabsListElement, activeTabValue]);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.1.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-render/useRender.js
function useRender(params) {
  return useRenderElement(params.defaultTagName ?? "div", params, params);
}

// ../../../node_modules/.pnpm/@wordpress+ui@0.6.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/stack/stack.mjs
var import_element2 = __toESM(require_element(), 1);
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "71d20935c2");
  style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}"));
  document.head.appendChild(style);
}
var style_default = { "stack": "_19ce0419607e1896__stack" };
var Stack = (0, import_element2.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render: render4, ...props }, ref) {
  const style = {
    gap: gap && `var(--wpds-dimension-gap-${gap})`,
    alignItems: align,
    justifyContent: justify,
    flexDirection: direction,
    flexWrap: wrap
  };
  const element = useRender({
    render: render4,
    ref,
    props: mergeProps(props, { style, className: style_default.stack })
  });
  return element;
});

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/icon/index.mjs
var import_element3 = __toESM(require_element(), 1);
var icon_default = (0, import_element3.forwardRef)(
  ({ icon: icon15, size = 24, ...props }, ref) => {
    return (0, import_element3.cloneElement)(icon15, {
      width: size,
      height: size,
      ...props,
      ref
    });
  }
);

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-down.mjs
var import_primitives = __toESM(require_primitives(), 1);
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-left.mjs
var import_primitives2 = __toESM(require_primitives(), 1);
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives2.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-right.mjs
var import_primitives3 = __toESM(require_primitives(), 1);
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives3.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-up.mjs
var import_primitives4 = __toESM(require_primitives(), 1);
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
var arrow_up_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives4.Path, { d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/backup.mjs
var import_primitives5 = __toESM(require_primitives(), 1);
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var backup_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives5.Path, { d: "M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/block-table.mjs
var import_primitives6 = __toESM(require_primitives(), 1);
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives6.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/category.mjs
var import_primitives7 = __toESM(require_primitives(), 1);
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
var category_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives7.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/check.mjs
var import_primitives8 = __toESM(require_primitives(), 1);
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var check_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives8.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/chevron-down.mjs
var import_primitives9 = __toESM(require_primitives(), 1);
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives9.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/chevron-right.mjs
var import_primitives10 = __toESM(require_primitives(), 1);
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives10.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/chevron-up.mjs
var import_primitives11 = __toESM(require_primitives(), 1);
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives11.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/close-small.mjs
var import_primitives12 = __toESM(require_primitives(), 1);
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives12.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/close.mjs
var import_primitives13 = __toESM(require_primitives(), 1);
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
var close_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives13.Path, { d: "m13.06 12 6.47-6.47-1.06-1.06L12 10.94 5.53 4.47 4.47 5.53 10.94 12l-6.47 6.47 1.06 1.06L12 13.06l6.47 6.47 1.06-1.06L13.06 12Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/cog.mjs
var import_primitives14 = __toESM(require_primitives(), 1);
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var cog_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives14.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/comment-content.mjs
var import_primitives15 = __toESM(require_primitives(), 1);
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
var comment_content_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives15.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/copy-small.mjs
var import_primitives16 = __toESM(require_primitives(), 1);
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
var copy_small_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives16.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.625 5.5h9.75c.069 0 .125.056.125.125v9.75a.125.125 0 0 1-.125.125h-9.75a.125.125 0 0 1-.125-.125v-9.75c0-.069.056-.125.125-.125ZM4 5.625C4 4.728 4.728 4 5.625 4h9.75C16.273 4 17 4.728 17 5.625v9.75c0 .898-.727 1.625-1.625 1.625h-9.75A1.625 1.625 0 0 1 4 15.375v-9.75Zm14.5 11.656v-9H20v9C20 18.8 18.77 20 17.251 20H6.25v-1.5h11.001c.69 0 1.249-.528 1.249-1.219Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/download.mjs
var import_primitives17 = __toESM(require_primitives(), 1);
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
var download_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives17.Path, { d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/envelope.mjs
var import_primitives18 = __toESM(require_primitives(), 1);
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives18.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M3 7c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Zm2-.5h14c.3 0 .5.2.5.5v1L12 13.5 4.5 7.9V7c0-.3.2-.5.5-.5Zm-.5 3.3V17c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V9.8L12 15.4 4.5 9.8Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/error.mjs
var import_primitives19 = __toESM(require_primitives(), 1);
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
var error_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives19.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.mjs
var import_primitives20 = __toESM(require_primitives(), 1);
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives20.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/format-list-bullets.mjs
var import_primitives21 = __toESM(require_primitives(), 1);
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives21.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/funnel.mjs
var import_primitives22 = __toESM(require_primitives(), 1);
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
var funnel_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives22.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/globe.mjs
var import_primitives23 = __toESM(require_primitives(), 1);
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
var globe_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives23.Path, { d: "M12 4c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8Zm6.5 8c0 .6 0 1.2-.2 1.8h-2.7c0-.6.2-1.1.2-1.8s0-1.2-.2-1.8h2.7c.2.6.2 1.1.2 1.8Zm-.9-3.2h-2.4c-.3-.9-.7-1.8-1.1-2.4-.1-.2-.2-.4-.3-.5 1.6.5 3 1.6 3.8 3ZM12.8 17c-.3.5-.6 1-.8 1.3-.2-.3-.5-.8-.8-1.3-.3-.5-.6-1.1-.8-1.7h3.3c-.2.6-.5 1.2-.8 1.7Zm-2.9-3.2c-.1-.6-.2-1.1-.2-1.8s0-1.2.2-1.8H14c.1.6.2 1.1.2 1.8s0 1.2-.2 1.8H9.9ZM11.2 7c.3-.5.6-1 .8-1.3.2.3.5.8.8 1.3.3.5.6 1.1.8 1.7h-3.3c.2-.6.5-1.2.8-1.7Zm-1-1.2c-.1.2-.2.3-.3.5-.4.7-.8 1.5-1.1 2.4H6.4c.8-1.4 2.2-2.5 3.8-3Zm-1.8 8H5.7c-.2-.6-.2-1.1-.2-1.8s0-1.2.2-1.8h2.7c0 .6-.2 1.1-.2 1.8s0 1.2.2 1.8Zm-2 1.4h2.4c.3.9.7 1.8 1.1 2.4.1.2.2.4.3.5-1.6-.5-3-1.6-3.8-3Zm7.4 3c.1-.2.2-.3.3-.5.4-.7.8-1.5 1.1-2.4h2.4c-.8 1.4-2.2 2.5-3.8 3Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/image.mjs
var import_primitives24 = __toESM(require_primitives(), 1);
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
var image_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives24.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/link.mjs
var import_primitives25 = __toESM(require_primitives(), 1);
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
var link_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives25.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/mobile.mjs
var import_primitives26 = __toESM(require_primitives(), 1);
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives26.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/more-vertical.mjs
var import_primitives27 = __toESM(require_primitives(), 1);
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives27.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/next.mjs
var import_primitives28 = __toESM(require_primitives(), 1);
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
var next_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives28.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/plugins.mjs
var import_primitives29 = __toESM(require_primitives(), 1);
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives29.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/plus.mjs
var import_primitives30 = __toESM(require_primitives(), 1);
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
var plus_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives30.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/previous.mjs
var import_primitives31 = __toESM(require_primitives(), 1);
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
var previous_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives31.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/scheduled.mjs
var import_primitives32 = __toESM(require_primitives(), 1);
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
var scheduled_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives32.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/search.mjs
var import_primitives33 = __toESM(require_primitives(), 1);
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
var search_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives33.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives33.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/seen.mjs
var import_primitives34 = __toESM(require_primitives(), 1);
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
var seen_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives34.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/trash.mjs
var import_primitives35 = __toESM(require_primitives(), 1);
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
var trash_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives35.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/unseen.mjs
var import_primitives36 = __toESM(require_primitives(), 1);
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives36.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@11.7.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/upload.mjs
var import_primitives37 = __toESM(require_primitives(), 1);
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
var upload_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives37.Path, { d: "M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z" }) });

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.mjs
var import_element4 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/constants.mjs
var import_i18n2 = __toESM(require_i18n(), 1);
var OPERATOR_IS_ANY = "isAny";
var OPERATOR_IS_NONE = "isNone";
var OPERATOR_IS_ALL = "isAll";
var OPERATOR_IS_NOT_ALL = "isNotAll";
var OPERATOR_BETWEEN = "between";
var OPERATOR_IN_THE_PAST = "inThePast";
var OPERATOR_OVER = "over";
var OPERATOR_IS = "is";
var OPERATOR_IS_NOT = "isNot";
var OPERATOR_LESS_THAN = "lessThan";
var OPERATOR_GREATER_THAN = "greaterThan";
var OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual";
var OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual";
var OPERATOR_BEFORE = "before";
var OPERATOR_AFTER = "after";
var OPERATOR_BEFORE_INC = "beforeInc";
var OPERATOR_AFTER_INC = "afterInc";
var OPERATOR_CONTAINS = "contains";
var OPERATOR_NOT_CONTAINS = "notContains";
var OPERATOR_STARTS_WITH = "startsWith";
var OPERATOR_ON = "on";
var OPERATOR_NOT_ON = "notOn";
var SORTING_DIRECTIONS = ["asc", "desc"];
var sortArrows = { asc: "\u2191", desc: "\u2193" };
var sortValues = { asc: "ascending", desc: "descending" };
var sortLabels = {
  asc: (0, import_i18n2.__)("Sort ascending"),
  desc: (0, import_i18n2.__)("Sort descending")
};
var sortIcons = {
  asc: arrow_up_default,
  desc: arrow_down_default
};
var LAYOUT_TABLE = "table";
var LAYOUT_GRID = "grid";
var LAYOUT_LIST = "list";
var LAYOUT_ACTIVITY = "activity";
var LAYOUT_PICKER_GRID = "pickerGrid";
var LAYOUT_PICKER_TABLE = "pickerTable";

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.mjs
var DataViewsContext = (0, import_element4.createContext)({
  view: { type: LAYOUT_TABLE },
  onChangeView: () => {
  },
  fields: [],
  data: [],
  paginationInfo: {
    totalItems: 0,
    totalPages: 0
  },
  selection: [],
  onChangeSelection: () => {
  },
  setOpenedFilter: () => {
  },
  openedFilter: null,
  getItemId: (item) => item.id,
  isItemClickable: () => true,
  renderItemLink: void 0,
  containerWidth: 0,
  containerRef: (0, import_element4.createRef)(),
  resizeObserverRef: () => {
  },
  defaultLayouts: { list: {}, grid: {}, table: {} },
  filters: [],
  isShowingFilter: false,
  setIsShowingFilter: () => {
  },
  hasInfiniteScrollHandler: false,
  config: {
    perPageSizes: []
  }
});
DataViewsContext.displayName = "DataViewsContext";
var dataviews_context_default = DataViewsContext;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/index.mjs
var import_i18n22 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/index.mjs
var import_i18n10 = __toESM(require_i18n(), 1);
var import_components9 = __toESM(require_components(), 1);
var import_element11 = __toESM(require_element(), 1);
var import_keycodes = __toESM(require_keycodes(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.mjs
var import_components4 = __toESM(require_components(), 1);
var import_i18n3 = __toESM(require_i18n(), 1);
var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
function DataViewsSelectionCheckbox({
  selection,
  onChangeSelection,
  item,
  getItemId: getItemId2,
  titleField,
  disabled: disabled2,
  ...extraProps
}) {
  const id = getItemId2(item);
  const checked = !disabled2 && selection.includes(id);
  const selectionLabel = titleField?.getValue?.({ item }) || (0, import_i18n3.__)("(no title)");
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
    import_components4.CheckboxControl,
    {
      className: "dataviews-selection-checkbox",
      "aria-label": selectionLabel,
      "aria-disabled": disabled2,
      checked,
      onChange: () => {
        if (disabled2) {
          return;
        }
        onChangeSelection(
          selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
        );
      },
      ...extraProps
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.mjs
var import_components5 = __toESM(require_components(), 1);
var import_i18n4 = __toESM(require_i18n(), 1);
var import_element5 = __toESM(require_element(), 1);
var import_data = __toESM(require_data(), 1);
var import_compose = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/lock-unlock.mjs
var import_private_apis = __toESM(require_private_apis(), 1);
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
  "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
  "@wordpress/dataviews"
);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.mjs
var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
var { Menu, kebabCase } = unlock(import_components5.privateApis);
function ButtonTrigger({
  action,
  onClick,
  items,
  variant
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    import_components5.Button,
    {
      disabled: !!action.disabled,
      accessibleWhenDisabled: true,
      size: "compact",
      variant,
      onClick,
      children: label
    }
  );
}
function MenuItemTrigger({
  action,
  onClick,
  items
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Menu.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Menu.ItemLabel, { children: label }) });
}
function ActionModal({
  action,
  items,
  closeModal
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    import_components5.Modal,
    {
      title: modalHeader || label,
      __experimentalHideHeader: !!action.hideModalHeader,
      onRequestClose: closeModal,
      focusOnMount: action.modalFocusOnMount ?? true,
      size: action.modalSize || "medium",
      overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(
        action.id
      )}`,
      children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(action.RenderModal, { items, closeModal })
    }
  );
}
function ActionsMenuGroup({
  actions: actions2,
  item,
  registry,
  setActiveModalAction
}) {
  const { primaryActions, regularActions } = (0, import_element5.useMemo)(() => {
    return actions2.reduce(
      (acc, action) => {
        (action.isPrimary ? acc.primaryActions : acc.regularActions).push(action);
        return acc;
      },
      {
        primaryActions: [],
        regularActions: []
      }
    );
  }, [actions2]);
  const renderActionGroup = (actionList) => actionList.map((action) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    MenuItemTrigger,
    {
      action,
      onClick: () => {
        if ("RenderModal" in action) {
          setActiveModalAction(action);
          return;
        }
        action.callback([item], { registry });
      },
      items: [item]
    },
    action.id
  ));
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Menu.Group, { children: [
    renderActionGroup(primaryActions),
    primaryActions.length > 0 && regularActions.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Menu.Separator, {}),
    renderActionGroup(regularActions)
  ] });
}
function ItemActions({
  item,
  actions: actions2,
  isCompact
}) {
  const registry = (0, import_data.useRegistry)();
  const { primaryActions, eligibleActions } = (0, import_element5.useMemo)(() => {
    const _eligibleActions = actions2.filter(
      (action) => !action.isEligible || action.isEligible(item)
    );
    const _primaryActions = _eligibleActions.filter(
      (action) => action.isPrimary
    );
    return {
      primaryActions: _primaryActions,
      eligibleActions: _eligibleActions
    };
  }, [actions2, item]);
  const isMobileViewport = (0, import_compose.useViewportMatch)("medium", "<");
  if (isCompact) {
    return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      CompactItemActions,
      {
        item,
        actions: eligibleActions,
        isSmall: true,
        registry
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
    Stack,
    {
      direction: "row",
      justify: "flex-end",
      className: "dataviews-item-actions",
      style: {
        flexShrink: 0,
        width: "auto"
      },
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
          PrimaryActions,
          {
            item,
            actions: primaryActions,
            registry
          }
        ),
        (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu
        // there if there are any actions at all.
        isMobileViewport) && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
          CompactItemActions,
          {
            item,
            actions: eligibleActions,
            registry
          }
        )
      ]
    }
  );
}
function CompactItemActions({
  item,
  actions: actions2,
  isSmall,
  registry
}) {
  const [activeModalAction, setActiveModalAction] = (0, import_element5.useState)(
    null
  );
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(Menu, { placement: "bottom-end", children: [
      /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
        Menu.TriggerButton,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
            import_components5.Button,
            {
              size: isSmall ? "small" : "compact",
              icon: more_vertical_default,
              label: (0, import_i18n4.__)("Actions"),
              accessibleWhenDisabled: true,
              disabled: !actions2.length,
              className: "dataviews-all-actions-button"
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
        ActionsMenuGroup,
        {
          actions: actions2,
          item,
          registry,
          setActiveModalAction
        }
      ) })
    ] }),
    !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      ActionModal,
      {
        action: activeModalAction,
        items: [item],
        closeModal: () => setActiveModalAction(null)
      }
    )
  ] });
}
function PrimaryActions({
  item,
  actions: actions2,
  registry,
  buttonVariant
}) {
  const [activeModalAction, setActiveModalAction] = (0, import_element5.useState)(null);
  const isMobileViewport = (0, import_compose.useViewportMatch)("medium", "<");
  if (isMobileViewport) {
    return null;
  }
  if (!Array.isArray(actions2) || actions2.length === 0) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
    actions2.map((action) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      ButtonTrigger,
      {
        action,
        onClick: () => {
          if ("RenderModal" in action) {
            setActiveModalAction(action);
            return;
          }
          action.callback([item], { registry });
        },
        items: [item],
        variant: buttonVariant
      },
      action.id
    )),
    !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      ActionModal,
      {
        action: activeModalAction,
        items: [item],
        closeModal: () => setActiveModalAction(null)
      }
    )
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.mjs
var import_components6 = __toESM(require_components(), 1);
var import_i18n6 = __toESM(require_i18n(), 1);
var import_element6 = __toESM(require_element(), 1);
var import_data2 = __toESM(require_data(), 1);
var import_compose2 = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/utils/get-footer-message.mjs
var import_i18n5 = __toESM(require_i18n(), 1);
function getFooterMessage(selectionCount, itemsCount, totalItems) {
  if (selectionCount > 0) {
    return (0, import_i18n5.sprintf)(
      /* translators: %d: number of items. */
      (0, import_i18n5._n)("%d Item selected", "%d Items selected", selectionCount),
      selectionCount
    );
  }
  if (totalItems > itemsCount) {
    return (0, import_i18n5.sprintf)(
      /* translators: %1$d: number of items. %2$d: total number of items. */
      (0, import_i18n5._n)("%1$d of %2$d Item", "%1$d of %2$d Items", totalItems),
      itemsCount,
      totalItems
    );
  }
  return (0, import_i18n5.sprintf)(
    /* translators: %d: number of items. */
    (0, import_i18n5._n)("%d Item", "%d Items", itemsCount),
    itemsCount
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.mjs
var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
function ActionWithModal({
  action,
  items,
  ActionTriggerComponent
}) {
  const [isModalOpen, setIsModalOpen] = (0, import_element6.useState)(false);
  const actionTriggerProps = {
    action,
    onClick: () => {
      setIsModalOpen(true);
    },
    items
  };
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(ActionTriggerComponent, { ...actionTriggerProps }),
    isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
      ActionModal,
      {
        action,
        items,
        closeModal: () => setIsModalOpen(false)
      }
    )
  ] });
}
function useHasAPossibleBulkAction(actions2, item) {
  return (0, import_element6.useMemo)(() => {
    return actions2.some((action) => {
      return action.supportsBulk && (!action.isEligible || action.isEligible(item));
    });
  }, [actions2, item]);
}
function useSomeItemHasAPossibleBulkAction(actions2, data) {
  return (0, import_element6.useMemo)(() => {
    return data.some((item) => {
      return actions2.some((action) => {
        return action.supportsBulk && (!action.isEligible || action.isEligible(item));
      });
    });
  }, [actions2, data]);
}
function BulkSelectionCheckbox({
  selection,
  onChangeSelection,
  data,
  actions: actions2,
  getItemId: getItemId2
}) {
  const selectableItems = (0, import_element6.useMemo)(() => {
    return data.filter((item) => {
      return actions2.some(
        (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
      );
    });
  }, [data, actions2]);
  const selectedItems = data.filter(
    (item) => selection.includes(getItemId2(item)) && selectableItems.includes(item)
  );
  const areAllSelected = selectedItems.length === selectableItems.length;
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
    import_components6.CheckboxControl,
    {
      className: "dataviews-view-table-selection-checkbox",
      checked: areAllSelected,
      indeterminate: !areAllSelected && !!selectedItems.length,
      onChange: () => {
        if (areAllSelected) {
          onChangeSelection([]);
        } else {
          onChangeSelection(
            selectableItems.map((item) => getItemId2(item))
          );
        }
      },
      "aria-label": areAllSelected ? (0, import_i18n6.__)("Deselect all") : (0, import_i18n6.__)("Select all")
    }
  );
}
function ActionTrigger({
  action,
  onClick,
  isBusy,
  items
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  const isMobile = (0, import_compose2.useViewportMatch)("medium", "<");
  if (isMobile) {
    return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
      import_components6.Button,
      {
        disabled: isBusy,
        accessibleWhenDisabled: true,
        label,
        icon: action.icon,
        size: "compact",
        onClick,
        isBusy
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
    import_components6.Button,
    {
      disabled: isBusy,
      accessibleWhenDisabled: true,
      size: "compact",
      onClick,
      isBusy,
      children: label
    }
  );
}
var EMPTY_ARRAY3 = [];
function ActionButton({
  action,
  selectedItems,
  actionInProgress,
  setActionInProgress
}) {
  const registry = (0, import_data2.useRegistry)();
  const selectedEligibleItems = (0, import_element6.useMemo)(() => {
    return selectedItems.filter((item) => {
      return !action.isEligible || action.isEligible(item);
    });
  }, [action, selectedItems]);
  if ("RenderModal" in action) {
    return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
      ActionWithModal,
      {
        action,
        items: selectedEligibleItems,
        ActionTriggerComponent: ActionTrigger
      },
      action.id
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
    ActionTrigger,
    {
      action,
      onClick: async () => {
        setActionInProgress(action.id);
        await action.callback(selectedItems, {
          registry
        });
        setActionInProgress(null);
      },
      items: selectedEligibleItems,
      isBusy: actionInProgress === action.id
    },
    action.id
  );
}
function renderFooterContent(data, actions2, getItemId2, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection, paginationInfo) {
  const message2 = getFooterMessage(
    selection.length,
    data.length,
    paginationInfo.totalItems
  );
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
    Stack,
    {
      direction: "row",
      className: "dataviews-bulk-actions-footer__container",
      gap: "sm",
      align: "center",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          BulkSelectionCheckbox,
          {
            selection,
            onChangeSelection,
            data,
            actions: actions2,
            getItemId: getItemId2
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message2 }),
        /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
          Stack,
          {
            direction: "row",
            className: "dataviews-bulk-actions-footer__action-buttons",
            gap: "2xs",
            children: [
              actionsToShow.map((action) => {
                return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
                  ActionButton,
                  {
                    action,
                    selectedItems,
                    actionInProgress,
                    setActionInProgress
                  },
                  action.id
                );
              }),
              selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
                import_components6.Button,
                {
                  icon: close_small_default,
                  showTooltip: true,
                  tooltipPosition: "top",
                  size: "compact",
                  label: (0, import_i18n6.__)("Cancel"),
                  disabled: !!actionInProgress,
                  accessibleWhenDisabled: false,
                  onClick: () => {
                    onChangeSelection(EMPTY_ARRAY3);
                  }
                }
              )
            ]
          }
        )
      ]
    }
  );
}
function FooterContent({
  selection,
  actions: actions2,
  onChangeSelection,
  data,
  getItemId: getItemId2,
  paginationInfo
}) {
  const [actionInProgress, setActionInProgress] = (0, import_element6.useState)(
    null
  );
  const footerContentRef = (0, import_element6.useRef)(null);
  const isMobile = (0, import_compose2.useViewportMatch)("medium", "<");
  const bulkActions = (0, import_element6.useMemo)(
    () => actions2.filter((action) => action.supportsBulk),
    [actions2]
  );
  const selectableItems = (0, import_element6.useMemo)(() => {
    return data.filter((item) => {
      return bulkActions.some(
        (action) => !action.isEligible || action.isEligible(item)
      );
    });
  }, [data, bulkActions]);
  const selectedItems = (0, import_element6.useMemo)(() => {
    return data.filter(
      (item) => selection.includes(getItemId2(item)) && selectableItems.includes(item)
    );
  }, [selection, data, getItemId2, selectableItems]);
  const actionsToShow = (0, import_element6.useMemo)(
    () => actions2.filter((action) => {
      return action.supportsBulk && (!isMobile || action.icon) && selectedItems.some(
        (item) => !action.isEligible || action.isEligible(item)
      );
    }),
    [actions2, selectedItems, isMobile]
  );
  if (!actionInProgress) {
    if (footerContentRef.current) {
      footerContentRef.current = null;
    }
    return renderFooterContent(
      data,
      actions2,
      getItemId2,
      selection,
      actionsToShow,
      selectedItems,
      actionInProgress,
      setActionInProgress,
      onChangeSelection,
      paginationInfo
    );
  } else if (!footerContentRef.current) {
    footerContentRef.current = renderFooterContent(
      data,
      actions2,
      getItemId2,
      selection,
      actionsToShow,
      selectedItems,
      actionInProgress,
      setActionInProgress,
      onChangeSelection,
      paginationInfo
    );
  }
  return footerContentRef.current;
}
function BulkActionsFooter() {
  const {
    data,
    selection,
    actions: actions2 = EMPTY_ARRAY3,
    onChangeSelection,
    getItemId: getItemId2,
    paginationInfo
  } = (0, import_element6.useContext)(dataviews_context_default);
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
    FooterContent,
    {
      selection,
      onChangeSelection,
      data,
      actions: actions2,
      getItemId: getItemId2,
      paginationInfo
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs
var import_i18n7 = __toESM(require_i18n(), 1);
var import_components7 = __toESM(require_components(), 1);
var import_element7 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/utils/get-hideable-fields.mjs
function getHideableFields(view, fields) {
  const togglableFields = [
    view?.titleField,
    view?.mediaField,
    view?.descriptionField
  ].filter(Boolean);
  return fields.filter(
    (f2) => !togglableFields.includes(f2.id) && f2.type !== "media" && f2.enableHiding !== false
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs
var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu2 } = unlock(import_components7.privateApis);
function WithMenuSeparators({ children }) {
  return import_element7.Children.toArray(children).filter(Boolean).map((child, i2) => /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_element7.Fragment, { children: [
    i2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.Separator, {}),
    child
  ] }, i2));
}
var _HeaderMenu = (0, import_element7.forwardRef)(function HeaderMenu({
  fieldId,
  view,
  fields,
  onChangeView,
  onHide,
  setOpenedFilter,
  canMove = true,
  canInsertLeft = true,
  canInsertRight = true
}, ref) {
  const visibleFieldIds = view.fields ?? [];
  const index = visibleFieldIds?.indexOf(fieldId);
  const isSorted = view.sort?.field === fieldId;
  let isHidable = false;
  let isSortable = false;
  let canAddFilter = false;
  let operators = [];
  const field = fields.find((f2) => f2.id === fieldId);
  const { setIsShowingFilter } = (0, import_element7.useContext)(dataviews_context_default);
  if (!field) {
    return null;
  }
  isHidable = field.enableHiding !== false;
  isSortable = field.enableSorting !== false;
  const header = field.header;
  operators = !!field.filterBy && field.filterBy?.operators || [];
  canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary;
  if (!isSortable && !canMove && !isHidable && !canAddFilter) {
    return header;
  }
  const hiddenFields = getHideableFields(view, fields).filter(
    (f2) => !visibleFieldIds.includes(f2.id)
  );
  const canInsert = (canInsertLeft || canInsertRight) && !!hiddenFields.length;
  const isRtl = (0, import_i18n7.isRTL)();
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Menu2, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
      Menu2.TriggerButton,
      {
        render: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
          import_components7.Button,
          {
            size: "compact",
            className: "dataviews-view-table-header-button",
            ref,
            variant: "tertiary"
          }
        ),
        children: [
          header,
          view.sort && isSorted && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { "aria-hidden": "true", children: sortArrows[view.sort.direction] })
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.Popover, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(WithMenuSeparators, { children: [
      isSortable && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.Group, { children: SORTING_DIRECTIONS.map(
        (direction) => {
          const isChecked = view.sort && isSorted && view.sort.direction === direction;
          const value = `${fieldId}-${direction}`;
          return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
            Menu2.RadioItem,
            {
              name: "view-table-sorting",
              value,
              checked: isChecked,
              onChange: () => {
                onChangeView({
                  ...view,
                  sort: {
                    field: fieldId,
                    direction
                  },
                  showLevels: false
                });
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: sortLabels[direction] })
            },
            value
          );
        }
      ) }),
      canAddFilter && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
        Menu2.Item,
        {
          prefix: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components7.Icon, { icon: funnel_default }),
          onClick: () => {
            setOpenedFilter(fieldId);
            setIsShowingFilter(true);
            onChangeView({
              ...view,
              page: 1,
              filters: [
                ...view.filters || [],
                {
                  field: fieldId,
                  value: void 0,
                  operator: operators[0]
                }
              ]
            });
          },
          children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Add filter") })
        }
      ) }),
      (canMove || isHidable || canInsert) && field && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Menu2.Group, { children: [
        canMove && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
          Menu2.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components7.Icon, { icon: arrow_left_default }),
            disabled: isRtl ? index >= visibleFieldIds.length - 1 : index < 1,
            onClick: () => {
              const targetIndex = isRtl ? index + 1 : index - 1;
              const newFields = [
                ...visibleFieldIds
              ];
              newFields.splice(index, 1);
              newFields.splice(
                targetIndex,
                0,
                fieldId
              );
              onChangeView({
                ...view,
                fields: newFields
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Move left") })
          }
        ),
        canMove && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
          Menu2.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components7.Icon, { icon: arrow_right_default }),
            disabled: isRtl ? index < 1 : index >= visibleFieldIds.length - 1,
            onClick: () => {
              const targetIndex = isRtl ? index - 1 : index + 1;
              const newFields = [
                ...visibleFieldIds
              ];
              newFields.splice(index, 1);
              newFields.splice(
                targetIndex,
                0,
                fieldId
              );
              onChangeView({
                ...view,
                fields: newFields
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Move right") })
          }
        ),
        canInsertLeft && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Menu2, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Insert left") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.Popover, { children: hiddenFields.map((hiddenField) => {
            const insertIndex = isRtl ? index + 1 : index;
            return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
              Menu2.Item,
              {
                onClick: () => {
                  onChangeView({
                    ...view,
                    fields: [
                      ...visibleFieldIds.slice(
                        0,
                        insertIndex
                      ),
                      hiddenField.id,
                      ...visibleFieldIds.slice(
                        insertIndex
                      )
                    ]
                  });
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: hiddenField.label })
              },
              hiddenField.id
            );
          }) })
        ] }),
        canInsertRight && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Menu2, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Insert right") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.Popover, { children: hiddenFields.map((hiddenField) => {
            const insertIndex = isRtl ? index : index + 1;
            return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
              Menu2.Item,
              {
                onClick: () => {
                  onChangeView({
                    ...view,
                    fields: [
                      ...visibleFieldIds.slice(
                        0,
                        insertIndex
                      ),
                      hiddenField.id,
                      ...visibleFieldIds.slice(
                        insertIndex
                      )
                    ]
                  });
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: hiddenField.label })
              },
              hiddenField.id
            );
          }) })
        ] }),
        isHidable && field && /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
          Menu2.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components7.Icon, { icon: unseen_default }),
            onClick: () => {
              onHide(field);
              onChangeView({
                ...view,
                fields: visibleFieldIds.filter(
                  (id) => id !== fieldId
                )
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Hide column") })
          }
        )
      ] })
    ] }) })
  ] });
});
var ColumnHeaderMenu = _HeaderMenu;
var column_header_menu_default = ColumnHeaderMenu;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs
var import_element8 = __toESM(require_element(), 1);
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
function getClickableItemProps({
  item,
  isItemClickable,
  onClickItem,
  className
}) {
  if (!isItemClickable(item) || !onClickItem) {
    return { className };
  }
  return {
    className: className ? `${className} ${className}--clickable` : void 0,
    role: "button",
    tabIndex: 0,
    onClick: (event) => {
      event.stopPropagation();
      onClickItem(item);
    },
    onKeyDown: (event) => {
      if (event.key === "Enter" || event.key === "" || event.key === " ") {
        event.stopPropagation();
        onClickItem(item);
      }
    }
  };
}
function ItemClickWrapper({
  item,
  isItemClickable,
  onClickItem,
  renderItemLink,
  className,
  children,
  ...extraProps
}) {
  if (!isItemClickable(item)) {
    return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className, ...extraProps, children });
  }
  if (renderItemLink) {
    const renderedElement = renderItemLink({
      item,
      className: `${className} ${className}--clickable`,
      ...extraProps,
      children
    });
    return (0, import_element8.cloneElement)(renderedElement, {
      onClick: (event) => {
        event.stopPropagation();
        if (renderedElement.props.onClick) {
          renderedElement.props.onClick(event);
        }
      },
      onKeyDown: (event) => {
        if (event.key === "Enter" || event.key === "" || event.key === " ") {
          event.stopPropagation();
          if (renderedElement.props.onKeyDown) {
            renderedElement.props.onKeyDown(event);
          }
        }
      }
    });
  }
  const clickProps = getClickableItemProps({
    item,
    isItemClickable,
    onClickItem,
    className
  });
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { ...clickProps, ...extraProps, children });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/column-primary.mjs
var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
function ColumnPrimary({
  item,
  level,
  titleField,
  mediaField,
  descriptionField,
  onClickItem,
  renderItemLink,
  isItemClickable
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { direction: "row", gap: "sm", align: "flex-start", justify: "flex-start", children: [
    mediaField && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
      ItemClickWrapper,
      {
        item,
        isItemClickable,
        onClickItem,
        renderItemLink,
        className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",
        "aria-label": isItemClickable(item) && (!!onClickItem || !!renderItemLink) && !!titleField ? titleField.getValue?.({ item }) : void 0,
        children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
          mediaField.render,
          {
            item,
            field: mediaField,
            config: { sizes: "32px" }
          }
        )
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
      Stack,
      {
        direction: "column",
        align: "flex-start",
        className: "dataviews-view-table__primary-column-content",
        children: [
          titleField && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
            ItemClickWrapper,
            {
              item,
              isItemClickable,
              onClickItem,
              renderItemLink,
              className: "dataviews-view-table__cell-content-wrapper dataviews-title-field",
              children: [
                level !== void 0 && level > 0 && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "dataviews-view-table__level", children: [
                  Array(level).fill("\u2014").join(" "),
                  "\xA0"
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(titleField.render, { item, field: titleField })
              ]
            }
          ),
          descriptionField && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
            descriptionField.render,
            {
              item,
              field: descriptionField
            }
          )
        ]
      }
    )
  ] });
}
var column_primary_default = ColumnPrimary;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/use-is-horizontal-scroll-end.mjs
var import_compose3 = __toESM(require_compose(), 1);
var import_element9 = __toESM(require_element(), 1);
var import_i18n8 = __toESM(require_i18n(), 1);
var isScrolledToEnd = (element) => {
  if ((0, import_i18n8.isRTL)()) {
    const scrollLeft = Math.abs(element.scrollLeft);
    return scrollLeft <= 1;
  }
  return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
};
function useIsHorizontalScrollEnd({
  scrollContainerRef,
  enabled = false
}) {
  const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0, import_element9.useState)(false);
  const handleIsHorizontalScrollEnd = (0, import_compose3.useDebounce)(
    (0, import_element9.useCallback)(() => {
      const scrollContainer = scrollContainerRef.current;
      if (scrollContainer) {
        setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
      }
    }, [scrollContainerRef, setIsHorizontalScrollEnd]),
    200
  );
  (0, import_element9.useEffect)(() => {
    if (typeof window === "undefined" || !enabled || !scrollContainerRef.current) {
      return () => {
      };
    }
    handleIsHorizontalScrollEnd();
    scrollContainerRef.current.addEventListener(
      "scroll",
      handleIsHorizontalScrollEnd
    );
    window.addEventListener("resize", handleIsHorizontalScrollEnd);
    return () => {
      scrollContainerRef.current?.removeEventListener(
        "scroll",
        handleIsHorizontalScrollEnd
      );
      window.removeEventListener("resize", handleIsHorizontalScrollEnd);
    };
  }, [scrollContainerRef, enabled]);
  return isHorizontalScrollEnd;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/get-data-by-group.mjs
function getDataByGroup(data, groupByField) {
  return data.reduce((groups, item) => {
    const groupName = groupByField.getValue({ item });
    if (!groups.has(groupName)) {
      groups.set(groupName, []);
    }
    groups.get(groupName)?.push(item);
    return groups;
  }, /* @__PURE__ */ new Map());
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.mjs
var import_components8 = __toESM(require_components(), 1);
var import_i18n9 = __toESM(require_i18n(), 1);
var import_element10 = __toESM(require_element(), 1);
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
function FieldItem({
  field,
  isVisible: isVisible2,
  onToggleVisibility
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components8.__experimentalItem, { onClick: field.enableHiding ? onToggleVisibility : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Stack, { direction: "row", gap: "xs", justify: "flex-start", align: "center", children: [
    /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { style: { height: 24, width: 24 }, children: isVisible2 && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components8.Icon, { icon: check_default }) }),
    /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "dataviews-view-config__label", children: field.label })
  ] }) });
}
function isDefined(item) {
  return !!item;
}
function PropertiesSection({
  showLabel = true
}) {
  const { view, fields, onChangeView } = (0, import_element10.useContext)(dataviews_context_default);
  const regularFields = getHideableFields(view, fields);
  if (!regularFields?.length) {
    return null;
  }
  const titleField = fields.find((f2) => f2.id === view.titleField);
  const previewField = fields.find((f2) => f2.id === view.mediaField);
  const descriptionField = fields.find(
    (f2) => f2.id === view.descriptionField
  );
  const lockedFields = [
    {
      field: titleField,
      isVisibleFlag: "showTitle"
    },
    {
      field: previewField,
      isVisibleFlag: "showMedia"
    },
    {
      field: descriptionField,
      isVisibleFlag: "showDescription"
    }
  ].filter(({ field }) => isDefined(field));
  const visibleFieldIds = view.fields ?? [];
  const visibleRegularFieldsCount = regularFields.filter(
    (f2) => visibleFieldIds.includes(f2.id)
  ).length;
  const visibleLockedFields = lockedFields.filter(
    ({ isVisibleFlag }) => (
      // @ts-expect-error
      view[isVisibleFlag] ?? true
    )
  );
  const totalVisibleFields = visibleLockedFields.length + visibleRegularFieldsCount;
  const isSingleVisibleLockedField = totalVisibleFields === 1 && visibleLockedFields.length === 1;
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(Stack, { direction: "column", className: "dataviews-field-control", children: [
    showLabel && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components8.BaseControl.VisualLabel, { children: (0, import_i18n9.__)("Properties") }),
    /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
      Stack,
      {
        direction: "column",
        className: "dataviews-view-config__properties",
        children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_components8.__experimentalItemGroup, { isBordered: true, isSeparated: true, size: "medium", children: [
          lockedFields.map(({ field, isVisibleFlag }) => {
            const isVisible2 = view[isVisibleFlag] ?? true;
            const fieldToRender = isSingleVisibleLockedField && isVisible2 ? { ...field, enableHiding: false } : field;
            return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              FieldItem,
              {
                field: fieldToRender,
                isVisible: isVisible2,
                onToggleVisibility: () => {
                  onChangeView({
                    ...view,
                    [isVisibleFlag]: !isVisible2
                  });
                }
              },
              field.id
            );
          }),
          regularFields.map((field) => {
            const isVisible2 = visibleFieldIds.includes(field.id);
            const fieldToRender = totalVisibleFields === 1 && isVisible2 ? { ...field, enableHiding: false } : field;
            return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              FieldItem,
              {
                field: fieldToRender,
                isVisible: isVisible2,
                onToggleVisibility: () => {
                  onChangeView({
                    ...view,
                    fields: isVisible2 ? visibleFieldIds.filter(
                      (fieldId) => fieldId !== field.id
                    ) : [...visibleFieldIds, field.id]
                  });
                }
              },
              field.id
            );
          })
        ] })
      }
    )
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/index.mjs
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
function TableColumnField({
  item,
  fields,
  column,
  align
}) {
  const field = fields.find((f2) => f2.id === column);
  if (!field) {
    return null;
  }
  const className = clsx_default("dataviews-view-table__cell-content-wrapper", {
    "dataviews-view-table__cell-align-end": align === "end",
    "dataviews-view-table__cell-align-center": align === "center"
  });
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(field.render, { item, field }) });
}
function TableRow({
  hasBulkActions,
  item,
  level,
  actions: actions2,
  fields,
  id,
  view,
  titleField,
  mediaField,
  descriptionField,
  selection,
  getItemId: getItemId2,
  isItemClickable,
  onClickItem,
  renderItemLink,
  onChangeSelection,
  isActionsColumnSticky,
  posinset
}) {
  const { paginationInfo } = (0, import_element11.useContext)(dataviews_context_default);
  const hasPossibleBulkAction = useHasAPossibleBulkAction(actions2, item);
  const isSelected2 = hasPossibleBulkAction && selection.includes(id);
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const isTouchDeviceRef = (0, import_element11.useRef)(false);
  const columns = view.fields ?? [];
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
    "tr",
    {
      className: clsx_default("dataviews-view-table__row", {
        "is-selected": hasPossibleBulkAction && isSelected2,
        "has-bulk-actions": hasPossibleBulkAction
      }),
      onTouchStart: () => {
        isTouchDeviceRef.current = true;
      },
      "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
      "aria-posinset": posinset,
      role: infiniteScrollEnabled ? "article" : void 0,
      onMouseDown: (event) => {
        const isMetaClick = (0, import_keycodes.isAppleOS)() ? event.metaKey : event.ctrlKey;
        if (event.button === 0 && isMetaClick && window.navigator.userAgent.toLowerCase().includes("firefox")) {
          event?.preventDefault();
        }
      },
      onClick: (event) => {
        if (!hasPossibleBulkAction) {
          return;
        }
        const isModifierKeyPressed = (0, import_keycodes.isAppleOS)() ? event.metaKey : event.ctrlKey;
        if (isModifierKeyPressed && !isTouchDeviceRef.current && document.getSelection()?.type !== "Range") {
          onChangeSelection(
            selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
          );
        }
      },
      children: [
        hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
          DataViewsSelectionCheckbox,
          {
            item,
            selection,
            onChangeSelection,
            getItemId: getItemId2,
            titleField,
            disabled: !hasPossibleBulkAction
          }
        ) }) }),
        hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
          column_primary_default,
          {
            item,
            level,
            titleField: showTitle ? titleField : void 0,
            mediaField: showMedia ? mediaField : void 0,
            descriptionField: showDescription ? descriptionField : void 0,
            isItemClickable,
            onClickItem,
            renderItemLink
          }
        ) }),
        columns.map((column) => {
          const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
          return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            "td",
            {
              style: {
                width,
                maxWidth,
                minWidth
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                TableColumnField,
                {
                  fields,
                  item,
                  column,
                  align
                }
              )
            },
            column
          );
        }),
        !!actions2?.length && // Disable reason: we are not making the element interactive,
        // but preventing any click events from bubbling up to the
        // table row. This allows us to add a click handler to the row
        // itself (to toggle row selection) without erroneously
        // intercepting click events from ItemActions.
        /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
        /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
          "td",
          {
            className: clsx_default("dataviews-view-table__actions-column", {
              "dataviews-view-table__actions-column--sticky": true,
              "dataviews-view-table__actions-column--stuck": isActionsColumnSticky
            }),
            onClick: (e2) => e2.stopPropagation(),
            children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ItemActions, { item, actions: actions2 })
          }
        )
      ]
    }
  );
}
function ViewTable({
  actions: actions2,
  data,
  fields,
  getItemId: getItemId2,
  getItemLevel,
  isLoading = false,
  onChangeView,
  onChangeSelection,
  selection,
  setOpenedFilter,
  onClickItem,
  isItemClickable,
  renderItemLink,
  view,
  className,
  empty
}) {
  const { containerRef } = (0, import_element11.useContext)(dataviews_context_default);
  const headerMenuRefs = (0, import_element11.useRef)(/* @__PURE__ */ new Map());
  const headerMenuToFocusRef = (0, import_element11.useRef)();
  const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element11.useState)();
  const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions2, data);
  const [contextMenuAnchor, setContextMenuAnchor] = (0, import_element11.useState)(null);
  (0, import_element11.useEffect)(() => {
    if (headerMenuToFocusRef.current) {
      headerMenuToFocusRef.current.focus();
      headerMenuToFocusRef.current = void 0;
    }
  });
  const tableNoticeId = (0, import_element11.useId)();
  const isHorizontalScrollEnd = useIsHorizontalScrollEnd({
    scrollContainerRef: containerRef,
    enabled: !!actions2?.length
  });
  if (nextHeaderMenuToFocus) {
    headerMenuToFocusRef.current = nextHeaderMenuToFocus;
    setNextHeaderMenuToFocus(void 0);
    return;
  }
  const onHide = (field) => {
    const hidden = headerMenuRefs.current.get(field.id);
    const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
    setNextHeaderMenuToFocus(fallback?.node);
  };
  const handleHeaderContextMenu = (event) => {
    event.preventDefault();
    event.stopPropagation();
    const virtualAnchor = {
      getBoundingClientRect: () => ({
        x: event.clientX,
        y: event.clientY,
        top: event.clientY,
        left: event.clientX,
        right: event.clientX,
        bottom: event.clientY,
        width: 0,
        height: 0,
        toJSON: () => ({})
      })
    };
    window.requestAnimationFrame(() => {
      setContextMenuAnchor(virtualAnchor);
    });
  };
  const hasData = !!data?.length;
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  const columns = view.fields ?? [];
  const headerMenuRef = (column, index) => (node) => {
    if (node) {
      headerMenuRefs.current.set(column, {
        node,
        fallback: columns[index > 0 ? index - 1 : 1]
      });
    } else {
      headerMenuRefs.current.delete(column);
    }
  };
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  const isRtl = (0, import_i18n10.isRTL)();
  return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
      "table",
      {
        className: clsx_default("dataviews-view-table", className, {
          [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
            view.layout.density
          ),
          "has-bulk-actions": hasBulkActions
        }),
        "aria-busy": isLoading,
        "aria-describedby": tableNoticeId,
        role: isInfiniteScroll ? "feed" : void 0,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("colgroup", { children: [
            hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("col", { className: "dataviews-view-table__col-checkbox" }),
            hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("col", { className: "dataviews-view-table__col-first-data" }),
            columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
              "col",
              {
                className: clsx_default(
                  `dataviews-view-table__col-${column}`,
                  {
                    "dataviews-view-table__col-first-data": !hasPrimaryColumn && index === 0
                  }
                )
              },
              `col-${column}`
            )),
            !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("col", { className: "dataviews-view-table__col-actions" })
          ] }),
          contextMenuAnchor && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            import_components9.Popover,
            {
              anchor: contextMenuAnchor,
              onClose: () => setContextMenuAnchor(null),
              placement: "bottom-start",
              children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(PropertiesSection, { showLabel: false })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("thead", { onContextMenu: handleHeaderContextMenu, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("tr", { className: "dataviews-view-table__row", children: [
            hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
              "th",
              {
                className: "dataviews-view-table__checkbox-column",
                scope: "col",
                onContextMenu: handleHeaderContextMenu,
                children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                  BulkSelectionCheckbox,
                  {
                    selection,
                    onChangeSelection,
                    data,
                    actions: actions2,
                    getItemId: getItemId2
                  }
                )
              }
            ),
            hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
              column_header_menu_default,
              {
                ref: headerMenuRef(
                  titleField.id,
                  0
                ),
                fieldId: titleField.id,
                view,
                fields,
                onChangeView,
                onHide,
                setOpenedFilter,
                canMove: false,
                canInsertLeft: isRtl ? view.layout?.enableMoving ?? true : false,
                canInsertRight: isRtl ? false : view.layout?.enableMoving ?? true
              }
            ) }),
            columns.map((column, index) => {
              const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
              const canInsertOrMove = view.layout?.enableMoving ?? true;
              return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                "th",
                {
                  style: {
                    width,
                    maxWidth,
                    minWidth,
                    textAlign: align
                  },
                  "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
                  scope: "col",
                  children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                    column_header_menu_default,
                    {
                      ref: headerMenuRef(column, index),
                      fieldId: column,
                      view,
                      fields,
                      onChangeView,
                      onHide,
                      setOpenedFilter,
                      canMove: canInsertOrMove,
                      canInsertLeft: canInsertOrMove,
                      canInsertRight: canInsertOrMove
                    }
                  )
                },
                column
              );
            }),
            !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
              "th",
              {
                className: clsx_default(
                  "dataviews-view-table__actions-column",
                  {
                    "dataviews-view-table__actions-column--sticky": true,
                    "dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
                  }
                ),
                children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: "dataviews-view-table-header", children: (0, import_i18n10.__)("Actions") })
              }
            )
          ] }) }),
          hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)("tbody", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                "td",
                {
                  colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions2?.length ? 1 : 0),
                  className: "dataviews-view-table__group-header-cell",
                  children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n10.sprintf)(
                    // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                    (0, import_i18n10.__)("%1$s: %2$s"),
                    groupField.label,
                    groupName
                  )
                }
              ) }),
              groupItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
                TableRow,
                {
                  item,
                  level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
                  hasBulkActions,
                  actions: actions2,
                  fields,
                  id: getItemId2(item) || index.toString(),
                  view,
                  titleField,
                  mediaField,
                  descriptionField,
                  selection,
                  getItemId: getItemId2,
                  onChangeSelection,
                  onClickItem,
                  renderItemLink,
                  isItemClickable,
                  isActionsColumnSticky: !isHorizontalScrollEnd
                },
                getItemId2(item)
              ))
            ] }, `group-${groupName}`)
          ) : /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("tbody", { children: hasData && data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
            TableRow,
            {
              item,
              level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
              hasBulkActions,
              actions: actions2,
              fields,
              id: getItemId2(item) || index.toString(),
              view,
              titleField,
              mediaField,
              descriptionField,
              selection,
              getItemId: getItemId2,
              onChangeSelection,
              onClickItem,
              renderItemLink,
              isItemClickable,
              isActionsColumnSticky: !isHorizontalScrollEnd,
              posinset: isInfiniteScroll ? index + 1 : void 0
            },
            getItemId2(item)
          )) })
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
      "div",
      {
        className: clsx_default({
          "dataviews-loading": isLoading,
          "dataviews-no-results": !hasData && !isLoading
        }),
        id: tableNoticeId,
        children: [
          !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components9.Spinner, {}) }) : empty),
          hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_components9.Spinner, {}) })
        ]
      }
    )
  ] });
}
var table_default = ViewTable;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/index.mjs
var import_components12 = __toESM(require_components(), 1);
var import_i18n13 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs
var import_components11 = __toESM(require_components(), 1);
var import_i18n12 = __toESM(require_i18n(), 1);
var import_compose4 = __toESM(require_compose(), 1);
var import_keycodes2 = __toESM(require_keycodes(), 1);
var import_element13 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/preview-size-picker.mjs
var import_components10 = __toESM(require_components(), 1);
var import_i18n11 = __toESM(require_i18n(), 1);
var import_element12 = __toESM(require_element(), 1);
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
var imageSizes = [
  {
    value: 120,
    breakpoint: 1
  },
  {
    value: 170,
    breakpoint: 1
  },
  {
    value: 230,
    breakpoint: 1
  },
  {
    value: 290,
    breakpoint: 1112
    // at minimum image width, 4 images display at this container size
  },
  {
    value: 350,
    breakpoint: 1636
    // at minimum image width, 6 images display at this container size
  },
  {
    value: 430,
    breakpoint: 588
    // at minimum image width, 2 images display at this container size
  }
];
var DEFAULT_PREVIEW_SIZE = imageSizes[2].value;
function useGridColumns() {
  const context = (0, import_element12.useContext)(dataviews_context_default);
  const view = context.view;
  return (0, import_element12.useMemo)(() => {
    const containerWidth = context.containerWidth;
    const gap = 32;
    const previewSize = view.layout?.previewSize ?? DEFAULT_PREVIEW_SIZE;
    const columns = Math.floor(
      (containerWidth + gap) / (previewSize + gap)
    );
    return Math.max(1, columns);
  }, [context.containerWidth, view.layout?.previewSize]);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
var { Badge } = unlock(import_components11.privateApis);
function chunk(array, size) {
  const chunks = [];
  for (let i2 = 0, j2 = array.length; i2 < j2; i2 += size) {
    chunks.push(array.slice(i2, i2 + size));
  }
  return chunks;
}
var GridItem = (0, import_element13.forwardRef)(function GridItem2({
  view,
  selection,
  onChangeSelection,
  onClickItem,
  isItemClickable,
  renderItemLink,
  getItemId: getItemId2,
  item,
  actions: actions2,
  mediaField,
  titleField,
  descriptionField,
  regularFields,
  badgeFields,
  hasBulkActions,
  config,
  ...props
}, ref) {
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const hasBulkAction = useHasAPossibleBulkAction(actions2, item);
  const id = getItemId2(item);
  const instanceId = (0, import_compose4.useInstanceId)(GridItem2);
  const isSelected2 = selection.includes(id);
  const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config
    }
  ) : null;
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(titleField.render, { item, field: titleField }) : null;
  const shouldRenderMedia = showMedia && renderedMediaField;
  let mediaA11yProps;
  let titleA11yProps;
  if (isItemClickable(item) && onClickItem) {
    if (renderedTitleField) {
      mediaA11yProps = {
        "aria-labelledby": `dataviews-view-grid__title-field-${instanceId}`
      };
      titleA11yProps = {
        id: `dataviews-view-grid__title-field-${instanceId}`
      };
    } else {
      mediaA11yProps = {
        "aria-label": (0, import_i18n12.__)("Navigate to item")
      };
    }
  }
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
    Stack,
    {
      direction: "column",
      ...props,
      ref,
      className: clsx_default(
        props.className,
        "dataviews-view-grid__row__gridcell",
        "dataviews-view-grid__card",
        {
          "is-selected": hasBulkAction && isSelected2
        }
      ),
      onClickCapture: (event) => {
        props.onClickCapture?.(event);
        if ((0, import_keycodes2.isAppleOS)() ? event.metaKey : event.ctrlKey) {
          event.stopPropagation();
          event.preventDefault();
          if (!hasBulkAction) {
            return;
          }
          onChangeSelection(
            selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
          );
        }
      },
      children: [
        shouldRenderMedia && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
          ItemClickWrapper,
          {
            item,
            isItemClickable,
            onClickItem,
            renderItemLink,
            className: "dataviews-view-grid__media",
            ...mediaA11yProps,
            children: renderedMediaField
          }
        ),
        hasBulkActions && shouldRenderMedia && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
          DataViewsSelectionCheckbox,
          {
            item,
            selection,
            onChangeSelection,
            getItemId: getItemId2,
            titleField,
            disabled: !hasBulkAction
          }
        ),
        !showTitle && shouldRenderMedia && !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ItemActions, { item, actions: actions2, isCompact: true }) }),
        showTitle && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
          Stack,
          {
            direction: "row",
            gap: "xs",
            className: "dataviews-view-grid__title-actions",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                ItemClickWrapper,
                {
                  item,
                  isItemClickable,
                  onClickItem,
                  renderItemLink,
                  className: "dataviews-view-grid__title-field dataviews-title-field",
                  ...titleA11yProps,
                  children: renderedTitleField
                }
              ),
              !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                ItemActions,
                {
                  item,
                  actions: actions2,
                  isCompact: true
                }
              )
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Stack, { direction: "column", gap: "2xs", children: [
          showDescription && descriptionField?.render && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            descriptionField.render,
            {
              item,
              field: descriptionField
            }
          ),
          !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            Stack,
            {
              direction: "row",
              className: "dataviews-view-grid__badge-fields",
              gap: "xs",
              wrap: "wrap",
              align: "top",
              justify: "flex-start",
              children: badgeFields.map((field) => {
                return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                  Badge,
                  {
                    className: "dataviews-view-grid__field-value",
                    children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                      field.render,
                      {
                        item,
                        field
                      }
                    )
                  },
                  field.id
                );
              })
            }
          ),
          !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            Stack,
            {
              direction: "column",
              className: "dataviews-view-grid__fields",
              gap: "2xs",
              children: regularFields.map((field) => {
                return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                  import_components11.Flex,
                  {
                    className: "dataviews-view-grid__field",
                    gap: 1,
                    justify: "flex-start",
                    expanded: true,
                    style: { height: "auto" },
                    direction: "row",
                    children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components11.Tooltip, { text: field.label, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components11.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header }) }),
                      /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                        import_components11.FlexItem,
                        {
                          className: "dataviews-view-grid__field-value",
                          style: { maxHeight: "none" },
                          children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                            field.render,
                            {
                              item,
                              field
                            }
                          )
                        }
                      )
                    ] })
                  },
                  field.id
                );
              })
            }
          )
        ] })
      ]
    }
  );
});
function CompositeGrid({
  data,
  isInfiniteScroll,
  className,
  isLoading,
  view,
  fields,
  selection,
  onChangeSelection,
  onClickItem,
  isItemClickable,
  renderItemLink,
  getItemId: getItemId2,
  actions: actions2
}) {
  const { paginationInfo, resizeObserverRef } = (0, import_element13.useContext)(dataviews_context_default);
  const gridColumns = useGridColumns();
  const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions2, data);
  const titleField = fields.find(
    (field) => field.id === view?.titleField
  );
  const mediaField = fields.find(
    (field) => field.id === view?.mediaField
  );
  const descriptionField = fields.find(
    (field) => field.id === view?.descriptionField
  );
  const otherFields = view.fields ?? [];
  const { regularFields, badgeFields } = otherFields.reduce(
    (accumulator, fieldId) => {
      const field = fields.find((f2) => f2.id === fieldId);
      if (!field) {
        return accumulator;
      }
      const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
      accumulator[key].push(field);
      return accumulator;
    },
    { regularFields: [], badgeFields: [] }
  );
  const size = "900px";
  const totalRows = Math.ceil(data.length / gridColumns);
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
    import_components11.Composite,
    {
      role: isInfiniteScroll ? "feed" : "grid",
      className: clsx_default("dataviews-view-grid", className),
      focusWrap: true,
      "aria-busy": isLoading,
      "aria-rowcount": isInfiniteScroll ? void 0 : totalRows,
      ref: resizeObserverRef,
      children: chunk(data, gridColumns).map((row, i2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
        import_components11.Composite.Row,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            "div",
            {
              role: "row",
              "aria-rowindex": i2 + 1,
              "aria-label": (0, import_i18n12.sprintf)(
                /* translators: %d: The row number in the grid */
                (0, import_i18n12.__)("Row %d"),
                i2 + 1
              ),
              className: "dataviews-view-grid__row",
              style: {
                gridTemplateColumns: `repeat( ${gridColumns}, minmax(0, 1fr) )`
              }
            }
          ),
          children: row.map((item, indexInRow) => {
            const index = i2 * gridColumns + indexInRow;
            return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
              import_components11.Composite.Item,
              {
                render: (props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                  GridItem,
                  {
                    ...props,
                    role: isInfiniteScroll ? "article" : "gridcell",
                    "aria-setsize": isInfiniteScroll ? paginationInfo.totalItems : void 0,
                    "aria-posinset": isInfiniteScroll ? index + 1 : void 0,
                    view,
                    selection,
                    onChangeSelection,
                    onClickItem,
                    isItemClickable,
                    renderItemLink,
                    getItemId: getItemId2,
                    item,
                    actions: actions2,
                    mediaField,
                    titleField,
                    descriptionField,
                    regularFields,
                    badgeFields,
                    hasBulkActions,
                    config: {
                      sizes: size
                    }
                  }
                )
              },
              getItemId2(item)
            );
          })
        },
        i2
      ))
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/index.mjs
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
function ViewGrid({
  actions: actions2,
  data,
  fields,
  getItemId: getItemId2,
  isLoading,
  onChangeSelection,
  onClickItem,
  isItemClickable,
  renderItemLink,
  selection,
  view,
  className,
  empty
}) {
  const hasData = !!data?.length;
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  const gridProps = {
    className,
    isLoading,
    view,
    fields,
    selection,
    onChangeSelection,
    onClickItem,
    isItemClickable,
    renderItemLink,
    getItemId: getItemId2,
    actions: actions2
  };
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, {
    // Render multiple groups.
    children: [
      hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { direction: "column", gap: "md", children: Array.from(dataByGroup.entries()).map(
        ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
          Stack,
          {
            direction: "column",
            gap: "xs",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h3", { className: "dataviews-view-grid__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n13.sprintf)(
                // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                (0, import_i18n13.__)("%1$s: %2$s"),
                groupField.label,
                groupName
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                CompositeGrid,
                {
                  ...gridProps,
                  data: groupItems,
                  isInfiniteScroll: false
                }
              )
            ]
          },
          groupName
        )
      ) }),
      // Render a single grid with all data.
      hasData && !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
        CompositeGrid,
        {
          ...gridProps,
          data,
          isInfiniteScroll: !!isInfiniteScroll
        }
      ),
      // Render empty state.
      !hasData && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
        "div",
        {
          className: clsx_default({
            "dataviews-loading": isLoading,
            "dataviews-no-results": !isLoading
          }),
          children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components12.Spinner, {}) }) : empty
        }
      ),
      hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components12.Spinner, {}) })
    ]
  });
}
var grid_default = ViewGrid;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/list/index.mjs
var import_compose5 = __toESM(require_compose(), 1);
var import_components13 = __toESM(require_components(), 1);
var import_element14 = __toESM(require_element(), 1);
var import_i18n14 = __toESM(require_i18n(), 1);
var import_data3 = __toESM(require_data(), 1);
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu3 } = unlock(import_components13.privateApis);
function generateItemWrapperCompositeId(idPrefix) {
  return `${idPrefix}-item-wrapper`;
}
function generatePrimaryActionCompositeId(idPrefix, primaryActionId) {
  return `${idPrefix}-primary-action-${primaryActionId}`;
}
function generateDropdownTriggerCompositeId(idPrefix) {
  return `${idPrefix}-dropdown`;
}
function PrimaryActionGridCell({
  idPrefix,
  primaryAction,
  item
}) {
  const registry = (0, import_data3.useRegistry)();
  const [isModalOpen, setIsModalOpen] = (0, import_element14.useState)(false);
  const compositeItemId = generatePrimaryActionCompositeId(
    idPrefix,
    primaryAction.id
  );
  const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]);
  return "RenderModal" in primaryAction ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    import_components13.Composite.Item,
    {
      id: compositeItemId,
      render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
        import_components13.Button,
        {
          disabled: !!primaryAction.disabled,
          accessibleWhenDisabled: true,
          text: label,
          size: "small",
          onClick: () => setIsModalOpen(true)
        }
      ),
      children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
        ActionModal,
        {
          action: primaryAction,
          items: [item],
          closeModal: () => setIsModalOpen(false)
        }
      )
    }
  ) }, primaryAction.id) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    import_components13.Composite.Item,
    {
      id: compositeItemId,
      render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
        import_components13.Button,
        {
          disabled: !!primaryAction.disabled,
          accessibleWhenDisabled: true,
          size: "small",
          onClick: () => {
            primaryAction.callback([item], { registry });
          },
          children: label
        }
      )
    }
  ) }, primaryAction.id);
}
function ListItem({
  view,
  actions: actions2,
  idPrefix,
  isSelected: isSelected2,
  item,
  titleField,
  mediaField,
  descriptionField,
  onSelect,
  otherFields,
  onDropdownTriggerKeyDown,
  posinset
}) {
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const itemRef = (0, import_element14.useRef)(null);
  const labelId = `${idPrefix}-label`;
  const descriptionId = `${idPrefix}-description`;
  const registry = (0, import_data3.useRegistry)();
  const [isHovered, setIsHovered] = (0, import_element14.useState)(false);
  const [activeModalAction, setActiveModalAction] = (0, import_element14.useState)(
    null
  );
  const handleHover = ({ type }) => {
    const isHover = type === "mouseenter";
    setIsHovered(isHover);
  };
  const { paginationInfo } = (0, import_element14.useContext)(dataviews_context_default);
  (0, import_element14.useEffect)(() => {
    if (isSelected2) {
      itemRef.current?.scrollIntoView({
        behavior: "auto",
        block: "nearest",
        inline: "nearest"
      });
    }
  }, [isSelected2]);
  const { primaryAction, eligibleActions } = (0, import_element14.useMemo)(() => {
    const _eligibleActions = actions2.filter(
      (action) => !action.isEligible || action.isEligible(item)
    );
    const _primaryActions = _eligibleActions.filter(
      (action) => action.isPrimary
    );
    return {
      primaryAction: _primaryActions[0],
      eligibleActions: _eligibleActions
    };
  }, [actions2, item]);
  const hasOnlyOnePrimaryAction = primaryAction && actions2.length === 1;
  const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config: { sizes: "52px" }
    }
  ) }) : null;
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(titleField.render, { item, field: titleField }) : null;
  const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
    Stack,
    {
      direction: "row",
      gap: "sm",
      className: "dataviews-view-list__item-actions",
      children: [
        primaryAction && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
          PrimaryActionGridCell,
          {
            idPrefix,
            primaryAction,
            item
          }
        ),
        !hasOnlyOnePrimaryAction && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { role: "gridcell", children: [
          /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Menu3, { placement: "bottom-end", children: [
            /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
              Menu3.TriggerButton,
              {
                render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                  import_components13.Composite.Item,
                  {
                    id: generateDropdownTriggerCompositeId(
                      idPrefix
                    ),
                    render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                      import_components13.Button,
                      {
                        size: "small",
                        icon: more_vertical_default,
                        label: (0, import_i18n14.__)("Actions"),
                        accessibleWhenDisabled: true,
                        disabled: !actions2.length,
                        onKeyDown: onDropdownTriggerKeyDown
                      }
                    )
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Menu3.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
              ActionsMenuGroup,
              {
                actions: eligibleActions,
                item,
                registry,
                setActiveModalAction
              }
            ) })
          ] }),
          !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
            ActionModal,
            {
              action: activeModalAction,
              items: [item],
              closeModal: () => setActiveModalAction(null)
            }
          )
        ] })
      ]
    }
  );
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    import_components13.Composite.Row,
    {
      ref: itemRef,
      render: (
        /* aria-posinset breaks Composite.Row if passed to it directly. */
        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
          "div",
          {
            "aria-posinset": posinset,
            "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0
          }
        )
      ),
      role: infiniteScrollEnabled ? "article" : "row",
      className: clsx_default({
        "is-selected": isSelected2,
        "is-hovered": isHovered
      }),
      onMouseEnter: handleHover,
      onMouseLeave: handleHover,
      children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
        Stack,
        {
          direction: "row",
          className: "dataviews-view-list__item-wrapper",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
              import_components13.Composite.Item,
              {
                id: generateItemWrapperCompositeId(idPrefix),
                "aria-pressed": isSelected2,
                "aria-labelledby": labelId,
                "aria-describedby": descriptionId,
                className: "dataviews-view-list__item",
                onClick: () => onSelect(item)
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "sm",
                justify: "start",
                align: "flex-start",
                style: { flex: 1 },
                children: [
                  renderedMediaField,
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                    Stack,
                    {
                      direction: "column",
                      gap: "2xs",
                      className: "dataviews-view-list__field-wrapper",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { direction: "row", align: "center", children: [
                          /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                            "div",
                            {
                              className: "dataviews-title-field",
                              id: labelId,
                              style: { flex: 1 },
                              children: renderedTitleField
                            }
                          ),
                          usedActions
                        ] }),
                        showDescription && descriptionField?.render && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                          descriptionField.render,
                          {
                            item,
                            field: descriptionField
                          }
                        ) }),
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                          "div",
                          {
                            className: "dataviews-view-list__fields",
                            id: descriptionId,
                            children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                              "div",
                              {
                                className: "dataviews-view-list__field",
                                children: [
                                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                                    import_components13.VisuallyHidden,
                                    {
                                      as: "span",
                                      className: "dataviews-view-list__field-label",
                                      children: field.label
                                    }
                                  ),
                                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                                    field.render,
                                    {
                                      item,
                                      field
                                    }
                                  ) })
                                ]
                              },
                              field.id
                            ))
                          }
                        )
                      ]
                    }
                  )
                ]
              }
            )
          ]
        }
      )
    }
  );
}
function isDefined2(item) {
  return !!item;
}
function ViewList(props) {
  const {
    actions: actions2,
    data,
    fields,
    getItemId: getItemId2,
    isLoading,
    onChangeSelection,
    selection,
    view,
    className,
    empty
  } = props;
  const baseId = (0, import_compose5.useInstanceId)(ViewList, "view-list");
  const selectedItem = data?.findLast(
    (item) => selection.includes(getItemId2(item))
  );
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f2) => fieldId === f2.id)).filter(isDefined2);
  const onSelect = (item) => onChangeSelection([getItemId2(item)]);
  const generateCompositeItemIdPrefix = (0, import_element14.useCallback)(
    (item) => `${baseId}-${getItemId2(item)}`,
    [baseId, getItemId2]
  );
  const isActiveCompositeItem = (0, import_element14.useCallback)(
    (item, idToCheck) => {
      return idToCheck.startsWith(
        generateCompositeItemIdPrefix(item)
      );
    },
    [generateCompositeItemIdPrefix]
  );
  const [activeCompositeId, setActiveCompositeId] = (0, import_element14.useState)(void 0);
  (0, import_element14.useEffect)(() => {
    if (selectedItem) {
      setActiveCompositeId(
        generateItemWrapperCompositeId(
          generateCompositeItemIdPrefix(selectedItem)
        )
      );
    }
  }, [selectedItem, generateCompositeItemIdPrefix]);
  const activeItemIndex = data.findIndex(
    (item) => isActiveCompositeItem(item, activeCompositeId ?? "")
  );
  const previousActiveItemIndex = (0, import_compose5.usePrevious)(activeItemIndex);
  const isActiveIdInList = activeItemIndex !== -1;
  const selectCompositeItem = (0, import_element14.useCallback)(
    (targetIndex, generateCompositeId) => {
      const clampedIndex = Math.min(
        data.length - 1,
        Math.max(0, targetIndex)
      );
      if (!data[clampedIndex]) {
        return;
      }
      const itemIdPrefix = generateCompositeItemIdPrefix(
        data[clampedIndex]
      );
      const targetCompositeItemId = generateCompositeId(itemIdPrefix);
      setActiveCompositeId(targetCompositeItemId);
      document.getElementById(targetCompositeItemId)?.focus();
    },
    [data, generateCompositeItemIdPrefix]
  );
  (0, import_element14.useEffect)(() => {
    const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1;
    if (!isActiveIdInList && wasActiveIdInList) {
      selectCompositeItem(
        previousActiveItemIndex,
        generateItemWrapperCompositeId
      );
    }
  }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]);
  const onDropdownTriggerKeyDown = (0, import_element14.useCallback)(
    (event) => {
      if (event.key === "ArrowDown") {
        event.preventDefault();
        selectCompositeItem(
          activeItemIndex + 1,
          generateDropdownTriggerCompositeId
        );
      }
      if (event.key === "ArrowUp") {
        event.preventDefault();
        selectCompositeItem(
          activeItemIndex - 1,
          generateDropdownTriggerCompositeId
        );
      }
    },
    [selectCompositeItem, activeItemIndex]
  );
  const hasData = data?.length;
  if (!hasData) {
    return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
      "div",
      {
        className: clsx_default({
          "dataviews-loading": isLoading,
          "dataviews-no-results": !hasData && !isLoading
        }),
        children: !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components13.Spinner, {}) }) : empty)
      }
    );
  }
  const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  if (hasData && groupField && dataByGroup) {
    return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
      import_components13.Composite,
      {
        id: `${baseId}`,
        render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {}),
        className: "dataviews-view-list__group",
        role: "grid",
        activeId: activeCompositeId,
        setActiveId: setActiveCompositeId,
        children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
          Stack,
          {
            direction: "column",
            gap: "md",
            className: clsx_default("dataviews-view-list", className),
            children: Array.from(dataByGroup.entries()).map(
              ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                Stack,
                {
                  direction: "column",
                  gap: "xs",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: "dataviews-view-list__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n14.sprintf)(
                      // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                      (0, import_i18n14.__)("%1$s: %2$s"),
                      groupField.label,
                      groupName
                    ) }),
                    groupItems.map((item) => {
                      const id = generateCompositeItemIdPrefix(item);
                      return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                        ListItem,
                        {
                          view,
                          idPrefix: id,
                          actions: actions2,
                          item,
                          isSelected: item === selectedItem,
                          onSelect,
                          mediaField,
                          titleField,
                          descriptionField,
                          otherFields,
                          onDropdownTriggerKeyDown
                        },
                        id
                      );
                    })
                  ]
                },
                groupName
              )
            )
          }
        )
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
      import_components13.Composite,
      {
        id: baseId,
        render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {}),
        className: clsx_default("dataviews-view-list", className, {
          [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
            view.layout.density
          )
        }),
        role: view.infiniteScrollEnabled ? "feed" : "grid",
        activeId: activeCompositeId,
        setActiveId: setActiveCompositeId,
        children: data.map((item, index) => {
          const id = generateCompositeItemIdPrefix(item);
          return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
            ListItem,
            {
              view,
              idPrefix: id,
              actions: actions2,
              item,
              isSelected: item === selectedItem,
              onSelect,
              mediaField,
              titleField,
              descriptionField,
              otherFields,
              onDropdownTriggerKeyDown,
              posinset: view.infiniteScrollEnabled ? index + 1 : void 0
            },
            id
          );
        })
      }
    ),
    hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components13.Spinner, {}) })
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/index.mjs
var import_components15 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/activity-group.mjs
var import_i18n15 = __toESM(require_i18n(), 1);
var import_element15 = __toESM(require_element(), 1);
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
function ActivityGroup({
  groupName,
  groupData,
  groupField,
  showLabel = true,
  children
}) {
  const groupHeader = showLabel ? (0, import_element15.createInterpolateElement)(
    // translators: %s: The label of the field e.g. "Status".
    (0, import_i18n15.sprintf)((0, import_i18n15.__)("%s: <groupName />"), groupField.label).trim(),
    {
      groupName: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
        groupField.render,
        {
          item: groupData[0],
          field: groupField
        }
      )
    }
  ) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(groupField.render, { item: groupData[0], field: groupField });
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
    Stack,
    {
      direction: "column",
      className: "dataviews-view-activity__group",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h3", { className: "dataviews-view-activity__group-header", children: groupHeader }),
        children
      ]
    },
    groupName
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/activity-item.mjs
var import_components14 = __toESM(require_components(), 1);
var import_element16 = __toESM(require_element(), 1);
var import_data4 = __toESM(require_data(), 1);
var import_compose6 = __toESM(require_compose(), 1);
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
function ActivityItem(props) {
  const {
    view,
    actions: actions2,
    item,
    titleField,
    mediaField,
    descriptionField,
    otherFields,
    posinset,
    onClickItem,
    renderItemLink,
    isItemClickable
  } = props;
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const itemRef = (0, import_element16.useRef)(null);
  const registry = (0, import_data4.useRegistry)();
  const { paginationInfo } = (0, import_element16.useContext)(dataviews_context_default);
  const { primaryActions, eligibleActions } = (0, import_element16.useMemo)(() => {
    const _eligibleActions = actions2.filter(
      (action) => !action.isEligible || action.isEligible(item)
    );
    const _primaryActions = _eligibleActions.filter(
      (action) => action.isPrimary
    );
    return {
      primaryActions: _primaryActions,
      eligibleActions: _eligibleActions
    };
  }, [actions2, item]);
  const isMobileViewport = (0, import_compose6.useViewportMatch)("medium", "<");
  const density = view.layout?.density ?? "balanced";
  const mediaContent = showMedia && density !== "compact" && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config: {
        sizes: density === "comfortable" ? "32px" : "24px"
      }
    }
  ) : null;
  const renderedMediaField = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-type-icon", children: mediaContent || /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
    "span",
    {
      className: "dataviews-view-activity__item-bullet",
      "aria-hidden": "true"
    }
  ) });
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(titleField.render, { item, field: titleField }) : null;
  const verticalGap = (0, import_element16.useMemo)(() => {
    switch (density) {
      case "comfortable":
        return "sm";
      default:
        return "xs";
    }
  }, [density]);
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
    "div",
    {
      ref: itemRef,
      role: infiniteScrollEnabled ? "article" : void 0,
      "aria-posinset": posinset,
      "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
      className: clsx_default(
        "dataviews-view-activity__item",
        density === "compact" && "is-compact",
        density === "balanced" && "is-balanced",
        density === "comfortable" && "is-comfortable"
      ),
      children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Stack, { direction: "row", gap: "md", justify: "start", align: "flex-start", children: [
        /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
          Stack,
          {
            direction: "column",
            gap: "2xs",
            align: "center",
            className: "dataviews-view-activity__item-type",
            children: renderedMediaField
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
          Stack,
          {
            direction: "column",
            gap: verticalGap,
            align: "flex-start",
            className: "dataviews-view-activity__item-content",
            children: [
              renderedTitleField && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                ItemClickWrapper,
                {
                  item,
                  isItemClickable,
                  onClickItem,
                  renderItemLink,
                  className: "dataviews-view-activity__item-title",
                  children: renderedTitleField
                }
              ),
              showDescription && descriptionField && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-description", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                descriptionField.render,
                {
                  item,
                  field: descriptionField
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-fields", children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
                "div",
                {
                  className: "dataviews-view-activity__item-field",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                      import_components14.VisuallyHidden,
                      {
                        as: "span",
                        className: "dataviews-view-activity__item-field-label",
                        children: field.label
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "dataviews-view-activity__item-field-value", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                      field.render,
                      {
                        item,
                        field
                      }
                    ) })
                  ]
                },
                field.id
              )) }),
              !!primaryActions?.length && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                PrimaryActions,
                {
                  item,
                  actions: primaryActions,
                  registry,
                  buttonVariant: "secondary"
                }
              )
            ]
          }
        ),
        (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu
        // there if there are any actions at all.
        isMobileViewport && // At the same time, only show the menu if there are actions to show.
        eligibleActions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-actions", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
          ItemActions,
          {
            item,
            actions: eligibleActions,
            isCompact: true
          }
        ) })
      ] })
    }
  );
}
var activity_item_default = ActivityItem;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/activity-items.mjs
var import_react3 = __toESM(require_react(), 1);
function isDefined3(item) {
  return !!item;
}
function ActivityItems(props) {
  const { data, fields, getItemId: getItemId2, view } = props;
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f2) => fieldId === f2.id)).filter(isDefined3);
  return data.map((item, index) => {
    return /* @__PURE__ */ (0, import_react3.createElement)(
      activity_item_default,
      {
        ...props,
        key: getItemId2(item),
        item,
        mediaField,
        titleField,
        descriptionField,
        otherFields,
        posinset: view.infiniteScrollEnabled ? index + 1 : void 0
      }
    );
  });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/index.mjs
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
function ViewActivity(props) {
  const { empty, data, fields, isLoading, view, className } = props;
  const hasData = data?.length;
  if (!hasData) {
    return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
      "div",
      {
        className: clsx_default({
          "dataviews-loading": isLoading,
          "dataviews-no-results": !hasData && !isLoading
        }),
        children: !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components15.Spinner, {}) }) : empty)
      }
    );
  }
  const wrapperClassName = clsx_default("dataviews-view-activity", className);
  const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const groupedEntries = dataByGroup ? Array.from(dataByGroup.entries()) : [];
  if (hasData && groupField && dataByGroup) {
    return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(Stack, { direction: "column", gap: "xs", className: wrapperClassName, children: groupedEntries.map(
      ([groupName, groupData]) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
        ActivityGroup,
        {
          groupName,
          groupData,
          groupField,
          showLabel: view.groupBy?.showLabel !== false,
          children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
            ActivityItems,
            {
              ...props,
              data: groupData
            }
          )
        },
        groupName
      )
    ) });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
      "div",
      {
        className: wrapperClassName,
        role: view.infiniteScrollEnabled ? "feed" : void 0,
        children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActivityItems, { ...props })
      }
    ),
    hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components15.Spinner, {}) })
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs
var import_components18 = __toESM(require_components(), 1);
var import_i18n18 = __toESM(require_i18n(), 1);
var import_compose7 = __toESM(require_compose(), 1);
var import_element20 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-picker-footer/index.mjs
var import_components17 = __toESM(require_components(), 1);
var import_data5 = __toESM(require_data(), 1);
var import_element18 = __toESM(require_element(), 1);
var import_i18n17 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.mjs
var import_components16 = __toESM(require_components(), 1);
var import_element17 = __toESM(require_element(), 1);
var import_i18n16 = __toESM(require_i18n(), 1);
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
function DataViewsPagination() {
  const {
    view,
    onChangeView,
    paginationInfo: { totalItems = 0, totalPages }
  } = (0, import_element17.useContext)(dataviews_context_default);
  if (!totalItems || !totalPages || view.infiniteScrollEnabled) {
    return null;
  }
  const currentPage = view.page ?? 1;
  const pageSelectOptions = Array.from(Array(totalPages)).map(
    (_, i2) => {
      const page = i2 + 1;
      return {
        value: page.toString(),
        label: page.toString(),
        "aria-label": currentPage === page ? (0, import_i18n16.sprintf)(
          // translators: 1: current page number. 2: total number of pages.
          (0, import_i18n16.__)("Page %1$d of %2$d"),
          currentPage,
          totalPages
        ) : page.toString()
      };
    }
  );
  return !!totalItems && totalPages !== 1 && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
    Stack,
    {
      direction: "row",
      className: "dataviews-pagination",
      justify: "end",
      align: "center",
      gap: "lg",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          Stack,
          {
            direction: "row",
            justify: "flex-start",
            align: "center",
            gap: "2xs",
            className: "dataviews-pagination__page-select",
            children: (0, import_element17.createInterpolateElement)(
              (0, import_i18n16.sprintf)(
                // translators: 1: Current page number, 2: Total number of pages.
                (0, import_i18n16._x)(
                  "<div>Page</div>%1$s<div>of %2$d</div>",
                  "paging"
                ),
                "<CurrentPage />",
                totalPages
              ),
              {
                div: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "aria-hidden": true }),
                CurrentPage: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
                  import_components16.SelectControl,
                  {
                    "aria-label": (0, import_i18n16.__)("Current page"),
                    value: currentPage.toString(),
                    options: pageSelectOptions,
                    onChange: (newValue) => {
                      onChangeView({
                        ...view,
                        page: +newValue
                      });
                    },
                    size: "small",
                    variant: "minimal"
                  }
                )
              }
            )
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Stack, { direction: "row", gap: "2xs", align: "center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
            import_components16.Button,
            {
              onClick: () => onChangeView({
                ...view,
                page: currentPage - 1
              }),
              disabled: currentPage === 1,
              accessibleWhenDisabled: true,
              label: (0, import_i18n16.__)("Previous page"),
              icon: (0, import_i18n16.isRTL)() ? next_default : previous_default,
              showTooltip: true,
              size: "compact",
              tooltipPosition: "top"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
            import_components16.Button,
            {
              onClick: () => onChangeView({ ...view, page: currentPage + 1 }),
              disabled: currentPage >= totalPages,
              accessibleWhenDisabled: true,
              label: (0, import_i18n16.__)("Next page"),
              icon: (0, import_i18n16.isRTL)() ? previous_default : next_default,
              showTooltip: true,
              size: "compact",
              tooltipPosition: "top"
            }
          )
        ] })
      ]
    }
  );
}
var dataviews_pagination_default = (0, import_element17.memo)(DataViewsPagination);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-picker-footer/index.mjs
var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
function useIsMultiselectPicker(actions2) {
  return (0, import_element18.useMemo)(() => {
    return actions2?.every((action) => action.supportsBulk);
  }, [actions2]);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/grid-items.mjs
var import_element19 = __toESM(require_element(), 1);
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
var GridItems = (0, import_element19.forwardRef)(({ className, previewSize, ...props }, ref) => {
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
    "div",
    {
      ref,
      className: clsx_default("dataviews-view-grid-items", className),
      style: {
        gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
      },
      ...props
    }
  );
});

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
var { Badge: Badge2 } = unlock(import_components18.privateApis);
function GridItem3({
  view,
  multiselect,
  selection,
  onChangeSelection,
  getItemId: getItemId2,
  item,
  mediaField,
  titleField,
  descriptionField,
  regularFields,
  badgeFields,
  config,
  posinset,
  setsize
}) {
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const id = getItemId2(item);
  const isSelected2 = selection.includes(id);
  const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config
    }
  ) : null;
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(titleField.render, { item, field: titleField }) : null;
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
    import_components18.Composite.Item,
    {
      "aria-label": titleField ? titleField.getValue({ item }) || (0, import_i18n18.__)("(no title)") : void 0,
      render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Stack, { direction: "column", children, ...props }),
      role: "option",
      "aria-posinset": posinset,
      "aria-setsize": setsize,
      className: clsx_default("dataviews-view-picker-grid__card", {
        "is-selected": isSelected2
      }),
      "aria-selected": isSelected2,
      onClick: () => {
        if (isSelected2) {
          onChangeSelection(
            selection.filter((itemId) => id !== itemId)
          );
        } else {
          const newSelection = multiselect ? [...selection, id] : [id];
          onChangeSelection(newSelection);
        }
      },
      children: [
        showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }),
        showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          DataViewsSelectionCheckbox,
          {
            item,
            selection,
            onChangeSelection,
            getItemId: getItemId2,
            titleField,
            disabled: false,
            "aria-hidden": true,
            tabIndex: -1
          }
        ),
        showTitle && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          Stack,
          {
            direction: "row",
            justify: "space-between",
            className: "dataviews-view-picker-grid__title-actions",
            children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Stack, { direction: "column", gap: "2xs", children: [
          showDescription && descriptionField?.render && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            descriptionField.render,
            {
              item,
              field: descriptionField
            }
          ),
          !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            Stack,
            {
              direction: "row",
              className: "dataviews-view-picker-grid__badge-fields",
              gap: "xs",
              wrap: "wrap",
              align: "top",
              justify: "flex-start",
              children: badgeFields.map((field) => {
                return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                  Badge2,
                  {
                    className: "dataviews-view-picker-grid__field-value",
                    children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                      field.render,
                      {
                        item,
                        field
                      }
                    )
                  },
                  field.id
                );
              })
            }
          ),
          !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            Stack,
            {
              direction: "column",
              className: "dataviews-view-picker-grid__fields",
              gap: "2xs",
              children: regularFields.map((field) => {
                return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                  import_components18.Flex,
                  {
                    className: "dataviews-view-picker-grid__field",
                    gap: 1,
                    justify: "flex-start",
                    expanded: true,
                    style: { height: "auto" },
                    direction: "row",
                    children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components18.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }),
                      /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                        import_components18.FlexItem,
                        {
                          className: "dataviews-view-picker-grid__field-value",
                          style: { maxHeight: "none" },
                          children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                            field.render,
                            {
                              item,
                              field
                            }
                          )
                        }
                      )
                    ] })
                  },
                  field.id
                );
              })
            }
          )
        ] })
      ]
    },
    id
  );
}
function GridGroup({
  groupName,
  groupField,
  showLabel = true,
  children
}) {
  const headerId = (0, import_compose7.useInstanceId)(
    GridGroup,
    "dataviews-view-picker-grid-group__header"
  );
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
    Stack,
    {
      direction: "column",
      gap: "xs",
      role: "group",
      "aria-labelledby": headerId,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          "h3",
          {
            className: "dataviews-view-picker-grid-group__header",
            id: headerId,
            children: showLabel ? (0, import_i18n18.sprintf)(
              // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
              (0, import_i18n18.__)("%1$s: %2$s"),
              groupField.label,
              groupName
            ) : groupName
          }
        ),
        children
      ]
    },
    groupName
  );
}
function ViewPickerGrid({
  actions: actions2,
  data,
  fields,
  getItemId: getItemId2,
  isLoading,
  onChangeSelection,
  selection,
  view,
  className,
  empty
}) {
  const { resizeObserverRef, paginationInfo, itemListLabel } = (0, import_element20.useContext)(dataviews_context_default);
  const titleField = fields.find(
    (field) => field.id === view?.titleField
  );
  const mediaField = fields.find(
    (field) => field.id === view?.mediaField
  );
  const descriptionField = fields.find(
    (field) => field.id === view?.descriptionField
  );
  const otherFields = view.fields ?? [];
  const { regularFields, badgeFields } = otherFields.reduce(
    (accumulator, fieldId) => {
      const field = fields.find((f2) => f2.id === fieldId);
      if (!field) {
        return accumulator;
      }
      const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
      accumulator[key].push(field);
      return accumulator;
    },
    { regularFields: [], badgeFields: [] }
  );
  const hasData = !!data?.length;
  const usedPreviewSize = view.layout?.previewSize;
  const isMultiselect = useIsMultiselectPicker(actions2);
  const size = "900px";
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  const currentPage = view?.page ?? 1;
  const perPage = view?.perPage ?? 0;
  const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, {
    // Render multiple groups.
    children: [
      hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
        import_components18.Composite,
        {
          virtualFocus: true,
          orientation: "horizontal",
          role: "listbox",
          "aria-multiselectable": isMultiselect,
          className: clsx_default(
            "dataviews-view-picker-grid",
            className
          ),
          "aria-label": itemListLabel,
          render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            Stack,
            {
              direction: "column",
              gap: "md",
              children,
              ...props
            }
          ),
          children: Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
              GridGroup,
              {
                groupName,
                groupField,
                showLabel: view.groupBy?.showLabel !== false,
                children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                  GridItems,
                  {
                    previewSize: usedPreviewSize,
                    style: {
                      gridTemplateColumns: usedPreviewSize && `repeat(auto-fill, minmax(${usedPreviewSize}px, 1fr))`
                    },
                    "aria-busy": isLoading,
                    ref: resizeObserverRef,
                    children: groupItems.map((item) => {
                      const posInSet = (currentPage - 1) * perPage + data.indexOf(item) + 1;
                      return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                        GridItem3,
                        {
                          view,
                          multiselect: isMultiselect,
                          selection,
                          onChangeSelection,
                          getItemId: getItemId2,
                          item,
                          mediaField,
                          titleField,
                          descriptionField,
                          regularFields,
                          badgeFields,
                          config: {
                            sizes: size
                          },
                          posinset: posInSet,
                          setsize: setSize
                        },
                        getItemId2(item)
                      );
                    })
                  }
                )
              },
              groupName
            )
          )
        }
      ),
      // Render a single grid with all data.
      hasData && !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
        import_components18.Composite,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            GridItems,
            {
              className: clsx_default(
                "dataviews-view-picker-grid",
                className
              ),
              previewSize: usedPreviewSize,
              "aria-busy": isLoading,
              ref: resizeObserverRef
            }
          ),
          virtualFocus: true,
          orientation: "horizontal",
          role: "listbox",
          "aria-multiselectable": isMultiselect,
          "aria-label": itemListLabel,
          children: data.map((item, index) => {
            let posinset = isInfiniteScroll ? index + 1 : void 0;
            if (!isInfiniteScroll) {
              posinset = (currentPage - 1) * perPage + index + 1;
            }
            return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
              GridItem3,
              {
                view,
                multiselect: isMultiselect,
                selection,
                onChangeSelection,
                getItemId: getItemId2,
                item,
                mediaField,
                titleField,
                descriptionField,
                regularFields,
                badgeFields,
                config: {
                  sizes: size
                },
                posinset,
                setsize: setSize
              },
              getItemId2(item)
            );
          })
        }
      ),
      // Render empty state.
      !hasData && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
        "div",
        {
          className: clsx_default({
            "dataviews-loading": isLoading,
            "dataviews-no-results": !isLoading
          }),
          children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components18.Spinner, {}) }) : empty
        }
      ),
      hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components18.Spinner, {}) })
    ]
  });
}
var picker_grid_default = ViewPickerGrid;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/picker-table/index.mjs
var import_i18n19 = __toESM(require_i18n(), 1);
var import_components19 = __toESM(require_components(), 1);
var import_element21 = __toESM(require_element(), 1);
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
function TableColumnField2({
  item,
  fields,
  column,
  align
}) {
  const field = fields.find((f2) => f2.id === column);
  if (!field) {
    return null;
  }
  const className = clsx_default("dataviews-view-table__cell-content-wrapper", {
    "dataviews-view-table__cell-align-end": align === "end",
    "dataviews-view-table__cell-align-center": align === "center"
  });
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(field.render, { item, field }) });
}
function TableRow2({
  item,
  fields,
  id,
  view,
  titleField,
  mediaField,
  descriptionField,
  selection,
  getItemId: getItemId2,
  onChangeSelection,
  multiselect,
  posinset
}) {
  const { paginationInfo } = (0, import_element21.useContext)(dataviews_context_default);
  const isSelected2 = selection.includes(id);
  const [isHovered, setIsHovered] = (0, import_element21.useState)(false);
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const handleMouseEnter = () => {
    setIsHovered(true);
  };
  const handleMouseLeave = () => {
    setIsHovered(false);
  };
  const columns = view.fields ?? [];
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
    import_components19.Composite.Item,
    {
      render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
        "tr",
        {
          className: clsx_default("dataviews-view-table__row", {
            "is-selected": isSelected2,
            "is-hovered": isHovered
          }),
          onMouseEnter: handleMouseEnter,
          onMouseLeave: handleMouseLeave,
          children,
          ...props
        }
      ),
      "aria-selected": isSelected2,
      "aria-setsize": paginationInfo.totalItems || void 0,
      "aria-posinset": posinset,
      role: infiniteScrollEnabled ? "article" : "option",
      onClick: () => {
        if (isSelected2) {
          onChangeSelection(
            selection.filter((itemId) => id !== itemId)
          );
        } else {
          const newSelection = multiselect ? [...selection, id] : [id];
          onChangeSelection(newSelection);
        }
      },
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
          "td",
          {
            className: "dataviews-view-table__checkbox-column",
            role: "presentation",
            children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
              DataViewsSelectionCheckbox,
              {
                item,
                selection,
                onChangeSelection,
                getItemId: getItemId2,
                titleField,
                disabled: false,
                "aria-hidden": true,
                tabIndex: -1
              }
            ) })
          }
        ),
        hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("td", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
          column_primary_default,
          {
            item,
            titleField: showTitle ? titleField : void 0,
            mediaField: showMedia ? mediaField : void 0,
            descriptionField: showDescription ? descriptionField : void 0,
            isItemClickable: () => false
          }
        ) }),
        columns.map((column) => {
          const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
          return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
            "td",
            {
              style: {
                width,
                maxWidth,
                minWidth
              },
              role: "presentation",
              children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                TableColumnField2,
                {
                  fields,
                  item,
                  column,
                  align
                }
              )
            },
            column
          );
        })
      ]
    },
    id
  );
}
function ViewPickerTable({
  actions: actions2,
  data,
  fields,
  getItemId: getItemId2,
  isLoading = false,
  onChangeView,
  onChangeSelection,
  selection,
  setOpenedFilter,
  view,
  className,
  empty
}) {
  const headerMenuRefs = (0, import_element21.useRef)(/* @__PURE__ */ new Map());
  const headerMenuToFocusRef = (0, import_element21.useRef)();
  const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element21.useState)();
  const isMultiselect = useIsMultiselectPicker(actions2) ?? false;
  (0, import_element21.useEffect)(() => {
    if (headerMenuToFocusRef.current) {
      headerMenuToFocusRef.current.focus();
      headerMenuToFocusRef.current = void 0;
    }
  });
  const tableNoticeId = (0, import_element21.useId)();
  if (nextHeaderMenuToFocus) {
    headerMenuToFocusRef.current = nextHeaderMenuToFocus;
    setNextHeaderMenuToFocus(void 0);
    return;
  }
  const onHide = (field) => {
    const hidden = headerMenuRefs.current.get(field.id);
    const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
    setNextHeaderMenuToFocus(fallback?.node);
  };
  const hasData = !!data?.length;
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  const columns = view.fields ?? [];
  const headerMenuRef = (column, index) => (node) => {
    if (node) {
      headerMenuRefs.current.set(column, {
        node,
        fallback: columns[index > 0 ? index - 1 : 1]
      });
    } else {
      headerMenuRefs.current.delete(column);
    }
  };
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
      "table",
      {
        className: clsx_default(
          "dataviews-view-table",
          "dataviews-view-picker-table",
          className,
          {
            [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
              view.layout.density
            )
          }
        ),
        "aria-busy": isLoading,
        "aria-describedby": tableNoticeId,
        role: isInfiniteScroll ? "feed" : "listbox",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("thead", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
            "tr",
            {
              className: "dataviews-view-table__row",
              role: "presentation",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("th", { className: "dataviews-view-table__checkbox-column", children: isMultiselect && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  BulkSelectionCheckbox,
                  {
                    selection,
                    onChangeSelection,
                    data,
                    actions: actions2,
                    getItemId: getItemId2
                  }
                ) }),
                hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("th", { children: titleField && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                  column_header_menu_default,
                  {
                    ref: headerMenuRef(
                      titleField.id,
                      0
                    ),
                    fieldId: titleField.id,
                    view,
                    fields,
                    onChangeView,
                    onHide,
                    setOpenedFilter,
                    canMove: false
                  }
                ) }),
                columns.map((column, index) => {
                  const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
                  return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                    "th",
                    {
                      style: {
                        width,
                        maxWidth,
                        minWidth,
                        textAlign: align
                      },
                      "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
                      scope: "col",
                      children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                        column_header_menu_default,
                        {
                          ref: headerMenuRef(column, index),
                          fieldId: column,
                          view,
                          fields,
                          onChangeView,
                          onHide,
                          setOpenedFilter,
                          canMove: view.layout?.enableMoving ?? true
                        }
                      )
                    },
                    column
                  );
                })
              ]
            }
          ) }),
          hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
              import_components19.Composite,
              {
                virtualFocus: true,
                orientation: "vertical",
                render: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("tbody", { role: "group" }),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                    "tr",
                    {
                      className: "dataviews-view-table__group-header-row",
                      role: "presentation",
                      children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                        "td",
                        {
                          colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + 1,
                          className: "dataviews-view-table__group-header-cell",
                          role: "presentation",
                          children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n19.sprintf)(
                            // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                            (0, import_i18n19.__)("%1$s: %2$s"),
                            groupField.label,
                            groupName
                          )
                        }
                      )
                    }
                  ),
                  groupItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                    TableRow2,
                    {
                      item,
                      fields,
                      id: getItemId2(item) || index.toString(),
                      view,
                      titleField,
                      mediaField,
                      descriptionField,
                      selection,
                      getItemId: getItemId2,
                      onChangeSelection,
                      multiselect: isMultiselect
                    },
                    getItemId2(item)
                  ))
                ]
              },
              `group-${groupName}`
            )
          ) : /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
            import_components19.Composite,
            {
              render: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("tbody", { role: "presentation" }),
              virtualFocus: true,
              orientation: "vertical",
              children: hasData && data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
                TableRow2,
                {
                  item,
                  fields,
                  id: getItemId2(item) || index.toString(),
                  view,
                  titleField,
                  mediaField,
                  descriptionField,
                  selection,
                  getItemId: getItemId2,
                  onChangeSelection,
                  multiselect: isMultiselect,
                  posinset: index + 1
                },
                getItemId2(item)
              ))
            }
          )
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
      "div",
      {
        className: clsx_default({
          "dataviews-loading": isLoading,
          "dataviews-no-results": !hasData && !isLoading
        }),
        id: tableNoticeId,
        children: [
          !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_components19.Spinner, {}) }) : empty),
          hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_components19.Spinner, {}) })
        ]
      }
    )
  ] });
}
var picker_table_default = ViewPickerTable;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/preview-size-picker.mjs
var import_components20 = __toESM(require_components(), 1);
var import_i18n20 = __toESM(require_i18n(), 1);
var import_element22 = __toESM(require_element(), 1);
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
var imageSizes2 = [
  {
    value: 120,
    breakpoint: 1
  },
  {
    value: 170,
    breakpoint: 1
  },
  {
    value: 230,
    breakpoint: 1
  },
  {
    value: 290,
    breakpoint: 1112
    // at minimum image width, 4 images display at this container size
  },
  {
    value: 350,
    breakpoint: 1636
    // at minimum image width, 6 images display at this container size
  },
  {
    value: 430,
    breakpoint: 588
    // at minimum image width, 2 images display at this container size
  }
];
function PreviewSizePicker() {
  const context = (0, import_element22.useContext)(dataviews_context_default);
  const view = context.view;
  const breakValues = imageSizes2.filter((size) => {
    return context.containerWidth >= size.breakpoint;
  });
  const layoutPreviewSize = view.layout?.previewSize ?? 230;
  const previewSizeToUse = breakValues.map((size, index) => ({ ...size, index })).filter((size) => size.value <= layoutPreviewSize).sort((a2, b2) => b2.value - a2.value)[0]?.index ?? 0;
  const marks = breakValues.map((size, index) => {
    return {
      value: index
    };
  });
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
    import_components20.RangeControl,
    {
      __next40pxDefaultSize: true,
      showTooltip: false,
      label: (0, import_i18n20.__)("Preview size"),
      value: previewSizeToUse,
      min: 0,
      max: breakValues.length - 1,
      withInputField: false,
      onChange: (value = 0) => {
        context.onChangeView({
          ...view,
          layout: {
            ...view.layout,
            previewSize: breakValues[value].value
          }
        });
      },
      step: 1,
      marks
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/density-picker.mjs
var import_components21 = __toESM(require_components(), 1);
var import_i18n21 = __toESM(require_i18n(), 1);
var import_element23 = __toESM(require_element(), 1);
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
function DensityPicker() {
  const context = (0, import_element23.useContext)(dataviews_context_default);
  const view = context.view;
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
    import_components21.__experimentalToggleGroupControl,
    {
      size: "__unstable-large",
      label: (0, import_i18n21.__)("Density"),
      value: view.layout?.density || "balanced",
      onChange: (value) => {
        context.onChangeView({
          ...view,
          layout: {
            ...view.layout,
            density: value
          }
        });
      },
      isBlock: true,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
          import_components21.__experimentalToggleGroupControlOption,
          {
            value: "comfortable",
            label: (0, import_i18n21._x)(
              "Comfortable",
              "Density option for DataView layout"
            )
          },
          "comfortable"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
          import_components21.__experimentalToggleGroupControlOption,
          {
            value: "balanced",
            label: (0, import_i18n21._x)("Balanced", "Density option for DataView layout")
          },
          "balanced"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
          import_components21.__experimentalToggleGroupControlOption,
          {
            value: "compact",
            label: (0, import_i18n21._x)("Compact", "Density option for DataView layout")
          },
          "compact"
        )
      ]
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/index.mjs
var VIEW_LAYOUTS = [
  {
    type: LAYOUT_TABLE,
    label: (0, import_i18n22.__)("Table"),
    component: table_default,
    icon: block_table_default,
    viewConfigOptions: DensityPicker
  },
  {
    type: LAYOUT_GRID,
    label: (0, import_i18n22.__)("Grid"),
    component: grid_default,
    icon: category_default,
    viewConfigOptions: PreviewSizePicker
  },
  {
    type: LAYOUT_LIST,
    label: (0, import_i18n22.__)("List"),
    component: ViewList,
    icon: (0, import_i18n22.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default,
    viewConfigOptions: DensityPicker
  },
  {
    type: LAYOUT_ACTIVITY,
    label: (0, import_i18n22.__)("Activity"),
    component: ViewActivity,
    icon: scheduled_default,
    viewConfigOptions: DensityPicker
  },
  {
    type: LAYOUT_PICKER_GRID,
    label: (0, import_i18n22.__)("Grid"),
    component: picker_grid_default,
    icon: category_default,
    viewConfigOptions: PreviewSizePicker,
    isPicker: true
  },
  {
    type: LAYOUT_PICKER_TABLE,
    label: (0, import_i18n22.__)("Table"),
    component: picker_table_default,
    icon: block_table_default,
    viewConfigOptions: DensityPicker,
    isPicker: true
  }
];

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.mjs
var import_element31 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.mjs
var import_components24 = __toESM(require_components(), 1);
var import_i18n25 = __toESM(require_i18n(), 1);
var import_element28 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/XMCVU3LR.js
function noop2(..._) {
}
function applyState(argument, currentValue) {
  if (isUpdater(argument)) {
    const value = isLazyValue(currentValue) ? currentValue() : currentValue;
    return argument(value);
  }
  return argument;
}
function isUpdater(argument) {
  return typeof argument === "function";
}
function isLazyValue(value) {
  return typeof value === "function";
}
function hasOwnProperty(object, prop) {
  if (typeof Object.hasOwn === "function") {
    return Object.hasOwn(object, prop);
  }
  return Object.prototype.hasOwnProperty.call(object, prop);
}
function chain(...fns) {
  return (...args) => {
    for (const fn of fns) {
      if (typeof fn === "function") {
        fn(...args);
      }
    }
  };
}
function normalizeString(str) {
  return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
function omit(object, keys) {
  const result2 = { ...object };
  for (const key of keys) {
    if (hasOwnProperty(result2, key)) {
      delete result2[key];
    }
  }
  return result2;
}
function pick(object, paths) {
  const result2 = {};
  for (const key of paths) {
    if (hasOwnProperty(object, key)) {
      result2[key] = object[key];
    }
  }
  return result2;
}
function identity(value) {
  return value;
}
function invariant(condition, message2) {
  if (condition) return;
  if (typeof message2 !== "string") throw new Error("Invariant failed");
  throw new Error(message2);
}
function getKeys(obj) {
  return Object.keys(obj);
}
function isFalsyBooleanCallback(booleanOrCallback, ...args) {
  const result2 = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
  if (result2 == null) return false;
  return !result2;
}
function disabledFromProps(props) {
  return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
}
function removeUndefinedValues(obj) {
  const result2 = {};
  for (const key in obj) {
    if (obj[key] !== void 0) {
      result2[key] = obj[key];
    }
  }
  return result2;
}
function defaultValue(...values) {
  for (const value of values) {
    if (value !== void 0) return value;
  }
  return void 0;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/YXGXYGQX.js
var import_react4 = __toESM(require_react(), 1);
function setRef(ref, value) {
  if (typeof ref === "function") {
    ref(value);
  } else if (ref) {
    ref.current = value;
  }
}
function isValidElementWithRef(element) {
  if (!element) return false;
  if (!(0, import_react4.isValidElement)(element)) return false;
  if ("ref" in element.props) return true;
  if ("ref" in element) return true;
  return false;
}
function getRefProperty(element) {
  if (!isValidElementWithRef(element)) return null;
  const props = { ...element.props };
  return props.ref || element.ref;
}
function mergeProps2(base, overrides) {
  const props = { ...base };
  for (const key in overrides) {
    if (!hasOwnProperty(overrides, key)) continue;
    if (key === "className") {
      const prop = "className";
      props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
      continue;
    }
    if (key === "style") {
      const prop = "style";
      props[prop] = base[prop] ? { ...base[prop], ...overrides[prop] } : overrides[prop];
      continue;
    }
    const overrideValue = overrides[key];
    if (typeof overrideValue === "function" && key.startsWith("on")) {
      const baseValue = base[key];
      if (typeof baseValue === "function") {
        props[key] = (...args) => {
          overrideValue(...args);
          baseValue(...args);
        };
        continue;
      }
    }
    props[key] = overrideValue;
  }
  return props;
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/3DNM6L6E.js
var canUseDOM = checkIsBrowser();
function checkIsBrowser() {
  var _a;
  return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
}
function getDocument(node) {
  if (!node) return document;
  if ("self" in node) return node.document;
  return node.ownerDocument || document;
}
function getActiveElement(node, activeDescendant = false) {
  var _a;
  const { activeElement: activeElement2 } = getDocument(node);
  if (!(activeElement2 == null ? void 0 : activeElement2.nodeName)) {
    return null;
  }
  if (isFrame(activeElement2) && ((_a = activeElement2.contentDocument) == null ? void 0 : _a.body)) {
    return getActiveElement(
      activeElement2.contentDocument.body,
      activeDescendant
    );
  }
  if (activeDescendant) {
    const id = activeElement2.getAttribute("aria-activedescendant");
    if (id) {
      const element = getDocument(activeElement2).getElementById(id);
      if (element) {
        return element;
      }
    }
  }
  return activeElement2;
}
function contains2(parent, child) {
  return parent === child || parent.contains(child);
}
function isFrame(element) {
  return element.tagName === "IFRAME";
}
function isButton(element) {
  const tagName = element.tagName.toLowerCase();
  if (tagName === "button") return true;
  if (tagName === "input" && element.type) {
    return buttonInputTypes.indexOf(element.type) !== -1;
  }
  return false;
}
var buttonInputTypes = [
  "button",
  "color",
  "file",
  "image",
  "reset",
  "submit"
];
function isVisible(element) {
  if (typeof element.checkVisibility === "function") {
    return element.checkVisibility();
  }
  const htmlElement = element;
  return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
}
function isTextField(element) {
  try {
    const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
    const isTextArea = element.tagName === "TEXTAREA";
    return isTextInput || isTextArea || false;
  } catch (_error) {
    return false;
  }
}
function isTextbox(element) {
  return element.isContentEditable || isTextField(element);
}
function getTextboxValue(element) {
  if (isTextField(element)) {
    return element.value;
  }
  if (element.isContentEditable) {
    const range = getDocument(element).createRange();
    range.selectNodeContents(element);
    return range.toString();
  }
  return "";
}
function getTextboxSelection(element) {
  let start = 0;
  let end = 0;
  if (isTextField(element)) {
    start = element.selectionStart || 0;
    end = element.selectionEnd || 0;
  } else if (element.isContentEditable) {
    const selection = getDocument(element).getSelection();
    if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains2(element, selection.anchorNode) && selection.focusNode && contains2(element, selection.focusNode)) {
      const range = selection.getRangeAt(0);
      const nextRange = range.cloneRange();
      nextRange.selectNodeContents(element);
      nextRange.setEnd(range.startContainer, range.startOffset);
      start = nextRange.toString().length;
      nextRange.setEnd(range.endContainer, range.endOffset);
      end = nextRange.toString().length;
    }
  }
  return { start, end };
}
function getPopupRole(element, fallback) {
  const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
  const role = element == null ? void 0 : element.getAttribute("role");
  if (role && allowedPopupRoles.indexOf(role) !== -1) {
    return role;
  }
  return fallback;
}
function getScrollingElement(element) {
  if (!element) return null;
  const isScrollableOverflow = (overflow) => {
    if (overflow === "auto") return true;
    if (overflow === "scroll") return true;
    return false;
  };
  if (element.clientHeight && element.scrollHeight > element.clientHeight) {
    const { overflowY } = getComputedStyle(element);
    if (isScrollableOverflow(overflowY)) return element;
  } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
    const { overflowX } = getComputedStyle(element);
    if (isScrollableOverflow(overflowX)) return element;
  }
  return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
}
function setSelectionRange(element, ...args) {
  if (/text|search|password|tel|url/i.test(element.type)) {
    element.setSelectionRange(...args);
  }
}
function sortBasedOnDOMPosition(items, getElement) {
  const pairs = items.map((item, index) => [index, item]);
  let isOrderDifferent = false;
  pairs.sort(([indexA, a2], [indexB, b2]) => {
    const elementA = getElement(a2);
    const elementB = getElement(b2);
    if (elementA === elementB) return 0;
    if (!elementA || !elementB) return 0;
    if (isElementPreceding(elementA, elementB)) {
      if (indexA > indexB) {
        isOrderDifferent = true;
      }
      return -1;
    }
    if (indexA < indexB) {
      isOrderDifferent = true;
    }
    return 1;
  });
  if (isOrderDifferent) {
    return pairs.map(([_, item]) => item);
  }
  return items;
}
function isElementPreceding(a2, b2) {
  return Boolean(
    b2.compareDocumentPosition(a2) & Node.DOCUMENT_POSITION_PRECEDING
  );
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/SNHYQNEZ.js
function isTouchDevice() {
  return canUseDOM && !!navigator.maxTouchPoints;
}
function isApple() {
  if (!canUseDOM) return false;
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
}
function isSafari() {
  return canUseDOM && isApple() && /apple/i.test(navigator.vendor);
}
function isFirefox() {
  return canUseDOM && /firefox\//i.test(navigator.userAgent);
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/utils/events.js
function isPortalEvent(event) {
  return Boolean(
    event.currentTarget && !contains2(event.currentTarget, event.target)
  );
}
function isSelfTarget(event) {
  return event.target === event.currentTarget;
}
function isOpeningInNewTab(event) {
  const element = event.currentTarget;
  if (!element) return false;
  const isAppleDevice = isApple();
  if (isAppleDevice && !event.metaKey) return false;
  if (!isAppleDevice && !event.ctrlKey) return false;
  const tagName = element.tagName.toLowerCase();
  if (tagName === "a") return true;
  if (tagName === "button" && element.type === "submit") return true;
  if (tagName === "input" && element.type === "submit") return true;
  return false;
}
function isDownloading(event) {
  const element = event.currentTarget;
  if (!element) return false;
  const tagName = element.tagName.toLowerCase();
  if (!event.altKey) return false;
  if (tagName === "a") return true;
  if (tagName === "button" && element.type === "submit") return true;
  if (tagName === "input" && element.type === "submit") return true;
  return false;
}
function fireBlurEvent(element, eventInit) {
  const event = new FocusEvent("blur", eventInit);
  const defaultAllowed = element.dispatchEvent(event);
  const bubbleInit = { ...eventInit, bubbles: true };
  element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
  return defaultAllowed;
}
function fireKeyboardEvent(element, type, eventInit) {
  const event = new KeyboardEvent(type, eventInit);
  return element.dispatchEvent(event);
}
function fireClickEvent(element, eventInit) {
  const event = new MouseEvent("click", eventInit);
  return element.dispatchEvent(event);
}
function isFocusEventOutside(event, container) {
  const containerElement = container || event.currentTarget;
  const relatedTarget = event.relatedTarget;
  return !relatedTarget || !contains2(containerElement, relatedTarget);
}
function queueBeforeEvent(element, type, callback, timeout) {
  const createTimer = (callback2) => {
    if (timeout) {
      const timerId2 = setTimeout(callback2, timeout);
      return () => clearTimeout(timerId2);
    }
    const timerId = requestAnimationFrame(callback2);
    return () => cancelAnimationFrame(timerId);
  };
  const cancelTimer = createTimer(() => {
    element.removeEventListener(type, callSync, true);
    callback();
  });
  const callSync = () => {
    cancelTimer();
    callback();
  };
  element.addEventListener(type, callSync, { once: true, capture: true });
  return cancelTimer;
}
function addGlobalEventListener(type, listener, options, scope = window) {
  const children = [];
  try {
    scope.document.addEventListener(type, listener, options);
    for (const frame of Array.from(scope.frames)) {
      children.push(addGlobalEventListener(type, listener, options, frame));
    }
  } catch (e2) {
  }
  const removeEventListener = () => {
    try {
      scope.document.removeEventListener(type, listener, options);
    } catch (e2) {
    }
    for (const remove of children) {
      remove();
    }
  };
  return removeEventListener;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/KPHZR4MB.js
var React30 = __toESM(require_react(), 1);
var import_react5 = __toESM(require_react(), 1);
var _React = { ...React30 };
var useReactId = _React.useId;
var useReactDeferredValue = _React.useDeferredValue;
var useReactInsertionEffect = _React.useInsertionEffect;
var useSafeLayoutEffect = canUseDOM ? import_react5.useLayoutEffect : import_react5.useEffect;
function useInitialValue(value) {
  const [initialValue] = (0, import_react5.useState)(value);
  return initialValue;
}
function useLiveRef(value) {
  const ref = (0, import_react5.useRef)(value);
  useSafeLayoutEffect(() => {
    ref.current = value;
  });
  return ref;
}
function useEvent(callback) {
  const ref = (0, import_react5.useRef)(() => {
    throw new Error("Cannot call an event handler while rendering.");
  });
  if (useReactInsertionEffect) {
    useReactInsertionEffect(() => {
      ref.current = callback;
    });
  } else {
    ref.current = callback;
  }
  return (0, import_react5.useCallback)((...args) => {
    var _a;
    return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
  }, []);
}
function useTransactionState(callback) {
  const [state, setState] = (0, import_react5.useState)(null);
  useSafeLayoutEffect(() => {
    if (state == null) return;
    if (!callback) return;
    let prevState = null;
    callback((prev) => {
      prevState = prev;
      return state;
    });
    return () => {
      callback(prevState);
    };
  }, [state, callback]);
  return [state, setState];
}
function useMergeRefs(...refs) {
  return (0, import_react5.useMemo)(() => {
    if (!refs.some(Boolean)) return;
    return (value) => {
      for (const ref of refs) {
        setRef(ref, value);
      }
    };
  }, refs);
}
function useId4(defaultId) {
  if (useReactId) {
    const reactId = useReactId();
    if (defaultId) return defaultId;
    return reactId;
  }
  const [id, setId] = (0, import_react5.useState)(defaultId);
  useSafeLayoutEffect(() => {
    if (defaultId || id) return;
    const random = Math.random().toString(36).slice(2, 8);
    setId(`id-${random}`);
  }, [defaultId, id]);
  return defaultId || id;
}
function useTagName(refOrElement, type) {
  const stringOrUndefined = (type2) => {
    if (typeof type2 !== "string") return;
    return type2;
  };
  const [tagName, setTagName] = (0, import_react5.useState)(() => stringOrUndefined(type));
  useSafeLayoutEffect(() => {
    const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
    setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
  }, [refOrElement, type]);
  return tagName;
}
function useAttribute(refOrElement, attributeName, defaultValue2) {
  const initialValue = useInitialValue(defaultValue2);
  const [attribute, setAttribute] = (0, import_react5.useState)(initialValue);
  (0, import_react5.useEffect)(() => {
    const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
    if (!element) return;
    const callback = () => {
      const value = element.getAttribute(attributeName);
      setAttribute(value == null ? initialValue : value);
    };
    const observer = new MutationObserver(callback);
    observer.observe(element, { attributeFilter: [attributeName] });
    callback();
    return () => observer.disconnect();
  }, [refOrElement, attributeName, initialValue]);
  return attribute;
}
function useUpdateEffect(effect, deps) {
  const mounted = (0, import_react5.useRef)(false);
  (0, import_react5.useEffect)(() => {
    if (mounted.current) {
      return effect();
    }
    mounted.current = true;
  }, deps);
  (0, import_react5.useEffect)(
    () => () => {
      mounted.current = false;
    },
    []
  );
}
function useUpdateLayoutEffect(effect, deps) {
  const mounted = (0, import_react5.useRef)(false);
  useSafeLayoutEffect(() => {
    if (mounted.current) {
      return effect();
    }
    mounted.current = true;
  }, deps);
  useSafeLayoutEffect(
    () => () => {
      mounted.current = false;
    },
    []
  );
}
function useForceUpdate() {
  return (0, import_react5.useReducer)(() => [], []);
}
function useBooleanEvent(booleanOrCallback) {
  return useEvent(
    typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
  );
}
function useWrapElement(props, callback, deps = []) {
  const wrapElement = (0, import_react5.useCallback)(
    (element) => {
      if (props.wrapElement) {
        element = props.wrapElement(element);
      }
      return callback(element);
    },
    [...deps, props.wrapElement]
  );
  return { ...props, wrapElement };
}
function useMetadataProps(props, key, value) {
  const parent = props.onLoadedMetadataCapture;
  const onLoadedMetadataCapture = (0, import_react5.useMemo)(() => {
    return Object.assign(() => {
    }, { ...parent, [key]: value });
  }, [parent, key, value]);
  return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
}
var hasInstalledGlobalEventListeners = false;
function useIsMouseMoving() {
  (0, import_react5.useEffect)(() => {
    if (hasInstalledGlobalEventListeners) return;
    addGlobalEventListener("mousemove", setMouseMoving, true);
    addGlobalEventListener("mousedown", resetMouseMoving, true);
    addGlobalEventListener("mouseup", resetMouseMoving, true);
    addGlobalEventListener("keydown", resetMouseMoving, true);
    addGlobalEventListener("scroll", resetMouseMoving, true);
    hasInstalledGlobalEventListeners = true;
  }, []);
  const isMouseMoving = useEvent(() => mouseMoving);
  return isMouseMoving;
}
var mouseMoving = false;
var previousScreenX = 0;
var previousScreenY = 0;
function hasMouseMovement(event) {
  const movementX = event.movementX || event.screenX - previousScreenX;
  const movementY = event.movementY || event.screenY - previousScreenY;
  previousScreenX = event.screenX;
  previousScreenY = event.screenY;
  return movementX || movementY || false;
}
function setMouseMoving(event) {
  if (!hasMouseMovement(event)) return;
  mouseMoving = true;
}
function resetMouseMoving() {
  mouseMoving = false;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/GWSL6KNJ.js
var React31 = __toESM(require_react(), 1);
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
function forwardRef22(render4) {
  const Role = React31.forwardRef(
    // @ts-ignore Incompatible with React 19 types. Ignore for now.
    (props, ref) => render4({ ...props, ref })
  );
  Role.displayName = render4.displayName || render4.name;
  return Role;
}
function memo22(Component, propsAreEqual) {
  return React31.memo(Component, propsAreEqual);
}
function createElement3(Type2, props) {
  const { wrapElement, render: render4, ...rest } = props;
  const mergedRef = useMergeRefs(props.ref, getRefProperty(render4));
  let element;
  if (React31.isValidElement(render4)) {
    const renderProps = {
      // @ts-ignore Incompatible with React 19 types. Ignore for now.
      ...render4.props,
      ref: mergedRef
    };
    element = React31.cloneElement(render4, mergeProps2(rest, renderProps));
  } else if (render4) {
    element = render4(rest);
  } else {
    element = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Type2, { ...rest });
  }
  if (wrapElement) {
    return wrapElement(element);
  }
  return element;
}
function createHook(useProps) {
  const useRole = (props = {}) => {
    return useProps(props);
  };
  useRole.displayName = useProps.name;
  return useRole;
}
function createStoreContext(providers = [], scopedProviders = []) {
  const context = React31.createContext(void 0);
  const scopedContext = React31.createContext(void 0);
  const useContext210 = () => React31.useContext(context);
  const useScopedContext = (onlyScoped = false) => {
    const scoped = React31.useContext(scopedContext);
    const store5 = useContext210();
    if (onlyScoped) return scoped;
    return scoped || store5;
  };
  const useProviderContext = () => {
    const scoped = React31.useContext(scopedContext);
    const store5 = useContext210();
    if (scoped && scoped === store5) return;
    return store5;
  };
  const ContextProvider = (props) => {
    return providers.reduceRight(
      (children, Provider) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Provider, { ...props, children }),
      /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(context.Provider, { ...props })
    );
  };
  const ScopedContextProvider = (props) => {
    return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextProvider, { ...props, children: scopedProviders.reduceRight(
      (children, Provider) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Provider, { ...props, children }),
      /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(scopedContext.Provider, { ...props })
    ) });
  };
  return {
    context,
    scopedContext,
    useContext: useContext210,
    useScopedContext,
    useProviderContext,
    ContextProvider,
    ScopedContextProvider
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/SMPCIMZM.js
var ctx = createStoreContext();
var useCollectionContext = ctx.useContext;
var useCollectionScopedContext = ctx.useScopedContext;
var useCollectionProviderContext = ctx.useProviderContext;
var CollectionContextProvider = ctx.ContextProvider;
var CollectionScopedContextProvider = ctx.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/AVVXDJMZ.js
var import_react6 = __toESM(require_react(), 1);
var ctx2 = createStoreContext(
  [CollectionContextProvider],
  [CollectionScopedContextProvider]
);
var useCompositeContext = ctx2.useContext;
var useCompositeScopedContext = ctx2.useScopedContext;
var useCompositeProviderContext = ctx2.useProviderContext;
var CompositeContextProvider = ctx2.ContextProvider;
var CompositeScopedContextProvider = ctx2.ScopedContextProvider;
var CompositeItemContext = (0, import_react6.createContext)(
  void 0
);
var CompositeRowContext = (0, import_react6.createContext)(
  void 0
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/5VQZOHHZ.js
function findFirstEnabledItem(items, excludeId) {
  return items.find((item) => {
    if (excludeId) {
      return !item.disabled && item.id !== excludeId;
    }
    return !item.disabled;
  });
}
function getEnabledItem(store5, id) {
  if (!id) return null;
  return store5.item(id) || null;
}
function groupItemsByRows(items) {
  const rows = [];
  for (const item of items) {
    const row = rows.find((currentRow) => {
      var _a;
      return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
    });
    if (row) {
      row.push(item);
    } else {
      rows.push([item]);
    }
  }
  return rows;
}
function selectTextField(element, collapseToEnd = false) {
  if (isTextField(element)) {
    element.setSelectionRange(
      collapseToEnd ? element.value.length : 0,
      element.value.length
    );
  } else if (element.isContentEditable) {
    const selection = getDocument(element).getSelection();
    selection == null ? void 0 : selection.selectAllChildren(element);
    if (collapseToEnd) {
      selection == null ? void 0 : selection.collapseToEnd();
    }
  }
}
var FOCUS_SILENTLY = /* @__PURE__ */ Symbol("FOCUS_SILENTLY");
function focusSilently(element) {
  element[FOCUS_SILENTLY] = true;
  element.focus({ preventScroll: true });
}
function silentlyFocused(element) {
  const isSilentlyFocused = element[FOCUS_SILENTLY];
  delete element[FOCUS_SILENTLY];
  return isSilentlyFocused;
}
function isItem(store5, element, exclude) {
  if (!element) return false;
  if (element === exclude) return false;
  const item = store5.item(element.id);
  if (!item) return false;
  if (exclude && item.element === exclude) return false;
  return true;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/Z2O3VLAQ.js
var import_react7 = __toESM(require_react(), 1);
var TagName = "div";
var useCollectionItem = createHook(
  function useCollectionItem2({
    store: store5,
    shouldRegisterItem = true,
    getItem = identity,
    // @ts-expect-error This prop may come from a collection renderer.
    element,
    ...props
  }) {
    const context = useCollectionContext();
    store5 = store5 || context;
    const id = useId4(props.id);
    const ref = (0, import_react7.useRef)(element);
    (0, import_react7.useEffect)(() => {
      const element2 = ref.current;
      if (!id) return;
      if (!element2) return;
      if (!shouldRegisterItem) return;
      const item = getItem({ id, element: element2 });
      return store5 == null ? void 0 : store5.renderItem(item);
    }, [id, shouldRegisterItem, getItem, store5]);
    props = {
      ...props,
      ref: useMergeRefs(ref, props.ref)
    };
    return removeUndefinedValues(props);
  }
);
var CollectionItem = forwardRef22(function CollectionItem2(props) {
  const htmlProps = useCollectionItem(props);
  return createElement3(TagName, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js
var import_react8 = __toESM(require_react(), 1);
var FocusableContext = (0, import_react8.createContext)(true);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/utils/focus.js
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
function isFocusable(element) {
  if (!element.matches(selector)) return false;
  if (!isVisible(element)) return false;
  if (element.closest("[inert]")) return false;
  return true;
}
function getClosestFocusable(element) {
  while (element && !isFocusable(element)) {
    element = element.closest(selector);
  }
  return element || null;
}
function hasFocus(element) {
  const activeElement2 = getActiveElement(element);
  if (!activeElement2) return false;
  if (activeElement2 === element) return true;
  const activeDescendant = activeElement2.getAttribute("aria-activedescendant");
  if (!activeDescendant) return false;
  return activeDescendant === element.id;
}
function hasFocusWithin(element) {
  const activeElement2 = getActiveElement(element);
  if (!activeElement2) return false;
  if (contains2(element, activeElement2)) return true;
  const activeDescendant = activeElement2.getAttribute("aria-activedescendant");
  if (!activeDescendant) return false;
  if (!("id" in element)) return false;
  if (activeDescendant === element.id) return true;
  return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
}
function focusIfNeeded(element) {
  if (!hasFocusWithin(element) && isFocusable(element)) {
    element.focus();
  }
}
function focusIntoView(element, options) {
  if (!("scrollIntoView" in element)) {
    element.focus();
  } else {
    element.focus({ preventScroll: true });
    element.scrollIntoView({ block: "nearest", inline: "nearest", ...options });
  }
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/U6HHPQDW.js
var import_react9 = __toESM(require_react(), 1);
var TagName2 = "div";
var isSafariBrowser = isSafari();
var alwaysFocusVisibleInputTypes = [
  "text",
  "search",
  "url",
  "tel",
  "email",
  "password",
  "number",
  "date",
  "month",
  "week",
  "time",
  "datetime",
  "datetime-local"
];
var safariFocusAncestorSymbol = /* @__PURE__ */ Symbol("safariFocusAncestor");
function markSafariFocusAncestor(element, value) {
  if (!element) return;
  element[safariFocusAncestorSymbol] = value;
}
function isAlwaysFocusVisible(element) {
  const { tagName, readOnly, type } = element;
  if (tagName === "TEXTAREA" && !readOnly) return true;
  if (tagName === "SELECT" && !readOnly) return true;
  if (tagName === "INPUT" && !readOnly) {
    return alwaysFocusVisibleInputTypes.includes(type);
  }
  if (element.isContentEditable) return true;
  const role = element.getAttribute("role");
  if (role === "combobox" && element.dataset.name) {
    return true;
  }
  return false;
}
function getLabels(element) {
  if ("labels" in element) {
    return element.labels;
  }
  return null;
}
function isNativeCheckboxOrRadio(element) {
  const tagName = element.tagName.toLowerCase();
  if (tagName === "input" && element.type) {
    return element.type === "radio" || element.type === "checkbox";
  }
  return false;
}
function isNativeTabbable(tagName) {
  if (!tagName) return true;
  return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
}
function supportsDisabledAttribute(tagName) {
  if (!tagName) return true;
  return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
}
function getTabIndex(focusable, trulyDisabled, nativeTabbable, supportsDisabled, tabIndexProp) {
  if (!focusable) {
    return tabIndexProp;
  }
  if (trulyDisabled) {
    if (nativeTabbable && !supportsDisabled) {
      return -1;
    }
    return;
  }
  if (nativeTabbable) {
    return tabIndexProp;
  }
  return tabIndexProp || 0;
}
function useDisableEvent(onEvent, disabled2) {
  return useEvent((event) => {
    onEvent == null ? void 0 : onEvent(event);
    if (event.defaultPrevented) return;
    if (disabled2) {
      event.stopPropagation();
      event.preventDefault();
    }
  });
}
var hasInstalledGlobalEventListeners2 = false;
var isKeyboardModality = true;
function onGlobalMouseDown(event) {
  const target = event.target;
  if (target && "hasAttribute" in target) {
    if (!target.hasAttribute("data-focus-visible")) {
      isKeyboardModality = false;
    }
  }
}
function onGlobalKeyDown(event) {
  if (event.metaKey) return;
  if (event.ctrlKey) return;
  if (event.altKey) return;
  isKeyboardModality = true;
}
var useFocusable = createHook(
  function useFocusable2({
    focusable = true,
    accessibleWhenDisabled,
    autoFocus,
    onFocusVisible,
    ...props
  }) {
    const ref = (0, import_react9.useRef)(null);
    (0, import_react9.useEffect)(() => {
      if (!focusable) return;
      if (hasInstalledGlobalEventListeners2) return;
      addGlobalEventListener("mousedown", onGlobalMouseDown, true);
      addGlobalEventListener("keydown", onGlobalKeyDown, true);
      hasInstalledGlobalEventListeners2 = true;
    }, [focusable]);
    if (isSafariBrowser) {
      (0, import_react9.useEffect)(() => {
        if (!focusable) return;
        const element = ref.current;
        if (!element) return;
        if (!isNativeCheckboxOrRadio(element)) return;
        const labels = getLabels(element);
        if (!labels) return;
        const onMouseUp = () => queueMicrotask(() => element.focus());
        for (const label of labels) {
          label.addEventListener("mouseup", onMouseUp);
        }
        return () => {
          for (const label of labels) {
            label.removeEventListener("mouseup", onMouseUp);
          }
        };
      }, [focusable]);
    }
    const disabled2 = focusable && disabledFromProps(props);
    const trulyDisabled = !!disabled2 && !accessibleWhenDisabled;
    const [focusVisible, setFocusVisible] = (0, import_react9.useState)(false);
    (0, import_react9.useEffect)(() => {
      if (!focusable) return;
      if (trulyDisabled && focusVisible) {
        setFocusVisible(false);
      }
    }, [focusable, trulyDisabled, focusVisible]);
    (0, import_react9.useEffect)(() => {
      if (!focusable) return;
      if (!focusVisible) return;
      const element = ref.current;
      if (!element) return;
      if (typeof IntersectionObserver === "undefined") return;
      const observer = new IntersectionObserver(() => {
        if (!isFocusable(element)) {
          setFocusVisible(false);
        }
      });
      observer.observe(element);
      return () => observer.disconnect();
    }, [focusable, focusVisible]);
    const onKeyPressCapture = useDisableEvent(
      props.onKeyPressCapture,
      disabled2
    );
    const onMouseDownCapture = useDisableEvent(
      props.onMouseDownCapture,
      disabled2
    );
    const onClickCapture = useDisableEvent(props.onClickCapture, disabled2);
    const onMouseDownProp = props.onMouseDown;
    const onMouseDown = useEvent((event) => {
      onMouseDownProp == null ? void 0 : onMouseDownProp(event);
      if (event.defaultPrevented) return;
      if (!focusable) return;
      const element = event.currentTarget;
      if (!isSafariBrowser) return;
      if (isPortalEvent(event)) return;
      if (!isButton(element) && !isNativeCheckboxOrRadio(element)) return;
      let receivedFocus = false;
      const onFocus = () => {
        receivedFocus = true;
      };
      const options = { capture: true, once: true };
      element.addEventListener("focusin", onFocus, options);
      const focusableContainer = getClosestFocusable(element.parentElement);
      markSafariFocusAncestor(focusableContainer, true);
      queueBeforeEvent(element, "mouseup", () => {
        element.removeEventListener("focusin", onFocus, true);
        markSafariFocusAncestor(focusableContainer, false);
        if (receivedFocus) return;
        focusIfNeeded(element);
      });
    });
    const handleFocusVisible = (event, currentTarget) => {
      if (currentTarget) {
        event.currentTarget = currentTarget;
      }
      if (!focusable) return;
      const element = event.currentTarget;
      if (!element) return;
      if (!hasFocus(element)) return;
      onFocusVisible == null ? void 0 : onFocusVisible(event);
      if (event.defaultPrevented) return;
      element.dataset.focusVisible = "true";
      setFocusVisible(true);
    };
    const onKeyDownCaptureProp = props.onKeyDownCapture;
    const onKeyDownCapture = useEvent((event) => {
      onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!focusable) return;
      if (focusVisible) return;
      if (event.metaKey) return;
      if (event.altKey) return;
      if (event.ctrlKey) return;
      if (!isSelfTarget(event)) return;
      const element = event.currentTarget;
      const applyFocusVisible = () => handleFocusVisible(event, element);
      queueBeforeEvent(element, "focusout", applyFocusVisible);
    });
    const onFocusCaptureProp = props.onFocusCapture;
    const onFocusCapture = useEvent((event) => {
      onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!focusable) return;
      if (!isSelfTarget(event)) {
        setFocusVisible(false);
        return;
      }
      const element = event.currentTarget;
      const applyFocusVisible = () => handleFocusVisible(event, element);
      if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
        queueBeforeEvent(event.target, "focusout", applyFocusVisible);
      } else {
        setFocusVisible(false);
      }
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      onBlurProp == null ? void 0 : onBlurProp(event);
      if (!focusable) return;
      if (!isFocusEventOutside(event)) return;
      event.currentTarget.removeAttribute("data-focus-visible");
      setFocusVisible(false);
    });
    const autoFocusOnShow = (0, import_react9.useContext)(FocusableContext);
    const autoFocusRef = useEvent((element) => {
      if (!focusable) return;
      if (!autoFocus) return;
      if (!element) return;
      if (!autoFocusOnShow) return;
      queueMicrotask(() => {
        if (hasFocus(element)) return;
        if (!isFocusable(element)) return;
        element.focus();
      });
    });
    const tagName = useTagName(ref);
    const nativeTabbable = focusable && isNativeTabbable(tagName);
    const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
    const styleProp = props.style;
    const style = (0, import_react9.useMemo)(() => {
      if (trulyDisabled) {
        return { pointerEvents: "none", ...styleProp };
      }
      return styleProp;
    }, [trulyDisabled, styleProp]);
    props = {
      "data-focus-visible": focusable && focusVisible || void 0,
      "data-autofocus": autoFocus || void 0,
      "aria-disabled": disabled2 || void 0,
      ...props,
      ref: useMergeRefs(ref, autoFocusRef, props.ref),
      style,
      tabIndex: getTabIndex(
        focusable,
        trulyDisabled,
        nativeTabbable,
        supportsDisabled,
        props.tabIndex
      ),
      disabled: supportsDisabled && trulyDisabled ? true : void 0,
      // TODO: Test Focusable contentEditable.
      contentEditable: disabled2 ? void 0 : props.contentEditable,
      onKeyPressCapture,
      onClickCapture,
      onMouseDownCapture,
      onMouseDown,
      onKeyDownCapture,
      onFocusCapture,
      onBlur
    };
    return removeUndefinedValues(props);
  }
);
var Focusable = forwardRef22(function Focusable2(props) {
  const htmlProps = useFocusable(props);
  return createElement3(TagName2, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/PZ3OL7I2.js
var import_react10 = __toESM(require_react(), 1);
var TagName3 = "button";
function isNativeClick(event) {
  if (!event.isTrusted) return false;
  const element = event.currentTarget;
  if (event.key === "Enter") {
    return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
  }
  if (event.key === " ") {
    return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
  }
  return false;
}
var symbol = /* @__PURE__ */ Symbol("command");
var useCommand = createHook(
  function useCommand2({ clickOnEnter = true, clickOnSpace = true, ...props }) {
    const ref = (0, import_react10.useRef)(null);
    const [isNativeButton, setIsNativeButton] = (0, import_react10.useState)(false);
    (0, import_react10.useEffect)(() => {
      if (!ref.current) return;
      setIsNativeButton(isButton(ref.current));
    }, []);
    const [active, setActive] = (0, import_react10.useState)(false);
    const activeRef = (0, import_react10.useRef)(false);
    const disabled2 = disabledFromProps(props);
    const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true);
    const onKeyDownProp = props.onKeyDown;
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      const element = event.currentTarget;
      if (event.defaultPrevented) return;
      if (isDuplicate) return;
      if (disabled2) return;
      if (!isSelfTarget(event)) return;
      if (isTextField(element)) return;
      if (element.isContentEditable) return;
      const isEnter = clickOnEnter && event.key === "Enter";
      const isSpace = clickOnSpace && event.key === " ";
      const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
      const shouldPreventSpace = event.key === " " && !clickOnSpace;
      if (shouldPreventEnter || shouldPreventSpace) {
        event.preventDefault();
        return;
      }
      if (isEnter || isSpace) {
        const nativeClick = isNativeClick(event);
        if (isEnter) {
          if (!nativeClick) {
            event.preventDefault();
            const { view, ...eventInit } = event;
            const click = () => fireClickEvent(element, eventInit);
            if (isFirefox()) {
              queueBeforeEvent(element, "keyup", click);
            } else {
              queueMicrotask(click);
            }
          }
        } else if (isSpace) {
          activeRef.current = true;
          if (!nativeClick) {
            event.preventDefault();
            setActive(true);
          }
        }
      }
    });
    const onKeyUpProp = props.onKeyUp;
    const onKeyUp = useEvent((event) => {
      onKeyUpProp == null ? void 0 : onKeyUpProp(event);
      if (event.defaultPrevented) return;
      if (isDuplicate) return;
      if (disabled2) return;
      if (event.metaKey) return;
      const isSpace = clickOnSpace && event.key === " ";
      if (activeRef.current && isSpace) {
        activeRef.current = false;
        if (!isNativeClick(event)) {
          event.preventDefault();
          setActive(false);
          const element = event.currentTarget;
          const { view, ...eventInit } = event;
          queueMicrotask(() => fireClickEvent(element, eventInit));
        }
      }
    });
    props = {
      "data-active": active || void 0,
      type: isNativeButton ? "button" : void 0,
      ...metadataProps,
      ...props,
      ref: useMergeRefs(ref, props.ref),
      onKeyDown,
      onKeyUp
    };
    props = useFocusable(props);
    return props;
  }
);
var Command = forwardRef22(function Command2(props) {
  const htmlProps = useCommand(props);
  return createElement3(TagName3, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/SXKM4CGU.js
function getInternal(store5, key) {
  const internals = store5.__unstableInternals;
  invariant(internals, "Invalid store");
  return internals[key];
}
function createStore(initialState4, ...stores) {
  let state = initialState4;
  let prevStateBatch = state;
  let lastUpdate = /* @__PURE__ */ Symbol();
  let destroy = noop2;
  const instances = /* @__PURE__ */ new Set();
  const updatedKeys = /* @__PURE__ */ new Set();
  const setups = /* @__PURE__ */ new Set();
  const listeners = /* @__PURE__ */ new Set();
  const batchListeners = /* @__PURE__ */ new Set();
  const disposables = /* @__PURE__ */ new WeakMap();
  const listenerKeys = /* @__PURE__ */ new WeakMap();
  const storeSetup = (callback) => {
    setups.add(callback);
    return () => setups.delete(callback);
  };
  const storeInit = () => {
    const initialized = instances.size;
    const instance = /* @__PURE__ */ Symbol();
    instances.add(instance);
    const maybeDestroy = () => {
      instances.delete(instance);
      if (instances.size) return;
      destroy();
    };
    if (initialized) return maybeDestroy;
    const desyncs = getKeys(state).map(
      (key) => chain(
        ...stores.map((store5) => {
          var _a;
          const storeState = (_a = store5 == null ? void 0 : store5.getState) == null ? void 0 : _a.call(store5);
          if (!storeState) return;
          if (!hasOwnProperty(storeState, key)) return;
          return sync(store5, [key], (state2) => {
            setState(
              key,
              state2[key],
              // @ts-expect-error - Not public API. This is just to prevent
              // infinite loops.
              true
            );
          });
        })
      )
    );
    const teardowns = [];
    for (const setup2 of setups) {
      teardowns.push(setup2());
    }
    const cleanups = stores.map(init);
    destroy = chain(...desyncs, ...teardowns, ...cleanups);
    return maybeDestroy;
  };
  const sub = (keys, listener, set2 = listeners) => {
    set2.add(listener);
    listenerKeys.set(listener, keys);
    return () => {
      var _a;
      (_a = disposables.get(listener)) == null ? void 0 : _a();
      disposables.delete(listener);
      listenerKeys.delete(listener);
      set2.delete(listener);
    };
  };
  const storeSubscribe = (keys, listener) => sub(keys, listener);
  const storeSync = (keys, listener) => {
    disposables.set(listener, listener(state, state));
    return sub(keys, listener);
  };
  const storeBatch = (keys, listener) => {
    disposables.set(listener, listener(state, prevStateBatch));
    return sub(keys, listener, batchListeners);
  };
  const storePick = (keys) => createStore(pick(state, keys), finalStore);
  const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
  const getState = () => state;
  const setState = (key, value, fromStores = false) => {
    var _a;
    if (!hasOwnProperty(state, key)) return;
    const nextValue = applyState(value, state[key]);
    if (nextValue === state[key]) return;
    if (!fromStores) {
      for (const store5 of stores) {
        (_a = store5 == null ? void 0 : store5.setState) == null ? void 0 : _a.call(store5, key, nextValue);
      }
    }
    const prevState = state;
    state = { ...state, [key]: nextValue };
    const thisUpdate = /* @__PURE__ */ Symbol();
    lastUpdate = thisUpdate;
    updatedKeys.add(key);
    const run = (listener, prev, uKeys) => {
      var _a2;
      const keys = listenerKeys.get(listener);
      const updated = (k) => uKeys ? uKeys.has(k) : k === key;
      if (!keys || keys.some(updated)) {
        (_a2 = disposables.get(listener)) == null ? void 0 : _a2();
        disposables.set(listener, listener(state, prev));
      }
    };
    for (const listener of listeners) {
      run(listener, prevState);
    }
    queueMicrotask(() => {
      if (lastUpdate !== thisUpdate) return;
      const snapshot = state;
      for (const listener of batchListeners) {
        run(listener, prevStateBatch, updatedKeys);
      }
      prevStateBatch = snapshot;
      updatedKeys.clear();
    });
  };
  const finalStore = {
    getState,
    setState,
    __unstableInternals: {
      setup: storeSetup,
      init: storeInit,
      subscribe: storeSubscribe,
      sync: storeSync,
      batch: storeBatch,
      pick: storePick,
      omit: storeOmit
    }
  };
  return finalStore;
}
function setup(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "setup")(...args);
}
function init(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "init")(...args);
}
function subscribe(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "subscribe")(...args);
}
function sync(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "sync")(...args);
}
function batch(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "batch")(...args);
}
function omit2(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "omit")(...args);
}
function pick2(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "pick")(...args);
}
function mergeStore(...stores) {
  var _a;
  const initialState4 = {};
  for (const store22 of stores) {
    const nextState = (_a = store22 == null ? void 0 : store22.getState) == null ? void 0 : _a.call(store22);
    if (nextState) {
      Object.assign(initialState4, nextState);
    }
  }
  const store5 = createStore(initialState4, ...stores);
  return Object.assign({}, ...stores, store5);
}
function throwOnConflictingProps(props, store5) {
  if (false) return;
  if (!store5) return;
  const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
    var _a;
    const stateKey = key.replace("default", "");
    return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`;
  });
  if (!defaultKeys.length) return;
  const storeState = store5.getState();
  const conflictingProps = defaultKeys.filter(
    (key) => hasOwnProperty(storeState, key)
  );
  if (!conflictingProps.length) return;
  throw new Error(
    `Passing a store prop in conjunction with a default state is not supported.

const store = useSelectStore();
<SelectProvider store={store} defaultValue="Apple" />
                ^             ^

Instead, pass the default state to the topmost store:

const store = useSelectStore({ defaultValue: "Apple" });
<SelectProvider store={store} />

See https://github.com/ariakit/ariakit/pull/2745 for more details.

If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
`
  );
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/Q5W46E73.js
var React32 = __toESM(require_react(), 1);
var import_shim = __toESM(require_shim(), 1);
var { useSyncExternalStore } = import_shim.default;
var noopSubscribe = () => () => {
};
function useStoreState(store5, keyOrSelector = identity) {
  const storeSubscribe = React32.useCallback(
    (callback) => {
      if (!store5) return noopSubscribe();
      return subscribe(store5, null, callback);
    },
    [store5]
  );
  const getSnapshot = () => {
    const key = typeof keyOrSelector === "string" ? keyOrSelector : null;
    const selector2 = typeof keyOrSelector === "function" ? keyOrSelector : null;
    const state = store5 == null ? void 0 : store5.getState();
    if (selector2) return selector2(state);
    if (!state) return;
    if (!key) return;
    if (!hasOwnProperty(state, key)) return;
    return state[key];
  };
  return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreStateObject(store5, object) {
  const objRef = React32.useRef(
    {}
  );
  const storeSubscribe = React32.useCallback(
    (callback) => {
      if (!store5) return noopSubscribe();
      return subscribe(store5, null, callback);
    },
    [store5]
  );
  const getSnapshot = () => {
    const state = store5 == null ? void 0 : store5.getState();
    let updated = false;
    const obj = objRef.current;
    for (const prop in object) {
      const keyOrSelector = object[prop];
      if (typeof keyOrSelector === "function") {
        const value = keyOrSelector(state);
        if (value !== obj[prop]) {
          obj[prop] = value;
          updated = true;
        }
      }
      if (typeof keyOrSelector === "string") {
        if (!state) continue;
        if (!hasOwnProperty(state, keyOrSelector)) continue;
        const value = state[keyOrSelector];
        if (value !== obj[prop]) {
          obj[prop] = value;
          updated = true;
        }
      }
    }
    if (updated) {
      objRef.current = { ...obj };
    }
    return objRef.current;
  };
  return useSyncExternalStore(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreProps(store5, props, key, setKey) {
  const value = hasOwnProperty(props, key) ? props[key] : void 0;
  const setValue = setKey ? props[setKey] : void 0;
  const propsRef = useLiveRef({ value, setValue });
  useSafeLayoutEffect(() => {
    return sync(store5, [key], (state, prev) => {
      const { value: value2, setValue: setValue2 } = propsRef.current;
      if (!setValue2) return;
      if (state[key] === prev[key]) return;
      if (state[key] === value2) return;
      setValue2(state[key]);
    });
  }, [store5, key]);
  useSafeLayoutEffect(() => {
    if (value === void 0) return;
    store5.setState(key, value);
    return batch(store5, [key], () => {
      if (value === void 0) return;
      store5.setState(key, value);
    });
  });
}
function useStore(createStore2, props) {
  const [store5, setStore] = React32.useState(() => createStore2(props));
  useSafeLayoutEffect(() => init(store5), [store5]);
  const useState210 = React32.useCallback(
    (keyOrSelector) => useStoreState(store5, keyOrSelector),
    [store5]
  );
  const memoizedStore = React32.useMemo(
    () => ({ ...store5, useState: useState210 }),
    [store5, useState210]
  );
  const updateStore = useEvent(() => {
    setStore((store22) => createStore2({ ...props, ...store22.getState() }));
  });
  return [memoizedStore, updateStore];
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/WZWDIE3S.js
var import_react11 = __toESM(require_react(), 1);
var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
var TagName4 = "button";
function isEditableElement(element) {
  if (isTextbox(element)) return true;
  return element.tagName === "INPUT" && !isButton(element);
}
function getNextPageOffset(scrollingElement, pageUp = false) {
  const height = scrollingElement.clientHeight;
  const { top } = scrollingElement.getBoundingClientRect();
  const pageSize = Math.max(height * 0.875, height - 40) * 1.5;
  const pageOffset = pageUp ? height - pageSize + top : pageSize + top;
  if (scrollingElement.tagName === "HTML") {
    return pageOffset + scrollingElement.scrollTop;
  }
  return pageOffset;
}
function getItemOffset(itemElement, pageUp = false) {
  const { top } = itemElement.getBoundingClientRect();
  if (pageUp) {
    return top + itemElement.clientHeight;
  }
  return top;
}
function findNextPageItemId(element, store5, next, pageUp = false) {
  var _a;
  if (!store5) return;
  if (!next) return;
  const { renderedItems } = store5.getState();
  const scrollingElement = getScrollingElement(element);
  if (!scrollingElement) return;
  const nextPageOffset = getNextPageOffset(scrollingElement, pageUp);
  let id;
  let prevDifference;
  for (let i2 = 0; i2 < renderedItems.length; i2 += 1) {
    const previousId = id;
    id = next(i2);
    if (!id) break;
    if (id === previousId) continue;
    const itemElement = (_a = getEnabledItem(store5, id)) == null ? void 0 : _a.element;
    if (!itemElement) continue;
    const itemOffset = getItemOffset(itemElement, pageUp);
    const difference = itemOffset - nextPageOffset;
    const absDifference = Math.abs(difference);
    if (pageUp && difference <= 0 || !pageUp && difference >= 0) {
      if (prevDifference !== void 0 && prevDifference < absDifference) {
        id = previousId;
      }
      break;
    }
    prevDifference = absDifference;
  }
  return id;
}
function targetIsAnotherItem(event, store5) {
  if (isSelfTarget(event)) return false;
  return isItem(store5, event.target);
}
var useCompositeItem2 = createHook(
  function useCompositeItem22({
    store: store5,
    rowId: rowIdProp,
    preventScrollOnKeyDown = false,
    moveOnKeyPress = true,
    tabbable = false,
    getItem: getItemProp,
    "aria-setsize": ariaSetSizeProp,
    "aria-posinset": ariaPosInSetProp,
    ...props
  }) {
    const context = useCompositeContext();
    store5 = store5 || context;
    const id = useId4(props.id);
    const ref = (0, import_react11.useRef)(null);
    const row = (0, import_react11.useContext)(CompositeRowContext);
    const disabled2 = disabledFromProps(props);
    const trulyDisabled = disabled2 && !props.accessibleWhenDisabled;
    const {
      rowId,
      baseElement,
      isActiveItem,
      ariaSetSize,
      ariaPosInSet,
      isTabbable
    } = useStoreStateObject(store5, {
      rowId(state) {
        if (rowIdProp) return rowIdProp;
        if (!state) return;
        if (!(row == null ? void 0 : row.baseElement)) return;
        if (row.baseElement !== state.baseElement) return;
        return row.id;
      },
      baseElement(state) {
        return (state == null ? void 0 : state.baseElement) || void 0;
      },
      isActiveItem(state) {
        return !!state && state.activeId === id;
      },
      ariaSetSize(state) {
        if (ariaSetSizeProp != null) return ariaSetSizeProp;
        if (!state) return;
        if (!(row == null ? void 0 : row.ariaSetSize)) return;
        if (row.baseElement !== state.baseElement) return;
        return row.ariaSetSize;
      },
      ariaPosInSet(state) {
        if (ariaPosInSetProp != null) return ariaPosInSetProp;
        if (!state) return;
        if (!(row == null ? void 0 : row.ariaPosInSet)) return;
        if (row.baseElement !== state.baseElement) return;
        const itemsInRow = state.renderedItems.filter(
          (item) => item.rowId === rowId
        );
        return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id);
      },
      isTabbable(state) {
        if (!(state == null ? void 0 : state.renderedItems.length)) return true;
        if (state.virtualFocus) return false;
        if (tabbable) return true;
        if (state.activeId === null) return false;
        const item = store5 == null ? void 0 : store5.item(state.activeId);
        if (item == null ? void 0 : item.disabled) return true;
        if (!(item == null ? void 0 : item.element)) return true;
        return state.activeId === id;
      }
    });
    const getItem = (0, import_react11.useCallback)(
      (item) => {
        var _a;
        const nextItem = {
          ...item,
          id: id || item.id,
          rowId,
          disabled: !!trulyDisabled,
          children: (_a = item.element) == null ? void 0 : _a.textContent
        };
        if (getItemProp) {
          return getItemProp(nextItem);
        }
        return nextItem;
      },
      [id, rowId, trulyDisabled, getItemProp]
    );
    const onFocusProp = props.onFocus;
    const hasFocusedComposite = (0, import_react11.useRef)(false);
    const onFocus = useEvent((event) => {
      onFocusProp == null ? void 0 : onFocusProp(event);
      if (event.defaultPrevented) return;
      if (isPortalEvent(event)) return;
      if (!id) return;
      if (!store5) return;
      if (targetIsAnotherItem(event, store5)) return;
      const { virtualFocus, baseElement: baseElement2 } = store5.getState();
      store5.setActiveId(id);
      if (isTextbox(event.currentTarget)) {
        selectTextField(event.currentTarget);
      }
      if (!virtualFocus) return;
      if (!isSelfTarget(event)) return;
      if (isEditableElement(event.currentTarget)) return;
      if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
      if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) {
        event.currentTarget.scrollIntoView({
          block: "nearest",
          inline: "nearest"
        });
      }
      hasFocusedComposite.current = true;
      const fromComposite = event.relatedTarget === baseElement2 || isItem(store5, event.relatedTarget);
      if (fromComposite) {
        focusSilently(baseElement2);
      } else {
        baseElement2.focus();
      }
    });
    const onBlurCaptureProp = props.onBlurCapture;
    const onBlurCapture = useEvent((event) => {
      onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
      if (event.defaultPrevented) return;
      const state = store5 == null ? void 0 : store5.getState();
      if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) {
        hasFocusedComposite.current = false;
        event.preventDefault();
        event.stopPropagation();
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown);
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (event.defaultPrevented) return;
      if (!isSelfTarget(event)) return;
      if (!store5) return;
      const { currentTarget } = event;
      const state = store5.getState();
      const item = store5.item(id);
      const isGrid2 = !!(item == null ? void 0 : item.rowId);
      const isVertical = state.orientation !== "horizontal";
      const isHorizontal = state.orientation !== "vertical";
      const canHomeEnd = () => {
        if (isGrid2) return true;
        if (isHorizontal) return true;
        if (!state.baseElement) return true;
        if (!isTextField(state.baseElement)) return true;
        return false;
      };
      const keyMap = {
        ArrowUp: (isGrid2 || isVertical) && store5.up,
        ArrowRight: (isGrid2 || isHorizontal) && store5.next,
        ArrowDown: (isGrid2 || isVertical) && store5.down,
        ArrowLeft: (isGrid2 || isHorizontal) && store5.previous,
        Home: () => {
          if (!canHomeEnd()) return;
          if (!isGrid2 || event.ctrlKey) {
            return store5 == null ? void 0 : store5.first();
          }
          return store5 == null ? void 0 : store5.previous(-1);
        },
        End: () => {
          if (!canHomeEnd()) return;
          if (!isGrid2 || event.ctrlKey) {
            return store5 == null ? void 0 : store5.last();
          }
          return store5 == null ? void 0 : store5.next(-1);
        },
        PageUp: () => {
          return findNextPageItemId(currentTarget, store5, store5 == null ? void 0 : store5.up, true);
        },
        PageDown: () => {
          return findNextPageItemId(currentTarget, store5, store5 == null ? void 0 : store5.down);
        }
      };
      const action = keyMap[event.key];
      if (action) {
        if (isTextbox(currentTarget)) {
          const selection = getTextboxSelection(currentTarget);
          const isLeft = isHorizontal && event.key === "ArrowLeft";
          const isRight = isHorizontal && event.key === "ArrowRight";
          const isUp = isVertical && event.key === "ArrowUp";
          const isDown = isVertical && event.key === "ArrowDown";
          if (isRight || isDown) {
            const { length: valueLength } = getTextboxValue(currentTarget);
            if (selection.end !== valueLength) return;
          } else if ((isLeft || isUp) && selection.start !== 0) return;
        }
        const nextId = action();
        if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
          if (!moveOnKeyPressProp(event)) return;
          event.preventDefault();
          store5.move(nextId);
        }
      }
    });
    const providerValue = (0, import_react11.useMemo)(
      () => ({ id, baseElement }),
      [id, baseElement]
    );
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }),
      [providerValue]
    );
    props = {
      id,
      "data-active-item": isActiveItem || void 0,
      ...props,
      ref: useMergeRefs(ref, props.ref),
      tabIndex: isTabbable ? props.tabIndex : -1,
      onFocus,
      onBlurCapture,
      onKeyDown
    };
    props = useCommand(props);
    props = useCollectionItem({
      store: store5,
      ...props,
      getItem,
      shouldRegisterItem: id ? props.shouldRegisterItem : false
    });
    return removeUndefinedValues({
      ...props,
      "aria-setsize": ariaSetSize,
      "aria-posinset": ariaPosInSet
    });
  }
);
var CompositeItem = memo22(
  forwardRef22(function CompositeItem2(props) {
    const htmlProps = useCompositeItem2(props);
    return createElement3(TagName4, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js
function toArray(arg) {
  if (Array.isArray(arg)) {
    return arg;
  }
  return typeof arg !== "undefined" ? [arg] : [];
}
function flatten2DArray(array) {
  const flattened = [];
  for (const row of array) {
    flattened.push(...row);
  }
  return flattened;
}
function reverseArray(array) {
  return array.slice().reverse();
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/ZMWF7ASR.js
var import_react12 = __toESM(require_react(), 1);
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
var TagName5 = "div";
function isGrid(items) {
  return items.some((item) => !!item.rowId);
}
function isPrintableKey(event) {
  const target = event.target;
  if (target && !isTextField(target)) return false;
  return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
}
function isModifierKey(event) {
  return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
}
function useKeyboardEventProxy(store5, onKeyboardEvent, previousElementRef) {
  return useEvent((event) => {
    var _a;
    onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
    if (event.defaultPrevented) return;
    if (event.isPropagationStopped()) return;
    if (!isSelfTarget(event)) return;
    if (isModifierKey(event)) return;
    if (isPrintableKey(event)) return;
    const state = store5.getState();
    const activeElement2 = (_a = getEnabledItem(store5, state.activeId)) == null ? void 0 : _a.element;
    if (!activeElement2) return;
    const { view, ...eventInit } = event;
    const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
    if (activeElement2 !== previousElement) {
      activeElement2.focus();
    }
    if (!fireKeyboardEvent(activeElement2, event.type, eventInit)) {
      event.preventDefault();
    }
    if (event.currentTarget.contains(activeElement2)) {
      event.stopPropagation();
    }
  });
}
function findFirstEnabledItemInTheLastRow(items) {
  return findFirstEnabledItem(
    flatten2DArray(reverseArray(groupItemsByRows(items)))
  );
}
function useScheduleFocus(store5) {
  const [scheduled, setScheduled] = (0, import_react12.useState)(false);
  const schedule = (0, import_react12.useCallback)(() => setScheduled(true), []);
  const activeItem = store5.useState(
    (state) => getEnabledItem(store5, state.activeId)
  );
  (0, import_react12.useEffect)(() => {
    const activeElement2 = activeItem == null ? void 0 : activeItem.element;
    if (!scheduled) return;
    if (!activeElement2) return;
    setScheduled(false);
    activeElement2.focus({ preventScroll: true });
  }, [activeItem, scheduled]);
  return schedule;
}
var useComposite = createHook(
  function useComposite2({
    store: store5,
    composite = true,
    focusOnMove = composite,
    moveOnKeyPress = true,
    ...props
  }) {
    const context = useCompositeProviderContext();
    store5 = store5 || context;
    invariant(
      store5,
      "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
    );
    const ref = (0, import_react12.useRef)(null);
    const previousElementRef = (0, import_react12.useRef)(null);
    const scheduleFocus = useScheduleFocus(store5);
    const moves = store5.useState("moves");
    const [, setBaseElement] = useTransactionState(
      composite ? store5.setBaseElement : null
    );
    (0, import_react12.useEffect)(() => {
      var _a;
      if (!store5) return;
      if (!moves) return;
      if (!composite) return;
      if (!focusOnMove) return;
      const { activeId: activeId2 } = store5.getState();
      const itemElement = (_a = getEnabledItem(store5, activeId2)) == null ? void 0 : _a.element;
      if (!itemElement) return;
      focusIntoView(itemElement);
    }, [store5, moves, composite, focusOnMove]);
    useSafeLayoutEffect(() => {
      if (!store5) return;
      if (!moves) return;
      if (!composite) return;
      const { baseElement, activeId: activeId2 } = store5.getState();
      const isSelfAcive = activeId2 === null;
      if (!isSelfAcive) return;
      if (!baseElement) return;
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (previousElement) {
        fireBlurEvent(previousElement, { relatedTarget: baseElement });
      }
      if (!hasFocus(baseElement)) {
        baseElement.focus();
      }
    }, [store5, moves, composite]);
    const activeId = store5.useState("activeId");
    const virtualFocus = store5.useState("virtualFocus");
    useSafeLayoutEffect(() => {
      var _a;
      if (!store5) return;
      if (!composite) return;
      if (!virtualFocus) return;
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (!previousElement) return;
      const activeElement2 = (_a = getEnabledItem(store5, activeId)) == null ? void 0 : _a.element;
      const relatedTarget = activeElement2 || getActiveElement(previousElement);
      if (relatedTarget === previousElement) return;
      fireBlurEvent(previousElement, { relatedTarget });
    }, [store5, activeId, virtualFocus, composite]);
    const onKeyDownCapture = useKeyboardEventProxy(
      store5,
      props.onKeyDownCapture,
      previousElementRef
    );
    const onKeyUpCapture = useKeyboardEventProxy(
      store5,
      props.onKeyUpCapture,
      previousElementRef
    );
    const onFocusCaptureProp = props.onFocusCapture;
    const onFocusCapture = useEvent((event) => {
      onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!store5) return;
      const { virtualFocus: virtualFocus2 } = store5.getState();
      if (!virtualFocus2) return;
      const previousActiveElement = event.relatedTarget;
      const isSilentlyFocused = silentlyFocused(event.currentTarget);
      if (isSelfTarget(event) && isSilentlyFocused) {
        event.stopPropagation();
        previousElementRef.current = previousActiveElement;
      }
    });
    const onFocusProp = props.onFocus;
    const onFocus = useEvent((event) => {
      onFocusProp == null ? void 0 : onFocusProp(event);
      if (event.defaultPrevented) return;
      if (!composite) return;
      if (!store5) return;
      const { relatedTarget } = event;
      const { virtualFocus: virtualFocus2 } = store5.getState();
      if (virtualFocus2) {
        if (isSelfTarget(event) && !isItem(store5, relatedTarget)) {
          queueMicrotask(scheduleFocus);
        }
      } else if (isSelfTarget(event)) {
        store5.setActiveId(null);
      }
    });
    const onBlurCaptureProp = props.onBlurCapture;
    const onBlurCapture = useEvent((event) => {
      var _a;
      onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!store5) return;
      const { virtualFocus: virtualFocus2, activeId: activeId2 } = store5.getState();
      if (!virtualFocus2) return;
      const activeElement2 = (_a = getEnabledItem(store5, activeId2)) == null ? void 0 : _a.element;
      const nextActiveElement = event.relatedTarget;
      const nextActiveElementIsItem = isItem(store5, nextActiveElement);
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (isSelfTarget(event) && nextActiveElementIsItem) {
        if (nextActiveElement === activeElement2) {
          if (previousElement && previousElement !== nextActiveElement) {
            fireBlurEvent(previousElement, event);
          }
        } else if (activeElement2) {
          fireBlurEvent(activeElement2, event);
        } else if (previousElement) {
          fireBlurEvent(previousElement, event);
        }
        event.stopPropagation();
      } else {
        const targetIsItem = isItem(store5, event.target);
        if (!targetIsItem && activeElement2) {
          fireBlurEvent(activeElement2, event);
        }
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const onKeyDown = useEvent((event) => {
      var _a;
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (event.nativeEvent.isComposing) return;
      if (event.defaultPrevented) return;
      if (!store5) return;
      if (!isSelfTarget(event)) return;
      const { orientation, renderedItems, activeId: activeId2 } = store5.getState();
      const activeItem = getEnabledItem(store5, activeId2);
      if ((_a = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a.isConnected) return;
      const isVertical = orientation !== "horizontal";
      const isHorizontal = orientation !== "vertical";
      const grid = isGrid(renderedItems);
      const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End";
      if (isHorizontalKey && isTextField(event.currentTarget)) return;
      const up = () => {
        if (grid) {
          const item = findFirstEnabledItemInTheLastRow(renderedItems);
          return item == null ? void 0 : item.id;
        }
        return store5 == null ? void 0 : store5.last();
      };
      const keyMap = {
        ArrowUp: (grid || isVertical) && up,
        ArrowRight: (grid || isHorizontal) && store5.first,
        ArrowDown: (grid || isVertical) && store5.first,
        ArrowLeft: (grid || isHorizontal) && store5.last,
        Home: store5.first,
        End: store5.last,
        PageUp: store5.first,
        PageDown: store5.last
      };
      const action = keyMap[event.key];
      if (action) {
        const id = action();
        if (id !== void 0) {
          if (!moveOnKeyPressProp(event)) return;
          event.preventDefault();
          store5.move(id);
        }
      }
    });
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(CompositeContextProvider, { value: store5, children: element }),
      [store5]
    );
    const activeDescendant = store5.useState((state) => {
      var _a;
      if (!store5) return;
      if (!composite) return;
      if (!state.virtualFocus) return;
      return (_a = getEnabledItem(store5, state.activeId)) == null ? void 0 : _a.id;
    });
    props = {
      "aria-activedescendant": activeDescendant,
      ...props,
      ref: useMergeRefs(ref, setBaseElement, props.ref),
      onKeyDownCapture,
      onKeyUpCapture,
      onFocusCapture,
      onFocus,
      onBlurCapture,
      onKeyDown
    };
    const focusable = store5.useState(
      (state) => composite && (state.virtualFocus || state.activeId === null)
    );
    props = useFocusable({ focusable, ...props });
    return props;
  }
);
var Composite5 = forwardRef22(function Composite22(props) {
  const htmlProps = useComposite(props);
  return createElement3(TagName5, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/LVDQFHCH.js
var ctx3 = createStoreContext();
var useDisclosureContext = ctx3.useContext;
var useDisclosureScopedContext = ctx3.useScopedContext;
var useDisclosureProviderContext = ctx3.useProviderContext;
var DisclosureContextProvider = ctx3.ContextProvider;
var DisclosureScopedContextProvider = ctx3.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/A62MDFCW.js
var import_react13 = __toESM(require_react(), 1);
var ctx4 = createStoreContext(
  [DisclosureContextProvider],
  [DisclosureScopedContextProvider]
);
var useDialogContext = ctx4.useContext;
var useDialogScopedContext = ctx4.useScopedContext;
var useDialogProviderContext = ctx4.useProviderContext;
var DialogContextProvider = ctx4.ContextProvider;
var DialogScopedContextProvider = ctx4.ScopedContextProvider;
var DialogHeadingContext = (0, import_react13.createContext)(void 0);
var DialogDescriptionContext = (0, import_react13.createContext)(void 0);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/6B3RXHKP.js
var import_react14 = __toESM(require_react(), 1);
var import_react_dom = __toESM(require_react_dom(), 1);
var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
var TagName6 = "div";
function afterTimeout(timeoutMs, cb) {
  const timeoutId = setTimeout(cb, timeoutMs);
  return () => clearTimeout(timeoutId);
}
function afterPaint2(cb) {
  let raf = requestAnimationFrame(() => {
    raf = requestAnimationFrame(cb);
  });
  return () => cancelAnimationFrame(raf);
}
function parseCSSTime(...times) {
  return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
    const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
    const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
    if (currentTime > longestTime) return currentTime;
    return longestTime;
  }, 0);
}
function isHidden(mounted, hidden, alwaysVisible) {
  return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
}
var useDisclosureContent = createHook(function useDisclosureContent2({ store: store5, alwaysVisible, ...props }) {
  const context = useDisclosureProviderContext();
  store5 = store5 || context;
  invariant(
    store5,
    "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
  );
  const ref = (0, import_react14.useRef)(null);
  const id = useId4(props.id);
  const [transition, setTransition] = (0, import_react14.useState)(null);
  const open = store5.useState("open");
  const mounted = store5.useState("mounted");
  const animated = store5.useState("animated");
  const contentElement = store5.useState("contentElement");
  const otherElement = useStoreState(store5.disclosure, "contentElement");
  useSafeLayoutEffect(() => {
    if (!ref.current) return;
    store5 == null ? void 0 : store5.setContentElement(ref.current);
  }, [store5]);
  useSafeLayoutEffect(() => {
    let previousAnimated;
    store5 == null ? void 0 : store5.setState("animated", (animated2) => {
      previousAnimated = animated2;
      return true;
    });
    return () => {
      if (previousAnimated === void 0) return;
      store5 == null ? void 0 : store5.setState("animated", previousAnimated);
    };
  }, [store5]);
  useSafeLayoutEffect(() => {
    if (!animated) return;
    if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
      setTransition(null);
      return;
    }
    return afterPaint2(() => {
      setTransition(open ? "enter" : mounted ? "leave" : null);
    });
  }, [animated, contentElement, open, mounted]);
  useSafeLayoutEffect(() => {
    if (!store5) return;
    if (!animated) return;
    if (!transition) return;
    if (!contentElement) return;
    const stopAnimation = () => store5 == null ? void 0 : store5.setState("animating", false);
    const stopAnimationSync = () => (0, import_react_dom.flushSync)(stopAnimation);
    if (transition === "leave" && open) return;
    if (transition === "enter" && !open) return;
    if (typeof animated === "number") {
      const timeout2 = animated;
      return afterTimeout(timeout2, stopAnimationSync);
    }
    const {
      transitionDuration,
      animationDuration,
      transitionDelay,
      animationDelay
    } = getComputedStyle(contentElement);
    const {
      transitionDuration: transitionDuration2 = "0",
      animationDuration: animationDuration2 = "0",
      transitionDelay: transitionDelay2 = "0",
      animationDelay: animationDelay2 = "0"
    } = otherElement ? getComputedStyle(otherElement) : {};
    const delay = parseCSSTime(
      transitionDelay,
      animationDelay,
      transitionDelay2,
      animationDelay2
    );
    const duration = parseCSSTime(
      transitionDuration,
      animationDuration,
      transitionDuration2,
      animationDuration2
    );
    const timeout = delay + duration;
    if (!timeout) {
      if (transition === "enter") {
        store5.setState("animated", false);
      }
      stopAnimation();
      return;
    }
    const frameRate = 1e3 / 60;
    const maxTimeout = Math.max(timeout - frameRate, 0);
    return afterTimeout(maxTimeout, stopAnimationSync);
  }, [store5, animated, contentElement, otherElement, open, transition]);
  props = useWrapElement(
    props,
    (element) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DialogScopedContextProvider, { value: store5, children: element }),
    [store5]
  );
  const hidden = isHidden(mounted, props.hidden, alwaysVisible);
  const styleProp = props.style;
  const style = (0, import_react14.useMemo)(() => {
    if (hidden) {
      return { ...styleProp, display: "none" };
    }
    return styleProp;
  }, [hidden, styleProp]);
  props = {
    id,
    "data-open": open || void 0,
    "data-enter": transition === "enter" || void 0,
    "data-leave": transition === "leave" || void 0,
    hidden,
    ...props,
    ref: useMergeRefs(id ? store5.setContentElement : null, ref, props.ref),
    style
  };
  return removeUndefinedValues(props);
});
var DisclosureContentImpl = forwardRef22(function DisclosureContentImpl2(props) {
  const htmlProps = useDisclosureContent(props);
  return createElement3(TagName6, htmlProps);
});
var DisclosureContent = forwardRef22(function DisclosureContent2({
  unmountOnHide,
  ...props
}) {
  const context = useDisclosureProviderContext();
  const store5 = props.store || context;
  const mounted = useStoreState(
    store5,
    (state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
  );
  if (mounted === false) return null;
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DisclosureContentImpl, { ...props });
});

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/75BJEVSH.js
function createDisclosureStore(props = {}) {
  const store5 = mergeStore(
    props.store,
    omit2(props.disclosure, ["contentElement", "disclosureElement"])
  );
  throwOnConflictingProps(props, store5);
  const syncState = store5 == null ? void 0 : store5.getState();
  const open = defaultValue(
    props.open,
    syncState == null ? void 0 : syncState.open,
    props.defaultOpen,
    false
  );
  const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false);
  const initialState4 = {
    open,
    animated,
    animating: !!animated && open,
    mounted: open,
    contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null),
    disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null)
  };
  const disclosure = createStore(initialState4, store5);
  setup(
    disclosure,
    () => sync(disclosure, ["animated", "animating"], (state) => {
      if (state.animated) return;
      disclosure.setState("animating", false);
    })
  );
  setup(
    disclosure,
    () => subscribe(disclosure, ["open"], () => {
      if (!disclosure.getState().animated) return;
      disclosure.setState("animating", true);
    })
  );
  setup(
    disclosure,
    () => sync(disclosure, ["open", "animating"], (state) => {
      disclosure.setState("mounted", state.open || state.animating);
    })
  );
  return {
    ...disclosure,
    disclosure: props.disclosure,
    setOpen: (value) => disclosure.setState("open", value),
    show: () => disclosure.setState("open", true),
    hide: () => disclosure.setState("open", false),
    toggle: () => disclosure.setState("open", (open2) => !open2),
    stopAnimation: () => disclosure.setState("animating", false),
    setContentElement: (value) => disclosure.setState("contentElement", value),
    setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/WLZ6H5FH.js
function useDisclosureStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.store, props.disclosure]);
  useStoreProps(store5, props, "open", "setOpen");
  useStoreProps(store5, props, "mounted", "setMounted");
  useStoreProps(store5, props, "animated");
  return Object.assign(store5, { disclosure: props.disclosure });
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/JMU4N4M5.js
var ctx5 = createStoreContext(
  [DialogContextProvider],
  [DialogScopedContextProvider]
);
var usePopoverContext = ctx5.useContext;
var usePopoverScopedContext = ctx5.useScopedContext;
var usePopoverProviderContext = ctx5.useProviderContext;
var PopoverContextProvider = ctx5.ContextProvider;
var PopoverScopedContextProvider = ctx5.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/N5XGANPW.js
function getCommonParent(items) {
  var _a;
  const firstItem = items.find((item) => !!item.element);
  const lastItem = [...items].reverse().find((item) => !!item.element);
  let parentElement = (_a = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _a.parentElement;
  while (parentElement && (lastItem == null ? void 0 : lastItem.element)) {
    const parent = parentElement;
    if (lastItem && parent.contains(lastItem.element)) {
      return parentElement;
    }
    parentElement = parentElement.parentElement;
  }
  return getDocument(parentElement).body;
}
function getPrivateStore(store5) {
  return store5 == null ? void 0 : store5.__unstablePrivateStore;
}
function createCollectionStore(props = {}) {
  var _a;
  throwOnConflictingProps(props, props.store);
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
  const items = defaultValue(
    props.items,
    syncState == null ? void 0 : syncState.items,
    props.defaultItems,
    []
  );
  const itemsMap = new Map(items.map((item) => [item.id, item]));
  const initialState4 = {
    items,
    renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, [])
  };
  const syncPrivateStore = getPrivateStore(props.store);
  const privateStore = createStore(
    { items, renderedItems: initialState4.renderedItems },
    syncPrivateStore
  );
  const collection = createStore(initialState4, props.store);
  const sortItems = (renderedItems) => {
    const sortedItems = sortBasedOnDOMPosition(renderedItems, (i2) => i2.element);
    privateStore.setState("renderedItems", sortedItems);
    collection.setState("renderedItems", sortedItems);
  };
  setup(collection, () => init(privateStore));
  setup(privateStore, () => {
    return batch(privateStore, ["items"], (state) => {
      collection.setState("items", state.items);
    });
  });
  setup(privateStore, () => {
    return batch(privateStore, ["renderedItems"], (state) => {
      let firstRun = true;
      let raf = requestAnimationFrame(() => {
        const { renderedItems } = collection.getState();
        if (state.renderedItems === renderedItems) return;
        sortItems(state.renderedItems);
      });
      if (typeof IntersectionObserver !== "function") {
        return () => cancelAnimationFrame(raf);
      }
      const ioCallback = () => {
        if (firstRun) {
          firstRun = false;
          return;
        }
        cancelAnimationFrame(raf);
        raf = requestAnimationFrame(() => sortItems(state.renderedItems));
      };
      const root = getCommonParent(state.renderedItems);
      const observer = new IntersectionObserver(ioCallback, { root });
      for (const item of state.renderedItems) {
        if (!item.element) continue;
        observer.observe(item.element);
      }
      return () => {
        cancelAnimationFrame(raf);
        observer.disconnect();
      };
    });
  });
  const mergeItem = (item, setItems, canDeleteFromMap = false) => {
    let prevItem;
    setItems((items2) => {
      const index = items2.findIndex(({ id }) => id === item.id);
      const nextItems = items2.slice();
      if (index !== -1) {
        prevItem = items2[index];
        const nextItem = { ...prevItem, ...item };
        nextItems[index] = nextItem;
        itemsMap.set(item.id, nextItem);
      } else {
        nextItems.push(item);
        itemsMap.set(item.id, item);
      }
      return nextItems;
    });
    const unmergeItem = () => {
      setItems((items2) => {
        if (!prevItem) {
          if (canDeleteFromMap) {
            itemsMap.delete(item.id);
          }
          return items2.filter(({ id }) => id !== item.id);
        }
        const index = items2.findIndex(({ id }) => id === item.id);
        if (index === -1) return items2;
        const nextItems = items2.slice();
        nextItems[index] = prevItem;
        itemsMap.set(item.id, prevItem);
        return nextItems;
      });
    };
    return unmergeItem;
  };
  const registerItem = (item) => mergeItem(
    item,
    (getItems) => privateStore.setState("items", getItems),
    true
  );
  return {
    ...collection,
    registerItem,
    renderItem: (item) => chain(
      registerItem(item),
      mergeItem(
        item,
        (getItems) => privateStore.setState("renderedItems", getItems)
      )
    ),
    item: (id) => {
      if (!id) return null;
      let item = itemsMap.get(id);
      if (!item) {
        const { items: items2 } = privateStore.getState();
        item = items2.find((item2) => item2.id === id);
        if (item) {
          itemsMap.set(id, item);
        }
      }
      return item || null;
    },
    // @ts-expect-error Internal
    __unstablePrivateStore: privateStore
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/GVAFFF2B.js
function useCollectionStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.store]);
  useStoreProps(store5, props, "items", "setItems");
  return store5;
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/RVTIKFRL.js
var NULL_ITEM = { id: null };
function findFirstEnabledItem2(items, excludeId) {
  return items.find((item) => {
    if (excludeId) {
      return !item.disabled && item.id !== excludeId;
    }
    return !item.disabled;
  });
}
function getEnabledItems(items, excludeId) {
  return items.filter((item) => {
    if (excludeId) {
      return !item.disabled && item.id !== excludeId;
    }
    return !item.disabled;
  });
}
function getItemsInRow(items, rowId) {
  return items.filter((item) => item.rowId === rowId);
}
function flipItems(items, activeId, shouldInsertNullItem = false) {
  const index = items.findIndex((item) => item.id === activeId);
  return [
    ...items.slice(index + 1),
    ...shouldInsertNullItem ? [NULL_ITEM] : [],
    ...items.slice(0, index)
  ];
}
function groupItemsByRows2(items) {
  const rows = [];
  for (const item of items) {
    const row = rows.find((currentRow) => {
      var _a;
      return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
    });
    if (row) {
      row.push(item);
    } else {
      rows.push([item]);
    }
  }
  return rows;
}
function getMaxRowLength(array) {
  let maxLength = 0;
  for (const { length } of array) {
    if (length > maxLength) {
      maxLength = length;
    }
  }
  return maxLength;
}
function createEmptyItem(rowId) {
  return {
    id: "__EMPTY_ITEM__",
    disabled: true,
    rowId
  };
}
function normalizeRows(rows, activeId, focusShift) {
  const maxLength = getMaxRowLength(rows);
  for (const row of rows) {
    for (let i2 = 0; i2 < maxLength; i2 += 1) {
      const item = row[i2];
      if (!item || focusShift && item.disabled) {
        const isFirst = i2 === 0;
        const previousItem = isFirst && focusShift ? findFirstEnabledItem2(row) : row[i2 - 1];
        row[i2] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
      }
    }
  }
  return rows;
}
function verticalizeItems(items) {
  const rows = groupItemsByRows2(items);
  const maxLength = getMaxRowLength(rows);
  const verticalized = [];
  for (let i2 = 0; i2 < maxLength; i2 += 1) {
    for (const row of rows) {
      const item = row[i2];
      if (item) {
        verticalized.push({
          ...item,
          // If there's no rowId, it means that it's not a grid composite, but
          // a single row instead. So, instead of verticalizing it, that is,
          // assigning a different rowId based on the column index, we keep it
          // undefined so they will be part of the same row. This is useful
          // when using up/down on one-dimensional composites.
          rowId: item.rowId ? `${i2}` : void 0
        });
      }
    }
  }
  return verticalized;
}
function createCompositeStore(props = {}) {
  var _a;
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
  const collection = createCollectionStore(props);
  const activeId = defaultValue(
    props.activeId,
    syncState == null ? void 0 : syncState.activeId,
    props.defaultActiveId
  );
  const initialState4 = {
    ...collection.getState(),
    id: defaultValue(
      props.id,
      syncState == null ? void 0 : syncState.id,
      `id-${Math.random().toString(36).slice(2, 8)}`
    ),
    activeId,
    baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),
    includesBaseElement: defaultValue(
      props.includesBaseElement,
      syncState == null ? void 0 : syncState.includesBaseElement,
      activeId === null
    ),
    moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0),
    orientation: defaultValue(
      props.orientation,
      syncState == null ? void 0 : syncState.orientation,
      "both"
    ),
    rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
    virtualFocus: defaultValue(
      props.virtualFocus,
      syncState == null ? void 0 : syncState.virtualFocus,
      false
    ),
    focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
    focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
    focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
  };
  const composite = createStore(initialState4, collection, props.store);
  setup(
    composite,
    () => sync(composite, ["renderedItems", "activeId"], (state) => {
      composite.setState("activeId", (activeId2) => {
        var _a2;
        if (activeId2 !== void 0) return activeId2;
        return (_a2 = findFirstEnabledItem2(state.renderedItems)) == null ? void 0 : _a2.id;
      });
    })
  );
  const getNextId = (direction = "next", options = {}) => {
    var _a2, _b;
    const defaultState2 = composite.getState();
    const {
      skip = 0,
      activeId: activeId2 = defaultState2.activeId,
      focusShift = defaultState2.focusShift,
      focusLoop = defaultState2.focusLoop,
      focusWrap = defaultState2.focusWrap,
      includesBaseElement = defaultState2.includesBaseElement,
      renderedItems = defaultState2.renderedItems,
      rtl = defaultState2.rtl
    } = options;
    const isVerticalDirection = direction === "up" || direction === "down";
    const isNextDirection = direction === "next" || direction === "down";
    const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
    const canShift = focusShift && !skip;
    let items = !isVerticalDirection ? renderedItems : flatten2DArray(
      normalizeRows(groupItemsByRows2(renderedItems), activeId2, canShift)
    );
    items = canReverse ? reverseArray(items) : items;
    items = isVerticalDirection ? verticalizeItems(items) : items;
    if (activeId2 == null) {
      return (_a2 = findFirstEnabledItem2(items)) == null ? void 0 : _a2.id;
    }
    const activeItem = items.find((item) => item.id === activeId2);
    if (!activeItem) {
      return (_b = findFirstEnabledItem2(items)) == null ? void 0 : _b.id;
    }
    const isGrid2 = items.some((item) => item.rowId);
    const activeIndex = items.indexOf(activeItem);
    const nextItems = items.slice(activeIndex + 1);
    const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
    if (skip) {
      const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
      const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
      nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
      return nextItem2 == null ? void 0 : nextItem2.id;
    }
    const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
    const canWrap = isGrid2 && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
    const hasNullItem = isNextDirection ? (!isGrid2 || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
    if (canLoop) {
      const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
      const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
      const nextItem2 = findFirstEnabledItem2(sortedItems, activeId2);
      return nextItem2 == null ? void 0 : nextItem2.id;
    }
    if (canWrap) {
      const nextItem2 = findFirstEnabledItem2(
        // We can use nextItems, which contains all the next items, including
        // items from other rows, to wrap between rows. However, if there is a
        // null item (the composite container), we'll only use the next items in
        // the row. So moving next from the last item will focus on the
        // composite container. On grid composites, horizontal navigation never
        // focuses on the composite container, only vertical.
        hasNullItem ? nextItemsInRow : nextItems,
        activeId2
      );
      const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;
      return nextId;
    }
    const nextItem = findFirstEnabledItem2(nextItemsInRow, activeId2);
    if (!nextItem && hasNullItem) {
      return null;
    }
    return nextItem == null ? void 0 : nextItem.id;
  };
  return {
    ...collection,
    ...composite,
    setBaseElement: (element) => composite.setState("baseElement", element),
    setActiveId: (id) => composite.setState("activeId", id),
    move: (id) => {
      if (id === void 0) return;
      composite.setState("activeId", id);
      composite.setState("moves", (moves) => moves + 1);
    },
    first: () => {
      var _a2;
      return (_a2 = findFirstEnabledItem2(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
    },
    last: () => {
      var _a2;
      return (_a2 = findFirstEnabledItem2(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
    },
    next: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("next", options);
    },
    previous: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("previous", options);
    },
    down: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("down", options);
    },
    up: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("up", options);
    }
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/IQYAUKXT.js
function useCompositeStoreOptions(props) {
  const id = useId4(props.id);
  return { id, ...props };
}
function useCompositeStoreProps(store5, update2, props) {
  store5 = useCollectionStoreProps(store5, update2, props);
  useStoreProps(store5, props, "activeId", "setActiveId");
  useStoreProps(store5, props, "includesBaseElement");
  useStoreProps(store5, props, "virtualFocus");
  useStoreProps(store5, props, "orientation");
  useStoreProps(store5, props, "rtl");
  useStoreProps(store5, props, "focusLoop");
  useStoreProps(store5, props, "focusWrap");
  useStoreProps(store5, props, "focusShift");
  return store5;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/CVCFNOHX.js
var import_react15 = __toESM(require_react(), 1);
var ComboboxListRoleContext = (0, import_react15.createContext)(
  void 0
);
var ctx6 = createStoreContext(
  [PopoverContextProvider, CompositeContextProvider],
  [PopoverScopedContextProvider, CompositeScopedContextProvider]
);
var useComboboxContext = ctx6.useContext;
var useComboboxScopedContext = ctx6.useScopedContext;
var useComboboxProviderContext = ctx6.useProviderContext;
var ComboboxContextProvider = ctx6.ContextProvider;
var ComboboxScopedContextProvider = ctx6.ScopedContextProvider;
var ComboboxItemValueContext = (0, import_react15.createContext)(
  void 0
);
var ComboboxItemCheckedContext = (0, import_react15.createContext)(false);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/KMAUV3TY.js
function createDialogStore(props = {}) {
  return createDisclosureStore(props);
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/4NYSH4UO.js
function useDialogStoreProps(store5, update2, props) {
  return useDisclosureStoreProps(store5, update2, props);
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/__chunks/BFGNM53A.js
function createPopoverStore({
  popover: otherPopover,
  ...props
} = {}) {
  const store5 = mergeStore(
    props.store,
    omit2(otherPopover, [
      "arrowElement",
      "anchorElement",
      "contentElement",
      "popoverElement",
      "disclosureElement"
    ])
  );
  throwOnConflictingProps(props, store5);
  const syncState = store5 == null ? void 0 : store5.getState();
  const dialog = createDialogStore({ ...props, store: store5 });
  const placement = defaultValue(
    props.placement,
    syncState == null ? void 0 : syncState.placement,
    "bottom"
  );
  const initialState4 = {
    ...dialog.getState(),
    placement,
    currentPlacement: placement,
    anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null),
    popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null),
    arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null),
    rendered: /* @__PURE__ */ Symbol("rendered")
  };
  const popover = createStore(initialState4, dialog, store5);
  return {
    ...dialog,
    ...popover,
    setAnchorElement: (element) => popover.setState("anchorElement", element),
    setPopoverElement: (element) => popover.setState("popoverElement", element),
    setArrowElement: (element) => popover.setState("arrowElement", element),
    render: () => popover.setState("rendered", /* @__PURE__ */ Symbol("rendered"))
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/B6FLPFJM.js
function usePopoverStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.popover]);
  useStoreProps(store5, props, "placement");
  return useDialogStoreProps(store5, update2, props);
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/4POTBZ2J.js
var TagName7 = "div";
var usePopoverAnchor = createHook(
  function usePopoverAnchor2({ store: store5, ...props }) {
    const context = usePopoverProviderContext();
    store5 = store5 || context;
    props = {
      ...props,
      ref: useMergeRefs(store5 == null ? void 0 : store5.setAnchorElement, props.ref)
    };
    return props;
  }
);
var PopoverAnchor = forwardRef22(function PopoverAnchor2(props) {
  const htmlProps = usePopoverAnchor(props);
  return createElement3(TagName7, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/X6LNAU2F.js
var import_react16 = __toESM(require_react(), 1);
var TagName8 = "div";
function getMouseDestination(event) {
  const relatedTarget = event.relatedTarget;
  if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) {
    return relatedTarget;
  }
  return null;
}
function hoveringInside(event) {
  const nextElement = getMouseDestination(event);
  if (!nextElement) return false;
  return contains2(event.currentTarget, nextElement);
}
var symbol2 = /* @__PURE__ */ Symbol("composite-hover");
function movingToAnotherItem(event) {
  let dest = getMouseDestination(event);
  if (!dest) return false;
  do {
    if (hasOwnProperty(dest, symbol2) && dest[symbol2]) return true;
    dest = dest.parentElement;
  } while (dest);
  return false;
}
var useCompositeHover = createHook(
  function useCompositeHover2({
    store: store5,
    focusOnHover = true,
    blurOnHoverEnd = !!focusOnHover,
    ...props
  }) {
    const context = useCompositeContext();
    store5 = store5 || context;
    invariant(
      store5,
      "CompositeHover must be wrapped in a Composite component."
    );
    const isMouseMoving = useIsMouseMoving();
    const onMouseMoveProp = props.onMouseMove;
    const focusOnHoverProp = useBooleanEvent(focusOnHover);
    const onMouseMove = useEvent((event) => {
      onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
      if (event.defaultPrevented) return;
      if (!isMouseMoving()) return;
      if (!focusOnHoverProp(event)) return;
      if (!hasFocusWithin(event.currentTarget)) {
        const baseElement = store5 == null ? void 0 : store5.getState().baseElement;
        if (baseElement && !hasFocus(baseElement)) {
          baseElement.focus();
        }
      }
      store5 == null ? void 0 : store5.setActiveId(event.currentTarget.id);
    });
    const onMouseLeaveProp = props.onMouseLeave;
    const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd);
    const onMouseLeave = useEvent((event) => {
      var _a;
      onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event);
      if (event.defaultPrevented) return;
      if (!isMouseMoving()) return;
      if (hoveringInside(event)) return;
      if (movingToAnotherItem(event)) return;
      if (!focusOnHoverProp(event)) return;
      if (!blurOnHoverEndProp(event)) return;
      store5 == null ? void 0 : store5.setActiveId(null);
      (_a = store5 == null ? void 0 : store5.getState().baseElement) == null ? void 0 : _a.focus();
    });
    const ref = (0, import_react16.useCallback)((element) => {
      if (!element) return;
      element[symbol2] = true;
    }, []);
    props = {
      ...props,
      ref: useMergeRefs(ref, props.ref),
      onMouseMove,
      onMouseLeave
    };
    return removeUndefinedValues(props);
  }
);
var CompositeHover = memo22(
  forwardRef22(function CompositeHover2(props) {
    const htmlProps = useCompositeHover(props);
    return createElement3(TagName8, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox.js
var import_react17 = __toESM(require_react(), 1);
var TagName9 = "input";
function isFirstItemAutoSelected(items, activeValue, autoSelect) {
  if (!autoSelect) return false;
  const firstItem = items.find((item) => !item.disabled && item.value);
  return (firstItem == null ? void 0 : firstItem.value) === activeValue;
}
function hasCompletionString(value, activeValue) {
  if (!activeValue) return false;
  if (value == null) return false;
  value = normalizeString(value);
  return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0;
}
function isInputEvent(event) {
  return event.type === "input";
}
function isAriaAutoCompleteValue(value) {
  return value === "inline" || value === "list" || value === "both" || value === "none";
}
function getDefaultAutoSelectId(items) {
  const item = items.find((item2) => {
    var _a;
    if (item2.disabled) return false;
    return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab";
  });
  return item == null ? void 0 : item.id;
}
var useCombobox = createHook(
  function useCombobox2({
    store: store5,
    focusable = true,
    autoSelect: autoSelectProp = false,
    getAutoSelectId,
    setValueOnChange,
    showMinLength = 0,
    showOnChange,
    showOnMouseDown,
    showOnClick = showOnMouseDown,
    showOnKeyDown,
    showOnKeyPress = showOnKeyDown,
    blurActiveItemOnClick,
    setValueOnClick = true,
    moveOnKeyPress = true,
    autoComplete = "list",
    ...props
  }) {
    const context = useComboboxProviderContext();
    store5 = store5 || context;
    invariant(
      store5,
      "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
    );
    const ref = (0, import_react17.useRef)(null);
    const [valueUpdated, forceValueUpdate] = useForceUpdate();
    const canAutoSelectRef = (0, import_react17.useRef)(false);
    const composingRef = (0, import_react17.useRef)(false);
    const autoSelect = store5.useState(
      (state) => state.virtualFocus && autoSelectProp
    );
    const inline = autoComplete === "inline" || autoComplete === "both";
    const [canInline, setCanInline] = (0, import_react17.useState)(inline);
    useUpdateLayoutEffect(() => {
      if (!inline) return;
      setCanInline(true);
    }, [inline]);
    const storeValue = store5.useState("value");
    const prevSelectedValueRef = (0, import_react17.useRef)(void 0);
    (0, import_react17.useEffect)(() => {
      return sync(store5, ["selectedValue", "activeId"], (_, prev) => {
        prevSelectedValueRef.current = prev.selectedValue;
      });
    }, []);
    const inlineActiveValue = store5.useState((state) => {
      var _a;
      if (!inline) return;
      if (!canInline) return;
      if (state.activeValue && Array.isArray(state.selectedValue)) {
        if (state.selectedValue.includes(state.activeValue)) return;
        if ((_a = prevSelectedValueRef.current) == null ? void 0 : _a.includes(state.activeValue)) return;
      }
      return state.activeValue;
    });
    const items = store5.useState("renderedItems");
    const open = store5.useState("open");
    const contentElement = store5.useState("contentElement");
    const value = (0, import_react17.useMemo)(() => {
      if (!inline) return storeValue;
      if (!canInline) return storeValue;
      const firstItemAutoSelected = isFirstItemAutoSelected(
        items,
        inlineActiveValue,
        autoSelect
      );
      if (firstItemAutoSelected) {
        if (hasCompletionString(storeValue, inlineActiveValue)) {
          const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || "";
          return storeValue + slice;
        }
        return storeValue;
      }
      return inlineActiveValue || storeValue;
    }, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]);
    (0, import_react17.useEffect)(() => {
      const element = ref.current;
      if (!element) return;
      const onCompositeItemMove = () => setCanInline(true);
      element.addEventListener("combobox-item-move", onCompositeItemMove);
      return () => {
        element.removeEventListener("combobox-item-move", onCompositeItemMove);
      };
    }, []);
    (0, import_react17.useEffect)(() => {
      if (!inline) return;
      if (!canInline) return;
      if (!inlineActiveValue) return;
      const firstItemAutoSelected = isFirstItemAutoSelected(
        items,
        inlineActiveValue,
        autoSelect
      );
      if (!firstItemAutoSelected) return;
      if (!hasCompletionString(storeValue, inlineActiveValue)) return;
      let cleanup = noop2;
      queueMicrotask(() => {
        const element = ref.current;
        if (!element) return;
        const { start: prevStart, end: prevEnd } = getTextboxSelection(element);
        const nextStart = storeValue.length;
        const nextEnd = inlineActiveValue.length;
        setSelectionRange(element, nextStart, nextEnd);
        cleanup = () => {
          if (!hasFocus(element)) return;
          const { start, end } = getTextboxSelection(element);
          if (start !== nextStart) return;
          if (end !== nextEnd) return;
          setSelectionRange(element, prevStart, prevEnd);
        };
      });
      return () => cleanup();
    }, [
      valueUpdated,
      inline,
      canInline,
      inlineActiveValue,
      items,
      autoSelect,
      storeValue
    ]);
    const scrollingElementRef = (0, import_react17.useRef)(null);
    const getAutoSelectIdProp = useEvent(getAutoSelectId);
    const autoSelectIdRef = (0, import_react17.useRef)(null);
    (0, import_react17.useEffect)(() => {
      if (!open) return;
      if (!contentElement) return;
      const scrollingElement = getScrollingElement(contentElement);
      if (!scrollingElement) return;
      scrollingElementRef.current = scrollingElement;
      const onUserScroll = () => {
        canAutoSelectRef.current = false;
      };
      const onScroll = () => {
        if (!store5) return;
        if (!canAutoSelectRef.current) return;
        const { activeId } = store5.getState();
        if (activeId === null) return;
        if (activeId === autoSelectIdRef.current) return;
        canAutoSelectRef.current = false;
      };
      const options = { passive: true, capture: true };
      scrollingElement.addEventListener("wheel", onUserScroll, options);
      scrollingElement.addEventListener("touchmove", onUserScroll, options);
      scrollingElement.addEventListener("scroll", onScroll, options);
      return () => {
        scrollingElement.removeEventListener("wheel", onUserScroll, true);
        scrollingElement.removeEventListener("touchmove", onUserScroll, true);
        scrollingElement.removeEventListener("scroll", onScroll, true);
      };
    }, [open, contentElement, store5]);
    useSafeLayoutEffect(() => {
      if (!storeValue) return;
      if (composingRef.current) return;
      canAutoSelectRef.current = true;
    }, [storeValue]);
    useSafeLayoutEffect(() => {
      if (autoSelect !== "always" && open) return;
      canAutoSelectRef.current = open;
    }, [autoSelect, open]);
    const resetValueOnSelect = store5.useState("resetValueOnSelect");
    useUpdateEffect(() => {
      var _a, _b;
      const canAutoSelect = canAutoSelectRef.current;
      if (!store5) return;
      if (!open) return;
      if (!canAutoSelect && !resetValueOnSelect) return;
      const { baseElement, contentElement: contentElement2, activeId } = store5.getState();
      if (baseElement && !hasFocus(baseElement)) return;
      if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) {
        const observer = new MutationObserver(forceValueUpdate);
        observer.observe(contentElement2, { attributeFilter: ["data-placing"] });
        return () => observer.disconnect();
      }
      if (autoSelect && canAutoSelect) {
        const userAutoSelectId = getAutoSelectIdProp(items);
        const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a = getDefaultAutoSelectId(items)) != null ? _a : store5.first();
        autoSelectIdRef.current = autoSelectId;
        store5.move(autoSelectId != null ? autoSelectId : null);
      } else {
        const element = (_b = store5.item(activeId || store5.first())) == null ? void 0 : _b.element;
        if (element && "scrollIntoView" in element) {
          element.scrollIntoView({ block: "nearest", inline: "nearest" });
        }
      }
      return;
    }, [
      store5,
      open,
      valueUpdated,
      storeValue,
      autoSelect,
      resetValueOnSelect,
      getAutoSelectIdProp,
      items
    ]);
    (0, import_react17.useEffect)(() => {
      if (!inline) return;
      const combobox = ref.current;
      if (!combobox) return;
      const elements = [combobox, contentElement].filter(
        (value2) => !!value2
      );
      const onBlur2 = (event) => {
        if (elements.every((el) => isFocusEventOutside(event, el))) {
          store5 == null ? void 0 : store5.setValue(value);
        }
      };
      for (const element of elements) {
        element.addEventListener("focusout", onBlur2);
      }
      return () => {
        for (const element of elements) {
          element.removeEventListener("focusout", onBlur2);
        }
      };
    }, [inline, contentElement, store5, value]);
    const canShow = (event) => {
      const currentTarget = event.currentTarget;
      return currentTarget.value.length >= showMinLength;
    };
    const onChangeProp = props.onChange;
    const showOnChangeProp = useBooleanEvent(showOnChange != null ? showOnChange : canShow);
    const setValueOnChangeProp = useBooleanEvent(
      // If the combobox is combined with tags, the value will be set by the tag
      // input component.
      setValueOnChange != null ? setValueOnChange : !store5.tag
    );
    const onChange = useEvent((event) => {
      onChangeProp == null ? void 0 : onChangeProp(event);
      if (event.defaultPrevented) return;
      if (!store5) return;
      const currentTarget = event.currentTarget;
      const { value: value2, selectionStart, selectionEnd } = currentTarget;
      const nativeEvent = event.nativeEvent;
      canAutoSelectRef.current = true;
      if (isInputEvent(nativeEvent)) {
        if (nativeEvent.isComposing) {
          canAutoSelectRef.current = false;
          composingRef.current = true;
        }
        if (inline) {
          const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText";
          const caretAtEnd = selectionStart === value2.length;
          setCanInline(textInserted && caretAtEnd);
        }
      }
      if (setValueOnChangeProp(event)) {
        const isSameValue = value2 === store5.getState().value;
        store5.setValue(value2);
        queueMicrotask(() => {
          setSelectionRange(currentTarget, selectionStart, selectionEnd);
        });
        if (inline && autoSelect && isSameValue) {
          forceValueUpdate();
        }
      }
      if (showOnChangeProp(event)) {
        store5.show();
      }
      if (!autoSelect || !canAutoSelectRef.current) {
        store5.setActiveId(null);
      }
    });
    const onCompositionEndProp = props.onCompositionEnd;
    const onCompositionEnd = useEvent((event) => {
      canAutoSelectRef.current = true;
      composingRef.current = false;
      onCompositionEndProp == null ? void 0 : onCompositionEndProp(event);
      if (event.defaultPrevented) return;
      if (!autoSelect) return;
      forceValueUpdate();
    });
    const onMouseDownProp = props.onMouseDown;
    const blurActiveItemOnClickProp = useBooleanEvent(
      blurActiveItemOnClick != null ? blurActiveItemOnClick : (() => !!(store5 == null ? void 0 : store5.getState().includesBaseElement))
    );
    const setValueOnClickProp = useBooleanEvent(setValueOnClick);
    const showOnClickProp = useBooleanEvent(showOnClick != null ? showOnClick : canShow);
    const onMouseDown = useEvent((event) => {
      onMouseDownProp == null ? void 0 : onMouseDownProp(event);
      if (event.defaultPrevented) return;
      if (event.button) return;
      if (event.ctrlKey) return;
      if (!store5) return;
      if (blurActiveItemOnClickProp(event)) {
        store5.setActiveId(null);
      }
      if (setValueOnClickProp(event)) {
        store5.setValue(value);
      }
      if (showOnClickProp(event)) {
        queueBeforeEvent(event.currentTarget, "mouseup", store5.show);
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const showOnKeyPressProp = useBooleanEvent(showOnKeyPress != null ? showOnKeyPress : canShow);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (!event.repeat) {
        canAutoSelectRef.current = false;
      }
      if (event.defaultPrevented) return;
      if (event.ctrlKey) return;
      if (event.altKey) return;
      if (event.shiftKey) return;
      if (event.metaKey) return;
      if (!store5) return;
      const { open: open2 } = store5.getState();
      if (open2) return;
      if (event.key === "ArrowUp" || event.key === "ArrowDown") {
        if (showOnKeyPressProp(event)) {
          event.preventDefault();
          store5.show();
        }
      }
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      canAutoSelectRef.current = false;
      onBlurProp == null ? void 0 : onBlurProp(event);
      if (event.defaultPrevented) return;
    });
    const id = useId4(props.id);
    const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
    const isActiveItem = store5.useState((state) => state.activeId === null);
    props = {
      id,
      role: "combobox",
      "aria-autocomplete": ariaAutoComplete,
      "aria-haspopup": getPopupRole(contentElement, "listbox"),
      "aria-expanded": open,
      "aria-controls": contentElement == null ? void 0 : contentElement.id,
      "data-active-item": isActiveItem || void 0,
      value,
      ...props,
      ref: useMergeRefs(ref, props.ref),
      onChange,
      onCompositionEnd,
      onMouseDown,
      onKeyDown,
      onBlur
    };
    props = useComposite({
      store: store5,
      focusable,
      ...props,
      // Enable inline autocomplete when the user moves from the combobox input
      // to an item.
      moveOnKeyPress: (event) => {
        if (isFalsyBooleanCallback(moveOnKeyPress, event)) return false;
        if (inline) setCanInline(true);
        return true;
      }
    });
    props = usePopoverAnchor({ store: store5, ...props });
    return { autoComplete: "off", ...props };
  }
);
var Combobox = forwardRef22(function Combobox2(props) {
  const htmlProps = useCombobox(props);
  return createElement3(TagName9, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/IBXZ2LQC.js
var import_react18 = __toESM(require_react(), 1);
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
var TagName10 = "div";
function isSelected(storeValue, itemValue) {
  if (itemValue == null) return;
  if (storeValue == null) return false;
  if (Array.isArray(storeValue)) {
    return storeValue.includes(itemValue);
  }
  return storeValue === itemValue;
}
function getItemRole(popupRole) {
  var _a;
  const itemRoleByPopupRole = {
    menu: "menuitem",
    listbox: "option",
    tree: "treeitem"
  };
  const key = popupRole;
  return (_a = itemRoleByPopupRole[key]) != null ? _a : "option";
}
var useComboboxItem = createHook(
  function useComboboxItem2({
    store: store5,
    value,
    hideOnClick,
    setValueOnClick,
    selectValueOnClick = true,
    resetValueOnSelect,
    focusOnHover = false,
    moveOnKeyPress = true,
    getItem: getItemProp,
    ...props
  }) {
    var _a;
    const context = useComboboxScopedContext();
    store5 = store5 || context;
    invariant(
      store5,
      "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
    );
    const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store5, {
      resetValueOnSelectState: "resetValueOnSelect",
      multiSelectable(state) {
        return Array.isArray(state.selectedValue);
      },
      selected(state) {
        return isSelected(state.selectedValue, value);
      }
    });
    const getItem = (0, import_react18.useCallback)(
      (item) => {
        const nextItem = { ...item, value };
        if (getItemProp) {
          return getItemProp(nextItem);
        }
        return nextItem;
      },
      [value, getItemProp]
    );
    setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable;
    hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
    const onClickProp = props.onClick;
    const setValueOnClickProp = useBooleanEvent(setValueOnClick);
    const selectValueOnClickProp = useBooleanEvent(selectValueOnClick);
    const resetValueOnSelectProp = useBooleanEvent(
      (_a = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a : multiSelectable
    );
    const hideOnClickProp = useBooleanEvent(hideOnClick);
    const onClick = useEvent((event) => {
      onClickProp == null ? void 0 : onClickProp(event);
      if (event.defaultPrevented) return;
      if (isDownloading(event)) return;
      if (isOpeningInNewTab(event)) return;
      if (value != null) {
        if (selectValueOnClickProp(event)) {
          if (resetValueOnSelectProp(event)) {
            store5 == null ? void 0 : store5.resetValue();
          }
          store5 == null ? void 0 : store5.setSelectedValue((prevValue) => {
            if (!Array.isArray(prevValue)) return value;
            if (prevValue.includes(value)) {
              return prevValue.filter((v2) => v2 !== value);
            }
            return [...prevValue, value];
          });
        }
        if (setValueOnClickProp(event)) {
          store5 == null ? void 0 : store5.setValue(value);
        }
      }
      if (hideOnClickProp(event)) {
        store5 == null ? void 0 : store5.hide();
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (event.defaultPrevented) return;
      const baseElement = store5 == null ? void 0 : store5.getState().baseElement;
      if (!baseElement) return;
      if (hasFocus(baseElement)) return;
      const printable = event.key.length === 1;
      if (printable || event.key === "Backspace" || event.key === "Delete") {
        queueMicrotask(() => baseElement.focus());
        if (isTextField(baseElement)) {
          store5 == null ? void 0 : store5.setValue(baseElement.value);
        }
      }
    });
    if (multiSelectable && selected != null) {
      props = {
        "aria-selected": selected,
        ...props
      };
    }
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }),
      [value, selected]
    );
    const popupRole = (0, import_react18.useContext)(ComboboxListRoleContext);
    props = {
      role: getItemRole(popupRole),
      children: value,
      ...props,
      onClick,
      onKeyDown
    };
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    props = useCompositeItem2({
      store: store5,
      ...props,
      getItem,
      // Dispatch a custom event on the combobox input when moving to an item
      // with the keyboard so the Combobox component can enable inline
      // autocompletion.
      moveOnKeyPress: (event) => {
        if (!moveOnKeyPressProp(event)) return false;
        const moveEvent = new Event("combobox-item-move");
        const baseElement = store5 == null ? void 0 : store5.getState().baseElement;
        baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent);
        return true;
      }
    });
    props = useCompositeHover({ store: store5, focusOnHover, ...props });
    return props;
  }
);
var ComboboxItem = memo22(
  forwardRef22(function ComboboxItem2(props) {
    const htmlProps = useComboboxItem(props);
    return createElement3(TagName10, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js
var import_react19 = __toESM(require_react(), 1);
var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
var TagName11 = "span";
function normalizeValue(value) {
  return normalizeString(value).toLowerCase();
}
function getOffsets(string, values) {
  const offsets = [];
  for (const value of values) {
    let pos = 0;
    const length = value.length;
    while (string.indexOf(value, pos) !== -1) {
      const index = string.indexOf(value, pos);
      if (index !== -1) {
        offsets.push([index, length]);
      }
      pos = index + 1;
    }
  }
  return offsets;
}
function filterOverlappingOffsets(offsets) {
  return offsets.filter(([offset, length], i2, arr) => {
    return !arr.some(
      ([o2, l2], j2) => j2 !== i2 && o2 <= offset && o2 + l2 >= offset + length
    );
  });
}
function sortOffsets(offsets) {
  return offsets.sort(([a2], [b2]) => a2 - b2);
}
function splitValue(itemValue, userValue) {
  if (!itemValue) return itemValue;
  if (!userValue) return itemValue;
  const userValues = toArray(userValue).filter(Boolean).map(normalizeValue);
  const parts = [];
  const span = (value, autocomplete = false) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
    "span",
    {
      "data-autocomplete-value": autocomplete ? "" : void 0,
      "data-user-value": autocomplete ? void 0 : "",
      children: value
    },
    parts.length
  );
  const offsets = sortOffsets(
    filterOverlappingOffsets(
      // Convert userValues into a set to avoid duplicates
      getOffsets(normalizeValue(itemValue), new Set(userValues))
    )
  );
  if (!offsets.length) {
    parts.push(span(itemValue, true));
    return parts;
  }
  const [firstOffset] = offsets[0];
  const values = [
    itemValue.slice(0, firstOffset),
    ...offsets.flatMap(([offset, length], i2) => {
      var _a;
      const value = itemValue.slice(offset, offset + length);
      const nextOffset = (_a = offsets[i2 + 1]) == null ? void 0 : _a[0];
      const nextValue = itemValue.slice(offset + length, nextOffset);
      return [value, nextValue];
    })
  ];
  values.forEach((value, i2) => {
    if (!value) return;
    parts.push(span(value, i2 % 2 === 0));
  });
  return parts;
}
var useComboboxItemValue = createHook(function useComboboxItemValue2({ store: store5, value, userValue, ...props }) {
  const context = useComboboxScopedContext();
  store5 = store5 || context;
  const itemContext = (0, import_react19.useContext)(ComboboxItemValueContext);
  const itemValue = value != null ? value : itemContext;
  const inputValue = useStoreState(store5, (state) => userValue != null ? userValue : state == null ? void 0 : state.value);
  const children = (0, import_react19.useMemo)(() => {
    if (!itemValue) return;
    if (!inputValue) return itemValue;
    return splitValue(itemValue, inputValue);
  }, [itemValue, inputValue]);
  props = {
    children,
    ...props
  };
  return removeUndefinedValues(props);
});
var ComboboxItemValue = forwardRef22(function ComboboxItemValue2(props) {
  const htmlProps = useComboboxItemValue(props);
  return createElement3(TagName11, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox-label.js
var TagName12 = "label";
var useComboboxLabel = createHook(
  function useComboboxLabel2({ store: store5, ...props }) {
    const context = useComboboxProviderContext();
    store5 = store5 || context;
    invariant(
      store5,
      "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component."
    );
    const comboboxId = store5.useState((state) => {
      var _a;
      return (_a = state.baseElement) == null ? void 0 : _a.id;
    });
    props = {
      htmlFor: comboboxId,
      ...props
    };
    return removeUndefinedValues(props);
  }
);
var ComboboxLabel = memo22(
  forwardRef22(function ComboboxLabel2(props) {
    const htmlProps = useComboboxLabel(props);
    return createElement3(TagName12, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/2G6YEJT4.js
var import_react20 = __toESM(require_react(), 1);
var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
var TagName13 = "div";
var useComboboxList = createHook(
  function useComboboxList2({ store: store5, alwaysVisible, ...props }) {
    const scopedContext = useComboboxScopedContext(true);
    const context = useComboboxContext();
    store5 = store5 || context;
    const scopedContextSameStore = !!store5 && store5 === scopedContext;
    invariant(
      store5,
      "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
    );
    const ref = (0, import_react20.useRef)(null);
    const id = useId4(props.id);
    const mounted = store5.useState("mounted");
    const hidden = isHidden(mounted, props.hidden, alwaysVisible);
    const style = hidden ? { ...props.style, display: "none" } : props.style;
    const multiSelectable = store5.useState(
      (state) => Array.isArray(state.selectedValue)
    );
    const role = useAttribute(ref, "role", props.role);
    const isCompositeRole = role === "listbox" || role === "tree" || role === "grid";
    const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0;
    const [hasListboxInside, setHasListboxInside] = (0, import_react20.useState)(false);
    const contentElement = store5.useState("contentElement");
    useSafeLayoutEffect(() => {
      if (!mounted) return;
      const element = ref.current;
      if (!element) return;
      if (contentElement !== element) return;
      const callback = () => {
        setHasListboxInside(!!element.querySelector("[role='listbox']"));
      };
      const observer = new MutationObserver(callback);
      observer.observe(element, {
        subtree: true,
        childList: true,
        attributeFilter: ["role"]
      });
      callback();
      return () => observer.disconnect();
    }, [mounted, contentElement]);
    if (!hasListboxInside) {
      props = {
        role: "listbox",
        "aria-multiselectable": ariaMultiSelectable,
        ...props
      };
    }
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ComboboxScopedContextProvider, { value: store5, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ComboboxListRoleContext.Provider, { value: role, children: element }) }),
      [store5, role]
    );
    const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store5.setContentElement : null;
    props = {
      id,
      hidden,
      ...props,
      ref: useMergeRefs(setContentElement, ref, props.ref),
      style
    };
    return removeUndefinedValues(props);
  }
);
var ComboboxList = forwardRef22(function ComboboxList2(props) {
  const htmlProps = useComboboxList(props);
  return createElement3(TagName13, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/XSIEPKGA.js
var import_react21 = __toESM(require_react(), 1);
var TagValueContext = (0, import_react21.createContext)(null);
var TagRemoveIdContext = (0, import_react21.createContext)(
  null
);
var ctx7 = createStoreContext(
  [CompositeContextProvider],
  [CompositeScopedContextProvider]
);
var useTagContext = ctx7.useContext;
var useTagScopedContext = ctx7.useScopedContext;
var useTagProviderContext = ctx7.useProviderContext;
var TagContextProvider = ctx7.ContextProvider;
var TagScopedContextProvider = ctx7.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+core@0.4.18/node_modules/@ariakit/core/esm/combobox/combobox-store.js
var isTouchSafari = isSafari() && isTouchDevice();
function createComboboxStore({
  tag,
  ...props
} = {}) {
  const store5 = mergeStore(props.store, pick2(tag, ["value", "rtl"]));
  throwOnConflictingProps(props, store5);
  const tagState = tag == null ? void 0 : tag.getState();
  const syncState = store5 == null ? void 0 : store5.getState();
  const activeId = defaultValue(
    props.activeId,
    syncState == null ? void 0 : syncState.activeId,
    props.defaultActiveId,
    null
  );
  const composite = createCompositeStore({
    ...props,
    activeId,
    includesBaseElement: defaultValue(
      props.includesBaseElement,
      syncState == null ? void 0 : syncState.includesBaseElement,
      true
    ),
    orientation: defaultValue(
      props.orientation,
      syncState == null ? void 0 : syncState.orientation,
      "vertical"
    ),
    focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
    focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
    virtualFocus: defaultValue(
      props.virtualFocus,
      syncState == null ? void 0 : syncState.virtualFocus,
      true
    )
  });
  const popover = createPopoverStore({
    ...props,
    placement: defaultValue(
      props.placement,
      syncState == null ? void 0 : syncState.placement,
      "bottom-start"
    )
  });
  const value = defaultValue(
    props.value,
    syncState == null ? void 0 : syncState.value,
    props.defaultValue,
    ""
  );
  const selectedValue = defaultValue(
    props.selectedValue,
    syncState == null ? void 0 : syncState.selectedValue,
    tagState == null ? void 0 : tagState.values,
    props.defaultSelectedValue,
    ""
  );
  const multiSelectable = Array.isArray(selectedValue);
  const initialState4 = {
    ...composite.getState(),
    ...popover.getState(),
    value,
    selectedValue,
    resetValueOnSelect: defaultValue(
      props.resetValueOnSelect,
      syncState == null ? void 0 : syncState.resetValueOnSelect,
      multiSelectable
    ),
    resetValueOnHide: defaultValue(
      props.resetValueOnHide,
      syncState == null ? void 0 : syncState.resetValueOnHide,
      multiSelectable && !tag
    ),
    activeValue: syncState == null ? void 0 : syncState.activeValue
  };
  const combobox = createStore(initialState4, composite, popover, store5);
  if (isTouchSafari) {
    setup(
      combobox,
      () => sync(combobox, ["virtualFocus"], () => {
        combobox.setState("virtualFocus", false);
      })
    );
  }
  setup(combobox, () => {
    if (!tag) return;
    return chain(
      sync(combobox, ["selectedValue"], (state) => {
        if (!Array.isArray(state.selectedValue)) return;
        tag.setValues(state.selectedValue);
      }),
      sync(tag, ["values"], (state) => {
        combobox.setState("selectedValue", state.values);
      })
    );
  });
  setup(
    combobox,
    () => sync(combobox, ["resetValueOnHide", "mounted"], (state) => {
      if (!state.resetValueOnHide) return;
      if (state.mounted) return;
      combobox.setState("value", value);
    })
  );
  setup(
    combobox,
    () => sync(combobox, ["open"], (state) => {
      if (state.open) return;
      combobox.setState("activeId", activeId);
      combobox.setState("moves", 0);
    })
  );
  setup(
    combobox,
    () => sync(combobox, ["moves", "activeId"], (state, prevState) => {
      if (state.moves === prevState.moves) {
        combobox.setState("activeValue", void 0);
      }
    })
  );
  setup(
    combobox,
    () => batch(combobox, ["moves", "renderedItems"], (state, prev) => {
      if (state.moves === prev.moves) return;
      const { activeId: activeId2 } = combobox.getState();
      const activeItem = composite.item(activeId2);
      combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
    })
  );
  return {
    ...popover,
    ...composite,
    ...combobox,
    tag,
    setValue: (value2) => combobox.setState("value", value2),
    resetValue: () => combobox.setState("value", initialState4.value),
    setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2)
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/SVN33SY6.js
function useComboboxStoreOptions(props) {
  const tag = useTagContext();
  props = {
    ...props,
    tag: props.tag !== void 0 ? props.tag : tag
  };
  return useCompositeStoreOptions(props);
}
function useComboboxStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.tag]);
  useStoreProps(store5, props, "value", "setValue");
  useStoreProps(store5, props, "selectedValue", "setSelectedValue");
  useStoreProps(store5, props, "resetValueOnHide");
  useStoreProps(store5, props, "resetValueOnSelect");
  return Object.assign(
    useCompositeStoreProps(
      usePopoverStoreProps(store5, update2, props),
      update2,
      props
    ),
    { tag: props.tag }
  );
}
function useComboboxStore(props = {}) {
  props = useComboboxStoreOptions(props);
  const [store5, update2] = useStore(createComboboxStore, props);
  return useComboboxStoreProps(store5, update2, props);
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.21_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
function ComboboxProvider(props = {}) {
  const store5 = useComboboxStore(props);
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ComboboxContextProvider, { value: store5, children: props.children });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.mjs
var import_remove_accents = __toESM(require_remove_accents(), 1);
var import_compose8 = __toESM(require_compose(), 1);
var import_i18n23 = __toESM(require_i18n(), 1);
var import_element25 = __toESM(require_element(), 1);
var import_components22 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.mjs
var EMPTY_ARRAY4 = [];
var getCurrentValue = (filterDefinition, currentFilter) => {
  if (filterDefinition.singleSelection) {
    return currentFilter?.value;
  }
  if (Array.isArray(currentFilter?.value)) {
    return currentFilter.value;
  }
  if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) {
    return [currentFilter.value];
  }
  return EMPTY_ARRAY4;
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/hooks/use-elements.mjs
var import_element24 = __toESM(require_element(), 1);
var EMPTY_ARRAY5 = [];
function useElements({
  elements,
  getElements
}) {
  const staticElements = Array.isArray(elements) && elements.length > 0 ? elements : EMPTY_ARRAY5;
  const [records, setRecords] = (0, import_element24.useState)(staticElements);
  const [isLoading, setIsLoading2] = (0, import_element24.useState)(false);
  (0, import_element24.useEffect)(() => {
    if (!getElements) {
      setRecords(staticElements);
      return;
    }
    let cancelled = false;
    setIsLoading2(true);
    getElements().then((fetchedElements) => {
      if (!cancelled) {
        const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements;
        setRecords(dynamicElements);
      }
    }).catch(() => {
      if (!cancelled) {
        setRecords(staticElements);
      }
    }).finally(() => {
      if (!cancelled) {
        setIsLoading2(false);
      }
    });
    return () => {
      cancelled = true;
    };
  }, [getElements, staticElements]);
  return {
    elements: records,
    isLoading
  };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.mjs
var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
function normalizeSearchInput(input = "") {
  return (0, import_remove_accents.default)(input.trim().toLowerCase());
}
var getNewValue = (filterDefinition, currentFilter, value) => {
  if (filterDefinition.singleSelection) {
    return value;
  }
  if (Array.isArray(currentFilter?.value)) {
    return currentFilter.value.includes(value) ? currentFilter.value.filter((v2) => v2 !== value) : [...currentFilter.value, value];
  }
  return [value];
};
function generateFilterElementCompositeItemId(prefix, filterElementValue) {
  return `${prefix}-${filterElementValue}`;
}
var MultiSelectionOption = ({ selected }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
    "span",
    {
      className: clsx_default(
        "dataviews-filters__search-widget-listitem-multi-selection",
        { "is-selected": selected }
      ),
      children: selected && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components22.Icon, { icon: check_default })
    }
  );
};
var SingleSelectionOption = ({ selected }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
    "span",
    {
      className: clsx_default(
        "dataviews-filters__search-widget-listitem-single-selection",
        { "is-selected": selected }
      )
    }
  );
};
function ListBox({ view, filter, onChangeView }) {
  const baseId = (0, import_compose8.useInstanceId)(ListBox, "dataviews-filter-list-box");
  const [activeCompositeId, setActiveCompositeId] = (0, import_element25.useState)(
    // When there are one or less operators, the first item is set as active
    // (by setting the initial `activeId` to `undefined`).
    // With 2 or more operators, the focus is moved on the operators control
    // (by setting the initial `activeId` to `null`), meaning that there won't
    // be an active item initially. Focus is then managed via the
    // `onFocusVisible` callback.
    filter.operators?.length === 1 ? void 0 : null
  );
  const currentFilter = view.filters?.find(
    (f2) => f2.field === filter.field
  );
  const currentValue = getCurrentValue(filter, currentFilter);
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
    import_components22.Composite,
    {
      virtualFocus: true,
      focusLoop: true,
      activeId: activeCompositeId,
      setActiveId: setActiveCompositeId,
      role: "listbox",
      className: "dataviews-filters__search-widget-listbox",
      "aria-label": (0, import_i18n23.sprintf)(
        /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
        (0, import_i18n23.__)("List of: %1$s"),
        filter.name
      ),
      onFocusVisible: () => {
        if (!activeCompositeId && filter.elements.length) {
          setActiveCompositeId(
            generateFilterElementCompositeItemId(
              baseId,
              filter.elements[0].value
            )
          );
        }
      },
      render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components22.Composite.Typeahead, {}),
      children: filter.elements.map((element) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
        import_components22.Composite.Hover,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            import_components22.Composite.Item,
            {
              id: generateFilterElementCompositeItemId(
                baseId,
                element.value
              ),
              render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                "div",
                {
                  "aria-label": element.label,
                  role: "option",
                  className: "dataviews-filters__search-widget-listitem"
                }
              ),
              onClick: () => {
                const newFilters = currentFilter ? [
                  ...(view.filters ?? []).map(
                    (_filter) => {
                      if (_filter.field === filter.field) {
                        return {
                          ..._filter,
                          operator: currentFilter.operator || filter.operators[0],
                          value: getNewValue(
                            filter,
                            currentFilter,
                            element.value
                          )
                        };
                      }
                      return _filter;
                    }
                  )
                ] : [
                  ...view.filters ?? [],
                  {
                    field: filter.field,
                    operator: filter.operators[0],
                    value: getNewValue(
                      filter,
                      currentFilter,
                      element.value
                    )
                  }
                ];
                onChangeView({
                  ...view,
                  page: 1,
                  filters: newFilters
                });
              }
            }
          ),
          children: [
            filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
              SingleSelectionOption,
              {
                selected: currentValue === element.value
              }
            ),
            !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
              MultiSelectionOption,
              {
                selected: currentValue.includes(element.value)
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { children: element.label })
          ]
        },
        element.value
      ))
    }
  );
}
function ComboboxList22({ view, filter, onChangeView }) {
  const [searchValue, setSearchValue] = (0, import_element25.useState)("");
  const deferredSearchValue = (0, import_element25.useDeferredValue)(searchValue);
  const currentFilter = view.filters?.find(
    (_filter) => _filter.field === filter.field
  );
  const currentValue = getCurrentValue(filter, currentFilter);
  const matches = (0, import_element25.useMemo)(() => {
    const normalizedSearch = normalizeSearchInput(deferredSearchValue);
    return filter.elements.filter(
      (item) => normalizeSearchInput(item.label).includes(normalizedSearch)
    );
  }, [filter.elements, deferredSearchValue]);
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
    ComboboxProvider,
    {
      selectedValue: currentValue,
      setSelectedValue: (value) => {
        const newFilters = currentFilter ? [
          ...(view.filters ?? []).map((_filter) => {
            if (_filter.field === filter.field) {
              return {
                ..._filter,
                operator: currentFilter.operator || filter.operators[0],
                value
              };
            }
            return _filter;
          })
        ] : [
          ...view.filters ?? [],
          {
            field: filter.field,
            operator: filter.operators[0],
            value
          }
        ];
        onChangeView({
          ...view,
          page: 1,
          filters: newFilters
        });
      },
      setValue: setSearchValue,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            ComboboxLabel,
            {
              render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components22.VisuallyHidden, { children: (0, import_i18n23.__)("Search items") }),
              children: (0, import_i18n23.__)("Search items")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Combobox,
            {
              autoSelect: "always",
              placeholder: (0, import_i18n23.__)("Search"),
              className: "dataviews-filters__search-widget-filter-combobox__input"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components22.Icon, { icon: search_default }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
          ComboboxList,
          {
            className: "dataviews-filters__search-widget-filter-combobox-list",
            alwaysVisible: true,
            children: [
              matches.map((element) => {
                return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
                  ComboboxItem,
                  {
                    resetValueOnSelect: false,
                    value: element.value,
                    className: "dataviews-filters__search-widget-listitem",
                    hideOnClick: false,
                    setValueOnClick: false,
                    focusOnHover: true,
                    children: [
                      filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                        SingleSelectionOption,
                        {
                          selected: currentValue === element.value
                        }
                      ),
                      !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                        MultiSelectionOption,
                        {
                          selected: currentValue.includes(
                            element.value
                          )
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("span", { children: [
                        /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                          ComboboxItemValue,
                          {
                            className: "dataviews-filters__search-widget-filter-combobox-item-value",
                            value: element.label
                          }
                        ),
                        !!element.description && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
                      ] })
                    ]
                  },
                  element.value
                );
              }),
              !matches.length && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { children: (0, import_i18n23.__)("No results found") })
            ]
          }
        )
      ]
    }
  );
}
function SearchWidget(props) {
  const { elements, isLoading } = useElements({
    elements: props.filter.elements,
    getElements: props.filter.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components22.Spinner, {}) });
  }
  if (elements.length === 0) {
    return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0, import_i18n23.__)("No elements found") });
  }
  const Widget = elements.length > 10 ? ComboboxList22 : ListBox;
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Widget, { ...props, filter: { ...props.filter, elements } });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.mjs
var import_es6 = __toESM(require_es6(), 1);
var import_compose9 = __toESM(require_compose(), 1);
var import_element26 = __toESM(require_element(), 1);
var import_components23 = __toESM(require_components(), 1);
var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
function InputWidget({
  filter,
  view,
  onChangeView,
  fields
}) {
  const currentFilter = view.filters?.find(
    (f2) => f2.field === filter.field
  );
  const currentValue = getCurrentValue(filter, currentFilter);
  const field = (0, import_element26.useMemo)(() => {
    const currentField = fields.find((f2) => f2.id === filter.field);
    if (currentField) {
      return {
        ...currentField,
        // Deactivate validation for filters.
        isValid: {},
        // Configure getValue/setValue as if Item was a plain object.
        getValue: ({ item }) => item[currentField.id],
        setValue: ({ value }) => ({
          [currentField.id]: value
        })
      };
    }
    return currentField;
  }, [fields, filter.field]);
  const data = (0, import_element26.useMemo)(() => {
    return (view.filters ?? []).reduce(
      (acc, activeFilter) => {
        acc[activeFilter.field] = activeFilter.value;
        return acc;
      },
      {}
    );
  }, [view.filters]);
  const handleChange = (0, import_compose9.useEvent)((updatedData) => {
    if (!field || !currentFilter) {
      return;
    }
    const nextValue = field.getValue({ item: updatedData });
    if ((0, import_es6.default)(nextValue, currentValue)) {
      return;
    }
    onChangeView({
      ...view,
      filters: (view.filters ?? []).map(
        (_filter) => _filter.field === filter.field ? {
          ..._filter,
          operator: currentFilter.operator || filter.operators[0],
          // Consider empty strings as undefined:
          //
          // - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records
          // - empty string as value means "search empty string": returns only the records that have an empty string as value
          //
          // In practice, this means the filter will not be able to find an empty string as the value.
          value: nextValue === "" ? void 0 : nextValue
        } : _filter
      )
    });
  });
  if (!field || !field.Edit || !currentFilter) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
    import_components23.Flex,
    {
      className: "dataviews-filters__user-input-widget",
      gap: 2.5,
      direction: "column",
      children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
        field.Edit,
        {
          hideLabelFromVision: true,
          data,
          field,
          operator: currentFilter.operator,
          onChange: handleChange
        }
      )
    }
  );
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
var daysInYear = 365.2425;
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
var minTime = -maxTime;
var millisecondsInWeek = 6048e5;
var millisecondsInDay = 864e5;
var secondsInHour = 3600;
var secondsInDay = secondsInHour * 24;
var secondsInWeek = secondsInDay * 7;
var secondsInYear = secondsInDay * daysInYear;
var secondsInMonth = secondsInYear / 12;
var secondsInQuarter = secondsInMonth * 3;
var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
function constructFrom(date, value) {
  if (typeof date === "function") return date(value);
  if (date && typeof date === "object" && constructFromSymbol in date)
    return date[constructFromSymbol](value);
  if (date instanceof Date) return new date.constructor(value);
  return new Date(value);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
function toDate(argument, context) {
  return constructFrom(context || argument, argument);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
function addDays(date, amount, options) {
  const _date = toDate(date, options?.in);
  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
  if (!amount) return _date;
  _date.setDate(_date.getDate() + amount);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js
function addMonths(date, amount, options) {
  const _date = toDate(date, options?.in);
  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
  if (!amount) {
    return _date;
  }
  const dayOfMonth = _date.getDate();
  const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
  endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
  const daysInMonth = endOfDesiredMonth.getDate();
  if (dayOfMonth >= daysInMonth) {
    return endOfDesiredMonth;
  } else {
    _date.setFullYear(
      endOfDesiredMonth.getFullYear(),
      endOfDesiredMonth.getMonth(),
      dayOfMonth
    );
    return _date;
  }
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
var defaultOptions = {};
function getDefaultOptions() {
  return defaultOptions;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
function startOfWeek(date, options) {
  const defaultOptions2 = getDefaultOptions();
  const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
  const _date = toDate(date, options?.in);
  const day = _date.getDay();
  const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  _date.setDate(_date.getDate() - diff);
  _date.setHours(0, 0, 0, 0);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
function startOfISOWeek(date, options) {
  return startOfWeek(date, { ...options, weekStartsOn: 1 });
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
function getISOWeekYear(date, options) {
  const _date = toDate(date, options?.in);
  const year = _date.getFullYear();
  const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
  fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
  fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
  const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
  const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
  fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
  fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
  const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
  if (_date.getTime() >= startOfNextYear.getTime()) {
    return year + 1;
  } else if (_date.getTime() >= startOfThisYear.getTime()) {
    return year;
  } else {
    return year - 1;
  }
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
function getTimezoneOffsetInMilliseconds(date) {
  const _date = toDate(date);
  const utcDate = new Date(
    Date.UTC(
      _date.getFullYear(),
      _date.getMonth(),
      _date.getDate(),
      _date.getHours(),
      _date.getMinutes(),
      _date.getSeconds(),
      _date.getMilliseconds()
    )
  );
  utcDate.setUTCFullYear(_date.getFullYear());
  return +date - +utcDate;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
function normalizeDates(context, ...dates) {
  const normalize = constructFrom.bind(
    null,
    context || dates.find((date) => typeof date === "object")
  );
  return dates.map(normalize);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
function startOfDay(date, options) {
  const _date = toDate(date, options?.in);
  _date.setHours(0, 0, 0, 0);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
function differenceInCalendarDays(laterDate, earlierDate, options) {
  const [laterDate_, earlierDate_] = normalizeDates(
    options?.in,
    laterDate,
    earlierDate
  );
  const laterStartOfDay = startOfDay(laterDate_);
  const earlierStartOfDay = startOfDay(earlierDate_);
  const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
  const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
  return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
function startOfISOWeekYear(date, options) {
  const year = getISOWeekYear(date, options);
  const fourthOfJanuary = constructFrom(options?.in || date, 0);
  fourthOfJanuary.setFullYear(year, 0, 4);
  fourthOfJanuary.setHours(0, 0, 0, 0);
  return startOfISOWeek(fourthOfJanuary);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js
function addWeeks(date, amount, options) {
  return addDays(date, amount * 7, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js
function addYears(date, amount, options) {
  return addMonths(date, amount * 12, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
function isDate(value) {
  return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
function isValid(date) {
  return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js
function startOfMonth(date, options) {
  const _date = toDate(date, options?.in);
  _date.setDate(1);
  _date.setHours(0, 0, 0, 0);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js
function startOfYear(date, options) {
  const date_ = toDate(date, options?.in);
  date_.setFullYear(date_.getFullYear(), 0, 1);
  date_.setHours(0, 0, 0, 0);
  return date_;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
var formatDistanceLocale = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
};
var formatDistance = (token, count, options) => {
  let result2;
  const tokenValue = formatDistanceLocale[token];
  if (typeof tokenValue === "string") {
    result2 = tokenValue;
  } else if (count === 1) {
    result2 = tokenValue.one;
  } else {
    result2 = tokenValue.other.replace("{{count}}", count.toString());
  }
  if (options?.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "in " + result2;
    } else {
      return result2 + " ago";
    }
  }
  return result2;
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
  return (options = {}) => {
    const width = options.width ? String(options.width) : args.defaultWidth;
    const format7 = args.formats[width] || args.formats[args.defaultWidth];
    return format7;
  };
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js
var dateFormats = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
};
var timeFormats = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
};
var dateTimeFormats = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong = {
  date: buildFormatLongFn({
    formats: dateFormats,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats,
    defaultWidth: "full"
  })
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
var formatRelativeLocale = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
};
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
  return (value, options) => {
    const context = options?.context ? String(options.context) : "standalone";
    let valuesArray;
    if (context === "formatting" && args.formattingValues) {
      const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
      const width = options?.width ? String(options.width) : defaultWidth;
      valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
    } else {
      const defaultWidth = args.defaultWidth;
      const width = options?.width ? String(options.width) : args.defaultWidth;
      valuesArray = args.values[width] || args.values[defaultWidth];
    }
    const index = args.argumentCallback ? args.argumentCallback(value) : value;
    return valuesArray[index];
  };
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js
var eraValues = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  wide: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
};
var dayValues = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ]
};
var dayPeriodValues = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
};
var formattingDayPeriodValues = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
};
var ordinalNumber = (dirtyNumber, _options) => {
  const number = Number(dirtyNumber);
  const rem100 = number % 100;
  if (rem100 > 20 || rem100 < 10) {
    switch (rem100 % 10) {
      case 1:
        return number + "st";
      case 2:
        return number + "nd";
      case 3:
        return number + "rd";
    }
  }
  return number + "th";
};
var localize = {
  ordinalNumber,
  era: buildLocalizeFn({
    values: eraValues,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn({
    values: quarterValues,
    defaultWidth: "wide",
    argumentCallback: (quarter) => quarter - 1
  }),
  month: buildLocalizeFn({
    values: monthValues,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn({
    values: dayValues,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn({
    values: dayPeriodValues,
    defaultWidth: "wide",
    formattingValues: formattingDayPeriodValues,
    defaultFormattingWidth: "wide"
  })
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
  return (string, options = {}) => {
    const width = options.width;
    const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
    const matchResult = string.match(matchPattern);
    if (!matchResult) {
      return null;
    }
    const matchedString = matchResult[0];
    const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
    const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
      // [TODO] -- I challenge you to fix the type
      findKey(parsePatterns, (pattern) => pattern.test(matchedString))
    );
    let value;
    value = args.valueCallback ? args.valueCallback(key) : key;
    value = options.valueCallback ? (
      // [TODO] -- I challenge you to fix the type
      options.valueCallback(value)
    ) : value;
    const rest = string.slice(matchedString.length);
    return { value, rest };
  };
}
function findKey(object, predicate) {
  for (const key in object) {
    if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
      return key;
    }
  }
  return void 0;
}
function findIndex(array, predicate) {
  for (let key = 0; key < array.length; key++) {
    if (predicate(array[key])) {
      return key;
    }
  }
  return void 0;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
  return (string, options = {}) => {
    const matchResult = string.match(args.matchPattern);
    if (!matchResult) return null;
    const matchedString = matchResult[0];
    const parseResult = string.match(args.parsePattern);
    if (!parseResult) return null;
    let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
    value = options.valueCallback ? options.valueCallback(value) : value;
    const rest = string.slice(matchedString.length);
    return { value, rest };
  };
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
  any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
  narrow: [
    /^j/i,
    /^f/i,
    /^m/i,
    /^a/i,
    /^m/i,
    /^j/i,
    /^j/i,
    /^a/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ],
  any: [
    /^ja/i,
    /^f/i,
    /^mar/i,
    /^ap/i,
    /^may/i,
    /^jun/i,
    /^jul/i,
    /^au/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ]
};
var matchDayPatterns = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
};
var match = {
  ordinalNumber: buildMatchPatternFn({
    matchPattern: matchOrdinalNumberPattern,
    parsePattern: parseOrdinalNumberPattern,
    valueCallback: (value) => parseInt(value, 10)
  }),
  era: buildMatchFn({
    matchPatterns: matchEraPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn({
    matchPatterns: matchQuarterPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns,
    defaultParseWidth: "any",
    valueCallback: (index) => index + 1
  }),
  month: buildMatchFn({
    matchPatterns: matchMonthPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn({
    matchPatterns: matchDayPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn({
    matchPatterns: matchDayPeriodPatterns,
    defaultMatchWidth: "any",
    parsePatterns: parseDayPeriodPatterns,
    defaultParseWidth: "any"
  })
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js
var enUS = {
  code: "en-US",
  formatDistance,
  formatLong,
  formatRelative,
  localize,
  match,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js
function getDayOfYear(date, options) {
  const _date = toDate(date, options?.in);
  const diff = differenceInCalendarDays(_date, startOfYear(_date));
  const dayOfYear = diff + 1;
  return dayOfYear;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js
function getISOWeek(date, options) {
  const _date = toDate(date, options?.in);
  const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
  return Math.round(diff / millisecondsInWeek) + 1;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js
function getWeekYear(date, options) {
  const _date = toDate(date, options?.in);
  const year = _date.getFullYear();
  const defaultOptions2 = getDefaultOptions();
  const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
  const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
  firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
  firstWeekOfNextYear.setHours(0, 0, 0, 0);
  const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
  const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
  firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
  firstWeekOfThisYear.setHours(0, 0, 0, 0);
  const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
  if (+_date >= +startOfNextYear) {
    return year + 1;
  } else if (+_date >= +startOfThisYear) {
    return year;
  } else {
    return year - 1;
  }
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js
function startOfWeekYear(date, options) {
  const defaultOptions2 = getDefaultOptions();
  const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
  const year = getWeekYear(date, options);
  const firstWeek = constructFrom(options?.in || date, 0);
  firstWeek.setFullYear(year, 0, firstWeekContainsDate);
  firstWeek.setHours(0, 0, 0, 0);
  const _date = startOfWeek(firstWeek, options);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js
function getWeek(date, options) {
  const _date = toDate(date, options?.in);
  const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
  return Math.round(diff / millisecondsInWeek) + 1;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/addLeadingZeros.js
function addLeadingZeros(number, targetLength) {
  const sign = number < 0 ? "-" : "";
  const output = Math.abs(number).toString().padStart(targetLength, "0");
  return sign + output;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/lightFormatters.js
var lightFormatters = {
  // Year
  y(date, token) {
    const signedYear = date.getFullYear();
    const year = signedYear > 0 ? signedYear : 1 - signedYear;
    return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
  },
  // Month
  M(date, token) {
    const month = date.getMonth();
    return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
  },
  // Day of the month
  d(date, token) {
    return addLeadingZeros(date.getDate(), token.length);
  },
  // AM or PM
  a(date, token) {
    const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return dayPeriodEnumValue.toUpperCase();
      case "aaa":
        return dayPeriodEnumValue;
      case "aaaaa":
        return dayPeriodEnumValue[0];
      case "aaaa":
      default:
        return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h(date, token) {
    return addLeadingZeros(date.getHours() % 12 || 12, token.length);
  },
  // Hour [0-23]
  H(date, token) {
    return addLeadingZeros(date.getHours(), token.length);
  },
  // Minute
  m(date, token) {
    return addLeadingZeros(date.getMinutes(), token.length);
  },
  // Second
  s(date, token) {
    return addLeadingZeros(date.getSeconds(), token.length);
  },
  // Fraction of second
  S(date, token) {
    const numberOfDigits = token.length;
    const milliseconds = date.getMilliseconds();
    const fractionalSeconds = Math.trunc(
      milliseconds * Math.pow(10, numberOfDigits - 3)
    );
    return addLeadingZeros(fractionalSeconds, token.length);
  }
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js
var dayPeriodEnum = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
};
var formatters = {
  // Era
  G: function(date, token, localize2) {
    const era = date.getFullYear() > 0 ? 1 : 0;
    switch (token) {
      // AD, BC
      case "G":
      case "GG":
      case "GGG":
        return localize2.era(era, { width: "abbreviated" });
      // A, B
      case "GGGGG":
        return localize2.era(era, { width: "narrow" });
      // Anno Domini, Before Christ
      case "GGGG":
      default:
        return localize2.era(era, { width: "wide" });
    }
  },
  // Year
  y: function(date, token, localize2) {
    if (token === "yo") {
      const signedYear = date.getFullYear();
      const year = signedYear > 0 ? signedYear : 1 - signedYear;
      return localize2.ordinalNumber(year, { unit: "year" });
    }
    return lightFormatters.y(date, token);
  },
  // Local week-numbering year
  Y: function(date, token, localize2, options) {
    const signedWeekYear = getWeekYear(date, options);
    const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
    if (token === "YY") {
      const twoDigitYear = weekYear % 100;
      return addLeadingZeros(twoDigitYear, 2);
    }
    if (token === "Yo") {
      return localize2.ordinalNumber(weekYear, { unit: "year" });
    }
    return addLeadingZeros(weekYear, token.length);
  },
  // ISO week-numbering year
  R: function(date, token) {
    const isoWeekYear = getISOWeekYear(date);
    return addLeadingZeros(isoWeekYear, token.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(date, token) {
    const year = date.getFullYear();
    return addLeadingZeros(year, token.length);
  },
  // Quarter
  Q: function(date, token, localize2) {
    const quarter = Math.ceil((date.getMonth() + 1) / 3);
    switch (token) {
      // 1, 2, 3, 4
      case "Q":
        return String(quarter);
      // 01, 02, 03, 04
      case "QQ":
        return addLeadingZeros(quarter, 2);
      // 1st, 2nd, 3rd, 4th
      case "Qo":
        return localize2.ordinalNumber(quarter, { unit: "quarter" });
      // Q1, Q2, Q3, Q4
      case "QQQ":
        return localize2.quarter(quarter, {
          width: "abbreviated",
          context: "formatting"
        });
      // 1, 2, 3, 4 (narrow quarter; could be not numerical)
      case "QQQQQ":
        return localize2.quarter(quarter, {
          width: "narrow",
          context: "formatting"
        });
      // 1st quarter, 2nd quarter, ...
      case "QQQQ":
      default:
        return localize2.quarter(quarter, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(date, token, localize2) {
    const quarter = Math.ceil((date.getMonth() + 1) / 3);
    switch (token) {
      // 1, 2, 3, 4
      case "q":
        return String(quarter);
      // 01, 02, 03, 04
      case "qq":
        return addLeadingZeros(quarter, 2);
      // 1st, 2nd, 3rd, 4th
      case "qo":
        return localize2.ordinalNumber(quarter, { unit: "quarter" });
      // Q1, Q2, Q3, Q4
      case "qqq":
        return localize2.quarter(quarter, {
          width: "abbreviated",
          context: "standalone"
        });
      // 1, 2, 3, 4 (narrow quarter; could be not numerical)
      case "qqqqq":
        return localize2.quarter(quarter, {
          width: "narrow",
          context: "standalone"
        });
      // 1st quarter, 2nd quarter, ...
      case "qqqq":
      default:
        return localize2.quarter(quarter, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(date, token, localize2) {
    const month = date.getMonth();
    switch (token) {
      case "M":
      case "MM":
        return lightFormatters.M(date, token);
      // 1st, 2nd, ..., 12th
      case "Mo":
        return localize2.ordinalNumber(month + 1, { unit: "month" });
      // Jan, Feb, ..., Dec
      case "MMM":
        return localize2.month(month, {
          width: "abbreviated",
          context: "formatting"
        });
      // J, F, ..., D
      case "MMMMM":
        return localize2.month(month, {
          width: "narrow",
          context: "formatting"
        });
      // January, February, ..., December
      case "MMMM":
      default:
        return localize2.month(month, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(date, token, localize2) {
    const month = date.getMonth();
    switch (token) {
      // 1, 2, ..., 12
      case "L":
        return String(month + 1);
      // 01, 02, ..., 12
      case "LL":
        return addLeadingZeros(month + 1, 2);
      // 1st, 2nd, ..., 12th
      case "Lo":
        return localize2.ordinalNumber(month + 1, { unit: "month" });
      // Jan, Feb, ..., Dec
      case "LLL":
        return localize2.month(month, {
          width: "abbreviated",
          context: "standalone"
        });
      // J, F, ..., D
      case "LLLLL":
        return localize2.month(month, {
          width: "narrow",
          context: "standalone"
        });
      // January, February, ..., December
      case "LLLL":
      default:
        return localize2.month(month, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(date, token, localize2, options) {
    const week = getWeek(date, options);
    if (token === "wo") {
      return localize2.ordinalNumber(week, { unit: "week" });
    }
    return addLeadingZeros(week, token.length);
  },
  // ISO week of year
  I: function(date, token, localize2) {
    const isoWeek = getISOWeek(date);
    if (token === "Io") {
      return localize2.ordinalNumber(isoWeek, { unit: "week" });
    }
    return addLeadingZeros(isoWeek, token.length);
  },
  // Day of the month
  d: function(date, token, localize2) {
    if (token === "do") {
      return localize2.ordinalNumber(date.getDate(), { unit: "date" });
    }
    return lightFormatters.d(date, token);
  },
  // Day of year
  D: function(date, token, localize2) {
    const dayOfYear = getDayOfYear(date);
    if (token === "Do") {
      return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
    }
    return addLeadingZeros(dayOfYear, token.length);
  },
  // Day of week
  E: function(date, token, localize2) {
    const dayOfWeek = date.getDay();
    switch (token) {
      // Tue
      case "E":
      case "EE":
      case "EEE":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "EEEEE":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "EEEEEE":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "EEEE":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(date, token, localize2, options) {
    const dayOfWeek = date.getDay();
    const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      // Numerical value (Nth day of week with current locale or weekStartsOn)
      case "e":
        return String(localDayOfWeek);
      // Padded numerical value
      case "ee":
        return addLeadingZeros(localDayOfWeek, 2);
      // 1st, 2nd, ..., 7th
      case "eo":
        return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
      case "eee":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "eeeee":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "eeeeee":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "eeee":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(date, token, localize2, options) {
    const dayOfWeek = date.getDay();
    const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      // Numerical value (same as in `e`)
      case "c":
        return String(localDayOfWeek);
      // Padded numerical value
      case "cc":
        return addLeadingZeros(localDayOfWeek, token.length);
      // 1st, 2nd, ..., 7th
      case "co":
        return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
      case "ccc":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "standalone"
        });
      // T
      case "ccccc":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "standalone"
        });
      // Tu
      case "cccccc":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "standalone"
        });
      // Tuesday
      case "cccc":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(date, token, localize2) {
    const dayOfWeek = date.getDay();
    const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
    switch (token) {
      // 2
      case "i":
        return String(isoDayOfWeek);
      // 02
      case "ii":
        return addLeadingZeros(isoDayOfWeek, token.length);
      // 2nd
      case "io":
        return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
      // Tue
      case "iii":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "iiiii":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "iiiiii":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "iiii":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(date, token, localize2) {
    const hours = date.getHours();
    const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(date, token, localize2) {
    const hours = date.getHours();
    let dayPeriodEnumValue;
    if (hours === 12) {
      dayPeriodEnumValue = dayPeriodEnum.noon;
    } else if (hours === 0) {
      dayPeriodEnumValue = dayPeriodEnum.midnight;
    } else {
      dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    }
    switch (token) {
      case "b":
      case "bb":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(date, token, localize2) {
    const hours = date.getHours();
    let dayPeriodEnumValue;
    if (hours >= 17) {
      dayPeriodEnumValue = dayPeriodEnum.evening;
    } else if (hours >= 12) {
      dayPeriodEnumValue = dayPeriodEnum.afternoon;
    } else if (hours >= 4) {
      dayPeriodEnumValue = dayPeriodEnum.morning;
    } else {
      dayPeriodEnumValue = dayPeriodEnum.night;
    }
    switch (token) {
      case "B":
      case "BB":
      case "BBB":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(date, token, localize2) {
    if (token === "ho") {
      let hours = date.getHours() % 12;
      if (hours === 0) hours = 12;
      return localize2.ordinalNumber(hours, { unit: "hour" });
    }
    return lightFormatters.h(date, token);
  },
  // Hour [0-23]
  H: function(date, token, localize2) {
    if (token === "Ho") {
      return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
    }
    return lightFormatters.H(date, token);
  },
  // Hour [0-11]
  K: function(date, token, localize2) {
    const hours = date.getHours() % 12;
    if (token === "Ko") {
      return localize2.ordinalNumber(hours, { unit: "hour" });
    }
    return addLeadingZeros(hours, token.length);
  },
  // Hour [1-24]
  k: function(date, token, localize2) {
    let hours = date.getHours();
    if (hours === 0) hours = 24;
    if (token === "ko") {
      return localize2.ordinalNumber(hours, { unit: "hour" });
    }
    return addLeadingZeros(hours, token.length);
  },
  // Minute
  m: function(date, token, localize2) {
    if (token === "mo") {
      return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
    }
    return lightFormatters.m(date, token);
  },
  // Second
  s: function(date, token, localize2) {
    if (token === "so") {
      return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
    }
    return lightFormatters.s(date, token);
  },
  // Fraction of second
  S: function(date, token) {
    return lightFormatters.S(date, token);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    if (timezoneOffset === 0) {
      return "Z";
    }
    switch (token) {
      // Hours and optional minutes
      case "X":
        return formatTimezoneWithOptionalMinutes(timezoneOffset);
      // Hours, minutes and optional seconds without `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `XX`
      case "XXXX":
      case "XX":
        return formatTimezone(timezoneOffset);
      // Hours, minutes and optional seconds with `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `XXX`
      case "XXXXX":
      case "XXX":
      // Hours and minutes with `:` delimiter
      default:
        return formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    switch (token) {
      // Hours and optional minutes
      case "x":
        return formatTimezoneWithOptionalMinutes(timezoneOffset);
      // Hours, minutes and optional seconds without `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `xx`
      case "xxxx":
      case "xx":
        return formatTimezone(timezoneOffset);
      // Hours, minutes and optional seconds with `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `xxx`
      case "xxxxx":
      case "xxx":
      // Hours and minutes with `:` delimiter
      default:
        return formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (GMT)
  O: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    switch (token) {
      // Short
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + formatTimezoneShort(timezoneOffset, ":");
      // Long
      case "OOOO":
      default:
        return "GMT" + formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    switch (token) {
      // Short
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + formatTimezoneShort(timezoneOffset, ":");
      // Long
      case "zzzz":
      default:
        return "GMT" + formatTimezone(timezoneOffset, ":");
    }
  },
  // Seconds timestamp
  t: function(date, token, _localize) {
    const timestamp = Math.trunc(+date / 1e3);
    return addLeadingZeros(timestamp, token.length);
  },
  // Milliseconds timestamp
  T: function(date, token, _localize) {
    return addLeadingZeros(+date, token.length);
  }
};
function formatTimezoneShort(offset, delimiter = "") {
  const sign = offset > 0 ? "-" : "+";
  const absOffset = Math.abs(offset);
  const hours = Math.trunc(absOffset / 60);
  const minutes = absOffset % 60;
  if (minutes === 0) {
    return sign + String(hours);
  }
  return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
  if (offset % 60 === 0) {
    const sign = offset > 0 ? "-" : "+";
    return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
  }
  return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
  const sign = offset > 0 ? "-" : "+";
  const absOffset = Math.abs(offset);
  const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
  const minutes = addLeadingZeros(absOffset % 60, 2);
  return sign + hours + delimiter + minutes;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/longFormatters.js
var dateLongFormatter = (pattern, formatLong2) => {
  switch (pattern) {
    case "P":
      return formatLong2.date({ width: "short" });
    case "PP":
      return formatLong2.date({ width: "medium" });
    case "PPP":
      return formatLong2.date({ width: "long" });
    case "PPPP":
    default:
      return formatLong2.date({ width: "full" });
  }
};
var timeLongFormatter = (pattern, formatLong2) => {
  switch (pattern) {
    case "p":
      return formatLong2.time({ width: "short" });
    case "pp":
      return formatLong2.time({ width: "medium" });
    case "ppp":
      return formatLong2.time({ width: "long" });
    case "pppp":
    default:
      return formatLong2.time({ width: "full" });
  }
};
var dateTimeLongFormatter = (pattern, formatLong2) => {
  const matchResult = pattern.match(/(P+)(p+)?/) || [];
  const datePattern = matchResult[1];
  const timePattern = matchResult[2];
  if (!timePattern) {
    return dateLongFormatter(pattern, formatLong2);
  }
  let dateTimeFormat;
  switch (datePattern) {
    case "P":
      dateTimeFormat = formatLong2.dateTime({ width: "short" });
      break;
    case "PP":
      dateTimeFormat = formatLong2.dateTime({ width: "medium" });
      break;
    case "PPP":
      dateTimeFormat = formatLong2.dateTime({ width: "long" });
      break;
    case "PPPP":
    default:
      dateTimeFormat = formatLong2.dateTime({ width: "full" });
      break;
  }
  return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
};
var longFormatters = {
  p: timeLongFormatter,
  P: dateTimeLongFormatter
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/protectedTokens.js
var dayOfYearTokenRE = /^D+$/;
var weekYearTokenRE = /^Y+$/;
var throwTokens = ["D", "DD", "YY", "YYYY"];
function isProtectedDayOfYearToken(token) {
  return dayOfYearTokenRE.test(token);
}
function isProtectedWeekYearToken(token) {
  return weekYearTokenRE.test(token);
}
function warnOrThrowProtectedError(token, format7, input) {
  const _message = message(token, format7, input);
  console.warn(_message);
  if (throwTokens.includes(token)) throw new RangeError(_message);
}
function message(token, format7, input) {
  const subject = token[0] === "Y" ? "years" : "days of the month";
  return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format7}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp = /^'([^]*?)'?$/;
var doubleQuoteRegExp = /''/g;
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
function format(date, formatStr, options) {
  const defaultOptions2 = getDefaultOptions();
  const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
  const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
  const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
  const originalDate = toDate(date, options?.in);
  if (!isValid(originalDate)) {
    throw new RangeError("Invalid time value");
  }
  let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
    const firstCharacter = substring[0];
    if (firstCharacter === "p" || firstCharacter === "P") {
      const longFormatter = longFormatters[firstCharacter];
      return longFormatter(substring, locale.formatLong);
    }
    return substring;
  }).join("").match(formattingTokensRegExp).map((substring) => {
    if (substring === "''") {
      return { isToken: false, value: "'" };
    }
    const firstCharacter = substring[0];
    if (firstCharacter === "'") {
      return { isToken: false, value: cleanEscapedString(substring) };
    }
    if (formatters[firstCharacter]) {
      return { isToken: true, value: substring };
    }
    if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
      );
    }
    return { isToken: false, value: substring };
  });
  if (locale.localize.preprocessor) {
    parts = locale.localize.preprocessor(originalDate, parts);
  }
  const formatterOptions = {
    firstWeekContainsDate,
    weekStartsOn,
    locale
  };
  return parts.map((part) => {
    if (!part.isToken) return part.value;
    const token = part.value;
    if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
      warnOrThrowProtectedError(token, formatStr, String(date));
    }
    const formatter = formatters[token[0]];
    return formatter(originalDate, token, locale.localize, formatterOptions);
  }).join("");
}
function cleanEscapedString(input) {
  const matched = input.match(escapedStringRegExp);
  if (!matched) {
    return input;
  }
  return matched[1].replace(doubleQuoteRegExp, "'");
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subDays.js
function subDays(date, amount, options) {
  return addDays(date, -amount, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMonths.js
function subMonths(date, amount, options) {
  return addMonths(date, -amount, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subWeeks.js
function subWeeks(date, amount, options) {
  return addWeeks(date, -amount, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subYears.js
function subYears(date, amount, options) {
  return addYears(date, -amount, options);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/utils/operators.mjs
var import_i18n24 = __toESM(require_i18n(), 1);
var import_element27 = __toESM(require_element(), 1);
var import_date2 = __toESM(require_date(), 1);
var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
var filterTextWrappers = {
  Name: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }),
  Value: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" })
};
function getRelativeDate(value, unit) {
  switch (unit) {
    case "days":
      return subDays(/* @__PURE__ */ new Date(), value);
    case "weeks":
      return subWeeks(/* @__PURE__ */ new Date(), value);
    case "months":
      return subMonths(/* @__PURE__ */ new Date(), value);
    case "years":
      return subYears(/* @__PURE__ */ new Date(), value);
    default:
      return /* @__PURE__ */ new Date();
  }
}
var isNoneOperatorDefinition = {
  /* translators: DataViews operator name */
  label: (0, import_i18n24.__)("Is none of"),
  filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
    (0, import_i18n24.sprintf)(
      /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is none of: Admin, Editor". */
      (0, import_i18n24.__)("<Name>%1$s is none of: </Name><Value>%2$s</Value>"),
      filter.name,
      activeElements.map((element) => element.label).join(", ")
    ),
    filterTextWrappers
  ),
  filter: ((item, field, filterValue) => {
    if (!filterValue?.length) {
      return true;
    }
    const fieldValue = field.getValue({ item });
    if (Array.isArray(fieldValue)) {
      return !filterValue.some(
        (fv) => fieldValue.includes(fv)
      );
    } else if (typeof fieldValue === "string") {
      return !filterValue.includes(fieldValue);
    }
    return false;
  }),
  selection: "multi"
};
var OPERATORS = [
  {
    name: OPERATOR_IS_ANY,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Includes"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is any: Admin, Editor". */
        (0, import_i18n24.__)("<Name>%1$s includes: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements.map((element) => element.label).join(", ")
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (!filterValue?.length) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      if (Array.isArray(fieldValue)) {
        return filterValue.some(
          (fv) => fieldValue.includes(fv)
        );
      } else if (typeof fieldValue === "string") {
        return filterValue.includes(fieldValue);
      }
      return false;
    },
    selection: "multi"
  },
  {
    name: OPERATOR_IS_NONE,
    ...isNoneOperatorDefinition
  },
  {
    name: OPERATOR_IS_ALL,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Includes all"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author includes all: Admin, Editor". */
        (0, import_i18n24.__)("<Name>%1$s includes all: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements.map((element) => element.label).join(", ")
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (!filterValue?.length) {
        return true;
      }
      return filterValue.every((value) => {
        return field.getValue({ item })?.includes(value);
      });
    },
    selection: "multi"
  },
  {
    name: OPERATOR_IS_NOT_ALL,
    ...isNoneOperatorDefinition
  },
  {
    name: OPERATOR_BETWEEN,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Between (inc)"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Item count"). 2: Filter value min. 3: Filter value max. e.g.: "Item count between (inc): 10 and 180". */
        (0, import_i18n24.__)(
          "<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>"
        ),
        filter.name,
        activeElements[0].label[0],
        activeElements[0].label[1]
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (!Array.isArray(filterValue) || filterValue.length !== 2 || filterValue[0] === void 0 || filterValue[1] === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      if (typeof fieldValue === "number" || fieldValue instanceof Date || typeof fieldValue === "string") {
        return fieldValue >= filterValue[0] && fieldValue <= filterValue[1];
      }
      return false;
    },
    selection: "custom"
  },
  {
    name: OPERATOR_IN_THE_PAST,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("In the past"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is in the past: 7 days". */
        (0, import_i18n24.__)(
          "<Name>%1$s is in the past: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        `${activeElements[0].value.value} ${activeElements[0].value.unit}`
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue?.value === void 0 || filterValue?.unit === void 0) {
        return true;
      }
      const targetDate = getRelativeDate(
        filterValue.value,
        filterValue.unit
      );
      const fieldValue = (0, import_date2.getDate)(field.getValue({ item }));
      return fieldValue >= targetDate && fieldValue <= /* @__PURE__ */ new Date();
    },
    selection: "custom"
  },
  {
    name: OPERATOR_OVER,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Over"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is over: 7 days". */
        (0, import_i18n24.__)("<Name>%1$s is over: </Name><Value>%2$s</Value>"),
        filter.name,
        `${activeElements[0].value.value} ${activeElements[0].value.unit}`
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue?.value === void 0 || filterValue?.unit === void 0) {
        return true;
      }
      const targetDate = getRelativeDate(
        filterValue.value,
        filterValue.unit
      );
      const fieldValue = (0, import_date2.getDate)(field.getValue({ item }));
      return fieldValue < targetDate;
    },
    selection: "custom"
  },
  {
    name: OPERATOR_IS,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Is"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is: Admin". */
        (0, import_i18n24.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      return filterValue === field.getValue({ item }) || filterValue === void 0;
    },
    selection: "single"
  },
  {
    name: OPERATOR_IS_NOT,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Is not"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is not: Admin". */
        (0, import_i18n24.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      return filterValue !== field.getValue({ item });
    },
    selection: "single"
  },
  {
    name: OPERATOR_LESS_THAN,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Less than"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than: 10". */
        (0, import_i18n24.__)("<Name>%1$s is less than: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue < filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_GREATER_THAN,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Greater than"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than: 10". */
        (0, import_i18n24.__)(
          "<Name>%1$s is greater than: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue > filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_LESS_THAN_OR_EQUAL,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Less than or equal"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than or equal to: 10". */
        (0, import_i18n24.__)(
          "<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue <= filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_GREATER_THAN_OR_EQUAL,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Greater than or equal"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than or equal to: 10". */
        (0, import_i18n24.__)(
          "<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue >= filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_BEFORE,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Before"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is before: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is before: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date2.getDate)(filterValue);
      const fieldDate = (0, import_date2.getDate)(field.getValue({ item }));
      return fieldDate < filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_AFTER,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("After"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is after: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is after: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date2.getDate)(filterValue);
      const fieldDate = (0, import_date2.getDate)(field.getValue({ item }));
      return fieldDate > filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_BEFORE_INC,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Before (inc)"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or before: 2024-01-01". */
        (0, import_i18n24.__)(
          "<Name>%1$s is on or before: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date2.getDate)(filterValue);
      const fieldDate = (0, import_date2.getDate)(field.getValue({ item }));
      return fieldDate <= filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_AFTER_INC,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("After (inc)"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or after: 2024-01-01". */
        (0, import_i18n24.__)(
          "<Name>%1$s is on or after: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date2.getDate)(filterValue);
      const fieldDate = (0, import_date2.getDate)(field.getValue({ item }));
      return fieldDate >= filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_CONTAINS,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Contains"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title contains: Hello". */
        (0, import_i18n24.__)("<Name>%1$s contains: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().includes(String(filterValue).toLowerCase());
    },
    selection: "single"
  },
  {
    name: OPERATOR_NOT_CONTAINS,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Doesn't contain"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title doesn't contain: Hello". */
        (0, import_i18n24.__)(
          "<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return typeof fieldValue === "string" && filterValue && !fieldValue.toLowerCase().includes(String(filterValue).toLowerCase());
    },
    selection: "single"
  },
  {
    name: OPERATOR_STARTS_WITH,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Starts with"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title starts with: Hello". */
        (0, import_i18n24.__)("<Name>%1$s starts with: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().startsWith(String(filterValue).toLowerCase());
    },
    selection: "single"
  },
  {
    name: OPERATOR_ON,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("On"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date2.getDate)(filterValue);
      const fieldDate = (0, import_date2.getDate)(field.getValue({ item }));
      return filterDate.getTime() === fieldDate.getTime();
    },
    selection: "single"
  },
  {
    name: OPERATOR_NOT_ON,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Not on"),
    filterText: (filter, activeElements) => (0, import_element27.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is not: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date2.getDate)(filterValue);
      const fieldDate = (0, import_date2.getDate)(field.getValue({ item }));
      return filterDate.getTime() !== fieldDate.getTime();
    },
    selection: "single"
  }
];
var getOperatorByName = (name) => OPERATORS.find((op) => op.name === name);
var getAllOperatorNames = () => OPERATORS.map((op) => op.name);
var isSingleSelectionOperator = (name) => OPERATORS.filter((op) => op.selection === "single").some(
  (op) => op.name === name
);
var isRegisteredOperator = (name) => OPERATORS.some((op) => op.name === name);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.mjs
var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1);
var ENTER = "Enter";
var SPACE = " ";
var FilterText = ({
  activeElements,
  filterInView,
  filter
}) => {
  if (activeElements === void 0 || activeElements.length === 0) {
    return filter.name;
  }
  const operator = getOperatorByName(filterInView?.operator);
  if (operator !== void 0) {
    return operator.filterText(filter, activeElements);
  }
  return (0, import_i18n25.sprintf)(
    /* translators: 1: Filter name e.g.: "Unknown status for Author". */
    (0, import_i18n25.__)("Unknown status for %1$s"),
    filter.name
  );
};
function OperatorSelector({
  filter,
  view,
  onChangeView
}) {
  const operatorOptions = filter.operators?.map((operator) => ({
    value: operator,
    label: getOperatorByName(operator)?.label || operator
  }));
  const currentFilter = view.filters?.find(
    (_filter) => _filter.field === filter.field
  );
  const value = currentFilter?.operator || filter.operators[0];
  return operatorOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
    Stack,
    {
      direction: "row",
      gap: "xs",
      justify: "flex-start",
      className: "dataviews-filters__summary-operators-container",
      align: "center",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components24.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          import_components24.SelectControl,
          {
            className: "dataviews-filters__summary-operators-filter-select",
            label: (0, import_i18n25.__)("Conditions"),
            value,
            options: operatorOptions,
            onChange: (newValue) => {
              const newOperator = newValue;
              const currentOperator = currentFilter?.operator;
              const newFilters = currentFilter ? [
                ...(view.filters ?? []).map(
                  (_filter) => {
                    if (_filter.field === filter.field) {
                      const currentOpSelectionModel = getOperatorByName(
                        currentOperator
                      )?.selection;
                      const newOpSelectionModel = getOperatorByName(
                        newOperator
                      )?.selection;
                      const shouldResetValue = currentOpSelectionModel !== newOpSelectionModel || [
                        currentOpSelectionModel,
                        newOpSelectionModel
                      ].includes("custom");
                      return {
                        ..._filter,
                        value: shouldResetValue ? void 0 : _filter.value,
                        operator: newOperator
                      };
                    }
                    return _filter;
                  }
                )
              ] : [
                ...view.filters ?? [],
                {
                  field: filter.field,
                  operator: newOperator,
                  value: void 0
                }
              ];
              onChangeView({
                ...view,
                page: 1,
                filters: newFilters
              });
            },
            size: "small",
            variant: "minimal",
            hideLabelFromVision: true
          }
        )
      ]
    }
  );
}
function Filter({
  addFilterRef,
  openedFilter,
  fields,
  ...commonProps
}) {
  const toggleRef = (0, import_element28.useRef)(null);
  const { filter, view, onChangeView } = commonProps;
  const filterInView = view.filters?.find(
    (f2) => f2.field === filter.field
  );
  let activeElements = [];
  const field = (0, import_element28.useMemo)(() => {
    const currentField = fields.find((f2) => f2.id === filter.field);
    if (currentField) {
      return {
        ...currentField,
        // Configure getValue as if Item was a plain object.
        // See related input-widget.tsx
        getValue: ({ item }) => item[currentField.id]
      };
    }
    return currentField;
  }, [fields, filter.field]);
  const { elements } = useElements({
    elements: filter.elements,
    getElements: filter.getElements
  });
  if (elements.length > 0) {
    activeElements = elements.filter((element) => {
      if (filter.singleSelection) {
        return element.value === filterInView?.value;
      }
      return filterInView?.value?.includes(element.value);
    });
  } else if (Array.isArray(filterInView?.value)) {
    const label = filterInView.value.map((v2) => {
      const formattedValue = field?.getValueFormatted({
        item: { [field.id]: v2 },
        field
      });
      return formattedValue || String(v2);
    });
    activeElements = [
      {
        value: filterInView.value,
        // @ts-ignore
        label
      }
    ];
  } else if (typeof filterInView?.value === "object") {
    activeElements = [
      { value: filterInView.value, label: filterInView.value }
    ];
  } else if (filterInView?.value !== void 0) {
    const label = field !== void 0 ? field.getValueFormatted({
      item: { [field.id]: filterInView.value },
      field
    }) : String(filterInView.value);
    activeElements = [
      {
        value: filterInView.value,
        label
      }
    ];
  }
  const isPrimary = filter.isPrimary;
  const isLocked = filterInView?.isLocked;
  const hasValues = !isLocked && filterInView?.value !== void 0;
  const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
  return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
    import_components24.Dropdown,
    {
      defaultOpen: openedFilter === filter.field,
      contentClassName: "dataviews-filters__summary-popover",
      popoverProps: { placement: "bottom-start", role: "dialog" },
      onClose: () => {
        toggleRef.current?.focus();
      },
      renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          import_components24.Tooltip,
          {
            text: (0, import_i18n25.sprintf)(
              /* translators: 1: Filter name. */
              (0, import_i18n25.__)("Filter by: %1$s"),
              filter.name.toLowerCase()
            ),
            placement: "top",
            children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              "div",
              {
                className: clsx_default(
                  "dataviews-filters__summary-chip",
                  {
                    "has-reset": canResetOrRemove,
                    "has-values": hasValues,
                    "is-not-clickable": isLocked
                  }
                ),
                role: "button",
                tabIndex: isLocked ? -1 : 0,
                onClick: () => {
                  if (!isLocked) {
                    onToggle();
                  }
                },
                onKeyDown: (event) => {
                  if (!isLocked && [ENTER, SPACE].includes(event.key)) {
                    onToggle();
                    event.preventDefault();
                  }
                },
                "aria-disabled": isLocked,
                "aria-pressed": isOpen,
                "aria-expanded": isOpen,
                ref: toggleRef,
                children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
                  FilterText,
                  {
                    activeElements,
                    filterInView,
                    filter
                  }
                )
              }
            )
          }
        ),
        canResetOrRemove && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          import_components24.Tooltip,
          {
            text: isPrimary ? (0, import_i18n25.__)("Reset") : (0, import_i18n25.__)("Remove"),
            placement: "top",
            children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              "button",
              {
                className: clsx_default(
                  "dataviews-filters__summary-chip-remove",
                  { "has-values": hasValues }
                ),
                onClick: () => {
                  onChangeView({
                    ...view,
                    page: 1,
                    filters: view.filters?.filter(
                      (_filter) => _filter.field !== filter.field
                    )
                  });
                  if (!isPrimary) {
                    addFilterRef.current?.focus();
                  } else {
                    toggleRef.current?.focus();
                  }
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components24.Icon, { icon: close_small_default })
              }
            )
          }
        )
      ] }),
      renderContent: () => {
        return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Stack, { direction: "column", justify: "flex-start", children: [
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(OperatorSelector, { ...commonProps }),
          commonProps.filter.hasElements ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
            SearchWidget,
            {
              ...commonProps,
              filter: {
                ...commonProps.filter,
                elements
              }
            }
          ) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(InputWidget, { ...commonProps, fields })
        ] });
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.mjs
var import_components25 = __toESM(require_components(), 1);
var import_i18n26 = __toESM(require_i18n(), 1);
var import_element29 = __toESM(require_element(), 1);
var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu4 } = unlock(import_components25.privateApis);
function AddFilterMenu({
  filters: filters2,
  view,
  onChangeView,
  setOpenedFilter,
  triggerProps
}) {
  const inactiveFilters = filters2.filter((filter) => !filter.isVisible);
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(Menu4, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Menu4.TriggerButton, { ...triggerProps }),
    /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Menu4.Popover, { children: inactiveFilters.map((filter) => {
      return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
        Menu4.Item,
        {
          onClick: () => {
            setOpenedFilter(filter.field);
            onChangeView({
              ...view,
              page: 1,
              filters: [
                ...view.filters || [],
                {
                  field: filter.field,
                  value: void 0,
                  operator: filter.operators[0]
                }
              ]
            });
          },
          children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Menu4.ItemLabel, { children: filter.name })
        },
        filter.field
      );
    }) })
  ] });
}
function AddFilter({ filters: filters2, view, onChangeView, setOpenedFilter }, ref) {
  if (!filters2.length || filters2.every(({ isPrimary }) => isPrimary)) {
    return null;
  }
  const inactiveFilters = filters2.filter((filter) => !filter.isVisible);
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
    AddFilterMenu,
    {
      triggerProps: {
        render: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
          import_components25.Button,
          {
            accessibleWhenDisabled: true,
            size: "compact",
            className: "dataviews-filters-button",
            variant: "tertiary",
            disabled: !inactiveFilters.length,
            ref
          }
        ),
        children: (0, import_i18n26.__)("Add filter")
      },
      ...{ filters: filters2, view, onChangeView, setOpenedFilter }
    }
  );
}
var add_filter_default = (0, import_element29.forwardRef)(AddFilter);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.mjs
var import_components26 = __toESM(require_components(), 1);
var import_i18n27 = __toESM(require_i18n(), 1);
var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
function ResetFilter({
  filters: filters2,
  view,
  onChangeView
}) {
  const isPrimary = (field) => filters2.some(
    (_filter) => _filter.field === field && _filter.isPrimary
  );
  const isDisabled = !view.search && !view.filters?.some(
    (_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
  );
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
    import_components26.Button,
    {
      disabled: isDisabled,
      accessibleWhenDisabled: true,
      size: "compact",
      variant: "tertiary",
      className: "dataviews-filters__reset-button",
      onClick: () => {
        onChangeView({
          ...view,
          page: 1,
          search: "",
          filters: view.filters?.filter((f2) => !!f2.isLocked) || []
        });
      },
      children: (0, import_i18n27.__)("Reset")
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.mjs
var import_element30 = __toESM(require_element(), 1);
function useFilters(fields, view) {
  return (0, import_element30.useMemo)(() => {
    const filters2 = [];
    fields.forEach((field) => {
      if (field.filterBy === false || !field.hasElements && !field.Edit) {
        return;
      }
      const operators = field.filterBy.operators;
      const isPrimary = !!field.filterBy?.isPrimary;
      const isLocked = view.filters?.some(
        (f2) => f2.field === field.id && !!f2.isLocked
      ) ?? false;
      filters2.push({
        field: field.id,
        name: field.label,
        elements: field.elements,
        getElements: field.getElements,
        hasElements: field.hasElements,
        singleSelection: operators.some(
          (op) => isSingleSelectionOperator(op)
        ),
        operators,
        isVisible: isLocked || isPrimary || !!view.filters?.some(
          (f2) => f2.field === field.id && isRegisteredOperator(f2.operator)
        ),
        isPrimary,
        isLocked
      });
    });
    filters2.sort((a2, b2) => {
      if (a2.isLocked && !b2.isLocked) {
        return -1;
      }
      if (!a2.isLocked && b2.isLocked) {
        return 1;
      }
      if (a2.isPrimary && !b2.isPrimary) {
        return -1;
      }
      if (!a2.isPrimary && b2.isPrimary) {
        return 1;
      }
      return a2.name.localeCompare(b2.name);
    });
    return filters2;
  }, [fields, view]);
}
var use_filters_default = useFilters;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.mjs
var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1);
function Filters({ className }) {
  const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0, import_element31.useContext)(dataviews_context_default);
  const addFilterRef = (0, import_element31.useRef)(null);
  const filters2 = use_filters_default(fields, view);
  const addFilter = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
    add_filter_default,
    {
      filters: filters2,
      view,
      onChangeView,
      ref: addFilterRef,
      setOpenedFilter
    },
    "add-filter"
  );
  const visibleFilters = filters2.filter((filter) => filter.isVisible);
  if (visibleFilters.length === 0) {
    return null;
  }
  const filterComponents = [
    ...visibleFilters.map((filter) => {
      return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
        Filter,
        {
          filter,
          view,
          fields,
          onChangeView,
          addFilterRef,
          openedFilter
        },
        filter.field
      );
    }),
    addFilter
  ];
  filterComponents.push(
    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
      ResetFilter,
      {
        filters: filters2,
        view,
        onChangeView
      },
      "reset-filters"
    )
  );
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
    Stack,
    {
      direction: "row",
      justify: "flex-start",
      gap: "xs",
      style: { width: "fit-content" },
      wrap: "wrap",
      className,
      children: filterComponents
    }
  );
}
var filters_default = (0, import_element31.memo)(Filters);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.mjs
var import_element32 = __toESM(require_element(), 1);
var import_components27 = __toESM(require_components(), 1);
var import_i18n28 = __toESM(require_i18n(), 1);
var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1);
function FiltersToggle() {
  const {
    filters: filters2,
    view,
    onChangeView,
    setOpenedFilter,
    isShowingFilter,
    setIsShowingFilter
  } = (0, import_element32.useContext)(dataviews_context_default);
  const buttonRef = (0, import_element32.useRef)(null);
  const onChangeViewWithFilterVisibility = (0, import_element32.useCallback)(
    (_view) => {
      onChangeView(_view);
      setIsShowingFilter(true);
    },
    [onChangeView, setIsShowingFilter]
  );
  const visibleFilters = filters2.filter((filter) => filter.isVisible);
  const hasVisibleFilters = !!visibleFilters.length;
  if (filters2.length === 0) {
    return null;
  }
  const addFilterButtonProps = {
    label: (0, import_i18n28.__)("Add filter"),
    "aria-expanded": false,
    isPressed: false
  };
  const toggleFiltersButtonProps = {
    label: (0, import_i18n28._x)("Filter", "verb"),
    "aria-expanded": isShowingFilter,
    isPressed: isShowingFilter,
    onClick: () => {
      if (!isShowingFilter) {
        setOpenedFilter(null);
      }
      setIsShowingFilter(!isShowingFilter);
    }
  };
  const buttonComponent = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
    import_components27.Button,
    {
      ref: buttonRef,
      className: "dataviews-filters__visibility-toggle",
      size: "compact",
      icon: funnel_default,
      ...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
    }
  );
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
    AddFilterMenu,
    {
      filters: filters2,
      view,
      onChangeView: onChangeViewWithFilterVisibility,
      setOpenedFilter,
      triggerProps: { render: buttonComponent }
    }
  ) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
    FilterVisibilityToggle,
    {
      buttonRef,
      filtersCount: view.filters?.length,
      children: buttonComponent
    }
  ) });
}
function FilterVisibilityToggle({
  buttonRef,
  filtersCount,
  children
}) {
  (0, import_element32.useEffect)(
    () => () => {
      buttonRef.current?.focus();
    },
    [buttonRef]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
    children,
    !!filtersCount && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
  ] });
}
var toggle_default = FiltersToggle;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.mjs
var import_element33 = __toESM(require_element(), 1);
var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1);
function FiltersToggled(props) {
  const { isShowingFilter } = (0, import_element33.useContext)(dataviews_context_default);
  if (!isShowingFilter) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(filters_default, { ...props });
}
var filters_toggled_default = FiltersToggled;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.mjs
var import_element34 = __toESM(require_element(), 1);
var import_i18n29 = __toESM(require_i18n(), 1);
var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
function DataViewsLayout({ className }) {
  const {
    actions: actions2 = [],
    data,
    fields,
    getItemId: getItemId2,
    getItemLevel,
    isLoading,
    view,
    onChangeView,
    selection,
    onChangeSelection,
    setOpenedFilter,
    onClickItem,
    isItemClickable,
    renderItemLink,
    defaultLayouts: defaultLayouts3,
    empty = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: (0, import_i18n29.__)("No results") })
  } = (0, import_element34.useContext)(dataviews_context_default);
  const ViewComponent = VIEW_LAYOUTS.find(
    (v2) => v2.type === view.type && defaultLayouts3[v2.type]
  )?.component;
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
    ViewComponent,
    {
      className,
      actions: actions2,
      data,
      fields,
      getItemId: getItemId2,
      getItemLevel,
      isLoading,
      onChangeView,
      onChangeSelection,
      selection,
      setOpenedFilter,
      onClickItem,
      renderItemLink,
      isItemClickable,
      view,
      empty
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.mjs
var import_element35 = __toESM(require_element(), 1);
var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1);
var EMPTY_ARRAY6 = [];
function DataViewsFooter() {
  const {
    view,
    paginationInfo: { totalItems = 0, totalPages },
    data,
    actions: actions2 = EMPTY_ARRAY6
  } = (0, import_element35.useContext)(dataviews_context_default);
  const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions2, data) && [LAYOUT_TABLE, LAYOUT_GRID].includes(view.type);
  if (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions) {
    return null;
  }
  return !!totalItems && /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
    Stack,
    {
      direction: "row",
      justify: "end",
      align: "center",
      className: "dataviews-footer",
      gap: "xs",
      children: [
        hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(BulkActionsFooter, {}),
        /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(dataviews_pagination_default, {})
      ]
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.mjs
var import_i18n30 = __toESM(require_i18n(), 1);
var import_element36 = __toESM(require_element(), 1);
var import_components28 = __toESM(require_components(), 1);
var import_compose10 = __toESM(require_compose(), 1);
var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
var DataViewsSearch = (0, import_element36.memo)(function Search({ label }) {
  const { view, onChangeView } = (0, import_element36.useContext)(dataviews_context_default);
  const [search, setSearch, debouncedSearch] = (0, import_compose10.useDebouncedInput)(
    view.search
  );
  (0, import_element36.useEffect)(() => {
    setSearch(view.search ?? "");
  }, [view.search, setSearch]);
  const onChangeViewRef = (0, import_element36.useRef)(onChangeView);
  const viewRef = (0, import_element36.useRef)(view);
  (0, import_element36.useEffect)(() => {
    onChangeViewRef.current = onChangeView;
    viewRef.current = view;
  }, [onChangeView, view]);
  (0, import_element36.useEffect)(() => {
    if (debouncedSearch !== viewRef.current?.search) {
      onChangeViewRef.current({
        ...viewRef.current,
        page: 1,
        search: debouncedSearch
      });
    }
  }, [debouncedSearch]);
  const searchLabel = label || (0, import_i18n30.__)("Search");
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
    import_components28.SearchControl,
    {
      className: "dataviews-search",
      onChange: setSearch,
      value: search,
      label: searchLabel,
      placeholder: searchLabel,
      size: "compact"
    }
  );
});
var dataviews_search_default = DataViewsSearch;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.mjs
var import_components30 = __toESM(require_components(), 1);
var import_i18n32 = __toESM(require_i18n(), 1);
var import_element38 = __toESM(require_element(), 1);
var import_warning = __toESM(require_warning(), 1);
var import_compose11 = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/infinite-scroll-toggle.mjs
var import_components29 = __toESM(require_components(), 1);
var import_i18n31 = __toESM(require_i18n(), 1);
var import_element37 = __toESM(require_element(), 1);
var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1);
function InfiniteScrollToggle() {
  const context = (0, import_element37.useContext)(dataviews_context_default);
  const { view, onChangeView } = context;
  const infiniteScrollEnabled = view.infiniteScrollEnabled ?? false;
  if (!context.hasInfiniteScrollHandler) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
    import_components29.ToggleControl,
    {
      label: (0, import_i18n31.__)("Enable infinite scroll"),
      help: (0, import_i18n31.__)(
        "Automatically load more content as you scroll, instead of showing pagination links."
      ),
      checked: infiniteScrollEnabled,
      onChange: (newValue) => {
        onChangeView({
          ...view,
          infiniteScrollEnabled: newValue
        });
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.mjs
var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu5 } = unlock(import_components30.privateApis);
var DATAVIEWS_CONFIG_POPOVER_PROPS = {
  className: "dataviews-config__popover",
  placement: "bottom-end",
  offset: 9
};
function ViewTypeMenu() {
  const { view, onChangeView, defaultLayouts: defaultLayouts3 } = (0, import_element38.useContext)(dataviews_context_default);
  const availableLayouts = Object.keys(defaultLayouts3);
  if (availableLayouts.length <= 1) {
    return null;
  }
  const activeView = VIEW_LAYOUTS.find((v2) => view.type === v2.type);
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(Menu5, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
      Menu5.TriggerButton,
      {
        render: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
          import_components30.Button,
          {
            size: "compact",
            icon: activeView?.icon,
            label: (0, import_i18n32.__)("Layout")
          }
        )
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Menu5.Popover, { children: availableLayouts.map((layout) => {
      const config = VIEW_LAYOUTS.find(
        (v2) => v2.type === layout
      );
      if (!config) {
        return null;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
        Menu5.RadioItem,
        {
          value: layout,
          name: "view-actions-available-view",
          checked: layout === view.type,
          hideOnClick: true,
          onChange: (e2) => {
            switch (e2.target.value) {
              case "list":
              case "grid":
              case "table":
              case "pickerGrid":
              case "pickerTable":
              case "activity":
                const viewWithoutLayout = { ...view };
                if ("layout" in viewWithoutLayout) {
                  delete viewWithoutLayout.layout;
                }
                return onChangeView({
                  ...viewWithoutLayout,
                  type: e2.target.value,
                  ...defaultLayouts3[e2.target.value]
                });
            }
            (0, import_warning.default)("Invalid dataview");
          },
          children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(Menu5.ItemLabel, { children: config.label })
        },
        layout
      );
    }) })
  ] });
}
function SortFieldControl() {
  const { view, fields, onChangeView } = (0, import_element38.useContext)(dataviews_context_default);
  const orderOptions = (0, import_element38.useMemo)(() => {
    const sortableFields = fields.filter(
      (field) => field.enableSorting !== false
    );
    return sortableFields.map((field) => {
      return {
        label: field.label,
        value: field.id
      };
    });
  }, [fields]);
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
    import_components30.SelectControl,
    {
      __next40pxDefaultSize: true,
      label: (0, import_i18n32.__)("Sort by"),
      value: view.sort?.field,
      options: orderOptions,
      onChange: (value) => {
        onChangeView({
          ...view,
          sort: {
            direction: view?.sort?.direction || "desc",
            field: value
          },
          showLevels: false
        });
      }
    }
  );
}
function SortDirectionControl() {
  const { view, fields, onChangeView } = (0, import_element38.useContext)(dataviews_context_default);
  const sortableFields = fields.filter(
    (field) => field.enableSorting !== false
  );
  if (sortableFields.length === 0) {
    return null;
  }
  let value = view.sort?.direction;
  if (!value && view.sort?.field) {
    value = "desc";
  }
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
    import_components30.__experimentalToggleGroupControl,
    {
      className: "dataviews-view-config__sort-direction",
      __next40pxDefaultSize: true,
      isBlock: true,
      label: (0, import_i18n32.__)("Order"),
      value,
      onChange: (newDirection) => {
        if (newDirection === "asc" || newDirection === "desc") {
          onChangeView({
            ...view,
            sort: {
              direction: newDirection,
              field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field.
              fields.find(
                (field) => field.enableSorting !== false
              )?.id || ""
            },
            showLevels: false
          });
          return;
        }
        (0, import_warning.default)("Invalid direction");
      },
      children: SORTING_DIRECTIONS.map((direction) => {
        return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
          import_components30.__experimentalToggleGroupControlOptionIcon,
          {
            value: direction,
            icon: sortIcons[direction],
            label: sortLabels[direction]
          },
          direction
        );
      })
    }
  );
}
function ItemsPerPageControl() {
  const { view, config, onChangeView } = (0, import_element38.useContext)(dataviews_context_default);
  const { infiniteScrollEnabled } = view;
  if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
    import_components30.__experimentalToggleGroupControl,
    {
      __next40pxDefaultSize: true,
      isBlock: true,
      label: (0, import_i18n32.__)("Items per page"),
      value: view.perPage || 10,
      disabled: !view?.sort?.field,
      onChange: (newItemsPerPage) => {
        const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10);
        onChangeView({
          ...view,
          perPage: newItemsPerPageNumber,
          page: 1
        });
      },
      children: config.perPageSizes.map((value) => {
        return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
          import_components30.__experimentalToggleGroupControlOption,
          {
            value,
            label: value.toString()
          },
          value
        );
      })
    }
  );
}
function SettingsSection({
  title,
  description,
  children
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_components30.__experimentalGrid, { columns: 12, className: "dataviews-settings-section", gap: 4, children: [
    /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "dataviews-settings-section__sidebar", children: [
      /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
        import_components30.__experimentalHeading,
        {
          level: 2,
          className: "dataviews-settings-section__title",
          children: title
        }
      ),
      description && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
        import_components30.__experimentalText,
        {
          variant: "muted",
          className: "dataviews-settings-section__description",
          children: description
        }
      )
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
      import_components30.__experimentalGrid,
      {
        columns: 8,
        gap: 4,
        className: "dataviews-settings-section__content",
        children
      }
    )
  ] });
}
function DataviewsViewConfigDropdown() {
  const { view } = (0, import_element38.useContext)(dataviews_context_default);
  const popoverId = (0, import_compose11.useInstanceId)(
    _DataViewsViewConfig,
    "dataviews-view-config-dropdown"
  );
  const activeLayout = VIEW_LAYOUTS.find(
    (layout) => layout.type === view.type
  );
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
    import_components30.Dropdown,
    {
      expandOnMobile: true,
      popoverProps: {
        ...DATAVIEWS_CONFIG_POPOVER_PROPS,
        id: popoverId
      },
      renderToggle: ({ onToggle, isOpen }) => {
        return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
          import_components30.Button,
          {
            size: "compact",
            icon: cog_default,
            label: (0, import_i18n32._x)("View options", "View is used as a noun"),
            onClick: onToggle,
            "aria-expanded": isOpen ? "true" : "false",
            "aria-controls": popoverId
          }
        );
      },
      renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
        import_components30.__experimentalDropdownContentWrapper,
        {
          paddingSize: "medium",
          className: "dataviews-config__popover-content-wrapper",
          children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
            Stack,
            {
              direction: "column",
              className: "dataviews-view-config",
              gap: "lg",
              children: /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(SettingsSection, { title: (0, import_i18n32.__)("Appearance"), children: [
                /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(
                  Stack,
                  {
                    direction: "row",
                    gap: "xs",
                    className: "is-divided-in-two",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SortFieldControl, {}),
                      /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(SortDirectionControl, {})
                    ]
                  }
                ),
                !!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(activeLayout.viewConfigOptions, {}),
                /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(InfiniteScrollToggle, {}),
                /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ItemsPerPageControl, {}),
                /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(PropertiesSection, {})
              ] })
            }
          )
        }
      )
    }
  );
}
function _DataViewsViewConfig() {
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(ViewTypeMenu, {}),
    /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(DataviewsViewConfigDropdown, {})
  ] });
}
var DataViewsViewConfig = (0, import_element38.memo)(_DataViewsViewConfig);
var dataviews_view_config_default = DataViewsViewConfig;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/checkbox.mjs
var import_components31 = __toESM(require_components(), 1);
var import_element39 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/get-custom-validity.mjs
function getCustomValidity(isValid2, validity) {
  let customValidity;
  if (isValid2?.required && validity?.required) {
    customValidity = validity?.required?.message ? validity.required : void 0;
  } else if (isValid2?.pattern && validity?.pattern) {
    customValidity = validity.pattern;
  } else if (isValid2?.min && validity?.min) {
    customValidity = validity.min;
  } else if (isValid2?.max && validity?.max) {
    customValidity = validity.max;
  } else if (isValid2?.minLength && validity?.minLength) {
    customValidity = validity.minLength;
  } else if (isValid2?.maxLength && validity?.maxLength) {
    customValidity = validity.maxLength;
  } else if (isValid2?.elements && validity?.elements) {
    customValidity = validity.elements;
  } else if (validity?.custom) {
    customValidity = validity.custom;
  }
  return customValidity;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/checkbox.mjs
var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1);
var { ValidatedCheckboxControl } = unlock(import_components31.privateApis);
function Checkbox({
  field,
  onChange,
  data,
  hideLabelFromVision,
  validity
}) {
  const { getValue, setValue, label, description, isValid: isValid2 } = field;
  const onChangeControl = (0, import_element39.useCallback)(() => {
    onChange(
      setValue({ item: data, value: !getValue({ item: data }) })
    );
  }, [data, getValue, onChange, setValue]);
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
    ValidatedCheckboxControl,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      hidden: hideLabelFromVision,
      label,
      help: description,
      checked: getValue({ item: data }),
      onChange: onChangeControl
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/combobox.mjs
var import_components32 = __toESM(require_components(), 1);
var import_element40 = __toESM(require_element(), 1);
var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
var { ValidatedComboboxControl } = unlock(import_components32.privateApis);
function Combobox3({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { label, description, placeholder, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data }) ?? "";
  const onChangeControl = (0, import_element40.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue ?? "" })),
    [data, onChange, setValue]
  );
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_components32.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
    ValidatedComboboxControl,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      value,
      help: description,
      placeholder,
      options: elements,
      onChange: onChangeControl,
      hideLabelFromVision,
      allowReset: true,
      expandOnFocus: true
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/datetime.mjs
var import_components34 = __toESM(require_components(), 1);
var import_element42 = __toESM(require_element(), 1);
var import_i18n34 = __toESM(require_i18n(), 1);
var import_date4 = __toESM(require_date(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/relative-date-control.mjs
var import_components33 = __toESM(require_components(), 1);
var import_element41 = __toESM(require_element(), 1);
var import_i18n33 = __toESM(require_i18n(), 1);
var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
var TIME_UNITS_OPTIONS = {
  [OPERATOR_IN_THE_PAST]: [
    { value: "days", label: (0, import_i18n33.__)("Days") },
    { value: "weeks", label: (0, import_i18n33.__)("Weeks") },
    { value: "months", label: (0, import_i18n33.__)("Months") },
    { value: "years", label: (0, import_i18n33.__)("Years") }
  ],
  [OPERATOR_OVER]: [
    { value: "days", label: (0, import_i18n33.__)("Days ago") },
    { value: "weeks", label: (0, import_i18n33.__)("Weeks ago") },
    { value: "months", label: (0, import_i18n33.__)("Months ago") },
    { value: "years", label: (0, import_i18n33.__)("Years ago") }
  ]
};
function RelativeDateControl({
  className,
  data,
  field,
  onChange,
  hideLabelFromVision,
  operator
}) {
  const options = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
  const { id, label, getValue, setValue } = field;
  const fieldValue = getValue({ item: data });
  const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
  const onChangeValue = (0, import_element41.useCallback)(
    (newValue) => onChange(
      setValue({
        item: data,
        value: { value: Number(newValue), unit }
      })
    ),
    [onChange, setValue, data, unit]
  );
  const onChangeUnit = (0, import_element41.useCallback)(
    (newUnit) => onChange(
      setValue({
        item: data,
        value: { value: relValue, unit: newUnit }
      })
    ),
    [onChange, setValue, data, relValue]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
    import_components33.BaseControl,
    {
      id,
      className: clsx_default(className, "dataviews-controls__relative-date"),
      label,
      hideLabelFromVision,
      children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Stack, { direction: "row", gap: "xs", children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          import_components33.__experimentalNumberControl,
          {
            __next40pxDefaultSize: true,
            className: "dataviews-controls__relative-date-number",
            spinControls: "none",
            min: 1,
            step: 1,
            value: relValue,
            onChange: onChangeValue
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          import_components33.SelectControl,
          {
            className: "dataviews-controls__relative-date-unit",
            __next40pxDefaultSize: true,
            label: (0, import_i18n33.__)("Unit"),
            value: unit,
            options,
            onChange: onChangeUnit,
            hideLabelFromVision: true
          }
        )
      ] })
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.mjs
var import_date3 = __toESM(require_date(), 1);
function parseDateTime(dateTimeString) {
  if (!dateTimeString) {
    return null;
  }
  const parsed = (0, import_date3.getDate)(dateTimeString);
  return parsed && isValid(parsed) ? parsed : null;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/datetime.mjs
var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
var { DateCalendar, ValidatedInputControl } = unlock(import_components34.privateApis);
var formatDateTime = (date) => {
  if (!date) {
    return "";
  }
  if (typeof date === "string") {
    return date;
  }
  return format(date, "yyyy-MM-dd'T'HH:mm");
};
function CalendarDateTimeControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { id, label, description, setValue, getValue, isValid: isValid2 } = field;
  const fieldValue = getValue({ item: data });
  const value = typeof fieldValue === "string" ? fieldValue : void 0;
  const [calendarMonth, setCalendarMonth] = (0, import_element42.useState)(() => {
    const parsedDate = parseDateTime(value);
    return parsedDate || /* @__PURE__ */ new Date();
  });
  const inputControlRef = (0, import_element42.useRef)(null);
  const validationTimeoutRef = (0, import_element42.useRef)();
  const previousFocusRef = (0, import_element42.useRef)(null);
  const onChangeCallback = (0, import_element42.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  (0, import_element42.useEffect)(() => {
    return () => {
      if (validationTimeoutRef.current) {
        clearTimeout(validationTimeoutRef.current);
      }
    };
  }, []);
  const onSelectDate = (0, import_element42.useCallback)(
    (newDate) => {
      let dateTimeValue;
      if (newDate) {
        let finalDateTime = newDate;
        if (value) {
          const currentDateTime = parseDateTime(value);
          if (currentDateTime) {
            finalDateTime = new Date(newDate);
            finalDateTime.setHours(currentDateTime.getHours());
            finalDateTime.setMinutes(
              currentDateTime.getMinutes()
            );
          }
        }
        dateTimeValue = finalDateTime.toISOString();
        onChangeCallback(dateTimeValue);
        if (validationTimeoutRef.current) {
          clearTimeout(validationTimeoutRef.current);
        }
      } else {
        onChangeCallback(void 0);
      }
      previousFocusRef.current = inputControlRef.current && inputControlRef.current.ownerDocument.activeElement;
      validationTimeoutRef.current = setTimeout(() => {
        if (inputControlRef.current) {
          inputControlRef.current.focus();
          inputControlRef.current.blur();
          onChangeCallback(dateTimeValue);
          if (previousFocusRef.current && previousFocusRef.current instanceof HTMLElement) {
            previousFocusRef.current.focus();
          }
        }
      }, 0);
    },
    [onChangeCallback, value]
  );
  const handleManualDateTimeChange = (0, import_element42.useCallback)(
    (newValue) => {
      if (newValue) {
        const dateTime = new Date(newValue);
        onChangeCallback(dateTime.toISOString());
        const parsedDate = parseDateTime(dateTime.toISOString());
        if (parsedDate) {
          setCalendarMonth(parsedDate);
        }
      } else {
        onChangeCallback(void 0);
      }
    },
    [onChangeCallback]
  );
  const { format: fieldFormat } = field;
  const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date4.getSettings)().l10n.startOfWeek;
  const {
    timezone: { string: timezoneString }
  } = (0, import_date4.getSettings)();
  const displayLabel = isValid2?.required && !hideLabelFromVision ? `${label} (${(0, import_i18n34.__)("Required")})` : label;
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
    import_components34.BaseControl,
    {
      id,
      label: displayLabel,
      help: description,
      hideLabelFromVision,
      children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Stack, { direction: "column", gap: "md", children: [
        /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
          DateCalendar,
          {
            style: { width: "100%" },
            selected: value ? parseDateTime(value) || void 0 : void 0,
            onSelect: onSelectDate,
            month: calendarMonth,
            onMonthChange: setCalendarMonth,
            timeZone: timezoneString || void 0,
            weekStartsOn
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
          ValidatedInputControl,
          {
            ref: inputControlRef,
            __next40pxDefaultSize: true,
            required: !!isValid2?.required,
            customValidity: getCustomValidity(isValid2, validity),
            type: "datetime-local",
            label: (0, import_i18n34.__)("Date time"),
            hideLabelFromVision: true,
            value: value ? formatDateTime(
              parseDateTime(value) || void 0
            ) : "",
            onChange: handleManualDateTimeChange
          }
        )
      ] })
    }
  );
}
function DateTime({
  data,
  field,
  onChange,
  hideLabelFromVision,
  operator,
  validity
}) {
  if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
    return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
      RelativeDateControl,
      {
        className: "dataviews-controls__datetime",
        data,
        field,
        onChange,
        hideLabelFromVision,
        operator
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
    CalendarDateTimeControl,
    {
      data,
      field,
      onChange,
      hideLabelFromVision,
      validity
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/date.mjs
var import_components35 = __toESM(require_components(), 1);
var import_element43 = __toESM(require_element(), 1);
var import_i18n35 = __toESM(require_i18n(), 1);
var import_date5 = __toESM(require_date(), 1);
var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
var { DateCalendar: DateCalendar2, DateRangeCalendar } = unlock(import_components35.privateApis);
var DATE_PRESETS = [
  {
    id: "today",
    label: (0, import_i18n35.__)("Today"),
    getValue: () => (0, import_date5.getDate)(null)
  },
  {
    id: "yesterday",
    label: (0, import_i18n35.__)("Yesterday"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return subDays(today, 1);
    }
  },
  {
    id: "past-week",
    label: (0, import_i18n35.__)("Past week"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return subDays(today, 7);
    }
  },
  {
    id: "past-month",
    label: (0, import_i18n35.__)("Past month"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return subMonths(today, 1);
    }
  }
];
var DATE_RANGE_PRESETS = [
  {
    id: "last-7-days",
    label: (0, import_i18n35.__)("Last 7 days"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return [subDays(today, 7), today];
    }
  },
  {
    id: "last-30-days",
    label: (0, import_i18n35.__)("Last 30 days"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return [subDays(today, 30), today];
    }
  },
  {
    id: "month-to-date",
    label: (0, import_i18n35.__)("Month to date"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return [startOfMonth(today), today];
    }
  },
  {
    id: "last-year",
    label: (0, import_i18n35.__)("Last year"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return [subYears(today, 1), today];
    }
  },
  {
    id: "year-to-date",
    label: (0, import_i18n35.__)("Year to date"),
    getValue: () => {
      const today = (0, import_date5.getDate)(null);
      return [startOfYear(today), today];
    }
  }
];
var parseDate = (dateString) => {
  if (!dateString) {
    return null;
  }
  const parsed = (0, import_date5.getDate)(dateString);
  return parsed && isValid(parsed) ? parsed : null;
};
var formatDate = (date) => {
  if (!date) {
    return "";
  }
  return typeof date === "string" ? date : format(date, "yyyy-MM-dd");
};
function ValidatedDateControl({
  field,
  validity,
  inputRefs,
  isTouched,
  setIsTouched,
  children
}) {
  const { isValid: isValid2 } = field;
  const [customValidity, setCustomValidity] = (0, import_element43.useState)(void 0);
  const validateRefs = (0, import_element43.useCallback)(() => {
    const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
    for (const ref of refs) {
      const input = ref.current;
      if (input && !input.validity.valid) {
        setCustomValidity({
          type: "invalid",
          message: input.validationMessage
        });
        return;
      }
    }
    setCustomValidity(void 0);
  }, [inputRefs]);
  (0, import_element43.useEffect)(() => {
    const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
    const result2 = validity ? getCustomValidity(isValid2, validity) : void 0;
    for (const ref of refs) {
      const input = ref.current;
      if (input) {
        input.setCustomValidity(
          result2?.type === "invalid" && result2.message ? result2.message : ""
        );
      }
    }
  }, [inputRefs, isValid2, validity]);
  (0, import_element43.useEffect)(() => {
    const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
    const handleInvalid = (event) => {
      event.preventDefault();
      setIsTouched(true);
    };
    for (const ref of refs) {
      ref.current?.addEventListener("invalid", handleInvalid);
    }
    return () => {
      for (const ref of refs) {
        ref.current?.removeEventListener("invalid", handleInvalid);
      }
    };
  }, [inputRefs, setIsTouched]);
  (0, import_element43.useEffect)(() => {
    if (!isTouched) {
      return;
    }
    const result2 = validity ? getCustomValidity(isValid2, validity) : void 0;
    if (result2) {
      setCustomValidity(result2);
    } else {
      validateRefs();
    }
  }, [isTouched, isValid2, validity, validateRefs]);
  const onBlur = (event) => {
    if (isTouched) {
      return;
    }
    if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
      setIsTouched(true);
    }
  };
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)("div", { onBlur, children: [
    children,
    /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
      "p",
      {
        className: clsx_default(
          "components-validated-control__indicator",
          customValidity.type === "invalid" ? "is-invalid" : void 0,
          customValidity.type === "valid" ? "is-valid" : void 0
        ),
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
            import_components35.Icon,
            {
              className: "components-validated-control__indicator-icon",
              icon: error_default,
              size: 16,
              fill: "currentColor"
            }
          ),
          customValidity.message
        ]
      }
    ) })
  ] });
}
function CalendarDateControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const {
    id,
    label,
    setValue,
    getValue,
    isValid: isValid2,
    format: fieldFormat
  } = field;
  const [selectedPresetId, setSelectedPresetId] = (0, import_element43.useState)(
    null
  );
  const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date5.getSettings)().l10n.startOfWeek;
  const fieldValue = getValue({ item: data });
  const value = typeof fieldValue === "string" ? fieldValue : void 0;
  const [calendarMonth, setCalendarMonth] = (0, import_element43.useState)(() => {
    const parsedDate = parseDate(value);
    return parsedDate || /* @__PURE__ */ new Date();
  });
  const [isTouched, setIsTouched] = (0, import_element43.useState)(false);
  const validityTargetRef = (0, import_element43.useRef)(null);
  const onChangeCallback = (0, import_element43.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  const onSelectDate = (0, import_element43.useCallback)(
    (newDate) => {
      const dateValue = newDate ? format(newDate, "yyyy-MM-dd") : void 0;
      onChangeCallback(dateValue);
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [onChangeCallback]
  );
  const handlePresetClick = (0, import_element43.useCallback)(
    (preset) => {
      const presetDate = preset.getValue();
      const dateValue = formatDate(presetDate);
      setCalendarMonth(presetDate);
      onChangeCallback(dateValue);
      setSelectedPresetId(preset.id);
      setIsTouched(true);
    },
    [onChangeCallback]
  );
  const handleManualDateChange = (0, import_element43.useCallback)(
    (newValue) => {
      onChangeCallback(newValue);
      if (newValue) {
        const parsedDate = parseDate(newValue);
        if (parsedDate) {
          setCalendarMonth(parsedDate);
        }
      }
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [onChangeCallback]
  );
  const {
    timezone: { string: timezoneString }
  } = (0, import_date5.getSettings)();
  const displayLabel = isValid2?.required ? `${label} (${(0, import_i18n35.__)("Required")})` : label;
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
    ValidatedDateControl,
    {
      field,
      validity,
      inputRefs: validityTargetRef,
      isTouched,
      setIsTouched,
      children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
        import_components35.BaseControl,
        {
          id,
          className: "dataviews-controls__date",
          label: displayLabel,
          hideLabelFromVision,
          children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Stack, { direction: "column", gap: "md", children: [
            /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "xs",
                wrap: "wrap",
                justify: "flex-start",
                children: [
                  DATE_PRESETS.map((preset) => {
                    const isSelected2 = selectedPresetId === preset.id;
                    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                      import_components35.Button,
                      {
                        className: "dataviews-controls__date-preset",
                        variant: "tertiary",
                        isPressed: isSelected2,
                        size: "small",
                        onClick: () => handlePresetClick(preset),
                        children: preset.label
                      },
                      preset.id
                    );
                  }),
                  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                    import_components35.Button,
                    {
                      className: "dataviews-controls__date-preset",
                      variant: "tertiary",
                      isPressed: !selectedPresetId,
                      size: "small",
                      disabled: !!selectedPresetId,
                      accessibleWhenDisabled: false,
                      children: (0, import_i18n35.__)("Custom")
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
              import_components35.__experimentalInputControl,
              {
                __next40pxDefaultSize: true,
                ref: validityTargetRef,
                type: "date",
                label: (0, import_i18n35.__)("Date"),
                hideLabelFromVision: true,
                value,
                onChange: handleManualDateChange,
                required: !!field.isValid?.required
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
              DateCalendar2,
              {
                style: { width: "100%" },
                selected: value ? parseDate(value) || void 0 : void 0,
                onSelect: onSelectDate,
                month: calendarMonth,
                onMonthChange: setCalendarMonth,
                timeZone: timezoneString || void 0,
                weekStartsOn
              }
            )
          ] })
        }
      )
    }
  );
}
function CalendarDateRangeControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { id, label, getValue, setValue, format: fieldFormat } = field;
  let value;
  const fieldValue = getValue({ item: data });
  if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
    value = fieldValue;
  }
  const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date5.getSettings)().l10n.startOfWeek;
  const onChangeCallback = (0, import_element43.useCallback)(
    (newValue) => {
      onChange(
        setValue({
          item: data,
          value: newValue
        })
      );
    },
    [data, onChange, setValue]
  );
  const [selectedPresetId, setSelectedPresetId] = (0, import_element43.useState)(
    null
  );
  const selectedRange = (0, import_element43.useMemo)(() => {
    if (!value) {
      return { from: void 0, to: void 0 };
    }
    const [from, to] = value;
    return {
      from: parseDate(from) || void 0,
      to: parseDate(to) || void 0
    };
  }, [value]);
  const [calendarMonth, setCalendarMonth] = (0, import_element43.useState)(() => {
    return selectedRange.from || /* @__PURE__ */ new Date();
  });
  const [isTouched, setIsTouched] = (0, import_element43.useState)(false);
  const fromInputRef = (0, import_element43.useRef)(null);
  const toInputRef = (0, import_element43.useRef)(null);
  const updateDateRange = (0, import_element43.useCallback)(
    (fromDate, toDate2) => {
      if (fromDate && toDate2) {
        onChangeCallback([
          formatDate(fromDate),
          formatDate(toDate2)
        ]);
      } else if (!fromDate && !toDate2) {
        onChangeCallback(void 0);
      }
    },
    [onChangeCallback]
  );
  const onSelectCalendarRange = (0, import_element43.useCallback)(
    (newRange) => {
      updateDateRange(newRange?.from, newRange?.to);
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [updateDateRange]
  );
  const handlePresetClick = (0, import_element43.useCallback)(
    (preset) => {
      const [startDate, endDate] = preset.getValue();
      setCalendarMonth(startDate);
      updateDateRange(startDate, endDate);
      setSelectedPresetId(preset.id);
      setIsTouched(true);
    },
    [updateDateRange]
  );
  const handleManualDateChange = (0, import_element43.useCallback)(
    (fromOrTo, newValue) => {
      const [currentFrom, currentTo] = value || [
        void 0,
        void 0
      ];
      const updatedFrom = fromOrTo === "from" ? newValue : currentFrom;
      const updatedTo = fromOrTo === "to" ? newValue : currentTo;
      updateDateRange(updatedFrom, updatedTo);
      if (newValue) {
        const parsedDate = parseDate(newValue);
        if (parsedDate) {
          setCalendarMonth(parsedDate);
        }
      }
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [value, updateDateRange]
  );
  const { timezone } = (0, import_date5.getSettings)();
  const displayLabel = field.isValid?.required ? `${label} (${(0, import_i18n35.__)("Required")})` : label;
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
    ValidatedDateControl,
    {
      field,
      validity,
      inputRefs: [fromInputRef, toInputRef],
      isTouched,
      setIsTouched,
      children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
        import_components35.BaseControl,
        {
          id,
          className: "dataviews-controls__date",
          label: displayLabel,
          hideLabelFromVision,
          children: /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(Stack, { direction: "column", gap: "md", children: [
            /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "xs",
                wrap: "wrap",
                justify: "flex-start",
                children: [
                  DATE_RANGE_PRESETS.map((preset) => {
                    const isSelected2 = selectedPresetId === preset.id;
                    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                      import_components35.Button,
                      {
                        className: "dataviews-controls__date-preset",
                        variant: "tertiary",
                        isPressed: isSelected2,
                        size: "small",
                        onClick: () => handlePresetClick(preset),
                        children: preset.label
                      },
                      preset.id
                    );
                  }),
                  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                    import_components35.Button,
                    {
                      className: "dataviews-controls__date-preset",
                      variant: "tertiary",
                      isPressed: !selectedPresetId,
                      size: "small",
                      accessibleWhenDisabled: false,
                      disabled: !!selectedPresetId,
                      children: (0, import_i18n35.__)("Custom")
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "xs",
                justify: "space-between",
                className: "dataviews-controls__date-range-inputs",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                    import_components35.__experimentalInputControl,
                    {
                      __next40pxDefaultSize: true,
                      ref: fromInputRef,
                      type: "date",
                      label: (0, import_i18n35.__)("From"),
                      hideLabelFromVision: true,
                      value: value?.[0],
                      onChange: (newValue) => handleManualDateChange("from", newValue),
                      required: !!field.isValid?.required
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
                    import_components35.__experimentalInputControl,
                    {
                      __next40pxDefaultSize: true,
                      ref: toInputRef,
                      type: "date",
                      label: (0, import_i18n35.__)("To"),
                      hideLabelFromVision: true,
                      value: value?.[1],
                      onChange: (newValue) => handleManualDateChange("to", newValue),
                      required: !!field.isValid?.required
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
              DateRangeCalendar,
              {
                style: { width: "100%" },
                selected: selectedRange,
                onSelect: onSelectCalendarRange,
                month: calendarMonth,
                onMonthChange: setCalendarMonth,
                timeZone: timezone.string || void 0,
                weekStartsOn
              }
            )
          ] })
        }
      )
    }
  );
}
function DateControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  operator,
  validity
}) {
  if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
      RelativeDateControl,
      {
        className: "dataviews-controls__date",
        data,
        field,
        onChange,
        hideLabelFromVision,
        operator
      }
    );
  }
  if (operator === OPERATOR_BETWEEN) {
    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
      CalendarDateRangeControl,
      {
        data,
        field,
        onChange,
        hideLabelFromVision,
        validity
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
    CalendarDateControl,
    {
      data,
      field,
      onChange,
      hideLabelFromVision,
      validity
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/email.mjs
var import_components37 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/validated-input.mjs
var import_components36 = __toESM(require_components(), 1);
var import_element44 = __toESM(require_element(), 1);
var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
var { ValidatedInputControl: ValidatedInputControl2 } = unlock(import_components36.privateApis);
function ValidatedText({
  data,
  field,
  onChange,
  hideLabelFromVision,
  type,
  prefix,
  suffix,
  validity
}) {
  const { label, placeholder, description, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data });
  const onChangeControl = (0, import_element44.useCallback)(
    (newValue) => onChange(
      setValue({
        item: data,
        value: newValue
      })
    ),
    [data, setValue, onChange]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
    ValidatedInputControl2,
    {
      required: !!isValid2.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      placeholder,
      value: value ?? "",
      help: description,
      onChange: onChangeControl,
      hideLabelFromVision,
      type,
      prefix,
      suffix,
      pattern: isValid2.pattern ? isValid2.pattern.constraint : void 0,
      minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0,
      maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0,
      __next40pxDefaultSize: true
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/email.mjs
var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1);
function Email({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        validity,
        type: "email",
        prefix: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_components37.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_components37.Icon, { icon: envelope_default }) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/telephone.mjs
var import_components38 = __toESM(require_components(), 1);
var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
function Telephone({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        validity,
        type: "tel",
        prefix: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components38.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components38.Icon, { icon: mobile_default }) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/url.mjs
var import_components39 = __toESM(require_components(), 1);
var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1);
function Url({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        validity,
        type: "url",
        prefix: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components39.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components39.Icon, { icon: link_default }) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/validated-number.mjs
var import_components40 = __toESM(require_components(), 1);
var import_element45 = __toESM(require_element(), 1);
var import_i18n36 = __toESM(require_i18n(), 1);
var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1);
var { ValidatedNumberControl } = unlock(import_components40.privateApis);
function toNumberOrEmpty(value) {
  if (value === "" || value === void 0) {
    return "";
  }
  const number = Number(value);
  return Number.isFinite(number) ? number : "";
}
function BetweenControls({
  value,
  onChange,
  hideLabelFromVision,
  step
}) {
  const [min = "", max = ""] = value;
  const onChangeMin = (0, import_element45.useCallback)(
    (newValue) => onChange([toNumberOrEmpty(newValue), max]),
    [onChange, max]
  );
  const onChangeMax = (0, import_element45.useCallback)(
    (newValue) => onChange([min, toNumberOrEmpty(newValue)]),
    [onChange, min]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
    import_components40.BaseControl,
    {
      help: (0, import_i18n36.__)("The max. value must be greater than the min. value."),
      children: /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(import_components40.Flex, { direction: "row", gap: 4, children: [
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
          import_components40.__experimentalNumberControl,
          {
            label: (0, import_i18n36.__)("Min."),
            value: min,
            max: max ? Number(max) - step : void 0,
            onChange: onChangeMin,
            __next40pxDefaultSize: true,
            hideLabelFromVision,
            step
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
          import_components40.__experimentalNumberControl,
          {
            label: (0, import_i18n36.__)("Max."),
            value: max,
            min: min ? Number(min) + step : void 0,
            onChange: onChangeMax,
            __next40pxDefaultSize: true,
            hideLabelFromVision,
            step
          }
        )
      ] })
    }
  );
}
function ValidatedNumber({
  data,
  field,
  onChange,
  hideLabelFromVision,
  operator,
  validity
}) {
  const decimals = field.format?.decimals ?? 0;
  const step = Math.pow(10, Math.abs(decimals) * -1);
  const { label, description, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data }) ?? "";
  const onChangeControl = (0, import_element45.useCallback)(
    (newValue) => {
      onChange(
        setValue({
          item: data,
          // Do not convert an empty string or undefined to a number,
          // otherwise there's a mismatch between the UI control (empty)
          // and the data relied by onChange (0).
          value: ["", void 0].includes(newValue) ? void 0 : Number(newValue)
        })
      );
    },
    [data, onChange, setValue]
  );
  const onChangeBetweenControls = (0, import_element45.useCallback)(
    (newValue) => {
      onChange(
        setValue({
          item: data,
          value: newValue
        })
      );
    },
    [data, onChange, setValue]
  );
  if (operator === OPERATOR_BETWEEN) {
    let valueBetween = ["", ""];
    if (Array.isArray(value) && value.length === 2 && value.every(
      (element) => typeof element === "number" || element === ""
    )) {
      valueBetween = value;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
      BetweenControls,
      {
        value: valueBetween,
        onChange: onChangeBetweenControls,
        hideLabelFromVision,
        step
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
    ValidatedNumberControl,
    {
      required: !!isValid2.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      help: description,
      value,
      onChange: onChangeControl,
      __next40pxDefaultSize: true,
      hideLabelFromVision,
      step,
      min: isValid2.min ? isValid2.min.constraint : void 0,
      max: isValid2.max ? isValid2.max.constraint : void 0
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/integer.mjs
var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
function Integer(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(ValidatedNumber, { ...props });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/number.mjs
var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
function Number2(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ValidatedNumber, { ...props });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/radio.mjs
var import_components41 = __toESM(require_components(), 1);
var import_element46 = __toESM(require_element(), 1);
var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
var { ValidatedRadioControl } = unlock(import_components41.privateApis);
function Radio({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { label, description, getValue, setValue, isValid: isValid2 } = field;
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  const value = getValue({ item: data });
  const onChangeControl = (0, import_element46.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_components41.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
    ValidatedRadioControl,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      help: description,
      onChange: onChangeControl,
      options: elements,
      selected: value,
      hideLabelFromVision
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/select.mjs
var import_components42 = __toESM(require_components(), 1);
var import_element47 = __toESM(require_element(), 1);
var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
var { ValidatedSelectControl } = unlock(import_components42.privateApis);
function Select({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { type, label, description, getValue, setValue, isValid: isValid2 } = field;
  const isMultiple = type === "array";
  const value = getValue({ item: data }) ?? (isMultiple ? [] : "");
  const onChangeControl = (0, import_element47.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components42.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
    ValidatedSelectControl,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      value,
      help: description,
      options: elements,
      onChange: onChangeControl,
      __next40pxDefaultSize: true,
      hideLabelFromVision,
      multiple: isMultiple
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/text.mjs
var import_element48 = __toESM(require_element(), 1);
var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1);
function Text2({
  data,
  field,
  onChange,
  hideLabelFromVision,
  config,
  validity
}) {
  const { prefix, suffix } = config || {};
  return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        validity,
        prefix: prefix ? (0, import_element48.createElement)(prefix) : void 0,
        suffix: suffix ? (0, import_element48.createElement)(suffix) : void 0
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/toggle.mjs
var import_components43 = __toESM(require_components(), 1);
var import_element49 = __toESM(require_element(), 1);
var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
var { ValidatedToggleControl } = unlock(import_components43.privateApis);
function Toggle({
  field,
  onChange,
  data,
  hideLabelFromVision,
  validity
}) {
  const { label, description, getValue, setValue, isValid: isValid2 } = field;
  const onChangeControl = (0, import_element49.useCallback)(() => {
    onChange(
      setValue({ item: data, value: !getValue({ item: data }) })
    );
  }, [onChange, setValue, data, getValue]);
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
    ValidatedToggleControl,
    {
      required: !!isValid2.required,
      customValidity: getCustomValidity(isValid2, validity),
      hidden: hideLabelFromVision,
      label,
      help: description,
      checked: getValue({ item: data }),
      onChange: onChangeControl
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/textarea.mjs
var import_components44 = __toESM(require_components(), 1);
var import_element50 = __toESM(require_element(), 1);
var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
var { ValidatedTextareaControl } = unlock(import_components44.privateApis);
function Textarea({
  data,
  field,
  onChange,
  hideLabelFromVision,
  config,
  validity
}) {
  const { rows = 4 } = config || {};
  const { label, placeholder, description, setValue, isValid: isValid2 } = field;
  const value = field.getValue({ item: data });
  const onChangeControl = (0, import_element50.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
    ValidatedTextareaControl,
    {
      required: !!isValid2.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      placeholder,
      value: value ?? "",
      help: description,
      onChange: onChangeControl,
      rows,
      minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0,
      maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0,
      __next40pxDefaultSize: true,
      hideLabelFromVision
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/toggle-group.mjs
var import_components45 = __toESM(require_components(), 1);
var import_element51 = __toESM(require_element(), 1);
var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
var { ValidatedToggleGroupControl } = unlock(import_components45.privateApis);
function ToggleGroup({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data });
  const onChangeControl = (0, import_element51.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_components45.Spinner, {});
  }
  if (elements.length === 0) {
    return null;
  }
  const selectedOption = elements.find((el) => el.value === value);
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
    ValidatedToggleGroupControl,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      __next40pxDefaultSize: true,
      isBlock: true,
      label: field.label,
      help: selectedOption?.description || field.description,
      onChange: onChangeControl,
      value,
      hideLabelFromVision,
      children: elements.map((el) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
        import_components45.__experimentalToggleGroupControlOption,
        {
          label: el.label,
          value: el.value
        },
        el.value
      ))
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/array.mjs
var import_components46 = __toESM(require_components(), 1);
var import_element52 = __toESM(require_element(), 1);
var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
var { ValidatedFormTokenField } = unlock(import_components46.privateApis);
function ArrayControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { label, placeholder, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data });
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  const arrayValueAsElements = (0, import_element52.useMemo)(
    () => Array.isArray(value) ? value.map((token) => {
      const element = elements?.find(
        (suggestion) => suggestion.value === token
      );
      return element || { value: token, label: token };
    }) : [],
    [value, elements]
  );
  const onChangeControl = (0, import_element52.useCallback)(
    (tokens) => {
      const valueTokens = tokens.map((token) => {
        if (typeof token === "object" && "value" in token) {
          return token.value;
        }
        return token;
      });
      onChange(setValue({ item: data, value: valueTokens }));
    },
    [onChange, setValue, data]
  );
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components46.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
    ValidatedFormTokenField,
    {
      required: !!isValid2?.required,
      customValidity: getCustomValidity(isValid2, validity),
      label: hideLabelFromVision ? void 0 : label,
      value: arrayValueAsElements,
      onChange: onChangeControl,
      placeholder,
      suggestions: elements?.map((element) => element.value),
      __experimentalValidateInput: (token) => {
        if (field.isValid?.elements && elements) {
          return elements.some(
            (element) => element.value === token || element.label === token
          );
        }
        return true;
      },
      __experimentalExpandOnFocus: elements && elements.length > 0,
      __experimentalShowHowTo: !field.isValid?.elements,
      displayTransform: (token) => {
        if (typeof token === "object" && "label" in token) {
          return token.label;
        }
        if (typeof token === "string" && elements) {
          const element = elements.find(
            (el) => el.value === token
          );
          return element?.label || token;
        }
        return token;
      },
      __experimentalRenderItem: ({ item }) => {
        if (typeof item === "string" && elements) {
          const element = elements.find(
            (el) => el.value === item
          );
          return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: element?.label || item });
        }
        return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: item });
      }
    }
  );
}

// ../../../node_modules/.pnpm/colord@2.9.3/node_modules/colord/index.mjs
var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) };
var t = function(r3) {
  return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3;
};
var n = function(r3, t2, n2) {
  return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = Math.pow(10, t2)), Math.round(n2 * r3) / n2 + 0;
};
var e = function(r3, t2, n2) {
  return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t2 ? r3 : t2;
};
var u = function(r3) {
  return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360;
};
var a = function(r3) {
  return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) };
};
var o = function(r3) {
  return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) };
};
var i = /^#([0-9a-f]{3,8})$/i;
var s = function(r3) {
  var t2 = r3.toString(16);
  return t2.length < 2 ? "0" + t2 : t2;
};
var h = function(r3) {
  var t2 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t2, n2, e2), o2 = a2 - Math.min(t2, n2, e2), i2 = o2 ? a2 === t2 ? (n2 - e2) / o2 : a2 === n2 ? 2 + (e2 - t2) / o2 : 4 + (t2 - n2) / o2 : 0;
  return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o2 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 };
};
var b = function(r3) {
  var t2 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a;
  t2 = t2 / 360 * 6, n2 /= 100, e2 /= 100;
  var a2 = Math.floor(t2), o2 = e2 * (1 - n2), i2 = e2 * (1 - (t2 - a2) * n2), s2 = e2 * (1 - (1 - t2 + a2) * n2), h2 = a2 % 6;
  return { r: 255 * [e2, i2, o2, o2, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o2, o2][h2], b: 255 * [o2, o2, s2, e2, e2, i2][h2], a: u2 };
};
var g = function(r3) {
  return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) };
};
var d = function(r3) {
  return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) };
};
var f = function(r3) {
  return b((n2 = (t2 = r3).s, { h: t2.h, s: (n2 *= ((e2 = t2.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t2.a }));
  var t2, n2, e2;
};
var c = function(r3) {
  return { h: (t2 = h(r3)).h, s: (u2 = (200 - (n2 = t2.s)) * (e2 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a };
  var t2, n2, e2, u2;
};
var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var y = { string: [[function(r3) {
  var t2 = i.exec(r3);
  return t2 ? (r3 = t2[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
}, "hex"], [function(r3) {
  var t2 = v.exec(r3) || m.exec(r3);
  return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null;
}, "rgb"], [function(t2) {
  var n2 = l.exec(t2) || p.exec(t2);
  if (!n2) return null;
  var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) });
  return f(a2);
}, "hsl"]], object: [[function(r3) {
  var n2 = r3.r, e2 = r3.g, u2 = r3.b, o2 = r3.a, i2 = void 0 === o2 ? 1 : o2;
  return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null;
}, "rgb"], [function(r3) {
  var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o2 = void 0 === a2 ? 1 : a2;
  if (!t(n2) || !t(e2) || !t(u2)) return null;
  var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o2) });
  return f(i2);
}, "hsl"], [function(r3) {
  var n2 = r3.h, a2 = r3.s, o2 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2;
  if (!t(n2) || !t(a2) || !t(o2)) return null;
  var h2 = (function(r4) {
    return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) };
  })({ h: Number(n2), s: Number(a2), v: Number(o2), a: Number(s2) });
  return b(h2);
}, "hsv"]] };
var N = function(r3, t2) {
  for (var n2 = 0; n2 < t2.length; n2++) {
    var e2 = t2[n2][0](r3);
    if (e2) return [e2, t2[n2][1]];
  }
  return [null, void 0];
};
var x = function(r3) {
  return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0];
};
var M = function(r3, t2) {
  var n2 = c(r3);
  return { h: n2.h, s: e(n2.s + 100 * t2, 0, 100), l: n2.l, a: n2.a };
};
var H = function(r3) {
  return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255;
};
var $ = function(r3, t2) {
  var n2 = c(r3);
  return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t2, 0, 100), a: n2.a };
};
var j = (function() {
  function r3(r4) {
    this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
  }
  return r3.prototype.isValid = function() {
    return null !== this.parsed;
  }, r3.prototype.brightness = function() {
    return n(H(this.rgba), 2);
  }, r3.prototype.isDark = function() {
    return H(this.rgba) < 0.5;
  }, r3.prototype.isLight = function() {
    return H(this.rgba) >= 0.5;
  }, r3.prototype.toHex = function() {
    return r4 = o(this.rgba), t2 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t2) + s(e2) + s(u2) + i2;
    var r4, t2, e2, u2, a2, i2;
  }, r3.prototype.toRgb = function() {
    return o(this.rgba);
  }, r3.prototype.toRgbString = function() {
    return r4 = o(this.rgba), t2 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t2 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t2 + ", " + n2 + ", " + e2 + ")";
    var r4, t2, n2, e2, u2;
  }, r3.prototype.toHsl = function() {
    return d(c(this.rgba));
  }, r3.prototype.toHslString = function() {
    return r4 = d(c(this.rgba)), t2 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t2 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t2 + ", " + n2 + "%, " + e2 + "%)";
    var r4, t2, n2, e2, u2;
  }, r3.prototype.toHsv = function() {
    return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) };
    var r4;
  }, r3.prototype.invert = function() {
    return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a });
    var r4;
  }, r3.prototype.saturate = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4));
  }, r3.prototype.desaturate = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4));
  }, r3.prototype.grayscale = function() {
    return w(M(this.rgba, -1));
  }, r3.prototype.lighten = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4));
  }, r3.prototype.darken = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4));
  }, r3.prototype.rotate = function(r4) {
    return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4);
  }, r3.prototype.alpha = function(r4) {
    return "number" == typeof r4 ? w({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r4 }) : n(this.rgba.a, 3);
    var t2;
  }, r3.prototype.hue = function(r4) {
    var t2 = c(this.rgba);
    return "number" == typeof r4 ? w({ h: r4, s: t2.s, l: t2.l, a: t2.a }) : n(t2.h);
  }, r3.prototype.isEqual = function(r4) {
    return this.toHex() === w(r4).toHex();
  }, r3;
})();
var w = function(r3) {
  return r3 instanceof j ? r3 : new j(r3);
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/color.mjs
var import_components47 = __toESM(require_components(), 1);
var import_element53 = __toESM(require_element(), 1);
var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
var { ValidatedInputControl: ValidatedInputControl3, Picker } = unlock(import_components47.privateApis);
var ColorPicker = ({
  color,
  onColorChange
}) => {
  const validColor = color && w(color).isValid() ? color : "#ffffff";
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
    import_components47.Dropdown,
    {
      renderToggle: ({ onToggle, isOpen }) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components47.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
        "button",
        {
          type: "button",
          onClick: onToggle,
          style: {
            width: "24px",
            height: "24px",
            borderRadius: "50%",
            backgroundColor: validColor,
            border: "1px solid #ddd",
            cursor: "pointer",
            outline: isOpen ? "2px solid #007cba" : "none",
            outlineOffset: "2px",
            display: "flex",
            alignItems: "center",
            justifyContent: "center",
            padding: 0,
            margin: 0
          },
          "aria-label": "Open color picker"
        }
      ) }),
      renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { style: { padding: "16px" }, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
        Picker,
        {
          color: w(validColor),
          onChange: onColorChange,
          enableAlpha: true
        }
      ) })
    }
  );
};
function Color({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { label, placeholder, description, setValue, isValid: isValid2 } = field;
  const value = field.getValue({ item: data }) || "";
  const handleColorChange = (0, import_element53.useCallback)(
    (colorObject) => {
      onChange(setValue({ item: data, value: colorObject.toHex() }));
    },
    [data, onChange, setValue]
  );
  const handleInputChange = (0, import_element53.useCallback)(
    (newValue) => {
      onChange(setValue({ item: data, value: newValue || "" }));
    },
    [data, onChange, setValue]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
    ValidatedInputControl3,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      placeholder,
      value,
      help: description,
      onChange: handleInputChange,
      hideLabelFromVision,
      type: "text",
      prefix: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
        ColorPicker,
        {
          color: value,
          onColorChange: handleColorChange
        }
      )
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/password.mjs
var import_components48 = __toESM(require_components(), 1);
var import_element54 = __toESM(require_element(), 1);
var import_i18n37 = __toESM(require_i18n(), 1);
var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
function Password({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const [isVisible2, setIsVisible] = (0, import_element54.useState)(false);
  const toggleVisibility = (0, import_element54.useCallback)(() => {
    setIsVisible((prev) => !prev);
  }, []);
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        validity,
        type: isVisible2 ? "text" : "password",
        suffix: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components48.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
          import_components48.Button,
          {
            icon: isVisible2 ? unseen_default : seen_default,
            onClick: toggleVisibility,
            size: "small",
            label: isVisible2 ? (0, import_i18n37.__)("Hide password") : (0, import_i18n37.__)("Show password")
          }
        ) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/has-elements.mjs
function hasElements(field) {
  return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function";
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/index.mjs
var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1);
var FORM_CONTROLS = {
  array: ArrayControl,
  checkbox: Checkbox,
  color: Color,
  combobox: Combobox3,
  datetime: DateTime,
  date: DateControl,
  email: Email,
  telephone: Telephone,
  url: Url,
  integer: Integer,
  number: Number2,
  password: Password,
  radio: Radio,
  select: Select,
  text: Text2,
  toggle: Toggle,
  textarea: Textarea,
  toggleGroup: ToggleGroup
};
function isEditConfig(value) {
  return value && typeof value === "object" && typeof value.control === "string";
}
function createConfiguredControl(config) {
  const { control, ...controlConfig } = config;
  const BaseControlType = getControlByType(control);
  if (BaseControlType === null) {
    return null;
  }
  return function ConfiguredControl(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(BaseControlType, { ...props, config: controlConfig });
  };
}
function getControl(field, fallback) {
  if (typeof field.Edit === "function") {
    return field.Edit;
  }
  if (typeof field.Edit === "string") {
    return getControlByType(field.Edit);
  }
  if (isEditConfig(field.Edit)) {
    return createConfiguredControl(field.Edit);
  }
  if (hasElements(field) && field.type !== "array") {
    return getControlByType("select");
  }
  if (fallback === null) {
    return null;
  }
  return getControlByType(fallback);
}
function getControlByType(type) {
  if (Object.keys(FORM_CONTROLS).includes(type)) {
    return FORM_CONTROLS[type];
  }
  return null;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-filter-by.mjs
function getFilterBy(field, defaultOperators, validOperators) {
  if (field.filterBy === false) {
    return false;
  }
  const operators = field.filterBy?.operators?.filter(
    (op) => validOperators.includes(op)
  ) ?? defaultOperators;
  if (operators.length === 0) {
    return false;
  }
  return {
    isPrimary: !!field.filterBy?.isPrimary,
    operators
  };
}
var get_filter_by_default = getFilterBy;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-value-from-id.mjs
var getValueFromId = (id) => ({ item }) => {
  const path = id.split(".");
  let value = item;
  for (const segment of path) {
    if (value.hasOwnProperty(segment)) {
      value = value[segment];
    } else {
      value = void 0;
    }
  }
  return value;
};
var get_value_from_id_default = getValueFromId;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/set-value-from-id.mjs
var setValueFromId = (id) => ({ value }) => {
  const path = id.split(".");
  const result2 = {};
  let current = result2;
  for (const segment of path.slice(0, -1)) {
    current[segment] = {};
    current = current[segment];
  }
  current[path.at(-1)] = value;
  return result2;
};
var set_value_from_id_default = setValueFromId;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/email.mjs
var import_i18n38 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.mjs
function RenderFromElements({
  item,
  field
}) {
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  const value = field.getValue({ item });
  if (isLoading) {
    return value;
  }
  if (elements.length === 0) {
    return value;
  }
  return elements?.find((element) => element.value === value)?.label || field.getValue({ item });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/render-default.mjs
var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
function render({
  item,
  field
}) {
  if (field.hasElements) {
    return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(RenderFromElements, { item, field });
  }
  return field.getValueFormatted({ item, field });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/sort-text.mjs
var sort_text_default = (a2, b2, direction) => {
  return direction === "asc" ? a2.localeCompare(b2) : b2.localeCompare(a2);
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-required.mjs
function isValidRequired(item, field) {
  const value = field.getValue({ item });
  return ![void 0, "", null].includes(value);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-min-length.mjs
function isValidMinLength(item, field) {
  if (typeof field.isValid.minLength?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return String(value).length >= field.isValid.minLength.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-max-length.mjs
function isValidMaxLength(item, field) {
  if (typeof field.isValid.maxLength?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return String(value).length <= field.isValid.maxLength.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-pattern.mjs
function isValidPattern(item, field) {
  if (field.isValid.pattern?.constraint === void 0) {
    return true;
  }
  try {
    const regexp = new RegExp(field.isValid.pattern.constraint);
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return true;
    }
    return regexp.test(String(value));
  } catch {
    return false;
  }
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-elements.mjs
function isValidElements(item, field) {
  const elements = field.elements ?? [];
  const validValues = elements.map((el) => el.value);
  if (validValues.length === 0) {
    return true;
  }
  const value = field.getValue({ item });
  return [].concat(value).every((v2) => validValues.includes(v2));
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-value-formatted-default.mjs
function getValueFormatted({
  item,
  field
}) {
  return field.getValue({ item });
}
var get_value_formatted_default_default = getValueFormatted;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/email.mjs
var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
function isValidCustom(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
    return (0, import_i18n38.__)("Value must be a valid email address.");
  }
  return null;
}
var email_default = {
  type: "email",
  render,
  Edit: "email",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements,
    custom: isValidCustom
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/integer.mjs
var import_i18n39 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/sort-number.mjs
var sort_number_default = (a2, b2, direction) => {
  return direction === "asc" ? a2 - b2 : b2 - a2;
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-min.mjs
function isValidMin(item, field) {
  if (typeof field.isValid.min?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return Number(value) >= field.isValid.min.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-max.mjs
function isValidMax(item, field) {
  if (typeof field.isValid.max?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return Number(value) <= field.isValid.max.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/integer.mjs
var format2 = {
  separatorThousand: ","
};
function getValueFormatted2({
  item,
  field
}) {
  let value = field.getValue({ item });
  if (value === null || value === void 0) {
    return "";
  }
  value = Number(value);
  if (!Number.isFinite(value)) {
    return String(value);
  }
  let formatInteger;
  if (field.type !== "integer") {
    formatInteger = format2;
  } else {
    formatInteger = field.format;
  }
  const { separatorThousand } = formatInteger;
  const integerValue = Math.trunc(value);
  if (!separatorThousand) {
    return String(integerValue);
  }
  return String(integerValue).replace(
    /\B(?=(\d{3})+(?!\d))/g,
    separatorThousand
  );
}
function isValidCustom2(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
    return (0, import_i18n39.__)("Value must be an integer.");
  }
  return null;
}
var integer_default = {
  type: "integer",
  render,
  Edit: "integer",
  sort: sort_number_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN
  ],
  validOperators: [
    // Single-selection
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN,
    // Multiple-selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: format2,
  getValueFormatted: getValueFormatted2,
  validate: {
    required: isValidRequired,
    min: isValidMin,
    max: isValidMax,
    elements: isValidElements,
    custom: isValidCustom2
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/number.mjs
var import_i18n40 = __toESM(require_i18n(), 1);
var format3 = {
  separatorThousand: ",",
  separatorDecimal: ".",
  decimals: 2
};
function getValueFormatted3({
  item,
  field
}) {
  let value = field.getValue({ item });
  if (value === null || value === void 0) {
    return "";
  }
  value = Number(value);
  if (!Number.isFinite(value)) {
    return String(value);
  }
  let formatNumber5;
  if (field.type !== "number") {
    formatNumber5 = format3;
  } else {
    formatNumber5 = field.format;
  }
  const { separatorThousand, separatorDecimal, decimals } = formatNumber5;
  const fixedValue = value.toFixed(decimals);
  const [integerPart, decimalPart] = fixedValue.split(".");
  const formattedInteger = separatorThousand ? integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, separatorThousand) : integerPart;
  return decimals === 0 ? formattedInteger : formattedInteger + separatorDecimal + decimalPart;
}
function isEmpty2(value) {
  return value === "" || value === void 0 || value === null;
}
function isValidCustom3(item, field) {
  const value = field.getValue({ item });
  if (!isEmpty2(value) && !Number.isFinite(value)) {
    return (0, import_i18n40.__)("Value must be a number.");
  }
  return null;
}
var number_default = {
  type: "number",
  render,
  Edit: "number",
  sort: sort_number_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN
  ],
  validOperators: [
    // Single-selection
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN,
    // Multiple-selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: format3,
  getValueFormatted: getValueFormatted3,
  validate: {
    required: isValidRequired,
    min: isValidMin,
    max: isValidMax,
    elements: isValidElements,
    custom: isValidCustom3
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/text.mjs
var text_default = {
  type: "text",
  render,
  Edit: "text",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    // Single selection
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/datetime.mjs
var import_date7 = __toESM(require_date(), 1);
var format4 = {
  datetime: (0, import_date7.getSettings)().formats.datetime,
  weekStartsOn: (0, import_date7.getSettings)().l10n.startOfWeek
};
function getValueFormatted4({
  item,
  field
}) {
  const value = field.getValue({ item });
  if (["", void 0, null].includes(value)) {
    return "";
  }
  let formatDatetime;
  if (field.type !== "datetime") {
    formatDatetime = format4;
  } else {
    formatDatetime = field.format;
  }
  return (0, import_date7.dateI18n)(formatDatetime.datetime, (0, import_date7.getDate)(value));
}
var sort = (a2, b2, direction) => {
  const timeA = new Date(a2).getTime();
  const timeB = new Date(b2).getTime();
  return direction === "asc" ? timeA - timeB : timeB - timeA;
};
var datetime_default = {
  type: "datetime",
  render,
  Edit: "datetime",
  sort,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER
  ],
  validOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER
  ],
  format: format4,
  getValueFormatted: getValueFormatted4,
  validate: {
    required: isValidRequired,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/date.mjs
var import_date8 = __toESM(require_date(), 1);
var format5 = {
  date: (0, import_date8.getSettings)().formats.date,
  weekStartsOn: (0, import_date8.getSettings)().l10n.startOfWeek
};
function getValueFormatted5({
  item,
  field
}) {
  const value = field.getValue({ item });
  if (["", void 0, null].includes(value)) {
    return "";
  }
  let formatDate2;
  if (field.type !== "date") {
    formatDate2 = format5;
  } else {
    formatDate2 = field.format;
  }
  return (0, import_date8.dateI18n)(formatDate2.date, (0, import_date8.getDate)(value));
}
var sort2 = (a2, b2, direction) => {
  const timeA = new Date(a2).getTime();
  const timeB = new Date(b2).getTime();
  return direction === "asc" ? timeA - timeB : timeB - timeA;
};
var date_default = {
  type: "date",
  render,
  Edit: "date",
  sort: sort2,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER,
    OPERATOR_BETWEEN
  ],
  validOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER,
    OPERATOR_BETWEEN
  ],
  format: format5,
  getValueFormatted: getValueFormatted5,
  validate: {
    required: isValidRequired,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/boolean.mjs
var import_i18n41 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-required-for-bool.mjs
function isValidRequiredForBool(item, field) {
  const value = field.getValue({ item });
  return value === true;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/boolean.mjs
function getValueFormatted6({
  item,
  field
}) {
  const value = field.getValue({ item });
  if (value === true) {
    return (0, import_i18n41.__)("True");
  }
  if (value === false) {
    return (0, import_i18n41.__)("False");
  }
  return "";
}
function isValidCustom4(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
    return (0, import_i18n41.__)("Value must be true, false, or undefined");
  }
  return null;
}
var sort3 = (a2, b2, direction) => {
  const boolA = Boolean(a2);
  const boolB = Boolean(b2);
  if (boolA === boolB) {
    return 0;
  }
  if (direction === "asc") {
    return boolA ? 1 : -1;
  }
  return boolA ? -1 : 1;
};
var boolean_default = {
  type: "boolean",
  render,
  Edit: "checkbox",
  sort: sort3,
  validate: {
    required: isValidRequiredForBool,
    elements: isValidElements,
    custom: isValidCustom4
  },
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
  validOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
  format: {},
  getValueFormatted: getValueFormatted6
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/media.mjs
var media_default = {
  type: "media",
  render: () => null,
  Edit: null,
  sort: () => 0,
  enableSorting: false,
  enableGlobalSearch: false,
  defaultOperators: [],
  validOperators: [],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  // cannot validate any constraint, so
  // the only available validation for the field author
  // would be providing a custom validator.
  validate: {}
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/array.mjs
var import_i18n42 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-required-for-array.mjs
function isValidRequiredForArray(item, field) {
  const value = field.getValue({ item });
  return Array.isArray(value) && value.length > 0 && value.every(
    (element) => ![void 0, "", null].includes(element)
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/array.mjs
function getValueFormatted7({
  item,
  field
}) {
  const value = field.getValue({ item });
  const arr = Array.isArray(value) ? value : [];
  return arr.join(", ");
}
function render2({ item, field }) {
  return getValueFormatted7({ item, field });
}
function isValidCustom5(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !Array.isArray(value)) {
    return (0, import_i18n42.__)("Value must be an array.");
  }
  if (!value.every((v2) => typeof v2 === "string")) {
    return (0, import_i18n42.__)("Every value must be a string.");
  }
  return null;
}
var sort4 = (a2, b2, direction) => {
  const arrA = Array.isArray(a2) ? a2 : [];
  const arrB = Array.isArray(b2) ? b2 : [];
  if (arrA.length !== arrB.length) {
    return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length;
  }
  const joinedA = arrA.join(",");
  const joinedB = arrB.join(",");
  return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA);
};
var array_default = {
  type: "array",
  render: render2,
  Edit: "array",
  sort: sort4,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: getValueFormatted7,
  validate: {
    required: isValidRequiredForArray,
    elements: isValidElements,
    custom: isValidCustom5
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/password.mjs
function getValueFormatted8({
  item,
  field
}) {
  return field.getValue({ item }) ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : "";
}
var password_default = {
  type: "password",
  render,
  Edit: "password",
  sort: () => 0,
  // Passwords should not be sortable for security reasons
  enableSorting: false,
  enableGlobalSearch: false,
  defaultOperators: [],
  validOperators: [],
  format: {},
  getValueFormatted: getValueFormatted8,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/telephone.mjs
var telephone_default = {
  type: "telephone",
  render,
  Edit: "telephone",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/color.mjs
var import_i18n43 = __toESM(require_i18n(), 1);
var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1);
function render3({ item, field }) {
  if (field.hasElements) {
    return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RenderFromElements, { item, field });
  }
  const value = get_value_formatted_default_default({ item, field });
  if (!value || !w(value).isValid()) {
    return value;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
    /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
      "div",
      {
        style: {
          width: "16px",
          height: "16px",
          borderRadius: "50%",
          backgroundColor: value,
          border: "1px solid #ddd",
          flexShrink: 0
        }
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { children: value })
  ] });
}
function isValidCustom6(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !w(value).isValid()) {
    return (0, import_i18n43.__)("Value must be a valid color.");
  }
  return null;
}
var sort5 = (a2, b2, direction) => {
  const colorA = w(a2);
  const colorB = w(b2);
  if (!colorA.isValid() && !colorB.isValid()) {
    return 0;
  }
  if (!colorA.isValid()) {
    return direction === "asc" ? 1 : -1;
  }
  if (!colorB.isValid()) {
    return direction === "asc" ? -1 : 1;
  }
  const hslA = colorA.toHsl();
  const hslB = colorB.toHsl();
  if (hslA.h !== hslB.h) {
    return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h;
  }
  if (hslA.s !== hslB.s) {
    return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s;
  }
  return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l;
};
var color_default = {
  type: "color",
  render: render3,
  Edit: "color",
  sort: sort5,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    elements: isValidElements,
    custom: isValidCustom6
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/url.mjs
var url_default = {
  type: "url",
  render,
  Edit: "url",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/no-type.mjs
var sort6 = (a2, b2, direction) => {
  if (typeof a2 === "number" && typeof b2 === "number") {
    return sort_number_default(a2, b2, direction);
  }
  return sort_text_default(a2, b2, direction);
};
var no_type_default = {
  // type: no type for this one
  render,
  Edit: null,
  sort: sort6,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
  validOperators: getAllOperatorNames(),
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-is-valid.mjs
function getIsValid(field, fieldType) {
  let required;
  if (field.isValid?.required === true && fieldType.validate.required !== void 0) {
    required = {
      constraint: true,
      validate: fieldType.validate.required
    };
  }
  let elements;
  if ((field.isValid?.elements === true || // elements is enabled unless the field opts-out
  field.isValid?.elements === void 0 && (!!field.elements || !!field.getElements)) && fieldType.validate.elements !== void 0) {
    elements = {
      constraint: true,
      validate: fieldType.validate.elements
    };
  }
  let min;
  if (typeof field.isValid?.min === "number" && fieldType.validate.min !== void 0) {
    min = {
      constraint: field.isValid.min,
      validate: fieldType.validate.min
    };
  }
  let max;
  if (typeof field.isValid?.max === "number" && fieldType.validate.max !== void 0) {
    max = {
      constraint: field.isValid.max,
      validate: fieldType.validate.max
    };
  }
  let minLength;
  if (typeof field.isValid?.minLength === "number" && fieldType.validate.minLength !== void 0) {
    minLength = {
      constraint: field.isValid.minLength,
      validate: fieldType.validate.minLength
    };
  }
  let maxLength;
  if (typeof field.isValid?.maxLength === "number" && fieldType.validate.maxLength !== void 0) {
    maxLength = {
      constraint: field.isValid.maxLength,
      validate: fieldType.validate.maxLength
    };
  }
  let pattern;
  if (field.isValid?.pattern !== void 0 && fieldType.validate.pattern !== void 0) {
    pattern = {
      constraint: field.isValid?.pattern,
      validate: fieldType.validate.pattern
    };
  }
  const custom = field.isValid?.custom ?? fieldType.validate.custom;
  return {
    required,
    elements,
    min,
    max,
    minLength,
    maxLength,
    pattern,
    custom
  };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-filter.mjs
function getFilter(fieldType) {
  return fieldType.validOperators.reduce((accumulator, operator) => {
    const operatorObj = getOperatorByName(operator);
    if (operatorObj?.filter) {
      accumulator[operator] = operatorObj.filter;
    }
    return accumulator;
  }, {});
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-format.mjs
function getFormat(field, fieldType) {
  return {
    ...fieldType.format,
    ...field.format
  };
}
var get_format_default = getFormat;

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/field-types/index.mjs
function getFieldTypeByName(type) {
  const found = [
    email_default,
    integer_default,
    number_default,
    text_default,
    datetime_default,
    date_default,
    boolean_default,
    media_default,
    array_default,
    password_default,
    telephone_default,
    color_default,
    url_default
  ].find((fieldType) => fieldType?.type === type);
  if (!!found) {
    return found;
  }
  return no_type_default;
}
function normalizeFields(fields) {
  return fields.map((field) => {
    const fieldType = getFieldTypeByName(field.type);
    const getValue = field.getValue || get_value_from_id_default(field.id);
    const sort7 = function(a2, b2, direction) {
      const aValue = getValue({ item: a2 });
      const bValue = getValue({ item: b2 });
      return field.sort ? field.sort(aValue, bValue, direction) : fieldType.sort(aValue, bValue, direction);
    };
    return {
      id: field.id,
      label: field.label || field.id,
      header: field.header || field.label || field.id,
      description: field.description,
      placeholder: field.placeholder,
      getValue,
      setValue: field.setValue || set_value_from_id_default(field.id),
      elements: field.elements,
      getElements: field.getElements,
      hasElements: hasElements(field),
      isVisible: field.isVisible,
      enableHiding: field.enableHiding ?? true,
      readOnly: field.readOnly ?? false,
      // The type provides defaults for the following props
      type: fieldType.type,
      render: field.render ?? fieldType.render,
      Edit: getControl(field, fieldType.Edit),
      sort: sort7,
      enableSorting: field.enableSorting ?? fieldType.enableSorting,
      enableGlobalSearch: field.enableGlobalSearch ?? fieldType.enableGlobalSearch,
      isValid: getIsValid(field, fieldType),
      filterBy: get_filter_by_default(
        field,
        fieldType.defaultOperators,
        fieldType.validOperators
      ),
      filter: getFilter(fieldType),
      format: get_format_default(field, fieldType),
      getValueFormatted: field.getValueFormatted ?? fieldType.getValueFormatted
    };
  });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@11.3.0_@types+react@18.3.28_react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/dataviews/build-module/dataviews/index.mjs
var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1);
var defaultGetItemId = (item) => item.id;
var defaultIsItemClickable = () => true;
var EMPTY_ARRAY7 = [];
var dataViewsLayouts = VIEW_LAYOUTS.filter(
  (viewLayout) => !viewLayout.isPicker
);
function DefaultUI({
  header,
  search = true,
  searchLabel = void 0
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_jsx_runtime115.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
      Stack,
      {
        direction: "row",
        align: "top",
        justify: "space-between",
        className: "dataviews__view-actions",
        gap: "2xs",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
            Stack,
            {
              direction: "row",
              justify: "start",
              gap: "xs",
              className: "dataviews__search",
              children: [
                search && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(dataviews_search_default, { label: searchLabel }),
                /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(toggle_default, {})
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(Stack, { direction: "row", gap: "2xs", style: { flexShrink: 0 }, children: [
            /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(dataviews_view_config_default, {}),
            header
          ] })
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(filters_toggled_default, { className: "dataviews-filters__container" }),
    /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DataViewsLayout, {}),
    /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DataViewsFooter, {})
  ] });
}
function DataViews({
  view,
  onChangeView,
  fields,
  search = true,
  searchLabel = void 0,
  actions: actions2 = EMPTY_ARRAY7,
  data,
  getItemId: getItemId2 = defaultGetItemId,
  getItemLevel,
  isLoading = false,
  paginationInfo,
  defaultLayouts: defaultLayoutsProperty,
  selection: selectionProperty,
  onChangeSelection,
  onClickItem,
  renderItemLink,
  isItemClickable = defaultIsItemClickable,
  header,
  children,
  config = { perPageSizes: [10, 20, 50, 100] },
  empty
}) {
  const { infiniteScrollHandler } = paginationInfo;
  const containerRef = (0, import_element55.useRef)(null);
  const [containerWidth, setContainerWidth] = (0, import_element55.useState)(0);
  const resizeObserverRef = (0, import_compose12.useResizeObserver)(
    (resizeObserverEntries) => {
      setContainerWidth(
        resizeObserverEntries[0].borderBoxSize[0].inlineSize
      );
    },
    { box: "border-box" }
  );
  const [selectionState, setSelectionState] = (0, import_element55.useState)([]);
  const isUncontrolled = selectionProperty === void 0 || onChangeSelection === void 0;
  const selection = isUncontrolled ? selectionState : selectionProperty;
  const [openedFilter, setOpenedFilter] = (0, import_element55.useState)(null);
  function setSelectionWithChange(value) {
    const newValue = typeof value === "function" ? value(selection) : value;
    if (isUncontrolled) {
      setSelectionState(newValue);
    }
    if (onChangeSelection) {
      onChangeSelection(newValue);
    }
  }
  const _fields = (0, import_element55.useMemo)(() => normalizeFields(fields), [fields]);
  const _selection = (0, import_element55.useMemo)(() => {
    return selection.filter(
      (id) => data.some((item) => getItemId2(item) === id)
    );
  }, [selection, data, getItemId2]);
  const filters2 = use_filters_default(_fields, view);
  const hasPrimaryOrLockedFilters = (0, import_element55.useMemo)(
    () => (filters2 || []).some(
      (filter) => filter.isPrimary || filter.isLocked
    ),
    [filters2]
  );
  const [isShowingFilter, setIsShowingFilter] = (0, import_element55.useState)(
    hasPrimaryOrLockedFilters
  );
  (0, import_element55.useEffect)(() => {
    if (hasPrimaryOrLockedFilters && !isShowingFilter) {
      setIsShowingFilter(true);
    }
  }, [hasPrimaryOrLockedFilters, isShowingFilter]);
  (0, import_element55.useEffect)(() => {
    if (!view.infiniteScrollEnabled || !containerRef.current) {
      return;
    }
    const handleScroll = (0, import_compose12.throttle)((event) => {
      const target = event.target;
      const scrollTop = target.scrollTop;
      const scrollHeight = target.scrollHeight;
      const clientHeight = target.clientHeight;
      if (scrollTop + clientHeight >= scrollHeight - 100) {
        infiniteScrollHandler?.();
      }
    }, 100);
    const container = containerRef.current;
    container.addEventListener("scroll", handleScroll);
    return () => {
      container.removeEventListener("scroll", handleScroll);
      handleScroll.cancel();
    };
  }, [infiniteScrollHandler, view.infiniteScrollEnabled]);
  const defaultLayouts3 = (0, import_element55.useMemo)(
    () => Object.fromEntries(
      Object.entries(defaultLayoutsProperty).filter(
        ([layoutType]) => {
          return dataViewsLayouts.some(
            (viewLayout) => viewLayout.type === layoutType
          );
        }
      )
    ),
    [defaultLayoutsProperty]
  );
  if (!defaultLayouts3[view.type]) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
    dataviews_context_default.Provider,
    {
      value: {
        view,
        onChangeView,
        fields: _fields,
        actions: actions2,
        data,
        isLoading,
        paginationInfo,
        selection: _selection,
        onChangeSelection: setSelectionWithChange,
        openedFilter,
        setOpenedFilter,
        getItemId: getItemId2,
        getItemLevel,
        isItemClickable,
        onClickItem,
        renderItemLink,
        containerWidth,
        containerRef,
        resizeObserverRef,
        defaultLayouts: defaultLayouts3,
        filters: filters2,
        isShowingFilter,
        setIsShowingFilter,
        config,
        empty,
        hasInfiniteScrollHandler: !!infiniteScrollHandler
      },
      children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "dataviews-wrapper", ref: containerRef, children: children ?? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
        DefaultUI,
        {
          header,
          search,
          searchLabel
        }
      ) })
    }
  );
}
var DataViewsSubComponents = DataViews;
DataViewsSubComponents.BulkActionToolbar = BulkActionsFooter;
DataViewsSubComponents.Filters = filters_default;
DataViewsSubComponents.FiltersToggled = filters_toggled_default;
DataViewsSubComponents.FiltersToggle = toggle_default;
DataViewsSubComponents.Layout = DataViewsLayout;
DataViewsSubComponents.LayoutSwitcher = ViewTypeMenu;
DataViewsSubComponents.Pagination = DataViewsPagination;
DataViewsSubComponents.Search = dataviews_search_default;
DataViewsSubComponents.ViewConfig = DataviewsViewConfigDropdown;
DataViewsSubComponents.Footer = DataViewsFooter;
var dataviews_default = DataViewsSubComponents;

// routes/responses/stage.tsx
var import_date10 = __toESM(require_date());
var import_element97 = __toESM(require_element());
var import_html_entities5 = __toESM(require_html_entities());
var import_i18n86 = __toESM(require_i18n());
import { useParams, useSearch as useSearch2, useNavigate as useNavigate3 } from "@wordpress/route";

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/badge/badge.mjs
var import_element56 = __toESM(require_element(), 1);
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='244b5c59c0']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "244b5c59c0");
  style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg);font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-sm);font-weight:var(--wpds-font-weight-regular);line-height:var(--wpds-font-line-height-xs);padding-block:var(--wpds-dimension-padding-xs);padding-inline:var(--wpds-dimension-padding-sm)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error);color:var(--wpds-color-fg-content-error)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning);color:var(--wpds-color-fg-content-warning)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution);color:var(--wpds-color-fg-content-caution)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success);color:var(--wpds-color-fg-content-success)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info);color:var(--wpds-color-fg-content-info)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak);color:var(--wpds-color-fg-content-neutral)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral);color:var(--wpds-color-fg-content-neutral-weak)}}"));
  document.head.appendChild(style);
}
var style_default2 = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" };
var Badge3 = (0, import_element56.forwardRef)(function Badge22({ children, intent = "none", render: render4, className, ...props }, ref) {
  const element = useRender({
    render: render4,
    defaultTagName: "span",
    ref,
    props: mergeProps(props, {
      className: clsx_default(
        style_default2.badge,
        style_default2[`is-${intent}-intent`],
        className
      ),
      children
    })
  });
  return element;
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/icon/icon.mjs
var import_element57 = __toESM(require_element(), 1);
var import_primitives38 = __toESM(require_primitives(), 1);
var import_jsx_runtime116 = __toESM(require_jsx_runtime(), 1);
var Icon9 = (0, import_element57.forwardRef)(function Icon22({ icon: icon15, size = 24, ...restProps }, ref) {
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
    import_primitives38.SVG,
    {
      ref,
      fill: "currentColor",
      ...icon15.props,
      ...restProps,
      width: size,
      height: size
    }
  );
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/stack/stack.mjs
var import_element58 = __toESM(require_element(), 1);
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='71d20935c2']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "71d20935c2");
  style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}"));
  document.head.appendChild(style);
}
var style_default3 = { "stack": "_19ce0419607e1896__stack" };
var Stack3 = (0, import_element58.forwardRef)(function Stack22({ direction, gap, align, justify, wrap, render: render4, ...props }, ref) {
  const style = {
    gap: gap && `var(--wpds-dimension-gap-${gap})`,
    alignItems: align,
    justifyContent: justify,
    flexDirection: direction,
    flexWrap: wrap
  };
  const element = useRender({
    render: render4,
    ref,
    props: mergeProps(props, { style, className: style_default3.stack })
  });
  return element;
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/tabs/index.mjs
var tabs_exports = {};
__export(tabs_exports, {
  List: () => List,
  Panel: () => Panel,
  Root: () => Root,
  Tab: () => Tab
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/tabs/list.mjs
var import_element59 = __toESM(require_element(), 1);
var import_compose13 = __toESM(require_compose(), 1);
var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e0ff4b2c02']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "e0ff4b2c02");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong);bottom:0;height:var(--wpds-border-width-focus);left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active);border-radius:var(--wpds-border-radius-sm);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n		&[data-orientation=vertical]{border:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral);cursor:pointer;display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-md);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active)}&:after{border-radius:var(--wpds-border-radius-sm);opacity:0;outline:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm) var(--wpds-dimension-padding-md)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus)}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n			[role=tab]:is([aria-selected=true])\n			&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus) var(--wpds-color-stroke-focus-brand);outline:2px solid #0000;outline-offset:0}}}'));
  document.head.appendChild(style);
}
var style_default4 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
var SCROLL_EPSILON = 1;
var List = (0, import_element59.forwardRef)(
  function TabList({
    children,
    variant = "default",
    className,
    activateOnFocus,
    render: render4,
    ...otherProps
  }, forwardedRef) {
    const [listEl, setListEl] = (0, import_element59.useState)(null);
    const [overflow, setOverflow] = (0, import_element59.useState)({
      first: false,
      last: false,
      isScrolling: false
    });
    (0, import_element59.useEffect)(() => {
      if (!listEl) {
        return;
      }
      const measureOverflow = () => {
        const { scrollWidth, clientWidth, scrollLeft } = listEl;
        const maxScroll = Math.max(scrollWidth - clientWidth, 0);
        const direction = listEl.dir || (typeof window !== "undefined" ? window.getComputedStyle(listEl).direction : "ltr");
        const scrollFromStart = direction === "rtl" && scrollLeft < 0 ? (
          // In RTL layouts, scrollLeft is typically 0 at the visual "start"
          // (right edge) and becomes negative toward the "end" (left edge).
          // Normalize value for correct first/last detection logic.
          -scrollLeft
        ) : scrollLeft;
        setOverflow({
          first: scrollFromStart > SCROLL_EPSILON,
          last: scrollFromStart < maxScroll - SCROLL_EPSILON,
          isScrolling: scrollWidth > clientWidth
        });
      };
      const resizeObserver = new ResizeObserver(measureOverflow);
      resizeObserver.observe(listEl);
      let scrollTick = false;
      const throttleMeasureOverflowOnScroll = () => {
        if (!scrollTick) {
          requestAnimationFrame(() => {
            measureOverflow();
            scrollTick = false;
          });
          scrollTick = true;
        }
      };
      listEl.addEventListener(
        "scroll",
        throttleMeasureOverflowOnScroll,
        { passive: true }
      );
      measureOverflow();
      return () => {
        listEl.removeEventListener(
          "scroll",
          throttleMeasureOverflowOnScroll
        );
        resizeObserver.disconnect();
      };
    }, [listEl]);
    const mergedListRef = (0, import_compose13.useMergeRefs)([
      forwardedRef,
      (el) => setListEl(el)
    ]);
    return /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
      index_parts_exports.List,
      {
        ref: mergedListRef,
        activateOnFocus,
        "data-select-on-move": activateOnFocus ? "true" : "false",
        className: clsx_default(
          style_default4.tablist,
          overflow.first && style_default4["is-overflowing-first"],
          overflow.last && style_default4["is-overflowing-last"],
          style_default4[`is-${variant}-variant`],
          className
        ),
        ...otherProps,
        tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
        children: [
          children,
          /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(index_parts_exports.Indicator, { className: style_default4.indicator })
        ]
      }
    );
  }
);

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/tabs/panel.mjs
var import_element60 = __toESM(require_element(), 1);
var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e0ff4b2c02']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "e0ff4b2c02");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong);bottom:0;height:var(--wpds-border-width-focus);left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active);border-radius:var(--wpds-border-radius-sm);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n		&[data-orientation=vertical]{border:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral);cursor:pointer;display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-md);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active)}&:after{border-radius:var(--wpds-border-radius-sm);opacity:0;outline:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm) var(--wpds-dimension-padding-md)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus)}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n			[role=tab]:is([aria-selected=true])\n			&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus) var(--wpds-color-stroke-focus-brand);outline:2px solid #0000;outline-offset:0}}}'));
  document.head.appendChild(style);
}
var style_default5 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
var Panel = (0, import_element60.forwardRef)(
  function TabPanel2({ className, ...otherProps }, forwardedRef) {
    return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
      index_parts_exports.Panel,
      {
        ref: forwardedRef,
        className: clsx_default(style_default5.tabpanel, className),
        ...otherProps
      }
    );
  }
);

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/tabs/root.mjs
var import_element61 = __toESM(require_element(), 1);
var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1);
var Root = (0, import_element61.forwardRef)(
  function TabsRoot3({ ...otherProps }, forwardedRef) {
    return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(index_parts_exports.Root, { ref: forwardedRef, ...otherProps });
  }
);

// ../../../node_modules/.pnpm/@wordpress+ui@0.7.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@16.26.1/node_modules/@wordpress/ui/build-module/tabs/tab.mjs
var import_element62 = __toESM(require_element(), 1);
var import_jsx_runtime120 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e0ff4b2c02']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "e0ff4b2c02");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong);bottom:0;height:var(--wpds-border-width-focus);left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active);border-radius:var(--wpds-border-radius-sm);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n		&[data-orientation=vertical]{border:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral);cursor:pointer;display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body);font-size:var(--wpds-font-size-md);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active)}&:after{border-radius:var(--wpds-border-radius-sm);opacity:0;outline:var(--wpds-border-width-focus) solid var(--wpds-color-stroke-focus-brand);pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm) var(--wpds-dimension-padding-md)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus)}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n			[role=tab]:is([aria-selected=true])\n			&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus) var(--wpds-color-stroke-focus-brand);outline:2px solid #0000;outline-offset:0}}}'));
  document.head.appendChild(style);
}
var style_default6 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
var Tab = (0, import_element62.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(
    index_parts_exports.Tab,
    {
      ref: forwardedRef,
      className: clsx_default(style_default6.tab, className),
      ...otherProps,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("span", { className: style_default6["tab-children"], children }),
        /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(Icon9, { icon: chevron_right_default, className: style_default6["tab-chevron"] })
      ]
    }
  );
});

// routes/responses/stage.tsx
var React33 = __toESM(require_react());

// src/blocks/contact-form/components/jetpack-integrations-modal/index.tsx
var import_components62 = __toESM(require_components(), 1);
var import_i18n60 = __toESM(require_i18n(), 1);

// ../../js-packages/analytics/index.jsx
var import_debug3 = __toESM(require_browser(), 1);
var debug3 = (0, import_debug3.default)("dops:analytics");
var _superProps;
var _user;
window._tkq = window._tkq || [];
window.ga = window.ga || function() {
  (window.ga.q = window.ga.q || []).push(arguments);
};
window.ga.l = +/* @__PURE__ */ new Date();
function buildQuerystring(group, name) {
  let uriComponent = "";
  if ("object" === typeof group) {
    for (const key in group) {
      uriComponent += "&x_" + encodeURIComponent(key) + "=" + encodeURIComponent(group[key]);
    }
    debug3("Bumping stats %o", group);
  } else {
    uriComponent = "&x_" + encodeURIComponent(group) + "=" + encodeURIComponent(name);
    debug3('Bumping stat "%s" in group "%s"', name, group);
  }
  return uriComponent;
}
function buildQuerystringNoPrefix(group, name) {
  let uriComponent = "";
  if ("object" === typeof group) {
    for (const key in group) {
      uriComponent += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(group[key]);
    }
    debug3("Built stats %o", group);
  } else {
    uriComponent = "&" + encodeURIComponent(group) + "=" + encodeURIComponent(name);
    debug3('Built stat "%s" in group "%s"', name, group);
  }
  return uriComponent;
}
var analytics = {
  initialize: function(userId, username, superProps) {
    analytics.setUser(userId, username);
    analytics.setSuperProps(superProps);
    analytics.identifyUser();
  },
  setGoogleAnalyticsEnabled: function(googleAnalyticsEnabled, googleAnalyticsKey = null) {
    this.googleAnalyticsEnabled = googleAnalyticsEnabled;
    this.googleAnalyticsKey = googleAnalyticsKey;
  },
  setMcAnalyticsEnabled: function(mcAnalyticsEnabled) {
    this.mcAnalyticsEnabled = mcAnalyticsEnabled;
  },
  setUser: function(userId, username) {
    _user = { ID: userId, username };
  },
  setSuperProps: function(superProps) {
    _superProps = superProps;
  },
  /**
   * Add global properties to be applied to all "tracks" events.
   * This function will add the new properties, overwrite the existing one.
   * Unlike `setSuperProps()`, it will not replace the whole object.
   *
   * @param {object} props - Super props to add.
   */
  assignSuperProps: function(props) {
    _superProps = Object.assign(_superProps || {}, props);
  },
  mc: {
    bumpStat: function(group, name) {
      const uriComponent = buildQuerystring(group, name);
      if (analytics.mcAnalyticsEnabled) {
        new Image().src = document.location.protocol + "//pixel.wp.com/g.gif?v=wpcom-no-pv" + uriComponent + "&t=" + Math.random();
      }
    },
    bumpStatWithPageView: function(group, name) {
      const uriComponent = buildQuerystringNoPrefix(group, name);
      if (analytics.mcAnalyticsEnabled) {
        new Image().src = document.location.protocol + "//pixel.wp.com/g.gif?v=wpcom" + uriComponent + "&t=" + Math.random();
      }
    }
  },
  // pageView is a wrapper for pageview events across Tracks and GA
  pageView: {
    record: function(urlPath, pageTitle) {
      analytics.tracks.recordPageView(urlPath);
      analytics.ga.recordPageView(urlPath, pageTitle);
    }
  },
  purchase: {
    record: function(transactionId, itemName, itemId, revenue, price, qty, currency) {
      analytics.ga.recordPurchase(transactionId, itemName, itemId, revenue, price, qty, currency);
    }
  },
  tracks: {
    recordEvent: function(eventName, eventProperties) {
      eventProperties = eventProperties || {};
      if (eventName.indexOf("akismet_") !== 0 && eventName.indexOf("jetpack_") !== 0) {
        debug3('- Event name must be prefixed by "akismet_" or "jetpack_"');
        return;
      }
      if (_superProps) {
        debug3("- Super Props: %o", _superProps);
        eventProperties = Object.assign(eventProperties, _superProps);
      }
      debug3(
        'Record event "%s" called with props %s',
        eventName,
        JSON.stringify(eventProperties)
      );
      window._tkq.push(["recordEvent", eventName, eventProperties]);
    },
    recordJetpackClick: function(target) {
      const props = "object" === typeof target ? target : { target };
      analytics.tracks.recordEvent("jetpack_wpa_click", props);
    },
    recordPageView: function(urlPath) {
      analytics.tracks.recordEvent("akismet_page_view", {
        path: urlPath
      });
    },
    setOptOut: function(isOptingOut) {
      debug3("Pushing setOptOut: %o", isOptingOut);
      window._tkq.push(["setOptOut", isOptingOut]);
    }
  },
  // Google Analytics usage and event stat tracking
  ga: {
    initialized: false,
    initialize: function() {
      let parameters = {};
      if (!analytics.ga.initialized) {
        if (_user) {
          parameters = {
            userId: "u-" + _user.ID
          };
        }
        window.ga("create", this.googleAnalyticsKey, "auto", parameters);
        analytics.ga.initialized = true;
      }
    },
    recordPageView: function(urlPath, pageTitle) {
      analytics.ga.initialize();
      debug3("Recording Page View ~ [URL: " + urlPath + "] [Title: " + pageTitle + "]");
      if (this.googleAnalyticsEnabled) {
        window.ga("set", "page", urlPath);
        window.ga("send", {
          hitType: "pageview",
          page: urlPath,
          title: pageTitle
        });
      }
    },
    recordEvent: function(category, action, label, value) {
      analytics.ga.initialize();
      let debugText = "Recording Event ~ [Category: " + category + "] [Action: " + action + "]";
      if ("undefined" !== typeof label) {
        debugText += " [Option Label: " + label + "]";
      }
      if ("undefined" !== typeof value) {
        debugText += " [Option Value: " + value + "]";
      }
      debug3(debugText);
      if (this.googleAnalyticsEnabled) {
        window.ga("send", "event", category, action, label, value);
      }
    },
    recordPurchase: function(transactionId, itemName, itemId, revenue, price, qty, currency) {
      window.ga("require", "ecommerce");
      window.ga("ecommerce:addTransaction", {
        id: transactionId,
        // Transaction ID. Required.
        // 'affiliation': 'Acme Clothing',   // Affiliation or store name.
        revenue,
        // Grand Total.
        // 'tax': '1.29',                     // Tax.
        currency
        // local currency code.
      });
      window.ga("ecommerce:addItem", {
        id: transactionId,
        // Transaction ID. Required.
        name: itemName,
        // Product name. Required.
        sku: itemId,
        // SKU/code.
        // 'category': 'Party Toys',         // Category or variation.
        price,
        // Unit price.
        quantity: qty
        // Quantity.
      });
      window.ga("ecommerce:send");
    }
  },
  identifyUser: function() {
    if (_user) {
      window._tkq.push(["identifyUser", _user.ID, _user.username]);
    }
  },
  setProperties: function(properties) {
    window._tkq.push(["setProperties", properties]);
  },
  clearedIdentity: function() {
    window._tkq.push(["clearIdentity"]);
  }
};
var analytics_default = analytics;

// src/blocks/contact-form/components/jetpack-integrations-modal/integrations-list.tsx
var import_element72 = __toESM(require_element(), 1);

// ../../js-packages/components/build/tools/jp-redirect/index.js
function getRedirectUrl(source, args = {}) {
  const queryVars = {};
  let calypsoEnv;
  if (typeof window !== "undefined") {
    calypsoEnv = window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv;
  }
  if (source.search("https://") === 0) {
    const parsedUrl = new URL(source);
    source = `https://${parsedUrl.host}${parsedUrl.pathname}`;
    queryVars.url = encodeURIComponent(source);
  } else {
    queryVars.source = encodeURIComponent(source);
  }
  for (const argName in args) {
    queryVars[argName] = encodeURIComponent(args[argName]);
  }
  if (!Object.keys(queryVars).includes("site") && typeof jetpack_redirects !== "undefined" && Object.hasOwn(jetpack_redirects, "currentSiteRawUrl")) {
    queryVars.site = jetpack_redirects.currentBlogID ?? jetpack_redirects.currentSiteRawUrl;
  }
  if (calypsoEnv) {
    queryVars.calypso_env = calypsoEnv;
  }
  const queryString = Object.keys(queryVars).map((key) => key + "=" + queryVars[key]).join("&");
  return `https://jetpack.com/redirect/?` + queryString;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/akismet.tsx
var import_components49 = __toESM(require_components(), 1);
var import_element63 = __toESM(require_element(), 1);
var import_i18n45 = __toESM(require_i18n(), 1);

// src/icons/akismet.tsx
var import_i18n44 = __toESM(require_i18n(), 1);
var import_primitives39 = __toESM(require_primitives(), 1);
var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1);
var AkismetIcon = (props) => {
  return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(
    import_primitives39.SVG,
    {
      width: props.width || 46,
      height: props.height || 46,
      viewBox: "0 0 46 46",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      role: "img",
      "aria-label": (0, import_i18n44.__)("Akismet icon", "jetpack-forms"),
      ...props,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_primitives39.Rect, { width: "46", height: "46", rx: "8", fill: "#357B49" }),
        /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_primitives39.G, { clipPath: "url(#clip0_3308_44290)", children: [
          /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
            import_primitives39.Path,
            {
              d: "M24.4162 12.0335L31.0989 29.5939C31.6753 31.0964 32.5607 31.641 34.0748 31.7683C34.1301 31.7708 34.1843 31.7847 34.2341 31.8089C34.2839 31.8332 34.3281 31.8675 34.3641 31.9095C34.4001 31.9515 34.4271 32.0005 34.4435 32.0534C34.4598 32.1063 34.4651 32.162 34.459 32.217C34.4613 32.2738 34.4522 32.3305 34.4324 32.3837C34.4125 32.437 34.3823 32.4858 34.3435 32.5274C34.3046 32.5689 34.2579 32.6023 34.2061 32.6257C34.1542 32.6491 34.0982 32.6619 34.0414 32.6635H26.7218C26.6626 32.665 26.6037 32.6544 26.5488 32.6325C26.4938 32.6106 26.4438 32.5778 26.4019 32.536C26.3599 32.4943 26.3268 32.4445 26.3047 32.3897C26.2825 32.3349 26.2716 32.2761 26.2728 32.217C26.2684 32.1596 26.276 32.1019 26.2951 32.0476C26.3141 31.9933 26.3442 31.9435 26.3834 31.9014C26.4227 31.8593 26.4702 31.8257 26.523 31.8028C26.5758 31.7799 26.6328 31.7681 26.6904 31.7683C27.4255 31.7683 28.2588 31.5763 28.2588 30.6811C28.2523 30.3078 28.1758 29.939 28.0332 29.5939L26.4294 25.3389C26.3646 25.1469 26.3333 25.0822 26.1412 25.0822H20.0328C19.0722 25.0822 17.8881 25.0822 17.3431 26.2988L15.8812 29.5939C15.7326 29.8928 15.6452 30.2185 15.6244 30.5517C15.6244 31.7036 17.13 31.7683 17.9215 31.7683C17.9791 31.7681 18.0361 31.7799 18.0889 31.8028C18.1418 31.8257 18.1893 31.8593 18.2285 31.9014C18.2677 31.9435 18.2978 31.9933 18.3169 32.0476C18.3359 32.1019 18.3435 32.1596 18.3392 32.217C18.3404 32.2762 18.3294 32.335 18.3071 32.3899C18.2848 32.4448 18.2515 32.4945 18.2093 32.5361C18.1671 32.5777 18.1168 32.6103 18.0616 32.6318C18.0064 32.6534 17.9474 32.6635 17.8881 32.6615H11.3934C11.3343 32.6629 11.2756 32.6523 11.2207 32.6304C11.1658 32.6084 11.116 32.5756 11.0742 32.5338C11.0324 32.4921 10.9995 32.4423 10.9776 32.3875C10.9556 32.3326 10.9451 32.2739 10.9465 32.2149C10.9422 32.1575 10.9498 32.0998 10.9688 32.0455C10.9879 31.9912 11.0179 31.9414 11.0572 31.8993C11.0964 31.8572 11.1439 31.8236 11.1967 31.8007C11.2496 31.7778 11.3066 31.7661 11.3642 31.7662C12.9325 31.6702 13.4525 30.9315 14.0518 29.5918L21.7661 12.7033C22.1191 11.9667 22.8876 11.3281 23.5913 11.3281C24.0967 11.3302 24.2575 11.6182 24.4162 12.0335ZM18.5689 23.4837C18.5302 23.5406 18.5078 23.607 18.5042 23.6757C18.5042 23.7404 18.5689 23.7717 18.6963 23.7717H25.0344C25.4813 23.7717 25.6734 23.6757 25.6734 23.3877C25.6728 23.2432 25.64 23.1006 25.5773 22.9704L23.8169 18.2354C23.3992 17.1482 22.7936 15.7104 22.6015 14.5251C22.6015 14.4625 22.5681 14.4291 22.5367 14.4291C22.5054 14.4291 22.4741 14.4625 22.4741 14.5251C22.2337 15.3401 21.9228 16.1326 21.5448 16.8936L18.5689 23.4837Z",
              fill: "white"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
            import_primitives39.Path,
            {
              d: "M24.4162 12.0335L31.0989 29.5939C31.6753 31.0964 32.5607 31.641 34.0748 31.7683C34.1301 31.7708 34.1843 31.7847 34.2341 31.809C34.2839 31.8332 34.3281 31.8675 34.3641 31.9095C34.4001 31.9516 34.4271 32.0005 34.4435 32.0534C34.4598 32.1063 34.4651 32.162 34.459 32.217C34.4613 32.2738 34.4522 32.3305 34.4324 32.3837C34.4125 32.437 34.3823 32.4858 34.3435 32.5274C34.3046 32.5689 34.2579 32.6023 34.2061 32.6257C34.1542 32.6491 34.0982 32.6619 34.0414 32.6636H26.7218C26.6626 32.665 26.6037 32.6544 26.5488 32.6325C26.4938 32.6106 26.4438 32.5778 26.4019 32.536C26.3599 32.4943 26.3268 32.4445 26.3047 32.3897C26.2825 32.3349 26.2716 32.2761 26.2728 32.217C26.2684 32.1596 26.276 32.1019 26.2951 32.0476C26.3141 31.9933 26.3442 31.9435 26.3834 31.9014C26.4227 31.8593 26.4702 31.8257 26.523 31.8028C26.5758 31.7799 26.6328 31.7682 26.6904 31.7683C27.4255 31.7683 28.2588 31.5763 28.2588 30.6811C28.2523 30.3078 28.1758 29.939 28.0332 29.5939L26.4294 25.3389C26.3647 25.1469 26.3333 25.0822 26.1412 25.0822H20.0328C19.0722 25.0822 17.8881 25.0822 17.3431 26.2988L15.8812 29.5939C15.7326 29.8929 15.6452 30.2185 15.6244 30.5517C15.6244 31.7036 17.13 31.7683 17.9215 31.7683C17.9791 31.7682 18.0361 31.7799 18.0889 31.8028C18.1418 31.8257 18.1893 31.8593 18.2285 31.9014C18.2677 31.9435 18.2978 31.9933 18.3169 32.0476C18.3359 32.1019 18.3435 32.1596 18.3392 32.217C18.3404 32.2762 18.3294 32.335 18.3071 32.3899C18.2848 32.4448 18.2515 32.4945 18.2093 32.5361C18.1671 32.5777 18.1168 32.6103 18.0616 32.6318C18.0064 32.6534 17.9474 32.6635 17.8881 32.6615H11.3934C11.3343 32.6629 11.2756 32.6523 11.2207 32.6304C11.1658 32.6084 11.116 32.5756 11.0742 32.5339C11.0324 32.4921 10.9995 32.4423 10.9776 32.3875C10.9556 32.3326 10.9451 32.2739 10.9465 32.2149C10.9422 32.1575 10.9498 32.0999 10.9688 32.0455C10.9879 31.9912 11.0179 31.9415 11.0572 31.8993C11.0964 31.8572 11.1439 31.8236 11.1967 31.8007C11.2496 31.7778 11.3066 31.7661 11.3642 31.7662C12.9325 31.6702 13.4525 30.9315 14.0518 29.5918L21.7661 12.7033C22.1191 11.9667 22.8876 11.3281 23.5913 11.3281C24.0967 11.3302 24.2575 11.6182 24.4162 12.0335ZM18.5689 23.4837C18.5302 23.5406 18.5078 23.607 18.5042 23.6757C18.5042 23.7404 18.5689 23.7717 18.6963 23.7717H25.0344C25.4813 23.7717 25.6734 23.6757 25.6734 23.3877C25.6728 23.2432 25.64 23.1006 25.5774 22.9704L23.8169 18.2354C23.3992 17.1482 22.7936 15.7104 22.6015 14.5251C22.6015 14.4625 22.5681 14.4291 22.5367 14.4291C22.5054 14.4291 22.4741 14.4625 22.4741 14.5251C22.2337 15.3401 21.9228 16.1326 21.5448 16.8936L18.5689 23.4837Z",
              fill: "white"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
            import_primitives39.Path,
            {
              d: "M36.4557 22.7333C36.4557 23.5555 35.99 24.0209 35.1484 24.0209C34.3068 24.0209 33.9727 23.5931 33.9727 22.9399C33.9727 22.1177 34.4592 21.6523 35.28 21.6523C36.1007 21.6523 36.4557 22.0989 36.4557 22.7333Z",
              fill: "white"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
            import_primitives39.Path,
            {
              d: "M11.3739 22.7588C11.3739 23.5789 10.9061 24.0464 10.0666 24.0464C9.22712 24.0464 8.88672 23.6165 8.88672 22.9633C8.88672 22.1432 9.3733 21.6758 10.194 21.6758C11.0147 21.6758 11.3739 22.1244 11.3739 22.7588Z",
              fill: "white"
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_primitives39.Defs, { children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("clipPath", { id: "clip0_3308_44290", children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
          import_primitives39.Rect,
          {
            width: "27.5556",
            height: "21.3333",
            fill: "white",
            transform: "translate(8.89062 11.332)"
          }
        ) }) })
      ]
    }
  );
};
var akismet_default = AkismetIcon;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/akismet.tsx
var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1);
function buildAkismetCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers
}) {
  const isConnected = !!integration.isConnected;
  const settingsUrl = integration.settingsUrl || "";
  const marketingUrl = integration.marketingUrl || "";
  const details = integration.details || {};
  const spamUrl = details.formSubmissionsSpamUrl || "";
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(akismet_default, { width: 28, height: 28 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      headerToggleValue: isConnected,
      isHeaderToggleEnabled: false,
      notInstalledMessage: (0, import_element63.createInterpolateElement)(
        (0, import_i18n45.__)(
          "Add one-click spam protection for your forms with <a>Akismet</a>. Simply install the plugin and you're set.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components49.ExternalLink, { href: marketingUrl, children: null }) }
      ),
      notActivatedMessage: (0, import_i18n45.__)(
        "Akismet is installed. Just activate the plugin to start blocking spam.",
        "jetpack-forms"
      ),
      trackEventName: "jetpack_forms_upsell_akismet_click"
    },
    toggleTooltip: (0, import_i18n45.__)("We keep your forms protected", "jetpack-forms"),
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "integration-card__description", children: (0, import_element63.createInterpolateElement)(
        (0, import_i18n45.__)(
          "Akismet is active. There is one step left. Please add your <a>Akismet key</a>.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components49.ExternalLink, { href: settingsUrl, children: null }) }
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
        import_components49.Button,
        {
          variant: "secondary",
          href: settingsUrl,
          target: "_blank",
          rel: "noopener noreferrer",
          __next40pxDefaultSize: true,
          children: (0, import_i18n45.__)("Add Akismet key", "jetpack-forms")
        }
      )
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("p", { className: "integration-card__description", children: (0, import_i18n45.__)("Your forms are automatically protected with Akismet.", "jetpack-forms") }),
      /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_components49.__experimentalHStack, { spacing: "2", justify: "start", className: "integration-card__links", children: [
        context === "dashboard" && handlers?.goToSpam ? /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components49.Button, { variant: "link", onClick: handlers.goToSpam, children: (0, import_i18n45.__)("View spam", "jetpack-forms") }) : /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components49.Button, { variant: "link", href: spamUrl, target: "_blank", rel: "noopener noreferrer", children: (0, import_i18n45.__)("View spam", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { children: "|" }),
        settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(import_jsx_runtime122.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components49.Button, { variant: "link", href: settingsUrl, target: "_blank", rel: "noopener noreferrer", children: (0, import_i18n45.__)("View stats and settings", "jetpack-forms") }),
          /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { children: "|" })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_components49.ExternalLink, { href: getRedirectUrl("akismet-jetpack-forms-docs"), children: (0, import_i18n45.__)("Learn about Akismet", "jetpack-forms") })
      ] })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/google-drive.tsx
var import_components52 = __toESM(require_components(), 1);
var import_i18n48 = __toESM(require_i18n(), 1);

// src/icons/google-sheets.tsx
var import_primitives40 = __toESM(require_primitives(), 1);
var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1);
var GoogleSheetsIcon = (props) => {
  return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_primitives40.SVG, { viewBox: "0 0 64 88", width: props.width || 28, height: props.height || 28, ...props, children: [
    /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_primitives40.Path, { d: "M 42,0 64,22 53,24 42,22 40,11 Z", fill: "#188038" }),
    /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
      import_primitives40.Path,
      {
        d: "M 42,22 V 0 H 6 C 2.685,0 0,2.685 0,6 v 76 c 0,3.315 2.685,6 6,6 h 52 c 3.315,0 6,-2.685 6,-6 V 22 Z",
        fill: "#34a853"
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
      import_primitives40.Path,
      {
        d: "M 12,34 V 63 H 52 V 34 Z M 29.5,58 H 17 v -7 h 12.5 z m 0,-12 H 17 V 39 H 29.5 Z M 47,58 H 34.5 V 51 H 47 Z M 47,46 H 34.5 V 39 H 47 Z",
        fill: "#fff"
      }
    )
  ] });
};
var google_sheets_default = GoogleSheetsIcon;

// ../../../node_modules/.pnpm/@automattic+popup-monitor@1.0.2/node_modules/@automattic/popup-monitor/dist/esm/index.js
var import_events8 = __toESM(require_events());
function Emitter(prototype) {
  Object.assign(prototype, import_events8.EventEmitter.prototype);
  prototype.emitChange = function() {
    this.emit("change");
  };
  prototype.off = prototype.removeListener;
}
function PopupMonitor() {
  this.intervals = {};
  this.monitorInterval = null;
  this.windowInstance = null;
  this.onMessage = (messageEvent) => {
    if (messageEvent.source === this.windowInstance) {
      this.emit("message", messageEvent.data);
    }
  };
}
Emitter(PopupMonitor.prototype);
PopupMonitor.prototype.open = function(url, name, specs) {
  name = name || Date.now();
  this.windowInstance = window.open(url, name, specs);
  this.startMonitoring(name, this.windowInstance);
  window.addEventListener("message", this.onMessage, false);
  return this;
};
PopupMonitor.prototype.getScreenCenterSpecs = function(width, height) {
  const screenTop = typeof window.screenTop !== "undefined" ? window.screenTop : window.screenY;
  const screenLeft = typeof window.screenLeft !== "undefined" ? window.screenLeft : window.screenX;
  return ["width=" + width, "height=" + height, "top=" + (screenTop + window.innerHeight / 2 - height / 2), "left=" + (screenLeft + window.innerWidth / 2 - width / 2)].join();
};
PopupMonitor.prototype.isOpen = function(name) {
  let isClosed = false;
  try {
    isClosed = this.intervals[name] && this.intervals[name].closed;
  } catch (e2) {
  }
  return !isClosed;
};
PopupMonitor.prototype.checkStatus = function() {
  for (const name in this.intervals) {
    if (this.intervals.hasOwnProperty(name) && !this.isOpen(name)) {
      this.emit("close", name);
      delete this.intervals[name];
    }
  }
  if (0 === Object.keys(this.intervals).length) {
    clearInterval(this.monitorInterval);
    delete this.monitorInterval;
    window.removeEventListener("message", this.onMessage);
  }
};
PopupMonitor.prototype.startMonitoring = function(name, windowInstance) {
  if (!this.monitorInterval) {
    this.monitorInterval = setInterval(this.checkStatus.bind(this), 100);
  }
  this.intervals[name] = windowInstance;
};
var esm_default = PopupMonitor;

// ../../../node_modules/.pnpm/@automattic+request-external-access@1.0.1/node_modules/@automattic/request-external-access/dist/esm/index.js
var requestExternalAccess = (url, cb) => {
  const popupMonitor = new esm_default();
  let lastMessage;
  popupMonitor.open(url, null, "toolbar=0,location=0,status=0,menubar=0," + popupMonitor.getScreenCenterSpecs(780, 700));
  popupMonitor.once("close", () => {
    const result2 = {};
    if (lastMessage && lastMessage.keyring_id) {
      result2.keyring_id = Number(lastMessage.keyring_id);
      result2.id_token = lastMessage.id_token;
      result2.user = lastMessage.user;
    }
    cb(result2);
  });
  popupMonitor.on("message", (message2) => lastMessage = message2);
};
var esm_default2 = requestExternalAccess;

// src/blocks/contact-form/components/jetpack-integrations-modal/components/google-drive-connect-button.tsx
var import_components50 = __toESM(require_components(), 1);
var import_element64 = __toESM(require_element(), 1);
var import_i18n46 = __toESM(require_i18n(), 1);
var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1);
function GoogleDriveConnectButton({
  settingsUrl,
  onConnected,
  isConnected
}) {
  const connectingText = (0, import_i18n46.__)("Connecting\u2026", "jetpack-forms");
  const connectText = (0, import_i18n46.__)("Connect to Google Drive", "jetpack-forms");
  const [isToggling, setIsToggling] = (0, import_element64.useState)(false);
  (0, import_element64.useEffect)(() => {
    setIsToggling(false);
  }, [isConnected]);
  const handleClick = () => {
    if (!settingsUrl) return;
    setIsToggling(true);
    esm_default2(settingsUrl, ({ keyring_id: keyringId }) => {
      if (keyringId) {
        onConnected();
      } else {
        setIsToggling(false);
      }
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(
    import_components50.Button,
    {
      variant: "secondary",
      onClick: handleClick,
      __next40pxDefaultSize: true,
      disabled: !settingsUrl || isToggling,
      children: isToggling ? connectingText : connectText
    }
  );
}

// src/blocks/contact-form/components/jetpack-integrations-modal/components/google-drive-disconnect-button.tsx
var import_api_fetch = __toESM(require_api_fetch(), 1);
var import_components51 = __toESM(require_components(), 1);
var import_element65 = __toESM(require_element(), 1);
var import_i18n47 = __toESM(require_i18n(), 1);
var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1);
function GoogleDriveDisconnectButton({ onDisconnected, isConnected }) {
  const disconnectingText = (0, import_i18n47.__)("Disconnecting\u2026", "jetpack-forms");
  const disconnectText = (0, import_i18n47.__)("Disconnect Google Drive", "jetpack-forms");
  const [isToggling, setIsToggling] = (0, import_element65.useState)(false);
  (0, import_element65.useEffect)(() => {
    setIsToggling(false);
  }, [isConnected]);
  const handleClick = () => {
    setIsToggling(true);
    (0, import_api_fetch.default)({ method: "DELETE", path: "/wp/v2/feedback/integrations/google-drive" }).then((response) => {
      if (response.deleted) {
        onDisconnected();
      }
    }).finally(() => {
      setIsToggling(false);
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_components51.Button, { variant: "link", onClick: handleClick, disabled: isToggling, children: isToggling ? disconnectingText : disconnectText });
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/google-drive.tsx
var import_jsx_runtime126 = __toESM(require_jsx_runtime(), 1);
function buildGoogleDriveCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers
}) {
  const isConnected = !!integration.isConnected;
  const settingsUrl = integration.settingsUrl;
  const defaultResponsesUrl = "/wp-admin/admin.php?page=jetpack-forms-admin";
  const responsesUrl = window.jpFormsBlocks?.defaults?.formsResponsesUrl || defaultResponsesUrl;
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(google_sheets_default, { className: "google-sheets-icon" }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      slug: "google-sheets",
      showHeaderToggle: false,
      isActive: !!integration.isConnected,
      trackEventName: "jetpack_forms_upsell_googledrive_click"
    },
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "integration-card__description", children: (0, import_i18n48.__)(
        "Connect your site to Google Drive to export form responses directly to Google Sheets.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
        GoogleDriveConnectButton,
        {
          settingsUrl,
          onConnected: refreshIntegrations2,
          isConnected
        }
      )
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("p", { className: "integration-card__description", children: (0, import_i18n48.__)(
        "Google Sheets is connected. You can export your form responses from the form responses page.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_components52.__experimentalHStack, { spacing: "2", justify: "start", className: "integration-card__links", children: [
        context === "dashboard" && handlers?.goToResponses ? /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_components52.Button, { variant: "link", onClick: handlers.goToResponses, children: (0, import_i18n48.__)("View form responses", "jetpack-forms") }) : /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_components52.Button, { variant: "link", href: responsesUrl, target: "_blank", rel: "noopener noreferrer", children: (0, import_i18n48.__)("View form responses", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("span", { children: "|" }),
        /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
          GoogleDriveDisconnectButton,
          {
            onDisconnected: refreshIntegrations2,
            isConnected
          }
        )
      ] })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/hostinger-reach.tsx
var import_components53 = __toESM(require_components(), 1);
var import_element66 = __toESM(require_element(), 1);
var import_i18n50 = __toESM(require_i18n(), 1);

// src/icons/hostinger-reach.tsx
var import_i18n49 = __toESM(require_i18n(), 1);
var import_primitives41 = __toESM(require_primitives(), 1);
var import_jsx_runtime127 = __toESM(require_jsx_runtime(), 1);
var HostingerReachIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
  import_primitives41.SVG,
  {
    ...props,
    width: props.width || 30,
    height: props.height || 30,
    viewBox: "7.002 8.287 148.203 175.426",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    role: "img",
    "aria-label": (0, import_i18n49.__)("Hostinger Reach icon", "jetpack-forms"),
    children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
      import_primitives41.Path,
      {
        d: "m7.002 8.287 39.319 21.172v39.32h57.467l36.295 21.172h-133.081zm148.203 75.615v-54.443l-42.344-21.172v51.418zm0 99.811-39.319-21.172v-39.32h-57.467l-36.295-21.172h133.081zm-148.203-75.615v54.443l42.343 21.172v-51.418z",
        fill: "#6747c7",
        fillRule: "evenodd",
        clipRule: "evenodd"
      }
    )
  }
);
var hostinger_reach_default = HostingerReachIcon;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/hostinger-reach.tsx
var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1);
function buildHostingerReachCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes,
  components
}) {
  const ConsentToggle = components?.ConsentToggle;
  const { isConnected = false, settingsUrl = "" } = integration || {};
  const enabledForForm = !!attributes?.hostingerReach?.enabledForForm;
  const groupName = attributes?.hostingerReach?.groupName ?? "";
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(hostinger_reach_default, { width: 28, height: 28 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: enabledForForm,
        isHeaderToggleEnabled: isConnected,
        onHeaderToggleChange: (value) => setAttributes?.({
          hostingerReach: {
            ...attributes?.hostingerReach ?? {},
            enabledForForm: value
          }
        })
      },
      notInstalledMessage: (0, import_element66.createInterpolateElement)(
        (0, import_i18n50.__)(
          "Add powerful email marketing to your forms with <a>Hostinger Reach</a>. Simply install the plugin to start sending emails.",
          "jetpack-forms"
        ),
        {
          a: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components53.ExternalLink, { href: integration.marketingUrl || "", children: null })
        }
      ),
      notActivatedMessage: (0, import_i18n50.__)(
        "Hostinger Reach is installed. Just activate the plugin to start sending emails.",
        "jetpack-forms"
      ),
      trackEventName: "jetpack_forms_upsell_hostinger_reach_click"
    },
    toggleTooltip: (0, import_i18n50.__)("Grow your audience with Hostinger Reach", "jetpack-forms"),
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "integration-card__description", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components53.ExternalLink, { href: settingsUrl, children: (0, import_i18n50.__)(
        "Hostinger Reach is active. There is one step left. Please complete Hostinger Reach setup.",
        "jetpack-forms"
      ) }) }),
      /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_components53.__experimentalHStack, { spacing: "3", justify: "start", children: [
        /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
          import_components53.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n50.__)("Complete Hostinger Reach setup", "jetpack-forms")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components53.Button, { variant: "tertiary", onClick: refreshIntegrations2, __next40pxDefaultSize: true, children: (0, import_i18n50.__)("Refresh status", "jetpack-forms") })
      ] })
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
      context === "block-editor" && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("div", { className: "integration-card__section", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
        import_components53.TextControl,
        {
          label: (0, import_i18n50.__)("Group name (optional)", "jetpack-forms"),
          help: (0, import_i18n50.__)(
            'If empty, contacts will be added under "Jetpack Forms".',
            "jetpack-forms"
          ),
          value: groupName,
          onChange: (newName) => setAttributes?.({
            hostingerReach: {
              ...attributes?.hostingerReach ?? {},
              groupName: newName
            }
          }),
          __nextHasNoMarginBottom: true
        }
      ) }),
      context === "block-editor" && ConsentToggle && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(ConsentToggle, {}),
      settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime128.jsx)("p", { className: "integration-card__description", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_components53.ExternalLink, { href: settingsUrl, children: (0, import_i18n50.__)("View Hostinger Reach dashboard", "jetpack-forms") }) })
    ] })
  };
  return base;
}

// ../../../node_modules/.pnpm/@automattic+color-studio@4.1.0/node_modules/@automattic/color-studio/dist/colors.json
var colors_default = {
  version: "4.1.0",
  colors: {
    White: "#fff",
    Black: "#000",
    "Gray 0": "#f6f7f7",
    "Gray 5": "#dcdcde",
    "Gray 10": "#c3c4c7",
    "Gray 20": "#a7aaad",
    "Gray 30": "#8c8f94",
    "Gray 40": "#787c82",
    "Gray 50": "#646970",
    "Gray 60": "#50575e",
    "Gray 70": "#3c434a",
    "Gray 80": "#2c3338",
    "Gray 90": "#1d2327",
    "Gray 100": "#101517",
    Gray: "#646970",
    "Blue 0": "#fbfcfe",
    "Blue 5": "#f7f8fe",
    "Blue 10": "#d6ddf9",
    "Blue 20": "#adbaf3",
    "Blue 30": "#7b90ff",
    "Blue 40": "#546ff3",
    "Blue 50": "#3858e9",
    "Blue 60": "#2a46ce",
    "Blue 70": "#1d35b4",
    "Blue 80": "#1f3286",
    "Blue 90": "#14215a",
    "Blue 100": "#0a112d",
    Blue: "#3858e9",
    "WordPress Blue 0": "#fbfcfe",
    "WordPress Blue 5": "#f7f8fe",
    "WordPress Blue 10": "#d6ddf9",
    "WordPress Blue 20": "#adbaf3",
    "WordPress Blue 30": "#7b90ff",
    "WordPress Blue 40": "#546ff3",
    "WordPress Blue 50": "#3858e9",
    "WordPress Blue 60": "#2a46ce",
    "WordPress Blue 70": "#1d35b4",
    "WordPress Blue 80": "#1f3286",
    "WordPress Blue 90": "#14215a",
    "WordPress Blue 100": "#0a112d",
    "WordPress Blue": "#3858e9",
    "Purple 0": "#f2e9ed",
    "Purple 5": "#ebcee0",
    "Purple 10": "#e3afd5",
    "Purple 20": "#d48fc8",
    "Purple 30": "#c475bd",
    "Purple 40": "#b35eb1",
    "Purple 50": "#984a9c",
    "Purple 60": "#7c3982",
    "Purple 70": "#662c6e",
    "Purple 80": "#4d2054",
    "Purple 90": "#35163b",
    "Purple 100": "#1e0c21",
    Purple: "#984a9c",
    "Pink 0": "#f5e9ed",
    "Pink 5": "#f2ceda",
    "Pink 10": "#f7a8c3",
    "Pink 20": "#f283aa",
    "Pink 30": "#eb6594",
    "Pink 40": "#e34c84",
    "Pink 50": "#c9356e",
    "Pink 60": "#ab235a",
    "Pink 70": "#8c1749",
    "Pink 80": "#700f3b",
    "Pink 90": "#4f092a",
    "Pink 100": "#260415",
    Pink: "#c9356e",
    "Red 0": "#f7ebec",
    "Red 5": "#facfd2",
    "Red 10": "#ffabaf",
    "Red 20": "#ff8085",
    "Red 30": "#f86368",
    "Red 40": "#e65054",
    "Red 50": "#d63638",
    "Red 60": "#b32d2e",
    "Red 70": "#8a2424",
    "Red 80": "#691c1c",
    "Red 90": "#451313",
    "Red 100": "#240a0a",
    Red: "#d63638",
    "Orange 0": "#f5ece6",
    "Orange 5": "#f7dcc6",
    "Orange 10": "#ffbf86",
    "Orange 20": "#faa754",
    "Orange 30": "#e68b28",
    "Orange 40": "#d67709",
    "Orange 50": "#b26200",
    "Orange 60": "#8a4d00",
    "Orange 70": "#704000",
    "Orange 80": "#543100",
    "Orange 90": "#361f00",
    "Orange 100": "#1f1200",
    Orange: "#b26200",
    "Yellow 0": "#f5f1e1",
    "Yellow 5": "#f5e6b3",
    "Yellow 10": "#f2d76b",
    "Yellow 20": "#f0c930",
    "Yellow 30": "#deb100",
    "Yellow 40": "#c08c00",
    "Yellow 50": "#9d6e00",
    "Yellow 60": "#7d5600",
    "Yellow 70": "#674600",
    "Yellow 80": "#4f3500",
    "Yellow 90": "#320",
    "Yellow 100": "#1c1300",
    Yellow: "#9d6e00",
    "Green 0": "#e6f2e8",
    "Green 5": "#b8e6bf",
    "Green 10": "#68de86",
    "Green 20": "#1ed15a",
    "Green 30": "#00ba37",
    "Green 40": "#00a32a",
    "Green 50": "#008a20",
    "Green 60": "#007017",
    "Green 70": "#005c12",
    "Green 80": "#00450c",
    "Green 90": "#003008",
    "Green 100": "#001c05",
    Green: "#008a20",
    "Celadon 0": "#e4f2ed",
    "Celadon 5": "#a7e8d3",
    "Celadon 10": "#66deb9",
    "Celadon 20": "#31cc9f",
    "Celadon 30": "#09b585",
    "Celadon 40": "#009e73",
    "Celadon 50": "#008763",
    "Celadon 60": "#007053",
    "Celadon 70": "#005c44",
    "Celadon 80": "#004533",
    "Celadon 90": "#003024",
    "Celadon 100": "#001c15",
    Celadon: "#008763",
    "Automattic Blue 0": "#ebf4fa",
    "Automattic Blue 5": "#c4e2f5",
    "Automattic Blue 10": "#88ccf2",
    "Automattic Blue 20": "#5ab7e8",
    "Automattic Blue 30": "#24a3e0",
    "Automattic Blue 40": "#1490c7",
    "Automattic Blue 50": "#0277a8",
    "Automattic Blue 60": "#036085",
    "Automattic Blue 70": "#02506e",
    "Automattic Blue 80": "#02384d",
    "Automattic Blue 90": "#022836",
    "Automattic Blue 100": "#021b24",
    "Automattic Blue": "#24a3e0",
    "Simplenote Blue 0": "#e9ecf5",
    "Simplenote Blue 5": "#ced9f2",
    "Simplenote Blue 10": "#abc1f5",
    "Simplenote Blue 20": "#84a4f0",
    "Simplenote Blue 30": "#618df2",
    "Simplenote Blue 40": "#4678eb",
    "Simplenote Blue 50": "#3361cc",
    "Simplenote Blue 60": "#1d4fc4",
    "Simplenote Blue 70": "#113ead",
    "Simplenote Blue 80": "#0d2f85",
    "Simplenote Blue 90": "#09205c",
    "Simplenote Blue 100": "#05102e",
    "Simplenote Blue": "#3361cc",
    "WooCommerce Purple 0": "#f2edff",
    "WooCommerce Purple 5": "#e1d7ff",
    "WooCommerce Purple 10": "#d1c1ff",
    "WooCommerce Purple 20": "#b999ff",
    "WooCommerce Purple 30": "#a77eff",
    "WooCommerce Purple 40": "#873eff",
    "WooCommerce Purple 50": "#720eec",
    "WooCommerce Purple 60": "#6108ce",
    "WooCommerce Purple 70": "#5007aa",
    "WooCommerce Purple 80": "#3c087e",
    "WooCommerce Purple 90": "#2c045d",
    "WooCommerce Purple 100": "#1f0342",
    "WooCommerce Purple": "#720eec",
    "Jetpack Green 0": "#f0f2eb",
    "Jetpack Green 5": "#d0e6b8",
    "Jetpack Green 10": "#9dd977",
    "Jetpack Green 20": "#64ca43",
    "Jetpack Green 30": "#2fb41f",
    "Jetpack Green 40": "#069e08",
    "Jetpack Green 50": "#008710",
    "Jetpack Green 60": "#007117",
    "Jetpack Green 70": "#005b18",
    "Jetpack Green 80": "#004515",
    "Jetpack Green 90": "#003010",
    "Jetpack Green 100": "#001c09",
    "Jetpack Green": "#069e08"
  }
};

// ../../js-packages/components/build/components/jetpack-logo/index.js
var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1);
var import_i18n51 = __toESM(require_i18n(), 1);
var JetpackLogo = ({ logoColor = "#069e08", showText = true, className, height = 32, title, ...otherProps }) => {
  const viewBox = showText ? "0 0 118 32" : "0 0 32 32";
  const logoTitle = title ?? (0, import_i18n51.__)("Jetpack Logo", "jetpack-components");
  return (0, import_jsx_runtime129.jsxs)("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    x: "0px",
    y: "0px",
    viewBox,
    className: clsx_default("jetpack-logo", className),
    "aria-labelledby": "jetpack-logo-title",
    height,
    ...otherProps,
    // role="img" is required to prevent VoiceOver on Safari reading the content of the SVG
    role: "img",
    children: [(0, import_jsx_runtime129.jsx)("title", { id: "jetpack-logo-title", children: logoTitle }), (0, import_jsx_runtime129.jsx)("path", { fill: logoColor, d: "M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z" }), showText && (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [(0, import_jsx_runtime129.jsx)("path", { d: "M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z" }), (0, import_jsx_runtime129.jsx)("path", { d: "M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z" }), (0, import_jsx_runtime129.jsx)("path", { d: "M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z" }), (0, import_jsx_runtime129.jsx)("path", { d: "M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z" }), (0, import_jsx_runtime129.jsx)("path", { d: "M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z" }), (0, import_jsx_runtime129.jsx)("path", { d: "M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z" }), (0, import_jsx_runtime129.jsx)("path", { d: "M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z" })] })]
  });
};
var jetpack_logo_default = JetpackLogo;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/jetpack-crm.tsx
var import_components54 = __toESM(require_components(), 1);
var import_element67 = __toESM(require_element(), 1);
var import_i18n52 = __toESM(require_i18n(), 1);
var import_semver = __toESM(require_semver2(), 1);
var import_jsx_runtime130 = __toESM(require_jsx_runtime(), 1);
var COLOR_JETPACK = colors_default.colors["Jetpack Green 40"];
function buildJetpackCrmCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes
}) {
  const { settingsUrl = "", marketingUrl = "", version: version2 = "", details = {} } = integration || {};
  const { hasExtension = false, canActivateExtension = false } = details;
  const crmVersion = import_semver.default.coerce(version2);
  const isRecentVersion = crmVersion && import_semver.default.gte(crmVersion, "4.9.1");
  const connectedMsgEditor = (0, import_i18n52.__)("This form is connected to Jetpack CRM.", "jetpack-forms");
  const connectedMsgDashboard = (0, import_i18n52.__)("Jetpack CRM is connected.", "jetpack-forms");
  const renderBody = () => {
    if (!isRecentVersion) {
      return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "integration-card__description", children: (0, import_i18n52.__)(
          "Please update to the latest version of the Jetpack CRM plugin to integrate your contact form with your CRM.",
          "jetpack-forms"
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
          import_components54.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n52.__)("Update Jetpack CRM", "jetpack-forms")
          }
        )
      ] });
    }
    if (!hasExtension) {
      return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "integration-card__description", children: (0, import_element67.createInterpolateElement)(
          (0, import_i18n52.__)(
            "You can integrate this contact form with Jetpack CRM by enabling Jetpack CRM's <a>Jetpack Forms extension</a>.",
            "jetpack-forms"
          ),
          {
            a: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
              import_components54.Button,
              {
                variant: "link",
                href: settingsUrl,
                target: "_blank",
                rel: "noopener noreferrer"
              }
            )
          }
        ) }),
        !canActivateExtension && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { children: (0, import_i18n52.__)(
          "A site administrator must enable the CRM Jetpack Forms extension.",
          "jetpack-forms"
        ) }),
        canActivateExtension && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
          import_components54.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n52.__)("Enable Jetpack Forms extension", "jetpack-forms")
          }
        )
      ] });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("p", { className: "integration-card__description", children: context === "block-editor" ? connectedMsgEditor : connectedMsgDashboard }),
      settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components54.ExternalLink, { href: settingsUrl, children: (0, import_i18n52.__)("Open Jetpack CRM settings", "jetpack-forms") })
    ] });
  };
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(jetpack_logo_default, { showText: false, logoColor: COLOR_JETPACK }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: !!attributes?.jetpackCRM,
        isHeaderToggleEnabled: true,
        onHeaderToggleChange: (value) => {
          setAttributes?.({ jetpackCRM: value });
        }
      },
      trackEventName: "jetpack_forms_upsell_crm_click",
      notInstalledMessage: (0, import_element67.createInterpolateElement)(
        (0, import_i18n52.__)(
          "You can save your form contacts in <a>Jetpack CRM</a>. To get started, please install the plugin.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components54.ExternalLink, { href: marketingUrl, children: null }) }
      ),
      notActivatedMessage: (0, import_i18n52.__)(
        "Jetpack CRM is installed. To start saving contacts, simply activate the plugin.",
        "jetpack-forms"
      )
    },
    body: renderBody()
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/mailpoet.tsx
var import_components55 = __toESM(require_components(), 1);
var import_element68 = __toESM(require_element(), 1);
var import_i18n54 = __toESM(require_i18n(), 1);

// src/icons/mailpoet.tsx
var import_i18n53 = __toESM(require_i18n(), 1);
var import_primitives42 = __toESM(require_primitives(), 1);
var import_jsx_runtime131 = __toESM(require_jsx_runtime(), 1);
var MailPoetIcon = (props) => {
  return /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(
    import_primitives42.SVG,
    {
      width: props.width || 32,
      height: props.height || 32,
      viewBox: "0 0 152.02 156.4",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      role: "img",
      "aria-label": (0, import_i18n53.__)("MailPoet icon", "jetpack-forms"),
      ...props,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
          import_primitives42.Path,
          {
            d: "M37.71,89.1c3.5,0,5.9-.8,7.2-2.3a8,8,0,0,0,2-5.4V35.7l17,45.1a12.68,12.68,0,0,0,3.7,5.4c1.6,1.3,4,2,7.2,2a12.54,12.54,0,0,0,5.9-1.4,8.41,8.41,0,0,0,3.9-5l18.1-50V81a8.53,8.53,0,0,0,2.1,6.1c1.4,1.4,3.7,2.2,6.9,2.2,3.5,0,5.9-.8,7.2-2.3a8,8,0,0,0,2-5.4V8.7a7.48,7.48,0,0,0-3.3-6.6c-2.1-1.4-5-2.1-8.6-2.1a19.3,19.3,0,0,0-9.4,2,11.63,11.63,0,0,0-5.1,6.8L74.91,67.1,54.41,8.4a12.4,12.4,0,0,0-4.5-6.2c-2.1-1.5-5-2.2-8.8-2.2a16.51,16.51,0,0,0-8.9,2.1c-2.3,1.5-3.5,3.9-3.5,7.2V80.8c0,2.8.7,4.8,2,6.2C32.21,88.4,34.41,89.1,37.71,89.1Z",
            fill: "#FF5301"
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
          import_primitives42.Path,
          {
            d: "M149,116.6l-2.4-1.9a7.4,7.4,0,0,0-9.4.3,19.65,19.65,0,0,1-12.5,4.6h-21.4A37.08,37.08,0,0,0,77,130.5l-1.1,1.2-1.1-1.1a37.25,37.25,0,0,0-26.3-10.9H27a19.59,19.59,0,0,1-12.4-4.6,7.28,7.28,0,0,0-9.4-.3l-2.4,1.9A7.43,7.43,0,0,0,0,122.2a7.14,7.14,0,0,0,2.4,5.7A37.28,37.28,0,0,0,27,137.4h21.6a19.59,19.59,0,0,1,18.9,14.4v.2c.1.7,1.2,4.4,8.5,4.4s8.4-3.7,8.5-4.4v-.2a19.59,19.59,0,0,1,18.9-14.4H125a37.28,37.28,0,0,0,24.6-9.5,7.42,7.42,0,0,0,2.4-5.7A7.86,7.86,0,0,0,149,116.6Z",
            fill: "#FF5301"
          }
        )
      ]
    }
  );
};
var mailpoet_default = MailPoetIcon;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/mailpoet.tsx
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
function buildMailPoetCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes,
  components
}) {
  const ConsentToggle = components?.ConsentToggle;
  const {
    isConnected = false,
    settingsUrl = "",
    marketingUrl = ""
  } = integration || {};
  const lists = Array.isArray(integration.details?.lists) ? integration.details?.lists : [];
  const enabledForForm = !!attributes?.mailpoet?.enabledForForm;
  const selectedListId = attributes?.mailpoet?.listId ?? "";
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(mailpoet_default, { width: 28, height: 28 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: enabledForForm,
        isHeaderToggleEnabled: isConnected,
        onHeaderToggleChange: (value) => setAttributes?.({
          mailpoet: {
            ...attributes?.mailpoet ?? {},
            enabledForForm: value
          }
        })
      },
      notInstalledMessage: (0, import_element68.createInterpolateElement)(
        (0, import_i18n54.__)(
          "Add powerful email marketing to your forms with <a>MailPoet</a>. Simply install the plugin to start sending emails.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components55.ExternalLink, { href: marketingUrl, children: null }) }
      ),
      notActivatedMessage: (0, import_i18n54.__)(
        "MailPoet is installed. Just activate the plugin to start sending emails.",
        "jetpack-forms"
      ),
      trackEventName: "jetpack_forms_upsell_mailpoet_click"
    },
    toggleTooltip: (0, import_i18n54.__)("Grow your audience with MailPoet", "jetpack-forms"),
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "integration-card__description", children: (0, import_element68.createInterpolateElement)(
        (0, import_i18n54.__)(
          "MailPoet is active. There is one step left. Please complete <a>MailPoet setup</a>.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components55.ExternalLink, { href: settingsUrl, children: null }) }
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_components55.__experimentalHStack, { spacing: "3", justify: "start", children: [
        /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
          import_components55.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n54.__)("Complete MailPoet setup", "jetpack-forms")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components55.Button, { variant: "tertiary", onClick: refreshIntegrations2, __next40pxDefaultSize: true, children: (0, import_i18n54.__)("Refresh status", "jetpack-forms") })
      ] })
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)("div", { children: [
      context === "block-editor" && (lists.length ? /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(
        import_components55.SelectControl,
        {
          label: (0, import_i18n54.__)("Which email list should contacts be added to?", "jetpack-forms"),
          value: selectedListId,
          options: lists.map((list) => ({ label: list.name, value: list.id })),
          onChange: (newId) => setAttributes?.({
            mailpoet: {
              ...attributes?.mailpoet ?? {},
              listId: newId
            }
          }),
          __next40pxDefaultSize: true,
          __nextHasNoMarginBottom: true
        }
      ) : /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "integration-card__description", children: (0, import_i18n54.__)(
        'You do not have any MailPoet lists yet. Click the dashboard button below to create one, or contacts will be added to a "Jetpack Forms Subscribers" list.',
        "jetpack-forms"
      ) })),
      context === "block-editor" && ConsentToggle && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(ConsentToggle, {}),
      settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "integration-card__description", children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components55.ExternalLink, { href: settingsUrl, children: (0, import_i18n54.__)("View dashboard", "jetpack-forms") }) })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/salesforce.tsx
var import_components57 = __toESM(require_components(), 1);
var import_i18n57 = __toESM(require_i18n(), 1);

// src/icons/salesforce.tsx
var import_primitives43 = __toESM(require_primitives(), 1);
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
var SalesforceIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(
  import_primitives43.SVG,
  {
    width: props.width || 46,
    height: props.height || 32,
    viewBox: "0 0 46 32",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    role: "img",
    ...props,
    children: [
      /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
        import_primitives43.Path,
        {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M19.0191 3.48472C20.4938 1.94961 22.5462 0.998992 24.8136 0.998992C27.8367 0.998992 30.4568 2.67854 31.8677 5.18105C33.12 4.62122 34.4764 4.33219 35.8482 4.33289C41.2899 4.33289 45.7071 8.78367 45.7071 14.2758C45.7071 19.7679 41.2899 24.2187 35.8482 24.2187C35.1831 24.2187 34.5348 24.1518 33.8999 24.0255C32.6654 26.2257 30.3057 27.7205 27.6184 27.7205C26.5243 27.7227 25.4443 27.4745 24.4609 26.995C23.2096 29.9342 20.2956 32 16.9029 32C13.3591 32 10.3527 29.7662 9.19382 26.6255C8.67803 26.7343 8.15228 26.789 7.62513 26.7887C3.40947 26.7887 0 23.3289 0 19.0796C0 16.2244 1.5351 13.7387 3.81256 12.395C3.3294 11.282 3.0807 10.0814 3.08196 8.86799C3.08196 3.96372 7.06248 0 11.9667 0C14.8388 0 17.4085 1.36883 19.0208 3.49345",
          fill: "#00A1E0"
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
        import_primitives43.Path,
        {
          d: "M26.6607 11.1632C26.7813 11.1619 26.9021 11.1717 27.021 11.1915C27.1093 11.2069 27.1969 11.2271 27.2827 11.253C27.3016 11.2605 27.3524 11.2861 27.3316 11.3458L27.1284 11.9015C27.1115 11.9433 27.1003 11.9687 27.0142 11.9425C26.9927 11.9361 26.9605 11.9268 26.8784 11.9093C26.8188 11.8969 26.7404 11.8878 26.6607 11.8878C26.5644 11.8865 26.4685 11.9004 26.3765 11.9288C26.2927 11.9563 26.2165 12.0035 26.1548 12.0665C26.0886 12.1329 26.0098 12.23 25.9683 12.3497C25.8711 12.6301 25.8328 12.9282 25.8286 12.9474H26.6753C26.7462 12.947 26.7691 12.9796 26.7622 13.0323L26.6636 13.5831C26.6487 13.661 26.5781 13.6603 26.5747 13.6603H25.7017L25.105 17.0382C25.0424 17.3871 24.9644 17.6866 24.8726 17.9278C24.7797 18.1714 24.6822 18.3501 24.5279 18.5206C24.3852 18.6786 24.2239 18.7954 24.0386 18.8624C23.8544 18.9289 23.632 18.963 23.3882 18.963C23.2718 18.963 23.147 18.9607 22.9995 18.9259C22.8938 18.901 22.8359 18.8833 22.7583 18.8556C22.7251 18.8437 22.6987 18.8024 22.7173 18.7501C22.7358 18.697 22.8916 18.2673 22.9136 18.2111C22.9407 18.1424 23.0093 18.1691 23.0093 18.1691C23.0563 18.1888 23.0892 18.2026 23.1519 18.215C23.2149 18.2276 23.3006 18.2384 23.3648 18.2384C23.4799 18.2384 23.585 18.2242 23.6763 18.1935C23.7869 18.1564 23.8508 18.0924 23.9185 18.006C23.9884 17.9166 24.0459 17.7933 24.104 17.629C24.1629 17.4627 24.2158 17.2433 24.2622 16.9767L24.856 13.6603H24.271C24.2006 13.6606 24.1783 13.6279 24.1851 13.5753L24.2837 13.0245C24.2992 12.9444 24.3726 12.9474 24.3726 12.9474H24.9742L25.0064 12.7677C25.0962 12.2358 25.2753 11.8309 25.5386 11.5655C25.8038 11.2983 26.1817 11.1632 26.6607 11.1632ZM8.31985 12.8527C8.82364 12.8527 9.31095 12.999 9.6636 13.214C9.69558 13.2332 9.72627 13.2704 9.70853 13.3195C9.69138 13.3674 9.53518 13.7854 9.51712 13.8331C9.48403 13.921 9.3931 13.8624 9.3931 13.8624C9.0858 13.6927 8.60568 13.5588 8.20267 13.5587C7.83989 13.5587 7.60403 13.7518 7.60403 14.0138V14.0294C7.6043 14.3349 8.00614 14.4665 8.47122 14.6173L8.5513 14.6427C9.16597 14.8358 9.82465 15.1065 9.82474 15.8487V15.8644C9.82474 16.6672 9.24141 17.1661 8.30423 17.1661C7.84427 17.1661 7.4047 17.0935 6.93802 16.8468C6.85071 16.7963 6.76308 16.7517 6.67728 16.6896C6.66805 16.6763 6.62924 16.6607 6.65774 16.5861L6.65677 16.5841L6.84134 16.0704C6.87056 15.9824 6.93849 16.0121 6.96536 16.0284C7.01606 16.0594 7.05384 16.0868 7.11966 16.1251C7.66551 16.4701 8.16962 16.4728 8.32767 16.4728C8.73377 16.4726 8.98676 16.2563 8.98685 15.9659V15.9503C8.98685 15.6346 8.59712 15.5135 8.147 15.3751L8.04837 15.3448C7.4303 15.1685 6.7681 14.9127 6.7681 14.13V14.1144C6.76812 13.372 7.36788 12.8527 8.2261 12.8527H8.31985ZM22.0396 12.8517C22.5433 12.8517 23.0307 12.9972 23.3833 13.212C23.4151 13.2311 23.4468 13.2686 23.4292 13.3175C23.4141 13.3645 23.2566 13.7846 23.2388 13.8321C23.2064 13.917 23.1199 13.8646 23.1148 13.8614C22.8058 13.6917 22.3274 13.5568 21.9243 13.5568C21.5617 13.5568 21.3259 13.75 21.3257 14.0118V14.0275C21.3257 14.3331 21.7277 14.4645 22.1929 14.6153L22.273 14.6417C22.8894 14.8349 23.5464 15.1054 23.5464 15.8478V15.8634C23.5464 16.6662 22.9631 17.1652 22.0259 17.1652C21.5658 17.1651 21.1255 17.0927 20.6587 16.8458C20.5716 16.7954 20.4842 16.7505 20.399 16.6886C20.3894 16.6753 20.3497 16.659 20.3784 16.5841L20.3765 16.5831L20.562 16.0695C20.5891 15.9855 20.6681 16.0157 20.6851 16.0265C20.7351 16.0587 20.7734 16.0857 20.8394 16.1241C21.3836 16.4691 21.889 16.4718 22.0474 16.4718C22.4536 16.4717 22.7075 16.2545 22.7075 15.964V15.9484C22.7073 15.6329 22.3192 15.5125 21.8677 15.3741L21.7681 15.3429C21.1501 15.1665 20.4878 14.9116 20.4878 14.129V14.1134C20.4878 13.3711 21.0877 12.8518 21.9458 12.8517H22.0396ZM28.7339 12.8663C29.0529 12.8663 29.3353 12.9227 29.5738 13.0343C29.8139 13.1451 30.0156 13.2999 30.1753 13.4913C30.3348 13.6827 30.4547 13.9108 30.5318 14.171H30.5298C30.6061 14.4297 30.645 14.7139 30.645 15.0128C30.645 15.3132 30.606 15.5952 30.5298 15.8536C30.4526 16.114 30.3328 16.3428 30.1734 16.5343C30.0139 16.7256 29.811 16.8786 29.5728 16.9874C29.3343 17.0963 29.0514 17.1525 28.7339 17.1525C28.4166 17.1524 28.1341 17.0962 27.8941 16.9874C27.6558 16.8783 27.4531 16.7256 27.2935 16.5343C27.1339 16.3428 27.0138 16.114 26.937 15.8536C26.8607 15.5952 26.8218 15.3132 26.8218 15.0128C26.8218 14.7122 26.8606 14.4297 26.937 14.171C27.0143 13.9108 27.1343 13.6827 27.2935 13.4913C27.4529 13.3 27.6558 13.1458 27.8941 13.0343C28.1341 12.923 28.415 12.8664 28.7339 12.8663ZM18.1538 12.8634C18.4146 12.8629 18.6726 12.9157 18.9126 13.0177C19.0789 13.0882 19.2452 13.2175 19.4165 13.4005C19.524 13.5163 19.6898 13.7695 19.7564 14.0196L19.7583 14.0206C19.9284 14.6168 19.8403 15.133 19.8374 15.1612C19.8302 15.2277 19.7632 15.2295 19.7603 15.2296L17.107 15.2277C17.1221 15.6306 17.2189 15.9147 17.4136 16.1095C17.6051 16.2998 17.911 16.4213 18.3208 16.422C18.9501 16.4237 19.219 16.2966 19.4087 16.2257C19.4087 16.2257 19.4826 16.1992 19.5093 16.2716L19.6822 16.757C19.7169 16.8387 19.6889 16.8674 19.6597 16.8839C19.495 16.9763 19.0914 17.146 18.3257 17.1486C17.9531 17.1497 17.6307 17.0965 17.3638 16.9933C17.0951 16.8892 16.8715 16.7416 16.6968 16.5519C16.5238 16.3638 16.3943 16.1367 16.314 15.878C16.2339 15.6211 16.1939 15.337 16.1939 15.0314C16.1939 14.7325 16.233 14.4469 16.3101 14.1866C16.3874 13.9231 16.5088 13.6929 16.6695 13.4982C16.8306 13.3035 17.0354 13.1478 17.2788 13.0333C17.5224 12.9196 17.823 12.8634 18.1538 12.8634ZM39.3667 12.8634C39.6275 12.863 39.8855 12.9156 40.1255 13.0177C40.2918 13.0882 40.4581 13.2174 40.6294 13.4005C40.7369 13.5164 40.9026 13.7695 40.9693 14.0196L40.9722 14.0206C41.1421 14.6168 41.0542 15.133 41.0513 15.1612C41.0439 15.2291 40.9742 15.2296 40.9742 15.2296L38.3208 15.2277C38.3359 15.6307 38.4336 15.9147 38.6284 16.1095C38.8199 16.2996 39.1235 16.4213 39.5347 16.422C40.1645 16.4237 40.4338 16.2966 40.6236 16.2257C40.6273 16.2244 40.6973 16.2011 40.7232 16.2716L40.896 16.757C40.9306 16.8387 40.903 16.8674 40.8736 16.8839C40.7089 16.9763 40.3053 17.146 39.5396 17.1486C39.1686 17.1497 38.8446 17.0965 38.5777 16.9933C38.309 16.8892 38.0853 16.7416 37.9107 16.5519C37.736 16.3638 37.6064 16.1367 37.5259 15.878C37.4463 15.6211 37.4058 15.337 37.4058 15.0314C37.4058 14.7325 37.4448 14.4469 37.522 14.1866C37.5992 13.9231 37.7204 13.6929 37.8814 13.4982C38.0426 13.3033 38.2482 13.1479 38.4917 13.0333C38.7352 12.9196 39.0359 12.8634 39.3667 12.8634ZM35.9605 12.8556C36.1821 12.8556 36.3788 12.8688 36.5484 12.8946C36.7297 12.922 36.9694 12.9869 37.0708 13.0265C37.0896 13.0338 37.1401 13.0591 37.1197 13.1183C37.046 13.3265 36.995 13.4628 36.9263 13.6525C36.8972 13.7323 36.8368 13.7077 36.8355 13.7071C36.5768 13.6262 36.3298 13.588 36.0074 13.588C35.6212 13.5881 35.3289 13.7199 35.1392 13.9718C34.947 14.227 34.8396 14.5598 34.8384 15.003C34.8368 15.4898 34.9578 15.8491 35.1743 16.0724C35.3893 16.2956 35.692 16.4083 36.0699 16.4083C36.2225 16.4083 36.3674 16.3985 36.4976 16.378C36.6269 16.3579 36.7491 16.3171 36.8628 16.2736C36.8683 16.2716 36.9377 16.2483 36.9624 16.3214H36.9634L37.1558 16.8517C37.1792 16.9146 37.1291 16.9421 37.1245 16.9445C36.829 17.0615 36.4175 17.1426 36.0161 17.1427C35.3376 17.1427 34.8162 16.9479 34.4702 16.5616C34.1244 16.1771 33.9497 15.6512 33.9497 15.003C33.9498 14.7025 33.9929 14.4188 34.0777 14.1603C34.1633 13.8999 34.2906 13.6711 34.4585 13.4796C34.6265 13.2882 34.8382 13.1339 35.0884 13.0226C35.3387 12.9111 35.6313 12.8556 35.9605 12.8556ZM12.0904 12.8575C12.6194 12.8575 13.0284 12.9802 13.3072 13.2237C13.5867 13.4673 13.7281 13.8622 13.7281 14.3927L13.73 16.8107C13.73 16.8107 13.7348 16.8809 13.6695 16.8976C13.6695 16.8976 13.5713 16.9241 13.4829 16.9445C13.2616 16.9924 13.0391 17.0358 12.8159 17.0743C12.554 17.1185 12.2833 17.1417 12.0113 17.1417C11.7528 17.1417 11.5173 17.117 11.3091 17.0695C11.0994 17.0224 10.9172 16.9431 10.77 16.8361C10.6222 16.7288 10.5033 16.5858 10.4243 16.421C10.3439 16.2548 10.3033 16.0515 10.3033 15.8165C10.3033 15.5849 10.351 15.3798 10.4449 15.2052C10.5379 15.0322 10.6697 14.8828 10.8296 14.7687C10.9891 14.6539 11.1759 14.5676 11.3824 14.5118C11.5872 14.4565 11.8071 14.4278 12.0337 14.4278C12.1999 14.4279 12.3393 14.4317 12.4468 14.4396L12.4497 14.4464C12.4606 14.4474 12.6656 14.4661 12.8863 14.4982V14.3859C12.8862 14.0333 12.8121 13.865 12.6675 13.754C12.5197 13.6408 12.2976 13.5831 12.0122 13.5831C11.9944 13.5829 11.3606 13.5786 10.8589 13.8517C10.8354 13.8656 10.815 13.8741 10.815 13.8741C10.8096 13.8759 10.7504 13.8932 10.7281 13.8312L10.5406 13.3273C10.5128 13.2562 10.5613 13.2235 10.564 13.2218C10.8025 13.035 11.3804 12.923 11.3804 12.923C11.5718 12.8845 11.8922 12.8576 12.0904 12.8575ZM15.3706 11.2491C15.4146 11.2494 15.4456 11.2844 15.4458 11.3282V16.9835C15.4457 17.0276 15.4147 17.0634 15.3706 17.0636H14.6675C14.6231 17.0635 14.5914 17.0277 14.5913 16.9835V11.3282C14.5915 11.2843 14.6232 11.2492 14.6675 11.2491H15.3706ZM33.2935 12.9034C33.4659 12.9142 33.6907 12.9614 33.7368 12.9786C33.7458 12.9821 33.7544 12.9876 33.7613 12.9943C33.7682 13.001 33.7732 13.0098 33.7769 13.0187C33.7805 13.0274 33.7827 13.0366 33.7827 13.046L33.7788 13.0636C33.7537 13.1358 33.6242 13.498 33.5786 13.6193C33.5613 13.6653 33.533 13.6963 33.482 13.6905C33.4759 13.6891 33.3275 13.6555 33.1919 13.6554C33.0715 13.6554 32.9512 13.672 32.8355 13.7052C32.7123 13.7434 32.6001 13.8109 32.5083 13.9015C32.4122 13.9955 32.3333 14.1269 32.2759 14.2911C32.2176 14.4574 32.189 14.7221 32.189 14.9874V16.9689C32.189 16.99 32.1804 17.0105 32.1656 17.0255C32.1505 17.0406 32.1292 17.0489 32.1079 17.0489H31.4126C31.3914 17.0488 31.371 17.0405 31.356 17.0255C31.341 17.0105 31.3326 16.9901 31.3325 16.9689V13.0216C31.3327 12.9774 31.3648 12.9415 31.4087 12.9415H32.0874C32.1318 12.9417 32.1625 12.9775 32.1626 13.0216L32.1636 13.3448C32.2643 13.2072 32.4457 13.0879 32.6099 13.0138C32.7761 12.9392 32.9611 12.8827 33.2935 12.9034ZM12.1656 15.0987C11.6392 15.0923 11.4073 15.2806 11.397 15.2902C11.2374 15.4027 11.1597 15.5711 11.1597 15.8028C11.1597 15.9503 11.1864 16.0655 11.2388 16.1466C11.2732 16.2005 11.2883 16.2209 11.3921 16.3038L11.3931 16.3048C11.3928 16.3054 11.6319 16.4924 12.1695 16.4601C12.549 16.4372 12.8853 16.3644 12.8853 16.3644H12.8843V15.1603C12.6464 15.1238 12.4062 15.1031 12.1656 15.0987ZM28.7359 13.5851C28.3866 13.5851 28.1396 13.7047 27.9771 13.9532C27.8136 14.2035 27.73 14.5594 27.73 15.0128C27.73 15.4662 27.813 15.8254 27.9771 16.0773C28.14 16.3268 28.3883 16.4483 28.7359 16.4484C29.0835 16.4484 29.3333 16.3256 29.4986 16.0753C29.6433 15.8535 29.7262 15.5522 29.7447 15.1769L29.7486 15.0128C29.7486 14.5595 29.665 14.2035 29.4986 13.9532C29.334 13.7058 29.0852 13.5851 28.7359 13.5851ZM39.3042 13.5646C38.9566 13.5646 38.7088 13.7008 38.5464 13.9493C38.438 14.1122 38.369 14.3225 38.3316 14.5743H40.2212C40.2034 14.3308 40.1556 14.1131 40.0464 13.9493C39.8818 13.7016 39.6518 13.5646 39.3042 13.5646ZM18.0913 13.5646C17.744 13.5647 17.497 13.701 17.3345 13.9493C17.2262 14.1122 17.1571 14.3224 17.1197 14.5743H19.0083C18.9904 14.3308 18.9435 14.1131 18.8345 13.9493C18.6699 13.7014 18.439 13.5646 18.0913 13.5646Z",
          fill: "#FFFFFE"
        }
      )
    ]
  }
);
var salesforce_default = SalesforceIcon;

// src/blocks/contact-form/components/help-message/index.jsx
var import_notice_outline = __toESM(require_notice_outline(), 1);

// src/blocks/contact-form/components/help-message/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='de1dced445']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "de1dced445");
  style.appendChild(document.createTextNode(".help-message{display:flex;font-size:13px;line-height:1.4;margin-bottom:1em;margin-top:-.5em}.help-message svg{margin-right:5px;min-width:24px}.help-message>span{margin-top:2px}.help-message.help-message-is-error{color:var(--color-error)}.help-message.help-message-is-error svg{fill:var(--color-error)}"));
  document.head.appendChild(style);
}

// src/blocks/contact-form/components/help-message/index.jsx
var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1);
var GridiconNoticeOutline = import_notice_outline.default.default || import_notice_outline.default;
var help_message_default = ({ children = null, isError = false, ...props }) => {
  const classes = clsx_default("help-message", {
    "help-message-is-error": isError
  });
  return children && /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: classes, ...props, children: [
    isError && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(GridiconNoticeOutline, { size: "24", "aria-hidden": "true", role: "img", focusable: "false" }),
    /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { children })
  ] });
};

// src/blocks/contact-form/components/jetpack-integrations-modal/components/create-salesforce-lead-form-button.tsx
var import_components56 = __toESM(require_components(), 1);
var import_i18n56 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-create-form.ts
var import_element69 = __toESM(require_element(), 1);

// src/hooks/use-config-value.ts
var import_data7 = __toESM(require_data(), 1);

// src/store/config/index.ts
var import_data6 = __toESM(require_data(), 1);

// src/store/config/actions.ts
var actions_exports = {};
__export(actions_exports, {
  invalidateConfig: () => invalidateConfig,
  receiveConfig: () => receiveConfig,
  receiveConfigValue: () => receiveConfigValue,
  refreshConfig: () => refreshConfig,
  setConfigError: () => setConfigError,
  setConfigLoading: () => setConfigLoading
});

// src/store/config/action-types.ts
var RECEIVE_CONFIG = "RECEIVE_CONFIG";
var RECEIVE_CONFIG_VALUE = "RECEIVE_CONFIG_VALUE";
var INVALIDATE_CONFIG = "INVALIDATE_CONFIG";
var SET_CONFIG_LOADING = "SET_CONFIG_LOADING";
var SET_CONFIG_ERROR = "SET_CONFIG_ERROR";

// src/store/config/resolvers.ts
var resolvers_exports = {};
__export(resolvers_exports, {
  getConfig: () => getConfig
});
var import_api_fetch2 = __toESM(require_api_fetch(), 1);

// src/store/constants.ts
var import_i18n55 = __toESM(require_i18n(), 1);
var UNKNOWN_ERROR_MESSAGE = (0, import_i18n55.__)("Unknown error", "jetpack-forms");

// src/store/config/resolvers.ts
var fetchConfigData = async (dispatch4) => {
  dispatch4(setConfigLoading(true));
  try {
    const result2 = await (0, import_api_fetch2.default)({
      path: "/wp/v2/feedback/config"
    });
    dispatch4(receiveConfig(result2));
  } catch (e2) {
    const message2 = e2 instanceof Error ? e2.message : UNKNOWN_ERROR_MESSAGE;
    dispatch4(setConfigError(message2));
  } finally {
    dispatch4(setConfigLoading(false));
  }
};
function getConfig() {
  return async ({ dispatch: dispatch4 }) => {
    await fetchConfigData(dispatch4);
  };
}
getConfig.isFulfilled = (state) => {
  return state.config !== null || state.isLoading;
};
getConfig.shouldInvalidate = (action) => {
  return action.type === INVALIDATE_CONFIG;
};

// src/store/config/actions.ts
var receiveConfig = (config) => ({
  type: RECEIVE_CONFIG,
  config
});
var receiveConfigValue = (key, value) => ({
  type: RECEIVE_CONFIG_VALUE,
  key,
  value
});
var invalidateConfig = () => ({
  type: INVALIDATE_CONFIG
});
var setConfigLoading = (isLoading) => ({
  type: SET_CONFIG_LOADING,
  isLoading
});
var setConfigError = (error2) => ({
  type: SET_CONFIG_ERROR,
  error: error2
});
var refreshConfig = () => getConfig();

// src/store/config/reducer.ts
var DEFAULT_STATE = {
  config: null,
  isLoading: false,
  error: null
};
function reducer(state = DEFAULT_STATE, action) {
  switch (action.type) {
    case SET_CONFIG_LOADING:
      return {
        ...state,
        isLoading: !!action.isLoading,
        error: action.isLoading ? null : state.error
      };
    case SET_CONFIG_ERROR:
      return {
        ...state,
        isLoading: false,
        error: action.error ?? UNKNOWN_ERROR_MESSAGE
      };
    case RECEIVE_CONFIG:
      return {
        ...state,
        config: action.config ?? null,
        isLoading: false,
        error: null
      };
    case RECEIVE_CONFIG_VALUE:
      return {
        ...state,
        config: {
          ...state.config ?? {},
          [action.key]: action.value
        }
      };
    case INVALIDATE_CONFIG:
      return {
        ...state,
        config: null,
        isLoading: false
      };
    default:
      return state;
  }
}

// src/store/config/selectors.ts
var selectors_exports = {};
__export(selectors_exports, {
  getConfig: () => getConfig2,
  getConfigError: () => getConfigError,
  getConfigValue: () => getConfigValue,
  isConfigLoading: () => isConfigLoading
});
var getConfig2 = (state) => state.config;
var getConfigValue = (state, key) => state.config?.[key];
var isConfigLoading = (state) => state.isLoading;
var getConfigError = (state) => state.error;

// src/store/config/index.ts
var CONFIG_STORE = "jetpack/forms/config";
var store = (0, import_data6.createReduxStore)(CONFIG_STORE, {
  reducer,
  actions: actions_exports,
  selectors: selectors_exports,
  resolvers: resolvers_exports
});
(0, import_data6.register)(store);

// src/hooks/use-config-value.ts
function useConfigValue(key) {
  return (0, import_data7.useSelect)(
    (select3) => {
      const configSelect = select3(CONFIG_STORE);
      const config = configSelect.getConfig();
      return config?.[key];
    },
    [key]
  );
}

// src/dashboard/hooks/use-create-form.ts
var openFormLink = (url) => {
  const link = document.createElement("a");
  link.setAttribute("href", url);
  link.style.display = "none";
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
};
function useCreateForm() {
  const newFormNonce = useConfigValue("newFormNonce");
  const isCentralFormManagementEnabled = useConfigValue("isCentralFormManagementEnabled");
  const adminUrl = useConfigValue("adminUrl");
  const ajaxUrl = useConfigValue("ajaxUrl");
  const createForm = (0, import_element69.useCallback)(
    async (formPattern) => {
      const data = new FormData();
      data.append("action", "create_new_form");
      data.append("newFormNonce", newFormNonce);
      if (formPattern) {
        data.append("pattern", formPattern);
      }
      const fetchUrl = ajaxUrl || window.ajaxurl;
      const response = await fetch(fetchUrl, { method: "POST", body: data });
      const {
        success,
        post_url: postUrl,
        data: message2
      } = await response.json();
      if (success === false) {
        throw new Error(message2);
      }
      return postUrl;
    },
    [newFormNonce, ajaxUrl]
  );
  const openNewForm = (0, import_element69.useCallback)(
    async ({ formPattern, showPatterns, analyticsEvent }) => {
      try {
        if (isCentralFormManagementEnabled === true) {
          analyticsEvent?.({ formPattern: formPattern ?? "" });
          const url = `${adminUrl || ""}post-new.php?post_type=jetpack_form`;
          openFormLink(url);
          return;
        }
        const postUrl = await createForm(formPattern);
        if (postUrl) {
          analyticsEvent?.({ formPattern });
          const url = `${postUrl}${showPatterns && !formPattern ? "&showJetpackFormsPatterns" : ""}`;
          openFormLink(url);
        }
      } catch (error2) {
        console.error(error2.message);
      }
    },
    [createForm, isCentralFormManagementEnabled, adminUrl]
  );
  return { createForm, openNewForm };
}

// src/blocks/contact-form/components/jetpack-integrations-modal/components/create-salesforce-lead-form-button.tsx
var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1);
function CreateSalesforceLeadFormButton({ className }) {
  const { openNewForm } = useCreateForm();
  const handleClick = () => {
    openNewForm({
      formPattern: "salesforce-lead-form",
      analyticsEvent: () => {
        if (window.jetpackAnalytics?.tracks) {
          window.jetpackAnalytics.tracks.recordEvent("jetpack_forms_salesforce_lead_form_click");
        }
      }
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_components56.Button, { variant: "primary", onClick: handleClick, className, children: (0, import_i18n56.__)("Create Salesforce lead form", "jetpack-forms") });
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/salesforce.tsx
var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1);
var isValidSalesforceOrgId = (id) => typeof id === "string" && /^[a-zA-Z0-9]{15,18}$/.test(id.trim());
function buildSalesforceCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes
}) {
  const organizationId = attributes?.salesforceData?.organizationId ?? "";
  const sendToSalesforce = !!attributes?.salesforceData?.sendToSalesforce;
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(salesforce_default, { width: 32, height: 32 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: sendToSalesforce,
        isHeaderToggleEnabled: isValidSalesforceOrgId(organizationId),
        onHeaderToggleChange: (value) => setAttributes?.({
          salesforceData: {
            ...attributes?.salesforceData ?? {},
            sendToSalesforce: value
          }
        }),
        toggleDisabledTooltip: !isValidSalesforceOrgId(organizationId) ? (0, import_i18n57.__)("Enter a Salesforce Organization ID to enable.", "jetpack-forms") : void 0,
        isConnected: isValidSalesforceOrgId(organizationId)
      },
      setupBadge: context === "dashboard" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Badge3, { intent: "stable", className: "integration-card__setup-badge", children: (0, import_i18n57.__)("Configured per form", "jetpack-forms") }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(Badge3, { intent: "draft", className: "integration-card__setup-badge", children: (0, import_i18n57.__)("Enter organization ID", "jetpack-forms") })
    },
    body: context === "block-editor" ? /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)(import_components57.BaseControl, { __nextHasNoMarginBottom: true, children: [
      /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
        import_components57.TextControl,
        {
          label: (0, import_i18n57.__)("Organization ID", "jetpack-forms"),
          value: organizationId,
          onChange: (newId) => setAttributes?.({
            salesforceData: {
              ...attributes?.salesforceData ?? {},
              organizationId: newId.trim()
            }
          }),
          __nextHasNoMarginBottom: true,
          __next40pxDefaultSize: true,
          style: { maxWidth: "300px" }
        }
      ),
      organizationId && !isValidSalesforceOrgId(organizationId) && /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(help_message_default, { isError: true, style: { marginTop: "8px" }, children: (0, import_i18n57.__)(
        "Invalid Organization ID. Should be a 15\u201318 characters long alphanumeric string.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_components57.ExternalLink, { href: "https://help.salesforce.com/s/articleView?id=000325251&type=1", children: (0, import_i18n57.__)("Where to find your Salesforce Organization ID", "jetpack-forms") }) }),
      /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("div", { style: { marginTop: "20px", marginBottom: "20px" }, children: (0, import_i18n57.__)(
        "For integration with Salesforce to work, you must add specific fields with specific field IDs that match Salesforce.",
        "jetpack-forms"
      ) })
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime136.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime136.jsx)("p", { className: "integration-card__description", children: (0, import_i18n57.__)(
        "Salesforce connections are managed for each form individually in the block editor.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(CreateSalesforceLeadFormButton, { className: "jp-forms__create-form-button--large-green" })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/hooks/use-integration-cards-data.tsx
var useIntegrationCardsData = ({
  integrations = [],
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers,
  attributes,
  setAttributes,
  components
}) => {
  return integrations.map((integration) => {
    const base = {
      id: integration.id,
      title: integration.title,
      description: integration.subtitle,
      cardData: {
        ...integration,
        isLoading: typeof integration.isInstalled === "undefined",
        refreshStatus: refreshIntegrations2
      }
    };
    switch (integration.id) {
      case "akismet":
        return buildAkismetCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          handlers
        });
      case "google-drive":
        return buildGoogleDriveCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          handlers
        });
      case "zero-bs-crm":
        return buildJetpackCrmCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes
        });
      case "mailpoet":
        return buildMailPoetCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes,
          components
        });
      case "hostinger-reach":
        return buildHostingerReachCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes,
          components
        });
      case "salesforce":
        return buildSalesforceCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes
        });
      default:
        return base;
    }
  });
};
var use_integration_cards_data_default = useIntegrationCardsData;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/index.tsx
var import_components61 = __toESM(require_components(), 1);

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/integration-card-body.tsx
var import_components58 = __toESM(require_components(), 1);
var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
var IntegrationCardBody = ({
  isExpanded,
  children,
  cardData = {}
}) => {
  if (!isExpanded) {
    return null;
  }
  const {
    notInstalledMessage,
    notActivatedMessage,
    isInstalled,
    isActive,
    isLoading,
    type,
    __isPartial
  } = cardData;
  const isPlugin = type === "plugin";
  const isService = type === "service";
  const showPluginInstallMessage = !__isPartial && isPlugin && !isInstalled;
  const showPluginActivateMessage = !__isPartial && isPlugin && isInstalled && !isActive;
  const showContent = !__isPartial && (isPlugin && isInstalled && isActive || isService);
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components58.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components58.Spinner, {}) });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime137.jsxs)(import_components58.CardBody, { children: [
    showPluginInstallMessage && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("p", { className: "integration-card__description", children: notInstalledMessage }),
    showPluginActivateMessage && /* @__PURE__ */ (0, import_jsx_runtime137.jsx)("p", { className: "integration-card__description", children: notActivatedMessage }),
    showContent && children
  ] });
};
var integration_card_body_default = IntegrationCardBody;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/integration-card-header.tsx
var import_components60 = __toESM(require_components(), 1);
var import_i18n59 = __toESM(require_i18n(), 1);

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/plugin-action-button.tsx
var import_components59 = __toESM(require_components(), 1);
var import_element71 = __toESM(require_element(), 1);
var import_i18n58 = __toESM(require_i18n(), 1);

// src/hooks/use-plugin-installation.ts
var import_data8 = __toESM(require_data(), 1);
var import_element70 = __toESM(require_element(), 1);
var import_notices = __toESM(require_notices(), 1);

// ../../js-packages/script-data/src/utils.ts
function getScriptData() {
  return window.JetpackScriptData;
}
function isSimpleSite() {
  return getScriptData()?.site?.host === "wpcom";
}
function isWoASite() {
  return getScriptData()?.site?.host === "woa";
}

// src/blocks/contact-form/util/plugin-management.js
var import_api_fetch3 = __toESM(require_api_fetch(), 1);
async function installAndActivatePlugin(slug) {
  if (isSimpleSite()) {
    return Promise.reject();
  }
  try {
    const attemptInstall = await (0, import_api_fetch3.default)({
      path: "/jetpack/v4/plugins",
      method: "POST",
      data: {
        slug,
        status: "active",
        source: "block-editor"
      }
    });
    return attemptInstall;
  } catch (error2) {
    return Promise.reject(error2.message);
  }
}
async function activatePlugin(pluginFile) {
  if (isSimpleSite()) {
    return Promise.reject();
  }
  try {
    const attemptActivate = await (0, import_api_fetch3.default)({
      path: `/jetpack/v4/plugins/${pluginFile}`,
      method: "POST",
      data: {
        status: "active",
        source: "block-editor"
      }
    });
    return attemptActivate;
  } catch (error2) {
    return Promise.reject(error2.message);
  }
}

// src/hooks/use-plugin-installation.ts
var usePluginInstallation = ({
  slug,
  pluginPath,
  isInstalled,
  trackEventName,
  trackEventProps = {},
  onSuccess,
  successNotices,
  errorNotice
}) => {
  const [isInstalling, setIsInstalling] = (0, import_element70.useState)(false);
  const { createSuccessNotice, createErrorNotice } = (0, import_data8.useDispatch)(import_notices.store);
  const canInstallPlugins = useConfigValue("canInstallPlugins");
  const canActivatePlugins = useConfigValue("canActivatePlugins");
  const installPlugin = (0, import_element70.useCallback)(async () => {
    setIsInstalling(true);
    if (trackEventName) {
      analytics_default.tracks.recordEvent(trackEventName, {
        intent: isInstalled ? "activate-plugin" : "install-plugin",
        ...trackEventProps ?? {}
      });
    }
    try {
      if (isInstalled) {
        if (!canActivatePlugins) {
          return false;
        }
        await activatePlugin(pluginPath);
      } else {
        if (!canInstallPlugins) {
          return false;
        }
        await installAndActivatePlugin(slug);
      }
      const successNoticeConfig = isInstalled ? successNotices?.activate : successNotices?.install;
      if (successNoticeConfig?.message) {
        createSuccessNotice(successNoticeConfig.message, successNoticeConfig.options);
      }
      if (onSuccess) {
        await onSuccess();
      }
      return true;
    } catch (error2) {
      if (errorNotice) {
        const noticeMessage = errorNotice.message || (error2 instanceof Error ? error2.message : void 0);
        if (noticeMessage) {
          createErrorNotice(noticeMessage, errorNotice.options);
        }
      }
      return false;
    } finally {
      setIsInstalling(false);
    }
  }, [
    trackEventName,
    isInstalled,
    trackEventProps,
    successNotices?.activate,
    successNotices?.install,
    onSuccess,
    canActivatePlugins,
    pluginPath,
    canInstallPlugins,
    slug,
    createSuccessNotice,
    errorNotice,
    createErrorNotice
  ]);
  return {
    isInstalling,
    installPlugin,
    canInstallPlugins,
    canActivatePlugins
  };
};

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/plugin-action-button.tsx
var import_jsx_runtime138 = __toESM(require_jsx_runtime(), 1);
var PluginActionButton = ({
  slug,
  pluginFile,
  isInstalled,
  isActive,
  refreshStatus,
  trackEventName
}) => {
  const trackEventProps = {
    screen: "block-editor"
  };
  const { isInstalling, installPlugin, canInstallPlugins, canActivatePlugins } = usePluginInstallation({
    slug,
    pluginPath: pluginFile,
    isInstalled,
    trackEventName,
    trackEventProps
  });
  const canPerformAction = isInstalled ? canActivatePlugins : canInstallPlugins;
  const [isReconcilingStatus, setIsReconcilingStatus] = (0, import_element71.useState)(false);
  const isDisabled = isInstalling || isReconcilingStatus || !canPerformAction;
  const handleAction = async (event) => {
    event.stopPropagation();
    if (isDisabled) {
      return;
    }
    const success = await installPlugin();
    if (success && refreshStatus) {
      setIsReconcilingStatus(true);
      refreshStatus();
    }
  };
  (0, import_element71.useEffect)(() => {
    if (isReconcilingStatus && isActive) {
      setIsReconcilingStatus(false);
    }
  }, [isReconcilingStatus, isActive]);
  const getButtonText = () => {
    return (isInstalling || isReconcilingStatus) && isInstalled && (0, import_i18n58.__)("Activating\u2026", "jetpack-forms") || (isInstalling || isReconcilingStatus) && (0, import_i18n58.__)("Installing\u2026", "jetpack-forms") || isInstalled && (0, import_i18n58.__)("Activate", "jetpack-forms") || (0, import_i18n58.__)("Install", "jetpack-forms");
  };
  const tooltipTextActivate = (0, import_i18n58.__)("Activate this plugin", "jetpack-forms");
  const tooltipTextInstall = (0, import_i18n58.__)("Install this plugin", "jetpack-forms");
  const tooltipTextNoInstallPerms = (0, import_i18n58.__)(
    "You do not have permission to install plugins.",
    "jetpack-forms"
  );
  const tooltipTextNoActivatePerms = (0, import_i18n58.__)(
    "You do not have permission to activate plugins.",
    "jetpack-forms"
  );
  const getTooltipText = () => {
    if (isInstalled && !canActivatePlugins) {
      return tooltipTextNoActivatePerms;
    }
    if (!isInstalled && !canInstallPlugins) {
      return tooltipTextNoInstallPerms;
    }
    return String(isInstalled ? tooltipTextActivate : tooltipTextInstall);
  };
  return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_components59.Tooltip, { text: getTooltipText(), children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)("span", { style: { display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
    import_components59.Button,
    {
      variant: "primary",
      onClick: handleAction,
      disabled: isDisabled,
      style: isDisabled ? { pointerEvents: "none" } : void 0,
      icon: isInstalling || isReconcilingStatus ? /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_components59.Spinner, {}) : void 0,
      __next40pxDefaultSize: true,
      children: getButtonText()
    }
  ) }) });
};
var plugin_action_button_default = PluginActionButton;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/integration-card-header.tsx
var import_jsx_runtime139 = __toESM(require_jsx_runtime(), 1);
var noop3 = () => {
};
var IntegrationCardHeader = ({
  title,
  description,
  isExpanded,
  onToggle,
  cardData = {},
  toggleTooltip
}) => {
  const {
    isInstalled,
    isActive,
    isConnected,
    needsConnection,
    type,
    showHeaderToggle,
    headerToggleValue,
    isHeaderToggleEnabled,
    onHeaderToggleChange,
    toggleDisabledTooltip,
    setupBadge,
    __isPartial
  } = cardData;
  const showPluginAction = !__isPartial && type === "plugin" && (!isInstalled || !isActive);
  const showConnectedBadge = !__isPartial && (isConnected || isActive && !needsConnection);
  const disableFormText = (0, import_i18n59.__)("Disable for this form", "jetpack-forms");
  const enableFormText = (0, import_i18n59.__)("Enable for this form", "jetpack-forms");
  const showPendingBadge = !__isPartial && !showPluginAction && !isConnected && needsConnection;
  const installPluginActionLabel = (0, import_i18n59.__)("Plugin needs install", "jetpack-forms");
  const activatePluginActionLabel = (0, import_i18n59.__)("Plugin needs activation", "jetpack-forms");
  const pluginActionLabel = !isInstalled ? installPluginActionLabel : activatePluginActionLabel;
  const getTooltipText = (checked) => {
    if (toggleTooltip) {
      return toggleTooltip;
    }
    if (checked) {
      return disableFormText;
    }
    return enableFormText;
  };
  const handleToggleChange = (value) => {
    analytics_default.tracks.recordEvent("jetpack_forms_integrations_card_toggle", {
      card: cardData.id,
      origin: "block-editor",
      enabled: value
    });
    if (onHeaderToggleChange) {
      onHeaderToggleChange(value);
    }
  };
  const handleHeaderClick = (e2) => {
    if (e2.target.closest(".components-form-toggle")) {
      return;
    }
    onToggle();
  };
  const isHeaderToggleEnabledFinal = isHeaderToggleEnabled && !__isPartial;
  const showHeaderToggleFinal = showHeaderToggle && !__isPartial;
  const showIntegrationIcons = useConfigValue("showIntegrationIcons");
  return /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
    import_components60.CardHeader,
    {
      onClick: __isPartial ? noop3 : handleHeaderClick,
      className: clsx_default("integration-card__header", { "is-clickable": !__isPartial }),
      children: /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "integration-card__header-content", children: [
        /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "integration-card__header-main", children: [
          showIntegrationIcons !== false && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("div", { className: "integration-card__service-icon-container", children: cardData?.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
            "img",
            {
              src: cardData.iconUrl,
              alt: "",
              "aria-hidden": true,
              width: 30,
              height: 30,
              className: clsx_default(
                "integration-card__service-icon",
                cardData.slug && `integration-card__service-icon--${cardData.slug}`
              )
            }
          ) : /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
            import_components60.Icon,
            {
              icon: plugins_default,
              className: clsx_default(
                "integration-card__service-icon",
                cardData.slug && `integration-card__service-icon--${cardData.slug}`
              ),
              size: 30,
              "aria-hidden": true
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)("div", { className: "integration-card__title-section", children: [
            /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("h3", { className: "integration-card__title", children: title }),
            description && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "integration-card__description", children: description }),
            __isPartial && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_components60.Animate, { type: "loading", children: ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
              Badge3,
              {
                intent: "draft",
                className: clsx_default("integration-card__plugin-badge", className),
                children: " "
              }
            ) }),
            showPluginAction && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
              Badge3,
              {
                intent: isInstalled && !isActive ? "low" : "draft",
                className: "integration-card__plugin-badge",
                children: pluginActionLabel
              }
            ),
            showConnectedBadge && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Badge3, { intent: "stable", className: "integration-card__connected-badge", children: (0, import_i18n59.__)("Enabled", "jetpack-forms") }),
            showPendingBadge && (setupBadge || /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(Badge3, { intent: "low", className: "integration-card__setup-badge", children: (0, import_i18n59.__)("Needs connection", "jetpack-forms") }))
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(
          import_components60.__experimentalHStack,
          {
            className: "integration-card__header-actions",
            spacing: "3",
            alignment: "center",
            justify: "end",
            expanded: false,
            children: [
              showPluginAction && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
                plugin_action_button_default,
                {
                  slug: cardData.slug,
                  pluginFile: cardData.pluginFile,
                  isInstalled,
                  isActive,
                  refreshStatus: cardData.refreshStatus,
                  trackEventName: cardData.trackEventName
                }
              ),
              !showPluginAction && showHeaderToggleFinal && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
                import_components60.Tooltip,
                {
                  text: !isHeaderToggleEnabledFinal && toggleDisabledTooltip ? toggleDisabledTooltip : getTooltipText(headerToggleValue),
                  children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)("span", { className: "integration-card__toggle-tooltip-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
                    import_components60.ToggleControl,
                    {
                      checked: headerToggleValue && (isActive || isConnected),
                      onChange: handleToggleChange,
                      disabled: !isHeaderToggleEnabledFinal || !(isActive || isConnected),
                      __nextHasNoMarginBottom: true
                    }
                  ) })
                }
              ),
              !__isPartial && /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_components60.Icon, { icon: isExpanded ? chevron_up_default : chevron_down_default })
            ]
          }
        )
      ] })
    }
  );
};
var integration_card_header_default = IntegrationCardHeader;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='274a5d18d1']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "274a5d18d1");
  style.appendChild(document.createTextNode(".integration-card__header.is-clickable{cursor:pointer}.integration-card__header-content{align-items:center;display:flex;gap:16px;justify-content:space-between;width:100%}@media (max-width:782px){.integration-card__header-content{align-items:flex-start;gap:10px}}.integration-card__header-main{align-items:center;display:flex;gap:16px}@media (max-width:782px){.integration-card__header-main{align-items:flex-start;gap:10px;width:100%}.integration-card__header-actions button{height:auto;padding:10px 12px}}.integration-card__title-section{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:4px 12px}@media (max-width:782px){.integration-card__title-section{gap:2px 12px}}.integration-card__service-icon-container{align-items:center;background-color:var(--jp-gray-0);border-radius:4px;display:flex;justify-content:center;padding:8px}@media (max-width:782px){.integration-card__service-icon-container{padding:4px}}.integration-card__service-icon{flex-shrink:0;margin-top:0}.integration-card__title{font-size:15px;font-weight:400;line-height:1.4;margin:0;order:1}.integration-card__connected-badge,.integration-card__plugin-badge,.integration-card__setup-badge{min-width:60px;order:2}@media (max-width:782px){.integration-card__connected-badge,.integration-card__plugin-badge,.integration-card__setup-badge{order:3}}.integration-card__description{color:var(--jp-gray-50);font-size:13px;line-height:1.5;order:3;width:100%}.integration-card__description:first-of-type{margin-top:0}@media (max-width:782px){.integration-card__description{order:2;padding-bottom:3px;text-wrap:balance}}.integration-card__section{margin:12px 0}@media (max-width:480px){.integration-card__links.components-h-stack{align-items:flex-start;flex-direction:column}.integration-card__links.components-h-stack span{display:none}}.integration-card .components-button .components-spinner{height:16px;margin:0 8px;width:16px}.integration-card .components-card__body{padding:8px 40px 24px 60px}@media (max-width:782px){.integration-card .components-card__body{padding-left:46px;padding-right:20px}}.integration-card .components-card-header{padding-left:0;padding-right:0}.integration-card p{text-wrap:balance;text-wrap:pretty}.integration-card__service-icon--google-sheets,.integration-card__service-icon--hostinger-reach,.integration-card__service-icon--mailpoet{border-radius:0!important}.integration-card:last-child{border-bottom:none}"));
  document.head.appendChild(style);
}

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/index.tsx
var import_jsx_runtime140 = __toESM(require_jsx_runtime(), 1);
var IntegrationCard = ({
  title,
  description,
  isExpanded,
  onToggle,
  children,
  cardData = {},
  toggleTooltip,
  borderBottom = true
}) => {
  return /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(
    import_components61.Card,
    {
      className: "integration-card",
      isBorderless: true,
      borderBottom,
      isRounded: false,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
          integration_card_header_default,
          {
            title,
            description,
            isExpanded,
            onToggle,
            cardData,
            toggleTooltip
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(integration_card_body_default, { isExpanded, cardData, children })
      ]
    }
  );
};
var integration_card_default = IntegrationCard;

// src/blocks/contact-form/components/jetpack-integrations-modal/integrations-list.tsx
var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1);
var IntegrationsList = ({
  integrations = [],
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers,
  attributes,
  setAttributes,
  components
}) => {
  const items = use_integration_cards_data_default({
    integrations,
    refreshIntegrations: refreshIntegrations2,
    context,
    handlers,
    attributes,
    setAttributes,
    components
  });
  const initialCardsExpandedState = (0, import_element72.useMemo)(() => {
    const state = {};
    integrations.forEach((integration) => {
      state[integration.id] = false;
    });
    return state;
  }, [integrations]);
  const [expandedCards, setExpandedCards] = (0, import_element72.useState)(initialCardsExpandedState);
  const toggleCard = (0, import_element72.useCallback)(
    (id) => {
      setExpandedCards((prev) => {
        const isExpanding = !prev[id];
        if (isExpanding) {
          analytics_default.tracks.recordEvent("jetpack_forms_integrations_card_expand", {
            card: id,
            origin: context
          });
        }
        return { ...prev, [id]: isExpanding };
      });
    },
    [context]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_jsx_runtime141.Fragment, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(
    integration_card_default,
    {
      title: item.title,
      description: item.description,
      isExpanded: !!expandedCards[item.id],
      onToggle: () => toggleCard(item.id),
      cardData: item.cardData,
      toggleTooltip: item.toggleTooltip,
      children: item.body
    },
    item.id
  )) });
};
var integrations_list_default = IntegrationsList;

// src/blocks/contact-form/components/jetpack-integrations-modal/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='62ef491701']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "62ef491701");
  style.appendChild(document.createTextNode('@import "@wordpress/theme/design-tokens.css";.jetpack-forms-integrations-modal .components-modal__header-heading{font-weight:400}'));
  document.head.appendChild(style);
}

// src/blocks/contact-form/components/jetpack-integrations-modal/index.tsx
var import_jsx_runtime142 = __toESM(require_jsx_runtime(), 1);
var IntegrationsModal = ({
  isOpen,
  onClose,
  attributes,
  setAttributes,
  integrationsData,
  refreshIntegrations: refreshIntegrations2,
  context = "block-editor",
  components
}) => {
  if (!isOpen) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
    import_components62.Modal,
    {
      title: (0, import_i18n60.__)("Manage integrations", "jetpack-forms"),
      onRequestClose: onClose,
      size: "large",
      className: "jetpack-forms-integrations-modal",
      children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_components62.__experimentalVStack, { spacing: "4", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
        integrations_list_default,
        {
          integrations: integrationsData,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes,
          components
        }
      ) })
    }
  );
};
var jetpack_integrations_modal_default = IntegrationsModal;

// src/dashboard/components/empty-responses/index.tsx
var import_components64 = __toESM(require_components(), 1);
var import_data10 = __toESM(require_data(), 1);
var import_element74 = __toESM(require_element(), 1);
var import_i18n62 = __toESM(require_i18n(), 1);

// src/store/integrations/index.ts
var import_data9 = __toESM(require_data(), 1);

// src/store/integrations/actions.ts
var actions_exports2 = {};
__export(actions_exports2, {
  invalidateIntegrations: () => invalidateIntegrations,
  receiveIntegrations: () => receiveIntegrations,
  refreshIntegrations: () => refreshIntegrations,
  setIntegrationsError: () => setIntegrationsError,
  setIntegrationsLoading: () => setIntegrationsLoading
});

// src/store/integrations/action-types.ts
var RECEIVE_INTEGRATIONS = "RECEIVE_INTEGRATIONS";
var INVALIDATE_INTEGRATIONS = "INVALIDATE_INTEGRATIONS";
var SET_INTEGRATIONS_LOADING = "SET_INTEGRATIONS_LOADING";
var SET_INTEGRATIONS_ERROR = "SET_INTEGRATIONS_ERROR";

// src/store/integrations/resolvers.ts
var resolvers_exports2 = {};
__export(resolvers_exports2, {
  getIntegrations: () => getIntegrations,
  resetMetadataFlag: () => resetMetadataFlag
});
var import_api_fetch4 = __toESM(require_api_fetch(), 1);
var import_url3 = __toESM(require_url(), 1);
var hasLoadedMeta = false;
var resetMetadataFlag = () => {
  hasLoadedMeta = false;
};
var fetchIntegrationsMetadata = () => async ({ dispatch: dispatch4 }) => {
  const metadataPath = "/wp/v2/feedback/integrations-metadata";
  const metadata = await (0, import_api_fetch4.default)({ path: metadataPath });
  const partialIntegrations = metadata.map((meta) => ({
    ...meta,
    pluginFile: null,
    isInstalled: false,
    isActive: false,
    isConnected: false,
    needsConnection: meta.type === "service",
    version: null,
    settingsUrl: null,
    details: {},
    __isPartial: true
    // Flag to indicate this is metadata-only
  }));
  dispatch4(receiveIntegrations(partialIntegrations));
};
var fetchFullIntegrations = () => async ({ dispatch: dispatch4 }) => {
  const fullPath = (0, import_url3.addQueryArgs)("/wp/v2/feedback/integrations", { version: 2 });
  const fullIntegrations = await (0, import_api_fetch4.default)({ path: fullPath });
  dispatch4(receiveIntegrations(fullIntegrations));
};
var getIntegrations = () => async ({ dispatch: dispatch4 }) => {
  dispatch4(setIntegrationsLoading(true));
  try {
    if (!hasLoadedMeta) {
      await fetchIntegrationsMetadata()({ dispatch: dispatch4 });
      hasLoadedMeta = true;
    }
    await fetchFullIntegrations()({ dispatch: dispatch4 });
  } catch (e2) {
    const message2 = e2 instanceof Error ? e2.message : UNKNOWN_ERROR_MESSAGE;
    dispatch4(setIntegrationsError(message2));
  } finally {
    dispatch4(setIntegrationsLoading(false));
  }
};
getIntegrations.shouldInvalidate = (action) => action.type === INVALIDATE_INTEGRATIONS;

// src/store/integrations/actions.ts
var receiveIntegrations = (items) => ({
  type: RECEIVE_INTEGRATIONS,
  items
});
var invalidateIntegrations = () => ({
  type: INVALIDATE_INTEGRATIONS
});
var setIntegrationsLoading = (isLoading) => ({
  type: SET_INTEGRATIONS_LOADING,
  isLoading
});
var setIntegrationsError = (error2) => ({
  type: SET_INTEGRATIONS_ERROR,
  error: error2
});
var refreshIntegrations = () => getIntegrations();

// src/store/integrations/reducer.ts
var DEFAULT_STATE2 = {
  items: null,
  isLoading: false,
  error: null
};
function reducer2(state = DEFAULT_STATE2, action) {
  switch (action.type) {
    case SET_INTEGRATIONS_LOADING:
      return {
        ...state,
        isLoading: !!action.isLoading,
        error: action.isLoading ? null : state.error
      };
    case SET_INTEGRATIONS_ERROR:
      return {
        ...state,
        isLoading: false,
        error: action.error ?? UNKNOWN_ERROR_MESSAGE
      };
    case RECEIVE_INTEGRATIONS:
      return {
        ...state,
        items: action.items,
        isLoading: false,
        error: null
      };
    case INVALIDATE_INTEGRATIONS:
      return {
        ...state,
        items: null,
        isLoading: false
      };
    default:
      return state;
  }
}

// src/store/integrations/selectors.ts
var selectors_exports2 = {};
__export(selectors_exports2, {
  getIntegrations: () => getIntegrations2,
  getIntegrationsError: () => getIntegrationsError,
  isIntegrationsLoading: () => isIntegrationsLoading
});
var getIntegrations2 = (state) => state.items;
var isIntegrationsLoading = (state) => state.isLoading;
var getIntegrationsError = (state) => state.error;

// src/store/integrations/index.ts
var INTEGRATIONS_STORE = "jetpack/forms/integrations";
var store2 = (0, import_data9.createReduxStore)(INTEGRATIONS_STORE, {
  reducer: reducer2,
  actions: actions_exports2,
  selectors: selectors_exports2,
  resolvers: resolvers_exports2
});
(0, import_data9.register)(store2);

// src/dashboard/components/create-form-button/index.tsx
var import_components63 = __toESM(require_components(), 1);
var import_element73 = __toESM(require_element(), 1);
var import_i18n61 = __toESM(require_i18n(), 1);
var import_jsx_runtime143 = __toESM(require_jsx_runtime(), 1);
function CreateFormButton({
  label = (0, import_i18n61.__)("Create a form", "jetpack-forms"),
  showPatterns = false,
  variant = "secondary",
  showIcon = true
}) {
  const { openNewForm } = useCreateForm();
  const onButtonClickHandler = (0, import_element73.useCallback)(
    () => openNewForm({
      showPatterns,
      analyticsEvent: () => {
        analytics_default.tracks.recordEvent("jetpack_wpa_forms_landing_page_cta_click", {
          button: "forms"
        });
      }
    }),
    [openNewForm, showPatterns]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(
    import_components63.Button,
    {
      size: "compact",
      variant,
      onClick: onButtonClickHandler,
      icon: showIcon ? plus_default : void 0,
      className: "create-form-button",
      children: label
    }
  );
}

// src/dashboard/components/empty-responses/index.tsx
var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1);
var useInstallAkismet = () => {
  const { akismetIntegration } = (0, import_data10.useSelect)((select3) => {
    const store5 = select3(INTEGRATIONS_STORE);
    const integrations = store5.getIntegrations() || [];
    return {
      akismetIntegration: integrations.find(
        (integration) => integration.id === "akismet"
      )
    };
  }, []);
  const { refreshIntegrations: refreshIntegrations2 } = (0, import_data10.useDispatch)(INTEGRATIONS_STORE);
  const akismetIntegrationReady = (0, import_element74.useMemo)(
    () => !!akismetIntegration && !akismetIntegration.__isPartial,
    [akismetIntegration]
  );
  const isInstalled = !!akismetIntegration?.isInstalled;
  const isAkismetActive = akismetIntegrationReady && isInstalled && !!akismetIntegration?.isActive;
  const shouldShowAkismetCta = akismetIntegrationReady && !isAkismetActive && !isSimpleSite();
  const akismetPluginFile = (0, import_element74.useMemo)(
    () => akismetIntegration?.pluginFile ?? "akismet/akismet",
    [akismetIntegration?.pluginFile]
  );
  const wrapperBody = (0, import_element74.createInterpolateElement)(
    (0, import_i18n62.__)(
      "Want automatic spam filtering? Akismet Anti-spam protects millions of sites. <moreInfoLink>Learn more.</moreInfoLink>",
      "jetpack-forms"
    ),
    {
      moreInfoLink: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_components64.ExternalLink, { href: "https://akismet.com/", children: null })
    }
  );
  const activateButtonText = (0, import_i18n62.__)("Activate Akismet Anti-spam", "jetpack-forms");
  const installAndActivateButtonText = (0, import_i18n62.__)("Install Akismet Anti-spam", "jetpack-forms");
  const wrapperButtonText = isInstalled ? activateButtonText : installAndActivateButtonText;
  const {
    isInstalling: isInstallingAkismet,
    installPlugin,
    canInstallPlugins,
    canActivatePlugins
  } = usePluginInstallation({
    slug: "akismet",
    pluginPath: akismetPluginFile,
    isInstalled,
    onSuccess: refreshIntegrations2,
    trackEventName: "jetpack_forms_upsell_akismet_click",
    trackEventProps: {
      screen: "dashboard"
    },
    successNotices: {
      install: {
        message: (0, import_i18n62.__)("Akismet installed and activated.", "jetpack-forms"),
        options: { type: "snackbar", id: "akismet-install-success" }
      },
      activate: {
        message: (0, import_i18n62.__)("Akismet activated.", "jetpack-forms"),
        options: { type: "snackbar", id: "akismet-install-success" }
      }
    },
    errorNotice: {
      message: (0, import_i18n62.__)("Could not set up Akismet. Please try again.", "jetpack-forms"),
      options: { type: "snackbar", id: "akismet-install-error" }
    }
  });
  const canPerformAkismetAction = isInstalled && akismetIntegrationReady ? canActivatePlugins !== false : canInstallPlugins !== false;
  const handleAkismetSetup = (0, import_element74.useCallback)(async () => {
    if (isInstallingAkismet || !akismetIntegrationReady || !canPerformAkismetAction) {
      return;
    }
    await installPlugin();
  }, [isInstallingAkismet, akismetIntegrationReady, canPerformAkismetAction, installPlugin]);
  return {
    shouldShowAkismetCta,
    wrapperBody,
    isInstallingAkismet,
    canPerformAkismetAction,
    wrapperButtonText,
    handleAkismetSetup
  };
};
var EmptyWrapper = ({ heading = "", body = "", actions: actions2 = null }) => /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_components64.__experimentalVStack, { alignment: "center", spacing: "2", children: [
  heading && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_components64.__experimentalText, { as: "h3", weight: "500", size: "15", children: heading }),
  body && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_components64.__experimentalText, { variant: "muted", children: body }),
  actions2 && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)("span", { style: { marginBlockStart: "16px" }, children: actions2 })
] });
var EmptyResponses = ({
  isSearch,
  isSingleFormView = false,
  readStatusFilter,
  status
}) => {
  const emptyTrashDays = useConfigValue("emptyTrashDays") ?? 0;
  const {
    shouldShowAkismetCta,
    wrapperBody,
    isInstallingAkismet,
    canPerformAkismetAction,
    wrapperButtonText,
    handleAkismetSetup
  } = useInstallAkismet();
  const hasReadStatusFilter = !!readStatusFilter;
  const searchHeading = (0, import_i18n62.__)("No results found", "jetpack-forms");
  const searchMessage = (0, import_i18n62.__)(
    "Try adjusting your search or filters to find what you're looking for.",
    "jetpack-forms"
  );
  if (isSearch || hasReadStatusFilter) {
    return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(EmptyWrapper, { heading: searchHeading, body: searchMessage });
  }
  const noTrashHeading = (0, import_i18n62.__)("Trash is empty", "jetpack-forms");
  const noTrashMessage = (0, import_i18n62.sprintf)(
    /* translators: %d number of days. */
    (0, import_i18n62._n)(
      "Items in trash are permanently deleted after %d day.",
      "Items in trash are permanently deleted after %d days.",
      emptyTrashDays,
      "jetpack-forms"
    ),
    emptyTrashDays
  );
  if (status === "trash") {
    return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(EmptyWrapper, { heading: noTrashHeading, body: emptyTrashDays > 0 && noTrashMessage });
  }
  const noSpamHeading = (0, import_i18n62.__)("Lucky you, no spam!", "jetpack-forms");
  const noSpamMessage = (0, import_i18n62.__)(
    "Spam responses are permanently deleted after 15 days.",
    "jetpack-forms"
  );
  if (status === "spam") {
    if (shouldShowAkismetCta) {
      return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
        EmptyWrapper,
        {
          heading: noSpamHeading,
          body: wrapperBody,
          actions: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
            import_components64.Button,
            {
              variant: "primary",
              isBusy: isInstallingAkismet,
              disabled: isInstallingAkismet || !canPerformAkismetAction,
              onClick: handleAkismetSetup,
              __next40pxDefaultSize: true,
              children: wrapperButtonText
            }
          )
        }
      );
    }
    return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(EmptyWrapper, { heading: noSpamHeading, body: noSpamMessage });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
    EmptyWrapper,
    {
      heading: (0, import_i18n62.__)("You're set up. No responses yet.", "jetpack-forms"),
      body: (0, import_i18n62.__)(
        "Share your form to start collecting responses. New items will appear here.",
        "jetpack-forms"
      ),
      actions: !isSingleFormView && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
        CreateFormButton,
        {
          label: (0, import_i18n62.__)("Create a new form", "jetpack-forms"),
          variant: "primary"
        }
      )
    }
  );
};
var empty_responses_default = EmptyResponses;

// ../../../node_modules/.pnpm/@gravatar-com+hovercards@0.15.0/node_modules/@gravatar-com/hovercards/dist/index.mjs
var __webpack_require__ = {};
(() => {
  __webpack_require__.d = (exports, definition) => {
    for (var key in definition) {
      if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
        Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
      }
    }
  };
})();
(() => {
  __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
})();
var __webpack_exports__ = {};
__webpack_require__.d(__webpack_exports__, {
  S: () => (
    /* reexport */
    Hovercards
  )
});
var paddingMap = {
  top: "paddingBottom",
  bottom: "paddingTop",
  left: "paddingRight",
  right: "paddingLeft"
};
function assignPosition(ref, card, _temp) {
  var _ref = _temp === void 0 ? {} : _temp, _ref$placement = _ref.placement, placement = _ref$placement === void 0 ? "right-start" : _ref$placement, _ref$offset = _ref.offset, offset = _ref$offset === void 0 ? 0 : _ref$offset, _ref$autoFlip = _ref.autoFlip, autoFlip = _ref$autoFlip === void 0 ? true : _ref$autoFlip, _ref$autoShift = _ref.autoShift, autoShift = _ref$autoShift === void 0 ? true : _ref$autoShift;
  card.style.padding = "0";
  var refRect = ref.getBoundingClientRect();
  var cardRect = card.getBoundingClientRect();
  var refScrollT = refRect.top + scrollY;
  var refScrollB = refRect.bottom + scrollY;
  var refScrollR = refRect.right + scrollX;
  var refScrollL = refRect.left + scrollX;
  var topSpace = refRect.top;
  var bottomSpace = innerHeight - refRect.bottom;
  var leftSpace = refRect.left;
  var rightSpace = innerWidth - refRect.right;
  var x2 = 0;
  var y2 = 0;
  var _placement$split = placement.split("-"), dir = _placement$split[0], align = _placement$split[1];
  offset = Math.max(0, offset);
  if (autoFlip) {
    var dirSpaceV = cardRect.height + offset;
    var dirSpaceH = cardRect.width + offset;
    if (dir === "top" && topSpace < dirSpaceV && bottomSpace > topSpace) {
      dir = "bottom";
    } else if (dir === "bottom" && bottomSpace < dirSpaceV && topSpace > bottomSpace) {
      dir = "top";
    } else if (dir === "left" && leftSpace < dirSpaceH && rightSpace > leftSpace) {
      dir = "right";
    } else if (dir === "right" && rightSpace < dirSpaceH && leftSpace > rightSpace) {
      dir = "left";
    }
  }
  if (autoShift) {
    var alignSpaceV = cardRect.height - refRect.height;
    var alignSpaceH = cardRect.width - refRect.width;
    var halfAlignSpaceV = alignSpaceV / 2;
    var halfAlignSpaceH = alignSpaceH / 2;
    if (dir === "top" || dir === "bottom") {
      if (align === "start" && rightSpace < alignSpaceH) {
        if (rightSpace < halfAlignSpaceH) {
          align = "end";
        } else {
          align = void 0;
        }
      } else if (align === "end" && leftSpace < alignSpaceH) {
        if (leftSpace < halfAlignSpaceH) {
          align = "start";
        } else {
          align = void 0;
        }
      } else if (align === void 0 && (rightSpace < halfAlignSpaceH || leftSpace < halfAlignSpaceH)) {
        if (rightSpace > leftSpace) {
          align = "start";
        } else {
          align = "end";
        }
      }
    }
    if (dir === "right" || dir === "left") {
      if (align === "start" && bottomSpace < alignSpaceV) {
        if (bottomSpace < halfAlignSpaceV) {
          align = "end";
        } else {
          align = void 0;
        }
      } else if (align === "end" && topSpace < alignSpaceV) {
        if (topSpace < halfAlignSpaceV) {
          align = "start";
        } else {
          align = void 0;
        }
      } else if (align === void 0 && (bottomSpace < halfAlignSpaceV || topSpace < halfAlignSpaceV)) {
        if (bottomSpace > topSpace) {
          align = "start";
        } else {
          align = "end";
        }
      }
    }
  }
  if (dir === "top" || dir === "bottom") {
    x2 = refScrollL + refRect.width / 2 - cardRect.width / 2;
    y2 = dir === "top" ? refScrollT - cardRect.height - offset : refScrollB;
    if (align === "start") {
      x2 = refScrollL;
    }
    if (align === "end") {
      x2 = refScrollR - cardRect.width;
    }
  } else {
    x2 = dir === "right" ? refScrollR : refScrollL - cardRect.width - offset;
    y2 = refScrollT + refRect.height / 2 - cardRect.height / 2;
    if (align === "start") {
      y2 = refScrollT;
    }
    if (align === "end") {
      y2 = refScrollB - cardRect.height;
    }
  }
  card.style.position = "absolute";
  card.style.left = x2 + "px";
  card.style.top = y2 + "px";
  card.style[paddingMap[dir]] = offset + "px";
}
function escHtml(str) {
  var htmlEntities = {
    "&": "&amp;",
    "<": "&lt;",
    ">": "&gt;",
    '"': "&quot;",
    "'": "&#39;",
    "`": "&#x60;"
  };
  return str.replace(/&(amp|lt|gt|quot|#39|x60);|[\&<>"'`]/g, function(match2) {
    return match2[0] === "&" ? match2 : htmlEntities[match2];
  });
}
function escUrl(url) {
  return encodeURI(url);
}
function addQueryArg(url, key, value) {
  var _url$split = url.split("?"), baseUrl = _url$split[0], queryStr = _url$split[1];
  var queryParams = new URLSearchParams(queryStr || "");
  queryParams.set(key, value);
  return baseUrl + "?" + queryParams.toString();
}
function __t(i18n, key) {
  return i18n[key] || key;
}
var _Hovercards;
function _extends() {
  return _extends = Object.assign ? Object.assign.bind() : function(n2) {
    for (var e2 = 1; e2 < arguments.length; e2++) {
      var t2 = arguments[e2];
      for (var r3 in t2) ({}).hasOwnProperty.call(t2, r3) && (n2[r3] = t2[r3]);
    }
    return n2;
  }, _extends.apply(null, arguments);
}
var BASE_API_URL = "https://api.gravatar.com/v3/profiles";
var dc = document;
var Hovercards = /* @__PURE__ */ (function() {
  function Hovercards2(_temp) {
    var _this = this;
    var _ref = _temp === void 0 ? {} : _temp, _ref$placement = _ref.placement, placement = _ref$placement === void 0 ? "right-start" : _ref$placement, _ref$offset = _ref.offset, offset = _ref$offset === void 0 ? 10 : _ref$offset, _ref$autoFlip = _ref.autoFlip, autoFlip = _ref$autoFlip === void 0 ? true : _ref$autoFlip, _ref$autoShift = _ref.autoShift, autoShift = _ref$autoShift === void 0 ? true : _ref$autoShift, _ref$hideOnTargetClic = _ref.hideOnTargetClick, hideOnTargetClick = _ref$hideOnTargetClic === void 0 ? false : _ref$hideOnTargetClic, _ref$delayToShow = _ref.delayToShow, delayToShow = _ref$delayToShow === void 0 ? 500 : _ref$delayToShow, _ref$delayToHide = _ref.delayToHide, delayToHide = _ref$delayToHide === void 0 ? 300 : _ref$delayToHide, _ref$additionalClass = _ref.additionalClass, additionalClass = _ref$additionalClass === void 0 ? "" : _ref$additionalClass, _ref$myHash = _ref.myHash, myHash = _ref$myHash === void 0 ? "" : _ref$myHash, _ref$onQueryHovercard = _ref.onQueryHovercardRef, onQueryHovercardRef = _ref$onQueryHovercard === void 0 ? function(ref) {
      return ref;
    } : _ref$onQueryHovercard, _ref$onFetchProfileSt = _ref.onFetchProfileStart, onFetchProfileStart = _ref$onFetchProfileSt === void 0 ? function() {
    } : _ref$onFetchProfileSt, _ref$onFetchProfileSu = _ref.onFetchProfileSuccess, onFetchProfileSuccess = _ref$onFetchProfileSu === void 0 ? function() {
    } : _ref$onFetchProfileSu, _ref$onFetchProfileFa = _ref.onFetchProfileFailure, onFetchProfileFailure = _ref$onFetchProfileFa === void 0 ? function() {
    } : _ref$onFetchProfileFa, _ref$onHovercardShown = _ref.onHovercardShown, onHovercardShown = _ref$onHovercardShown === void 0 ? function() {
    } : _ref$onHovercardShown, _ref$onHovercardHidde = _ref.onHovercardHidden, onHovercardHidden = _ref$onHovercardHidde === void 0 ? function() {
    } : _ref$onHovercardHidde, _ref$onCanShowHoverca = _ref.onCanShowHovercard, onCanShowHovercard = _ref$onCanShowHoverca === void 0 ? function() {
      return true;
    } : _ref$onCanShowHoverca, _ref$i18n = _ref.i18n, i18n = _ref$i18n === void 0 ? {} : _ref$i18n;
    this._i18n = {};
    this._hovercardRefs = [];
    this._showHovercardTimeoutIds = /* @__PURE__ */ new Map();
    this._hideHovercardTimeoutIds = /* @__PURE__ */ new Map();
    this._cachedProfiles = /* @__PURE__ */ new Map();
    this.attach = function(target, _temp2) {
      var _ref2 = _temp2 === void 0 ? {} : _temp2, _ref2$dataAttributeNa = _ref2.dataAttributeName, dataAttributeName = _ref2$dataAttributeNa === void 0 ? "gravatar-hash" : _ref2$dataAttributeNa, ignoreSelector = _ref2.ignoreSelector;
      if (!target) {
        return;
      }
      _this.detach();
      _this._queryHovercardRefs(target, dataAttributeName, ignoreSelector).forEach(function(hovercardRef) {
        hovercardRef.ref.addEventListener("mouseenter", hovercardRef.onEnter);
        hovercardRef.ref.addEventListener("mouseleave", hovercardRef.onLeave);
        hovercardRef.ref.addEventListener("click", hovercardRef.onClick);
      });
    };
    this.detach = function() {
      if (!_this._hovercardRefs.length) {
        return;
      }
      _this._hovercardRefs.forEach(function(hovercardRef) {
        var _dc$getElementById;
        hovercardRef.ref.removeEventListener("mouseenter", hovercardRef.onEnter);
        hovercardRef.ref.removeEventListener("mouseleave", hovercardRef.onLeave);
        hovercardRef.ref.removeEventListener("click", hovercardRef.onClick);
        clearInterval(_this._showHovercardTimeoutIds.get(hovercardRef.id));
        (_dc$getElementById = dc.getElementById(hovercardRef.id)) == null || _dc$getElementById.remove();
      });
      _this._hovercardRefs = [];
    };
    this._placement = placement;
    this._offset = offset;
    this._autoFlip = autoFlip;
    this._autoShift = autoShift;
    this._hideOnTargetClick = hideOnTargetClick;
    this._delayToShow = delayToShow;
    this._delayToHide = delayToHide;
    this._additionalClass = additionalClass;
    this._myHash = myHash;
    this._onQueryHovercardRef = onQueryHovercardRef;
    this._onFetchProfileStart = onFetchProfileStart;
    this._onFetchProfileSuccess = onFetchProfileSuccess;
    this._onFetchProfileFailure = onFetchProfileFailure;
    this._onHovercardShown = onHovercardShown;
    this._onHovercardHidden = onHovercardHidden;
    this._canShowHovercard = onCanShowHovercard;
    this._i18n = i18n;
  }
  var _proto = Hovercards2.prototype;
  _proto._queryHovercardRefs = function _queryHovercardRefs(target, dataAttributeName, ignoreSelector) {
    var _this2 = this;
    var refs = [];
    var camelAttrName = dataAttributeName.replace(/-([a-z])/g, function(g2) {
      return g2[1].toUpperCase();
    });
    var ignoreRefs = ignoreSelector ? Array.from(dc.querySelectorAll(ignoreSelector)) : [];
    var matchPath = "gravatar.com/avatar/";
    if (camelAttrName && target.dataset[camelAttrName] || target.tagName === "IMG" && target.src.includes(matchPath)) {
      refs = [target];
    } else {
      refs = Array.from(target.querySelectorAll('img[src*="' + matchPath + '"]'));
      if (dataAttributeName) {
        refs = [].concat(refs.filter(function(img) {
          return !img.hasAttribute("data-" + dataAttributeName);
        }), Array.from(target.querySelectorAll("[data-" + dataAttributeName + "]")));
      }
    }
    this._hovercardRefs = refs.map(function(ref, idx) {
      if (ignoreRefs.includes(ref)) {
        return null;
      }
      var hash;
      var params;
      var dataAttrValue = ref.dataset[camelAttrName];
      if (dataAttrValue) {
        var part = dataAttrValue.split("?");
        hash = part[0];
        params = part.length > 1 ? part[1] : "";
      } else if (ref.tagName === "IMG") {
        var _part = ref.src.split("/").pop().split("?");
        hash = _part[0];
        params = _part.length > 1 ? _part[1] : "";
      }
      if (!hash) {
        return null;
      }
      var p2 = new URLSearchParams(params);
      var d2 = p2.get("d") || p2.get("default");
      var f2 = p2.get("f") || p2.get("forcedefault");
      var r3 = p2.get("r") || p2.get("rating");
      var initials = p2.get("initials");
      var name = p2.get("name");
      var txtColor = p2.get("txt_color");
      var bgColor = p2.get("bg_color");
      params = [d2 && "d=" + d2, f2 && "f=" + f2, r3 && "r=" + r3, initials && "initials=" + initials, name && "name=" + name, txtColor && "txt_color=" + txtColor, bgColor && "bg_color=" + bgColor].filter(Boolean).join("&");
      return {
        id: "gravatar-hovercard-" + hash + "-" + idx,
        hash,
        params: params ? "?" + params : "",
        ref: _this2._onQueryHovercardRef(ref) || ref
      };
    }).filter(Boolean).map(function(hovercardRef) {
      return _extends({}, hovercardRef, {
        onEnter: function onEnter(e2) {
          return _this2._handleMouseEnter(e2, hovercardRef);
        },
        onLeave: function onLeave(e2) {
          return _this2._handleMouseLeave(e2, hovercardRef);
        },
        onClick: function onClick() {
          return _this2._handleMouseClick(hovercardRef);
        }
      });
    });
    return this._hovercardRefs;
  };
  Hovercards2._createDrawer = function _createDrawer(name, titleText, content) {
    return '\n			<div class="gravatar-hovercard__drawer" data-drawer-name="' + name + '">\n				<div class="gravatar-hovercard__drawer-backdrop" data-target-drawer="' + name + '"></div>\n				<div class="gravatar-hovercard__drawer-card">\n					<div class="gravatar-hovercard__drawer-header">\n						<h2 class="gravatar-hovercard__drawer-title">' + titleText + '</h2>\n						<button class="gravatar-hovercard__drawer-close" data-target-drawer="' + name + '">\n							<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n								<path d="M12 13.0607L15.7123 16.773L16.773 15.7123L13.0607 12L16.773 8.28772L15.7123 7.22706L12 10.9394L8.28771 7.22705L7.22705 8.28771L10.9394 12L7.22706 15.7123L8.28772 16.773L12 13.0607Z" fill="#101517"></path>\n							</svg>\n						</button>\n					</div>\n					<ul class="gravatar-hovercard__drawer-items">\n						' + content + "\n					</ul>\n				</div>\n			</div>\n		";
  };
  Hovercards2._openDrawer = function _openDrawer(target, container) {
    var drawer = container.querySelector('.gravatar-hovercard__drawer[data-drawer-name="' + target.dataset.targetDrawer + '"]');
    if (!drawer) {
      return;
    }
    drawer.classList.add("gravatar-hovercard__drawer--open");
  };
  Hovercards2._closeDrawer = function _closeDrawer(target, container) {
    var drawer = container.querySelector('.gravatar-hovercard__drawer[data-drawer-name="' + target.dataset.targetDrawer + '"]');
    if (!drawer) {
      return;
    }
    drawer.classList.add("gravatar-hovercard__drawer--closing");
    drawer.classList.remove("gravatar-hovercard__drawer--open");
    setTimeout(function() {
      drawer.classList.remove("gravatar-hovercard__drawer--closing");
    }, 300);
  };
  Hovercards2._createContactDrawerContent = function _createContactDrawerContent(contactsData, _temp3) {
    var _ref3 = _temp3 === void 0 ? {} : _temp3, _ref3$i18n = _ref3.i18n, i18n = _ref3$i18n === void 0 ? {} : _ref3$i18n;
    var icons = {
      email: "icons/mail.svg",
      home_phone: "icons/home-phone.svg",
      work_phone: "icons/work-phone.svg",
      cell_phone: "icons/mobile-phone.svg",
      contact_form: "icons/envelope.svg",
      calendar: "icons/calendar.svg",
      calendly: "icons/calendly.svg"
    };
    var labels = {
      email: __t(i18n, "Email"),
      home_phone: __t(i18n, "Home Phone"),
      work_phone: __t(i18n, "Work Phone"),
      cell_phone: __t(i18n, "Cell Phone"),
      contact_form: __t(i18n, "Contact Form"),
      calendar: __t(i18n, "Calendar")
    };
    var getUrl = function getUrl2(type, value) {
      switch (type) {
        case "email":
          return "mailto:" + value;
        case "contact_form":
        case "calendar":
        case "calendly":
          return value.startsWith("http") ? value : "https://" + value;
        default:
          return null;
      }
    };
    var items = contactsData.map(function(_ref4) {
      var _labels$key;
      var key = _ref4[0], value = _ref4[1];
      var url = getUrl(key, value);
      var text = value.replace(/^(https?:\/\/)?(www\.)?/, "");
      text = text.endsWith("/") ? text.slice(0, -1) : text;
      if (url) {
        text = '<a class="gravatar-hovercard__drawer-item-link" href="' + url + '" target="_blank">' + text + "</a>";
      }
      return '\n				<li class="gravatar-hovercard__drawer-item">\n					<img\n						class="gravatar-hovercard__drawer-item-icon"\n						width="24"\n						height="24"\n						src="https://s.gravatar.com/' + icons[key] + '"\n						alt=""\n					>\n					<div class="gravatar-hovercard__drawer-item-info">\n						<span class="gravatar-hovercard__drawer-item-label">' + ((_labels$key = labels[key]) != null ? _labels$key : key.replace("_", " ")) + '</span>\n						<span class="gravatar-hovercard__drawer-item-text">' + text + "</span>\n					</div>\n				</li>\n			";
    });
    return items.join("");
  };
  Hovercards2._createSendMoneyDrawerContent = function _createSendMoneyDrawerContent(payments) {
    var _payments$links, _payments$crypto_wall;
    var items = [];
    (_payments$links = payments.links) == null || _payments$links.forEach(function(item) {
      items.push('\n				<li class="gravatar-hovercard__drawer-item">\n					<img class="gravatar-hovercard__drawer-item-icon" width="24" height="24" src="https://s.gravatar.com/icons/link.svg" alt="">\n					<div class="gravatar-hovercard__drawer-item-info">\n						<span class="gravatar-hovercard__drawer-item-label">' + item.label + '</span>\n						<span class="gravatar-hovercard__drawer-item-text">\n							<a class="gravatar-hovercard__drawer-item-link" href="' + item.url + '" target="_blank">\n								' + item.url.replace(/^(https?:\/\/)/, "") + "\n							</a>\n						</span>\n					</div>\n				</li>\n			");
    });
    (_payments$crypto_wall = payments.crypto_wallets) == null || _payments$crypto_wall.forEach(function(item) {
      items.push('\n				<li class="gravatar-hovercard__drawer-item">\n					<img class="gravatar-hovercard__drawer-item-icon" width="24" height="24" src="https://s.gravatar.com/icons/link.svg" alt="">\n					<div class="gravatar-hovercard__drawer-item-info">\n						<span class="gravatar-hovercard__drawer-item-label">' + item.label + '</span>\n						<span class="gravatar-hovercard__drawer-item-text">' + item.address + "</span>\n					</div>\n				</li>\n			");
    });
    return items.join("");
  };
  _proto._showHovercard = function _showHovercard(_ref5) {
    var _this3 = this;
    var id = _ref5.id, hash = _ref5.hash, params = _ref5.params, ref = _ref5.ref;
    var timeoutId = setTimeout(function() {
      if (dc.getElementById(id)) {
        return;
      }
      if (!_this3._canShowHovercard(hash)) {
        return;
      }
      var urlParams = new URLSearchParams(params);
      urlParams["delete"]("size");
      urlParams.set("s", "256");
      params = "?" + urlParams.toString();
      var hovercard;
      var positionOptions = {
        placement: _this3._placement,
        offset: _this3._offset,
        autoFlip: _this3._autoFlip,
        autoShift: _this3._autoShift
      };
      if (_this3._cachedProfiles.has(hash)) {
        var profile = _this3._cachedProfiles.get(hash);
        hovercard = Hovercards2.createHovercard(_extends({}, profile, {
          avatarUrl: profile.avatarUrl + params
        }), {
          additionalClass: _this3._additionalClass,
          myHash: _this3._myHash,
          i18n: _this3._i18n
        });
        _this3._onHovercardShown(hash, hovercard);
      } else {
        hovercard = Hovercards2.createHovercardSkeleton({
          additionalClass: _this3._additionalClass
        });
        _this3._onFetchProfileStart(hash);
        fetch(addQueryArg(BASE_API_URL + "/" + hash, "source", "hovercard")).then(function(res) {
          if (res.status !== 200) {
            throw res.status;
          }
          return res.json();
        }).then(function(data) {
          var _data$verified_accoun;
          _this3._cachedProfiles.set(hash, {
            hash: data.hash,
            avatarUrl: data.avatar_url,
            profileUrl: data.profile_url,
            displayName: data.display_name,
            location: data.location,
            description: data.description,
            jobTitle: data.job_title,
            company: data.company,
            headerImage: data.header_image,
            hideDefaultHeaderImage: data.hide_default_header_image,
            backgroundColor: data.background_color,
            verifiedAccounts: (_data$verified_accoun = data.verified_accounts) == null ? void 0 : _data$verified_accoun.map(function(account) {
              return {
                type: account.service_type,
                label: account.service_label,
                icon: account.service_icon,
                url: account.url,
                isHidden: account.is_hidden
              };
            }),
            contactInfo: data.contact_info,
            payments: data.payments
          });
          var profile2 = _this3._cachedProfiles.get(hash);
          var hovercardInner = Hovercards2.createHovercard(_extends({}, profile2, {
            avatarUrl: profile2.avatarUrl + params
          }), {
            additionalClass: _this3._additionalClass,
            myHash: _this3._myHash,
            i18n: _this3._i18n
          }).firstElementChild;
          hovercard.classList.remove("gravatar-hovercard--skeleton");
          hovercard.replaceChildren(hovercardInner);
          assignPosition(ref, hovercard, positionOptions);
          _this3._onFetchProfileSuccess(hash, _this3._cachedProfiles.get(hash));
          _this3._onHovercardShown(hash, hovercard);
        })["catch"](function(code) {
          var message2 = __t(_this3._i18n, "Sorry, we are unable to load this Gravatar profile.");
          switch (code) {
            case 404:
              message2 = __t(_this3._i18n, "Gravatar not found.");
              break;
            case 429:
              message2 = __t(_this3._i18n, "Too Many Requests.");
              break;
            case 500:
              message2 = __t(_this3._i18n, "Internal Server Error.");
              break;
          }
          var additionalMessage = code === 404 ? '\n								<i class="gravatar-hovercard__error-message gravatar-hovercard__error-message--claim-gravatar">\n									' + __t(_this3._i18n, "Is this you?") + ' \n									<a href="https://gravatar.com/signup?utm_source=hovercard" target="_blank">\n										' + __t(_this3._i18n, "Claim your free profile.") + "\n									</a>\n								</i>\n								" : "";
          var hovercardInner = Hovercards2.createHovercardError("https://0.gravatar.com/avatar/" + hash + params, message2, {
            additionalClass: _this3._additionalClass,
            additionalMessage
          }).firstElementChild;
          hovercard.classList.add("gravatar-hovercard--error");
          hovercard.classList.remove("gravatar-hovercard--skeleton");
          hovercard.replaceChildren(hovercardInner);
          _this3._onFetchProfileFailure(hash, {
            code,
            message: message2
          });
        });
      }
      hovercard.id = id;
      hovercard.addEventListener("mouseenter", function() {
        return clearInterval(_this3._hideHovercardTimeoutIds.get(id));
      });
      hovercard.addEventListener("mouseleave", function() {
        return _this3._hideHovercard(id);
      });
      dc.body.appendChild(hovercard);
      assignPosition(ref, hovercard, positionOptions);
    }, this._delayToShow);
    this._showHovercardTimeoutIds.set(id, timeoutId);
  };
  _proto._hideHovercard = function _hideHovercard(id, delay) {
    var _this4 = this;
    if (delay === void 0) {
      delay = this._delayToHide;
    }
    var timeoutId = setTimeout(function() {
      var hovercard = dc.getElementById(id);
      if (hovercard) {
        hovercard.remove();
        _this4._onHovercardHidden(id, hovercard);
      }
    }, delay);
    this._hideHovercardTimeoutIds.set(id, timeoutId);
  };
  _proto._handleMouseEnter = function _handleMouseEnter(e2, hovercardRef) {
    if ("ontouchstart" in dc) {
      return;
    }
    e2.stopImmediatePropagation();
    clearInterval(this._hideHovercardTimeoutIds.get(hovercardRef.id));
    this._showHovercard(hovercardRef);
  };
  _proto._handleMouseLeave = function _handleMouseLeave(e2, _ref6) {
    var id = _ref6.id;
    if ("ontouchstart" in dc) {
      return;
    }
    e2.stopImmediatePropagation();
    clearInterval(this._showHovercardTimeoutIds.get(id));
    this._hideHovercard(id);
  };
  _proto._handleMouseClick = function _handleMouseClick(_ref7) {
    var id = _ref7.id;
    if ("ontouchstart" in dc || !this._hideOnTargetClick) {
      return;
    }
    clearInterval(this._showHovercardTimeoutIds.get(id));
    this._hideHovercard(id, 0);
  };
  return Hovercards2;
})();
_Hovercards = Hovercards;
Hovercards.createHovercard = function(profileData, _temp4) {
  var _payments$links2, _payments$crypto_wall2;
  var _ref8 = _temp4 === void 0 ? {} : _temp4, additionalClass = _ref8.additionalClass, myHash = _ref8.myHash, _ref8$i18n = _ref8.i18n, i18n = _ref8$i18n === void 0 ? {} : _ref8$i18n;
  var hash = profileData.hash, avatarUrl = profileData.avatarUrl, profileUrl = profileData.profileUrl, displayName = profileData.displayName, location = profileData.location, description = profileData.description, jobTitle = profileData.jobTitle, company = profileData.company, headerImage = profileData.headerImage, hideDefaultHeaderImage = profileData.hideDefaultHeaderImage, _profileData$verified = profileData.verifiedAccounts, verifiedAccounts = _profileData$verified === void 0 ? [] : _profileData$verified, payments = profileData.payments, contactInfo = profileData.contactInfo, backgroundColor = profileData.backgroundColor;
  var hovercard = dc.createElement("div");
  hovercard.className = "gravatar-hovercard" + (additionalClass ? " " + additionalClass : "");
  var calendly = verifiedAccounts.find(function(account) {
    return account.type === "calendly" && !account.isHidden;
  });
  if (contactInfo && calendly) {
    contactInfo.calendly = calendly.url;
  }
  var trackedProfileUrl = escUrl(addQueryArg(profileUrl, "utm_source", "hovercard"));
  var username = escHtml(displayName);
  var isEditProfile = !description && myHash === hash;
  var jobInfo = [jobTitle, company].filter(Boolean).join(", ");
  var hasPayments = (payments == null || (_payments$links2 = payments.links) == null ? void 0 : _payments$links2.length) || (payments == null || (_payments$crypto_wall2 = payments.crypto_wallets) == null ? void 0 : _payments$crypto_wall2.length);
  var nonEmptyContacts = Object.entries(contactInfo || {}).filter(function(_ref9) {
    var _ = _ref9[0], value = _ref9[1];
    return !!value;
  });
  var renderSocialLinks = verifiedAccounts.slice(0, 3).reduce(function(links, _ref10) {
    var label = _ref10.label, icon15 = _ref10.icon, url = _ref10.url, type = _ref10.type, isHidden2 = _ref10.isHidden;
    if (isHidden2) {
      return links;
    }
    links.push('\n					<a class="gravatar-hovercard__social-link" href="' + escUrl(url) + '" target="_blank" data-service-name="' + type + '">\n						<img class="gravatar-hovercard__social-icon" src="' + escUrl(icon15) + '" width="32" height="32" alt="' + escHtml(label) + '" />\n					</a>\n				');
    return links;
  }, []).join("");
  var headerImageHtml = "";
  var ctaButtons = "";
  var contactsDrawer = "";
  var sendMoneyDrawer = "";
  if (headerImage || !hideDefaultHeaderImage) {
    var img = '<img class="gravatar-hovercard__header-image-img" src="' + escUrl(avatarUrl) + '" alt=""/>';
    headerImageHtml = '<div class="gravatar-hovercard__header-image">' + (!headerImage ? img : "") + "</div>";
  }
  if (nonEmptyContacts.length || hasPayments) {
    if (nonEmptyContacts.length) {
      ctaButtons += '\n					<button class="gravatar-hovercard__button" data-target-drawer="contact">' + __t(i18n, "Contact") + "</button>\n				";
      contactsDrawer = _Hovercards._createDrawer("contact", __t(i18n, "Contact"), _Hovercards._createContactDrawerContent(nonEmptyContacts, {
        i18n
      }));
    }
    if (hasPayments) {
      ctaButtons += '\n					<button class="gravatar-hovercard__button" data-target-drawer="send-money">' + __t(i18n, "Send money") + "</button>\n				";
      sendMoneyDrawer = _Hovercards._createDrawer("send-money", __t(i18n, "Send money"), _Hovercards._createSendMoneyDrawerContent(payments));
    }
    ctaButtons = '\n				<div class="gravatar-hovercard__buttons">' + ctaButtons + "</div>\n			";
  }
  hovercard.innerHTML = '\n			<div class="gravatar-hovercard__inner">\n				' + headerImageHtml + '\n				<div class="gravatar-hovercard__header">\n					<a class="gravatar-hovercard__avatar-link" href="' + trackedProfileUrl + '" target="_blank">\n						<img class="gravatar-hovercard__avatar" src="' + escUrl(avatarUrl) + '" width="104" height="104" alt="' + username + '" />\n					</a>\n					<a class="gravatar-hovercard__personal-info-link" href="' + trackedProfileUrl + '" target="_blank">\n						<h4 class="gravatar-hovercard__name">' + username + "</h4>\n						" + (jobInfo ? '<p class="gravatar-hovercard__job">' + escHtml(jobInfo) + "</p>" : "") + "\n						" + (location ? '<p class="gravatar-hovercard__location">' + escHtml(location) + "</p>" : "") + "\n					</a>\n				</div>\n				" + (description ? '<div class="gravatar-hovercard__body">\n								<p class="gravatar-hovercard__description">' + escHtml(description) + "</p>\n							</div>" : "") + '\n				<div class="gravatar-hovercard__social-links">\n					<a class="gravatar-hovercard__social-link" href="' + trackedProfileUrl + '" target="_blank" data-service-name="gravatar">\n						<img class="gravatar-hovercard__social-icon" src="https://s.gravatar.com/icons/gravatar.svg" width="32" height="32" alt="Gravatar" />\n					</a>\n					' + renderSocialLinks + "\n				</div>\n				" + ctaButtons + '\n				<div class="gravatar-hovercard__footer">\n					<a class="gravatar-hovercard__profile-url" title="' + profileUrl + '" href="' + trackedProfileUrl + '" target="_blank">\n						' + profileUrl.replace("https://", "") + '\n					</a>\n					<a\n						class="gravatar-hovercard__profile-link' + (isEditProfile ? " gravatar-hovercard__profile-link--edit" : "") + '"\n						href="' + (isEditProfile ? "https://gravatar.com/profiles/edit?utm_source=hovercard" : trackedProfileUrl) + '"\n						target="_blank"\n					>\n						' + (isEditProfile ? __t(i18n, "Edit your profile \u2192") : __t(i18n, "View profile \u2192")) + "\n					</a>\n				</div>\n				" + contactsDrawer + "\n				" + sendMoneyDrawer + "\n				" + (backgroundColor ? '<div class="gravatar-hovercard__profile-color"></div>' : "") + "\n			</div>\n		";
  var hovercardInner = hovercard.querySelector(".gravatar-hovercard__inner");
  var headerImageEl = hovercardInner.querySelector(".gravatar-hovercard__header-image");
  var profileColorEl = hovercardInner.querySelector(".gravatar-hovercard__profile-color");
  if (headerImage && headerImageEl) {
    headerImageEl.style.background = headerImage;
  }
  if (backgroundColor && profileColorEl) {
    profileColorEl.style.background = backgroundColor;
  }
  hovercardInner.querySelectorAll(".gravatar-hovercard__button").forEach(function(el) {
    el.addEventListener("click", function() {
      return _Hovercards._openDrawer(el, hovercardInner);
    });
  });
  hovercardInner.querySelectorAll(".gravatar-hovercard__drawer-close").forEach(function(el) {
    el.addEventListener("click", function() {
      return _Hovercards._closeDrawer(el, hovercardInner);
    });
  });
  hovercardInner.querySelectorAll(".gravatar-hovercard__drawer-backdrop").forEach(function(el) {
    el.addEventListener("click", function() {
      return _Hovercards._closeDrawer(el, hovercardInner);
    });
  });
  return hovercard;
};
Hovercards.createHovercardSkeleton = function(_temp5) {
  var _ref11 = _temp5 === void 0 ? {} : _temp5, additionalClass = _ref11.additionalClass;
  var hovercard = dc.createElement("div");
  hovercard.className = "gravatar-hovercard gravatar-hovercard--skeleton" + (additionalClass ? " " + additionalClass : "");
  hovercard.innerHTML = '\n			<div class="gravatar-hovercard__inner">\n				<div class="gravatar-hovercard__header">\n					<div class="gravatar-hovercard__avatar-link"></div>\n					<div class="gravatar-hovercard__personal-info-link"></div>\n				</div>\n				<div class="gravatar-hovercard__social-links">\n					<div class="gravatar-hovercard__social-link"></div>\n					<div class="gravatar-hovercard__social-link"></div>\n				</div>\n				<div class="gravatar-hovercard__footer">\n					<div class="gravatar-hovercard__profile-url"></div>\n					<div class="gravatar-hovercard__profile-link"></div>\n				</div>\n			</div>\n		';
  return hovercard;
};
Hovercards.createHovercardError = function(avatarUrl, message2, _temp6) {
  var _ref12 = _temp6 === void 0 ? {} : _temp6, _ref12$avatarAlt = _ref12.avatarAlt, avatarAlt = _ref12$avatarAlt === void 0 ? "Avatar" : _ref12$avatarAlt, additionalClass = _ref12.additionalClass, _ref12$additionalMess = _ref12.additionalMessage, additionalMessage = _ref12$additionalMess === void 0 ? "" : _ref12$additionalMess;
  var hovercard = dc.createElement("div");
  hovercard.className = "gravatar-hovercard gravatar-hovercard--error" + (additionalClass ? " " + additionalClass : "");
  hovercard.innerHTML = '\n			<div class="gravatar-hovercard__inner">\n				<img class="gravatar-hovercard__avatar" src="' + avatarUrl + '" width="104" height="104" alt="' + avatarAlt + '" />\n				<div class="gravatar-hovercard__error-message-wrapper">\n					<i class="gravatar-hovercard__error-message">' + message2 + "</i>\n					" + additionalMessage + "\n				</div>\n			</div>\n		";
  return hovercard;
};
var __webpack_exports__Hovercards = __webpack_exports__.S;

// ../../../node_modules/.pnpm/@gravatar-com+hovercards@0.15.0/node_modules/@gravatar-com/hovercards/dist/style.css
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='7b5ece90c6']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "7b5ece90c6");
  style.appendChild(document.createTextNode(".gravatar-hovercard{color:#000;display:inline-block;font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:14px;line-height:1.5;z-index:10000000}.gravatar-hovercard,.gravatar-hovercard:after,.gravatar-hovercard:before{box-sizing:border-box}.gravatar-hovercard *{appearance:none;-webkit-appearance:none;-moz-appearance:none;background:transparent;border:0;box-sizing:inherit;color:inherit;font:inherit;line-height:inherit;list-style:none;margin:0;padding:0;vertical-align:baseline}.gravatar-hovercard a{cursor:pointer;text-decoration:none}.gravatar-hovercard button{background:none;border:none;cursor:pointer;padding:0}.gravatar-hovercard img,.gravatar-hovercard svg{display:block;height:auto;max-width:100%}.gravatar-hovercard a:focus-visible,.gravatar-hovercard button:focus-visible{outline:2px solid revert}.gravatar-hovercard .gravatar-hovercard__inner{background-color:#fff;border:1px solid #d8dbdd;border-radius:4px;box-shadow:0 2px 6px rgba(0,0,0,.08);display:flex;flex-direction:column;justify-content:space-between;min-height:273px;overflow:hidden;padding:24px 24px 16px;position:relative;width:336px}.gravatar-hovercard .gravatar-hovercard__header-image{height:75px;left:50%;overflow-y:hidden;position:absolute;top:0;transform:translateX(-50%);width:100%}.gravatar-hovercard .gravatar-hovercard__header-image-img{filter:blur(40px);-o-object-fit:cover;object-fit:cover;transform:translateY(-30%);width:100%}.gravatar-hovercard .gravatar-hovercard__header{display:flex;flex-direction:column;gap:8px;z-index:1}.gravatar-hovercard .gravatar-hovercard__avatar-link{width:-moz-fit-content;width:fit-content}.gravatar-hovercard .gravatar-hovercard__avatar{background-color:#eee;border-radius:50%}.gravatar-hovercard .gravatar-hovercard__name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:32px;font-weight:700;line-height:38px;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.gravatar-hovercard .gravatar-hovercard__job,.gravatar-hovercard .gravatar-hovercard__location{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;color:#707070;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.gravatar-hovercard .gravatar-hovercard__body{margin-top:8px}.gravatar-hovercard .gravatar-hovercard__description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;word-break:break-word}.gravatar-hovercard .gravatar-hovercard__social-links{align-items:center;display:flex;gap:4px;margin-top:16px}.gravatar-hovercard .gravatar-hovercard__buttons{display:flex;gap:16px;margin-top:16px}.gravatar-hovercard .gravatar-hovercard__button{border:1px solid rgba(29,79,196,.3);border-radius:4px;color:#1d4fc4;font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:15px;font-weight:600;line-height:21px;min-height:42px;padding:8px;width:100%}.gravatar-hovercard .gravatar-hovercard__button:hover{border:1px solid rgba(29,79,196,.6)}.gravatar-hovercard .gravatar-hovercard__footer{align-items:center;display:flex;gap:12px;justify-content:space-between;margin-top:12px}.gravatar-hovercard .gravatar-hovercard__profile-url{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;color:#707070;overflow:hidden;text-overflow:ellipsis;word-break:break-word;word-break:break-all}.gravatar-hovercard .gravatar-hovercard__profile-link{color:#707070;flex-shrink:0}.gravatar-hovercard .gravatar-hovercard__profile-color{bottom:0;height:4px;left:0;position:absolute;width:100%}.gravatar-hovercard--skeleton .gravatar-hovercard__avatar-link,.gravatar-hovercard--skeleton .gravatar-hovercard__personal-info-link,.gravatar-hovercard--skeleton .gravatar-hovercard__profile-link,.gravatar-hovercard--skeleton .gravatar-hovercard__profile-url,.gravatar-hovercard--skeleton .gravatar-hovercard__social-link{background-color:#eee}.gravatar-hovercard--skeleton .gravatar-hovercard__avatar-link{border-radius:50%;height:104px;width:104px}.gravatar-hovercard--skeleton .gravatar-hovercard__personal-info-link{height:38px;width:70%}.gravatar-hovercard--skeleton .gravatar-hovercard__social-link{border-radius:50%;height:32px;width:32px}.gravatar-hovercard--skeleton .gravatar-hovercard__profile-url{height:21px;width:50%}.gravatar-hovercard--skeleton .gravatar-hovercard__profile-link{height:21px;width:96px}.gravatar-hovercard--error .gravatar-hovercard__inner{align-items:center;gap:34px;justify-content:center}.gravatar-hovercard--error .gravatar-hovercard__error-message-wrapper{align-items:center;display:flex;flex-direction:column}.gravatar-hovercard--error .gravatar-hovercard__error-message{color:#707070}.gravatar-hovercard--error .gravatar-hovercard__error-message.gravatar-hovercard__error-message--claim-gravatar a{text-decoration:underline}.gravatar-hovercard__drawer{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;visibility:hidden;z-index:1}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-backdrop{background-color:rgba(0,0,0,.4);bottom:0;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s ease-in-out}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-card{background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;bottom:0;display:flex;flex-direction:column;left:0;max-height:100%;padding:20px 0;position:absolute;transform:translate3d(0,100%,0);transition:transform .3s ease-in-out;width:100%}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-header{align-items:center;display:flex;justify-content:space-between;margin-bottom:16px;padding:0 20px}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-title{font-family:SF Pro Text,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:18px;font-weight:700;line-height:27px}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-close{align-items:center;display:flex;justify-content:center}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-items{display:flex;flex-direction:column;gap:12px;overflow-y:auto;padding:0 20px}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-item{align-items:start;display:flex;gap:8px}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-item-info{display:flex;flex-direction:column}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-item-label{font-weight:600;line-height:24px;text-transform:capitalize}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-item-link{color:#1d4fc4}.gravatar-hovercard__drawer .gravatar-hovercard__drawer-item-link:hover{text-decoration:underline}.gravatar-hovercard__drawer.gravatar-hovercard__drawer--open{visibility:visible}.gravatar-hovercard__drawer.gravatar-hovercard__drawer--open .gravatar-hovercard__drawer-backdrop{opacity:1}.gravatar-hovercard__drawer.gravatar-hovercard__drawer--open .gravatar-hovercard__drawer-card{transform:translateZ(0)}.gravatar-hovercard__drawer.gravatar-hovercard__drawer--closing{visibility:visible}.gravatar-hovercard__drawer.gravatar-hovercard__drawer--closing .gravatar-hovercard__drawer-backdrop{opacity:0}.gravatar-hovercard__drawer.gravatar-hovercard__drawer--closing .gravatar-hovercard__drawer-card{transform:translate3d(0,100%,0)}"));
  document.head.appendChild(style);
}

// src/dashboard/components/gravatar/index.tsx
var import_element75 = __toESM(require_element(), 1);
var import_i18n63 = __toESM(require_i18n(), 1);
var import_js_sha256 = __toESM(require_sha256(), 1);

// src/dashboard/components/gravatar/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='0e4c753bda']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "0e4c753bda");
  style.appendChild(document.createTextNode(".jp-forms__gravatar{background-color:var(--jp-gray-5);border-radius:50%;flex-shrink:0;overflow:hidden}"));
  document.head.appendChild(style);
}

// src/dashboard/components/gravatar/index.tsx
var import_jsx_runtime145 = __toESM(require_jsx_runtime(), 1);
function Gravatar({
  defaultImage = "initials",
  displayName,
  email,
  size = 48,
  useHovercard = true
}) {
  const profileImageRef = (0, import_element75.useRef)(null);
  const hovercardRef = (0, import_element75.useRef)(null);
  (0, import_element75.useEffect)(() => {
    if (useHovercard && profileImageRef.current) {
      hovercardRef.current = new __webpack_exports__Hovercards({
        // Documented at https://github.com/Automattic/gravatar/tree/trunk/web/packages/hovercards#translations
        i18n: {
          "Edit your profile \u2192": (0, import_i18n63.__)("Edit your profile \u2192", "jetpack-forms"),
          "View profile \u2192": (0, import_i18n63.__)("View profile \u2192", "jetpack-forms"),
          Contact: (0, import_i18n63.__)("Contact", "jetpack-forms"),
          "Send money": (0, import_i18n63.__)("Send money", "jetpack-forms"),
          "Sorry, we are unable to load this Gravatar profile.": (0, import_i18n63.__)(
            "Sorry, we are unable to load this Gravatar profile.",
            "jetpack-forms"
          ),
          "Gravatar not found.": (0, import_i18n63.__)("Gravatar not found.", "jetpack-forms"),
          "Too Many Requests.": (0, import_i18n63.__)("Too many requests.", "jetpack-forms"),
          "Internal Server Error.": (0, import_i18n63.__)("Internal server error.", "jetpack-forms"),
          "Is this you?": (0, import_i18n63.__)("Is this you?", "jetpack-forms"),
          "Claim your free profile.": (0, import_i18n63.__)("Claim your free profile.", "jetpack-forms"),
          Email: (0, import_i18n63.__)("Email", "jetpack-forms"),
          "Home Phone": (0, import_i18n63.__)("Home phone", "jetpack-forms"),
          "Work Phone": (0, import_i18n63.__)("Work phone", "jetpack-forms"),
          "Cell Phone": (0, import_i18n63.__)("Cell phone", "jetpack-forms"),
          "Contact Form": (0, import_i18n63.__)("Contact form", "jetpack-forms"),
          Calendar: (0, import_i18n63.__)("Calendar", "jetpack-forms")
        }
      });
      hovercardRef.current.attach(profileImageRef.current);
    }
  }, [useHovercard]);
  if (!email) {
    return null;
  }
  const hashedEmail = (0, import_js_sha256.sha256)(email);
  return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
    "img",
    {
      alt: displayName || "",
      className: "jp-forms__gravatar",
      ref: profileImageRef,
      src: `https://0.gravatar.com/avatar/${hashedEmail}?d=${defaultImage}&name=${displayName}`,
      width: size,
      height: size
    }
  );
}

// src/dashboard/components/text-with-flag/index.tsx
var import_components65 = __toESM(require_components(), 1);

// src/util/country-names-translated.js
var import_i18n64 = __toESM(require_i18n(), 1);
var translatedCountryNames = {
  AF: (0, import_i18n64.__)("Afghanistan", "jetpack-forms"),
  AL: (0, import_i18n64.__)("Albania", "jetpack-forms"),
  DZ: (0, import_i18n64.__)("Algeria", "jetpack-forms"),
  AS: (0, import_i18n64.__)("American Samoa", "jetpack-forms"),
  AD: (0, import_i18n64.__)("Andorra", "jetpack-forms"),
  AO: (0, import_i18n64.__)("Angola", "jetpack-forms"),
  AI: (0, import_i18n64.__)("Anguilla", "jetpack-forms"),
  AG: (0, import_i18n64.__)("Antigua and Barbuda", "jetpack-forms"),
  AR: (0, import_i18n64.__)("Argentina", "jetpack-forms"),
  AM: (0, import_i18n64.__)("Armenia", "jetpack-forms"),
  AW: (0, import_i18n64.__)("Aruba", "jetpack-forms"),
  AU: (0, import_i18n64.__)("Australia", "jetpack-forms"),
  AT: (0, import_i18n64.__)("Austria", "jetpack-forms"),
  AZ: (0, import_i18n64.__)("Azerbaijan", "jetpack-forms"),
  BS: (0, import_i18n64.__)("Bahamas", "jetpack-forms"),
  BH: (0, import_i18n64.__)("Bahrain", "jetpack-forms"),
  BD: (0, import_i18n64.__)("Bangladesh", "jetpack-forms"),
  BB: (0, import_i18n64.__)("Barbados", "jetpack-forms"),
  BY: (0, import_i18n64.__)("Belarus", "jetpack-forms"),
  BE: (0, import_i18n64.__)("Belgium", "jetpack-forms"),
  BZ: (0, import_i18n64.__)("Belize", "jetpack-forms"),
  BJ: (0, import_i18n64.__)("Benin", "jetpack-forms"),
  BM: (0, import_i18n64.__)("Bermuda", "jetpack-forms"),
  BT: (0, import_i18n64.__)("Bhutan", "jetpack-forms"),
  BO: (0, import_i18n64.__)("Bolivia", "jetpack-forms"),
  BA: (0, import_i18n64.__)("Bosnia and Herzegovina", "jetpack-forms"),
  BW: (0, import_i18n64.__)("Botswana", "jetpack-forms"),
  BR: (0, import_i18n64.__)("Brazil", "jetpack-forms"),
  IO: (0, import_i18n64.__)("British Indian Ocean Territory", "jetpack-forms"),
  VG: (0, import_i18n64.__)("British Virgin Islands", "jetpack-forms"),
  BN: (0, import_i18n64.__)("Brunei", "jetpack-forms"),
  BG: (0, import_i18n64.__)("Bulgaria", "jetpack-forms"),
  BF: (0, import_i18n64.__)("Burkina Faso", "jetpack-forms"),
  BI: (0, import_i18n64.__)("Burundi", "jetpack-forms"),
  KH: (0, import_i18n64.__)("Cambodia", "jetpack-forms"),
  CM: (0, import_i18n64.__)("Cameroon", "jetpack-forms"),
  CA: (0, import_i18n64.__)("Canada", "jetpack-forms"),
  CV: (0, import_i18n64.__)("Cape Verde", "jetpack-forms"),
  KY: (0, import_i18n64.__)("Cayman Islands", "jetpack-forms"),
  CF: (0, import_i18n64.__)("Central African Republic", "jetpack-forms"),
  TD: (0, import_i18n64.__)("Chad", "jetpack-forms"),
  CL: (0, import_i18n64.__)("Chile", "jetpack-forms"),
  CN: (0, import_i18n64.__)("China", "jetpack-forms"),
  CX: (0, import_i18n64.__)("Christmas Island", "jetpack-forms"),
  CC: (0, import_i18n64.__)("Cocos (Keeling) Islands", "jetpack-forms"),
  CO: (0, import_i18n64.__)("Colombia", "jetpack-forms"),
  KM: (0, import_i18n64.__)("Comoros", "jetpack-forms"),
  CG: (0, import_i18n64.__)("Congo - Brazzaville", "jetpack-forms"),
  CD: (0, import_i18n64.__)("Congo - Kinshasa", "jetpack-forms"),
  CK: (0, import_i18n64.__)("Cook Islands", "jetpack-forms"),
  CR: (0, import_i18n64.__)("Costa Rica", "jetpack-forms"),
  HR: (0, import_i18n64.__)("Croatia", "jetpack-forms"),
  CU: (0, import_i18n64.__)("Cuba", "jetpack-forms"),
  CY: (0, import_i18n64.__)("Cyprus", "jetpack-forms"),
  CZ: (0, import_i18n64.__)("Czech Republic", "jetpack-forms"),
  CI: (0, import_i18n64.__)("C\xF4te d'Ivoire", "jetpack-forms"),
  DK: (0, import_i18n64.__)("Denmark", "jetpack-forms"),
  DJ: (0, import_i18n64.__)("Djibouti", "jetpack-forms"),
  DM: (0, import_i18n64.__)("Dominica", "jetpack-forms"),
  DO: (0, import_i18n64.__)("Dominican Republic", "jetpack-forms"),
  EC: (0, import_i18n64.__)("Ecuador", "jetpack-forms"),
  EG: (0, import_i18n64.__)("Egypt", "jetpack-forms"),
  SV: (0, import_i18n64.__)("El Salvador", "jetpack-forms"),
  GQ: (0, import_i18n64.__)("Equatorial Guinea", "jetpack-forms"),
  ER: (0, import_i18n64.__)("Eritrea", "jetpack-forms"),
  EE: (0, import_i18n64.__)("Estonia", "jetpack-forms"),
  SZ: (0, import_i18n64.__)("Eswatini", "jetpack-forms"),
  ET: (0, import_i18n64.__)("Ethiopia", "jetpack-forms"),
  FK: (0, import_i18n64.__)("Falkland Islands", "jetpack-forms"),
  FO: (0, import_i18n64.__)("Faroe Islands", "jetpack-forms"),
  FJ: (0, import_i18n64.__)("Fiji", "jetpack-forms"),
  FI: (0, import_i18n64.__)("Finland", "jetpack-forms"),
  FR: (0, import_i18n64.__)("France", "jetpack-forms"),
  GF: (0, import_i18n64.__)("French Guiana", "jetpack-forms"),
  PF: (0, import_i18n64.__)("French Polynesia", "jetpack-forms"),
  GA: (0, import_i18n64.__)("Gabon", "jetpack-forms"),
  GM: (0, import_i18n64.__)("Gambia", "jetpack-forms"),
  GE: (0, import_i18n64.__)("Georgia", "jetpack-forms"),
  DE: (0, import_i18n64.__)("Germany", "jetpack-forms"),
  GH: (0, import_i18n64.__)("Ghana", "jetpack-forms"),
  GI: (0, import_i18n64.__)("Gibraltar", "jetpack-forms"),
  GR: (0, import_i18n64.__)("Greece", "jetpack-forms"),
  GL: (0, import_i18n64.__)("Greenland", "jetpack-forms"),
  GD: (0, import_i18n64.__)("Grenada", "jetpack-forms"),
  GP: (0, import_i18n64.__)("Guadeloupe", "jetpack-forms"),
  GU: (0, import_i18n64.__)("Guam", "jetpack-forms"),
  GT: (0, import_i18n64.__)("Guatemala", "jetpack-forms"),
  GG: (0, import_i18n64.__)("Guernsey", "jetpack-forms"),
  GN: (0, import_i18n64.__)("Guinea", "jetpack-forms"),
  GW: (0, import_i18n64.__)("Guinea-Bissau", "jetpack-forms"),
  GY: (0, import_i18n64.__)("Guyana", "jetpack-forms"),
  HT: (0, import_i18n64.__)("Haiti", "jetpack-forms"),
  HN: (0, import_i18n64.__)("Honduras", "jetpack-forms"),
  HK: (0, import_i18n64.__)("Hong Kong", "jetpack-forms"),
  HU: (0, import_i18n64.__)("Hungary", "jetpack-forms"),
  IS: (0, import_i18n64.__)("Iceland", "jetpack-forms"),
  IN: (0, import_i18n64.__)("India", "jetpack-forms"),
  ID: (0, import_i18n64.__)("Indonesia", "jetpack-forms"),
  IR: (0, import_i18n64.__)("Iran", "jetpack-forms"),
  IQ: (0, import_i18n64.__)("Iraq", "jetpack-forms"),
  IE: (0, import_i18n64.__)("Ireland", "jetpack-forms"),
  IM: (0, import_i18n64.__)("Isle of Man", "jetpack-forms"),
  IL: (0, import_i18n64.__)("Israel", "jetpack-forms"),
  IT: (0, import_i18n64.__)("Italy", "jetpack-forms"),
  JM: (0, import_i18n64.__)("Jamaica", "jetpack-forms"),
  JP: (0, import_i18n64.__)("Japan", "jetpack-forms"),
  JE: (0, import_i18n64.__)("Jersey", "jetpack-forms"),
  JO: (0, import_i18n64.__)("Jordan", "jetpack-forms"),
  KZ: (0, import_i18n64.__)("Kazakhstan", "jetpack-forms"),
  KE: (0, import_i18n64.__)("Kenya", "jetpack-forms"),
  KI: (0, import_i18n64.__)("Kiribati", "jetpack-forms"),
  XK: (0, import_i18n64.__)("Kosovo", "jetpack-forms"),
  KW: (0, import_i18n64.__)("Kuwait", "jetpack-forms"),
  KG: (0, import_i18n64.__)("Kyrgyzstan", "jetpack-forms"),
  LA: (0, import_i18n64.__)("Laos", "jetpack-forms"),
  LV: (0, import_i18n64.__)("Latvia", "jetpack-forms"),
  LB: (0, import_i18n64.__)("Lebanon", "jetpack-forms"),
  LS: (0, import_i18n64.__)("Lesotho", "jetpack-forms"),
  LR: (0, import_i18n64.__)("Liberia", "jetpack-forms"),
  LY: (0, import_i18n64.__)("Libya", "jetpack-forms"),
  LI: (0, import_i18n64.__)("Liechtenstein", "jetpack-forms"),
  LT: (0, import_i18n64.__)("Lithuania", "jetpack-forms"),
  LU: (0, import_i18n64.__)("Luxembourg", "jetpack-forms"),
  MO: (0, import_i18n64.__)("Macao", "jetpack-forms"),
  MG: (0, import_i18n64.__)("Madagascar", "jetpack-forms"),
  MW: (0, import_i18n64.__)("Malawi", "jetpack-forms"),
  MY: (0, import_i18n64.__)("Malaysia", "jetpack-forms"),
  MV: (0, import_i18n64.__)("Maldives", "jetpack-forms"),
  ML: (0, import_i18n64.__)("Mali", "jetpack-forms"),
  MT: (0, import_i18n64.__)("Malta", "jetpack-forms"),
  MH: (0, import_i18n64.__)("Marshall Islands", "jetpack-forms"),
  MQ: (0, import_i18n64.__)("Martinique", "jetpack-forms"),
  MR: (0, import_i18n64.__)("Mauritania", "jetpack-forms"),
  MU: (0, import_i18n64.__)("Mauritius", "jetpack-forms"),
  YT: (0, import_i18n64.__)("Mayotte", "jetpack-forms"),
  MX: (0, import_i18n64.__)("Mexico", "jetpack-forms"),
  FM: (0, import_i18n64.__)("Micronesia", "jetpack-forms"),
  MD: (0, import_i18n64.__)("Moldova", "jetpack-forms"),
  MC: (0, import_i18n64.__)("Monaco", "jetpack-forms"),
  MN: (0, import_i18n64.__)("Mongolia", "jetpack-forms"),
  ME: (0, import_i18n64.__)("Montenegro", "jetpack-forms"),
  MS: (0, import_i18n64.__)("Montserrat", "jetpack-forms"),
  MA: (0, import_i18n64.__)("Morocco", "jetpack-forms"),
  MZ: (0, import_i18n64.__)("Mozambique", "jetpack-forms"),
  MM: (0, import_i18n64.__)("Myanmar", "jetpack-forms"),
  NA: (0, import_i18n64.__)("Namibia", "jetpack-forms"),
  NR: (0, import_i18n64.__)("Nauru", "jetpack-forms"),
  NP: (0, import_i18n64.__)("Nepal", "jetpack-forms"),
  NL: (0, import_i18n64.__)("Netherlands", "jetpack-forms"),
  NC: (0, import_i18n64.__)("New Caledonia", "jetpack-forms"),
  NZ: (0, import_i18n64.__)("New Zealand", "jetpack-forms"),
  NI: (0, import_i18n64.__)("Nicaragua", "jetpack-forms"),
  NE: (0, import_i18n64.__)("Niger", "jetpack-forms"),
  NG: (0, import_i18n64.__)("Nigeria", "jetpack-forms"),
  NU: (0, import_i18n64.__)("Niue", "jetpack-forms"),
  NF: (0, import_i18n64.__)("Norfolk Island", "jetpack-forms"),
  KP: (0, import_i18n64.__)("North Korea", "jetpack-forms"),
  MK: (0, import_i18n64.__)("North Macedonia", "jetpack-forms"),
  MP: (0, import_i18n64.__)("Northern Mariana Islands", "jetpack-forms"),
  NO: (0, import_i18n64.__)("Norway", "jetpack-forms"),
  OM: (0, import_i18n64.__)("Oman", "jetpack-forms"),
  PK: (0, import_i18n64.__)("Pakistan", "jetpack-forms"),
  PW: (0, import_i18n64.__)("Palau", "jetpack-forms"),
  PS: (0, import_i18n64.__)("Palestine", "jetpack-forms"),
  PA: (0, import_i18n64.__)("Panama", "jetpack-forms"),
  PG: (0, import_i18n64.__)("Papua New Guinea", "jetpack-forms"),
  PY: (0, import_i18n64.__)("Paraguay", "jetpack-forms"),
  PE: (0, import_i18n64.__)("Peru", "jetpack-forms"),
  PH: (0, import_i18n64.__)("Philippines", "jetpack-forms"),
  PN: (0, import_i18n64.__)("Pitcairn Islands", "jetpack-forms"),
  PL: (0, import_i18n64.__)("Poland", "jetpack-forms"),
  PT: (0, import_i18n64.__)("Portugal", "jetpack-forms"),
  PR: (0, import_i18n64.__)("Puerto Rico", "jetpack-forms"),
  QA: (0, import_i18n64.__)("Qatar", "jetpack-forms"),
  RO: (0, import_i18n64.__)("Romania", "jetpack-forms"),
  RU: (0, import_i18n64.__)("Russia", "jetpack-forms"),
  RW: (0, import_i18n64.__)("Rwanda", "jetpack-forms"),
  RE: (0, import_i18n64.__)("R\xE9union", "jetpack-forms"),
  BL: (0, import_i18n64.__)("Saint Barth\xE9lemy", "jetpack-forms"),
  SH: (0, import_i18n64.__)("Saint Helena", "jetpack-forms"),
  KN: (0, import_i18n64.__)("Saint Kitts and Nevis", "jetpack-forms"),
  LC: (0, import_i18n64.__)("Saint Lucia", "jetpack-forms"),
  MF: (0, import_i18n64.__)("Saint Martin", "jetpack-forms"),
  PM: (0, import_i18n64.__)("Saint Pierre and Miquelon", "jetpack-forms"),
  VC: (0, import_i18n64.__)("Saint Vincent and the Grenadines", "jetpack-forms"),
  WS: (0, import_i18n64.__)("Samoa", "jetpack-forms"),
  SM: (0, import_i18n64.__)("San Marino", "jetpack-forms"),
  SA: (0, import_i18n64.__)("Saudi Arabia", "jetpack-forms"),
  SN: (0, import_i18n64.__)("Senegal", "jetpack-forms"),
  RS: (0, import_i18n64.__)("Serbia", "jetpack-forms"),
  SC: (0, import_i18n64.__)("Seychelles", "jetpack-forms"),
  SL: (0, import_i18n64.__)("Sierra Leone", "jetpack-forms"),
  SG: (0, import_i18n64.__)("Singapore", "jetpack-forms"),
  SK: (0, import_i18n64.__)("Slovakia", "jetpack-forms"),
  SI: (0, import_i18n64.__)("Slovenia", "jetpack-forms"),
  SB: (0, import_i18n64.__)("Solomon Islands", "jetpack-forms"),
  SO: (0, import_i18n64.__)("Somalia", "jetpack-forms"),
  ZA: (0, import_i18n64.__)("South Africa", "jetpack-forms"),
  GS: (0, import_i18n64.__)("South Georgia and the South Sandwich Islands", "jetpack-forms"),
  KR: (0, import_i18n64.__)("South Korea", "jetpack-forms"),
  ES: (0, import_i18n64.__)("Spain", "jetpack-forms"),
  LK: (0, import_i18n64.__)("Sri Lanka", "jetpack-forms"),
  SD: (0, import_i18n64.__)("Sudan", "jetpack-forms"),
  SR: (0, import_i18n64.__)("Suriname", "jetpack-forms"),
  SJ: (0, import_i18n64.__)("Svalbard and Jan Mayen", "jetpack-forms"),
  SE: (0, import_i18n64.__)("Sweden", "jetpack-forms"),
  CH: (0, import_i18n64.__)("Switzerland", "jetpack-forms"),
  SY: (0, import_i18n64.__)("Syria", "jetpack-forms"),
  ST: (0, import_i18n64.__)("S\xE3o Tom\xE9 and Pr\xEDncipe", "jetpack-forms"),
  TW: (0, import_i18n64.__)("Taiwan", "jetpack-forms"),
  TJ: (0, import_i18n64.__)("Tajikistan", "jetpack-forms"),
  TZ: (0, import_i18n64.__)("Tanzania", "jetpack-forms"),
  TH: (0, import_i18n64.__)("Thailand", "jetpack-forms"),
  TL: (0, import_i18n64.__)("Timor-Leste", "jetpack-forms"),
  TG: (0, import_i18n64.__)("Togo", "jetpack-forms"),
  TK: (0, import_i18n64.__)("Tokelau", "jetpack-forms"),
  TO: (0, import_i18n64.__)("Tonga", "jetpack-forms"),
  TT: (0, import_i18n64.__)("Trinidad and Tobago", "jetpack-forms"),
  TN: (0, import_i18n64.__)("Tunisia", "jetpack-forms"),
  TR: (0, import_i18n64.__)("Turkey", "jetpack-forms"),
  TM: (0, import_i18n64.__)("Turkmenistan", "jetpack-forms"),
  TC: (0, import_i18n64.__)("Turks and Caicos Islands", "jetpack-forms"),
  TV: (0, import_i18n64.__)("Tuvalu", "jetpack-forms"),
  VI: (0, import_i18n64.__)("U.S. Virgin Islands", "jetpack-forms"),
  UG: (0, import_i18n64.__)("Uganda", "jetpack-forms"),
  UA: (0, import_i18n64.__)("Ukraine", "jetpack-forms"),
  AE: (0, import_i18n64.__)("United Arab Emirates", "jetpack-forms"),
  GB: (0, import_i18n64.__)("United Kingdom", "jetpack-forms"),
  US: (0, import_i18n64.__)("United States", "jetpack-forms"),
  UY: (0, import_i18n64.__)("Uruguay", "jetpack-forms"),
  UZ: (0, import_i18n64.__)("Uzbekistan", "jetpack-forms"),
  VU: (0, import_i18n64.__)("Vanuatu", "jetpack-forms"),
  VA: (0, import_i18n64.__)("Vatican City", "jetpack-forms"),
  VE: (0, import_i18n64.__)("Venezuela", "jetpack-forms"),
  VN: (0, import_i18n64.__)("Vietnam", "jetpack-forms"),
  WF: (0, import_i18n64.__)("Wallis and Futuna", "jetpack-forms"),
  YE: (0, import_i18n64.__)("Yemen", "jetpack-forms"),
  ZM: (0, import_i18n64.__)("Zambia", "jetpack-forms"),
  ZW: (0, import_i18n64.__)("Zimbabwe", "jetpack-forms")
};
var getTranslatedCountryName = (countryCode) => {
  return translatedCountryNames[countryCode] || countryCode;
};

// src/dashboard/components/text-with-flag/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='28c427b7b6']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "28c427b7b6");
  style.appendChild(document.createTextNode(".jp-forms__text-with-flag-emoji{font-size:16px;vertical-align:middle}.jp-forms__text-with-flag-globe{fill:currentColor;vertical-align:text-top}"));
  document.head.appendChild(style);
}

// src/dashboard/components/text-with-flag/index.tsx
var import_jsx_runtime146 = __toESM(require_jsx_runtime(), 1);
function getFlagEmoji(countryCode) {
  if (!countryCode || countryCode.length !== 2) {
    return "";
  }
  const upperCountryCode = countryCode.toUpperCase();
  if (!/^[A-Z]{2}$/.test(upperCountryCode)) {
    return "";
  }
  const offset = 127397;
  return String.fromCodePoint(
    upperCountryCode.charCodeAt(0) + offset,
    upperCountryCode.charCodeAt(1) + offset
  );
}
function TextWithFlag({
  children,
  countryCode,
  fallbackIcon = false
}) {
  let flag, countryName;
  if (countryCode) {
    flag = getFlagEmoji(countryCode);
    countryName = getTranslatedCountryName(countryCode);
  }
  return /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("span", { children: [
    flag && /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_components65.Tooltip, { text: countryName, children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)("span", { "aria-label": countryName, role: "img", className: "jp-forms__text-with-flag-emoji", children: flag }) }),
      " "
    ] }),
    !flag && fallbackIcon && /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)(import_jsx_runtime146.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(icon_default, { icon: globe_default, size: 16, className: "jp-forms__text-with-flag-globe" }),
      " "
    ] }),
    children
  ] });
}

// src/dashboard/hooks/use-inbox-data.ts
var import_core_data = __toESM(require_core_data(), 1);
var import_data13 = __toESM(require_data(), 1);
var import_element77 = __toESM(require_element(), 1);
var import_html_entities2 = __toESM(require_html_entities(), 1);

// src/dashboard/components/inspector/utils.ts
var import_html_entities = __toESM(require_html_entities(), 1);
var isFileUploadField = (value) => {
  return !!value && typeof value === "object" && "files" in value;
};
var isImageSelectField = (value) => {
  return !!value && typeof value === "object" && "type" in value && value.type === "image-select";
};
var isLikelyPhoneNumber = (value) => {
  if (typeof value !== "string") {
    return false;
  }
  const normalizedValue = value.trim();
  if (!/^[\d+\-\s().]+$/.test(normalizedValue)) {
    return false;
  }
  if (/^\d{4}[-/]\d{1,2}[-/]\d{1,2}$/.test(normalizedValue)) {
    return false;
  }
  if (/^\d{1,2}[-/]\d{1,2}[-/]\d{2,4}$/.test(normalizedValue)) {
    return false;
  }
  const digits = normalizedValue.replace(/\D/g, "");
  if (digits.length < 7 || digits.length > 15) {
    return false;
  }
  return true;
};
var isCollectionFormatField = (item) => {
  return item !== null && typeof item === "object" && "label" in item && "value" in item && "key" in item;
};
var isFieldsCollection = (fields) => {
  if (Array.isArray(fields)) {
    if (fields.length === 0) {
      return true;
    }
    return isCollectionFormatField(fields[0]);
  }
  if (!fields || typeof fields !== "object") {
    return false;
  }
  const values = Object.values(fields);
  return values.length > 0 && isCollectionFormatField(values[0]);
};

// src/dashboard/router/dashboard-search-params-context.tsx
var import_element76 = __toESM(require_element(), 1);
var import_jsx_runtime147 = __toESM(require_jsx_runtime(), 1);
var DashboardSearchParamsContext = (0, import_element76.createContext)(null);
function DashboardSearchParamsProvider({
  value,
  children
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(DashboardSearchParamsContext.Provider, { value, children });
}
function useDashboardSearchParams() {
  const ctx8 = (0, import_element76.useContext)(DashboardSearchParamsContext);
  if (!ctx8) {
    throw new Error(
      "useDashboardSearchParams must be used within a DashboardSearchParamsProvider."
    );
  }
  return ctx8;
}

// src/dashboard/store/index.js
var import_data12 = __toESM(require_data(), 1);

// src/dashboard/store/actions.js
var actions_exports3 = {};
__export(actions_exports3, {
  addPendingAction: () => addPendingAction,
  clearInvalidRecords: () => clearInvalidRecords,
  doBulkAction: () => doBulkAction,
  invalidateCounts: () => invalidateCounts,
  invalidateFilters: () => invalidateFilters,
  markRecordsAsInvalid: () => markRecordsAsInvalid,
  receiveFilters: () => receiveFilters,
  removePendingAction: () => removePendingAction,
  setCounts: () => setCounts,
  setCurrentQuery: () => setCurrentQuery,
  setSelectedResponses: () => setSelectedResponses,
  updateCountsOptimistically: () => updateCountsOptimistically
});
var import_api_fetch5 = __toESM(require_api_fetch(), 1);

// src/dashboard/store/action-types.js
var RECEIVE_FILTERS = "RECEIVE_FILTERS";
var INVALIDATE_FILTERS = "INVALIDATE_FILTERS";
var SET_CURRENT_QUERY = "SET_CURRENT_QUERY";
var SET_SELECTED_RESPONSES = "SET_SELECTED_RESPONSES";
var SET_COUNTS = "SET_COUNTS";
var UPDATE_COUNTS_OPTIMISTICALLY = "UPDATE_COUNTS_OPTIMISTICALLY";
var INVALIDATE_COUNTS = "INVALIDATE_COUNTS";
var MARK_RECORDS_AS_INVALID = "MARK_RECORDS_AS_INVALID";
var CLEAR_INVALID_RECORDS = "CLEAR_INVALID_RECORDS";
var ADD_PENDING_ACTION = "ADD_PENDING_ACTION";
var REMOVE_PENDING_ACTION = "REMOVE_PENDING_ACTION";

// src/dashboard/store/actions.js
function receiveFilters(filters2) {
  return {
    type: RECEIVE_FILTERS,
    filters: filters2
  };
}
var invalidateFilters = () => {
  return { type: INVALIDATE_FILTERS };
};
var invalidateCounts = () => {
  return { type: INVALIDATE_COUNTS };
};
var setSelectedResponses = (selectedResponses) => ({
  type: SET_SELECTED_RESPONSES,
  selectedResponses
});
function setCurrentQuery(currentQuery2) {
  return ({ dispatch: dispatch4, select: select3, registry }) => {
    const previousQuery = select3.getCurrentQuery();
    const queryWithFormat = {
      ...currentQuery2,
      fields_format: currentQuery2.fields_format ?? previousQuery.fields_format ?? "collection"
    };
    const filtersChanged = previousQuery.status !== queryWithFormat.status || previousQuery.search !== queryWithFormat.search || previousQuery.is_unread !== queryWithFormat.is_unread || previousQuery.parent !== queryWithFormat.parent || previousQuery.before !== queryWithFormat.before || previousQuery.after !== queryWithFormat.after;
    if (filtersChanged) {
      dispatch4(clearInvalidRecords());
      if (registry && registry.dispatch("core")) {
        registry.dispatch("core").invalidateResolution("getEntityRecords", ["postType", "feedback", queryWithFormat]);
      }
    }
    dispatch4({
      type: SET_CURRENT_QUERY,
      currentQuery: queryWithFormat
    });
  };
}
function setCounts(counts2, queryParams = {}) {
  return {
    type: SET_COUNTS,
    counts: counts2,
    queryParams
  };
}
function updateCountsOptimistically(fromStatus, toStatus, count = 1, queryParams = {}) {
  return {
    type: UPDATE_COUNTS_OPTIMISTICALLY,
    fromStatus,
    toStatus,
    count,
    queryParams
  };
}
function markRecordsAsInvalid(recordIds) {
  return {
    type: MARK_RECORDS_AS_INVALID,
    recordIds
  };
}
function clearInvalidRecords() {
  return {
    type: CLEAR_INVALID_RECORDS
  };
}
function addPendingAction(actionId) {
  return {
    type: ADD_PENDING_ACTION,
    actionId
  };
}
function removePendingAction(actionId) {
  return {
    type: REMOVE_PENDING_ACTION,
    actionId
  };
}
var doBulkAction = (ids, action) => async () => {
  try {
    await (0, import_api_fetch5.default)({
      path: `wp/v2/feedback/bulk_actions`,
      method: "POST",
      data: {
        action,
        post_ids: ids
      }
    });
  } catch {
  }
};

// src/dashboard/store/reducer.js
var import_data11 = __toESM(require_data(), 1);
var filters = (state = {}, action) => {
  if (action.type === RECEIVE_FILTERS) {
    return action.filters;
  }
  return state;
};
var currentQuery = (state = {
  order: "desc",
  orderby: "date",
  page: 1,
  per_page: 20,
  status: "draft,publish",
  fields_format: "collection"
}, action) => {
  if (action.type === SET_CURRENT_QUERY) {
    return action.currentQuery;
  }
  return state;
};
var selectedResponsesFromCurrentDataset = (state = [], action) => {
  if (action.type === SET_SELECTED_RESPONSES) {
    return action.selectedResponses;
  }
  return state;
};
var normalizeValue2 = (value) => {
  if (Array.isArray(value)) {
    return value.slice().sort().join(",");
  }
  if (typeof value === "boolean") {
    return value ? "1" : "0";
  }
  return String(value);
};
var getCacheKey = (queryParams = {}) => {
  const keys = ["search", "parent", "before", "after", "is_unread"];
  const parts = keys.filter((key) => queryParams[key] !== void 0).map((key) => `${key}:${normalizeValue2(queryParams[key])}`);
  return parts.length > 0 ? parts.join("|") : "default";
};
var counts = (state = {}, action) => {
  if (action.type === SET_COUNTS) {
    const cacheKey = getCacheKey(action.queryParams);
    return {
      ...state,
      [cacheKey]: action.counts
    };
  }
  if (action.type === UPDATE_COUNTS_OPTIMISTICALLY) {
    const { fromStatus, toStatus, count, queryParams } = action;
    const cacheKey = getCacheKey(queryParams);
    const currentCounts = state[cacheKey] || { inbox: 0, spam: 0, trash: 0 };
    const newCounts = { ...currentCounts };
    if (fromStatus === "inbox" || fromStatus === "publish" || fromStatus === "draft") {
      newCounts.inbox = Math.max(0, newCounts.inbox - count);
    } else if (fromStatus === "spam") {
      newCounts.spam = Math.max(0, newCounts.spam - count);
    } else if (fromStatus === "trash") {
      newCounts.trash = Math.max(0, newCounts.trash - count);
    }
    if (toStatus === "publish" || toStatus === "draft") {
      newCounts.inbox += count;
    } else if (toStatus === "spam") {
      newCounts.spam += count;
    } else if (toStatus === "trash") {
      newCounts.trash += count;
    }
    return {
      ...state,
      [cacheKey]: newCounts
    };
  }
  return state;
};
var invalidRecords = (state = /* @__PURE__ */ new Set(), action) => {
  if (action.type === MARK_RECORDS_AS_INVALID) {
    return /* @__PURE__ */ new Set([...state, ...action.recordIds]);
  }
  if (action.type === CLEAR_INVALID_RECORDS) {
    return /* @__PURE__ */ new Set();
  }
  return state;
};
var pendingActions = (state = /* @__PURE__ */ new Set(), action) => {
  if (action.type === ADD_PENDING_ACTION) {
    return /* @__PURE__ */ new Set([...state, action.actionId]);
  }
  if (action.type === REMOVE_PENDING_ACTION) {
    const newState = new Set(state);
    newState.delete(action.actionId);
    return newState;
  }
  return state;
};
var reducer_default = (0, import_data11.combineReducers)({
  selectedResponsesFromCurrentDataset,
  filters,
  currentQuery,
  counts,
  invalidRecords,
  pendingActions
});

// src/dashboard/store/resolvers.js
var resolvers_exports3 = {};
__export(resolvers_exports3, {
  getCounts: () => getCounts,
  getFilters: () => getFilters
});
var import_api_fetch6 = __toESM(require_api_fetch(), 1);
var import_url4 = __toESM(require_url(), 1);
var getFilters = () => async ({ dispatch: dispatch4 }) => {
  const results = await (0, import_api_fetch6.default)({
    path: "/wp/v2/feedback/filters"
  });
  dispatch4.receiveFilters(results);
};
getFilters.shouldInvalidate = (action) => action.type === INVALIDATE_FILTERS;
var getCounts = (queryParams = {}) => async ({ dispatch: dispatch4 }) => {
  const params = {};
  if (queryParams?.search) {
    params.search = queryParams.search;
  }
  if (queryParams?.parent) {
    params.parent = queryParams.parent;
  }
  if (queryParams?.before) {
    params.before = queryParams.before;
  }
  if (queryParams?.after) {
    params.after = queryParams.after;
  }
  if (queryParams?.is_unread !== void 0) {
    params.is_unread = queryParams.is_unread;
  }
  const path = (0, import_url4.addQueryArgs)("/wp/v2/feedback/counts", params);
  const response = await (0, import_api_fetch6.default)({ path });
  dispatch4.setCounts(response, queryParams);
};
getCounts.shouldInvalidate = (action) => action.type === INVALIDATE_COUNTS;

// src/dashboard/store/selectors.js
var selectors_exports3 = {};
__export(selectors_exports3, {
  getCounts: () => getCounts2,
  getCurrentQuery: () => getCurrentQuery,
  getCurrentStatus: () => getCurrentStatus,
  getFilters: () => getFilters2,
  getInboxCount: () => getInboxCount,
  getInvalidRecords: () => getInvalidRecords,
  getPendingActions: () => getPendingActions,
  getSelectedResponsesCount: () => getSelectedResponsesCount,
  getSelectedResponsesFromCurrentDataset: () => getSelectedResponsesFromCurrentDataset,
  getSpamCount: () => getSpamCount,
  getTrashCount: () => getTrashCount,
  hasPendingActions: () => hasPendingActions,
  isRecordInvalid: () => isRecordInvalid
});
var getFilters2 = (state) => state.filters;
var getCurrentQuery = (state) => state.currentQuery;
var getCurrentStatus = (state) => state.currentQuery?.status ?? "draft,publish";
var getSelectedResponsesFromCurrentDataset = (state) => state.selectedResponsesFromCurrentDataset;
var getSelectedResponsesCount = (state) => state.selectedResponsesFromCurrentDataset.length;
var getCounts2 = (state, queryParams = {}) => {
  const cacheKey = getCacheKey(queryParams);
  return state.counts[cacheKey] || { inbox: 0, spam: 0, trash: 0 };
};
var getInboxCount = (state, queryParams = {}) => {
  const counts2 = getCounts2(state, queryParams);
  return counts2.inbox;
};
var getSpamCount = (state, queryParams = {}) => {
  const counts2 = getCounts2(state, queryParams);
  return counts2.spam;
};
var getTrashCount = (state, queryParams = {}) => {
  const counts2 = getCounts2(state, queryParams);
  return counts2.trash;
};
var getInvalidRecords = (state) => {
  return state.invalidRecords || /* @__PURE__ */ new Set();
};
var isRecordInvalid = (state, recordId) => {
  return state.invalidRecords?.has(recordId) || false;
};
var getPendingActions = (state) => {
  return state.pendingActions || /* @__PURE__ */ new Set();
};
var hasPendingActions = (state) => {
  return (state.pendingActions?.size ?? 0) > 0;
};

// src/dashboard/store/index.js
var STORE_NAME = "FORM_RESPONSES";
var store3 = (0, import_data12.createReduxStore)(STORE_NAME, {
  actions: actions_exports3,
  reducer: reducer_default,
  selectors: selectors_exports3,
  resolvers: resolvers_exports3
});
(0, import_data12.register)(store3);

// src/dashboard/hooks/use-inbox-data.ts
function getStatusFilter(urlStatus) {
  const statusFilter = ["inbox", "spam", "trash"].includes(urlStatus) ? urlStatus : "inbox";
  return statusFilter === "inbox" ? "draft,publish" : statusFilter;
}
var formatFieldName = (fieldName) => {
  const match2 = fieldName.match(/^(\d+_)?(.*)/i);
  if (match2) {
    return match2[2];
  }
  return fieldName;
};
var isEmpty3 = (obj) => [Object, Array].includes((obj || {}).constructor) && !Object.entries(obj || {}).length;
var formatFieldValue = (fieldValue) => {
  if (!fieldValue || isEmpty3(fieldValue)) {
    return "-";
  }
  if (Array.isArray(fieldValue)) {
    return fieldValue.join(", ");
  }
  return fieldValue;
};
var decodeValue = (value) => {
  if (typeof value === "string") {
    return (0, import_html_entities2.decodeEntities)(value);
  }
  if (Array.isArray(value)) {
    return value.map((v2) => typeof v2 === "string" ? (0, import_html_entities2.decodeEntities)(v2) : v2);
  }
  return value;
};
var hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
var normalizeFieldsForDisplay = (fields) => {
  if (!fields || !Array.isArray(fields)) {
    return /* @__PURE__ */ Object.create(null);
  }
  if (isCollectionFormatField(fields[0])) {
    return fields;
  }
  return Object.entries(fields || {}).reduce(
    (accumulator, [key, value]) => {
      let _key = formatFieldName(key);
      let counter = 2;
      while (hasOwn(accumulator, _key)) {
        _key = `${formatFieldName(key)} (${counter})`;
        counter++;
      }
      accumulator[_key] = formatFieldValue(decodeValue(value));
      return accumulator;
    },
    /* @__PURE__ */ Object.create(null)
  );
};
function useInboxData(options = {}) {
  const [searchParams] = useDashboardSearchParams();
  const { setCurrentQuery: setCurrentQuery2, setSelectedResponses: setSelectedResponses2 } = (0, import_data13.useDispatch)(store3);
  const urlStatus = options.status ?? searchParams.get("status");
  const statusFilter = getStatusFilter(urlStatus);
  const {
    selectedResponsesCount,
    currentStatus,
    currentQuery: currentQuery2,
    filterOptions,
    invalidRecords: invalidRecords2,
    hasPendingActions: hasPendingActions2
  } = (0, import_data13.useSelect)(
    (select3) => ({
      selectedResponsesCount: select3(store3).getSelectedResponsesCount(),
      currentStatus: select3(store3).getCurrentStatus(),
      currentQuery: select3(store3).getCurrentQuery(),
      filterOptions: select3(store3).getFilters(),
      invalidRecords: select3(store3).getInvalidRecords(),
      hasPendingActions: select3(store3).hasPendingActions()
    }),
    []
  );
  const [frozenInvalidIds, setFrozenInvalidIds] = (0, import_element77.useState)([]);
  const currentPageRef = (0, import_element77.useRef)(currentQuery2?.page || 1);
  (0, import_element77.useEffect)(() => {
    const newPage = currentQuery2?.page || 1;
    const hasUnreadFilter = currentQuery2?.is_unread === true;
    if (newPage !== currentPageRef.current) {
      currentPageRef.current = newPage;
      if (hasUnreadFilter) {
        setFrozenInvalidIds(Array.from(invalidRecords2 || /* @__PURE__ */ new Set()));
      } else {
        setFrozenInvalidIds([]);
      }
    }
  }, [currentQuery2?.page, currentQuery2?.is_unread, invalidRecords2]);
  const queryWithInvalidIds = (0, import_element77.useMemo)(() => {
    if (frozenInvalidIds.length > 0) {
      return {
        ...currentQuery2,
        invalid_ids: frozenInvalidIds
      };
    }
    return currentQuery2;
  }, [currentQuery2, frozenInvalidIds]);
  const {
    records: rawRecords,
    hasResolved,
    totalItems,
    totalPages
  } = (0, import_core_data.useEntityRecords)("postType", "feedback", queryWithInvalidIds);
  const editedRecords = (0, import_data13.useSelect)(
    (select3) => {
      return (rawRecords || []).map((record) => {
        const editedRecord = select3(import_core_data.store).getEditedEntityRecord(
          "postType",
          "feedback",
          record.id
        );
        return editedRecord || record;
      });
    },
    [rawRecords]
  );
  const statusMatchesFilter = (status, filter) => {
    if (filter.includes(",")) {
      return filter.split(",").includes(status);
    }
    return status === filter;
  };
  const records = (0, import_element77.useMemo)(() => {
    const filteredRecords = (editedRecords || []).filter((record) => {
      return statusMatchesFilter(record.status, statusFilter);
    });
    return filteredRecords.map((record) => {
      const formResponse = record;
      return {
        ...formResponse,
        fields: normalizeFieldsForDisplay(formResponse.fields)
      };
    });
  }, [editedRecords, statusFilter]);
  const countsQueryParams = (0, import_element77.useMemo)(() => {
    const params = {};
    if (currentQuery2?.search) {
      params.search = currentQuery2.search;
    }
    if (currentQuery2?.parent) {
      params.parent = currentQuery2.parent;
    }
    if (currentQuery2?.before) {
      params.before = currentQuery2.before;
    }
    if (currentQuery2?.after) {
      params.after = currentQuery2.after;
    }
    if (currentQuery2?.is_unread !== void 0) {
      params.is_unread = currentQuery2.is_unread;
    }
    return params;
  }, [currentQuery2]);
  const { totalItemsInbox, totalItemsSpam, totalItemsTrash } = (0, import_data13.useSelect)(
    (select3) => {
      select3(store3).getCounts(countsQueryParams);
      return {
        totalItemsInbox: select3(store3).getInboxCount(countsQueryParams),
        totalItemsSpam: select3(store3).getSpamCount(countsQueryParams),
        totalItemsTrash: select3(store3).getTrashCount(countsQueryParams)
      };
    },
    [countsQueryParams]
  );
  const isLoadingData = !rawRecords?.length && !hasResolved || !records?.length && hasPendingActions2;
  return {
    totalItemsInbox,
    totalItemsSpam,
    totalItemsTrash,
    records,
    isLoadingData,
    totalItems,
    totalPages,
    selectedResponsesCount,
    setSelectedResponses: setSelectedResponses2,
    statusFilter,
    currentStatus,
    currentQuery: currentQuery2,
    setCurrentQuery: setCurrentQuery2,
    filterOptions
  };
}

// src/dashboard/router/wp-route-dashboard-search-params-provider.tsx
var import_element78 = __toESM(require_element(), 1);
import { useSearch, useNavigate } from "@wordpress/route";
var import_jsx_runtime148 = __toESM(require_jsx_runtime(), 1);
function searchRecordToUrlSearchParams(search) {
  const params = new URLSearchParams();
  for (const [key, value] of Object.entries(search || {})) {
    if (value === void 0 || value === null) {
      continue;
    }
    if (Array.isArray(value)) {
      for (const v2 of value) {
        if (v2 === void 0 || v2 === null) {
          continue;
        }
        params.append(key, String(v2));
      }
      continue;
    }
    params.set(key, String(value));
  }
  return params;
}
function urlSearchParamsToSearchRecord(params, options = {}) {
  const { arrayKeys = /* @__PURE__ */ new Set() } = options;
  const out = {};
  for (const key of params.keys()) {
    const values = params.getAll(key);
    if (values.length < 1) {
      continue;
    }
    if (arrayKeys.has(key)) {
      out[key] = values;
      continue;
    }
    out[key] = values[values.length - 1];
  }
  return out;
}
function WpRouteDashboardSearchParamsProvider({
  from,
  children
}) {
  const search = useSearch({
    // In this build, the router type isn't registered, so `@wordpress/route` models `from` as `never`.
    // We still want to pass the runtime route id through.
    from,
    strict: false
  });
  const navigate = useNavigate();
  const searchParams = (0, import_element78.useMemo)(() => searchRecordToUrlSearchParams(search), [search]);
  const setSearchParams = (0, import_element78.useCallback)(
    (next) => {
      const resolved = typeof next === "function" ? next(searchParams) : next;
      const nextSearch = urlSearchParamsToSearchRecord(resolved, {
        arrayKeys: /* @__PURE__ */ new Set(["responseIds"])
      });
      const replaceSearch = (() => nextSearch);
      navigate({ search: replaceSearch });
    },
    [navigate, searchParams]
  );
  const value = (0, import_element78.useMemo)(
    () => [searchParams, setSearchParams],
    [searchParams, setSearchParams]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(DashboardSearchParamsProvider, { value, children });
}

// src/dashboard/wp-build/components/dataviews-header-row/index.tsx
var import_data14 = __toESM(require_data(), 1);
var import_element81 = __toESM(require_element(), 1);
var import_i18n66 = __toESM(require_i18n(), 1);
import { useNavigate as useNavigate2 } from "@wordpress/route";

// src/dashboard/constants.ts
var NON_TRASH_FORM_STATUSES = "publish,draft,pending,future,private";

// src/dashboard/hooks/use-forms-data.ts
var import_core_data2 = __toESM(require_core_data(), 1);
var import_element79 = __toESM(require_element(), 1);
var import_html_entities3 = __toESM(require_html_entities(), 1);
function getFormsListQuery(page, perPage, search, status) {
  const queryParams = {
    context: "edit",
    jetpack_forms_context: "dashboard",
    order: "desc",
    orderby: "modified",
    page,
    per_page: perPage,
    status
  };
  if (search) {
    queryParams.search = search;
  }
  return queryParams;
}
function useFormsData(page, perPage, search, status) {
  const query = (0, import_element79.useMemo)(() => {
    return getFormsListQuery(page, perPage, search, status);
  }, [page, perPage, search, status]);
  const {
    records: rawRecords,
    hasResolved,
    totalItems,
    totalPages
  } = (0, import_core_data2.useEntityRecords)("postType", "jetpack_form", query);
  const records = (rawRecords || []).map((item) => {
    const typedItem = item;
    return {
      id: typedItem.id,
      title: (0, import_html_entities3.decodeEntities)(typedItem.title?.rendered || ""),
      status: typedItem.status,
      modified: typedItem.modified,
      entriesCount: typedItem.entries_count ?? 0,
      editUrl: typedItem.edit_url
    };
  });
  return {
    records,
    isLoading: !hasResolved,
    totalItems: totalItems ?? 0,
    totalPages: totalPages ?? 0
  };
}

// src/dashboard/wp-build/components/inbox-status-toggle/index.tsx
var import_element80 = __toESM(require_element(), 1);
var import_i18n65 = __toESM(require_i18n(), 1);
var import_jsx_runtime149 = __toESM(require_jsx_runtime(), 1);
var getLabel = (status, count) => {
  let label;
  switch (status) {
    case "inbox":
      label = (0, import_i18n65.__)("Inbox", "jetpack-forms");
      break;
    case "spam":
      label = (0, import_i18n65.__)("Spam", "jetpack-forms");
      break;
    case "trash":
      label = (0, import_i18n65._x)("Trash", "noun", "jetpack-forms");
      break;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)("span", { children: [
    label,
    /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(Badge3, { intent: "draft", className: "jp-forms-tabs-count", children: formatNumberCompact(count || 0) })
  ] });
};
function InboxStatusToggle({
  activeStatus,
  counts: counts2,
  onChange
}) {
  const handleChange = (0, import_element80.useCallback)(
    (nextStatus) => {
      if (nextStatus === activeStatus) {
        return;
      }
      onChange(nextStatus);
    },
    [activeStatus, onChange]
  );
  const statusTabs = (0, import_element80.useMemo)(
    () => [
      { value: "inbox", label: getLabel("inbox", counts2.inbox) },
      { value: "spam", label: getLabel("spam", counts2.spam) },
      { value: "trash", label: getLabel("trash", counts2.trash) }
    ],
    [counts2.inbox, counts2.spam, counts2.trash]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(tabs_exports.Root, { value: activeStatus, onValueChange: handleChange, children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(tabs_exports.List, { variant: "minimal", children: statusTabs.map((option) => /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(tabs_exports.Tab, { value: option.value, children: option.label }, option.value)) }) });
}

// src/dashboard/wp-build/components/dataviews-header-row/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='9f4017da04']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "9f4017da04");
  style.appendChild(document.createTextNode(".jp-forms-dataviews__view-actions{border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,#e0e0e0);box-sizing:border-box;container-type:inline-size;flex-shrink:0;overflow-x:auto;padding-inline:20px;width:100%}@container (width < 500px){.jp-forms-dataviews__view-actions{--wp-ui-stack-justify:flex-start;align-items:flex-start;flex-direction:column}}.jp-forms-dataviews__view-actions>div:not(:empty){min-height:48px}.jp-forms-dataviews-filters__container,.jp-forms-dataviews-filters__container:not(:empty){padding:0}.jp-forms-dataviews-filters__container:not(:empty){padding-block:12px;padding-inline:20px}.jp-forms-tabs-count{margin-inline-start:4px;vertical-align:middle}"));
  document.head.appendChild(style);
}

// src/dashboard/wp-build/components/dataviews-header-row/index.tsx
var import_jsx_runtime150 = __toESM(require_jsx_runtime(), 1);
function DataViewsHeaderRow({
  activeTab,
  isSingleFormView = false,
  activeStatus,
  statusCounts,
  onStatusChange
}) {
  const navigate = useNavigate2();
  const { totalItems: formsCount = 0 } = useFormsData(1, 1, "", NON_TRASH_FORM_STATUSES);
  const responsesInboxCount = (0, import_data14.useSelect)((select3) => {
    select3(store3).getCounts();
    return select3(store3).getInboxCount() ?? 0;
  }, []);
  const onTabChange = (0, import_element81.useCallback)(
    (nextValue) => {
      if (nextValue === "forms") {
        navigate({ href: "/forms" });
        return;
      }
      navigate({ href: "/responses/inbox" });
    },
    [navigate]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_jsx_runtime150.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(
      Stack3,
      {
        align: "center",
        className: "jp-forms-dataviews__view-actions",
        gap: "sm",
        justify: "space-between",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Stack3, { align: "center", gap: "sm", children: isSingleFormView ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
            InboxStatusToggle,
            {
              activeStatus: activeStatus ?? "inbox",
              counts: statusCounts ?? { inbox: 0, spam: 0, trash: 0 },
              onChange: onStatusChange ?? (() => {
              })
            }
          ) : /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(tabs_exports.Root, { value: activeTab, onValueChange: onTabChange, children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(tabs_exports.List, { variant: "minimal", children: [
            /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(tabs_exports.Tab, { value: "forms", children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
              (0, import_i18n66.__)("Forms", "jetpack-forms"),
              /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Badge3, { intent: "draft", className: "jp-forms-tabs-count", children: formatNumberCompact(formsCount || 0) })
            ] }) }),
            /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(tabs_exports.Tab, { value: "responses", children: /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("span", { children: [
              (0, import_i18n66.__)("Responses", "jetpack-forms"),
              /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(Badge3, { intent: "draft", className: "jp-forms-tabs-count", children: formatNumberCompact(responsesInboxCount || 0) })
            ] }) })
          ] }) }) }),
          /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(Stack3, { align: "center", gap: "sm", children: [
            /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(dataviews_default.Search, {}),
            isSingleFormView ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(dataviews_default.FiltersToggle, {}) : null,
            /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(dataviews_default.ViewConfig, {})
          ] })
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(dataviews_default.FiltersToggled, { className: "jp-forms-dataviews-filters__container" })
  ] });
}

// ../../js-packages/components/build/components/layout/use-breakpoint-match/index.js
var import_compose14 = __toESM(require_compose(), 1);

// ../../js-packages/components/build/components/layout/breakpoints.module.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='223cbd12e4']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "223cbd12e4");
  style.appendChild(document.createTextNode(""));
  document.head.appendChild(style);
}
var breakpoints_module_default = { "sm": "(max-width: 599px)", "md": "(min-width: 600px) and (max-width: 959px)", "lg": "(min-width: 960px)" };

// ../../js-packages/components/build/components/layout/use-breakpoint-match/index.js
var BREAKPOINTS = ["sm", "md", "lg"];
var getMediaByOperator = (breakpoint, operator, matches) => {
  const breakpointIndex = BREAKPOINTS.indexOf(breakpoint);
  const breakpointIndexPlusOne = breakpointIndex + 1;
  const isEqual = operator.includes("=");
  let allNeededBreakpoints = [];
  if (operator.startsWith("<")) {
    allNeededBreakpoints = BREAKPOINTS.slice(0, isEqual ? breakpointIndexPlusOne : breakpointIndex);
  }
  if (operator.startsWith(">")) {
    allNeededBreakpoints = BREAKPOINTS.slice(isEqual ? breakpointIndex : breakpointIndexPlusOne);
  }
  return allNeededBreakpoints?.length ? allNeededBreakpoints.some((brk) => matches[brk]) : matches[breakpoint];
};
var useBreakpointMatch = (breakpointToMatch, operatorToMatch) => {
  const breakpoints = Array.isArray(breakpointToMatch) ? breakpointToMatch : [breakpointToMatch];
  const operators = Array.isArray(operatorToMatch) ? operatorToMatch : [operatorToMatch];
  const [smKey, mdKey, lgKey] = BREAKPOINTS;
  const sm = (0, import_compose14.useMediaQuery)(breakpoints_module_default[smKey]);
  const md = (0, import_compose14.useMediaQuery)(breakpoints_module_default[mdKey]);
  const lg = (0, import_compose14.useMediaQuery)(breakpoints_module_default[lgKey]);
  const matches = { sm, md, lg };
  return breakpoints.map((breakpoint, idx) => {
    const operator = operators[idx];
    return operator ? getMediaByOperator(breakpoint, operator, matches) : matches[breakpoint];
  });
};
var use_breakpoint_match_default = useBreakpointMatch;

// ../../js-packages/api/index.jsx
var import_jetpack_config = __toESM(require_src(), 1);
var import_url5 = __toESM(require_url(), 1);
function createCustomError(name) {
  class CustomError extends Error {
    constructor(...args) {
      super(...args);
      this.name = name;
    }
  }
  return CustomError;
}
var JsonParseError = createCustomError("JsonParseError");
var JsonParseAfterRedirectError = createCustomError("JsonParseAfterRedirectError");
var Api404Error = createCustomError("Api404Error");
var Api404AfterRedirectError = createCustomError("Api404AfterRedirectError");
var FetchNetworkError = createCustomError("FetchNetworkError");
function JetpackRestApiClient(root, nonce) {
  let apiRoot = root, wpcomOriginApiUrl = root, headers = {
    "X-WP-Nonce": nonce
  }, getParams = {
    credentials: "same-origin",
    headers
  }, postParams = {
    method: "post",
    credentials: "same-origin",
    headers: Object.assign({}, headers, {
      "Content-type": "application/json"
    })
  }, cacheBusterCallback = addCacheBuster;
  const methods = {
    setApiRoot(newRoot) {
      apiRoot = newRoot;
    },
    /**
     * Sets API root for search endpoints.
     * They are routed through wpcom API for wpcom simple sites,
     * so we add `/wp-json/wpcom-origin/` to this path on wpcom.
     * For non-wpcom sites, this is the same as apiRoot.
     *
     * @param {string} newRoot - API root for search endpoints.
     */
    setWpcomOriginApiUrl(newRoot) {
      wpcomOriginApiUrl = newRoot;
    },
    setApiNonce(newNonce) {
      headers = {
        "X-WP-Nonce": newNonce
      };
      getParams = {
        credentials: "same-origin",
        headers
      };
      postParams = {
        method: "post",
        credentials: "same-origin",
        headers: Object.assign({}, headers, {
          "Content-type": "application/json"
        })
      };
    },
    setCacheBusterCallback: (callback) => {
      cacheBusterCallback = callback;
    },
    registerSite: (deprecated, redirectUri, from) => {
      const params = {};
      if ((0, import_jetpack_config.jetpackConfigHas)("consumer_slug")) {
        params.plugin_slug = (0, import_jetpack_config.jetpackConfigGet)("consumer_slug");
      }
      if (null !== redirectUri) {
        params.redirect_uri = redirectUri;
      }
      if (from) {
        params.from = from;
      }
      return postRequest(`${apiRoot}jetpack/v4/connection/register`, postParams, {
        body: JSON.stringify(params)
      }).then(checkStatus).then(parseJsonResponse);
    },
    fetchAuthorizationUrl: (redirectUri) => getRequest(
      (0, import_url5.addQueryArgs)(`${apiRoot}jetpack/v4/connection/authorize_url`, {
        no_iframe: "1",
        redirect_uri: redirectUri
      }),
      getParams
    ).then(checkStatus).then(parseJsonResponse),
    fetchSiteConnectionData: () => getRequest(`${apiRoot}jetpack/v4/connection/data`, getParams).then(parseJsonResponse),
    fetchSiteConnectionStatus: () => getRequest(`${apiRoot}jetpack/v4/connection`, getParams).then(parseJsonResponse),
    fetchSiteConnectionTest: () => getRequest(`${apiRoot}jetpack/v4/connection/test`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchUserConnectionData: () => getRequest(`${apiRoot}jetpack/v4/connection/data`, getParams).then(parseJsonResponse),
    fetchUserTrackingSettings: () => getRequest(`${apiRoot}jetpack/v4/tracking/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateUserTrackingSettings: (newSettings) => postRequest(`${apiRoot}jetpack/v4/tracking/settings`, postParams, {
      body: JSON.stringify(newSettings)
    }).then(checkStatus).then(parseJsonResponse),
    disconnectSite: () => postRequest(`${apiRoot}jetpack/v4/connection`, postParams, {
      body: JSON.stringify({ isActive: false })
    }).then(checkStatus).then(parseJsonResponse),
    fetchConnectUrl: () => getRequest(`${apiRoot}jetpack/v4/connection/url`, getParams).then(checkStatus).then(parseJsonResponse),
    unlinkUser: (force = false, options = {}) => {
      const params = {
        linked: false,
        force: !!force
      };
      if (options.disconnectAllUsers) {
        params["disconnect-all-users"] = true;
      }
      return postRequest(`${apiRoot}jetpack/v4/connection/user`, postParams, {
        body: JSON.stringify(params)
      }).then(checkStatus).then(parseJsonResponse);
    },
    reconnect: () => postRequest(`${apiRoot}jetpack/v4/connection/reconnect`, postParams).then(checkStatus).then(parseJsonResponse),
    fetchConnectedPlugins: () => getRequest(`${apiRoot}jetpack/v4/connection/plugins`, getParams).then(checkStatus).then(parseJsonResponse),
    setHasSeenWCConnectionModal: () => postRequest(`${apiRoot}jetpack/v4/seen-wc-connection-modal`, postParams).then(checkStatus).then(parseJsonResponse),
    fetchModules: () => getRequest(`${apiRoot}jetpack/v4/module/all`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchModule: (slug) => getRequest(`${apiRoot}jetpack/v4/module/${slug}`, getParams).then(checkStatus).then(parseJsonResponse),
    activateModule: (slug) => postRequest(`${apiRoot}jetpack/v4/module/${slug}/active`, postParams, {
      body: JSON.stringify({ active: true })
    }).then(checkStatus).then(parseJsonResponse),
    deactivateModule: (slug) => postRequest(`${apiRoot}jetpack/v4/module/${slug}/active`, postParams, {
      body: JSON.stringify({ active: false })
    }),
    updateModuleOptions: (slug, newOptionValues) => postRequest(`${apiRoot}jetpack/v4/module/${slug}`, postParams, {
      body: JSON.stringify(newOptionValues)
    }).then(checkStatus).then(parseJsonResponse),
    updateSettings: (newOptionValues) => postRequest(`${apiRoot}jetpack/v4/settings`, postParams, {
      body: JSON.stringify(newOptionValues)
    }).then(checkStatus).then(parseJsonResponse),
    getProtectCount: () => getRequest(`${apiRoot}jetpack/v4/module/protect/data`, getParams).then(checkStatus).then(parseJsonResponse),
    resetOptions: (options) => postRequest(`${apiRoot}jetpack/v4/options/${options}`, postParams, {
      body: JSON.stringify({ reset: true })
    }).then(checkStatus).then(parseJsonResponse),
    activateVaultPress: () => postRequest(`${apiRoot}jetpack/v4/plugins`, postParams, {
      body: JSON.stringify({ slug: "vaultpress", status: "active" })
    }).then(checkStatus).then(parseJsonResponse),
    getVaultPressData: () => getRequest(`${apiRoot}jetpack/v4/module/vaultpress/data`, getParams).then(checkStatus).then(parseJsonResponse),
    installPlugin: (slug, source) => {
      const props = { slug, status: "active" };
      if (source) {
        props.source = source;
      }
      return postRequest(`${apiRoot}jetpack/v4/plugins`, postParams, {
        body: JSON.stringify(props)
      }).then(checkStatus).then(parseJsonResponse);
    },
    activateAkismet: () => postRequest(`${apiRoot}jetpack/v4/plugins`, postParams, {
      body: JSON.stringify({ slug: "akismet", status: "active" })
    }).then(checkStatus).then(parseJsonResponse),
    getAkismetData: () => getRequest(`${apiRoot}jetpack/v4/module/akismet/data`, getParams).then(checkStatus).then(parseJsonResponse),
    checkAkismetKey: () => getRequest(`${apiRoot}jetpack/v4/module/akismet/key/check`, getParams).then(checkStatus).then(parseJsonResponse),
    checkAkismetKeyTyped: (apiKey) => postRequest(`${apiRoot}jetpack/v4/module/akismet/key/check`, postParams, {
      body: JSON.stringify({ api_key: apiKey })
    }).then(checkStatus).then(parseJsonResponse),
    getFeatureTypeStatus: (customContentType) => getRequest(`${apiRoot}jetpack/v4/feature/${customContentType}`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchStatsData: (range) => getRequest(statsDataUrl(range), getParams).then(checkStatus).then(parseJsonResponse).then(handleStatsResponseError),
    getPluginUpdates: () => getRequest(`${apiRoot}jetpack/v4/updates/plugins`, getParams).then(checkStatus).then(parseJsonResponse),
    getPlans: () => getRequest(`${apiRoot}jetpack/v4/plans`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchSettings: () => getRequest(`${apiRoot}jetpack/v4/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateSetting: (updatedSetting) => postRequest(`${apiRoot}jetpack/v4/settings`, postParams, {
      body: JSON.stringify(updatedSetting)
    }).then(checkStatus).then(parseJsonResponse),
    fetchSiteData: () => getRequest(`${apiRoot}jetpack/v4/site`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteFeatures: () => getRequest(`${apiRoot}jetpack/v4/site/features`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteProducts: () => getRequest(`${apiRoot}jetpack/v4/site/products`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchSitePurchases: () => getRequest(`${apiRoot}jetpack/v4/site/purchases`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteBenefits: () => getRequest(`${apiRoot}jetpack/v4/site/benefits`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteDiscount: () => getRequest(`${apiRoot}jetpack/v4/site/discount`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => body.data),
    fetchSetupQuestionnaire: () => getRequest(`${apiRoot}jetpack/v4/setup/questionnaire`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsData: () => getRequest(`${apiRoot}jetpack/v4/recommendations/data`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsProductSuggestions: () => getRequest(`${apiRoot}jetpack/v4/recommendations/product-suggestions`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsUpsell: () => getRequest(`${apiRoot}jetpack/v4/recommendations/upsell`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsConditional: () => getRequest(`${apiRoot}jetpack/v4/recommendations/conditional`, getParams).then(checkStatus).then(parseJsonResponse),
    saveRecommendationsData: (data) => postRequest(`${apiRoot}jetpack/v4/recommendations/data`, postParams, {
      body: JSON.stringify({ data })
    }).then(checkStatus),
    fetchProducts: () => getRequest(`${apiRoot}jetpack/v4/products`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRewindStatus: () => getRequest(`${apiRoot}jetpack/v4/rewind`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchScanStatus: () => getRequest(`${apiRoot}jetpack/v4/scan`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    dismissJetpackNotice: (notice) => postRequest(`${apiRoot}jetpack/v4/notice/${notice}`, postParams, {
      body: JSON.stringify({ dismissed: true })
    }).then(checkStatus).then(parseJsonResponse),
    fetchPluginsData: () => getRequest(`${apiRoot}jetpack/v4/plugins`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchIntroOffers: () => getRequest(`${apiRoot}jetpack/v4/intro-offers`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchVerifySiteGoogleStatus: (keyringId) => {
      const request = keyringId !== null ? getRequest(`${apiRoot}jetpack/v4/verify-site/google/${keyringId}`, getParams) : getRequest(`${apiRoot}jetpack/v4/verify-site/google`, getParams);
      return request.then(checkStatus).then(parseJsonResponse);
    },
    verifySiteGoogle: (keyringId) => postRequest(`${apiRoot}jetpack/v4/verify-site/google`, postParams, {
      body: JSON.stringify({ keyring_id: keyringId })
    }).then(checkStatus).then(parseJsonResponse),
    submitSurvey: (surveyResponse) => postRequest(`${apiRoot}jetpack/v4/marketing/survey`, postParams, {
      body: JSON.stringify(surveyResponse)
    }).then(checkStatus).then(parseJsonResponse),
    saveSetupQuestionnaire: (props) => postRequest(`${apiRoot}jetpack/v4/setup/questionnaire`, postParams, {
      body: JSON.stringify(props)
    }).then(checkStatus).then(parseJsonResponse),
    updateLicensingError: (props) => postRequest(`${apiRoot}jetpack/v4/licensing/error`, postParams, {
      body: JSON.stringify(props)
    }).then(checkStatus).then(parseJsonResponse),
    updateLicenseKey: (license) => postRequest(`${apiRoot}jetpack/v4/licensing/set-license`, postParams, {
      body: JSON.stringify({ license })
    }).then(checkStatus).then(parseJsonResponse),
    getUserLicensesCounts: () => getRequest(`${apiRoot}jetpack/v4/licensing/user/counts`, getParams).then(checkStatus).then(parseJsonResponse),
    getUserLicenses: () => getRequest(`${apiRoot}jetpack/v4/licensing/user/licenses`, getParams).then(checkStatus).then(parseJsonResponse),
    updateLicensingActivationNoticeDismiss: (lastDetachedCount) => postRequest(`${apiRoot}jetpack/v4/licensing/user/activation-notice-dismiss`, postParams, {
      body: JSON.stringify({ last_detached_count: lastDetachedCount })
    }).then(checkStatus).then(parseJsonResponse),
    updateRecommendationsStep: (step) => postRequest(`${apiRoot}jetpack/v4/recommendations/step`, postParams, {
      body: JSON.stringify({ step })
    }).then(checkStatus),
    confirmIDCSafeMode: () => postRequest(`${apiRoot}jetpack/v4/identity-crisis/confirm-safe-mode`, postParams).then(
      checkStatus
    ),
    startIDCFresh: (redirectUri) => postRequest(`${apiRoot}jetpack/v4/identity-crisis/start-fresh`, postParams, {
      body: JSON.stringify({ redirect_uri: redirectUri })
    }).then(checkStatus).then(parseJsonResponse),
    migrateIDC: () => postRequest(`${apiRoot}jetpack/v4/identity-crisis/migrate`, postParams).then(
      checkStatus
    ),
    attachLicenses: (licenses) => postRequest(`${apiRoot}jetpack/v4/licensing/attach-licenses`, postParams, {
      body: JSON.stringify({ licenses })
    }).then(checkStatus).then(parseJsonResponse),
    fetchSearchPlanInfo: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/plan`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchSearchSettings: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateSearchSettings: (newSettings) => postRequest(`${wpcomOriginApiUrl}jetpack/v4/search/settings`, postParams, {
      body: JSON.stringify(newSettings)
    }).then(checkStatus).then(parseJsonResponse),
    fetchSearchStats: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/stats`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchWafSettings: () => getRequest(`${apiRoot}jetpack/v4/waf`, getParams).then(checkStatus).then(parseJsonResponse),
    updateWafSettings: (newSettings) => postRequest(`${apiRoot}jetpack/v4/waf`, postParams, {
      body: JSON.stringify(newSettings)
    }).then(checkStatus).then(parseJsonResponse),
    fetchWordAdsSettings: () => getRequest(`${apiRoot}jetpack/v4/wordads/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateWordAdsSettings: (newSettings) => postRequest(`${apiRoot}jetpack/v4/wordads/settings`, postParams, {
      body: JSON.stringify(newSettings)
    }),
    fetchSearchPricing: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/pricing`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchMigrationStatus: () => getRequest(`${apiRoot}jetpack/v4/migration/status`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchBackupUndoEvent: () => getRequest(`${apiRoot}jetpack/v4/site/backup/undo-event`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchBackupPreflightStatus: () => getRequest(`${apiRoot}jetpack/v4/site/backup/preflight`, getParams).then(checkStatus).then(parseJsonResponse)
  };
  function addCacheBuster(route) {
    const parts = route.split("?"), query = parts.length > 1 ? parts[1] : "", args = query.length ? query.split("&") : [];
    args.push("_cacheBuster=" + (/* @__PURE__ */ new Date()).getTime());
    return parts[0] + "?" + args.join("&");
  }
  function getRequest(route, params) {
    return fetch(cacheBusterCallback(route), params);
  }
  function postRequest(route, params, body) {
    return fetch(route, Object.assign({}, params, body)).catch(catchNetworkErrors);
  }
  function statsDataUrl(range) {
    let url = `${apiRoot}jetpack/v4/module/stats/data`;
    if (url.indexOf("?") !== -1) {
      url = url + `&range=${encodeURIComponent(range)}`;
    } else {
      url = url + `?range=${encodeURIComponent(range)}`;
    }
    return url;
  }
  function handleStatsResponseError(statsData) {
    const responseOk = statsData.general && statsData.general.response === void 0 || statsData.week && statsData.week.response === void 0 || statsData.month && statsData.month.response === void 0;
    return responseOk ? statsData : {};
  }
  Object.assign(this, methods);
}
var restApi = new JetpackRestApiClient();
var api_default = restApi;
function checkStatus(response) {
  if (response.status >= 200 && response.status < 300) {
    return response;
  }
  if (response.status === 404) {
    return new Promise(() => {
      const err = response.redirected ? new Api404AfterRedirectError(response.redirected) : new Api404Error();
      throw err;
    });
  }
  return response.json().catch((e2) => catchJsonParseError(e2)).then((json) => {
    const error2 = new Error(`${json.message} (Status ${response.status})`);
    error2.response = json;
    error2.name = "ApiError";
    throw error2;
  });
}
function parseJsonResponse(response) {
  return response.json().catch((e2) => catchJsonParseError(e2, response.redirected, response.url));
}
function catchJsonParseError(e2, redirected, url) {
  const err = redirected ? new JsonParseAfterRedirectError(url) : new JsonParseError();
  throw err;
}
function catchNetworkErrors() {
  throw new FetchNetworkError();
}

// src/dashboard/wp-build/hooks/use-page-header-details.tsx
var import_components76 = __toESM(require_components(), 1);
var import_core_data6 = __toESM(require_core_data(), 1);
var import_data32 = __toESM(require_data(), 1);
var import_element95 = __toESM(require_element(), 1);
var import_html_entities4 = __toESM(require_html_entities(), 1);
var import_i18n84 = __toESM(require_i18n(), 1);

// src/dashboard/components/edit-form-button/index.tsx
var import_components66 = __toESM(require_components(), 1);
var import_element82 = __toESM(require_element(), 1);
var import_i18n67 = __toESM(require_i18n(), 1);
var import_jsx_runtime151 = __toESM(require_jsx_runtime(), 1);
function EditFormButton({ formId }) {
  const adminUrl = useConfigValue("adminUrl") || "";
  const onClick = (0, import_element82.useCallback)(() => {
    const editPath = `post.php?post=${formId}&action=edit`;
    window.location.href = adminUrl ? `${adminUrl}${editPath}` : editPath;
  }, [adminUrl, formId]);
  return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_components66.Button, { size: "compact", variant: "secondary", onClick, children: (0, import_i18n67.__)("Edit form", "jetpack-forms") });
}

// src/dashboard/components/empty-spam-button/index.tsx
var import_components68 = __toESM(require_components(), 1);
var import_i18n70 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-empty-spam.ts
var import_api_fetch7 = __toESM(require_api_fetch(), 1);
var import_core_data3 = __toESM(require_core_data(), 1);
var import_data15 = __toESM(require_data(), 1);
var import_element83 = __toESM(require_element(), 1);
var import_i18n68 = __toESM(require_i18n(), 1);
var import_notices2 = __toESM(require_notices(), 1);
function useEmptySpam({
  totalItemsSpam: totalItemsSpamProp
} = {}) {
  const [isConfirmDialogOpen, setConfirmDialogOpen] = (0, import_element83.useState)(false);
  const [isEmptying, setIsEmptying] = (0, import_element83.useState)(false);
  const [isEmpty4, setIsEmpty] = (0, import_element83.useState)(true);
  const { createSuccessNotice, createErrorNotice } = (0, import_data15.useDispatch)(import_notices2.store);
  const { invalidateResolution } = (0, import_data15.useDispatch)(import_core_data3.store);
  const { invalidateCounts: invalidateCounts2 } = (0, import_data15.useDispatch)(store3);
  const hookData = useInboxData();
  const totalItemsSpam = totalItemsSpamProp ?? hookData.totalItemsSpam ?? 0;
  const { selectedResponsesCount, currentQuery: currentQuery2 } = hookData;
  (0, import_element83.useEffect)(() => {
    setIsEmpty(!totalItemsSpam);
  }, [totalItemsSpam]);
  const openConfirmDialog = (0, import_element83.useCallback)(() => setConfirmDialogOpen(true), []);
  const closeConfirmDialog = (0, import_element83.useCallback)(() => setConfirmDialogOpen(false), []);
  const onConfirmEmptying = (0, import_element83.useCallback)(async () => {
    if (isEmptying || isEmpty4) {
      return;
    }
    closeConfirmDialog();
    setIsEmptying(true);
    analytics_default.tracks.recordEvent("jetpack_forms_empty_spam_click");
    (0, import_api_fetch7.default)({
      method: "DELETE",
      path: `/wp/v2/feedback/trash?status=spam`
    }).then((response) => {
      const deleted = response?.deleted ?? 0;
      const successMessage = deleted === 1 ? (0, import_i18n68.__)("Response deleted permanently.", "jetpack-forms") : (0, import_i18n68.sprintf)(
        /* translators: %s: The number of responses. */
        (0, import_i18n68._n)(
          "%s response deleted permanently.",
          "%s responses deleted permanently.",
          deleted,
          "jetpack-forms"
        ),
        formatNumber2(deleted)
      );
      createSuccessNotice(successMessage, { type: "snackbar", id: "empty-spam" });
    }).catch(() => {
      createErrorNotice((0, import_i18n68.__)("Could not empty spam.", "jetpack-forms"), {
        type: "snackbar",
        id: "empty-spam-error"
      });
    }).finally(() => {
      setIsEmptying(false);
      invalidateResolution("getEntityRecords", ["postType", "feedback", currentQuery2]);
      invalidateResolution("getEntityRecords", [
        "postType",
        "feedback",
        { ...currentQuery2, per_page: 1, _fields: "id" }
      ]);
      invalidateCounts2();
    });
  }, [
    closeConfirmDialog,
    createErrorNotice,
    createSuccessNotice,
    invalidateResolution,
    invalidateCounts2,
    isEmpty4,
    isEmptying,
    currentQuery2
  ]);
  return {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsSpam,
    selectedResponsesCount
  };
}

// src/dashboard/components/empty-spam-button/confirmation-modal.tsx
var import_components67 = __toESM(require_components(), 1);
var import_i18n69 = __toESM(require_i18n(), 1);
var import_jsx_runtime152 = __toESM(require_jsx_runtime(), 1);
function EmptySpamConfirmationModal({
  isOpen,
  onCancel,
  onConfirm,
  totalItemsSpam,
  selectedResponsesCount
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)(
    import_components67.__experimentalConfirmDialog,
    {
      onCancel,
      onConfirm,
      isOpen,
      confirmButtonText: (0, import_i18n69.__)("Delete", "jetpack-forms"),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("h3", { children: (0, import_i18n69.__)("Delete forever", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("p", { children: selectedResponsesCount > 0 ? (0, import_i18n69.sprintf)(
          // translators: %s: the number of responses in spam
          (0, import_i18n69._n)(
            "%s response in spam will be deleted forever. This action cannot be undone.",
            "All %s responses in spam will be deleted forever. This action cannot be undone.",
            totalItemsSpam || 0,
            "jetpack-forms"
          ),
          formatNumber2(totalItemsSpam)
        ) : (0, import_i18n69.__)(
          "All responses in spam will be deleted forever. This action cannot be undone.",
          "jetpack-forms"
        ) })
      ]
    }
  );
}

// src/dashboard/components/empty-spam-button/index.tsx
var import_jsx_runtime153 = __toESM(require_jsx_runtime(), 1);
var EmptySpamButton = ({
  totalItemsSpam: totalItemsSpamProp
} = {}) => {
  const {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsSpam,
    selectedResponsesCount
  } = useEmptySpam({
    totalItemsSpam: totalItemsSpamProp
  });
  return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(import_jsx_runtime153.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
      import_components68.Button,
      {
        size: "compact",
        accessibleWhenDisabled: true,
        disabled: isEmpty4 || isEmptying,
        icon: trash_default,
        isBusy: isEmptying,
        label: isEmpty4 ? (0, import_i18n70.__)("Spam is already empty.", "jetpack-forms") : "",
        onClick: openConfirmDialog,
        showTooltip: isEmpty4,
        variant: "primary",
        children: (0, import_i18n70.__)("Delete spam", "jetpack-forms")
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
      EmptySpamConfirmationModal,
      {
        isOpen: isConfirmDialogOpen,
        onCancel: closeConfirmDialog,
        onConfirm: onConfirmEmptying,
        totalItemsSpam,
        selectedResponsesCount
      }
    )
  ] });
};
var empty_spam_button_default = EmptySpamButton;

// src/dashboard/components/empty-trash-button/index.tsx
var import_components70 = __toESM(require_components(), 1);
var import_i18n73 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-empty-trash.ts
var import_api_fetch8 = __toESM(require_api_fetch(), 1);
var import_core_data4 = __toESM(require_core_data(), 1);
var import_data16 = __toESM(require_data(), 1);
var import_element84 = __toESM(require_element(), 1);
var import_i18n71 = __toESM(require_i18n(), 1);
var import_notices3 = __toESM(require_notices(), 1);
function useEmptyTrash({
  totalItemsTrash: totalItemsTrashProp
} = {}) {
  const [isConfirmDialogOpen, setConfirmDialogOpen] = (0, import_element84.useState)(false);
  const [isEmptying, setIsEmptying] = (0, import_element84.useState)(false);
  const [isEmpty4, setIsEmpty] = (0, import_element84.useState)(true);
  const { createSuccessNotice, createErrorNotice } = (0, import_data16.useDispatch)(import_notices3.store);
  const { invalidateResolution } = (0, import_data16.useDispatch)(import_core_data4.store);
  const { invalidateCounts: invalidateCounts2 } = (0, import_data16.useDispatch)(store3);
  const hookData = useInboxData();
  const totalItemsTrash = totalItemsTrashProp ?? hookData.totalItemsTrash ?? 0;
  const { selectedResponsesCount, currentQuery: currentQuery2 } = hookData;
  (0, import_element84.useEffect)(() => {
    setIsEmpty(!totalItemsTrash);
  }, [totalItemsTrash]);
  const openConfirmDialog = (0, import_element84.useCallback)(() => setConfirmDialogOpen(true), []);
  const closeConfirmDialog = (0, import_element84.useCallback)(() => setConfirmDialogOpen(false), []);
  const onConfirmEmptying = (0, import_element84.useCallback)(async () => {
    if (isEmptying || isEmpty4) {
      return;
    }
    closeConfirmDialog();
    setIsEmptying(true);
    analytics_default.tracks.recordEvent("jetpack_forms_empty_trash_click");
    (0, import_api_fetch8.default)({
      method: "DELETE",
      path: `/wp/v2/feedback/trash`
    }).then((response) => {
      const deleted = response?.deleted ?? 0;
      const successMessage = deleted === 1 ? (0, import_i18n71.__)("Response deleted permanently.", "jetpack-forms") : (0, import_i18n71.sprintf)(
        /* translators: %s: the number of responses deleted permanently. */
        (0, import_i18n71._n)(
          "%s response deleted permanently.",
          "%s responses deleted permanently.",
          deleted,
          "jetpack-forms"
        ),
        formatNumber2(deleted)
      );
      createSuccessNotice(successMessage, { type: "snackbar", id: "empty-trash" });
    }).catch(() => {
      createErrorNotice((0, import_i18n71.__)("Could not empty trash.", "jetpack-forms"), {
        type: "snackbar",
        id: "empty-trash-error"
      });
    }).finally(() => {
      setIsEmptying(false);
      invalidateResolution("getEntityRecords", ["postType", "feedback", currentQuery2]);
      invalidateResolution("getEntityRecords", [
        "postType",
        "feedback",
        { ...currentQuery2, per_page: 1, _fields: "id" }
      ]);
      invalidateCounts2();
    });
  }, [
    closeConfirmDialog,
    createErrorNotice,
    createSuccessNotice,
    invalidateResolution,
    invalidateCounts2,
    isEmpty4,
    isEmptying,
    currentQuery2
  ]);
  return {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsTrash,
    selectedResponsesCount
  };
}

// src/dashboard/components/empty-trash-button/confirmation-modal.tsx
var import_components69 = __toESM(require_components(), 1);
var import_i18n72 = __toESM(require_i18n(), 1);
var import_jsx_runtime154 = __toESM(require_jsx_runtime(), 1);
function EmptyTrashConfirmationModal({
  isOpen,
  onCancel,
  onConfirm,
  totalItemsTrash,
  selectedResponsesCount
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(
    import_components69.__experimentalConfirmDialog,
    {
      onCancel,
      onConfirm,
      isOpen,
      confirmButtonText: (0, import_i18n72.__)("Delete", "jetpack-forms"),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime154.jsx)("h3", { children: (0, import_i18n72.__)("Delete forever", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime154.jsx)("p", { children: selectedResponsesCount > 0 ? (0, import_i18n72.sprintf)(
          // translators: %s: the number of responses in the trash.
          (0, import_i18n72._n)(
            "%s response in trash will be deleted forever. This action cannot be undone.",
            "All %s responses in trash will be deleted forever. This action cannot be undone.",
            totalItemsTrash || 0,
            "jetpack-forms"
          ),
          formatNumber2(totalItemsTrash)
        ) : (0, import_i18n72.__)(
          "All responses in trash will be deleted forever. This action cannot be undone.",
          "jetpack-forms"
        ) })
      ]
    }
  );
}

// src/dashboard/components/empty-trash-button/index.tsx
var import_jsx_runtime155 = __toESM(require_jsx_runtime(), 1);
var EmptyTrashButton = ({
  totalItemsTrash: totalItemsTrashProp
} = {}) => {
  const {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsTrash,
    selectedResponsesCount
  } = useEmptyTrash({
    totalItemsTrash: totalItemsTrashProp
  });
  return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(import_jsx_runtime155.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
      import_components70.Button,
      {
        size: "compact",
        accessibleWhenDisabled: true,
        disabled: isEmpty4 || isEmptying,
        icon: trash_default,
        isBusy: isEmptying,
        label: isEmpty4 ? (0, import_i18n73.__)("Trash is already empty.", "jetpack-forms") : "",
        onClick: openConfirmDialog,
        showTooltip: isEmpty4,
        variant: "primary",
        children: (0, import_i18n73.__)("Empty trash", "jetpack-forms")
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
      EmptyTrashConfirmationModal,
      {
        isOpen: isConfirmDialogOpen,
        onCancel: closeConfirmDialog,
        onConfirm: onConfirmEmptying,
        totalItemsTrash,
        selectedResponsesCount
      }
    )
  ] });
};
var empty_trash_button_default = EmptyTrashButton;

// src/dashboard/components/export-responses/button.tsx
var import_components74 = __toESM(require_components(), 1);
var import_i18n79 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-export-responses.ts
var import_core_data5 = __toESM(require_core_data(), 1);
var import_data17 = __toESM(require_data(), 1);
var import_element85 = __toESM(require_element(), 1);
var import_i18n74 = __toESM(require_i18n(), 1);
function useExportResponses() {
  const [isSm] = use_breakpoint_match_default("sm");
  const [showExportModal, setShowExportModal] = (0, import_element85.useState)(false);
  const closeModal = (0, import_element85.useCallback)(() => setShowExportModal(false), [setShowExportModal]);
  const [autoConnectGdrive, setAutoConnectGdrive] = (0, import_element85.useState)(false);
  const { selectedResponsesCount, currentStatus } = (0, import_data17.useSelect)(
    (select3) => ({
      selectedResponsesCount: select3(store3).getSelectedResponsesCount(),
      currentStatus: select3(store3).getCurrentStatus()
    }),
    []
  );
  const isSpam = currentStatus.includes("spam");
  const isTrash = currentStatus.includes("trash");
  let statusLabel = (0, import_i18n74.__)("Export", "jetpack-forms");
  if (isSpam) {
    statusLabel = (0, import_i18n74.__)("Export spam", "jetpack-forms");
  } else if (isTrash) {
    statusLabel = (0, import_i18n74.__)("Export trash", "jetpack-forms");
  }
  const exportLabel = selectedResponsesCount > 0 ? `${statusLabel} (${formatNumber2(selectedResponsesCount)})` : statusLabel;
  const openModal = (0, import_element85.useCallback)(() => {
    setShowExportModal(true);
    analytics_default.tracks.recordEvent("jetpack_forms_export_responses_modal_open", {
      viewport: isSm ? "mobile" : "desktop"
    });
  }, [isSm]);
  const userCanExport = (0, import_data17.useSelect)(
    (select3) => select3(import_core_data5.store).canUser("update", "settings"),
    []
  );
  const { selected, currentQuery: currentQuery2 } = (0, import_data17.useSelect)((select3) => {
    const { getSelectedResponsesFromCurrentDataset: getSelectedResponsesFromCurrentDataset2, getCurrentQuery: getCurrentQuery2 } = select3(store3);
    return { selected: getSelectedResponsesFromCurrentDataset2(), currentQuery: getCurrentQuery2() };
  }, []);
  const exportNonce = useConfigValue("exportNonce");
  const onExport = (0, import_element85.useCallback)(
    (action, nonceName) => {
      const data = new FormData();
      data.append("action", action);
      data.append(nonceName, exportNonce);
      selected.forEach((id) => data.append("selected[]", id));
      data.append("post", currentQuery2.parent || "all");
      data.append("search", currentQuery2.search || "");
      data.append("status", currentQuery2.status);
      if (currentQuery2.before && currentQuery2.after) {
        data.append("before", currentQuery2.before);
        data.append("after", currentQuery2.after);
      }
      return fetch(window.ajaxurl, { method: "POST", body: data });
    },
    [currentQuery2, selected, exportNonce]
  );
  (0, import_element85.useEffect)(() => {
    const url = new URL(window.location.href);
    if (url.searchParams.get("connect-gdrive") === "true") {
      setAutoConnectGdrive(true);
      openModal();
      url.searchParams.delete("connect-gdrive");
      window.history.replaceState({}, "", url);
    }
  }, [openModal]);
  return {
    showExportModal,
    openModal,
    closeModal,
    autoConnectGdrive,
    userCanExport,
    onExport,
    selectedResponsesCount,
    currentStatus,
    exportLabel
  };
}

// src/dashboard/components/export-responses/modal.tsx
var import_components73 = __toESM(require_components(), 1);
var import_data29 = __toESM(require_data(), 1);
var import_i18n78 = __toESM(require_i18n(), 1);

// ../../js-packages/shared-extension-utils/src/get-jetpack-data.js
var JETPACK_DATA_PATH = "Jetpack_Editor_Initial_State";
function getJetpackData() {
  return "object" === typeof window ? window?.[JETPACK_DATA_PATH] ?? null : null;
}

// ../../js-packages/shared-extension-utils/src/site-type-utils.js
function isPrivateSite() {
  const jetpackData = getJetpackData();
  return jetpackData?.jetpack?.is_private_site ?? false;
}

// ../../js-packages/shared-extension-utils/src/register-jetpack-plugin.js
var import_plugins2 = __toESM(require_plugins());

// ../../js-packages/shared-extension-utils/src/with-has-warning-is-interactive-class-names/index.jsx
var import_compose15 = __toESM(require_compose());

// ../../js-packages/shared-extension-utils/src/with-has-warning-is-interactive-class-names/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='ce3503a0a4']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "ce3503a0a4");
  style.appendChild(document.createTextNode(".block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-interactive>*{pointer-events:auto;user-select:auto}.block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-interactive:after{content:none}"));
  document.head.appendChild(style);
}

// ../../js-packages/shared-extension-utils/src/with-has-warning-is-interactive-class-names/index.jsx
var import_jsx_runtime156 = __toESM(require_jsx_runtime());

// ../../js-packages/shared-extension-utils/src/plan-utils.js
var import_i18n75 = __toESM(require_i18n());
var import_url6 = __toESM(require_url());
var usableBlockWithFreePlan = [
  {
    name: "core/cover",
    mediaPlaceholder: true,
    mediaReplaceFlow: true,
    fileType: "video",
    description: (0, import_i18n75.__)("Upgrade your plan to use video covers", "jetpack-shared-extension-utils")
  },
  {
    name: "core/audio",
    mediaPlaceholder: true,
    mediaReplaceFlow: true,
    fileType: "audio",
    description: (0, import_i18n75.__)("Upgrade your plan to upload audio", "jetpack-shared-extension-utils")
  }
];

// ../../js-packages/connection/components/use-connection/index.ts
var import_data22 = __toESM(require_data(), 1);
var import_react24 = __toESM(require_react(), 1);

// ../../js-packages/connection/state/actions.jsx
var SET_CONNECTION_STATUS = "SET_CONNECTION_STATUS";
var SET_CONNECTION_STATUS_IS_FETCHING = "SET_CONNECTION_STATUS_IS_FETCHING";
var FETCH_CONNECTION_STATUS = "FETCH_CONNECTION_STATUS";
var SET_SITE_IS_REGISTERING = "SET_SITE_IS_REGISTERING";
var SET_USER_IS_CONNECTING = "SET_USER_IS_CONNECTING";
var SET_REGISTRATION_ERROR = "SET_REGISTRATION_ERROR";
var CLEAR_REGISTRATION_ERROR = "CLEAR_REGISTRATION_ERROR";
var REGISTER_SITE = "REGISTER_SITE";
var SET_AUTHORIZATION_URL = "SET_AUTHORIZATION_URL";
var CONNECT_USER = "CONNECT_USER";
var DISCONNECT_USER_SUCCESS = "DISCONNECT_USER_SUCCESS";
var FETCH_AUTHORIZATION_URL = "FETCH_AUTHORIZATION_URL";
var SET_CONNECTED_PLUGINS = "SET_CONNECTED_PLUGINS";
var SET_CONNECTION_ERRORS = "SET_CONNECTION_ERRORS";
var SET_IS_OFFLINE_MODE = "SET_IS_OFFLINE_MODE";
var setConnectionStatus = (connectionStatus2) => {
  return { type: SET_CONNECTION_STATUS, connectionStatus: connectionStatus2 };
};
var setConnectionStatusIsFetching = (isFetching) => {
  return { type: SET_CONNECTION_STATUS_IS_FETCHING, isFetching };
};
var fetchConnectionStatus = () => {
  return { type: FETCH_CONNECTION_STATUS };
};
var setSiteIsRegistering = (isRegistering) => {
  return { type: SET_SITE_IS_REGISTERING, isRegistering };
};
var setUserIsConnecting = (isConnecting) => {
  return { type: SET_USER_IS_CONNECTING, isConnecting };
};
var disconnectUserSuccess = () => {
  return { type: DISCONNECT_USER_SUCCESS };
};
var setRegistrationError = (registrationError2) => {
  return { type: SET_REGISTRATION_ERROR, registrationError: registrationError2 };
};
var clearRegistrationError = () => {
  return { type: CLEAR_REGISTRATION_ERROR };
};
var setAuthorizationUrl = (authorizationUrl2) => {
  return { type: SET_AUTHORIZATION_URL, authorizationUrl: authorizationUrl2 };
};
var fetchAuthorizationUrl = (redirectUri) => {
  return { type: FETCH_AUTHORIZATION_URL, redirectUri };
};
var setConnectedPlugins = (connectedPlugins2) => {
  return { type: SET_CONNECTED_PLUGINS, connectedPlugins: connectedPlugins2 };
};
var setConnectionErrors = (connectionErrors2) => {
  return { type: SET_CONNECTION_ERRORS, connectionErrors: connectionErrors2 };
};
var setIsOfflineMode = (isOfflineMode2) => {
  return { type: SET_IS_OFFLINE_MODE, isOfflineMode: isOfflineMode2 };
};
function* connectUser({ from, redirectFunc, redirectUri, skipPricingPage } = {}) {
  yield setUserIsConnecting(true);
  yield { type: CONNECT_USER, from, redirectFunc, redirectUri, skipPricingPage };
}
function* registerSite({ registrationNonce, redirectUri, from = "" }) {
  yield clearRegistrationError();
  yield setSiteIsRegistering(true);
  try {
    const response = yield { type: REGISTER_SITE, registrationNonce, redirectUri, from };
    yield setConnectionStatus({ isRegistered: true });
    yield setAuthorizationUrl(response.authorizeUrl);
    yield setSiteIsRegistering(false);
    return Promise.resolve(response);
  } catch (error2) {
    yield setRegistrationError(error2);
    yield setSiteIsRegistering(false);
    return Promise.reject(error2);
  }
}
var refreshConnectedPlugins = () => async ({ dispatch: dispatch4 }) => {
  return await new Promise((resolve) => {
    return api_default.fetchConnectedPlugins().then((data) => {
      dispatch4(setConnectedPlugins(data));
      resolve(data);
    });
  });
};
var actions = {
  setConnectionStatus,
  setConnectionStatusIsFetching,
  fetchConnectionStatus,
  fetchAuthorizationUrl,
  setSiteIsRegistering,
  setUserIsConnecting,
  setRegistrationError,
  clearRegistrationError,
  setAuthorizationUrl,
  registerSite,
  connectUser,
  disconnectUserSuccess,
  setConnectedPlugins,
  refreshConnectedPlugins,
  setConnectionErrors,
  setIsOfflineMode
};

// ../../js-packages/connection/state/controls.jsx
var import_data18 = __toESM(require_data(), 1);

// ../../js-packages/connection/state/assignLocation.jsx
function assignLocation(url) {
  return window.location.assign(url);
}

// ../../js-packages/connection/state/store-id.jsx
var STORE_ID = "jetpack-connection";
var store_id_default = STORE_ID;

// ../../js-packages/connection/state/controls.jsx
var REGISTER_SITE2 = ({ redirectUri, from }) => api_default.registerSite(null, redirectUri, from);
var CONNECT_USER2 = (0, import_data18.createRegistryControl)(
  ({ resolveSelect: resolveSelect2 }) => ({ from, redirectFunc, redirectUri, skipPricingPage } = {}) => {
    return new Promise((resolve, reject) => {
      resolveSelect2(store_id_default).getAuthorizationUrl(redirectUri).then((authorizationUrl2) => {
        const redirect = redirectFunc || ((url2) => assignLocation(url2));
        const url = new URL(authorizationUrl2);
        if (skipPricingPage) {
          url.searchParams.set("skip_pricing", "true");
        }
        if (from) {
          url.searchParams.set("from", encodeURIComponent(from));
        }
        const finalUrl = url.toString();
        redirect(finalUrl);
        resolve(finalUrl);
      }).catch((error2) => {
        reject(error2);
      });
    });
  }
);
var FETCH_AUTHORIZATION_URL2 = ({ redirectUri }) => api_default.fetchAuthorizationUrl(redirectUri);
var controls_default = {
  FETCH_AUTHORIZATION_URL: FETCH_AUTHORIZATION_URL2,
  REGISTER_SITE: REGISTER_SITE2,
  CONNECT_USER: CONNECT_USER2
};

// ../../js-packages/connection/state/reducers.jsx
var import_data19 = __toESM(require_data(), 1);
var connectionStatus = (state = {}, action) => {
  switch (action.type) {
    case SET_CONNECTION_STATUS:
      return { ...state, ...action.connectionStatus };
    case DISCONNECT_USER_SUCCESS:
      return { ...state, isUserConnected: false };
  }
  return state;
};
var connectedPlugins = (state = {}, action) => {
  switch (action.type) {
    case SET_CONNECTED_PLUGINS:
      return action.connectedPlugins;
  }
  return state;
};
var connectionStatusIsFetching = (state = false, action) => {
  switch (action.type) {
    case SET_CONNECTION_STATUS_IS_FETCHING:
      return action.isFetching;
  }
  return state;
};
var siteIsRegistering = (state = false, action) => {
  switch (action.type) {
    case SET_SITE_IS_REGISTERING:
      return action.isRegistering;
  }
  return state;
};
var userIsConnecting = (state = false, action) => {
  switch (action.type) {
    case SET_USER_IS_CONNECTING:
      return action.isConnecting;
  }
  return state;
};
var registrationError = (state, action) => {
  switch (action.type) {
    case CLEAR_REGISTRATION_ERROR:
      return false;
    case SET_REGISTRATION_ERROR:
      return action.registrationError;
    default:
      return state;
  }
};
var authorizationUrl = (state, action) => {
  switch (action.type) {
    case SET_AUTHORIZATION_URL:
      return action.authorizationUrl;
    default:
      return state;
  }
};
var userConnectionData = (state, action) => {
  switch (action.type) {
    default:
      return state;
  }
};
var connectionErrors = (state = {}, action) => {
  switch (action.type) {
    case SET_CONNECTION_ERRORS:
      return action.connectionErrors;
  }
  return state;
};
var isOfflineMode = (state = false, action) => {
  switch (action.type) {
    case SET_IS_OFFLINE_MODE:
      return action.isConnecting;
  }
  return state;
};
var reducers = (0, import_data19.combineReducers)({
  connectionStatus,
  connectionStatusIsFetching,
  siteIsRegistering,
  userIsConnecting,
  registrationError,
  authorizationUrl,
  userConnectionData,
  connectedPlugins,
  connectionErrors,
  isOfflineMode
});
var reducers_default = reducers;

// ../../js-packages/connection/state/resolvers.jsx
var import_data20 = __toESM(require_data(), 1);
var connectionResolvers = {
  getAuthorizationUrl: {
    isFulfilled: (state, ...args) => {
      const hasAuthorization = Boolean(state.authorizationUrl);
      const hasFinishedResolution = (0, import_data20.select)(store_id_default).hasFinishedResolution(
        "getAuthorizationUrl",
        args
      );
      if (hasAuthorization && !hasFinishedResolution) {
        (0, import_data20.dispatch)(store_id_default).finishResolution("getAuthorizationUrl", args);
      }
      return hasAuthorization;
    },
    *fulfill(redirectUri) {
      const response = yield actions.fetchAuthorizationUrl(redirectUri);
      yield actions.setAuthorizationUrl(response.authorizeUrl);
    }
  }
};
var resolvers_default = {
  ...connectionResolvers
};

// ../../js-packages/connection/state/selectors.jsx
var getWpcomUser = (state) => {
  return state?.userConnectionData?.currentUser?.wpcomUser;
};
var getBlogId = (state) => {
  return state?.userConnectionData?.currentUser?.blogId;
};
var connectionSelectors = {
  getConnectionStatus: (state) => state.connectionStatus || {},
  /**
   * Checks whether the store is fetching the connection status from the server
   *
   * @deprecated since 0.14.0
   * @return {boolean} Is the store is fetching the connection status from the server?
   */
  getConnectionStatusIsFetching: () => false,
  getSiteIsRegistering: (state) => state.siteIsRegistering || false,
  getUserIsConnecting: (state) => state.userIsConnecting || false,
  getRegistrationError: (state) => state.registrationError || false,
  getAuthorizationUrl: (state) => state.authorizationUrl || false,
  getUserConnectionData: (state) => state.userConnectionData || false,
  getConnectedPlugins: (state) => state.connectedPlugins || [],
  getConnectionErrors: (state) => state.connectionErrors || [],
  getIsOfflineMode: (state) => state.isOfflineMode || false,
  getWpcomUser,
  getBlogId
};
var selectors = {
  ...connectionSelectors
};
var selectors_default = selectors;

// ../../js-packages/connection/state/store-holder.jsx
var import_data21 = __toESM(require_data(), 1);
var storeHolder = class _storeHolder {
  static store = null;
  static mayBeInit(storeId, storeConfig) {
    if (null === _storeHolder.store) {
      _storeHolder.store = (0, import_data21.createReduxStore)(storeId, storeConfig);
      (0, import_data21.register)(_storeHolder.store);
    }
  }
};
var store_holder_default = storeHolder;

// ../../js-packages/connection/state/store.jsx
var initialState = window.JP_CONNECTION_INITIAL_STATE || getScriptData()?.connection;
if (!initialState) {
  console.error(
    "Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."
  );
}
store_holder_default.mayBeInit(store_id_default, {
  __experimentalUseThunks: true,
  reducer: reducers_default,
  actions,
  selectors: selectors_default,
  resolvers: resolvers_default,
  controls: controls_default,
  initialState: initialState || {}
});

// ../../js-packages/connection/components/use-connection/index.ts
var initialState2 = window?.JP_CONNECTION_INITIAL_STATE || getScriptData()?.connection || {};
function useConnection({
  registrationNonce = initialState2.registrationNonce,
  apiRoot = initialState2.apiRoot,
  apiNonce = initialState2.apiNonce,
  redirectUri,
  autoTrigger,
  from,
  skipUserConnection,
  skipPricingPage
} = {}) {
  const { registerSite: registerSite2, connectUser: connectUser2, refreshConnectedPlugins: refreshConnectedPlugins2 } = (0, import_data22.useDispatch)(store_id_default);
  const registrationError2 = (0, import_data22.useSelect)(
    (select3) => select3(store_id_default).getRegistrationError(),
    []
  );
  const {
    siteIsRegistering: siteIsRegistering2,
    userIsConnecting: userIsConnecting2,
    userConnectionData: userConnectionData2,
    connectedPlugins: connectedPlugins2,
    connectionErrors: connectionErrors2,
    isRegistered,
    isUserConnected,
    hasConnectedOwner,
    isOfflineMode: isOfflineMode2
  } = (0, import_data22.useSelect)((select3) => {
    const connectionStatus2 = select3(store_id_default).getConnectionStatus();
    return {
      siteIsRegistering: select3(store_id_default).getSiteIsRegistering(),
      userIsConnecting: select3(store_id_default).getUserIsConnecting(),
      userConnectionData: select3(store_id_default).getUserConnectionData() || {},
      connectedPlugins: select3(store_id_default).getConnectedPlugins(),
      connectionErrors: select3(store_id_default).getConnectionErrors(),
      isOfflineMode: select3(store_id_default).getIsOfflineMode(),
      isRegistered: connectionStatus2.isRegistered ?? false,
      isUserConnected: connectionStatus2.isUserConnected ?? false,
      hasConnectedOwner: connectionStatus2.hasConnectedOwner ?? false
    };
  }, []);
  const handleConnectUser = () => {
    if (!skipUserConnection) {
      return connectUser2({ from, redirectUri, skipPricingPage });
    } else if (redirectUri) {
      window.location.href = redirectUri;
      return Promise.resolve(redirectUri);
    }
    return Promise.resolve();
  };
  const handleRegisterSite = (e2) => {
    e2 && e2.preventDefault();
    if (isRegistered) {
      return handleConnectUser();
    }
    return registerSite2({ registrationNonce, redirectUri, from }).then(() => {
      return handleConnectUser();
    });
  };
  (0, import_react24.useEffect)(() => {
    api_default.setApiRoot(apiRoot);
    api_default.setApiNonce(apiNonce);
  }, [apiRoot, apiNonce]);
  (0, import_react24.useEffect)(() => {
    if (autoTrigger && !siteIsRegistering2 && !userIsConnecting2) {
      handleRegisterSite();
    }
  }, []);
  return {
    handleRegisterSite,
    handleConnectUser,
    refreshConnectedPlugins: refreshConnectedPlugins2,
    isRegistered,
    isUserConnected,
    siteIsRegistering: siteIsRegistering2,
    userIsConnecting: userIsConnecting2,
    registrationError: registrationError2,
    userConnectionData: userConnectionData2,
    hasConnectedOwner,
    connectedPlugins: connectedPlugins2,
    connectionErrors: connectionErrors2,
    isOfflineMode: isOfflineMode2
  };
}

// ../../js-packages/shared-extension-utils/src/hooks/use-analytics.js
var import_element86 = __toESM(require_element());
var { tracks } = analytics_default;
var { recordEvent } = tracks;
var useAnalytics = ({
  pageViewEventName = null,
  pageViewNamespace = "jetpack",
  pageViewSuffix = "page_view",
  pageViewEventProperties = {}
} = {}) => {
  const [pageViewRecorded, setPageViewRecorded] = (0, import_element86.useState)(false);
  const { isUserConnected, isRegistered, userConnectionData: userConnectionData2 = {} } = useConnection();
  const { wpcomUser: { login, ID } = {}, blogId } = userConnectionData2.currentUser || {};
  const recordEventAsync = (0, import_element86.useCallback)(
    async (event, properties = {}) => {
      if (!(isUserConnected && ID && login)) {
        return;
      }
      recordEvent(event, properties);
    },
    [isUserConnected, ID, login]
  );
  (0, import_element86.useEffect)(() => {
    if (!isUserConnected || !ID || !login || !blogId) {
      return;
    }
    analytics_default.initialize(ID, login, {
      blog_id: blogId
    });
  }, [blogId, ID, login, isUserConnected]);
  (0, import_element86.useEffect)(() => {
    const pageViewEvent = pageViewEventName ? `${pageViewNamespace}_${pageViewEventName}_${pageViewSuffix}` : null;
    if (!isRegistered) {
      return;
    }
    if (!pageViewEvent) {
      return;
    }
    if (!pageViewRecorded) {
      recordEventAsync(pageViewEvent, pageViewEventProperties);
      setPageViewRecorded(true);
    }
  }, [
    pageViewRecorded,
    pageViewNamespace,
    pageViewEventName,
    pageViewSuffix,
    isRegistered,
    pageViewEventProperties,
    recordEventAsync
  ]);
  return {
    recordEvent: recordEventAsync,
    tracks
  };
};
var use_analytics_default = useAnalytics;

// ../../js-packages/shared-extension-utils/src/hooks/use-autosave-and-redirect/index.ts
var import_data23 = __toESM(require_data());
var import_element87 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/hooks/use-ref-interval.ts
var import_element88 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/hooks/use-module-status/index.js
var import_data26 = __toESM(require_data());
var import_element89 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/modules-state/index.js
var import_data25 = __toESM(require_data());

// ../../js-packages/shared-extension-utils/src/modules-state/actions.js
var import_data24 = __toESM(require_data());

// ../../js-packages/shared-extension-utils/src/modules-state/controls.js
var import_api_fetch9 = __toESM(require_api_fetch());
var FETCH_JETPACK_MODULES = "FETCH_JETPACK_MODULES";
var UPDATE_JETPACK_MODULE_STATUS = "UPDATE_JETPACK_MODULE_STATUS";
var fetchJetpackModules = () => {
  return {
    type: FETCH_JETPACK_MODULES
  };
};
var updateJetpackModuleStatus = (settings) => {
  return {
    type: UPDATE_JETPACK_MODULE_STATUS,
    settings
  };
};
var controls_default2 = {
  [FETCH_JETPACK_MODULES]: function() {
    return (0, import_api_fetch9.default)({
      path: `/jetpack/v4/module/all`,
      method: "GET"
    });
  },
  [UPDATE_JETPACK_MODULE_STATUS]: function({ settings }) {
    return (0, import_api_fetch9.default)({
      path: `/jetpack/v4/module/${settings.name}/active`,
      method: "POST",
      data: {
        active: settings.active
      }
    });
  }
};

// ../../js-packages/shared-extension-utils/src/modules-state/actions.js
var SET_JETPACK_MODULES = "SET_JETPACK_MODULES";
var SET_MODULE_UPDATING = "SET_MODULE_UPDATING";
function* updateJetpackModuleStatus2(settings) {
  try {
    yield setIsUpdating(settings.name, true);
    yield updateJetpackModuleStatus(settings);
    const data = yield fetchJetpackModules();
    yield setJetpackModules({ data });
    return true;
  } catch {
    const oldSettings = (0, import_data24.select)(JETPACK_MODULES_STORE_ID).getJetpackModules();
    yield setJetpackModules(oldSettings);
    return false;
  } finally {
    yield setIsUpdating(settings.name, false);
  }
}
function* fetchModules() {
  if (isSimpleSite()) {
    return true;
  }
  try {
    yield setIsLoading(true);
    const data = yield fetchJetpackModules();
    yield setJetpackModules({ data });
    return true;
  } catch {
    const oldSettings = (0, import_data24.select)(JETPACK_MODULES_STORE_ID).getJetpackModules();
    yield setJetpackModules(oldSettings);
    return false;
  } finally {
    yield setIsLoading(false);
  }
}
function setIsLoading(isLoading) {
  return setJetpackModules({ isLoading });
}
function setIsUpdating(name, isUpdating) {
  return { type: SET_MODULE_UPDATING, name, isUpdating };
}
function setJetpackModules(options) {
  return { type: SET_JETPACK_MODULES, options };
}
var actions_default = { updateJetpackModuleStatus: updateJetpackModuleStatus2, setJetpackModules, fetchModules };

// ../../js-packages/shared-extension-utils/src/modules-state/reducer.js
var defaultState = {
  isLoading: false,
  isUpdating: {},
  data: {}
};
var setModulesData = (state = defaultState, action) => {
  switch (action.type) {
    case "SET_JETPACK_MODULES":
      return {
        ...state,
        ...action.options
      };
    case "SET_MODULE_UPDATING":
      return {
        ...state,
        ...{
          isUpdating: {
            ...state.isUpdating,
            [action.name]: action.isUpdating
          }
        }
      };
  }
  return state;
};
var reducer_default2 = setModulesData;

// ../../js-packages/shared-extension-utils/src/modules-state/resolvers.js
function* getJetpackModules() {
  try {
    yield setIsLoading(true);
    const data = yield fetchJetpackModules();
    if (data) {
      return setJetpackModules({ data });
    }
  } catch (e2) {
    console.error(e2);
  } finally {
    yield setIsLoading(false);
  }
}
var resolvers_default2 = { getJetpackModules };

// ../../js-packages/shared-extension-utils/src/modules-state/selectors.js
var jetpackModulesSelectors = {
  getJetpackModules: (state) => state.data,
  // We consider simple sites to have all modules active
  // TODO: we would remove this when wrapping logic with hooks
  isModuleActive: (state, moduleName) => isSimpleSite() || (state?.data?.[moduleName]?.activated ?? false),
  areModulesLoading: (state) => state.isLoading ?? false,
  isModuleUpdating: (state, moduleName) => state?.isUpdating?.[moduleName] ?? false
};
var selectors_default2 = jetpackModulesSelectors;

// ../../js-packages/shared-extension-utils/src/modules-state/index.js
var JETPACK_MODULES_STORE_ID = "jetpack-modules";
var store4 = (0, import_data25.createReduxStore)(JETPACK_MODULES_STORE_ID, {
  reducer: reducer_default2,
  actions: actions_default,
  controls: controls_default2,
  resolvers: resolvers_default2,
  selectors: selectors_default2
});
(0, import_data25.register)(store4);
var initialData = window?.Initial_State?.getModules || // Jetpack Dashboard
window?.Jetpack_Editor_Initial_State?.modules || // Gutenberg
null;
if (initialData !== null) {
  (0, import_data25.dispatch)(JETPACK_MODULES_STORE_ID).setJetpackModules({
    data: { ...initialData }
  });
}

// ../../js-packages/shared-extension-utils/src/get-block-icon-from-metadata.js
var import_element90 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/libs/connection/index.ts
var import_debug4 = __toESM(require_browser());
var initialState3 = window?.JP_CONNECTION_INITIAL_STATE;
var debug4 = (0, import_debug4.default)("shared-extension-utils:connection");

// ../../js-packages/shared-extension-utils/src/hooks/use-upgrade-flow/index.js
var import_data27 = __toESM(require_data());
var import_hooks = __toESM(require_hooks());

// ../../js-packages/shared-extension-utils/src/block-editor-actions.js
var import_dom_ready = __toESM(require_dom_ready());

// src/dashboard/components/export-responses/csv.tsx
var import_components71 = __toESM(require_components(), 1);
var import_element91 = __toESM(require_element(), 1);
var import_i18n76 = __toESM(require_i18n(), 1);
var import_jsx_runtime157 = __toESM(require_jsx_runtime(), 1);
var CSVExport = ({ onExport }) => {
  const { tracks: tracks2 } = use_analytics_default();
  const downloadCSV = (0, import_element91.useCallback)(() => {
    tracks2.recordEvent("jetpack_forms_export_click", {
      destination: "csv",
      screen: "form-responses-inbox"
    });
    onExport("feedback_export", "feedback_export_nonce_csv").then(async (response) => {
      const blob = await response.blob();
      const a2 = document.createElement("a");
      a2.href = window.URL.createObjectURL(blob);
      const contentDispositionHeader = response.headers.get("Content-Disposition") ?? "";
      a2.download = contentDispositionHeader.split("filename=")[1] || "Jetpack Form Responses.csv";
      document.body.appendChild(a2);
      a2.click();
      document.body.removeChild(a2);
      window.URL.revokeObjectURL(a2.href);
    });
  }, [onExport, tracks2]);
  const buttonClasses = clsx_default("button", "export-button", "export-csv");
  return /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "jp-forms__export-modal-card", children: [
    /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "jp-forms__export-modal-card-header", children: [
      /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
        import_components71.SVG,
        {
          width: "22",
          height: "20",
          viewBox: "0 0 22 20",
          fill: "none",
          xmlns: "http://www.w3.org/2000/SVG",
          children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            import_components71.Path,
            {
              fillRule: "evenodd",
              clipRule: "evenodd",
              d: "M11.2309 5.04199L10.0797 2.73945C9.98086 2.54183 9.77887 2.41699 9.55792 2.41699H2.83333C2.51117 2.41699 2.25 2.67816 2.25 3.00033V16.7087C2.25 17.0308 2.51117 17.292 2.83333 17.292H19.1667C19.4888 17.292 19.75 17.0308 19.75 16.7087V5.62533C19.75 5.30316 19.4888 5.04199 19.1667 5.04199H11.2309ZM12.3125 3.29199L11.6449 1.95683C11.2497 1.16633 10.4417 0.666992 9.55792 0.666992H2.83333C1.54467 0.666992 0.5 1.71166 0.5 3.00033V16.7087C0.5 17.9973 1.54467 19.042 2.83333 19.042H19.1667C20.4553 19.042 21.5 17.9973 21.5 16.7087V5.62533C21.5 4.33666 20.4553 3.29199 19.1667 3.29199H12.3125Z",
              fill: "#008710"
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "jp-forms__export-modal-card-header-title", children: (0, import_i18n76.__)("CSV File", "jetpack-forms") })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)("div", { className: "jp-forms__export-modal-card-body", children: [
      /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "jp-forms__export-modal-card-body-description", children: (0, import_i18n76.__)("Download your form response data as a CSV file.", "jetpack-forms") }),
      /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("div", { className: "jp-forms__export-modal-card-body-cta", children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_components71.Button, { variant: "primary", className: buttonClasses, onClick: downloadCSV, children: (0, import_i18n76.__)("Download", "jetpack-forms") }) })
    ] })
  ] });
};
var csv_default = CSVExport;

// src/dashboard/components/export-responses/google-drive.tsx
var import_components72 = __toESM(require_components(), 1);
var import_data28 = __toESM(require_data(), 1);
var import_element92 = __toESM(require_element(), 1);
var import_i18n77 = __toESM(require_i18n(), 1);

// src/util/get-preferred-responses-view.js
var PARTIAL_RESPONSES_PATH = "admin.php?page=jetpack-forms-admin";
var FULL_RESPONSES_PATH = getJetpackData()?.adminUrl + PARTIAL_RESPONSES_PATH;

// src/dashboard/components/export-responses/google-drive.tsx
var import_jsx_runtime158 = __toESM(require_jsx_runtime(), 1);
var GoogleDriveExport = ({ onExport, autoConnect = false }) => {
  const [isExporting, setIsExporting] = (0, import_element92.useState)(false);
  const { integration } = (0, import_data28.useSelect)((select3) => {
    const store5 = select3(INTEGRATIONS_STORE);
    const list = store5.getIntegrations() || [];
    return { integration: list.find((i2) => i2.id === "google-drive") };
  }, []);
  const { refreshIntegrations: refreshIntegrations2 } = (0, import_data28.useDispatch)(INTEGRATIONS_STORE);
  const isConnectedToGoogleDrive = !!integration?.isConnected;
  const gdriveConnectSupportURL = useConfigValue("gdriveConnectSupportURL");
  const { tracks: tracks2 } = use_analytics_default();
  const autoConnectOpened = (0, import_element92.useRef)(false);
  const [isTogglingConnection, setIsTogglingConnection] = (0, import_element92.useState)(false);
  const { isUserConnected, handleConnectUser, userIsConnecting: userIsConnecting2, isOfflineMode: isOfflineMode2 } = useConnection({
    redirectUri: PARTIAL_RESPONSES_PATH + "&connect-gdrive=true"
  });
  const needsUserConnection = !isSimpleSite() && !isUserConnected;
  const exportToGoogleDrive = (0, import_element92.useCallback)(() => {
    if (isExporting) {
      return;
    }
    setIsExporting(true);
    tracks2.recordEvent("jetpack_forms_export_click", {
      destination: "google-drive",
      screen: "form-responses-inbox"
    });
    onExport("grunion_export_to_gdrive", "feedback_export_nonce_gdrive").then((response) => response.json()).then(({ data }) => {
      window.open(data.sheet_link, "_blank");
    }).finally(() => {
      setIsExporting(false);
    });
  }, [tracks2, onExport, isExporting]);
  const handleConnectClick = (0, import_element92.useCallback)(() => {
    if (!integration?.settingsUrl) return;
    tracks2.recordEvent("jetpack_forms_upsell_googledrive_click", {
      screen: "form-responses-inbox"
    });
    setIsTogglingConnection(true);
    esm_default2(integration?.settingsUrl, ({ keyring_id: keyringId }) => {
      if (keyringId) {
        refreshIntegrations2();
      } else {
        setIsTogglingConnection(false);
      }
    });
  }, [tracks2, integration?.settingsUrl, refreshIntegrations2]);
  if (isOfflineMode2) {
    return null;
  }
  const buttonClasses = clsx_default("button", "export-button", "export-gdrive");
  return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "jp-forms__export-modal-card", children: [
    /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "jp-forms__export-modal-card-header", children: [
      /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
        import_components72.SVG,
        {
          width: "18",
          height: "24",
          viewBox: "0 0 18 24",
          fill: "none",
          xmlns: "http://www.w3.org/2000/SVG",
          children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
            import_components72.Path,
            {
              d: "M11.8387 1.16016H2C1.44772 1.16016 1 1.60787 1 2.16016V21.8053V21.8376C1 22.3899 1.44772 22.8376 2 22.8376H16C16.5523 22.8376 17 22.3899 17 21.8376V5.80532M11.8387 1.16016V5.80532H17M11.8387 1.16016L17 5.80532M4.6129 13.0311V16.1279H9.25806M4.6129 13.0311V9.93435H9.25806M4.6129 13.0311H13.9032M13.9032 13.0311V9.93435H9.25806M13.9032 13.0311V16.1279H9.25806M9.25806 9.93435V16.1279",
              stroke: "#008710",
              strokeWidth: "1.5"
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "jp-forms__export-modal-card-header-title", children: (0, import_i18n77.__)("Google Sheets", "jetpack-forms") })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { className: "jp-forms__export-modal-card-body", children: [
      /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "jp-forms__export-modal-card-body-description", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)("div", { children: [
        (0, import_i18n77.__)("Export your data into a Google Sheets file.", "jetpack-forms"),
        !isConnectedToGoogleDrive && /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
          "\xA0",
          /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
            "a",
            {
              href: gdriveConnectSupportURL,
              title: (0, import_i18n77.__)("Connect to Google Drive", "jetpack-forms"),
              target: "_blank",
              rel: "noopener noreferrer",
              children: (0, import_i18n77.__)("You need to connect to Google Drive.", "jetpack-forms")
            }
          )
        ] })
      ] }) }),
      /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("div", { className: "jp-forms__export-modal-card-body-cta", children: !integration ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(import_components72.Spinner, {}) : /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_jsx_runtime158.Fragment, { children: [
        isConnectedToGoogleDrive && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
          import_components72.Button,
          {
            className: buttonClasses,
            variant: "primary",
            onClick: exportToGoogleDrive,
            isBusy: isExporting,
            children: (0, import_i18n77.__)("Export", "jetpack-forms")
          }
        ),
        !isConnectedToGoogleDrive && needsUserConnection && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
          import_components72.Button,
          {
            className: buttonClasses,
            variant: "primary",
            rel: "noopener noreferrer",
            target: "_blank",
            onClick: handleConnectUser,
            isBusy: userIsConnecting2,
            children: (0, import_i18n77.__)("Connect Jetpack user account", "jetpack-forms")
          }
        ),
        !isConnectedToGoogleDrive && !needsUserConnection && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
          import_components72.Button,
          {
            className: buttonClasses,
            variant: "primary",
            rel: "noopener noreferrer",
            target: "_blank",
            onClick: handleConnectClick,
            disabled: !integration?.settingsUrl || isTogglingConnection,
            ref: (el) => {
              if (autoConnect && !autoConnectOpened.current) {
                el?.click();
                autoConnectOpened.current = true;
              }
            },
            children: isTogglingConnection ? (0, import_i18n77.__)("Connecting\u2026", "jetpack-forms") : (0, import_i18n77._x)(
              "Connect to Google Drive",
              "",
              // Dummy context to avoid bad minification. See https://github.com/Automattic/jetpack/tree/e3f007ec7ac80715f3d82db33c9ed8098a7b45b4/projects/js-packages/i18n-check-webpack-plugin#conditional-function-call-compaction
              "jetpack-forms"
            )
          }
        )
      ] }) })
    ] })
  ] });
};
var google_drive_default = GoogleDriveExport;

// src/dashboard/components/export-responses/modal.tsx
var import_jsx_runtime159 = __toESM(require_jsx_runtime(), 1);
var ExportResponsesModal = ({
  onRequestClose,
  onExport,
  autoConnectGdrive
}) => {
  const { integrations } = (0, import_data29.useSelect)((select3) => {
    const store5 = select3(INTEGRATIONS_STORE);
    return {
      integrations: store5.getIntegrations() || []
    };
  }, []);
  const isGoogleDriveEnabled = integrations.some(
    (integration) => integration.id === "google-drive"
  );
  return /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(
    import_components73.Modal,
    {
      title: (0, import_i18n78.__)("Export responses", "jetpack-forms"),
      onRequestClose,
      size: "large",
      children: /* @__PURE__ */ (0, import_jsx_runtime159.jsxs)(import_components73.__experimentalVStack, { spacing: 8, children: [
        /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(csv_default, { onExport }),
        isGoogleDriveEnabled && /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(google_drive_default, { onExport, autoConnect: autoConnectGdrive })
      ] })
    }
  );
};
var modal_default = ExportResponsesModal;

// src/dashboard/components/export-responses/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='734b1cba81']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "734b1cba81");
  style.appendChild(document.createTextNode(".jp-forms__export-modal-card{border-radius:var(--jp-border-radius,4px);box-shadow:0 0 0 1px var(--jp-gray-10,#c3c4c7) inset;display:flex;flex-direction:column;isolation:isolate;padding:24px}.jp-forms__export-modal-card-body,.jp-forms__export-modal-card-header{display:flex}.jp-forms__export-modal-card-header{align-items:center;gap:16px;margin-bottom:16px}.jp-forms__export-modal-card-header-title{font-size:20px;font-style:normal;font-weight:700;line-height:30px}.jp-forms__export-modal-card-body{align-items:flex-start;flex-direction:column;gap:20px}@media (min-width:783px){.jp-forms__export-modal-card-body{align-items:center;flex-direction:row;gap:32px;justify-content:space-between}}.jp-forms__export-modal-card-body-description{color:#000;flex-grow:1;font-size:14px;font-style:normal;font-weight:400;letter-spacing:-.02em;line-height:24px;max-width:100%}@media (min-width:783px){.jp-forms__export-modal-card-body-description{max-width:60%}}.jp-forms__export-modal-card-body-description a{color:inherit}.jp-forms__export-modal-card-body-cta{align-self:flex-start}@media (min-width:783px){.jp-forms__export-modal-card-body-cta{align-self:flex-end}}.jp-forms__export-modal-card-body-cta a.export-gdrive{display:flex}"));
  document.head.appendChild(style);
}

// src/dashboard/components/export-responses/button.tsx
var import_jsx_runtime160 = __toESM(require_jsx_runtime(), 1);
var ExportResponsesButton = ({
  isPrimary = false,
  showIcon = true
}) => {
  const {
    showExportModal,
    openModal,
    closeModal,
    userCanExport,
    onExport,
    autoConnectGdrive,
    exportLabel
  } = useExportResponses();
  const { totalItems, isLoadingData } = useInboxData();
  const isEmpty4 = isLoadingData || totalItems === 0;
  const isDisabled = isEmpty4 || userCanExport === false;
  if (userCanExport === false) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime160.jsxs)(import_jsx_runtime160.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
      import_components74.Button,
      {
        size: "compact",
        variant: isPrimary ? "primary" : "secondary",
        icon: showIcon ? download_default : void 0,
        onClick: openModal,
        accessibleWhenDisabled: true,
        disabled: isDisabled,
        label: isEmpty4 ? (0, import_i18n79.__)("Nothing to export.", "jetpack-forms") : "",
        showTooltip: isEmpty4,
        children: exportLabel
      }
    ),
    showExportModal && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(
      modal_default,
      {
        onRequestClose: closeModal,
        onExport,
        autoConnectGdrive
      }
    )
  ] });
};
var button_default = ExportResponsesButton;

// src/dashboard/wp-build/components/manage-integrations-button/index.tsx
var import_components75 = __toESM(require_components(), 1);
var import_i18n80 = __toESM(require_i18n(), 1);
var import_jsx_runtime161 = __toESM(require_jsx_runtime(), 1);
function ManageIntegrationsButton({ onClick }) {
  return /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(import_components75.Button, { size: "compact", variant: "secondary", onClick, children: (0, import_i18n80.__)("Manage integrations", "jetpack-forms") });
}

// src/dashboard/wp-build/hooks/use-form-item-actions.ts
var import_api_fetch10 = __toESM(require_api_fetch(), 1);
var import_data31 = __toESM(require_data(), 1);
var import_element94 = __toESM(require_element(), 1);
var import_i18n83 = __toESM(require_i18n(), 1);
var import_notices5 = __toESM(require_notices(), 1);

// src/dashboard/wp-build/hooks/use-duplicate-form.ts
var import_data30 = __toESM(require_data(), 1);
var import_element93 = __toESM(require_element(), 1);
var import_i18n82 = __toESM(require_i18n(), 1);
var import_notices4 = __toESM(require_notices(), 1);

// src/blocks/shared/util/constants.js
var import_i18n81 = __toESM(require_i18n(), 1);
var currentYear = (/* @__PURE__ */ new Date()).getFullYear();
var DATE_FORMATS = [
  {
    value: "mm/dd/yy",
    /* translators: date format. DD is the day of the month, MM the month, and YYYY the year (e.g., 12/31/2023). */
    label: (0, import_i18n81.__)("MM/DD/YYYY", "jetpack-forms"),
    example: `12/31/${currentYear}`
  },
  {
    value: "dd/mm/yy",
    /* translators: date format. DD is the day of the month, MM the month, and YYYY the year (e.g., 31/12/2023). */
    label: (0, import_i18n81.__)("DD/MM/YYYY", "jetpack-forms"),
    example: `21/12/${currentYear}`
  },
  {
    value: "yy-mm-dd",
    /* translators: date format. DD is the day of the month, MM the month, and YYYY the year (e.g., 2023-12-31). */
    label: (0, import_i18n81.__)("YYYY-MM-DD", "jetpack-forms"),
    example: `${currentYear}-12-31`
  }
];
var DATE_FORMAT_OPTIONS = DATE_FORMATS.map(
  ({ value, label: optionLabel, example }) => ({
    label: `${optionLabel} (${example})`,
    value
  })
);
var FORM_SOURCE_META_KEY = "_jetpack_forms_source_post_id";

// src/dashboard/wp-build/hooks/use-duplicate-form.ts
function useDuplicateForm() {
  const [isDuplicating, setIsDuplicating] = (0, import_element93.useState)(false);
  const { createSuccessNotice, createErrorNotice } = (0, import_data30.useDispatch)(import_notices4.store);
  const { saveEntityRecord } = (0, import_data30.useDispatch)("core");
  const adminUrl = useConfigValue("adminUrl") || "";
  const duplicateForm = (0, import_element93.useCallback)(
    async (item) => {
      if (isDuplicating) {
        return;
      }
      if (!item?.id) {
        return;
      }
      setIsDuplicating(true);
      try {
        const original = await (0, import_data30.resolveSelect)("core").getEntityRecord(
          "postType",
          "jetpack_form",
          item.id,
          { context: "edit" }
        );
        if (!original) {
          createErrorNotice(
            (0, import_i18n82.__)("Could not load the form to duplicate. Please try again.", "jetpack-forms"),
            {
              type: "snackbar"
            }
          );
          return;
        }
        const raw = original.content?.raw;
        const originalContentRaw = typeof raw === "string" ? raw : "";
        const originalTitle = item.title || (0, import_i18n82.__)("Untitled Form", "jetpack-forms");
        const newTitle = (0, import_i18n82.sprintf)(
          /* translators: %s: original form title */
          (0, import_i18n82.__)("%s Copy", "jetpack-forms"),
          originalTitle
        );
        const created = await saveEntityRecord(
          "postType",
          "jetpack_form",
          {
            title: newTitle,
            // Duplicate the raw block content so the form is an exact copy.
            content: originalContentRaw,
            status: "publish",
            meta: {
              [FORM_SOURCE_META_KEY]: item.id
            }
          },
          { throwOnError: true }
        );
        const createdId = created?.id;
        if (!createdId) {
          createErrorNotice((0, import_i18n82.__)("Could not duplicate form. Please try again.", "jetpack-forms"), {
            type: "snackbar"
          });
          return;
        }
        createSuccessNotice((0, import_i18n82.__)("Form duplicated.", "jetpack-forms"), {
          type: "snackbar",
          actions: [
            {
              label: (0, import_i18n82.__)("Edit", "jetpack-forms"),
              onClick: () => {
                if (adminUrl) {
                  window.location.href = `${adminUrl}post.php?post=${createdId}&action=edit&post_type=jetpack_form`;
                }
              }
            }
          ]
        });
      } catch {
        createErrorNotice((0, import_i18n82.__)("Could not duplicate form. Please try again.", "jetpack-forms"), {
          type: "snackbar"
        });
      } finally {
        setIsDuplicating(false);
      }
    },
    [createErrorNotice, createSuccessNotice, adminUrl, isDuplicating, saveEntityRecord]
  );
  return { duplicateForm, isDuplicating };
}

// src/dashboard/wp-build/hooks/use-form-item-actions.ts
function useFormItemActions() {
  const { createSuccessNotice, createErrorNotice } = (0, import_data31.useDispatch)(import_notices5.store);
  const { duplicateForm, isDuplicating } = useDuplicateForm();
  const previewForm = (0, import_element94.useCallback)(async (item) => {
    try {
      const response = await (0, import_api_fetch10.default)({
        path: `/wp/v2/jetpack-forms/${item.id}/preview-url`
      });
      window.open(response.preview_url, "_blank");
    } catch (error2) {
      console.error("Failed to get preview URL:", error2);
    }
  }, []);
  const copyEmbed = (0, import_element94.useCallback)(
    async (item) => {
      const embedCode = `<!-- wp:jetpack/contact-form {"ref":${item.id}} /-->`;
      try {
        await navigator.clipboard.writeText(embedCode);
        createSuccessNotice((0, import_i18n83.__)("Embed code copied to clipboard.", "jetpack-forms"), {
          type: "snackbar"
        });
      } catch {
        createErrorNotice((0, import_i18n83.__)("Failed to copy embed code. Please try again.", "jetpack-forms"), {
          type: "snackbar"
        });
      }
    },
    [createErrorNotice, createSuccessNotice]
  );
  const copyShortcode = (0, import_element94.useCallback)(
    async (item) => {
      const shortcode = `[contact-form ref="${item.id}"]`;
      try {
        await navigator.clipboard.writeText(shortcode);
        createSuccessNotice((0, import_i18n83.__)("Shortcode copied to clipboard.", "jetpack-forms"), {
          type: "snackbar"
        });
      } catch {
        createErrorNotice((0, import_i18n83.__)("Failed to copy shortcode. Please try again.", "jetpack-forms"), {
          type: "snackbar"
        });
      }
    },
    [createErrorNotice, createSuccessNotice]
  );
  return { duplicateForm, previewForm, copyEmbed, copyShortcode, isDuplicating };
}

// src/dashboard/wp-build/hooks/use-page-header-details.tsx
var import_jsx_runtime162 = __toESM(require_jsx_runtime(), 1);
function usePageHeaderDetails(props) {
  const {
    screen,
    sourceId,
    formsCount,
    isIntegrationsEnabled,
    showDashboardIntegrations,
    onOpenIntegrations,
    onOpenFormsHelp
  } = props;
  const statusView = props.statusView ?? "inbox";
  const sourceIdNumber = (0, import_element95.useMemo)(() => {
    const value = sourceId;
    const numberValue = typeof value === "number" ? value : Number(value);
    return Number.isFinite(numberValue) && numberValue > 0 ? numberValue : null;
  }, [sourceId]);
  const [isSm] = use_breakpoint_match_default("sm");
  const isFormsScreen = screen === "forms";
  const isSingleFormScreen = screen === "responses" && sourceIdNumber !== null;
  const { openNewForm } = useCreateForm();
  const {
    showExportModal,
    openModal: openExportModal,
    closeModal: closeExportModal,
    onExport,
    autoConnectGdrive,
    exportLabel
  } = useExportResponses();
  const { totalItems, isLoadingData } = useInboxData();
  const hasResponses = !isLoadingData && totalItems > 0;
  const emptySpam = useEmptySpam();
  const emptyTrash = useEmptyTrash();
  const formRecord = (0, import_data32.useSelect)(
    (select3) => sourceIdNumber ? select3(import_core_data6.store).getEntityRecord(
      "postType",
      "jetpack_form",
      sourceIdNumber
    ) : void 0,
    [sourceIdNumber]
  );
  const formTitle = (0, import_element95.useMemo)(() => {
    const rendered = formRecord?.title?.rendered || "";
    return (0, import_html_entities4.decodeEntities)(rendered);
  }, [formRecord?.title?.rendered]);
  const formStatus = formRecord?.status;
  const statusLabel = (0, import_element95.useMemo)(() => {
    switch (formStatus) {
      case "publish":
        return (0, import_i18n84.__)("Published", "jetpack-forms");
      case "draft":
        return (0, import_i18n84.__)("Draft", "jetpack-forms");
      case "pending":
        return (0, import_i18n84.__)("Pending review", "jetpack-forms");
      case "future":
        return (0, import_i18n84.__)("Scheduled", "jetpack-forms");
      case "private":
        return (0, import_i18n84.__)("Private", "jetpack-forms");
      default:
        return formStatus;
    }
  }, [formStatus]);
  const badges = (0, import_element95.useMemo)(() => {
    if (!isSingleFormScreen || !formStatus || formStatus === "publish") {
      return void 0;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(Badge3, { intent: "draft", children: statusLabel });
  }, [isSingleFormScreen, formStatus, statusLabel]);
  const { duplicateForm, previewForm, copyEmbed, copyShortcode } = useFormItemActions();
  const formItemControls = (0, import_element95.useMemo)(() => {
    if (!sourceIdNumber) {
      return [];
    }
    const formItem = { id: sourceIdNumber, title: formTitle };
    const controls = [
      {
        title: (0, import_i18n84.__)("Duplicate", "jetpack-forms"),
        onClick: () => duplicateForm(formItem)
      },
      {
        title: (0, import_i18n84.__)("Preview", "jetpack-forms"),
        onClick: () => previewForm(formItem)
      }
    ];
    if (navigator?.clipboard) {
      controls.push(
        {
          title: (0, import_i18n84.__)("Copy embed", "jetpack-forms"),
          onClick: () => copyEmbed(formItem)
        },
        {
          title: (0, import_i18n84.__)("Copy shortcode", "jetpack-forms"),
          onClick: () => copyShortcode(formItem)
        }
      );
    }
    return controls;
  }, [sourceIdNumber, formTitle, duplicateForm, previewForm, copyEmbed, copyShortcode]);
  const breadcrumbsItems = (0, import_element95.useMemo)(() => {
    if (isSingleFormScreen) {
      return [
        { label: (0, import_i18n84.__)("Forms", "jetpack-forms"), to: "/forms" },
        { label: formTitle || (0, import_i18n84.__)("Form responses", "jetpack-forms") }
      ];
    }
    return [{ label: (0, import_i18n84.__)("Forms", "jetpack-forms") }];
  }, [formTitle, isSingleFormScreen]);
  const breadcrumbs = (0, import_element95.useMemo)(() => {
    return /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(Stack3, { align: "center", gap: "xs", children: [
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(jetpack_logo_default, { showText: false, width: 20 }),
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(breadcrumbs_default, { items: breadcrumbsItems })
    ] });
  }, [breadcrumbsItems]);
  const subtitle = (0, import_element95.useMemo)(() => {
    if (isFormsScreen) {
      const shortMessage = (0, import_i18n84.__)("View and manage all your forms.", "jetpack-forms");
      const longMessage = (0, import_i18n84.__)("View and manage all your forms in one place.", "jetpack-forms");
      const shouldShowFormsHelpLink = !!onOpenFormsHelp && (typeof formsCount !== "number" || formsCount < 5);
      return shouldShowFormsHelpLink ? /* @__PURE__ */ (0, import_jsx_runtime162.jsxs)(import_jsx_runtime162.Fragment, { children: [
        shortMessage,
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(import_components76.Button, { variant: "link", onClick: onOpenFormsHelp, children: (0, import_i18n84.__)("Missing forms?", "jetpack-forms") })
      ] }) : longMessage;
    }
    if (isSingleFormScreen) {
      if (formTitle) {
        return (0, import_i18n84.sprintf)(
          /* translators: %s: form name */
          (0, import_i18n84.__)("View responses for %s.", "jetpack-forms"),
          formTitle
        );
      }
      return (0, import_i18n84.__)("View responses for this form.", "jetpack-forms");
    }
    return (0, import_i18n84.__)("View and manage all your form responses in one place.", "jetpack-forms");
  }, [formTitle, isFormsScreen, isSingleFormScreen, onOpenFormsHelp, formsCount]);
  const actions2 = (0, import_element95.useMemo)(() => {
    if (isSm) {
      const dropdownControls = [];
      if (isFormsScreen) {
        if (isIntegrationsEnabled && showDashboardIntegrations) {
          dropdownControls.push({
            onClick: onOpenIntegrations,
            title: (0, import_i18n84.__)("Manage integrations", "jetpack-forms")
          });
        }
        dropdownControls.push({
          onClick: () => openNewForm({}),
          title: (0, import_i18n84.__)("Create a form", "jetpack-forms")
        });
      } else if (isSingleFormScreen) {
        if (statusView === "inbox" && sourceIdNumber) {
          dropdownControls.push({
            onClick: () => {
              const fallbackEditUrl = `post.php?post=${sourceIdNumber}&action=edit&post_type=jetpack_form`;
              const url = new URL(fallbackEditUrl, window.location.origin);
              window.location.href = url.toString();
            },
            title: (0, import_i18n84.__)("Edit form", "jetpack-forms")
          });
        }
        dropdownControls.push({
          onClick: openExportModal,
          title: exportLabel,
          isDisabled: !hasResponses
        });
        if (statusView === "trash") {
          dropdownControls.push({
            onClick: emptyTrash.openConfirmDialog,
            title: (0, import_i18n84.__)("Empty trash", "jetpack-forms"),
            isDisabled: emptyTrash.isEmpty || emptyTrash.isEmptying
          });
        }
        if (statusView === "spam") {
          dropdownControls.push({
            onClick: emptySpam.openConfirmDialog,
            title: (0, import_i18n84.__)("Delete spam", "jetpack-forms"),
            isDisabled: emptySpam.isEmpty || emptySpam.isEmptying
          });
        }
        dropdownControls.push(...formItemControls);
      } else {
        if (statusView === "inbox" && isIntegrationsEnabled && showDashboardIntegrations) {
          dropdownControls.push({
            onClick: onOpenIntegrations,
            title: (0, import_i18n84.__)("Manage integrations", "jetpack-forms")
          });
        }
        if (statusView === "inbox") {
          dropdownControls.push({
            onClick: () => openNewForm({ showPatterns: false }),
            title: (0, import_i18n84.__)("Create a form", "jetpack-forms")
          });
        }
        dropdownControls.push({
          onClick: openExportModal,
          title: exportLabel,
          isDisabled: !hasResponses
        });
        if (statusView === "trash") {
          dropdownControls.push({
            onClick: emptyTrash.openConfirmDialog,
            title: (0, import_i18n84.__)("Empty trash", "jetpack-forms"),
            isDisabled: emptyTrash.isEmpty || emptyTrash.isEmptying
          });
        }
        if (statusView === "spam") {
          dropdownControls.push({
            onClick: emptySpam.openConfirmDialog,
            title: (0, import_i18n84.__)("Delete spam", "jetpack-forms"),
            isDisabled: emptySpam.isEmpty || emptySpam.isEmptying
          });
        }
      }
      if (dropdownControls.length === 0) {
        return null;
      }
      return [
        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
          import_components76.DropdownMenu,
          {
            controls: dropdownControls,
            icon: more_vertical_default,
            label: (0, import_i18n84.__)("More actions", "jetpack-forms"),
            toggleProps: { size: "compact" }
          },
          "actions-menu"
        ),
        // Include modals when on mobile
        ...showExportModal ? [
          /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            modal_default,
            {
              onRequestClose: closeExportModal,
              onExport,
              autoConnectGdrive
            },
            "export-modal"
          )
        ] : [],
        ...emptyTrash.isConfirmDialogOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            EmptyTrashConfirmationModal,
            {
              isOpen: emptyTrash.isConfirmDialogOpen,
              onCancel: emptyTrash.closeConfirmDialog,
              onConfirm: emptyTrash.onConfirmEmptying,
              totalItemsTrash: emptyTrash.totalItemsTrash,
              selectedResponsesCount: emptyTrash.selectedResponsesCount
            },
            "empty-trash-confirm"
          )
        ] : [],
        ...emptySpam.isConfirmDialogOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            EmptySpamConfirmationModal,
            {
              isOpen: emptySpam.isConfirmDialogOpen,
              onCancel: emptySpam.closeConfirmDialog,
              onConfirm: emptySpam.onConfirmEmptying,
              totalItemsSpam: emptySpam.totalItemsSpam,
              selectedResponsesCount: emptySpam.selectedResponsesCount
            },
            "empty-spam-confirm"
          )
        ] : []
      ];
    }
    if (isFormsScreen) {
      return [
        ...isIntegrationsEnabled && showDashboardIntegrations ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(ManageIntegrationsButton, { onClick: onOpenIntegrations }, "integrations")] : [],
        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(CreateFormButton, { variant: "primary", showIcon: false }, "create")
      ];
    }
    if (isSingleFormScreen) {
      return [
        ...sourceIdNumber ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(EditFormButton, { formId: sourceIdNumber }, "edit-form")] : [],
        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
          button_default,
          {
            isPrimary: statusView === "inbox",
            showIcon: false
          },
          "export"
        ),
        ...statusView === "trash" ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(empty_trash_button_default, {}, "empty-trash")] : [],
        ...statusView === "spam" ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(empty_spam_button_default, {}, "empty-spam")] : [],
        ...formItemControls.length > 0 ? [
          /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
            import_components76.DropdownMenu,
            {
              controls: formItemControls,
              icon: more_vertical_default,
              label: (0, import_i18n84.__)("More actions", "jetpack-forms"),
              toggleProps: { size: "compact" }
            },
            "form-actions-menu"
          )
        ] : []
      ];
    }
    return [
      ...statusView === "inbox" && isIntegrationsEnabled && showDashboardIntegrations ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(ManageIntegrationsButton, { onClick: onOpenIntegrations }, "integrations")] : [],
      ...statusView === "inbox" ? [
        /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
          CreateFormButton,
          {
            variant: "secondary",
            showPatterns: false,
            showIcon: false
          },
          "create"
        )
      ] : [],
      /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
        button_default,
        {
          isPrimary: statusView === "inbox",
          showIcon: false
        },
        "export"
      ),
      ...statusView === "trash" ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(empty_trash_button_default, {}, "empty-trash")] : [],
      ...statusView === "spam" ? [/* @__PURE__ */ (0, import_jsx_runtime162.jsx)(empty_spam_button_default, {}, "empty-spam")] : []
    ];
  }, [
    isSm,
    isIntegrationsEnabled,
    onOpenIntegrations,
    showDashboardIntegrations,
    sourceIdNumber,
    isFormsScreen,
    isSingleFormScreen,
    formItemControls,
    statusView,
    openNewForm,
    openExportModal,
    showExportModal,
    closeExportModal,
    onExport,
    autoConnectGdrive,
    hasResponses,
    exportLabel,
    emptyTrash.openConfirmDialog,
    emptyTrash.isEmpty,
    emptyTrash.isEmptying,
    emptyTrash.isConfirmDialogOpen,
    emptyTrash.closeConfirmDialog,
    emptyTrash.onConfirmEmptying,
    emptyTrash.totalItemsTrash,
    emptyTrash.selectedResponsesCount,
    emptySpam.openConfirmDialog,
    emptySpam.isEmpty,
    emptySpam.isEmptying,
    emptySpam.isConfirmDialogOpen,
    emptySpam.closeConfirmDialog,
    emptySpam.onConfirmEmptying,
    emptySpam.totalItemsSpam,
    emptySpam.selectedResponsesCount
  ]);
  return { breadcrumbs, badges, subtitle, actions: actions2 };
}

// routes/responses/actions.tsx
var import_api_fetch11 = __toESM(require_api_fetch());
var import_components77 = __toESM(require_components());
var import_core_data7 = __toESM(require_core_data());
var import_i18n85 = __toESM(require_i18n());
var import_notices6 = __toESM(require_notices());

// src/dashboard/icons/not-spam.tsx
var import_primitives44 = __toESM(require_primitives(), 1);
var import_jsx_runtime163 = __toESM(require_jsx_runtime(), 1);
var notSpam = /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_primitives44.Path, { d: "M13 17v-2h-.9l-.9 2H13Zm3.6-11.9-.7 1.5 2.5 2.5v5.8l-3.6 3.6h-4.3L9.8 20h5.6l4.5-4.5v-7l-3.4-3.4ZM15 2.8 14.4 4h-6L3.9 8.5v7l3.6 3.6-.5 1.2.9.4L16 3.2l-.9-.4Zm-2 4.5V7h-2v4.6l-2.7 6-2.8-2.8V9l3.6-3.6h4.7L13 7.2Z" }) });
var not_spam_default = notSpam;

// src/dashboard/icons/spam.tsx
var import_primitives45 = __toESM(require_primitives(), 1);
var import_jsx_runtime164 = __toESM(require_jsx_runtime(), 1);
var spam = /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_primitives45.Path, { d: "M11 13h2V7h-2v6Zm0 4h2v-2h-2v2Zm4.5-13h-7L4 8.5v7L8.5 20h7l4.5-4.5v-7L15.5 4Zm3 10.9-3.6 3.6H9.1l-3.6-3.6V9.1l3.6-3.6h5.8l3.6 3.6v5.8Z" }) });
var spam_default = spam;

// src/dashboard/inbox/stage/views.js
var import_compose16 = __toESM(require_compose(), 1);
var import_element96 = __toESM(require_element(), 1);
var LAYOUT_TABLE2 = "table";
var defaultView = {
  type: LAYOUT_TABLE2,
  search: "",
  filters: [],
  page: 1,
  perPage: 20,
  titleField: "from",
  fields: ["date", "source", "ip"]
};
var defaultLayouts = {
  [LAYOUT_TABLE2]: {}
};

// src/dashboard/inbox/utils.js
var getPath = (item) => {
  try {
    const url = new URL(item.entry_permalink);
    return url.pathname;
  } catch {
    return "";
  }
};
function updateBadge(element, count) {
  const oldClass = [...element.classList].find((c2) => c2.startsWith("count-"));
  if (oldClass) {
    element.classList.replace(oldClass, `count-${count}`);
  } else {
    element.classList.add(`count-${count}`);
  }
  element.ariaHidden = count > 0 ? "false" : "true";
  element.textContent = formatNumber2(count);
}
var updateMenuCounter = (count) => {
  document.querySelectorAll(".jp-feedback-unread-counter").forEach((item) => {
    if (item.dataset.unreadDiff) {
      const unreadDiff = parseInt(item.dataset.unreadDiff, 10) + count;
      updateBadge(item, unreadDiff);
    } else {
      updateBadge(item, count);
    }
  });
};
var updateMenuCounterOptimistically = (count) => {
  document.querySelectorAll(".jp-feedback-unread-counter").forEach((item) => {
    let optimisticCount = 0;
    if (item.textContent !== "") {
      optimisticCount = parseInt(item.textContent.replace(/\D/g, ""), 10) + count;
    }
    if (optimisticCount >= 0) {
      updateBadge(item, optimisticCount);
    }
  });
};

// routes/responses/actions.tsx
var import_jsx_runtime165 = __toESM(require_jsx_runtime());
var getCountQueryParams = (currentQuery2) => {
  const queryParams = {};
  if (currentQuery2?.search) {
    queryParams.search = currentQuery2.search;
  }
  if (currentQuery2?.parent) {
    queryParams.parent = currentQuery2.parent;
  }
  if (currentQuery2?.before) {
    queryParams.before = currentQuery2.before;
  }
  if (currentQuery2?.after) {
    queryParams.after = currentQuery2.after;
  }
  if (currentQuery2?.is_unread !== void 0) {
    queryParams.is_unread = currentQuery2.is_unread;
  }
  return queryParams;
};
var undoingMessage = (0, import_i18n85.__)("Undoing\u2026", "jetpack-forms");
var pendingRefetches = /* @__PURE__ */ new Map();
var invalidateCacheAndNavigate = (registry, currentQuery2, queryParams, statusBeingRemovedFrom) => {
  registry.dispatch(store3).invalidateCounts();
  const { getTrashCount: getTrashCount2, getSpamCount: getSpamCount2, getInboxCount: getInboxCount2 } = registry.select(store3);
  const { setCurrentQuery: setCurrentQuery2 } = registry.dispatch(store3);
  const currentStatus = currentQuery2?.status || "draft,publish";
  const isViewingInbox = currentStatus === "draft,publish";
  const isViewingSpam = currentStatus === "spam";
  const isViewingTrash = currentStatus === "trash";
  const shouldAdjustPage = isViewingTrash && statusBeingRemovedFrom === "trash" || isViewingSpam && statusBeingRemovedFrom === "spam" || isViewingInbox && statusBeingRemovedFrom === "inbox";
  let targetPage = currentQuery2?.page || defaultView.page;
  if (shouldAdjustPage) {
    const countGetters = {
      trash: getTrashCount2,
      spam: getSpamCount2,
      inbox: getInboxCount2
    };
    const remainingCount = countGetters[statusBeingRemovedFrom](queryParams);
    const perPage = currentQuery2?.per_page || defaultView.perPage;
    const newTotalPages = Math.max(1, Math.ceil(remainingCount / perPage));
    const currentPage = currentQuery2?.page || defaultView.page;
    targetPage = currentPage > newTotalPages ? newTotalPages : currentPage;
  }
  const updatedQuery = {
    ...currentQuery2,
    page: targetPage
  };
  setCurrentQuery2(updatedQuery);
};
var getGenericErrorMessage = (numberOfErrors) => {
  return numberOfErrors === 1 ? (0, import_i18n85.__)("An error occurred.", "jetpack-forms") : (0, import_i18n85.sprintf)(
    /* translators: %s: the number of responses. */
    (0, import_i18n85._n)(
      "An error occurred for %s response.",
      "An error occurred for %s responses.",
      numberOfErrors,
      "jetpack-forms"
    ),
    formatNumber2(numberOfErrors)
  );
};
var withTimeout = (promise, timeoutMs = 3e4) => {
  return Promise.race([
    promise,
    new Promise(
      (_, reject) => setTimeout(() => reject(new Error("Request timeout")), timeoutMs)
    )
  ]);
};
var waitForEntityRecordsResolution = async (registry, currentQuery2) => {
  if (!currentQuery2) {
    return;
  }
  const querySnapshot = { ...currentQuery2 };
  try {
    await withTimeout(
      registry.resolveSelect(import_core_data7.store).getEntityRecords("postType", "feedback", querySnapshot),
      1e4
    );
  } catch {
  }
};
var processStatusChange = async ({
  items,
  newStatus,
  apiCall,
  editEntityRecord,
  updateCountsOptimistically: updateCountsOptimistically2,
  queryParams
}) => {
  const originalStatuses = items.map((item) => item.status);
  items.forEach((item) => {
    editEntityRecord("postType", "feedback", item.id, {
      status: newStatus
    });
    updateCountsOptimistically2(item.status, newStatus, 1, queryParams);
  });
  const promises = await Promise.allSettled(
    items.map(({ id }) => withTimeout(apiCall(id)))
  );
  const itemsUpdated = [];
  const itemsFailed = [];
  promises.forEach((promise, index) => {
    if (promise.status === "rejected" || !promise.value?.id) {
      itemsFailed.push(index);
    } else {
      itemsUpdated.push(promise.value);
    }
  });
  itemsFailed.forEach((index) => {
    const item = items[index];
    const originalStatus = originalStatuses[index];
    editEntityRecord("postType", "feedback", item.id, {
      status: originalStatus
    });
    updateCountsOptimistically2(newStatus, originalStatus, 1, queryParams);
  });
  return {
    itemsUpdated,
    itemsFailed,
    numberOfErrors: itemsFailed.length
  };
};
var BULK_ACTIONS = {
  markAsSpam: "mark_as_spam",
  markAsNotSpam: "mark_as_not_spam"
};
function getActions({ navigate, searchParams }) {
  const viewAction = {
    id: "view-response",
    isPrimary: true,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: comment_content_default }),
    label: (0, import_i18n85.__)("View", "jetpack-forms"),
    async callback(items) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "view-response",
        multiple: items.length > 1
      });
      const ids = items.map((item) => item.id.toString());
      navigate({
        search: {
          ...searchParams,
          responseIds: ids
        }
      });
    }
  };
  const editFormAction = {
    id: "edit-form",
    isPrimary: false,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: backup_default }),
    label: (0, import_i18n85.__)("Edit form", "jetpack-forms"),
    isEligible: (item) => !!item?.edit_form_url,
    supportsBulk: false,
    async callback(items) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "edit-form",
        multiple: false
      });
      const [item] = items;
      if (item?.edit_form_url) {
        const url = new URL(item.edit_form_url, window.location.origin);
        window.location.href = url.toString();
      }
    }
  };
  const markAsSpamAction = {
    id: "mark-as-spam",
    isPrimary: true,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: spam_default }),
    label: (0, import_i18n85.__)("Spam", "jetpack-forms"),
    isEligible: (item) => item.status !== "spam",
    supportsBulk: true,
    async callback(items, { registry }, { isUndo = false } = {}) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "mark-as-spam",
        multiple: items.length > 1
      });
      const { createSuccessNotice, createErrorNotice, createInfoNotice, removeNotice } = registry.dispatch(import_notices6.store);
      const { saveEntityRecord, editEntityRecord } = registry.dispatch(import_core_data7.store);
      const { updateCountsOptimistically: updateCountsOptimistically2, addPendingAction: addPendingAction2, removePendingAction: removePendingAction2 } = registry.dispatch(store3);
      const { getCurrentQuery: getCurrentQuery2 } = registry.select(store3);
      const queryParams = getCountQueryParams(getCurrentQuery2());
      const actionId = `mark-as-spam-${Date.now()}-${items.map((i2) => i2.id).join("-")}`;
      const busyMessage = isUndo ? undoingMessage : (0, import_i18n85.sprintf)(
        /* translators: %s: the number of responses. */
        (0, import_i18n85._n)(
          "Moving %s response to spam\u2026",
          "Moving %s responses to spam\u2026",
          items.length,
          "jetpack-forms"
        ),
        formatNumber2(items.length)
      );
      createInfoNotice(busyMessage, {
        type: "snackbar",
        id: "mark-as-spam-action",
        icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Spinner, {})
      });
      addPendingAction2(actionId);
      let waitForRecordsPromise = null;
      try {
        const { itemsUpdated, numberOfErrors } = await processStatusChange({
          items,
          newStatus: "spam",
          apiCall: (id) => saveEntityRecord("postType", "feedback", { id, status: "spam" }),
          editEntityRecord,
          updateCountsOptimistically: updateCountsOptimistically2,
          queryParams
        });
        if (itemsUpdated.length) {
          let status = "inbox";
          if (items[0]?.status === "trash") {
            status = "trash";
          }
          invalidateCacheAndNavigate(registry, getCurrentQuery2(), queryParams, status);
          waitForRecordsPromise = waitForEntityRecordsResolution(registry, getCurrentQuery2());
          pendingRefetches.set(actionId, waitForRecordsPromise);
        }
        if (numberOfErrors === 0) {
          const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response marked as spam.", "jetpack-forms") : (0, import_i18n85.sprintf)(
            /* translators: %s: the number of responses. */
            (0, import_i18n85._n)(
              "%s response marked as spam.",
              "%s responses marked as spam.",
              items.length,
              "jetpack-forms"
            ),
            formatNumber2(items.length)
          );
          if (!isUndo) {
            createSuccessNotice(successMessage, {
              type: "snackbar",
              id: "mark-as-spam-action",
              actions: [
                {
                  label: (0, import_i18n85.__)("Undo", "jetpack-forms"),
                  onClick: async () => {
                    const originalRefetch = pendingRefetches.get(actionId);
                    if (originalRefetch) {
                      await originalRefetch;
                      pendingRefetches.delete(actionId);
                    }
                    removePendingAction2(actionId);
                    markAsNotSpamAction.callback?.(items, { registry }, { isUndo: true });
                  }
                }
              ]
            });
          } else {
            removeNotice("mark-as-spam-action");
          }
        } else {
          const errorMessage = getGenericErrorMessage(numberOfErrors);
          removeNotice("mark-as-spam-action");
          createErrorNotice(errorMessage, { type: "snackbar" });
        }
        if (itemsUpdated.length) {
          await registry.dispatch(store3).doBulkAction(
            itemsUpdated.map((item) => item.id.toString()),
            BULK_ACTIONS.markAsSpam
          );
        }
      } finally {
        if (waitForRecordsPromise) {
          await waitForRecordsPromise;
        }
        pendingRefetches.delete(actionId);
        removePendingAction2(actionId);
      }
    }
  };
  const markAsNotSpamAction = {
    id: "mark-as-not-spam",
    isPrimary: true,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: not_spam_default }),
    label: (0, import_i18n85.__)("Not spam", "jetpack-forms"),
    isEligible: (item) => item.status === "spam",
    supportsBulk: true,
    async callback(items, { registry }, { isUndo = false } = {}) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "mark-as-not-spam",
        multiple: items.length > 1
      });
      const { createSuccessNotice, createErrorNotice, createInfoNotice, removeNotice } = registry.dispatch(import_notices6.store);
      const { saveEntityRecord, editEntityRecord } = registry.dispatch(import_core_data7.store);
      const { updateCountsOptimistically: updateCountsOptimistically2, addPendingAction: addPendingAction2, removePendingAction: removePendingAction2 } = registry.dispatch(store3);
      const { getCurrentQuery: getCurrentQuery2 } = registry.select(store3);
      const queryParams = getCountQueryParams(getCurrentQuery2());
      const actionId = `mark-as-not-spam-${Date.now()}-${items.map((i2) => i2.id).join("-")}`;
      const busyMessage = isUndo ? undoingMessage : (0, import_i18n85.sprintf)(
        /* translators: %s: the number of responses. */
        (0, import_i18n85._n)(
          "Marking %s response as not spam\u2026",
          "Marking %s responses as not spam\u2026",
          items.length,
          "jetpack-forms"
        ),
        formatNumber2(items.length)
      );
      createInfoNotice(busyMessage, {
        type: "snackbar",
        id: "mark-as-not-spam-action",
        icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Spinner, {})
      });
      addPendingAction2(actionId);
      let waitForRecordsPromise = null;
      try {
        const { itemsUpdated, numberOfErrors } = await processStatusChange({
          items,
          newStatus: "publish",
          apiCall: (id) => saveEntityRecord("postType", "feedback", { id, status: "publish" }),
          editEntityRecord,
          updateCountsOptimistically: updateCountsOptimistically2,
          queryParams
        });
        if (itemsUpdated.length) {
          invalidateCacheAndNavigate(registry, getCurrentQuery2(), queryParams, "spam");
          waitForRecordsPromise = waitForEntityRecordsResolution(registry, getCurrentQuery2());
          pendingRefetches.set(actionId, waitForRecordsPromise);
        }
        if (numberOfErrors === 0) {
          const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response marked as not spam.", "jetpack-forms") : (0, import_i18n85.sprintf)(
            /* translators: %s: the number of responses. */
            (0, import_i18n85._n)(
              "%s response marked as not spam.",
              "%s responses marked as not spam.",
              items.length,
              "jetpack-forms"
            ),
            formatNumber2(items.length)
          );
          if (!isUndo) {
            createSuccessNotice(successMessage, {
              type: "snackbar",
              id: "mark-as-not-spam-action",
              actions: [
                {
                  label: (0, import_i18n85.__)("Undo", "jetpack-forms"),
                  onClick: async () => {
                    const originalRefetch = pendingRefetches.get(actionId);
                    if (originalRefetch) {
                      await originalRefetch;
                      pendingRefetches.delete(actionId);
                    }
                    removePendingAction2(actionId);
                    markAsSpamAction.callback?.(items, { registry }, { isUndo: true });
                  }
                }
              ]
            });
          } else {
            removeNotice("mark-as-not-spam-action");
          }
        } else {
          const errorMessage = getGenericErrorMessage(numberOfErrors);
          removeNotice("mark-as-not-spam-action");
          createErrorNotice(errorMessage, { type: "snackbar" });
        }
        if (itemsUpdated.length) {
          await registry.dispatch(store3).doBulkAction(
            itemsUpdated.map((item) => item.id.toString()),
            BULK_ACTIONS.markAsNotSpam
          );
        }
      } finally {
        if (waitForRecordsPromise) {
          await waitForRecordsPromise;
        }
        pendingRefetches.delete(actionId);
        removePendingAction2(actionId);
      }
    }
  };
  const restoreAction = {
    id: "restore",
    isPrimary: true,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: backup_default }),
    label: (0, import_i18n85.__)("Restore", "jetpack-forms"),
    isEligible: (item) => item.status === "trash",
    supportsBulk: true,
    async callback(items, { registry }, { isUndo = false, targetStatus = "publish" } = {}) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "restore",
        multiple: items.length > 1
      });
      const { saveEntityRecord, editEntityRecord } = registry.dispatch(import_core_data7.store);
      const { createSuccessNotice, createErrorNotice, createInfoNotice, removeNotice } = registry.dispatch(import_notices6.store);
      const { updateCountsOptimistically: updateCountsOptimistically2, addPendingAction: addPendingAction2, removePendingAction: removePendingAction2 } = registry.dispatch(store3);
      const { getCurrentQuery: getCurrentQuery2 } = registry.select(store3);
      const queryParams = getCountQueryParams(getCurrentQuery2());
      const newStatus = targetStatus === "trash" ? "publish" : targetStatus;
      const actionId = `restore-${Date.now()}-${items.map((i2) => i2.id).join("-")}`;
      const busyMessage = isUndo ? undoingMessage : (0, import_i18n85.sprintf)(
        /* translators: %s: the number of responses. */
        (0, import_i18n85._n)(
          "Restoring %s response\u2026",
          "Restoring %s responses\u2026",
          items.length,
          "jetpack-forms"
        ),
        formatNumber2(items.length)
      );
      createInfoNotice(busyMessage, {
        type: "snackbar",
        id: "restore-action",
        icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Spinner, {})
      });
      addPendingAction2(actionId);
      let waitForRecordsPromise = null;
      try {
        const { itemsUpdated, numberOfErrors } = await processStatusChange({
          items,
          newStatus,
          apiCall: (id) => saveEntityRecord("postType", "feedback", { id, status: newStatus }),
          editEntityRecord,
          updateCountsOptimistically: updateCountsOptimistically2,
          queryParams
        });
        if (itemsUpdated.length) {
          invalidateCacheAndNavigate(registry, getCurrentQuery2(), queryParams, "trash");
          waitForRecordsPromise = waitForEntityRecordsResolution(registry, getCurrentQuery2());
          pendingRefetches.set(actionId, waitForRecordsPromise);
        }
        if (numberOfErrors === 0) {
          const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response restored.", "jetpack-forms") : (0, import_i18n85.sprintf)(
            /* translators: %s: the number of responses. */
            (0, import_i18n85._n)(
              "%s response restored.",
              "%s responses restored.",
              items.length,
              "jetpack-forms"
            ),
            formatNumber2(items.length)
          );
          if (!isUndo) {
            createSuccessNotice(successMessage, {
              type: "snackbar",
              id: "restore-action",
              actions: [
                {
                  label: (0, import_i18n85.__)("Undo", "jetpack-forms"),
                  onClick: async () => {
                    const originalRefetch = pendingRefetches.get(actionId);
                    if (originalRefetch) {
                      await originalRefetch;
                      pendingRefetches.delete(actionId);
                    }
                    removePendingAction2(actionId);
                    moveToTrashAction.callback?.(items, { registry }, { isUndo: true });
                  }
                }
              ]
            });
          } else {
            removeNotice("restore-action");
          }
          return;
        }
        const errorMessage = getGenericErrorMessage(numberOfErrors);
        removeNotice("restore-action");
        createErrorNotice(errorMessage, { type: "snackbar" });
      } finally {
        if (waitForRecordsPromise) {
          await waitForRecordsPromise;
        }
        pendingRefetches.delete(actionId);
        removePendingAction2(actionId);
      }
    }
  };
  const moveToTrashAction = {
    id: "move-to-trash",
    isPrimary: true,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: trash_default }),
    label: (0, import_i18n85.__)("Trash", "jetpack-forms"),
    isEligible: (item) => item.status !== "trash",
    supportsBulk: true,
    async callback(items, { registry }, { isUndo = false } = {}) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "move-to-trash",
        multiple: items.length > 1
      });
      const { deleteEntityRecord, editEntityRecord, receiveEntityRecords } = registry.dispatch(import_core_data7.store);
      const { createSuccessNotice, createErrorNotice, createInfoNotice, removeNotice } = registry.dispatch(import_notices6.store);
      const { updateCountsOptimistically: updateCountsOptimistically2, addPendingAction: addPendingAction2, removePendingAction: removePendingAction2 } = registry.dispatch(store3);
      const { getCurrentQuery: getCurrentQuery2 } = registry.select(store3);
      const queryParams = getCountQueryParams(getCurrentQuery2());
      const previousStatus = items[0]?.status;
      const actionId = `move-to-trash-${Date.now()}-${items.map((i2) => i2.id).join("-")}`;
      const busyMessage = isUndo ? undoingMessage : (0, import_i18n85.sprintf)(
        /* translators: %s: the number of responses. */
        (0, import_i18n85._n)(
          "Moving %s response to trash\u2026",
          "Moving %s responses to trash\u2026",
          items.length,
          "jetpack-forms"
        ),
        formatNumber2(items.length)
      );
      createInfoNotice(busyMessage, {
        type: "snackbar",
        id: "move-to-trash-action",
        icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Spinner, {})
      });
      addPendingAction2(actionId);
      let waitForRecordsPromise = null;
      try {
        const { itemsUpdated, numberOfErrors } = await processStatusChange({
          items,
          newStatus: "trash",
          apiCall: (id) => deleteEntityRecord("postType", "feedback", id, {}, { throwOnError: true }),
          editEntityRecord,
          updateCountsOptimistically: updateCountsOptimistically2,
          queryParams
        });
        if (itemsUpdated.length) {
          let status = "inbox";
          if (items[0]?.status === "trash") {
            status = "trash";
          }
          invalidateCacheAndNavigate(registry, getCurrentQuery2(), queryParams, status);
          waitForRecordsPromise = waitForEntityRecordsResolution(registry, getCurrentQuery2());
          pendingRefetches.set(actionId, waitForRecordsPromise);
        }
        if (numberOfErrors === 0) {
          const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response moved to trash.", "jetpack-forms") : (0, import_i18n85.sprintf)(
            /* translators: %s: the number of responses. */
            (0, import_i18n85._n)(
              "%s response moved to trash.",
              "%s responses moved to trash.",
              items.length,
              "jetpack-forms"
            ),
            formatNumber2(items.length)
          );
          if (!isUndo) {
            receiveEntityRecords("postType", "feedback", items, queryParams, true);
            createSuccessNotice(successMessage, {
              type: "snackbar",
              id: "move-to-trash-action",
              actions: [
                {
                  label: (0, import_i18n85.__)("Undo", "jetpack-forms"),
                  onClick: async () => {
                    const originalRefetch = pendingRefetches.get(actionId);
                    if (originalRefetch) {
                      await originalRefetch;
                      pendingRefetches.delete(actionId);
                    }
                    removePendingAction2(actionId);
                    restoreAction.callback?.(
                      items,
                      { registry },
                      // We can trash a spam or inbox item, so we need to restore to the original status
                      { isUndo: true, targetStatus: previousStatus }
                    );
                  }
                }
              ]
            });
          } else {
            removeNotice("move-to-trash-action");
          }
          return;
        }
        const errorMessage = getGenericErrorMessage(numberOfErrors);
        removeNotice("move-to-trash-action");
        createErrorNotice(errorMessage, { type: "snackbar" });
      } finally {
        if (waitForRecordsPromise) {
          await waitForRecordsPromise;
        }
        pendingRefetches.delete(actionId);
        removePendingAction2(actionId);
      }
    }
  };
  const deleteAction = {
    id: "delete",
    isPrimary: true,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: trash_default }),
    label: (0, import_i18n85.__)("Delete", "jetpack-forms"),
    isEligible: (item) => item.status === "trash",
    supportsBulk: true,
    isDestructive: true,
    async callback(items, { registry }) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "delete",
        multiple: items.length > 1
      });
      const { deleteEntityRecord } = registry.dispatch(import_core_data7.store);
      const { invalidateFilters: invalidateFilters2, updateCountsOptimistically: updateCountsOptimistically2 } = registry.dispatch(store3);
      const { getCurrentQuery: getCurrentQuery2 } = registry.select(store3);
      const { createSuccessNotice, createErrorNotice } = registry.dispatch(import_notices6.store);
      const queryParams = getCountQueryParams(getCurrentQuery2());
      items.forEach(() => {
        updateCountsOptimistically2("trash", "deleted", 1, queryParams);
      });
      const promises = await Promise.allSettled(
        items.map(
          ({ id }) => deleteEntityRecord("postType", "feedback", id, { force: true }, { throwOnError: true })
        )
      );
      const itemsUpdated = promises.filter(({ status }) => status === "fulfilled");
      if (itemsUpdated.length) {
        invalidateFilters2();
        invalidateCacheAndNavigate(registry, getCurrentQuery2(), queryParams, "trash");
      }
      if (itemsUpdated.length === items.length) {
        const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response deleted permanently.", "jetpack-forms") : (0, import_i18n85.sprintf)(
          /* translators: %s: the number of responses. */
          (0, import_i18n85._n)(
            "%s response deleted permanently.",
            "%s responses deleted permanently.",
            items.length,
            "jetpack-forms"
          ),
          formatNumber2(items.length)
        );
        createSuccessNotice(successMessage, { type: "snackbar", id: "delete-action" });
        const hash = window.location.hash;
        const hashQueryIndex = hash.indexOf("?");
        const hashBase = hashQueryIndex > 0 ? hash.substring(0, hashQueryIndex) : hash;
        const hashQuery = hashQueryIndex > 0 ? hash.substring(hashQueryIndex + 1) : "";
        const hashParams = new URLSearchParams(hashQuery);
        const currentSelection = hashParams.get("r")?.split(",") || [];
        const deletedIds = items.map(({ id }) => id.toString());
        const newSelection = currentSelection.filter((id) => !deletedIds.includes(id));
        if (newSelection.length) {
          hashParams.set("r", newSelection.join(","));
        } else {
          hashParams.delete("r");
        }
        const hashString = hashParams.toString();
        window.location.hash = hashString ? `${hashBase}?${hashString}` : hashBase;
        return;
      }
      const numberOfErrors = promises.filter(({ status }) => status === "rejected").length;
      const errorMessage = getGenericErrorMessage(numberOfErrors);
      createErrorNotice(errorMessage, { type: "snackbar" });
    }
  };
  const markAsReadAction = {
    id: "mark-as-read",
    isPrimary: false,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: seen_default }),
    label: (0, import_i18n85.__)("Mark as read", "jetpack-forms"),
    isEligible: (item) => item.is_unread,
    supportsBulk: true,
    async callback(items, { registry }) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "mark-as-read",
        multiple: items.length > 1
      });
      const { editEntityRecord } = registry.dispatch(import_core_data7.store);
      const { getEntityRecord } = registry.select(import_core_data7.store);
      const { createSuccessNotice, createErrorNotice } = registry.dispatch(import_notices6.store);
      const { invalidateCounts: invalidateCounts2, markRecordsAsInvalid: markRecordsAsInvalid2 } = registry.dispatch(store3);
      const promises = await Promise.allSettled(
        items.map(async ({ id, status }) => {
          const currentEntity = getEntityRecord("postType", "feedback", id);
          if (currentEntity) {
            editEntityRecord("postType", "feedback", id, {
              is_unread: false
            });
            if (status === "publish") {
              updateMenuCounterOptimistically(-1);
            }
          }
          return (0, import_api_fetch11.default)({
            path: `/wp/v2/feedback/${id}/read`,
            method: "POST",
            data: { is_unread: false }
          }).then((response) => {
            const { count } = response;
            updateMenuCounter(count);
          }).catch(() => {
            if (currentEntity) {
              editEntityRecord("postType", "feedback", id, {
                is_unread: true
              });
              if (status === "publish") {
                updateMenuCounterOptimistically(1);
              }
            }
            throw new Error("Failed to mark as read");
          });
        })
      );
      if (promises.some(({ status }) => status === "fulfilled")) {
        invalidateCounts2();
        const updatedIds = items.filter((_, index) => promises[index]?.status === "fulfilled").map((item) => item.id);
        markRecordsAsInvalid2(updatedIds);
      }
      if (promises.every(({ status }) => status === "fulfilled")) {
        const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response marked as read.", "jetpack-forms") : (0, import_i18n85.sprintf)(
          /* translators: %s: the number of responses. */
          (0, import_i18n85._n)(
            "%s response marked as read.",
            "%s responses marked as read.",
            items.length,
            "jetpack-forms"
          ),
          formatNumber2(items.length)
        );
        createSuccessNotice(successMessage, {
          type: "snackbar",
          id: "mark-as-read-action",
          actions: [
            {
              label: (0, import_i18n85.__)("Undo", "jetpack-forms"),
              onClick: () => {
                markAsUnreadAction.callback?.(items, { registry });
              }
            }
          ]
        });
        return;
      }
      const numberOfErrors = promises.filter(({ status }) => status === "rejected").length;
      const errorMessage = getGenericErrorMessage(numberOfErrors);
      createErrorNotice(errorMessage, { type: "snackbar" });
    }
  };
  const markAsUnreadAction = {
    id: "mark-as-unread",
    isPrimary: false,
    icon: /* @__PURE__ */ (0, import_jsx_runtime165.jsx)(import_components77.Icon, { icon: unseen_default }),
    label: (0, import_i18n85.__)("Mark as unread", "jetpack-forms"),
    isEligible: (item) => !item.is_unread,
    supportsBulk: true,
    async callback(items, { registry }) {
      analytics_default.tracks.recordEvent("jetpack_forms_inbox_action_click", {
        action: "mark-as-unread",
        multiple: items.length > 1
      });
      const { editEntityRecord } = registry.dispatch(import_core_data7.store);
      const { getEntityRecord } = registry.select(import_core_data7.store);
      const { createSuccessNotice, createErrorNotice } = registry.dispatch(import_notices6.store);
      const { invalidateCounts: invalidateCounts2, markRecordsAsInvalid: markRecordsAsInvalid2 } = registry.dispatch(store3);
      const promises = await Promise.allSettled(
        items.map(async ({ id, status }) => {
          const currentEntity = getEntityRecord("postType", "feedback", id);
          if (currentEntity) {
            editEntityRecord("postType", "feedback", id, {
              is_unread: true
            });
            if (status === "publish") {
              updateMenuCounterOptimistically(1);
            }
          }
          return (0, import_api_fetch11.default)({
            path: `/wp/v2/feedback/${id}/read`,
            method: "POST",
            data: { is_unread: true }
          }).then((response) => {
            const { count } = response;
            updateMenuCounter(count);
          }).catch(() => {
            if (currentEntity) {
              editEntityRecord("postType", "feedback", id, {
                is_unread: false
              });
              if (status === "publish") {
                updateMenuCounterOptimistically(-1);
              }
            }
            throw new Error("Failed to mark as unread");
          });
        })
      );
      if (promises.every(({ status }) => status === "fulfilled")) {
        invalidateCounts2();
        const updatedIds = items.map((item) => item.id);
        markRecordsAsInvalid2(updatedIds);
        const successMessage = items.length === 1 ? (0, import_i18n85.__)("Response marked as unread.", "jetpack-forms") : (0, import_i18n85.sprintf)(
          /* translators: %s: the number of responses. */
          (0, import_i18n85._n)(
            "%s response marked as unread.",
            "%s responses marked as unread.",
            items.length,
            "jetpack-forms"
          ),
          formatNumber2(items.length)
        );
        createSuccessNotice(successMessage, {
          type: "snackbar",
          id: "mark-as-unread-action",
          actions: [
            {
              label: (0, import_i18n85.__)("Undo", "jetpack-forms"),
              onClick: () => {
                markAsReadAction.callback?.(items, { registry });
              }
            }
          ]
        });
        return;
      }
      const numberOfErrors = promises.filter(({ status }) => status === "rejected").length;
      const errorMessage = getGenericErrorMessage(numberOfErrors);
      createErrorNotice(errorMessage, { type: "snackbar" });
    }
  };
  return {
    viewAction,
    editFormAction,
    markAsSpamAction,
    markAsNotSpamAction,
    restoreAction,
    moveToTrashAction,
    deleteAction,
    markAsReadAction,
    markAsUnreadAction
  };
}
function getRowActions({
  navigate,
  searchParams,
  view
}) {
  const {
    viewAction,
    editFormAction,
    markAsSpamAction,
    markAsNotSpamAction,
    restoreAction,
    moveToTrashAction,
    deleteAction,
    markAsReadAction,
    markAsUnreadAction
  } = getActions({
    navigate,
    searchParams
  });
  switch (view) {
    case "trash":
      return [viewAction, restoreAction, deleteAction, markAsUnreadAction, editFormAction];
    case "spam":
      return [
        viewAction,
        markAsNotSpamAction,
        moveToTrashAction,
        markAsUnreadAction,
        editFormAction
      ];
    default:
      return [
        viewAction,
        markAsReadAction,
        markAsSpamAction,
        moveToTrashAction,
        markAsUnreadAction,
        editFormAction
      ];
  }
}

// src/dashboard/wp-build/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='cbc7186354']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "cbc7186354");
  style.appendChild(document.createTextNode("body.jetpack-forms-responses .admin-ui-breadcrumbs__list li,body.jetpack_page_jetpack-forms-responses-wp-admin .admin-ui-breadcrumbs__list li{margin-bottom:0}body.jetpack-forms-responses .admin-ui-breadcrumbs__list li:first-of-type,body.jetpack_page_jetpack-forms-responses-wp-admin .admin-ui-breadcrumbs__list li:first-of-type{margin-inline-start:4px}body.jetpack-forms-responses .admin-ui-breadcrumbs__list li a,body.jetpack_page_jetpack-forms-responses-wp-admin .admin-ui-breadcrumbs__list li a{color:var(--wp-components-color-foreground,#1e1e1e);font-weight:600}body.jetpack-forms-responses .dataviews-search .components-base-control__field,body.jetpack_page_jetpack-forms-responses-wp-admin .dataviews-search .components-base-control__field{margin-bottom:0}"));
  document.head.appendChild(style);
}

// routes/responses/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='7f0fe2280e']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "7f0fe2280e");
  style.appendChild(document.createTextNode(':root{--wpds-border-radius-lg:8px;--wpds-border-radius-md:4px;--wpds-border-radius-sm:2px;--wpds-border-radius-xs:1px;--wpds-border-width-focus:2px;--wpds-border-width-lg:8px;--wpds-border-width-md:4px;--wpds-border-width-sm:2px;--wpds-border-width-xs:1px;--wpds-color-bg-interactive-brand-strong:#3858e9;--wpds-color-bg-interactive-brand-strong-active:#2e49d9;--wpds-color-bg-interactive-brand-weak:#0000;--wpds-color-bg-interactive-brand-weak-active:#e6eaf4;--wpds-color-bg-interactive-error:#0000;--wpds-color-bg-interactive-error-active:#fff6f4;--wpds-color-bg-interactive-error-strong:#cc1818;--wpds-color-bg-interactive-error-strong-active:#b90000;--wpds-color-bg-interactive-error-weak:#0000;--wpds-color-bg-interactive-error-weak-active:#f6e6e3;--wpds-color-bg-interactive-neutral-strong:#2d2d2d;--wpds-color-bg-interactive-neutral-strong-active:#1e1e1e;--wpds-color-bg-interactive-neutral-strong-disabled:#e2e2e2;--wpds-color-bg-interactive-neutral-weak:#0000;--wpds-color-bg-interactive-neutral-weak-active:#eaeaea;--wpds-color-bg-interactive-neutral-weak-disabled:#0000;--wpds-color-bg-surface-brand:#ecf0f9;--wpds-color-bg-surface-caution:#fee994;--wpds-color-bg-surface-caution-weak:#fff9c9;--wpds-color-bg-surface-error:#f6e6e3;--wpds-color-bg-surface-error-weak:#fff6f4;--wpds-color-bg-surface-info:#deebfa;--wpds-color-bg-surface-info-weak:#f2f9ff;--wpds-color-bg-surface-neutral:#f8f8f8;--wpds-color-bg-surface-neutral-strong:#fff;--wpds-color-bg-surface-neutral-weak:#f0f0f0;--wpds-color-bg-surface-success:#c5f7cc;--wpds-color-bg-surface-success-weak:#eaffed;--wpds-color-bg-surface-warning:#fde6bd;--wpds-color-bg-surface-warning-weak:#fff7e0;--wpds-color-bg-thumb-brand:#3858e9;--wpds-color-bg-thumb-brand-active:#3858e9;--wpds-color-bg-thumb-neutral-disabled:#d8d8d8;--wpds-color-bg-thumb-neutral-weak:#8a8a8a;--wpds-color-bg-thumb-neutral-weak-active:#6c6c6c;--wpds-color-bg-track-neutral:#d8d8d8;--wpds-color-bg-track-neutral-weak:#e0e0e0;--wpds-color-fg-content-caution:#281d00;--wpds-color-fg-content-caution-weak:#826a00;--wpds-color-fg-content-error:#470000;--wpds-color-fg-content-error-weak:#cc1818;--wpds-color-fg-content-info:#001b4f;--wpds-color-fg-content-info-weak:#006bd7;--wpds-color-fg-content-neutral:#1e1e1e;--wpds-color-fg-content-neutral-weak:#6d6d6d;--wpds-color-fg-content-success:#002900;--wpds-color-fg-content-success-weak:#007f30;--wpds-color-fg-content-warning:#2e1900;--wpds-color-fg-content-warning-weak:#926300;--wpds-color-fg-interactive-brand:#3858e9;--wpds-color-fg-interactive-brand-active:#3858e9;--wpds-color-fg-interactive-brand-strong:#eff0f2;--wpds-color-fg-interactive-brand-strong-active:#eff0f2;--wpds-color-fg-interactive-error:#cc1818;--wpds-color-fg-interactive-error-active:#cc1818;--wpds-color-fg-interactive-error-strong:#f2efef;--wpds-color-fg-interactive-error-strong-active:#f2efef;--wpds-color-fg-interactive-neutral:#1e1e1e;--wpds-color-fg-interactive-neutral-active:#1e1e1e;--wpds-color-fg-interactive-neutral-disabled:#8a8a8a;--wpds-color-fg-interactive-neutral-strong:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-active:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-disabled:#8a8a8a;--wpds-color-fg-interactive-neutral-weak:#6d6d6d;--wpds-color-fg-interactive-neutral-weak-disabled:#8a8a8a;--wpds-color-stroke-focus-brand:#3858e9;--wpds-color-stroke-interactive-brand:#3858e9;--wpds-color-stroke-interactive-brand-active:#2337c8;--wpds-color-stroke-interactive-error:#cc1818;--wpds-color-stroke-interactive-error-active:#9d0000;--wpds-color-stroke-interactive-error-strong:#cc1818;--wpds-color-stroke-interactive-neutral:#8a8a8a;--wpds-color-stroke-interactive-neutral-active:#6c6c6c;--wpds-color-stroke-interactive-neutral-disabled:#d8d8d8;--wpds-color-stroke-interactive-neutral-strong:#6c6c6c;--wpds-color-stroke-surface-brand:#a3b1d4;--wpds-color-stroke-surface-brand-strong:#3858e9;--wpds-color-stroke-surface-error:#daa39b;--wpds-color-stroke-surface-error-strong:#cc1818;--wpds-color-stroke-surface-info:#9fbcdc;--wpds-color-stroke-surface-info-strong:#006bd7;--wpds-color-stroke-surface-neutral:#d8d8d8;--wpds-color-stroke-surface-neutral-strong:#8a8a8a;--wpds-color-stroke-surface-neutral-weak:#e0e0e0;--wpds-color-stroke-surface-success:#8ac894;--wpds-color-stroke-surface-success-strong:#007f30;--wpds-color-stroke-surface-warning:#d0b381;--wpds-color-stroke-surface-warning-strong:#926300;--wpds-dimension-base:4px;--wpds-dimension-gap-2xs:4px;--wpds-dimension-gap-lg:24px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-padding-surface-2xs:4px;--wpds-dimension-padding-surface-lg:32px;--wpds-dimension-padding-surface-md:24px;--wpds-dimension-padding-surface-sm:16px;--wpds-dimension-padding-surface-xs:8px;--wpds-elevation-large:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-elevation-medium:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-small:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-x-small:0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003;--wpds-font-family-body:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-font-family-heading:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-font-family-mono:"Menlo","Consolas",monaco,monospace;--wpds-font-line-height-2xl:40px;--wpds-font-line-height-lg:28px;--wpds-font-line-height-md:24px;--wpds-font-line-height-sm:20px;--wpds-font-line-height-xl:32px;--wpds-font-line-height-xs:16px;--wpds-font-size-2xl:32px;--wpds-font-size-lg:15px;--wpds-font-size-md:13px;--wpds-font-size-sm:12px;--wpds-font-size-xl:20px;--wpds-font-size-xs:11px;--wpds-font-weight-medium:499;--wpds-font-weight-regular:400}[data-wpds-theme-provider-id][data-wpds-density=default]{--wpds-dimension-base:4px;--wpds-dimension-gap-2xs:4px;--wpds-dimension-gap-lg:24px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-xl:40px;--wpds-dimension-gap-xs:8px;--wpds-dimension-padding-surface-2xs:4px;--wpds-dimension-padding-surface-lg:32px;--wpds-dimension-padding-surface-md:24px;--wpds-dimension-padding-surface-sm:16px;--wpds-dimension-padding-surface-xs:8px}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-gap-2xs:4px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-surface-2xs:4px;--wpds-dimension-padding-surface-lg:24px;--wpds-dimension-padding-surface-md:20px;--wpds-dimension-padding-surface-sm:12px;--wpds-dimension-padding-surface-xs:4px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-gap-2xs:8px;--wpds-dimension-gap-lg:32px;--wpds-dimension-gap-md:20px;--wpds-dimension-gap-sm:16px;--wpds-dimension-gap-xl:48px;--wpds-dimension-gap-xs:12px;--wpds-dimension-padding-surface-2xs:8px;--wpds-dimension-padding-surface-lg:40px;--wpds-dimension-padding-surface-md:32px;--wpds-dimension-padding-surface-sm:20px;--wpds-dimension-padding-surface-xs:12px}@media (min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}.dataviews-picker-wrapper,.dataviews-wrapper{background-color:var(--wp-dataviews-color-background,#fff);box-sizing:border-box;container:dataviews-wrapper/inline-size;display:flex;flex-direction:column;font-size:13px;height:100%;line-height:1.4;overflow:auto;scroll-padding-bottom:64px}.dataviews-filters__container,.dataviews__view-actions{background-color:inherit;box-sizing:border-box;flex-shrink:0;left:0;padding:16px 24px;position:sticky}@media not (prefers-reduced-motion){.dataviews-filters__container,.dataviews__view-actions{transition:padding .1s ease-out}}.dataviews-loading,.dataviews-no-results{align-items:center;display:flex;flex-grow:1;justify-content:center;padding:0 24px}@media not (prefers-reduced-motion){.dataviews-loading,.dataviews-no-results{transition:padding .1s ease-out}}.dataviews-loading-more{text-align:center}@container (max-width: 430px){.dataviews-filters__container,.dataviews__view-actions{padding:12px 24px}}.dataviews-title-field{font-size:13px;font-weight:499;width:100%}.dataviews-title-field,.dataviews-title-field a{color:#2f2f2f;text-overflow:ellipsis;white-space:nowrap}.dataviews-title-field a{display:block;flex-grow:0;overflow:hidden;text-decoration:none}.dataviews-title-field a:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field a:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.dataviews-title-field button.components-button.is-link{color:#1e1e1e;display:block;font-weight:inherit;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:100%}.dataviews-title-field button.components-button.is-link:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable{color:#2f2f2f;cursor:pointer}.dataviews-title-field--clickable:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.components-card__body:has(>.dataviews-picker-wrapper),.components-card__body:has(>.dataviews-wrapper){overflow:hidden;padding:8px 0 0}.dataviews-bulk-actions-footer__item-count{color:#1e1e1e}.dataviews-bulk-actions-footer__container{margin-right:auto;min-height:32px}.dataviews-filters__button{position:relative}.dataviews-filters__container{padding-top:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true],.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:hover{opacity:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:focus{opacity:1}.dataviews-filters__summary-popover{font-size:13px;line-height:1.4}.dataviews-filters__summary-popover .components-popover__content{border-radius:4px;max-width:250px;min-width:230px;width:100%}.dataviews-filters__summary-popover.components-dropdown__content .components-popover__content{padding:0}.dataviews-filters__summary-operators-container{padding:8px 16px}.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-listbox),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-no-elements),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__user-input-widget){border-bottom:1px solid #e0e0e0}.dataviews-filters__summary-operators-container:empty{display:none}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-name{color:#757575;flex-shrink:0;max-width:calc(100% - 55px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-select{overflow:hidden;white-space:nowrap;width:100%}.dataviews-filters__summary-chip-container{position:relative;white-space:pre-wrap}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip{align-items:center;background:#f0f0f0;border:1px solid #0000;border-radius:16px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;min-height:32px;padding:4px 12px;position:relative}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable{cursor:default}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-reset{padding-inline-end:28px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:hover:not(.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable),.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip[aria-expanded=true]{background:#e0e0e0;color:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values{background:rgba(var(--wp-admin-theme-color--rgb),.04);color:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values:hover,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values[aria-expanded=true]{background:rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip .dataviews-filters-__summary-filter-text-name{font-weight:499}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove{align-items:center;background:#0000;border:0;border-radius:50%;cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;position:absolute;right:4px;top:50%;transform:translateY(-50%);width:24px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove svg{fill:#757575}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover{background:#e0e0e0}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus svg,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover svg{fill:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values svg{fill:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values:hover{background:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__search-widget-filter-combobox-list{border-top:1px solid #e0e0e0;max-height:184px;overflow:auto;padding:4px}.dataviews-filters__search-widget-filter-combobox-list .dataviews-filters__search-widget-filter-combobox-item-value [data-user-value]{font-weight:600}.dataviews-filters__search-widget-listbox{overflow:auto;padding:4px}.dataviews-filters__search-widget-listitem{align-items:center;border-radius:2px;box-sizing:border-box;cursor:default;display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;gap:8px;line-height:20px;min-height:32px;padding:4px 12px}.dataviews-filters__search-widget-listitem:last-child{margin-block-end:0}.dataviews-filters__search-widget-listitem:focus,.dataviews-filters__search-widget-listitem:hover,.dataviews-filters__search-widget-listitem[data-active-item]{background-color:var(--wp-admin-theme-color);color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-description{color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection{background:#fff;border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection{border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-description{color:#757575;display:block;font-size:12px;line-height:16px;overflow:hidden;text-overflow:ellipsis}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{border:1px solid #1e1e1e;border-radius:50%;height:24px;margin-right:12px;max-width:24px;min-width:24px;position:relative;transition:none;width:24px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{transition:box-shadow .1s linear}}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{height:16px;max-width:16px;min-width:16px;width:16px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid #0000}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked{background:var(--wp-admin-theme-color);border:none}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{margin:0;padding:0}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{background-color:#fff;border:4px solid #fff;border-radius:50%;box-sizing:inherit;content:"";height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:24px;border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 #0000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-right:12px;padding:6px 8px;transition:none}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:box-shadow .1s linear}}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::placeholder{color:#1e1e1e9e}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid #0000}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{color:#fff;margin:-3px -5px}@media (min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{margin:-4px 0 0 -5px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{content:"\\f460";display:inline-block;float:left;font:normal 30px/1 dashicons;vertical-align:middle;width:16px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{float:none;font-size:21px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:disabled,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-disabled=true]{background:#f0f0f0;border-color:#ddd;cursor:default;opacity:1}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{background:#fff;color:#1e1e1e;height:var(--checkbox-size);margin:0;padding:0;position:relative;width:var(--checkbox-size)}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:16px}}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:border-color .1s ease-in-out}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:var(--checkbox-size);fill:#fff;height:var(--checkmark-size);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--checkmark-size)}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:calc(var(--checkbox-size) + 4px)}}.dataviews-filters__search-widget-filter-combobox__wrapper{padding:8px;position:relative}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 #0000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:normal;padding:6px 8px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{transition:box-shadow .1s linear}}@media (min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid #0000}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::placeholder{color:#1e1e1e9e}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{display:block;font-size:16px;height:32px;margin-left:0;margin-right:0;padding:0 8px 0 32px;width:100%}@media (min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{background:#fff;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::placeholder{color:#757575}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-cancel-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-decoration,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-decoration{-webkit-appearance:none}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon{align-items:center;bottom:0;display:flex;inset-inline-start:12px;justify-content:center;position:absolute;top:0;width:24px}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon:dir(ltr){transform:scaleX(-1)}.dataviews-filters__container-visibility-toggle{flex-shrink:0;position:relative}.dataviews-filters-toggle__count{background:var(--wp-admin-theme-color,#3858e9);border-radius:8px;box-sizing:border-box;color:#fff;font-size:11px;height:16px;line-height:16px;min-width:16px;outline:var(--wp-admin-border-width-focus) solid #fff;padding:0 4px;position:absolute;right:0;text-align:center;top:0;transform:translate(50%,-50%)}.dataviews-search{width:fit-content}.dataviews-filters__user-input-widget{padding:16px}.dataviews-filters__user-input-widget .components-input-control__prefix{padding-left:8px}.dataviews-filters__search-widget-no-elements{align-items:center;display:flex;justify-content:center;padding:16px}.dataviews-footer{background-color:inherit;border-top:1px solid #f0f0f0;bottom:0;flex-shrink:0;left:0;padding:12px 24px;position:sticky}@media not (prefers-reduced-motion){.dataviews-footer{transition:padding .1s ease-out}}.dataviews-footer{z-index:2}@container (max-width: 560px){.dataviews-footer{flex-direction:column!important}.dataviews-footer .dataviews-bulk-actions-footer__container{width:100%}.dataviews-footer .dataviews-bulk-actions-footer__item-count{flex-grow:1}.dataviews-footer .dataviews-pagination{justify-content:space-between;width:100%}}.dataviews-pagination__page-select{font-size:11px;font-weight:499;text-transform:uppercase}@media (min-width:600px){.dataviews-pagination__page-select .components-select-control__input{font-size:11px!important;font-weight:499}}.dataviews-action-modal{z-index:1000001}.dataviews-selection-checkbox{--checkbox-input-size:24px}@media (min-width:600px){.dataviews-selection-checkbox{--checkbox-input-size:16px}}.dataviews-selection-checkbox{flex-shrink:0;line-height:0}.dataviews-selection-checkbox .components-checkbox-control__input-container{margin:0}.dataviews-view-config{container-type:inline-size;font-size:13px;line-height:1.4;width:320px}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper{height:100%;overflow-y:scroll}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper .dataviews-view-config{width:auto}.dataviews-view-config__sort-direction .components-toggle-group-control-option-base{text-transform:uppercase}.dataviews-settings-section__title.dataviews-settings-section__title{font-size:15px;line-height:24px}.dataviews-settings-section__sidebar{grid-column:span 4}.dataviews-settings-section__content,.dataviews-settings-section__content>*{grid-column:span 8}.dataviews-settings-section__content .is-divided-in-two{display:contents}.dataviews-settings-section__content .is-divided-in-two>*{grid-column:span 4}.dataviews-settings-section:has(.dataviews-settings-section__content:empty){display:none}@container (max-width: 500px){.dataviews-settings-section.dataviews-settings-section{grid-template-columns:repeat(2,1fr)}.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__content,.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__sidebar{grid-column:span 2}}.dataviews-view-config__label{text-wrap:nowrap}.dataviews-view-grid-items{container-type:inline-size;display:grid;gap:32px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));grid-template-rows:max-content;margin-bottom:auto;padding:0 24px 24px}@media not (prefers-reduced-motion){.dataviews-view-grid-items{transition:padding .1s ease-out}}.dataviews-view-grid{container-type:inline-size;display:flex;flex-direction:column;gap:32px;margin-bottom:auto;padding:0 24px 24px}@media not (prefers-reduced-motion){.dataviews-view-grid{transition:padding .1s ease-out}}.dataviews-view-grid .dataviews-view-grid__row{display:grid;gap:32px}.dataviews-view-grid .dataviews-view-grid__row .dataviews-view-grid__row__gridcell{border-radius:4px;position:relative}.dataviews-view-grid .dataviews-view-grid__row .dataviews-view-grid__row__gridcell[data-focus-visible]:after{border-radius:4px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";height:100%;left:0;outline:2px solid #0000;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-grid .dataviews-view-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-actions{padding:8px 0 4px}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable{width:fit-content}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{color:#1e1e1e}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after,.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;overflow:hidden;position:relative;width:100%}.dataviews-view-grid .dataviews-view-grid__media img{height:100%;object-fit:cover;width:100%}.dataviews-view-grid .dataviews-view-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-grid .dataviews-view-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-grid .dataviews-view-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field{align-items:center;min-height:24px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))){display:none}.dataviews-view-grid .dataviews-view-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-grid__field-value:empty,.dataviews-view-grid__field:empty{display:none}.dataviews-view-grid__card .dataviews-selection-checkbox{left:8px;opacity:0;position:absolute;top:-9999em;z-index:1}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-selection-checkbox{transition:opacity .1s linear}}@media (hover:none){.dataviews-view-grid__card .dataviews-selection-checkbox{opacity:1;top:8px}}.dataviews-view-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-grid__card:hover .dataviews-selection-checkbox{opacity:1;top:8px}.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:0;position:absolute;right:4px;top:4px}.dataviews-view-grid__card .dataviews-view-grid__media-actions .dataviews-all-actions-button{background-color:#fff}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-view-grid__media-actions{transition:opacity .1s linear}}@media (hover:none){.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:1;top:4px}}.dataviews-view-grid__card .dataviews-view-grid__media-actions:has(.dataviews-all-actions-button[aria-expanded=true]),.dataviews-view-grid__card:focus-within .dataviews-view-grid__media-actions,.dataviews-view-grid__card:hover .dataviews-view-grid__media-actions{opacity:1}.dataviews-view-grid__media--clickable{cursor:pointer}.dataviews-view-grid__group-header{color:#1e1e1e;container-type:inline-size;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 24px}div.dataviews-view-list{list-style-type:none}.dataviews-view-list{margin:0 0 auto}.dataviews-view-list div[role=article],.dataviews-view-list div[role=row]{border-top:1px solid #f0f0f0;margin:0}.dataviews-view-list div[role=article] .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row] .dataviews-view-list__item-wrapper{box-sizing:border-box;padding:16px 24px;position:relative}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions{display:flex;flex:0 0 auto;gap:4px;white-space:nowrap;width:max-content}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions .components-button,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions .components-button{position:relative;z-index:1}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>div,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>div{height:24px}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex:0;overflow:hidden;width:0}.dataviews-view-list div[role=article]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}@media (hover:none){.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}}.dataviews-view-list div[role=article].is-selected.is-selected,.dataviews-view-list div[role=article].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=article].is-selected.is-selected+div[role=row],.dataviews-view-list div[role=row].is-selected.is-selected,.dataviews-view-list div[role=row].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=row].is-selected.is-selected+div[role=row]{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered,.dataviews-view-list div[role=article]:not(.is-selected):focus-within,.dataviews-view-list div[role=article]:not(.is-selected):hover,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered,.dataviews-view-list div[role=row]:not(.is-selected):focus-within,.dataviews-view-list div[role=row]:not(.is-selected):hover{background-color:rgba(var(--wp-admin-theme-color--rgb),.04);border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12);color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered+div[role=article],.dataviews-view-list div[role=article]:not(.is-selected).is-hovered+div[role=row],.dataviews-view-list div[role=article]:not(.is-selected):focus-within+div[role=article],.dataviews-view-list div[role=article]:not(.is-selected):focus-within+div[role=row],.dataviews-view-list div[role=article]:not(.is-selected):hover+div[role=article],.dataviews-view-list div[role=article]:not(.is-selected):hover+div[role=row],.dataviews-view-list div[role=row]:not(.is-selected).is-hovered+div[role=article],.dataviews-view-list div[role=row]:not(.is-selected).is-hovered+div[role=row],.dataviews-view-list div[role=row]:not(.is-selected):focus-within+div[role=article],.dataviews-view-list div[role=row]:not(.is-selected):focus-within+div[role=row],.dataviews-view-list div[role=row]:not(.is-selected):hover+div[role=article],.dataviews-view-list div[role=row]:not(.is-selected):hover+div[role=row]{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-title-field,.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-view-list__field,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-title-field,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-view-list__field,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-title-field,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-view-list__field,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-title-field,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-view-list__field,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-title-field,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-view-list__field,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-title-field,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-view-list__field{color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper{background-color:rgba(var(--wp-admin-theme-color--rgb),.08);color:#1e1e1e}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__field,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__field,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__field,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__field{color:#1e1e1e}.dataviews-view-list .dataviews-view-list__item{appearance:none;background:none;border:none;cursor:pointer;inset:0;padding:0;position:absolute;scroll-margin:8px 0;z-index:1}.dataviews-view-list .dataviews-view-list__item:focus-visible{outline:none}.dataviews-view-list .dataviews-view-list__item:focus-visible:before{border-radius:2px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";inset:var(--wp-admin-border-width-focus);outline:2px solid #0000;position:absolute}.dataviews-view-list .dataviews-view-list__title-field{flex:1;line-height:24px;min-height:24px;overflow:hidden}.dataviews-view-list .dataviews-view-list__title-field:has(a,button){z-index:1}.dataviews-view-list .dataviews-view-list__media-wrapper{background-color:#fff;border-radius:4px;flex-shrink:0;height:52px;overflow:hidden;position:relative;width:52px}.dataviews-view-list .dataviews-view-list__media-wrapper img{height:100%;object-fit:cover;width:100%}.dataviews-view-list .dataviews-view-list__media-wrapper:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;position:absolute;top:0;width:100%}.dataviews-view-list .dataviews-view-list__field-wrapper{flex-grow:1;min-height:52px}.dataviews-view-list .dataviews-view-list__field{color:#757575}.dataviews-view-list .dataviews-view-list__fields{display:flex;flex-wrap:wrap;font-size:12px;gap:12px;row-gap:4px}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field:has(.dataviews-view-list__field-value:empty),.dataviews-view-list .dataviews-view-list__fields:empty{display:none}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field-value{align-items:center;display:flex;line-height:20px;min-height:24px}.dataviews-view-list+.dataviews-pagination{justify-content:space-between}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__item-wrapper{padding:8px 24px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__title-field{line-height:16px;min-height:16px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__media-wrapper{height:32px;width:32px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__field-wrapper{min-height:32px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__fields{gap:8px;row-gap:4px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__fields .dataviews-view-list__field-value{line-height:16px;min-height:16px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__item-wrapper{padding:24px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__title-field{line-height:32px;min-height:32px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__media-wrapper{height:64px;width:64px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__field-wrapper{min-height:64px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__fields{gap:16px;row-gap:8px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__fields .dataviews-view-list__field-value{line-height:24px;min-height:32px}.dataviews-view-list__group-header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 24px}.dataviews-view-table{background-color:inherit;border-collapse:collapse;border-color:inherit;color:#757575;margin-bottom:auto;position:relative;text-indent:0;width:100%}.dataviews-view-table th{color:#1e1e1e;font-size:13px;font-weight:400;text-align:left}.dataviews-view-table td,.dataviews-view-table th{padding:12px}.dataviews-view-table td.dataviews-view-table__actions-column,.dataviews-view-table th.dataviews-view-table__actions-column{text-align:right}.dataviews-view-table td.dataviews-view-table__actions-column--sticky,.dataviews-view-table th.dataviews-view-table__actions-column--sticky{background-color:var(--wp-dataviews-color-background,#fff);position:sticky;right:0}.dataviews-view-table td.dataviews-view-table__actions-column--stuck:after,.dataviews-view-table th.dataviews-view-table__actions-column--stuck:after{background-color:#f0f0f0;bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:1px}.dataviews-view-table td.dataviews-view-table__checkbox-column,.dataviews-view-table th.dataviews-view-table__checkbox-column{padding-right:0}.dataviews-view-table td.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper,.dataviews-view-table th.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper{max-width:auto;min-width:auto}.dataviews-view-table tr{background-color:inherit;border-top:1px solid #f0f0f0}.dataviews-view-table tr td:first-child,.dataviews-view-table tr th:first-child{padding-left:24px}.dataviews-view-table tr td:last-child,.dataviews-view-table tr th:last-child{padding-right:24px}.dataviews-view-table tr:last-child{border-bottom:0}.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:0}@media (hover:none){.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}}.dataviews-view-table tr.is-selected{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff);color:#757575}.dataviews-view-table tr.is-selected,.dataviews-view-table tr.is-selected+tr{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-table tr.is-selected .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff)}.dataviews-view-table tr.is-hovered .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:focus-within .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:hover .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}.dataviews-view-table.has-bulk-actions tr:focus-within .dataviews-view-table__actions-column--sticky,.dataviews-view-table.has-bulk-actions tr:hover .dataviews-view-table__actions-column--sticky{background-color:var(--wp-dataviews-color-background,#fff)}.dataviews-view-table.has-bulk-actions tr.is-selected .dataviews-view-table__actions-column--sticky,.dataviews-view-table.has-bulk-actions tr.is-selected:hover .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff)}.dataviews-view-table thead{background-color:inherit;inset-block-start:0;position:sticky;z-index:1}.dataviews-view-table thead tr{border:0}.dataviews-view-table thead th{background-color:inherit;font-size:11px;font-weight:499;padding-bottom:8px;padding-top:8px;text-transform:uppercase}.dataviews-view-table thead th:has(.dataviews-view-table-header-button){padding-left:4px;padding-right:4px}.dataviews-view-table thead th:has(.dataviews-view-table-header-button) .dataviews-view-table-header-button{gap:4px}.dataviews-view-table thead th:has(.dataviews-view-table-header-button):first-child{padding-left:40px}.dataviews-view-table thead th:has(.dataviews-view-table-header-button):last-child{padding-right:40px}.dataviews-view-table tbody td{vertical-align:top}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper{align-items:center;display:flex;min-height:32px;white-space:nowrap}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-end{justify-content:flex-end}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-center{justify-content:center}.dataviews-view-table tbody .components-v-stack>.dataviews-view-table__cell-content-wrapper:not(:first-child){min-height:0}.dataviews-view-table .dataviews-view-table-header-button{font-size:11px;font-weight:499;padding:4px 8px;text-transform:uppercase}.dataviews-view-table .dataviews-view-table-header-button:not(:hover){color:#1e1e1e}.dataviews-view-table .dataviews-view-table-header-button span{speak:none}.dataviews-view-table .dataviews-view-table-header-button span:empty{display:none}.dataviews-view-table .dataviews-view-table-header{padding-left:4px}.dataviews-view-table .dataviews-view-table__actions-column{white-space:nowrap;width:auto}.dataviews-view-table.has-compact-density thead th:has(.dataviews-view-table-header-button):not(:first-child){padding-left:0}.dataviews-view-table.has-compact-density thead th:has(.dataviews-view-table-header-button):not(:last-child){padding-right:0}.dataviews-view-table.has-compact-density td,.dataviews-view-table.has-compact-density th{padding:4px 8px}.dataviews-view-table.has-comfortable-density td,.dataviews-view-table.has-comfortable-density th{padding:16px 12px}.dataviews-view-table.has-comfortable-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-comfortable-density th.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density th.dataviews-view-table__checkbox-column{padding-right:0}.dataviews-view-table-selection-checkbox{--checkbox-input-size:24px}@media (min-width:600px){.dataviews-view-table-selection-checkbox{--checkbox-input-size:16px}}.dataviews-column-primary__media{background-color:#fff;border-radius:4px;flex-shrink:0;max-width:60px;min-height:32px;min-width:32px;overflow:hidden;position:relative}.dataviews-column-primary__media img{height:32px;object-fit:cover;width:32px}.dataviews-column-primary__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;position:absolute;top:0;width:100%}.dataviews-view-table__cell-content-wrapper:not(.dataviews-column-primary__media),.dataviews-view-table__primary-column-content:not(.dataviews-column-primary__media){max-width:80ch;min-width:15ch}.dataviews-view-table__group-header-row .dataviews-view-table__group-header-cell{color:#1e1e1e;font-weight:499;padding:12px 24px}.dataviews-view-table col[class^=dataviews-view-table__col-]:not(.dataviews-view-table__col-first-data){width:1%}.dataviews-view-picker-grid .dataviews-view-picker-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-actions{padding:8px 0 4px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field--clickable{width:fit-content}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{color:#1e1e1e}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after,.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-picker-grid:focus-visible[aria-activedescendant]{outline:none}.dataviews-view-picker-grid:focus-visible [data-active-item=true]{outline:2px solid var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-selection-checkbox{top:8px!important}.dataviews-view-picker-grid .dataviews-selection-checkbox input{pointer-events:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;min-height:0;position:relative;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media img{height:100%;object-fit:cover;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field{align-items:center;min-height:24px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field:not(:has(.dataviews-view-picker-grid__field-value:not(:empty))){display:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-picker-grid__field-value:empty,.dataviews-view-picker-grid__field:empty{display:none}.dataviews-view-picker-grid__card .dataviews-selection-checkbox{left:8px;position:absolute;top:-9999em;z-index:1}@media (hover:none){.dataviews-view-picker-grid__card .dataviews-selection-checkbox{top:8px}}.dataviews-view-picker-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:hover .dataviews-selection-checkbox{top:8px}.dataviews-view-picker-grid__media--clickable{cursor:pointer}.dataviews-view-picker-grid-group__header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 48px}.dataviews-view-picker-table{background-color:inherit}.dataviews-view-picker-table .dataviews-view-table__checkbox-column{width:48px}.dataviews-view-picker-table tbody:focus-visible[aria-activedescendant]{outline:none}.dataviews-view-picker-table tbody:focus-visible [data-active-item=true]{outline:2px solid var(--wp-admin-theme-color)}.dataviews-view-picker-table .dataviews-selection-checkbox .components-checkbox-control__input.components-checkbox-control__input{opacity:1;pointer-events:none}.dataviews-view-picker-table .dataviews-view-table__row{cursor:pointer}.dataviews-view-picker-table .dataviews-view-table__row.is-selected{background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.dataviews-view-picker-table .dataviews-view-table__row.is-hovered{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-picker-table .dataviews-view-table__row.is-selected.is-hovered{background-color:rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-activity{margin:0 0 auto;padding:8px 24px}.dataviews-view-activity .dataviews-view-activity__group-header{color:#949494;font-size:15px;font-weight:499;margin:0 0 8px;padding:0}.dataviews-view-activity .dataviews-view-activity__item-actions{min-width:24px}.dataviews-view-activity .dataviews-view-activity__item-content{flex-grow:1}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-description,.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields,.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title{min-height:16px}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title{align-items:center;display:flex;flex:1;overflow:hidden;position:relative}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title--clickable{cursor:pointer}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title--clickable:focus-visible{border-radius:2px;outline:var(--wp-admin-border-width-focus) solid var(--wp-admin-theme-color);outline-offset:var(--wp-admin-border-width-focus)}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__primary-actions{display:flex;flex:0 0 auto;width:max-content}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__primary-actions .components-button{position:relative;z-index:1}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields{color:#757575;display:flex;flex-wrap:wrap;gap:12px;row-gap:4px}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields .dataviews-view-activity__item-field:has(.dataviews-view-activity__item-field-value:empty),.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields:empty{display:none}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields .dataviews-view-activity__item-field-value{align-items:center;display:flex}.dataviews-view-activity .dataviews-view-activity__item-type{align-self:stretch;flex-shrink:0}.dataviews-view-activity .dataviews-view-activity__item-type:after{background-color:#ddd;content:"";flex:1 1 auto;margin:0 auto;width:1px}.dataviews-view-activity .dataviews-view-activity__item-type:before{background-color:#ddd;content:"";flex:0 0 auto;margin:0 auto;width:1px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-type{width:8px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-type:before{height:12px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-type-icon{height:11px;width:11px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-content{margin:12px 0}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-type{width:24px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-type:before{height:12px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-type-icon{height:25px;width:25px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-content{margin:12px 0;padding-top:8px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-type{width:32px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-type:before{height:8px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-type-icon{height:33px;width:33px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-content{margin:8px 0 16px;padding-top:12px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-bullet,.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-bullet{height:9px;position:relative;top:50%;transform:translateY(-50%);width:9px}.dataviews-view-activity .dataviews-view-activity__item:first-child .dataviews-view-activity__item-type:before{visibility:hidden}.dataviews-view-activity .dataviews-view-activity__group:last-of-type>.dataviews-view-activity__item:last-of-type .dataviews-view-activity__item-type:after,.dataviews-view-activity>.dataviews-view-activity__item:last-child .dataviews-view-activity__item-type:after{background:linear-gradient(180deg,#ddd 0,#ddd3 60%,#ddd0)}.dataviews-view-activity .dataviews-view-activity__item-type-icon{background-color:#fff;flex-shrink:0;overflow:hidden}.dataviews-view-activity .dataviews-view-activity__item-type-icon .dataviews-view-activity__item-bullet,.dataviews-view-activity .dataviews-view-activity__item-type-icon img,.dataviews-view-activity .dataviews-view-activity__item-type-icon svg{border-radius:50%;box-shadow:inset 0 0 0 1px #ddd;box-sizing:border-box;display:block;height:100%;margin:0 auto;object-fit:cover;width:100%}.dataviews-view-activity .dataviews-view-activity__item-type-icon svg{padding:4px}.dataviews-view-activity .dataviews-view-activity__item-type-icon .dataviews-view-activity__item-bullet{background-color:#ddd;content:""}.dataviews-view-activity+.dataviews-pagination{justify-content:space-between}.dataviews-picker-footer__bulk-selection{align-self:flex-start;height:32px}.dataviews-picker-footer__actions{align-self:flex-end}.dataviews-controls__datetime{border:none;padding:0}.dataviews-controls__relative-date-number,.dataviews-controls__relative-date-unit{flex:1 1 50%}.dataviews-controls__date input[type=date]::-webkit-calendar-picker-indicator,.dataviews-controls__date input[type=date]::-webkit-inner-spin-button{-webkit-appearance:none;display:none}.dataviews-controls__date-range-inputs>*{min-width:0}.dataviews-controls__date-preset{border:1px solid #ddd}.dataviews-controls__date-preset:active{background-color:#000}.dataforms-layouts-panel__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-panel__field--label-position-none{align-items:center!important}.dataforms-layouts-panel__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-panel__field-label--label-position-side{align-self:center}.dataforms-layouts-panel__field-label.has-error{color:#cc1818}.dataforms-layouts-panel__field-label-error-content{cursor:help;fill:#cc1818}.dataforms-layouts-panel__field-label-error-content svg{fill:currentColor}.dataforms-layouts-panel__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-panel__field-control .components-button{max-width:100%;min-height:32px;text-align:left;text-wrap:balance;text-wrap:pretty;white-space:normal}.dataforms-layouts-panel__field-control.components-button.is-link[aria-disabled=true]{text-decoration:none}.dataforms-layouts-panel__field-control .components-dropdown{max-width:100%}.dataforms-layouts-panel__field-dropdown .components-popover__content{min-width:320px;padding:16px}.dataforms-layouts-panel__dropdown-header{margin-bottom:16px}.dataforms-layouts-panel__modal-footer{margin-top:16px}.components-popover.components-dropdown__content.dataforms-layouts-panel__field-dropdown{z-index:159990}.dataforms-layouts-panel__summary-button:empty{min-width:160px}.dataforms-layouts-regular__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-regular__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-regular__field-label--label-position-side{align-self:center}.dataforms-layouts-regular__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-card__field-header-label{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:15px;font-weight:499;line-height:20px}.dataforms-layouts-card__field{width:100%}.dataforms-layouts-card__field-description{color:#757575;display:block;font-size:13px;margin-bottom:16px}.dataforms-layouts-card__field-summary{display:flex;flex-direction:row;gap:16px}.dataforms-layouts-details__content{padding-top:12px}.dataforms-layouts-row__field-control{width:100%}.dataforms-layouts__wrapper{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px}@media (max-width:782px){.admin-ui-page{top:46px}}@container (width < 500px){.jp-forms-dataviews__view-actions{--wp-ui-stack-justify:flex-start;align-items:flex-start;flex-direction:column-reverse}}.jp-forms-dataviews__view-actions>div:not(:empty){min-height:48px}.jp-forms-dataviews-filters__container,.jp-forms-dataviews-filters__container:not(:empty){padding:0}.jp-forms-dataviews-filters__container:not(:empty){padding-block:12px;padding-inline:20px}'));
  document.head.appendChild(style);
}

// routes/responses/stage.tsx
var import_jsx_runtime166 = __toESM(require_jsx_runtime());
var EMPTY_ARRAY8 = [];
var defaultLayouts2 = {
  table: {},
  list: {}
};
var DEFAULT_VIEW = {
  type: "table",
  filters: [],
  perPage: 20,
  sort: {
    field: "date",
    direction: "desc"
  },
  titleField: "from",
  fields: ["date", "source", "ip"]
};
function getItemId(item) {
  return item?.id?.toString() ?? "";
}
function styleUnreadValue(element, isUnread) {
  if (!isUnread) {
    return element;
  }
  if (typeof element === "string") {
    return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("span", { style: { fontWeight: 600 }, children: element });
  }
  if (React33.isValidElement(element)) {
    return React33.cloneElement(element, {
      style: { ...element.props.style || {}, fontWeight: 600 }
    });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("span", { style: { fontWeight: 600 }, children: element });
}
function getUrlPath(url) {
  try {
    const parsedUrl = new URL(url);
    return parsedUrl.pathname;
  } catch {
    return null;
  }
}
function StageInner() {
  const params = useParams({ from: "/responses/$view" });
  const searchParams = useSearch2({ from: "/responses/$view" });
  const navigate = useNavigate3();
  const statusView = params.view === "spam" || params.view === "trash" ? params.view : "inbox";
  const statusFilter = statusView === "inbox" ? "draft,publish" : statusView;
  const sourceIdValue = searchParams?.sourceId;
  const sourceIdNumber = typeof sourceIdValue === "number" ? sourceIdValue : Number(sourceIdValue);
  const isSingleFormView = Number.isFinite(sourceIdNumber) && sourceIdNumber > 0;
  const [isIntegrationsModalOpen, setIsIntegrationsModalOpen] = (0, import_element97.useState)(false);
  const integrations = (0, import_data33.useSelect)(
    (select3) => select3(INTEGRATIONS_STORE).getIntegrations?.() ?? [],
    []
  );
  const { refreshIntegrations: refreshIntegrations2 } = (0, import_data33.useDispatch)(INTEGRATIONS_STORE);
  const isIntegrationsEnabled = useConfigValue("isIntegrationsEnabled");
  const showDashboardIntegrations = useConfigValue("showDashboardIntegrations");
  const [view, setView] = (0, import_element97.useState)(() => ({
    ...DEFAULT_VIEW,
    search: searchParams?.search || ""
  }));
  const selection = (0, import_element97.useMemo)(() => searchParams?.responseIds ?? [], [searchParams?.responseIds]);
  const {
    setCurrentQuery: setCurrentQuery2,
    setSelectedResponses: setSelectedResponses2,
    filterOptions,
    records,
    isLoadingData,
    totalItems,
    totalPages,
    totalItemsInbox,
    totalItemsSpam,
    totalItemsTrash
  } = useInboxData({ status: statusView });
  (0, import_element97.useEffect)(() => {
    const urlSearch = searchParams?.search || "";
    if (urlSearch !== view.search) {
      setView((prev) => ({ ...prev, search: urlSearch }));
    }
  }, [searchParams?.search]);
  const onChangeView = (0, import_element97.useCallback)(
    (newView) => {
      if (!isSingleFormView) {
        const folderValue = newView.filters?.find((filter) => filter.field === "folder")?.value || "inbox";
        if (folderValue !== statusView) {
          navigate({
            to: "/responses/$view",
            params: { view: folderValue },
            search: {
              ...searchParams,
              responseIds: void 0
            }
          });
          setView({ ...newView, page: 1 });
          return;
        }
      }
      setView(newView);
      if (newView.search !== view.search) {
        navigate({
          search: {
            ...searchParams,
            search: newView.search || void 0
          }
        });
      }
    },
    [isSingleFormView, navigate, searchParams, statusView, view.search]
  );
  const onChangeSelection = (0, import_element97.useCallback)(
    (items) => {
      navigate({
        search: {
          ...searchParams,
          responseIds: items.length > 0 ? items : void 0
        }
      });
    },
    [searchParams, navigate]
  );
  const onStatusChange = (0, import_element97.useCallback)(
    (nextStatus) => {
      navigate({
        to: "/responses/$view",
        params: { view: nextStatus },
        search: {
          ...searchParams,
          responseIds: void 0,
          sourceId: isSingleFormView ? String(sourceIdNumber) : void 0
        }
      });
    },
    [isSingleFormView, navigate, searchParams, sourceIdNumber]
  );
  (0, import_element97.useEffect)(() => {
    if (isSingleFormView) {
      return;
    }
    setView((previousView) => {
      const previousFilters = previousView.filters || [];
      const existing = previousFilters.find((filter) => filter.field === "folder");
      if (existing?.value === statusView) {
        return previousView;
      }
      return {
        ...previousView,
        filters: [
          { field: "folder", operator: "is", value: statusView },
          ...previousFilters.filter((filter) => filter.field !== "folder")
        ]
      };
    });
  }, [isSingleFormView, setView, statusView]);
  const queryParams = (0, import_element97.useMemo)(() => {
    const queryArgs = {
      status: statusFilter,
      per_page: view.perPage,
      page: view.page || 1,
      orderby: view.sort?.field || "date",
      order: view.sort?.direction || "desc"
    };
    if (view.search) {
      queryArgs.search = view.search;
    }
    if (isSingleFormView) {
      queryArgs.parent = String(sourceIdNumber);
    }
    view.filters?.forEach((filter) => {
      if (!filter.value) {
        return;
      }
      if (filter.field === "read_status") {
        queryArgs.is_unread = filter.value === "unread";
      }
      if (!isSingleFormView && filter.field === "source") {
        queryArgs.parent = filter.value;
      }
      if (filter.field === "date") {
        const [year, month] = filter.value.split("/").map(Number);
        queryArgs.after = new Date(Date.UTC(year, month - 1, 1)).toISOString();
        queryArgs.before = new Date(Date.UTC(year, month, 0, 23, 59, 59)).toISOString();
      }
    });
    return queryArgs;
  }, [isSingleFormView, sourceIdNumber, statusFilter, view]);
  (0, import_element97.useEffect)(() => {
    setCurrentQuery2(queryParams);
  }, [queryParams, setCurrentQuery2]);
  (0, import_element97.useEffect)(() => {
    const validSelectedIds = (selection || []).filter((id) => {
      return records?.some((record) => getItemId(record) === id);
    });
    setSelectedResponses2(validSelectedIds);
  }, [records, selection, setSelectedResponses2]);
  const fields = (0, import_element97.useMemo)(
    () => [
      ...isSingleFormView ? [] : [
        {
          id: "folder",
          label: (0, import_i18n86.__)("Folder", "jetpack-forms"),
          elements: [
            {
              label: (0, import_i18n86.sprintf)(
                /* translators: %s is the number of inbox responses. */
                (0, import_i18n86.__)("Inbox (%s)", "jetpack-forms"),
                formatNumber2(totalItemsInbox ?? 0)
              ),
              value: "inbox"
            },
            {
              label: (0, import_i18n86.sprintf)(
                /* translators: %s is the number of spam responses. */
                (0, import_i18n86.__)("Spam (%s)", "jetpack-forms"),
                formatNumber2(totalItemsSpam ?? 0)
              ),
              value: "spam"
            },
            {
              label: (0, import_i18n86.sprintf)(
                /* translators: %s is the number of trash responses. */
                (0, import_i18n86.__)("Trash (%s)", "jetpack-forms"),
                formatNumber2(totalItemsTrash ?? 0)
              ),
              value: "trash"
            }
          ],
          // Primary so the filter UI (and its pill) is visible by default.
          filterBy: { operators: ["is"], isPrimary: true },
          enableSorting: false,
          enableHiding: false,
          // Filter-only field; not shown as a column.
          render: () => null,
          getValue: () => null
        }
      ],
      {
        id: "from",
        label: (0, import_i18n86.__)("From", "jetpack-forms"),
        render: ({ item }) => {
          const displayName = (0, import_html_entities5.decodeEntities)(
            item.author_name || item.author_email || item.author_url || item.ip || "Anonymous"
          );
          const showEmail = item.author_email && displayName !== (0, import_html_entities5.decodeEntities)(item.author_email);
          const defaultImage = item.author_name || item.author_email ? "initials" : "mp";
          return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(Stack3, { align: "center", gap: "sm", children: [
            item.is_unread && /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
              "span",
              {
                style: {
                  color: "#d63638",
                  fontSize: "8px",
                  position: "absolute",
                  marginLeft: "-12px"
                },
                "aria-label": (0, import_i18n86.__)("(Unread form response)", "jetpack-forms"),
                children: "\u25CF"
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
              Gravatar,
              {
                email: item.author_email || item.ip,
                defaultImage,
                displayName,
                size: 32,
                useHovercard: false
              }
            ),
            styleUnreadValue(
              /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(Stack3, { direction: "column", gap: "2xs", children: [
                /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(import_components78.__experimentalText, { ellipsizeMode: "tail", limit: 50, truncate: true, children: displayName }),
                showEmail && /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(import_components78.__experimentalText, { variant: "muted", size: 12, ellipsizeMode: "tail", limit: 50, truncate: true, children: item.author_email })
              ] }),
              item.is_unread
            )
          ] });
        },
        getValue: ({ item }) => item.author_name || item.author_email || item.author_url || item.ip || "Anonymous",
        enableSorting: false,
        enableHiding: false
      },
      {
        id: "date",
        label: (0, import_i18n86.__)("Date", "jetpack-forms"),
        render: ({ item }) => {
          const dateStr = new Date(item.date).toLocaleDateString(void 0, {
            year: "numeric",
            month: "long",
            day: "numeric"
          });
          return styleUnreadValue(dateStr, item.is_unread);
        },
        elements: (filterOptions?.date || []).map((filter) => {
          const date = /* @__PURE__ */ new Date();
          date.setDate(1);
          date.setMonth(filter.month - 1);
          date.setFullYear(filter.year);
          return {
            label: (0, import_date10.dateI18n)((0, import_i18n86.__)("F Y", "jetpack-forms"), date),
            value: `${filter.year}/${filter.month}`
          };
        }),
        filterBy: { operators: ["is"] },
        enableSorting: false
      },
      {
        id: "source",
        label: (0, import_i18n86.__)("Source", "jetpack-forms"),
        render: ({ item }) => {
          const source = item.entry_title || getUrlPath(item.entry_permalink) || (0, import_i18n86.__)("(no title)", "jetpack-forms");
          if (item.entry_permalink) {
            return styleUnreadValue(
              /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(import_components78.ExternalLink, { href: item.entry_permalink, children: source }),
              item.is_unread
            );
          }
          return styleUnreadValue(source, item.is_unread);
        },
        elements: (filterOptions?.source || []).map(
          (source) => ({
            value: source.id.toString(),
            label: (0, import_html_entities5.decodeEntities)(source.title) || getUrlPath(source.url) || (0, import_i18n86.__)("(no title)", "jetpack-forms")
          })
        ),
        ...isSingleFormView ? {} : { filterBy: { operators: ["is"] } },
        enableSorting: false
      },
      {
        id: "read_status",
        label: (0, import_i18n86.__)("Status", "jetpack-forms"),
        elements: [
          { label: (0, import_i18n86.__)("Unread", "jetpack-forms"), value: "unread" },
          { label: (0, import_i18n86.__)("Read", "jetpack-forms"), value: "read" }
        ],
        filterBy: { operators: ["is"] },
        enableSorting: false,
        render: ({ item }) => {
          return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(Badge3, { intent: "draft", children: item.is_unread ? (0, import_i18n86.__)("Unread", "jetpack-forms") : (0, import_i18n86.__)("Read", "jetpack-forms") });
        }
      },
      {
        id: "ip",
        label: (0, import_i18n86.__)("IP Address", "jetpack-forms"),
        render: ({ item }) => {
          if (!item.ip) {
            return styleUnreadValue("-", item.is_unread);
          }
          return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(TextWithFlag, { countryCode: item.country_code, fallbackIcon: true, children: styleUnreadValue(item.ip, item.is_unread) });
        },
        enableSorting: false
      }
    ],
    [filterOptions, isSingleFormView, totalItemsInbox, totalItemsSpam, totalItemsTrash]
  );
  const actions2 = (0, import_element97.useMemo)(
    () => getRowActions({
      navigate,
      searchParams,
      view: statusView
    }),
    [navigate, searchParams, statusView]
  );
  const paginationInfo = (0, import_element97.useMemo)(
    () => ({
      totalItems: totalItems || 0,
      totalPages: totalPages || 1
    }),
    [totalItems, totalPages]
  );
  const handleIntegrations = (0, import_element97.useCallback)(() => {
    setIsIntegrationsModalOpen(true);
  }, []);
  const closeIntegrationsModal = (0, import_element97.useCallback)(() => {
    setIsIntegrationsModalOpen(false);
  }, []);
  const {
    breadcrumbs,
    badges,
    subtitle,
    actions: headerActions
  } = usePageHeaderDetails({
    screen: "responses",
    statusView,
    sourceId: sourceIdValue,
    isIntegrationsEnabled: !!isIntegrationsEnabled,
    showDashboardIntegrations: !!showDashboardIntegrations,
    onOpenIntegrations: handleIntegrations
  });
  const readStatusFilter = view.filters?.find((filter) => filter.field === "read_status")?.value;
  const onClickItem = (0, import_element97.useCallback)(
    (item) => {
      onChangeSelection([String(item.id)]);
    },
    [onChangeSelection]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(
    page_default,
    {
      showSidebarToggle: false,
      breadcrumbs,
      badges,
      subTitle: subtitle,
      actions: headerActions,
      hasPadding: false,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(
          dataviews_default,
          {
            empty: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
              empty_responses_default,
              {
                isSearch: !!view.search,
                isSingleFormView,
                readStatusFilter,
                status: statusView
              }
            ),
            data: records || EMPTY_ARRAY8,
            fields,
            view,
            onChangeView,
            paginationInfo,
            isLoading: isLoadingData,
            getItemId,
            defaultLayouts: defaultLayouts2,
            selection,
            onChangeSelection,
            onClickItem,
            actions: actions2,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
                DataViewsHeaderRow,
                {
                  activeTab: "responses",
                  isSingleFormView,
                  activeStatus: statusView,
                  statusCounts: {
                    inbox: totalItemsInbox ?? 0,
                    spam: totalItemsSpam ?? 0,
                    trash: totalItemsTrash ?? 0
                  },
                  onStatusChange
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(dataviews_default.Layout, {}),
              /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(dataviews_default.Footer, {})
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(
          jetpack_integrations_modal_default,
          {
            isOpen: isIntegrationsModalOpen,
            onClose: closeIntegrationsModal,
            attributes: void 0,
            setAttributes: void 0,
            integrationsData: integrations,
            refreshIntegrations: refreshIntegrations2,
            context: "dashboard"
          }
        )
      ]
    }
  );
}
var Stage = () => {
  return /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(WpRouteDashboardSearchParamsProvider, { from: "/responses/$view", children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(StageInner, {}) });
};

// routes/responses/response/index.tsx
var import_api_fetch12 = __toESM(require_api_fetch());
var import_components92 = __toESM(require_components());
var import_core_data10 = __toESM(require_core_data());
var import_data37 = __toESM(require_data());
var import_element103 = __toESM(require_element());
var import_html_entities9 = __toESM(require_html_entities());
var import_i18n97 = __toESM(require_i18n());
import { useParams as useParams2, useSearch as useSearch4, useNavigate as useNavigate5 } from "@wordpress/route";

// src/dashboard/components/feedback-comments/index.tsx
var import_components80 = __toESM(require_components(), 1);
var import_core_data8 = __toESM(require_core_data(), 1);
var import_data34 = __toESM(require_data(), 1);
var import_element98 = __toESM(require_element(), 1);
var import_i18n88 = __toESM(require_i18n(), 1);
var import_notices7 = __toESM(require_notices(), 1);

// src/dashboard/components/feedback-comments/comment-item.tsx
var import_components79 = __toESM(require_components(), 1);
var import_date11 = __toESM(require_date(), 1);
var import_dom14 = __toESM(require_dom(), 1);
var import_i18n87 = __toESM(require_i18n(), 1);
var import_jsx_runtime167 = __toESM(require_jsx_runtime(), 1);
function formatCommentDate(dateString) {
  return (0, import_i18n87.sprintf)(
    /* Translators: %1$s is the date, %2$s is the time. */
    (0, import_i18n87.__)("%1$s at %2$s", "jetpack-forms"),
    (0, import_date11.dateI18n)((0, import_date11.getSettings)().formats.date, dateString),
    (0, import_date11.dateI18n)((0, import_date11.getSettings)().formats.time, dateString)
  );
}
var CommentItem = ({ comment, onDelete, isDeleting }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)("div", { className: "jp-forms__feedback-comments-comment", children: [
    /* @__PURE__ */ (0, import_jsx_runtime167.jsxs)("div", { className: "jp-forms__feedback-comments-comment-meta", children: [
      /* @__PURE__ */ (0, import_jsx_runtime167.jsx)("strong", { className: "jp-forms__feedback-comments-comment-author", children: comment.author_name }),
      /* @__PURE__ */ (0, import_jsx_runtime167.jsx)("span", { className: "jp-forms__feedback-comments-comment-date", children: formatCommentDate(comment.date) }),
      /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(
        import_components79.DropdownMenu,
        {
          icon: more_vertical_default,
          label: (0, import_i18n87.__)("Note options", "jetpack-forms"),
          controls: [
            {
              title: (0, import_i18n87.__)("Delete", "jetpack-forms"),
              icon: trash_default,
              onClick: () => onDelete(comment.id),
              isDisabled: isDeleting
            }
          ]
        }
      )
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime167.jsx)(
      "div",
      {
        className: "jp-forms__feedback-comments-comment-content",
        dangerouslySetInnerHTML: { __html: (0, import_dom14.safeHTML)(comment.content.rendered) }
      }
    )
  ] }, comment.id);
};
var comment_item_default = CommentItem;

// src/dashboard/components/feedback-comments/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='e06e9946c9']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "e06e9946c9");
  style.appendChild(document.createTextNode(".jp-forms__feedback-comments{border-top:1px solid var(--jp-forms-border-color);display:flex;flex-direction:column;margin-top:0;padding:24px 0}@media (min-width:783px){.jp-forms__feedback-comments{padding:24px 16px}}.jp-forms__feedback-comments-heading{flex-shrink:0;font-size:16px;font-weight:600;margin:0 0 16px;padding:0;position:relative}.jp-forms__feedback-loading{bottom:-3px;position:absolute}.jp-forms__feedback-comments-list{display:flex;flex-direction:column;gap:16px;margin-bottom:24px}.jp-forms__feedback-comments-load-more{border-top:1px solid var(--jp-forms-border-color,#ddd);display:flex;justify-content:center;margin-bottom:24px;padding:12px}.jp-forms__feedback-comments-comment{background-color:var(--jp-forms-white-off,var(--wpds-color-bg-surface-neutral-weak,#e7e7e7));border-radius:var(--jp-forms-border-radius,4px);display:flex;flex-direction:column;gap:8px;padding:12px}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-meta{align-items:center;display:flex;flex-wrap:wrap;gap:8px}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-meta .jp-forms__feedback-comments-comment-date{flex-grow:4}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-meta .components-dropdown{align-self:flex-end}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-author{color:var(--jp-forms-color-darker-20,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:14px;font-weight:600}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-date{color:var(--jp-gray-80,#50575e);font-size:12px}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-content{font-size:14px;line-height:1.5;overflow-wrap:break-word}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-content p{margin:0}.jp-forms__feedback-comments-comment .jp-forms__feedback-comments-comment-content p+p{margin-top:8px}.jp-forms__feedback-comments-form-wrapper{background-color:#fff;border:1px solid var(--jp-forms-border-color,#ddd);border-radius:var(--jp-forms-border-radius,4px);display:flex;flex-direction:column;gap:12px}.jp-forms__feedback-comments-form-avatar{align-items:center;display:flex;flex-shrink:0;gap:12px}.jp-forms__feedback-comments-form-avatar img{border-radius:50%;display:block;height:32px;overflow:hidden;width:32px}.jp-forms__feedback-comments-form-input{flex:1;min-width:0}.jp-forms__feedback-comments-form-input .components-base-control,.jp-forms__feedback-comments-form-input .components-base-control__field{margin-bottom:0}.jp-forms__feedback-comments-form-input textarea{border:none;min-height:96px;padding:12px;resize:vertical;width:100%}.jp-forms__feedback-comments-user-info{display:flex;flex-direction:row;justify-content:space-between;padding:12px}.jp-forms__feedback-comments-form-button{flex-shrink:0;scroll-margin-bottom:20px}.jp-forms__feedback-comments-form-button .components-button{height:32px}.jp-forms__feedback-comments-error{background-color:#f8d7da;border:1px solid #f5c2c7;border-radius:var(--jp-forms-border-radius,4px);color:#842029;font-size:14px;margin-bottom:12px;padding:12px}"));
  document.head.appendChild(style);
}

// src/dashboard/components/feedback-comments/index.tsx
var import_jsx_runtime168 = __toESM(require_jsx_runtime(), 1);
var FeedbackComments = ({ postId }) => {
  const [newComment, setNewComment] = (0, import_element98.useState)("");
  const [isSubmitting, setIsSubmitting] = (0, import_element98.useState)(false);
  const [deletingCommentIds, setDeletingCommentIds] = (0, import_element98.useState)(/* @__PURE__ */ new Set());
  const [error2, setError] = (0, import_element98.useState)(null);
  const [page, setPage] = (0, import_element98.useState)(1);
  const perPage = 50;
  const [loadedComments, setLoadedComments] = (0, import_element98.useState)([]);
  const [clientAddedComments, setClientAddedComments] = (0, import_element98.useState)([]);
  const { createSuccessNotice, createErrorNotice } = (0, import_data34.useDispatch)(import_notices7.store);
  const { deleteEntityRecord, saveEntityRecord } = (0, import_data34.useDispatch)(import_core_data8.store);
  const currentUser = (0, import_data34.useSelect)((select3) => {
    return select3(import_core_data8.store).getCurrentUser();
  }, []);
  const {
    comments: commentsPage,
    totalComments,
    isLoadingComments
  } = (0, import_data34.useSelect)(
    (select3) => {
      const commentsData = select3(import_core_data8.store).getEntityRecords("root", "comment", {
        per_page: perPage,
        page,
        orderby: "date",
        order: "asc",
        post: postId
      });
      const total = select3(import_core_data8.store).getEntityRecordsTotalItems("root", "comment", {
        per_page: perPage,
        page,
        post: postId
      });
      return {
        comments: commentsData,
        totalComments: total || 0,
        isLoadingComments: commentsData === void 0 || commentsData === null
      };
    },
    [postId, page]
  );
  const hasMoreComments = page * perPage < (totalComments || 0);
  (0, import_element98.useEffect)(() => {
    setPage(1);
    setLoadedComments([]);
    setClientAddedComments([]);
    setError(null);
  }, [postId]);
  (0, import_element98.useEffect)(() => {
    if (!commentsPage) {
      return;
    }
    if (!Array.isArray(commentsPage)) {
      const message2 = commentsPage.message || (0, import_i18n88.__)("Failed to load comments. Please try again.", "jetpack-forms");
      setError(message2);
      return;
    }
    setError(null);
    if (commentsPage.length === 0) {
      return;
    }
    setLoadedComments((prev) => {
      const existing = new Set(prev.map((c2) => c2.id));
      const toAdd = commentsPage.filter((c2) => !existing.has(c2.id));
      setClientAddedComments(
        (prevClient) => prevClient.filter((c2) => !commentsPage.some((pc) => pc.id === c2.id))
      );
      return prev.concat(toAdd);
    });
  }, [commentsPage]);
  const scrollToBottom = (0, import_element98.useCallback)(() => {
    const button = document.querySelector(".jp-forms__feedback-comments-form-button");
    if (button) {
      button.scrollIntoView({ behavior: "smooth", block: "nearest" });
    }
  }, []);
  const handleLoadMore = (0, import_element98.useCallback)(() => {
    setPage((prevPage) => prevPage + 1);
  }, []);
  const handleNewComment = (0, import_element98.useCallback)(async () => {
    if (!newComment.trim()) {
      return;
    }
    setIsSubmitting(true);
    setError(null);
    try {
      const saved = await saveEntityRecord("root", "comment", {
        post: postId,
        content: newComment
      });
      if (saved === void 0) {
        setError((0, import_i18n88.__)("Failed to save the note. Please try again.", "jetpack-forms"));
        createErrorNotice((0, import_i18n88.__)("Failed to save the note.", "jetpack-forms"));
        setIsSubmitting(false);
        return;
      }
      setNewComment("");
      createSuccessNotice((0, import_i18n88.__)("Note added successfully.", "jetpack-forms"));
      setClientAddedComments((prev) => {
        if (!saved || !saved.id) {
          return prev;
        }
        const savedComment = saved;
        const existing = new Set(prev.map((c2) => c2.id));
        if (existing.has(savedComment.id)) {
          return prev;
        }
        return prev.concat(savedComment);
      });
      scrollToBottom();
    } catch (err) {
      setError((0, import_i18n88.__)("Failed to save the note. Please try again.", "jetpack-forms"));
      createErrorNotice((0, import_i18n88.__)("Failed to save the note.", "jetpack-forms"));
    } finally {
      setIsSubmitting(false);
    }
  }, [
    newComment,
    saveEntityRecord,
    postId,
    createSuccessNotice,
    scrollToBottom,
    createErrorNotice
  ]);
  const handleKeyDown = (0, import_element98.useCallback)(
    (event) => {
      if (event.key === "Enter" && !event.shiftKey) {
        event.preventDefault();
        handleNewComment();
      }
    },
    [handleNewComment]
  );
  const handleDelete = (0, import_element98.useCallback)(
    async (commentId) => {
      setDeletingCommentIds((prev) => {
        const next = new Set(prev);
        next.add(commentId);
        return next;
      });
      try {
        await deleteEntityRecord("root", "comment", commentId, {}, { throwOnError: true });
        createSuccessNotice((0, import_i18n88.__)("Note deleted.", "jetpack-forms"));
        setLoadedComments((prev) => prev.filter((c2) => c2.id !== commentId));
        setClientAddedComments((prev) => prev.filter((c2) => c2.id !== commentId));
      } catch (err) {
        setError((0, import_i18n88.__)("Failed to delete the note. Please try again.", "jetpack-forms"));
        createErrorNotice((0, import_i18n88.__)("Failed to delete the note.", "jetpack-forms"));
      } finally {
        setDeletingCommentIds((prev) => {
          const next = new Set(prev);
          next.delete(commentId);
          return next;
        });
      }
    },
    [deleteEntityRecord, createSuccessNotice, createErrorNotice]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "jp-forms__feedback-comments", children: [
    /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("h3", { className: "jp-forms__feedback-comments-heading", children: [
      (0, import_i18n88.__)("Notes", "jetpack-forms"),
      isLoadingComments && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("span", { className: "jp-forms__feedback-loading", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_components80.Spinner, { height: 12, width: 12 }) })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "jp-forms__feedback-comments-content", children: [
      !isLoadingComments && loadedComments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { className: "jp-forms__feedback-comments-list", children: loadedComments.map((comment) => /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
        comment_item_default,
        {
          comment,
          onDelete: handleDelete,
          isDeleting: deletingCommentIds.has(comment.id)
        },
        comment.id
      )) }),
      !isLoadingComments && hasMoreComments && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { className: "jp-forms__feedback-comments-load-more", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_components80.Button, { variant: "secondary", onClick: handleLoadMore, children: (0, import_i18n88.__)("Load more comments", "jetpack-forms") }) }),
      clientAddedComments.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { className: "jp-forms__feedback-comments-list jp-forms__feedback-comments-new", children: clientAddedComments.map((comment) => /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
        comment_item_default,
        {
          comment,
          onDelete: handleDelete,
          isDeleting: deletingCommentIds.has(comment.id)
        },
        comment.id
      )) })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "jp-forms__feedback-comments-form", children: [
      error2 && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { className: "jp-forms__feedback-comments-error", children: error2 }),
      /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "jp-forms__feedback-comments-form-wrapper", children: [
        /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { className: "jp-forms__feedback-comments-form-input", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
          import_components80.TextareaControl,
          {
            hideLabelFromVision: true,
            label: (0, import_i18n88.__)("Leave a note", "jetpack-forms"),
            value: newComment,
            onChange: setNewComment,
            onKeyDown: handleKeyDown,
            onBlur: scrollToBottom,
            enterKeyHint: "send",
            rows: 1,
            disabled: isSubmitting,
            placeholder: (0, import_i18n88.__)("Write a quick note\u2026", "jetpack-forms")
          }
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "jp-forms__feedback-comments-user-info", children: [
          currentUser && /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "jp-forms__feedback-comments-form-avatar", children: [
            /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("img", { src: currentUser.avatar_urls?.["48"] || "", alt: "" }),
            /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("strong", { children: currentUser.name })
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("div", { className: "jp-forms__feedback-comments-form-button", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(
            import_components80.Button,
            {
              variant: "primary",
              type: "submit",
              onClick: handleNewComment,
              disabled: isSubmitting || !newComment.trim(),
              isBusy: isSubmitting,
              children: (0, import_i18n88.__)("Add note", "jetpack-forms")
            }
          ) })
        ] })
      ] })
    ] })
  ] });
};
var feedback_comments_default = FeedbackComments;

// src/dashboard/components/inspector/preview-file/index.tsx
var import_components81 = __toESM(require_components(), 1);
var import_html_entities6 = __toESM(require_html_entities(), 1);
var import_i18n89 = __toESM(require_i18n(), 1);

// src/dashboard/components/inspector/preview-file/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='6858eb9077']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "6858eb9077");
  style.appendChild(document.createTextNode(".jp-forms__inbox-file-preview-shell{max-height:70vh;overflow:hidden}.jp-forms__inbox-file-preview-container{aspect-ratio:16/9;margin-bottom:16px;max-height:70vh}.jp-forms__inbox-file-preview-container.is-loading{display:none}.jp-forms__inbox-file-preview-image{height:100%;max-height:66vh;object-fit:contain;width:100%}.components-modal__screen-overlay:nth-of-type(2){z-index:var(--jp-forms-z-modal-backdrop)}.jp-forms__inbox-file-loading{align-content:center;display:flex;flex-wrap:wrap;height:150px;justify-content:center}.jp-forms__inbox-file-spinner.jp-forms__inbox-file-spinner{margin-top:0}"));
  document.head.appendChild(style);
}

// src/dashboard/components/inspector/preview-file/index.tsx
var import_jsx_runtime169 = __toESM(require_jsx_runtime(), 1);
var PreviewFile = ({ file, isLoading, onImageLoaded }) => {
  const imageClass = clsx_default("jp-forms__inbox-file-preview-container", {
    "is-loading": isLoading
  });
  return /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("div", { className: "jp-forms__inbox-file-preview-shell", children: [
    isLoading && /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)("div", { className: "jp-forms__inbox-file-loading", children: [
      /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(import_components81.Spinner, { className: "jp-forms__inbox-file-spinner" }),
      /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("div", { className: "jp-forms__inbox-file-loading-message ", children: (0, import_i18n89.__)("Loading preview\u2026", "jetpack-forms") })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime169.jsx)("div", { className: imageClass, children: /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(
      "img",
      {
        src: file.url,
        alt: (0, import_html_entities6.decodeEntities)(file.name),
        onLoad: onImageLoaded,
        className: "jp-forms__inbox-file-preview-image"
      }
    ) })
  ] });
};
var preview_file_default = PreviewFile;

// src/dashboard/components/inspector/response-fields/field-email/index.tsx
var import_components83 = __toESM(require_components(), 1);

// src/dashboard/components/copy-clipboard-button/index.tsx
var import_components82 = __toESM(require_components(), 1);
var import_compose17 = __toESM(require_compose(), 1);
var import_element99 = __toESM(require_element(), 1);
var import_i18n90 = __toESM(require_i18n(), 1);

// src/dashboard/components/copy-clipboard-button/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='f2ba3be839']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "f2ba3be839");
  style.appendChild(document.createTextNode(".jp-forms__copy-clipboard-button svg{height:20px;width:20px}"));
  document.head.appendChild(style);
}

// src/dashboard/components/copy-clipboard-button/index.tsx
var import_jsx_runtime170 = __toESM(require_jsx_runtime(), 1);
function CopyClipboardButton({ text }) {
  const [showCopyConfirmation, setShowCopyConfirmation] = (0, import_element99.useState)(false);
  const timeoutIdRef = (0, import_element99.useRef)(null);
  const ref = (0, import_compose17.useCopyToClipboard)(text, () => {
    setShowCopyConfirmation(true);
    if (timeoutIdRef.current) {
      clearTimeout(timeoutIdRef.current);
    }
    timeoutIdRef.current = setTimeout(() => {
      setShowCopyConfirmation(false);
    }, 4e3);
  });
  (0, import_element99.useEffect)(() => {
    return () => {
      if (timeoutIdRef.current) {
        clearTimeout(timeoutIdRef.current);
      }
    };
  }, []);
  const copied = (0, import_i18n90.__)("Copied!", "jetpack-forms");
  const copy = (0, import_i18n90.__)("Copy", "jetpack-forms");
  const emailCopyLabel = showCopyConfirmation ? copied : copy;
  return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(import_components82.Tooltip, { delay: 0, hideOnClick: false, text: emailCopyLabel, children: /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(
    import_components82.Button,
    {
      className: "jp-forms__copy-clipboard-button",
      size: "small",
      "aria-label": emailCopyLabel,
      ref,
      icon: showCopyConfirmation ? check_default : copy_small_default,
      showTooltip: false
    }
  ) });
}

// src/dashboard/components/inspector/response-fields/field-email/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='553130bff6']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "553130bff6");
  style.appendChild(document.createTextNode(".jp-forms__inbox-response-field-email a{overflow-wrap:break-word}"));
  document.head.appendChild(style);
}

// src/dashboard/components/inspector/response-fields/field-email/index.tsx
var import_jsx_runtime171 = __toESM(require_jsx_runtime(), 1);
var FieldEmail = ({ email }) => {
  const emailParts = email.split("@");
  return /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)(
    import_components83.__experimentalHStack,
    {
      alignment: "center",
      className: "jp-forms__inbox-response-field-email",
      justify: "left",
      spacing: "2",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime171.jsxs)("a", { href: `mailto:${email}`, children: [
          emailParts[0],
          /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("wbr", {}),
          "@",
          emailParts[1]
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime171.jsx)(CopyClipboardButton, { text: email })
      ]
    }
  );
};
var field_email_default = FieldEmail;

// src/dashboard/components/inspector/response-fields/field-file/file.tsx
var import_components84 = __toESM(require_components(), 1);
var import_html_entities7 = __toESM(require_html_entities(), 1);
var import_i18n91 = __toESM(require_i18n(), 1);
var import_jsx_runtime172 = __toESM(require_jsx_runtime(), 1);
var extensionMap = {
  pdf: "pdf",
  png: "png",
  jpg: "png",
  jpeg: "png",
  gif: "png",
  mp4: "mp4",
  mp3: "mp3",
  webm: "mp4",
  doc: "doc",
  docx: "doc",
  txt: "txt",
  ppt: "ppt",
  pptx: "ppt",
  xls: "xls",
  xlsx: "xls",
  csv: "xls",
  zip: "zip",
  sql: "sql",
  cal: "cal",
  html: "html"
};
var mimeMap = {
  image: "png",
  video: "mp4",
  audio: "mp3",
  document: "pdf",
  application: "txt"
};
var FieldFile = ({ file, onClick }) => {
  const fileExtension = file.name.split(".").pop().toLowerCase();
  const fileType = file.type?.split("/")?.[0];
  const fileIconsUrl = useConfigValue("fileIconsUrl");
  const iconType = extensionMap[fileExtension] || mimeMap[fileType] || "txt";
  const iconClass = clsx_default("jp-forms__inbox-response-file__icon", {
    ["icon-" + iconType]: !file.is_previewable,
    "has-thumbnail": file.is_previewable
  });
  let iconStyle;
  if (file.is_previewable) {
    iconStyle = { backgroundImage: `url(${file.url})`, backgroundSize: "cover" };
  } else if (fileIconsUrl) {
    iconStyle = { backgroundImage: `url(${fileIconsUrl}${iconType}.svg)` };
  }
  return /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: "jp-forms__inbox-response-file", children: [
    /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: "jp-forms__inbox-response-file__info", children: [
      /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { className: iconClass, style: iconStyle }),
      /* @__PURE__ */ (0, import_jsx_runtime172.jsxs)("div", { className: "jp-forms__inbox-response-file__name", children: [
        file.is_previewable && /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components84.Button, { target: "_blank", variant: "link", onClick, children: (0, import_html_entities7.decodeEntities)(file.name) }),
        !file.is_previewable && /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components84.ExternalLink, { href: file.url + "&preview=true", children: (0, import_html_entities7.decodeEntities)(file.name) }),
        /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { className: "jp-forms__inbox-response-file__meta-info", children: (0, import_i18n91.sprintf)(
          /* translators: %1$s size of the file and %2$s is the file extension */
          (0, import_i18n91.__)("%1$s, %2$s", "jetpack-forms"),
          file.size,
          fileExtension.toUpperCase()
        ) })
      ] })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("span", { className: "jp-forms__inbox-response-file__item-actions", children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components84.Tooltip, { text: (0, import_i18n91.__)("Download", "jetpack-forms"), children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components84.Button, { variant: "secondary", href: file.url, target: "_blank", children: /* @__PURE__ */ (0, import_jsx_runtime172.jsx)(import_components84.Icon, { icon: download_default }) }) }) })
  ] });
};
var file_default = FieldFile;

// src/dashboard/components/inspector/response-fields/field-file/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='425b83a5a8']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "425b83a5a8");
  style.appendChild(document.createTextNode(".jp-forms__inbox-response-field-file{margin-top:4px}.jp-forms__inbox-response-file{display:flex;gap:12px;justify-content:space-between}.jp-forms__inbox-response-file__icon{background-color:#f0f0f0;background-image:url(../../../../../contact-form/images/file-icons/txt.svg);background-position:50%;background-repeat:no-repeat;background-size:18px;border-radius:50%;height:32px;margin-top:8px;min-width:32px;width:32px}@media (min-width:783px){.jp-forms__inbox-response-file__icon{background-size:24px;height:40px;margin-top:0;min-width:40px;width:40px}}.jp-forms__inbox-response-file__icon.icon-cal{background-image:url(../../../../../contact-form/images/file-icons/cal.svg)}.jp-forms__inbox-response-file__icon.icon-html{background-image:url(../../../../../contact-form/images/file-icons/html.svg)}.jp-forms__inbox-response-file__icon.icon-mp3{background-image:url(../../../../../contact-form/images/file-icons/mp3.svg)}.jp-forms__inbox-response-file__icon.icon-mp4{background-image:url(../../../../../contact-form/images/file-icons/mp4.svg)}.jp-forms__inbox-response-file__icon.icon-pdf{background-image:url(../../../../../contact-form/images/file-icons/pdf.svg)}.jp-forms__inbox-response-file__icon.icon-png{background-image:url(../../../../../contact-form/images/file-icons/png.svg)}.jp-forms__inbox-response-file__icon.icon-ppt{background-image:url(../../../../../contact-form/images/file-icons/ppt.svg)}.jp-forms__inbox-response-file__icon.icon-sql{background-image:url(../../../../../contact-form/images/file-icons/sql.svg)}.jp-forms__inbox-response-file__icon.icon-txt{background-image:url(../../../../../contact-form/images/file-icons/txt.svg)}.jp-forms__inbox-response-file__icon.icon-xls{background-image:url(../../../../../contact-form/images/file-icons/xls.svg)}.jp-forms__inbox-response-file__icon.icon-zip{background-image:url(../../../../../contact-form/images/file-icons/zip.svg)}.jp-forms__inbox-response-file__icon.has-thumbnail{background-image:none}.jp-forms__inbox-response-file__info{display:flex;gap:12px}"));
  document.head.appendChild(style);
}

// src/dashboard/components/inspector/response-fields/field-file/index.tsx
var import_jsx_runtime173 = __toESM(require_jsx_runtime(), 1);
var FieldFile2 = ({ files, handleFilePreview }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("div", { className: "jp-forms__inbox-response-field-file", children: files?.length ? files.map((file) => {
    if (!file || !file.name) {
      return "-";
    }
    return /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(file_default, { file, onClick: handleFilePreview(file) }, file.file_id);
  }) : "-" });
};
var field_file_default = FieldFile2;

// src/dashboard/components/inspector/response-fields/field-image-select/index.tsx
var import_components85 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/photon@4.1.1/node_modules/photon/dist/esm/index.js
var import_crc32 = __toESM(require_crc32());
var import_debug5 = __toESM(require_browser());
var import_seed_random = __toESM(require_seed_random());
var debug5 = (0, import_debug5.default)("photon");
var mappings = {
  width: "w",
  height: "h",
  letterboxing: "lb",
  removeLetterboxing: "ulb"
};
var PARSE_BASE_HOST = "__domain__.invalid";
var PARSE_BASE_URL = `https://${PARSE_BASE_HOST}`;
var PHOTON_BASE_URL = "https://i0.wp.com";
function photon(imageUrl, opts) {
  let parsedUrl;
  try {
    parsedUrl = new URL(imageUrl, PARSE_BASE_URL);
  } catch {
    return null;
  }
  const wasSecure = parsedUrl.protocol === "https:";
  const photonUrl = new URL(PHOTON_BASE_URL);
  if (isAlreadyPhotoned(parsedUrl.host)) {
    photonUrl.pathname = parsedUrl.pathname;
    photonUrl.hostname = wasSecure ? "i0.wp.com" : parsedUrl.hostname;
  } else {
    if (parsedUrl.search) {
      return null;
    }
    let formattedUrl = parsedUrl.href.replace(`${parsedUrl.protocol}/`, "");
    if (parsedUrl.protocol === "blob:") {
      formattedUrl = parsedUrl.pathname.replace("://", "//");
    }
    if (parsedUrl.hostname === PARSE_BASE_HOST) {
      formattedUrl = parsedUrl.pathname;
    }
    photonUrl.pathname = formattedUrl;
    photonUrl.hostname = serverFromUrlParts(formattedUrl, photonUrl.protocol === "https:");
    if (wasSecure) {
      photonUrl.searchParams.set("ssl", "1");
    }
  }
  if (opts) {
    for (const [opt, value] of Object.entries(opts)) {
      if (opt === "host" || opt === "hostname") {
        photonUrl.hostname = value;
        continue;
      }
      if (opt === "secure" && !value) {
        photonUrl.protocol = "http:";
        continue;
      }
      photonUrl.searchParams.set(mappings[opt] ?? opt, value.toString());
    }
  }
  debug5("generated Photon URL: %s", photonUrl.href);
  return photonUrl.href;
}
function isAlreadyPhotoned(host) {
  return /^i[0-2]\.wp\.com$/.test(host);
}
function serverFromUrlParts(pathname, isSecure) {
  if (isSecure) {
    return "i0.wp.com";
  }
  const hash = (0, import_crc32.default)(pathname);
  const rng = (0, import_seed_random.default)(hash);
  const server = "i" + Math.floor(rng() * 3);
  debug5('determined server "%s" to use with "%s"', server, pathname);
  return server + ".wp.com";
}

// src/dashboard/components/inspector/response-fields/field-image-select/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='5733d382a3']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "5733d382a3");
  style.appendChild(document.createTextNode(".jp-forms__image-select-preview-wrapper{padding-block-start:8px}.jp-forms__image-select-preview{--jp-forms--image-select-border-color:#0000001a}.jp-forms__image-select-preview img,.jp-forms__image-select-preview svg{display:block}.jp-forms__image-select-preview.has-image{cursor:pointer}.jp-forms__image-select-preview.has-image:hover{background-color:var(--jp-forms--image-select-border-color)}.jp-forms__image-select-preview .jp-forms__image-select-preview-image-wrapper{padding:8px}.jp-forms__image-select-preview .jp-forms__image-select-preview-image-wrapper .jp-forms__image-select-preview-image{min-height:144px;object-fit:cover}.jp-forms__image-select-preview .jp-forms__image-select-preview-label-wrapper{align-items:baseline;max-width:138px}.jp-forms__image-select-preview .jp-forms__image-select-preview-label-wrapper .jp-forms__image-select-preview-selected{background-color:#fff;border-radius:2px;box-shadow:0 0 0 1px var(--jp-forms--image-select-border-color);color:#000;flex-shrink:0;min-width:1em;padding:4px;text-align:center}.jp-forms__image-select-preview .jp-forms__image-select-preview-label-wrapper .jp-forms__image-select-preview-label{flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"));
  document.head.appendChild(style);
}

// src/dashboard/components/inspector/response-fields/field-image-select/index.tsx
var import_jsx_runtime174 = __toESM(require_jsx_runtime(), 1);
function photonSafeUrl(url = "") {
  if (!url) {
    return null;
  }
  if (url.startsWith("blob:") || /^https?:\/\/localhost/.test(url) || /^https?:\/\/.*\.local\//.test(url) || isWoASite() && isPrivateSite()) {
    return url;
  }
  return photon(url.split("?", 1)[0], { width: 138, height: 144 });
}
var ImageSelectButton = ({ choice, handleFilePreview }) => {
  const label = choice.label ? `${choice.selected}: ${choice.label}` : choice.selected;
  const hasImage = choice.image?.src;
  return /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
    import_components85.Card,
    {
      onClick: hasImage ? handleFilePreview({
        file_id: choice.image.id,
        name: label,
        url: choice.image.src
      }) : void 0,
      className: `jp-forms__image-select-preview ${hasImage ? "has-image" : ""}`,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_components85.CardMedia, { children: /* @__PURE__ */ (0, import_jsx_runtime174.jsx)("div", { className: "jp-forms__image-select-preview-image-wrapper", children: hasImage ? /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
          "img",
          {
            className: "jp-forms__image-select-preview-image",
            width: 138,
            height: 144,
            alt: choice.selected,
            loading: "lazy",
            src: photonSafeUrl(choice.image.src) ?? void 0
          }
        ) : /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_components85.Icon, { icon: image_default, size: 144 }) }) }),
        /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
          import_components85.CardBody,
          {
            size: {
              blockStart: "none",
              blockEnd: "xSmall",
              inlineStart: "xSmall",
              inlineEnd: "xSmall"
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(
              import_components85.__experimentalHStack,
              {
                className: "jp-forms__image-select-preview-label-wrapper",
                spacing: "2",
                alignment: "topLeft",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_components85.__experimentalText, { className: "jp-forms__image-select-preview-selected", children: choice.selected }),
                  /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(import_components85.__experimentalText, { title: choice.label, className: "jp-forms__image-select-preview-label", children: choice.label })
                ]
              }
            )
          }
        )
      ]
    }
  );
};
var FieldImageSelect = ({ choices, handleFilePreview }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime174.jsxs)(import_jsx_runtime174.Fragment, { children: [
    (choices?.length ?? 0) === 0 && "-",
    (choices?.length ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
      import_components85.__experimentalHStack,
      {
        spacing: "2",
        alignment: "topLeft",
        wrap: true,
        className: "jp-forms__image-select-preview-wrapper",
        children: choices.map((choice) => {
          return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)(
            ImageSelectButton,
            {
              choice,
              handleFilePreview
            },
            choice.selected
          );
        })
      }
    )
  ] });
};
var field_image_select_default = FieldImageSelect;

// src/dashboard/components/inspector/response-fields/field-preview/index.tsx
var import_components88 = __toESM(require_components(), 1);

// src/blocks/field-checkbox/icon.jsx
var import_primitives46 = __toESM(require_primitives(), 1);
var import_jsx_runtime175 = __toESM(require_jsx_runtime(), 1);
var icon = /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(
  import_primitives46.Path,
  {
    fillRule: "evenodd",
    d: "M6.125 6H17.875C17.944 6 18 6.05596 18 6.125V17.875C18 17.944 17.944 18 17.875 18H6.125C6.05596 18 6 17.944 6 17.875V6.125C6 6.05596 6.05596 6 6.125 6ZM4.5 6.125C4.5 5.22754 5.22754 4.5 6.125 4.5H17.875C18.7725 4.5 19.5 5.22754 19.5 6.125V17.875C19.5 18.7725 18.7725 19.5 17.875 19.5H6.125C5.22754 19.5 4.5 18.7725 4.5 17.875V6.125ZM10.5171 16.4421L16.5897 8.71335L15.4103 7.78662L10.4828 14.0579L8.57616 11.7698L7.42383 12.7301L10.5171 16.4421Z"
  }
) });
var icon_default2 = {
  src: icon
};

// src/blocks/field-consent/icon.jsx
var import_primitives47 = __toESM(require_primitives(), 1);
var import_jsx_runtime176 = __toESM(require_jsx_runtime(), 1);
var icon2 = /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
  /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_primitives47.Path, { d: "M7 5.5H17C17.2761 5.5 17.5 5.72386 17.5 6V13H19V6C19 4.89543 18.1046 4 17 4H7C5.89543 4 5 4.89543 5 6V18C5 19.1046 5.89543 20 7 20H11.5V18.5H7C6.72386 18.5 6.5 18.2761 6.5 18V6C6.5 5.72386 6.72386 5.5 7 5.5ZM16 7.75H8V9.25H16V7.75ZM8 11H13V12.5H8V11Z" }),
  /* @__PURE__ */ (0, import_jsx_runtime176.jsx)(import_primitives47.Path, { d: "M20.1087 15.9382L15.9826 21.6689L12.959 18.5194L14.0411 17.4806L15.8175 19.331L18.8914 15.0618L20.1087 15.9382Z" })
] });
var icon_default3 = {
  src: icon2
};

// src/blocks/field-date/icon.jsx
var import_primitives48 = __toESM(require_primitives(), 1);
var import_jsx_runtime177 = __toESM(require_jsx_runtime(), 1);
var icon3 = /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(
  import_primitives48.Path,
  {
    fillRule: "evenodd",
    d: "M4.5 7H19.5V19C19.5 19.2761 19.2761 19.5 19 19.5H5C4.72386 19.5 4.5 19.2761 4.5 19V7ZM3 5V7V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V7V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5ZM11 9.25H7V13.25H11V9.25Z"
  }
) });
var icon_default4 = {
  src: icon3
};

// src/blocks/field-image-select/icon.tsx
var import_primitives49 = __toESM(require_primitives(), 1);
var import_jsx_runtime178 = __toESM(require_jsx_runtime(), 1);
var icon4 = /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(import_primitives49.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V5c-.1-.3.1-.5.4-.5zm14 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) });
var icon_default5 = {
  src: icon4
};

// src/blocks/field-multiple-choice/icon.jsx
var import_primitives50 = __toESM(require_primitives(), 1);
var import_jsx_runtime179 = __toESM(require_jsx_runtime(), 1);
var icon5 = /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(import_primitives50.Path, { d: "M7.0812 10.1419L10.6001 5.45005L9.40006 4.55005L6.91891 7.85824L5.53039 6.46972L4.46973 7.53038L7.0812 10.1419ZM12 8.5H20V7H12V8.5ZM12 17H20V15.5H12V17ZM8.5 14.5H5.5V17.5H8.5V14.5ZM5.5 13H8.5C9.32843 13 10 13.6716 10 14.5V17.5C10 18.3284 9.32843 19 8.5 19H5.5C4.67157 19 4 18.3284 4 17.5V14.5C4 13.6716 4.67157 13 5.5 13Z" }) });
var icon_default6 = {
  src: icon5
};

// src/blocks/field-name/icon.jsx
var import_primitives51 = __toESM(require_primitives(), 1);
var import_jsx_runtime180 = __toESM(require_jsx_runtime(), 1);
var icon6 = /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_primitives51.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(import_primitives51.Path, { d: "M8.25 11.5C9.63071 11.5 10.75 10.3807 10.75 9C10.75 7.61929 9.63071 6.5 8.25 6.5C6.86929 6.5 5.75 7.61929 5.75 9C5.75 10.3807 6.86929 11.5 8.25 11.5ZM8.25 10C8.80228 10 9.25 9.55228 9.25 9C9.25 8.44772 8.80228 8 8.25 8C7.69772 8 7.25 8.44772 7.25 9C7.25 9.55228 7.69772 10 8.25 10ZM13 15.5V17.5H11.5V15.5C11.5 14.8096 10.9404 14.25 10.25 14.25H6.25C5.55964 14.25 5 14.8096 5 15.5V17.5H3.5V15.5C3.5 13.9812 4.73122 12.75 6.25 12.75H10.25C11.7688 12.75 13 13.9812 13 15.5ZM20.5 11H14.5V9.5H20.5V11ZM20.5 14.5H14.5V13H20.5V14.5Z" }) });
var icon_default7 = {
  src: icon6
};

// src/blocks/field-number/icon.jsx
var import_primitives52 = __toESM(require_primitives(), 1);
var import_jsx_runtime181 = __toESM(require_jsx_runtime(), 1);
var icon7 = /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_primitives52.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime181.jsx)(import_primitives52.Path, { d: "M12 7H4V8.5H12V7ZM19.75 17.25V10.75H4.25V17.25H19.75ZM5.75 15.75V12.25H18.25V15.75H5.75Z" }) });
var icon_default8 = {
  src: icon7
};

// src/blocks/field-rating/icon.jsx
var import_primitives53 = __toESM(require_primitives(), 1);
var import_jsx_runtime182 = __toESM(require_jsx_runtime(), 1);
var icon8 = /* @__PURE__ */ (0, import_jsx_runtime182.jsxs)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: [
  /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(import_primitives53.Path, { d: "M4.90821 9.05978C4.91669 9.04183 4.92977 9.02672 4.94599 9.01616C4.96221 9.0056 4.98091 9 5 9C5.01909 9 5.03779 9.0056 5.05401 9.01616C5.07023 9.02672 5.08331 9.04183 5.09179 9.05978L5.93962 10.8628C5.94695 10.8785 5.95779 10.892 5.97121 10.9023C5.98463 10.9125 6.00023 10.9192 6.01666 10.9217L7.91228 11.2108C7.93118 11.2137 7.94893 11.222 7.96354 11.2349C7.97814 11.2478 7.98902 11.2648 7.99495 11.2838C8.00087 11.3029 8.0016 11.3233 7.99706 11.3428C7.99252 11.3622 7.98288 11.38 7.96924 11.394L6.59731 12.7975C6.58536 12.8097 6.57643 12.8247 6.57129 12.8414C6.56615 12.858 6.56495 12.8757 6.5678 12.893L6.89153 14.8745C6.89467 14.8942 6.89251 14.9144 6.8853 14.9329C6.87809 14.9514 6.86611 14.9675 6.8507 14.9792C6.8353 14.991 6.81707 14.998 6.79808 14.9995C6.77909 15.0009 6.76008 14.9968 6.74319 14.9876L5.04753 14.0521C5.03287 14.044 5.01656 14.0398 5 14.0398C4.98344 14.0398 4.96713 14.044 4.95247 14.0521L3.25681 14.9876C3.23991 14.997 3.22085 15.0012 3.20179 14.9997C3.18273 14.9983 3.16443 14.9913 3.14896 14.9795C3.13348 14.9678 3.12145 14.9517 3.11423 14.9331C3.107 14.9146 3.10487 14.8943 3.10806 14.8745L3.43178 12.893C3.43469 12.8758 3.43356 12.8581 3.42849 12.8414C3.42342 12.8248 3.41456 12.8097 3.40269 12.7975L2.03076 11.394C2.01712 11.38 2.00748 11.3622 2.00294 11.3428C1.9984 11.3233 1.99913 11.3029 2.00505 11.2838C2.01098 11.2648 2.02185 11.2478 2.03646 11.2349C2.05107 11.222 2.06882 11.2137 2.08772 11.2108L3.98334 10.9217C3.99977 10.9192 4.01537 10.9125 4.02879 10.9023C4.04221 10.892 4.05305 10.8785 4.06038 10.8628L4.90821 9.05978Z" }),
  /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(import_primitives53.Path, { d: "M11.9082 9.05978C11.9167 9.04183 11.9298 9.02672 11.946 9.01616C11.9622 9.0056 11.9809 9 12 9C12.0191 9 12.0378 9.0056 12.054 9.01616C12.0702 9.02672 12.0833 9.04183 12.0918 9.05978L12.9396 10.8628C12.9469 10.8785 12.9578 10.892 12.9712 10.9023C12.9846 10.9125 13.0002 10.9192 13.0167 10.9217L14.9123 11.2108C14.9312 11.2137 14.9489 11.222 14.9635 11.2349C14.9781 11.2478 14.989 11.2648 14.9949 11.2838C15.0009 11.3029 15.0016 11.3233 14.9971 11.3428C14.9925 11.3622 14.9829 11.38 14.9692 11.394L13.5973 12.7975C13.5854 12.8097 13.5764 12.8247 13.5713 12.8414C13.5661 12.858 13.565 12.8757 13.5678 12.893L13.8915 14.8745C13.8947 14.8942 13.8925 14.9144 13.8853 14.9329C13.8781 14.9514 13.8661 14.9675 13.8507 14.9792C13.8353 14.991 13.8171 14.998 13.7981 14.9995C13.7791 15.0009 13.7601 14.9968 13.7432 14.9876L12.0475 14.0521C12.0329 14.044 12.0166 14.0398 12 14.0398C11.9834 14.0398 11.9671 14.044 11.9525 14.0521L10.2568 14.9876C10.2399 14.997 10.2208 15.0012 10.2018 14.9997C10.1827 14.9983 10.1644 14.9913 10.149 14.9795C10.1335 14.9678 10.1215 14.9517 10.1142 14.9331C10.107 14.9146 10.1049 14.8943 10.1081 14.8745L10.4318 12.893C10.4347 12.8758 10.4336 12.8581 10.4285 12.8414C10.4234 12.8248 10.4146 12.8097 10.4027 12.7975L9.03076 11.394C9.01712 11.38 9.00748 11.3622 9.00294 11.3428C8.9984 11.3233 8.99913 11.3029 9.00505 11.2838C9.01098 11.2648 9.02185 11.2478 9.03646 11.2349C9.05107 11.222 9.06882 11.2137 9.08772 11.2108L10.9833 10.9217C10.9998 10.9192 11.0154 10.9125 11.0288 10.9023C11.0422 10.892 11.0531 10.8785 11.0604 10.8628L11.9082 9.05978Z" }),
  /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(
    import_primitives53.Path,
    {
      fillRule: "evenodd",
      clipRule: "evenodd",
      d: "M18.0605 10.8627C18.0532 10.8784 18.0423 10.8919 18.0289 10.9022C18.0155 10.9125 17.9999 10.9191 17.9835 10.9217L16.0881 11.2107C16.0691 11.2135 16.0513 11.2219 16.0366 11.2348C16.0219 11.2477 16.011 11.2647 16.005 11.2839C15.9991 11.303 15.9984 11.3235 16.003 11.343C16.0076 11.3626 16.0174 11.3803 16.0311 11.3943L17.4029 12.7973C17.4148 12.8095 17.4238 12.8246 17.4289 12.8412C17.434 12.8579 17.4352 12.8756 17.4324 12.8928L17.1087 14.8743C17.1055 14.894 17.1076 14.9143 17.1147 14.9329C17.1219 14.9515 17.1339 14.9675 17.1493 14.9794C17.1647 14.9912 17.183 14.9982 17.202 14.9997C17.221 15.0012 17.2401 14.9971 17.257 14.9878L18.9525 14.0519C18.9672 14.0438 18.9836 14.0395 19.0002 14.0395C19.0168 14.0395 19.0332 14.0438 19.0479 14.0519L20.743 14.9874C20.7599 14.9967 20.7789 15.0009 20.798 14.9995C20.817 14.9981 20.8353 14.9911 20.8508 14.9793C20.8663 14.9676 20.8783 14.9515 20.8855 14.9329C20.8928 14.9144 20.8949 14.894 20.8917 14.8743L20.568 12.8928C20.5652 12.8756 20.5664 12.8579 20.5715 12.8412C20.5766 12.8246 20.5856 12.8095 20.5975 12.7973L21.9689 11.3943C21.9826 11.3803 21.9924 11.3626 21.997 11.343C22.0016 11.3235 22.0009 11.303 21.995 11.2839C21.989 11.2647 21.9781 11.2477 21.9634 11.2348C21.9487 11.2219 21.9309 11.2135 21.9119 11.2107L20.0165 10.9217C20.0001 10.9191 19.9845 10.9125 19.9711 10.9022C19.9577 10.8919 19.9468 10.8784 19.9395 10.8627L19.0918 9.05978C19.0833 9.04183 19.0702 9.02672 19.054 9.01616C19.0378 9.0056 19.0191 9 19 9C18.9809 9 18.9622 9.0056 18.946 9.01616C18.9298 9.02672 18.9167 9.04183 18.9082 9.05978L18.0605 10.8627ZM19.0004 10.3225L18.612 11.1488C18.5605 11.2581 18.4846 11.3527 18.3906 11.4244C18.2966 11.4961 18.1874 11.5428 18.0724 11.5604L17.2038 11.6928L17.8323 12.3358C18.0011 12.5087 18.0781 12.7582 18.0384 13.0025L17.8901 13.91L18.6669 13.4812C18.7698 13.4244 18.8843 13.3947 19.0006 13.3947C19.1169 13.3947 19.2314 13.4244 19.3343 13.4812L20.1108 13.91L19.9624 13.0025C19.9428 12.8821 19.9513 12.7585 19.9873 12.6424C20.0232 12.5262 20.0856 12.421 20.1689 12.3358L20.7971 11.6928L19.9284 11.5604C19.8135 11.5428 19.7043 11.4961 19.6103 11.4244C19.5163 11.3527 19.4403 11.2581 19.3888 11.1488L19.0004 10.3225Z"
    }
  )
] });
var icon_default9 = {
  src: icon8
};

// src/blocks/field-select/icon.jsx
var import_primitives54 = __toESM(require_primitives(), 1);
var import_jsx_runtime183 = __toESM(require_jsx_runtime(), 1);
var icon9 = /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_primitives54.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(import_primitives54.Path, { d: "M5 4.5H19C19.2761 4.5 19.5 4.72386 19.5 5V19C19.5 19.2761 19.2761 19.5 19 19.5H5C4.72386 19.5 4.5 19.2761 4.5 19V5C4.5 4.72386 4.72386 4.5 5 4.5ZM19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3ZM8.93582 10.1396L8.06396 11.3602L11.9999 14.1716L15.9358 11.3602L15.064 10.1396L11.9999 12.3283L8.93582 10.1396Z" }) });
var icon_default10 = {
  src: icon9
};

// src/blocks/field-single-choice/icon.jsx
var import_primitives55 = __toESM(require_primitives(), 1);
var import_jsx_runtime184 = __toESM(require_jsx_runtime(), 1);
var icon10 = /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(import_primitives55.Path, { d: "M4 7.75C4 9.40685 5.34315 10.75 7 10.75C8.65685 10.75 10 9.40685 10 7.75C10 6.09315 8.65685 4.75 7 4.75C5.34315 4.75 4 6.09315 4 7.75ZM20 8.5H12V7H20V8.5ZM20 17H12V15.5H20V17ZM7 17.75C6.17157 17.75 5.5 17.0784 5.5 16.25C5.5 15.4216 6.17157 14.75 7 14.75C7.82843 14.75 8.5 15.4216 8.5 16.25C8.5 17.0784 7.82843 17.75 7 17.75ZM4 16.25C4 17.9069 5.34315 19.25 7 19.25C8.65685 19.25 10 17.9069 10 16.25C10 14.5931 8.65685 13.25 7 13.25C5.34315 13.25 4 14.5931 4 16.25Z" }) });
var icon_default11 = {
  src: icon10
};

// src/blocks/field-slider/icon.jsx
var import_primitives56 = __toESM(require_primitives(), 1);
var import_jsx_runtime185 = __toESM(require_jsx_runtime(), 1);
var icon11 = /* @__PURE__ */ (0, import_jsx_runtime185.jsxs)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", children: [
  /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(import_primitives56.Line, { x1: "4", y1: "12", x2: "20", y2: "12", stroke: "currentColor", strokeWidth: "2" }),
  /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(import_primitives56.Circle, { cx: "12", cy: "12", r: "2", fill: "currentColor" })
] });
var icon_default12 = {
  src: icon11
};

// src/blocks/field-text/icon.jsx
var import_primitives57 = __toESM(require_primitives(), 1);
var import_jsx_runtime186 = __toESM(require_jsx_runtime(), 1);
var icon12 = /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_primitives57.Path, { d: "M12 7H4V8.5H12V7ZM19.75 17.25V10.75H4.25V17.25H19.75ZM5.75 15.75V12.25H18.25V15.75H5.75Z" }) });
var icon_default13 = {
  src: icon12
};

// src/blocks/field-textarea/icon.jsx
var import_primitives58 = __toESM(require_primitives(), 1);
var import_jsx_runtime187 = __toESM(require_jsx_runtime(), 1);
var icon13 = /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(import_primitives58.Path, { d: "M20 5H4V6.5H20V5ZM5.5 11.5H18.5V18.5H5.5V11.5ZM20 20V10H4V20H20Z" }) });
var icon_default14 = {
  src: icon13
};

// src/blocks/field-time/icon.jsx
var import_primitives59 = __toESM(require_primitives(), 1);
var import_jsx_runtime188 = __toESM(require_jsx_runtime(), 1);
var icon14 = /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(
  import_primitives59.Path,
  {
    fillRule: "evenodd",
    clipRule: "evenodd",
    d: "M12 18.5C10.2761 18.5 8.62279 17.8152 7.40381 16.5962C6.18482 15.3772 5.5 13.7239 5.5 12C5.5 10.2761 6.18482 8.62279 7.40381 7.40381C8.62279 6.18482 10.2761 5.5 12 5.5C13.7239 5.5 15.3772 6.18482 16.5962 7.40381C17.8152 8.62279 18.5 10.2761 18.5 12C18.5 13.7239 17.8152 15.3772 16.5962 16.5962C15.3772 17.8152 13.7239 18.5 12 18.5ZM4 12C4 9.87827 4.84285 7.84344 6.34315 6.34315C7.84344 4.84285 9.87827 4 12 4C14.1217 4 16.1566 4.84285 17.6569 6.34315C19.1571 7.84344 20 9.87827 20 12C20 14.1217 19.1571 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20C9.87827 20 7.84344 19.1571 6.34315 17.6569C4.84285 16.1566 4 14.1217 4 12ZM13 13V8H11.5V11.5H9.5V13H13Z"
  }
) });
var icon_default15 = icon14;

// src/dashboard/components/inspector/response-fields/field-icons.tsx
var fieldIcons = {
  checkbox: icon_default2.src,
  "checkbox-multiple": icon_default6.src,
  consent: icon_default3.src,
  date: icon_default4.src,
  email: envelope_default,
  file: upload_default,
  hidden: unseen_default,
  "image-select": icon_default5.src,
  name: icon_default7.src,
  number: icon_default8.src,
  phone: mobile_default,
  radio: icon_default11.src,
  range: icon_default12.src,
  rating: icon_default9.src,
  select: icon_default10.src,
  slider: icon_default12.src,
  telephone: mobile_default,
  text: icon_default13.src,
  textarea: icon_default14.src,
  time: icon_default15,
  url: globe_default
};

// src/dashboard/components/inspector/response-fields/field-phone/index.tsx
var import_element100 = __toESM(require_element(), 1);
var import_jsx_runtime189 = __toESM(require_jsx_runtime(), 1);
var FieldPhone = ({ phone }) => {
  const [displayInfo, setDisplayInfo] = (0, import_element100.useState)({
    formattedNumber: phone
  });
  (0, import_element100.useEffect)(() => {
    let cancelled = false;
    setDisplayInfo({ formattedNumber: phone, countryCode: void 0 });
    const formatPhone = async () => {
      try {
        const { parsePhoneNumber: parsePhoneNumber5 } = await Promise.resolve().then(() => (init_libphonenumber_js(), libphonenumber_js_exports));
        if (cancelled) {
          return;
        }
        const phoneNumber = parsePhoneNumber5(phone);
        if (phoneNumber) {
          setDisplayInfo({
            formattedNumber: phoneNumber.formatInternational(),
            countryCode: phoneNumber.country
          });
        }
      } catch {
      }
    };
    formatPhone();
    return () => {
      cancelled = true;
    };
  }, [phone]);
  const { formattedNumber, countryCode } = displayInfo;
  return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(TextWithFlag, { countryCode, children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)("a", { href: `tel:${phone}`, children: formattedNumber }) });
};
var field_phone_default = FieldPhone;

// src/dashboard/components/inspector/response-fields/field-rating/index.tsx
var import_components87 = __toESM(require_components(), 1);
var import_i18n92 = __toESM(require_i18n(), 1);

// src/blocks/field-rating/rating-icon.jsx
var import_components86 = __toESM(require_components(), 1);

// src/blocks/field-rating/rating-icons.js
var MAX_RATING_ICONS = 10;
var RATING_ICONS = {
  stars: "M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.62L12 2 9.19 8.62 2 9.24l5.46 4.73L5.82 21z",
  hearts: "M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z"
};

// src/blocks/field-rating/rating-icon.jsx
var import_jsx_runtime190 = __toESM(require_jsx_runtime(), 1);
var RatingIcon = ({
  iconStyle,
  strokeColor = "currentColor",
  fillColor = "none",
  strokeWidth = 2
}) => {
  const iconPath = RATING_ICONS[iconStyle] || RATING_ICONS.stars;
  return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(import_components86.SVG, { className: "jetpack-field-rating__icon", viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(
    import_components86.Path,
    {
      d: iconPath,
      fill: fillColor,
      stroke: strokeColor,
      strokeWidth,
      strokeLinejoin: "round"
    }
  ) });
};

// src/dashboard/components/inspector/response-fields/field-rating/index.tsx
var import_jsx_runtime191 = __toESM(require_jsx_runtime(), 1);
var FieldRating = ({ value }) => {
  const stringValue = value != null ? String(value) : "";
  if (stringValue.trim() === "") {
    return "-";
  }
  const [rateValue, outOf] = stringValue.split("/") ?? [];
  if (!rateValue || rateValue.trim() === "") {
    return "-";
  }
  if (!outOf || outOf.trim() === "") {
    return "-";
  }
  const rateValueTrimmed = rateValue.trim();
  const outOfTrimmed = outOf.trim();
  if (!/^[0-9]+$/.test(rateValueTrimmed) || !/^[0-9]+$/.test(outOfTrimmed)) {
    return "-";
  }
  const parsedRating = Number.parseInt(rateValueTrimmed, 10);
  const parsedMax = Number.parseInt(outOfTrimmed, 10);
  if (!Number.isFinite(parsedRating) || parsedRating < 0 || !Number.isFinite(parsedMax) || parsedMax < 0) {
    return "-";
  }
  const clampedMax = Math.min(parsedMax, MAX_RATING_ICONS);
  const displayRating = Math.min(Math.max(0, parsedRating), clampedMax);
  const ratingLabel = (0, import_i18n92.sprintf)(
    /* translators: 1: rating value, 2: maximum rating (e.g. "4" and "5" for "4 out of 5") */
    (0, import_i18n92.__)("Rating %1$s out of %2$s", "jetpack-forms"),
    String(displayRating),
    String(clampedMax)
  );
  return /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_jsx_runtime191.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_components87.VisuallyHidden, { as: "span", children: ratingLabel }),
    /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(import_components87.__experimentalHStack, { spacing: "1", alignment: "topLeft", children: Array.from({ length: clampedMax }, (_, index) => /* @__PURE__ */ (0, import_jsx_runtime191.jsx)("span", { style: { flex: "0 0 24px" }, children: /* @__PURE__ */ (0, import_jsx_runtime191.jsx)(
      RatingIcon,
      {
        iconStyle: "stars",
        strokeColor: index < displayRating ? "#F0B849" : "#757575",
        fillColor: index < displayRating ? "#F0B849" : "none",
        strokeWidth: 1.5
      }
    ) }, index)) })
  ] });
};
var field_rating_default = FieldRating;

// src/dashboard/components/inspector/response-fields/field-preview/field-preview-utils.ts
var EMAIL_REGEX = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i;
var FIELD_TYPE_LABEL_PREFIXES = [
  // Contact info fields
  ["first name", "name"],
  ["last name", "name"],
  ["name", "name"],
  ["email", "email"],
  ["phone", "telephone"],
  ["website", "url"],
  // Basic fields
  ["text", "text"],
  ["message", "textarea"],
  ["number", "number"],
  // Choice fields
  ["dropdown", "select"],
  ["choose one option", "radio"],
  ["choose several options", "checkbox-multiple"],
  // Advanced fields
  ["date", "date"],
  ["time", "time"],
  ["upload a file", "file"],
  ["slider", "slider"],
  ["rating", "rating"],
  // Consent field (partial match for long default label)
  ["by submitting your information", "consent"],
  ["can we send you an email from time to time", "consent"]
];
var inferFieldTypeFromLabel = (label) => {
  const normalizedLabel = label.toLowerCase().replace(/:$/, "").trim();
  for (const [prefix, fieldType] of FIELD_TYPE_LABEL_PREFIXES) {
    if (normalizedLabel.startsWith(prefix)) {
      return fieldType;
    }
  }
  return null;
};

// src/dashboard/components/inspector/response-fields/field-preview/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='363ec2ad9c']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "363ec2ad9c");
  style.appendChild(document.createTextNode(".jp-forms__inbox-response-data{overflow-wrap:break-word;padding:0 16px}.jp-forms__inbox-response-data.is-collection-format .jp-forms__field-preview{border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,var(--jp-forms-border-color,#e0e0e0));padding-bottom:24px;padding-top:24px}.jp-forms__inbox-response-data.is-collection-format .jp-forms__field-preview-icon{flex-shrink:0}.jp-forms__inbox-response-data.is-collection-format .jp-forms__field-preview-content{line-height:var(--wpds-font-line-height-sm,20px);min-width:0;overflow-wrap:break-word}.jp-forms__inbox-response-data.is-collection-format .jp-forms__field-preview-label,.jp-forms__inbox-response-data.is-collection-format .jp-forms__field-preview-value{margin-top:calc((24px - var(--wpds-font-line-height-sm, 20px))/2)}.jp-forms__inbox-response-data:not(.is-collection-format){display:flex;flex-direction:column;padding-bottom:24px;padding-top:24px;row-gap:24px}.jp-forms__field-preview-label{color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d);font-weight:300}.jp-forms__inbox-response-data-value{white-space:pre-wrap}"));
  document.head.appendChild(style);
}

// src/dashboard/components/inspector/response-fields/field-preview/index.tsx
var import_jsx_runtime192 = __toESM(require_jsx_runtime(), 1);
var getFieldIcon = (fieldType) => {
  return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(import_components88.Icon, { icon: fieldIcons[fieldType] ?? fieldIcons.text });
};
var BADGED_VALUE_FIELDS = ["consent", "checkbox", "radio", "select"];
var FieldPreview = ({ field, onFilePreview }) => {
  const { label, value, type } = field;
  const fieldType = type && type !== "basic" ? type : inferFieldTypeFromLabel(label) ?? "text";
  const icon15 = getFieldIcon(fieldType);
  const typeClassName = `is-field-type-${fieldType}`;
  const renderFieldValue = () => {
    if (fieldType === "image-select") {
      const choices = value?.choices;
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(field_image_select_default, { choices, handleFilePreview: onFilePreview });
    }
    if (fieldType === "file") {
      const files = value?.files;
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(field_file_default, { files, handleFilePreview: onFilePreview });
    }
    if (fieldType === "checkbox-multiple" && Array.isArray(value)) {
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(import_components88.__experimentalVStack, { spacing: "2", alignment: "topLeft", children: value.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(Badge3, { intent: "draft", children: item }, index)) });
    }
    if (value === null || value === void 0) {
      return "-";
    }
    if (Array.isArray(value)) {
      return value.join(", ");
    }
    if (typeof value === "object") {
      return JSON.stringify(value);
    }
    const stringValue = String(value);
    if (stringValue.trim() === "") {
      return "-";
    }
    if (BADGED_VALUE_FIELDS.includes(fieldType)) {
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(Badge3, { intent: "draft", children: stringValue });
    }
    if (fieldType === "number") {
      return formatNumber2(Number(stringValue));
    }
    if (fieldType === "email" && EMAIL_REGEX.test(stringValue)) {
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(field_email_default, { email: stringValue });
    }
    if (fieldType === "phone" || fieldType === "telephone") {
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(field_phone_default, { phone: stringValue });
    }
    if (fieldType === "url" && /^https?:\/\//.test(stringValue)) {
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(import_components88.ExternalLink, { href: stringValue, children: stringValue });
    }
    if (fieldType === "rating") {
      return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(field_rating_default, { value: stringValue });
    }
    return stringValue;
  };
  return /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(
    import_components88.__experimentalHStack,
    {
      alignment: "topLeft",
      spacing: "4",
      className: `jp-forms__field-preview ${typeClassName}`,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime192.jsx)("div", { className: "jp-forms__field-preview-icon", children: icon15 }),
        /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)(import_components88.__experimentalVStack, { spacing: "0", className: "jp-forms__field-preview-content", children: [
          label && /* @__PURE__ */ (0, import_jsx_runtime192.jsx)("div", { className: "jp-forms__field-preview-label", children: label }),
          /* @__PURE__ */ (0, import_jsx_runtime192.jsx)("div", { className: "jp-forms__field-preview-value", children: renderFieldValue() })
        ] })
      ]
    }
  );
};
var field_preview_default = FieldPreview;

// src/dashboard/components/inspector/response-fields/index.tsx
var import_jsx_runtime193 = __toESM(require_jsx_runtime(), 1);
var ResponseFieldsIterator = ({
  fields,
  onFilePreview
}) => {
  const fieldsAreNewFormat = isFieldsCollection(fields);
  const rootClass = clsx_default("jp-forms__inbox-response-data", {
    "is-collection-format": fieldsAreNewFormat
  });
  const renderFieldValue = (value) => {
    if (isImageSelectField(value)) {
      return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(
        field_image_select_default,
        {
          choices: value.choices,
          handleFilePreview: onFilePreview
        }
      );
    }
    if (isFileUploadField(value)) {
      const fileValue = value;
      return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(field_file_default, { files: fileValue.files, handleFilePreview: onFilePreview });
    }
    const emailRegEx = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}$/i;
    if (typeof value === "string" && emailRegEx.test(value)) {
      return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(field_email_default, { email: value });
    }
    if (isLikelyPhoneNumber(value)) {
      return /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("a", { href: `tel:${value}`, children: String(value) });
    }
    return value;
  };
  return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)("div", { className: rootClass, children: [
    fields && !fieldsAreNewFormat && Object.entries(fields).map(([key, value]) => /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)("div", { className: "jp-forms__inbox-response-item", children: [
      /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("div", { className: "jp-forms__inbox-response-data-label", children: key.endsWith("?") ? key : `${key}:` }),
      /* @__PURE__ */ (0, import_jsx_runtime193.jsx)("div", { className: "jp-forms__inbox-response-data-value", children: renderFieldValue(value) })
    ] }, key)),
    fields && fieldsAreNewFormat && (Array.isArray(fields) ? fields : Object.values(fields)).map(
      (field) => /* @__PURE__ */ (0, import_jsx_runtime193.jsx)(field_preview_default, { field, onFilePreview }, field.key)
    )
  ] });
};
var response_fields_default = ResponseFieldsIterator;

// src/dashboard/components/inspector/response-meta/index.tsx
var import_components89 = __toESM(require_components(), 1);
var import_date12 = __toESM(require_date(), 1);
var import_html_entities8 = __toESM(require_html_entities(), 1);
var import_i18n93 = __toESM(require_i18n(), 1);

// src/dashboard/components/inspector/response-meta/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='6c5f816f45']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "6c5f816f45");
  style.appendChild(document.createTextNode(".jp-forms__inbox-response-meta{background-color:#fcfcfc;border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,var(--jp-forms-border-color,#e0e0e0));padding:24px 16px}.jp-forms__inbox-response-meta-from{min-height:48px;overflow-wrap:break-word}.jp-forms__inbox-response-meta-from-email,.jp-forms__inbox-response-meta-from-name{margin:0;padding:0}.jp-forms__inbox-response-meta-table{color:var(--jp-gray-80,#2c3338);font-size:13px;padding-top:16px;text-align:left;width:fit-content}.jp-forms__inbox-response-meta-table td,.jp-forms__inbox-response-meta-table th{margin:0;overflow-wrap:break-word;padding:0 0 6px}.jp-forms__inbox-response-meta-table th{color:var(--jp-gray-50,#646970);font-weight:400;padding-right:16px;vertical-align:top;white-space:nowrap}"));
  document.head.appendChild(style);
}

// src/dashboard/components/inspector/response-meta/index.tsx
var import_jsx_runtime194 = __toESM(require_jsx_runtime(), 1);
var getDisplayName = (response) => {
  const { author_name, author_email, author_url, ip } = response;
  return (0, import_html_entities8.decodeEntities)(author_name || author_email || author_url || ip);
};
var ResponseMeta = ({ response }) => {
  const displayName = getDisplayName(response);
  const gravatarEmail = response.author_email || response.ip;
  const defaultImage = response.author_name || response.author_email ? "initials" : "mp";
  const responseAuthorEmailParts = response.author_email?.split("@") ?? [];
  const dateSettings = (0, import_date12.getSettings)();
  return /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("div", { className: "jp-forms__inbox-response-meta", children: [
    /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(import_components89.__experimentalHStack, { alignment: "topLeft", spacing: "3", wrap: false, children: [
      /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
        Gravatar,
        {
          email: gravatarEmail,
          defaultImage,
          displayName
        },
        gravatarEmail
      ),
      /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(import_components89.__experimentalVStack, { spacing: "0", className: "jp-forms__inbox-response-meta-from", children: [
        /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
          import_components89.__experimentalText,
          {
            className: "jp-forms__inbox-response-meta-from-name",
            lineHeight: "20px",
            size: "15px",
            weight: "600",
            children: displayName
          }
        ),
        response.author_email && displayName !== response.author_email && /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(
          import_components89.__experimentalHStack,
          {
            alignment: "center",
            className: "jp-forms__inbox-response-meta-from-email",
            justify: "start",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)(
                import_components89.__experimentalText,
                {
                  as: "a",
                  href: `mailto:${response.author_email}`,
                  lineHeight: "20px",
                  size: "13px",
                  variant: "muted",
                  weight: "400",
                  children: [
                    responseAuthorEmailParts[0],
                    /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("wbr", {}),
                    "@",
                    responseAuthorEmailParts[1]
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(CopyClipboardButton, { text: response.author_email })
            ]
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("table", { className: "jp-forms__inbox-response-meta-table", children: /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tbody", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tr", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("th", { children: (0, import_i18n93.__)("Date:", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("td", { children: (0, import_date12.dateI18n)(dateSettings.formats.datetime, response.date) })
      ] }),
      /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tr", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("th", { children: (0, import_i18n93.__)("Source:", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("td", { children: [
          response.entry_permalink && /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_components89.ExternalLink, { href: response.entry_permalink, children: (0, import_html_entities8.decodeEntities)(response.entry_title) || getPath(response) }),
          !response.entry_permalink && (0, import_html_entities8.decodeEntities)(response.entry_title)
        ] })
      ] }),
      /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tr", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("th", { children: [
          (0, import_i18n93.__)("IP address:", "jetpack-forms"),
          "\xA0"
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(TextWithFlag, { countryCode: response.country_code, children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(import_components89.Tooltip, { text: (0, import_i18n93.__)("Lookup IP address", "jetpack-forms"), children: /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
          import_components89.ExternalLink,
          {
            href: `https://apps.db.ripe.net/db-web-ui/query?searchtext=${encodeURIComponent(
              response.ip
            )}`,
            children: response.ip
          }
        ) }) }) })
      ] }),
      response.browser && /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("tr", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime194.jsxs)("th", { children: [
          (0, import_i18n93.__)("Browser:", "jetpack-forms"),
          "\xA0"
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime194.jsx)("td", { children: response.browser })
      ] })
    ] }) })
  ] });
};
var response_meta_default = ResponseMeta;

// src/dashboard/hooks/use-mark-as-spam.ts
var import_core_data9 = __toESM(require_core_data(), 1);
var import_data35 = __toESM(require_data(), 1);
var import_element101 = __toESM(require_element(), 1);
var import_i18n94 = __toESM(require_i18n(), 1);
var useMarkAsSpam = (response, options) => {
  const [isConfirmDialogOpen, setIsConfirmDialogOpen] = (0, import_element101.useState)(false);
  const [isSaving, setIsSaving] = (0, import_element101.useState)(false);
  const { saveEntityRecord } = (0, import_data35.useDispatch)(import_core_data9.store);
  const { invalidateCounts: invalidateCounts2 } = (0, import_data35.useDispatch)(store3);
  const markAsSpamConfirmationMessage = (0, import_element101.useMemo)(
    () => (0, import_i18n94.__)("Are you sure you want to mark this response as spam?", "jetpack-forms"),
    []
  );
  const { checkParameter, removeParameter, switchToSpam } = options;
  const onConfirmMarkAsSpam = (0, import_element101.useCallback)(async () => {
    if (!response) {
      return;
    }
    try {
      setIsSaving(true);
      await saveEntityRecord("postType", "feedback", {
        id: response.id,
        status: "spam"
      });
      await invalidateCounts2();
      setIsSaving(false);
      setIsConfirmDialogOpen(false);
      switchToSpam(response.id);
    } catch {
      setIsSaving(false);
    }
  }, [response, saveEntityRecord, invalidateCounts2, switchToSpam]);
  const hasSpamParameter = (0, import_element101.useMemo)(() => checkParameter(), [checkParameter]);
  const onCancelMarkAsSpam = (0, import_element101.useCallback)(() => {
    setIsConfirmDialogOpen(false);
    removeParameter();
  }, [removeParameter]);
  (0, import_element101.useEffect)(() => {
    if (hasSpamParameter && response && !["spam", "trash"].includes(response.status)) {
      setIsConfirmDialogOpen(true);
    }
  }, [response?.status, hasSpamParameter, response]);
  return {
    isConfirmDialogOpen,
    onConfirmMarkAsSpam,
    onCancelMarkAsSpam,
    markAsSpamConfirmationMessage,
    isSaving
  };
};

// routes/responses/response/actions.tsx
var import_components90 = __toESM(require_components());
var import_data36 = __toESM(require_data());
var import_element102 = __toESM(require_element());
var import_i18n95 = __toESM(require_i18n());
import { useSearch as useSearch3, useNavigate as useNavigate4 } from "@wordpress/route";
var import_jsx_runtime195 = __toESM(require_jsx_runtime());
function ResponseActions({
  response,
  onActionComplete
}) {
  const searchParams = useSearch3({ from: "/responses/$view" });
  const navigate = useNavigate4();
  const {
    markAsSpamAction,
    markAsNotSpamAction,
    moveToTrashAction,
    restoreAction,
    deleteAction,
    markAsReadAction,
    markAsUnreadAction
  } = (0, import_element102.useMemo)(
    () => getActions({
      navigate,
      searchParams
    }),
    [navigate, searchParams]
  );
  const [isMarkingAsSpam, setIsMarkingAsSpam] = (0, import_element102.useState)(false);
  const [isMarkingAsNotSpam, setIsMarkingAsNotSpam] = (0, import_element102.useState)(false);
  const [isMovingToTrash, setIsMovingToTrash] = (0, import_element102.useState)(false);
  const [isRestoring, setIsRestoring] = (0, import_element102.useState)(false);
  const [isDeleting, setIsDeleting] = (0, import_element102.useState)(false);
  const [isTogglingReadStatus, setIsTogglingReadStatus] = (0, import_element102.useState)(false);
  const registry = (0, import_data36.useRegistry)();
  const handleMarkAsSpam = (0, import_element102.useCallback)(async () => {
    onActionComplete?.(response);
    setIsMarkingAsSpam(true);
    await markAsSpamAction.callback?.([response], { registry });
    setIsMarkingAsSpam(false);
  }, [onActionComplete, response, markAsSpamAction, registry]);
  const handleMarkAsNotSpam = (0, import_element102.useCallback)(async () => {
    onActionComplete?.(response);
    setIsMarkingAsNotSpam(true);
    await markAsNotSpamAction?.callback?.([response], { registry });
    setIsMarkingAsNotSpam(false);
  }, [onActionComplete, response, markAsNotSpamAction, registry]);
  const handleMoveToTrash = (0, import_element102.useCallback)(async () => {
    onActionComplete?.(response);
    setIsMovingToTrash(true);
    await moveToTrashAction?.callback?.([response], { registry });
    setIsMovingToTrash(false);
  }, [onActionComplete, response, moveToTrashAction, registry]);
  const handleRestore = (0, import_element102.useCallback)(async () => {
    onActionComplete?.(response);
    setIsRestoring(true);
    await restoreAction?.callback?.([response], { registry });
    setIsRestoring(false);
  }, [onActionComplete, response, restoreAction, registry]);
  const handleDelete = (0, import_element102.useCallback)(async () => {
    onActionComplete?.(response);
    setIsDeleting(true);
    await deleteAction?.callback?.([response], { registry });
    setIsDeleting(false);
  }, [onActionComplete, response, deleteAction, registry]);
  const handleMarkAsRead = (0, import_element102.useCallback)(async () => {
    setIsTogglingReadStatus(true);
    await markAsReadAction?.callback?.([response], { registry });
    setIsTogglingReadStatus(false);
    onActionComplete?.({ ...response, is_unread: false });
  }, [onActionComplete, response, markAsReadAction, registry]);
  const handleMarkAsUnread = (0, import_element102.useCallback)(async () => {
    setIsTogglingReadStatus(true);
    await markAsUnreadAction?.callback?.([response], { registry });
    setIsTogglingReadStatus(false);
    onActionComplete?.({ ...response, is_unread: true });
  }, [onActionComplete, response, markAsUnreadAction, registry]);
  const readUnreadButtons = /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(import_jsx_runtime195.Fragment, { children: [
    response.is_unread && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isTogglingReadStatus, onClick: handleMarkAsRead, size: "compact", children: (0, import_i18n95.__)("Mark as read", "jetpack-forms") }),
    !response.is_unread && /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isTogglingReadStatus, onClick: handleMarkAsUnread, size: "compact", children: (0, import_i18n95.__)("Mark as unread", "jetpack-forms") })
  ] });
  const trashButton = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isMovingToTrash, onClick: handleMoveToTrash, size: "compact", children: (0, import_i18n95.__)("Trash", "jetpack-forms") });
  const spamButton = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isMarkingAsSpam, onClick: handleMarkAsSpam, size: "compact", children: (0, import_i18n95.__)("Spam", "jetpack-forms") });
  const notSpamButton = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isMarkingAsNotSpam, onClick: handleMarkAsNotSpam, size: "compact", children: (0, import_i18n95.__)("Not spam", "jetpack-forms") });
  const deleteButton = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isDeleting, onClick: handleDelete, size: "compact", children: (0, import_i18n95.__)("Delete", "jetpack-forms") });
  const restoreButton = /* @__PURE__ */ (0, import_jsx_runtime195.jsx)(import_components90.Button, { isBusy: isRestoring, onClick: handleRestore, size: "compact", children: (0, import_i18n95.__)("Restore", "jetpack-forms") });
  return /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(
    Stack3,
    {
      direction: "row",
      gap: "xs",
      justify: "start",
      wrap: "wrap",
      className: "jp-forms-response-header-actions",
      children: [
        response.status === "publish" && /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(import_jsx_runtime195.Fragment, { children: [
          readUnreadButtons,
          spamButton,
          trashButton
        ] }),
        response.status === "trash" && /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(import_jsx_runtime195.Fragment, { children: [
          readUnreadButtons,
          restoreButton,
          deleteButton
        ] }),
        response.status === "spam" && /* @__PURE__ */ (0, import_jsx_runtime195.jsxs)(import_jsx_runtime195.Fragment, { children: [
          readUnreadButtons,
          notSpamButton,
          trashButton
        ] })
      ]
    }
  );
}

// routes/responses/response/navigation.tsx
var import_components91 = __toESM(require_components());
var import_i18n96 = __toESM(require_i18n());
var import_jsx_runtime196 = __toESM(require_jsx_runtime());
function ResponseNavigation({
  hasNext,
  hasPrevious,
  onNext,
  onPrevious,
  onClose
}) {
  const sharedProps = {
    accessibleWhenDisabled: true,
    iconSize: 24,
    showTooltip: true,
    size: "compact"
  };
  return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)(Stack3, { direction: "row", gap: "xs", justify: "end", style: { flexShrink: 0 }, wrap: "wrap", children: [
    /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
      import_components91.Button,
      {
        ...sharedProps,
        disabled: !hasPrevious,
        icon: chevron_up_default,
        label: (0, import_i18n96.__)("Previous", "jetpack-forms"),
        onClick: onPrevious
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
      import_components91.Button,
      {
        ...sharedProps,
        disabled: !hasNext,
        icon: chevron_down_default,
        label: (0, import_i18n96.__)("Next", "jetpack-forms"),
        onClick: onNext
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
      "span",
      {
        style: {
          backgroundColor: "var(--wp-admin-theme-color-darker-10, #135e96)",
          display: "inline-block",
          height: "20px",
          margin: "6px 4px 6px 0",
          opacity: 0.2,
          width: "1px"
        }
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime196.jsx)(
      import_components91.Button,
      {
        ...sharedProps,
        iconSize: 20,
        icon: close_default,
        label: (0, import_i18n96.__)("Close", "jetpack-forms"),
        onClick: onClose
      }
    )
  ] });
}

// routes/responses/response/style.scss
if (typeof document !== "undefined" && !document.head.querySelector("style[data-wp-hash='8721584580']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "8721584580");
  style.appendChild(document.createTextNode(".jp-forms-response-header{border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,#e0e0e0);padding:8px}.jp-forms-response-header-actions{gap:0!important}.jp-forms__inbox__tip-container{border-top:1px solid var(--wpds-color-stroke-surface-neutral,#e0e0e0);margin:auto 0 0;padding:16px;text-wrap:pretty}.jp-forms__inbox__tip-container .components-tip{align-items:anchor-center}"));
  document.head.appendChild(style);
}

// routes/responses/response/index.tsx
var import_jsx_runtime197 = __toESM(require_jsx_runtime());
function SingleResponseView({
  responseId,
  allResponseIds,
  onNavigate,
  onClose
}) {
  const [previewFile, setPreviewFile] = (0, import_element103.useState)(null);
  const [isImageLoading, setIsImageLoading] = (0, import_element103.useState)(true);
  const [hasMarkedAsRead, setHasMarkedAsRead] = (0, import_element103.useState)(null);
  const emptyTrashDays = useConfigValue("emptyTrashDays") ?? 0;
  const isNotesEnabled = useConfigValue("isNotesEnabled") ?? false;
  const { editEntityRecord } = (0, import_data37.useDispatch)(import_core_data10.store);
  const navigate = useNavigate5();
  const searchParams = useSearch4({ from: "/responses/$view" });
  const { response, isLoading } = (0, import_data37.useSelect)(
    (select3) => {
      if (!responseId) {
        return { response: null, isLoading: false };
      }
      return {
        response: select3(import_core_data10.store).getEditedEntityRecord(
          "postType",
          "feedback",
          responseId
        ),
        isLoading: select3(import_core_data10.store).isResolving(
          "getEntityRecord",
          ["postType", "feedback", responseId]
        )
      };
    },
    [responseId]
  );
  const {
    isConfirmDialogOpen,
    onConfirmMarkAsSpam,
    onCancelMarkAsSpam,
    markAsSpamConfirmationMessage,
    isSaving
  } = useMarkAsSpam(response, {
    checkParameter: () => searchParams?.mark_as_spam === 1,
    removeParameter: () => {
      navigate({
        search: {
          ...searchParams,
          mark_as_spam: void 0
        }
      });
    },
    switchToSpam: (id) => {
      navigate({
        to: "/responses/spam",
        search: {
          ...searchParams,
          responseIds: [String(id)],
          mark_as_spam: void 0
        }
      });
    }
  });
  const currentIndex = allResponseIds.indexOf(responseId);
  const hasNext = currentIndex < allResponseIds.length - 1;
  const hasPrevious = currentIndex > 0;
  const handleNext = (0, import_element103.useCallback)(() => {
    if (hasNext) {
      onNavigate(allResponseIds[currentIndex + 1]);
    }
  }, [hasNext, allResponseIds, currentIndex, onNavigate]);
  const handlePrevious = (0, import_element103.useCallback)(() => {
    if (hasPrevious) {
      onNavigate(allResponseIds[currentIndex - 1]);
    }
  }, [hasPrevious, allResponseIds, currentIndex, onNavigate]);
  (0, import_element103.useEffect)(() => {
    const handleKeyDown = (event) => {
      if (event.key === "ArrowUp" && hasPrevious) {
        event.preventDefault();
        handlePrevious();
      } else if (event.key === "ArrowDown" && hasNext) {
        event.preventDefault();
        handleNext();
      } else if (event.key === "Escape") {
        onClose();
      }
    };
    window.addEventListener("keydown", handleKeyDown);
    return () => window.removeEventListener("keydown", handleKeyDown);
  }, [hasNext, hasPrevious, handleNext, handlePrevious, onClose]);
  (0, import_element103.useEffect)(() => {
    if (!response || !response.id || !response.is_unread) {
      return;
    }
    if (hasMarkedAsRead === response.id) {
      return;
    }
    setHasMarkedAsRead(response.id);
    editEntityRecord("postType", "feedback", response.id, {
      is_unread: false
    });
    (0, import_api_fetch12.default)({
      path: `/wp/v2/feedback/${response.id}/read`,
      method: "POST",
      data: { is_unread: false }
    }).catch(() => {
      editEntityRecord("postType", "feedback", response.id, {
        is_unread: true
      });
    });
  }, [response, editEntityRecord, hasMarkedAsRead]);
  const handleFilePreview = (0, import_element103.useCallback)(
    (file) => () => {
      setIsImageLoading(true);
      setPreviewFile(file);
    },
    []
  );
  const closePreviewModal = (0, import_element103.useCallback)(() => {
    setPreviewFile(null);
    setIsImageLoading(true);
  }, []);
  const handleImageLoaded = (0, import_element103.useCallback)(() => {
    setIsImageLoading(false);
  }, []);
  const handleActionComplete = (0, import_element103.useCallback)(
    (updatedItem) => {
      if (!updatedItem) {
        if (hasNext) {
          handleNext();
        } else if (hasPrevious) {
          handlePrevious();
        } else {
          onClose();
        }
      }
    },
    [hasNext, hasPrevious, handleNext, handlePrevious, onClose]
  );
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Stack3, { direction: "row", justify: "center", style: { padding: "40px" }, children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_components92.Spinner, {}) });
  }
  if (!response) {
    return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Stack3, { direction: "row", justify: "center", style: { padding: "40px" }, children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("p", { children: (0, import_i18n97.__)("Response not found.", "jetpack-forms") }) });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(import_jsx_runtime197.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)(Stack3, { className: "jp-forms-response-header", direction: "row", gap: "xs", justify: "space-between", children: [
      /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(ResponseActions, { response, onActionComplete: handleActionComplete }),
      /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
        ResponseNavigation,
        {
          hasNext,
          hasPrevious,
          onNext: handleNext,
          onPrevious: handlePrevious,
          onClose
        }
      )
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(response_meta_default, { response }),
    /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(response_fields_default, { fields: response.fields, onFilePreview: handleFilePreview }),
    isNotesEnabled && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(feedback_comments_default, { postId: response.id }),
    response.status === "spam" && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "jp-forms__inbox__tip-container", children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_components92.Tip, { children: (0, import_i18n97.sprintf)(
      /* translators: %d number of days. */
      (0, import_i18n97._n)(
        "Spam responses are permanently deleted after %d day.",
        "Spam responses are permanently deleted after %d days.",
        15,
        "jetpack-forms"
      ),
      // Number from https://github.com/Automattic/jetpack/blob/bde3cf9a89ce0d02e50469df173a6253383bd276/projects/packages/forms/src/contact-form/class-contact-form-plugin.php#L132
      15
    ) }) }),
    response.status === "trash" && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)("div", { className: "jp-forms__inbox__tip-container", children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_components92.Tip, { children: (0, import_i18n97.sprintf)(
      /* translators: %d number of days. */
      (0, import_i18n97._n)(
        "Items in trash are permanently deleted after %d day.",
        "Items in trash are permanently deleted after %d days.",
        emptyTrashDays,
        "jetpack-forms"
      ),
      emptyTrashDays
    ) }) }),
    previewFile && /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(import_components92.Modal, { title: (0, import_html_entities9.decodeEntities)(previewFile.name), onRequestClose: closePreviewModal, children: /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
      preview_file_default,
      {
        file: previewFile,
        isLoading: isImageLoading,
        onImageLoaded: handleImageLoaded
      }
    ) }),
    /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
      import_components92.__experimentalConfirmDialog,
      {
        isOpen: isConfirmDialogOpen,
        onConfirm: onConfirmMarkAsSpam,
        onCancel: onCancelMarkAsSpam,
        isBusy: isSaving,
        children: markAsSpamConfirmationMessage
      }
    )
  ] });
}
function Response() {
  const params = useParams2({ from: "/responses/$view" });
  const searchParams = useSearch4({ from: "/responses/$view" });
  const navigate = useNavigate5();
  const responseIds = searchParams?.responseIds || [];
  const statusView = params.view === "spam" || params.view === "trash" ? params.view : "inbox";
  const { records } = useInboxData({ status: statusView });
  const allRecordIds = records?.map((record) => record.id) ?? [];
  const handleClose = (0, import_element103.useCallback)(() => {
    navigate({
      search: {
        ...searchParams,
        responseIds: void 0
      }
    });
  }, [navigate, searchParams]);
  const handleNavigate = (0, import_element103.useCallback)(
    (id) => {
      navigate({
        search: {
          ...searchParams,
          responseIds: [String(id)]
        }
      });
    },
    [navigate, searchParams]
  );
  if (responseIds.length !== 1) {
    return null;
  }
  const selectedResponseId = Number(responseIds[0]);
  return /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(
    SingleResponseView,
    {
      responseId: selectedResponseId,
      allResponseIds: allRecordIds,
      onNavigate: handleNavigate,
      onClose: handleClose
    }
  );
}

// routes/responses/inspector.tsx
var import_jsx_runtime198 = __toESM(require_jsx_runtime());
function Inspector() {
  return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(WpRouteDashboardSearchParamsProvider, { from: "/responses/$view", children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(page_default, { showSidebarToggle: false, hasPadding: false, children: /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(Response, {}) }) });
}
export {
  Inspector as inspector,
  Stage as stage
};
/*! Bundled license information:

use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
  (**
   * @license React
   * use-sync-external-store-shim.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)

js-sha256/src/sha256.js:
  (**
   * [js-sha256]{@link https://github.com/emn178/js-sha256}
   *
   * @version 0.11.1
   * @author Chen, Yi-Cyuan [emn178@gmail.com]
   * @copyright Chen, Yi-Cyuan 2014-2025
   * @license MIT
   *)
*/
