UNPKG

mind-link-ai-widget

Version:

A react widget for React Web and React-Native Mobile integrations.

1,939 lines 81 kB
import * as d from "react";
import V, { useState as P, useRef as Ke, useEffect as ne, useMemo as fe } from "react";
var me = { exports: {} }, K = {};
/**
 * @license React
 * react-jsx-runtime.production.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.
 */
var Pe;
function gt() {
  if (Pe) return K;
  Pe = 1;
  var e = Symbol.for("react.transitional.element"), t = Symbol.for("react.fragment");
  function n(r, a, i) {
    var u = null;
    if (i !== void 0 && (u = "" + i), a.key !== void 0 && (u = "" + a.key), "key" in a) {
      i = {};
      for (var h in a)
        h !== "key" && (i[h] = a[h]);
    } else i = a;
    return a = i.ref, {
      $$typeof: e,
      type: r,
      key: u,
      ref: a !== void 0 ? a : null,
      props: i
    };
  }
  return K.Fragment = t, K.jsx = n, K.jsxs = n, K;
}
var Le;
function xt() {
  return Le || (Le = 1, me.exports = gt()), me.exports;
}
var l = xt(), Xe = {
  color: void 0,
  size: void 0,
  className: void 0,
  style: void 0,
  attr: void 0
}, Ie = V.createContext && /* @__PURE__ */ V.createContext(Xe), yt = ["attr", "size", "title"];
function bt(e, t) {
  if (e == null) return {};
  var n = wt(e, t), r, a;
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    for (a = 0; a < i.length; a++)
      r = i[a], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
  }
  return n;
}
function wt(e, t) {
  if (e == null) return {};
  var n = {};
  for (var r in e)
    if (Object.prototype.hasOwnProperty.call(e, r)) {
      if (t.indexOf(r) >= 0) continue;
      n[r] = e[r];
    }
  return n;
}
function ie() {
  return ie = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var r in n)
        Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
    }
    return e;
  }, ie.apply(this, arguments);
}
function $e(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var r = Object.getOwnPropertySymbols(e);
    t && (r = r.filter(function(a) {
      return Object.getOwnPropertyDescriptor(e, a).enumerable;
    })), n.push.apply(n, r);
  }
  return n;
}
function le(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? $e(Object(n), !0).forEach(function(r) {
      Nt(e, r, n[r]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : $e(Object(n)).forEach(function(r) {
      Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(n, r));
    });
  }
  return e;
}
function Nt(e, t, n) {
  return t = jt(t), t in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
}
function jt(e) {
  var t = Ct(e, "string");
  return typeof t == "symbol" ? t : t + "";
}
function Ct(e, t) {
  if (typeof e != "object" || !e) return e;
  var n = e[Symbol.toPrimitive];
  if (n !== void 0) {
    var r = n.call(e, t);
    if (typeof r != "object") return r;
    throw new TypeError("@@toPrimitive must return a primitive value.");
  }
  return (t === "string" ? String : Number)(e);
}
function Qe(e) {
  return e && e.map((t, n) => /* @__PURE__ */ V.createElement(t.tag, le({
    key: n
  }, t.attr), Qe(t.child)));
}
function k(e) {
  return (t) => /* @__PURE__ */ V.createElement(Et, ie({
    attr: le({}, e.attr)
  }, t), Qe(e.child));
}
function Et(e) {
  var t = (n) => {
    var {
      attr: r,
      size: a,
      title: i
    } = e, u = bt(e, yt), h = a || n.size || "1em", s;
    return n.className && (s = n.className), e.className && (s = (s ? s + " " : "") + e.className), /* @__PURE__ */ V.createElement("svg", ie({
      stroke: "currentColor",
      fill: "currentColor",
      strokeWidth: "0"
    }, n.attr, r, u, {
      className: s,
      style: le(le({
        color: e.color || n.color
      }, n.style), e.style),
      height: h,
      width: h,
      xmlns: "http://www.w3.org/2000/svg"
    }), i && /* @__PURE__ */ V.createElement("title", null, i), e.children);
  };
  return Ie !== void 0 ? /* @__PURE__ */ V.createElement(Ie.Consumer, null, (n) => t(n)) : t(Xe);
}
function Ae(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 112a56 56 0 1 1 56-56 56.06 56.06 0 0 1-56 56z" }, child: [] }, { tag: "path", attr: { d: "m432 112.8-.45.12-.42.13c-1 .28-2 .58-3 .89-18.61 5.46-108.93 30.92-172.56 30.92-59.13 0-141.28-22-167.56-29.47a73.79 73.79 0 0 0-8-2.58c-19-5-32 14.3-32 31.94 0 17.47 15.7 25.79 31.55 31.76v.28l95.22 29.74c9.73 3.73 12.33 7.54 13.6 10.84 4.13 10.59.83 31.56-.34 38.88l-5.8 45-32.19 176.19q-.15.72-.27 1.47l-.23 1.27c-2.32 16.15 9.54 31.82 32 31.82 19.6 0 28.25-13.53 32-31.94s28-157.57 42-157.57 42.84 157.57 42.84 157.57c3.75 18.41 12.4 31.94 32 31.94 22.52 0 34.38-15.74 32-31.94a57.17 57.17 0 0 0-.76-4.06L329 301.27l-5.79-45c-4.19-26.21-.82-34.87.32-36.9a1.09 1.09 0 0 0 .08-.15c1.08-2 6-6.48 17.48-10.79l89.28-31.21a16.9 16.9 0 0 0 1.62-.52c16-6 32-14.3 32-31.93S451 107.81 432 112.8z" }, child: [] }] })(e);
}
function Rt(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "48", d: "M244 400 100 256l144-144M120 256h292" }, child: [] }] })(e);
}
function kt(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "48", d: "m112 244 144-144 144 144M256 120v292" }, child: [] }] })(e);
}
function St(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeMiterlimit: "10", strokeWidth: "32", d: "M216.08 192v143.85a40.08 40.08 0 0 0 80.15 0l.13-188.55a67.94 67.94 0 1 0-135.87 0v189.82a95.51 95.51 0 1 0 191 0V159.74" }, child: [] }] })(e);
}
function Me(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M400 32H112a48 48 0 0 0-48 48v320a47.91 47.91 0 0 0 16 35.74V454a26 26 0 0 0 26 26h28a26 26 0 0 0 26-26v-6h192v6a26 26 0 0 0 26 26h28a26 26 0 0 0 26-26v-18.26A47.91 47.91 0 0 0 448 400V80a48 48 0 0 0-48-48zM147.47 399.82a32 32 0 1 1 28.35-28.35 32 32 0 0 1-28.35 28.35zM236 288H112a16 16 0 0 1-16-16V144a16 16 0 0 1 16-16h124a4 4 0 0 1 4 4v152a4 4 0 0 1-4 4zm20-192H112.46c-8.6 0-16-6.6-16.44-15.19A16 16 0 0 1 112 64h287.54c8.6 0 16 6.6 16.44 15.19A16 16 0 0 1 400 96H256zm20 32h124a16 16 0 0 1 16 16v128a16 16 0 0 1-16 16H276a4 4 0 0 1-4-4V132a4 4 0 0 1 4-4zm60.18 243.47a32 32 0 1 1 28.35 28.35 32 32 0 0 1-28.35-28.35z" }, child: [] }] })(e);
}
function _e(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M391 480c-19.52 0-46.94-7.06-88-30-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21 4.95-2.23 12.45-5.6 21.95-2 6.34 2.38 12 7.25 20.86 16 18.17 17.92 43 57.83 52.16 77.43 6.15 13.21 10.22 21.93 10.23 31.71 0 11.45-5.76 20.28-12.75 29.81-1.31 1.79-2.61 3.5-3.87 5.16-7.61 10-9.28 12.89-8.18 18.05 2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47 1.48-1.13 3-2.3 4.59-3.47 10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18 18 9.08 59.11 33.59 77.14 51.78 8.77 8.84 13.66 14.48 16.05 20.81 3.6 9.53.21 17-2 22-.37.83-.78 1.74-1.21 2.75a176.49 176.49 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.42 67.42 0 0 1 391 480z" }, child: [] }] })(e);
}
function Pt(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" }, child: [] }, { tag: "circle", attr: { cx: "256", cy: "416", r: "48" }, child: [] }, { tag: "circle", attr: { cx: "256", cy: "96", r: "48" }, child: [] }] })(e);
}
function Te(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M340.75 344.49c5.91-20.7 9.82-44.75 11.31-67.84a4.41 4.41 0 0 0-4.46-4.65h-71.06a4.43 4.43 0 0 0-4.47 4.39v55.3a4.44 4.44 0 0 0 4.14 4.38 273.51 273.51 0 0 1 59 11.39 4.45 4.45 0 0 0 5.54-2.97zm-17.17 32.82a260.05 260.05 0 0 0-46.6-9.09 4.42 4.42 0 0 0-4.91 4.29v65.24a4.47 4.47 0 0 0 6.76 3.7c15.9-9.27 29-24.84 40.84-45.43 1.94-3.36 4.89-9.15 6.67-12.69a4.29 4.29 0 0 0-2.76-6.02zm-88.29-8.91a256.85 256.85 0 0 0-46.56 8.82c-2.64.76-3.75 4.4-2.55 6.79 1.79 3.56 4 8.11 5.89 11.51 13 23 26.84 37.5 41.24 45.93a4.47 4.47 0 0 0 6.76-3.7v-65.27a4.16 4.16 0 0 0-4.78-4.08zm.31-96.4h-71.06a4.41 4.41 0 0 0-4.46 4.64c1.48 23.06 5.37 47.16 11.26 67.84a4.46 4.46 0 0 0 5.59 3 272.2 272.2 0 0 1 59-11.36 4.44 4.44 0 0 0 4.15-4.38V276.4a4.43 4.43 0 0 0-4.48-4.4zM277 143.78a235.8 235.8 0 0 0 46.5-9.14 4.3 4.3 0 0 0 2.76-6c-1.79-3.57-4.27-8.68-6.17-12.09-12.29-22-26.14-37.35-41.24-46a4.48 4.48 0 0 0-6.76 3.7v65.23a4.43 4.43 0 0 0 4.91 4.3zm-.46 96.22h71.06a4.39 4.39 0 0 0 4.46-4.58c-1.48-22.77-5.27-47.8-11.16-68.22a4.46 4.46 0 0 0-5.59-2.95c-19 5.74-38.79 10.43-59.09 12a4.4 4.4 0 0 0-4.15 4.32v55.11a4.4 4.4 0 0 0 4.47 4.32zM233.31 70.56c-15.42 8.57-29.17 24.43-41.47 46.37-1.91 3.41-4.19 8.11-6 11.67a4.31 4.31 0 0 0 2.76 6 225.42 225.42 0 0 0 46.54 9.17 4.43 4.43 0 0 0 4.91-4.29V74.26a4.49 4.49 0 0 0-6.74-3.7zm2.61 105.7c-20.3-1.55-40.11-6.24-59.09-12a4.46 4.46 0 0 0-5.59 2.95c-5.89 20.42-9.68 45.45-11.16 68.22a4.39 4.39 0 0 0 4.46 4.58h71.06a4.4 4.4 0 0 0 4.47-4.34v-55.09a4.4 4.4 0 0 0-4.15-4.32z" }, child: [] }, { tag: "path", attr: { d: "M414.39 97.61A224 224 0 1 0 97.61 414.39 224 224 0 1 0 414.39 97.61zM176.6 430.85a219.08 219.08 0 0 1-12.48-19.66c-2-3.69-4.84-9.26-6.73-13.13a7.29 7.29 0 0 0-10.31-3.16c-4.3 2.41-10 5.72-14.13 8.43a147.29 147.29 0 0 1-23.57-22.43 248.83 248.83 0 0 1 30.41-18.36c1.86-1 2.77-2.14 2.18-4.18a374.8 374.8 0 0 1-14.09-82.17 4.36 4.36 0 0 0-4.3-4.17H66.84a2 2 0 0 1-2-1.7A98.28 98.28 0 0 1 64 256a96.27 96.27 0 0 1 .86-14.29 2 2 0 0 1 2-1.7h56.74c2.29 0 4.17-1.32 4.29-3.63a372.71 372.71 0 0 1 14-81.83 4.36 4.36 0 0 0-2.19-5.11 260.63 260.63 0 0 1-29.84-17.9 169.82 169.82 0 0 1 23.14-22.8c4.08 2.68 9.4 5.71 13.66 8.11a7.89 7.89 0 0 0 11-3.42c1.88-3.87 4-8.18 6.06-11.88a221.93 221.93 0 0 1 12.54-19.91A185 185 0 0 1 256 64c28.94 0 55.9 7 80.53 18.46a202.23 202.23 0 0 1 12 19c2.59 4.66 5.34 10.37 7.66 15.32a4.29 4.29 0 0 0 5.92 1.94c5.38-2.91 11.21-6.26 16.34-9.63a171.36 171.36 0 0 1 23.2 23 244.89 244.89 0 0 1-29.06 17.31 4.35 4.35 0 0 0-2.18 5.12 348.68 348.68 0 0 1 13.85 81.4 4.33 4.33 0 0 0 4.3 4.12l56.62-.07a2 2 0 0 1 2 1.7 117.46 117.46 0 0 1 0 28.62 2 2 0 0 1-2 1.72h-56.67a4.35 4.35 0 0 0-4.3 4.17 367.4 367.4 0 0 1-13.87 81.3 4.45 4.45 0 0 0 2.19 5.19c5 2.59 10.57 5.48 15.37 8.42s9.55 6.08 14.13 9.34a172.73 172.73 0 0 1-23 22.93c-2.44-1.61-5.34-3.44-7.84-4.94-1.72-1-4.89-2.77-6.65-3.76-3.82-2.14-7.88-.54-9.79 3.4s-4.83 9.59-6.87 13.25a212.42 212.42 0 0 1-12.35 19.53C310.91 442.37 284.94 448 256 448s-54.77-5.63-79.4-17.15z" }, child: [] }] })(e);
}
function De(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "m478.33 433.6-90-218a22 22 0 0 0-40.67 0l-90 218a22 22 0 1 0 40.67 16.79L316.66 406h102.67l18.33 44.39A22 22 0 0 0 458 464a22 22 0 0 0 20.32-30.4zM334.83 362 368 281.65 401.17 362zm-66.99-19.08a22 22 0 0 0-4.89-30.7c-.2-.15-15-11.13-36.49-34.73 39.65-53.68 62.11-114.75 71.27-143.49H330a22 22 0 0 0 0-44H214V70a22 22 0 0 0-44 0v20H54a22 22 0 0 0 0 44h197.25c-9.52 26.95-27.05 69.5-53.79 108.36-31.41-41.68-43.08-68.65-43.17-68.87a22 22 0 0 0-40.58 17c.58 1.38 14.55 34.23 52.86 83.93.92 1.19 1.83 2.35 2.74 3.51-39.24 44.35-77.74 71.86-93.85 80.74a22 22 0 1 0 21.07 38.63c2.16-1.18 48.6-26.89 101.63-85.59 22.52 24.08 38 35.44 38.93 36.1a22 22 0 0 0 30.75-4.9z" }, child: [] }] })(e);
}
function Oe(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M256 32C167.67 32 96 96.51 96 176c0 128 160 304 160 304s160-176 160-304c0-79.49-71.67-144-160-144zm0 224a64 64 0 1 1 64-64 64.07 64.07 0 0 1-64 64z" }, child: [] }] })(e);
}
function Be(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M424 80H88a56.06 56.06 0 0 0-56 56v240a56.06 56.06 0 0 0 56 56h336a56.06 56.06 0 0 0 56-56V136a56.06 56.06 0 0 0-56-56zm-14.18 92.63-144 112a16 16 0 0 1-19.64 0l-144-112a16 16 0 1 1 19.64-25.26L256 251.73l134.18-104.36a16 16 0 0 1 19.64 25.26z" }, child: [] }] })(e);
}
function ze(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", d: "M336 64H176a16 16 0 0 0-16 16v16h192V80a16 16 0 0 0-16-16z" }, child: [] }, { tag: "path", attr: { d: "M432 96h-48V80a48.05 48.05 0 0 0-48-48H176a48.05 48.05 0 0 0-48 48v16H80a64.07 64.07 0 0 0-64 64v256a64 64 0 0 0 64 64h352a64 64 0 0 0 64-64V160a64.07 64.07 0 0 0-64-64zm-96 208h-64v64a16 16 0 0 1-32 0v-64h-64a16 16 0 0 1 0-32h64v-64a16 16 0 0 1 32 0v64h64a16 16 0 0 1 0 32zm16-208H160V80a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16z" }, child: [] }] })(e);
}
function He(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { fill: "none", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "32", d: "M192 448h128m64-240v32c0 70.4-57.6 128-128 128h0c-70.4 0-128-57.6-128-128v-32m128 160v80" }, child: [] }, { tag: "path", attr: { d: "M256 320a78.83 78.83 0 0 1-56.55-24.1A80.89 80.89 0 0 1 176 239V128a79.69 79.69 0 0 1 80-80c44.86 0 80 35.14 80 80v111c0 44.66-35.89 81-80 81z" }, child: [] }] })(e);
}
function Fe(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M288 256c52.79 0 99.43-49.71 104-110.82 2.27-30.7-7.36-59.33-27.12-80.6C345.33 43.57 318 32 288 32c-30.24 0-57.59 11.5-77 32.38-19.63 21.11-29.2 49.8-27 80.78C188.49 206.28 235.12 256 288 256zm207.38 183.76c-8.44-46.82-34.79-86.15-76.19-113.75C382.42 301.5 335.83 288 288 288s-94.42 13.5-131.19 38c-41.4 27.6-67.75 66.93-76.19 113.75-1.93 10.73.69 21.34 7.19 29.11A30.94 30.94 0 0 0 112 480h352a30.94 30.94 0 0 0 24.21-11.13c6.48-7.77 9.1-18.38 7.17-29.11zM104 288v-40h40a16 16 0 0 0 0-32h-40v-40a16 16 0 0 0-32 0v40H32a16 16 0 0 0 0 32h40v40a16 16 0 0 0 32 0z" }, child: [] }] })(e);
}
function Ue(e) {
  return k({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M464 384.39a32 32 0 0 1-13-2.77 15.77 15.77 0 0 1-2.71-1.54l-82.71-58.22A32 32 0 0 1 352 295.7v-79.4a32 32 0 0 1 13.58-26.16l82.71-58.22a15.77 15.77 0 0 1 2.71-1.54 32 32 0 0 1 45 29.24v192.76a32 32 0 0 1-32 32zM268 400H84a68.07 68.07 0 0 1-68-68V180a68.07 68.07 0 0 1 68-68h184.48A67.6 67.6 0 0 1 336 179.52V332a68.07 68.07 0 0 1-68 68z" }, child: [] }] })(e);
}
var ee, Lt = new Uint8Array(16);
function It() {
  if (!ee && (ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !ee))
    throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
  return ee(Lt);
}
const $t = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
function At(e) {
  return typeof e == "string" && $t.test(e);
}
var E = [];
for (var pe = 0; pe < 256; ++pe)
  E.push((pe + 256).toString(16).substr(1));
function Mt(e) {
  var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, n = (E[e[t + 0]] + E[e[t + 1]] + E[e[t + 2]] + E[e[t + 3]] + "-" + E[e[t + 4]] + E[e[t + 5]] + "-" + E[e[t + 6]] + E[e[t + 7]] + "-" + E[e[t + 8]] + E[e[t + 9]] + "-" + E[e[t + 10]] + E[e[t + 11]] + E[e[t + 12]] + E[e[t + 13]] + E[e[t + 14]] + E[e[t + 15]]).toLowerCase();
  if (!At(n))
    throw TypeError("Stringified UUID is invalid");
  return n;
}
function _t(e, t, n) {
  e = e || {};
  var r = e.random || (e.rng || It)();
  return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Mt(r);
}
const Tt = _t();
function Dt() {
  const e = (/* @__PURE__ */ new Date()).getHours();
  return e < 12 ? "Good Morning" : e < 18 ? "Good Afternoon" : "Good Evening";
}
function xe(e, t = 1) {
  return e.slice().sort(() => 0.5 - Math.random()).slice(0, t);
}
function We(e) {
  const t = e.replace(/\D/g, "");
  return t.length === 10 ? `(${t.slice(0, 3)}) ${t.slice(3, 6)}-${t.slice(6)}` : t.length === 11 && t.startsWith("1") ? `+1 (${t.slice(1, 4)}) ${t.slice(4, 7)}-${t.slice(7)}` : e;
}
function ye(e) {
  return e.replace(/\w\S*/g, (t) => t.charAt(0).toUpperCase() + t.slice(1).toLowerCase());
}
async function Ot(e) {
  const n = await fetch("http://localhost:8000/api/v1/intents-and-entities", {
    method: "POST",
    headers: { "Content-Type": "application/json", accept: "application/json", "x-csid": Tt },
    body: JSON.stringify({ query: e })
  });
  if (!n.ok) throw new Error("Network error");
  return n.json();
}
async function Ve(e) {
  const n = await fetch("http://localhost:8000/api/v1/crediblemind/suggest", {
    method: "POST",
    headers: { "Content-Type": "application/json", accept: "application/json" },
    body: JSON.stringify({ query: e })
  });
  if (!n.ok) throw new Error("Network error");
  return n.json();
}
async function Bt(e) {
  const n = await fetch("http://localhost:8000/api/v1/providers/search", {
    method: "POST",
    headers: { "Content-Type": "application/json", accept: "application/json" },
    body: JSON.stringify(e)
  });
  if (!n.ok) throw new Error("Network error");
  return n.json();
}
/**
 * react-router v7.7.0
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */
function R(e, t) {
  if (e === !1 || e === null || typeof e > "u")
    throw new Error(t);
}
function B(e, t) {
  if (!e) {
    typeof console < "u" && console.warn(t);
    try {
      throw new Error(t);
    } catch {
    }
  }
}
function be({
  pathname: e = "/",
  search: t = "",
  hash: n = ""
}) {
  return t && t !== "?" && (e += t.charAt(0) === "?" ? t : "?" + t), n && n !== "#" && (e += n.charAt(0) === "#" ? n : "#" + n), e;
}
function we(e) {
  let t = {};
  if (e) {
    let n = e.indexOf("#");
    n >= 0 && (t.hash = e.substring(n), e = e.substring(0, n));
    let r = e.indexOf("?");
    r >= 0 && (t.search = e.substring(r), e = e.substring(0, r)), e && (t.pathname = e);
  }
  return t;
}
function Ze(e, t, n = "/") {
  return zt(e, t, n, !1);
}
function zt(e, t, n, r) {
  let a = typeof t == "string" ? we(t) : t, i = W(a.pathname || "/", n);
  if (i == null)
    return null;
  let u = et(e);
  Ht(u);
  let h = null;
  for (let s = 0; h == null && s < u.length; ++s) {
    let c = Qt(i);
    h = Kt(
      u[s],
      c,
      r
    );
  }
  return h;
}
function et(e, t = [], n = [], r = "") {
  let a = (i, u, h) => {
    let s = {
      relativePath: h === void 0 ? i.path || "" : h,
      caseSensitive: i.caseSensitive === !0,
      childrenIndex: u,
      route: i
    };
    s.relativePath.startsWith("/") && (R(
      s.relativePath.startsWith(r),
      `Absolute route path "${s.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`
    ), s.relativePath = s.relativePath.slice(r.length));
    let c = O([r, s.relativePath]), m = n.concat(s);
    i.children && i.children.length > 0 && (R(
      // Our types know better, but runtime JS may not!
      // @ts-expect-error
      i.index !== !0,
      `Index routes must not have child routes. Please remove all child routes from route path "${c}".`
    ), et(i.children, t, m, c)), !(i.path == null && !i.index) && t.push({
      path: c,
      score: Gt(c, i.index),
      routesMeta: m
    });
  };
  return e.forEach((i, u) => {
    if (i.path === "" || !i.path?.includes("?"))
      a(i, u);
    else
      for (let h of tt(i.path))
        a(i, u, h);
  }), t;
}
function tt(e) {
  let t = e.split("/");
  if (t.length === 0) return [];
  let [n, ...r] = t, a = n.endsWith("?"), i = n.replace(/\?$/, "");
  if (r.length === 0)
    return a ? [i, ""] : [i];
  let u = tt(r.join("/")), h = [];
  return h.push(
    ...u.map(
      (s) => s === "" ? i : [i, s].join("/")
    )
  ), a && h.push(...u), h.map(
    (s) => e.startsWith("/") && s === "" ? "/" : s
  );
}
function Ht(e) {
  e.sort(
    (t, n) => t.score !== n.score ? n.score - t.score : Yt(
      t.routesMeta.map((r) => r.childrenIndex),
      n.routesMeta.map((r) => r.childrenIndex)
    )
  );
}
var Ft = /^:[\w-]+$/, Ut = 3, Wt = 2, Vt = 1, qt = 10, Jt = -2, qe = (e) => e === "*";
function Gt(e, t) {
  let n = e.split("/"), r = n.length;
  return n.some(qe) && (r += Jt), t && (r += Wt), n.filter((a) => !qe(a)).reduce(
    (a, i) => a + (Ft.test(i) ? Ut : i === "" ? Vt : qt),
    r
  );
}
function Yt(e, t) {
  return e.length === t.length && e.slice(0, -1).every((r, a) => r === t[a]) ? (
    // If two routes are siblings, we should try to match the earlier sibling
    // first. This allows people to have fine-grained control over the matching
    // behavior by simply putting routes with identical paths in the order they
    // want them tried.
    e[e.length - 1] - t[t.length - 1]
  ) : (
    // Otherwise, it doesn't really make sense to rank non-siblings by index,
    // so they sort equally.
    0
  );
}
function Kt(e, t, n = !1) {
  let { routesMeta: r } = e, a = {}, i = "/", u = [];
  for (let h = 0; h < r.length; ++h) {
    let s = r[h], c = h === r.length - 1, m = i === "/" ? t : t.slice(i.length) || "/", p = oe(
      { path: s.relativePath, caseSensitive: s.caseSensitive, end: c },
      m
    ), g = s.route;
    if (!p && c && n && !r[r.length - 1].route.index && (p = oe(
      {
        path: s.relativePath,
        caseSensitive: s.caseSensitive,
        end: !1
      },
      m
    )), !p)
      return null;
    Object.assign(a, p.params), u.push({
      // TODO: Can this as be avoided?
      params: a,
      pathname: O([i, p.pathname]),
      pathnameBase: nn(
        O([i, p.pathnameBase])
      ),
      route: g
    }), p.pathnameBase !== "/" && (i = O([i, p.pathnameBase]));
  }
  return u;
}
function oe(e, t) {
  typeof e == "string" && (e = { path: e, caseSensitive: !1, end: !0 });
  let [n, r] = Xt(
    e.path,
    e.caseSensitive,
    e.end
  ), a = t.match(n);
  if (!a) return null;
  let i = a[0], u = i.replace(/(.)\/+$/, "$1"), h = a.slice(1);
  return {
    params: r.reduce(
      (c, { paramName: m, isOptional: p }, g) => {
        if (m === "*") {
          let x = h[g] || "";
          u = i.slice(0, i.length - x.length).replace(/(.)\/+$/, "$1");
        }
        const w = h[g];
        return p && !w ? c[m] = void 0 : c[m] = (w || "").replace(/%2F/g, "/"), c;
      },
      {}
    ),
    pathname: i,
    pathnameBase: u,
    pattern: e
  };
}
function Xt(e, t = !1, n = !0) {
  B(
    e === "*" || !e.endsWith("*") || e.endsWith("/*"),
    `Route path "${e}" will be treated as if it were "${e.replace(/\*$/, "/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/, "/*")}".`
  );
  let r = [], a = "^" + e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(
    /\/:([\w-]+)(\?)?/g,
    (u, h, s) => (r.push({ paramName: h, isOptional: s != null }), s ? "/?([^\\/]+)?" : "/([^\\/]+)")
  );
  return e.endsWith("*") ? (r.push({ paramName: "*" }), a += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? a += "\\/*$" : e !== "" && e !== "/" && (a += "(?:(?=\\/|$))"), [new RegExp(a, t ? void 0 : "i"), r];
}
function Qt(e) {
  try {
    return e.split("/").map((t) => decodeURIComponent(t).replace(/\//g, "%2F")).join("/");
  } catch (t) {
    return B(
      !1,
      `The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`
    ), e;
  }
}
function W(e, t) {
  if (t === "/") return e;
  if (!e.toLowerCase().startsWith(t.toLowerCase()))
    return null;
  let n = t.endsWith("/") ? t.length - 1 : t.length, r = e.charAt(n);
  return r && r !== "/" ? null : e.slice(n) || "/";
}
function Zt(e, t = "/") {
  let {
    pathname: n,
    search: r = "",
    hash: a = ""
  } = typeof e == "string" ? we(e) : e;
  return {
    pathname: n ? n.startsWith("/") ? n : en(n, t) : t,
    search: an(r),
    hash: rn(a)
  };
}
function en(e, t) {
  let n = t.replace(/\/+$/, "").split("/");
  return e.split("/").forEach((a) => {
    a === ".." ? n.length > 1 && n.pop() : a !== "." && n.push(a);
  }), n.length > 1 ? n.join("/") : "/";
}
function ve(e, t, n, r) {
  return `Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(
    r
  )}].  Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`;
}
function tn(e) {
  return e.filter(
    (t, n) => n === 0 || t.route.path && t.route.path.length > 0
  );
}
function nt(e) {
  let t = tn(e);
  return t.map(
    (n, r) => r === t.length - 1 ? n.pathname : n.pathnameBase
  );
}
function at(e, t, n, r = !1) {
  let a;
  typeof e == "string" ? a = we(e) : (a = { ...e }, R(
    !a.pathname || !a.pathname.includes("?"),
    ve("?", "pathname", "search", a)
  ), R(
    !a.pathname || !a.pathname.includes("#"),
    ve("#", "pathname", "hash", a)
  ), R(
    !a.search || !a.search.includes("#"),
    ve("#", "search", "hash", a)
  ));
  let i = e === "" || a.pathname === "", u = i ? "/" : a.pathname, h;
  if (u == null)
    h = n;
  else {
    let p = t.length - 1;
    if (!r && u.startsWith("..")) {
      let g = u.split("/");
      for (; g[0] === ".."; )
        g.shift(), p -= 1;
      a.pathname = g.join("/");
    }
    h = p >= 0 ? t[p] : "/";
  }
  let s = Zt(a, h), c = u && u !== "/" && u.endsWith("/"), m = (i || u === ".") && n.endsWith("/");
  return !s.pathname.endsWith("/") && (c || m) && (s.pathname += "/"), s;
}
var O = (e) => e.join("/").replace(/\/\/+/g, "/"), nn = (e) => e.replace(/\/+$/, "").replace(/^\/*/, "/"), an = (e) => !e || e === "?" ? "" : e.startsWith("?") ? e : "?" + e, rn = (e) => !e || e === "#" ? "" : e.startsWith("#") ? e : "#" + e;
function ln(e) {
  return e != null && typeof e.status == "number" && typeof e.statusText == "string" && typeof e.internal == "boolean" && "data" in e;
}
var rt = [
  "POST",
  "PUT",
  "PATCH",
  "DELETE"
];
new Set(
  rt
);
var on = [
  "GET",
  ...rt
];
new Set(on);
var G = d.createContext(null);
G.displayName = "DataRouter";
var se = d.createContext(null);
se.displayName = "DataRouterState";
d.createContext(!1);
var it = d.createContext({
  isTransitioning: !1
});
it.displayName = "ViewTransition";
var sn = d.createContext(
  /* @__PURE__ */ new Map()
);
sn.displayName = "Fetchers";
var cn = d.createContext(null);
cn.displayName = "Await";
var z = d.createContext(
  null
);
z.displayName = "Navigation";
var Ne = d.createContext(
  null
);
Ne.displayName = "Location";
var H = d.createContext({
  outlet: null,
  matches: [],
  isDataRoute: !1
});
H.displayName = "Route";
var je = d.createContext(null);
je.displayName = "RouteError";
function un(e, { relative: t } = {}) {
  R(
    ce(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useHref() may be used only in the context of a <Router> component."
  );
  let { basename: n, navigator: r } = d.useContext(z), { hash: a, pathname: i, search: u } = Z(e, { relative: t }), h = i;
  return n !== "/" && (h = i === "/" ? n : O([n, i])), r.createHref({ pathname: h, search: u, hash: a });
}
function ce() {
  return d.useContext(Ne) != null;
}
function q() {
  return R(
    ce(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useLocation() may be used only in the context of a <Router> component."
  ), d.useContext(Ne).location;
}
var lt = "You should call navigate() in a React.useEffect(), not when your component is first rendered.";
function ot(e) {
  d.useContext(z).static || d.useLayoutEffect(e);
}
function dn() {
  let { isDataRoute: e } = d.useContext(H);
  return e ? Cn() : hn();
}
function hn() {
  R(
    ce(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useNavigate() may be used only in the context of a <Router> component."
  );
  let e = d.useContext(G), { basename: t, navigator: n } = d.useContext(z), { matches: r } = d.useContext(H), { pathname: a } = q(), i = JSON.stringify(nt(r)), u = d.useRef(!1);
  return ot(() => {
    u.current = !0;
  }), d.useCallback(
    (s, c = {}) => {
      if (B(u.current, lt), !u.current) return;
      if (typeof s == "number") {
        n.go(s);
        return;
      }
      let m = at(
        s,
        JSON.parse(i),
        a,
        c.relative === "path"
      );
      e == null && t !== "/" && (m.pathname = m.pathname === "/" ? t : O([t, m.pathname])), (c.replace ? n.replace : n.push)(
        m,
        c.state,
        c
      );
    },
    [
      t,
      n,
      i,
      a,
      e
    ]
  );
}
d.createContext(null);
function Z(e, { relative: t } = {}) {
  let { matches: n } = d.useContext(H), { pathname: r } = q(), a = JSON.stringify(nt(n));
  return d.useMemo(
    () => at(
      e,
      JSON.parse(a),
      r,
      t === "path"
    ),
    [e, a, r, t]
  );
}
function fn(e, t, n, r) {
  R(
    ce(),
    // TODO: This error is probably because they somehow have 2 versions of the
    // router loaded. We can help them understand how to avoid that.
    "useRoutes() may be used only in the context of a <Router> component."
  );
  let { navigator: a } = d.useContext(z), { matches: i } = d.useContext(H), u = i[i.length - 1], h = u ? u.params : {}, s = u ? u.pathname : "/", c = u ? u.pathnameBase : "/", m = u && u.route;
  {
    let v = m && m.path || "";
    st(
      s,
      !m || v.endsWith("*") || v.endsWith("*?"),
      `You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${v}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${v}"> to <Route path="${v === "/" ? "*" : `${v}/*`}">.`
    );
  }
  let p = q(), g;
  g = p;
  let w = g.pathname || "/", x = w;
  if (c !== "/") {
    let v = c.replace(/^\//, "").split("/");
    x = "/" + w.replace(/^\//, "").split("/").slice(v.length).join("/");
  }
  let y = Ze(e, { pathname: x });
  return B(
    m || y != null,
    `No routes matched location "${g.pathname}${g.search}${g.hash}" `
  ), B(
    y == null || y[y.length - 1].route.element !== void 0 || y[y.length - 1].route.Component !== void 0 || y[y.length - 1].route.lazy !== void 0,
    `Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`
  ), xn(
    y && y.map(
      (v) => Object.assign({}, v, {
        params: Object.assign({}, h, v.params),
        pathname: O([
          c,
          // Re-encode pathnames that were decoded inside matchRoutes
          a.encodeLocation ? a.encodeLocation(v.pathname).pathname : v.pathname
        ]),
        pathnameBase: v.pathnameBase === "/" ? c : O([
          c,
          // Re-encode pathnames that were decoded inside matchRoutes
          a.encodeLocation ? a.encodeLocation(v.pathnameBase).pathname : v.pathnameBase
        ])
      })
    ),
    i,
    n,
    r
  );
}
function mn() {
  let e = jn(), t = ln(e) ? `${e.status} ${e.statusText}` : e instanceof Error ? e.message : JSON.stringify(e), n = e instanceof Error ? e.stack : null, r = "rgba(200,200,200, 0.5)", a = { padding: "0.5rem", backgroundColor: r }, i = { padding: "2px 4px", backgroundColor: r }, u = null;
  return console.error(
    "Error handled by React Router default ErrorBoundary:",
    e
  ), u = /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("p", null, "💿 Hey developer 👋"), /* @__PURE__ */ d.createElement("p", null, "You can provide a way better UX than this when your app throws errors by providing your own ", /* @__PURE__ */ d.createElement("code", { style: i }, "ErrorBoundary"), " or", " ", /* @__PURE__ */ d.createElement("code", { style: i }, "errorElement"), " prop on your route.")), /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("h2", null, "Unexpected Application Error!"), /* @__PURE__ */ d.createElement("h3", { style: { fontStyle: "italic" } }, t), n ? /* @__PURE__ */ d.createElement("pre", { style: a }, n) : null, u);
}
var pn = /* @__PURE__ */ d.createElement(mn, null), vn = class extends d.Component {
  constructor(e) {
    super(e), this.state = {
      location: e.location,
      revalidation: e.revalidation,
      error: e.error
    };
  }
  static getDerivedStateFromError(e) {
    return { error: e };
  }
  static getDerivedStateFromProps(e, t) {
    return t.location !== e.location || t.revalidation !== "idle" && e.revalidation === "idle" ? {
      error: e.error,
      location: e.location,
      revalidation: e.revalidation
    } : {
      error: e.error !== void 0 ? e.error : t.error,
      location: t.location,
      revalidation: e.revalidation || t.revalidation
    };
  }
  componentDidCatch(e, t) {
    console.error(
      "React Router caught the following error during render",
      e,
      t
    );
  }
  render() {
    return this.state.error !== void 0 ? /* @__PURE__ */ d.createElement(H.Provider, { value: this.props.routeContext }, /* @__PURE__ */ d.createElement(
      je.Provider,
      {
        value: this.state.error,
        children: this.props.component
      }
    )) : this.props.children;
  }
};
function gn({ routeContext: e, match: t, children: n }) {
  let r = d.useContext(G);
  return r && r.static && r.staticContext && (t.route.errorElement || t.route.ErrorBoundary) && (r.staticContext._deepestRenderedBoundaryId = t.route.id), /* @__PURE__ */ d.createElement(H.Provider, { value: e }, n);
}
function xn(e, t = [], n = null, r = null) {
  if (e == null) {
    if (!n)
      return null;
    if (n.errors)
      e = n.matches;
    else if (t.length === 0 && !n.initialized && n.matches.length > 0)
      e = n.matches;
    else
      return null;
  }
  let a = e, i = n?.errors;
  if (i != null) {
    let s = a.findIndex(
      (c) => c.route.id && i?.[c.route.id] !== void 0
    );
    R(
      s >= 0,
      `Could not find a matching route for errors on route IDs: ${Object.keys(
        i
      ).join(",")}`
    ), a = a.slice(
      0,
      Math.min(a.length, s + 1)
    );
  }
  let u = !1, h = -1;
  if (n)
    for (let s = 0; s < a.length; s++) {
      let c = a[s];
      if ((c.route.HydrateFallback || c.route.hydrateFallbackElement) && (h = s), c.route.id) {
        let { loaderData: m, errors: p } = n, g = c.route.loader && !m.hasOwnProperty(c.route.id) && (!p || p[c.route.id] === void 0);
        if (c.route.lazy || g) {
          u = !0, h >= 0 ? a = a.slice(0, h + 1) : a = [a[0]];
          break;
        }
      }
    }
  return a.reduceRight((s, c, m) => {
    let p, g = !1, w = null, x = null;
    n && (p = i && c.route.id ? i[c.route.id] : void 0, w = c.route.errorElement || pn, u && (h < 0 && m === 0 ? (st(
      "route-fallback",
      !1,
      "No `HydrateFallback` element provided to render during initial hydration"
    ), g = !0, x = null) : h === m && (g = !0, x = c.route.hydrateFallbackElement || null)));
    let y = t.concat(a.slice(0, m + 1)), N = () => {
      let v;
      return p ? v = w : g ? v = x : c.route.Component ? v = /* @__PURE__ */ d.createElement(c.route.Component, null) : c.route.element ? v = c.route.element : v = s, /* @__PURE__ */ d.createElement(
        gn,
        {
          match: c,
          routeContext: {
            outlet: s,
            matches: y,
            isDataRoute: n != null
          },
          children: v
        }
      );
    };
    return n && (c.route.ErrorBoundary || c.route.errorElement || m === 0) ? /* @__PURE__ */ d.createElement(
      vn,
      {
        location: n.location,
        revalidation: n.revalidation,
        component: w,
        error: p,
        children: N(),
        routeContext: { outlet: null, matches: y, isDataRoute: !0 }
      }
    ) : N();
  }, null);
}
function Ce(e) {
  return `${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`;
}
function yn(e) {
  let t = d.useContext(G);
  return R(t, Ce(e)), t;
}
function bn(e) {
  let t = d.useContext(se);
  return R(t, Ce(e)), t;
}
function wn(e) {
  let t = d.useContext(H);
  return R(t, Ce(e)), t;
}
function Ee(e) {
  let t = wn(e), n = t.matches[t.matches.length - 1];
  return R(
    n.route.id,
    `${e} can only be used on routes that contain a unique "id"`
  ), n.route.id;
}
function Nn() {
  return Ee(
    "useRouteId"
    /* UseRouteId */
  );
}
function jn() {
  let e = d.useContext(je), t = bn(
    "useRouteError"
    /* UseRouteError */
  ), n = Ee(
    "useRouteError"
    /* UseRouteError */
  );
  return e !== void 0 ? e : t.errors?.[n];
}
function Cn() {
  let { router: e } = yn(
    "useNavigate"
    /* UseNavigateStable */
  ), t = Ee(
    "useNavigate"
    /* UseNavigateStable */
  ), n = d.useRef(!1);
  return ot(() => {
    n.current = !0;
  }), d.useCallback(
    async (a, i = {}) => {
      B(n.current, lt), n.current && (typeof a == "number" ? e.navigate(a) : await e.navigate(a, { fromRouteId: t, ...i }));
    },
    [e, t]
  );
}
var Je = {};
function st(e, t, n) {
  !t && !Je[e] && (Je[e] = !0, B(!1, n));
}
d.memo(En);
function En({
  routes: e,
  future: t,
  state: n
}) {
  return fn(e, void 0, n, t);
}
var ae = "get", re = "application/x-www-form-urlencoded";
function ue(e) {
  return e != null && typeof e.tagName == "string";
}
function Rn(e) {
  return ue(e) && e.tagName.toLowerCase() === "button";
}
function kn(e) {
  return ue(e) && e.tagName.toLowerCase() === "form";
}
function Sn(e) {
  return ue(e) && e.tagName.toLowerCase() === "input";
}
function Pn(e) {
  return !!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey);
}
function Ln(e, t) {
  return e.button === 0 && // Ignore everything but left clicks
  (!t || t === "_self") && // Let browser handle "target=_blank" etc.
  !Pn(e);
}
var te = null;
function In() {
  if (te === null)
    try {
      new FormData(
        document.createElement("form"),
        // @ts-expect-error if FormData supports the submitter parameter, this will throw
        0
      ), te = !1;
    } catch {
      te = !0;
    }
  return te;
}
var $n = /* @__PURE__ */ new Set([
  "application/x-www-form-urlencoded",
  "multipart/form-data",
  "text/plain"
]);
function ge(e) {
  return e != null && !$n.has(e) ? (B(
    !1,
    `"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${re}"`
  ), null) : e;
}
function An(e, t) {
  let n, r, a, i, u;
  if (kn(e)) {
    let h = e.getAttribute("action");
    r = h ? W(h, t) : null, n = e.getAttribute("method") || ae, a = ge(e.getAttribute("enctype")) || re, i = new FormData(e);
  } else if (Rn(e) || Sn(e) && (e.type === "submit" || e.type === "image")) {
    let h = e.form;
    if (h == null)
      throw new Error(
        'Cannot submit a <button> or <input type="submit"> without a <form>'
      );
    let s = e.getAttribute("formaction") || h.getAttribute("action");
    if (r = s ? W(s, t) : null, n = e.getAttribute("formmethod") || h.getAttribute("method") || ae, a = ge(e.getAttribute("formenctype")) || ge(h.getAttribute("enctype")) || re, i = new FormData(h, e), !In()) {
      let { name: c, type: m, value: p } = e;
      if (m === "image") {
        let g = c ? `${c}.` : "";
        i.append(`${g}x`, "0"), i.append(`${g}y`, "0");
      } else c && i.append(c, p);
    }
  } else {
    if (ue(e))
      throw new Error(
        'Cannot submit element that is not <form>, <button>, or <input type="submit|image">'
      );
    n = ae, r = null, a = re, u = e;
  }
  return i && a === "text/plain" && (u = i, i = void 0), { action: r, method: n.toLowerCase(), encType: a, formData: i, body: u };
}
Object.getOwnPropertyNames(Object.prototype).sort().join("\0");
function Re(e, t) {
  if (e === !1 || e === null || typeof e > "u")
    throw new Error(t);
}
function Mn(e, t, n) {
  let r = typeof e == "string" ? new URL(
    e,
    // This can be called during the SSR flow via PrefetchPageLinksImpl so
    // don't assume window is available
    typeof window > "u" ? "server://singlefetch/" : window.location.origin
  ) : e;
  return r.pathname === "/" ? r.pathname = `_root.${n}` : t && W(r.pathname, t) === "/" ? r.pathname = `${t.replace(/\/$/, "")}/_root.${n}` : r.pathname = `${r.pathname.replace(/\/$/, "")}.${n}`, r;
}
async function _n(e, t) {
  if (e.id in t)
    return t[e.id];
  try {
    let n = await import(
      /* @vite-ignore */
      /* webpackIgnore: true */
      e.module
    );
    return t[e.id] = n, n;
  } catch (n) {
    return console.error(
      `Error loading route module \`${e.module}\`, reloading page...`
    ), console.error(n), window.__reactRouterContext && window.__reactRouterContext.isSpaMode, window.location.reload(), new Promise(() => {
    });
  }
}
function Tn(e) {
  return e == null ? !1 : e.href == null ? e.rel === "preload" && typeof e.imageSrcSet == "string" && typeof e.imageSizes == "string" : typeof e.rel == "string" && typeof e.href == "string";
}
async function Dn(e, t, n) {
  let r = await Promise.all(
    e.map(async (a) => {
      let i = t.routes[a.route.id];
      if (i) {
        let u = await _n(i, n);
        return u.links ? u.links() : [];
      }
      return [];
    })
  );
  return Hn(
    r.flat(1).filter(Tn).filter((a) => a.rel === "stylesheet" || a.rel === "preload").map(
      (a) => a.rel === "stylesheet" ? { ...a, rel: "prefetch", as: "style" } : { ...a, rel: "prefetch" }
    )
  );
}
function Ge(e, t, n, r, a, i) {
  let u = (s, c) => n[c] ? s.route.id !== n[c].route.id : !0, h = (s, c) => (
    // param change, /users/123 -> /users/456
    n[c].pathname !== s.pathname || // splat param changed, which is not present in match.path
    // e.g. /files/images/avatar.jpg -> files/finances.xls
    n[c].route.path?.endsWith("*") && n[c].params["*"] !== s.params["*"]
  );
  return i === "assets" ? t.filter(
    (s, c) => u(s, c) || h(s, c)
  ) : i === "data" ? t.filter((s, c) => {
    let m = r.routes[s.route.id];
    if (!m || !m.hasLoader)
      return !1;
    if (u(s, c) || h(s, c))
      return !0;
    if (s.route.shouldRevalidate) {
      let p = s.route.shouldRevalidate({
        currentUrl: new URL(
          a.pathname + a.search + a.hash,
          window.origin
        ),
        currentParams: n[0]?.params || {},
        nextUrl: new URL(e, window.origin),
        nextParams: s.params,
        defaultShouldRevalidate: !0
      });
      if (typeof p == "boolean")
        return p;
    }
    return !0;
  }) : [];
}
function On(e, t, { includeHydrateFallback: n } = {}) {
  return Bn(
    e.map((r) => {
      let a = t.routes[r.route.id];
      if (!a) return [];
      let i = [a.module];
      return a.clientActionModule && (i = i.concat(a.clientActionModule)), a.clientLoaderModule && (i = i.concat(a.clientLoaderModule)), n && a.hydrateFallbackModule && (i = i.concat(a.hydrateFallbackModule)), a.imports && (i = i.concat(a.imports)), i;
    }).flat(1)
  );
}
function Bn(e) {
  return [...new Set(e)];
}
function zn(e) {
  let t = {}, n = Object.keys(e).sort();
  for (let r of n)
    t[r] = e[r];
  return t;
}
function Hn(e, t) {
  let n = /* @__PURE__ */ new Set();
  return new Set(t), e.reduce((r, a) => {
    let i = JSON.stringify(zn(a));
    return n.has(i) || (n.add(i), r.push({ key: i, link: a })), r;
  }, []);
}
function ct() {
  let e = d.useContext(G);
  return Re(
    e,
    "You must render this element inside a <DataRouterContext.Provider> element"
  ), e;
}
function Fn() {
  let e = d.useContext(se);
  return Re(
    e,
    "You must render this element inside a <DataRouterStateContext.Provider> element"
  ), e;
}
var ke = d.createContext(void 0);
ke.displayName = "FrameworkContext";
function ut() {
  let e = d.useContext(ke);
  return Re(
    e,
    "You must render this element inside a <HydratedRouter> element"
  ), e;
}
function Un(e, t) {
  let n = d.useContext(ke), [r, a] = d.useState(!1), [i, u] = d.useState(!1), { onFocus: h, onBlur: s, onMouseEnter: c, onMouseLeave: m, onTouchStart: p } = t, g = d.useRef(null);
  d.useEffect(() => {
    if (e === "render" && u(!0), e === "viewport") {
      let y = (v) => {
        v.forEach((j) => {
          u(j.isIntersecting);
        });
      }, N = new IntersectionObserver(y, { threshold: 0.5 });
      return g.current && N.observe(g.current), () => {
        N.disconnect();
      };
    }
  }, [e]), d.useEffect(() => {
    if (r) {
      let y = setTimeout(() => {
        u(!0);
      }, 100);
      return () => {
        clearTimeout(y);
      };
    }
  }, [r]);
  let w = () => {
    a(!0);
  }, x = () => {
    a(!1), u(!1);
  };
  return n ? e !== "intent" ? [i, g, {}] : [
    i,
    g,
    {
      onFocus: X(h, w),
      onBlur: X(s, x),
      onMouseEnter: X(c, w),
      onMouseLeave: X(m, x),
      onTouchStart: X(p, w)
    }
  ] : [!1, g, {}];
}
function X(e, t) {
  return (n) => {
    e && e(n), n.defaultPrevented || t(n);
  };
}
function Wn({
  page: e,
  ...t
}) {
  let { router: n } = ct(), r = d.useMemo(
    () => Ze(n.routes, e, n.basename),
    [n.routes, e, n.basename]
  );
  return r ? /* @__PURE__ */ d.createElement(qn, { page: e, matches: r, ...t }) : null;
}
function Vn(e) {
  let { manifest: t, routeModules: n } = ut(), [r, a] = d.useState([]);
  return d.useEffect(() => {
    let i = !1;
    return Dn(e, t, n).then(
      (u) => {
        i || a(u);
      }
    ), () => {
      i = !0;
    };
  }, [e, t, n]), r;
}
function qn({
  page: e,
  matches: t,
  ...n
}) {
  let r = q(), { manifest: a, routeModules: i } = ut(), { basename: u } = ct(), { loaderData: h, matches: s } = Fn(), c = d.useMemo(
    () => Ge(
      e,
      t,
      s,
      a,
      r,
      "data"
    ),
    [e, t, s, a, r]
  ), m = d.useMemo(
    () => Ge(
      e,
      t,
      s,
      a,
      r,
      "assets"
    ),
    [e, t, s, a, r]
  ), p = d.useMemo(() => {
    if (e === r.pathname + r.search + r.hash)
      return [];
    let x = /* @__PURE__ */ new Set(), y = !1;
    if (t.forEach((v) => {
      let j = a.routes[v.route.id];
      !j || !j.hasLoader || (!c.some((C) => C.route.id === v.route.id) && v.route.id in h && i[v.route.id]?.shouldRevalidate || j.hasClientLoader ? y = !0 : x.add(v.route.id));
    }), x.size === 0)
      return [];
    let N = Mn(e, u, "data");
    return y && x.size > 0 && N.searchParams.set(
      "_routes",
      t.filter((v) => x.has(v.route.id)).map((v) => v.route.id).join(",")
    ), [N.pathname + N.search];
  }, [
    u,
    h,
    r,
    a,
    c,
    t,
    e,
    i
  ]), g = d.useMemo(
    () => On(m, a),
    [m, a]
  ), w = Vn(m);
  return /* @__PURE__ */ d.createElement(d.Fragment, null, p.map((x) => /* @__PURE__ */ d.createElement("link", { key: x, rel: "prefetch", as: "fetch", href: x, ...n })), g.map((x) => /* @__PURE__ */ d.createElement("link", { key: x, rel: "modulepreload", href: x, ...n })), w.map(({ key: x, link: y }) => (
    // these don't spread `linkProps` because they are full link descriptors
    // already with their own props
    /* @__PURE__ */ d.createElement("link", { key: x, ...y })
  )));
}
function Jn(...e) {
  return (t) => {
    e.forEach((n) => {
      typeof n == "function" ? n(t) : n != null && (n.current = t);
    });
  };
}
var dt = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
try {
  dt && (window.__reactRouterVersion = // @ts-expect-error
  "7.7.0");
} catch {
}
var ht = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i, Q = d.forwardRef(
  function({
    onClick: t,
    discover: n = "render",
    prefetch: r = "none",
    relative: a,
    reloadDocument: i,
    replace: u,
    state: h,
    target: s,
    to: c,
    preventScrollReset: m,
    viewTransition: p,
    ...g
  }, w) {
    let { basename: x } = d.useContext(z), y = typeof c == "string" && ht.test(c), N, v = !1;
    if (typeof c == "string" && y && (N = c, dt))
      try {
        let S = new URL(window.location.href), M = c.startsWith("//") ? new URL(S.protocol + c) : new URL(c), J = W(M.pathname, x);
        M.origin === S.origin && J != null ? c = J + M.search + M.hash : v = !0;
      } catch {
        B(
          !1,
          `<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
        );
      }
    let j = un(c, { relative: a }), [C, T, L] = Un(
      r,
      g
    ), F = Xn(c, {
      replace: u,
      state: h,
      target: s,
      preventScrollReset: m,
      relative: a,
      viewTransition: p
    });
    function A(S) {
      t && t(S), S.defaultPrevented || F(S);
    }
    let D = (
      // eslint-disable-next-line jsx-a11y/anchor-has-content
      /* @__PURE__ */ d.createElement(
        "a",
        {
          ...g,
          ...L,
          href: N || j,
          onClick: v || i ? t : A,
          ref: Jn(w, T),
          target: s,
          "data-discover": !y && n === "render" ? "true" : void 0
        }
      )
    );
    return C && !y ? /* @__PURE__ */ d.createElement(d.Fragment, null, D, /* @__PURE__ */ d.createElement(Wn, { page: j })) : D;
  }
);
Q.displayName = "Link";
var Gn = d.forwardRef(
  function({
    "aria-current": t = "page",
    caseSensitive: n = !1,
    className: r = "",
    end: a = !1,
    style: i,
    to: u,
    viewTransition: h,
    children: s,
    ...c
  }, m) {
    let p = Z(u, { relative: c.relative }), g = q(), w = d.useContext(se), { navigator: x, basename: y } = d.useContext(z), N = w != null && // Conditional usage is OK here because the usage of a data router is static
    // eslint-disable-next-line react-hooks/rules-of-hooks
    na(p) && h === !0, v = x.encodeLocation ? x.encodeLocation(p).pathname : p.pathname, j = g.pathname, C = w && w.navigation && w.navigation.location ? w.navigation.location.pathname : null;
    n || (j = j.toLowerCase(), C = C ? C.toLowerCase() : null, v = v.toLowerCase()), C && y && (C = W(C, y) || C);
    const T = v !== "/" && v.endsWith("/") ? v.length - 1 : v.length;
    let L = j === v || !a && j.startsWith(v) && j.charAt(T) === "/", F = C != null && (C === v || !a && C.startsWith(v) && C.charAt(v.length) === "/"), A = {
      isActive: L,
      isPending: F,
      isTransitioning: N
    }, D = L ? t : void 0, S;
    typeof r == "function" ? S = r(A) : S = [
      r,
      L ? "active" : null,
      F ? "pending" : null,
      N ? "transitioning" : null
    ].filter(Boolean).join(" ");
    let M = typeof i == "function" ? i(A) : i;
    return /* @__PURE__ */ d.createElement(
      Q,
      {
        ...c,
        "aria-current": D,
        className: S,
        ref: m,
        style: M,
        to: u,
        viewTransition: h
      },
      typeof s == "function" ? s(A) : s
    );
  }
);
Gn.displayName = "NavLink";
var Yn = d.forwardRef(
  ({
    discover: e = "render",
    fetcherKey: t,
    navigate: n,
    reloadDocument: r,
    replace: a,
    state: i,
    method: u = ae,
    action: h,
    onSubmit: s,
    relative: c,
    preventScrollReset: m,
    viewTransition: p,
    ...g
  }, w) => {
    let x = ea(), y = ta(h, { relative: c }), N = u.toLowerCase() === "get" ? "get" : "post", v = typeof h == "string" && ht.test(h), j = (C) => {
      if (s && s(C), C.defaultPrevented) return;
      C.preventDefault();
      let T = C.nativeEvent.submitter, L = T?.getAttribute("formmethod") || u;
      x(T || C.currentTarget, {
        fetcherKey: t,
        method: L,
        navigate: n,
        replace: a,
        state: i,
        relative: c,
        preventScrollReset: m,
        viewTransition: p
      });
    };
    return /* @__PURE__ */ d.createElement(
      "form",
      {
        ref: w,
        method: N,
        action: y,
        onSubmit: r ? s : j,
        ...g,
        "data-discover": !v && e === "render" ? "true" : void 0
      }
    );
  }
);
Yn.displayName = "Form";
function Kn(e) {
  return `${e} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`;
}
function ft(e) {
  let t = d.useContext(G);
  return R(t, Kn(e)), t;
}
function Xn(e, {
  target: t,
  replace: n,
  state: r,
  preventScrollReset: a,
  relative: i,
  viewTransition: u
} = {}) {
  let h = dn(), s = q(), c = Z(e, { relative: i });
  return d.useCallback(
    (m) => {
      if (Ln(m, t)) {
        m.preventDefault();
        let p = n !== void 0 ? n : be(s) === be(c);
        h(e, {
          replace: p,
          state: r,
          preventScrollReset: a,
          relative: i,
          viewTransition: u
        });
      }
    },
    [
      s,
      h,
      c,
      n,
      r,
      t,
      e,
      a,
      i,
      u
    ]
  );
}
var Qn = 0, Zn = () => `__${String(++Qn)}__`;
function ea() {
  let { router: e } = ft(
    "useSubmit"
    /* UseSubmit */
  ), { basename: t } = d.useContext(z), n = Nn();
  return d.useCallback(
    async (r, a = {}) => {
      let { action: i, method: u, encType: h, formData: s, body: c } = An(
        r,
        t
      );
      if (a.navigate === !1) {
        let m = a.fetcherKey || Zn();
        await e.fetch(m, n, a.action || i, {
          preventScrollReset: a.preventScrollReset,
          formData: s,
          body: c,
          formMethod: a.method || u,
          formEncType: a.encType || h,
          flushSync: a.flushSync
        });
      } else
        await e.navigate(a.action || i, {
          preventScrollReset: a.preventScrollReset,
          formData: s,
          body: c,
          formMethod: a.method || u,
          formEncType: a.encType || h,
          replace: a.replace,
          state: a.state,
          fromRouteId: n,
          flushSync: a.flushSync,
          viewTransition: a.viewTransition
        });
    },
    [e, t, n]
  );
}
function ta(e, { relative: t } = {}) {
  let { basename: n } = d.useContext(z), r = d.useContext(H);
  R(r, "useFormAction must be used inside a RouteContext");
  let [a] = r.matches.slice(-1), i = { ...Z(e || ".", { relative: t }) }, u = q();
  if (e == null) {
    i.search = u.search;
    let h = new URLSearchParams(i.search), s = h.getAll("index");
    if (s.some((m) => m === "")) {
      h.delete("index"), s.filter((p) => p).forEach((p) => h.append("index", p));
      let m = h.toString();
      i.search = m ? `?${m}` : "";
    }
  }
  return (!e || e === ".") && a.route.index && (i.search = i.search ? i.search.replace(/^\?/, "?index&") : "?index"), n !== "/" && (i.pathname = i.pathname === "/" ? n : O([n, i.pathname])), be(i);
}
function na(e, t = {}) {
  let n = d.useContext(it);
  R(
    n != null,
    "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?"
  );
  let { basename: r } = ft(
    "useViewTransitionState"
    /* useViewTransitionState */
  ), a = Z(e, { relative: t.relative });
  if (!n.isTransitioning)
    return !1;
  let i = W(n.currentLocation.pathname, r) || n.currentLocation.pathname, u = W(n.nextLocation.pathname, r) || n.nextLocation.pathname;
  return oe(a.pathname, u) != null || oe(a.pathname, i) != null;
}
const Ye = "var(--carelon-purple)", aa = ({ showGreeting: e, onStartChat: t, chipToSend: n, onChipSent: r, chips: a = [], selectedChipIdx: i = null, handleChipClick: u }) => {
  const [h, s] = P([]), [c, m] = P(""), [p, g] = P(!1), [w, x] = P(null), [y, N] = P(!1), [v, j] = P(!1), [C, T] = P(!1), [L, F] = P([]), [A, D] = P(null), S = 30, M = Ke(null);
  ne(() => {
    M.current?.scrollIntoView({ behavior: "smooth" });
  }, [h, p]), ne(() => {
    n && !C && (J(n), T(!0), e && t(), typeof r == "function" && r());
  }, [n]);
  const J = async (b) => {
    if (!(b || c.trim()) || p) return;
    e && t(), T(!0);
    const o = b || c, I = {
      id: Date.now() + "-user",
      sender: "user",
      text: o
    };
    s((f) => [...f, I]), m(""), g(!0), x(null);
    try {
      const f = await Ot(I.text);
      let _ = f.smalltalk || "Sorry, I could not understand. Say it again?";
      const Y = f.hybridtalk || "Sorry, I could not understand. Say it again?";
      if (f.intent !== "provider_search_intent" && s((U) => [
        ...U,
        { id: Date.now() + "-bot-smalltalk", sender: "bot", text: _ }
      ]), f.intent === "health_content_intent" && f.slots.content_query) {
        const U = await Ve(f.slots.content_query);
        s((de) => [...de, { id: Date.now() + "-bot-richinfo", sender: "bot", text: "", crediblemind: U.crediblemind }]);
      }
      if (f.intent === "provider_search_intent") {
        const U = await Ve(f.query);
        U?.crediblemind?.length && (_ = Y), s((he) => [...he, { id: Date.now() + "-bot-smalltalk-hybrid", sender: "bot", text: _ }]);
        const de = await Bt({
          gender: f.slots.gender,
          specialty: f.slots.specialty,
          provider_type: f.slots.provider_type,
          location: f.slots.location,
          language: f.slots.language
        });
        s((he) => [...he, { id: Date.now() + "-bot-providersearch-richinfo", sender: "bot", text: _, crediblemind: U.crediblemind, providers: de.providers }]);
      }
      const Se = f.followup_prompt;
      Se && s((U) => [...U, { id: Date.now() + "-bot-followup", sender: "bot", text: Se }]);
    } catch {
      x("Sorry, there was a problem connecting. Please try again."), s((_) => [
        ..._,
        { id: Date.now() + "-bot-error", sender: "bot", text: "Sorry, there was an error." }
      ]);
    } finally {
      g(!1);
    }
  };
  ne(() => {
    if (!e && h.length > L.length) {
      const b = h[L.length];
      if (b.sender === "bot") {
        let o = "", I = 0;
        const f = () => {
          I < b.text.length && (o += b.text[I], F((_) => {
            const Y = [..._];
            return Y[Y.length - 1] = { ...b, text: o }, Y;
          }), I++, setTimeout(f, S));
        };
        F((_) => [..._, { ...b, text: "" }]), setTimeout(f, S);
      } else
        F((o) => [...o, b]);
    }
    M.current?.scrollIntoView({ behavior: "smooth" });
  }, [h, e, L.length]);
  const mt = fe(() => "John!", []), pt = fe(() => xe(["Hi", "Hey", "Hello", Dt()]), []), vt = fe(() => xe(["How can I help you today?", "What can I do for you today?"]), []);
  return /* @__PURE__ */ l.jsxs("div", { className: "chat-body-center", children: [
    e && /* @__PURE__ */ l.jsxs("div", { className: "greeting-chips-block", children: [
      /* @__PURE__ */ l.jsxs("div", { className: "central-greeting", children: [
        /* @__PURE__ */ l.jsxs("div", { className: "greeting-main", children: [
          pt,
          ",",
          /* @__PURE__ */ l.jsx("span", { className: "greeting-name", children: mt })
        ] }),
        /* @__PURE__ */ l.jsx("div", { className: "greeting-sub", children: vt })
      ] }),
      /* @__PURE__ */ l.jsx("div", { className: "suggestion-chips-wrap main-chips", children: /* @__PURE__ */ l.jsx("div", { className: "suggestion-chips", children: a.map((b, o) => /* @__PURE__ */ l.jsx(
        "button",
        {
          className: `suggestion-chip${i === o ? " selected" : ""}`,
          tabIndex: 0,
          onClick: () => u && u(o),
          children: b
        },
        b
      )) }) })
    ] }),
    /* @__PURE__ */ l.jsx("div", { className: "chat-outer", children: /* @__PURE__ */ l.jsxs("div", { className: "chat-container", children: [
      !e && !A && /* @__PURE__ */ l.jsxs("div", { className: "chat-messages", children: [
        L.map((b) => /* @__PURE__ */ l.jsx("div", { className: b.sender === "user" ? "chat-user-msg" : "chat-bot-msg", children: b.crediblemind && Array.isArray(b.crediblemind) && b.crediblemind.length > 0 && b.providers && Array.isArray(b.providers) && b.providers.length > 0 ? /* @__PURE__ */ l.jsxs("div", { className: "crediblemind-and-provider-cards", children: [
          /* @__PURE__ */ l.jsx("div", { className: "crediblemind-cards", children: b.crediblemind.map((o) => /* @__PURE__ */ l.jsxs(
            "a",
            {
              href: o.content_url,
              className: "crediblemind-card",
              children: [
                /* @__PURE__ */ l.jsx("div", { className: "crediblemind-title", children: o.title }),
                /* @__PURE__ */ l.jsx("div", { className: "crediblemind-type", children: o.content_type })
              ]
            },
            o.entry_id
          )) }),
          /* @__PURE__ */ l.jsx("div", { className: "provider-cards", children: b.providers.map((o) => {
            const I = `${o.name.firstName?.[0] || ""}${o.name.lastName?.[0] || ""}`.toUpperCase();
            return /* @__PURE__ */ l.jsxs("div", { className: "provider-card", children: [
              /* @__PURE__ */ l.jsxs("div", { className: "provider-header-horizontal", children: [
                /* @__PURE__ */ l.jsx("span", { className: "provider-logo-circle fixed-width-span", children: I }),
                /* @__PURE__ */ l.jsxs("span", { className: "provider-name", children: [
                  o.name.firstName,
                  " ",
                  o.name.lastName
                ] }),
                /* @__PURE__ */ l.jsx("span", { className: "provider-title right-align", children: o.title })
              ] }),
              /* @__PURE__ */ l.jsxs("div", { className: "provider-details", children: [
                /* @__PURE__ */ l.jsxs("div", { className: "provider-address", children: [
                  /* @__PURE__ */ l.jsxs("span", { className: "provider-icon address-icon", children: [
                    /* @__PURE__ */ l.jsx(Oe, {}),
                    " "
                  ] }),
                  /* @__PURE__ */ l.jsxs("span", { className: "provider-link", onClick: () => {
                    const f = `${o.contact.address.addr1}, ${o.contact.address.city}, ${o.contact.address.state} ${o.contact.address.zip}`;
                    window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(f)}`, "_blank");
                  }, children: [
                    o.contact.address.addr1,
                    ", ",
                    o.contact.address.city,
                    ", ",
                    o.contact.address.state,
                    " ",
                    o.contact.address.zip
                  ] })
                ] }),
                /* @__PURE__ */ l.jsxs("div", { className: "provider-contact", children: [
                  o.contact.phone && o.contact.phone !== "Not Available" && /* @__PURE__ */ l.jsxs("span", { children: [
                    /* @__PURE__ */ l.jsx(_e, { className: "provider-icon" }),
                    /* @__PURE__ */ l.jsx(
                      "a",
                      {
                        href: `tel:${o.contact.phone}`,
                        target: "_blank",
                        rel: "noopener noreferrer",
                        className: "provider-link",
                        children: We(o.contact.phone)
                      }
                    )
                  ] }),
                  o.contact.officeEmail && o.contact.officeEmail !== "Not Available" && /* @__PURE__ */ l.jsxs("span", { children: [
                    /* @__PURE__ */ l.jsx(Be, { className: "provider-icon" }),
                    /* @__PURE__ */ l.jsx("a", { href: `mailto:${o.contact.officeEmail}`, className: "provider-link-blank", children: o.contact.officeEmail })
                  ] }),
                  o.contact.website && o.contact.website !== "Not Available" && (o.contact.website.startsWith("/") ? /* @__PURE__ */ l.jsx(Q, { to: o.contact.website, className: "provider-link-blank", children: o.contact.website }) : /* @__PURE__ */ l.jsxs("span", { children: [
                    /* @__PURE__ */ l.jsx(Te, { className: "provider-icon" }),
                    /* @__PURE__ */ l.jsx(
                      "a",
                      {
                        href: o.contact.website.startsWith("http") ? o.contact.website : `https://${o.contact.website}`,
                        className: "provider-link-blank",
                        onClick: (f) => {
                          f.preventDefault(), D(o.contact.website.startsWith("http") ? o.contact.website : `https://${o.contact.website}`);
                        },
                        children: o.contact.website
                      }
                    )
                  ] }))
                ] }),
                o.languages && o.languages.length > 0 && /* @__PURE__ */ l.jsxs("div", { className: "provider-languages", children: [
                  /* @__PURE__ */ l.jsx("span", { className: "provider-icon", children: /* @__PURE__ */ l.jsx(De, {}) }),
                  o.languages.map((f) => ye(f)).join(", ")
                ] }),
                o.yellowLabels && o.yellowLabels.length > 0 && /* @__PURE__ */ l.jsx("div", { className: "provider-labels", children: o.yellowLabels.filter((f) => !f.notAvailable).map((f) => f.icon === "accepting-new-patients" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Fe, { className: "provider-label-icon" }), tooltip: f.label || "Accepting new patients" }, f.icon) : f.icon === "public-transportation" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Me, { className: "provider-label-icon" }), tooltip: f.label || "Public transportation available" }, f.icon) : f.icon === "wheelchair-accessible" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Ae, { className: "provider-label-icon" }), tooltip: f.label || "Wheelchair accessible" }, f.icon) : f.icon === "telehealth-provider" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Ue, { className: "provider-label-icon" }), tooltip: f.label || "Telehealth provider" }, f.icon) : f.icon === "medicaid-provider" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(ze, { className: "provider-label-icon" }), tooltip: f.label || "Medicaid provider" }, f.icon) : /* @__PURE__ */ l.jsx($, { icon: null, tooltip: f.label || f.icon, children: f.label || f.icon }, f.icon)) })
              ] }),
              o.onlineAppointmentScheduleFlag == 1 && /* @__PURE__ */ l.jsx(
                "button",
                {
                  className: "provider-request-appt-btn",
                  onClick: () => {
                  },
                  children: "Request an appointment"
                }
              )
            ] }, o.providerId || `${o.name.firstName} ${o.name.lastName}`);
          }) })
        ] }) : b.crediblemind && Array.isArray(b.crediblemind) && b.crediblemind.length > 0 ? /* @__PURE__ */ l.jsx("div", { className: "crediblemind-cards", children: b.crediblemind.map((o) => o.content_url.startsWith("/") ? /* @__PURE__ */ l.jsxs(Q, { to: o.content_url, className: "crediblemind-card", children: [
          /* @__PURE__ */ l.jsx("div", { className: "crediblemind-title", children: o.title }),
          /* @__PURE__ */ l.jsx("div", { className: "crediblemind-type", children: o.content_type })
        ] }, o.entry_id) : /* @__PURE__ */ l.jsxs(
          "a",
          {
            href: o.content_url,
            className: "crediblemind-card",
            onClick: (I) => {
              I.preventDefault(), D(o.content_url);
            },
            children: [
              /* @__PURE__ */ l.jsx("div", { className: "crediblemind-title", children: o.title }),
              /* @__PURE__ */ l.jsx("div", { className: "crediblemind-type", children: o.content_type })
            ]
          },
          o.entry_id
        )) }) : b.providers && Array.isArray(b.providers) && b.providers.length > 0 ? /* @__PURE__ */ l.jsx("div", { className: "provider-cards", children: b.providers.map((o) => {
          const I = `${o.name.firstName?.[0] || ""}${o.name.lastName?.[0] || ""}`.toUpperCase();
          return /* @__PURE__ */ l.jsxs("div", { className: "provider-card", children: [
            /* @__PURE__ */ l.jsxs("div", { className: "provider-header-horizontal", children: [
              /* @__PURE__ */ l.jsx("span", { className: "provider-logo-circle fixed-width-span", children: I }),
              /* @__PURE__ */ l.jsxs("span", { className: "provider-name", children: [
                o.name.firstName,
                " ",
                o.name.lastName
              ] }),
              /* @__PURE__ */ l.jsx("span", { className: "provider-title right-align", children: o.title })
            ] }),
            /* @__PURE__ */ l.jsxs("div", { className: "provider-details", children: [
              /* @__PURE__ */ l.jsxs("div", { className: "provider-address", children: [
                /* @__PURE__ */ l.jsxs("span", { className: "provider-icon address-icon", children: [
                  /* @__PURE__ */ l.jsx(Oe, {}),
                  " "
                ] }),
                /* @__PURE__ */ l.jsxs("span", { className: "provider-link", onClick: () => {
                  const f = `${o.contact.address.addr1}, ${o.contact.address.city}, ${o.contact.address.state} ${o.contact.address.zip}`;
                  window.open(`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(f)}`, "_blank");
                }, children: [
                  o.contact.address.addr1,
                  ", ",
                  o.contact.address.city,
                  ", ",
                  o.contact.address.state,
                  " ",
                  o.contact.address.zip
                ] })
              ] }),
              /* @__PURE__ */ l.jsxs("div", { className: "provider-contact", children: [
                o.contact.phone && o.contact.phone !== "Not Available" && /* @__PURE__ */ l.jsxs("span", { children: [
                  /* @__PURE__ */ l.jsx(_e, { className: "provider-icon" }),
                  /* @__PURE__ */ l.jsx(
                    "a",
                    {
                      href: `tel:${o.contact.phone}`,
                      target: "_blank",
                      rel: "noopener noreferrer",
                      className: "provider-link",
                      children: We(o.contact.phone)
                    }
                  )
                ] }),
                o.contact.officeEmail && o.contact.officeEmail !== "Not Available" && /* @__PURE__ */ l.jsxs("span", { children: [
                  /* @__PURE__ */ l.jsx(Be, { className: "provider-icon" }),
                  /* @__PURE__ */ l.jsx("a", { href: `mailto:${o.contact.officeEmail}`, className: "provider-link-blank", children: o.contact.officeEmail })
                ] }),
                o.contact.website && o.contact.website !== "Not Available" && (o.contact.website.startsWith("/") ? /* @__PURE__ */ l.jsx(Q, { to: o.contact.website, className: "provider-link-blank", children: o.contact.website }) : /* @__PURE__ */ l.jsxs("span", { children: [
                  /* @__PURE__ */ l.jsx(Te, { className: "provider-icon" }),
                  /* @__PURE__ */ l.jsx(
                    "a",
                    {
                      href: o.contact.website.startsWith("http") ? o.contact.website : `https://${o.contact.website}`,
                      className: "provider-link-blank",
                      onClick: (f) => {
                        f.preventDefault(), D(o.contact.website.startsWith("http") ? o.contact.website : `https://${o.contact.website}`);
                      },
                      children: o.contact.website
                    }
                  )
                ] }))
              ] }),
              o.languages && o.languages.length > 0 && /* @__PURE__ */ l.jsxs("div", { className: "provider-languages", children: [
                /* @__PURE__ */ l.jsx("span", { className: "provider-icon", children: /* @__PURE__ */ l.jsx(De, {}) }),
                o.languages.map((f) => ye(f)).join(", ")
              ] }),
              o.yellowLabels && o.yellowLabels.length > 0 && /* @__PURE__ */ l.jsx("div", { className: "provider-labels", children: o.yellowLabels.filter((f) => !f.notAvailable).map((f) => f.icon === "accepting-new-patients" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Fe, { className: "provider-label-icon" }), tooltip: f.label || "Accepting new patients" }, f.icon) : f.icon === "public-transportation" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Me, { className: "provider-label-icon" }), tooltip: f.label || "Public transportation available" }, f.icon) : f.icon === "wheelchair-accessible" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Ae, { className: "provider-label-icon" }), tooltip: f.label || "Wheelchair accessible" }, f.icon) : f.icon === "telehealth-provider" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(Ue, { className: "provider-label-icon" }), tooltip: f.label || "Telehealth provider" }, f.icon) : f.icon === "medicaid-provider" ? /* @__PURE__ */ l.jsx($, { icon: /* @__PURE__ */ l.jsx(ze, { className: "provider-label-icon" }), tooltip: f.label || "Medicaid provider" }, f.icon) : /* @__PURE__ */ l.jsx($, { icon: null, tooltip: f.label || f.icon, children: f.label || f.icon }, f.icon)) })
            ] }),
            o.onlineAppointmentScheduleFlag == 1 && /* @__PURE__ */ l.jsx(
              "button",
              {
                className: "provider-request-appt-btn",
                onClick: () => {
                },
                children: "Request an appointment"
              }
            )
          ] }, o.providerId || `${o.name.firstName} ${o.name.lastName}`);
        }) }) : b.text }, b.id)),
        p && /* @__PURE__ */ l.jsxs("div", { className: "chat-bot-msg loading", children: [
          /* @__PURE__ */ l.jsx("span", { className: "loader-dot", children: "•" }),
          /* @__PURE__ */ l.jsx("span", { className: "loader-dot", children: "•" }),
          /* @__PURE__ */ l.jsx("span", { className: "loader-dot", children: "•" })
        ] }),
        w && /* @__PURE__ */ l.jsx("div", { className: "chat-error-msg", role: "alert", children: w }),
        /* @__PURE__ */ l.jsx("div", { ref: M })
      ] }),
      !A && /* @__PURE__ */ l.jsxs("div", { className: "chat-input-row", children: [
        /* @__PURE__ */ l.jsx("input", { className: "chat-input", type: "text", placeholder: "Ask anything", value: c, onChange: (b) => m(b.target.value), onKeyDown: (b) => {
          b.key === "Enter" && J();
        }, disabled: p, "aria-label": "Type your message" }),
        /* @__PURE__ */ l.jsx(
          "button",
          {
            className: "chat-mic-btn",
            "aria-label": "Voice input",
            onClick: () => {
              j(!0), N(!1);
            },
            disabled: p || e && !n,
            children: /* @__PURE__ */ l.jsx(He, {})
          }
        ),
        /* @__PURE__ */ l.jsx(
          "button",
          {
            className: "chat-send-btn",
            onClick: () => J(),
            disabled: p || !c.trim() && e && !n,
            "aria-label": "Send message",
            children: /* @__PURE__ */ l.jsx(kt, {})
          }
        )
      ] }),
      v && /* @__PURE__ */ l.jsx("div", { className: "chat-popup-overlay", tabIndex: -1, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ l.jsxs("div", { className: "chat-popup-modal", children: [
        /* @__PURE__ */ l.jsx("button", { className: "chat-popup-close", onClick: () => {
          j(!1), typeof window.onChatBack == "function" && window.onChatBack();
        }, "aria-label": "Close", children: "×" }),
        /* @__PURE__ */ l.jsx("div", { className: "chat-popup-icon animate-mic", children: /* @__PURE__ */ l.jsx(He, { size: 36, color: Ye }) }),
        /* @__PURE__ */ l.jsx("div", { className: "chat-popup-title", children: "Listening..." }),
        /* @__PURE__ */ l.jsx("div", { className: "chat-popup-desc", children: "Speak your query and we'll convert it to text. (Animation here)" })
      ] }) }),
      y && /* @__PURE__ */ l.jsx("div", { className: "chat-popup-overlay", tabIndex: -1, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ l.jsxs("div", { className: "chat-popup-modal", children: [
        /* @__PURE__ */ l.jsx("button", { className: "chat-popup-close", onClick: () => {
          N(!1), typeof window.onChatBack == "function" && window.onChatBack();
        }, "aria-label": "Close", children: "×" }),
        /* @__PURE__ */ l.jsx("div", { className: "chat-popup-icon animate-attachment", children: /* @__PURE__ */ l.jsx(St, { size: 36, color: Ye }) }),
        /* @__PURE__ */ l.jsx("div", { className: "chat-popup-title", children: "Upload a file or image" }),
        /* @__PURE__ */ l.jsx("input", { type: "file", className: "chat-popup-file" }),
        /* @__PURE__ */ l.jsx("div", { className: "chat-popup-desc", children: "Choose a file or image to upload. (Animation here)" })
      ] }) }),
      A && /* @__PURE__ */ l.jsx("div", { className: "iframe-modal-overlay", children: /* @__PURE__ */ l.jsxs("div", { className: "iframe-modal", children: [
        /* @__PURE__ */ l.jsx("button", { className: "iframe-modal-close", onClick: () => {
          D(null), typeof window.onChatBack == "function" && window.onChatBack();
        }, children: "×" }),
        /* @__PURE__ */ l.jsx("iframe", { src: A, title: "External Content", style: { width: "100%", height: "80vh", border: "none" } })
      ] }) })
    ] }) })
  ] });
};
function $({ icon: e, tooltip: t, children: n }) {
  const [r, a] = P(!1);
  let i;
  const u = () => {
    a(!0), clearTimeout(i), i = setTimeout(() => a(!1), 5e3);
  }, h = () => {
    a(!1), clearTimeout(i);
  };
  return /* @__PURE__ */ l.jsxs("span", { className: "provider-label", onClick: u, onMouseEnter: u, onMouseLeave: h, children: [
    e,
    n,
    r && /* @__PURE__ */ l.jsx("span", { className: "provider-label-tooltip", children: ye(t) })
  ] });
}
const ra = ({ onBack: e, onHistory: t }) => /* @__PURE__ */ l.jsxs("div", { className: "top-bar sticky-top", children: [
  /* @__PURE__ */ l.jsx("button", { className: "back-btn", onClick: e, "aria-label": "Back", children: /* @__PURE__ */ l.jsx(Rt, {}) }),
  /* @__PURE__ */ l.jsx("div", { className: "top-bar-spacer" }),
  /* @__PURE__ */ l.jsx("button", { className: "history-btn", onClick: t, "aria-label": "Chat History", children: /* @__PURE__ */ l.jsx(Pt, {}) })
] });
function la({ userFName: e = "Alex", senderApp: t = "EAP_MOB", lob: n = "Emblem", userType: r = "Anonymous" }) {
  const i = xe([
    "I feel stressed",
    "Tips for anxiety",
    "How to sleep better?",
    "My benefits",
    "Work-life balance advice",
    "Mindfulness techniques",
    "Dealing with burnout",
    "Healthy habits",
    "Managing emotions",
    "Productivity tips",
    "Positive thinking",
    "Social support",
    "Self care routines",
    "Goal setting",
    "Time management",
    "Healthy eating",
    "Sleep hygiene",
    "Stress relief",
    "Mental wellness",
    "Emotional balance"
  ], 4), [u, h] = P(null), [s, c] = P(!1), [m, p] = P(null), g = Ke(null), w = () => {
    g.current && (c(g.current.chatStarted), h(g.current.selectedChipIdx), p(g.current.chipToSend));
  };
  ne(() => (window.onChatBack = w, () => {
    window.onChatBack = void 0;
  }), []);
  const x = () => {
    alert("Show chat history (to be implemented)");
  }, y = (j) => {
    h(j), p(i[j]), c(!0);
  }, N = () => {
    h(null), p(null);
  }, v = () => c(!0);
  return /* @__PURE__ */ l.jsxs("div", { className: "app-root theme-light", style: { backgroundColor: "#fafafd" }, children: [
    /* @__PURE__ */ l.jsx(ra, { onBack: w, onHistory: x }),
    /* @__PURE__ */ l.jsx("div", { className: "app-body", children: /* @__PURE__ */ l.jsx(
      aa,
      {
        showGreeting: !s,
        onStartChat: v,
        chipToSend: m,
        onChipSent: N,
        chips: i,
        selectedChipIdx: u,
        handleChipClick: y,
        userFName: e,
        senderApp: t,
        lob: n,
        userType: r
      }
    ) }),
    /* @__PURE__ */ l.jsx("footer", { className: "app-footer", children: "Footer content here" })
  ] });
}
export {
  la as default
};