@universe-platform/ui 0.1.0-beta.25 → 0.1.0-beta.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -7718,11 +7718,969 @@ function TableBlock(props) {
7718
7718
  return /* @__PURE__ */ jsx13(TableBlockClient, __spreadValues({}, props));
7719
7719
  }
7720
7720
 
7721
+ // src/components/PlacementBlock/PlacementBlock.tsx
7722
+ import { useState as useState14, useEffect as useEffect12, useRef as useRef11, useCallback as useCallback12, useMemo as useMemo7 } from "react";
7723
+ import { AgGridReact } from "ag-grid-react";
7724
+ import {
7725
+ ModuleRegistry,
7726
+ AllCommunityModule
7727
+ } from "ag-grid-community";
7728
+
7729
+ // src/components/PlacementBlock/PlacementSettings.tsx
7730
+ import React13 from "react";
7731
+
7732
+ // src/components/PlacementBlock/placementColumns.ts
7733
+ var RELATION_SEP = "::";
7734
+ var RELATION_LABEL_KEY = "__label";
7735
+ var NON_TEXT_TYPES = ["RELATION", "SUB_TABLE", "GOOGLE_DRIVE_FILE", "GOOGLE_CONTACT", "LINK"];
7736
+ var tableColumns = (table) => (table == null ? void 0 : table.fields) || (table == null ? void 0 : table.columns) || [];
7737
+ var isUserColumn = (c) => !!(c == null ? void 0 : c.name) && c.name !== "_id" && c.name !== "id" && !c.isHidden;
7738
+ var buildRelationRef = (relationColumn, field) => `${relationColumn}${RELATION_SEP}${field}`;
7739
+ function parseColumnRef(ref) {
7740
+ const i = ref.indexOf(RELATION_SEP);
7741
+ if (i < 0) return { field: ref };
7742
+ return { relationColumn: ref.slice(0, i), field: ref.slice(i + RELATION_SEP.length) };
7743
+ }
7744
+ var columnRefLabel = (ref) => {
7745
+ if (!ref) return "";
7746
+ const { relationColumn, field } = parseColumnRef(ref);
7747
+ return relationColumn ? `${relationColumn} \u203A ${field}` : field;
7748
+ };
7749
+ function buildColumnOptions(table, allTables, opts = {}) {
7750
+ var _a, _b;
7751
+ const { textOnly = false, includeRelated = true } = opts;
7752
+ const result = [];
7753
+ for (const col of tableColumns(table).filter(isUserColumn)) {
7754
+ if (textOnly && NON_TEXT_TYPES.includes(col.type)) continue;
7755
+ result.push({
7756
+ id: col.name,
7757
+ name: col.name,
7758
+ type: col.type,
7759
+ description: col.type ? `\u05E1\u05D5\u05D2 \u05E9\u05D3\u05D4: ${col.type}` : void 0
7760
+ });
7761
+ }
7762
+ if (!includeRelated) return result;
7763
+ for (const rel of tableColumns(table).filter(isUserColumn)) {
7764
+ if (rel.type !== "RELATION") continue;
7765
+ const refId = (_a = rel.config) == null ? void 0 : _a.referencedTableId;
7766
+ const refTable = refId ? allTables == null ? void 0 : allTables.find((t) => t.id === refId) : void 0;
7767
+ if (!refTable) continue;
7768
+ const fromName = refTable.name || ((_b = rel.config) == null ? void 0 : _b.referencedTableName) || "";
7769
+ for (const col of tableColumns(refTable).filter(isUserColumn)) {
7770
+ if (NON_TEXT_TYPES.includes(col.type)) continue;
7771
+ result.push({
7772
+ id: buildRelationRef(rel.name, col.name),
7773
+ name: `${rel.name} \u203A ${col.name}`,
7774
+ type: col.type,
7775
+ description: `\u05DE\u05D8\u05D1\u05DC\u05EA ${refTable.isGlobal ? "\u05DE\u05E2\u05E8\u05DB\u05EA " : ""}"${fromName}"`,
7776
+ viaRelation: rel.name,
7777
+ fromTableName: fromName,
7778
+ fromGlobalTable: !!refTable.isGlobal
7779
+ });
7780
+ }
7781
+ }
7782
+ return result;
7783
+ }
7784
+ function enrichRowsWithRelations(rows, columns, relationOptions) {
7785
+ const relCols = (columns || []).filter((c) => (c == null ? void 0 : c.type) === "RELATION" && (c == null ? void 0 : c.name));
7786
+ if (!relCols.length || !relationOptions) return rows;
7787
+ const idOf = (v) => {
7788
+ var _a, _b, _c;
7789
+ return String((_c = (_b = (_a = v == null ? void 0 : v.id) != null ? _a : v == null ? void 0 : v._id) != null ? _b : v) != null ? _c : "");
7790
+ };
7791
+ const join = (vals) => vals.filter((v) => v !== null && v !== void 0 && v !== "").map((v) => {
7792
+ var _a, _b;
7793
+ return typeof v === "object" ? String((_b = (_a = v.label) != null ? _a : v.name) != null ? _b : "") : String(v);
7794
+ }).filter(Boolean).join(", ");
7795
+ return rows.map((row) => {
7796
+ var _a;
7797
+ const extra = {};
7798
+ for (const rel of relCols) {
7799
+ const options = relationOptions[rel.name] || [];
7800
+ if (!options.length) continue;
7801
+ const byId = new Map(options.map((o) => [String(o.id), o]));
7802
+ const raw = (_a = row.data) == null ? void 0 : _a[rel.name];
7803
+ const values = Array.isArray(raw) ? raw : raw === null || raw === void 0 || raw === "" ? [] : [raw];
7804
+ const linked = values.map((v) => byId.get(idOf(v))).filter(Boolean);
7805
+ if (!linked.length) continue;
7806
+ extra[`${rel.name}${RELATION_SEP}${RELATION_LABEL_KEY}`] = join(linked.map((o) => o.label));
7807
+ const fieldNames = /* @__PURE__ */ new Set();
7808
+ linked.forEach((o) => Object.keys(o.data || {}).forEach((k) => fieldNames.add(k)));
7809
+ fieldNames.forEach((f) => {
7810
+ extra[`${rel.name}${RELATION_SEP}${f}`] = join(linked.map((o) => {
7811
+ var _a2;
7812
+ return (_a2 = o.data) == null ? void 0 : _a2[f];
7813
+ }));
7814
+ });
7815
+ }
7816
+ return Object.keys(extra).length ? __spreadProps(__spreadValues({}, row), { data: __spreadValues(__spreadValues({}, row.data), extra) }) : row;
7817
+ });
7818
+ }
7819
+ function readColumnValue(data, ref) {
7820
+ if (!data || !ref) return void 0;
7821
+ const label = data[`${ref}${RELATION_SEP}${RELATION_LABEL_KEY}`];
7822
+ if (label !== void 0) return label;
7823
+ return data[ref];
7824
+ }
7825
+
7826
+ // src/components/PlacementBlock/PlacementSettings.tsx
7827
+ import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
7828
+ var DEFAULT_PLACEMENT_STATUS_COLORS = [
7829
+ { id: "1", hex: "#10b981", label: "\u05DE\u05EA\u05D0\u05D9\u05DD / \u05D0\u05D5\u05E9\u05E8" },
7830
+ { id: "2", hex: "#f59e0b", label: "\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05E8\u05D0\u05D9\u05D5\u05DF" },
7831
+ { id: "3", hex: "#ef4444", label: "\u05E4\u05E0\u05D5\u05D9 / \u05DC\u05D0 \u05E8\u05DC\u05D5\u05D5\u05E0\u05D8\u05D9" }
7832
+ ];
7833
+ function resolveDefaultStatusId(list, wanted) {
7834
+ var _a, _b;
7835
+ if (wanted && list.some((s) => s.id === wanted)) return wanted;
7836
+ if (list.some((s) => s.id === "3")) return "3";
7837
+ return (_b = (_a = list[0]) == null ? void 0 : _a.id) != null ? _b : "";
7838
+ }
7839
+ var SummaryRow = ({ label, value, hint }) => /* @__PURE__ */ jsxs13("div", { className: "flex items-start gap-2 text-sm", children: [
7840
+ /* @__PURE__ */ jsx14("span", { className: value ? "text-emerald-600" : "text-slate-300", children: value ? "\u2713" : "\u25CB" }),
7841
+ /* @__PURE__ */ jsxs13("span", { className: "text-slate-500 shrink-0", children: [
7842
+ label,
7843
+ ":"
7844
+ ] }),
7845
+ value ? /* @__PURE__ */ jsxs13("span", { className: "font-semibold text-slate-800 break-words", children: [
7846
+ value,
7847
+ hint && /* @__PURE__ */ jsx14("span", { className: "mr-2 text-[11px] font-normal text-indigo-600", children: hint })
7848
+ ] }) : /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "\u05D8\u05E8\u05DD \u05E0\u05D1\u05D7\u05E8" })
7849
+ ] });
7850
+ var PlacementStatusEditor = ({ config, onChange }) => {
7851
+ var _a;
7852
+ const radioName = `placement-default-status-${React13.useId()}`;
7853
+ const statuses = ((_a = config.statusColors) == null ? void 0 : _a.length) ? config.statusColors : DEFAULT_PLACEMENT_STATUS_COLORS;
7854
+ const defaultStatusId = resolveDefaultStatusId(statuses, config.defaultReturnStatusId);
7855
+ const setStatuses = (next, defId = defaultStatusId) => {
7856
+ var _a2;
7857
+ return onChange(__spreadProps(__spreadValues({}, config), {
7858
+ statusColors: next,
7859
+ defaultReturnStatusId: next.some((st) => st.id === defId) ? defId : (_a2 = next[0]) == null ? void 0 : _a2.id
7860
+ }));
7861
+ };
7862
+ const updateStatus = (id, patch) => setStatuses(statuses.map((st) => st.id === id ? __spreadValues(__spreadValues({}, st), patch) : st));
7863
+ const addStatus = () => setStatuses([...statuses, { id: `s${Date.now().toString(36)}`, hex: "#3b82f6", label: "\u05E1\u05D8\u05D8\u05D5\u05E1 \u05D7\u05D3\u05E9" }]);
7864
+ const removeStatus = (id) => {
7865
+ if (statuses.length > 1) setStatuses(statuses.filter((st) => st.id !== id));
7866
+ };
7867
+ const moveStatus = (index, dir) => {
7868
+ const j = index + dir;
7869
+ if (j < 0 || j >= statuses.length) return;
7870
+ const next = [...statuses];
7871
+ [next[index], next[j]] = [next[j], next[index]];
7872
+ setStatuses(next);
7873
+ };
7874
+ return /* @__PURE__ */ jsxs13("div", { className: "p-4 border border-emerald-200 bg-emerald-50/50 rounded space-y-3", children: [
7875
+ /* @__PURE__ */ jsx14("h4", { className: "font-semibold text-emerald-900", children: "\u05E9\u05DC\u05D1 3: \u05E1\u05D8\u05D8\u05D5\u05E1\u05D9\u05DD (\u05D4\u05E2\u05D9\u05D2\u05D5\u05DC\u05D9\u05DD \u05D4\u05E6\u05D1\u05E2\u05D5\u05E0\u05D9\u05D9\u05DD)" }),
7876
+ /* @__PURE__ */ jsx14("p", { className: "text-xs text-slate-500", children: "\u05DC\u05D7\u05D9\u05E6\u05D4 \u05E2\u05DC \u05E2\u05D9\u05D2\u05D5\u05DC \u05D1\u05E8\u05DB\u05D9\u05D1 \u05DE\u05D7\u05DC\u05D9\u05E4\u05D4 \u05D1\u05D9\u05DF \u05D4\u05E1\u05D8\u05D8\u05D5\u05E1\u05D9\u05DD \u05DC\u05E4\u05D9 \u05D4\u05E1\u05D3\u05E8 \u05E9\u05DB\u05D0\u05DF. \u05D4\u05D8\u05E7\u05E1\u05D8 \u05DE\u05D5\u05E4\u05D9\u05E2 \u05D1\u05D1\u05D5\u05E2\u05D4 \u05DB\u05E9\u05D4\u05E2\u05DB\u05D1\u05E8 \u05E2\u05D5\u05DE\u05D3 \u05DE\u05E2\u05DC \u05D4\u05E2\u05D9\u05D2\u05D5\u05DC." }),
7877
+ /* @__PURE__ */ jsx14("div", { className: "space-y-2", children: statuses.map((st, i) => /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2 bg-white border rounded p-2", children: [
7878
+ /* @__PURE__ */ jsx14(
7879
+ "input",
7880
+ {
7881
+ type: "color",
7882
+ value: st.hex,
7883
+ onChange: (e) => updateStatus(st.id, { hex: e.target.value }),
7884
+ className: "w-9 h-9 p-0 border rounded cursor-pointer shrink-0",
7885
+ "aria-label": "\u05E6\u05D1\u05E2"
7886
+ }
7887
+ ),
7888
+ /* @__PURE__ */ jsx14(
7889
+ "input",
7890
+ {
7891
+ type: "text",
7892
+ value: st.label,
7893
+ onChange: (e) => updateStatus(st.id, { label: e.target.value }),
7894
+ placeholder: "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05D1\u05D5\u05E2\u05D4 (\u05DC\u05DE\u05E9\u05DC: \u05D0\u05D5\u05DC\u05D9)",
7895
+ className: "flex-1 min-w-0 border p-2 rounded text-sm"
7896
+ }
7897
+ ),
7898
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-xs text-slate-600 shrink-0 cursor-pointer", title: "\u05D4\u05E1\u05D8\u05D8\u05D5\u05E1 \u05D4\u05D4\u05EA\u05D7\u05DC\u05EA\u05D9, \u05D5\u05D2\u05DD \u05D6\u05D4 \u05E9\u05D0\u05DC\u05D9\u05D5 \u05D7\u05D5\u05D6\u05E8 \u05DE\u05D5\u05E2\u05DE\u05D3 \u05E9\u05DE\u05D5\u05D7\u05D6\u05E8 \u05DC\u05E8\u05E9\u05D9\u05DE\u05EA \u05D4\u05DE\u05E7\u05D5\u05E8", children: [
7899
+ /* @__PURE__ */ jsx14(
7900
+ "input",
7901
+ {
7902
+ type: "radio",
7903
+ name: radioName,
7904
+ checked: defaultStatusId === st.id,
7905
+ onChange: () => setStatuses(statuses, st.id)
7906
+ }
7907
+ ),
7908
+ "\u05D1\u05E8\u05D9\u05E8\u05EA \u05DE\u05D7\u05D3\u05DC"
7909
+ ] }),
7910
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => moveStatus(i, -1), disabled: i === 0, className: "px-2 py-1 border rounded text-xs disabled:opacity-30", "aria-label": "\u05D4\u05D6\u05D6 \u05DC\u05DE\u05E2\u05DC\u05D4", children: "\u25B2" }),
7911
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => moveStatus(i, 1), disabled: i === statuses.length - 1, className: "px-2 py-1 border rounded text-xs disabled:opacity-30", "aria-label": "\u05D4\u05D6\u05D6 \u05DC\u05DE\u05D8\u05D4", children: "\u25BC" }),
7912
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => removeStatus(st.id), disabled: statuses.length <= 1, className: "px-2 py-1 border border-rose-300 text-rose-600 rounded text-xs disabled:opacity-30", "aria-label": "\u05DE\u05D7\u05E7 \u05E1\u05D8\u05D8\u05D5\u05E1", children: "\u2715" })
7913
+ ] }, st.id)) }),
7914
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-3", children: [
7915
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: addStatus, className: "px-3 py-1.5 rounded text-sm font-medium bg-emerald-600 text-white hover:bg-emerald-700", children: "+ \u05D4\u05D5\u05E1\u05E3 \u05E1\u05D8\u05D8\u05D5\u05E1" }),
7916
+ /* @__PURE__ */ jsx14("button", { type: "button", onClick: () => setStatuses(DEFAULT_PLACEMENT_STATUS_COLORS, "3"), className: "text-xs text-slate-500 underline", children: "\u05D0\u05E4\u05E1 \u05DC\u05D1\u05E8\u05D9\u05E8\u05EA \u05D4\u05DE\u05D7\u05D3\u05DC" })
7917
+ ] })
7918
+ ] });
7919
+ };
7920
+ var PlacementSettings = ({ config, onChange, tables }) => {
7921
+ const sourceTable = tables == null ? void 0 : tables.find((t) => t.id === config.sourceTableId);
7922
+ const targetTable = tables == null ? void 0 : tables.find((t) => t.id === config.targetTableId);
7923
+ const sourceColumns = buildColumnOptions(sourceTable, tables);
7924
+ const targetTextColumns = buildColumnOptions(targetTable, tables, { textOnly: true });
7925
+ const targetColumns = buildColumnOptions(targetTable, tables, { includeRelated: false });
7926
+ const relatedHint = (ref, cols) => {
7927
+ const o = cols.find((c) => c.id === ref);
7928
+ return (o == null ? void 0 : o.viaRelation) ? `\u05DE\u05D8\u05D1\u05DC\u05EA ${o.fromGlobalTable ? "\u05DE\u05E2\u05E8\u05DB\u05EA " : ""}${o.fromTableName}` : void 0;
7929
+ };
7930
+ const handleSourceTableChange = (value) => {
7931
+ onChange(__spreadProps(__spreadValues({}, config), { sourceTableId: value, sourceDisplayFieldId: "" }));
7932
+ };
7933
+ const handleTargetTableChange = (value) => {
7934
+ onChange(__spreadProps(__spreadValues({}, config), {
7935
+ targetTableId: value,
7936
+ targetFilterField1Id: "",
7937
+ targetFilterField2Id: "",
7938
+ targetSelectorFieldId: "",
7939
+ targetAssignmentFieldId: ""
7940
+ }));
7941
+ };
7942
+ const optionsFor = (cols, currentKey) => {
7943
+ const used = [
7944
+ config.targetFilterField1Id,
7945
+ config.targetFilterField2Id,
7946
+ config.targetSelectorFieldId,
7947
+ config.targetAssignmentFieldId
7948
+ ];
7949
+ return cols.filter((c) => c.id === config[currentKey] || !used.includes(c.id));
7950
+ };
7951
+ const selectClass = "w-full border p-2 rounded bg-white text-sm";
7952
+ return /* @__PURE__ */ jsxs13("div", { className: "p-4 border rounded shadow-sm bg-gray-50 space-y-6", dir: "rtl", children: [
7953
+ /* @__PURE__ */ jsx14("h3", { className: "text-lg font-bold", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E8\u05DB\u05D9\u05D1 \u05E9\u05D9\u05D1\u05D5\u05E5" }),
7954
+ /* @__PURE__ */ jsxs13("div", { className: "p-4 border border-indigo-200 bg-indigo-50/60 rounded space-y-2", "aria-live": "polite", children: [
7955
+ /* @__PURE__ */ jsx14("h4", { className: "font-semibold text-indigo-900 text-sm", children: "\u05D4\u05D1\u05D7\u05D9\u05E8\u05D5\u05EA \u05E9\u05E0\u05E2\u05E9\u05D5 \u05E2\u05D3 \u05DB\u05D4" }),
7956
+ /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-1.5", children: [
7957
+ /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
7958
+ /* @__PURE__ */ jsx14("div", { className: "text-xs font-bold text-slate-500", children: "\u05DE\u05E7\u05D5\u05E8" }),
7959
+ /* @__PURE__ */ jsx14(SummaryRow, { label: "\u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8", value: sourceTable == null ? void 0 : sourceTable.name }),
7960
+ /* @__PURE__ */ jsx14(
7961
+ SummaryRow,
7962
+ {
7963
+ label: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05DE\u05D9\u05D3\u05E2",
7964
+ value: columnRefLabel(config.sourceDisplayFieldId),
7965
+ hint: relatedHint(config.sourceDisplayFieldId, sourceColumns)
7966
+ }
7967
+ )
7968
+ ] }),
7969
+ /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
7970
+ /* @__PURE__ */ jsx14("div", { className: "text-xs font-bold text-slate-500", children: "\u05D9\u05E2\u05D3" }),
7971
+ /* @__PURE__ */ jsx14(SummaryRow, { label: "\u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3", value: targetTable == null ? void 0 : targetTable.name }),
7972
+ /* @__PURE__ */ jsx14(
7973
+ SummaryRow,
7974
+ {
7975
+ label: "\u05E1\u05D9\u05E0\u05D5\u05DF 1",
7976
+ value: columnRefLabel(config.targetFilterField1Id),
7977
+ hint: relatedHint(config.targetFilterField1Id, targetTextColumns)
7978
+ }
7979
+ ),
7980
+ /* @__PURE__ */ jsx14(
7981
+ SummaryRow,
7982
+ {
7983
+ label: "\u05E1\u05D9\u05E0\u05D5\u05DF 2",
7984
+ value: columnRefLabel(config.targetFilterField2Id),
7985
+ hint: relatedHint(config.targetFilterField2Id, targetTextColumns)
7986
+ }
7987
+ ),
7988
+ /* @__PURE__ */ jsx14(
7989
+ SummaryRow,
7990
+ {
7991
+ label: "\u05D1\u05D7\u05D9\u05E8\u05EA \u05E8\u05E9\u05D5\u05DE\u05D4",
7992
+ value: columnRefLabel(config.targetSelectorFieldId),
7993
+ hint: relatedHint(config.targetSelectorFieldId, targetTextColumns)
7994
+ }
7995
+ ),
7996
+ /* @__PURE__ */ jsx14(SummaryRow, { label: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05E9\u05D9\u05D1\u05D5\u05E5", value: config.targetAssignmentFieldId })
7997
+ ] })
7998
+ ] })
7999
+ ] }),
8000
+ /* @__PURE__ */ jsxs13("div", { className: "p-4 border border-slate-200 bg-white rounded space-y-3", children: [
8001
+ /* @__PURE__ */ jsx14("h4", { className: "font-semibold text-slate-800", children: "\u05E9\u05DC\u05D1 1: \u05D8\u05D1\u05DC\u05EA \u05D4\u05DE\u05E7\u05D5\u05E8" }),
8002
+ /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-2 gap-4", children: [
8003
+ /* @__PURE__ */ jsxs13("div", { children: [
8004
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 (\u05DC\u05DE\u05E9\u05DC: \u05DE\u05D3\u05E8\u05D9\u05DB\u05D9\u05DD):" }),
8005
+ /* @__PURE__ */ jsxs13(
8006
+ "select",
8007
+ {
8008
+ className: selectClass,
8009
+ value: config.sourceTableId || "",
8010
+ onChange: (e) => handleSourceTableChange(e.target.value),
8011
+ children: [
8012
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 --" }),
8013
+ tables == null ? void 0 : tables.map((t) => /* @__PURE__ */ jsx14("option", { value: t.id, children: t.name }, t.id))
8014
+ ]
8015
+ }
8016
+ )
8017
+ ] }),
8018
+ /* @__PURE__ */ jsxs13("div", { children: [
8019
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05D4 \u05DC\u05E7\u05D7\u05EA \u05DE\u05DE\u05E0\u05D4 \u05DE\u05D9\u05D3\u05E2 (\u05DC\u05DE\u05E9\u05DC: \u05E9\u05DD \u05DE\u05D3\u05E8\u05D9\u05DA):" }),
8020
+ /* @__PURE__ */ jsxs13(
8021
+ "select",
8022
+ {
8023
+ className: selectClass,
8024
+ disabled: !config.sourceTableId,
8025
+ value: config.sourceDisplayFieldId || "",
8026
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { sourceDisplayFieldId: e.target.value })),
8027
+ children: [
8028
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05EA \u05DE\u05E7\u05D5\u05E8 --" }),
8029
+ sourceColumns.map((f) => /* @__PURE__ */ jsx14("option", { value: f.id, children: f.name }, f.id))
8030
+ ]
8031
+ }
8032
+ )
8033
+ ] })
8034
+ ] })
8035
+ ] }),
8036
+ /* @__PURE__ */ jsxs13("div", { className: "p-4 border border-blue-200 bg-blue-50 rounded space-y-3", children: [
8037
+ /* @__PURE__ */ jsx14("h4", { className: "font-semibold text-blue-900", children: "\u05E9\u05DC\u05D1 2: \u05D8\u05D1\u05DC\u05EA \u05D4\u05D9\u05E2\u05D3" }),
8038
+ /* @__PURE__ */ jsxs13("div", { children: [
8039
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3:" }),
8040
+ /* @__PURE__ */ jsxs13(
8041
+ "select",
8042
+ {
8043
+ className: selectClass,
8044
+ value: config.targetTableId || "",
8045
+ onChange: (e) => handleTargetTableChange(e.target.value),
8046
+ children: [
8047
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3 --" }),
8048
+ tables == null ? void 0 : tables.map((t) => /* @__PURE__ */ jsx14("option", { value: t.id, children: t.name }, t.id))
8049
+ ]
8050
+ }
8051
+ )
8052
+ ] }),
8053
+ config.targetTableId && /* @__PURE__ */ jsxs13(Fragment3, { children: [
8054
+ /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-3 gap-4", children: [
8055
+ /* @__PURE__ */ jsxs13("div", { children: [
8056
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05E1\u05D9\u05E0\u05D5\u05DF 1:" }),
8057
+ /* @__PURE__ */ jsxs13(
8058
+ "select",
8059
+ {
8060
+ className: selectClass,
8061
+ value: config.targetFilterField1Id || "",
8062
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetFilterField1Id: e.target.value })),
8063
+ children: [
8064
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4 --" }),
8065
+ optionsFor(targetTextColumns, "targetFilterField1Id").map((f) => /* @__PURE__ */ jsx14("option", { value: f.id, children: f.name }, f.id))
8066
+ ]
8067
+ }
8068
+ )
8069
+ ] }),
8070
+ /* @__PURE__ */ jsxs13("div", { children: [
8071
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05E1\u05D9\u05E0\u05D5\u05DF 2:" }),
8072
+ /* @__PURE__ */ jsxs13(
8073
+ "select",
8074
+ {
8075
+ className: selectClass,
8076
+ value: config.targetFilterField2Id || "",
8077
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetFilterField2Id: e.target.value })),
8078
+ children: [
8079
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4 --" }),
8080
+ optionsFor(targetTextColumns, "targetFilterField2Id").map((f) => /* @__PURE__ */ jsx14("option", { value: f.id, children: f.name }, f.id))
8081
+ ]
8082
+ }
8083
+ )
8084
+ ] }),
8085
+ /* @__PURE__ */ jsxs13("div", { children: [
8086
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D1\u05D7\u05D9\u05E8\u05EA \u05D4\u05E8\u05E9\u05D5\u05DE\u05D4:" }),
8087
+ /* @__PURE__ */ jsxs13(
8088
+ "select",
8089
+ {
8090
+ className: selectClass,
8091
+ value: config.targetSelectorFieldId || "",
8092
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetSelectorFieldId: e.target.value })),
8093
+ children: [
8094
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4 --" }),
8095
+ optionsFor(targetTextColumns, "targetSelectorFieldId").map((f) => /* @__PURE__ */ jsx14("option", { value: f.id, children: f.name }, f.id))
8096
+ ]
8097
+ }
8098
+ )
8099
+ ] })
8100
+ ] }),
8101
+ /* @__PURE__ */ jsxs13("div", { children: [
8102
+ /* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium mb-1", children: "\u05E2\u05DE\u05D5\u05D3\u05D4 \u05D1\u05D8\u05D1\u05DC\u05EA \u05D4\u05D9\u05E2\u05D3 \u05D0\u05DC\u05D9\u05D4 \u05D9\u05D9\u05DB\u05E0\u05E1 \u05D4\u05DE\u05D9\u05D3\u05E2 \u05DE\u05D4\u05DE\u05E7\u05D5\u05E8:" }),
8103
+ /* @__PURE__ */ jsxs13(
8104
+ "select",
8105
+ {
8106
+ className: selectClass,
8107
+ value: config.targetAssignmentFieldId || "",
8108
+ onChange: (e) => onChange(__spreadProps(__spreadValues({}, config), { targetAssignmentFieldId: e.target.value })),
8109
+ children: [
8110
+ /* @__PURE__ */ jsx14("option", { value: "", disabled: true, children: "-- \u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3 --" }),
8111
+ optionsFor(targetColumns, "targetAssignmentFieldId").map((f) => /* @__PURE__ */ jsx14("option", { value: f.id, children: f.name }, f.id))
8112
+ ]
8113
+ }
8114
+ )
8115
+ ] })
8116
+ ] })
8117
+ ] }),
8118
+ /* @__PURE__ */ jsx14(PlacementStatusEditor, { config, onChange })
8119
+ ] });
8120
+ };
8121
+
8122
+ // src/components/PlacementBlock/PlacementBlock.tsx
8123
+ import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
8124
+ ModuleRegistry.registerModules([AllCommunityModule]);
8125
+ var FETCH_LIMIT = 1e3;
8126
+ function normalizeRows(records) {
8127
+ return (records || []).filter(Boolean).map((r) => {
8128
+ var _c, _d, _e;
8129
+ const data = r.data && typeof r.data === "object" ? r.data : r.values && typeof r.values === "object" ? r.values : ((_a) => {
8130
+ var _b = _a, { id, _id, recordId } = _b, rest = __objRest(_b, ["id", "_id", "recordId"]);
8131
+ return rest;
8132
+ })(r);
8133
+ return { id: String((_e = (_d = (_c = r.id) != null ? _c : r._id) != null ? _d : r.recordId) != null ? _e : ""), data };
8134
+ }).filter((r) => r.id);
8135
+ }
8136
+ function unpackTableResponse(res) {
8137
+ var _a, _b, _c, _d, _e, _f;
8138
+ const rawRecords = Array.isArray(res) ? res : Array.isArray(res == null ? void 0 : res.records) ? res.records : Array.isArray(res == null ? void 0 : res.data) ? res.data : Array.isArray((_a = res == null ? void 0 : res.data) == null ? void 0 : _a.records) ? res.data.records : Array.isArray((_b = res == null ? void 0 : res.data) == null ? void 0 : _b.data) ? res.data.data : [];
8139
+ const columns = ((_c = res == null ? void 0 : res.schema) == null ? void 0 : _c.columns) || ((_e = (_d = res == null ? void 0 : res.data) == null ? void 0 : _d.schema) == null ? void 0 : _e.columns) || [];
8140
+ const opts = (res == null ? void 0 : res.relationOptions) || ((_f = res == null ? void 0 : res.data) == null ? void 0 : _f.relationOptions) || {};
8141
+ return {
8142
+ rows: enrichRowsWithRelations(normalizeRows(rawRecords), columns, opts),
8143
+ columns,
8144
+ relationOptions: opts
8145
+ };
8146
+ }
8147
+ function cellText(value) {
8148
+ var _a, _b, _c, _d;
8149
+ if (value === null || value === void 0) return "";
8150
+ if (Array.isArray(value)) return value.map(cellText).join(", ");
8151
+ if (typeof value === "object") return String((_d = (_c = (_b = (_a = value.title) != null ? _a : value.label) != null ? _b : value.name) != null ? _c : value.id) != null ? _d : "[\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8]");
8152
+ return String(value);
8153
+ }
8154
+ var ColorDotRenderer = (props) => {
8155
+ const item = props.data;
8156
+ if (!item) return null;
8157
+ const { statuses, defaultStatusId } = props;
8158
+ const status = statuses.find((c) => c.id === item.statusId) || statuses.find((c) => c.id === defaultStatusId) || statuses[0];
8159
+ if (!status) return null;
8160
+ return /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx15(
8161
+ "button",
8162
+ {
8163
+ type: "button",
8164
+ onClick: () => props.onCycle(item.id),
8165
+ title: status.label,
8166
+ "aria-label": status.label,
8167
+ className: "w-5 h-5 rounded-full border shadow-sm transition-transform hover:scale-110 cursor-pointer",
8168
+ style: { backgroundColor: status.hex, borderColor: "rgba(0,0,0,0.15)" }
8169
+ }
8170
+ ) });
8171
+ };
8172
+ var CheckCellRenderer = (props) => {
8173
+ if (!props.data) return null;
8174
+ return /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-center h-full", children: /* @__PURE__ */ jsx15(
8175
+ "input",
8176
+ {
8177
+ type: "checkbox",
8178
+ className: "w-4 h-4 cursor-pointer accent-blue-600",
8179
+ checked: !!props.data.__checked,
8180
+ onChange: () => props.onToggle(props.data.id),
8181
+ "aria-label": "\u05D1\u05D7\u05D9\u05E8\u05EA \u05DE\u05D5\u05E2\u05DE\u05D3"
8182
+ }
8183
+ ) });
8184
+ };
8185
+ var CheckHeader = (props) => /* @__PURE__ */ jsx15("div", { className: "flex items-center justify-center w-full", children: /* @__PURE__ */ jsx15(
8186
+ "input",
8187
+ {
8188
+ type: "checkbox",
8189
+ className: "w-4 h-4 cursor-pointer accent-blue-600",
8190
+ ref: (el) => {
8191
+ if (el) el.indeterminate = props.someChecked && !props.allChecked;
8192
+ },
8193
+ checked: props.allChecked,
8194
+ onChange: props.onToggleAll,
8195
+ "aria-label": "\u05D1\u05D7\u05D9\u05E8\u05EA \u05DB\u05DC \u05D4\u05DE\u05D5\u05E2\u05DE\u05D3\u05D9\u05DD"
8196
+ }
8197
+ ) });
8198
+ var PlacementBlock = (props) => {
8199
+ var _a, _b;
8200
+ const { executeAction, fetchSourceData, fetchTargetData, updateAssignment, className = "" } = props;
8201
+ const config = useMemo7(() => {
8202
+ var _a2, _b2, _c;
8203
+ const raw = (_a2 = props.config) != null ? _a2 : props.settings;
8204
+ if (!raw) return void 0;
8205
+ return ((_b2 = raw.config) == null ? void 0 : _b2.sourceTableId) || ((_c = raw.config) == null ? void 0 : _c.targetTableId) ? raw.config : raw;
8206
+ }, [props.config, props.settings]);
8207
+ const statuses = useMemo7(
8208
+ () => {
8209
+ var _a2;
8210
+ return ((_a2 = config == null ? void 0 : config.statusColors) == null ? void 0 : _a2.length) ? config.statusColors : DEFAULT_PLACEMENT_STATUS_COLORS;
8211
+ },
8212
+ [config == null ? void 0 : config.statusColors]
8213
+ );
8214
+ const defaultStatusId = useMemo7(
8215
+ () => resolveDefaultStatusId(statuses, config == null ? void 0 : config.defaultReturnStatusId),
8216
+ [statuses, config == null ? void 0 : config.defaultReturnStatusId]
8217
+ );
8218
+ const sourceTableId = config == null ? void 0 : config.sourceTableId;
8219
+ const targetTableId = config == null ? void 0 : config.targetTableId;
8220
+ const displayField = (config == null ? void 0 : config.sourceDisplayFieldId) || "name";
8221
+ const assignmentField = config == null ? void 0 : config.targetAssignmentFieldId;
8222
+ const executeActionRef = useRef11(executeAction);
8223
+ executeActionRef.current = executeAction;
8224
+ const legacyRef = useRef11({ fetchSourceData, fetchTargetData, updateAssignment });
8225
+ legacyRef.current = { fetchSourceData, fetchTargetData, updateAssignment };
8226
+ const [sourceRows, setSourceRows] = useState14([]);
8227
+ const [sourceColumns, setSourceColumns] = useState14([]);
8228
+ const [targetRows, setTargetRows] = useState14([]);
8229
+ const [targetColumns, setTargetColumns] = useState14([]);
8230
+ const [targetRelOptions, setTargetRelOptions] = useState14({});
8231
+ const [selectedTargetId, setSelectedTargetId] = useState14("");
8232
+ const [candidateIds, setCandidateIds] = useState14([]);
8233
+ const [checkedIds, setCheckedIds] = useState14([]);
8234
+ const [isSaving, setIsSaving] = useState14(false);
8235
+ const [sourceSearch, setSourceSearch] = useState14("");
8236
+ const [candidateSearch, setCandidateSearch] = useState14("");
8237
+ const [statusMap, setStatusMap] = useState14({});
8238
+ const [isLoading, setIsLoading] = useState14(false);
8239
+ const [loadError, setLoadError] = useState14(null);
8240
+ const [saveError, setSaveError] = useState14(null);
8241
+ const [targetFilters, setTargetFilters] = useState14({});
8242
+ const loadTable = useCallback12(async (tableId, kind) => {
8243
+ const exec = executeActionRef.current;
8244
+ if (exec) {
8245
+ const res = await exec("FETCH_TABLE_DATA", { tableId, tableMetaId: tableId, limit: FETCH_LIMIT, skip: 0 });
8246
+ return unpackTableResponse(res);
8247
+ }
8248
+ const legacy = kind === "source" ? legacyRef.current.fetchSourceData : legacyRef.current.fetchTargetData;
8249
+ if (legacy) {
8250
+ const raw = await legacy(tableId);
8251
+ return { rows: normalizeRows(raw), columns: [], relationOptions: {} };
8252
+ }
8253
+ throw new Error("executeAction \u05DC\u05D0 \u05D4\u05D5\u05E2\u05D1\u05E8 \u05DC\u05E8\u05DB\u05D9\u05D1 \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5");
8254
+ }, []);
8255
+ useEffect12(() => {
8256
+ if (!sourceTableId || !targetTableId) return;
8257
+ let cancelled = false;
8258
+ (async () => {
8259
+ setIsLoading(true);
8260
+ setLoadError(null);
8261
+ try {
8262
+ const [src, tgt] = await Promise.all([
8263
+ loadTable(sourceTableId, "source"),
8264
+ loadTable(targetTableId, "target")
8265
+ ]);
8266
+ if (cancelled) return;
8267
+ setSourceRows(src.rows);
8268
+ setSourceColumns(src.columns);
8269
+ setTargetRows(tgt.rows);
8270
+ setTargetColumns(tgt.columns);
8271
+ setTargetRelOptions(tgt.relationOptions || {});
8272
+ } catch (err) {
8273
+ if (!cancelled) setLoadError((err == null ? void 0 : err.message) || "\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD");
8274
+ } finally {
8275
+ if (!cancelled) setIsLoading(false);
8276
+ }
8277
+ })();
8278
+ return () => {
8279
+ cancelled = true;
8280
+ };
8281
+ }, [sourceTableId, targetTableId, loadTable]);
8282
+ const displayValue = useCallback12((col, val) => {
8283
+ var _a2, _b2, _c, _d, _e;
8284
+ let text = cellText(val);
8285
+ if (text && /^[a-fA-F0-9]{24}$/.test(text)) {
8286
+ let opts = targetRelOptions[col == null ? void 0 : col.name] || targetRelOptions[col == null ? void 0 : col.id] || [];
8287
+ if (opts.length === 0 && ((_a2 = col == null ? void 0 : col.name) == null ? void 0 : _a2.includes(RELATION_SEP))) {
8288
+ const baseName = col.name.split(RELATION_SEP)[0];
8289
+ opts = targetRelOptions[baseName] || [];
8290
+ }
8291
+ if (opts.length === 0) {
8292
+ opts = Object.values(targetRelOptions).flat();
8293
+ }
8294
+ if (opts.length === 0) {
8295
+ opts = [...targetRows.map((r) => r.data), ...sourceRows.map((r) => r.data)];
8296
+ }
8297
+ const found = opts.find((o) => String(o.id) === text || String(o._id) === text || String(o.value) === text);
8298
+ if (found) return cellText((_e = (_d = (_c = (_b2 = found.label) != null ? _b2 : found.title) != null ? _c : found.name) != null ? _d : found.value) != null ? _e : found);
8299
+ }
8300
+ return text;
8301
+ }, [targetRelOptions, targetRows, sourceRows]);
8302
+ const filterColumns = useMemo7(() => {
8303
+ const definedFilters = (config == null ? void 0 : config.filterFields) || [];
8304
+ const legacyFilters = [config == null ? void 0 : config.targetFilterField1Id, config == null ? void 0 : config.targetFilterField2Id].filter(Boolean);
8305
+ const fieldsToUse = definedFilters.length > 0 ? definedFilters : legacyFilters;
8306
+ if (fieldsToUse.length > 0) {
8307
+ const seen = /* @__PURE__ */ new Set();
8308
+ const resolved = [];
8309
+ fieldsToUse.forEach((idOrName) => {
8310
+ let col = targetColumns.find((c) => c.id === idOrName || c.name === idOrName);
8311
+ if (!col) {
8312
+ const { relationColumn } = parseColumnRef(idOrName);
8313
+ if (relationColumn) col = targetColumns.find((c) => {
8314
+ var _a2;
8315
+ return c.name === relationColumn && ((_a2 = c.type) == null ? void 0 : _a2.toUpperCase()) === "RELATION";
8316
+ });
8317
+ }
8318
+ const final = col || { name: idOrName, label: columnRefLabel(idOrName) };
8319
+ if (seen.has(final.name)) return;
8320
+ seen.add(final.name);
8321
+ resolved.push(final);
8322
+ });
8323
+ return resolved;
8324
+ }
8325
+ return targetColumns.filter((c) => isUserColumn(c) && c.name !== assignmentField && !["id", "_id", "id_", "statusId"].includes(c.name)).slice(0, 3);
8326
+ }, [targetColumns, assignmentField, config]);
8327
+ const rawSelectorField = (config == null ? void 0 : config.targetSelectorFieldId) || (config == null ? void 0 : config.targetDisplayFieldId) || ((_a = filterColumns[0]) == null ? void 0 : _a.name) || "";
8328
+ const selectorField = useMemo7(() => {
8329
+ const { relationColumn } = parseColumnRef(rawSelectorField);
8330
+ if (relationColumn && !targetColumns.some((c) => c.name === rawSelectorField) && targetColumns.some((c) => {
8331
+ var _a2;
8332
+ return c.name === relationColumn && ((_a2 = c.type) == null ? void 0 : _a2.toUpperCase()) === "RELATION";
8333
+ })) {
8334
+ return relationColumn;
8335
+ }
8336
+ return rawSelectorField;
8337
+ }, [rawSelectorField, targetColumns]);
8338
+ const filteredTargetRows = useMemo7(() => {
8339
+ return targetRows.filter((r) => {
8340
+ return filterColumns.every((col) => {
8341
+ const filterVal = targetFilters[col.name];
8342
+ if (!filterVal) return true;
8343
+ return displayValue(col, readColumnValue(r.data, col.name)) === filterVal;
8344
+ });
8345
+ });
8346
+ }, [targetRows, targetFilters, filterColumns, displayValue]);
8347
+ useEffect12(() => {
8348
+ if (filteredTargetRows.length > 0) {
8349
+ if (!selectedTargetId || !filteredTargetRows.some((r) => r.id === selectedTargetId)) {
8350
+ setSelectedTargetId(filteredTargetRows[0].id);
8351
+ }
8352
+ } else {
8353
+ setSelectedTargetId("");
8354
+ }
8355
+ }, [filteredTargetRows, selectedTargetId]);
8356
+ const assignmentColumn = useMemo7(() => targetColumns.find((c) => c.name === assignmentField), [targetColumns, assignmentField]);
8357
+ const isRelationField = ((_b = assignmentColumn == null ? void 0 : assignmentColumn.type) == null ? void 0 : _b.toUpperCase()) === "RELATION";
8358
+ const assignmentLabel = (assignmentColumn == null ? void 0 : assignmentColumn.label) || (assignmentColumn == null ? void 0 : assignmentColumn.name) || assignmentField || "";
8359
+ const nameOf = useCallback12((row) => cellText(readColumnValue(row.data, displayField)) || "\u05DC\u05DC\u05D0 \u05E9\u05DD", [displayField]);
8360
+ const assignedIds = useMemo7(() => {
8361
+ var _a2;
8362
+ const target = targetRows.find((r) => r.id === selectedTargetId);
8363
+ if (!target || !assignmentField) return [];
8364
+ const raw = (_a2 = target.data) == null ? void 0 : _a2[assignmentField];
8365
+ if (raw === null || raw === void 0 || raw === "") return [];
8366
+ const values = Array.isArray(raw) ? raw : typeof raw === "string" && !isRelationField ? raw.split(",").map((s) => s.trim()).filter(Boolean) : [raw];
8367
+ const ids = values.map((v) => {
8368
+ var _a3, _b2, _c;
8369
+ if (isRelationField || typeof v === "object" && v !== null) return String((_b2 = (_a3 = v == null ? void 0 : v.id) != null ? _a3 : v == null ? void 0 : v._id) != null ? _b2 : v);
8370
+ return (_c = sourceRows.find((s) => nameOf(s) === String(v))) == null ? void 0 : _c.id;
8371
+ }).filter((id) => !!id && sourceRows.some((s) => s.id === id));
8372
+ return Array.from(new Set(ids));
8373
+ }, [selectedTargetId, targetRows, sourceRows, assignmentField, isRelationField, nameOf]);
8374
+ const assignedIdsRef = useRef11(assignedIds);
8375
+ assignedIdsRef.current = assignedIds;
8376
+ useEffect12(() => {
8377
+ setCandidateIds(assignedIdsRef.current);
8378
+ setCheckedIds(assignedIdsRef.current);
8379
+ }, [selectedTargetId, sourceRows]);
8380
+ const toGridRow = useCallback12((r, checked = false) => __spreadProps(__spreadValues({}, r.data), { id: r.id, __label: nameOf(r), __checked: checked, statusId: statusMap[r.id] || defaultStatusId }), [nameOf, statusMap, defaultStatusId]);
8381
+ const candidateGridData = useMemo7(() => {
8382
+ const checked = new Set(checkedIds);
8383
+ return candidateIds.map((id) => sourceRows.find((r) => r.id === id)).filter((r) => !!r).map((r) => toGridRow(r, checked.has(r.id)));
8384
+ }, [candidateIds, checkedIds, sourceRows, toGridRow]);
8385
+ const availableGridData = useMemo7(() => {
8386
+ const set = new Set(candidateIds);
8387
+ return sourceRows.filter((r) => !set.has(r.id)).map((r) => toGridRow(r));
8388
+ }, [candidateIds, sourceRows, toGridRow]);
8389
+ const persistAssignment = useCallback12(async (nextIds) => {
8390
+ const exec = executeActionRef.current;
8391
+ if (exec && targetTableId && assignmentField && selectedTargetId) {
8392
+ const value = isRelationField ? nextIds : nextIds.map((id) => sourceRows.find((r) => r.id === id)).filter((r) => !!r).map(nameOf).join(", ");
8393
+ await exec("UPDATE_RECORD", { tableId: targetTableId, tableMetaId: targetTableId, modifications: { [selectedTargetId]: { [assignmentField]: value } } });
8394
+ setTargetRows((prev) => prev.map((r) => r.id === selectedTargetId ? __spreadProps(__spreadValues({}, r), { data: __spreadProps(__spreadValues({}, r.data), { [assignmentField]: value }) }) : r));
8395
+ return;
8396
+ }
8397
+ if (legacyRef.current.updateAssignment) {
8398
+ for (const id of nextIds.filter((i) => !assignedIds.includes(i))) await legacyRef.current.updateAssignment(selectedTargetId, id);
8399
+ }
8400
+ }, [targetTableId, assignmentField, selectedTargetId, isRelationField, sourceRows, nameOf, assignedIds]);
8401
+ const moveToCandidates = useCallback12((id) => {
8402
+ setCandidateIds((prev) => prev.includes(id) ? prev : [...prev, id]);
8403
+ }, []);
8404
+ const moveToSource = useCallback12((id) => {
8405
+ setCandidateIds((prev) => prev.filter((x) => x !== id));
8406
+ setCheckedIds((prev) => prev.filter((x) => x !== id));
8407
+ setStatusMap((prev) => __spreadProps(__spreadValues({}, prev), { [id]: defaultStatusId }));
8408
+ }, [defaultStatusId]);
8409
+ const moveToCandidatesRef = useRef11(moveToCandidates);
8410
+ moveToCandidatesRef.current = moveToCandidates;
8411
+ const moveToSourceRef = useRef11(moveToSource);
8412
+ moveToSourceRef.current = moveToSource;
8413
+ const toggleChecked = useCallback12((id) => {
8414
+ setCheckedIds((prev) => prev.includes(id) ? prev.filter((x) => x !== id) : [...prev, id]);
8415
+ }, []);
8416
+ const allChecked = candidateIds.length > 0 && candidateIds.every((id) => checkedIds.includes(id));
8417
+ const someChecked = candidateIds.some((id) => checkedIds.includes(id));
8418
+ const toggleAll = useCallback12(() => {
8419
+ setCheckedIds(allChecked ? [] : [...candidateIds]);
8420
+ }, [allChecked, candidateIds]);
8421
+ const returnAll = useCallback12(() => {
8422
+ setCandidateIds([]);
8423
+ setCheckedIds([]);
8424
+ }, []);
8425
+ const checkedCandidates = useMemo7(() => candidateIds.filter((id) => checkedIds.includes(id)), [candidateIds, checkedIds]);
8426
+ const isDirty = checkedCandidates.length !== assignedIds.length || checkedCandidates.some((id) => !assignedIds.includes(id));
8427
+ const submitAssignment = useCallback12(async () => {
8428
+ if (!selectedTargetId) {
8429
+ alert("\u05D0\u05E0\u05D0 \u05D1\u05D7\u05E8 \u05E7\u05D5\u05D3\u05DD \u05E8\u05E9\u05D5\u05DE\u05EA \u05D9\u05E2\u05D3 \u05DC\u05E4\u05E0\u05D9 \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5");
8430
+ return;
8431
+ }
8432
+ setSaveError(null);
8433
+ setIsSaving(true);
8434
+ try {
8435
+ await persistAssignment(checkedCandidates);
8436
+ } catch (err) {
8437
+ console.error("[PlacementBlock] save failed:", err);
8438
+ setSaveError((err == null ? void 0 : err.message) || "\u05D4\u05E9\u05DE\u05D9\u05E8\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4");
8439
+ } finally {
8440
+ setIsSaving(false);
8441
+ }
8442
+ }, [selectedTargetId, persistAssignment, checkedCandidates]);
8443
+ const cycleStatus = useCallback12((recordId) => {
8444
+ setStatusMap((prev) => {
8445
+ const current = prev[recordId] || defaultStatusId;
8446
+ const idx = statuses.findIndex((c) => c.id === current);
8447
+ return __spreadProps(__spreadValues({}, prev), { [recordId]: statuses[(idx + 1) % statuses.length].id });
8448
+ });
8449
+ }, [statuses, defaultStatusId]);
8450
+ const cancelAssignment = useCallback12(async () => {
8451
+ if (!selectedTargetId || assignedIds.length === 0) return;
8452
+ if (!window.confirm(`\u05DC\u05D1\u05D8\u05DC \u05D0\u05EA \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5 \u05D5\u05DC\u05DE\u05D7\u05D5\u05E7 \u05D0\u05EA \u05D4\u05E0\u05EA\u05D5\u05DF \u05DE\u05E9\u05D3\u05D4 "${assignmentLabel}"?`)) return;
8453
+ const removed = new Set(assignedIds);
8454
+ setSaveError(null);
8455
+ setIsSaving(true);
8456
+ try {
8457
+ await persistAssignment([]);
8458
+ setCheckedIds((prev) => prev.filter((id) => !removed.has(id)));
8459
+ } catch (err) {
8460
+ console.error("[PlacementBlock] cancel failed:", err);
8461
+ setSaveError((err == null ? void 0 : err.message) || "\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5 \u05E0\u05DB\u05E9\u05DC");
8462
+ } finally {
8463
+ setIsSaving(false);
8464
+ }
8465
+ }, [selectedTargetId, assignedIds, assignmentLabel, persistAssignment]);
8466
+ const makeColDefs = useCallback12((columns, fallbackName, withCheckbox = false) => {
8467
+ const defs = [];
8468
+ if (withCheckbox) {
8469
+ defs.push({
8470
+ colId: "select",
8471
+ headerName: "",
8472
+ width: 56,
8473
+ pinned: "right",
8474
+ suppressSizeToFit: true,
8475
+ sortable: false,
8476
+ filter: false,
8477
+ suppressMovable: true,
8478
+ cellRenderer: CheckCellRenderer,
8479
+ cellRendererParams: { onToggle: toggleChecked },
8480
+ headerComponent: CheckHeader,
8481
+ headerComponentParams: { allChecked, someChecked, onToggleAll: toggleAll }
8482
+ });
8483
+ }
8484
+ defs.push({ colId: "color", headerName: "\u05E1\u05D8\u05D8\u05D5\u05E1", width: 70, valueGetter: (p) => {
8485
+ var _a2;
8486
+ return (_a2 = p.data) == null ? void 0 : _a2.statusId;
8487
+ }, cellRenderer: ColorDotRenderer, cellRendererParams: { onCycle: cycleStatus, statuses, defaultStatusId }, pinned: "right", suppressSizeToFit: true });
8488
+ const userCols = (columns || []).filter((c) => isUserColumn(c) && !["id", "_id", "id_", "statusId"].includes(c.name));
8489
+ if (userCols.length > 0) {
8490
+ const displayIsRelated = displayField.includes(RELATION_SEP);
8491
+ const ordered = [...userCols.filter((c) => c.name === displayField), ...userCols.filter((c) => c.name !== displayField)];
8492
+ if (displayIsRelated) defs.push({ colId: displayField, headerName: columnRefLabel(displayField), valueGetter: (p) => {
8493
+ var _a2;
8494
+ return (_a2 = p.data) == null ? void 0 : _a2[displayField];
8495
+ }, valueFormatter: (p) => cellText(p.value), getQuickFilterText: (p) => cellText(p.value), rowDrag: true, flex: 1, minWidth: 120 });
8496
+ ordered.forEach((c, i) => defs.push({ colId: c.name, field: c.name, headerName: c.label || c.name, valueGetter: (p) => readColumnValue(p.data, c.name), valueFormatter: (p) => displayValue(c, p.value), getQuickFilterText: (p) => cellText(displayValue(c, p.value)), rowDrag: !displayIsRelated && i === 0, flex: 1, minWidth: 120 }));
8497
+ } else {
8498
+ defs.push({ field: "__label", headerName: fallbackName, rowDrag: true, flex: 1 });
8499
+ }
8500
+ return defs;
8501
+ }, [cycleStatus, statuses, defaultStatusId, displayField, displayValue, toggleChecked, toggleAll, allChecked, someChecked]);
8502
+ const sourceHeader = displayField === "name" ? "\u05E9\u05DD" : columnRefLabel(displayField);
8503
+ const sourceColDefs = useMemo7(() => makeColDefs(sourceColumns, sourceHeader), [makeColDefs, sourceColumns, sourceHeader]);
8504
+ const candidateColDefs = useMemo7(() => makeColDefs(sourceColumns, sourceHeader, true), [makeColDefs, sourceColumns, sourceHeader]);
8505
+ const getRowId = useCallback12((p) => p.data.id, []);
8506
+ const sourceContainerRef = useRef11(null);
8507
+ const assignedContainerRef = useRef11(null);
8508
+ const [sourceApi, setSourceApi] = useState14(null);
8509
+ const [assignedApi, setAssignedApi] = useState14(null);
8510
+ useEffect12(() => {
8511
+ if (!sourceApi || !assignedApi) return;
8512
+ const toAssigned = { getContainer: () => assignedContainerRef.current, onDragStop: (p) => {
8513
+ var _a2, _b2;
8514
+ if ((_b2 = (_a2 = p.node) == null ? void 0 : _a2.data) == null ? void 0 : _b2.id) moveToCandidatesRef.current(p.node.data.id);
8515
+ } };
8516
+ const toSource = { getContainer: () => sourceContainerRef.current, onDragStop: (p) => {
8517
+ var _a2, _b2;
8518
+ if ((_b2 = (_a2 = p.node) == null ? void 0 : _a2.data) == null ? void 0 : _b2.id) moveToSourceRef.current(p.node.data.id);
8519
+ } };
8520
+ sourceApi.addRowDropZone(toAssigned);
8521
+ assignedApi.addRowDropZone(toSource);
8522
+ return () => {
8523
+ try {
8524
+ sourceApi.removeRowDropZone(toAssigned);
8525
+ } catch (e) {
8526
+ }
8527
+ try {
8528
+ assignedApi.removeRowDropZone(toSource);
8529
+ } catch (e) {
8530
+ }
8531
+ };
8532
+ }, [sourceApi, assignedApi]);
8533
+ const selectorLabel = useMemo7(() => {
8534
+ const col = targetColumns.find((c) => c.name === selectorField || c.id === selectorField);
8535
+ return (col == null ? void 0 : col.label) || columnRefLabel(selectorField) || "\u05D1\u05D7\u05D9\u05E8\u05EA \u05E8\u05E9\u05D5\u05DE\u05D4 \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5";
8536
+ }, [targetColumns, selectorField]);
8537
+ const assignedText = useMemo7(
8538
+ () => assignedIds.map((id) => sourceRows.find((r) => r.id === id)).filter((r) => !!r).map(nameOf).join(", "),
8539
+ [assignedIds, sourceRows, nameOf]
8540
+ );
8541
+ const activeTarget = targetRows.find((r) => r.id === selectedTargetId);
8542
+ const targetLabel = useCallback12((r) => {
8543
+ const col = targetColumns.find((c) => c.name === selectorField || c.id === selectorField);
8544
+ return displayValue(col || { name: selectorField }, readColumnValue(r.data, selectorField)) || "\u05DC\u05DC\u05D0 \u05E9\u05DD";
8545
+ }, [selectorField, targetColumns, displayValue]);
8546
+ const previewColumns = useMemo7(() => targetColumns.filter((c) => isUserColumn(c) && c.name !== assignmentField && !["id", "_id", "id_", "statusId"].includes(c.name)), [targetColumns, assignmentField]);
8547
+ if (!config || !sourceTableId || !targetTableId) {
8548
+ return /* @__PURE__ */ jsx15("div", { className: "p-4 text-xs text-slate-500 border border-dashed border-slate-300 rounded-xl", dir: "rtl", children: "\u05E8\u05DB\u05D9\u05D1 \u05D4\u05E9\u05D9\u05D1\u05D5\u05E5 \u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8 (\u05D7\u05E1\u05E8\u05D5\u05EA \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 / \u05D8\u05D1\u05DC\u05EA \u05D9\u05E2\u05D3)." });
8549
+ }
8550
+ const selectClass = "w-full p-2 border border-slate-300 rounded-lg text-xs font-medium text-slate-700 bg-slate-50 outline-none focus:border-brand";
8551
+ const labelClass = "block text-[11px] font-semibold text-slate-500 mb-1";
8552
+ return /* @__PURE__ */ jsxs14("div", { className: `w-full flex flex-col gap-4 p-4 bg-slate-50 min-h-[850px] rounded-xl border border-slate-200 ${className}`, dir: "rtl", children: [
8553
+ (loadError || saveError) && /* @__PURE__ */ jsx15("div", { className: "p-3 text-xs rounded-lg bg-rose-50 border border-rose-200 text-rose-700", children: loadError || saveError }),
8554
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col lg:flex-row gap-4", children: [
8555
+ /* @__PURE__ */ jsxs14("div", { className: "w-full lg:w-1/3 bg-teal-50/40 p-4 rounded-xl border border-teal-100 shadow-xs flex flex-col", children: [
8556
+ /* @__PURE__ */ jsxs14("h4", { className: "font-bold text-teal-900 border-b border-teal-200 pb-2 mb-3 text-sm flex items-center gap-2", children: [
8557
+ /* @__PURE__ */ jsx15("span", { children: "\u{1F4CC}" }),
8558
+ " \u05E4\u05E8\u05D8\u05D9 \u05D4\u05D9\u05E2\u05D3 \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5"
8559
+ ] }),
8560
+ activeTarget ? /* @__PURE__ */ jsxs14("div", { className: "space-y-2 text-xs text-slate-700 overflow-y-auto pr-1 max-h-32", children: [
8561
+ /* @__PURE__ */ jsx15("div", { className: "font-bold text-slate-900 text-sm mb-1", children: targetLabel(activeTarget) }),
8562
+ previewColumns.map((col) => ({ col, text: displayValue(col, readColumnValue(activeTarget.data, col.name)) })).filter(({ col, text }) => {
8563
+ var _a2;
8564
+ return text && (col.type === "RELATION" || typeof ((_a2 = activeTarget.data) == null ? void 0 : _a2[col.name]) !== "object");
8565
+ }).map(({ col, text }) => /* @__PURE__ */ jsxs14("div", { className: "flex gap-2 items-start", children: [
8566
+ /* @__PURE__ */ jsxs14("span", { className: "font-semibold shrink-0", children: [
8567
+ col.label || col.name,
8568
+ ":"
8569
+ ] }),
8570
+ /* @__PURE__ */ jsx15("span", { className: "break-words line-clamp-2", children: text })
8571
+ ] }, col.name)),
8572
+ assignmentField && assignedText && /* @__PURE__ */ jsxs14("div", { className: "flex gap-2 items-start", children: [
8573
+ /* @__PURE__ */ jsxs14("span", { className: "font-semibold shrink-0", children: [
8574
+ assignmentLabel,
8575
+ ":"
8576
+ ] }),
8577
+ /* @__PURE__ */ jsx15("span", { className: "break-words line-clamp-2", title: assignedText, children: assignedText })
8578
+ ] }),
8579
+ /* @__PURE__ */ jsxs14("div", { className: "mt-3 pt-3 border-t border-teal-200/60 text-teal-800 font-bold", children: [
8580
+ "\u05DE\u05E9\u05D5\u05D1\u05E6\u05D9\u05DD \u05DB\u05E8\u05D2\u05E2: ",
8581
+ assignedIds.length
8582
+ ] })
8583
+ ] }) : /* @__PURE__ */ jsx15("div", { className: "text-slate-500 text-xs text-center py-6", children: isLoading ? "\u05D8\u05D5\u05E2\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD..." : "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05E8\u05E9\u05D5\u05DE\u05EA \u05D9\u05E2\u05D3." })
8584
+ ] }),
8585
+ /* @__PURE__ */ jsx15("div", { className: "w-full lg:w-2/3 bg-white p-4 rounded-xl border border-slate-200 shadow-xs flex flex-col", children: /* @__PURE__ */ jsxs14("div", { children: [
8586
+ /* @__PURE__ */ jsx15("h4", { className: "font-bold text-slate-800 mb-3 text-sm", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05D4\u05D9\u05E2\u05D3" }),
8587
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col sm:flex-row gap-3", children: [
8588
+ filterColumns.map((col, index) => {
8589
+ const previousColumns = filterColumns.slice(0, index);
8590
+ const validRowsForThisFilter = targetRows.filter((r) => {
8591
+ return previousColumns.every((prevCol) => {
8592
+ const filterVal = targetFilters[prevCol.name];
8593
+ if (!filterVal) return true;
8594
+ return displayValue(prevCol, readColumnValue(r.data, prevCol.name)) === filterVal;
8595
+ });
8596
+ });
8597
+ const uniqueValues = Array.from(new Set(
8598
+ validRowsForThisFilter.map((r) => displayValue(col, readColumnValue(r.data, col.name)))
8599
+ )).filter(Boolean).sort((a, b) => a.localeCompare(b, "he"));
8600
+ return /* @__PURE__ */ jsxs14("div", { className: "flex-1 basis-0 min-w-0", children: [
8601
+ /* @__PURE__ */ jsx15("label", { className: labelClass, children: col.label || columnRefLabel(col.name) }),
8602
+ /* @__PURE__ */ jsxs14(
8603
+ "select",
8604
+ {
8605
+ className: selectClass,
8606
+ value: targetFilters[col.name] || "",
8607
+ onChange: (e) => {
8608
+ const val = e.target.value;
8609
+ setTargetFilters((prev) => {
8610
+ const newFilters = __spreadProps(__spreadValues({}, prev), { [col.name]: val });
8611
+ filterColumns.slice(index + 1).forEach((subCol) => {
8612
+ newFilters[subCol.name] = "";
8613
+ });
8614
+ return newFilters;
8615
+ });
8616
+ },
8617
+ children: [
8618
+ /* @__PURE__ */ jsx15("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
8619
+ uniqueValues.map((v) => /* @__PURE__ */ jsx15("option", { value: v, children: v }, v))
8620
+ ]
8621
+ }
8622
+ )
8623
+ ] }, col.name);
8624
+ }),
8625
+ /* @__PURE__ */ jsxs14("div", { className: "flex-1 basis-0 min-w-0", children: [
8626
+ /* @__PURE__ */ jsx15("label", { className: labelClass, children: selectorLabel }),
8627
+ /* @__PURE__ */ jsxs14("select", { className: selectClass, value: selectedTargetId, onChange: (e) => setSelectedTargetId(e.target.value), children: [
8628
+ /* @__PURE__ */ jsxs14("option", { value: "", children: [
8629
+ "-- \u05D1\u05D7\u05E8 \u05DE\u05EA\u05D5\u05DA ",
8630
+ filteredTargetRows.length,
8631
+ " \u05EA\u05D5\u05E6\u05D0\u05D5\u05EA --"
8632
+ ] }),
8633
+ filteredTargetRows.map((r) => /* @__PURE__ */ jsx15("option", { value: r.id, children: targetLabel(r) }, r.id))
8634
+ ] })
8635
+ ] })
8636
+ ] })
8637
+ ] }) })
8638
+ ] }),
8639
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-col lg:flex-row w-full gap-4 h-[550px]", children: [
8640
+ /* @__PURE__ */ jsxs14("div", { className: "w-full lg:w-1/2 flex flex-col border border-slate-200 rounded-xl shadow-xs bg-white overflow-hidden", children: [
8641
+ /* @__PURE__ */ jsxs14("div", { className: "bg-slate-100 p-3 border-b border-slate-200 flex flex-col gap-2", children: [
8642
+ /* @__PURE__ */ jsxs14("div", { className: "flex justify-between items-center font-bold text-slate-800 text-sm", children: [
8643
+ /* @__PURE__ */ jsxs14("span", { children: [
8644
+ "\u05E8\u05E9\u05D9\u05DE\u05EA \u05DE\u05E7\u05D5\u05E8 (",
8645
+ availableGridData.length,
8646
+ ")"
8647
+ ] }),
8648
+ /* @__PURE__ */ jsx15("span", { className: "text-[11px] font-normal text-slate-500 bg-white px-2 py-0.5 rounded-full shadow-sm border border-slate-200", children: "\u05D2\u05E8\u05D5\u05E8 \u05E9\u05DE\u05D0\u05DC\u05D4 \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5 \u2190" })
8649
+ ] }),
8650
+ /* @__PURE__ */ jsx15("input", { type: "search", value: sourceSearch, onChange: (e) => setSourceSearch(e.target.value), placeholder: "\u05E1\u05D9\u05E0\u05D5\u05DF...", className: "w-full p-2 border border-slate-300 rounded-lg text-xs bg-white outline-none focus:border-brand" })
8651
+ ] }),
8652
+ /* @__PURE__ */ jsx15("div", { ref: sourceContainerRef, className: "ag-theme-quartz flex-1 w-full h-full", children: /* @__PURE__ */ jsx15(AgGridReact, { rowData: availableGridData, columnDefs: sourceColDefs, getRowId, enableRtl: true, rowDragManaged: false, quickFilterText: sourceSearch, onGridReady: (e) => setSourceApi(e.api), loading: isLoading }) })
8653
+ ] }),
8654
+ /* @__PURE__ */ jsxs14("div", { className: "w-full lg:w-1/2 flex flex-col border border-blue-200 rounded-xl shadow-xs bg-white overflow-hidden ring-1 ring-blue-100", children: [
8655
+ /* @__PURE__ */ jsxs14("div", { className: "bg-blue-50/80 p-3 border-b border-blue-100 flex flex-col gap-2", children: [
8656
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap justify-between items-center gap-2", children: [
8657
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 font-bold text-blue-900 text-sm", children: [
8658
+ /* @__PURE__ */ jsxs14("span", { children: [
8659
+ "\u05DE\u05D5\u05E2\u05DE\u05D3\u05D9\u05DD \u05DC\u05E9\u05D9\u05D1\u05D5\u05E5 (",
8660
+ candidateGridData.length,
8661
+ ")"
8662
+ ] }),
8663
+ /* @__PURE__ */ jsx15("span", { className: "text-[11px] font-normal text-blue-700 bg-white px-2 py-0.5 rounded-full shadow-sm border border-blue-100", children: "\u2192 \u05D2\u05E8\u05D5\u05E8 \u05D9\u05DE\u05D9\u05E0\u05D4 \u05DC\u05D4\u05D7\u05D6\u05E8\u05D4" })
8664
+ ] }),
8665
+ /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2", children: [
8666
+ /* @__PURE__ */ jsx15("button", { type: "button", onClick: returnAll, disabled: candidateIds.length === 0, className: "px-3 py-1.5 rounded-lg text-xs font-bold bg-amber-400 hover:bg-amber-500 text-slate-900 disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: "\u21BA \u05D4\u05D7\u05D6\u05E8 \u05D4\u05DB\u05DC" }),
8667
+ /* @__PURE__ */ jsx15("button", { type: "button", onClick: submitAssignment, disabled: !selectedTargetId || !isDirty || isSaving, className: "px-4 py-1.5 rounded-lg text-xs font-bold bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: isSaving ? "\u05E9\u05D5\u05DE\u05E8..." : "\u05E9\u05D1\u05E5" }),
8668
+ /* @__PURE__ */ jsx15("button", { type: "button", onClick: cancelAssignment, disabled: !selectedTargetId || assignedIds.length === 0 || isSaving, className: "px-3 py-1.5 rounded-lg text-xs font-bold bg-white hover:bg-rose-50 text-rose-600 border border-rose-300 disabled:opacity-40 disabled:cursor-not-allowed transition-colors", children: "\u05D1\u05D9\u05D8\u05D5\u05DC \u05E9\u05D9\u05D1\u05D5\u05E5" })
8669
+ ] })
8670
+ ] }),
8671
+ /* @__PURE__ */ jsx15("input", { type: "search", value: candidateSearch, onChange: (e) => setCandidateSearch(e.target.value), placeholder: "\u05E1\u05D9\u05E0\u05D5\u05DF...", className: "w-full p-2 border border-slate-300 rounded-lg text-xs bg-white outline-none focus:border-brand" })
8672
+ ] }),
8673
+ /* @__PURE__ */ jsx15("div", { ref: assignedContainerRef, className: "ag-theme-quartz flex-1 w-full h-full", children: /* @__PURE__ */ jsx15(AgGridReact, { rowData: candidateGridData, columnDefs: candidateColDefs, getRowId, enableRtl: true, rowDragManaged: false, quickFilterText: candidateSearch, onGridReady: (e) => setAssignedApi(e.api), loading: isLoading }) })
8674
+ ] })
8675
+ ] })
8676
+ ] });
8677
+ };
8678
+
7721
8679
  // src/components/WhatsAppComponent/WhatsAppComponent.tsx
7722
8680
  import { CheckCircle2 as CheckCircle24, AlertCircle as AlertCircle5, X as X12, Loader2 as Loader27, Phone as Phone4, Send as Send2, Image as ImageIcon3, FileText as FileText4, Video as Video3 } from "lucide-react";
7723
8681
 
7724
8682
  // src/components/WhatsAppComponent/CreateTemplateModal.tsx
7725
- import { useState as useState14, useEffect as useEffect12, useRef as useRef11, useMemo as useMemo7 } from "react";
8683
+ import { useState as useState15, useEffect as useEffect13, useRef as useRef12, useMemo as useMemo8 } from "react";
7726
8684
  import {
7727
8685
  X as X9,
7728
8686
  Plus,
@@ -7865,7 +8823,7 @@ function readFileAsBase64(file) {
7865
8823
  }
7866
8824
 
7867
8825
  // src/components/WhatsAppComponent/CreateTemplateModal.tsx
7868
- import { Fragment as Fragment3, jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
8826
+ import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
7869
8827
  function CreateTemplateModal({
7870
8828
  isOpen,
7871
8829
  onClose,
@@ -7875,26 +8833,26 @@ function CreateTemplateModal({
7875
8833
  executeAction,
7876
8834
  orgId
7877
8835
  }) {
7878
- const [templateName, setTemplateName] = useState14("");
7879
- const [language, setLanguage] = useState14("he");
7880
- const [category, setCategory] = useState14("MARKETING");
7881
- const [bodyText, setBodyText] = useState14("");
7882
- const [variableSamples, setVariableSamples] = useState14({});
7883
- const [hasFileHeader, setHasFileHeader] = useState14(false);
7884
- const [selectedFile, setSelectedFile] = useState14(null);
7885
- const [fileBase64, setFileBase64] = useState14("");
7886
- const [buttons, setButtons] = useState14([]);
7887
- const [isAddButtonOpen, setIsAddButtonOpen] = useState14(false);
7888
- const addButtonDropdownRef = useRef11(null);
7889
- const [isSubmitting, setIsSubmitting] = useState14(false);
7890
- const [submittingStep, setSubmittingStep] = useState14("");
7891
- const [submitError, setSubmitError] = useState14(null);
7892
- const [fileError, setFileError] = useState14(null);
7893
- const textareaRef = useRef11(null);
7894
- const fileInputRef = useRef11(null);
7895
- const emojiPickerRef = useRef11(null);
7896
- const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState14(false);
7897
- useEffect12(() => {
8836
+ const [templateName, setTemplateName] = useState15("");
8837
+ const [language, setLanguage] = useState15("he");
8838
+ const [category, setCategory] = useState15("MARKETING");
8839
+ const [bodyText, setBodyText] = useState15("");
8840
+ const [variableSamples, setVariableSamples] = useState15({});
8841
+ const [hasFileHeader, setHasFileHeader] = useState15(false);
8842
+ const [selectedFile, setSelectedFile] = useState15(null);
8843
+ const [fileBase64, setFileBase64] = useState15("");
8844
+ const [buttons, setButtons] = useState15([]);
8845
+ const [isAddButtonOpen, setIsAddButtonOpen] = useState15(false);
8846
+ const addButtonDropdownRef = useRef12(null);
8847
+ const [isSubmitting, setIsSubmitting] = useState15(false);
8848
+ const [submittingStep, setSubmittingStep] = useState15("");
8849
+ const [submitError, setSubmitError] = useState15(null);
8850
+ const [fileError, setFileError] = useState15(null);
8851
+ const textareaRef = useRef12(null);
8852
+ const fileInputRef = useRef12(null);
8853
+ const emojiPickerRef = useRef12(null);
8854
+ const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState15(false);
8855
+ useEffect13(() => {
7898
8856
  function handleClickOutside(event) {
7899
8857
  if (emojiPickerRef.current && !emojiPickerRef.current.contains(event.target)) {
7900
8858
  setIsEmojiPickerOpen(false);
@@ -7918,7 +8876,7 @@ function CreateTemplateModal({
7918
8876
  document.removeEventListener("keydown", handleKeyDown2);
7919
8877
  };
7920
8878
  }, [isEmojiPickerOpen, isAddButtonOpen]);
7921
- useEffect12(() => {
8879
+ useEffect13(() => {
7922
8880
  if (isOpen) {
7923
8881
  setTemplateName("");
7924
8882
  setLanguage("he");
@@ -7937,10 +8895,10 @@ function CreateTemplateModal({
7937
8895
  setIsEmojiPickerOpen(false);
7938
8896
  }
7939
8897
  }, [isOpen]);
7940
- const uniqueVariables = useMemo7(() => {
8898
+ const uniqueVariables = useMemo8(() => {
7941
8899
  return extractUniqueVariableIndices(bodyText);
7942
8900
  }, [bodyText]);
7943
- useEffect12(() => {
8901
+ useEffect13(() => {
7944
8902
  setVariableSamples((prev) => {
7945
8903
  const next = {};
7946
8904
  uniqueVariables.forEach((idx) => {
@@ -7951,7 +8909,7 @@ function CreateTemplateModal({
7951
8909
  }, [uniqueVariables]);
7952
8910
  const isNameEmpty = templateName.trim().length === 0;
7953
8911
  const isNamePatternValid = isValidTemplateName(templateName);
7954
- const isNameDuplicate = useMemo7(() => {
8912
+ const isNameDuplicate = useMemo8(() => {
7955
8913
  const trimmedName = templateName.trim().toLowerCase();
7956
8914
  if (!trimmedName) return false;
7957
8915
  if (existingTemplates && existingTemplates.length > 0) {
@@ -7961,9 +8919,9 @@ function CreateTemplateModal({
7961
8919
  }
7962
8920
  return isDuplicateTemplateName(trimmedName, existingTemplateNames, language);
7963
8921
  }, [templateName, language, existingTemplates, existingTemplateNames]);
7964
- const ratioInfo = useMemo7(() => validateWordToVariableRatio(bodyText), [bodyText]);
7965
- const seqInfo = useMemo7(() => validateSequentialVariables(bodyText), [bodyText]);
7966
- const validationResult = useMemo7(() => {
8922
+ const ratioInfo = useMemo8(() => validateWordToVariableRatio(bodyText), [bodyText]);
8923
+ const seqInfo = useMemo8(() => validateSequentialVariables(bodyText), [bodyText]);
8924
+ const validationResult = useMemo8(() => {
7967
8925
  return validateWhatsAppTemplate({
7968
8926
  name: templateName,
7969
8927
  language,
@@ -8217,12 +9175,12 @@ function CreateTemplateModal({
8217
9175
  }
8218
9176
  };
8219
9177
  if (!isOpen) return null;
8220
- return /* @__PURE__ */ jsx14(
9178
+ return /* @__PURE__ */ jsx16(
8221
9179
  "div",
8222
9180
  {
8223
9181
  className: "fixed inset-0 bg-slate-900/60 backdrop-blur-xs z-50 flex items-center justify-center p-4 overflow-y-auto animate-in fade-in duration-200",
8224
9182
  dir: "rtl",
8225
- children: /* @__PURE__ */ jsxs13(
9183
+ children: /* @__PURE__ */ jsxs15(
8226
9184
  "div",
8227
9185
  {
8228
9186
  className: "bg-white rounded-2xl border border-slate-200 shadow-2xl w-full max-w-2xl max-h-[92vh] flex flex-col overflow-hidden animate-in zoom-in-95 duration-150",
@@ -8230,43 +9188,43 @@ function CreateTemplateModal({
8230
9188
  "aria-modal": "true",
8231
9189
  "aria-labelledby": "modal-title",
8232
9190
  children: [
8233
- /* @__PURE__ */ jsxs13("div", { className: "px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
8234
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2.5", children: [
8235
- /* @__PURE__ */ jsx14("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx14(Plus, { className: "w-4 h-4" }) }),
8236
- /* @__PURE__ */ jsxs13("div", { children: [
8237
- /* @__PURE__ */ jsx14("h3", { id: "modal-title", className: "text-sm font-bold text-slate-900", children: "\u05D9\u05E6\u05D9\u05E8\u05EA \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4" }),
8238
- /* @__PURE__ */ jsx14("p", { className: "text-xs text-slate-500", children: "\u05D4\u05D2\u05D3\u05E8\u05EA \u05EA\u05D5\u05DB\u05DF \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05DE\u05E9\u05EA\u05E0\u05D9\u05DD \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta Cloud API" })
9191
+ /* @__PURE__ */ jsxs15("div", { className: "px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
9192
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2.5", children: [
9193
+ /* @__PURE__ */ jsx16("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx16(Plus, { className: "w-4 h-4" }) }),
9194
+ /* @__PURE__ */ jsxs15("div", { children: [
9195
+ /* @__PURE__ */ jsx16("h3", { id: "modal-title", className: "text-sm font-bold text-slate-900", children: "\u05D9\u05E6\u05D9\u05E8\u05EA \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4" }),
9196
+ /* @__PURE__ */ jsx16("p", { className: "text-xs text-slate-500", children: "\u05D4\u05D2\u05D3\u05E8\u05EA \u05EA\u05D5\u05DB\u05DF \u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05DE\u05E9\u05EA\u05E0\u05D9\u05DD \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta Cloud API" })
8239
9197
  ] })
8240
9198
  ] }),
8241
- /* @__PURE__ */ jsx14(
9199
+ /* @__PURE__ */ jsx16(
8242
9200
  "button",
8243
9201
  {
8244
9202
  type: "button",
8245
9203
  onClick: onClose,
8246
9204
  className: "p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-200/60 rounded-lg transition-colors cursor-pointer",
8247
9205
  "aria-label": "\u05E1\u05D2\u05D5\u05E8",
8248
- children: /* @__PURE__ */ jsx14(X9, { className: "w-5 h-5" })
9206
+ children: /* @__PURE__ */ jsx16(X9, { className: "w-5 h-5" })
8249
9207
  }
8250
9208
  )
8251
9209
  ] }),
8252
- /* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, className: "flex flex-col overflow-hidden flex-1", children: [
8253
- /* @__PURE__ */ jsxs13("div", { className: "p-6 overflow-y-auto space-y-5 flex-1", children: [
8254
- submitError && /* @__PURE__ */ jsxs13("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-800 flex items-center gap-2", children: [
8255
- /* @__PURE__ */ jsx14(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
8256
- /* @__PURE__ */ jsx14("span", { children: submitError })
9210
+ /* @__PURE__ */ jsxs15("form", { onSubmit: handleSubmit, className: "flex flex-col overflow-hidden flex-1", children: [
9211
+ /* @__PURE__ */ jsxs15("div", { className: "p-6 overflow-y-auto space-y-5 flex-1", children: [
9212
+ submitError && /* @__PURE__ */ jsxs15("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-800 flex items-center gap-2", children: [
9213
+ /* @__PURE__ */ jsx16(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
9214
+ /* @__PURE__ */ jsx16("span", { children: submitError })
8257
9215
  ] }),
8258
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
8259
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
8260
- /* @__PURE__ */ jsxs13("label", { className: "block text-xs font-bold text-slate-800", children: [
9216
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
9217
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
9218
+ /* @__PURE__ */ jsxs15("label", { className: "block text-xs font-bold text-slate-800", children: [
8261
9219
  "\u05E9\u05DD \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4 ",
8262
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9220
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8263
9221
  ] }),
8264
- templateName && isNamePatternValid && !isNameDuplicate && /* @__PURE__ */ jsxs13("span", { className: "text-[11px] text-emerald-600 font-semibold flex items-center gap-1", children: [
8265
- /* @__PURE__ */ jsx14(CheckCircle22, { className: "w-3.5 h-3.5" }),
9222
+ templateName && isNamePatternValid && !isNameDuplicate && /* @__PURE__ */ jsxs15("span", { className: "text-[11px] text-emerald-600 font-semibold flex items-center gap-1", children: [
9223
+ /* @__PURE__ */ jsx16(CheckCircle22, { className: "w-3.5 h-3.5" }),
8266
9224
  " \u05E9\u05DD \u05EA\u05E7\u05D9\u05DF"
8267
9225
  ] })
8268
9226
  ] }),
8269
- /* @__PURE__ */ jsx14(
9227
+ /* @__PURE__ */ jsx16(
8270
9228
  "input",
8271
9229
  {
8272
9230
  type: "text",
@@ -8278,47 +9236,47 @@ function CreateTemplateModal({
8278
9236
  required: true
8279
9237
  }
8280
9238
  ),
8281
- /* @__PURE__ */ jsx14("p", { className: "text-[10px] text-slate-400 mt-1", children: "\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05E7\u05D8\u05E0\u05D5\u05EA \u05D1\u05D0\u05E0\u05D2\u05DC\u05D9\u05EA, \u05DE\u05E1\u05E4\u05E8\u05D9\u05DD \u05D5\u05E7\u05D5\u05D5\u05D9\u05DD \u05EA\u05D7\u05EA\u05D5\u05E0\u05D9\u05DD \u05D1\u05DC\u05D1\u05D3." }),
8282
- !isNameEmpty && isNameDuplicate && /* @__PURE__ */ jsxs13("p", { className: "text-[11px] text-rose-600 font-semibold flex items-center gap-1 mt-1", children: [
8283
- /* @__PURE__ */ jsx14(AlertCircle2, { className: "w-3.5 h-3.5 shrink-0" }),
9239
+ /* @__PURE__ */ jsx16("p", { className: "text-[10px] text-slate-400 mt-1", children: "\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA \u05E7\u05D8\u05E0\u05D5\u05EA \u05D1\u05D0\u05E0\u05D2\u05DC\u05D9\u05EA, \u05DE\u05E1\u05E4\u05E8\u05D9\u05DD \u05D5\u05E7\u05D5\u05D5\u05D9\u05DD \u05EA\u05D7\u05EA\u05D5\u05E0\u05D9\u05DD \u05D1\u05DC\u05D1\u05D3." }),
9240
+ !isNameEmpty && isNameDuplicate && /* @__PURE__ */ jsxs15("p", { className: "text-[11px] text-rose-600 font-semibold flex items-center gap-1 mt-1", children: [
9241
+ /* @__PURE__ */ jsx16(AlertCircle2, { className: "w-3.5 h-3.5 shrink-0" }),
8284
9242
  "\u05E9\u05DD \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA \u05DB\u05D1\u05E8 \u05E7\u05D9\u05D9\u05DD \u05D1\u05D7\u05E9\u05D1\u05D5\u05DF \u05E2\u05D1\u05D5\u05E8 \u05E9\u05E4\u05D4 \u05D6\u05D5 (",
8285
9243
  language,
8286
9244
  "). \u05D0\u05E0\u05D0 \u05D1\u05D7\u05E8 \u05E9\u05DD \u05D9\u05D9\u05D7\u05D5\u05D3\u05D9 \u05D0\u05D5 \u05E9\u05E4\u05D4 \u05D0\u05D7\u05E8\u05EA."
8287
9245
  ] })
8288
9246
  ] }),
8289
- /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-2 gap-4", children: [
8290
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
8291
- /* @__PURE__ */ jsx14("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E9\u05E4\u05D4" }),
8292
- /* @__PURE__ */ jsx14(
9247
+ /* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-2 gap-4", children: [
9248
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
9249
+ /* @__PURE__ */ jsx16("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E9\u05E4\u05D4" }),
9250
+ /* @__PURE__ */ jsx16(
8293
9251
  "select",
8294
9252
  {
8295
9253
  value: language,
8296
9254
  onChange: (e) => setLanguage(e.target.value),
8297
9255
  className: "w-full px-3 py-2 text-xs bg-slate-50 border border-slate-200 rounded-xl text-slate-800 outline-hidden",
8298
- children: LANGUAGE_OPTIONS.map((opt) => /* @__PURE__ */ jsx14("option", { value: opt.value, children: opt.label }, opt.value))
9256
+ children: LANGUAGE_OPTIONS.map((opt) => /* @__PURE__ */ jsx16("option", { value: opt.value, children: opt.label }, opt.value))
8299
9257
  }
8300
9258
  )
8301
9259
  ] }),
8302
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1.5", children: [
8303
- /* @__PURE__ */ jsx14("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E7\u05D8\u05D2\u05D5\u05E8\u05D9\u05D4" }),
8304
- /* @__PURE__ */ jsx14(
9260
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1.5", children: [
9261
+ /* @__PURE__ */ jsx16("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E7\u05D8\u05D2\u05D5\u05E8\u05D9\u05D4" }),
9262
+ /* @__PURE__ */ jsx16(
8305
9263
  "select",
8306
9264
  {
8307
9265
  value: category,
8308
9266
  onChange: (e) => setCategory(e.target.value),
8309
9267
  className: "w-full px-3 py-2 text-xs bg-slate-50 border border-slate-200 rounded-xl text-slate-800 outline-hidden",
8310
- children: CATEGORY_OPTIONS.map((opt) => /* @__PURE__ */ jsx14("option", { value: opt.value, children: opt.label }, opt.value))
9268
+ children: CATEGORY_OPTIONS.map((opt) => /* @__PURE__ */ jsx16("option", { value: opt.value, children: opt.label }, opt.value))
8311
9269
  }
8312
9270
  )
8313
9271
  ] })
8314
9272
  ] }),
8315
- /* @__PURE__ */ jsxs13("div", { className: "space-y-2", children: [
8316
- /* @__PURE__ */ jsxs13("label", { className: "block text-xs font-bold text-slate-800", children: [
9273
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
9274
+ /* @__PURE__ */ jsxs15("label", { className: "block text-xs font-bold text-slate-800", children: [
8317
9275
  "\u05EA\u05D5\u05DB\u05DF \u05D2\u05D5\u05E3 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 ",
8318
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9276
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8319
9277
  ] }),
8320
- /* @__PURE__ */ jsxs13("div", { className: "border border-slate-200 focus-within:border-emerald-500 focus-within:ring-1 focus-within:ring-emerald-500 rounded-xl overflow-visible bg-white transition-all shadow-xs relative", children: [
8321
- /* @__PURE__ */ jsx14(
9278
+ /* @__PURE__ */ jsxs15("div", { className: "border border-slate-200 focus-within:border-emerald-500 focus-within:ring-1 focus-within:ring-emerald-500 rounded-xl overflow-visible bg-white transition-all shadow-xs relative", children: [
9279
+ /* @__PURE__ */ jsx16(
8322
9280
  "textarea",
8323
9281
  {
8324
9282
  ref: textareaRef,
@@ -8333,14 +9291,14 @@ function CreateTemplateModal({
8333
9291
  required: true
8334
9292
  }
8335
9293
  ),
8336
- /* @__PURE__ */ jsxs13(
9294
+ /* @__PURE__ */ jsxs15(
8337
9295
  "div",
8338
9296
  {
8339
9297
  className: "bg-slate-50/90 border-t border-slate-100 px-3 py-1.5 flex items-center justify-between gap-2 select-none relative",
8340
9298
  dir: language === "en_US" ? "ltr" : "rtl",
8341
9299
  children: [
8342
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
8343
- /* @__PURE__ */ jsx14(
9300
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
9301
+ /* @__PURE__ */ jsx16(
8344
9302
  "button",
8345
9303
  {
8346
9304
  type: "button",
@@ -8348,10 +9306,10 @@ function CreateTemplateModal({
8348
9306
  onClick: () => handleApplyFormatting("*"),
8349
9307
  title: "\u05DE\u05D5\u05D3\u05D2\u05E9 (Bold) *\u05D8\u05E7\u05E1\u05D8*",
8350
9308
  className: "w-7 h-7 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center justify-center font-bold text-xs transition-colors cursor-pointer",
8351
- children: /* @__PURE__ */ jsx14(Bold, { className: "w-3.5 h-3.5" })
9309
+ children: /* @__PURE__ */ jsx16(Bold, { className: "w-3.5 h-3.5" })
8352
9310
  }
8353
9311
  ),
8354
- /* @__PURE__ */ jsx14(
9312
+ /* @__PURE__ */ jsx16(
8355
9313
  "button",
8356
9314
  {
8357
9315
  type: "button",
@@ -8359,10 +9317,10 @@ function CreateTemplateModal({
8359
9317
  onClick: () => handleApplyFormatting("_"),
8360
9318
  title: "\u05E0\u05D8\u05D5\u05D9 (Italic) _\u05D8\u05E7\u05E1\u05D8_",
8361
9319
  className: "w-7 h-7 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center justify-center italic text-xs transition-colors cursor-pointer",
8362
- children: /* @__PURE__ */ jsx14(Italic, { className: "w-3.5 h-3.5" })
9320
+ children: /* @__PURE__ */ jsx16(Italic, { className: "w-3.5 h-3.5" })
8363
9321
  }
8364
9322
  ),
8365
- /* @__PURE__ */ jsx14(
9323
+ /* @__PURE__ */ jsx16(
8366
9324
  "button",
8367
9325
  {
8368
9326
  type: "button",
@@ -8370,12 +9328,12 @@ function CreateTemplateModal({
8370
9328
  onClick: () => handleApplyFormatting("~"),
8371
9329
  title: "\u05E7\u05D5 \u05D7\u05D5\u05E6\u05D4 (Strikethrough) ~\u05D8\u05E7\u05E1\u05D8~",
8372
9330
  className: "w-7 h-7 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center justify-center text-xs transition-colors cursor-pointer",
8373
- children: /* @__PURE__ */ jsx14(Strikethrough, { className: "w-3.5 h-3.5" })
9331
+ children: /* @__PURE__ */ jsx16(Strikethrough, { className: "w-3.5 h-3.5" })
8374
9332
  }
8375
9333
  ),
8376
- /* @__PURE__ */ jsx14("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
8377
- /* @__PURE__ */ jsxs13("div", { className: "relative inline-block", ref: emojiPickerRef, children: [
8378
- /* @__PURE__ */ jsx14(
9334
+ /* @__PURE__ */ jsx16("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
9335
+ /* @__PURE__ */ jsxs15("div", { className: "relative inline-block", ref: emojiPickerRef, children: [
9336
+ /* @__PURE__ */ jsx16(
8379
9337
  "button",
8380
9338
  {
8381
9339
  type: "button",
@@ -8383,16 +9341,16 @@ function CreateTemplateModal({
8383
9341
  onClick: () => setIsEmojiPickerOpen(!isEmojiPickerOpen),
8384
9342
  title: "\u05D4\u05D5\u05E1\u05E3 \u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9 (Emoji)",
8385
9343
  className: `w-7 h-7 rounded-lg flex items-center justify-center transition-colors cursor-pointer ${isEmojiPickerOpen ? "bg-emerald-100 text-emerald-700" : "text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80"}`,
8386
- children: /* @__PURE__ */ jsx14(Smile, { className: "w-4 h-4" })
9344
+ children: /* @__PURE__ */ jsx16(Smile, { className: "w-4 h-4" })
8387
9345
  }
8388
9346
  ),
8389
- isEmojiPickerOpen && /* @__PURE__ */ jsx14(
9347
+ isEmojiPickerOpen && /* @__PURE__ */ jsx16(
8390
9348
  "div",
8391
9349
  {
8392
9350
  className: `absolute bottom-full mb-2 ${language === "en_US" ? "left-0" : "right-0"} z-50 shadow-2xl rounded-2xl overflow-hidden border border-slate-200 animate-in fade-in zoom-in-95 duration-100`,
8393
9351
  dir: "ltr",
8394
9352
  onMouseDown: (e) => e.stopPropagation(),
8395
- children: /* @__PURE__ */ jsx14(
9353
+ children: /* @__PURE__ */ jsx16(
8396
9354
  EmojiPicker,
8397
9355
  {
8398
9356
  onEmojiClick: (emojiData) => {
@@ -8409,8 +9367,8 @@ function CreateTemplateModal({
8409
9367
  }
8410
9368
  )
8411
9369
  ] }),
8412
- /* @__PURE__ */ jsx14("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
8413
- /* @__PURE__ */ jsxs13(
9370
+ /* @__PURE__ */ jsx16("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
9371
+ /* @__PURE__ */ jsxs15(
8414
9372
  "button",
8415
9373
  {
8416
9374
  type: "button",
@@ -8420,28 +9378,28 @@ function CreateTemplateModal({
8420
9378
  "aria-label": language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4",
8421
9379
  className: "h-7 px-2 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-200/70 active:bg-slate-300/80 flex items-center gap-1 text-xs font-medium transition-colors cursor-pointer",
8422
9380
  children: [
8423
- /* @__PURE__ */ jsx14(Plus, { className: "w-3.5 h-3.5" }),
8424
- /* @__PURE__ */ jsx14("span", { children: language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4" })
9381
+ /* @__PURE__ */ jsx16(Plus, { className: "w-3.5 h-3.5" }),
9382
+ /* @__PURE__ */ jsx16("span", { children: language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4" })
8425
9383
  ]
8426
9384
  }
8427
9385
  )
8428
9386
  ] }),
8429
- /* @__PURE__ */ jsxs13(
9387
+ /* @__PURE__ */ jsxs15(
8430
9388
  "div",
8431
9389
  {
8432
9390
  className: "flex items-center gap-1 font-mono text-[11px]",
8433
9391
  dir: "ltr",
8434
9392
  title: "\u05DE\u05D2\u05D1\u05DC\u05EA \u05EA\u05D5\u05D5\u05D9\u05DD (1024 \u05EA\u05D5\u05D5\u05D9\u05DD \u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8)",
8435
9393
  children: [
8436
- /* @__PURE__ */ jsx14(
9394
+ /* @__PURE__ */ jsx16(
8437
9395
  "span",
8438
9396
  {
8439
9397
  className: `font-semibold transition-colors ${bodyText.length >= 1024 ? "text-rose-600" : bodyText.length >= 950 ? "text-amber-600" : "text-slate-500"}`,
8440
9398
  children: bodyText.length
8441
9399
  }
8442
9400
  ),
8443
- /* @__PURE__ */ jsx14("span", { className: "text-slate-300", children: "/" }),
8444
- /* @__PURE__ */ jsx14("span", { className: "text-slate-400", children: "1024" })
9401
+ /* @__PURE__ */ jsx16("span", { className: "text-slate-300", children: "/" }),
9402
+ /* @__PURE__ */ jsx16("span", { className: "text-slate-400", children: "1024" })
8445
9403
  ]
8446
9404
  }
8447
9405
  )
@@ -8449,30 +9407,30 @@ function CreateTemplateModal({
8449
9407
  }
8450
9408
  )
8451
9409
  ] }),
8452
- /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap items-center justify-between text-[11px] text-slate-400 px-1 gap-2", children: /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-3", children: [
8453
- /* @__PURE__ */ jsxs13("span", { children: [
9410
+ /* @__PURE__ */ jsx16("div", { className: "flex flex-wrap items-center justify-between text-[11px] text-slate-400 px-1 gap-2", children: /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-3", children: [
9411
+ /* @__PURE__ */ jsxs15("span", { children: [
8454
9412
  ratioInfo.staticWordsCount,
8455
9413
  " \u05DE\u05D9\u05DC\u05D9\u05DD"
8456
9414
  ] }),
8457
- /* @__PURE__ */ jsxs13("span", { children: [
9415
+ /* @__PURE__ */ jsxs15("span", { children: [
8458
9416
  ratioInfo.variableCount,
8459
9417
  " \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD"
8460
9418
  ] })
8461
9419
  ] }) }),
8462
- uniqueVariables.length > 0 && /* @__PURE__ */ jsxs13("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
8463
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 text-xs font-bold text-slate-800", children: [
8464
- /* @__PURE__ */ jsx14(Info2, { className: "w-4 h-4 text-emerald-600" }),
8465
- /* @__PURE__ */ jsx14("span", { children: "\u05E2\u05E8\u05DB\u05D9\u05DD \u05DC\u05D3\u05D5\u05D2\u05DE\u05D4 \u05DC\u05DE\u05E9\u05EA\u05E0\u05D9\u05DD (\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta)" })
9420
+ uniqueVariables.length > 0 && /* @__PURE__ */ jsxs15("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
9421
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5 text-xs font-bold text-slate-800", children: [
9422
+ /* @__PURE__ */ jsx16(Info2, { className: "w-4 h-4 text-emerald-600" }),
9423
+ /* @__PURE__ */ jsx16("span", { children: "\u05E2\u05E8\u05DB\u05D9\u05DD \u05DC\u05D3\u05D5\u05D2\u05DE\u05D4 \u05DC\u05DE\u05E9\u05EA\u05E0\u05D9\u05DD (\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta)" })
8466
9424
  ] }),
8467
- /* @__PURE__ */ jsx14("p", { className: "text-[11px] text-slate-500 leading-relaxed", children: "Meta \u05D3\u05D5\u05E8\u05E9\u05EA \u05D3\u05D5\u05D2\u05DE\u05D4 \u05E2\u05D1\u05D5\u05E8 \u05DB\u05DC \u05DE\u05E9\u05EA\u05E0\u05D4 \u05D9\u05D9\u05D7\u05D5\u05D3\u05D9 \u05DB\u05D3\u05D9 \u05DC\u05D5\u05D5\u05D3\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA \u05EA\u05D5\u05DB\u05DF." }),
8468
- /* @__PURE__ */ jsx14("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1", children: uniqueVariables.map((idx) => /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8469
- /* @__PURE__ */ jsxs13("label", { className: "block text-[11px] font-semibold text-slate-700 font-mono", children: [
9425
+ /* @__PURE__ */ jsx16("p", { className: "text-[11px] text-slate-500 leading-relaxed", children: "Meta \u05D3\u05D5\u05E8\u05E9\u05EA \u05D3\u05D5\u05D2\u05DE\u05D4 \u05E2\u05D1\u05D5\u05E8 \u05DB\u05DC \u05DE\u05E9\u05EA\u05E0\u05D4 \u05D9\u05D9\u05D7\u05D5\u05D3\u05D9 \u05DB\u05D3\u05D9 \u05DC\u05D5\u05D5\u05D3\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA \u05EA\u05D5\u05DB\u05DF." }),
9426
+ /* @__PURE__ */ jsx16("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1", children: uniqueVariables.map((idx) => /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9427
+ /* @__PURE__ */ jsxs15("label", { className: "block text-[11px] font-semibold text-slate-700 font-mono", children: [
8470
9428
  "\u05D3\u05D5\u05D2\u05DE\u05D4 \u05E2\u05D1\u05D5\u05E8 ",
8471
9429
  `{{${idx}}}`,
8472
9430
  " ",
8473
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9431
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8474
9432
  ] }),
8475
- /* @__PURE__ */ jsx14(
9433
+ /* @__PURE__ */ jsx16(
8476
9434
  "input",
8477
9435
  {
8478
9436
  type: "text",
@@ -8487,21 +9445,21 @@ function CreateTemplateModal({
8487
9445
  )
8488
9446
  ] }, idx)) })
8489
9447
  ] }),
8490
- bodyText.trim().length > 0 && validationResult.errors.length > 0 && /* @__PURE__ */ jsxs13("div", { className: "p-3.5 bg-amber-50 border border-amber-200 rounded-xl space-y-1.5 text-xs text-amber-900", children: [
8491
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1.5 font-bold", children: [
8492
- /* @__PURE__ */ jsx14(AlertCircle2, { className: "w-4 h-4 text-amber-600 shrink-0" }),
8493
- /* @__PURE__ */ jsx14("span", { children: "\u05D3\u05E8\u05D9\u05E9\u05D5\u05EA \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA Meta \u05DC\u05D7\u05E1\u05D9\u05DE\u05EA \u05E9\u05D2\u05D9\u05D0\u05D5\u05EA:" })
9448
+ bodyText.trim().length > 0 && validationResult.errors.length > 0 && /* @__PURE__ */ jsxs15("div", { className: "p-3.5 bg-amber-50 border border-amber-200 rounded-xl space-y-1.5 text-xs text-amber-900", children: [
9449
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5 font-bold", children: [
9450
+ /* @__PURE__ */ jsx16(AlertCircle2, { className: "w-4 h-4 text-amber-600 shrink-0" }),
9451
+ /* @__PURE__ */ jsx16("span", { children: "\u05D3\u05E8\u05D9\u05E9\u05D5\u05EA \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA Meta \u05DC\u05D7\u05E1\u05D9\u05DE\u05EA \u05E9\u05D2\u05D9\u05D0\u05D5\u05EA:" })
8494
9452
  ] }),
8495
- /* @__PURE__ */ jsx14("ul", { className: "list-disc list-inside space-y-1 text-[11px] pr-2 leading-relaxed", children: validationResult.errors.map((err, i) => /* @__PURE__ */ jsx14("li", { children: err }, i)) })
9453
+ /* @__PURE__ */ jsx16("ul", { className: "list-disc list-inside space-y-1 text-[11px] pr-2 leading-relaxed", children: validationResult.errors.map((err, i) => /* @__PURE__ */ jsx16("li", { children: err }, i)) })
8496
9454
  ] })
8497
9455
  ] }),
8498
- /* @__PURE__ */ jsxs13("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
8499
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
8500
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
8501
- /* @__PURE__ */ jsx14(Paperclip, { className: "w-4 h-4 text-slate-600" }),
8502
- /* @__PURE__ */ jsx14("label", { htmlFor: "modalHeaderFileCheckbox", className: "text-xs font-bold text-slate-800 cursor-pointer", children: "\u05E7\u05D5\u05D1\u05E5 \u05DB\u05D5\u05EA\u05E8\u05EA \u05DE\u05E6\u05D5\u05E8\u05E3 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" })
9456
+ /* @__PURE__ */ jsxs15("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
9457
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
9458
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
9459
+ /* @__PURE__ */ jsx16(Paperclip, { className: "w-4 h-4 text-slate-600" }),
9460
+ /* @__PURE__ */ jsx16("label", { htmlFor: "modalHeaderFileCheckbox", className: "text-xs font-bold text-slate-800 cursor-pointer", children: "\u05E7\u05D5\u05D1\u05E5 \u05DB\u05D5\u05EA\u05E8\u05EA \u05DE\u05E6\u05D5\u05E8\u05E3 (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" })
8503
9461
  ] }),
8504
- /* @__PURE__ */ jsx14(
9462
+ /* @__PURE__ */ jsx16(
8505
9463
  "input",
8506
9464
  {
8507
9465
  type: "checkbox",
@@ -8517,12 +9475,12 @@ function CreateTemplateModal({
8517
9475
  }
8518
9476
  )
8519
9477
  ] }),
8520
- hasFileHeader && /* @__PURE__ */ jsxs13("div", { className: "space-y-3 pt-1", children: [
8521
- fileError && /* @__PURE__ */ jsxs13("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl flex items-center gap-2 text-xs text-rose-700 font-semibold animate-in fade-in duration-150", children: [
8522
- /* @__PURE__ */ jsx14(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
8523
- /* @__PURE__ */ jsx14("span", { children: fileError })
9478
+ hasFileHeader && /* @__PURE__ */ jsxs15("div", { className: "space-y-3 pt-1", children: [
9479
+ fileError && /* @__PURE__ */ jsxs15("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl flex items-center gap-2 text-xs text-rose-700 font-semibold animate-in fade-in duration-150", children: [
9480
+ /* @__PURE__ */ jsx16(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
9481
+ /* @__PURE__ */ jsx16("span", { children: fileError })
8524
9482
  ] }),
8525
- /* @__PURE__ */ jsx14(
9483
+ /* @__PURE__ */ jsx16(
8526
9484
  "input",
8527
9485
  {
8528
9486
  ref: fileInputRef,
@@ -8532,7 +9490,7 @@ function CreateTemplateModal({
8532
9490
  className: "hidden"
8533
9491
  }
8534
9492
  ),
8535
- !selectedFile && /* @__PURE__ */ jsxs13(
9493
+ !selectedFile && /* @__PURE__ */ jsxs15(
8536
9494
  "button",
8537
9495
  {
8538
9496
  type: "button",
@@ -8542,49 +9500,49 @@ function CreateTemplateModal({
8542
9500
  },
8543
9501
  className: "w-full p-4 border-2 border-dashed border-slate-300 hover:border-emerald-500 rounded-xl flex flex-col items-center justify-center gap-2 bg-white hover:bg-emerald-50/30 transition-all cursor-pointer",
8544
9502
  children: [
8545
- /* @__PURE__ */ jsx14("div", { className: "w-9 h-9 rounded-full bg-slate-100 text-slate-500 flex items-center justify-center", children: /* @__PURE__ */ jsx14(Upload2, { className: "w-4 h-4" }) }),
8546
- /* @__PURE__ */ jsxs13("div", { className: "text-center", children: [
8547
- /* @__PURE__ */ jsx14("span", { className: "text-xs font-bold text-emerald-700 block", children: "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D7\u05D9\u05E8\u05EA \u05E7\u05D5\u05D1\u05E5" }),
8548
- /* @__PURE__ */ jsx14("span", { className: "text-[10px] text-slate-400", children: "PDF, JPG, PNG, MP4 \u05E2\u05D3 5MB" })
9503
+ /* @__PURE__ */ jsx16("div", { className: "w-9 h-9 rounded-full bg-slate-100 text-slate-500 flex items-center justify-center", children: /* @__PURE__ */ jsx16(Upload2, { className: "w-4 h-4" }) }),
9504
+ /* @__PURE__ */ jsxs15("div", { className: "text-center", children: [
9505
+ /* @__PURE__ */ jsx16("span", { className: "text-xs font-bold text-emerald-700 block", children: "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D7\u05D9\u05E8\u05EA \u05E7\u05D5\u05D1\u05E5" }),
9506
+ /* @__PURE__ */ jsx16("span", { className: "text-[10px] text-slate-400", children: "PDF, JPG, PNG, MP4 \u05E2\u05D3 5MB" })
8549
9507
  ] })
8550
9508
  ]
8551
9509
  }
8552
9510
  ),
8553
- selectedFile && /* @__PURE__ */ jsxs13("div", { className: "p-3 bg-white border border-emerald-200 rounded-xl flex items-center justify-between gap-3 shadow-2xs", children: [
8554
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2.5 overflow-hidden", children: [
8555
- /* @__PURE__ */ jsx14("div", { className: "w-8 h-8 rounded-lg bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0", children: selectedFile.type.includes("pdf") || selectedFile.name.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ jsx14(FileText2, { className: "w-4 h-4" }) : selectedFile.type.includes("video") || selectedFile.name.toLowerCase().match(/\.(mp4|mov|avi|webm)$/) ? /* @__PURE__ */ jsx14(Video, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx14(ImageIcon, { className: "w-4 h-4" }) }),
8556
- /* @__PURE__ */ jsxs13("div", { className: "overflow-hidden", children: [
8557
- /* @__PURE__ */ jsx14("p", { className: "text-xs font-bold text-slate-800 truncate", title: selectedFile.name, children: /* @__PURE__ */ jsx14("span", { dir: "ltr", className: "inline-block truncate max-w-full", children: selectedFile.name }) }),
8558
- /* @__PURE__ */ jsx14("p", { className: "text-[10px] text-slate-400", children: /* @__PURE__ */ jsxs13("span", { dir: "ltr", className: "inline-block", children: [
9511
+ selectedFile && /* @__PURE__ */ jsxs15("div", { className: "p-3 bg-white border border-emerald-200 rounded-xl flex items-center justify-between gap-3 shadow-2xs", children: [
9512
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2.5 overflow-hidden", children: [
9513
+ /* @__PURE__ */ jsx16("div", { className: "w-8 h-8 rounded-lg bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0", children: selectedFile.type.includes("pdf") || selectedFile.name.toLowerCase().endsWith(".pdf") ? /* @__PURE__ */ jsx16(FileText2, { className: "w-4 h-4" }) : selectedFile.type.includes("video") || selectedFile.name.toLowerCase().match(/\.(mp4|mov|avi|webm)$/) ? /* @__PURE__ */ jsx16(Video, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx16(ImageIcon, { className: "w-4 h-4" }) }),
9514
+ /* @__PURE__ */ jsxs15("div", { className: "overflow-hidden", children: [
9515
+ /* @__PURE__ */ jsx16("p", { className: "text-xs font-bold text-slate-800 truncate", title: selectedFile.name, children: /* @__PURE__ */ jsx16("span", { dir: "ltr", className: "inline-block truncate max-w-full", children: selectedFile.name }) }),
9516
+ /* @__PURE__ */ jsx16("p", { className: "text-[10px] text-slate-400", children: /* @__PURE__ */ jsxs15("span", { dir: "ltr", className: "inline-block", children: [
8559
9517
  formatFileSize(selectedFile.size),
8560
9518
  selectedFile.type ? ` \u2022 ${selectedFile.type}` : ""
8561
9519
  ] }) })
8562
9520
  ] })
8563
9521
  ] }),
8564
- /* @__PURE__ */ jsx14(
9522
+ /* @__PURE__ */ jsx16(
8565
9523
  "button",
8566
9524
  {
8567
9525
  type: "button",
8568
9526
  onClick: handleRemoveFile,
8569
9527
  className: "p-1 text-slate-400 hover:text-rose-600 rounded-md transition-colors cursor-pointer",
8570
9528
  title: "\u05D4\u05E1\u05E8 \u05E7\u05D5\u05D1\u05E5",
8571
- children: /* @__PURE__ */ jsx14(Trash22, { className: "w-4 h-4" })
9529
+ children: /* @__PURE__ */ jsx16(Trash22, { className: "w-4 h-4" })
8572
9530
  }
8573
9531
  )
8574
9532
  ] })
8575
9533
  ] })
8576
9534
  ] }),
8577
- /* @__PURE__ */ jsxs13("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3.5", children: [
8578
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
8579
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
8580
- /* @__PURE__ */ jsx14(MousePointerClick, { className: "w-4 h-4 text-slate-600" }),
8581
- /* @__PURE__ */ jsxs13("div", { children: [
8582
- /* @__PURE__ */ jsx14("span", { className: "text-xs font-bold text-slate-800 block", children: "\u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD \u05D0\u05D9\u05E0\u05D8\u05E8\u05D0\u05E7\u05D8\u05D9\u05D1\u05D9\u05D9\u05DD (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" }),
8583
- /* @__PURE__ */ jsx14("span", { className: "text-[10px] text-slate-400 block", children: "\u05D4\u05D5\u05E1\u05E4\u05EA \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9 \u05E7\u05E8\u05D9\u05D0\u05D4 \u05DC\u05E4\u05E2\u05D5\u05DC\u05D4 (CTA) \u05D5\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 (\u05E2\u05D3 10 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD)" })
9535
+ /* @__PURE__ */ jsxs15("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3.5", children: [
9536
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
9537
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
9538
+ /* @__PURE__ */ jsx16(MousePointerClick, { className: "w-4 h-4 text-slate-600" }),
9539
+ /* @__PURE__ */ jsxs15("div", { children: [
9540
+ /* @__PURE__ */ jsx16("span", { className: "text-xs font-bold text-slate-800 block", children: "\u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD \u05D0\u05D9\u05E0\u05D8\u05E8\u05D0\u05E7\u05D8\u05D9\u05D1\u05D9\u05D9\u05DD (\u05D0\u05D5\u05E4\u05E6\u05D9\u05D5\u05E0\u05DC\u05D9)" }),
9541
+ /* @__PURE__ */ jsx16("span", { className: "text-[10px] text-slate-400 block", children: "\u05D4\u05D5\u05E1\u05E4\u05EA \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9 \u05E7\u05E8\u05D9\u05D0\u05D4 \u05DC\u05E4\u05E2\u05D5\u05DC\u05D4 (CTA) \u05D5\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4 (\u05E2\u05D3 10 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD)" })
8584
9542
  ] })
8585
9543
  ] }),
8586
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
8587
- /* @__PURE__ */ jsxs13(
9544
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
9545
+ /* @__PURE__ */ jsxs15(
8588
9546
  "span",
8589
9547
  {
8590
9548
  className: `text-[10px] font-mono px-2 py-0.5 rounded-full border ${buttons.length >= 10 ? "bg-amber-50 text-amber-700 border-amber-200 font-bold" : "bg-white text-slate-500 border-slate-200"}`,
@@ -8594,8 +9552,8 @@ function CreateTemplateModal({
8594
9552
  ]
8595
9553
  }
8596
9554
  ),
8597
- /* @__PURE__ */ jsxs13("div", { className: "relative", ref: addButtonDropdownRef, children: [
8598
- /* @__PURE__ */ jsxs13(
9555
+ /* @__PURE__ */ jsxs15("div", { className: "relative", ref: addButtonDropdownRef, children: [
9556
+ /* @__PURE__ */ jsxs15(
8599
9557
  "button",
8600
9558
  {
8601
9559
  type: "button",
@@ -8604,9 +9562,9 @@ function CreateTemplateModal({
8604
9562
  className: `inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-semibold rounded-xl border transition-all ${buttons.length >= 10 ? "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed opacity-60" : "bg-white text-emerald-700 border-emerald-200 hover:bg-emerald-50/80 active:scale-[0.98] shadow-2xs cursor-pointer"}`,
8605
9563
  title: buttons.length >= 10 ? "\u05D4\u05D2\u05E2\u05EA \u05DC\u05DE\u05D2\u05D1\u05DC\u05D4 \u05D4\u05DE\u05E8\u05D1\u05D9\u05EA \u05E9\u05DC 10 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD" : "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8 \u05D7\u05D3\u05E9",
8606
9564
  children: [
8607
- /* @__PURE__ */ jsx14(Plus, { className: "w-3.5 h-3.5" }),
8608
- /* @__PURE__ */ jsx14("span", { children: "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" }),
8609
- /* @__PURE__ */ jsx14(
9565
+ /* @__PURE__ */ jsx16(Plus, { className: "w-3.5 h-3.5" }),
9566
+ /* @__PURE__ */ jsx16("span", { children: "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" }),
9567
+ /* @__PURE__ */ jsx16(
8610
9568
  ChevronDown2,
8611
9569
  {
8612
9570
  className: `w-3.5 h-3.5 transition-transform ${isAddButtonOpen ? "rotate-180" : ""}`
@@ -8615,63 +9573,63 @@ function CreateTemplateModal({
8615
9573
  ]
8616
9574
  }
8617
9575
  ),
8618
- isAddButtonOpen && /* @__PURE__ */ jsxs13("div", { className: "absolute top-full left-0 mt-1.5 w-64 bg-white border border-slate-200 rounded-xl shadow-xl z-30 p-1.5 space-y-1 animate-in fade-in-50 zoom-in-95 duration-100 divide-y divide-slate-100", children: [
8619
- /* @__PURE__ */ jsxs13(
9576
+ isAddButtonOpen && /* @__PURE__ */ jsxs15("div", { className: "absolute top-full left-0 mt-1.5 w-64 bg-white border border-slate-200 rounded-xl shadow-xl z-30 p-1.5 space-y-1 animate-in fade-in-50 zoom-in-95 duration-100 divide-y divide-slate-100", children: [
9577
+ /* @__PURE__ */ jsxs15(
8620
9578
  "button",
8621
9579
  {
8622
9580
  type: "button",
8623
9581
  onClick: () => handleAddButton("QUICK_REPLY"),
8624
9582
  className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group",
8625
9583
  children: [
8626
- /* @__PURE__ */ jsx14("div", { className: "w-7 h-7 rounded-md bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-emerald-100", children: /* @__PURE__ */ jsx14(MessageSquare, { className: "w-3.5 h-3.5" }) }),
8627
- /* @__PURE__ */ jsxs13("div", { children: [
8628
- /* @__PURE__ */ jsx14("p", { className: "text-xs font-semibold text-slate-800", children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" }),
8629
- /* @__PURE__ */ jsx14("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05DE\u05E2\u05E0\u05D4 \u05DE\u05D4\u05D9\u05E8 \u05D1\u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05D7\u05EA" })
9584
+ /* @__PURE__ */ jsx16("div", { className: "w-7 h-7 rounded-md bg-emerald-50 text-emerald-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-emerald-100", children: /* @__PURE__ */ jsx16(MessageSquare, { className: "w-3.5 h-3.5" }) }),
9585
+ /* @__PURE__ */ jsxs15("div", { children: [
9586
+ /* @__PURE__ */ jsx16("p", { className: "text-xs font-semibold text-slate-800", children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" }),
9587
+ /* @__PURE__ */ jsx16("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05DE\u05E2\u05E0\u05D4 \u05DE\u05D4\u05D9\u05E8 \u05D1\u05DC\u05D7\u05D9\u05E6\u05D4 \u05D0\u05D7\u05EA" })
8630
9588
  ] })
8631
9589
  ]
8632
9590
  }
8633
9591
  ),
8634
- /* @__PURE__ */ jsxs13(
9592
+ /* @__PURE__ */ jsxs15(
8635
9593
  "button",
8636
9594
  {
8637
9595
  type: "button",
8638
9596
  onClick: () => handleAddButton("URL"),
8639
9597
  className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group pt-2",
8640
9598
  children: [
8641
- /* @__PURE__ */ jsx14("div", { className: "w-7 h-7 rounded-md bg-sky-50 text-sky-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-sky-100", children: /* @__PURE__ */ jsx14(ExternalLink3, { className: "w-3.5 h-3.5" }) }),
8642
- /* @__PURE__ */ jsxs13("div", { children: [
8643
- /* @__PURE__ */ jsx14("p", { className: "text-xs font-semibold text-slate-800", children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" }),
8644
- /* @__PURE__ */ jsx14("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05E7\u05D9\u05E9\u05D5\u05E8 \u05D0\u05D9\u05E0\u05D8\u05E8\u05E0\u05D8 \u05E1\u05D8\u05D8\u05D9" })
9599
+ /* @__PURE__ */ jsx16("div", { className: "w-7 h-7 rounded-md bg-sky-50 text-sky-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-sky-100", children: /* @__PURE__ */ jsx16(ExternalLink3, { className: "w-3.5 h-3.5" }) }),
9600
+ /* @__PURE__ */ jsxs15("div", { children: [
9601
+ /* @__PURE__ */ jsx16("p", { className: "text-xs font-semibold text-slate-800", children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" }),
9602
+ /* @__PURE__ */ jsx16("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05E7\u05D9\u05E9\u05D5\u05E8 \u05D0\u05D9\u05E0\u05D8\u05E8\u05E0\u05D8 \u05E1\u05D8\u05D8\u05D9" })
8645
9603
  ] })
8646
9604
  ]
8647
9605
  }
8648
9606
  ),
8649
- /* @__PURE__ */ jsxs13(
9607
+ /* @__PURE__ */ jsxs15(
8650
9608
  "button",
8651
9609
  {
8652
9610
  type: "button",
8653
9611
  onClick: () => handleAddButton("PHONE_NUMBER"),
8654
9612
  className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group pt-2",
8655
9613
  children: [
8656
- /* @__PURE__ */ jsx14("div", { className: "w-7 h-7 rounded-md bg-violet-50 text-violet-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-violet-100", children: /* @__PURE__ */ jsx14(Phone, { className: "w-3.5 h-3.5" }) }),
8657
- /* @__PURE__ */ jsxs13("div", { children: [
8658
- /* @__PURE__ */ jsx14("p", { className: "text-xs font-semibold text-slate-800", children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" }),
8659
- /* @__PURE__ */ jsx14("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05D7\u05D9\u05D5\u05D2 \u05D9\u05E9\u05D9\u05E8 \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF" })
9614
+ /* @__PURE__ */ jsx16("div", { className: "w-7 h-7 rounded-md bg-violet-50 text-violet-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-violet-100", children: /* @__PURE__ */ jsx16(Phone, { className: "w-3.5 h-3.5" }) }),
9615
+ /* @__PURE__ */ jsxs15("div", { children: [
9616
+ /* @__PURE__ */ jsx16("p", { className: "text-xs font-semibold text-slate-800", children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" }),
9617
+ /* @__PURE__ */ jsx16("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05D7\u05D9\u05D5\u05D2 \u05D9\u05E9\u05D9\u05E8 \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF" })
8660
9618
  ] })
8661
9619
  ]
8662
9620
  }
8663
9621
  ),
8664
- /* @__PURE__ */ jsxs13(
9622
+ /* @__PURE__ */ jsxs15(
8665
9623
  "button",
8666
9624
  {
8667
9625
  type: "button",
8668
9626
  onClick: () => handleAddButton("COPY_CODE"),
8669
9627
  className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group pt-2",
8670
9628
  children: [
8671
- /* @__PURE__ */ jsx14("div", { className: "w-7 h-7 rounded-md bg-amber-50 text-amber-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-amber-100", children: /* @__PURE__ */ jsx14(Copy3, { className: "w-3.5 h-3.5" }) }),
8672
- /* @__PURE__ */ jsxs13("div", { children: [
8673
- /* @__PURE__ */ jsx14("p", { className: "text-xs font-semibold text-slate-800", children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" }),
8674
- /* @__PURE__ */ jsx14("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3 \u05E7\u05D5\u05E4\u05D5\u05DF \u05DC\u05DC\u05D5\u05D7" })
9629
+ /* @__PURE__ */ jsx16("div", { className: "w-7 h-7 rounded-md bg-amber-50 text-amber-600 flex items-center justify-center shrink-0 mt-0.5 group-hover:bg-amber-100", children: /* @__PURE__ */ jsx16(Copy3, { className: "w-3.5 h-3.5" }) }),
9630
+ /* @__PURE__ */ jsxs15("div", { children: [
9631
+ /* @__PURE__ */ jsx16("p", { className: "text-xs font-semibold text-slate-800", children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" }),
9632
+ /* @__PURE__ */ jsx16("p", { className: "text-[10px] text-slate-400 leading-tight", children: "\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3 \u05E7\u05D5\u05E4\u05D5\u05DF \u05DC\u05DC\u05D5\u05D7" })
8675
9633
  ] })
8676
9634
  ]
8677
9635
  }
@@ -8680,55 +9638,55 @@ function CreateTemplateModal({
8680
9638
  ] })
8681
9639
  ] })
8682
9640
  ] }),
8683
- buttons.length === 0 && /* @__PURE__ */ jsx14("div", { className: "p-3 text-center border border-dashed border-slate-200 rounded-lg text-slate-400 text-xs bg-white/60", children: '\u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8\u05D5 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD. \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" \u05DB\u05D3\u05D9 \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8 \u05E8\u05D0\u05E9\u05D5\u05DF \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA.' }),
8684
- buttons.length > 0 && /* @__PURE__ */ jsx14("div", { className: "space-y-2.5", children: buttons.map((btn, index) => {
9641
+ buttons.length === 0 && /* @__PURE__ */ jsx16("div", { className: "p-3 text-center border border-dashed border-slate-200 rounded-lg text-slate-400 text-xs bg-white/60", children: '\u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8\u05D5 \u05DB\u05E4\u05EA\u05D5\u05E8\u05D9\u05DD. \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" \u05DB\u05D3\u05D9 \u05DC\u05D4\u05D5\u05E1\u05D9\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8 \u05E8\u05D0\u05E9\u05D5\u05DF \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA.' }),
9642
+ buttons.length > 0 && /* @__PURE__ */ jsx16("div", { className: "space-y-2.5", children: buttons.map((btn, index) => {
8685
9643
  const btnNum = index + 1;
8686
- return /* @__PURE__ */ jsxs13(
9644
+ return /* @__PURE__ */ jsxs15(
8687
9645
  "div",
8688
9646
  {
8689
9647
  className: "p-3 bg-white border border-slate-200 rounded-xl space-y-2.5 shadow-2xs transition-all hover:border-slate-300",
8690
9648
  children: [
8691
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between", children: [
8692
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
8693
- /* @__PURE__ */ jsxs13("span", { className: "text-[11px] font-bold text-slate-400 font-mono", children: [
9649
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
9650
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
9651
+ /* @__PURE__ */ jsxs15("span", { className: "text-[11px] font-bold text-slate-400 font-mono", children: [
8694
9652
  "#",
8695
9653
  btnNum
8696
9654
  ] }),
8697
- btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-emerald-50 text-emerald-700 border border-emerald-200 text-[10px] font-semibold", children: [
8698
- /* @__PURE__ */ jsx14(MessageSquare, { className: "w-3 h-3" }),
8699
- /* @__PURE__ */ jsx14("span", { children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" })
9655
+ btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-emerald-50 text-emerald-700 border border-emerald-200 text-[10px] font-semibold", children: [
9656
+ /* @__PURE__ */ jsx16(MessageSquare, { className: "w-3 h-3" }),
9657
+ /* @__PURE__ */ jsx16("span", { children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" })
8700
9658
  ] }),
8701
- btn.type === "URL" && /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-sky-50 text-sky-700 border border-sky-200 text-[10px] font-semibold", children: [
8702
- /* @__PURE__ */ jsx14(ExternalLink3, { className: "w-3 h-3" }),
8703
- /* @__PURE__ */ jsx14("span", { children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" })
9659
+ btn.type === "URL" && /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-sky-50 text-sky-700 border border-sky-200 text-[10px] font-semibold", children: [
9660
+ /* @__PURE__ */ jsx16(ExternalLink3, { className: "w-3 h-3" }),
9661
+ /* @__PURE__ */ jsx16("span", { children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" })
8704
9662
  ] }),
8705
- btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-violet-50 text-violet-700 border border-violet-200 text-[10px] font-semibold", children: [
8706
- /* @__PURE__ */ jsx14(Phone, { className: "w-3 h-3" }),
8707
- /* @__PURE__ */ jsx14("span", { children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" })
9663
+ btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-violet-50 text-violet-700 border border-violet-200 text-[10px] font-semibold", children: [
9664
+ /* @__PURE__ */ jsx16(Phone, { className: "w-3 h-3" }),
9665
+ /* @__PURE__ */ jsx16("span", { children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" })
8708
9666
  ] }),
8709
- btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs13("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-amber-50 text-amber-700 border border-amber-200 text-[10px] font-semibold", children: [
8710
- /* @__PURE__ */ jsx14(Copy3, { className: "w-3 h-3" }),
8711
- /* @__PURE__ */ jsx14("span", { children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" })
9667
+ btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs15("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-lg bg-amber-50 text-amber-700 border border-amber-200 text-[10px] font-semibold", children: [
9668
+ /* @__PURE__ */ jsx16(Copy3, { className: "w-3 h-3" }),
9669
+ /* @__PURE__ */ jsx16("span", { children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" })
8712
9670
  ] })
8713
9671
  ] }),
8714
- /* @__PURE__ */ jsx14(
9672
+ /* @__PURE__ */ jsx16(
8715
9673
  "button",
8716
9674
  {
8717
9675
  type: "button",
8718
9676
  onClick: () => handleRemoveButton(index),
8719
9677
  className: "p-1 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded-lg transition-colors cursor-pointer",
8720
9678
  title: "\u05D4\u05E1\u05E8 \u05DB\u05E4\u05EA\u05D5\u05E8",
8721
- children: /* @__PURE__ */ jsx14(Trash22, { className: "w-3.5 h-3.5" })
9679
+ children: /* @__PURE__ */ jsx16(Trash22, { className: "w-3.5 h-3.5" })
8722
9680
  }
8723
9681
  )
8724
9682
  ] }),
8725
- btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8726
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8727
- /* @__PURE__ */ jsxs13("label", { className: "font-semibold text-slate-700", children: [
9683
+ btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9684
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9685
+ /* @__PURE__ */ jsxs15("label", { className: "font-semibold text-slate-700", children: [
8728
9686
  "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
8729
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9687
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8730
9688
  ] }),
8731
- /* @__PURE__ */ jsxs13(
9689
+ /* @__PURE__ */ jsxs15(
8732
9690
  "span",
8733
9691
  {
8734
9692
  className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -8739,7 +9697,7 @@ function CreateTemplateModal({
8739
9697
  }
8740
9698
  )
8741
9699
  ] }),
8742
- /* @__PURE__ */ jsx14(
9700
+ /* @__PURE__ */ jsx16(
8743
9701
  "input",
8744
9702
  {
8745
9703
  type: "text",
@@ -8751,14 +9709,14 @@ function CreateTemplateModal({
8751
9709
  }
8752
9710
  )
8753
9711
  ] }),
8754
- btn.type === "URL" && /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
8755
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8756
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8757
- /* @__PURE__ */ jsxs13("label", { className: "font-semibold text-slate-700", children: [
9712
+ btn.type === "URL" && /* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
9713
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9714
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9715
+ /* @__PURE__ */ jsxs15("label", { className: "font-semibold text-slate-700", children: [
8758
9716
  "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
8759
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9717
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8760
9718
  ] }),
8761
- /* @__PURE__ */ jsxs13(
9719
+ /* @__PURE__ */ jsxs15(
8762
9720
  "span",
8763
9721
  {
8764
9722
  className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -8769,7 +9727,7 @@ function CreateTemplateModal({
8769
9727
  }
8770
9728
  )
8771
9729
  ] }),
8772
- /* @__PURE__ */ jsx14(
9730
+ /* @__PURE__ */ jsx16(
8773
9731
  "input",
8774
9732
  {
8775
9733
  type: "text",
@@ -8781,18 +9739,18 @@ function CreateTemplateModal({
8781
9739
  }
8782
9740
  )
8783
9741
  ] }),
8784
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8785
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8786
- /* @__PURE__ */ jsxs13("label", { className: "font-semibold text-slate-700", children: [
9742
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9743
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9744
+ /* @__PURE__ */ jsxs15("label", { className: "font-semibold text-slate-700", children: [
8787
9745
  "\u05DB\u05EA\u05D5\u05D1\u05EA URL \u05E1\u05D8\u05D8\u05D9\u05EA ",
8788
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9746
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8789
9747
  ] }),
8790
- /* @__PURE__ */ jsxs13("span", { className: "font-mono text-[10px] text-slate-400", children: [
9748
+ /* @__PURE__ */ jsxs15("span", { className: "font-mono text-[10px] text-slate-400", children: [
8791
9749
  (btn.url || "").length,
8792
9750
  "/2000"
8793
9751
  ] })
8794
9752
  ] }),
8795
- /* @__PURE__ */ jsx14(
9753
+ /* @__PURE__ */ jsx16(
8796
9754
  "input",
8797
9755
  {
8798
9756
  type: "url",
@@ -8806,14 +9764,14 @@ function CreateTemplateModal({
8806
9764
  )
8807
9765
  ] })
8808
9766
  ] }),
8809
- btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
8810
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8811
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8812
- /* @__PURE__ */ jsxs13("label", { className: "font-semibold text-slate-700", children: [
9767
+ btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
9768
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9769
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9770
+ /* @__PURE__ */ jsxs15("label", { className: "font-semibold text-slate-700", children: [
8813
9771
  "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
8814
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9772
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8815
9773
  ] }),
8816
- /* @__PURE__ */ jsxs13(
9774
+ /* @__PURE__ */ jsxs15(
8817
9775
  "span",
8818
9776
  {
8819
9777
  className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -8824,7 +9782,7 @@ function CreateTemplateModal({
8824
9782
  }
8825
9783
  )
8826
9784
  ] }),
8827
- /* @__PURE__ */ jsx14(
9785
+ /* @__PURE__ */ jsx16(
8828
9786
  "input",
8829
9787
  {
8830
9788
  type: "text",
@@ -8836,18 +9794,18 @@ function CreateTemplateModal({
8836
9794
  }
8837
9795
  )
8838
9796
  ] }),
8839
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8840
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8841
- /* @__PURE__ */ jsxs13("label", { className: "font-semibold text-slate-700", children: [
9797
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9798
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9799
+ /* @__PURE__ */ jsxs15("label", { className: "font-semibold text-slate-700", children: [
8842
9800
  "\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF (\u05E4\u05D5\u05E8\u05DE\u05D8: +[\u05E7\u05D9\u05D3\u05D5\u05DE\u05EA][\u05DE\u05E1\u05E4\u05E8]) ",
8843
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9801
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8844
9802
  ] }),
8845
- /* @__PURE__ */ jsxs13("span", { className: "font-mono text-[10px] text-slate-400", children: [
9803
+ /* @__PURE__ */ jsxs15("span", { className: "font-mono text-[10px] text-slate-400", children: [
8846
9804
  (btn.phone_number || "").length,
8847
9805
  "/20"
8848
9806
  ] })
8849
9807
  ] }),
8850
- /* @__PURE__ */ jsx14(
9808
+ /* @__PURE__ */ jsx16(
8851
9809
  "input",
8852
9810
  {
8853
9811
  type: "tel",
@@ -8861,14 +9819,14 @@ function CreateTemplateModal({
8861
9819
  )
8862
9820
  ] })
8863
9821
  ] }),
8864
- btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs13("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
8865
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8866
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8867
- /* @__PURE__ */ jsxs13("label", { className: "font-semibold text-slate-700", children: [
9822
+ btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs15("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
9823
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9824
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9825
+ /* @__PURE__ */ jsxs15("label", { className: "font-semibold text-slate-700", children: [
8868
9826
  "\u05E7\u05D5\u05D3 \u05D4\u05E6\u05E2\u05D4 / \u05E7\u05D5\u05E4\u05D5\u05DF ",
8869
- /* @__PURE__ */ jsx14("span", { className: "text-rose-500", children: "*" })
9827
+ /* @__PURE__ */ jsx16("span", { className: "text-rose-500", children: "*" })
8870
9828
  ] }),
8871
- /* @__PURE__ */ jsxs13(
9829
+ /* @__PURE__ */ jsxs15(
8872
9830
  "span",
8873
9831
  {
8874
9832
  className: `font-mono text-[10px] ${(btn.example || "").length >= 15 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -8879,7 +9837,7 @@ function CreateTemplateModal({
8879
9837
  }
8880
9838
  )
8881
9839
  ] }),
8882
- /* @__PURE__ */ jsx14(
9840
+ /* @__PURE__ */ jsx16(
8883
9841
  "input",
8884
9842
  {
8885
9843
  type: "text",
@@ -8892,15 +9850,15 @@ function CreateTemplateModal({
8892
9850
  }
8893
9851
  )
8894
9852
  ] }),
8895
- /* @__PURE__ */ jsxs13("div", { className: "space-y-1", children: [
8896
- /* @__PURE__ */ jsxs13("div", { className: "flex items-center justify-between text-[11px]", children: [
8897
- /* @__PURE__ */ jsx14("label", { className: "font-semibold text-slate-700", children: "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 (\u05D1\u05E8\u05D9\u05E8\u05EA \u05DE\u05D7\u05D3\u05DC: \u05D4\u05E2\u05EA\u05E7 \u05E7\u05D5\u05D3)" }),
8898
- /* @__PURE__ */ jsxs13("span", { className: "font-mono text-[10px] text-slate-400", children: [
9853
+ /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
9854
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between text-[11px]", children: [
9855
+ /* @__PURE__ */ jsx16("label", { className: "font-semibold text-slate-700", children: "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 (\u05D1\u05E8\u05D9\u05E8\u05EA \u05DE\u05D7\u05D3\u05DC: \u05D4\u05E2\u05EA\u05E7 \u05E7\u05D5\u05D3)" }),
9856
+ /* @__PURE__ */ jsxs15("span", { className: "font-mono text-[10px] text-slate-400", children: [
8899
9857
  (btn.text || "").length,
8900
9858
  "/25"
8901
9859
  ] })
8902
9860
  ] }),
8903
- /* @__PURE__ */ jsx14(
9861
+ /* @__PURE__ */ jsx16(
8904
9862
  "input",
8905
9863
  {
8906
9864
  type: "text",
@@ -8920,8 +9878,8 @@ function CreateTemplateModal({
8920
9878
  }) })
8921
9879
  ] })
8922
9880
  ] }),
8923
- /* @__PURE__ */ jsxs13("div", { className: "px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-slate-50/50", children: [
8924
- /* @__PURE__ */ jsx14(
9881
+ /* @__PURE__ */ jsxs15("div", { className: "px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-slate-50/50", children: [
9882
+ /* @__PURE__ */ jsx16(
8925
9883
  "button",
8926
9884
  {
8927
9885
  type: "button",
@@ -8931,19 +9889,19 @@ function CreateTemplateModal({
8931
9889
  children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
8932
9890
  }
8933
9891
  ),
8934
- /* @__PURE__ */ jsx14(
9892
+ /* @__PURE__ */ jsx16(
8935
9893
  "button",
8936
9894
  {
8937
9895
  type: "submit",
8938
9896
  disabled: !canSubmit,
8939
9897
  className: `inline-flex items-center gap-2 px-5 py-2 text-xs font-semibold text-white rounded-xl shadow-xs transition-all cursor-pointer active:scale-[0.98] ${canSubmit ? "bg-emerald-600 hover:bg-emerald-700" : "bg-slate-300 text-slate-500 cursor-not-allowed opacity-60"}`,
8940
9898
  title: !canSubmit ? fileError || validationResult.errors[0] || "\u05D9\u05E9 \u05DC\u05D4\u05E9\u05DC\u05D9\u05DD \u05D0\u05EA \u05DB\u05DC \u05E9\u05D3\u05D5\u05EA \u05D4\u05D7\u05D5\u05D1\u05D4 \u05D1\u05D0\u05D5\u05E4\u05DF \u05EA\u05E7\u05D9\u05DF" : "\u05E9\u05DC\u05D7 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DC\u05D0\u05D9\u05E9\u05D5\u05E8 Meta",
8941
- children: isSubmitting ? /* @__PURE__ */ jsxs13(Fragment3, { children: [
8942
- /* @__PURE__ */ jsx14(Loader24, { className: "w-4 h-4 animate-spin" }),
8943
- /* @__PURE__ */ jsx14("span", { children: submittingStep || "\u05D9\u05D5\u05E6\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA..." })
8944
- ] }) : /* @__PURE__ */ jsxs13(Fragment3, { children: [
8945
- /* @__PURE__ */ jsx14(CheckCircle22, { className: "w-4 h-4" }),
8946
- /* @__PURE__ */ jsx14("span", { children: "\u05E9\u05DC\u05D7 \u05DC\u05D1\u05D3\u05D9\u05E7\u05D4" })
9899
+ children: isSubmitting ? /* @__PURE__ */ jsxs15(Fragment4, { children: [
9900
+ /* @__PURE__ */ jsx16(Loader24, { className: "w-4 h-4 animate-spin" }),
9901
+ /* @__PURE__ */ jsx16("span", { children: submittingStep || "\u05D9\u05D5\u05E6\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA..." })
9902
+ ] }) : /* @__PURE__ */ jsxs15(Fragment4, { children: [
9903
+ /* @__PURE__ */ jsx16(CheckCircle22, { className: "w-4 h-4" }),
9904
+ /* @__PURE__ */ jsx16("span", { children: "\u05E9\u05DC\u05D7 \u05DC\u05D1\u05D3\u05D9\u05E7\u05D4" })
8947
9905
  ] })
8948
9906
  }
8949
9907
  )
@@ -8957,7 +9915,7 @@ function CreateTemplateModal({
8957
9915
  }
8958
9916
 
8959
9917
  // src/components/WhatsAppComponent/hooks/useWhatsAppState.ts
8960
- import { useState as useState15, useEffect as useEffect13, useRef as useRef12, useMemo as useMemo8, useCallback as useCallback12 } from "react";
9918
+ import { useState as useState16, useEffect as useEffect14, useRef as useRef13, useMemo as useMemo9, useCallback as useCallback13 } from "react";
8961
9919
 
8962
9920
  // src/components/WhatsAppComponent/utils/recipientEngine.ts
8963
9921
  var STORAGE_KEY_TEST_PHONE = "whatsapp_test_phone";
@@ -9282,7 +10240,7 @@ function matchesColumnFilter(cellValue, filterVal, colName, relationOptions, col
9282
10240
  }
9283
10241
  return true;
9284
10242
  }
9285
- function filterRecordsByColumnAndSearch(records, columnFilters, searchQuery, tableColumns, relationOptions) {
10243
+ function filterRecordsByColumnAndSearch(records, columnFilters, searchQuery, tableColumns2, relationOptions) {
9286
10244
  let result = records || [];
9287
10245
  if (columnFilters && typeof columnFilters === "object") {
9288
10246
  const activeEntries = Object.entries(columnFilters).filter(([_, val]) => {
@@ -9298,7 +10256,7 @@ function filterRecordsByColumnAndSearch(records, columnFilters, searchQuery, tab
9298
10256
  const rowData = record.data || {};
9299
10257
  for (const [colName, filterVal] of activeEntries) {
9300
10258
  const cellValue = rowData[colName];
9301
- const colDef = tableColumns == null ? void 0 : tableColumns.find((c) => c.name === colName);
10259
+ const colDef = tableColumns2 == null ? void 0 : tableColumns2.find((c) => c.name === colName);
9302
10260
  if (!matchesColumnFilter(cellValue, filterVal, colName, relationOptions, colDef)) {
9303
10261
  return false;
9304
10262
  }
@@ -9359,9 +10317,9 @@ function isTextableColumn(col) {
9359
10317
  }
9360
10318
  function getTextableColumnOptions(params) {
9361
10319
  var _a, _b, _c, _d;
9362
- const { tableColumns = [], selectedPhoneOption, referencedTableSchemas = {} } = params;
10320
+ const { tableColumns: tableColumns2 = [], selectedPhoneOption, referencedTableSchemas = {} } = params;
9363
10321
  const options = [];
9364
- for (const col of tableColumns) {
10322
+ for (const col of tableColumns2) {
9365
10323
  if (col.name === "_id" || col.id === "_id") continue;
9366
10324
  const colType = String(col.type || "").toUpperCase();
9367
10325
  if (colType === "SUB_TABLE" || colType === "SUBTABLE") continue;
@@ -9379,7 +10337,7 @@ function getTextableColumnOptions(params) {
9379
10337
  const parentColName = selectedPhoneOption.parentColumnName || "";
9380
10338
  const refTableId = selectedPhoneOption.referencedTableId;
9381
10339
  const subSchema = refTableId ? referencedTableSchemas[refTableId] : null;
9382
- const parentCol = tableColumns.find((c) => c.name === parentColName);
10340
+ const parentCol = tableColumns2.find((c) => c.name === parentColName);
9383
10341
  const subtableName = ((_a = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _a.referencedTableName) || (subSchema == null ? void 0 : subSchema.title) || (parentCol == null ? void 0 : parentCol.name) || parentColName || "\u05D8\u05D1\u05DC\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8\u05EA";
9384
10342
  const embeddedCols = ((_b = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _b.columns) || ((_d = (_c = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _c.schema) == null ? void 0 : _d.columns);
9385
10343
  const cols = (subSchema == null ? void 0 : subSchema.columns) || embeddedCols || [];
@@ -9637,7 +10595,7 @@ function buildTemplateComponents(params) {
9637
10595
  variableMapping,
9638
10596
  textableColumnOptions,
9639
10597
  recordData,
9640
- tableColumns,
10598
+ tableColumns: tableColumns2,
9641
10599
  relationOptions,
9642
10600
  templateHeaderComp,
9643
10601
  mediaUrl
@@ -9714,7 +10672,7 @@ function buildTemplateComponents(params) {
9714
10672
  mapping.value,
9715
10673
  textableColumnOptions,
9716
10674
  recordData,
9717
- tableColumns,
10675
+ tableColumns2,
9718
10676
  relationOptions,
9719
10677
  templateLanguage
9720
10678
  );
@@ -9734,7 +10692,7 @@ function buildTemplateComponents(params) {
9734
10692
  variableMapping,
9735
10693
  textableColumnOptions,
9736
10694
  recordData,
9737
- tableColumns,
10695
+ tableColumns: tableColumns2,
9738
10696
  relationOptions
9739
10697
  });
9740
10698
  if (bodyParameters.length > 0) {
@@ -9752,7 +10710,7 @@ function buildBodyParameters(params) {
9752
10710
  variableMapping,
9753
10711
  textableColumnOptions,
9754
10712
  recordData,
9755
- tableColumns,
10713
+ tableColumns: tableColumns2,
9756
10714
  relationOptions
9757
10715
  } = params;
9758
10716
  const bodyComp = (_a = selectedTemplate.components) == null ? void 0 : _a.find(
@@ -9785,7 +10743,7 @@ function buildBodyParameters(params) {
9785
10743
  mapping.value,
9786
10744
  textableColumnOptions,
9787
10745
  recordData,
9788
- tableColumns,
10746
+ tableColumns2,
9789
10747
  relationOptions,
9790
10748
  templateLanguage
9791
10749
  );
@@ -9795,7 +10753,7 @@ function buildBodyParameters(params) {
9795
10753
  };
9796
10754
  });
9797
10755
  }
9798
- function resolveColumnValue(columnOptionId, textableColumnOptions, recordData, tableColumns, relationOptions, templateLanguage) {
10756
+ function resolveColumnValue(columnOptionId, textableColumnOptions, recordData, tableColumns2, relationOptions, templateLanguage) {
9799
10757
  const colOption = textableColumnOptions.find((opt) => opt.id === columnOptionId);
9800
10758
  if (!colOption) {
9801
10759
  const rawValue2 = recordData[columnOptionId];
@@ -9803,7 +10761,7 @@ function resolveColumnValue(columnOptionId, textableColumnOptions, recordData, t
9803
10761
  }
9804
10762
  const colName = colOption.columnName;
9805
10763
  const rawValue = recordData[colName];
9806
- const colDef = findColumnDef(colOption, tableColumns);
10764
+ const colDef = findColumnDef(colOption, tableColumns2);
9807
10765
  const colType = colOption.type || (colDef == null ? void 0 : colDef.type) || "STRING";
9808
10766
  const formatOptions = {
9809
10767
  columnDef: colDef,
@@ -9811,13 +10769,13 @@ function resolveColumnValue(columnOptionId, textableColumnOptions, recordData, t
9811
10769
  };
9812
10770
  return formatVariableValue(rawValue, colType, templateLanguage, formatOptions);
9813
10771
  }
9814
- function findColumnDef(colOption, tableColumns) {
10772
+ function findColumnDef(colOption, tableColumns2) {
9815
10773
  var _a, _b, _c;
9816
10774
  if (colOption.source === "MAIN") {
9817
- return tableColumns.find((c) => c.name === colOption.columnName) || null;
10775
+ return tableColumns2.find((c) => c.name === colOption.columnName) || null;
9818
10776
  }
9819
10777
  if (colOption.source === "SUBTABLE" && colOption.parentColumnName) {
9820
- const parentCol = tableColumns.find((c) => c.name === colOption.parentColumnName);
10778
+ const parentCol = tableColumns2.find((c) => c.name === colOption.parentColumnName);
9821
10779
  if (parentCol) {
9822
10780
  const embeddedCols = ((_a = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _a.columns) || ((_c = (_b = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _b.schema) == null ? void 0 : _c.columns) || [];
9823
10781
  return embeddedCols.find((c) => c.name === colOption.columnName) || null;
@@ -9981,7 +10939,7 @@ async function sendTestMessage(params) {
9981
10939
  variableMapping,
9982
10940
  textableColumnOptions,
9983
10941
  recordData,
9984
- tableColumns,
10942
+ tableColumns: tableColumns2,
9985
10943
  relationOptions,
9986
10944
  templateHeaderComp,
9987
10945
  mediaUrl,
@@ -9994,7 +10952,7 @@ async function sendTestMessage(params) {
9994
10952
  variableMapping,
9995
10953
  textableColumnOptions,
9996
10954
  recordData,
9997
- tableColumns,
10955
+ tableColumns: tableColumns2,
9998
10956
  relationOptions,
9999
10957
  templateHeaderComp,
10000
10958
  mediaUrl
@@ -10015,7 +10973,7 @@ async function sendBulkWhatsAppMessages(params) {
10015
10973
  selectedTemplate,
10016
10974
  variableMapping,
10017
10975
  textableColumnOptions,
10018
- tableColumns,
10976
+ tableColumns: tableColumns2,
10019
10977
  relationOptions,
10020
10978
  templateHeaderComp,
10021
10979
  mediaUrl,
@@ -10055,7 +11013,7 @@ async function sendBulkWhatsAppMessages(params) {
10055
11013
  variableMapping,
10056
11014
  textableColumnOptions,
10057
11015
  recordData: recipient.recordData,
10058
- tableColumns,
11016
+ tableColumns: tableColumns2,
10059
11017
  relationOptions,
10060
11018
  templateHeaderComp: templateHeaderComp || null,
10061
11019
  mediaUrl
@@ -10262,29 +11220,29 @@ function useWhatsAppState(props) {
10262
11220
  data: injectedData
10263
11221
  } = props;
10264
11222
  const orgId = props.orgId || props.organizationId || (settings == null ? void 0 : settings.orgId) || (settings == null ? void 0 : settings.organizationId) || (injectedData == null ? void 0 : injectedData.orgId) || (injectedData == null ? void 0 : injectedData.organizationId);
10265
- const [tableColumns, setTableColumns] = useState15(() => {
11223
+ const [tableColumns2, setTableColumns] = useState16(() => {
10266
11224
  return Array.isArray(settings == null ? void 0 : settings.columns) ? settings.columns : [];
10267
11225
  });
10268
- const [rawRecords, setRawRecords] = useState15(() => {
11226
+ const [rawRecords, setRawRecords] = useState16(() => {
10269
11227
  if (Array.isArray(injectedData)) return injectedData;
10270
11228
  if (Array.isArray(injectedData == null ? void 0 : injectedData.records)) return injectedData.records;
10271
11229
  return [];
10272
11230
  });
10273
- const [relationOptions, setRelationOptions] = useState15(() => {
11231
+ const [relationOptions, setRelationOptions] = useState16(() => {
10274
11232
  return (injectedData == null ? void 0 : injectedData.relationOptions) || {};
10275
11233
  });
10276
- const [isLoadingTableData, setIsLoadingTableData] = useState15(() => Boolean(settings == null ? void 0 : settings.tableMetaId));
10277
- const [activeSubtableScans, setActiveSubtableScans] = useState15(0);
10278
- const [tableError, setTableError] = useState15(null);
10279
- const [filters, setFilters] = useState15({});
10280
- const [selectedRowIds, setSelectedRowIds] = useState15([]);
10281
- const [autoSelectCount, setAutoSelectCount] = useState15(null);
10282
- const isAutoSelectingRef = useRef12(false);
10283
- const isManualOverrideRef = useRef12(false);
10284
- const prevAutoSelectCountRef = useRef12(null);
10285
- const fetchedTableIdsRef = useRef12(/* @__PURE__ */ new Set());
10286
- const fullyFetchedRelationKeysRef = useRef12(/* @__PURE__ */ new Set());
10287
- const loadTableData = useCallback12(async () => {
11234
+ const [isLoadingTableData, setIsLoadingTableData] = useState16(() => Boolean(settings == null ? void 0 : settings.tableMetaId));
11235
+ const [activeSubtableScans, setActiveSubtableScans] = useState16(0);
11236
+ const [tableError, setTableError] = useState16(null);
11237
+ const [filters, setFilters] = useState16({});
11238
+ const [selectedRowIds, setSelectedRowIds] = useState16([]);
11239
+ const [autoSelectCount, setAutoSelectCount] = useState16(null);
11240
+ const isAutoSelectingRef = useRef13(false);
11241
+ const isManualOverrideRef = useRef13(false);
11242
+ const prevAutoSelectCountRef = useRef13(null);
11243
+ const fetchedTableIdsRef = useRef13(/* @__PURE__ */ new Set());
11244
+ const fullyFetchedRelationKeysRef = useRef13(/* @__PURE__ */ new Set());
11245
+ const loadTableData = useCallback13(async () => {
10288
11246
  var _a2;
10289
11247
  const tableId = (settings == null ? void 0 : settings.tableMetaId) || (injectedData == null ? void 0 : injectedData.tableMetaId) || (injectedData == null ? void 0 : injectedData.tableId);
10290
11248
  if (!tableId || !executeAction) return;
@@ -10351,26 +11309,26 @@ function useWhatsAppState(props) {
10351
11309
  executeAction,
10352
11310
  orgId
10353
11311
  ]);
10354
- useEffect13(() => {
11312
+ useEffect14(() => {
10355
11313
  loadTableData();
10356
11314
  }, [loadTableData]);
10357
- const filterableColumns = useMemo8(() => {
10358
- return (tableColumns || []).filter((col) => {
11315
+ const filterableColumns = useMemo9(() => {
11316
+ return (tableColumns2 || []).filter((col) => {
10359
11317
  var _a2;
10360
11318
  if (!col || col.name === "_id" || col.id === "_id") return false;
10361
11319
  const type = (_a2 = col.type) == null ? void 0 : _a2.toUpperCase();
10362
11320
  return type === "RELATION" || type === "BOOLEAN";
10363
11321
  });
10364
- }, [tableColumns]);
10365
- const [referencedTableSchemas, setReferencedTableSchemas] = useState15({});
10366
- const subtableCols = useMemo8(() => {
10367
- return (tableColumns || []).filter((col) => {
11322
+ }, [tableColumns2]);
11323
+ const [referencedTableSchemas, setReferencedTableSchemas] = useState16({});
11324
+ const subtableCols = useMemo9(() => {
11325
+ return (tableColumns2 || []).filter((col) => {
10368
11326
  var _a2;
10369
11327
  const type = (_a2 = col.type) == null ? void 0 : _a2.toUpperCase();
10370
11328
  return type === "RELATION" || type === "SUB_TABLE" || type === "SUBTABLE";
10371
11329
  });
10372
- }, [tableColumns]);
10373
- useEffect13(() => {
11330
+ }, [tableColumns2]);
11331
+ useEffect14(() => {
10374
11332
  if (!executeAction) return;
10375
11333
  const unrequestedCols = subtableCols.filter((col) => {
10376
11334
  var _a2;
@@ -10414,22 +11372,22 @@ function useWhatsAppState(props) {
10414
11372
  });
10415
11373
  }, [subtableCols, executeAction, orgId]);
10416
11374
  const isScanningPhoneColumns = Boolean(
10417
- isLoadingTableData || activeSubtableScans > 0 || tableColumns.length === 0 && Boolean(settings == null ? void 0 : settings.tableMetaId)
11375
+ isLoadingTableData || activeSubtableScans > 0 || tableColumns2.length === 0 && Boolean(settings == null ? void 0 : settings.tableMetaId)
10418
11376
  );
10419
- const targetPhoneOptions = useMemo8(() => {
10420
- const cols = tableColumns && tableColumns.length > 0 ? tableColumns : Array.isArray(settings == null ? void 0 : settings.columns) ? settings.columns : [];
11377
+ const targetPhoneOptions = useMemo9(() => {
11378
+ const cols = tableColumns2 && tableColumns2.length > 0 ? tableColumns2 : Array.isArray(settings == null ? void 0 : settings.columns) ? settings.columns : [];
10421
11379
  return scanTargetPhoneOptions(cols, referencedTableSchemas);
10422
- }, [tableColumns, settings == null ? void 0 : settings.columns, referencedTableSchemas]);
10423
- const phoneColumns = useMemo8(() => {
11380
+ }, [tableColumns2, settings == null ? void 0 : settings.columns, referencedTableSchemas]);
11381
+ const phoneColumns = useMemo9(() => {
10424
11382
  return targetPhoneOptions.map((opt) => ({ name: opt.label, id: opt.id, type: "PHONE" }));
10425
11383
  }, [targetPhoneOptions]);
10426
- const [phoneColumnId, setPhoneColumnId] = useState15("");
10427
- const [subtableFilterColumn, setSubtableFilterColumn] = useState15("");
10428
- const [subtableFilterValue, setSubtableFilterValue] = useState15("");
10429
- const [subtableSendLimit, setSubtableSendLimit] = useState15(
11384
+ const [phoneColumnId, setPhoneColumnId] = useState16("");
11385
+ const [subtableFilterColumn, setSubtableFilterColumn] = useState16("");
11386
+ const [subtableFilterValue, setSubtableFilterValue] = useState16("");
11387
+ const [subtableSendLimit, setSubtableSendLimit] = useState16(
10430
11388
  (settings == null ? void 0 : settings.subtableSendLimit) || "PRIMARY"
10431
11389
  );
10432
- useEffect13(() => {
11390
+ useEffect14(() => {
10433
11391
  if (targetPhoneOptions.length > 0) {
10434
11392
  const isValid = targetPhoneOptions.some(
10435
11393
  (opt) => opt.id === phoneColumnId || opt.columnName === phoneColumnId
@@ -10441,20 +11399,20 @@ function useWhatsAppState(props) {
10441
11399
  setPhoneColumnId("");
10442
11400
  }
10443
11401
  }, [targetPhoneOptions, phoneColumnId]);
10444
- const selectedPhoneOption = useMemo8(() => {
11402
+ const selectedPhoneOption = useMemo9(() => {
10445
11403
  if (!phoneColumnId) return targetPhoneOptions[0] || null;
10446
11404
  return targetPhoneOptions.find(
10447
11405
  (opt) => opt.id === phoneColumnId || opt.columnName === phoneColumnId
10448
11406
  ) || targetPhoneOptions[0] || null;
10449
11407
  }, [targetPhoneOptions, phoneColumnId]);
10450
- const subtableFilterableColumns = useMemo8(() => {
11408
+ const subtableFilterableColumns = useMemo9(() => {
10451
11409
  var _a2, _b2, _c;
10452
11410
  if (!selectedPhoneOption || selectedPhoneOption.type !== "SUBTABLE") {
10453
11411
  return [];
10454
11412
  }
10455
11413
  const refTableId = selectedPhoneOption.referencedTableId;
10456
11414
  const subSchema = refTableId ? referencedTableSchemas[refTableId] : null;
10457
- const parentCol = (tableColumns || []).find(
11415
+ const parentCol = (tableColumns2 || []).find(
10458
11416
  (c) => c.name === selectedPhoneOption.parentColumnName
10459
11417
  );
10460
11418
  const embeddedCols = ((_a2 = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _a2.columns) || ((_c = (_b2 = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _b2.schema) == null ? void 0 : _c.columns);
@@ -10465,18 +11423,18 @@ function useWhatsAppState(props) {
10465
11423
  const type = (_a3 = c.type) == null ? void 0 : _a3.toUpperCase();
10466
11424
  return type === "BOOLEAN" || type === "RELATION";
10467
11425
  });
10468
- }, [selectedPhoneOption, referencedTableSchemas, tableColumns]);
10469
- const selectedSubtableFilterCol = useMemo8(() => {
11426
+ }, [selectedPhoneOption, referencedTableSchemas, tableColumns2]);
11427
+ const selectedSubtableFilterCol = useMemo9(() => {
10470
11428
  return subtableFilterableColumns.find((c) => c.name === subtableFilterColumn);
10471
11429
  }, [subtableFilterableColumns, subtableFilterColumn]);
10472
- const [enablePostSendAction, setEnablePostSendAction] = useState15(false);
10473
- const [postSendActionColumn, setPostSendActionColumn] = useState15("");
10474
- const [postSendActionValue, setPostSendActionValue] = useState15("");
10475
- const [postSendActionTargetType, setPostSendActionTargetType] = useState15("MAIN");
10476
- const postSendActionTargetOptions = useMemo8(() => {
11430
+ const [enablePostSendAction, setEnablePostSendAction] = useState16(false);
11431
+ const [postSendActionColumn, setPostSendActionColumn] = useState16("");
11432
+ const [postSendActionValue, setPostSendActionValue] = useState16("");
11433
+ const [postSendActionTargetType, setPostSendActionTargetType] = useState16("MAIN");
11434
+ const postSendActionTargetOptions = useMemo9(() => {
10477
11435
  var _a2, _b2, _c;
10478
11436
  const options = [];
10479
- (tableColumns || []).forEach((col) => {
11437
+ (tableColumns2 || []).forEach((col) => {
10480
11438
  var _a3;
10481
11439
  if (!col || col.name === "_id" || col.id === "_id") return;
10482
11440
  const type = (_a3 = col.type) == null ? void 0 : _a3.toUpperCase();
@@ -10495,7 +11453,7 @@ function useWhatsAppState(props) {
10495
11453
  const parentColName = selectedPhoneOption.parentColumnName || "";
10496
11454
  const refTableId = selectedPhoneOption.referencedTableId;
10497
11455
  const subSchema = refTableId ? referencedTableSchemas[refTableId] : null;
10498
- const parentCol = (tableColumns || []).find((c) => c.name === parentColName);
11456
+ const parentCol = (tableColumns2 || []).find((c) => c.name === parentColName);
10499
11457
  const embeddedCols = ((_a2 = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _a2.columns) || ((_c = (_b2 = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _b2.schema) == null ? void 0 : _c.columns);
10500
11458
  const cols = (subSchema == null ? void 0 : subSchema.columns) || embeddedCols || [];
10501
11459
  cols.forEach((subCol) => {
@@ -10517,15 +11475,15 @@ function useWhatsAppState(props) {
10517
11475
  });
10518
11476
  }
10519
11477
  return options;
10520
- }, [tableColumns, selectedPhoneOption, referencedTableSchemas]);
10521
- const selectedPostSendOption = useMemo8(() => {
11478
+ }, [tableColumns2, selectedPhoneOption, referencedTableSchemas]);
11479
+ const selectedPostSendOption = useMemo9(() => {
10522
11480
  return postSendActionTargetOptions.find(
10523
11481
  (opt) => opt.id === postSendActionColumn || opt.columnName === postSendActionColumn
10524
11482
  );
10525
11483
  }, [postSendActionTargetOptions, postSendActionColumn]);
10526
11484
  const selectedPostSendCol = selectedPostSendOption;
10527
- const [isTestPromptOpen, setIsTestPromptOpen] = useState15(false);
10528
- const [testPhoneNumber, setTestPhoneNumber] = useState15(() => {
11485
+ const [isTestPromptOpen, setIsTestPromptOpen] = useState16(false);
11486
+ const [testPhoneNumber, setTestPhoneNumber] = useState16(() => {
10529
11487
  if (typeof window !== "undefined") {
10530
11488
  try {
10531
11489
  return localStorage.getItem(STORAGE_KEY_TEST_PHONE) || "";
@@ -10535,10 +11493,10 @@ function useWhatsAppState(props) {
10535
11493
  }
10536
11494
  return "";
10537
11495
  });
10538
- const [testFeedback, setTestFeedback] = useState15(null);
10539
- const [isSendingTest, setIsSendingTest] = useState15(false);
10540
- const [isSendingBroadcast, setIsSendingBroadcast] = useState15(false);
10541
- const [broadcastProgress, setBroadcastProgress] = useState15({
11496
+ const [testFeedback, setTestFeedback] = useState16(null);
11497
+ const [isSendingTest, setIsSendingTest] = useState16(false);
11498
+ const [isSendingBroadcast, setIsSendingBroadcast] = useState16(false);
11499
+ const [broadcastProgress, setBroadcastProgress] = useState16({
10542
11500
  current: 0,
10543
11501
  total: 0,
10544
11502
  successful: 0,
@@ -10546,12 +11504,12 @@ function useWhatsAppState(props) {
10546
11504
  skipped: 0,
10547
11505
  percent: 0
10548
11506
  });
10549
- const [broadcastSummary, setBroadcastSummary] = useState15(null);
10550
- const [rowStatusMap, setRowStatusMap] = useState15({});
10551
- const clearBroadcastSummary = useCallback12(() => {
11507
+ const [broadcastSummary, setBroadcastSummary] = useState16(null);
11508
+ const [rowStatusMap, setRowStatusMap] = useState16({});
11509
+ const clearBroadcastSummary = useCallback13(() => {
10552
11510
  setBroadcastSummary(null);
10553
11511
  }, []);
10554
- const handleTestPhoneChange = useCallback12((val) => {
11512
+ const handleTestPhoneChange = useCallback13((val) => {
10555
11513
  setTestPhoneNumber(val);
10556
11514
  if (typeof window !== "undefined") {
10557
11515
  try {
@@ -10561,7 +11519,7 @@ function useWhatsAppState(props) {
10561
11519
  }
10562
11520
  }
10563
11521
  }, []);
10564
- const getRelationOptionsForCol = useCallback12(
11522
+ const getRelationOptionsForCol = useCallback13(
10565
11523
  (colName, parentColName) => {
10566
11524
  var _a2, _b2, _c, _d;
10567
11525
  if (parentColName) {
@@ -10590,7 +11548,7 @@ function useWhatsAppState(props) {
10590
11548
  return relationOptions[postSendRefId];
10591
11549
  }
10592
11550
  }
10593
- const mainCol = (tableColumns || []).find((c) => c.name === colName);
11551
+ const mainCol = (tableColumns2 || []).find((c) => c.name === colName);
10594
11552
  const mainRefId = ((_c = mainCol == null ? void 0 : mainCol.config) == null ? void 0 : _c.referencedTableId) || (mainCol == null ? void 0 : mainCol.referencedTableId);
10595
11553
  if (mainRefId && relationOptions[mainRefId] && relationOptions[mainRefId].length > 0) {
10596
11554
  return relationOptions[mainRefId];
@@ -10602,13 +11560,13 @@ function useWhatsAppState(props) {
10602
11560
  }
10603
11561
  return [];
10604
11562
  },
10605
- [relationOptions, subtableFilterableColumns, postSendActionTargetOptions, tableColumns, filterableColumns]
11563
+ [relationOptions, subtableFilterableColumns, postSendActionTargetOptions, tableColumns2, filterableColumns]
10606
11564
  );
10607
- useEffect13(() => {
11565
+ useEffect14(() => {
10608
11566
  var _a2, _b2, _c, _d, _e;
10609
11567
  if (!executeAction) return;
10610
11568
  const targets = [];
10611
- (tableColumns || []).forEach((col) => {
11569
+ (tableColumns2 || []).forEach((col) => {
10612
11570
  var _a3, _b3, _c2;
10613
11571
  if (((_a3 = col.type) == null ? void 0 : _a3.toUpperCase()) === "RELATION") {
10614
11572
  const refId = ((_b3 = col.config) == null ? void 0 : _b3.referencedTableId) || col.referencedTableId;
@@ -10633,7 +11591,7 @@ function useWhatsAppState(props) {
10633
11591
  const parentColName = selectedPhoneOption.parentColumnName || "";
10634
11592
  const refTableId = selectedPhoneOption.referencedTableId;
10635
11593
  const subSchema = refTableId ? referencedTableSchemas[refTableId] : null;
10636
- const parentCol = (tableColumns || []).find((c) => c.name === parentColName);
11594
+ const parentCol = (tableColumns2 || []).find((c) => c.name === parentColName);
10637
11595
  const embeddedCols = ((_a2 = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _a2.columns) || ((_c = (_b2 = parentCol == null ? void 0 : parentCol.config) == null ? void 0 : _b2.schema) == null ? void 0 : _c.columns);
10638
11596
  const cols = (subSchema == null ? void 0 : subSchema.columns) || embeddedCols || [];
10639
11597
  cols.forEach((subCol) => {
@@ -10697,8 +11655,8 @@ function useWhatsAppState(props) {
10697
11655
  console.warn(`[useWhatsAppState] Failed to fetch relation options for ${target.key}:`, err);
10698
11656
  }
10699
11657
  });
10700
- }, [filterableColumns, selectedPhoneOption, referencedTableSchemas, tableColumns, executeAction, selectedPostSendOption, orgId]);
10701
- useEffect13(() => {
11658
+ }, [filterableColumns, selectedPhoneOption, referencedTableSchemas, tableColumns2, executeAction, selectedPostSendOption, orgId]);
11659
+ useEffect14(() => {
10702
11660
  var _a2, _b2, _c;
10703
11661
  if (!executeAction || !selectedSubtableFilterCol) return;
10704
11662
  if (((_a2 = selectedSubtableFilterCol.type) == null ? void 0 : _a2.toUpperCase()) !== "RELATION") return;
@@ -10749,7 +11707,7 @@ function useWhatsAppState(props) {
10749
11707
  }
10750
11708
  })();
10751
11709
  }, [selectedSubtableFilterCol, selectedPhoneOption, executeAction, orgId]);
10752
- useEffect13(() => {
11710
+ useEffect14(() => {
10753
11711
  var _a2, _b2;
10754
11712
  if (!executeAction || !selectedPostSendOption) return;
10755
11713
  if (selectedPostSendOption.type !== "RELATION") return;
@@ -10802,7 +11760,7 @@ function useWhatsAppState(props) {
10802
11760
  }
10803
11761
  })();
10804
11762
  }, [selectedPostSendOption, executeAction, orgId]);
10805
- const filteredRecords = useMemo8(() => {
11763
+ const filteredRecords = useMemo9(() => {
10806
11764
  const activeEntries = Object.entries(filters).filter(
10807
11765
  ([_, val]) => val !== void 0 && val !== null && val !== ""
10808
11766
  );
@@ -10834,7 +11792,7 @@ function useWhatsAppState(props) {
10834
11792
  });
10835
11793
  }, [rawRecords, filters, filterableColumns]);
10836
11794
  const filteredData = filteredRecords;
10837
- useEffect13(() => {
11795
+ useEffect14(() => {
10838
11796
  if (autoSelectCount !== null && autoSelectCount > 0) {
10839
11797
  isAutoSelectingRef.current = true;
10840
11798
  const sliced = filteredData.slice(0, autoSelectCount);
@@ -10852,7 +11810,7 @@ function useWhatsAppState(props) {
10852
11810
  isManualOverrideRef.current = false;
10853
11811
  prevAutoSelectCountRef.current = autoSelectCount;
10854
11812
  }, [autoSelectCount, filteredData]);
10855
- const embeddedTableExecuteAction = useCallback12(async (actionType, payload) => {
11813
+ const embeddedTableExecuteAction = useCallback13(async (actionType, payload) => {
10856
11814
  if (actionType === "FETCH_TABLE_DATA") {
10857
11815
  const colFilters = (payload == null ? void 0 : payload.columnFilters) || (payload == null ? void 0 : payload.filters);
10858
11816
  const searchQuery = payload == null ? void 0 : payload.search;
@@ -10860,11 +11818,11 @@ function useWhatsAppState(props) {
10860
11818
  filteredRecords,
10861
11819
  colFilters,
10862
11820
  searchQuery,
10863
- tableColumns,
11821
+ tableColumns2,
10864
11822
  relationOptions
10865
11823
  );
10866
11824
  return {
10867
- schema: { columns: tableColumns },
11825
+ schema: { columns: tableColumns2 },
10868
11826
  records: recordsToReturn,
10869
11827
  meta: {
10870
11828
  totalRecords: recordsToReturn.length,
@@ -10886,7 +11844,7 @@ function useWhatsAppState(props) {
10886
11844
  return executeAction(actionType, payload);
10887
11845
  }
10888
11846
  return null;
10889
- }, [tableColumns, filteredRecords, relationOptions, executeAction]);
11847
+ }, [tableColumns2, filteredRecords, relationOptions, executeAction]);
10890
11848
  const handleFilterChange = (colName, val) => {
10891
11849
  setFilters((prev) => __spreadProps(__spreadValues({}, prev), {
10892
11850
  [colName]: val
@@ -10895,10 +11853,10 @@ function useWhatsAppState(props) {
10895
11853
  const handleClearFilters = () => {
10896
11854
  setFilters({});
10897
11855
  };
10898
- const activeFiltersCount = useMemo8(() => {
11856
+ const activeFiltersCount = useMemo9(() => {
10899
11857
  return Object.values(filters).filter((v) => v !== "").length;
10900
11858
  }, [filters]);
10901
- const handleSelectionChange = useCallback12((selectedIds) => {
11859
+ const handleSelectionChange = useCallback13((selectedIds) => {
10902
11860
  setSelectedRowIds((prev) => {
10903
11861
  if (prev.length === selectedIds.length && prev.every((id, idx) => id === selectedIds[idx])) {
10904
11862
  return prev;
@@ -10912,13 +11870,13 @@ function useWhatsAppState(props) {
10912
11870
  return selectedIds;
10913
11871
  });
10914
11872
  }, [autoSelectCount]);
10915
- const handleRowToggle = useCallback12((rowId, checked) => {
11873
+ const handleRowToggle = useCallback13((rowId, checked) => {
10916
11874
  if (autoSelectCount !== null && autoSelectCount > 0) {
10917
11875
  isManualOverrideRef.current = true;
10918
11876
  setAutoSelectCount(null);
10919
11877
  }
10920
11878
  }, [autoSelectCount]);
10921
- const toggleRowSelection = useCallback12((rowId, checked) => {
11879
+ const toggleRowSelection = useCallback13((rowId, checked) => {
10922
11880
  if (autoSelectCount !== null && autoSelectCount > 0) {
10923
11881
  isManualOverrideRef.current = true;
10924
11882
  setAutoSelectCount(null);
@@ -10934,15 +11892,15 @@ function useWhatsAppState(props) {
10934
11892
  return prev;
10935
11893
  });
10936
11894
  }, [autoSelectCount]);
10937
- const [templates, setTemplates] = useState15([]);
10938
- const [selectedTemplateId, setSelectedTemplateId] = useState15(null);
10939
- const [isLoading, setIsLoading] = useState15(true);
10940
- const [fetchError, setFetchError] = useState15(null);
10941
- const [isModalOpen, setIsModalOpen] = useState15(false);
10942
- const [isDropdownOpen, setIsDropdownOpen] = useState15(false);
10943
- const [isDeleting, setIsDeleting] = useState15(false);
10944
- const [feedback, setFeedback] = useState15(null);
10945
- const loadTemplates = useCallback12(async () => {
11895
+ const [templates, setTemplates] = useState16([]);
11896
+ const [selectedTemplateId, setSelectedTemplateId] = useState16(null);
11897
+ const [isLoading, setIsLoading] = useState16(true);
11898
+ const [fetchError, setFetchError] = useState16(null);
11899
+ const [isModalOpen, setIsModalOpen] = useState16(false);
11900
+ const [isDropdownOpen, setIsDropdownOpen] = useState16(false);
11901
+ const [isDeleting, setIsDeleting] = useState16(false);
11902
+ const [feedback, setFeedback] = useState16(null);
11903
+ const loadTemplates = useCallback13(async () => {
10946
11904
  var _a2, _b2;
10947
11905
  if (!executeAction) {
10948
11906
  setIsLoading(false);
@@ -10994,13 +11952,13 @@ function useWhatsAppState(props) {
10994
11952
  setIsLoading(false);
10995
11953
  }
10996
11954
  }, [executeAction, orgId]);
10997
- useEffect13(() => {
11955
+ useEffect14(() => {
10998
11956
  loadTemplates();
10999
11957
  }, [loadTemplates]);
11000
- const selectedTemplate = useMemo8(() => {
11958
+ const selectedTemplate = useMemo9(() => {
11001
11959
  return templates.find((t) => t.id === selectedTemplateId) || null;
11002
11960
  }, [templates, selectedTemplateId]);
11003
- const templateBodyText = useMemo8(() => {
11961
+ const templateBodyText = useMemo9(() => {
11004
11962
  if (!(selectedTemplate == null ? void 0 : selectedTemplate.components)) return "";
11005
11963
  const bodyComp = selectedTemplate.components.find(
11006
11964
  (c) => {
@@ -11010,7 +11968,7 @@ function useWhatsAppState(props) {
11010
11968
  );
11011
11969
  return (bodyComp == null ? void 0 : bodyComp.text) || "";
11012
11970
  }, [selectedTemplate]);
11013
- const templateHeaderComp = useMemo8(() => {
11971
+ const templateHeaderComp = useMemo9(() => {
11014
11972
  if (!(selectedTemplate == null ? void 0 : selectedTemplate.components)) return null;
11015
11973
  return selectedTemplate.components.find(
11016
11974
  (c) => {
@@ -11019,8 +11977,8 @@ function useWhatsAppState(props) {
11019
11977
  }
11020
11978
  ) || null;
11021
11979
  }, [selectedTemplate]);
11022
- const [headerMediaUrl, setHeaderMediaUrl] = useState15("");
11023
- useEffect13(() => {
11980
+ const [headerMediaUrl, setHeaderMediaUrl] = useState16("");
11981
+ useEffect14(() => {
11024
11982
  if (!templateHeaderComp) {
11025
11983
  setHeaderMediaUrl("");
11026
11984
  return;
@@ -11037,7 +11995,7 @@ function useWhatsAppState(props) {
11037
11995
  setHeaderMediaUrl("");
11038
11996
  }
11039
11997
  }, [templateHeaderComp, selectedTemplate == null ? void 0 : selectedTemplate.name]);
11040
- const handleHeaderMediaUrlChange = useCallback12(
11998
+ const handleHeaderMediaUrlChange = useCallback13(
11041
11999
  (newUrl) => {
11042
12000
  setHeaderMediaUrl(newUrl);
11043
12001
  if ((selectedTemplate == null ? void 0 : selectedTemplate.name) && typeof window !== "undefined") {
@@ -11056,7 +12014,7 @@ function useWhatsAppState(props) {
11056
12014
  },
11057
12015
  [selectedTemplate == null ? void 0 : selectedTemplate.name]
11058
12016
  );
11059
- const handleResetHeaderMediaUrl = useCallback12(() => {
12017
+ const handleResetHeaderMediaUrl = useCallback13(() => {
11060
12018
  if ((selectedTemplate == null ? void 0 : selectedTemplate.name) && typeof window !== "undefined") {
11061
12019
  try {
11062
12020
  localStorage.removeItem(`whatsapp_template_media_${selectedTemplate.name}`);
@@ -11070,8 +12028,8 @@ function useWhatsAppState(props) {
11070
12028
  );
11071
12029
  setHeaderMediaUrl(defaultUrl || "");
11072
12030
  }, [templateHeaderComp, selectedTemplate == null ? void 0 : selectedTemplate.name]);
11073
- const [isUploadingMedia, setIsUploadingMedia] = useState15(false);
11074
- const handleFileUpload = useCallback12(
12031
+ const [isUploadingMedia, setIsUploadingMedia] = useState16(false);
12032
+ const handleFileUpload = useCallback13(
11075
12033
  async (file, templateName) => {
11076
12034
  const tplName = templateName || (selectedTemplate == null ? void 0 : selectedTemplate.name) || "";
11077
12035
  if (!file) return;
@@ -11112,20 +12070,20 @@ function useWhatsAppState(props) {
11112
12070
  },
11113
12071
  [selectedTemplate == null ? void 0 : selectedTemplate.name]
11114
12072
  );
11115
- const templateVariables = useMemo8(() => {
12073
+ const templateVariables = useMemo9(() => {
11116
12074
  return extractTemplateVariables(selectedTemplate);
11117
12075
  }, [selectedTemplate]);
11118
- const [variableMapping, setVariableMapping] = useState15({});
11119
- useEffect13(() => {
12076
+ const [variableMapping, setVariableMapping] = useState16({});
12077
+ useEffect14(() => {
11120
12078
  setVariableMapping({});
11121
12079
  }, [selectedTemplateId]);
11122
- const textableColumnOptions = useMemo8(() => {
12080
+ const textableColumnOptions = useMemo9(() => {
11123
12081
  return getTextableColumnOptions({
11124
- tableColumns,
12082
+ tableColumns: tableColumns2,
11125
12083
  selectedPhoneOption,
11126
12084
  referencedTableSchemas
11127
12085
  });
11128
- }, [tableColumns, selectedPhoneOption, referencedTableSchemas]);
12086
+ }, [tableColumns2, selectedPhoneOption, referencedTableSchemas]);
11129
12087
  const handleVariableTypeChange = (varKey, newType) => {
11130
12088
  setVariableMapping((prev) => __spreadProps(__spreadValues({}, prev), {
11131
12089
  [varKey]: {
@@ -11145,7 +12103,7 @@ function useWhatsAppState(props) {
11145
12103
  });
11146
12104
  });
11147
12105
  };
11148
- const existingTemplateNames = useMemo8(() => {
12106
+ const existingTemplateNames = useMemo9(() => {
11149
12107
  return templates.map((t) => t.name);
11150
12108
  }, [templates]);
11151
12109
  const handleDeleteTemplate = async () => {
@@ -11192,14 +12150,14 @@ function useWhatsAppState(props) {
11192
12150
  postSendActionColumn,
11193
12151
  postSendActionValue
11194
12152
  );
11195
- const isStaticVariableMissing = useMemo8(() => {
12153
+ const isStaticVariableMissing = useMemo9(() => {
11196
12154
  return isStaticVariableIncomplete(templateVariables, variableMapping);
11197
12155
  }, [templateVariables, variableMapping]);
11198
- const currentRecords = useMemo8(() => {
12156
+ const currentRecords = useMemo9(() => {
11199
12157
  var _a2;
11200
12158
  return rawRecords && rawRecords.length > 0 ? rawRecords : Array.isArray(props.data) ? props.data : Array.isArray((_a2 = props.data) == null ? void 0 : _a2.records) ? props.data.records : [];
11201
12159
  }, [rawRecords, props.data]);
11202
- const preparedRecipients = useMemo8(() => {
12160
+ const preparedRecipients = useMemo9(() => {
11203
12161
  return prepareRecipients({
11204
12162
  selectedIds: selectedRowIds,
11205
12163
  records: currentRecords,
@@ -11219,7 +12177,7 @@ function useWhatsAppState(props) {
11219
12177
  selectedSubtableFilterCol
11220
12178
  ]);
11221
12179
  const finalRecipientCount = preparedRecipients.length;
11222
- const validMainRowsCount = useMemo8(() => {
12180
+ const validMainRowsCount = useMemo9(() => {
11223
12181
  const rowIdSet = new Set(
11224
12182
  preparedRecipients.map((r) => r.mainRowId).filter(Boolean)
11225
12183
  );
@@ -11305,7 +12263,7 @@ function useWhatsAppState(props) {
11305
12263
  variableMapping,
11306
12264
  textableColumnOptions,
11307
12265
  recordData: testRecordData,
11308
- tableColumns,
12266
+ tableColumns: tableColumns2,
11309
12267
  relationOptions,
11310
12268
  templateHeaderComp,
11311
12269
  mediaUrl: headerMediaUrl || void 0,
@@ -11328,7 +12286,7 @@ function useWhatsAppState(props) {
11328
12286
  setIsSendingTest(false);
11329
12287
  }
11330
12288
  };
11331
- const handleSendMessages = useCallback12(async () => {
12289
+ const handleSendMessages = useCallback13(async () => {
11332
12290
  var _a2, _b2;
11333
12291
  if (isSendDisabled || isSendingBroadcast) return;
11334
12292
  const recipients = preparedRecipients;
@@ -11386,7 +12344,7 @@ function useWhatsAppState(props) {
11386
12344
  selectedTemplate,
11387
12345
  variableMapping,
11388
12346
  textableColumnOptions,
11389
- tableColumns,
12347
+ tableColumns: tableColumns2,
11390
12348
  relationOptions,
11391
12349
  templateHeaderComp,
11392
12350
  mediaUrl: headerMediaUrl || void 0,
@@ -11507,7 +12465,7 @@ function useWhatsAppState(props) {
11507
12465
  selectedTemplate,
11508
12466
  variableMapping,
11509
12467
  textableColumnOptions,
11510
- tableColumns,
12468
+ tableColumns2,
11511
12469
  relationOptions,
11512
12470
  templateHeaderComp,
11513
12471
  headerMediaUrl,
@@ -11523,7 +12481,7 @@ function useWhatsAppState(props) {
11523
12481
  return {
11524
12482
  orgId,
11525
12483
  // Table & data
11526
- tableColumns,
12484
+ tableColumns: tableColumns2,
11527
12485
  rawRecords,
11528
12486
  relationOptions,
11529
12487
  isLoadingTableData,
@@ -11634,7 +12592,7 @@ function useWhatsAppState(props) {
11634
12592
  }
11635
12593
 
11636
12594
  // src/components/WhatsAppComponent/ui/TemplateSelectionBlock.tsx
11637
- import { useRef as useRef13 } from "react";
12595
+ import { useRef as useRef14 } from "react";
11638
12596
  import {
11639
12597
  FileText as FileText3,
11640
12598
  Trash2 as Trash23,
@@ -11651,7 +12609,7 @@ import {
11651
12609
  CheckCircle2 as CheckCircle23,
11652
12610
  AlertCircle as AlertCircle3
11653
12611
  } from "lucide-react";
11654
- import { Fragment as Fragment4, jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
12612
+ import { Fragment as Fragment5, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
11655
12613
  function TemplateSelectionBlock({
11656
12614
  selectedTemplate,
11657
12615
  selectedTemplateId,
@@ -11677,16 +12635,16 @@ function TemplateSelectionBlock({
11677
12635
  isUploadingMedia = false,
11678
12636
  handleFileUpload
11679
12637
  }) {
11680
- const fileInputRef = useRef13(null);
11681
- return /* @__PURE__ */ jsxs14("div", { className: "col-span-12 lg:col-span-5 min-h-[26rem] h-full flex flex-col bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 relative", children: [
11682
- /* @__PURE__ */ jsxs14("div", { className: "space-y-1.5 shrink-0", children: [
11683
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between pb-1.5 border-b border-slate-200/70 shrink-0 gap-2", children: [
11684
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5 min-w-0", children: [
11685
- /* @__PURE__ */ jsx15(FileText3, { className: "w-4 h-4 text-emerald-600 shrink-0" }),
11686
- /* @__PURE__ */ jsx15("span", { className: "text-xs font-bold text-slate-800 truncate", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05D5\u05EA\u05D5\u05DB\u05DF \u05D4\u05D5\u05D3\u05E2\u05D4" })
12638
+ const fileInputRef = useRef14(null);
12639
+ return /* @__PURE__ */ jsxs16("div", { className: "col-span-12 lg:col-span-5 min-h-[26rem] h-full flex flex-col bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 relative", children: [
12640
+ /* @__PURE__ */ jsxs16("div", { className: "space-y-1.5 shrink-0", children: [
12641
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between pb-1.5 border-b border-slate-200/70 shrink-0 gap-2", children: [
12642
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 min-w-0", children: [
12643
+ /* @__PURE__ */ jsx17(FileText3, { className: "w-4 h-4 text-emerald-600 shrink-0" }),
12644
+ /* @__PURE__ */ jsx17("span", { className: "text-xs font-bold text-slate-800 truncate", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05D5\u05EA\u05D5\u05DB\u05DF \u05D4\u05D5\u05D3\u05E2\u05D4" })
11687
12645
  ] }),
11688
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5 shrink-0", children: [
11689
- /* @__PURE__ */ jsxs14(
12646
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 shrink-0", children: [
12647
+ /* @__PURE__ */ jsxs16(
11690
12648
  "button",
11691
12649
  {
11692
12650
  type: "button",
@@ -11695,12 +12653,12 @@ function TemplateSelectionBlock({
11695
12653
  className: `h-7 px-2 text-[11px] font-semibold rounded-lg border transition-all flex items-center gap-1 ${selectedTemplate && !isDeleting ? "bg-white text-rose-600 hover:bg-rose-50 border-rose-200 active:scale-[0.98] shadow-2xs cursor-pointer" : "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed opacity-60"}`,
11696
12654
  title: !selectedTemplate ? "\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DB\u05D3\u05D9 \u05DC\u05DE\u05D7\u05D5\u05E7 \u05D0\u05D5\u05EA\u05D4" : `\u05DE\u05D7\u05E7 \u05D0\u05EA \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA "${selectedTemplate.name}"`,
11697
12655
  children: [
11698
- isDeleting ? /* @__PURE__ */ jsx15(Loader25, { className: "w-3.5 h-3.5 animate-spin text-rose-500" }) : /* @__PURE__ */ jsx15(Trash23, { className: "w-3.5 h-3.5 text-rose-500" }),
11699
- /* @__PURE__ */ jsx15("span", { children: "\u05DE\u05D7\u05D9\u05E7\u05D4" })
12656
+ isDeleting ? /* @__PURE__ */ jsx17(Loader25, { className: "w-3.5 h-3.5 animate-spin text-rose-500" }) : /* @__PURE__ */ jsx17(Trash23, { className: "w-3.5 h-3.5 text-rose-500" }),
12657
+ /* @__PURE__ */ jsx17("span", { children: "\u05DE\u05D7\u05D9\u05E7\u05D4" })
11700
12658
  ]
11701
12659
  }
11702
12660
  ),
11703
- /* @__PURE__ */ jsxs14(
12661
+ /* @__PURE__ */ jsxs16(
11704
12662
  "button",
11705
12663
  {
11706
12664
  type: "button",
@@ -11708,40 +12666,40 @@ function TemplateSelectionBlock({
11708
12666
  className: "h-7 px-2.5 text-[11px] font-semibold text-white bg-emerald-600 hover:bg-emerald-700 active:scale-[0.98] rounded-lg shadow-2xs transition-all flex items-center gap-1 cursor-pointer",
11709
12667
  title: "\u05E6\u05D5\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4",
11710
12668
  children: [
11711
- /* @__PURE__ */ jsx15(Plus2, { className: "w-3.5 h-3.5" }),
11712
- /* @__PURE__ */ jsx15("span", { children: "\u05D7\u05D3\u05E9" })
12669
+ /* @__PURE__ */ jsx17(Plus2, { className: "w-3.5 h-3.5" }),
12670
+ /* @__PURE__ */ jsx17("span", { children: "\u05D7\u05D3\u05E9" })
11713
12671
  ]
11714
12672
  }
11715
12673
  )
11716
12674
  ] })
11717
12675
  ] }),
11718
- /* @__PURE__ */ jsxs14("div", { className: "relative", children: [
11719
- /* @__PURE__ */ jsxs14(
12676
+ /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12677
+ /* @__PURE__ */ jsxs16(
11720
12678
  "button",
11721
12679
  {
11722
12680
  type: "button",
11723
12681
  onClick: () => setIsDropdownOpen((prev) => !prev),
11724
12682
  className: "w-full h-8.5 px-3 bg-white hover:bg-slate-100/70 border border-slate-200 rounded-xl text-right flex items-center justify-between transition-colors cursor-pointer text-xs",
11725
12683
  children: [
11726
- selectedTemplate ? /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 overflow-hidden", children: [
11727
- /* @__PURE__ */ jsx15(
12684
+ selectedTemplate ? /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 overflow-hidden", children: [
12685
+ /* @__PURE__ */ jsx17(
11728
12686
  "span",
11729
12687
  {
11730
12688
  className: `w-2 h-2 rounded-full shrink-0 ${getStatusConfig(selectedTemplate.status).dotColor}`
11731
12689
  }
11732
12690
  ),
11733
- /* @__PURE__ */ jsx15("span", { className: "text-xs font-semibold text-slate-900 truncate", children: selectedTemplate.name }),
11734
- /* @__PURE__ */ jsxs14("span", { className: "text-[10px] text-slate-400 shrink-0", children: [
12691
+ /* @__PURE__ */ jsx17("span", { className: "text-xs font-semibold text-slate-900 truncate", children: selectedTemplate.name }),
12692
+ /* @__PURE__ */ jsxs16("span", { className: "text-[10px] text-slate-400 shrink-0", children: [
11735
12693
  "(",
11736
12694
  selectedTemplate.category,
11737
12695
  " \u2022 ",
11738
12696
  selectedTemplate.language,
11739
12697
  ")"
11740
12698
  ] })
11741
- ] }) : /* @__PURE__ */ jsx15("span", { className: "text-xs text-slate-400", children: "\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05E7\u05D9\u05D9\u05DE\u05EA \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4..." }),
11742
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-1.5 shrink-0 mr-1", children: [
11743
- isLoadingTemplates && /* @__PURE__ */ jsx15(Loader25, { className: "w-3.5 h-3.5 text-emerald-600 animate-spin" }),
11744
- /* @__PURE__ */ jsx15(
12699
+ ] }) : /* @__PURE__ */ jsx17("span", { className: "text-xs text-slate-400", children: "\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05E7\u05D9\u05D9\u05DE\u05EA \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4..." }),
12700
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 shrink-0 mr-1", children: [
12701
+ isLoadingTemplates && /* @__PURE__ */ jsx17(Loader25, { className: "w-3.5 h-3.5 text-emerald-600 animate-spin" }),
12702
+ /* @__PURE__ */ jsx17(
11745
12703
  ChevronDown3,
11746
12704
  {
11747
12705
  className: `w-3.5 h-3.5 text-slate-400 transition-transform ${isDropdownOpen ? "rotate-180" : ""}`
@@ -11751,21 +12709,21 @@ function TemplateSelectionBlock({
11751
12709
  ]
11752
12710
  }
11753
12711
  ),
11754
- isDropdownOpen && /* @__PURE__ */ jsxs14(Fragment4, { children: [
11755
- /* @__PURE__ */ jsx15(
12712
+ isDropdownOpen && /* @__PURE__ */ jsxs16(Fragment5, { children: [
12713
+ /* @__PURE__ */ jsx17(
11756
12714
  "div",
11757
12715
  {
11758
12716
  className: "fixed inset-0 z-40",
11759
12717
  onClick: () => setIsDropdownOpen(false)
11760
12718
  }
11761
12719
  ),
11762
- /* @__PURE__ */ jsxs14("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white border border-slate-200 rounded-xl shadow-xl z-50 max-h-52 overflow-y-auto divide-y divide-slate-100 animate-in fade-in-50 zoom-in-95 duration-100", children: [
11763
- templates.length === 0 && !isLoadingTemplates && /* @__PURE__ */ jsx15("div", { className: "p-3 text-center text-xs text-slate-400", children: '\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA. \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05E6\u05D5\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4".' }),
12720
+ /* @__PURE__ */ jsxs16("div", { className: "absolute top-full left-0 right-0 mt-1 bg-white border border-slate-200 rounded-xl shadow-xl z-50 max-h-52 overflow-y-auto divide-y divide-slate-100 animate-in fade-in-50 zoom-in-95 duration-100", children: [
12721
+ templates.length === 0 && !isLoadingTemplates && /* @__PURE__ */ jsx17("div", { className: "p-3 text-center text-xs text-slate-400", children: '\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA. \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05E6\u05D5\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4".' }),
11764
12722
  templates.map((tpl) => {
11765
12723
  const statusConfig = getStatusConfig(tpl.status);
11766
12724
  const isSelected = tpl.id === selectedTemplateId;
11767
12725
  const canSelect = statusConfig.isSelectable;
11768
- return /* @__PURE__ */ jsxs14(
12726
+ return /* @__PURE__ */ jsxs16(
11769
12727
  "div",
11770
12728
  {
11771
12729
  onClick: () => {
@@ -11778,29 +12736,29 @@ function TemplateSelectionBlock({
11778
12736
  className: `p-2.5 flex items-center justify-between gap-2.5 transition-colors ${canSelect ? "hover:bg-slate-50 cursor-pointer" : "opacity-60 bg-slate-50/60 cursor-not-allowed"} ${isSelected ? "bg-emerald-50/50" : ""}`,
11779
12737
  title: !canSelect ? `\u05E1\u05D8\u05D8\u05D5\u05E1 \u05EA\u05D1\u05E0\u05D9\u05EA: ${tpl.status}. \u05E8\u05E7 \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA \u05D1\u05DE\u05E6\u05D1 \u05DE\u05D0\u05D5\u05E9\u05E8 \u05D0\u05D5 \u05E4\u05E2\u05D9\u05DC \u05E0\u05D9\u05EA\u05E0\u05D5\u05EA \u05DC\u05D1\u05D7\u05D9\u05E8\u05D4.` : void 0,
11780
12738
  children: [
11781
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 overflow-hidden", children: [
11782
- /* @__PURE__ */ jsx15(
12739
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 overflow-hidden", children: [
12740
+ /* @__PURE__ */ jsx17(
11783
12741
  "span",
11784
12742
  {
11785
12743
  className: `w-2 h-2 rounded-full shrink-0 ${statusConfig.dotColor}`
11786
12744
  }
11787
12745
  ),
11788
- /* @__PURE__ */ jsxs14("div", { className: "overflow-hidden", children: [
11789
- /* @__PURE__ */ jsx15(
12746
+ /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden", children: [
12747
+ /* @__PURE__ */ jsx17(
11790
12748
  "p",
11791
12749
  {
11792
12750
  className: `text-xs font-semibold truncate ${isSelected ? "text-emerald-700" : canSelect ? "text-slate-800" : "text-slate-500"}`,
11793
12751
  children: tpl.name
11794
12752
  }
11795
12753
  ),
11796
- /* @__PURE__ */ jsxs14("p", { className: "text-[10px] text-slate-400", children: [
12754
+ /* @__PURE__ */ jsxs16("p", { className: "text-[10px] text-slate-400", children: [
11797
12755
  tpl.category,
11798
12756
  " \u2022 ",
11799
12757
  tpl.language
11800
12758
  ] })
11801
12759
  ] })
11802
12760
  ] }),
11803
- /* @__PURE__ */ jsx15(
12761
+ /* @__PURE__ */ jsx17(
11804
12762
  "span",
11805
12763
  {
11806
12764
  className: `text-[9px] font-semibold px-2 py-0.5 rounded-full border shrink-0 ${statusConfig.badgeBg} ${statusConfig.badgeText}`,
@@ -11816,18 +12774,18 @@ function TemplateSelectionBlock({
11816
12774
  ] })
11817
12775
  ] })
11818
12776
  ] }),
11819
- /* @__PURE__ */ jsxs14("div", { className: "flex-1 min-h-0 flex flex-col gap-2", children: [
11820
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-600 shrink-0", children: [
11821
- /* @__PURE__ */ jsx15("span", { children: "\u05EA\u05E6\u05D5\u05D2\u05EA \u05D4\u05D5\u05D3\u05E2\u05D4" }),
11822
- selectedTemplate && /* @__PURE__ */ jsxs14("span", { className: "text-[10px] text-slate-400", children: [
12777
+ /* @__PURE__ */ jsxs16("div", { className: "flex-1 min-h-0 flex flex-col gap-2", children: [
12778
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-600 shrink-0", children: [
12779
+ /* @__PURE__ */ jsx17("span", { children: "\u05EA\u05E6\u05D5\u05D2\u05EA \u05D4\u05D5\u05D3\u05E2\u05D4" }),
12780
+ selectedTemplate && /* @__PURE__ */ jsxs16("span", { className: "text-[10px] text-slate-400", children: [
11823
12781
  "(",
11824
12782
  templateBodyText.length,
11825
12783
  " \u05EA\u05D5\u05D5\u05D9\u05DD)"
11826
12784
  ] })
11827
12785
  ] }),
11828
- selectedTemplate ? /* @__PURE__ */ jsx15("div", { className: "flex-1 min-h-0 overflow-y-auto bg-white border border-slate-200 rounded-lg p-3 text-sm text-slate-700 leading-relaxed font-sans whitespace-pre-wrap select-all shadow-2xs", children: templateBodyText || "(\u05D2\u05D5\u05E3 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E8\u05D9\u05E7)" }) : /* @__PURE__ */ jsxs14("div", { className: "flex-1 min-h-0 py-3 bg-white border border-dashed border-slate-200 rounded-lg text-center text-sm text-slate-400 flex flex-col items-center justify-center gap-0.5", children: [
11829
- /* @__PURE__ */ jsx15("span", { children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" }),
11830
- /* @__PURE__ */ jsx15("span", { className: "text-xs text-slate-400", children: '\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4 \u05D0\u05D5 \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05D7\u05D3\u05E9"' })
12786
+ selectedTemplate ? /* @__PURE__ */ jsx17("div", { className: "flex-1 min-h-0 overflow-y-auto bg-white border border-slate-200 rounded-lg p-3 text-sm text-slate-700 leading-relaxed font-sans whitespace-pre-wrap select-all shadow-2xs", children: templateBodyText || "(\u05D2\u05D5\u05E3 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E8\u05D9\u05E7)" }) : /* @__PURE__ */ jsxs16("div", { className: "flex-1 min-h-0 py-3 bg-white border border-dashed border-slate-200 rounded-lg text-center text-sm text-slate-400 flex flex-col items-center justify-center gap-0.5", children: [
12787
+ /* @__PURE__ */ jsx17("span", { children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" }),
12788
+ /* @__PURE__ */ jsx17("span", { className: "text-xs text-slate-400", children: '\u05D1\u05D7\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4 \u05D0\u05D5 \u05DC\u05D7\u05E5 \u05E2\u05DC "+ \u05D7\u05D3\u05E9"' })
11831
12789
  ] }),
11832
12790
  selectedTemplate && (() => {
11833
12791
  var _a;
@@ -11836,19 +12794,19 @@ function TemplateSelectionBlock({
11836
12794
  );
11837
12795
  const tplButtons = (buttonsComp == null ? void 0 : buttonsComp.buttons) || [];
11838
12796
  if (!tplButtons || tplButtons.length === 0) return null;
11839
- return /* @__PURE__ */ jsx15("div", { className: "flex flex-wrap gap-1.5 shrink-0 pt-0.5", children: tplButtons.map((btn, idx) => {
12797
+ return /* @__PURE__ */ jsx17("div", { className: "flex flex-wrap gap-1.5 shrink-0 pt-0.5", children: tplButtons.map((btn, idx) => {
11840
12798
  const btnType = (btn.type || "").toUpperCase();
11841
12799
  const btnText = btn.text || (btnType === "COPY_CODE" ? `\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D5\u05D3: ${btn.example}` : "\u05DB\u05E4\u05EA\u05D5\u05E8");
11842
- return /* @__PURE__ */ jsxs14(
12800
+ return /* @__PURE__ */ jsxs16(
11843
12801
  "div",
11844
12802
  {
11845
12803
  className: "inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg bg-white border border-slate-200/90 text-slate-700 text-xs font-semibold shadow-2xs select-none",
11846
12804
  children: [
11847
- btnType === "QUICK_REPLY" && /* @__PURE__ */ jsx15(MessageSquare2, { className: "w-3 h-3 text-emerald-600" }),
11848
- btnType === "URL" && /* @__PURE__ */ jsx15(ExternalLink4, { className: "w-3 h-3 text-sky-600" }),
11849
- btnType === "PHONE_NUMBER" && /* @__PURE__ */ jsx15(Phone2, { className: "w-3 h-3 text-violet-600" }),
11850
- btnType === "COPY_CODE" && /* @__PURE__ */ jsx15(Copy4, { className: "w-3 h-3 text-amber-600" }),
11851
- /* @__PURE__ */ jsx15("span", { className: "truncate max-w-[180px]", children: btnText })
12805
+ btnType === "QUICK_REPLY" && /* @__PURE__ */ jsx17(MessageSquare2, { className: "w-3 h-3 text-emerald-600" }),
12806
+ btnType === "URL" && /* @__PURE__ */ jsx17(ExternalLink4, { className: "w-3 h-3 text-sky-600" }),
12807
+ btnType === "PHONE_NUMBER" && /* @__PURE__ */ jsx17(Phone2, { className: "w-3 h-3 text-violet-600" }),
12808
+ btnType === "COPY_CODE" && /* @__PURE__ */ jsx17(Copy4, { className: "w-3 h-3 text-amber-600" }),
12809
+ /* @__PURE__ */ jsx17("span", { className: "truncate max-w-[180px]", children: btnText })
11852
12810
  ]
11853
12811
  },
11854
12812
  idx
@@ -11863,9 +12821,9 @@ function TemplateSelectionBlock({
11863
12821
  const docFilename = resolveDocumentFilename(templateHeaderComp, headerMediaUrl);
11864
12822
  const hasValidMedia = Boolean(headerMediaUrl && headerMediaUrl.trim() && headerMediaUrl.startsWith("http"));
11865
12823
  const uploadButtonLabel = headerFormat === "DOCUMENT" ? "\u05D4\u05E2\u05DC\u05D4 \u05DE\u05E1\u05DE\u05DA" : headerFormat === "IMAGE" ? "\u05D4\u05E2\u05DC\u05D4 \u05EA\u05DE\u05D5\u05E0\u05D4" : "\u05D4\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5";
11866
- return /* @__PURE__ */ jsxs14("div", { className: "p-2.5 bg-slate-50 border border-slate-200/90 rounded-xl flex items-center justify-between gap-3 shrink-0 shadow-2xs", children: [
11867
- /* @__PURE__ */ jsx15("div", { className: "flex items-center gap-2.5 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs14(Fragment4, { children: [
11868
- /* @__PURE__ */ jsx15("div", { className: "w-8 h-8 rounded-lg overflow-hidden border border-slate-200 shrink-0 bg-slate-100 flex items-center justify-center", children: hasValidMedia ? /* @__PURE__ */ jsx15(
12824
+ return /* @__PURE__ */ jsxs16("div", { className: "p-2.5 bg-slate-50 border border-slate-200/90 rounded-xl flex items-center justify-between gap-3 shrink-0 shadow-2xs", children: [
12825
+ /* @__PURE__ */ jsx17("div", { className: "flex items-center gap-2.5 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs16(Fragment5, { children: [
12826
+ /* @__PURE__ */ jsx17("div", { className: "w-8 h-8 rounded-lg overflow-hidden border border-slate-200 shrink-0 bg-slate-100 flex items-center justify-center", children: hasValidMedia ? /* @__PURE__ */ jsx17(
11869
12827
  "img",
11870
12828
  {
11871
12829
  src: headerMediaUrl,
@@ -11875,33 +12833,33 @@ function TemplateSelectionBlock({
11875
12833
  e.currentTarget.style.display = "none";
11876
12834
  }
11877
12835
  }
11878
- ) : /* @__PURE__ */ jsx15(ImageIcon2, { className: "w-4 h-4 text-amber-600" }) }),
11879
- /* @__PURE__ */ jsxs14("div", { className: "overflow-hidden", children: [
11880
- /* @__PURE__ */ jsx15("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" }),
11881
- /* @__PURE__ */ jsx15("span", { className: "text-[10px] text-slate-400 block truncate", children: hasValidMedia ? "\u05E7\u05D5\u05D1\u05E5 \u05EA\u05DE\u05D5\u05E0\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA" : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05EA\u05DE\u05D5\u05E0\u05D4" })
12836
+ ) : /* @__PURE__ */ jsx17(ImageIcon2, { className: "w-4 h-4 text-amber-600" }) }),
12837
+ /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden", children: [
12838
+ /* @__PURE__ */ jsx17("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" }),
12839
+ /* @__PURE__ */ jsx17("span", { className: "text-[10px] text-slate-400 block truncate", children: hasValidMedia ? "\u05E7\u05D5\u05D1\u05E5 \u05EA\u05DE\u05D5\u05E0\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA" : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05EA\u05DE\u05D5\u05E0\u05D4" })
11882
12840
  ] })
11883
- ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs14(Fragment4, { children: [
11884
- /* @__PURE__ */ jsx15("div", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border ${hasValidMedia ? "bg-rose-50 text-rose-600 border-rose-100" : "bg-slate-100 text-slate-400 border-slate-200"}`, children: /* @__PURE__ */ jsx15(FileText3, { className: "w-4 h-4" }) }),
11885
- /* @__PURE__ */ jsxs14("div", { className: "overflow-hidden", children: [
11886
- /* @__PURE__ */ jsx15("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
11887
- /* @__PURE__ */ jsx15("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: hasValidMedia ? docFilename : void 0, children: hasValidMedia ? docFilename : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05DE\u05E1\u05DE\u05DA" })
12841
+ ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs16(Fragment5, { children: [
12842
+ /* @__PURE__ */ jsx17("div", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border ${hasValidMedia ? "bg-rose-50 text-rose-600 border-rose-100" : "bg-slate-100 text-slate-400 border-slate-200"}`, children: /* @__PURE__ */ jsx17(FileText3, { className: "w-4 h-4" }) }),
12843
+ /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden", children: [
12844
+ /* @__PURE__ */ jsx17("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
12845
+ /* @__PURE__ */ jsx17("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: hasValidMedia ? docFilename : void 0, children: hasValidMedia ? docFilename : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05DE\u05E1\u05DE\u05DA" })
11888
12846
  ] })
11889
- ] }) : /* @__PURE__ */ jsxs14(Fragment4, { children: [
11890
- /* @__PURE__ */ jsx15("div", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border ${hasValidMedia ? "bg-indigo-50 text-indigo-600 border-indigo-100" : "bg-slate-100 text-slate-400 border-slate-200"}`, children: /* @__PURE__ */ jsx15(Video2, { className: "w-4 h-4" }) }),
11891
- /* @__PURE__ */ jsxs14("div", { className: "overflow-hidden", children: [
11892
- /* @__PURE__ */ jsx15("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" }),
11893
- /* @__PURE__ */ jsx15("span", { className: "text-[10px] text-slate-400 block truncate", children: hasValidMedia ? "\u05E7\u05D5\u05D1\u05E5 \u05D5\u05D9\u05D3\u05D0\u05D5 \u05DE\u05E7\u05D5\u05E9\u05E8 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA" : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05D5\u05D9\u05D3\u05D0\u05D5" })
12847
+ ] }) : /* @__PURE__ */ jsxs16(Fragment5, { children: [
12848
+ /* @__PURE__ */ jsx17("div", { className: `w-8 h-8 rounded-lg flex items-center justify-center shrink-0 border ${hasValidMedia ? "bg-indigo-50 text-indigo-600 border-indigo-100" : "bg-slate-100 text-slate-400 border-slate-200"}`, children: /* @__PURE__ */ jsx17(Video2, { className: "w-4 h-4" }) }),
12849
+ /* @__PURE__ */ jsxs16("div", { className: "overflow-hidden", children: [
12850
+ /* @__PURE__ */ jsx17("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" }),
12851
+ /* @__PURE__ */ jsx17("span", { className: "text-[10px] text-slate-400 block truncate", children: hasValidMedia ? "\u05E7\u05D5\u05D1\u05E5 \u05D5\u05D9\u05D3\u05D0\u05D5 \u05DE\u05E7\u05D5\u05E9\u05E8 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA" : "\u05D8\u05E8\u05DD \u05D4\u05D5\u05E2\u05DC\u05D4 \u05E7\u05D5\u05D1\u05E5 \u05D5\u05D9\u05D3\u05D0\u05D5" })
11894
12852
  ] })
11895
12853
  ] }) }),
11896
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center gap-2 shrink-0", children: [
11897
- hasValidMedia ? /* @__PURE__ */ jsxs14("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-emerald-800 px-2 py-0.5 bg-emerald-50 border border-emerald-200 rounded-lg", children: [
11898
- /* @__PURE__ */ jsx15(CheckCircle23, { className: "w-3 h-3 text-emerald-600" }),
12854
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2 shrink-0", children: [
12855
+ hasValidMedia ? /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1 text-[10px] font-medium text-emerald-800 px-2 py-0.5 bg-emerald-50 border border-emerald-200 rounded-lg", children: [
12856
+ /* @__PURE__ */ jsx17(CheckCircle23, { className: "w-3 h-3 text-emerald-600" }),
11899
12857
  "\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E6\u05D5\u05E8\u05E3 \u05EA\u05E7\u05D9\u05DF"
11900
- ] }) : /* @__PURE__ */ jsxs14("span", { className: "inline-flex items-center gap-1 text-[10px] font-semibold text-amber-800 px-2 py-0.5 bg-amber-50 border border-amber-200 rounded-lg", children: [
11901
- /* @__PURE__ */ jsx15(AlertCircle3, { className: "w-3 h-3 text-amber-600 shrink-0" }),
12858
+ ] }) : /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1 text-[10px] font-semibold text-amber-800 px-2 py-0.5 bg-amber-50 border border-amber-200 rounded-lg", children: [
12859
+ /* @__PURE__ */ jsx17(AlertCircle3, { className: "w-3 h-3 text-amber-600 shrink-0" }),
11902
12860
  "\u05E0\u05D3\u05E8\u05E9 \u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5"
11903
12861
  ] }),
11904
- hasValidMedia && /* @__PURE__ */ jsx15(
12862
+ hasValidMedia && /* @__PURE__ */ jsx17(
11905
12863
  "a",
11906
12864
  {
11907
12865
  href: headerMediaUrl,
@@ -11909,10 +12867,10 @@ function TemplateSelectionBlock({
11909
12867
  rel: "noopener noreferrer",
11910
12868
  title: "\u05EA\u05E6\u05D5\u05D2\u05D4 \u05DE\u05E7\u05D3\u05D9\u05DE\u05D4 \u05E9\u05DC \u05D4\u05E7\u05D5\u05D1\u05E5",
11911
12869
  className: "p-1 text-slate-400 hover:text-emerald-700 hover:bg-slate-200/60 rounded-md transition-colors",
11912
- children: /* @__PURE__ */ jsx15(ExternalLink4, { className: "w-3.5 h-3.5" })
12870
+ children: /* @__PURE__ */ jsx17(ExternalLink4, { className: "w-3.5 h-3.5" })
11913
12871
  }
11914
12872
  ),
11915
- /* @__PURE__ */ jsx15(
12873
+ /* @__PURE__ */ jsx17(
11916
12874
  "input",
11917
12875
  {
11918
12876
  ref: fileInputRef,
@@ -11930,7 +12888,7 @@ function TemplateSelectionBlock({
11930
12888
  disabled: isUploadingMedia
11931
12889
  }
11932
12890
  ),
11933
- /* @__PURE__ */ jsx15(
12891
+ /* @__PURE__ */ jsx17(
11934
12892
  "button",
11935
12893
  {
11936
12894
  type: "button",
@@ -11941,39 +12899,39 @@ function TemplateSelectionBlock({
11941
12899
  },
11942
12900
  className: `inline-flex items-center gap-1.5 px-2.5 py-1 text-[11px] font-medium rounded-lg transition-colors border shadow-2xs ${isUploadingMedia ? "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed" : hasValidMedia ? "bg-white text-slate-700 hover:bg-slate-50 border-slate-200 hover:border-slate-300" : "bg-emerald-600 text-white hover:bg-emerald-700 border-emerald-600"}`,
11943
12901
  title: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DE\u05D3\u05D9\u05D4 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5" : `${uploadButtonLabel} \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5`,
11944
- children: isUploadingMedia ? /* @__PURE__ */ jsxs14(Fragment4, { children: [
11945
- /* @__PURE__ */ jsx15(Loader25, { className: "w-3.5 h-3.5 animate-spin" }),
11946
- /* @__PURE__ */ jsx15("span", { children: "\u05DE\u05E2\u05DC\u05D4..." })
11947
- ] }) : /* @__PURE__ */ jsxs14(Fragment4, { children: [
11948
- /* @__PURE__ */ jsx15(Upload3, { className: "w-3.5 h-3.5" }),
11949
- /* @__PURE__ */ jsx15("span", { children: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5" : uploadButtonLabel })
12902
+ children: isUploadingMedia ? /* @__PURE__ */ jsxs16(Fragment5, { children: [
12903
+ /* @__PURE__ */ jsx17(Loader25, { className: "w-3.5 h-3.5 animate-spin" }),
12904
+ /* @__PURE__ */ jsx17("span", { children: "\u05DE\u05E2\u05DC\u05D4..." })
12905
+ ] }) : /* @__PURE__ */ jsxs16(Fragment5, { children: [
12906
+ /* @__PURE__ */ jsx17(Upload3, { className: "w-3.5 h-3.5" }),
12907
+ /* @__PURE__ */ jsx17("span", { children: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5" : uploadButtonLabel })
11950
12908
  ] })
11951
12909
  }
11952
12910
  )
11953
12911
  ] })
11954
12912
  ] });
11955
12913
  })(),
11956
- selectedTemplate && templateVariables.length > 0 && /* @__PURE__ */ jsxs14("div", { className: "shrink-0 flex flex-col gap-1.5 pt-2 border-t border-slate-200/80 pb-0", children: [
11957
- /* @__PURE__ */ jsxs14("div", { className: "flex items-center justify-between shrink-0", children: [
11958
- /* @__PURE__ */ jsx15("span", { className: "text-[11px] font-bold text-slate-700", children: "\u05DE\u05D9\u05E4\u05D5\u05D9 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD" }),
11959
- /* @__PURE__ */ jsxs14("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-200", children: [
12914
+ selectedTemplate && templateVariables.length > 0 && /* @__PURE__ */ jsxs16("div", { className: "shrink-0 flex flex-col gap-1.5 pt-2 border-t border-slate-200/80 pb-0", children: [
12915
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between shrink-0", children: [
12916
+ /* @__PURE__ */ jsx17("span", { className: "text-[11px] font-bold text-slate-700", children: "\u05DE\u05D9\u05E4\u05D5\u05D9 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD" }),
12917
+ /* @__PURE__ */ jsxs16("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-200", children: [
11960
12918
  templateVariables.length,
11961
12919
  " \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD"
11962
12920
  ] })
11963
12921
  ] }),
11964
- /* @__PURE__ */ jsx15("div", { className: "max-h-48 overflow-y-auto space-y-1.5 pr-0.5", children: templateVariables.map((varKey) => {
12922
+ /* @__PURE__ */ jsx17("div", { className: "max-h-48 overflow-y-auto space-y-1.5 pr-0.5", children: templateVariables.map((varKey) => {
11965
12923
  var _a;
11966
12924
  const mapping = variableMapping[varKey] || { type: "column", value: "" };
11967
12925
  const isStatic = mapping.type === "static";
11968
12926
  const selectedColVal = textableColumnOptions.some((o) => o.id === mapping.value) ? mapping.value : ((_a = textableColumnOptions.find((o) => o.columnName === mapping.value)) == null ? void 0 : _a.id) || mapping.value || "";
11969
- return /* @__PURE__ */ jsxs14(
12927
+ return /* @__PURE__ */ jsxs16(
11970
12928
  "div",
11971
12929
  {
11972
12930
  className: "flex items-center gap-1.5 p-1 bg-white border border-slate-200 rounded-xl text-xs shrink-0",
11973
12931
  children: [
11974
- /* @__PURE__ */ jsx15("span", { className: "px-2 py-0.5 bg-emerald-50 text-emerald-800 font-mono font-bold text-[11px] rounded-lg border border-emerald-200/80 shrink-0", children: `{{${varKey}}}` }),
11975
- /* @__PURE__ */ jsxs14("div", { className: "inline-flex items-center p-0.5 bg-slate-100 rounded-lg border border-slate-200/80 shrink-0 text-[10px] font-medium", children: [
11976
- /* @__PURE__ */ jsx15(
12932
+ /* @__PURE__ */ jsx17("span", { className: "px-2 py-0.5 bg-emerald-50 text-emerald-800 font-mono font-bold text-[11px] rounded-lg border border-emerald-200/80 shrink-0", children: `{{${varKey}}}` }),
12933
+ /* @__PURE__ */ jsxs16("div", { className: "inline-flex items-center p-0.5 bg-slate-100 rounded-lg border border-slate-200/80 shrink-0 text-[10px] font-medium", children: [
12934
+ /* @__PURE__ */ jsx17(
11977
12935
  "button",
11978
12936
  {
11979
12937
  type: "button",
@@ -11982,7 +12940,7 @@ function TemplateSelectionBlock({
11982
12940
  children: "\u05E2\u05DE\u05D5\u05D3\u05D4"
11983
12941
  }
11984
12942
  ),
11985
- /* @__PURE__ */ jsx15(
12943
+ /* @__PURE__ */ jsx17(
11986
12944
  "button",
11987
12945
  {
11988
12946
  type: "button",
@@ -11992,7 +12950,7 @@ function TemplateSelectionBlock({
11992
12950
  }
11993
12951
  )
11994
12952
  ] }),
11995
- isStatic ? /* @__PURE__ */ jsx15(
12953
+ isStatic ? /* @__PURE__ */ jsx17(
11996
12954
  "input",
11997
12955
  {
11998
12956
  type: "text",
@@ -12001,20 +12959,20 @@ function TemplateSelectionBlock({
12001
12959
  placeholder: "\u05D4\u05D6\u05DF \u05E2\u05E8\u05DA \u05E7\u05D1\u05D5\u05E2 (\u05D7\u05D5\u05D1\u05D4)...",
12002
12960
  className: `flex-1 min-w-0 h-7 px-2 text-[11px] rounded-lg border bg-white text-slate-800 placeholder:text-slate-400 focus:outline-none transition-colors ${!mapping.value || mapping.value.trim() === "" ? "border-amber-300 focus:border-amber-500 focus:ring-1 focus:ring-amber-500/20" : "border-slate-200 focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500/20"}`
12003
12961
  }
12004
- ) : /* @__PURE__ */ jsxs14("div", { className: "relative flex-1 min-w-0", children: [
12005
- /* @__PURE__ */ jsxs14(
12962
+ ) : /* @__PURE__ */ jsxs16("div", { className: "relative flex-1 min-w-0", children: [
12963
+ /* @__PURE__ */ jsxs16(
12006
12964
  "select",
12007
12965
  {
12008
12966
  value: selectedColVal,
12009
12967
  onChange: (e) => handleVariableValueChange(varKey, e.target.value),
12010
12968
  className: "w-full h-7 pr-2.5 pl-6 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500/20 cursor-pointer truncate appearance-none",
12011
12969
  children: [
12012
- /* @__PURE__ */ jsx15("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
12013
- textableColumnOptions.map((opt) => /* @__PURE__ */ jsx15("option", { value: opt.id, children: opt.label }, opt.id))
12970
+ /* @__PURE__ */ jsx17("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
12971
+ textableColumnOptions.map((opt) => /* @__PURE__ */ jsx17("option", { value: opt.id, children: opt.label }, opt.id))
12014
12972
  ]
12015
12973
  }
12016
12974
  ),
12017
- /* @__PURE__ */ jsx15(ChevronDown3, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
12975
+ /* @__PURE__ */ jsx17(ChevronDown3, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
12018
12976
  ] })
12019
12977
  ]
12020
12978
  },
@@ -12034,7 +12992,7 @@ import {
12034
12992
  CheckSquare,
12035
12993
  RefreshCw
12036
12994
  } from "lucide-react";
12037
- import { Fragment as Fragment5, jsx as jsx16, jsxs as jsxs15 } from "react/jsx-runtime";
12995
+ import { Fragment as Fragment6, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
12038
12996
  function DynamicFiltersBlock({
12039
12997
  filterableColumns,
12040
12998
  filters,
@@ -12049,31 +13007,31 @@ function DynamicFiltersBlock({
12049
13007
  loadTableData,
12050
13008
  isLoadingTableData
12051
13009
  }) {
12052
- return /* @__PURE__ */ jsxs15("div", { className: "col-span-12 lg:col-span-3 min-h-[26rem] h-full flex flex-col justify-between bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 gap-2", children: [
12053
- /* @__PURE__ */ jsxs15("div", { className: "space-y-2", children: [
12054
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: [
12055
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-2", children: [
12056
- /* @__PURE__ */ jsx16(Filter2, { className: "w-4 h-4 text-emerald-600" }),
12057
- /* @__PURE__ */ jsx16("span", { className: "text-xs font-bold text-slate-800", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05D3\u05D9\u05E0\u05DE\u05D9" }),
12058
- activeFiltersCount > 0 && /* @__PURE__ */ jsx16("span", { className: "text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-emerald-100 text-emerald-800 border border-emerald-200", children: activeFiltersCount })
13010
+ return /* @__PURE__ */ jsxs17("div", { className: "col-span-12 lg:col-span-3 min-h-[26rem] h-full flex flex-col justify-between bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 gap-2", children: [
13011
+ /* @__PURE__ */ jsxs17("div", { className: "space-y-2", children: [
13012
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: [
13013
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
13014
+ /* @__PURE__ */ jsx18(Filter2, { className: "w-4 h-4 text-emerald-600" }),
13015
+ /* @__PURE__ */ jsx18("span", { className: "text-xs font-bold text-slate-800", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05D3\u05D9\u05E0\u05DE\u05D9" }),
13016
+ activeFiltersCount > 0 && /* @__PURE__ */ jsx18("span", { className: "text-[10px] font-bold px-1.5 py-0.5 rounded-full bg-emerald-100 text-emerald-800 border border-emerald-200", children: activeFiltersCount })
12059
13017
  ] }),
12060
- activeFiltersCount > 0 && /* @__PURE__ */ jsxs15(
13018
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxs17(
12061
13019
  "button",
12062
13020
  {
12063
13021
  type: "button",
12064
13022
  onClick: handleClearFilters,
12065
13023
  className: "text-[11px] text-rose-600 hover:text-rose-700 font-semibold hover:underline flex items-center gap-1 cursor-pointer",
12066
13024
  children: [
12067
- /* @__PURE__ */ jsx16(X10, { className: "w-3 h-3" }),
12068
- /* @__PURE__ */ jsx16("span", { children: "\u05E0\u05E7\u05D4" })
13025
+ /* @__PURE__ */ jsx18(X10, { className: "w-3 h-3" }),
13026
+ /* @__PURE__ */ jsx18("span", { children: "\u05E0\u05E7\u05D4" })
12069
13027
  ]
12070
13028
  }
12071
13029
  )
12072
13030
  ] }),
12073
- /* @__PURE__ */ jsx16("div", { className: "py-1", children: filterableColumns.length === 0 ? /* @__PURE__ */ jsxs15("div", { className: "flex flex-col items-center justify-center text-center p-4 text-xs text-slate-400 gap-1", children: [
12074
- /* @__PURE__ */ jsx16("span", { children: "\u05D0\u05D9\u05DF \u05E9\u05D3\u05D5\u05EA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D6\u05D5" }),
12075
- /* @__PURE__ */ jsx16("span", { className: "text-[10px] text-slate-400", children: "\u05E9\u05D3\u05D5\u05EA \u05DE\u05E1\u05D5\u05D2 \u05E7\u05E9\u05E8 \u05D5\u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9 \u05D1\u05DC\u05D1\u05D3" })
12076
- ] }) : /* @__PURE__ */ jsx16("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-2", children: filterableColumns.map((col) => {
13031
+ /* @__PURE__ */ jsx18("div", { className: "py-1", children: filterableColumns.length === 0 ? /* @__PURE__ */ jsxs17("div", { className: "flex flex-col items-center justify-center text-center p-4 text-xs text-slate-400 gap-1", children: [
13032
+ /* @__PURE__ */ jsx18("span", { children: "\u05D0\u05D9\u05DF \u05E9\u05D3\u05D5\u05EA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D6\u05D5" }),
13033
+ /* @__PURE__ */ jsx18("span", { className: "text-[10px] text-slate-400", children: "\u05E9\u05D3\u05D5\u05EA \u05DE\u05E1\u05D5\u05D2 \u05E7\u05E9\u05E8 \u05D5\u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9 \u05D1\u05DC\u05D1\u05D3" })
13034
+ ] }) : /* @__PURE__ */ jsx18("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-2", children: filterableColumns.map((col) => {
12077
13035
  var _a, _b, _c;
12078
13036
  const colType = (_a = col.type) == null ? void 0 : _a.toUpperCase();
12079
13037
  const isBoolean = colType === "BOOLEAN";
@@ -12081,9 +13039,9 @@ function DynamicFiltersBlock({
12081
13039
  const isActive = Boolean(currentValue);
12082
13040
  const refTableId = ((_b = col == null ? void 0 : col.config) == null ? void 0 : _b.referencedTableId) || (col == null ? void 0 : col.referencedTableId);
12083
13041
  const options = ((_c = getRelationOptionsForCol ? getRelationOptionsForCol(col.name) : []) == null ? void 0 : _c.length) > 0 ? getRelationOptionsForCol(col.name) : relationOptions[col.name] && relationOptions[col.name].length > 0 ? relationOptions[col.name] : refTableId && relationOptions[refTableId] && relationOptions[refTableId].length > 0 ? relationOptions[refTableId] : col.id && relationOptions[col.id] && relationOptions[col.id].length > 0 ? relationOptions[col.id] : [];
12084
- return /* @__PURE__ */ jsxs15("div", { className: "space-y-1", children: [
12085
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
12086
- /* @__PURE__ */ jsx16(
13042
+ return /* @__PURE__ */ jsxs17("div", { className: "space-y-1", children: [
13043
+ /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between", children: [
13044
+ /* @__PURE__ */ jsx18(
12087
13045
  "label",
12088
13046
  {
12089
13047
  className: "text-[11px] font-semibold text-slate-700 truncate max-w-[130px]",
@@ -12091,49 +13049,49 @@ function DynamicFiltersBlock({
12091
13049
  children: col.name
12092
13050
  }
12093
13051
  ),
12094
- /* @__PURE__ */ jsx16("span", { className: "text-[9px] text-slate-400 font-mono", children: isBoolean ? "\u05DB\u05DF/\u05DC\u05D0" : "\u05E7\u05E9\u05E8" })
13052
+ /* @__PURE__ */ jsx18("span", { className: "text-[9px] text-slate-400 font-mono", children: isBoolean ? "\u05DB\u05DF/\u05DC\u05D0" : "\u05E7\u05E9\u05E8" })
12095
13053
  ] }),
12096
- /* @__PURE__ */ jsxs15("div", { className: "relative", children: [
12097
- /* @__PURE__ */ jsxs15(
13054
+ /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
13055
+ /* @__PURE__ */ jsxs17(
12098
13056
  "select",
12099
13057
  {
12100
13058
  value: currentValue,
12101
13059
  onChange: (e) => handleFilterChange(col.name, e.target.value),
12102
13060
  className: `w-full h-8 px-2 pr-2.5 pl-6 text-[11px] rounded-lg border transition-all appearance-none bg-white cursor-pointer truncate ${isActive ? "border-emerald-500 bg-emerald-50/20 text-emerald-900 font-medium ring-1 ring-emerald-500/20" : "border-slate-200 text-slate-700 hover:border-slate-300 focus:border-emerald-500"}`,
12103
13061
  children: [
12104
- /* @__PURE__ */ jsx16("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
12105
- isBoolean ? /* @__PURE__ */ jsxs15(Fragment5, { children: [
12106
- /* @__PURE__ */ jsx16("option", { value: "true", children: "\u05DB\u05DF" }),
12107
- /* @__PURE__ */ jsx16("option", { value: "false", children: "\u05DC\u05D0" })
12108
- ] }) : options.map((opt) => /* @__PURE__ */ jsx16("option", { value: opt.id || opt._id, children: getRelationOptionLabel(opt, col, relationOptions) }, opt.id || opt._id))
13062
+ /* @__PURE__ */ jsx18("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
13063
+ isBoolean ? /* @__PURE__ */ jsxs17(Fragment6, { children: [
13064
+ /* @__PURE__ */ jsx18("option", { value: "true", children: "\u05DB\u05DF" }),
13065
+ /* @__PURE__ */ jsx18("option", { value: "false", children: "\u05DC\u05D0" })
13066
+ ] }) : options.map((opt) => /* @__PURE__ */ jsx18("option", { value: opt.id || opt._id, children: getRelationOptionLabel(opt, col, relationOptions) }, opt.id || opt._id))
12109
13067
  ]
12110
13068
  }
12111
13069
  ),
12112
- /* @__PURE__ */ jsx16(ChevronDown4, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
13070
+ /* @__PURE__ */ jsx18(ChevronDown4, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
12113
13071
  ] })
12114
13072
  ] }, col.name);
12115
13073
  }) }) })
12116
13074
  ] }),
12117
- /* @__PURE__ */ jsxs15("div", { className: "pt-2.5 mt-2 border-t border-slate-200/80 flex items-center justify-between gap-1.5 shrink-0", children: [
12118
- /* @__PURE__ */ jsxs15(
13075
+ /* @__PURE__ */ jsxs17("div", { className: "pt-2.5 mt-2 border-t border-slate-200/80 flex items-center justify-between gap-1.5 shrink-0", children: [
13076
+ /* @__PURE__ */ jsxs17(
12119
13077
  "div",
12120
13078
  {
12121
13079
  className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-lg text-[11px] font-semibold border transition-all ${selectedRowIds.length > 0 ? "bg-emerald-50 text-emerald-800 border-emerald-200 shadow-2xs" : "bg-white text-slate-600 border-slate-200"}`,
12122
13080
  children: [
12123
- /* @__PURE__ */ jsx16(
13081
+ /* @__PURE__ */ jsx18(
12124
13082
  CheckSquare,
12125
13083
  {
12126
13084
  className: `w-3 h-3 ${selectedRowIds.length > 0 ? "text-emerald-600" : "text-slate-400"}`
12127
13085
  }
12128
13086
  ),
12129
- /* @__PURE__ */ jsxs15("span", { children: [
13087
+ /* @__PURE__ */ jsxs17("span", { children: [
12130
13088
  "\u05E0\u05D1\u05D7\u05E8\u05D5 ",
12131
13089
  selectedRowIds.length
12132
13090
  ] })
12133
13091
  ]
12134
13092
  }
12135
13093
  ),
12136
- /* @__PURE__ */ jsx16(
13094
+ /* @__PURE__ */ jsx18(
12137
13095
  "button",
12138
13096
  {
12139
13097
  type: "button",
@@ -12141,7 +13099,7 @@ function DynamicFiltersBlock({
12141
13099
  disabled: isLoadingTableData,
12142
13100
  className: "p-1.5 text-slate-500 hover:text-slate-800 bg-white hover:bg-slate-100 border border-slate-200 rounded-lg transition-colors cursor-pointer disabled:opacity-50 shrink-0",
12143
13101
  title: "\u05E8\u05E2\u05E0\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9 \u05D8\u05D1\u05DC\u05D4",
12144
- children: /* @__PURE__ */ jsx16(
13102
+ children: /* @__PURE__ */ jsx18(
12145
13103
  RefreshCw,
12146
13104
  {
12147
13105
  className: `w-3.5 h-3.5 ${isLoadingTableData ? "animate-spin text-emerald-600" : ""}`
@@ -12164,7 +13122,7 @@ import {
12164
13122
  X as X11,
12165
13123
  CheckSquare as CheckSquare2
12166
13124
  } from "lucide-react";
12167
- import { Fragment as Fragment6, jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
13125
+ import { Fragment as Fragment7, jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
12168
13126
  function SettingsAndActionsBlock({
12169
13127
  isScanningPhoneColumns,
12170
13128
  targetPhoneOptions,
@@ -12207,29 +13165,29 @@ function SettingsAndActionsBlock({
12207
13165
  clearBroadcastSummary
12208
13166
  }) {
12209
13167
  var _a;
12210
- return /* @__PURE__ */ jsxs16("div", { className: "col-span-12 lg:col-span-4 min-h-[26rem] flex flex-col justify-between bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 gap-2", children: [
12211
- /* @__PURE__ */ jsxs16("div", { className: "space-y-2", children: [
12212
- /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-2", children: [
12213
- /* @__PURE__ */ jsx17("span", { className: "text-sm", children: "\u2699\uFE0F" }),
12214
- /* @__PURE__ */ jsx17("span", { className: "text-xs font-bold text-slate-800", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D5\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA" })
13168
+ return /* @__PURE__ */ jsxs18("div", { className: "col-span-12 lg:col-span-4 min-h-[26rem] flex flex-col justify-between bg-slate-50/70 border border-slate-200 rounded-2xl p-3.5 gap-2", children: [
13169
+ /* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
13170
+ /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
13171
+ /* @__PURE__ */ jsx19("span", { className: "text-sm", children: "\u2699\uFE0F" }),
13172
+ /* @__PURE__ */ jsx19("span", { className: "text-xs font-bold text-slate-800", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D5\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA" })
12215
13173
  ] }) }),
12216
- /* @__PURE__ */ jsxs16("div", { className: "space-y-2.5 py-1", children: [
12217
- isScanningPhoneColumns && targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs16("div", { className: "p-2.5 bg-slate-100/80 border border-slate-200 rounded-xl text-slate-500 text-xs flex items-center gap-2 shadow-2xs animate-pulse", children: [
12218
- /* @__PURE__ */ jsx17(Loader26, { className: "w-4 h-4 animate-spin text-emerald-600 shrink-0" }),
12219
- /* @__PURE__ */ jsx17("span", { className: "font-medium text-[11px] text-slate-600", children: "\u05E1\u05D5\u05E8\u05E7 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D5\u05D1\u05D8\u05D1\u05DC\u05D0\u05D5\u05EA \u05DE\u05E7\u05D5\u05E9\u05E8\u05D5\u05EA..." })
12220
- ] }) : targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs16("div", { className: "p-2.5 bg-amber-50 border border-amber-200 rounded-xl text-amber-900 text-xs flex items-center gap-2 shadow-2xs", children: [
12221
- /* @__PURE__ */ jsx17(AlertCircle4, { className: "w-4 h-4 text-amber-600 shrink-0" }),
12222
- /* @__PURE__ */ jsx17("span", { className: "font-semibold text-[11px]", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D4 \u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4" })
12223
- ] }) : targetPhoneOptions.length === 1 && targetPhoneOptions[0].type === "DIRECT" ? /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
12224
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12225
- /* @__PURE__ */ jsxs16("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
12226
- /* @__PURE__ */ jsx17(Phone3, { className: "w-3 h-3 text-slate-400" }),
12227
- /* @__PURE__ */ jsx17("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
13174
+ /* @__PURE__ */ jsxs18("div", { className: "space-y-2.5 py-1", children: [
13175
+ isScanningPhoneColumns && targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs18("div", { className: "p-2.5 bg-slate-100/80 border border-slate-200 rounded-xl text-slate-500 text-xs flex items-center gap-2 shadow-2xs animate-pulse", children: [
13176
+ /* @__PURE__ */ jsx19(Loader26, { className: "w-4 h-4 animate-spin text-emerald-600 shrink-0" }),
13177
+ /* @__PURE__ */ jsx19("span", { className: "font-medium text-[11px] text-slate-600", children: "\u05E1\u05D5\u05E8\u05E7 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D5\u05D1\u05D8\u05D1\u05DC\u05D0\u05D5\u05EA \u05DE\u05E7\u05D5\u05E9\u05E8\u05D5\u05EA..." })
13178
+ ] }) : targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs18("div", { className: "p-2.5 bg-amber-50 border border-amber-200 rounded-xl text-amber-900 text-xs flex items-center gap-2 shadow-2xs", children: [
13179
+ /* @__PURE__ */ jsx19(AlertCircle4, { className: "w-4 h-4 text-amber-600 shrink-0" }),
13180
+ /* @__PURE__ */ jsx19("span", { className: "font-semibold text-[11px]", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D4 \u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4" })
13181
+ ] }) : targetPhoneOptions.length === 1 && targetPhoneOptions[0].type === "DIRECT" ? /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
13182
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13183
+ /* @__PURE__ */ jsxs18("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
13184
+ /* @__PURE__ */ jsx19(Phone3, { className: "w-3 h-3 text-slate-400" }),
13185
+ /* @__PURE__ */ jsx19("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
12228
13186
  ] }),
12229
- /* @__PURE__ */ jsx17("span", { className: "text-[9px] font-medium text-slate-500 bg-slate-100 px-1.5 py-0.5 rounded border border-slate-200", children: "\u05D6\u05D5\u05D4\u05EA\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA" })
13187
+ /* @__PURE__ */ jsx19("span", { className: "text-[9px] font-medium text-slate-500 bg-slate-100 px-1.5 py-0.5 rounded border border-slate-200", children: "\u05D6\u05D5\u05D4\u05EA\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA" })
12230
13188
  ] }),
12231
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12232
- /* @__PURE__ */ jsx17(
13189
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13190
+ /* @__PURE__ */ jsx19(
12233
13191
  "input",
12234
13192
  {
12235
13193
  type: "text",
@@ -12239,52 +13197,52 @@ function SettingsAndActionsBlock({
12239
13197
  className: "w-full h-8 px-2.5 pl-7 text-[11px] rounded-lg border border-slate-200 bg-slate-100 text-slate-600 cursor-not-allowed font-medium select-none"
12240
13198
  }
12241
13199
  ),
12242
- /* @__PURE__ */ jsx17(Phone3, { className: "w-3.5 h-3.5 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
13200
+ /* @__PURE__ */ jsx19(Phone3, { className: "w-3.5 h-3.5 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
12243
13201
  ] })
12244
- ] }) : /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
12245
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12246
- /* @__PURE__ */ jsxs16("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
12247
- /* @__PURE__ */ jsx17(Phone3, { className: "w-3 h-3 text-slate-400" }),
12248
- /* @__PURE__ */ jsx17("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
13202
+ ] }) : /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
13203
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13204
+ /* @__PURE__ */ jsxs18("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
13205
+ /* @__PURE__ */ jsx19(Phone3, { className: "w-3 h-3 text-slate-400" }),
13206
+ /* @__PURE__ */ jsx19("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
12249
13207
  ] }),
12250
- /* @__PURE__ */ jsx17("span", { className: "text-[9px] text-slate-400", children: "\u05D7\u05D5\u05D1\u05D4" })
13208
+ /* @__PURE__ */ jsx19("span", { className: "text-[9px] text-slate-400", children: "\u05D7\u05D5\u05D1\u05D4" })
12251
13209
  ] }),
12252
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12253
- /* @__PURE__ */ jsx17(
13210
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13211
+ /* @__PURE__ */ jsx19(
12254
13212
  "select",
12255
13213
  {
12256
13214
  value: phoneColumnId,
12257
13215
  onChange: (e) => setPhoneColumnId(e.target.value),
12258
13216
  className: "w-full h-8 px-2.5 pr-2.5 pl-6 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer",
12259
- children: targetPhoneOptions.map((opt) => /* @__PURE__ */ jsx17("option", { value: opt.id, children: opt.label }, opt.id))
13217
+ children: targetPhoneOptions.map((opt) => /* @__PURE__ */ jsx19("option", { value: opt.id, children: opt.label }, opt.id))
12260
13218
  }
12261
13219
  ),
12262
- /* @__PURE__ */ jsx17(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
13220
+ /* @__PURE__ */ jsx19(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
12263
13221
  ] })
12264
13222
  ] }),
12265
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
12266
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12267
- /* @__PURE__ */ jsxs16(
13223
+ /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
13224
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13225
+ /* @__PURE__ */ jsxs18(
12268
13226
  "label",
12269
13227
  {
12270
13228
  htmlFor: "whatsapp-auto-select-records",
12271
13229
  className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1 cursor-pointer",
12272
13230
  children: [
12273
- /* @__PURE__ */ jsx17(CheckSquare2, { className: "w-3 h-3 text-slate-400" }),
12274
- /* @__PURE__ */ jsx17("span", { children: "\u05D1\u05D7\u05E8 \u05E8\u05E9\u05D5\u05DE\u05D4 (\u05DB\u05DE\u05D5\u05EA \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05E8\u05D1\u05D9\u05EA)" })
13231
+ /* @__PURE__ */ jsx19(CheckSquare2, { className: "w-3 h-3 text-slate-400" }),
13232
+ /* @__PURE__ */ jsx19("span", { children: "\u05D1\u05D7\u05E8 \u05E8\u05E9\u05D5\u05DE\u05D4 (\u05DB\u05DE\u05D5\u05EA \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05E8\u05D1\u05D9\u05EA)" })
12275
13233
  ]
12276
13234
  }
12277
13235
  ),
12278
- autoSelectCount !== null && autoSelectCount > 0 && /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 animate-in fade-in duration-150", children: [
12279
- /* @__PURE__ */ jsxs16("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 border border-emerald-200/80 px-1.5 py-0.5 rounded-full flex items-center gap-1", children: [
12280
- /* @__PURE__ */ jsx17("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }),
12281
- /* @__PURE__ */ jsxs16("span", { children: [
13236
+ autoSelectCount !== null && autoSelectCount > 0 && /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 animate-in fade-in duration-150", children: [
13237
+ /* @__PURE__ */ jsxs18("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 border border-emerald-200/80 px-1.5 py-0.5 rounded-full flex items-center gap-1", children: [
13238
+ /* @__PURE__ */ jsx19("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }),
13239
+ /* @__PURE__ */ jsxs18("span", { children: [
12282
13240
  "\u05E0\u05D1\u05D7\u05E8\u05D5 ",
12283
13241
  selectedRowIdsCount,
12284
13242
  " \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA"
12285
13243
  ] })
12286
13244
  ] }),
12287
- /* @__PURE__ */ jsxs16(
13245
+ /* @__PURE__ */ jsxs18(
12288
13246
  "button",
12289
13247
  {
12290
13248
  type: "button",
@@ -12293,14 +13251,14 @@ function SettingsAndActionsBlock({
12293
13251
  title: "\u05E0\u05E7\u05D4 \u05D1\u05D7\u05D9\u05E8\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",
12294
13252
  "aria-label": "Clear auto select count",
12295
13253
  children: [
12296
- /* @__PURE__ */ jsx17(X11, { className: "w-3 h-3" }),
12297
- /* @__PURE__ */ jsx17("span", { children: "\u05E0\u05E7\u05D4" })
13254
+ /* @__PURE__ */ jsx19(X11, { className: "w-3 h-3" }),
13255
+ /* @__PURE__ */ jsx19("span", { children: "\u05E0\u05E7\u05D4" })
12298
13256
  ]
12299
13257
  }
12300
13258
  )
12301
13259
  ] })
12302
13260
  ] }),
12303
- /* @__PURE__ */ jsx17("div", { className: "relative", children: /* @__PURE__ */ jsx17(
13261
+ /* @__PURE__ */ jsx19("div", { className: "relative", children: /* @__PURE__ */ jsx19(
12304
13262
  "input",
12305
13263
  {
12306
13264
  id: "whatsapp-auto-select-records",
@@ -12328,19 +13286,19 @@ function SettingsAndActionsBlock({
12328
13286
  }
12329
13287
  ) })
12330
13288
  ] }),
12331
- (selectedPhoneOption == null ? void 0 : selectedPhoneOption.type) === "SUBTABLE" && /* @__PURE__ */ jsxs16("div", { className: "p-2.5 bg-emerald-50/60 border border-emerald-200/80 rounded-xl space-y-2 animate-in fade-in duration-150", children: [
12332
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 pb-1 border-b border-emerald-200/60", children: [
12333
- /* @__PURE__ */ jsx17(Users, { className: "w-3.5 h-3.5 text-emerald-700" }),
12334
- /* @__PURE__ */ jsxs16("span", { className: "text-[10.5px] font-bold text-emerald-900 truncate", children: [
13289
+ (selectedPhoneOption == null ? void 0 : selectedPhoneOption.type) === "SUBTABLE" && /* @__PURE__ */ jsxs18("div", { className: "p-2.5 bg-emerald-50/60 border border-emerald-200/80 rounded-xl space-y-2 animate-in fade-in duration-150", children: [
13290
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 pb-1 border-b border-emerald-200/60", children: [
13291
+ /* @__PURE__ */ jsx19(Users, { className: "w-3.5 h-3.5 text-emerald-700" }),
13292
+ /* @__PURE__ */ jsxs18("span", { className: "text-[10.5px] font-bold text-emerald-900 truncate", children: [
12335
13293
  "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DC\u05EA\u05EA-\u05D8\u05D1\u05DC\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8\u05EA (",
12336
13294
  selectedPhoneOption.parentColumnName,
12337
13295
  ")"
12338
13296
  ] })
12339
13297
  ] }),
12340
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
12341
- /* @__PURE__ */ jsx17("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx17("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05E1\u05E0\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD (\u05D1\u05EA\u05EA-\u05D4\u05D8\u05D1\u05DC\u05D4) \u05DC\u05E4\u05D9 \u05E2\u05DE\u05D5\u05D3\u05D4:" }) }),
12342
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12343
- /* @__PURE__ */ jsxs16(
13298
+ /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
13299
+ /* @__PURE__ */ jsx19("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx19("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05E1\u05E0\u05DF \u05E0\u05E6\u05D9\u05D2\u05D9\u05DD (\u05D1\u05EA\u05EA-\u05D4\u05D8\u05D1\u05DC\u05D4) \u05DC\u05E4\u05D9 \u05E2\u05DE\u05D5\u05D3\u05D4:" }) }),
13300
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13301
+ /* @__PURE__ */ jsxs18(
12344
13302
  "select",
12345
13303
  {
12346
13304
  value: subtableFilterColumn,
@@ -12350,10 +13308,10 @@ function SettingsAndActionsBlock({
12350
13308
  },
12351
13309
  className: "w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer truncate",
12352
13310
  children: [
12353
- /* @__PURE__ */ jsx17("option", { value: "", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5 (\u05DC\u05DC\u05D0 \u05E1\u05D9\u05E0\u05D5\u05DF \u05E0\u05D5\u05E1\u05E3)" }),
13311
+ /* @__PURE__ */ jsx19("option", { value: "", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5 (\u05DC\u05DC\u05D0 \u05E1\u05D9\u05E0\u05D5\u05DF \u05E0\u05D5\u05E1\u05E3)" }),
12354
13312
  subtableFilterableColumns.map((col) => {
12355
13313
  var _a2;
12356
- return /* @__PURE__ */ jsxs16("option", { value: col.name, children: [
13314
+ return /* @__PURE__ */ jsxs18("option", { value: col.name, children: [
12357
13315
  col.name,
12358
13316
  " (",
12359
13317
  ((_a2 = col.type) == null ? void 0 : _a2.toUpperCase()) === "BOOLEAN" ? "\u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9" : "\u05E7\u05E9\u05E8",
@@ -12363,30 +13321,30 @@ function SettingsAndActionsBlock({
12363
13321
  ]
12364
13322
  }
12365
13323
  ),
12366
- /* @__PURE__ */ jsx17(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
13324
+ /* @__PURE__ */ jsx19(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
12367
13325
  ] })
12368
13326
  ] }),
12369
- selectedSubtableFilterCol && /* @__PURE__ */ jsxs16("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
12370
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12371
- /* @__PURE__ */ jsx17("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05E9\u05D4\u05E2\u05E8\u05DA \u05E9\u05DC\u05D4\u05DD \u05E9\u05D5\u05D5\u05D4 \u05DC:" }),
12372
- !subtableFilterValue && /* @__PURE__ */ jsx17("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." })
13327
+ selectedSubtableFilterCol && /* @__PURE__ */ jsxs18("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
13328
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13329
+ /* @__PURE__ */ jsx19("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05E9\u05D4\u05E2\u05E8\u05DA \u05E9\u05DC\u05D4\u05DD \u05E9\u05D5\u05D5\u05D4 \u05DC:" }),
13330
+ !subtableFilterValue && /* @__PURE__ */ jsx19("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." })
12373
13331
  ] }),
12374
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12375
- /* @__PURE__ */ jsxs16(
13332
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13333
+ /* @__PURE__ */ jsxs18(
12376
13334
  "select",
12377
13335
  {
12378
13336
  value: subtableFilterValue,
12379
13337
  onChange: (e) => setSubtableFilterValue(e.target.value),
12380
13338
  className: `w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border appearance-none cursor-pointer truncate transition-colors ${!subtableFilterValue ? "border-amber-400 bg-amber-50/30 text-slate-700 focus:border-amber-500 focus:ring-1 focus:ring-amber-500" : "border-slate-200 bg-white text-slate-700 focus:border-emerald-500"}`,
12381
13339
  children: [
12382
- /* @__PURE__ */ jsx17("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF..." }),
12383
- ((_a = selectedSubtableFilterCol.type) == null ? void 0 : _a.toUpperCase()) === "BOOLEAN" ? /* @__PURE__ */ jsxs16(Fragment6, { children: [
12384
- /* @__PURE__ */ jsx17("option", { value: "true", children: "\u05DB\u05DF (true)" }),
12385
- /* @__PURE__ */ jsx17("option", { value: "false", children: "\u05DC\u05D0 (false)" })
13340
+ /* @__PURE__ */ jsx19("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF..." }),
13341
+ ((_a = selectedSubtableFilterCol.type) == null ? void 0 : _a.toUpperCase()) === "BOOLEAN" ? /* @__PURE__ */ jsxs18(Fragment7, { children: [
13342
+ /* @__PURE__ */ jsx19("option", { value: "true", children: "\u05DB\u05DF (true)" }),
13343
+ /* @__PURE__ */ jsx19("option", { value: "false", children: "\u05DC\u05D0 (false)" })
12386
13344
  ] }) : getRelationOptionsForCol(
12387
13345
  selectedSubtableFilterCol.name,
12388
13346
  selectedPhoneOption.parentColumnName
12389
- ).map((opt) => /* @__PURE__ */ jsx17("option", { value: opt.id, children: getRelationOptionLabel(
13347
+ ).map((opt) => /* @__PURE__ */ jsx19("option", { value: opt.id, children: getRelationOptionLabel(
12390
13348
  opt,
12391
13349
  selectedSubtableFilterCol,
12392
13350
  relationOptions
@@ -12394,32 +13352,32 @@ function SettingsAndActionsBlock({
12394
13352
  ]
12395
13353
  }
12396
13354
  ),
12397
- /* @__PURE__ */ jsx17(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
13355
+ /* @__PURE__ */ jsx19(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
12398
13356
  ] })
12399
13357
  ] }),
12400
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
12401
- /* @__PURE__ */ jsx17("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05DE\u05D2\u05D1\u05DC\u05EA \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DC\u05DB\u05DC \u05E9\u05D5\u05E8\u05D4 \u05E8\u05D0\u05E9\u05D9\u05EA:" }),
12402
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12403
- /* @__PURE__ */ jsxs16(
13358
+ /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
13359
+ /* @__PURE__ */ jsx19("label", { className: "text-[10px] font-semibold text-slate-700 block", children: "\u05DE\u05D2\u05D1\u05DC\u05EA \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DC\u05DB\u05DC \u05E9\u05D5\u05E8\u05D4 \u05E8\u05D0\u05E9\u05D9\u05EA:" }),
13360
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13361
+ /* @__PURE__ */ jsxs18(
12404
13362
  "select",
12405
13363
  {
12406
13364
  value: subtableSendLimit,
12407
13365
  onChange: (e) => setSubtableSendLimit(e.target.value),
12408
13366
  className: "w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer truncate",
12409
13367
  children: [
12410
- /* @__PURE__ */ jsx17("option", { value: "PRIMARY", children: "\u05DC\u05E0\u05E6\u05D9\u05D2 \u05E8\u05D0\u05E9\u05D9 \u05D1\u05DC\u05D1\u05D3" }),
12411
- /* @__PURE__ */ jsx17("option", { value: "FIRST", children: "\u05E0\u05E6\u05D9\u05D2 \u05D0\u05D7\u05D3 \u05D1\u05DC\u05D1\u05D3" }),
12412
- /* @__PURE__ */ jsx17("option", { value: "ALL", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD" })
13368
+ /* @__PURE__ */ jsx19("option", { value: "PRIMARY", children: "\u05DC\u05E0\u05E6\u05D9\u05D2 \u05E8\u05D0\u05E9\u05D9 \u05D1\u05DC\u05D1\u05D3" }),
13369
+ /* @__PURE__ */ jsx19("option", { value: "FIRST", children: "\u05E0\u05E6\u05D9\u05D2 \u05D0\u05D7\u05D3 \u05D1\u05DC\u05D1\u05D3" }),
13370
+ /* @__PURE__ */ jsx19("option", { value: "ALL", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD" })
12413
13371
  ]
12414
13372
  }
12415
13373
  ),
12416
- /* @__PURE__ */ jsx17(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
13374
+ /* @__PURE__ */ jsx19(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
12417
13375
  ] })
12418
13376
  ] })
12419
13377
  ] }),
12420
- /* @__PURE__ */ jsxs16("div", { className: "pt-2 border-t border-slate-200/70 space-y-2", children: [
12421
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
12422
- /* @__PURE__ */ jsx17(
13378
+ /* @__PURE__ */ jsxs18("div", { className: "pt-2 border-t border-slate-200/70 space-y-2", children: [
13379
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
13380
+ /* @__PURE__ */ jsx19(
12423
13381
  "input",
12424
13382
  {
12425
13383
  type: "checkbox",
@@ -12436,13 +13394,13 @@ function SettingsAndActionsBlock({
12436
13394
  className: "w-3.5 h-3.5 rounded border-slate-300 text-emerald-600 focus:ring-emerald-500 cursor-pointer"
12437
13395
  }
12438
13396
  ),
12439
- /* @__PURE__ */ jsx17("span", { className: "text-[11px] font-semibold text-slate-800", children: "\u05E2\u05D3\u05DB\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05DC\u05D0\u05D7\u05E8 \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DE\u05D5\u05E6\u05DC\u05D7\u05EA" })
13397
+ /* @__PURE__ */ jsx19("span", { className: "text-[11px] font-semibold text-slate-800", children: "\u05E2\u05D3\u05DB\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD \u05DC\u05D0\u05D7\u05E8 \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DE\u05D5\u05E6\u05DC\u05D7\u05EA" })
12440
13398
  ] }),
12441
- enablePostSendAction && /* @__PURE__ */ jsx17("div", { className: "p-2 bg-slate-100/70 border border-slate-200/80 rounded-xl space-y-2 animate-in fade-in duration-150", children: postSendActionTargetOptions.length === 0 ? /* @__PURE__ */ jsx17("div", { className: "text-[10px] text-slate-400 text-center py-1", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05E7\u05E9\u05E8 \u05D0\u05D5 \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9 \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
12442
- /* @__PURE__ */ jsxs16("div", { className: "space-y-1", children: [
12443
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12444
- /* @__PURE__ */ jsx17("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3 \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
12445
- selectedPostSendOption && /* @__PURE__ */ jsx17(
13399
+ enablePostSendAction && /* @__PURE__ */ jsx19("div", { className: "p-2 bg-slate-100/70 border border-slate-200/80 rounded-xl space-y-2 animate-in fade-in duration-150", children: postSendActionTargetOptions.length === 0 ? /* @__PURE__ */ jsx19("div", { className: "text-[10px] text-slate-400 text-center py-1", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05E2\u05DE\u05D5\u05D3\u05D5\u05EA \u05E7\u05E9\u05E8 \u05D0\u05D5 \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9 \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }) : /* @__PURE__ */ jsxs18(Fragment7, { children: [
13400
+ /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
13401
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13402
+ /* @__PURE__ */ jsx19("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3 \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
13403
+ selectedPostSendOption && /* @__PURE__ */ jsx19(
12446
13404
  "span",
12447
13405
  {
12448
13406
  className: `text-[9px] font-medium px-1.5 py-0.5 rounded border ${selectedPostSendOption.targetType === "SUBTABLE" ? "bg-emerald-50 text-emerald-700 border-emerald-200" : "bg-slate-100 text-slate-600 border-slate-200"}`,
@@ -12450,8 +13408,8 @@ function SettingsAndActionsBlock({
12450
13408
  }
12451
13409
  )
12452
13410
  ] }),
12453
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12454
- /* @__PURE__ */ jsxs16(
13411
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13412
+ /* @__PURE__ */ jsxs18(
12455
13413
  "select",
12456
13414
  {
12457
13415
  value: postSendActionColumn,
@@ -12464,35 +13422,35 @@ function SettingsAndActionsBlock({
12464
13422
  },
12465
13423
  className: "w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border border-slate-200 bg-white text-slate-700 appearance-none focus:border-emerald-500 cursor-pointer truncate",
12466
13424
  children: [
12467
- /* @__PURE__ */ jsx17("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
12468
- postSendActionTargetOptions.map((opt) => /* @__PURE__ */ jsx17("option", { value: opt.id, children: opt.label }, opt.id))
13425
+ /* @__PURE__ */ jsx19("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
13426
+ postSendActionTargetOptions.map((opt) => /* @__PURE__ */ jsx19("option", { value: opt.id, children: opt.label }, opt.id))
12469
13427
  ]
12470
13428
  }
12471
13429
  ),
12472
- /* @__PURE__ */ jsx17(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
13430
+ /* @__PURE__ */ jsx19(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
12473
13431
  ] })
12474
13432
  ] }),
12475
- selectedPostSendOption && /* @__PURE__ */ jsxs16("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
12476
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12477
- /* @__PURE__ */ jsx17("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05E8\u05DA \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
12478
- !postSendActionValue && /* @__PURE__ */ jsx17("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D1\u05D7\u05D5\u05E8 \u05E2\u05E8\u05DA" })
13433
+ selectedPostSendOption && /* @__PURE__ */ jsxs18("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
13434
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13435
+ /* @__PURE__ */ jsx19("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05E8\u05DA \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
13436
+ !postSendActionValue && /* @__PURE__ */ jsx19("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D1\u05D7\u05D5\u05E8 \u05E2\u05E8\u05DA" })
12479
13437
  ] }),
12480
- /* @__PURE__ */ jsxs16("div", { className: "relative", children: [
12481
- /* @__PURE__ */ jsxs16(
13438
+ /* @__PURE__ */ jsxs18("div", { className: "relative", children: [
13439
+ /* @__PURE__ */ jsxs18(
12482
13440
  "select",
12483
13441
  {
12484
13442
  value: postSendActionValue,
12485
13443
  onChange: (e) => setPostSendActionValue(e.target.value),
12486
13444
  className: `w-full h-7 px-2 pr-2 pl-5 text-[11px] rounded-lg border appearance-none cursor-pointer truncate transition-colors ${!postSendActionValue ? "border-amber-400 bg-amber-50/30 text-slate-700 focus:border-amber-500 focus:ring-1 focus:ring-amber-500" : "border-slate-200 bg-white text-slate-700 focus:border-emerald-500"}`,
12487
13445
  children: [
12488
- /* @__PURE__ */ jsx17("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." }),
12489
- selectedPostSendOption.type === "BOOLEAN" ? /* @__PURE__ */ jsxs16(Fragment6, { children: [
12490
- /* @__PURE__ */ jsx17("option", { value: "true", children: "\u05DB\u05DF (Yes)" }),
12491
- /* @__PURE__ */ jsx17("option", { value: "false", children: "\u05DC\u05D0 (No)" })
13446
+ /* @__PURE__ */ jsx19("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." }),
13447
+ selectedPostSendOption.type === "BOOLEAN" ? /* @__PURE__ */ jsxs18(Fragment7, { children: [
13448
+ /* @__PURE__ */ jsx19("option", { value: "true", children: "\u05DB\u05DF (Yes)" }),
13449
+ /* @__PURE__ */ jsx19("option", { value: "false", children: "\u05DC\u05D0 (No)" })
12492
13450
  ] }) : getRelationOptionsForCol(
12493
13451
  selectedPostSendOption.columnName,
12494
13452
  selectedPostSendOption.parentColumnName
12495
- ).map((opt) => /* @__PURE__ */ jsx17("option", { value: opt.id, children: getRelationOptionLabel(
13453
+ ).map((opt) => /* @__PURE__ */ jsx19("option", { value: opt.id, children: getRelationOptionLabel(
12496
13454
  opt,
12497
13455
  selectedPostSendOption,
12498
13456
  relationOptions
@@ -12500,15 +13458,15 @@ function SettingsAndActionsBlock({
12500
13458
  ]
12501
13459
  }
12502
13460
  ),
12503
- /* @__PURE__ */ jsx17(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
13461
+ /* @__PURE__ */ jsx19(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
12504
13462
  ] })
12505
13463
  ] })
12506
13464
  ] }) })
12507
13465
  ] })
12508
13466
  ] })
12509
13467
  ] }),
12510
- /* @__PURE__ */ jsxs16("div", { className: "mt-auto pt-2.5 border-t border-slate-200/80 space-y-2 shrink-0", children: [
12511
- /* @__PURE__ */ jsxs16(
13468
+ /* @__PURE__ */ jsxs18("div", { className: "mt-auto pt-2.5 border-t border-slate-200/80 space-y-2 shrink-0", children: [
13469
+ /* @__PURE__ */ jsxs18(
12512
13470
  "button",
12513
13471
  {
12514
13472
  type: "button",
@@ -12517,23 +13475,23 @@ function SettingsAndActionsBlock({
12517
13475
  className: `w-full h-8 px-3 text-xs font-semibold rounded-xl border transition-all flex items-center justify-center gap-1.5 ${isTestDisabled || isSendingBroadcast ? "bg-slate-100 text-slate-400 border-slate-200 cursor-not-allowed opacity-60" : "bg-white hover:bg-slate-50 text-slate-700 border-slate-200 active:scale-[0.98] cursor-pointer shadow-2xs"}`,
12518
13476
  title: testButtonTitle,
12519
13477
  children: [
12520
- /* @__PURE__ */ jsx17(Phone3, { className: "w-3 h-3" }),
12521
- /* @__PURE__ */ jsx17("span", { children: "\u05E9\u05DC\u05D7 \u05D8\u05E1\u05D8" })
13478
+ /* @__PURE__ */ jsx19(Phone3, { className: "w-3 h-3" }),
13479
+ /* @__PURE__ */ jsx19("span", { children: "\u05E9\u05DC\u05D7 \u05D8\u05E1\u05D8" })
12522
13480
  ]
12523
13481
  }
12524
13482
  ),
12525
- isSendingBroadcast ? /* @__PURE__ */ jsxs16(
13483
+ isSendingBroadcast ? /* @__PURE__ */ jsxs18(
12526
13484
  "div",
12527
13485
  {
12528
13486
  className: "w-full bg-white border border-emerald-200 rounded-xl p-2.5 shadow-xs space-y-2 animate-in fade-in duration-200",
12529
13487
  "data-testid": "live-broadcast-progress",
12530
13488
  children: [
12531
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-700", children: [
12532
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 text-emerald-800 font-bold", children: [
12533
- /* @__PURE__ */ jsx17(Loader26, { className: "w-3.5 h-3.5 animate-spin text-emerald-600 shrink-0" }),
12534
- /* @__PURE__ */ jsx17("span", { children: "\u05E9\u05D5\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05EA\u05E4\u05D5\u05E6\u05D4..." })
13489
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-700", children: [
13490
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 text-emerald-800 font-bold", children: [
13491
+ /* @__PURE__ */ jsx19(Loader26, { className: "w-3.5 h-3.5 animate-spin text-emerald-600 shrink-0" }),
13492
+ /* @__PURE__ */ jsx19("span", { children: "\u05E9\u05D5\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05EA\u05E4\u05D5\u05E6\u05D4..." })
12535
13493
  ] }),
12536
- /* @__PURE__ */ jsxs16("span", { className: "text-emerald-700 font-bold", children: [
13494
+ /* @__PURE__ */ jsxs18("span", { className: "text-emerald-700 font-bold", children: [
12537
13495
  (broadcastProgress == null ? void 0 : broadcastProgress.percent) || 0,
12538
13496
  "% (",
12539
13497
  (broadcastProgress == null ? void 0 : broadcastProgress.current) || 0,
@@ -12542,7 +13500,7 @@ function SettingsAndActionsBlock({
12542
13500
  ")"
12543
13501
  ] })
12544
13502
  ] }),
12545
- /* @__PURE__ */ jsx17("div", { className: "w-full h-2.5 bg-slate-100 rounded-full overflow-hidden border border-slate-200", children: /* @__PURE__ */ jsx17(
13503
+ /* @__PURE__ */ jsx19("div", { className: "w-full h-2.5 bg-slate-100 rounded-full overflow-hidden border border-slate-200", children: /* @__PURE__ */ jsx19(
12546
13504
  "div",
12547
13505
  {
12548
13506
  className: "h-full bg-emerald-500 rounded-full transition-all duration-300 ease-out",
@@ -12551,18 +13509,18 @@ function SettingsAndActionsBlock({
12551
13509
  }
12552
13510
  }
12553
13511
  ) }),
12554
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-around pt-1 text-[11px] font-medium border-t border-slate-100", children: [
12555
- /* @__PURE__ */ jsxs16("span", { className: "text-emerald-700 flex items-center gap-1", title: "\u05E0\u05E9\u05DC\u05D7\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4", children: [
12556
- /* @__PURE__ */ jsx17("span", { children: "\u2705" }),
12557
- /* @__PURE__ */ jsx17("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.successful) || 0 })
13512
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-around pt-1 text-[11px] font-medium border-t border-slate-100", children: [
13513
+ /* @__PURE__ */ jsxs18("span", { className: "text-emerald-700 flex items-center gap-1", title: "\u05E0\u05E9\u05DC\u05D7\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4", children: [
13514
+ /* @__PURE__ */ jsx19("span", { children: "\u2705" }),
13515
+ /* @__PURE__ */ jsx19("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.successful) || 0 })
12558
13516
  ] }),
12559
- /* @__PURE__ */ jsxs16("span", { className: "text-rose-600 flex items-center gap-1", title: "\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4", children: [
12560
- /* @__PURE__ */ jsx17("span", { children: "\u274C" }),
12561
- /* @__PURE__ */ jsx17("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.failed) || 0 })
13517
+ /* @__PURE__ */ jsxs18("span", { className: "text-rose-600 flex items-center gap-1", title: "\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4", children: [
13518
+ /* @__PURE__ */ jsx19("span", { children: "\u274C" }),
13519
+ /* @__PURE__ */ jsx19("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.failed) || 0 })
12562
13520
  ] }),
12563
- /* @__PURE__ */ jsxs16("span", { className: "text-amber-700 flex items-center gap-1", title: "\u05E9\u05D5\u05E8\u05D5\u05EA \u05E9\u05D3\u05D5\u05DC\u05D2\u05D5 \u05DC\u05DC\u05D0 \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF", children: [
12564
- /* @__PURE__ */ jsx17("span", { children: "\u26A0\uFE0F" }),
12565
- /* @__PURE__ */ jsxs16("span", { className: "font-bold", children: [
13521
+ /* @__PURE__ */ jsxs18("span", { className: "text-amber-700 flex items-center gap-1", title: "\u05E9\u05D5\u05E8\u05D5\u05EA \u05E9\u05D3\u05D5\u05DC\u05D2\u05D5 \u05DC\u05DC\u05D0 \u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05EA\u05E7\u05D9\u05DF", children: [
13522
+ /* @__PURE__ */ jsx19("span", { children: "\u26A0\uFE0F" }),
13523
+ /* @__PURE__ */ jsxs18("span", { className: "font-bold", children: [
12566
13524
  (broadcastProgress == null ? void 0 : broadcastProgress.skipped) || 0,
12567
13525
  " \u05DC\u05DC\u05D0 \u05D8\u05DC\u05E4\u05D5\u05DF"
12568
13526
  ] })
@@ -12570,8 +13528,8 @@ function SettingsAndActionsBlock({
12570
13528
  ] })
12571
13529
  ]
12572
13530
  }
12573
- ) : /* @__PURE__ */ jsxs16(Fragment6, { children: [
12574
- /* @__PURE__ */ jsxs16(
13531
+ ) : /* @__PURE__ */ jsxs18(Fragment7, { children: [
13532
+ /* @__PURE__ */ jsxs18(
12575
13533
  "button",
12576
13534
  {
12577
13535
  type: "button",
@@ -12580,56 +13538,56 @@ function SettingsAndActionsBlock({
12580
13538
  className: `w-full h-9 px-3 text-xs font-bold rounded-xl shadow-xs transition-all flex items-center justify-center gap-2 ${isSendDisabled ? "bg-emerald-600/40 text-white/70 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-700 active:scale-[0.98] text-white cursor-pointer"}`,
12581
13539
  title: sendButtonTitle,
12582
13540
  children: [
12583
- /* @__PURE__ */ jsx17(Send, { className: "w-3.5 h-3.5" }),
12584
- /* @__PURE__ */ jsx17("span", { children: finalRecipientCount > 0 ? `\u05E9\u05DC\u05D7 \u05DC-${finalRecipientCount} \u05E0\u05DE\u05E2\u05E0\u05D9\u05DD` : "\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" })
13541
+ /* @__PURE__ */ jsx19(Send, { className: "w-3.5 h-3.5" }),
13542
+ /* @__PURE__ */ jsx19("span", { children: finalRecipientCount > 0 ? `\u05E9\u05DC\u05D7 \u05DC-${finalRecipientCount} \u05E0\u05DE\u05E2\u05E0\u05D9\u05DD` : "\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" })
12585
13543
  ]
12586
13544
  }
12587
13545
  ),
12588
- validMainRowsCount > 0 && /* @__PURE__ */ jsxs16("div", { className: "text-center text-[10.5px] text-slate-500 font-medium pt-0.5", children: [
13546
+ validMainRowsCount > 0 && /* @__PURE__ */ jsxs18("div", { className: "text-center text-[10.5px] text-slate-500 font-medium pt-0.5", children: [
12589
13547
  "\u05DE\u05EA\u05D5\u05DA ",
12590
13548
  validMainRowsCount,
12591
13549
  " \u05E9\u05D5\u05E8\u05D5\u05EA \u05E8\u05D0\u05E9\u05D9\u05D5\u05EA"
12592
13550
  ] }),
12593
- broadcastSummary && /* @__PURE__ */ jsxs16(
13551
+ broadcastSummary && /* @__PURE__ */ jsxs18(
12594
13552
  "div",
12595
13553
  {
12596
13554
  className: "w-full bg-slate-50/90 border border-slate-200/90 rounded-xl p-2.5 shadow-2xs space-y-2 animate-in fade-in duration-200",
12597
13555
  "data-testid": "broadcast-summary-card",
12598
13556
  children: [
12599
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center justify-between", children: [
12600
- /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1.5 text-[11px] font-bold text-slate-700", children: [
12601
- /* @__PURE__ */ jsx17("span", { className: "text-xs", children: "\u{1F4CA}" }),
12602
- /* @__PURE__ */ jsx17("span", { children: "\u05E1\u05D9\u05DB\u05D5\u05DD \u05E9\u05D9\u05D3\u05D5\u05E8 \u05D0\u05D7\u05E8\u05D5\u05DF" })
13557
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
13558
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 text-[11px] font-bold text-slate-700", children: [
13559
+ /* @__PURE__ */ jsx19("span", { className: "text-xs", children: "\u{1F4CA}" }),
13560
+ /* @__PURE__ */ jsx19("span", { children: "\u05E1\u05D9\u05DB\u05D5\u05DD \u05E9\u05D9\u05D3\u05D5\u05E8 \u05D0\u05D7\u05E8\u05D5\u05DF" })
12603
13561
  ] }),
12604
- clearBroadcastSummary && /* @__PURE__ */ jsx17(
13562
+ clearBroadcastSummary && /* @__PURE__ */ jsx19(
12605
13563
  "button",
12606
13564
  {
12607
13565
  type: "button",
12608
13566
  onClick: clearBroadcastSummary,
12609
13567
  className: "text-slate-400 hover:text-slate-600 p-0.5 rounded-md hover:bg-slate-200/60 transition-colors cursor-pointer",
12610
13568
  title: "\u05E1\u05D2\u05D5\u05E8 \u05E1\u05D9\u05DB\u05D5\u05DD",
12611
- children: /* @__PURE__ */ jsx17(X11, { className: "w-3.5 h-3.5" })
13569
+ children: /* @__PURE__ */ jsx19(X11, { className: "w-3.5 h-3.5" })
12612
13570
  }
12613
13571
  )
12614
13572
  ] }),
12615
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-1.5 pt-0.5", children: [
12616
- /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/80", children: [
12617
- /* @__PURE__ */ jsx17("span", { children: "\u2705" }),
12618
- /* @__PURE__ */ jsxs16("span", { children: [
13573
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-1.5 pt-0.5", children: [
13574
+ /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-emerald-50 text-emerald-700 border border-emerald-200/80", children: [
13575
+ /* @__PURE__ */ jsx19("span", { children: "\u2705" }),
13576
+ /* @__PURE__ */ jsxs18("span", { children: [
12619
13577
  broadcastSummary.successful,
12620
13578
  " \u05E0\u05E9\u05DC\u05D7\u05D5"
12621
13579
  ] })
12622
13580
  ] }),
12623
- broadcastSummary.failed > 0 && /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-rose-50 text-rose-700 border border-rose-200/80", children: [
12624
- /* @__PURE__ */ jsx17("span", { children: "\u274C" }),
12625
- /* @__PURE__ */ jsxs16("span", { children: [
13581
+ broadcastSummary.failed > 0 && /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-rose-50 text-rose-700 border border-rose-200/80", children: [
13582
+ /* @__PURE__ */ jsx19("span", { children: "\u274C" }),
13583
+ /* @__PURE__ */ jsxs18("span", { children: [
12626
13584
  broadcastSummary.failed,
12627
13585
  " \u05E0\u05DB\u05E9\u05DC\u05D5"
12628
13586
  ] })
12629
13587
  ] }),
12630
- broadcastSummary.skipped > 0 && /* @__PURE__ */ jsxs16("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-amber-50 text-amber-700 border border-amber-200/80", children: [
12631
- /* @__PURE__ */ jsx17("span", { children: "\u26A0\uFE0F" }),
12632
- /* @__PURE__ */ jsxs16("span", { children: [
13588
+ broadcastSummary.skipped > 0 && /* @__PURE__ */ jsxs18("span", { className: "inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10.5px] font-semibold bg-amber-50 text-amber-700 border border-amber-200/80", children: [
13589
+ /* @__PURE__ */ jsx19("span", { children: "\u26A0\uFE0F" }),
13590
+ /* @__PURE__ */ jsxs18("span", { children: [
12633
13591
  broadcastSummary.skipped,
12634
13592
  " \u05DC\u05DC\u05D0 \u05D8\u05DC\u05E4\u05D5\u05DF"
12635
13593
  ] })
@@ -12644,48 +13602,48 @@ function SettingsAndActionsBlock({
12644
13602
  }
12645
13603
 
12646
13604
  // src/components/WhatsAppComponent/WhatsAppComponent.tsx
12647
- import { Fragment as Fragment7, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
13605
+ import { Fragment as Fragment8, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
12648
13606
  function WhatsAppComponent(props) {
12649
13607
  var _a;
12650
13608
  const { className = "", settings, orgId, componentId, executeAction } = props;
12651
13609
  const state = useWhatsAppState(props);
12652
- return /* @__PURE__ */ jsxs17(
13610
+ return /* @__PURE__ */ jsxs19(
12653
13611
  "div",
12654
13612
  {
12655
13613
  className: `w-full flex flex-col bg-white border border-slate-200 rounded-2xl shadow-xs overflow-hidden ${className}`,
12656
13614
  "data-testid": "whatsapp-component",
12657
13615
  dir: "rtl",
12658
13616
  children: [
12659
- state.feedback && /* @__PURE__ */ jsxs17(
13617
+ state.feedback && /* @__PURE__ */ jsxs19(
12660
13618
  "div",
12661
13619
  {
12662
13620
  className: `px-6 py-3 border-b text-xs flex items-center justify-between gap-3 ${state.feedback.type === "success" ? "bg-emerald-50 border-emerald-200 text-emerald-800" : "bg-rose-50 border-rose-200 text-rose-800"}`,
12663
13621
  children: [
12664
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
12665
- state.feedback.type === "success" ? /* @__PURE__ */ jsx18(CheckCircle24, { className: "w-4 h-4 text-emerald-600 shrink-0" }) : /* @__PURE__ */ jsx18(AlertCircle5, { className: "w-4 h-4 text-rose-600 shrink-0" }),
12666
- /* @__PURE__ */ jsx18("span", { children: state.feedback.message })
13622
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
13623
+ state.feedback.type === "success" ? /* @__PURE__ */ jsx20(CheckCircle24, { className: "w-4 h-4 text-emerald-600 shrink-0" }) : /* @__PURE__ */ jsx20(AlertCircle5, { className: "w-4 h-4 text-rose-600 shrink-0" }),
13624
+ /* @__PURE__ */ jsx20("span", { children: state.feedback.message })
12667
13625
  ] }),
12668
- /* @__PURE__ */ jsx18(
13626
+ /* @__PURE__ */ jsx20(
12669
13627
  "button",
12670
13628
  {
12671
13629
  type: "button",
12672
13630
  onClick: () => state.setFeedback(null),
12673
13631
  className: "text-slate-400 hover:text-slate-700 cursor-pointer",
12674
- children: /* @__PURE__ */ jsx18(X12, { className: "w-4 h-4" })
13632
+ children: /* @__PURE__ */ jsx20(X12, { className: "w-4 h-4" })
12675
13633
  }
12676
13634
  )
12677
13635
  ]
12678
13636
  }
12679
13637
  ),
12680
- state.fetchError && !state.isLoadingTemplates && /* @__PURE__ */ jsxs17("div", { className: "px-6 py-3 bg-amber-50 border-b border-amber-200 text-xs text-amber-900 flex items-center justify-between", children: [
12681
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2", children: [
12682
- /* @__PURE__ */ jsx18(AlertCircle5, { className: "w-4 h-4 text-amber-600 shrink-0" }),
12683
- /* @__PURE__ */ jsxs17("span", { children: [
13638
+ state.fetchError && !state.isLoadingTemplates && /* @__PURE__ */ jsxs19("div", { className: "px-6 py-3 bg-amber-50 border-b border-amber-200 text-xs text-amber-900 flex items-center justify-between", children: [
13639
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
13640
+ /* @__PURE__ */ jsx20(AlertCircle5, { className: "w-4 h-4 text-amber-600 shrink-0" }),
13641
+ /* @__PURE__ */ jsxs19("span", { children: [
12684
13642
  "\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05D8\u05E2\u05D9\u05E0\u05EA \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA \u05DE-Meta: ",
12685
13643
  state.fetchError
12686
13644
  ] })
12687
13645
  ] }),
12688
- /* @__PURE__ */ jsx18(
13646
+ /* @__PURE__ */ jsx20(
12689
13647
  "button",
12690
13648
  {
12691
13649
  type: "button",
@@ -12695,9 +13653,9 @@ function WhatsAppComponent(props) {
12695
13653
  }
12696
13654
  )
12697
13655
  ] }),
12698
- /* @__PURE__ */ jsxs17("div", { className: "p-4 flex flex-col gap-4", children: [
12699
- /* @__PURE__ */ jsxs17("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-4 shrink-0 items-stretch", children: [
12700
- /* @__PURE__ */ jsx18(
13656
+ /* @__PURE__ */ jsxs19("div", { className: "p-4 flex flex-col gap-4", children: [
13657
+ /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-4 shrink-0 items-stretch", children: [
13658
+ /* @__PURE__ */ jsx20(
12701
13659
  TemplateSelectionBlock,
12702
13660
  {
12703
13661
  selectedTemplate: state.selectedTemplate,
@@ -12725,7 +13683,7 @@ function WhatsAppComponent(props) {
12725
13683
  handleFileUpload: state.handleFileUpload
12726
13684
  }
12727
13685
  ),
12728
- /* @__PURE__ */ jsx18(
13686
+ /* @__PURE__ */ jsx20(
12729
13687
  DynamicFiltersBlock,
12730
13688
  {
12731
13689
  filterableColumns: state.filterableColumns,
@@ -12742,7 +13700,7 @@ function WhatsAppComponent(props) {
12742
13700
  isLoadingTableData: state.isLoadingTableData
12743
13701
  }
12744
13702
  ),
12745
- /* @__PURE__ */ jsx18(
13703
+ /* @__PURE__ */ jsx20(
12746
13704
  SettingsAndActionsBlock,
12747
13705
  {
12748
13706
  isScanningPhoneColumns: state.isScanningPhoneColumns,
@@ -12788,13 +13746,13 @@ function WhatsAppComponent(props) {
12788
13746
  }
12789
13747
  )
12790
13748
  ] }),
12791
- /* @__PURE__ */ jsx18("div", { className: "w-full h-[calc(100vh-420px)] min-h-[320px] overflow-hidden border border-slate-200 rounded-2xl shadow-xs bg-white flex flex-col", children: state.isLoadingTableData && state.rawRecords.length === 0 ? /* @__PURE__ */ jsxs17("div", { className: "flex-1 flex flex-col items-center justify-center p-12 text-center text-xs text-slate-400 gap-2", children: [
12792
- /* @__PURE__ */ jsx18(Loader27, { className: "w-6 h-6 animate-spin text-emerald-600" }),
12793
- /* @__PURE__ */ jsx18("span", { children: "\u05D8\u05D5\u05E2\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05D4\u05D8\u05D1\u05DC\u05D4..." })
12794
- ] }) : state.tableError ? /* @__PURE__ */ jsxs17("div", { className: "flex-1 flex items-center justify-center p-6 text-center text-xs text-rose-600 bg-rose-50 gap-2", children: [
12795
- /* @__PURE__ */ jsx18(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
12796
- /* @__PURE__ */ jsx18("span", { children: state.tableError })
12797
- ] }) : !(settings == null ? void 0 : settings.tableMetaId) ? /* @__PURE__ */ jsx18("div", { className: "flex-1 flex items-center justify-center p-10 text-center text-xs text-slate-400", children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 \u05E2\u05D1\u05D5\u05E8 \u05E8\u05DB\u05D9\u05D1 WhatsApp \u05D6\u05D4" }) : /* @__PURE__ */ jsx18(
13749
+ /* @__PURE__ */ jsx20("div", { className: "w-full h-[calc(100vh-420px)] min-h-[320px] overflow-hidden border border-slate-200 rounded-2xl shadow-xs bg-white flex flex-col", children: state.isLoadingTableData && state.rawRecords.length === 0 ? /* @__PURE__ */ jsxs19("div", { className: "flex-1 flex flex-col items-center justify-center p-12 text-center text-xs text-slate-400 gap-2", children: [
13750
+ /* @__PURE__ */ jsx20(Loader27, { className: "w-6 h-6 animate-spin text-emerald-600" }),
13751
+ /* @__PURE__ */ jsx20("span", { children: "\u05D8\u05D5\u05E2\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05D4\u05D8\u05D1\u05DC\u05D4..." })
13752
+ ] }) : state.tableError ? /* @__PURE__ */ jsxs19("div", { className: "flex-1 flex items-center justify-center p-6 text-center text-xs text-rose-600 bg-rose-50 gap-2", children: [
13753
+ /* @__PURE__ */ jsx20(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
13754
+ /* @__PURE__ */ jsx20("span", { children: state.tableError })
13755
+ ] }) : !(settings == null ? void 0 : settings.tableMetaId) ? /* @__PURE__ */ jsx20("div", { className: "flex-1 flex items-center justify-center p-10 text-center text-xs text-slate-400", children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05D8\u05D1\u05DC\u05EA \u05DE\u05E7\u05D5\u05E8 \u05E2\u05D1\u05D5\u05E8 \u05E8\u05DB\u05D9\u05D1 WhatsApp \u05D6\u05D4" }) : /* @__PURE__ */ jsx20(
12798
13756
  TableBlockClient,
12799
13757
  {
12800
13758
  settings: {
@@ -12816,7 +13774,7 @@ function WhatsAppComponent(props) {
12816
13774
  }
12817
13775
  ) })
12818
13776
  ] }),
12819
- /* @__PURE__ */ jsx18(
13777
+ /* @__PURE__ */ jsx20(
12820
13778
  CreateTemplateModal,
12821
13779
  {
12822
13780
  isOpen: state.isModalOpen,
@@ -12830,7 +13788,7 @@ function WhatsAppComponent(props) {
12830
13788
  orgId: state.orgId || orgId
12831
13789
  }
12832
13790
  ),
12833
- state.isTestPromptOpen && /* @__PURE__ */ jsx18(
13791
+ state.isTestPromptOpen && /* @__PURE__ */ jsx20(
12834
13792
  "div",
12835
13793
  {
12836
13794
  className: "fixed inset-0 bg-slate-900/60 backdrop-blur-xs z-50 flex items-center justify-center p-4 overflow-y-auto animate-in fade-in duration-150",
@@ -12839,7 +13797,7 @@ function WhatsAppComponent(props) {
12839
13797
  state.setIsTestPromptOpen(false);
12840
13798
  state.setTestFeedback(null);
12841
13799
  },
12842
- children: /* @__PURE__ */ jsxs17(
13800
+ children: /* @__PURE__ */ jsxs19(
12843
13801
  "div",
12844
13802
  {
12845
13803
  className: "bg-white rounded-2xl border border-slate-200 shadow-2xl w-full max-w-md flex flex-col overflow-hidden animate-in zoom-in-95 duration-150",
@@ -12848,15 +13806,15 @@ function WhatsAppComponent(props) {
12848
13806
  "aria-labelledby": "test-modal-title",
12849
13807
  onClick: (e) => e.stopPropagation(),
12850
13808
  children: [
12851
- /* @__PURE__ */ jsxs17("div", { className: "px-5 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
12852
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center gap-2.5", children: [
12853
- /* @__PURE__ */ jsx18("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx18(Phone4, { className: "w-4 h-4" }) }),
12854
- /* @__PURE__ */ jsxs17("div", { children: [
12855
- /* @__PURE__ */ jsx18("h3", { id: "test-modal-title", className: "text-sm font-bold text-slate-900", children: "\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05D5\u05D3\u05E2\u05EA \u05D1\u05D3\u05D9\u05E7\u05D4 (\u05D8\u05E1\u05D8)" }),
12856
- /* @__PURE__ */ jsx18("p", { className: "text-[11px] text-slate-500", children: "\u05D1\u05D3\u05D9\u05E7\u05EA \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA \u05DE\u05D5\u05DC \u05E0\u05DE\u05E2\u05DF \u05D1\u05D5\u05D3\u05D3 \u05DC\u05E4\u05E0\u05D9 \u05E9\u05D9\u05D3\u05D5\u05E8 \u05E8\u05D7\u05D1" })
13809
+ /* @__PURE__ */ jsxs19("div", { className: "px-5 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
13810
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2.5", children: [
13811
+ /* @__PURE__ */ jsx20("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx20(Phone4, { className: "w-4 h-4" }) }),
13812
+ /* @__PURE__ */ jsxs19("div", { children: [
13813
+ /* @__PURE__ */ jsx20("h3", { id: "test-modal-title", className: "text-sm font-bold text-slate-900", children: "\u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05D5\u05D3\u05E2\u05EA \u05D1\u05D3\u05D9\u05E7\u05D4 (\u05D8\u05E1\u05D8)" }),
13814
+ /* @__PURE__ */ jsx20("p", { className: "text-[11px] text-slate-500", children: "\u05D1\u05D3\u05D9\u05E7\u05EA \u05D4\u05EA\u05D1\u05E0\u05D9\u05EA \u05DE\u05D5\u05DC \u05E0\u05DE\u05E2\u05DF \u05D1\u05D5\u05D3\u05D3 \u05DC\u05E4\u05E0\u05D9 \u05E9\u05D9\u05D3\u05D5\u05E8 \u05E8\u05D7\u05D1" })
12857
13815
  ] })
12858
13816
  ] }),
12859
- /* @__PURE__ */ jsx18(
13817
+ /* @__PURE__ */ jsx20(
12860
13818
  "button",
12861
13819
  {
12862
13820
  type: "button",
@@ -12868,25 +13826,25 @@ function WhatsAppComponent(props) {
12868
13826
  },
12869
13827
  className: `w-8 h-8 rounded-lg flex items-center justify-center transition-colors ${state.isSendingTest ? "text-slate-300 cursor-not-allowed" : "text-slate-400 hover:text-slate-700 hover:bg-slate-200/50 cursor-pointer"}`,
12870
13828
  title: "\u05E1\u05D2\u05D5\u05E8",
12871
- children: /* @__PURE__ */ jsx18(X12, { className: "w-4 h-4" })
13829
+ children: /* @__PURE__ */ jsx20(X12, { className: "w-4 h-4" })
12872
13830
  }
12873
13831
  )
12874
13832
  ] }),
12875
- /* @__PURE__ */ jsxs17("div", { className: "p-5 space-y-4", children: [
12876
- /* @__PURE__ */ jsxs17("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
12877
- /* @__PURE__ */ jsx18("span", { className: "text-slate-500 font-medium", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05E0\u05D1\u05D7\u05E8\u05EA:" }),
12878
- /* @__PURE__ */ jsx18("span", { className: "font-bold text-slate-800 font-mono", children: ((_a = state.selectedTemplate) == null ? void 0 : _a.name) || "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" })
13833
+ /* @__PURE__ */ jsxs19("div", { className: "p-5 space-y-4", children: [
13834
+ /* @__PURE__ */ jsxs19("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
13835
+ /* @__PURE__ */ jsx20("span", { className: "text-slate-500 font-medium", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05E0\u05D1\u05D7\u05E8\u05EA:" }),
13836
+ /* @__PURE__ */ jsx20("span", { className: "font-bold text-slate-800 font-mono", children: ((_a = state.selectedTemplate) == null ? void 0 : _a.name) || "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" })
12879
13837
  ] }),
12880
- state.selectedPhoneOption && /* @__PURE__ */ jsxs17("div", { className: "p-2 bg-emerald-50/50 border border-emerald-200/60 rounded-xl flex items-center justify-between text-[11px]", children: [
12881
- /* @__PURE__ */ jsx18("span", { className: "text-emerald-800 font-medium", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3:" }),
12882
- /* @__PURE__ */ jsx18("span", { className: "font-bold text-emerald-950 font-mono", children: state.selectedPhoneOption.label })
13838
+ state.selectedPhoneOption && /* @__PURE__ */ jsxs19("div", { className: "p-2 bg-emerald-50/50 border border-emerald-200/60 rounded-xl flex items-center justify-between text-[11px]", children: [
13839
+ /* @__PURE__ */ jsx20("span", { className: "text-emerald-800 font-medium", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3:" }),
13840
+ /* @__PURE__ */ jsx20("span", { className: "font-bold text-emerald-950 font-mono", children: state.selectedPhoneOption.label })
12883
13841
  ] }),
12884
13842
  state.templateHeaderComp && (() => {
12885
13843
  const headerFormat = (state.templateHeaderComp.format || "").toUpperCase();
12886
13844
  const docFilename = resolveDocumentFilename(state.templateHeaderComp, state.headerMediaUrl);
12887
- return /* @__PURE__ */ jsxs17("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
12888
- /* @__PURE__ */ jsx18("div", { className: "flex items-center gap-2 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs17(Fragment7, { children: [
12889
- /* @__PURE__ */ jsx18("div", { className: "w-7 h-7 rounded-md overflow-hidden border border-slate-200 shrink-0 bg-slate-100 flex items-center justify-center", children: state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx18(
13845
+ return /* @__PURE__ */ jsxs19("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
13846
+ /* @__PURE__ */ jsx20("div", { className: "flex items-center gap-2 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
13847
+ /* @__PURE__ */ jsx20("div", { className: "w-7 h-7 rounded-md overflow-hidden border border-slate-200 shrink-0 bg-slate-100 flex items-center justify-center", children: state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx20(
12890
13848
  "img",
12891
13849
  {
12892
13850
  src: state.headerMediaUrl,
@@ -12896,28 +13854,28 @@ function WhatsAppComponent(props) {
12896
13854
  e.currentTarget.style.display = "none";
12897
13855
  }
12898
13856
  }
12899
- ) : /* @__PURE__ */ jsx18(ImageIcon3, { className: "w-3.5 h-3.5 text-emerald-600" }) }),
12900
- /* @__PURE__ */ jsx18("span", { className: "font-semibold text-slate-800 truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" })
12901
- ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs17(Fragment7, { children: [
12902
- /* @__PURE__ */ jsx18("div", { className: "w-7 h-7 rounded-md bg-rose-50 text-rose-600 border border-rose-100 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx18(FileText4, { className: "w-3.5 h-3.5" }) }),
12903
- /* @__PURE__ */ jsxs17("div", { className: "overflow-hidden", children: [
12904
- /* @__PURE__ */ jsx18("span", { className: "font-semibold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
12905
- /* @__PURE__ */ jsx18("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: docFilename, children: docFilename })
13857
+ ) : /* @__PURE__ */ jsx20(ImageIcon3, { className: "w-3.5 h-3.5 text-emerald-600" }) }),
13858
+ /* @__PURE__ */ jsx20("span", { className: "font-semibold text-slate-800 truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" })
13859
+ ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
13860
+ /* @__PURE__ */ jsx20("div", { className: "w-7 h-7 rounded-md bg-rose-50 text-rose-600 border border-rose-100 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx20(FileText4, { className: "w-3.5 h-3.5" }) }),
13861
+ /* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
13862
+ /* @__PURE__ */ jsx20("span", { className: "font-semibold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
13863
+ /* @__PURE__ */ jsx20("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: docFilename, children: docFilename })
12906
13864
  ] })
12907
- ] }) : /* @__PURE__ */ jsxs17(Fragment7, { children: [
12908
- /* @__PURE__ */ jsx18("div", { className: "w-7 h-7 rounded-md bg-indigo-50 text-indigo-600 border border-indigo-100 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx18(Video3, { className: "w-3.5 h-3.5" }) }),
12909
- /* @__PURE__ */ jsx18("span", { className: "font-semibold text-slate-800 truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" })
13865
+ ] }) : /* @__PURE__ */ jsxs19(Fragment8, { children: [
13866
+ /* @__PURE__ */ jsx20("div", { className: "w-7 h-7 rounded-md bg-indigo-50 text-indigo-600 border border-indigo-100 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx20(Video3, { className: "w-3.5 h-3.5" }) }),
13867
+ /* @__PURE__ */ jsx20("span", { className: "font-semibold text-slate-800 truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" })
12910
13868
  ] }) }),
12911
- state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx18("span", { className: "text-[10px] text-emerald-700 bg-emerald-50 border border-emerald-200 px-1.5 py-0.5 rounded font-medium shrink-0", children: "\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E6\u05D5\u05E8\u05E3 \u05EA\u05E7\u05D9\u05DF" }) : /* @__PURE__ */ jsx18("span", { className: "text-[10px] text-amber-700 bg-amber-50 border border-amber-200 px-1.5 py-0.5 rounded font-medium shrink-0", children: "\u05E0\u05D3\u05E8\u05E9 \u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5" })
13869
+ state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx20("span", { className: "text-[10px] text-emerald-700 bg-emerald-50 border border-emerald-200 px-1.5 py-0.5 rounded font-medium shrink-0", children: "\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E6\u05D5\u05E8\u05E3 \u05EA\u05E7\u05D9\u05DF" }) : /* @__PURE__ */ jsx20("span", { className: "text-[10px] text-amber-700 bg-amber-50 border border-amber-200 px-1.5 py-0.5 rounded font-medium shrink-0", children: "\u05E0\u05D3\u05E8\u05E9 \u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5" })
12912
13870
  ] });
12913
13871
  })(),
12914
- /* @__PURE__ */ jsxs17("div", { className: "space-y-1.5", children: [
12915
- /* @__PURE__ */ jsxs17("label", { className: "text-xs font-semibold text-slate-700 block", children: [
13872
+ /* @__PURE__ */ jsxs19("div", { className: "space-y-1.5", children: [
13873
+ /* @__PURE__ */ jsxs19("label", { className: "text-xs font-semibold text-slate-700 block", children: [
12916
13874
  "\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05DC\u05D8\u05E1\u05D8 ",
12917
- /* @__PURE__ */ jsx18("span", { className: "text-rose-500", children: "*" })
13875
+ /* @__PURE__ */ jsx20("span", { className: "text-rose-500", children: "*" })
12918
13876
  ] }),
12919
- /* @__PURE__ */ jsxs17("div", { className: "relative", children: [
12920
- /* @__PURE__ */ jsx18(
13877
+ /* @__PURE__ */ jsxs19("div", { className: "relative", children: [
13878
+ /* @__PURE__ */ jsx20(
12921
13879
  "input",
12922
13880
  {
12923
13881
  type: "tel",
@@ -12939,17 +13897,17 @@ function WhatsAppComponent(props) {
12939
13897
  className: "w-full h-10 px-3 pr-3 pl-8 text-sm rounded-xl border border-slate-200 bg-white text-slate-900 placeholder:text-slate-400 focus:outline-hidden focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500 transition-all font-mono disabled:opacity-60 disabled:cursor-not-allowed"
12940
13898
  }
12941
13899
  ),
12942
- /* @__PURE__ */ jsx18(Phone4, { className: "w-4 h-4 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
13900
+ /* @__PURE__ */ jsx20(Phone4, { className: "w-4 h-4 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
12943
13901
  ] }),
12944
- /* @__PURE__ */ jsx18("p", { className: "text-[11px] text-slate-500 leading-normal", children: "\u05D4\u05D5\u05D3\u05E2\u05EA \u05D4\u05D1\u05D3\u05D9\u05E7\u05D4 \u05EA\u05D9\u05E9\u05DC\u05D7 \u05D9\u05E9\u05D9\u05E8\u05D5\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D6\u05D4 \u05DC\u05E6\u05D5\u05E8\u05DA \u05D5\u05D9\u05D3\u05D5\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA \u05EA\u05D5\u05DB\u05DF \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05D4\u05E2\u05D9\u05E6\u05D5\u05D1." })
13902
+ /* @__PURE__ */ jsx20("p", { className: "text-[11px] text-slate-500 leading-normal", children: "\u05D4\u05D5\u05D3\u05E2\u05EA \u05D4\u05D1\u05D3\u05D9\u05E7\u05D4 \u05EA\u05D9\u05E9\u05DC\u05D7 \u05D9\u05E9\u05D9\u05E8\u05D5\u05EA \u05DC\u05DE\u05E1\u05E4\u05E8 \u05D6\u05D4 \u05DC\u05E6\u05D5\u05E8\u05DA \u05D5\u05D9\u05D3\u05D5\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D5\u05EA \u05EA\u05D5\u05DB\u05DF \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 \u05D5\u05D4\u05E2\u05D9\u05E6\u05D5\u05D1." })
12945
13903
  ] }),
12946
- state.testFeedback && /* @__PURE__ */ jsxs17("div", { className: "p-2.5 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-700 flex items-center gap-2", children: [
12947
- /* @__PURE__ */ jsx18(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
12948
- /* @__PURE__ */ jsx18("span", { children: state.testFeedback })
13904
+ state.testFeedback && /* @__PURE__ */ jsxs19("div", { className: "p-2.5 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-700 flex items-center gap-2", children: [
13905
+ /* @__PURE__ */ jsx20(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
13906
+ /* @__PURE__ */ jsx20("span", { children: state.testFeedback })
12949
13907
  ] })
12950
13908
  ] }),
12951
- /* @__PURE__ */ jsxs17("div", { className: "px-5 py-3.5 bg-slate-50/70 border-t border-slate-100 flex items-center justify-end gap-2", children: [
12952
- /* @__PURE__ */ jsx18(
13909
+ /* @__PURE__ */ jsxs19("div", { className: "px-5 py-3.5 bg-slate-50/70 border-t border-slate-100 flex items-center justify-end gap-2", children: [
13910
+ /* @__PURE__ */ jsx20(
12953
13911
  "button",
12954
13912
  {
12955
13913
  type: "button",
@@ -12963,7 +13921,7 @@ function WhatsAppComponent(props) {
12963
13921
  children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
12964
13922
  }
12965
13923
  ),
12966
- /* @__PURE__ */ jsx18(
13924
+ /* @__PURE__ */ jsx20(
12967
13925
  "button",
12968
13926
  {
12969
13927
  type: "button",
@@ -12971,12 +13929,12 @@ function WhatsAppComponent(props) {
12971
13929
  onClick: state.handleSendTest,
12972
13930
  title: state.testButtonTitle,
12973
13931
  className: `px-4 py-2 text-xs font-bold rounded-xl transition-all flex items-center gap-1.5 ${!state.testPhoneNumber.trim() || state.isSendingTest || state.isTestDisabled ? "bg-emerald-600/40 text-white/70 cursor-not-allowed" : "bg-emerald-600 hover:bg-emerald-700 active:scale-[0.98] text-white shadow-xs cursor-pointer"}`,
12974
- children: state.isSendingTest ? /* @__PURE__ */ jsxs17(Fragment7, { children: [
12975
- /* @__PURE__ */ jsx18(Loader27, { className: "w-3.5 h-3.5 animate-spin" }),
12976
- /* @__PURE__ */ jsx18("span", { children: "\u05E9\u05D5\u05DC\u05D7..." })
12977
- ] }) : /* @__PURE__ */ jsxs17(Fragment7, { children: [
12978
- /* @__PURE__ */ jsx18(Send2, { className: "w-3.5 h-3.5" }),
12979
- /* @__PURE__ */ jsx18("span", { children: "\u05E9\u05DC\u05D7 \u05E2\u05DB\u05E9\u05D9\u05D5" })
13932
+ children: state.isSendingTest ? /* @__PURE__ */ jsxs19(Fragment8, { children: [
13933
+ /* @__PURE__ */ jsx20(Loader27, { className: "w-3.5 h-3.5 animate-spin" }),
13934
+ /* @__PURE__ */ jsx20("span", { children: "\u05E9\u05D5\u05DC\u05D7..." })
13935
+ ] }) : /* @__PURE__ */ jsxs19(Fragment8, { children: [
13936
+ /* @__PURE__ */ jsx20(Send2, { className: "w-3.5 h-3.5" }),
13937
+ /* @__PURE__ */ jsx20("span", { children: "\u05E9\u05DC\u05D7 \u05E2\u05DB\u05E9\u05D9\u05D5" })
12980
13938
  ] })
12981
13939
  }
12982
13940
  )
@@ -12992,18 +13950,18 @@ function WhatsAppComponent(props) {
12992
13950
  }
12993
13951
 
12994
13952
  // src/components/FormBlock/FormBlock.tsx
12995
- import { useState as useState16, useEffect as useEffect14 } from "react";
13953
+ import { useState as useState17, useEffect as useEffect15 } from "react";
12996
13954
  import { Loader2 as Loader28, CheckCircle2 as CheckCircle25 } from "lucide-react";
12997
- import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
13955
+ import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
12998
13956
  function FormBlock({ settings: schema, executeAction, componentId, className = "", onSuccess }) {
12999
13957
  const { showError, addToast } = useToast();
13000
- const [formData, setFormData] = useState16({});
13001
- const [isSubmitting, setIsSubmitting] = useState16(false);
13002
- const [isSubmitted, setIsSubmitted] = useState16(false);
13003
- const [columns, setColumns] = useState16((schema == null ? void 0 : schema.columns) || []);
13004
- const [isLoadingSchema, setIsLoadingSchema] = useState16(false);
13958
+ const [formData, setFormData] = useState17({});
13959
+ const [isSubmitting, setIsSubmitting] = useState17(false);
13960
+ const [isSubmitted, setIsSubmitted] = useState17(false);
13961
+ const [columns, setColumns] = useState17((schema == null ? void 0 : schema.columns) || []);
13962
+ const [isLoadingSchema, setIsLoadingSchema] = useState17(false);
13005
13963
  const targetTableId = (schema == null ? void 0 : schema.tableMetaId) || (schema == null ? void 0 : schema.tableId) || (schema == null ? void 0 : schema.id);
13006
- useEffect14(() => {
13964
+ useEffect15(() => {
13007
13965
  let isMounted = true;
13008
13966
  if ((!(schema == null ? void 0 : schema.columns) || schema.columns.length === 0) && targetTableId && executeAction) {
13009
13967
  setIsLoadingSchema(true);
@@ -13085,21 +14043,21 @@ function FormBlock({ settings: schema, executeAction, componentId, className = "
13085
14043
  }
13086
14044
  };
13087
14045
  if (isLoadingSchema) {
13088
- return /* @__PURE__ */ jsxs18("div", { className: "p-8 flex items-center justify-center gap-2 text-slate-500", children: [
13089
- /* @__PURE__ */ jsx19(Loader28, { className: "w-5 h-5 animate-spin text-brand" }),
13090
- /* @__PURE__ */ jsx19("span", { className: "text-sm", children: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D3\u05D5\u05EA \u05D8\u05D5\u05E4\u05E1..." })
14046
+ return /* @__PURE__ */ jsxs20("div", { className: "p-8 flex items-center justify-center gap-2 text-slate-500", children: [
14047
+ /* @__PURE__ */ jsx21(Loader28, { className: "w-5 h-5 animate-spin text-brand" }),
14048
+ /* @__PURE__ */ jsx21("span", { className: "text-sm", children: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D3\u05D5\u05EA \u05D8\u05D5\u05E4\u05E1..." })
13091
14049
  ] });
13092
14050
  }
13093
14051
  if (!formColumns || formColumns.length === 0) {
13094
- return /* @__PURE__ */ jsx19("div", { className: "p-4 text-center text-slate-500", children: "\u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8\u05D5 \u05E9\u05D3\u05D5\u05EA \u05DC\u05D8\u05D5\u05E4\u05E1 \u05D6\u05D4." });
14052
+ return /* @__PURE__ */ jsx21("div", { className: "p-4 text-center text-slate-500", children: "\u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8\u05D5 \u05E9\u05D3\u05D5\u05EA \u05DC\u05D8\u05D5\u05E4\u05E1 \u05D6\u05D4." });
13095
14053
  }
13096
14054
  if (isSubmitted) {
13097
14055
  const customMessage = (schema == null ? void 0 : schema.successMessage) || "\u05EA\u05D5\u05D3\u05D4 \u05E8\u05D1\u05D4! \u05D4\u05E4\u05E8\u05D8\u05D9\u05DD \u05D4\u05EA\u05E7\u05D1\u05DC\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4.";
13098
- return /* @__PURE__ */ jsxs18("div", { id: componentId, className: `bg-white p-8 rounded-xl shadow-xs border border-slate-200 text-center dir-rtl ${className}`, children: [
13099
- /* @__PURE__ */ jsx19("div", { className: "w-16 h-16 bg-emerald-50 text-emerald-600 rounded-full flex items-center justify-center mx-auto mb-4 animate-in zoom-in duration-200", children: /* @__PURE__ */ jsx19(CheckCircle25, { className: "w-8 h-8" }) }),
13100
- /* @__PURE__ */ jsx19("h3", { className: "text-2xl font-bold text-slate-800 mb-2", children: "\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4" }),
13101
- /* @__PURE__ */ jsx19("p", { className: "text-slate-600 text-base max-w-md mx-auto whitespace-pre-wrap", children: customMessage }),
13102
- /* @__PURE__ */ jsx19(
14056
+ return /* @__PURE__ */ jsxs20("div", { id: componentId, className: `bg-white p-8 rounded-xl shadow-xs border border-slate-200 text-center dir-rtl ${className}`, children: [
14057
+ /* @__PURE__ */ jsx21("div", { className: "w-16 h-16 bg-emerald-50 text-emerald-600 rounded-full flex items-center justify-center mx-auto mb-4 animate-in zoom-in duration-200", children: /* @__PURE__ */ jsx21(CheckCircle25, { className: "w-8 h-8" }) }),
14058
+ /* @__PURE__ */ jsx21("h3", { className: "text-2xl font-bold text-slate-800 mb-2", children: "\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4" }),
14059
+ /* @__PURE__ */ jsx21("p", { className: "text-slate-600 text-base max-w-md mx-auto whitespace-pre-wrap", children: customMessage }),
14060
+ /* @__PURE__ */ jsx21(
13103
14061
  "button",
13104
14062
  {
13105
14063
  type: "button",
@@ -13110,20 +14068,20 @@ function FormBlock({ settings: schema, executeAction, componentId, className = "
13110
14068
  )
13111
14069
  ] });
13112
14070
  }
13113
- return /* @__PURE__ */ jsxs18("div", { id: componentId, className: `bg-white p-6 rounded-xl shadow-xs border border-slate-200 dir-rtl ${className}`, children: [
13114
- (schema == null ? void 0 : schema.title) && /* @__PURE__ */ jsx19("h2", { className: "text-xl font-bold text-slate-800 mb-6", children: schema.title }),
13115
- /* @__PURE__ */ jsxs18("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
14071
+ return /* @__PURE__ */ jsxs20("div", { id: componentId, className: `bg-white p-6 rounded-xl shadow-xs border border-slate-200 dir-rtl ${className}`, children: [
14072
+ (schema == null ? void 0 : schema.title) && /* @__PURE__ */ jsx21("h2", { className: "text-xl font-bold text-slate-800 mb-6", children: schema.title }),
14073
+ /* @__PURE__ */ jsxs20("form", { onSubmit: handleSubmit, className: "space-y-4", children: [
13116
14074
  formColumns.map((col) => {
13117
14075
  var _a, _b;
13118
14076
  const colType = ((_a = col.type) == null ? void 0 : _a.toUpperCase()) || "DEFAULT";
13119
14077
  const InputComponent = FORM_INPUTS[colType] || FORM_INPUTS.DEFAULT;
13120
- return /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1.5", children: [
13121
- /* @__PURE__ */ jsxs18("label", { className: "text-sm font-semibold text-slate-700", children: [
14078
+ return /* @__PURE__ */ jsxs20("div", { className: "flex flex-col gap-1.5", children: [
14079
+ /* @__PURE__ */ jsxs20("label", { className: "text-sm font-semibold text-slate-700", children: [
13122
14080
  col.name,
13123
14081
  " ",
13124
- col.isRequired && /* @__PURE__ */ jsx19("span", { className: "text-rose-500", children: "*" })
14082
+ col.isRequired && /* @__PURE__ */ jsx21("span", { className: "text-rose-500", children: "*" })
13125
14083
  ] }),
13126
- /* @__PURE__ */ jsx19("div", { className: "border border-slate-200 rounded-lg min-h-[40px] relative", children: /* @__PURE__ */ jsx19(
14084
+ /* @__PURE__ */ jsx21("div", { className: "border border-slate-200 rounded-lg min-h-[40px] relative", children: /* @__PURE__ */ jsx21(
13127
14085
  InputComponent,
13128
14086
  {
13129
14087
  column: col,
@@ -13138,15 +14096,15 @@ function FormBlock({ settings: schema, executeAction, componentId, className = "
13138
14096
  ) })
13139
14097
  ] }, col.name);
13140
14098
  }),
13141
- /* @__PURE__ */ jsx19("div", { className: "pt-4 border-t border-slate-100 flex justify-end", children: /* @__PURE__ */ jsxs18(
14099
+ /* @__PURE__ */ jsx21("div", { className: "pt-4 border-t border-slate-100 flex justify-end", children: /* @__PURE__ */ jsxs20(
13142
14100
  "button",
13143
14101
  {
13144
14102
  type: "submit",
13145
14103
  disabled: isSubmitting,
13146
14104
  className: "flex items-center gap-2 px-6 py.2.5 bg-brand hover:bg-brand-hover text-white font-bold rounded-lg shadow-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
13147
14105
  children: [
13148
- isSubmitting && /* @__PURE__ */ jsx19(Loader28, { className: "w-4 h-4 animate-spin" }),
13149
- /* @__PURE__ */ jsx19("span", { children: isSubmitting ? "\u05E9\u05D5\u05DE\u05E8..." : "\u05E9\u05DC\u05D9\u05D7\u05D4" })
14106
+ isSubmitting && /* @__PURE__ */ jsx21(Loader28, { className: "w-4 h-4 animate-spin" }),
14107
+ /* @__PURE__ */ jsx21("span", { children: isSubmitting ? "\u05E9\u05D5\u05DE\u05E8..." : "\u05E9\u05DC\u05D9\u05D7\u05D4" })
13150
14108
  ]
13151
14109
  }
13152
14110
  ) })
@@ -13158,7 +14116,8 @@ function FormBlock({ settings: schema, executeAction, componentId, className = "
13158
14116
  var UNIVERSE_COMPONENTS = {
13159
14117
  TABLE: TableBlock,
13160
14118
  WHATSAPP: WhatsAppComponent,
13161
- FORM: FormBlock
14119
+ FORM: FormBlock,
14120
+ PLACEMENT: PlacementBlock
13162
14121
  };
13163
14122
  export {
13164
14123
  COLUMN_CAPABILITIES,
@@ -13167,10 +14126,17 @@ export {
13167
14126
  COLUMN_TYPE_LABELS,
13168
14127
  ColumnHeaderTitle,
13169
14128
  CreateTemplateModal,
14129
+ DEFAULT_PLACEMENT_STATUS_COLORS,
13170
14130
  DatePickerCell,
13171
14131
  DynamicFiltersBlock,
13172
14132
  LinkPickerCell,
14133
+ NON_TEXT_TYPES,
13173
14134
  PASTEL_PALETTES,
14135
+ PlacementBlock,
14136
+ PlacementSettings,
14137
+ PlacementStatusEditor,
14138
+ RELATION_LABEL_KEY,
14139
+ RELATION_SEP,
13174
14140
  RelationFilterPopover,
13175
14141
  RelationPickerCell,
13176
14142
  SettingsAndActionsBlock,
@@ -13184,9 +14150,13 @@ export {
13184
14150
  TruncatedTooltip,
13185
14151
  UNIVERSE_COMPONENTS,
13186
14152
  WhatsAppComponent,
14153
+ buildColumnOptions,
14154
+ buildRelationRef,
13187
14155
  calculateMinColumnWidth,
13188
14156
  checkElementTruncation,
13189
14157
  cn,
14158
+ columnRefLabel,
14159
+ enrichRowsWithRelations,
13190
14160
  extractUniqueVariableIndices,
13191
14161
  extractVariableIndices,
13192
14162
  findVariableAtPosition,
@@ -13207,6 +14177,7 @@ export {
13207
14177
  isDuplicateTemplate,
13208
14178
  isDuplicateTemplateName,
13209
14179
  isTextRepresentable,
14180
+ isUserColumn,
13210
14181
  isValidButtonPhoneNumber,
13211
14182
  isValidButtonUrl,
13212
14183
  isValidPhoneNumber,
@@ -13216,14 +14187,18 @@ export {
13216
14187
  normalizePhoneForWhatsApp,
13217
14188
  normalizeRelationValue,
13218
14189
  openWhatsAppChat,
14190
+ parseColumnRef,
13219
14191
  parseLinkValue,
13220
14192
  parseTimeParts,
14193
+ readColumnValue,
13221
14194
  reindexVariables,
14195
+ resolveDefaultStatusId,
13222
14196
  resolveProtocol,
13223
14197
  sanitizePhoneNumber,
13224
14198
  sanitizeTemplateNameInput,
13225
14199
  seamlessVariableEngine,
13226
14200
  splitHeaderTitle,
14201
+ tableColumns,
13227
14202
  useColumnReorder,
13228
14203
  useColumnResize,
13229
14204
  useSmartTooltip,