import { d as he, ag as Ee, r as n, U as $e, o, c as u, a as t, x as Pe, t as y, f as c, F as C, b as _, q as x, v as f, n as h, z as Te, e as j, k as ae, p as se, Y as ue, _ as Re } from "./main-e6123302.mjs";
import { _ as H } from "./loadernew-ac153a51.mjs";
import { D as Se } from "./Header-2fcbd18f.mjs";
import { c as Ue, u as Ne } from "./delphi_utils-fd314b4b.mjs";
import { u as Ce } from "./index-71114b0d.mjs";
import "./genome-Logo-white-ffcf2413.mjs";
import "./PopupComponent-457fc235.mjs";
import "./Close-button-48e5479d.mjs";
const Ve = {
  key: 0,
  class: "flex flex-col"
}, Ae = { class: "flex" }, Ye = { class: "mt-14 flex w-full overflow-y-auto text-[15px]" }, Fe = { class: "shadow mx-auto flex w-1/2 flex-wrap justify-between bg-gray-100 p-4" }, Le = { class: "mt-4 flex w-full" }, Me = { key: 0 }, Oe = { class: "text-green-700" }, ze = {
  key: 1,
  class: "flex justify-end"
}, Be = { class: "w-full text-[15px]" }, De = {
  key: 1,
  class: "w-10",
  src: H,
  alt: "Loader Gif"
}, Ie = { key: 2 }, Ke = { class: "text-red-900" }, Qe = { class: "mt-4 flex w-full" }, je = { class: "mx-1 my-2 w-full" }, He = { class: "text-left text-background-secondary" }, qe = ["disabled"], Ge = { key: 0 }, We = { key: 1 }, Xe = { class: "mx-1 my-2 flex w-56 justify-end" }, Je = { class: "flex w-1/3 justify-start" }, Ze = { class: "switch" }, et = ["disabled"], tt = { class: "mx-1 my-2 w-full" }, at = { class: "text-left text-background-secondary" }, st = ["disabled"], lt = { key: 0 }, ot = { class: "mx-1 my-2 w-full" }, ut = { class: "text-left text-background-secondary" }, nt = ["disabled"], rt = { class: "mx-1 my-2 w-full" }, dt = { class: "text-left text-background-secondary" }, it = ["disabled"], ct = { key: 0 }, pt = { class: "mx-1 my-2 w-full" }, vt = { class: "text-left text-background-secondary" }, mt = ["id", "disabled"], xt = {
  key: 0,
  class: "mt-4 w-full"
}, _t = { class: "mt-4 w-full" }, ft = { class: "text-left text-background-secondary" }, gt = ["onUpdate:modelValue", "disabled"], yt = { key: 0 }, bt = { class: "mt-4 w-full" }, wt = { class: "text-left text-background-secondary" }, kt = ["onUpdate:modelValue", "disabled"], ht = { class: "mt-4 w-full" }, Et = { class: "text-left text-background-secondary" }, $t = ["onUpdate:modelValue", "disabled"], Pt = { class: "shadow mx-auto w-1/2 bg-gray-100 p-4" }, Tt = { class: "mt-4 w-full text-[15px]" }, Rt = ["disabled"], St = { key: 0 }, Ut = { class: "text-red-900" }, Nt = { class: "mt-4 w-full" }, Ct = {
  key: 0,
  class: "mb-4 font-bold text-background-secondary"
}, Vt = { class: "font-bold" }, At = {
  key: 0,
  class: "text-[15px] text-red-900"
}, Yt = {
  key: 0,
  class: "bot-text text-row-bg relative w-full max-w-3xl md:w-auto lg:w-auto"
}, Ft = { class: "flex items-center border border-gray-400 px-3 py-2" }, Lt = { class: "w-auto" }, Mt = ["for"], Ot = ["disabled", "onChange"], zt = { key: 0 }, Bt = { class: "text-[15px] text-red-900" }, Dt = { key: 1 }, It = { class: "-text-blue text-[15px]" }, Kt = { class: "pl-2" }, Qt = ["disabled", "onClick"], jt = {
  key: 0,
  class: "w-10",
  src: H,
  alt: "Loader Gif"
}, Ht = { key: 1 }, qt = ["id", "onUpdate:modelValue"], Gt = { class: "mt-4 w-full" }, Wt = { class: "box-wrap-1 mt-4 text-xs" }, Xt = { class: "text-left text-background-secondary" }, Jt = { class: "box-wrap-1 mt-4 text-xs" }, Zt = { class: "text-left text-background-secondary" }, ea = { class: "box-wrap-1 mt-4 text-xs" }, ta = { class: "text-left text-background-secondary" }, aa = { class: "box-wrap-1 mt-4 text-xs" }, sa = { class: "text-left text-background-secondary" }, la = { class: "box-wrap-1 mt-4 text-xs" }, oa = { class: "text-left text-background-secondary" }, ua = { class: "box-wrap-1 mt-4 text-xs" }, na = { class: "text-left text-background-secondary" }, ra = { class: "mt-4 w-full" }, da = ["disabled"], ia = {
  key: 1,
  class: "w-10",
  src: H,
  alt: "Loader Gif"
}, ca = { key: 0 }, pa = { class: "text-red-900" }, va = {
  key: 1,
  class: "-text-blue mt-4 w-full border border-gray-400 p-2"
}, ma = { key: 0 }, xa = {
  key: 0,
  class: "text-[15px] shadow fixed_headers checkBoxSize mb-4 mt-1 w-full rounded bg-white text-xs"
}, _a = { class: "-text-blue-800 flex w-full text-left" }, fa = { class: "z-10 flex flex w-full justify-between border-b bg-background-secondary text-white" }, ga = { class: "-text-blue-800 max-table-height flex w-full flex-col items-center overflow-y-auto opacity-80" }, ya = { class: "p-2 w-10" }, ba = ["innerHTML"], wa = { key: 2 }, ka = {
  key: 0,
  class: "w-10",
  src: H,
  alt: "Loader Gif"
}, ha = ["disabled"], Ea = {
  key: 1,
  class: "flex h-screen flex-col"
}, $a = {
  key: 1,
  class: "h-min-screen flex flex-col justify-center text-center"
}, Pa = /* @__PURE__ */ he({
  __name: "AddPrompt",
  setup(Ta) {
    const X = Ee(), q = n(!1), b = n(!0), w = n(!0), ne = n(), $ = n(""), O = n(""), T = n(""), R = n(""), k = n(""), re = Ce(), m = n(), A = n(), V = n(!1), J = n(!1), Y = n(!1);
    n(!1);
    const d = n(!1), p = n(), l = n(), E = n(), g = n(), F = n(), L = n(!1), z = n(!0), B = n(!0), D = n(), S = n(), I = n(!1), K = n(!1), Z = n(!1), G = n(), U = n(), M = n(), ee = n("not_executed"), P = n(), Q = n(), W = n(), v = n({
      MAX_TOKENS: 500,
      TEMPERATURE: 0.3,
      TOP_P: 0,
      STOP_SEQUENCE: "$$$",
      FREQUENCY_PENALTY: 0,
      PRESENCE_PENALTY: 0
    }), de = async () => {
      K.value = !0, ee.value = "not_executed", D.value = "", F.value = "", g.value = null, l.value = null, E.value = null, p.value && p.value.length && (w.value = !1);
      for (let s = 0; s < p.value.length; s++) {
        const e = p.value[s];
        e.parameter_value = "";
      }
    }, ie = async () => {
      d.value = !1, I.value = !0, K.value = !1, p.value = [];
    }, ce = async () => {
      try {
        J.value = !1;
        const s = $.value.trim();
        if (!s)
          return;
        const { data: e } = await ae(`/delphi/prompt/name?prompt_display_name=${s}`);
        e && e.data && (J.value = !0);
      } catch (s) {
        console.log("Error in fetch prompt by name", { message: s.message });
      }
    }, pe = async () => {
      V.value = !V.value, console.log(`is_public ${V.value}`);
    }, ve = async () => {
      if (b.value = !0, A.value = [], (!$.value || !$.value.trim()) && (b.value = !1), (!T.value || !T.value.trim()) && (b.value = !1), (!R.value || !R.value.trim()) && (b.value = !1), console.log(`rules.value ${k.value}`), !!k.value && !(!m.value || !m.value.length)) {
        console.log(`is_mandatory_completed before input loop ${b.value}`);
        for (let s = 0; s < m.value.length; s++) {
          const e = m.value[s];
          console.log("input_params", { input_params: e }), e.display_name ? A.value.push({ disply_error_message: "" }) : (b.value = b.value && !1, A.value.push({ disply_error_message: "Display name is mandatory" }));
        }
        console.log("input_error_msgs", { input_error_msgs: A });
      }
    }, te = async () => {
      w.value = !0;
      for (let s = 0; s < p.value.length; s++) {
        const e = p.value[s];
        console.log("input_params", { input_parameters_to_execute: p }), console.log("input_params.is_mandatory", { value: e.is_mandatory }), console.log("input_params.parameter_value", { value: e.parameter_value }), console.log(`input_params.is_mandatory && !input_params.parameter_value, ${e.is_mandatory && !e.parameter_value}`), e.is_mandatory && !e.parameter_value ? w.value = w.value && !1 : console.log("inside else");
      }
    }, me = async () => {
      v.value && v.value.FREQUENCY_PENALTY.toString() !== "" && v.value.MAX_TOKENS.toString() !== "" && v.value.PRESENCE_PENALTY.toString() !== "" && v.value.STOP_SEQUENCE !== "" && v.value.TEMPERATURE.toString() !== "" && v.value.TOP_P.toString() !== "" || (w.value = w.value && !1);
    }, xe = async () => {
      try {
        if (z.value = !1, w.value = !0, p.value && p.value.length && await te(), await me(), W.value || (w.value = !1), console.log(`is_mandatory_completed_to_execute ${w.value}`), !w.value) {
          z.value = !0, D.value = "All mandatory inputs are not completed", setTimeout(() => {
            D.value = null;
          }, 6e3);
          return;
        }
        const { data: s } = await se("/delphi/prompt/execution", {
          prompt_id: S.value,
          input_params: p.value,
          // linked_app_id : 'cdbb9123e5688d6b71541d537418bc24da8e95e9896ce9898b97bbf391fdb8c0',
          temperature_settings: v.value,
          linked_app_id: W.value
        });
        if (console.log("res", { data: s }), z.value = !0, s && s.is_access_not_allowed) {
          Y.value = !1, M.value = s.message, setTimeout(() => {
            M.value = null;
          }, 6e3);
          return;
        }
        console.log("data", { val: s.data }), z.value = !0, E.value = s.data, F.value = `<div>Your execution id is "${E.value}" and status is <span class="font-bold">in progress</span>.</div><div>Please click on "<span class="font-bold">Check Status"</span> to get the expected output.</div>`;
      } catch (s) {
        L.value = !0, console.log("Error in executing prompt", { message: s.message }), re.error(`${s.response.data.message}`);
      }
    }, _e = async () => {
      try {
        L.value = !0;
        const { data: s } = await ae(`/delphi/prompt/execution/status/${E.value}`);
        if (g.value = s && s.data ? s.data : null, L.value = !1, !g.value) {
          M.value = "There is some issue while fetching execution status", setTimeout(() => {
            M.value = null;
          }, 6e3);
          return;
        }
        if (ee.value = g.value.execution_status, g.value.execution_status === "success") {
          if (P.value = g.value.parsed_output ? g.value.parsed_output : [], console.log("executed_parsed_output", { length: P.value.length, data: P.value }), Q.value = [], P.value.length) {
            const e = P.value[0];
            console.log("first_parsed_output", { first_parsed_output: e });
            for (let a in e) {
              const r = a;
              console.log(`key ${r}`), r && Q.value.push(r);
            }
          }
          console.log("parsed_output_columns", Q.value), F.value = `<div>Your execution id is "${E.value}" and status is <span class="font-bold">${g.value.execution_status}</span></div><div><span class="font-bold">Execution Output: </span>${g.value.execution_ouput}</div>`;
        } else
          g.value.execution_status === "failed" ? F.value = `<div>Youd execution id is "${E.value}" and status is <span class="font-bold">${g.value.execution_status}</span></div><div><span>Execution Error: </span>${g.value.execution_error}</div>` : F.value = `<div>Youd execution id is "${E.value}" and status is <span class="font-bold">${g.value.execution_status}</span></div><div>Please click on "<span class="font-bold">Check Status"</span> to get the expected output.</div>`;
      } catch (s) {
        L.value = !1, console.log("Error in fetching execution status", { message: s.message });
      }
    }, fe = async () => {
      B.value = !1;
      try {
        if (await ve(), console.log(`is_mandatory_completed ${b.value}`), !b.value) {
          B.value = !0;
          return;
        }
        let s = {
          prompt_id: S.value ? S.value : "",
          desc: O.value ? O.value : "",
          prompt_display_name: $.value,
          persona: T.value,
          intent: R.value,
          rules: k.value ? [k.value] : [],
          input_parameters: m.value ? m.value : [],
          is_public: V.value ? 1 : 0
        };
        console.log("prompt_details to save", { prompt_details: s });
        const { data: e } = await se("/delphi/prompt/save", s);
        if (e && e.is_access_not_allowed) {
          Y.value = !1, U.value = e.message, setTimeout(() => {
            U.value = null;
          }, 6e3);
          return;
        }
        if (e.is_edit_not_allowed) {
          Z.value = !0, U.value = e.message, setTimeout(() => {
            U.value = null;
          }, 6e3);
          return;
        }
        G.value = e.message, setTimeout(() => {
          G.value = null;
        }, 6e3);
        const a = e.prompt_details;
        p.value = [], p.value = a.input_parameters, console.log("input_parameters_to_execute after adding prompt", { input_parameters_to_execute: p }), S.value = a.prompt_id, d.value = !0, console.log(`is_save_completed ${d.value}`), I.value = !0, B.value = !0;
      } catch (s) {
        B.value = !0, console.log("Error in saving prompt details", { message: s.message });
      }
    }, ge = async () => {
      let s = [];
      if (m.value && (s = m.value), !k.value || !k.value.length) {
        ne.value = "Rules is required to create input parameters";
        return;
      }
      const e = k.value;
      m.value = [];
      let a = 0, r = e.indexOf("$");
      for (; r > -1; ) {
        const i = e.indexOf("$", a);
        if (i === -1)
          break;
        if (a = i + 1, r = e.indexOf("$", a), r > -1 && e.substring(i + 1, r) !== `
`) {
          let N = e.substring(i, r + 1);
          if (N = N.split(" ").join(""), N === "$$")
            continue;
          const le = {
            parameter_name: N,
            parameter_value: "",
            parameter_type: "text",
            is_mandatory: !0,
            display_name: ""
          };
          if (m.value) {
            let oe = s.find((ke) => ke.parameter_name === N);
            oe ? m.value.push(oe) : m.value.push(le);
          } else
            m.value.push(le);
        }
        a = r + 1;
      }
      console.log("input_parameters", { inputs: m.value });
    }, ye = (s, e) => {
      const a = `uploadResume-${e}`;
      console.log(`input_name ${a}`), l.value || (l.value = {}), l.value[`uploadResume-${e}`] = { value: s.target.files[0], error_message: "", success_message: "", afterResumeuploaded: !1 }, console.log("event", s.target.files[0]), console.log("uploadedFile.value", l.value);
      const r = 1024 * 1024 * 5;
      if (s.target.files[0].size > r) {
        l.value[a] = {
          value: null,
          error_message: "File size exceeds the maximum allowed size (1MB).",
          success_message: "",
          afterResumeuploaded: !1
        };
        return;
      }
      const i = ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "text/plain"];
      if (console.log("uploadedFile.value.type", s.target.files[0].type, i.includes(s.target.files[0].type)), !i.includes(s.target.files[0].type)) {
        l.value[a] = {
          value: null,
          error_message: "Invalid file type. Please upload valid file.",
          success_message: "",
          afterResumeuploaded: !1
        };
        return;
      }
      console.log("event", s.target.files[0]), console.log("uploadedFile.value", l.value[a].value), console.log("uploadFilename.value", l.value[a].value);
    }, be = async (s) => {
      const e = `uploadResume-${s}`;
      if (console.log(`input_name ${e}`), console.log("uploadedFiles.value", { val: l.value }), console.log(
        `uploadedFiles.value || (uploadedFiles.value && !uploadedFiles.value[input_name].value) ${!l.value || l.value && !l.value[e] || l.value && l.value[e] && !l.value[e].value}`
      ), !l.value || l.value && !l.value[e] || l.value && l.value[e] && !l.value[e].value)
        l.value || (l.value = {}), l.value[e] ? l.value[e].error_message = "Please Select valid file to upload" : l.value[e] = {
          value: null,
          error_message: "Please Select valid file to upload",
          success_message: "",
          afterResumeuploaded: !1
        }, setTimeout(() => {
          l.value[e].error_message = null;
        }, 6e3);
      else {
        l.value[e].renderWaiting = !0;
        const a = await se("/delphi/signed_url", {
          file_name: l.value[e].value.name
        });
        console.log("preSignedRes", a);
        const r = a.data.messsage.url, i = a.data.messsage.file_key;
        console.log("preSignedUrl", r), console.log("fileKey", i), (await Ne(r, l.value[e].value)).status === 200 && (l.value[e].success_message = "Resume has been uploaded successfully", setTimeout(() => {
          l.value[e].success_message = null;
        }, 6e3), console.log(`index ${s}`), console.log("input_parameters_to_execute", { params: p.value }), p.value[s].parameter_value = i, await te(), l.value[e].afterResumeuploaded = !0, l.value[e].renderWaiting = !1);
      }
    }, we = async () => {
      try {
        const { data: s } = await ae(`/delphi/prompt/${S.value}`);
        if (s && s.is_access_not_allowed) {
          Y.value = !1, U.value = s.message, setTimeout(() => {
            U.value = null;
          }, 6e3);
          return;
        }
        s && s.is_edit_not_allowed && (Z.value = s.is_edit_not_allowed);
        const e = s && s.data ? s.data : null;
        O.value = e.desc, $.value = e.prompt_display_name, T.value = e.persona, R.value = e.intent, k.value = e.rules ? e.rules : "", m.value = e.input_parameters ? e.input_parameters : [], V.value = e.is_public === 1, p.value = e.input_parameters, console.log("input_parameters_to_execute", { params: p }), q.value = !0, I.value = !0, d.value = !0;
      } catch (s) {
        q.value = !0, console.log("Error in fetching all prompts", { message: s.message });
      }
    };
    return $e(async () => {
      S.value = X.query && X.query.prompt_id ? X.query.prompt_id : null, console.log(`prompt_id ${S.value}`), Y.value = await Ue(), Y.value && (S.value && await we(), q.value = !0);
    }), (s, e) => q.value ? (o(), u(C, { key: 0 }, [
      Y.value ? (o(), u("div", Ve, [
        t("nav", Ae, [
          Pe(Se)
        ]),
        t("section", Ye, [
          t("div", Fe, [
            t("div", Le, [
              e[21] || (e[21] = t("div", { class: "mb-4 flex w-full justify-start" }, [
                t("div", { class: "text-center text-3xl font-bold text-background-secondary" }, "Prompt Details")
              ], -1)),
              G.value ? (o(), u("div", Me, [
                t("span", Oe, y(G.value), 1)
              ])) : c("", !0),
              Z.value ? c("", !0) : (o(), u("div", ze, [
                t("div", Be, [
                  B.value ? (o(), u(C, { key: 0 }, [
                    d.value ? c("", !0) : (o(), u("button", {
                      key: 0,
                      class: "flex items-center rounded bg-background-secondary px-4 py-2 text-white",
                      onClick: e[0] || (e[0] = (a) => fe())
                    }, e[19] || (e[19] = [
                      _(" Save "),
                      t("svg", {
                        xmlns: "http://www.w3.org/2000/svg",
                        fill: "currentColor",
                        class: "bi bi-save h-4 w-4 pl-1",
                        viewBox: "0 0 16 16"
                      }, [
                        t("path", { d: "M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9.5a1 1 0 0 0-1 1v7.293l2.646-2.647a.5.5 0 0 1 .708.708l-3.5 3.5a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L7.5 9.293V2a2 2 0 0 1 2-2H14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h2.5a.5.5 0 0 1 0 1H2z" })
                      ], -1)
                    ]))),
                    d.value ? (o(), u("button", {
                      key: 1,
                      class: "flex items-center rounded bg-background-secondary px-4 py-2 text-white",
                      onClick: e[1] || (e[1] = (a) => ie())
                    }, e[20] || (e[20] = [
                      _(" Edit "),
                      t("svg", {
                        xmlns: "http://www.w3.org/2000/svg",
                        fill: "currentColor",
                        class: "bi bi-pencil h-4 w-4 pl-1",
                        viewBox: "0 0 16 16"
                      }, [
                        t("path", { d: "M12.146.146a.5.5 0 0 1 .708 0l3 3a.5.5 0 0 1 0 .708l-10 10a.5.5 0 0 1-.168.11l-5 2a.5.5 0 0 1-.65-.65l2-5a.5.5 0 0 1 .11-.168l10-10zM11.207 2.5 13.5 4.793 14.793 3.5 12.5 1.207 11.207 2.5zm1.586 3L10.5 3.207 4 9.707V10h.5a.5.5 0 0 1 .5.5v.5h.5a.5.5 0 0 1 .5.5v.5h.293l6.5-6.5zm-9.761 5.175-.106.106-1.528 3.821 3.821-1.528.106-.106A.5.5 0 0 1 5 12.5V12h-.5a.5.5 0 0 1-.5-.5V11h-.5a.5.5 0 0 1-.468-.325z" })
                      ], -1)
                    ]))) : c("", !0)
                  ], 64)) : (o(), u("img", De))
                ])
              ])),
              U.value ? (o(), u("div", Ie, [
                t("span", Ke, y(U.value), 1)
              ])) : c("", !0)
            ]),
            e[40] || (e[40] = t("div", { class: "mb-4 w-full" }, [
              t("div", { class: "text-left text-[15px] text-background-secondary" }, [
                t("b", null, "*Instruction: "),
                _(`If you are adding an input parameter in rules then please prefix and suffix it with '$' for eg. if you want to input candidates skill in rules then the parameter name can be "$candidate_skill$" or "$candidateSkill$". Please do not use spaces in between like "$candiate skill$". `)
              ])
            ], -1)),
            t("div", Qe, [
              t("div", je, [
                e[24] || (e[24] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                  _("Prompt Name "),
                  t("span", { class: "text-[15px] text-red-900" }, "*")
                ], -1)),
                t("div", He, [
                  x(t("input", {
                    "onUpdate:modelValue": e[2] || (e[2] = (a) => $.value = a),
                    disabled: I.value,
                    class: h([I.value ? "cursor-not-allowed" : "", "block w-full appearance-none rounded border border-gray-200 px-4 py-2 text-[15px] leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none"]),
                    type: "text",
                    onKeyup: ce
                  }, null, 42, qe), [
                    [f, $.value]
                  ])
                ]),
                J.value ? (o(), u("div", Ge, e[22] || (e[22] = [
                  t("span", { class: "text-[15px] text-red-900" }, "Prompt name already exists", -1)
                ]))) : c("", !0),
                !b.value && (!$.value || $.value && !$.value.trim()) ? (o(), u("div", We, e[23] || (e[23] = [
                  t("span", { class: "text-[15px] text-red-900" }, "Prompt name is mandatory", -1)
                ]))) : c("", !0)
              ]),
              t("div", Xe, [
                t("div", null, [
                  e[26] || (e[26] = t("label", { class: "-text-blue-800 opacity-80" }, "Is Prompt Public", -1)),
                  t("div", Je, [
                    t("label", Ze, [
                      x(t("input", {
                        "onUpdate:modelValue": e[3] || (e[3] = (a) => V.value = a),
                        disabled: d.value,
                        class: h(d.value ? "cursor-not-allowed" : ""),
                        type: "checkbox",
                        onClick: pe
                      }, null, 10, et), [
                        [Te, V.value]
                      ]),
                      e[25] || (e[25] = t("div", { class: "slider round" }, null, -1))
                    ])
                  ])
                ])
              ])
            ]),
            t("div", tt, [
              e[28] || (e[28] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                _("Persona "),
                t("span", { class: "text-[15px] text-red-900" }, "*")
              ], -1)),
              t("div", at, [
                x(t("input", {
                  "onUpdate:modelValue": e[4] || (e[4] = (a) => T.value = a),
                  disabled: d.value,
                  class: h([d.value ? "cursor-not-allowed" : "", "block w-full appearance-none rounded border border-gray-200 px-4 py-2 text-[15px] leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none"]),
                  type: "text"
                }, null, 10, st), [
                  [f, T.value]
                ])
              ]),
              !b.value && (!T.value || T.value && !T.value.trim()) ? (o(), u("div", lt, e[27] || (e[27] = [
                t("span", { class: "text-[15px] text-red-900" }, "Persona is mandatory", -1)
              ]))) : c("", !0)
            ]),
            t("div", ot, [
              e[29] || (e[29] = t("div", { class: "text-left font-bold text-background-secondary" }, "Description", -1)),
              t("div", ut, [
                x(t("input", {
                  "onUpdate:modelValue": e[5] || (e[5] = (a) => O.value = a),
                  disabled: d.value,
                  class: h([d.value ? "cursor-not-allowed" : "", "block w-full appearance-none rounded border border-gray-200 px-4 py-2 leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none"]),
                  type: "text"
                }, null, 10, nt), [
                  [f, O.value]
                ])
              ])
            ]),
            t("div", rt, [
              e[31] || (e[31] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                _("Intent "),
                t("span", { class: "text-[15px] text-red-900" }, "*")
              ], -1)),
              t("div", dt, [
                x(t("textarea", {
                  "onUpdate:modelValue": e[6] || (e[6] = (a) => R.value = a),
                  disabled: d.value,
                  class: h([d.value ? "cursor-not-allowed" : "", "m-0 w-full border border-solid border-gray-300 bg-white bg-clip-padding px-3 py-1.5 text-gray-700 ease-in-out focus:border-blue-600 focus:bg-white focus:text-gray-700 focus:outline-none"]),
                  rows: "10"
                }, null, 10, it), [
                  [f, R.value]
                ])
              ]),
              !b.value && (!R.value || R.value && !R.value.trim()) ? (o(), u("div", ct, e[30] || (e[30] = [
                t("span", { class: "text-[15px] text-red-900" }, "Intent is mandatory", -1)
              ]))) : c("", !0)
            ]),
            t("div", pt, [
              e[32] || (e[32] = t("div", { class: "text-left font-bold text-background-secondary" }, "Rules", -1)),
              t("div", vt, [
                x(t("textarea", {
                  id: k.value,
                  "onUpdate:modelValue": e[7] || (e[7] = (a) => k.value = a),
                  disabled: d.value,
                  class: h([d.value ? "cursor-not-allowed" : "", "m-0 w-full border border-solid border-gray-300 bg-white bg-clip-padding px-3 py-1.5 text-gray-700 ease-in-out focus:border-blue-600 focus:bg-white focus:text-gray-700 focus:outline-none"]),
                  rows: "10",
                  onKeyup: ge
                }, null, 42, mt), [
                  [f, k.value]
                ])
              ])
            ]),
            k.value && m.value && m.value.length ? (o(), u("div", xt, [
              e[39] || (e[39] = t("div", { class: "text-left font-bold text-background-secondary" }, "Input Parameters", -1)),
              (o(!0), u(C, null, j(m.value, (a, r) => (o(), u("div", {
                key: a.parameter_name,
                class: "shadow box-wrap-1 mb-2 border border-gray-400 p-2 text-left font-bold text-background-secondary"
              }, [
                t("div", null, y(r + 1) + ". " + y(a.parameter_name), 1),
                t("div", _t, [
                  e[34] || (e[34] = t("div", { class: "text-left text-[15px] font-bold text-background-secondary" }, [
                    _("Display Name "),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", ft, [
                    x(t("input", {
                      "onUpdate:modelValue": (i) => a.display_name = i,
                      disabled: d.value,
                      class: h([d.value ? "cursor-not-allowed" : "", "block w-full appearance-none rounded border border-gray-200 px-4 py-1 leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none"]),
                      type: "text"
                    }, null, 10, gt), [
                      [f, a.display_name]
                    ])
                  ]),
                  A.value && A.value[r].disply_error_message ? (o(), u("div", yt, e[33] || (e[33] = [
                    t("span", { class: "text-[15px] text-red-900" }, "Display name is mandatory", -1)
                  ]))) : c("", !0)
                ]),
                t("div", bt, [
                  e[36] || (e[36] = t("div", { class: "text-left text-[15px] font-bold text-background-secondary" }, "Paramerter is Mandatory", -1)),
                  t("div", wt, [
                    x(t("select", {
                      "onUpdate:modelValue": (i) => a.is_mandatory = i,
                      disabled: d.value,
                      class: h([d.value ? "cursor-not-allowed" : "", "block w-full appearance-none rounded border border-gray-200 px-4 py-1 leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none"])
                    }, e[35] || (e[35] = [
                      t("option", { value: "false" }, "No", -1),
                      t("option", {
                        value: "true",
                        selected: ""
                      }, "Yes", -1)
                    ]), 10, kt), [
                      [ue, a.is_mandatory]
                    ])
                  ])
                ]),
                t("div", ht, [
                  e[38] || (e[38] = t("div", { class: "text-left text-[15px] font-bold text-background-secondary" }, "Paramerter Type", -1)),
                  t("div", Et, [
                    x(t("select", {
                      "onUpdate:modelValue": (i) => a.parameter_type = i,
                      disabled: d.value,
                      class: h([d.value ? "cursor-not-allowed" : "", "block w-full appearance-none rounded border border-gray-200 px-4 py-1 leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none"])
                    }, e[37] || (e[37] = [
                      t("option", { value: "file" }, "File", -1),
                      t("option", {
                        value: "text",
                        selected: ""
                      }, "Text", -1)
                    ]), 10, $t), [
                      [ue, a.parameter_type]
                    ])
                  ])
                ])
              ]))), 128))
            ])) : c("", !0)
          ]),
          t("div", Pt, [
            t("div", Tt, [
              t("button", {
                disabled: !d.value || K.value,
                class: h(["inline-block rounded px-4 py-2 text-white", !d.value || K.value ? "cursor-not-allowed bg-gray-500" : "cursor-pointer bg-background-secondary"]),
                onClick: e[8] || (e[8] = (a) => de())
              }, " Execute Prompt ", 10, Rt)
            ]),
            M.value ? (o(), u("div", St, [
              t("span", Ut, y(M.value), 1)
            ])) : c("", !0),
            K.value ? (o(), u(C, { key: 1 }, [
              t("div", Nt, [
                p.value ? (o(), u("div", Ct, "Input Parameters :")) : c("", !0),
                (o(!0), u(C, null, j(p.value, (a, r) => (o(), u("div", {
                  key: a.parameter_name,
                  class: "text-left text-xs text-background-secondary"
                }, [
                  t("div", Vt, [
                    _(y(a.display_name) + " ", 1),
                    a.is_mandatory ? (o(), u("span", At, "*")) : c("", !0)
                  ]),
                  a.parameter_type === "file" ? (o(), u("div", Yt, [
                    t("div", Ft, [
                      t("div", Lt, [
                        e[41] || (e[41] = t("div", { class: "-text-blue py-1.5" }, "Upload resume here", -1)),
                        t("label", {
                          for: `uploadResume-${r}`,
                          class: "pointer text-gray-500"
                        }, [
                          t("input", {
                            disabled: l.value && l.value[`uploadResume-${r}`].afterResumeuploaded,
                            type: "file",
                            accept: ".pdf,.docx,.doc,.txt",
                            onChange: (i) => ye(i, r)
                          }, null, 40, Ot)
                        ], 8, Mt),
                        e[42] || (e[42] = t("div", { class: "mt-1 flex" }, [
                          t("div", { class: "-text-blue text-[15px]" }, "File size max 5 MB"),
                          t("div", { class: "pl-6 text-[15px]" }, "File types .pdf/ .docx/.doc/.txt")
                        ], -1)),
                        l.value && l.value[`uploadResume-${r}`].error_message ? (o(), u("div", zt, [
                          t("span", Bt, y(l.value[`uploadResume-${r}`].error_message), 1)
                        ])) : c("", !0),
                        l.value && l.value[`uploadResume-${r}`].success_message ? (o(), u("div", Dt, [
                          t("span", It, y(l.value[`uploadResume-${r}`].success_message), 1)
                        ])) : c("", !0)
                      ]),
                      t("div", Kt, [
                        t("button", {
                          disabled: l.value && l.value[`uploadResume-${r}`].afterResumeuploaded,
                          class: h([
                            l.value && l.value[`uploadResume-${r}`].afterResumeuploaded || l.value && l.value[`uploadResume-${r}`].error_message ? "cursor-not-allowed bg-gray-500" : "cursor-pointer bg-background-secondary",
                            "inline-block rounded px-6 py-1.5 text-white"
                          ]),
                          onClick: (i) => be(r)
                        }, " Upload ", 10, Qt),
                        l.value && l.value[`uploadResume-${r}`].renderWaiting ? (o(), u("img", jt)) : c("", !0)
                      ])
                    ])
                  ])) : c("", !0),
                  a.parameter_type === "text" ? (o(), u("div", Ht, [
                    x(t("textarea", {
                      id: a.parameter_name,
                      "onUpdate:modelValue": (i) => a.parameter_value = i,
                      class: "m-0 w-full border border-solid border-gray-300 bg-white bg-clip-padding px-3 py-1.5 text-gray-700 ease-in-out focus:border-blue-600 focus:bg-white focus:text-gray-700 focus:outline-none",
                      rows: "3",
                      onKeyup: e[9] || (e[9] = (i) => te())
                    }, null, 40, qt), [
                      [f, a.parameter_value]
                    ])
                  ])) : c("", !0)
                ]))), 128))
              ]),
              t("div", Gt, [
                e[49] || (e[49] = t("div", { class: "text-left font-bold text-background-secondary" }, "Termperature Settings :", -1)),
                t("div", Wt, [
                  e[43] || (e[43] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                    _("Max Tokens "),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", Xt, [
                    x(t("input", {
                      "onUpdate:modelValue": e[10] || (e[10] = (a) => v.value.MAX_TOKENS = a),
                      class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 text-xs leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                      type: "number"
                    }, null, 512), [
                      [f, v.value.MAX_TOKENS]
                    ])
                  ])
                ]),
                t("div", Jt, [
                  e[44] || (e[44] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                    _("Temperature "),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", Zt, [
                    x(t("input", {
                      "onUpdate:modelValue": e[11] || (e[11] = (a) => v.value.TEMPERATURE = a),
                      class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 text-xs leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                      type: "number"
                    }, null, 512), [
                      [f, v.value.TEMPERATURE]
                    ])
                  ])
                ]),
                t("div", ea, [
                  e[45] || (e[45] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                    _("TOP_P "),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", ta, [
                    x(t("input", {
                      "onUpdate:modelValue": e[12] || (e[12] = (a) => v.value.TOP_P = a),
                      class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 text-xs leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                      type: "number"
                    }, null, 512), [
                      [f, v.value.TOP_P]
                    ])
                  ])
                ]),
                t("div", aa, [
                  e[46] || (e[46] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                    _("STOP_SEQUENCE "),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", sa, [
                    x(t("input", {
                      "onUpdate:modelValue": e[13] || (e[13] = (a) => v.value.STOP_SEQUENCE = a),
                      class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 text-xs leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                      type: "text"
                    }, null, 512), [
                      [f, v.value.STOP_SEQUENCE]
                    ])
                  ])
                ]),
                t("div", la, [
                  e[47] || (e[47] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                    _("FREQUENCY_PENALTY"),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", oa, [
                    x(t("input", {
                      "onUpdate:modelValue": e[14] || (e[14] = (a) => v.value.FREQUENCY_PENALTY = a),
                      default: "",
                      min: "0",
                      class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 text-xs leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                      type: "number"
                    }, null, 512), [
                      [f, v.value.FREQUENCY_PENALTY]
                    ])
                  ])
                ]),
                t("div", ua, [
                  e[48] || (e[48] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                    _("PRESENCE_PENALTY "),
                    t("span", { class: "text-[15px] text-red-900" }, "*")
                  ], -1)),
                  t("div", na, [
                    x(t("input", {
                      "onUpdate:modelValue": e[15] || (e[15] = (a) => v.value.PRESENCE_PENALTY = a),
                      class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 text-xs leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                      type: "number"
                    }, null, 512), [
                      [f, v.value.PRESENCE_PENALTY]
                    ])
                  ])
                ])
              ]),
              t("div", ra, [
                e[50] || (e[50] = t("div", { class: "text-left font-bold text-background-secondary" }, [
                  _("Client Key(This is required for validating access to prompt execution): "),
                  t("span", { class: "text-[15px] text-red-900" }, "*")
                ], -1)),
                x(t("input", {
                  "onUpdate:modelValue": e[16] || (e[16] = (a) => W.value = a),
                  class: "block w-full appearance-none rounded border border-gray-200 px-4 py-1 leading-tight text-gray-700 focus:border-gray-500 focus:bg-white focus:outline-none",
                  type: "text"
                }, null, 512), [
                  [f, W.value]
                ])
              ]),
              t("div", {
                class: "mt-4 w-full",
                disabled: E.value || !w.value
              }, [
                z.value ? (o(), u("button", {
                  key: 0,
                  class: h(["mr-4 mt-4 inline-block px-4 py-2 text-white", E.value || !w.value ? "cursor-not-allowed bg-gray-500" : "cursor-pointer bg-background-secondary"]),
                  onClick: e[17] || (e[17] = (a) => xe())
                }, " Start Execution ", 2)) : (o(), u("img", ia))
              ], 8, da),
              D.value ? (o(), u("div", ca, [
                t("span", pa, y(D.value), 1)
              ])) : c("", !0),
              E.value ? (o(), u("div", va, [
                e[53] || (e[53] = t("div", { class: "font-bold" }, "Execution Status", -1)),
                P.value && P.value.length ? (o(), u("div", ma, [
                  t("div", null, [
                    _("Your execution id is " + y(E.value) + " and status is ", 1),
                    e[51] || (e[51] = t("span", { class: "font-bold" }, "success", -1))
                  ]),
                  P.value && P.value.length ? (o(), u("table", xa, [
                    t("thead", _a, [
                      t("tr", fa, [
                        e[52] || (e[52] = t("th", { class: "p-2 w-10" }, "S.No.", -1)),
                        (o(!0), u(C, null, j(Q.value, (a, r) => (o(), u("th", {
                          key: r,
                          class: "w-1/2 p-2"
                        }, y(a), 1))), 128))
                      ])
                    ]),
                    t("tbody", ga, [
                      (o(!0), u(C, null, j(P.value, (a, r) => (o(), u("tr", {
                        key: r,
                        class: "flex w-full justify-between border-b hover:bg-gray-300"
                      }, [
                        t("td", ya, y(r + 1), 1),
                        (o(!0), u(C, null, j(Q.value, (i, N) => (o(), u("td", {
                          key: N,
                          class: "w-1/2 p-2"
                        }, y(a[i]), 1))), 128))
                      ]))), 128))
                    ])
                  ])) : c("", !0)
                ])) : (o(), u("div", {
                  key: 1,
                  class: "",
                  innerHTML: F.value
                }, null, 8, ba)),
                ee.value !== "success" ? (o(), u("div", wa, [
                  L.value ? (o(), u("img", ka)) : (o(), u("button", {
                    key: 1,
                    disabled: L.value,
                    class: "mr-4 mt-4 inline-block bg-background-secondary px-4 py-2 text-white",
                    onClick: e[18] || (e[18] = (a) => _e())
                  }, "Check Status", 8, ha))
                ])) : c("", !0)
              ])) : c("", !0)
            ], 64)) : c("", !0)
          ])
        ])
      ])) : (o(), u("div", Ea, "You don't have access"))
    ], 64)) : (o(), u("div", $a, e[54] || (e[54] = [
      t("img", {
        class: "loadercss mx-auto mb-8 mt-3% block",
        src: H,
        alt: "Loader Gif"
      }, null, -1),
      t("p", { class: "loadertextcss ext-genpact-darkest-blue mx-auto mb-10 px-4 leading-normal" }, "Loading...", -1)
    ])));
  }
});
const Fa = /* @__PURE__ */ Re(Pa, [["__scopeId", "data-v-87494603"]]);
export {
  Fa as default
};
