import {
  launchPlot
} from "./chunk-ULPMYS5B.js";
import {
  SearchHandler,
  fillTermWrapper,
  table2col,
  termsettingInit
} from "./chunk-SA7APTJR.js";
import "./chunk-HJ6L54YS.js";
import "./chunk-LSEFWW72.js";
import "./chunk-SKREEF3H.js";
import "./chunk-HYOEWQ5P.js";
import "./chunk-HBW42TDT.js";
import "./chunk-G6O3URDN.js";
import "./chunk-FN5XPUPH.js";
import "./chunk-IIT367QZ.js";
import "./chunk-RZGEKL77.js";
import "./chunk-UI7OCM2A.js";
import "./chunk-YZK37YCC.js";
import "./chunk-7EMWHCVW.js";
import "./chunk-7IYJZZQI.js";
import "./chunk-M3J4MINX.js";
import "./chunk-PF4DSFDR.js";
import "./chunk-QH6W3NVF.js";
import "./chunk-NOEAT6CX.js";
import "./chunk-4UWS5Y3N.js";
import "./chunk-DD4R5P6W.js";
import "./chunk-JNITUVXP.js";
import "./chunk-KSGA62R2.js";
import "./chunk-LOZEKOES.js";
import "./chunk-TOU7EVFQ.js";
import "./chunk-OAWQ6LOO.js";
import "./chunk-TLT4YIG3.js";
import "./chunk-KYBIQBXE.js";
import "./chunk-I6Y4O3RR.js";
import "./chunk-OMR2DT66.js";
import "./chunk-DQC5FFGV.js";
import "./chunk-HFNDKYVF.js";

// plots/summarizeMutationSurvival.ts
async function makeChartBtnMenu(holder, chartsInstance) {
  let dictTw;
  {
    const t = chartsInstance.app.vocabApi.termdbConfig.defaultTw4correlationPlot?.survival;
    if (!t) throw "defaultTw4correlationPlot missing";
    dictTw = structuredClone(t);
    await fillTermWrapper(dictTw, chartsInstance.app.vocabApi);
  }
  const table = table2col({
    holder: holder.append("div"),
    margin: "0px 10px 10px 10px",
    cellPadding: "10px"
  });
  {
    const [td1, td2] = table.addRow();
    td1.text("Mutation Variable");
    const searchDiv = td2.append("div");
    const geneSearchInst = new SearchHandler();
    geneSearchInst.init({
      holder: searchDiv,
      genomeObj: chartsInstance.app.opts.genome,
      app: chartsInstance.app,
      // required to supply "opts.app.vocabApi" for the search ui
      msg: "Hit ENTER to launch plot.",
      callback: async (geneTw) => {
        await fillTermWrapper(geneTw, chartsInstance.app.vocabApi);
        launchPlot({
          tw1: dictTw,
          tw2: geneTw,
          chartsInstance,
          holder
        });
      }
    });
    searchDiv.style("padding", "0px 0px 5px 0px");
  }
  {
    const [td1, td2] = table.addRow();
    td1.text("Compare Mutations Against");
    const pillDiv = td2.append("div");
    const pill = await termsettingInit({
      usecase: { target: "survival", detail: "term" },
      // limit to survival terms
      vocabApi: chartsInstance.app.vocabApi,
      holder: pillDiv,
      callback: async (tw) => {
        await pill.main(tw);
        dictTw = tw;
      }
    });
    await fillTermWrapper(dictTw, chartsInstance.app.vocabApi);
    await pill.main(dictTw);
  }
}
export {
  makeChartBtnMenu
};
//# sourceMappingURL=summarizeMutationSurvival-3WBT5TXG.js.map
