@universe-platform/ui 0.1.0-beta.60 → 0.1.0-beta.62

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
@@ -9967,12 +9967,1224 @@ var PlacementBlock = (props) => {
9967
9967
  ] });
9968
9968
  };
9969
9969
 
9970
+ // src/components/PaymentReportsBlock/PaymentReportsBlock.tsx
9971
+ import { useCallback as useCallback16, useEffect as useEffect15, useMemo as useMemo13, useRef as useRef17, useState as useState22 } from "react";
9972
+
9973
+ // src/components/PaymentReportsBlock/PaymentReportsBlock.types.ts
9974
+ var PAYMENT_REPORTS_REQUIRED = [
9975
+ "reportsTableId",
9976
+ "reportReporterColumn",
9977
+ "reportPaymentColumn",
9978
+ "reportAmountColumn",
9979
+ "paymentsTableId",
9980
+ "paymentTotalColumn",
9981
+ "paymentReceiptDateColumn"
9982
+ ];
9983
+ function missingPaymentReportsFields(c) {
9984
+ return PAYMENT_REPORTS_REQUIRED.filter((k) => !c || !c[k]);
9985
+ }
9986
+ var PAYMENT_REPORTS_ACTIONS = {
9987
+ CREATE_PAYMENT: "PAYMENT_REPORTS_CREATE_PAYMENT",
9988
+ CANCEL_PAYMENT: "PAYMENT_REPORTS_CANCEL_PAYMENT",
9989
+ CONFIRM_RECEIPT: "PAYMENT_REPORTS_CONFIRM_RECEIPT",
9990
+ UNDO_RECEIPT: "PAYMENT_REPORTS_UNDO_RECEIPT",
9991
+ SET_PROOF: "PAYMENT_REPORTS_SET_PROOF"
9992
+ };
9993
+
9994
+ // src/components/PaymentReportsBlock/paymentReportsUtils.ts
9995
+ function normalizeRows2(records) {
9996
+ return (records || []).filter(Boolean).map((r) => {
9997
+ var _c, _d, _e;
9998
+ const data = r.data && typeof r.data === "object" ? r.data : r.values && typeof r.values === "object" ? r.values : ((_a) => {
9999
+ var _b = _a, { id, _id, recordId } = _b, rest = __objRest(_b, ["id", "_id", "recordId"]);
10000
+ return rest;
10001
+ })(r);
10002
+ return { id: String((_e = (_d = (_c = r.id) != null ? _c : r._id) != null ? _d : r.recordId) != null ? _e : ""), data };
10003
+ }).filter((r) => r.id);
10004
+ }
10005
+ function unpackTableResponse2(res) {
10006
+ var _a, _b, _c, _d, _e;
10007
+ 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 : [];
10008
+ const columns = ((_b = res == null ? void 0 : res.schema) == null ? void 0 : _b.columns) || ((_d = (_c = res == null ? void 0 : res.data) == null ? void 0 : _c.schema) == null ? void 0 : _d.columns) || [];
10009
+ const relationOptions = (res == null ? void 0 : res.relationOptions) || ((_e = res == null ? void 0 : res.data) == null ? void 0 : _e.relationOptions) || {};
10010
+ return { rows: normalizeRows2(rawRecords), columns, relationOptions };
10011
+ }
10012
+ var PAGE_SIZE = 1e3;
10013
+ var MAX_PAGES = 20;
10014
+ async function fetchAllTableData(exec, tableId) {
10015
+ if (!exec) throw new Error("executeAction \u05DC\u05D0 \u05D4\u05D5\u05E2\u05D1\u05E8 \u05DC\u05E8\u05DB\u05D9\u05D1");
10016
+ const out = { rows: [], columns: [], relationOptions: {} };
10017
+ const seen = /* @__PURE__ */ new Set();
10018
+ for (let page = 0; page < MAX_PAGES; page++) {
10019
+ const res = await exec("FETCH_TABLE_DATA", { tableId, tableMetaId: tableId, limit: PAGE_SIZE, skip: page * PAGE_SIZE });
10020
+ if (res && res.success === false) throw new Error(res.error || "\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD");
10021
+ const part = unpackTableResponse2(res);
10022
+ if (page === 0) out.columns = part.columns;
10023
+ for (const r of part.rows) {
10024
+ if (!seen.has(r.id)) {
10025
+ seen.add(r.id);
10026
+ out.rows.push(r);
10027
+ }
10028
+ }
10029
+ for (const [col, opts] of Object.entries(part.relationOptions || {})) {
10030
+ const existing = out.relationOptions[col] || (out.relationOptions[col] = []);
10031
+ const ids = new Set(existing.map((o) => String(o.id)));
10032
+ for (const o of opts) if (!ids.has(String(o.id))) existing.push(o);
10033
+ }
10034
+ if (part.rows.length < PAGE_SIZE) break;
10035
+ }
10036
+ return out;
10037
+ }
10038
+ async function runAction(exec, type, payload) {
10039
+ if (!exec) throw new Error("executeAction \u05DC\u05D0 \u05D4\u05D5\u05E2\u05D1\u05E8 \u05DC\u05E8\u05DB\u05D9\u05D1");
10040
+ const res = await exec(type, payload);
10041
+ if (res && res.success === false) throw new Error(res.error || res.message || "\u05D4\u05E4\u05E2\u05D5\u05DC\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4");
10042
+ return res && typeof res === "object" && "data" in res && "success" in res ? res.data : res;
10043
+ }
10044
+ function relationIds(v) {
10045
+ if (v === null || v === void 0 || v === "") return [];
10046
+ const arr = Array.isArray(v) ? v : [v];
10047
+ return arr.map((x) => {
10048
+ var _a, _b, _c;
10049
+ return typeof x === "object" && x !== null ? String((_c = (_b = (_a = x.id) != null ? _a : x._id) != null ? _b : x.value) != null ? _c : "") : String(x);
10050
+ }).filter(Boolean);
10051
+ }
10052
+ function toNumber(v) {
10053
+ if (typeof v === "number") return isFinite(v) ? v : 0;
10054
+ const n = Number(String(v != null ? v : "").replace(/[^0-9.-]/g, ""));
10055
+ return isFinite(n) ? n : 0;
10056
+ }
10057
+ function cellText2(v) {
10058
+ var _a, _b, _c, _d, _e;
10059
+ if (v === null || v === void 0) return "";
10060
+ if (Array.isArray(v)) return v.map(cellText2).filter(Boolean).join(", ");
10061
+ if (typeof v === "object") return String((_e = (_d = (_c = (_b = (_a = v.title) != null ? _a : v.label) != null ? _b : v.fileName) != null ? _c : v.name) != null ? _d : v.id) != null ? _e : "");
10062
+ return String(v);
10063
+ }
10064
+ function driveFiles(v) {
10065
+ if (!v) return [];
10066
+ const arr = Array.isArray(v) ? v : [v];
10067
+ return arr.filter((f) => f && typeof f === "object" && (f.fileId || f.fileUrl || f.url));
10068
+ }
10069
+ var DATE_RE = /^(\d{4})-(\d{2})-(\d{2})/;
10070
+ function dateParts(v) {
10071
+ if (!v) return null;
10072
+ if (typeof v === "string") {
10073
+ const m = DATE_RE.exec(v);
10074
+ if (m) return { y: +m[1], m: +m[2], d: +m[3] };
10075
+ }
10076
+ const dt = new Date(v);
10077
+ if (isNaN(dt.getTime())) return null;
10078
+ return { y: dt.getFullYear(), m: dt.getMonth() + 1, d: dt.getDate() };
10079
+ }
10080
+ function formatDate(v) {
10081
+ const p = dateParts(v);
10082
+ return p ? `${p.d}.${p.m}.${p.y}` : "";
10083
+ }
10084
+ function monthKey(v) {
10085
+ const p = dateParts(v);
10086
+ return p ? `${p.y}-${String(p.m).padStart(2, "0")}` : null;
10087
+ }
10088
+ var HEB_MONTHS = ["\u05D9\u05E0\u05D5\u05D0\u05E8", "\u05E4\u05D1\u05E8\u05D5\u05D0\u05E8", "\u05DE\u05E8\u05E5", "\u05D0\u05E4\u05E8\u05D9\u05DC", "\u05DE\u05D0\u05D9", "\u05D9\u05D5\u05E0\u05D9", "\u05D9\u05D5\u05DC\u05D9", "\u05D0\u05D5\u05D2\u05D5\u05E1\u05D8", "\u05E1\u05E4\u05D8\u05DE\u05D1\u05E8", "\u05D0\u05D5\u05E7\u05D8\u05D5\u05D1\u05E8", "\u05E0\u05D5\u05D1\u05DE\u05D1\u05E8", "\u05D3\u05E6\u05DE\u05D1\u05E8"];
10089
+ function monthLabel(key) {
10090
+ const [y, m] = key.split("-").map(Number);
10091
+ return `${HEB_MONTHS[(m || 1) - 1]} ${y}`;
10092
+ }
10093
+ function formatMoney(n, symbol = "\u20AA") {
10094
+ return `${symbol}${(Math.round(n * 100) / 100).toLocaleString("he-IL", { maximumFractionDigits: 2 })}`;
10095
+ }
10096
+ function todayIso() {
10097
+ const d = /* @__PURE__ */ new Date();
10098
+ return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
10099
+ }
10100
+ var labelOf = (options, id) => {
10101
+ const o = (options || []).find((x) => String(x.id) === id);
10102
+ return o ? String(o.label || "") : "";
10103
+ };
10104
+ function buildModel(config, reports, payments) {
10105
+ var _a, _b;
10106
+ const repOpts = (_a = reports.relationOptions) == null ? void 0 : _a[config.reportReporterColumn];
10107
+ const reportItems = reports.rows.map((r) => {
10108
+ const reporterId = relationIds(r.data[config.reportReporterColumn])[0] || "";
10109
+ return {
10110
+ id: r.id,
10111
+ data: r.data,
10112
+ reporterId,
10113
+ reporterLabel: labelOf(repOpts, reporterId) || (reporterId ? "\u2014" : ""),
10114
+ paymentId: relationIds(r.data[config.reportPaymentColumn])[0] || null,
10115
+ amount: toNumber(r.data[config.reportAmountColumn]),
10116
+ qty: config.reportQuantityColumn ? toNumber(r.data[config.reportQuantityColumn]) : 0,
10117
+ month: config.reportDateColumn ? monthKey(r.data[config.reportDateColumn]) : null
10118
+ };
10119
+ });
10120
+ const byPayment = /* @__PURE__ */ new Map();
10121
+ for (const r of reportItems) {
10122
+ if (!r.paymentId) continue;
10123
+ const list = byPayment.get(r.paymentId) || [];
10124
+ list.push(r);
10125
+ byPayment.set(r.paymentId, list);
10126
+ }
10127
+ const payOpts = config.paymentReporterColumn ? (_b = payments.relationOptions) == null ? void 0 : _b[config.paymentReporterColumn] : void 0;
10128
+ const paymentItems = payments.rows.map((p) => {
10129
+ var _a2;
10130
+ const linked = byPayment.get(p.id) || [];
10131
+ const payReporterId = config.paymentReporterColumn ? relationIds(p.data[config.paymentReporterColumn])[0] : "";
10132
+ const rawTotal = p.data[config.paymentTotalColumn];
10133
+ const hasTotal = rawTotal !== void 0 && rawTotal !== null && rawTotal !== "";
10134
+ return {
10135
+ id: p.id,
10136
+ data: p.data,
10137
+ reporterLabel: payReporterId && labelOf(payOpts, payReporterId) || ((_a2 = linked[0]) == null ? void 0 : _a2.reporterLabel) || "",
10138
+ total: hasTotal ? toNumber(rawTotal) : linked.reduce((s, r) => s + r.amount, 0),
10139
+ receiptDate: p.data[config.paymentReceiptDateColumn] || null,
10140
+ proof: config.paymentProofColumn ? driveFiles(p.data[config.paymentProofColumn]) : [],
10141
+ reports: linked,
10142
+ months: Array.from(new Set(linked.map((r) => r.month).filter(Boolean)))
10143
+ };
10144
+ });
10145
+ return { reports: reportItems, payments: paymentItems };
10146
+ }
10147
+ function displayCell(item, col, relationOptions, symbol) {
10148
+ const v = item.data[col.name];
10149
+ switch (col.type) {
10150
+ case "RELATION": {
10151
+ const opts = (relationOptions == null ? void 0 : relationOptions[col.name]) || [];
10152
+ return relationIds(v).map((id) => labelOf(opts, id) || "").filter(Boolean).join(", ");
10153
+ }
10154
+ case "DATE":
10155
+ return formatDate(v);
10156
+ case "BOOLEAN":
10157
+ return v === true ? "\u2713" : "";
10158
+ case "CURRENCY":
10159
+ return v === void 0 || v === null || v === "" ? "" : formatMoney(toNumber(v), symbol);
10160
+ case "NUMBER":
10161
+ return v === void 0 || v === null || v === "" ? "" : toNumber(v);
10162
+ case "GOOGLE_DRIVE_FILE":
10163
+ return driveFiles(v).map((f) => f.fileName).join(", ");
10164
+ default:
10165
+ return cellText2(v);
10166
+ }
10167
+ }
10168
+
10169
+ // src/components/PaymentReportsBlock/UnpaidReportsTab.tsx
10170
+ import { useMemo as useMemo10, useRef as useRef15, useState as useState19 } from "react";
10171
+ import { AgGridReact as AgGridReact2 } from "ag-grid-react";
10172
+ import { ModuleRegistry as ModuleRegistry2, AllCommunityModule as AllCommunityModule2 } from "ag-grid-community";
10173
+
10174
+ // src/components/PaymentReportsBlock/PaymentReportsModals.tsx
10175
+ import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
10176
+ var Modal = ({ title, onClose, children, footer, wide }) => /* @__PURE__ */ jsx22(
10177
+ "div",
10178
+ {
10179
+ className: "fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",
10180
+ dir: "rtl",
10181
+ onClick: onClose,
10182
+ children: /* @__PURE__ */ jsxs18(
10183
+ "div",
10184
+ {
10185
+ className: `bg-white rounded-xl shadow-xl w-full ${wide ? "max-w-3xl" : "max-w-md"} max-h-[85vh] flex flex-col`,
10186
+ onClick: (e) => e.stopPropagation(),
10187
+ children: [
10188
+ /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between px-5 py-3 border-b border-slate-200", children: [
10189
+ /* @__PURE__ */ jsx22("h3", { className: "text-base font-bold text-slate-800", children: title }),
10190
+ /* @__PURE__ */ jsx22("button", { type: "button", onClick: onClose, className: "text-slate-400 hover:text-slate-600 text-xl leading-none cursor-pointer", children: "\xD7" })
10191
+ ] }),
10192
+ /* @__PURE__ */ jsx22("div", { className: "p-5 overflow-auto text-sm text-slate-700", children }),
10193
+ footer && /* @__PURE__ */ jsx22("div", { className: "px-5 py-3 border-t border-slate-200 flex justify-end gap-2", children: footer })
10194
+ ]
10195
+ }
10196
+ )
10197
+ }
10198
+ );
10199
+ var ConfirmModal = ({ title, message, confirmLabel, danger, busy, onConfirm, onClose }) => /* @__PURE__ */ jsx22(
10200
+ Modal,
10201
+ {
10202
+ title,
10203
+ onClose,
10204
+ footer: /* @__PURE__ */ jsxs18(Fragment4, { children: [
10205
+ /* @__PURE__ */ jsx22(
10206
+ "button",
10207
+ {
10208
+ type: "button",
10209
+ onClick: onClose,
10210
+ className: "px-4 py-2 rounded-lg text-sm font-medium bg-white border border-slate-300 text-slate-600 hover:bg-slate-50 cursor-pointer",
10211
+ children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
10212
+ }
10213
+ ),
10214
+ /* @__PURE__ */ jsx22(
10215
+ "button",
10216
+ {
10217
+ type: "button",
10218
+ disabled: busy,
10219
+ onClick: onConfirm,
10220
+ className: `px-4 py-2 rounded-lg text-sm font-bold text-white disabled:opacity-50 cursor-pointer ${danger ? "bg-rose-600 hover:bg-rose-700" : "bg-blue-600 hover:bg-blue-700"}`,
10221
+ children: busy ? "\u05DE\u05D1\u05E6\u05E2..." : confirmLabel
10222
+ }
10223
+ )
10224
+ ] }),
10225
+ children: message
10226
+ }
10227
+ );
10228
+
10229
+ // src/components/PaymentReportsBlock/useGridColumnWidths.ts
10230
+ import { useCallback as useCallback15, useState as useState18 } from "react";
10231
+ function useGridColumnWidths(storageKey) {
10232
+ const [widths, setWidths] = useState18(() => {
10233
+ if (typeof window === "undefined") return {};
10234
+ try {
10235
+ return JSON.parse(localStorage.getItem(storageKey) || "{}") || {};
10236
+ } catch (e) {
10237
+ return {};
10238
+ }
10239
+ });
10240
+ const onColumnResized = useCallback15(
10241
+ (e) => {
10242
+ var _a;
10243
+ if (!e.finished || e.source !== "uiColumnResized" || !((_a = e.columns) == null ? void 0 : _a.length)) return;
10244
+ setWidths((prev) => {
10245
+ const next = __spreadValues({}, prev);
10246
+ for (const c of e.columns) next[c.getColId()] = Math.round(c.getActualWidth());
10247
+ try {
10248
+ localStorage.setItem(storageKey, JSON.stringify(next));
10249
+ } catch (e2) {
10250
+ }
10251
+ return next;
10252
+ });
10253
+ },
10254
+ [storageKey]
10255
+ );
10256
+ const applyWidths = useCallback15(
10257
+ (defs) => defs.map((d) => {
10258
+ const w = d.colId ? widths[d.colId] : void 0;
10259
+ return w ? __spreadProps(__spreadValues({}, d), { width: w, flex: 0 }) : d;
10260
+ }),
10261
+ [widths]
10262
+ );
10263
+ return { onColumnResized, applyWidths };
10264
+ }
10265
+
10266
+ // src/components/PaymentReportsBlock/UnpaidReportsTab.tsx
10267
+ import { jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
10268
+ ModuleRegistry2.registerModules([AllCommunityModule2]);
10269
+ var isUserColumn2 = (c) => !!(c == null ? void 0 : c.name) && c.name !== "_id" && c.name !== "id" && !c.isHidden;
10270
+ var EDITABLE_TYPES = ["STRING", "NUMBER", "CURRENCY"];
10271
+ var DeleteCell = (p) => {
10272
+ if (!p.data || p.data.paymentId) return null;
10273
+ return /* @__PURE__ */ jsx23(
10274
+ "button",
10275
+ {
10276
+ type: "button",
10277
+ title: "\u05DE\u05D7\u05E7 \u05D3\u05D9\u05D5\u05D5\u05D7",
10278
+ onClick: () => p.handlers.current.onDeleteReports([p.data.id]),
10279
+ className: "text-slate-400 hover:text-rose-600 cursor-pointer text-base",
10280
+ children: "\u{1F5D1}"
10281
+ }
10282
+ );
10283
+ };
10284
+ var UnpaidReportsTab = ({
10285
+ config,
10286
+ symbol,
10287
+ canEdit,
10288
+ reports,
10289
+ columns,
10290
+ relationOptions,
10291
+ search,
10292
+ showPaid,
10293
+ onToggleShowPaid,
10294
+ paymentLabels,
10295
+ handlers
10296
+ }) => {
10297
+ var _a;
10298
+ const apiRef = useRef15(null);
10299
+ const { onColumnResized, applyWidths } = useGridColumnWidths(`payment-reports:${config.reportsTableId}:unpaid`);
10300
+ const [selectedIds, setSelectedIds] = useState19([]);
10301
+ const [confirmOpen, setConfirmOpen] = useState19(false);
10302
+ const [paying, setPaying] = useState19(false);
10303
+ const displayCols = useMemo10(() => {
10304
+ var _a2;
10305
+ const byName = new Map(columns.filter(isUserColumn2).map((c) => [c.name, c]));
10306
+ const wanted = ((_a2 = config.reportDisplayColumns) == null ? void 0 : _a2.length) ? config.reportDisplayColumns : Array.from(byName.keys());
10307
+ return wanted.filter((n) => n !== config.reportPaymentColumn && n !== config.reportReporterColumn).map((n) => byName.get(n)).filter(Boolean);
10308
+ }, [columns, config.reportDisplayColumns, config.reportPaymentColumn, config.reportReporterColumn]);
10309
+ const colDefs = useMemo10(() => {
10310
+ const defs = [
10311
+ { headerName: "\u05DE\u05D3\u05D5\u05D5\u05D7", colId: "__reporter", minWidth: 140, valueGetter: (p) => {
10312
+ var _a2;
10313
+ return ((_a2 = p.data) == null ? void 0 : _a2.reporterLabel) || "";
10314
+ } }
10315
+ ];
10316
+ for (const col of displayCols) {
10317
+ const base = { headerName: col.name, colId: col.name, minWidth: 110 };
10318
+ if (EDITABLE_TYPES.includes(col.type)) {
10319
+ defs.push(__spreadProps(__spreadValues({}, base), {
10320
+ editable: (p) => canEdit && !!p.data && !p.data.paymentId,
10321
+ valueGetter: (p) => {
10322
+ var _a2, _b, _c;
10323
+ return (_c = (_b = (_a2 = p.data) == null ? void 0 : _a2.data) == null ? void 0 : _b[col.name]) != null ? _c : "";
10324
+ },
10325
+ valueFormatter: col.type === "CURRENCY" ? (p) => p.value === "" || p.value == null ? "" : formatMoney(toNumber(p.value), symbol) : void 0,
10326
+ valueSetter: (p) => {
10327
+ var _a2;
10328
+ if (p.data) {
10329
+ handlers.current.onEditCell(
10330
+ p.data.id,
10331
+ col.name,
10332
+ col.type === "STRING" ? String((_a2 = p.newValue) != null ? _a2 : "") : toNumber(p.newValue)
10333
+ );
10334
+ }
10335
+ return false;
10336
+ }
10337
+ }));
10338
+ } else {
10339
+ defs.push(__spreadProps(__spreadValues({}, base), {
10340
+ valueGetter: (p) => p.data ? displayCell(p.data, col, relationOptions, symbol) : ""
10341
+ }));
10342
+ }
10343
+ }
10344
+ if (showPaid) {
10345
+ defs.push({
10346
+ headerName: "\u05EA\u05E9\u05DC\u05D5\u05DD",
10347
+ colId: "__payment",
10348
+ minWidth: 130,
10349
+ valueGetter: (p) => {
10350
+ var _a2;
10351
+ return ((_a2 = p.data) == null ? void 0 : _a2.paymentId) ? paymentLabels[p.data.paymentId] || "\u05E9\u05D5\u05DC\u05DD" : "";
10352
+ }
10353
+ });
10354
+ }
10355
+ if (canEdit) {
10356
+ defs.push({
10357
+ headerName: "\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA",
10358
+ colId: "__actions",
10359
+ width: 90,
10360
+ sortable: false,
10361
+ filter: false,
10362
+ resizable: false,
10363
+ cellRenderer: DeleteCell,
10364
+ cellRendererParams: { handlers }
10365
+ });
10366
+ }
10367
+ return defs;
10368
+ }, [displayCols, canEdit, symbol, relationOptions, showPaid, paymentLabels, handlers]);
10369
+ const finalColDefs = useMemo10(() => applyWidths(colDefs), [applyWidths, colDefs]);
10370
+ const unpaid = useMemo10(() => reports.filter((r) => !r.paymentId), [reports]);
10371
+ const totals = useMemo10(() => {
10372
+ const amount = unpaid.reduce((s, r) => s + r.amount, 0);
10373
+ const qty = unpaid.reduce((s, r) => s + r.qty, 0);
10374
+ return { count: unpaid.length, amount, qty, avg: qty > 0 ? amount / qty : 0 };
10375
+ }, [unpaid]);
10376
+ const selected = useMemo10(
10377
+ () => unpaid.filter((r) => selectedIds.includes(r.id)),
10378
+ [unpaid, selectedIds]
10379
+ );
10380
+ const selectedTotal = selected.reduce((s, r) => s + r.amount, 0);
10381
+ const reporterIds = new Set(selected.map((r) => r.reporterId));
10382
+ const sameReporter = reporterIds.size === 1 && !reporterIds.has("");
10383
+ const reporterName = ((_a = selected[0]) == null ? void 0 : _a.reporterLabel) || "";
10384
+ const doPay = async () => {
10385
+ var _a2;
10386
+ setPaying(true);
10387
+ try {
10388
+ await handlers.current.onPay(selected.map((r) => r.id));
10389
+ (_a2 = apiRef.current) == null ? void 0 : _a2.deselectAll();
10390
+ setSelectedIds([]);
10391
+ setConfirmOpen(false);
10392
+ } catch (e) {
10393
+ } finally {
10394
+ setPaying(false);
10395
+ }
10396
+ };
10397
+ return /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3", children: [
10398
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
10399
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-2 text-xs text-slate-600 cursor-pointer", children: [
10400
+ /* @__PURE__ */ jsx23("input", { type: "checkbox", checked: showPaid, onChange: (e) => onToggleShowPaid(e.target.checked) }),
10401
+ "\u05D4\u05E6\u05D2 \u05D2\u05DD \u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05E9\u05E9\u05D5\u05DC\u05DE\u05D5"
10402
+ ] }),
10403
+ canEdit && /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-3", children: [
10404
+ selected.length > 0 && !sameReporter && /* @__PURE__ */ jsx23("span", { className: "text-xs text-rose-600", children: "\u05E0\u05D9\u05EA\u05DF \u05DC\u05E9\u05DC\u05DD \u05DC\u05DE\u05D3\u05D5\u05D5\u05D7 \u05D0\u05D7\u05D3 \u05D1\u05DB\u05DC \u05E4\u05E2\u05DD" }),
10405
+ selected.length > 0 && sameReporter && /* @__PURE__ */ jsxs19("span", { className: "text-xs text-slate-500", children: [
10406
+ selected.length,
10407
+ " \u05E0\u05D1\u05D7\u05E8\u05D5 \xB7 ",
10408
+ formatMoney(selectedTotal, symbol)
10409
+ ] }),
10410
+ /* @__PURE__ */ jsx23(
10411
+ "button",
10412
+ {
10413
+ type: "button",
10414
+ disabled: selected.length === 0 || !sameReporter || paying,
10415
+ onClick: () => setConfirmOpen(true),
10416
+ className: "px-4 py-2 rounded-lg text-sm font-bold bg-blue-600 hover:bg-blue-700 text-white disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
10417
+ children: "\u{1F4B3} \u05D1\u05D5\u05E6\u05E2 \u05EA\u05E9\u05DC\u05D5\u05DD \u05DC\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05E9\u05E0\u05D1\u05D7\u05E8\u05D5"
10418
+ }
10419
+ )
10420
+ ] })
10421
+ ] }),
10422
+ /* @__PURE__ */ jsx23("div", { className: "ag-theme-quartz w-full", style: { height: 520 }, children: /* @__PURE__ */ jsx23(
10423
+ AgGridReact2,
10424
+ {
10425
+ rowData: reports,
10426
+ columnDefs: finalColDefs,
10427
+ onColumnResized,
10428
+ defaultColDef: { sortable: true, resizable: true, filter: true, flex: 1 },
10429
+ getRowId: (p) => p.data.id,
10430
+ enableRtl: true,
10431
+ rowHeight: 46,
10432
+ headerHeight: 48,
10433
+ quickFilterText: search,
10434
+ singleClickEdit: true,
10435
+ stopEditingWhenCellsLoseFocus: true,
10436
+ getRowStyle: (p) => {
10437
+ var _a2;
10438
+ return ((_a2 = p.data) == null ? void 0 : _a2.paymentId) ? { background: "#fee2e2", color: "#b91c1c" } : void 0;
10439
+ },
10440
+ rowSelection: canEdit ? {
10441
+ mode: "multiRow",
10442
+ checkboxes: true,
10443
+ headerCheckbox: true,
10444
+ enableClickSelection: false,
10445
+ isRowSelectable: (node) => !!node.data && !node.data.paymentId
10446
+ } : void 0,
10447
+ onGridReady: (e) => {
10448
+ apiRef.current = e.api;
10449
+ },
10450
+ onSelectionChanged: (e) => setSelectedIds(e.api.getSelectedRows().map((r) => r.id))
10451
+ }
10452
+ ) }),
10453
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap gap-x-6 gap-y-1 text-sm font-medium text-slate-700 bg-slate-100 rounded-lg px-4 py-2", children: [
10454
+ /* @__PURE__ */ jsxs19("span", { children: [
10455
+ "\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05E9\u05D8\u05E8\u05DD \u05E9\u05D5\u05DC\u05DE\u05D5: ",
10456
+ totals.count
10457
+ ] }),
10458
+ config.reportQuantityColumn && /* @__PURE__ */ jsxs19("span", { children: [
10459
+ '\u05E1\u05D4"\u05DB \u05DB\u05DE\u05D5\u05EA: ',
10460
+ totals.qty
10461
+ ] }),
10462
+ /* @__PURE__ */ jsxs19("span", { children: [
10463
+ '\u05E1\u05D4"\u05DB \u05E1\u05DB\u05D5\u05DD: ',
10464
+ formatMoney(totals.amount, symbol)
10465
+ ] }),
10466
+ config.reportQuantityColumn && totals.qty > 0 && /* @__PURE__ */ jsxs19("span", { children: [
10467
+ "\u05DE\u05DE\u05D5\u05E6\u05E2 \u05DC\u05D9\u05D7\u05D9\u05D3\u05D4: ",
10468
+ formatMoney(totals.avg, symbol)
10469
+ ] })
10470
+ ] }),
10471
+ confirmOpen && /* @__PURE__ */ jsx23(
10472
+ ConfirmModal,
10473
+ {
10474
+ title: "\u05D0\u05D9\u05E9\u05D5\u05E8 \u05EA\u05E9\u05DC\u05D5\u05DD",
10475
+ confirmLabel: "\u05D1\u05E6\u05E2 \u05EA\u05E9\u05DC\u05D5\u05DD",
10476
+ busy: paying,
10477
+ onConfirm: doPay,
10478
+ onClose: () => setConfirmOpen(false),
10479
+ message: /* @__PURE__ */ jsxs19("p", { children: [
10480
+ "\u05D9\u05D9\u05D5\u05D5\u05E6\u05E8 \u05EA\u05E9\u05DC\u05D5\u05DD \u05D0\u05D7\u05D3 \u05DC\u05DE\u05D3\u05D5\u05D5\u05D7 ",
10481
+ /* @__PURE__ */ jsx23("b", { children: reporterName }),
10482
+ " \u05E2\u05DC ",
10483
+ /* @__PURE__ */ jsx23("b", { children: selected.length }),
10484
+ " \u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD, \u05D1\u05E1\u05DA",
10485
+ " ",
10486
+ /* @__PURE__ */ jsx23("b", { children: formatMoney(selectedTotal, symbol) }),
10487
+ "."
10488
+ ] })
10489
+ }
10490
+ )
10491
+ ] });
10492
+ };
10493
+
10494
+ // src/components/PaymentReportsBlock/PaymentsGrid.tsx
10495
+ import { useMemo as useMemo11, useState as useState21 } from "react";
10496
+ import { AgGridReact as AgGridReact3 } from "ag-grid-react";
10497
+ import { ModuleRegistry as ModuleRegistry3, AllCommunityModule as AllCommunityModule3 } from "ag-grid-community";
10498
+
10499
+ // src/components/PaymentReportsBlock/ProofCell.tsx
10500
+ import { useRef as useRef16, useState as useState20 } from "react";
10501
+ import { Fragment as Fragment5, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
10502
+ var ProofCell = ({ files, editable, onUpload, onRemove }) => {
10503
+ const inputRef = useRef16(null);
10504
+ const [busy, setBusy] = useState20(false);
10505
+ const file = files[0];
10506
+ const href = (file == null ? void 0 : file.fileUrl) || (file == null ? void 0 : file.url);
10507
+ const handleFile = async (e) => {
10508
+ var _a;
10509
+ const f = (_a = e.target.files) == null ? void 0 : _a[0];
10510
+ e.target.value = "";
10511
+ if (!f) return;
10512
+ setBusy(true);
10513
+ try {
10514
+ await onUpload(f);
10515
+ } finally {
10516
+ setBusy(false);
10517
+ }
10518
+ };
10519
+ const handleRemove = async () => {
10520
+ setBusy(true);
10521
+ try {
10522
+ await onRemove();
10523
+ } finally {
10524
+ setBusy(false);
10525
+ }
10526
+ };
10527
+ return /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 h-full", children: [
10528
+ file ? /* @__PURE__ */ jsxs20(Fragment5, { children: [
10529
+ /* @__PURE__ */ jsx24("a", { href, target: "_blank", rel: "noreferrer", className: "text-blue-600 underline text-xs font-medium", children: "\u05E6\u05E4\u05D9\u05D9\u05D4" }),
10530
+ editable && /* @__PURE__ */ jsxs20(Fragment5, { children: [
10531
+ /* @__PURE__ */ jsx24("button", { type: "button", disabled: busy, onClick: () => {
10532
+ var _a;
10533
+ return (_a = inputRef.current) == null ? void 0 : _a.click();
10534
+ }, className: "text-[11px] text-slate-500 hover:text-slate-800 cursor-pointer", children: "\u05D4\u05D7\u05DC\u05E3" }),
10535
+ /* @__PURE__ */ jsx24("button", { type: "button", disabled: busy, onClick: handleRemove, className: "text-[11px] text-rose-500 hover:text-rose-700 cursor-pointer", children: "\u05D4\u05E1\u05E8" })
10536
+ ] })
10537
+ ] }) : editable ? /* @__PURE__ */ jsx24(
10538
+ "button",
10539
+ {
10540
+ type: "button",
10541
+ disabled: busy,
10542
+ onClick: () => {
10543
+ var _a;
10544
+ return (_a = inputRef.current) == null ? void 0 : _a.click();
10545
+ },
10546
+ className: "px-2 py-1 rounded-md text-xs font-medium bg-slate-100 hover:bg-slate-200 text-slate-700 disabled:opacity-50 cursor-pointer",
10547
+ children: busy ? "\u05DE\u05E2\u05DC\u05D4..." : "\u2B06 \u05D4\u05E2\u05DC\u05D4 \u05D0\u05E1\u05DE\u05DB\u05EA\u05D0"
10548
+ }
10549
+ ) : /* @__PURE__ */ jsx24("span", { className: "text-xs text-slate-400 italic", children: "\u05DC\u05D0 \u05D4\u05D5\u05E2\u05DC\u05EA\u05D4" }),
10550
+ /* @__PURE__ */ jsx24("input", { ref: inputRef, type: "file", className: "hidden", onChange: handleFile })
10551
+ ] });
10552
+ };
10553
+
10554
+ // src/components/PaymentReportsBlock/PaymentsGrid.tsx
10555
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
10556
+ ModuleRegistry3.registerModules([AllCommunityModule3]);
10557
+ var ProofRenderer = (p) => p.data ? /* @__PURE__ */ jsx25(
10558
+ ProofCell,
10559
+ {
10560
+ files: p.data.proof,
10561
+ editable: !!p.editable,
10562
+ onUpload: (f) => p.handlers.current.onUploadProof(p.data.id, f),
10563
+ onRemove: () => p.handlers.current.onRemoveProof(p.data.id)
10564
+ }
10565
+ ) : null;
10566
+ var ReceiptRenderer = (p) => {
10567
+ const [date, setDate] = useState21(todayIso());
10568
+ const [busy, setBusy] = useState21(false);
10569
+ if (!p.data) return null;
10570
+ const id = p.data.id;
10571
+ return /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 h-full", children: [
10572
+ /* @__PURE__ */ jsx25(
10573
+ "input",
10574
+ {
10575
+ type: "date",
10576
+ value: date,
10577
+ onChange: (e) => setDate(e.target.value),
10578
+ className: "border border-slate-300 rounded-md px-2 py-1 text-xs bg-white"
10579
+ }
10580
+ ),
10581
+ /* @__PURE__ */ jsx25(
10582
+ "button",
10583
+ {
10584
+ type: "button",
10585
+ disabled: busy || !date,
10586
+ onClick: async () => {
10587
+ setBusy(true);
10588
+ try {
10589
+ await p.handlers.current.onConfirmReceipt(id, date);
10590
+ } finally {
10591
+ setBusy(false);
10592
+ }
10593
+ },
10594
+ className: "px-3 py-1 rounded-md text-xs font-bold bg-emerald-600 hover:bg-emerald-700 text-white disabled:opacity-50 cursor-pointer",
10595
+ children: busy ? "..." : "\u05D0\u05E9\u05E8 \u05E7\u05D1\u05DC\u05D4"
10596
+ }
10597
+ )
10598
+ ] });
10599
+ };
10600
+ var ActionsRenderer = (p) => {
10601
+ if (!p.data) return null;
10602
+ const pay = p.data;
10603
+ return /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 h-full", children: [
10604
+ /* @__PURE__ */ jsx25(
10605
+ "button",
10606
+ {
10607
+ type: "button",
10608
+ onClick: () => p.handlers.current.onDetails(pay),
10609
+ className: "px-2 py-1 rounded-md text-xs font-medium bg-slate-100 hover:bg-slate-200 text-slate-700 cursor-pointer",
10610
+ children: "\u05E4\u05D9\u05E8\u05D5\u05D8"
10611
+ }
10612
+ ),
10613
+ p.editable && (p.mode === "pending" ? /* @__PURE__ */ jsx25(
10614
+ "button",
10615
+ {
10616
+ type: "button",
10617
+ title: "\u05D1\u05D9\u05D8\u05D5\u05DC \u05D4\u05EA\u05E9\u05DC\u05D5\u05DD - \u05D4\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05D9\u05D7\u05D6\u05E8\u05D5 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA \u05D4\u05E8\u05D0\u05E9\u05D5\u05E0\u05D4",
10618
+ onClick: () => p.handlers.current.onCancelPayment(pay),
10619
+ className: "px-2 py-1 rounded-md text-xs font-medium bg-rose-50 hover:bg-rose-100 text-rose-600 border border-rose-200 cursor-pointer",
10620
+ children: "\u05D1\u05D9\u05D8\u05D5\u05DC \u05EA\u05E9\u05DC\u05D5\u05DD"
10621
+ }
10622
+ ) : /* @__PURE__ */ jsx25(
10623
+ "button",
10624
+ {
10625
+ type: "button",
10626
+ title: "\u05D1\u05D9\u05D8\u05D5\u05DC \u05D0\u05D9\u05E9\u05D5\u05E8 \u05D4\u05E7\u05D1\u05DC\u05D4 - \u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05D9\u05D7\u05D6\u05D5\u05E8 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA '\u05E9\u05D5\u05DC\u05DD \u05DC\u05DE\u05D3\u05E8\u05D9\u05DB\u05D9\u05DD'",
10627
+ onClick: () => p.handlers.current.onUndoReceipt(pay),
10628
+ className: "px-2 py-1 rounded-md text-xs font-medium bg-amber-50 hover:bg-amber-100 text-amber-700 border border-amber-200 cursor-pointer",
10629
+ children: "\u05D1\u05D8\u05DC \u05D0\u05D9\u05E9\u05D5\u05E8"
10630
+ }
10631
+ ))
10632
+ ] });
10633
+ };
10634
+ var PaymentsGrid = ({ mode, config, symbol, canEdit, payments, search, handlers }) => {
10635
+ const { onColumnResized, applyWidths } = useGridColumnWidths(`payment-reports:${config.paymentsTableId}:${mode}`);
10636
+ const colDefs = useMemo11(() => {
10637
+ const defs = [
10638
+ { headerName: "\u05DE\u05D3\u05D5\u05D5\u05D7", colId: "__reporter", minWidth: 140, valueGetter: (p) => {
10639
+ var _a;
10640
+ return ((_a = p.data) == null ? void 0 : _a.reporterLabel) || "";
10641
+ } },
10642
+ {
10643
+ headerName: mode === "pending" ? "\u05E1\u05DB\u05D5\u05DD \u05DB\u05D5\u05DC\u05DC" : "\u05E1\u05DB\u05D5\u05DD \u05E9\u05E9\u05D5\u05DC\u05DD",
10644
+ colId: "__total",
10645
+ minWidth: 120,
10646
+ valueGetter: (p) => {
10647
+ var _a, _b;
10648
+ return (_b = (_a = p.data) == null ? void 0 : _a.total) != null ? _b : 0;
10649
+ },
10650
+ valueFormatter: (p) => formatMoney(Number(p.value || 0), symbol)
10651
+ },
10652
+ { headerName: "\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD", colId: "__count", width: 100, valueGetter: (p) => {
10653
+ var _a, _b;
10654
+ return (_b = (_a = p.data) == null ? void 0 : _a.reports.length) != null ? _b : 0;
10655
+ } }
10656
+ ];
10657
+ if (config.paymentProofColumn) {
10658
+ defs.push({
10659
+ headerName: "\u05D0\u05E1\u05DE\u05DB\u05EA\u05D0",
10660
+ colId: "__proof",
10661
+ minWidth: 190,
10662
+ sortable: false,
10663
+ filter: false,
10664
+ valueGetter: (p) => {
10665
+ var _a;
10666
+ return (((_a = p.data) == null ? void 0 : _a.proof) || []).map((f) => f.fileId || f.fileUrl || f.url).join(",");
10667
+ },
10668
+ cellRenderer: ProofRenderer,
10669
+ cellRendererParams: { handlers, editable: canEdit && mode === "pending" }
10670
+ });
10671
+ }
10672
+ if (mode === "pending") {
10673
+ defs.push({
10674
+ headerName: "\u05EA\u05D0\u05E8\u05D9\u05DA \u05E7\u05D1\u05DC\u05D4",
10675
+ colId: "__receipt",
10676
+ minWidth: 250,
10677
+ sortable: false,
10678
+ filter: false,
10679
+ cellRenderer: canEdit ? ReceiptRenderer : void 0,
10680
+ cellRendererParams: { handlers },
10681
+ valueGetter: () => ""
10682
+ });
10683
+ } else {
10684
+ defs.push({
10685
+ headerName: "\u05EA\u05D0\u05E8\u05D9\u05DA \u05E7\u05D1\u05DC\u05D4",
10686
+ colId: "__receipt",
10687
+ minWidth: 130,
10688
+ valueGetter: (p) => {
10689
+ var _a;
10690
+ return formatDate((_a = p.data) == null ? void 0 : _a.receiptDate);
10691
+ }
10692
+ });
10693
+ }
10694
+ defs.push({
10695
+ headerName: "\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA",
10696
+ colId: "__actions",
10697
+ minWidth: 220,
10698
+ sortable: false,
10699
+ filter: false,
10700
+ cellRenderer: ActionsRenderer,
10701
+ cellRendererParams: { handlers, editable: canEdit, mode }
10702
+ });
10703
+ return defs;
10704
+ }, [mode, config.paymentProofColumn, symbol, canEdit, handlers]);
10705
+ const finalColDefs = useMemo11(() => applyWidths(colDefs), [applyWidths, colDefs]);
10706
+ const total = useMemo11(() => payments.reduce((s, p) => s + p.total, 0), [payments]);
10707
+ return /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3", children: [
10708
+ /* @__PURE__ */ jsx25("div", { className: "ag-theme-quartz w-full", style: { height: 480 }, children: /* @__PURE__ */ jsx25(
10709
+ AgGridReact3,
10710
+ {
10711
+ rowData: payments,
10712
+ columnDefs: finalColDefs,
10713
+ onColumnResized,
10714
+ defaultColDef: { sortable: true, resizable: true, filter: true, flex: 1 },
10715
+ getRowId: (p) => p.data.id,
10716
+ enableRtl: true,
10717
+ rowHeight: 52,
10718
+ headerHeight: 48,
10719
+ quickFilterText: search
10720
+ }
10721
+ ) }),
10722
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap gap-x-6 gap-y-1 text-sm font-medium text-slate-700 bg-slate-100 rounded-lg px-4 py-2", children: [
10723
+ /* @__PURE__ */ jsxs21("span", { children: [
10724
+ "\u05E1\u05DA \u05D4\u05DB\u05DC \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA: ",
10725
+ payments.length
10726
+ ] }),
10727
+ /* @__PURE__ */ jsxs21("span", { children: [
10728
+ '\u05E1\u05D4"\u05DB \u05E1\u05DB\u05D5\u05DD: ',
10729
+ formatMoney(total, symbol)
10730
+ ] })
10731
+ ] })
10732
+ ] });
10733
+ };
10734
+
10735
+ // src/components/PaymentReportsBlock/PaidPaymentsTab.tsx
10736
+ import { jsx as jsx26 } from "react/jsx-runtime";
10737
+ var PaidPaymentsTab = (props) => /* @__PURE__ */ jsx26(PaymentsGrid, __spreadValues({ mode: "pending" }, props));
10738
+
10739
+ // src/components/PaymentReportsBlock/ReceiptsTab.tsx
10740
+ import { jsx as jsx27 } from "react/jsx-runtime";
10741
+ var ReceiptsTab = (props) => /* @__PURE__ */ jsx27(PaymentsGrid, __spreadValues({ mode: "received" }, props));
10742
+
10743
+ // src/components/PaymentReportsBlock/PaymentDetailsModal.tsx
10744
+ import { useMemo as useMemo12 } from "react";
10745
+ import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
10746
+ var isUserColumn3 = (c) => !!(c == null ? void 0 : c.name) && c.name !== "_id" && c.name !== "id" && !c.isHidden;
10747
+ var PaymentDetailsModal = ({ payment, config, symbol, columns, relationOptions, onClose }) => {
10748
+ const cols = useMemo12(() => {
10749
+ var _a;
10750
+ const byName = new Map(columns.filter(isUserColumn3).map((c) => [c.name, c]));
10751
+ const wanted = ((_a = config.reportDisplayColumns) == null ? void 0 : _a.length) ? config.reportDisplayColumns : Array.from(byName.keys());
10752
+ return wanted.filter((n) => n !== config.reportPaymentColumn && n !== config.reportReporterColumn).map((n) => byName.get(n)).filter(Boolean);
10753
+ }, [columns, config]);
10754
+ const sum = payment.reports.reduce((s, r) => s + r.amount, 0);
10755
+ return /* @__PURE__ */ jsxs22(
10756
+ Modal,
10757
+ {
10758
+ wide: true,
10759
+ title: `\u05E4\u05D9\u05E8\u05D5\u05D8 \u05EA\u05E9\u05DC\u05D5\u05DD${payment.reporterLabel ? ` \xB7 ${payment.reporterLabel}` : ""}`,
10760
+ onClose,
10761
+ footer: /* @__PURE__ */ jsx28(
10762
+ "button",
10763
+ {
10764
+ type: "button",
10765
+ onClick: onClose,
10766
+ className: "px-4 py-2 rounded-lg text-sm font-medium bg-white border border-slate-300 text-slate-600 hover:bg-slate-50 cursor-pointer",
10767
+ children: "\u05E1\u05D2\u05D5\u05E8"
10768
+ }
10769
+ ),
10770
+ children: [
10771
+ payment.reports.length === 0 ? /* @__PURE__ */ jsx28("p", { className: "text-slate-500", children: "\u05DC\u05D0 \u05E0\u05DE\u05E6\u05D0\u05D5 \u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05DE\u05E7\u05D5\u05E9\u05E8\u05D9\u05DD \u05DC\u05EA\u05E9\u05DC\u05D5\u05DD \u05D6\u05D4." }) : /* @__PURE__ */ jsx28("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs22("table", { className: "w-full text-sm text-right border-collapse", children: [
10772
+ /* @__PURE__ */ jsx28("thead", { children: /* @__PURE__ */ jsx28("tr", { className: "bg-slate-100 text-slate-600", children: cols.map((c) => /* @__PURE__ */ jsx28("th", { className: "px-3 py-2 font-semibold border-b border-slate-200 whitespace-nowrap", children: c.name }, c.name)) }) }),
10773
+ /* @__PURE__ */ jsx28("tbody", { children: payment.reports.map((r) => /* @__PURE__ */ jsx28("tr", { className: "border-b border-slate-100", children: cols.map((c) => {
10774
+ var _a;
10775
+ return /* @__PURE__ */ jsx28("td", { className: "px-3 py-2 whitespace-nowrap", children: String((_a = displayCell(r, c, relationOptions, symbol)) != null ? _a : "") }, c.name);
10776
+ }) }, r.id)) })
10777
+ ] }) }),
10778
+ /* @__PURE__ */ jsxs22("div", { className: "mt-4 flex flex-wrap gap-x-6 gap-y-1 font-bold text-slate-800", children: [
10779
+ /* @__PURE__ */ jsxs22("span", { children: [
10780
+ "\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD: ",
10781
+ payment.reports.length
10782
+ ] }),
10783
+ /* @__PURE__ */ jsxs22("span", { children: [
10784
+ "\u05E1\u05DB\u05D5\u05DD \u05D4\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD: ",
10785
+ formatMoney(sum, symbol)
10786
+ ] }),
10787
+ Math.abs(sum - payment.total) > 5e-3 && /* @__PURE__ */ jsxs22("span", { className: "text-amber-700", children: [
10788
+ "\u05E1\u05DB\u05D5\u05DD \u05D4\u05EA\u05E9\u05DC\u05D5\u05DD: ",
10789
+ formatMoney(payment.total, symbol)
10790
+ ] })
10791
+ ] })
10792
+ ]
10793
+ }
10794
+ );
10795
+ };
10796
+
10797
+ // src/components/PaymentReportsBlock/driveUpload.ts
10798
+ async function uploadFileToDrive(file, opts) {
10799
+ if (file.size <= 0) throw new Error(`\u05D4\u05E7\u05D5\u05D1\u05E5 "${file.name}" \u05E8\u05D9\u05E7`);
10800
+ const { orgId = "", folderName, executeAction } = opts;
10801
+ let formError = null;
10802
+ try {
10803
+ const w = typeof window !== "undefined" ? window : {};
10804
+ const apiBase = w.NEXT_PUBLIC_UNIVERSE_SERVER_URL || w.NEXT_PUBLIC_UNIVERSE_API_URL || process.env.NEXT_PUBLIC_UNIVERSE_SERVER_URL || process.env.NEXT_PUBLIC_UNIVERSE_API_URL || (typeof window !== "undefined" ? window.location.origin : "");
10805
+ const url = apiBase ? `${apiBase.replace(/\/$/, "")}/api/drive/upload` : "/api/drive/upload";
10806
+ const fd = new FormData();
10807
+ fd.append("file", file);
10808
+ fd.append("tableName", folderName);
10809
+ if (orgId) fd.append("orgId", orgId);
10810
+ const res2 = await fetch(url, { method: "POST", body: fd, headers: orgId ? { "x-org-id": orgId } : {} });
10811
+ if (res2.ok) {
10812
+ const json = await res2.json().catch(() => null);
10813
+ const d2 = (json == null ? void 0 : json.data) || json;
10814
+ if (d2 && (d2.fileId || d2.id)) {
10815
+ return {
10816
+ fileId: d2.fileId || d2.id,
10817
+ fileName: d2.fileName || d2.name || file.name,
10818
+ fileUrl: d2.fileUrl || d2.url || d2.link || "",
10819
+ url: d2.url || d2.fileUrl || d2.link || ""
10820
+ };
10821
+ }
10822
+ } else {
10823
+ const err = await res2.json().catch(() => null);
10824
+ formError = (err == null ? void 0 : err.error) || `\u05E9\u05D2\u05D9\u05D0\u05EA \u05D4\u05E2\u05DC\u05D0\u05D4 (${res2.status})`;
10825
+ }
10826
+ } catch (e) {
10827
+ formError = (e == null ? void 0 : e.message) || "\u05E9\u05D2\u05D9\u05D0\u05EA \u05E8\u05E9\u05EA";
10828
+ }
10829
+ if (!executeAction) throw new Error(formError || "\u05D4\u05E2\u05DC\u05D0\u05EA \u05D4\u05E7\u05D5\u05D1\u05E5 \u05E0\u05DB\u05E9\u05DC\u05D4");
10830
+ const base64 = await new Promise((resolve, reject) => {
10831
+ const reader = new FileReader();
10832
+ reader.onload = () => {
10833
+ const r = String(reader.result || "");
10834
+ resolve(r.includes(",") ? r.split(",")[1] : r);
10835
+ };
10836
+ reader.onerror = reject;
10837
+ reader.readAsDataURL(file);
10838
+ });
10839
+ const res = await executeAction("UPLOAD_DRIVE_FILE", {
10840
+ fileName: file.name,
10841
+ name: file.name,
10842
+ mimeType: file.type || "application/octet-stream",
10843
+ size: file.size,
10844
+ content: base64,
10845
+ base64,
10846
+ isBase64: true,
10847
+ tableName: folderName,
10848
+ orgId
10849
+ });
10850
+ if (!res || res.success === false || res.error) throw new Error((res == null ? void 0 : res.error) || formError || "\u05D4\u05E2\u05DC\u05D0\u05EA \u05D4\u05E7\u05D5\u05D1\u05E5 \u05E0\u05DB\u05E9\u05DC\u05D4");
10851
+ const d = (res == null ? void 0 : res.data) || res;
10852
+ const fileId = (d == null ? void 0 : d.fileId) || (d == null ? void 0 : d.id);
10853
+ if (!fileId) throw new Error(formError || "\u05D4\u05E2\u05DC\u05D0\u05EA \u05D4\u05E7\u05D5\u05D1\u05E5 \u05E0\u05DB\u05E9\u05DC\u05D4");
10854
+ return {
10855
+ fileId,
10856
+ fileName: d.fileName || d.name || file.name,
10857
+ fileUrl: d.fileUrl || d.url || d.link || "",
10858
+ url: d.url || d.fileUrl || d.link || ""
10859
+ };
10860
+ }
10861
+
10862
+ // src/components/PaymentReportsBlock/PortalLinksBar.tsx
10863
+ import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
10864
+ function platformOrigin() {
10865
+ const w = typeof window !== "undefined" ? window : {};
10866
+ const base = w.NEXT_PUBLIC_UNIVERSE_SERVER_URL || w.NEXT_PUBLIC_UNIVERSE_API_URL || process.env.NEXT_PUBLIC_UNIVERSE_SERVER_URL || process.env.NEXT_PUBLIC_UNIVERSE_API_URL || (typeof window !== "undefined" ? window.location.origin : "");
10867
+ return String(base).replace(/\/$/, "");
10868
+ }
10869
+ function PortalLinksBar({ config, componentId }) {
10870
+ const { addToast } = useToast();
10871
+ if (!config.portalEnabled || !config.reportersTableId) return null;
10872
+ const origin = platformOrigin();
10873
+ const links = [
10874
+ config.registrationFormId && {
10875
+ label: "\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D4\u05E8\u05E9\u05DE\u05D4 (\u05D8\u05D5\u05E4\u05E1 1)",
10876
+ url: `${origin}/embed/form/${config.reportersTableId}?form=${encodeURIComponent(config.registrationFormId)}`
10877
+ },
10878
+ componentId && {
10879
+ label: "\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D3\u05D9\u05D5\u05D5\u05D7 (\u05D8\u05D5\u05E4\u05E1 2, \u05D1\u05DB\u05E0\u05D9\u05E1\u05D4 \u05E2\u05DD \u05E7\u05D5\u05D3 \u05D1\u05D0\u05D9\u05DE\u05D9\u05D9\u05DC)",
10880
+ url: `${origin}/embed/reporter-report/${config.reportsTableId}?c=${encodeURIComponent(componentId)}`
10881
+ }
10882
+ ].filter(Boolean);
10883
+ if (!links.length) return null;
10884
+ const copy = async (url, label) => {
10885
+ try {
10886
+ await navigator.clipboard.writeText(url);
10887
+ addToast({ type: "success", message: `${label}: \u05D4\u05D5\u05E2\u05EA\u05E7` });
10888
+ } catch (e) {
10889
+ window.prompt("\u05D4\u05E2\u05EA\u05E7 \u05D9\u05D3\u05E0\u05D9\u05EA:", url);
10890
+ }
10891
+ };
10892
+ return /* @__PURE__ */ jsx29("div", { className: "flex flex-col gap-1.5 rounded-lg border border-slate-200 bg-slate-50 px-3 py-2 text-xs", children: links.map((l) => /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-2", children: [
10893
+ /* @__PURE__ */ jsxs23("span", { className: "font-semibold text-slate-600 whitespace-nowrap", children: [
10894
+ l.label,
10895
+ ":"
10896
+ ] }),
10897
+ /* @__PURE__ */ jsx29(
10898
+ "input",
10899
+ {
10900
+ readOnly: true,
10901
+ dir: "ltr",
10902
+ value: l.url,
10903
+ onFocus: (e) => e.currentTarget.select(),
10904
+ className: "flex-1 min-w-[200px] rounded-md border border-slate-200 bg-white px-2 py-1 text-[11px] text-slate-600"
10905
+ }
10906
+ ),
10907
+ /* @__PURE__ */ jsx29("button", { type: "button", onClick: () => copy(l.url, l.label), className: "font-semibold text-blue-600 hover:underline cursor-pointer whitespace-nowrap", children: "\u05D4\u05E2\u05EA\u05E7" })
10908
+ ] }, l.url)) });
10909
+ }
10910
+
10911
+ // src/components/PaymentReportsBlock/PaymentReportsBlock.tsx
10912
+ import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
10913
+ var EMPTY = { rows: [], columns: [], relationOptions: {} };
10914
+ var PaymentReportsBlock = (props) => {
10915
+ const { executeAction, orgId, role, readOnly, permissions, className } = props;
10916
+ const { addToast } = useToast();
10917
+ const config = useMemo13(() => {
10918
+ var _a, _b;
10919
+ const raw = (_a = props.config) != null ? _a : props.settings;
10920
+ if (!raw) return void 0;
10921
+ return ((_b = raw.config) == null ? void 0 : _b.reportsTableId) ? raw.config : raw;
10922
+ }, [props.config, props.settings]);
10923
+ const missing = missingPaymentReportsFields(config);
10924
+ const symbol = (config == null ? void 0 : config.currencySymbol) || "\u20AA";
10925
+ const canEdit = !readOnly && ((permissions == null ? void 0 : permissions.canUpdate) !== void 0 ? !!permissions.canUpdate : role ? role === "OWNER" || role === "EDITOR" : true);
10926
+ const [tab, setTab] = useState22("unpaid");
10927
+ const [month, setMonth] = useState22("");
10928
+ const [search, setSearch] = useState22("");
10929
+ const [showPaid, setShowPaid] = useState22(false);
10930
+ const [reportsRes, setReportsRes] = useState22(EMPTY);
10931
+ const [paymentsRes, setPaymentsRes] = useState22(EMPTY);
10932
+ const [loading, setLoading] = useState22(true);
10933
+ const [error, setError] = useState22(null);
10934
+ const [details, setDetails] = useState22(null);
10935
+ const [confirm, setConfirm] = useState22(null);
10936
+ const [confirmBusy, setConfirmBusy] = useState22(false);
10937
+ const toastOk = useCallback16((message) => addToast({ type: "success", message }), [addToast]);
10938
+ const toastErr = useCallback16((e) => addToast({ type: "error", message: (e == null ? void 0 : e.message) || String(e) }), [addToast]);
10939
+ const load = useCallback16(
10940
+ async (silent = false) => {
10941
+ if (!config || missing.length) return;
10942
+ if (!silent) setLoading(true);
10943
+ setError(null);
10944
+ try {
10945
+ const [r, p] = await Promise.all([
10946
+ fetchAllTableData(executeAction, config.reportsTableId),
10947
+ fetchAllTableData(executeAction, config.paymentsTableId)
10948
+ ]);
10949
+ setReportsRes(r);
10950
+ setPaymentsRes(p);
10951
+ } catch (e) {
10952
+ setError((e == null ? void 0 : e.message) || "\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05D8\u05E2\u05D9\u05E0\u05EA \u05D4\u05E0\u05EA\u05D5\u05E0\u05D9\u05DD");
10953
+ } finally {
10954
+ setLoading(false);
10955
+ }
10956
+ },
10957
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10958
+ [config == null ? void 0 : config.reportsTableId, config == null ? void 0 : config.paymentsTableId, missing.length, executeAction]
10959
+ );
10960
+ useEffect15(() => {
10961
+ load();
10962
+ }, [load]);
10963
+ const model = useMemo13(
10964
+ () => config && !missing.length ? buildModel(config, reportsRes, paymentsRes) : { reports: [], payments: [] },
10965
+ [config, missing.length, reportsRes, paymentsRes]
10966
+ );
10967
+ const months = useMemo13(() => {
10968
+ const set = /* @__PURE__ */ new Set();
10969
+ model.reports.forEach((r) => r.month && set.add(r.month));
10970
+ return Array.from(set).sort().reverse();
10971
+ }, [model.reports]);
10972
+ const reportsInMonth = useMemo13(
10973
+ () => model.reports.filter((r) => (!month || r.month === month) && (showPaid || !r.paymentId)),
10974
+ [model.reports, month, showPaid]
10975
+ );
10976
+ const pendingPayments = useMemo13(
10977
+ () => model.payments.filter((p) => !p.receiptDate && (!month || p.months.includes(month))),
10978
+ [model.payments, month]
10979
+ );
10980
+ const receivedPayments = useMemo13(
10981
+ () => model.payments.filter((p) => !!p.receiptDate && (!month || p.months.includes(month))),
10982
+ [model.payments, month]
10983
+ );
10984
+ const unpaidCount = model.reports.filter((r) => !r.paymentId).length;
10985
+ const paymentLabels = useMemo13(() => {
10986
+ const m = {};
10987
+ model.payments.forEach((p) => {
10988
+ m[p.id] = `${p.receiptDate ? "\u05D4\u05EA\u05E7\u05D1\u05DC" : "\u05E9\u05D5\u05DC\u05DD"} \xB7 ${formatMoney(p.total, symbol)}`;
10989
+ });
10990
+ return m;
10991
+ }, [model.payments, symbol]);
10992
+ const base = { reportsTableId: config == null ? void 0 : config.reportsTableId, paymentsTableId: config == null ? void 0 : config.paymentsTableId };
10993
+ const handlers = useRef17(null);
10994
+ handlers.current = {
10995
+ onPay: async (reportIds) => {
10996
+ var _a;
10997
+ try {
10998
+ const res = await runAction(executeAction, PAYMENT_REPORTS_ACTIONS.CREATE_PAYMENT, __spreadProps(__spreadValues({}, base), { reportIds }));
10999
+ toastOk(`\u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05E0\u05D5\u05E6\u05E8 \u05D1\u05E1\u05DA ${formatMoney(Number((res == null ? void 0 : res.total) || 0), symbol)} (${(_a = res == null ? void 0 : res.count) != null ? _a : reportIds.length} \u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD)`);
11000
+ await load(true);
11001
+ } catch (e) {
11002
+ toastErr(e);
11003
+ throw e;
11004
+ }
11005
+ },
11006
+ onDeleteReports: (ids) => setConfirm({ kind: "deleteReports", ids }),
11007
+ onEditCell: (reportId, column, value) => {
11008
+ setReportsRes((prev) => __spreadProps(__spreadValues({}, prev), {
11009
+ rows: prev.rows.map((r) => r.id === reportId ? __spreadProps(__spreadValues({}, r), { data: __spreadProps(__spreadValues({}, r.data), { [column]: value }) }) : r)
11010
+ }));
11011
+ runAction(executeAction, "UPDATE_RECORD", {
11012
+ tableId: config.reportsTableId,
11013
+ recordId: reportId,
11014
+ data: { [column]: value }
11015
+ }).catch((e) => {
11016
+ toastErr(e);
11017
+ load(true);
11018
+ });
11019
+ },
11020
+ onDetails: (p) => setDetails(p),
11021
+ onConfirmReceipt: async (paymentId, date) => {
11022
+ try {
11023
+ await runAction(executeAction, PAYMENT_REPORTS_ACTIONS.CONFIRM_RECEIPT, __spreadProps(__spreadValues({}, base), { paymentId, receiptDate: date }));
11024
+ toastOk("\u05D4\u05E7\u05D1\u05DC\u05D4 \u05D0\u05D5\u05E9\u05E8\u05D4 \u05D5\u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05E2\u05D1\u05E8 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA \u05D4\u05E7\u05D1\u05DC\u05D5\u05EA");
11025
+ await load(true);
11026
+ } catch (e) {
11027
+ toastErr(e);
11028
+ }
11029
+ },
11030
+ onCancelPayment: (payment) => setConfirm({ kind: "cancelPayment", payment }),
11031
+ onUndoReceipt: (payment) => setConfirm({ kind: "undoReceipt", payment }),
11032
+ onUploadProof: async (paymentId, file) => {
11033
+ try {
11034
+ const driveFile = await uploadFileToDrive(file, {
11035
+ orgId: orgId || (config == null ? void 0 : config.orgId),
11036
+ folderName: (config == null ? void 0 : config.proofFolderName) || "\u05D0\u05E1\u05DE\u05DB\u05EA\u05D0\u05D5\u05EA \u05EA\u05E9\u05DC\u05D5\u05DD",
11037
+ executeAction
11038
+ });
11039
+ await runAction(executeAction, PAYMENT_REPORTS_ACTIONS.SET_PROOF, __spreadProps(__spreadValues({}, base), { paymentId, file: driveFile }));
11040
+ toastOk("\u05D4\u05D0\u05E1\u05DE\u05DB\u05EA\u05D0 \u05D4\u05D5\u05E2\u05DC\u05EA\u05D4");
11041
+ await load(true);
11042
+ } catch (e) {
11043
+ toastErr(e);
11044
+ }
11045
+ },
11046
+ onRemoveProof: async (paymentId) => {
11047
+ try {
11048
+ const res = await runAction(executeAction, PAYMENT_REPORTS_ACTIONS.SET_PROOF, __spreadProps(__spreadValues({}, base), { paymentId, file: null }));
11049
+ if (res == null ? void 0 : res.fileWarning) addToast({ type: "warning", message: res.fileWarning });
11050
+ await load(true);
11051
+ } catch (e) {
11052
+ toastErr(e);
11053
+ }
11054
+ }
11055
+ };
11056
+ const runConfirmed = async () => {
11057
+ if (!confirm) return;
11058
+ setConfirmBusy(true);
11059
+ try {
11060
+ if (confirm.kind === "deleteReports") {
11061
+ await runAction(executeAction, "DELETE_RECORD", { tableId: config.reportsTableId, ids: confirm.ids });
11062
+ toastOk("\u05D4\u05D3\u05D9\u05D5\u05D5\u05D7 \u05E0\u05DE\u05D7\u05E7");
11063
+ } else if (confirm.kind === "cancelPayment") {
11064
+ const res = await runAction(executeAction, PAYMENT_REPORTS_ACTIONS.CANCEL_PAYMENT, __spreadProps(__spreadValues({}, base), { paymentId: confirm.payment.id }));
11065
+ toastOk("\u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05D1\u05D5\u05D8\u05DC \u05D5\u05D4\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05D7\u05D6\u05E8\u05D5 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA \u05D4\u05E8\u05D0\u05E9\u05D5\u05E0\u05D4");
11066
+ if (res == null ? void 0 : res.fileWarning) addToast({ type: "warning", message: res.fileWarning });
11067
+ } else {
11068
+ await runAction(executeAction, PAYMENT_REPORTS_ACTIONS.UNDO_RECEIPT, __spreadProps(__spreadValues({}, base), { paymentId: confirm.payment.id }));
11069
+ toastOk('\u05D0\u05D9\u05E9\u05D5\u05E8 \u05D4\u05E7\u05D1\u05DC\u05D4 \u05D1\u05D5\u05D8\u05DC \u05D5\u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05D7\u05D6\u05E8 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA "\u05E9\u05D5\u05DC\u05DD \u05DC\u05DE\u05D3\u05E8\u05D9\u05DB\u05D9\u05DD"');
11070
+ }
11071
+ setConfirm(null);
11072
+ await load(true);
11073
+ } catch (e) {
11074
+ toastErr(e);
11075
+ } finally {
11076
+ setConfirmBusy(false);
11077
+ }
11078
+ };
11079
+ if (!config || missing.length) {
11080
+ return /* @__PURE__ */ jsx30("div", { dir: "rtl", className: "p-6 rounded-xl border border-dashed border-slate-300 text-slate-500 text-sm text-center", children: '\u05D4\u05E8\u05DB\u05D9\u05D1 "\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05DC\u05EA\u05E9\u05DC\u05D5\u05DD" \u05E2\u05D3\u05D9\u05D9\u05DF \u05DC\u05D0 \u05D4\u05D5\u05D2\u05D3\u05E8 \u05D1\u05DE\u05DC\u05D5\u05D0\u05D5. \u05D9\u05E9 \u05DC\u05D4\u05E9\u05DC\u05D9\u05DD \u05D0\u05EA \u05D4\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D1\u05E2\u05D5\u05E8\u05DA \u05D4\u05E2\u05DE\u05D5\u05D3.' });
11081
+ }
11082
+ const tabs = [
11083
+ { key: "unpaid", label: "\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD (\u05D8\u05E8\u05DD \u05E9\u05D5\u05DC\u05DE\u05D5)", count: unpaidCount },
11084
+ { key: "paid", label: "\u05E9\u05D5\u05DC\u05DD (\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05E7\u05D1\u05DC\u05D4)", count: model.payments.filter((p) => !p.receiptDate).length },
11085
+ { key: "receipts", label: '\u05E7\u05D1\u05DC\u05D5\u05EA \u05D5\u05D4\u05E0\u05D4"\u05D7', count: model.payments.filter((p) => !!p.receiptDate).length }
11086
+ ];
11087
+ return /* @__PURE__ */ jsxs24("div", { dir: "rtl", className: `w-full flex flex-col gap-4 ${className || ""}`, children: [
11088
+ config.title && /* @__PURE__ */ jsx30("h2", { className: "text-2xl font-bold text-slate-800", children: config.title }),
11089
+ canEdit && /* @__PURE__ */ jsx30(PortalLinksBar, { config, componentId: props.componentId }),
11090
+ /* @__PURE__ */ jsx30("div", { className: "flex border-b border-slate-200 overflow-x-auto", children: tabs.map((t) => /* @__PURE__ */ jsxs24(
11091
+ "button",
11092
+ {
11093
+ type: "button",
11094
+ onClick: () => setTab(t.key),
11095
+ className: `px-5 py-3 text-sm font-semibold whitespace-nowrap border-b-2 -mb-px cursor-pointer ${tab === t.key ? "border-blue-600 text-blue-700" : "border-transparent text-slate-500 hover:text-slate-800"}`,
11096
+ children: [
11097
+ t.label,
11098
+ " ",
11099
+ /* @__PURE__ */ jsxs24("span", { className: "text-xs opacity-70", children: [
11100
+ "(",
11101
+ t.count,
11102
+ ")"
11103
+ ] })
11104
+ ]
11105
+ },
11106
+ t.key
11107
+ )) }),
11108
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-wrap items-center gap-3", children: [
11109
+ /* @__PURE__ */ jsx30(
11110
+ "input",
11111
+ {
11112
+ type: "text",
11113
+ value: search,
11114
+ onChange: (e) => setSearch(e.target.value),
11115
+ placeholder: "\u05D7\u05D9\u05E4\u05D5\u05E9 \u05D7\u05D5\u05E4\u05E9\u05D9...",
11116
+ className: "border border-slate-300 rounded-lg px-3 py-2 text-sm bg-white w-64"
11117
+ }
11118
+ ),
11119
+ config.reportDateColumn && /* @__PURE__ */ jsxs24(
11120
+ "select",
11121
+ {
11122
+ value: month,
11123
+ onChange: (e) => setMonth(e.target.value),
11124
+ className: "border border-slate-300 rounded-lg px-3 py-2 text-sm bg-white",
11125
+ children: [
11126
+ /* @__PURE__ */ jsx30("option", { value: "", children: "\u05DB\u05DC \u05D4\u05D7\u05D5\u05D3\u05E9\u05D9\u05DD" }),
11127
+ months.map((m) => /* @__PURE__ */ jsx30("option", { value: m, children: monthLabel(m) }, m))
11128
+ ]
11129
+ }
11130
+ )
11131
+ ] }),
11132
+ error && /* @__PURE__ */ jsxs24("div", { className: "rounded-lg bg-rose-50 border border-rose-200 text-rose-700 text-sm px-4 py-3 flex items-center justify-between", children: [
11133
+ /* @__PURE__ */ jsx30("span", { children: error }),
11134
+ /* @__PURE__ */ jsx30("button", { type: "button", onClick: () => load(), className: "underline cursor-pointer", children: "\u05E0\u05E1\u05D4 \u05E9\u05D5\u05D1" })
11135
+ ] }),
11136
+ loading ? /* @__PURE__ */ jsx30("div", { className: "py-16 text-center text-slate-400 text-sm", children: "\u05D8\u05D5\u05E2\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9\u05DD..." }) : tab === "unpaid" ? /* @__PURE__ */ jsx30(
11137
+ UnpaidReportsTab,
11138
+ {
11139
+ config,
11140
+ symbol,
11141
+ canEdit,
11142
+ reports: reportsInMonth,
11143
+ columns: reportsRes.columns,
11144
+ relationOptions: reportsRes.relationOptions,
11145
+ search,
11146
+ showPaid,
11147
+ onToggleShowPaid: setShowPaid,
11148
+ paymentLabels,
11149
+ handlers
11150
+ }
11151
+ ) : tab === "paid" ? /* @__PURE__ */ jsx30(PaidPaymentsTab, { config, symbol, canEdit, payments: pendingPayments, search, handlers }) : /* @__PURE__ */ jsx30(ReceiptsTab, { config, symbol, canEdit, payments: receivedPayments, search, handlers }),
11152
+ details && /* @__PURE__ */ jsx30(
11153
+ PaymentDetailsModal,
11154
+ {
11155
+ payment: model.payments.find((p) => p.id === details.id) || details,
11156
+ config,
11157
+ symbol,
11158
+ columns: reportsRes.columns,
11159
+ relationOptions: reportsRes.relationOptions,
11160
+ onClose: () => setDetails(null)
11161
+ }
11162
+ ),
11163
+ confirm && /* @__PURE__ */ jsx30(
11164
+ ConfirmModal,
11165
+ {
11166
+ danger: true,
11167
+ busy: confirmBusy,
11168
+ title: confirm.kind === "deleteReports" ? "\u05DE\u05D7\u05D9\u05E7\u05EA \u05D3\u05D9\u05D5\u05D5\u05D7" : confirm.kind === "cancelPayment" ? "\u05D1\u05D9\u05D8\u05D5\u05DC \u05EA\u05E9\u05DC\u05D5\u05DD" : "\u05D1\u05D9\u05D8\u05D5\u05DC \u05D0\u05D9\u05E9\u05D5\u05E8 \u05E7\u05D1\u05DC\u05D4",
11169
+ confirmLabel: confirm.kind === "deleteReports" ? "\u05DE\u05D7\u05E7" : "\u05D1\u05D8\u05DC",
11170
+ onConfirm: runConfirmed,
11171
+ onClose: () => setConfirm(null),
11172
+ message: confirm.kind === "deleteReports" ? /* @__PURE__ */ jsx30("p", { children: "\u05DC\u05DE\u05D7\u05D5\u05E7 \u05D0\u05EA \u05D4\u05D3\u05D9\u05D5\u05D5\u05D7? \u05D4\u05E4\u05E2\u05D5\u05DC\u05D4 \u05D0\u05D9\u05E0\u05D4 \u05D4\u05E4\u05D9\u05DB\u05D4." }) : confirm.kind === "cancelPayment" ? /* @__PURE__ */ jsxs24("p", { children: [
11173
+ '\u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05D9\u05D9\u05DE\u05D7\u05E7, \u05D4\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD \u05D9\u05D7\u05D6\u05E8\u05D5 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA "\u05D3\u05D9\u05D5\u05D5\u05D7\u05D9\u05DD (\u05D8\u05E8\u05DD \u05E9\u05D5\u05DC\u05DE\u05D5)"',
11174
+ confirm.payment.proof.length > 0 ? ", \u05D5\u05D4\u05D0\u05E1\u05DE\u05DB\u05EA\u05D0 \u05EA\u05D9\u05DE\u05D7\u05E7 \u05D2\u05DD \u05DE-Google Drive" : "",
11175
+ ". \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA?"
11176
+ ] }) : /* @__PURE__ */ jsx30("p", { children: '\u05D0\u05D9\u05E9\u05D5\u05E8 \u05D4\u05E7\u05D1\u05DC\u05D4 \u05D9\u05D1\u05D5\u05D8\u05DC \u05D5\u05D4\u05EA\u05E9\u05DC\u05D5\u05DD \u05D9\u05D7\u05D6\u05D5\u05E8 \u05DC\u05DC\u05E9\u05D5\u05E0\u05D9\u05EA "\u05E9\u05D5\u05DC\u05DD (\u05DE\u05DE\u05EA\u05D9\u05DF \u05DC\u05E7\u05D1\u05DC\u05D4)". \u05DC\u05D4\u05DE\u05E9\u05D9\u05DA?' })
11177
+ }
11178
+ )
11179
+ ] });
11180
+ };
11181
+
9970
11182
  // src/components/WhatsAppComponent/WhatsAppComponent.tsx
9971
- import React21 from "react";
11183
+ import React26 from "react";
9972
11184
  import { CheckCircle2 as CheckCircle24, AlertCircle as AlertCircle5, X as X12, Loader2 as Loader28, Phone as Phone4, Send as Send3, Image as ImageIcon3, FileText as FileText4, Video as Video3 } from "lucide-react";
9973
11185
 
9974
11186
  // src/components/WhatsAppComponent/CreateTemplateModal.tsx
9975
- import { useState as useState18, useEffect as useEffect15, useRef as useRef15, useMemo as useMemo10 } from "react";
11187
+ import { useState as useState23, useEffect as useEffect16, useRef as useRef18, useMemo as useMemo14 } from "react";
9976
11188
  import {
9977
11189
  X as X9,
9978
11190
  Plus,
@@ -10115,7 +11327,7 @@ function readFileAsBase64(file) {
10115
11327
  }
10116
11328
 
10117
11329
  // src/components/WhatsAppComponent/CreateTemplateModal.tsx
10118
- import { Fragment as Fragment4, jsx as jsx22, jsxs as jsxs18 } from "react/jsx-runtime";
11330
+ import { Fragment as Fragment6, jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
10119
11331
  function CreateTemplateModal({
10120
11332
  isOpen,
10121
11333
  onClose,
@@ -10125,26 +11337,26 @@ function CreateTemplateModal({
10125
11337
  executeAction,
10126
11338
  orgId
10127
11339
  }) {
10128
- const [templateName, setTemplateName] = useState18("");
10129
- const [language, setLanguage] = useState18("he");
10130
- const [category, setCategory] = useState18("MARKETING");
10131
- const [bodyText, setBodyText] = useState18("");
10132
- const [variableSamples, setVariableSamples] = useState18({});
10133
- const [hasFileHeader, setHasFileHeader] = useState18(false);
10134
- const [selectedFile, setSelectedFile] = useState18(null);
10135
- const [fileBase64, setFileBase64] = useState18("");
10136
- const [buttons, setButtons] = useState18([]);
10137
- const [isAddButtonOpen, setIsAddButtonOpen] = useState18(false);
10138
- const addButtonDropdownRef = useRef15(null);
10139
- const [isSubmitting, setIsSubmitting] = useState18(false);
10140
- const [submittingStep, setSubmittingStep] = useState18("");
10141
- const [submitError, setSubmitError] = useState18(null);
10142
- const [fileError, setFileError] = useState18(null);
10143
- const textareaRef = useRef15(null);
10144
- const fileInputRef = useRef15(null);
10145
- const emojiPickerRef = useRef15(null);
10146
- const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState18(false);
10147
- useEffect15(() => {
11340
+ const [templateName, setTemplateName] = useState23("");
11341
+ const [language, setLanguage] = useState23("he");
11342
+ const [category, setCategory] = useState23("MARKETING");
11343
+ const [bodyText, setBodyText] = useState23("");
11344
+ const [variableSamples, setVariableSamples] = useState23({});
11345
+ const [hasFileHeader, setHasFileHeader] = useState23(false);
11346
+ const [selectedFile, setSelectedFile] = useState23(null);
11347
+ const [fileBase64, setFileBase64] = useState23("");
11348
+ const [buttons, setButtons] = useState23([]);
11349
+ const [isAddButtonOpen, setIsAddButtonOpen] = useState23(false);
11350
+ const addButtonDropdownRef = useRef18(null);
11351
+ const [isSubmitting, setIsSubmitting] = useState23(false);
11352
+ const [submittingStep, setSubmittingStep] = useState23("");
11353
+ const [submitError, setSubmitError] = useState23(null);
11354
+ const [fileError, setFileError] = useState23(null);
11355
+ const textareaRef = useRef18(null);
11356
+ const fileInputRef = useRef18(null);
11357
+ const emojiPickerRef = useRef18(null);
11358
+ const [isEmojiPickerOpen, setIsEmojiPickerOpen] = useState23(false);
11359
+ useEffect16(() => {
10148
11360
  function handleClickOutside(event) {
10149
11361
  if (emojiPickerRef.current && !emojiPickerRef.current.contains(event.target)) {
10150
11362
  setIsEmojiPickerOpen(false);
@@ -10168,7 +11380,7 @@ function CreateTemplateModal({
10168
11380
  document.removeEventListener("keydown", handleKeyDown2);
10169
11381
  };
10170
11382
  }, [isEmojiPickerOpen, isAddButtonOpen]);
10171
- useEffect15(() => {
11383
+ useEffect16(() => {
10172
11384
  if (isOpen) {
10173
11385
  setTemplateName("");
10174
11386
  setLanguage("he");
@@ -10187,10 +11399,10 @@ function CreateTemplateModal({
10187
11399
  setIsEmojiPickerOpen(false);
10188
11400
  }
10189
11401
  }, [isOpen]);
10190
- const uniqueVariables = useMemo10(() => {
11402
+ const uniqueVariables = useMemo14(() => {
10191
11403
  return extractUniqueVariableIndices(bodyText);
10192
11404
  }, [bodyText]);
10193
- useEffect15(() => {
11405
+ useEffect16(() => {
10194
11406
  setVariableSamples((prev) => {
10195
11407
  const next = {};
10196
11408
  uniqueVariables.forEach((idx) => {
@@ -10201,7 +11413,7 @@ function CreateTemplateModal({
10201
11413
  }, [uniqueVariables]);
10202
11414
  const isNameEmpty = templateName.trim().length === 0;
10203
11415
  const isNamePatternValid = isValidTemplateName(templateName);
10204
- const isNameDuplicate = useMemo10(() => {
11416
+ const isNameDuplicate = useMemo14(() => {
10205
11417
  const trimmedName = templateName.trim().toLowerCase();
10206
11418
  if (!trimmedName) return false;
10207
11419
  if (existingTemplates && existingTemplates.length > 0) {
@@ -10211,9 +11423,9 @@ function CreateTemplateModal({
10211
11423
  }
10212
11424
  return isDuplicateTemplateName(trimmedName, existingTemplateNames, language);
10213
11425
  }, [templateName, language, existingTemplates, existingTemplateNames]);
10214
- const ratioInfo = useMemo10(() => validateWordToVariableRatio(bodyText), [bodyText]);
10215
- const seqInfo = useMemo10(() => validateSequentialVariables(bodyText), [bodyText]);
10216
- const validationResult = useMemo10(() => {
11426
+ const ratioInfo = useMemo14(() => validateWordToVariableRatio(bodyText), [bodyText]);
11427
+ const seqInfo = useMemo14(() => validateSequentialVariables(bodyText), [bodyText]);
11428
+ const validationResult = useMemo14(() => {
10217
11429
  return validateWhatsAppTemplate({
10218
11430
  name: templateName,
10219
11431
  language,
@@ -10467,12 +11679,12 @@ function CreateTemplateModal({
10467
11679
  }
10468
11680
  };
10469
11681
  if (!isOpen) return null;
10470
- return /* @__PURE__ */ jsx22(
11682
+ return /* @__PURE__ */ jsx31(
10471
11683
  "div",
10472
11684
  {
10473
11685
  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",
10474
11686
  dir: "rtl",
10475
- children: /* @__PURE__ */ jsxs18(
11687
+ children: /* @__PURE__ */ jsxs25(
10476
11688
  "div",
10477
11689
  {
10478
11690
  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",
@@ -10480,43 +11692,43 @@ function CreateTemplateModal({
10480
11692
  "aria-modal": "true",
10481
11693
  "aria-labelledby": "modal-title",
10482
11694
  children: [
10483
- /* @__PURE__ */ jsxs18("div", { className: "px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
10484
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2.5", children: [
10485
- /* @__PURE__ */ jsx22("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx22(Plus, { className: "w-4 h-4" }) }),
10486
- /* @__PURE__ */ jsxs18("div", { children: [
10487
- /* @__PURE__ */ jsx22("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" }),
10488
- /* @__PURE__ */ jsx22("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" })
11695
+ /* @__PURE__ */ jsxs25("div", { className: "px-6 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
11696
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2.5", children: [
11697
+ /* @__PURE__ */ jsx31("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx31(Plus, { className: "w-4 h-4" }) }),
11698
+ /* @__PURE__ */ jsxs25("div", { children: [
11699
+ /* @__PURE__ */ jsx31("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" }),
11700
+ /* @__PURE__ */ jsx31("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" })
10489
11701
  ] })
10490
11702
  ] }),
10491
- /* @__PURE__ */ jsx22(
11703
+ /* @__PURE__ */ jsx31(
10492
11704
  "button",
10493
11705
  {
10494
11706
  type: "button",
10495
11707
  onClick: onClose,
10496
11708
  className: "p-1.5 text-slate-400 hover:text-slate-700 hover:bg-slate-200/60 rounded-lg transition-colors cursor-pointer",
10497
11709
  "aria-label": "\u05E1\u05D2\u05D5\u05E8",
10498
- children: /* @__PURE__ */ jsx22(X9, { className: "w-5 h-5" })
11710
+ children: /* @__PURE__ */ jsx31(X9, { className: "w-5 h-5" })
10499
11711
  }
10500
11712
  )
10501
11713
  ] }),
10502
- /* @__PURE__ */ jsxs18("form", { onSubmit: handleSubmit, className: "flex flex-col overflow-hidden flex-1", children: [
10503
- /* @__PURE__ */ jsxs18("div", { className: "p-6 overflow-y-auto space-y-5 flex-1", children: [
10504
- submitError && /* @__PURE__ */ jsxs18("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-800 flex items-center gap-2", children: [
10505
- /* @__PURE__ */ jsx22(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
10506
- /* @__PURE__ */ jsx22("span", { children: submitError })
11714
+ /* @__PURE__ */ jsxs25("form", { onSubmit: handleSubmit, className: "flex flex-col overflow-hidden flex-1", children: [
11715
+ /* @__PURE__ */ jsxs25("div", { className: "p-6 overflow-y-auto space-y-5 flex-1", children: [
11716
+ submitError && /* @__PURE__ */ jsxs25("div", { className: "p-3 bg-rose-50 border border-rose-200 rounded-xl text-xs text-rose-800 flex items-center gap-2", children: [
11717
+ /* @__PURE__ */ jsx31(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
11718
+ /* @__PURE__ */ jsx31("span", { children: submitError })
10507
11719
  ] }),
10508
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", children: [
10509
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
10510
- /* @__PURE__ */ jsxs18("label", { className: "block text-xs font-bold text-slate-800", children: [
11720
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1.5", children: [
11721
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between", children: [
11722
+ /* @__PURE__ */ jsxs25("label", { className: "block text-xs font-bold text-slate-800", children: [
10511
11723
  "\u05E9\u05DD \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4 ",
10512
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
11724
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
10513
11725
  ] }),
10514
- templateName && isNamePatternValid && !isNameDuplicate && /* @__PURE__ */ jsxs18("span", { className: "text-[11px] text-emerald-600 font-semibold flex items-center gap-1", children: [
10515
- /* @__PURE__ */ jsx22(CheckCircle22, { className: "w-3.5 h-3.5" }),
11726
+ templateName && isNamePatternValid && !isNameDuplicate && /* @__PURE__ */ jsxs25("span", { className: "text-[11px] text-emerald-600 font-semibold flex items-center gap-1", children: [
11727
+ /* @__PURE__ */ jsx31(CheckCircle22, { className: "w-3.5 h-3.5" }),
10516
11728
  " \u05E9\u05DD \u05EA\u05E7\u05D9\u05DF"
10517
11729
  ] })
10518
11730
  ] }),
10519
- /* @__PURE__ */ jsx22(
11731
+ /* @__PURE__ */ jsx31(
10520
11732
  "input",
10521
11733
  {
10522
11734
  type: "text",
@@ -10528,47 +11740,47 @@ function CreateTemplateModal({
10528
11740
  required: true
10529
11741
  }
10530
11742
  ),
10531
- /* @__PURE__ */ jsx22("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." }),
10532
- !isNameEmpty && isNameDuplicate && /* @__PURE__ */ jsxs18("p", { className: "text-[11px] text-rose-600 font-semibold flex items-center gap-1 mt-1", children: [
10533
- /* @__PURE__ */ jsx22(AlertCircle2, { className: "w-3.5 h-3.5 shrink-0" }),
11743
+ /* @__PURE__ */ jsx31("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." }),
11744
+ !isNameEmpty && isNameDuplicate && /* @__PURE__ */ jsxs25("p", { className: "text-[11px] text-rose-600 font-semibold flex items-center gap-1 mt-1", children: [
11745
+ /* @__PURE__ */ jsx31(AlertCircle2, { className: "w-3.5 h-3.5 shrink-0" }),
10534
11746
  "\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 (",
10535
11747
  language,
10536
11748
  "). \u05D0\u05E0\u05D0 \u05D1\u05D7\u05E8 \u05E9\u05DD \u05D9\u05D9\u05D7\u05D5\u05D3\u05D9 \u05D0\u05D5 \u05E9\u05E4\u05D4 \u05D0\u05D7\u05E8\u05EA."
10537
11749
  ] })
10538
11750
  ] }),
10539
- /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-4", children: [
10540
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", children: [
10541
- /* @__PURE__ */ jsx22("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E9\u05E4\u05D4" }),
10542
- /* @__PURE__ */ jsx22(
11751
+ /* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-2 gap-4", children: [
11752
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1.5", children: [
11753
+ /* @__PURE__ */ jsx31("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E9\u05E4\u05D4" }),
11754
+ /* @__PURE__ */ jsx31(
10543
11755
  "select",
10544
11756
  {
10545
11757
  value: language,
10546
11758
  onChange: (e) => setLanguage(e.target.value),
10547
11759
  className: "w-full px-3 py-2 text-xs bg-slate-50 border border-slate-200 rounded-xl text-slate-800 outline-hidden",
10548
- children: LANGUAGE_OPTIONS.map((opt) => /* @__PURE__ */ jsx22("option", { value: opt.value, children: opt.label }, opt.value))
11760
+ children: LANGUAGE_OPTIONS.map((opt) => /* @__PURE__ */ jsx31("option", { value: opt.value, children: opt.label }, opt.value))
10549
11761
  }
10550
11762
  )
10551
11763
  ] }),
10552
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1.5", children: [
10553
- /* @__PURE__ */ jsx22("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E7\u05D8\u05D2\u05D5\u05E8\u05D9\u05D4" }),
10554
- /* @__PURE__ */ jsx22(
11764
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1.5", children: [
11765
+ /* @__PURE__ */ jsx31("label", { className: "block text-xs font-semibold text-slate-700", children: "\u05E7\u05D8\u05D2\u05D5\u05E8\u05D9\u05D4" }),
11766
+ /* @__PURE__ */ jsx31(
10555
11767
  "select",
10556
11768
  {
10557
11769
  value: category,
10558
11770
  onChange: (e) => setCategory(e.target.value),
10559
11771
  className: "w-full px-3 py-2 text-xs bg-slate-50 border border-slate-200 rounded-xl text-slate-800 outline-hidden",
10560
- children: CATEGORY_OPTIONS.map((opt) => /* @__PURE__ */ jsx22("option", { value: opt.value, children: opt.label }, opt.value))
11772
+ children: CATEGORY_OPTIONS.map((opt) => /* @__PURE__ */ jsx31("option", { value: opt.value, children: opt.label }, opt.value))
10561
11773
  }
10562
11774
  )
10563
11775
  ] })
10564
11776
  ] }),
10565
- /* @__PURE__ */ jsxs18("div", { className: "space-y-2", children: [
10566
- /* @__PURE__ */ jsxs18("label", { className: "block text-xs font-bold text-slate-800", children: [
11777
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-2", children: [
11778
+ /* @__PURE__ */ jsxs25("label", { className: "block text-xs font-bold text-slate-800", children: [
10567
11779
  "\u05EA\u05D5\u05DB\u05DF \u05D2\u05D5\u05E3 \u05D4\u05D4\u05D5\u05D3\u05E2\u05D4 ",
10568
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
11780
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
10569
11781
  ] }),
10570
- /* @__PURE__ */ jsxs18("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: [
10571
- /* @__PURE__ */ jsx22(
11782
+ /* @__PURE__ */ jsxs25("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: [
11783
+ /* @__PURE__ */ jsx31(
10572
11784
  "textarea",
10573
11785
  {
10574
11786
  ref: textareaRef,
@@ -10583,14 +11795,14 @@ function CreateTemplateModal({
10583
11795
  required: true
10584
11796
  }
10585
11797
  ),
10586
- /* @__PURE__ */ jsxs18(
11798
+ /* @__PURE__ */ jsxs25(
10587
11799
  "div",
10588
11800
  {
10589
11801
  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",
10590
11802
  dir: language === "en_US" ? "ltr" : "rtl",
10591
11803
  children: [
10592
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1", children: [
10593
- /* @__PURE__ */ jsx22(
11804
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1", children: [
11805
+ /* @__PURE__ */ jsx31(
10594
11806
  "button",
10595
11807
  {
10596
11808
  type: "button",
@@ -10598,10 +11810,10 @@ function CreateTemplateModal({
10598
11810
  onClick: () => handleApplyFormatting("*"),
10599
11811
  title: "\u05DE\u05D5\u05D3\u05D2\u05E9 (Bold) *\u05D8\u05E7\u05E1\u05D8*",
10600
11812
  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",
10601
- children: /* @__PURE__ */ jsx22(Bold, { className: "w-3.5 h-3.5" })
11813
+ children: /* @__PURE__ */ jsx31(Bold, { className: "w-3.5 h-3.5" })
10602
11814
  }
10603
11815
  ),
10604
- /* @__PURE__ */ jsx22(
11816
+ /* @__PURE__ */ jsx31(
10605
11817
  "button",
10606
11818
  {
10607
11819
  type: "button",
@@ -10609,10 +11821,10 @@ function CreateTemplateModal({
10609
11821
  onClick: () => handleApplyFormatting("_"),
10610
11822
  title: "\u05E0\u05D8\u05D5\u05D9 (Italic) _\u05D8\u05E7\u05E1\u05D8_",
10611
11823
  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",
10612
- children: /* @__PURE__ */ jsx22(Italic, { className: "w-3.5 h-3.5" })
11824
+ children: /* @__PURE__ */ jsx31(Italic, { className: "w-3.5 h-3.5" })
10613
11825
  }
10614
11826
  ),
10615
- /* @__PURE__ */ jsx22(
11827
+ /* @__PURE__ */ jsx31(
10616
11828
  "button",
10617
11829
  {
10618
11830
  type: "button",
@@ -10620,12 +11832,12 @@ function CreateTemplateModal({
10620
11832
  onClick: () => handleApplyFormatting("~"),
10621
11833
  title: "\u05E7\u05D5 \u05D7\u05D5\u05E6\u05D4 (Strikethrough) ~\u05D8\u05E7\u05E1\u05D8~",
10622
11834
  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",
10623
- children: /* @__PURE__ */ jsx22(Strikethrough, { className: "w-3.5 h-3.5" })
11835
+ children: /* @__PURE__ */ jsx31(Strikethrough, { className: "w-3.5 h-3.5" })
10624
11836
  }
10625
11837
  ),
10626
- /* @__PURE__ */ jsx22("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
10627
- /* @__PURE__ */ jsxs18("div", { className: "relative inline-block", ref: emojiPickerRef, children: [
10628
- /* @__PURE__ */ jsx22(
11838
+ /* @__PURE__ */ jsx31("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
11839
+ /* @__PURE__ */ jsxs25("div", { className: "relative inline-block", ref: emojiPickerRef, children: [
11840
+ /* @__PURE__ */ jsx31(
10629
11841
  "button",
10630
11842
  {
10631
11843
  type: "button",
@@ -10633,16 +11845,16 @@ function CreateTemplateModal({
10633
11845
  onClick: () => setIsEmojiPickerOpen(!isEmojiPickerOpen),
10634
11846
  title: "\u05D4\u05D5\u05E1\u05E3 \u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9 (Emoji)",
10635
11847
  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"}`,
10636
- children: /* @__PURE__ */ jsx22(Smile, { className: "w-4 h-4" })
11848
+ children: /* @__PURE__ */ jsx31(Smile, { className: "w-4 h-4" })
10637
11849
  }
10638
11850
  ),
10639
- isEmojiPickerOpen && /* @__PURE__ */ jsx22(
11851
+ isEmojiPickerOpen && /* @__PURE__ */ jsx31(
10640
11852
  "div",
10641
11853
  {
10642
11854
  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`,
10643
11855
  dir: "ltr",
10644
11856
  onMouseDown: (e) => e.stopPropagation(),
10645
- children: /* @__PURE__ */ jsx22(
11857
+ children: /* @__PURE__ */ jsx31(
10646
11858
  EmojiPicker,
10647
11859
  {
10648
11860
  onEmojiClick: (emojiData) => {
@@ -10659,8 +11871,8 @@ function CreateTemplateModal({
10659
11871
  }
10660
11872
  )
10661
11873
  ] }),
10662
- /* @__PURE__ */ jsx22("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
10663
- /* @__PURE__ */ jsxs18(
11874
+ /* @__PURE__ */ jsx31("div", { className: "h-4 w-px bg-slate-200 mx-1" }),
11875
+ /* @__PURE__ */ jsxs25(
10664
11876
  "button",
10665
11877
  {
10666
11878
  type: "button",
@@ -10670,28 +11882,28 @@ function CreateTemplateModal({
10670
11882
  "aria-label": language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4",
10671
11883
  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",
10672
11884
  children: [
10673
- /* @__PURE__ */ jsx22(Plus, { className: "w-3.5 h-3.5" }),
10674
- /* @__PURE__ */ jsx22("span", { children: language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4" })
11885
+ /* @__PURE__ */ jsx31(Plus, { className: "w-3.5 h-3.5" }),
11886
+ /* @__PURE__ */ jsx31("span", { children: language === "en_US" ? "Add variable" : "\u05DE\u05E9\u05EA\u05E0\u05D4" })
10675
11887
  ]
10676
11888
  }
10677
11889
  )
10678
11890
  ] }),
10679
- /* @__PURE__ */ jsxs18(
11891
+ /* @__PURE__ */ jsxs25(
10680
11892
  "div",
10681
11893
  {
10682
11894
  className: "flex items-center gap-1 font-mono text-[11px]",
10683
11895
  dir: "ltr",
10684
11896
  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)",
10685
11897
  children: [
10686
- /* @__PURE__ */ jsx22(
11898
+ /* @__PURE__ */ jsx31(
10687
11899
  "span",
10688
11900
  {
10689
11901
  className: `font-semibold transition-colors ${bodyText.length >= 1024 ? "text-rose-600" : bodyText.length >= 950 ? "text-amber-600" : "text-slate-500"}`,
10690
11902
  children: bodyText.length
10691
11903
  }
10692
11904
  ),
10693
- /* @__PURE__ */ jsx22("span", { className: "text-slate-300", children: "/" }),
10694
- /* @__PURE__ */ jsx22("span", { className: "text-slate-400", children: "1024" })
11905
+ /* @__PURE__ */ jsx31("span", { className: "text-slate-300", children: "/" }),
11906
+ /* @__PURE__ */ jsx31("span", { className: "text-slate-400", children: "1024" })
10695
11907
  ]
10696
11908
  }
10697
11909
  )
@@ -10699,30 +11911,30 @@ function CreateTemplateModal({
10699
11911
  }
10700
11912
  )
10701
11913
  ] }),
10702
- /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap items-center justify-between text-[11px] text-slate-400 px-1 gap-2", children: /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-3", children: [
10703
- /* @__PURE__ */ jsxs18("span", { children: [
11914
+ /* @__PURE__ */ jsx31("div", { className: "flex flex-wrap items-center justify-between text-[11px] text-slate-400 px-1 gap-2", children: /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-3", children: [
11915
+ /* @__PURE__ */ jsxs25("span", { children: [
10704
11916
  ratioInfo.staticWordsCount,
10705
11917
  " \u05DE\u05D9\u05DC\u05D9\u05DD"
10706
11918
  ] }),
10707
- /* @__PURE__ */ jsxs18("span", { children: [
11919
+ /* @__PURE__ */ jsxs25("span", { children: [
10708
11920
  ratioInfo.variableCount,
10709
11921
  " \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD"
10710
11922
  ] })
10711
11923
  ] }) }),
10712
- uniqueVariables.length > 0 && /* @__PURE__ */ jsxs18("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
10713
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 text-xs font-bold text-slate-800", children: [
10714
- /* @__PURE__ */ jsx22(Info2, { className: "w-4 h-4 text-emerald-600" }),
10715
- /* @__PURE__ */ jsx22("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)" })
11924
+ uniqueVariables.length > 0 && /* @__PURE__ */ jsxs25("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
11925
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1.5 text-xs font-bold text-slate-800", children: [
11926
+ /* @__PURE__ */ jsx31(Info2, { className: "w-4 h-4 text-emerald-600" }),
11927
+ /* @__PURE__ */ jsx31("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)" })
10716
11928
  ] }),
10717
- /* @__PURE__ */ jsx22("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." }),
10718
- /* @__PURE__ */ jsx22("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1", children: uniqueVariables.map((idx) => /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
10719
- /* @__PURE__ */ jsxs18("label", { className: "block text-[11px] font-semibold text-slate-700 font-mono", children: [
11929
+ /* @__PURE__ */ jsx31("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." }),
11930
+ /* @__PURE__ */ jsx31("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3 pt-1", children: uniqueVariables.map((idx) => /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
11931
+ /* @__PURE__ */ jsxs25("label", { className: "block text-[11px] font-semibold text-slate-700 font-mono", children: [
10720
11932
  "\u05D3\u05D5\u05D2\u05DE\u05D4 \u05E2\u05D1\u05D5\u05E8 ",
10721
11933
  `{{${idx}}}`,
10722
11934
  " ",
10723
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
11935
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
10724
11936
  ] }),
10725
- /* @__PURE__ */ jsx22(
11937
+ /* @__PURE__ */ jsx31(
10726
11938
  "input",
10727
11939
  {
10728
11940
  type: "text",
@@ -10737,21 +11949,21 @@ function CreateTemplateModal({
10737
11949
  )
10738
11950
  ] }, idx)) })
10739
11951
  ] }),
10740
- bodyText.trim().length > 0 && validationResult.errors.length > 0 && /* @__PURE__ */ jsxs18("div", { className: "p-3.5 bg-amber-50 border border-amber-200 rounded-xl space-y-1.5 text-xs text-amber-900", children: [
10741
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-1.5 font-bold", children: [
10742
- /* @__PURE__ */ jsx22(AlertCircle2, { className: "w-4 h-4 text-amber-600 shrink-0" }),
10743
- /* @__PURE__ */ jsx22("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:" })
11952
+ bodyText.trim().length > 0 && validationResult.errors.length > 0 && /* @__PURE__ */ jsxs25("div", { className: "p-3.5 bg-amber-50 border border-amber-200 rounded-xl space-y-1.5 text-xs text-amber-900", children: [
11953
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-1.5 font-bold", children: [
11954
+ /* @__PURE__ */ jsx31(AlertCircle2, { className: "w-4 h-4 text-amber-600 shrink-0" }),
11955
+ /* @__PURE__ */ jsx31("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:" })
10744
11956
  ] }),
10745
- /* @__PURE__ */ jsx22("ul", { className: "list-disc list-inside space-y-1 text-[11px] pr-2 leading-relaxed", children: validationResult.errors.map((err, i) => /* @__PURE__ */ jsx22("li", { children: err }, i)) })
11957
+ /* @__PURE__ */ jsx31("ul", { className: "list-disc list-inside space-y-1 text-[11px] pr-2 leading-relaxed", children: validationResult.errors.map((err, i) => /* @__PURE__ */ jsx31("li", { children: err }, i)) })
10746
11958
  ] })
10747
11959
  ] }),
10748
- /* @__PURE__ */ jsxs18("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
10749
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
10750
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
10751
- /* @__PURE__ */ jsx22(Paperclip, { className: "w-4 h-4 text-slate-600" }),
10752
- /* @__PURE__ */ jsx22("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)" })
11960
+ /* @__PURE__ */ jsxs25("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3", children: [
11961
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between", children: [
11962
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
11963
+ /* @__PURE__ */ jsx31(Paperclip, { className: "w-4 h-4 text-slate-600" }),
11964
+ /* @__PURE__ */ jsx31("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)" })
10753
11965
  ] }),
10754
- /* @__PURE__ */ jsx22(
11966
+ /* @__PURE__ */ jsx31(
10755
11967
  "input",
10756
11968
  {
10757
11969
  type: "checkbox",
@@ -10767,12 +11979,12 @@ function CreateTemplateModal({
10767
11979
  }
10768
11980
  )
10769
11981
  ] }),
10770
- hasFileHeader && /* @__PURE__ */ jsxs18("div", { className: "space-y-3 pt-1", children: [
10771
- fileError && /* @__PURE__ */ jsxs18("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: [
10772
- /* @__PURE__ */ jsx22(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
10773
- /* @__PURE__ */ jsx22("span", { children: fileError })
11982
+ hasFileHeader && /* @__PURE__ */ jsxs25("div", { className: "space-y-3 pt-1", children: [
11983
+ fileError && /* @__PURE__ */ jsxs25("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: [
11984
+ /* @__PURE__ */ jsx31(AlertCircle2, { className: "w-4 h-4 text-rose-600 shrink-0" }),
11985
+ /* @__PURE__ */ jsx31("span", { children: fileError })
10774
11986
  ] }),
10775
- /* @__PURE__ */ jsx22(
11987
+ /* @__PURE__ */ jsx31(
10776
11988
  "input",
10777
11989
  {
10778
11990
  ref: fileInputRef,
@@ -10782,7 +11994,7 @@ function CreateTemplateModal({
10782
11994
  className: "hidden"
10783
11995
  }
10784
11996
  ),
10785
- !selectedFile && /* @__PURE__ */ jsxs18(
11997
+ !selectedFile && /* @__PURE__ */ jsxs25(
10786
11998
  "button",
10787
11999
  {
10788
12000
  type: "button",
@@ -10792,49 +12004,49 @@ function CreateTemplateModal({
10792
12004
  },
10793
12005
  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",
10794
12006
  children: [
10795
- /* @__PURE__ */ jsx22("div", { className: "w-9 h-9 rounded-full bg-slate-100 text-slate-500 flex items-center justify-center", children: /* @__PURE__ */ jsx22(Upload2, { className: "w-4 h-4" }) }),
10796
- /* @__PURE__ */ jsxs18("div", { className: "text-center", children: [
10797
- /* @__PURE__ */ jsx22("span", { className: "text-xs font-bold text-emerald-700 block", children: "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D7\u05D9\u05E8\u05EA \u05E7\u05D5\u05D1\u05E5" }),
10798
- /* @__PURE__ */ jsx22("span", { className: "text-[10px] text-slate-400", children: "PDF, JPG, PNG, MP4 \u05E2\u05D3 5MB" })
12007
+ /* @__PURE__ */ jsx31("div", { className: "w-9 h-9 rounded-full bg-slate-100 text-slate-500 flex items-center justify-center", children: /* @__PURE__ */ jsx31(Upload2, { className: "w-4 h-4" }) }),
12008
+ /* @__PURE__ */ jsxs25("div", { className: "text-center", children: [
12009
+ /* @__PURE__ */ jsx31("span", { className: "text-xs font-bold text-emerald-700 block", children: "\u05DC\u05D7\u05E5 \u05DC\u05D1\u05D7\u05D9\u05E8\u05EA \u05E7\u05D5\u05D1\u05E5" }),
12010
+ /* @__PURE__ */ jsx31("span", { className: "text-[10px] text-slate-400", children: "PDF, JPG, PNG, MP4 \u05E2\u05D3 5MB" })
10799
12011
  ] })
10800
12012
  ]
10801
12013
  }
10802
12014
  ),
10803
- selectedFile && /* @__PURE__ */ jsxs18("div", { className: "p-3 bg-white border border-emerald-200 rounded-xl flex items-center justify-between gap-3 shadow-2xs", children: [
10804
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2.5 overflow-hidden", children: [
10805
- /* @__PURE__ */ jsx22("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__ */ jsx22(FileText2, { className: "w-4 h-4" }) : selectedFile.type.includes("video") || selectedFile.name.toLowerCase().match(/\.(mp4|mov|avi|webm)$/) ? /* @__PURE__ */ jsx22(Video, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx22(ImageIcon, { className: "w-4 h-4" }) }),
10806
- /* @__PURE__ */ jsxs18("div", { className: "overflow-hidden", children: [
10807
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-bold text-slate-800 truncate", title: selectedFile.name, children: /* @__PURE__ */ jsx22("span", { dir: "ltr", className: "inline-block truncate max-w-full", children: selectedFile.name }) }),
10808
- /* @__PURE__ */ jsx22("p", { className: "text-[10px] text-slate-400", children: /* @__PURE__ */ jsxs18("span", { dir: "ltr", className: "inline-block", children: [
12015
+ selectedFile && /* @__PURE__ */ jsxs25("div", { className: "p-3 bg-white border border-emerald-200 rounded-xl flex items-center justify-between gap-3 shadow-2xs", children: [
12016
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2.5 overflow-hidden", children: [
12017
+ /* @__PURE__ */ jsx31("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__ */ jsx31(FileText2, { className: "w-4 h-4" }) : selectedFile.type.includes("video") || selectedFile.name.toLowerCase().match(/\.(mp4|mov|avi|webm)$/) ? /* @__PURE__ */ jsx31(Video, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx31(ImageIcon, { className: "w-4 h-4" }) }),
12018
+ /* @__PURE__ */ jsxs25("div", { className: "overflow-hidden", children: [
12019
+ /* @__PURE__ */ jsx31("p", { className: "text-xs font-bold text-slate-800 truncate", title: selectedFile.name, children: /* @__PURE__ */ jsx31("span", { dir: "ltr", className: "inline-block truncate max-w-full", children: selectedFile.name }) }),
12020
+ /* @__PURE__ */ jsx31("p", { className: "text-[10px] text-slate-400", children: /* @__PURE__ */ jsxs25("span", { dir: "ltr", className: "inline-block", children: [
10809
12021
  formatFileSize(selectedFile.size),
10810
12022
  selectedFile.type ? ` \u2022 ${selectedFile.type}` : ""
10811
12023
  ] }) })
10812
12024
  ] })
10813
12025
  ] }),
10814
- /* @__PURE__ */ jsx22(
12026
+ /* @__PURE__ */ jsx31(
10815
12027
  "button",
10816
12028
  {
10817
12029
  type: "button",
10818
12030
  onClick: handleRemoveFile,
10819
12031
  className: "p-1 text-slate-400 hover:text-rose-600 rounded-md transition-colors cursor-pointer",
10820
12032
  title: "\u05D4\u05E1\u05E8 \u05E7\u05D5\u05D1\u05E5",
10821
- children: /* @__PURE__ */ jsx22(Trash22, { className: "w-4 h-4" })
12033
+ children: /* @__PURE__ */ jsx31(Trash22, { className: "w-4 h-4" })
10822
12034
  }
10823
12035
  )
10824
12036
  ] })
10825
12037
  ] })
10826
12038
  ] }),
10827
- /* @__PURE__ */ jsxs18("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3.5", children: [
10828
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
10829
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
10830
- /* @__PURE__ */ jsx22(MousePointerClick, { className: "w-4 h-4 text-slate-600" }),
10831
- /* @__PURE__ */ jsxs18("div", { children: [
10832
- /* @__PURE__ */ jsx22("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)" }),
10833
- /* @__PURE__ */ jsx22("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)" })
12039
+ /* @__PURE__ */ jsxs25("div", { className: "p-4 bg-slate-50 border border-slate-200 rounded-xl space-y-3.5", children: [
12040
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between", children: [
12041
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
12042
+ /* @__PURE__ */ jsx31(MousePointerClick, { className: "w-4 h-4 text-slate-600" }),
12043
+ /* @__PURE__ */ jsxs25("div", { children: [
12044
+ /* @__PURE__ */ jsx31("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)" }),
12045
+ /* @__PURE__ */ jsx31("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)" })
10834
12046
  ] })
10835
12047
  ] }),
10836
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
10837
- /* @__PURE__ */ jsxs18(
12048
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
12049
+ /* @__PURE__ */ jsxs25(
10838
12050
  "span",
10839
12051
  {
10840
12052
  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"}`,
@@ -10844,8 +12056,8 @@ function CreateTemplateModal({
10844
12056
  ]
10845
12057
  }
10846
12058
  ),
10847
- /* @__PURE__ */ jsxs18("div", { className: "relative", ref: addButtonDropdownRef, children: [
10848
- /* @__PURE__ */ jsxs18(
12059
+ /* @__PURE__ */ jsxs25("div", { className: "relative", ref: addButtonDropdownRef, children: [
12060
+ /* @__PURE__ */ jsxs25(
10849
12061
  "button",
10850
12062
  {
10851
12063
  type: "button",
@@ -10854,9 +12066,9 @@ function CreateTemplateModal({
10854
12066
  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"}`,
10855
12067
  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",
10856
12068
  children: [
10857
- /* @__PURE__ */ jsx22(Plus, { className: "w-3.5 h-3.5" }),
10858
- /* @__PURE__ */ jsx22("span", { children: "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" }),
10859
- /* @__PURE__ */ jsx22(
12069
+ /* @__PURE__ */ jsx31(Plus, { className: "w-3.5 h-3.5" }),
12070
+ /* @__PURE__ */ jsx31("span", { children: "\u05D4\u05D5\u05E1\u05E3 \u05DB\u05E4\u05EA\u05D5\u05E8" }),
12071
+ /* @__PURE__ */ jsx31(
10860
12072
  ChevronDown3,
10861
12073
  {
10862
12074
  className: `w-3.5 h-3.5 transition-transform ${isAddButtonOpen ? "rotate-180" : ""}`
@@ -10865,63 +12077,63 @@ function CreateTemplateModal({
10865
12077
  ]
10866
12078
  }
10867
12079
  ),
10868
- isAddButtonOpen && /* @__PURE__ */ jsxs18("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: [
10869
- /* @__PURE__ */ jsxs18(
12080
+ isAddButtonOpen && /* @__PURE__ */ jsxs25("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: [
12081
+ /* @__PURE__ */ jsxs25(
10870
12082
  "button",
10871
12083
  {
10872
12084
  type: "button",
10873
12085
  onClick: () => handleAddButton("QUICK_REPLY"),
10874
12086
  className: "w-full p-2 text-right rounded-lg hover:bg-slate-50 flex items-start gap-2.5 transition-colors cursor-pointer group",
10875
12087
  children: [
10876
- /* @__PURE__ */ jsx22("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__ */ jsx22(MessageSquare, { className: "w-3.5 h-3.5" }) }),
10877
- /* @__PURE__ */ jsxs18("div", { children: [
10878
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" }),
10879
- /* @__PURE__ */ jsx22("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" })
12088
+ /* @__PURE__ */ jsx31("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__ */ jsx31(MessageSquare, { className: "w-3.5 h-3.5" }) }),
12089
+ /* @__PURE__ */ jsxs25("div", { children: [
12090
+ /* @__PURE__ */ jsx31("p", { className: "text-xs font-semibold text-slate-800", children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" }),
12091
+ /* @__PURE__ */ jsx31("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" })
10880
12092
  ] })
10881
12093
  ]
10882
12094
  }
10883
12095
  ),
10884
- /* @__PURE__ */ jsxs18(
12096
+ /* @__PURE__ */ jsxs25(
10885
12097
  "button",
10886
12098
  {
10887
12099
  type: "button",
10888
12100
  onClick: () => handleAddButton("URL"),
10889
12101
  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",
10890
12102
  children: [
10891
- /* @__PURE__ */ jsx22("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__ */ jsx22(ExternalLink3, { className: "w-3.5 h-3.5" }) }),
10892
- /* @__PURE__ */ jsxs18("div", { children: [
10893
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" }),
10894
- /* @__PURE__ */ jsx22("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" })
12103
+ /* @__PURE__ */ jsx31("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__ */ jsx31(ExternalLink3, { className: "w-3.5 h-3.5" }) }),
12104
+ /* @__PURE__ */ jsxs25("div", { children: [
12105
+ /* @__PURE__ */ jsx31("p", { className: "text-xs font-semibold text-slate-800", children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" }),
12106
+ /* @__PURE__ */ jsx31("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" })
10895
12107
  ] })
10896
12108
  ]
10897
12109
  }
10898
12110
  ),
10899
- /* @__PURE__ */ jsxs18(
12111
+ /* @__PURE__ */ jsxs25(
10900
12112
  "button",
10901
12113
  {
10902
12114
  type: "button",
10903
12115
  onClick: () => handleAddButton("PHONE_NUMBER"),
10904
12116
  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",
10905
12117
  children: [
10906
- /* @__PURE__ */ jsx22("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__ */ jsx22(Phone, { className: "w-3.5 h-3.5" }) }),
10907
- /* @__PURE__ */ jsxs18("div", { children: [
10908
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" }),
10909
- /* @__PURE__ */ jsx22("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" })
12118
+ /* @__PURE__ */ jsx31("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__ */ jsx31(Phone, { className: "w-3.5 h-3.5" }) }),
12119
+ /* @__PURE__ */ jsxs25("div", { children: [
12120
+ /* @__PURE__ */ jsx31("p", { className: "text-xs font-semibold text-slate-800", children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" }),
12121
+ /* @__PURE__ */ jsx31("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" })
10910
12122
  ] })
10911
12123
  ]
10912
12124
  }
10913
12125
  ),
10914
- /* @__PURE__ */ jsxs18(
12126
+ /* @__PURE__ */ jsxs25(
10915
12127
  "button",
10916
12128
  {
10917
12129
  type: "button",
10918
12130
  onClick: () => handleAddButton("COPY_CODE"),
10919
12131
  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",
10920
12132
  children: [
10921
- /* @__PURE__ */ jsx22("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__ */ jsx22(Copy3, { className: "w-3.5 h-3.5" }) }),
10922
- /* @__PURE__ */ jsxs18("div", { children: [
10923
- /* @__PURE__ */ jsx22("p", { className: "text-xs font-semibold text-slate-800", children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" }),
10924
- /* @__PURE__ */ jsx22("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" })
12133
+ /* @__PURE__ */ jsx31("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__ */ jsx31(Copy3, { className: "w-3.5 h-3.5" }) }),
12134
+ /* @__PURE__ */ jsxs25("div", { children: [
12135
+ /* @__PURE__ */ jsx31("p", { className: "text-xs font-semibold text-slate-800", children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" }),
12136
+ /* @__PURE__ */ jsx31("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" })
10925
12137
  ] })
10926
12138
  ]
10927
12139
  }
@@ -10930,55 +12142,55 @@ function CreateTemplateModal({
10930
12142
  ] })
10931
12143
  ] })
10932
12144
  ] }),
10933
- buttons.length === 0 && /* @__PURE__ */ jsx22("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.' }),
10934
- buttons.length > 0 && /* @__PURE__ */ jsx22("div", { className: "space-y-2.5", children: buttons.map((btn, index) => {
12145
+ buttons.length === 0 && /* @__PURE__ */ jsx31("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.' }),
12146
+ buttons.length > 0 && /* @__PURE__ */ jsx31("div", { className: "space-y-2.5", children: buttons.map((btn, index) => {
10935
12147
  const btnNum = index + 1;
10936
- return /* @__PURE__ */ jsxs18(
12148
+ return /* @__PURE__ */ jsxs25(
10937
12149
  "div",
10938
12150
  {
10939
12151
  className: "p-3 bg-white border border-slate-200 rounded-xl space-y-2.5 shadow-2xs transition-all hover:border-slate-300",
10940
12152
  children: [
10941
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
10942
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2", children: [
10943
- /* @__PURE__ */ jsxs18("span", { className: "text-[11px] font-bold text-slate-400 font-mono", children: [
12153
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between", children: [
12154
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
12155
+ /* @__PURE__ */ jsxs25("span", { className: "text-[11px] font-bold text-slate-400 font-mono", children: [
10944
12156
  "#",
10945
12157
  btnNum
10946
12158
  ] }),
10947
- btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs18("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: [
10948
- /* @__PURE__ */ jsx22(MessageSquare, { className: "w-3 h-3" }),
10949
- /* @__PURE__ */ jsx22("span", { children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" })
12159
+ btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs25("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: [
12160
+ /* @__PURE__ */ jsx31(MessageSquare, { className: "w-3 h-3" }),
12161
+ /* @__PURE__ */ jsx31("span", { children: "Custom (\u05EA\u05D2\u05D5\u05D1\u05D4 \u05DE\u05D4\u05D9\u05E8\u05D4)" })
10950
12162
  ] }),
10951
- btn.type === "URL" && /* @__PURE__ */ jsxs18("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: [
10952
- /* @__PURE__ */ jsx22(ExternalLink3, { className: "w-3 h-3" }),
10953
- /* @__PURE__ */ jsx22("span", { children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" })
12163
+ btn.type === "URL" && /* @__PURE__ */ jsxs25("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: [
12164
+ /* @__PURE__ */ jsx31(ExternalLink3, { className: "w-3 h-3" }),
12165
+ /* @__PURE__ */ jsx31("span", { children: "Visit website (\u05E7\u05D9\u05E9\u05D5\u05E8 \u05DC\u05D0\u05EA\u05E8)" })
10954
12166
  ] }),
10955
- btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs18("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: [
10956
- /* @__PURE__ */ jsx22(Phone, { className: "w-3 h-3" }),
10957
- /* @__PURE__ */ jsx22("span", { children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" })
12167
+ btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs25("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: [
12168
+ /* @__PURE__ */ jsx31(Phone, { className: "w-3 h-3" }),
12169
+ /* @__PURE__ */ jsx31("span", { children: "Call phone number (\u05D7\u05D9\u05D5\u05D2 \u05DC\u05DE\u05E1\u05E4\u05E8)" })
10958
12170
  ] }),
10959
- btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs18("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: [
10960
- /* @__PURE__ */ jsx22(Copy3, { className: "w-3 h-3" }),
10961
- /* @__PURE__ */ jsx22("span", { children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" })
12171
+ btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs25("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: [
12172
+ /* @__PURE__ */ jsx31(Copy3, { className: "w-3 h-3" }),
12173
+ /* @__PURE__ */ jsx31("span", { children: "Copy offer code (\u05D4\u05E2\u05EA\u05E7\u05EA \u05E7\u05D5\u05D3)" })
10962
12174
  ] })
10963
12175
  ] }),
10964
- /* @__PURE__ */ jsx22(
12176
+ /* @__PURE__ */ jsx31(
10965
12177
  "button",
10966
12178
  {
10967
12179
  type: "button",
10968
12180
  onClick: () => handleRemoveButton(index),
10969
12181
  className: "p-1 text-slate-400 hover:text-rose-600 hover:bg-rose-50 rounded-lg transition-colors cursor-pointer",
10970
12182
  title: "\u05D4\u05E1\u05E8 \u05DB\u05E4\u05EA\u05D5\u05E8",
10971
- children: /* @__PURE__ */ jsx22(Trash22, { className: "w-3.5 h-3.5" })
12183
+ children: /* @__PURE__ */ jsx31(Trash22, { className: "w-3.5 h-3.5" })
10972
12184
  }
10973
12185
  )
10974
12186
  ] }),
10975
- btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
10976
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
10977
- /* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
12187
+ btn.type === "QUICK_REPLY" && /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12188
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12189
+ /* @__PURE__ */ jsxs25("label", { className: "font-semibold text-slate-700", children: [
10978
12190
  "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
10979
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
12191
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
10980
12192
  ] }),
10981
- /* @__PURE__ */ jsxs18(
12193
+ /* @__PURE__ */ jsxs25(
10982
12194
  "span",
10983
12195
  {
10984
12196
  className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -10989,7 +12201,7 @@ function CreateTemplateModal({
10989
12201
  }
10990
12202
  )
10991
12203
  ] }),
10992
- /* @__PURE__ */ jsx22(
12204
+ /* @__PURE__ */ jsx31(
10993
12205
  "input",
10994
12206
  {
10995
12207
  type: "text",
@@ -11001,14 +12213,14 @@ function CreateTemplateModal({
11001
12213
  }
11002
12214
  )
11003
12215
  ] }),
11004
- btn.type === "URL" && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
11005
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
11006
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
11007
- /* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
12216
+ btn.type === "URL" && /* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
12217
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12218
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12219
+ /* @__PURE__ */ jsxs25("label", { className: "font-semibold text-slate-700", children: [
11008
12220
  "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
11009
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
12221
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
11010
12222
  ] }),
11011
- /* @__PURE__ */ jsxs18(
12223
+ /* @__PURE__ */ jsxs25(
11012
12224
  "span",
11013
12225
  {
11014
12226
  className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -11019,7 +12231,7 @@ function CreateTemplateModal({
11019
12231
  }
11020
12232
  )
11021
12233
  ] }),
11022
- /* @__PURE__ */ jsx22(
12234
+ /* @__PURE__ */ jsx31(
11023
12235
  "input",
11024
12236
  {
11025
12237
  type: "text",
@@ -11031,18 +12243,18 @@ function CreateTemplateModal({
11031
12243
  }
11032
12244
  )
11033
12245
  ] }),
11034
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
11035
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
11036
- /* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
12246
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12247
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12248
+ /* @__PURE__ */ jsxs25("label", { className: "font-semibold text-slate-700", children: [
11037
12249
  "\u05DB\u05EA\u05D5\u05D1\u05EA URL \u05E1\u05D8\u05D8\u05D9\u05EA ",
11038
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
12250
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
11039
12251
  ] }),
11040
- /* @__PURE__ */ jsxs18("span", { className: "font-mono text-[10px] text-slate-400", children: [
12252
+ /* @__PURE__ */ jsxs25("span", { className: "font-mono text-[10px] text-slate-400", children: [
11041
12253
  (btn.url || "").length,
11042
12254
  "/2000"
11043
12255
  ] })
11044
12256
  ] }),
11045
- /* @__PURE__ */ jsx22(
12257
+ /* @__PURE__ */ jsx31(
11046
12258
  "input",
11047
12259
  {
11048
12260
  type: "url",
@@ -11056,14 +12268,14 @@ function CreateTemplateModal({
11056
12268
  )
11057
12269
  ] })
11058
12270
  ] }),
11059
- btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
11060
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
11061
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
11062
- /* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
12271
+ btn.type === "PHONE_NUMBER" && /* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
12272
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12273
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12274
+ /* @__PURE__ */ jsxs25("label", { className: "font-semibold text-slate-700", children: [
11063
12275
  "\u05D8\u05E7\u05E1\u05D8 \u05D4\u05DB\u05E4\u05EA\u05D5\u05E8 ",
11064
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
12276
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
11065
12277
  ] }),
11066
- /* @__PURE__ */ jsxs18(
12278
+ /* @__PURE__ */ jsxs25(
11067
12279
  "span",
11068
12280
  {
11069
12281
  className: `font-mono text-[10px] ${(btn.text || "").length >= 25 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -11074,7 +12286,7 @@ function CreateTemplateModal({
11074
12286
  }
11075
12287
  )
11076
12288
  ] }),
11077
- /* @__PURE__ */ jsx22(
12289
+ /* @__PURE__ */ jsx31(
11078
12290
  "input",
11079
12291
  {
11080
12292
  type: "text",
@@ -11086,18 +12298,18 @@ function CreateTemplateModal({
11086
12298
  }
11087
12299
  )
11088
12300
  ] }),
11089
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
11090
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
11091
- /* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
12301
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12302
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12303
+ /* @__PURE__ */ jsxs25("label", { className: "font-semibold text-slate-700", children: [
11092
12304
  "\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF (\u05E4\u05D5\u05E8\u05DE\u05D8: +[\u05E7\u05D9\u05D3\u05D5\u05DE\u05EA][\u05DE\u05E1\u05E4\u05E8]) ",
11093
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
12305
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
11094
12306
  ] }),
11095
- /* @__PURE__ */ jsxs18("span", { className: "font-mono text-[10px] text-slate-400", children: [
12307
+ /* @__PURE__ */ jsxs25("span", { className: "font-mono text-[10px] text-slate-400", children: [
11096
12308
  (btn.phone_number || "").length,
11097
12309
  "/20"
11098
12310
  ] })
11099
12311
  ] }),
11100
- /* @__PURE__ */ jsx22(
12312
+ /* @__PURE__ */ jsx31(
11101
12313
  "input",
11102
12314
  {
11103
12315
  type: "tel",
@@ -11111,14 +12323,14 @@ function CreateTemplateModal({
11111
12323
  )
11112
12324
  ] })
11113
12325
  ] }),
11114
- btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
11115
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
11116
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
11117
- /* @__PURE__ */ jsxs18("label", { className: "font-semibold text-slate-700", children: [
12326
+ btn.type === "COPY_CODE" && /* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
12327
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12328
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12329
+ /* @__PURE__ */ jsxs25("label", { className: "font-semibold text-slate-700", children: [
11118
12330
  "\u05E7\u05D5\u05D3 \u05D4\u05E6\u05E2\u05D4 / \u05E7\u05D5\u05E4\u05D5\u05DF ",
11119
- /* @__PURE__ */ jsx22("span", { className: "text-rose-500", children: "*" })
12331
+ /* @__PURE__ */ jsx31("span", { className: "text-rose-500", children: "*" })
11120
12332
  ] }),
11121
- /* @__PURE__ */ jsxs18(
12333
+ /* @__PURE__ */ jsxs25(
11122
12334
  "span",
11123
12335
  {
11124
12336
  className: `font-mono text-[10px] ${(btn.example || "").length >= 15 ? "text-amber-600 font-bold" : "text-slate-400"}`,
@@ -11129,7 +12341,7 @@ function CreateTemplateModal({
11129
12341
  }
11130
12342
  )
11131
12343
  ] }),
11132
- /* @__PURE__ */ jsx22(
12344
+ /* @__PURE__ */ jsx31(
11133
12345
  "input",
11134
12346
  {
11135
12347
  type: "text",
@@ -11142,15 +12354,15 @@ function CreateTemplateModal({
11142
12354
  }
11143
12355
  )
11144
12356
  ] }),
11145
- /* @__PURE__ */ jsxs18("div", { className: "space-y-1", children: [
11146
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-[11px]", children: [
11147
- /* @__PURE__ */ jsx22("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)" }),
11148
- /* @__PURE__ */ jsxs18("span", { className: "font-mono text-[10px] text-slate-400", children: [
12357
+ /* @__PURE__ */ jsxs25("div", { className: "space-y-1", children: [
12358
+ /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between text-[11px]", children: [
12359
+ /* @__PURE__ */ jsx31("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)" }),
12360
+ /* @__PURE__ */ jsxs25("span", { className: "font-mono text-[10px] text-slate-400", children: [
11149
12361
  (btn.text || "").length,
11150
12362
  "/25"
11151
12363
  ] })
11152
12364
  ] }),
11153
- /* @__PURE__ */ jsx22(
12365
+ /* @__PURE__ */ jsx31(
11154
12366
  "input",
11155
12367
  {
11156
12368
  type: "text",
@@ -11170,8 +12382,8 @@ function CreateTemplateModal({
11170
12382
  }) })
11171
12383
  ] })
11172
12384
  ] }),
11173
- /* @__PURE__ */ jsxs18("div", { className: "px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-slate-50/50", children: [
11174
- /* @__PURE__ */ jsx22(
12385
+ /* @__PURE__ */ jsxs25("div", { className: "px-6 py-4 border-t border-slate-100 flex items-center justify-end gap-3 bg-slate-50/50", children: [
12386
+ /* @__PURE__ */ jsx31(
11175
12387
  "button",
11176
12388
  {
11177
12389
  type: "button",
@@ -11181,19 +12393,19 @@ function CreateTemplateModal({
11181
12393
  children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
11182
12394
  }
11183
12395
  ),
11184
- /* @__PURE__ */ jsx22(
12396
+ /* @__PURE__ */ jsx31(
11185
12397
  "button",
11186
12398
  {
11187
12399
  type: "submit",
11188
12400
  disabled: !canSubmit,
11189
12401
  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"}`,
11190
12402
  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",
11191
- children: isSubmitting ? /* @__PURE__ */ jsxs18(Fragment4, { children: [
11192
- /* @__PURE__ */ jsx22(Loader24, { className: "w-4 h-4 animate-spin" }),
11193
- /* @__PURE__ */ jsx22("span", { children: submittingStep || "\u05D9\u05D5\u05E6\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA..." })
11194
- ] }) : /* @__PURE__ */ jsxs18(Fragment4, { children: [
11195
- /* @__PURE__ */ jsx22(CheckCircle22, { className: "w-4 h-4" }),
11196
- /* @__PURE__ */ jsx22("span", { children: "\u05E9\u05DC\u05D7 \u05DC\u05D1\u05D3\u05D9\u05E7\u05D4" })
12403
+ children: isSubmitting ? /* @__PURE__ */ jsxs25(Fragment6, { children: [
12404
+ /* @__PURE__ */ jsx31(Loader24, { className: "w-4 h-4 animate-spin" }),
12405
+ /* @__PURE__ */ jsx31("span", { children: submittingStep || "\u05D9\u05D5\u05E6\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA..." })
12406
+ ] }) : /* @__PURE__ */ jsxs25(Fragment6, { children: [
12407
+ /* @__PURE__ */ jsx31(CheckCircle22, { className: "w-4 h-4" }),
12408
+ /* @__PURE__ */ jsx31("span", { children: "\u05E9\u05DC\u05D7 \u05DC\u05D1\u05D3\u05D9\u05E7\u05D4" })
11197
12409
  ] })
11198
12410
  }
11199
12411
  )
@@ -11207,7 +12419,7 @@ function CreateTemplateModal({
11207
12419
  }
11208
12420
 
11209
12421
  // src/components/WhatsAppComponent/hooks/useWhatsAppState.ts
11210
- import { useState as useState19, useEffect as useEffect16, useRef as useRef16, useMemo as useMemo11, useCallback as useCallback15 } from "react";
12422
+ import { useState as useState24, useEffect as useEffect17, useRef as useRef19, useMemo as useMemo15, useCallback as useCallback17 } from "react";
11211
12423
 
11212
12424
  // src/components/WhatsAppComponent/utils/recipientEngine.ts
11213
12425
  var STORAGE_KEY_TEST_PHONE = "whatsapp_test_phone";
@@ -11722,7 +12934,7 @@ function formatVariableValue(value, columnType, templateLanguage, options) {
11722
12934
  return formatBoolean(value, templateLanguage);
11723
12935
  // ── Date: DD/MM/YYYY ────────────────────────────────────────────
11724
12936
  case "DATE":
11725
- return formatDate(value);
12937
+ return formatDate2(value);
11726
12938
  // ── Time: HH:mm ─────────────────────────────────────────────────
11727
12939
  case "TIME":
11728
12940
  return formatTime(value);
@@ -11749,7 +12961,7 @@ function formatBoolean(value, templateLanguage) {
11749
12961
  }
11750
12962
  return isTrue2 ? "Yes" : "No";
11751
12963
  }
11752
- function formatDate(value) {
12964
+ function formatDate2(value) {
11753
12965
  if (!value) return "";
11754
12966
  let dateObj;
11755
12967
  if (value instanceof Date) {
@@ -12512,29 +13724,29 @@ function useWhatsAppState(props) {
12512
13724
  data: injectedData
12513
13725
  } = props;
12514
13726
  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);
12515
- const [tableColumns2, setTableColumns] = useState19(() => {
13727
+ const [tableColumns2, setTableColumns] = useState24(() => {
12516
13728
  return Array.isArray(settings == null ? void 0 : settings.columns) ? settings.columns : [];
12517
13729
  });
12518
- const [rawRecords, setRawRecords] = useState19(() => {
13730
+ const [rawRecords, setRawRecords] = useState24(() => {
12519
13731
  if (Array.isArray(injectedData)) return injectedData;
12520
13732
  if (Array.isArray(injectedData == null ? void 0 : injectedData.records)) return injectedData.records;
12521
13733
  return [];
12522
13734
  });
12523
- const [relationOptions, setRelationOptions] = useState19(() => {
13735
+ const [relationOptions, setRelationOptions] = useState24(() => {
12524
13736
  return (injectedData == null ? void 0 : injectedData.relationOptions) || {};
12525
13737
  });
12526
- const [isLoadingTableData, setIsLoadingTableData] = useState19(() => Boolean(settings == null ? void 0 : settings.tableMetaId));
12527
- const [activeSubtableScans, setActiveSubtableScans] = useState19(0);
12528
- const [tableError, setTableError] = useState19(null);
12529
- const [filters, setFilters] = useState19({});
12530
- const [selectedRowIds, setSelectedRowIds] = useState19([]);
12531
- const [autoSelectCount, setAutoSelectCount] = useState19(null);
12532
- const isAutoSelectingRef = useRef16(false);
12533
- const isManualOverrideRef = useRef16(false);
12534
- const prevAutoSelectCountRef = useRef16(null);
12535
- const fetchedTableIdsRef = useRef16(/* @__PURE__ */ new Set());
12536
- const fullyFetchedRelationKeysRef = useRef16(/* @__PURE__ */ new Set());
12537
- const loadTableData = useCallback15(async () => {
13738
+ const [isLoadingTableData, setIsLoadingTableData] = useState24(() => Boolean(settings == null ? void 0 : settings.tableMetaId));
13739
+ const [activeSubtableScans, setActiveSubtableScans] = useState24(0);
13740
+ const [tableError, setTableError] = useState24(null);
13741
+ const [filters, setFilters] = useState24({});
13742
+ const [selectedRowIds, setSelectedRowIds] = useState24([]);
13743
+ const [autoSelectCount, setAutoSelectCount] = useState24(null);
13744
+ const isAutoSelectingRef = useRef19(false);
13745
+ const isManualOverrideRef = useRef19(false);
13746
+ const prevAutoSelectCountRef = useRef19(null);
13747
+ const fetchedTableIdsRef = useRef19(/* @__PURE__ */ new Set());
13748
+ const fullyFetchedRelationKeysRef = useRef19(/* @__PURE__ */ new Set());
13749
+ const loadTableData = useCallback17(async () => {
12538
13750
  var _a2;
12539
13751
  const tableId = (settings == null ? void 0 : settings.tableMetaId) || (injectedData == null ? void 0 : injectedData.tableMetaId) || (injectedData == null ? void 0 : injectedData.tableId);
12540
13752
  if (!tableId || !executeAction) return;
@@ -12601,10 +13813,10 @@ function useWhatsAppState(props) {
12601
13813
  executeAction,
12602
13814
  orgId
12603
13815
  ]);
12604
- useEffect16(() => {
13816
+ useEffect17(() => {
12605
13817
  loadTableData();
12606
13818
  }, [loadTableData]);
12607
- const filterableColumns = useMemo11(() => {
13819
+ const filterableColumns = useMemo15(() => {
12608
13820
  return (tableColumns2 || []).filter((col) => {
12609
13821
  var _a2;
12610
13822
  if (!col || col.name === "_id" || col.id === "_id") return false;
@@ -12612,15 +13824,15 @@ function useWhatsAppState(props) {
12612
13824
  return type === "RELATION" || type === "BOOLEAN";
12613
13825
  });
12614
13826
  }, [tableColumns2]);
12615
- const [referencedTableSchemas, setReferencedTableSchemas] = useState19({});
12616
- const subtableCols = useMemo11(() => {
13827
+ const [referencedTableSchemas, setReferencedTableSchemas] = useState24({});
13828
+ const subtableCols = useMemo15(() => {
12617
13829
  return (tableColumns2 || []).filter((col) => {
12618
13830
  var _a2;
12619
13831
  const type = (_a2 = col.type) == null ? void 0 : _a2.toUpperCase();
12620
13832
  return type === "RELATION" || type === "SUB_TABLE" || type === "SUBTABLE";
12621
13833
  });
12622
13834
  }, [tableColumns2]);
12623
- useEffect16(() => {
13835
+ useEffect17(() => {
12624
13836
  if (!executeAction) return;
12625
13837
  const unrequestedCols = subtableCols.filter((col) => {
12626
13838
  var _a2;
@@ -12666,20 +13878,20 @@ function useWhatsAppState(props) {
12666
13878
  const isScanningPhoneColumns = Boolean(
12667
13879
  isLoadingTableData || activeSubtableScans > 0 || tableColumns2.length === 0 && Boolean(settings == null ? void 0 : settings.tableMetaId)
12668
13880
  );
12669
- const targetPhoneOptions = useMemo11(() => {
13881
+ const targetPhoneOptions = useMemo15(() => {
12670
13882
  const cols = tableColumns2 && tableColumns2.length > 0 ? tableColumns2 : Array.isArray(settings == null ? void 0 : settings.columns) ? settings.columns : [];
12671
13883
  return scanTargetPhoneOptions(cols, referencedTableSchemas);
12672
13884
  }, [tableColumns2, settings == null ? void 0 : settings.columns, referencedTableSchemas]);
12673
- const phoneColumns = useMemo11(() => {
13885
+ const phoneColumns = useMemo15(() => {
12674
13886
  return targetPhoneOptions.map((opt) => ({ name: opt.label, id: opt.id, type: "PHONE" }));
12675
13887
  }, [targetPhoneOptions]);
12676
- const [phoneColumnId, setPhoneColumnId] = useState19("");
12677
- const [subtableFilterColumn, setSubtableFilterColumn] = useState19("");
12678
- const [subtableFilterValue, setSubtableFilterValue] = useState19("");
12679
- const [subtableSendLimit, setSubtableSendLimit] = useState19(
13888
+ const [phoneColumnId, setPhoneColumnId] = useState24("");
13889
+ const [subtableFilterColumn, setSubtableFilterColumn] = useState24("");
13890
+ const [subtableFilterValue, setSubtableFilterValue] = useState24("");
13891
+ const [subtableSendLimit, setSubtableSendLimit] = useState24(
12680
13892
  (settings == null ? void 0 : settings.subtableSendLimit) || "PRIMARY"
12681
13893
  );
12682
- useEffect16(() => {
13894
+ useEffect17(() => {
12683
13895
  if (targetPhoneOptions.length > 0) {
12684
13896
  const isValid = targetPhoneOptions.some(
12685
13897
  (opt) => opt.id === phoneColumnId || opt.columnName === phoneColumnId
@@ -12691,13 +13903,13 @@ function useWhatsAppState(props) {
12691
13903
  setPhoneColumnId("");
12692
13904
  }
12693
13905
  }, [targetPhoneOptions, phoneColumnId]);
12694
- const selectedPhoneOption = useMemo11(() => {
13906
+ const selectedPhoneOption = useMemo15(() => {
12695
13907
  if (!phoneColumnId) return targetPhoneOptions[0] || null;
12696
13908
  return targetPhoneOptions.find(
12697
13909
  (opt) => opt.id === phoneColumnId || opt.columnName === phoneColumnId
12698
13910
  ) || targetPhoneOptions[0] || null;
12699
13911
  }, [targetPhoneOptions, phoneColumnId]);
12700
- const subtableFilterableColumns = useMemo11(() => {
13912
+ const subtableFilterableColumns = useMemo15(() => {
12701
13913
  var _a2, _b2, _c;
12702
13914
  if (!selectedPhoneOption || selectedPhoneOption.type !== "SUBTABLE") {
12703
13915
  return [];
@@ -12716,14 +13928,14 @@ function useWhatsAppState(props) {
12716
13928
  return type === "BOOLEAN" || type === "RELATION";
12717
13929
  });
12718
13930
  }, [selectedPhoneOption, referencedTableSchemas, tableColumns2]);
12719
- const selectedSubtableFilterCol = useMemo11(() => {
13931
+ const selectedSubtableFilterCol = useMemo15(() => {
12720
13932
  return subtableFilterableColumns.find((c) => c.name === subtableFilterColumn);
12721
13933
  }, [subtableFilterableColumns, subtableFilterColumn]);
12722
- const [enablePostSendAction, setEnablePostSendAction] = useState19(false);
12723
- const [postSendActionColumn, setPostSendActionColumn] = useState19("");
12724
- const [postSendActionValue, setPostSendActionValue] = useState19("");
12725
- const [postSendActionTargetType, setPostSendActionTargetType] = useState19("MAIN");
12726
- const postSendActionTargetOptions = useMemo11(() => {
13934
+ const [enablePostSendAction, setEnablePostSendAction] = useState24(false);
13935
+ const [postSendActionColumn, setPostSendActionColumn] = useState24("");
13936
+ const [postSendActionValue, setPostSendActionValue] = useState24("");
13937
+ const [postSendActionTargetType, setPostSendActionTargetType] = useState24("MAIN");
13938
+ const postSendActionTargetOptions = useMemo15(() => {
12727
13939
  var _a2, _b2, _c;
12728
13940
  const options = [];
12729
13941
  (tableColumns2 || []).forEach((col) => {
@@ -12768,14 +13980,14 @@ function useWhatsAppState(props) {
12768
13980
  }
12769
13981
  return options;
12770
13982
  }, [tableColumns2, selectedPhoneOption, referencedTableSchemas]);
12771
- const selectedPostSendOption = useMemo11(() => {
13983
+ const selectedPostSendOption = useMemo15(() => {
12772
13984
  return postSendActionTargetOptions.find(
12773
13985
  (opt) => opt.id === postSendActionColumn || opt.columnName === postSendActionColumn
12774
13986
  );
12775
13987
  }, [postSendActionTargetOptions, postSendActionColumn]);
12776
13988
  const selectedPostSendCol = selectedPostSendOption;
12777
- const [isTestPromptOpen, setIsTestPromptOpen] = useState19(false);
12778
- const [testPhoneNumber, setTestPhoneNumber] = useState19(() => {
13989
+ const [isTestPromptOpen, setIsTestPromptOpen] = useState24(false);
13990
+ const [testPhoneNumber, setTestPhoneNumber] = useState24(() => {
12779
13991
  if (typeof window !== "undefined") {
12780
13992
  try {
12781
13993
  return localStorage.getItem(STORAGE_KEY_TEST_PHONE) || "";
@@ -12785,10 +13997,10 @@ function useWhatsAppState(props) {
12785
13997
  }
12786
13998
  return "";
12787
13999
  });
12788
- const [testFeedback, setTestFeedback] = useState19(null);
12789
- const [isSendingTest, setIsSendingTest] = useState19(false);
12790
- const [isSendingBroadcast, setIsSendingBroadcast] = useState19(false);
12791
- const [broadcastProgress, setBroadcastProgress] = useState19({
14000
+ const [testFeedback, setTestFeedback] = useState24(null);
14001
+ const [isSendingTest, setIsSendingTest] = useState24(false);
14002
+ const [isSendingBroadcast, setIsSendingBroadcast] = useState24(false);
14003
+ const [broadcastProgress, setBroadcastProgress] = useState24({
12792
14004
  current: 0,
12793
14005
  total: 0,
12794
14006
  successful: 0,
@@ -12796,12 +14008,12 @@ function useWhatsAppState(props) {
12796
14008
  skipped: 0,
12797
14009
  percent: 0
12798
14010
  });
12799
- const [broadcastSummary, setBroadcastSummary] = useState19(null);
12800
- const [rowStatusMap, setRowStatusMap] = useState19({});
12801
- const clearBroadcastSummary = useCallback15(() => {
14011
+ const [broadcastSummary, setBroadcastSummary] = useState24(null);
14012
+ const [rowStatusMap, setRowStatusMap] = useState24({});
14013
+ const clearBroadcastSummary = useCallback17(() => {
12802
14014
  setBroadcastSummary(null);
12803
14015
  }, []);
12804
- const handleTestPhoneChange = useCallback15((val) => {
14016
+ const handleTestPhoneChange = useCallback17((val) => {
12805
14017
  setTestPhoneNumber(val);
12806
14018
  if (typeof window !== "undefined") {
12807
14019
  try {
@@ -12811,7 +14023,7 @@ function useWhatsAppState(props) {
12811
14023
  }
12812
14024
  }
12813
14025
  }, []);
12814
- const getRelationOptionsForCol = useCallback15(
14026
+ const getRelationOptionsForCol = useCallback17(
12815
14027
  (colName, parentColName) => {
12816
14028
  var _a2, _b2, _c, _d;
12817
14029
  if (parentColName) {
@@ -12854,7 +14066,7 @@ function useWhatsAppState(props) {
12854
14066
  },
12855
14067
  [relationOptions, subtableFilterableColumns, postSendActionTargetOptions, tableColumns2, filterableColumns]
12856
14068
  );
12857
- useEffect16(() => {
14069
+ useEffect17(() => {
12858
14070
  var _a2, _b2, _c, _d, _e;
12859
14071
  if (!executeAction) return;
12860
14072
  const targets = [];
@@ -12948,7 +14160,7 @@ function useWhatsAppState(props) {
12948
14160
  }
12949
14161
  });
12950
14162
  }, [filterableColumns, selectedPhoneOption, referencedTableSchemas, tableColumns2, executeAction, selectedPostSendOption, orgId]);
12951
- useEffect16(() => {
14163
+ useEffect17(() => {
12952
14164
  var _a2, _b2, _c;
12953
14165
  if (!executeAction || !selectedSubtableFilterCol) return;
12954
14166
  if (((_a2 = selectedSubtableFilterCol.type) == null ? void 0 : _a2.toUpperCase()) !== "RELATION") return;
@@ -12999,7 +14211,7 @@ function useWhatsAppState(props) {
12999
14211
  }
13000
14212
  })();
13001
14213
  }, [selectedSubtableFilterCol, selectedPhoneOption, executeAction, orgId]);
13002
- useEffect16(() => {
14214
+ useEffect17(() => {
13003
14215
  var _a2, _b2;
13004
14216
  if (!executeAction || !selectedPostSendOption) return;
13005
14217
  if (selectedPostSendOption.type !== "RELATION") return;
@@ -13052,7 +14264,7 @@ function useWhatsAppState(props) {
13052
14264
  }
13053
14265
  })();
13054
14266
  }, [selectedPostSendOption, executeAction, orgId]);
13055
- const filteredRecords = useMemo11(() => {
14267
+ const filteredRecords = useMemo15(() => {
13056
14268
  const activeEntries = Object.entries(filters).filter(
13057
14269
  ([_, val]) => val !== void 0 && val !== null && val !== ""
13058
14270
  );
@@ -13084,7 +14296,7 @@ function useWhatsAppState(props) {
13084
14296
  });
13085
14297
  }, [rawRecords, filters, filterableColumns]);
13086
14298
  const filteredData = filteredRecords;
13087
- useEffect16(() => {
14299
+ useEffect17(() => {
13088
14300
  if (autoSelectCount !== null && autoSelectCount > 0) {
13089
14301
  isAutoSelectingRef.current = true;
13090
14302
  const sliced = filteredData.slice(0, autoSelectCount);
@@ -13102,7 +14314,7 @@ function useWhatsAppState(props) {
13102
14314
  isManualOverrideRef.current = false;
13103
14315
  prevAutoSelectCountRef.current = autoSelectCount;
13104
14316
  }, [autoSelectCount, filteredData]);
13105
- const embeddedTableExecuteAction = useCallback15(async (actionType, payload) => {
14317
+ const embeddedTableExecuteAction = useCallback17(async (actionType, payload) => {
13106
14318
  if (actionType === "FETCH_TABLE_DATA") {
13107
14319
  const colFilters = (payload == null ? void 0 : payload.columnFilters) || (payload == null ? void 0 : payload.filters);
13108
14320
  const searchQuery = payload == null ? void 0 : payload.search;
@@ -13145,10 +14357,10 @@ function useWhatsAppState(props) {
13145
14357
  const handleClearFilters = () => {
13146
14358
  setFilters({});
13147
14359
  };
13148
- const activeFiltersCount = useMemo11(() => {
14360
+ const activeFiltersCount = useMemo15(() => {
13149
14361
  return Object.values(filters).filter((v) => v !== "").length;
13150
14362
  }, [filters]);
13151
- const handleSelectionChange = useCallback15((selectedIds) => {
14363
+ const handleSelectionChange = useCallback17((selectedIds) => {
13152
14364
  setSelectedRowIds((prev) => {
13153
14365
  if (prev.length === selectedIds.length && prev.every((id, idx) => id === selectedIds[idx])) {
13154
14366
  return prev;
@@ -13162,13 +14374,13 @@ function useWhatsAppState(props) {
13162
14374
  return selectedIds;
13163
14375
  });
13164
14376
  }, [autoSelectCount]);
13165
- const handleRowToggle = useCallback15((rowId, checked) => {
14377
+ const handleRowToggle = useCallback17((rowId, checked) => {
13166
14378
  if (autoSelectCount !== null && autoSelectCount > 0) {
13167
14379
  isManualOverrideRef.current = true;
13168
14380
  setAutoSelectCount(null);
13169
14381
  }
13170
14382
  }, [autoSelectCount]);
13171
- const toggleRowSelection = useCallback15((rowId, checked) => {
14383
+ const toggleRowSelection = useCallback17((rowId, checked) => {
13172
14384
  if (autoSelectCount !== null && autoSelectCount > 0) {
13173
14385
  isManualOverrideRef.current = true;
13174
14386
  setAutoSelectCount(null);
@@ -13184,15 +14396,15 @@ function useWhatsAppState(props) {
13184
14396
  return prev;
13185
14397
  });
13186
14398
  }, [autoSelectCount]);
13187
- const [templates, setTemplates] = useState19([]);
13188
- const [selectedTemplateId, setSelectedTemplateId] = useState19(null);
13189
- const [isLoading, setIsLoading] = useState19(true);
13190
- const [fetchError, setFetchError] = useState19(null);
13191
- const [isModalOpen, setIsModalOpen] = useState19(false);
13192
- const [isDropdownOpen, setIsDropdownOpen] = useState19(false);
13193
- const [isDeleting, setIsDeleting] = useState19(false);
13194
- const [feedback, setFeedback] = useState19(null);
13195
- const loadTemplates = useCallback15(async () => {
14399
+ const [templates, setTemplates] = useState24([]);
14400
+ const [selectedTemplateId, setSelectedTemplateId] = useState24(null);
14401
+ const [isLoading, setIsLoading] = useState24(true);
14402
+ const [fetchError, setFetchError] = useState24(null);
14403
+ const [isModalOpen, setIsModalOpen] = useState24(false);
14404
+ const [isDropdownOpen, setIsDropdownOpen] = useState24(false);
14405
+ const [isDeleting, setIsDeleting] = useState24(false);
14406
+ const [feedback, setFeedback] = useState24(null);
14407
+ const loadTemplates = useCallback17(async () => {
13196
14408
  var _a2, _b2;
13197
14409
  if (!executeAction) {
13198
14410
  setIsLoading(false);
@@ -13244,13 +14456,13 @@ function useWhatsAppState(props) {
13244
14456
  setIsLoading(false);
13245
14457
  }
13246
14458
  }, [executeAction, orgId]);
13247
- useEffect16(() => {
14459
+ useEffect17(() => {
13248
14460
  loadTemplates();
13249
14461
  }, [loadTemplates]);
13250
- const selectedTemplate = useMemo11(() => {
14462
+ const selectedTemplate = useMemo15(() => {
13251
14463
  return templates.find((t) => t.id === selectedTemplateId) || null;
13252
14464
  }, [templates, selectedTemplateId]);
13253
- const templateBodyText = useMemo11(() => {
14465
+ const templateBodyText = useMemo15(() => {
13254
14466
  if (!(selectedTemplate == null ? void 0 : selectedTemplate.components)) return "";
13255
14467
  const bodyComp = selectedTemplate.components.find(
13256
14468
  (c) => {
@@ -13260,7 +14472,7 @@ function useWhatsAppState(props) {
13260
14472
  );
13261
14473
  return (bodyComp == null ? void 0 : bodyComp.text) || "";
13262
14474
  }, [selectedTemplate]);
13263
- const templateHeaderComp = useMemo11(() => {
14475
+ const templateHeaderComp = useMemo15(() => {
13264
14476
  if (!(selectedTemplate == null ? void 0 : selectedTemplate.components)) return null;
13265
14477
  return selectedTemplate.components.find(
13266
14478
  (c) => {
@@ -13269,8 +14481,8 @@ function useWhatsAppState(props) {
13269
14481
  }
13270
14482
  ) || null;
13271
14483
  }, [selectedTemplate]);
13272
- const [headerMediaUrl, setHeaderMediaUrl] = useState19("");
13273
- useEffect16(() => {
14484
+ const [headerMediaUrl, setHeaderMediaUrl] = useState24("");
14485
+ useEffect17(() => {
13274
14486
  if (!templateHeaderComp) {
13275
14487
  setHeaderMediaUrl("");
13276
14488
  return;
@@ -13287,7 +14499,7 @@ function useWhatsAppState(props) {
13287
14499
  setHeaderMediaUrl("");
13288
14500
  }
13289
14501
  }, [templateHeaderComp, selectedTemplate == null ? void 0 : selectedTemplate.name]);
13290
- const handleHeaderMediaUrlChange = useCallback15(
14502
+ const handleHeaderMediaUrlChange = useCallback17(
13291
14503
  (newUrl) => {
13292
14504
  setHeaderMediaUrl(newUrl);
13293
14505
  if ((selectedTemplate == null ? void 0 : selectedTemplate.name) && typeof window !== "undefined") {
@@ -13306,7 +14518,7 @@ function useWhatsAppState(props) {
13306
14518
  },
13307
14519
  [selectedTemplate == null ? void 0 : selectedTemplate.name]
13308
14520
  );
13309
- const handleResetHeaderMediaUrl = useCallback15(() => {
14521
+ const handleResetHeaderMediaUrl = useCallback17(() => {
13310
14522
  if ((selectedTemplate == null ? void 0 : selectedTemplate.name) && typeof window !== "undefined") {
13311
14523
  try {
13312
14524
  localStorage.removeItem(`whatsapp_template_media_${selectedTemplate.name}`);
@@ -13320,8 +14532,8 @@ function useWhatsAppState(props) {
13320
14532
  );
13321
14533
  setHeaderMediaUrl(defaultUrl || "");
13322
14534
  }, [templateHeaderComp, selectedTemplate == null ? void 0 : selectedTemplate.name]);
13323
- const [isUploadingMedia, setIsUploadingMedia] = useState19(false);
13324
- const handleFileUpload = useCallback15(
14535
+ const [isUploadingMedia, setIsUploadingMedia] = useState24(false);
14536
+ const handleFileUpload = useCallback17(
13325
14537
  async (file, templateName) => {
13326
14538
  const tplName = templateName || (selectedTemplate == null ? void 0 : selectedTemplate.name) || "";
13327
14539
  if (!file) return;
@@ -13362,14 +14574,14 @@ function useWhatsAppState(props) {
13362
14574
  },
13363
14575
  [selectedTemplate == null ? void 0 : selectedTemplate.name]
13364
14576
  );
13365
- const templateVariables = useMemo11(() => {
14577
+ const templateVariables = useMemo15(() => {
13366
14578
  return extractTemplateVariables(selectedTemplate);
13367
14579
  }, [selectedTemplate]);
13368
- const [variableMapping, setVariableMapping] = useState19({});
13369
- useEffect16(() => {
14580
+ const [variableMapping, setVariableMapping] = useState24({});
14581
+ useEffect17(() => {
13370
14582
  setVariableMapping({});
13371
14583
  }, [selectedTemplateId]);
13372
- const textableColumnOptions = useMemo11(() => {
14584
+ const textableColumnOptions = useMemo15(() => {
13373
14585
  return getTextableColumnOptions({
13374
14586
  tableColumns: tableColumns2,
13375
14587
  selectedPhoneOption,
@@ -13395,7 +14607,7 @@ function useWhatsAppState(props) {
13395
14607
  });
13396
14608
  });
13397
14609
  };
13398
- const existingTemplateNames = useMemo11(() => {
14610
+ const existingTemplateNames = useMemo15(() => {
13399
14611
  return templates.map((t) => t.name);
13400
14612
  }, [templates]);
13401
14613
  const handleDeleteTemplate = async () => {
@@ -13442,14 +14654,14 @@ function useWhatsAppState(props) {
13442
14654
  postSendActionColumn,
13443
14655
  postSendActionValue
13444
14656
  );
13445
- const isStaticVariableMissing = useMemo11(() => {
14657
+ const isStaticVariableMissing = useMemo15(() => {
13446
14658
  return isStaticVariableIncomplete(templateVariables, variableMapping);
13447
14659
  }, [templateVariables, variableMapping]);
13448
- const currentRecords = useMemo11(() => {
14660
+ const currentRecords = useMemo15(() => {
13449
14661
  var _a2;
13450
14662
  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 : [];
13451
14663
  }, [rawRecords, props.data]);
13452
- const preparedRecipients = useMemo11(() => {
14664
+ const preparedRecipients = useMemo15(() => {
13453
14665
  return prepareRecipients({
13454
14666
  selectedIds: selectedRowIds,
13455
14667
  records: currentRecords,
@@ -13469,7 +14681,7 @@ function useWhatsAppState(props) {
13469
14681
  selectedSubtableFilterCol
13470
14682
  ]);
13471
14683
  const finalRecipientCount = preparedRecipients.length;
13472
- const validMainRowsCount = useMemo11(() => {
14684
+ const validMainRowsCount = useMemo15(() => {
13473
14685
  const rowIdSet = new Set(
13474
14686
  preparedRecipients.map((r) => r.mainRowId).filter(Boolean)
13475
14687
  );
@@ -13578,7 +14790,7 @@ function useWhatsAppState(props) {
13578
14790
  setIsSendingTest(false);
13579
14791
  }
13580
14792
  };
13581
- const handleSendMessages = useCallback15(async () => {
14793
+ const handleSendMessages = useCallback17(async () => {
13582
14794
  var _a2, _b2;
13583
14795
  if (isSendDisabled || isSendingBroadcast) return;
13584
14796
  const recipients = preparedRecipients;
@@ -13884,7 +15096,7 @@ function useWhatsAppState(props) {
13884
15096
  }
13885
15097
 
13886
15098
  // src/components/WhatsAppComponent/ui/TemplateSelectionBlock.tsx
13887
- import { useRef as useRef17 } from "react";
15099
+ import { useRef as useRef20 } from "react";
13888
15100
  import {
13889
15101
  FileText as FileText3,
13890
15102
  Trash2 as Trash23,
@@ -13901,7 +15113,7 @@ import {
13901
15113
  CheckCircle2 as CheckCircle23,
13902
15114
  AlertCircle as AlertCircle3
13903
15115
  } from "lucide-react";
13904
- import { Fragment as Fragment5, jsx as jsx23, jsxs as jsxs19 } from "react/jsx-runtime";
15116
+ import { Fragment as Fragment7, jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
13905
15117
  function TemplateSelectionBlock({
13906
15118
  selectedTemplate,
13907
15119
  selectedTemplateId,
@@ -13927,16 +15139,16 @@ function TemplateSelectionBlock({
13927
15139
  isUploadingMedia = false,
13928
15140
  handleFileUpload
13929
15141
  }) {
13930
- const fileInputRef = useRef17(null);
13931
- return /* @__PURE__ */ jsxs19("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: [
13932
- /* @__PURE__ */ jsxs19("div", { className: "space-y-1.5 shrink-0", children: [
13933
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between pb-1.5 border-b border-slate-200/70 shrink-0 gap-2", children: [
13934
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 min-w-0", children: [
13935
- /* @__PURE__ */ jsx23(FileText3, { className: "w-4 h-4 text-emerald-600 shrink-0" }),
13936
- /* @__PURE__ */ jsx23("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" })
15142
+ const fileInputRef = useRef20(null);
15143
+ return /* @__PURE__ */ jsxs26("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: [
15144
+ /* @__PURE__ */ jsxs26("div", { className: "space-y-1.5 shrink-0", children: [
15145
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between pb-1.5 border-b border-slate-200/70 shrink-0 gap-2", children: [
15146
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-1.5 min-w-0", children: [
15147
+ /* @__PURE__ */ jsx32(FileText3, { className: "w-4 h-4 text-emerald-600 shrink-0" }),
15148
+ /* @__PURE__ */ jsx32("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" })
13937
15149
  ] }),
13938
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 shrink-0", children: [
13939
- /* @__PURE__ */ jsxs19(
15150
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-1.5 shrink-0", children: [
15151
+ /* @__PURE__ */ jsxs26(
13940
15152
  "button",
13941
15153
  {
13942
15154
  type: "button",
@@ -13945,12 +15157,12 @@ function TemplateSelectionBlock({
13945
15157
  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"}`,
13946
15158
  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}"`,
13947
15159
  children: [
13948
- isDeleting ? /* @__PURE__ */ jsx23(Loader25, { className: "w-3.5 h-3.5 animate-spin text-rose-500" }) : /* @__PURE__ */ jsx23(Trash23, { className: "w-3.5 h-3.5 text-rose-500" }),
13949
- /* @__PURE__ */ jsx23("span", { children: "\u05DE\u05D7\u05D9\u05E7\u05D4" })
15160
+ isDeleting ? /* @__PURE__ */ jsx32(Loader25, { className: "w-3.5 h-3.5 animate-spin text-rose-500" }) : /* @__PURE__ */ jsx32(Trash23, { className: "w-3.5 h-3.5 text-rose-500" }),
15161
+ /* @__PURE__ */ jsx32("span", { children: "\u05DE\u05D7\u05D9\u05E7\u05D4" })
13950
15162
  ]
13951
15163
  }
13952
15164
  ),
13953
- /* @__PURE__ */ jsxs19(
15165
+ /* @__PURE__ */ jsxs26(
13954
15166
  "button",
13955
15167
  {
13956
15168
  type: "button",
@@ -13958,40 +15170,40 @@ function TemplateSelectionBlock({
13958
15170
  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",
13959
15171
  title: "\u05E6\u05D5\u05E8 \u05EA\u05D1\u05E0\u05D9\u05EA \u05D7\u05D3\u05E9\u05D4",
13960
15172
  children: [
13961
- /* @__PURE__ */ jsx23(Plus2, { className: "w-3.5 h-3.5" }),
13962
- /* @__PURE__ */ jsx23("span", { children: "\u05D7\u05D3\u05E9" })
15173
+ /* @__PURE__ */ jsx32(Plus2, { className: "w-3.5 h-3.5" }),
15174
+ /* @__PURE__ */ jsx32("span", { children: "\u05D7\u05D3\u05E9" })
13963
15175
  ]
13964
15176
  }
13965
15177
  )
13966
15178
  ] })
13967
15179
  ] }),
13968
- /* @__PURE__ */ jsxs19("div", { className: "relative", children: [
13969
- /* @__PURE__ */ jsxs19(
15180
+ /* @__PURE__ */ jsxs26("div", { className: "relative", children: [
15181
+ /* @__PURE__ */ jsxs26(
13970
15182
  "button",
13971
15183
  {
13972
15184
  type: "button",
13973
15185
  onClick: () => setIsDropdownOpen((prev) => !prev),
13974
15186
  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",
13975
15187
  children: [
13976
- selectedTemplate ? /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 overflow-hidden", children: [
13977
- /* @__PURE__ */ jsx23(
15188
+ selectedTemplate ? /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 overflow-hidden", children: [
15189
+ /* @__PURE__ */ jsx32(
13978
15190
  "span",
13979
15191
  {
13980
15192
  className: `w-2 h-2 rounded-full shrink-0 ${getStatusConfig(selectedTemplate.status).dotColor}`
13981
15193
  }
13982
15194
  ),
13983
- /* @__PURE__ */ jsx23("span", { className: "text-xs font-semibold text-slate-900 truncate", children: selectedTemplate.name }),
13984
- /* @__PURE__ */ jsxs19("span", { className: "text-[10px] text-slate-400 shrink-0", children: [
15195
+ /* @__PURE__ */ jsx32("span", { className: "text-xs font-semibold text-slate-900 truncate", children: selectedTemplate.name }),
15196
+ /* @__PURE__ */ jsxs26("span", { className: "text-[10px] text-slate-400 shrink-0", children: [
13985
15197
  "(",
13986
15198
  selectedTemplate.category,
13987
15199
  " \u2022 ",
13988
15200
  selectedTemplate.language,
13989
15201
  ")"
13990
15202
  ] })
13991
- ] }) : /* @__PURE__ */ jsx23("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..." }),
13992
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-1.5 shrink-0 mr-1", children: [
13993
- isLoadingTemplates && /* @__PURE__ */ jsx23(Loader25, { className: "w-3.5 h-3.5 text-emerald-600 animate-spin" }),
13994
- /* @__PURE__ */ jsx23(
15203
+ ] }) : /* @__PURE__ */ jsx32("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..." }),
15204
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-1.5 shrink-0 mr-1", children: [
15205
+ isLoadingTemplates && /* @__PURE__ */ jsx32(Loader25, { className: "w-3.5 h-3.5 text-emerald-600 animate-spin" }),
15206
+ /* @__PURE__ */ jsx32(
13995
15207
  ChevronDown4,
13996
15208
  {
13997
15209
  className: `w-3.5 h-3.5 text-slate-400 transition-transform ${isDropdownOpen ? "rotate-180" : ""}`
@@ -14001,21 +15213,21 @@ function TemplateSelectionBlock({
14001
15213
  ]
14002
15214
  }
14003
15215
  ),
14004
- isDropdownOpen && /* @__PURE__ */ jsxs19(Fragment5, { children: [
14005
- /* @__PURE__ */ jsx23(
15216
+ isDropdownOpen && /* @__PURE__ */ jsxs26(Fragment7, { children: [
15217
+ /* @__PURE__ */ jsx32(
14006
15218
  "div",
14007
15219
  {
14008
15220
  className: "fixed inset-0 z-40",
14009
15221
  onClick: () => setIsDropdownOpen(false)
14010
15222
  }
14011
15223
  ),
14012
- /* @__PURE__ */ jsxs19("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: [
14013
- templates.length === 0 && !isLoadingTemplates && /* @__PURE__ */ jsx23("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".' }),
15224
+ /* @__PURE__ */ jsxs26("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: [
15225
+ templates.length === 0 && !isLoadingTemplates && /* @__PURE__ */ jsx32("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".' }),
14014
15226
  templates.map((tpl) => {
14015
15227
  const statusConfig = getStatusConfig(tpl.status);
14016
15228
  const isSelected = tpl.id === selectedTemplateId;
14017
15229
  const canSelect = statusConfig.isSelectable;
14018
- return /* @__PURE__ */ jsxs19(
15230
+ return /* @__PURE__ */ jsxs26(
14019
15231
  "div",
14020
15232
  {
14021
15233
  onClick: () => {
@@ -14028,29 +15240,29 @@ function TemplateSelectionBlock({
14028
15240
  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" : ""}`,
14029
15241
  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,
14030
15242
  children: [
14031
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 overflow-hidden", children: [
14032
- /* @__PURE__ */ jsx23(
15243
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 overflow-hidden", children: [
15244
+ /* @__PURE__ */ jsx32(
14033
15245
  "span",
14034
15246
  {
14035
15247
  className: `w-2 h-2 rounded-full shrink-0 ${statusConfig.dotColor}`
14036
15248
  }
14037
15249
  ),
14038
- /* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
14039
- /* @__PURE__ */ jsx23(
15250
+ /* @__PURE__ */ jsxs26("div", { className: "overflow-hidden", children: [
15251
+ /* @__PURE__ */ jsx32(
14040
15252
  "p",
14041
15253
  {
14042
15254
  className: `text-xs font-semibold truncate ${isSelected ? "text-emerald-700" : canSelect ? "text-slate-800" : "text-slate-500"}`,
14043
15255
  children: tpl.name
14044
15256
  }
14045
15257
  ),
14046
- /* @__PURE__ */ jsxs19("p", { className: "text-[10px] text-slate-400", children: [
15258
+ /* @__PURE__ */ jsxs26("p", { className: "text-[10px] text-slate-400", children: [
14047
15259
  tpl.category,
14048
15260
  " \u2022 ",
14049
15261
  tpl.language
14050
15262
  ] })
14051
15263
  ] })
14052
15264
  ] }),
14053
- /* @__PURE__ */ jsx23(
15265
+ /* @__PURE__ */ jsx32(
14054
15266
  "span",
14055
15267
  {
14056
15268
  className: `text-[9px] font-semibold px-2 py-0.5 rounded-full border shrink-0 ${statusConfig.badgeBg} ${statusConfig.badgeText}`,
@@ -14066,18 +15278,18 @@ function TemplateSelectionBlock({
14066
15278
  ] })
14067
15279
  ] })
14068
15280
  ] }),
14069
- /* @__PURE__ */ jsxs19("div", { className: "flex-1 min-h-0 flex flex-col gap-2", children: [
14070
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-600 shrink-0", children: [
14071
- /* @__PURE__ */ jsx23("span", { children: "\u05EA\u05E6\u05D5\u05D2\u05EA \u05D4\u05D5\u05D3\u05E2\u05D4" }),
14072
- selectedTemplate && /* @__PURE__ */ jsxs19("span", { className: "text-[10px] text-slate-400", children: [
15281
+ /* @__PURE__ */ jsxs26("div", { className: "flex-1 min-h-0 flex flex-col gap-2", children: [
15282
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-600 shrink-0", children: [
15283
+ /* @__PURE__ */ jsx32("span", { children: "\u05EA\u05E6\u05D5\u05D2\u05EA \u05D4\u05D5\u05D3\u05E2\u05D4" }),
15284
+ selectedTemplate && /* @__PURE__ */ jsxs26("span", { className: "text-[10px] text-slate-400", children: [
14073
15285
  "(",
14074
15286
  templateBodyText.length,
14075
15287
  " \u05EA\u05D5\u05D5\u05D9\u05DD)"
14076
15288
  ] })
14077
15289
  ] }),
14078
- selectedTemplate ? /* @__PURE__ */ jsx23("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__ */ jsxs19("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: [
14079
- /* @__PURE__ */ jsx23("span", { children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" }),
14080
- /* @__PURE__ */ jsx23("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"' })
15290
+ selectedTemplate ? /* @__PURE__ */ jsx32("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__ */ jsxs26("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: [
15291
+ /* @__PURE__ */ jsx32("span", { children: "\u05DC\u05D0 \u05E0\u05D1\u05D7\u05E8\u05D4 \u05EA\u05D1\u05E0\u05D9\u05EA" }),
15292
+ /* @__PURE__ */ jsx32("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"' })
14081
15293
  ] }),
14082
15294
  selectedTemplate && (() => {
14083
15295
  var _a;
@@ -14086,19 +15298,19 @@ function TemplateSelectionBlock({
14086
15298
  );
14087
15299
  const tplButtons = (buttonsComp == null ? void 0 : buttonsComp.buttons) || [];
14088
15300
  if (!tplButtons || tplButtons.length === 0) return null;
14089
- return /* @__PURE__ */ jsx23("div", { className: "flex flex-wrap gap-1.5 shrink-0 pt-0.5", children: tplButtons.map((btn, idx) => {
15301
+ return /* @__PURE__ */ jsx32("div", { className: "flex flex-wrap gap-1.5 shrink-0 pt-0.5", children: tplButtons.map((btn, idx) => {
14090
15302
  const btnType = (btn.type || "").toUpperCase();
14091
15303
  const btnText = btn.text || (btnType === "COPY_CODE" ? `\u05D4\u05E2\u05EA\u05E7 \u05E7\u05D5\u05D3: ${btn.example}` : "\u05DB\u05E4\u05EA\u05D5\u05E8");
14092
- return /* @__PURE__ */ jsxs19(
15304
+ return /* @__PURE__ */ jsxs26(
14093
15305
  "div",
14094
15306
  {
14095
15307
  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",
14096
15308
  children: [
14097
- btnType === "QUICK_REPLY" && /* @__PURE__ */ jsx23(MessageSquare2, { className: "w-3 h-3 text-emerald-600" }),
14098
- btnType === "URL" && /* @__PURE__ */ jsx23(ExternalLink4, { className: "w-3 h-3 text-sky-600" }),
14099
- btnType === "PHONE_NUMBER" && /* @__PURE__ */ jsx23(Phone2, { className: "w-3 h-3 text-violet-600" }),
14100
- btnType === "COPY_CODE" && /* @__PURE__ */ jsx23(Copy4, { className: "w-3 h-3 text-amber-600" }),
14101
- /* @__PURE__ */ jsx23("span", { className: "truncate max-w-[180px]", children: btnText })
15309
+ btnType === "QUICK_REPLY" && /* @__PURE__ */ jsx32(MessageSquare2, { className: "w-3 h-3 text-emerald-600" }),
15310
+ btnType === "URL" && /* @__PURE__ */ jsx32(ExternalLink4, { className: "w-3 h-3 text-sky-600" }),
15311
+ btnType === "PHONE_NUMBER" && /* @__PURE__ */ jsx32(Phone2, { className: "w-3 h-3 text-violet-600" }),
15312
+ btnType === "COPY_CODE" && /* @__PURE__ */ jsx32(Copy4, { className: "w-3 h-3 text-amber-600" }),
15313
+ /* @__PURE__ */ jsx32("span", { className: "truncate max-w-[180px]", children: btnText })
14102
15314
  ]
14103
15315
  },
14104
15316
  idx
@@ -14113,9 +15325,9 @@ function TemplateSelectionBlock({
14113
15325
  const docFilename = resolveDocumentFilename(templateHeaderComp, headerMediaUrl);
14114
15326
  const hasValidMedia = Boolean(headerMediaUrl && headerMediaUrl.trim() && headerMediaUrl.startsWith("http"));
14115
15327
  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";
14116
- return /* @__PURE__ */ jsxs19("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: [
14117
- /* @__PURE__ */ jsx23("div", { className: "flex items-center gap-2.5 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
14118
- /* @__PURE__ */ jsx23("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__ */ jsx23(
15328
+ return /* @__PURE__ */ jsxs26("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: [
15329
+ /* @__PURE__ */ jsx32("div", { className: "flex items-center gap-2.5 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
15330
+ /* @__PURE__ */ jsx32("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__ */ jsx32(
14119
15331
  "img",
14120
15332
  {
14121
15333
  src: headerMediaUrl,
@@ -14125,33 +15337,33 @@ function TemplateSelectionBlock({
14125
15337
  e.currentTarget.style.display = "none";
14126
15338
  }
14127
15339
  }
14128
- ) : /* @__PURE__ */ jsx23(ImageIcon2, { className: "w-4 h-4 text-amber-600" }) }),
14129
- /* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
14130
- /* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" }),
14131
- /* @__PURE__ */ jsx23("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" })
15340
+ ) : /* @__PURE__ */ jsx32(ImageIcon2, { className: "w-4 h-4 text-amber-600" }) }),
15341
+ /* @__PURE__ */ jsxs26("div", { className: "overflow-hidden", children: [
15342
+ /* @__PURE__ */ jsx32("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" }),
15343
+ /* @__PURE__ */ jsx32("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" })
14132
15344
  ] })
14133
- ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
14134
- /* @__PURE__ */ jsx23("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__ */ jsx23(FileText3, { className: "w-4 h-4" }) }),
14135
- /* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
14136
- /* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
14137
- /* @__PURE__ */ jsx23("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" })
15345
+ ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
15346
+ /* @__PURE__ */ jsx32("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__ */ jsx32(FileText3, { className: "w-4 h-4" }) }),
15347
+ /* @__PURE__ */ jsxs26("div", { className: "overflow-hidden", children: [
15348
+ /* @__PURE__ */ jsx32("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
15349
+ /* @__PURE__ */ jsx32("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" })
14138
15350
  ] })
14139
- ] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
14140
- /* @__PURE__ */ jsx23("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__ */ jsx23(Video2, { className: "w-4 h-4" }) }),
14141
- /* @__PURE__ */ jsxs19("div", { className: "overflow-hidden", children: [
14142
- /* @__PURE__ */ jsx23("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" }),
14143
- /* @__PURE__ */ jsx23("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" })
15351
+ ] }) : /* @__PURE__ */ jsxs26(Fragment7, { children: [
15352
+ /* @__PURE__ */ jsx32("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__ */ jsx32(Video2, { className: "w-4 h-4" }) }),
15353
+ /* @__PURE__ */ jsxs26("div", { className: "overflow-hidden", children: [
15354
+ /* @__PURE__ */ jsx32("span", { className: "text-xs font-bold text-slate-800 block truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" }),
15355
+ /* @__PURE__ */ jsx32("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" })
14144
15356
  ] })
14145
15357
  ] }) }),
14146
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 shrink-0", children: [
14147
- hasValidMedia ? /* @__PURE__ */ jsxs19("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: [
14148
- /* @__PURE__ */ jsx23(CheckCircle23, { className: "w-3 h-3 text-emerald-600" }),
15358
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center gap-2 shrink-0", children: [
15359
+ hasValidMedia ? /* @__PURE__ */ jsxs26("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: [
15360
+ /* @__PURE__ */ jsx32(CheckCircle23, { className: "w-3 h-3 text-emerald-600" }),
14149
15361
  "\u05E7\u05D5\u05D1\u05E5 \u05DE\u05E6\u05D5\u05E8\u05E3 \u05EA\u05E7\u05D9\u05DF"
14150
- ] }) : /* @__PURE__ */ jsxs19("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: [
14151
- /* @__PURE__ */ jsx23(AlertCircle3, { className: "w-3 h-3 text-amber-600 shrink-0" }),
15362
+ ] }) : /* @__PURE__ */ jsxs26("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: [
15363
+ /* @__PURE__ */ jsx32(AlertCircle3, { className: "w-3 h-3 text-amber-600 shrink-0" }),
14152
15364
  "\u05E0\u05D3\u05E8\u05E9 \u05E6\u05D9\u05E8\u05D5\u05E3 \u05E7\u05D5\u05D1\u05E5 \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA \u05D6\u05D5"
14153
15365
  ] }),
14154
- hasValidMedia && /* @__PURE__ */ jsx23(
15366
+ hasValidMedia && /* @__PURE__ */ jsx32(
14155
15367
  "a",
14156
15368
  {
14157
15369
  href: headerMediaUrl,
@@ -14159,10 +15371,10 @@ function TemplateSelectionBlock({
14159
15371
  rel: "noopener noreferrer",
14160
15372
  title: "\u05EA\u05E6\u05D5\u05D2\u05D4 \u05DE\u05E7\u05D3\u05D9\u05DE\u05D4 \u05E9\u05DC \u05D4\u05E7\u05D5\u05D1\u05E5",
14161
15373
  className: "p-1 text-slate-400 hover:text-emerald-700 hover:bg-slate-200/60 rounded-md transition-colors",
14162
- children: /* @__PURE__ */ jsx23(ExternalLink4, { className: "w-3.5 h-3.5" })
15374
+ children: /* @__PURE__ */ jsx32(ExternalLink4, { className: "w-3.5 h-3.5" })
14163
15375
  }
14164
15376
  ),
14165
- /* @__PURE__ */ jsx23(
15377
+ /* @__PURE__ */ jsx32(
14166
15378
  "input",
14167
15379
  {
14168
15380
  ref: fileInputRef,
@@ -14180,7 +15392,7 @@ function TemplateSelectionBlock({
14180
15392
  disabled: isUploadingMedia
14181
15393
  }
14182
15394
  ),
14183
- /* @__PURE__ */ jsx23(
15395
+ /* @__PURE__ */ jsx32(
14184
15396
  "button",
14185
15397
  {
14186
15398
  type: "button",
@@ -14191,39 +15403,39 @@ function TemplateSelectionBlock({
14191
15403
  },
14192
15404
  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"}`,
14193
15405
  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`,
14194
- children: isUploadingMedia ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
14195
- /* @__PURE__ */ jsx23(Loader25, { className: "w-3.5 h-3.5 animate-spin" }),
14196
- /* @__PURE__ */ jsx23("span", { children: "\u05DE\u05E2\u05DC\u05D4..." })
14197
- ] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
14198
- /* @__PURE__ */ jsx23(Upload3, { className: "w-3.5 h-3.5" }),
14199
- /* @__PURE__ */ jsx23("span", { children: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5" : uploadButtonLabel })
15406
+ children: isUploadingMedia ? /* @__PURE__ */ jsxs26(Fragment7, { children: [
15407
+ /* @__PURE__ */ jsx32(Loader25, { className: "w-3.5 h-3.5 animate-spin" }),
15408
+ /* @__PURE__ */ jsx32("span", { children: "\u05DE\u05E2\u05DC\u05D4..." })
15409
+ ] }) : /* @__PURE__ */ jsxs26(Fragment7, { children: [
15410
+ /* @__PURE__ */ jsx32(Upload3, { className: "w-3.5 h-3.5" }),
15411
+ /* @__PURE__ */ jsx32("span", { children: hasValidMedia ? "\u05D4\u05D7\u05DC\u05E3 \u05E7\u05D5\u05D1\u05E5" : uploadButtonLabel })
14200
15412
  ] })
14201
15413
  }
14202
15414
  )
14203
15415
  ] })
14204
15416
  ] });
14205
15417
  })(),
14206
- selectedTemplate && templateVariables.length > 0 && /* @__PURE__ */ jsxs19("div", { className: "shrink-0 flex flex-col gap-1.5 pt-2 border-t border-slate-200/80 pb-0", children: [
14207
- /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between shrink-0", children: [
14208
- /* @__PURE__ */ jsx23("span", { className: "text-[11px] font-bold text-slate-700", children: "\u05DE\u05D9\u05E4\u05D5\u05D9 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD" }),
14209
- /* @__PURE__ */ jsxs19("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-200", children: [
15418
+ selectedTemplate && templateVariables.length > 0 && /* @__PURE__ */ jsxs26("div", { className: "shrink-0 flex flex-col gap-1.5 pt-2 border-t border-slate-200/80 pb-0", children: [
15419
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between shrink-0", children: [
15420
+ /* @__PURE__ */ jsx32("span", { className: "text-[11px] font-bold text-slate-700", children: "\u05DE\u05D9\u05E4\u05D5\u05D9 \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD" }),
15421
+ /* @__PURE__ */ jsxs26("span", { className: "text-[9px] font-semibold text-emerald-700 bg-emerald-50 px-1.5 py-0.5 rounded border border-emerald-200", children: [
14210
15422
  templateVariables.length,
14211
15423
  " \u05DE\u05E9\u05EA\u05E0\u05D9\u05DD"
14212
15424
  ] })
14213
15425
  ] }),
14214
- /* @__PURE__ */ jsx23("div", { className: "max-h-48 overflow-y-auto space-y-1.5 pr-0.5", children: templateVariables.map((varKey) => {
15426
+ /* @__PURE__ */ jsx32("div", { className: "max-h-48 overflow-y-auto space-y-1.5 pr-0.5", children: templateVariables.map((varKey) => {
14215
15427
  var _a;
14216
15428
  const mapping = variableMapping[varKey] || { type: "column", value: "" };
14217
15429
  const isStatic = mapping.type === "static";
14218
15430
  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 || "";
14219
- return /* @__PURE__ */ jsxs19(
15431
+ return /* @__PURE__ */ jsxs26(
14220
15432
  "div",
14221
15433
  {
14222
15434
  className: "flex items-center gap-1.5 p-1 bg-white border border-slate-200 rounded-xl text-xs shrink-0",
14223
15435
  children: [
14224
- /* @__PURE__ */ jsx23("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}}}` }),
14225
- /* @__PURE__ */ jsxs19("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: [
14226
- /* @__PURE__ */ jsx23(
15436
+ /* @__PURE__ */ jsx32("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}}}` }),
15437
+ /* @__PURE__ */ jsxs26("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: [
15438
+ /* @__PURE__ */ jsx32(
14227
15439
  "button",
14228
15440
  {
14229
15441
  type: "button",
@@ -14232,7 +15444,7 @@ function TemplateSelectionBlock({
14232
15444
  children: "\u05E2\u05DE\u05D5\u05D3\u05D4"
14233
15445
  }
14234
15446
  ),
14235
- /* @__PURE__ */ jsx23(
15447
+ /* @__PURE__ */ jsx32(
14236
15448
  "button",
14237
15449
  {
14238
15450
  type: "button",
@@ -14242,7 +15454,7 @@ function TemplateSelectionBlock({
14242
15454
  }
14243
15455
  )
14244
15456
  ] }),
14245
- isStatic ? /* @__PURE__ */ jsx23(
15457
+ isStatic ? /* @__PURE__ */ jsx32(
14246
15458
  "input",
14247
15459
  {
14248
15460
  type: "text",
@@ -14251,20 +15463,20 @@ function TemplateSelectionBlock({
14251
15463
  placeholder: "\u05D4\u05D6\u05DF \u05E2\u05E8\u05DA \u05E7\u05D1\u05D5\u05E2 (\u05D7\u05D5\u05D1\u05D4)...",
14252
15464
  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"}`
14253
15465
  }
14254
- ) : /* @__PURE__ */ jsxs19("div", { className: "relative flex-1 min-w-0", children: [
14255
- /* @__PURE__ */ jsxs19(
15466
+ ) : /* @__PURE__ */ jsxs26("div", { className: "relative flex-1 min-w-0", children: [
15467
+ /* @__PURE__ */ jsxs26(
14256
15468
  "select",
14257
15469
  {
14258
15470
  value: selectedColVal,
14259
15471
  onChange: (e) => handleVariableValueChange(varKey, e.target.value),
14260
15472
  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",
14261
15473
  children: [
14262
- /* @__PURE__ */ jsx23("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
14263
- textableColumnOptions.map((opt) => /* @__PURE__ */ jsx23("option", { value: opt.id, children: opt.label }, opt.id))
15474
+ /* @__PURE__ */ jsx32("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
15475
+ textableColumnOptions.map((opt) => /* @__PURE__ */ jsx32("option", { value: opt.id, children: opt.label }, opt.id))
14264
15476
  ]
14265
15477
  }
14266
15478
  ),
14267
- /* @__PURE__ */ jsx23(ChevronDown4, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
15479
+ /* @__PURE__ */ jsx32(ChevronDown4, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
14268
15480
  ] })
14269
15481
  ]
14270
15482
  },
@@ -14284,7 +15496,7 @@ import {
14284
15496
  CheckSquare,
14285
15497
  RefreshCw
14286
15498
  } from "lucide-react";
14287
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
15499
+ import { Fragment as Fragment8, jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
14288
15500
  function DynamicFiltersBlock({
14289
15501
  filterableColumns,
14290
15502
  filters,
@@ -14299,31 +15511,31 @@ function DynamicFiltersBlock({
14299
15511
  loadTableData,
14300
15512
  isLoadingTableData
14301
15513
  }) {
14302
- return /* @__PURE__ */ jsxs20("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: [
14303
- /* @__PURE__ */ jsxs20("div", { className: "space-y-2", children: [
14304
- /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: [
14305
- /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
14306
- /* @__PURE__ */ jsx24(Filter3, { className: "w-4 h-4 text-emerald-600" }),
14307
- /* @__PURE__ */ jsx24("span", { className: "text-xs font-bold text-slate-800", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05D3\u05D9\u05E0\u05DE\u05D9" }),
14308
- activeFiltersCount > 0 && /* @__PURE__ */ jsx24("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 })
15514
+ return /* @__PURE__ */ jsxs27("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: [
15515
+ /* @__PURE__ */ jsxs27("div", { className: "space-y-2", children: [
15516
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: [
15517
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-2", children: [
15518
+ /* @__PURE__ */ jsx33(Filter3, { className: "w-4 h-4 text-emerald-600" }),
15519
+ /* @__PURE__ */ jsx33("span", { className: "text-xs font-bold text-slate-800", children: "\u05E1\u05D9\u05E0\u05D5\u05DF \u05D3\u05D9\u05E0\u05DE\u05D9" }),
15520
+ activeFiltersCount > 0 && /* @__PURE__ */ jsx33("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 })
14309
15521
  ] }),
14310
- activeFiltersCount > 0 && /* @__PURE__ */ jsxs20(
15522
+ activeFiltersCount > 0 && /* @__PURE__ */ jsxs27(
14311
15523
  "button",
14312
15524
  {
14313
15525
  type: "button",
14314
15526
  onClick: handleClearFilters,
14315
15527
  className: "text-[11px] text-rose-600 hover:text-rose-700 font-semibold hover:underline flex items-center gap-1 cursor-pointer",
14316
15528
  children: [
14317
- /* @__PURE__ */ jsx24(X10, { className: "w-3 h-3" }),
14318
- /* @__PURE__ */ jsx24("span", { children: "\u05E0\u05E7\u05D4" })
15529
+ /* @__PURE__ */ jsx33(X10, { className: "w-3 h-3" }),
15530
+ /* @__PURE__ */ jsx33("span", { children: "\u05E0\u05E7\u05D4" })
14319
15531
  ]
14320
15532
  }
14321
15533
  )
14322
15534
  ] }),
14323
- /* @__PURE__ */ jsx24("div", { className: "py-1", children: filterableColumns.length === 0 ? /* @__PURE__ */ jsxs20("div", { className: "flex flex-col items-center justify-center text-center p-4 text-xs text-slate-400 gap-1", children: [
14324
- /* @__PURE__ */ jsx24("span", { children: "\u05D0\u05D9\u05DF \u05E9\u05D3\u05D5\u05EA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D6\u05D5" }),
14325
- /* @__PURE__ */ jsx24("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" })
14326
- ] }) : /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-2", children: filterableColumns.map((col) => {
15535
+ /* @__PURE__ */ jsx33("div", { className: "py-1", children: filterableColumns.length === 0 ? /* @__PURE__ */ jsxs27("div", { className: "flex flex-col items-center justify-center text-center p-4 text-xs text-slate-400 gap-1", children: [
15536
+ /* @__PURE__ */ jsx33("span", { children: "\u05D0\u05D9\u05DF \u05E9\u05D3\u05D5\u05EA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF \u05D1\u05D8\u05D1\u05DC\u05D4 \u05D6\u05D5" }),
15537
+ /* @__PURE__ */ jsx33("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" })
15538
+ ] }) : /* @__PURE__ */ jsx33("div", { className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-2", children: filterableColumns.map((col) => {
14327
15539
  var _a, _b, _c;
14328
15540
  const colType = (_a = col.type) == null ? void 0 : _a.toUpperCase();
14329
15541
  const isBoolean = colType === "BOOLEAN";
@@ -14331,9 +15543,9 @@ function DynamicFiltersBlock({
14331
15543
  const isActive = Boolean(currentValue);
14332
15544
  const refTableId = ((_b = col == null ? void 0 : col.config) == null ? void 0 : _b.referencedTableId) || (col == null ? void 0 : col.referencedTableId);
14333
15545
  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] : [];
14334
- return /* @__PURE__ */ jsxs20("div", { className: "space-y-1", children: [
14335
- /* @__PURE__ */ jsxs20("div", { className: "flex items-center justify-between", children: [
14336
- /* @__PURE__ */ jsx24(
15546
+ return /* @__PURE__ */ jsxs27("div", { className: "space-y-1", children: [
15547
+ /* @__PURE__ */ jsxs27("div", { className: "flex items-center justify-between", children: [
15548
+ /* @__PURE__ */ jsx33(
14337
15549
  "label",
14338
15550
  {
14339
15551
  className: "text-[11px] font-semibold text-slate-700 truncate max-w-[130px]",
@@ -14341,49 +15553,49 @@ function DynamicFiltersBlock({
14341
15553
  children: col.name
14342
15554
  }
14343
15555
  ),
14344
- /* @__PURE__ */ jsx24("span", { className: "text-[9px] text-slate-400 font-mono", children: isBoolean ? "\u05DB\u05DF/\u05DC\u05D0" : "\u05E7\u05E9\u05E8" })
15556
+ /* @__PURE__ */ jsx33("span", { className: "text-[9px] text-slate-400 font-mono", children: isBoolean ? "\u05DB\u05DF/\u05DC\u05D0" : "\u05E7\u05E9\u05E8" })
14345
15557
  ] }),
14346
- /* @__PURE__ */ jsxs20("div", { className: "relative", children: [
14347
- /* @__PURE__ */ jsxs20(
15558
+ /* @__PURE__ */ jsxs27("div", { className: "relative", children: [
15559
+ /* @__PURE__ */ jsxs27(
14348
15560
  "select",
14349
15561
  {
14350
15562
  value: currentValue,
14351
15563
  onChange: (e) => handleFilterChange(col.name, e.target.value),
14352
15564
  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"}`,
14353
15565
  children: [
14354
- /* @__PURE__ */ jsx24("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
14355
- isBoolean ? /* @__PURE__ */ jsxs20(Fragment6, { children: [
14356
- /* @__PURE__ */ jsx24("option", { value: "true", children: "\u05DB\u05DF" }),
14357
- /* @__PURE__ */ jsx24("option", { value: "false", children: "\u05DC\u05D0" })
14358
- ] }) : options.map((opt) => /* @__PURE__ */ jsx24("option", { value: opt.id || opt._id, children: getRelationOptionLabel(opt, col, relationOptions) }, opt.id || opt._id))
15566
+ /* @__PURE__ */ jsx33("option", { value: "", children: "\u05D4\u05DB\u05DC" }),
15567
+ isBoolean ? /* @__PURE__ */ jsxs27(Fragment8, { children: [
15568
+ /* @__PURE__ */ jsx33("option", { value: "true", children: "\u05DB\u05DF" }),
15569
+ /* @__PURE__ */ jsx33("option", { value: "false", children: "\u05DC\u05D0" })
15570
+ ] }) : options.map((opt) => /* @__PURE__ */ jsx33("option", { value: opt.id || opt._id, children: getRelationOptionLabel(opt, col, relationOptions) }, opt.id || opt._id))
14359
15571
  ]
14360
15572
  }
14361
15573
  ),
14362
- /* @__PURE__ */ jsx24(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
15574
+ /* @__PURE__ */ jsx33(ChevronDown5, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
14363
15575
  ] })
14364
15576
  ] }, col.name);
14365
15577
  }) }) })
14366
15578
  ] }),
14367
- /* @__PURE__ */ jsxs20("div", { className: "pt-2.5 mt-2 border-t border-slate-200/80 flex items-center justify-between gap-1.5 shrink-0", children: [
14368
- /* @__PURE__ */ jsxs20(
15579
+ /* @__PURE__ */ jsxs27("div", { className: "pt-2.5 mt-2 border-t border-slate-200/80 flex items-center justify-between gap-1.5 shrink-0", children: [
15580
+ /* @__PURE__ */ jsxs27(
14369
15581
  "div",
14370
15582
  {
14371
15583
  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"}`,
14372
15584
  children: [
14373
- /* @__PURE__ */ jsx24(
15585
+ /* @__PURE__ */ jsx33(
14374
15586
  CheckSquare,
14375
15587
  {
14376
15588
  className: `w-3 h-3 ${selectedRowIds.length > 0 ? "text-emerald-600" : "text-slate-400"}`
14377
15589
  }
14378
15590
  ),
14379
- /* @__PURE__ */ jsxs20("span", { children: [
15591
+ /* @__PURE__ */ jsxs27("span", { children: [
14380
15592
  "\u05E0\u05D1\u05D7\u05E8\u05D5 ",
14381
15593
  selectedRowIds.length
14382
15594
  ] })
14383
15595
  ]
14384
15596
  }
14385
15597
  ),
14386
- /* @__PURE__ */ jsx24(
15598
+ /* @__PURE__ */ jsx33(
14387
15599
  "button",
14388
15600
  {
14389
15601
  type: "button",
@@ -14391,7 +15603,7 @@ function DynamicFiltersBlock({
14391
15603
  disabled: isLoadingTableData,
14392
15604
  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",
14393
15605
  title: "\u05E8\u05E2\u05E0\u05DF \u05E0\u05EA\u05D5\u05E0\u05D9 \u05D8\u05D1\u05DC\u05D4",
14394
- children: /* @__PURE__ */ jsx24(
15606
+ children: /* @__PURE__ */ jsx33(
14395
15607
  RefreshCw,
14396
15608
  {
14397
15609
  className: `w-3.5 h-3.5 ${isLoadingTableData ? "animate-spin text-emerald-600" : ""}`
@@ -14414,7 +15626,7 @@ import {
14414
15626
  X as X11,
14415
15627
  CheckSquare as CheckSquare2
14416
15628
  } from "lucide-react";
14417
- import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
15629
+ import { Fragment as Fragment9, jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
14418
15630
  function SettingsAndActionsBlock({
14419
15631
  isScanningPhoneColumns,
14420
15632
  targetPhoneOptions,
@@ -14457,29 +15669,29 @@ function SettingsAndActionsBlock({
14457
15669
  clearBroadcastSummary
14458
15670
  }) {
14459
15671
  var _a;
14460
- return /* @__PURE__ */ jsxs21("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: [
14461
- /* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
14462
- /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
14463
- /* @__PURE__ */ jsx25("span", { className: "text-sm", children: "\u2699\uFE0F" }),
14464
- /* @__PURE__ */ jsx25("span", { className: "text-xs font-bold text-slate-800", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D5\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA" })
15672
+ return /* @__PURE__ */ jsxs28("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: [
15673
+ /* @__PURE__ */ jsxs28("div", { className: "space-y-2", children: [
15674
+ /* @__PURE__ */ jsx34("div", { className: "flex items-center justify-between pb-2 border-b border-slate-200/70 shrink-0", children: /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-2", children: [
15675
+ /* @__PURE__ */ jsx34("span", { className: "text-sm", children: "\u2699\uFE0F" }),
15676
+ /* @__PURE__ */ jsx34("span", { className: "text-xs font-bold text-slate-800", children: "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05D5\u05E4\u05E2\u05D5\u05DC\u05D5\u05EA" })
14465
15677
  ] }) }),
14466
- /* @__PURE__ */ jsxs21("div", { className: "space-y-2.5 py-1", children: [
14467
- isScanningPhoneColumns && targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs21("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: [
14468
- /* @__PURE__ */ jsx25(Loader26, { className: "w-4 h-4 animate-spin text-emerald-600 shrink-0" }),
14469
- /* @__PURE__ */ jsx25("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..." })
14470
- ] }) : targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs21("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: [
14471
- /* @__PURE__ */ jsx25(AlertCircle4, { className: "w-4 h-4 text-amber-600 shrink-0" }),
14472
- /* @__PURE__ */ jsx25("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" })
14473
- ] }) : targetPhoneOptions.length === 1 && targetPhoneOptions[0].type === "DIRECT" ? /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
14474
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14475
- /* @__PURE__ */ jsxs21("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
14476
- /* @__PURE__ */ jsx25(Phone3, { className: "w-3 h-3 text-slate-400" }),
14477
- /* @__PURE__ */ jsx25("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
15678
+ /* @__PURE__ */ jsxs28("div", { className: "space-y-2.5 py-1", children: [
15679
+ isScanningPhoneColumns && targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs28("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: [
15680
+ /* @__PURE__ */ jsx34(Loader26, { className: "w-4 h-4 animate-spin text-emerald-600 shrink-0" }),
15681
+ /* @__PURE__ */ jsx34("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..." })
15682
+ ] }) : targetPhoneOptions.length === 0 ? /* @__PURE__ */ jsxs28("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: [
15683
+ /* @__PURE__ */ jsx34(AlertCircle4, { className: "w-4 h-4 text-amber-600 shrink-0" }),
15684
+ /* @__PURE__ */ jsx34("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" })
15685
+ ] }) : targetPhoneOptions.length === 1 && targetPhoneOptions[0].type === "DIRECT" ? /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
15686
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
15687
+ /* @__PURE__ */ jsxs28("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
15688
+ /* @__PURE__ */ jsx34(Phone3, { className: "w-3 h-3 text-slate-400" }),
15689
+ /* @__PURE__ */ jsx34("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
14478
15690
  ] }),
14479
- /* @__PURE__ */ jsx25("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" })
15691
+ /* @__PURE__ */ jsx34("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" })
14480
15692
  ] }),
14481
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14482
- /* @__PURE__ */ jsx25(
15693
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15694
+ /* @__PURE__ */ jsx34(
14483
15695
  "input",
14484
15696
  {
14485
15697
  type: "text",
@@ -14489,52 +15701,52 @@ function SettingsAndActionsBlock({
14489
15701
  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"
14490
15702
  }
14491
15703
  ),
14492
- /* @__PURE__ */ jsx25(Phone3, { className: "w-3.5 h-3.5 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
15704
+ /* @__PURE__ */ jsx34(Phone3, { className: "w-3.5 h-3.5 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
14493
15705
  ] })
14494
- ] }) : /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
14495
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14496
- /* @__PURE__ */ jsxs21("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
14497
- /* @__PURE__ */ jsx25(Phone3, { className: "w-3 h-3 text-slate-400" }),
14498
- /* @__PURE__ */ jsx25("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
15706
+ ] }) : /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
15707
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
15708
+ /* @__PURE__ */ jsxs28("label", { className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1", children: [
15709
+ /* @__PURE__ */ jsx34(Phone3, { className: "w-3 h-3 text-slate-400" }),
15710
+ /* @__PURE__ */ jsx34("span", { children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D8\u05DC\u05E4\u05D5\u05DF \u05D9\u05E2\u05D3" })
14499
15711
  ] }),
14500
- /* @__PURE__ */ jsx25("span", { className: "text-[9px] text-slate-400", children: "\u05D7\u05D5\u05D1\u05D4" })
15712
+ /* @__PURE__ */ jsx34("span", { className: "text-[9px] text-slate-400", children: "\u05D7\u05D5\u05D1\u05D4" })
14501
15713
  ] }),
14502
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14503
- /* @__PURE__ */ jsx25(
15714
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15715
+ /* @__PURE__ */ jsx34(
14504
15716
  "select",
14505
15717
  {
14506
15718
  value: phoneColumnId,
14507
15719
  onChange: (e) => setPhoneColumnId(e.target.value),
14508
15720
  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",
14509
- children: targetPhoneOptions.map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: opt.label }, opt.id))
15721
+ children: targetPhoneOptions.map((opt) => /* @__PURE__ */ jsx34("option", { value: opt.id, children: opt.label }, opt.id))
14510
15722
  }
14511
15723
  ),
14512
- /* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
15724
+ /* @__PURE__ */ jsx34(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-2 top-1/2 -translate-y-1/2 pointer-events-none" })
14513
15725
  ] })
14514
15726
  ] }),
14515
- /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
14516
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14517
- /* @__PURE__ */ jsxs21(
15727
+ /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
15728
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
15729
+ /* @__PURE__ */ jsxs28(
14518
15730
  "label",
14519
15731
  {
14520
15732
  htmlFor: "whatsapp-auto-select-records",
14521
15733
  className: "text-[11px] font-semibold text-slate-700 flex items-center gap-1 cursor-pointer",
14522
15734
  children: [
14523
- /* @__PURE__ */ jsx25(CheckSquare2, { className: "w-3 h-3 text-slate-400" }),
14524
- /* @__PURE__ */ jsx25("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)" })
15735
+ /* @__PURE__ */ jsx34(CheckSquare2, { className: "w-3 h-3 text-slate-400" }),
15736
+ /* @__PURE__ */ jsx34("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)" })
14525
15737
  ]
14526
15738
  }
14527
15739
  ),
14528
- autoSelectCount !== null && autoSelectCount > 0 && /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 animate-in fade-in duration-150", children: [
14529
- /* @__PURE__ */ jsxs21("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: [
14530
- /* @__PURE__ */ jsx25("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }),
14531
- /* @__PURE__ */ jsxs21("span", { children: [
15740
+ autoSelectCount !== null && autoSelectCount > 0 && /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1.5 animate-in fade-in duration-150", children: [
15741
+ /* @__PURE__ */ jsxs28("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: [
15742
+ /* @__PURE__ */ jsx34("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }),
15743
+ /* @__PURE__ */ jsxs28("span", { children: [
14532
15744
  "\u05E0\u05D1\u05D7\u05E8\u05D5 ",
14533
15745
  selectedRowIdsCount,
14534
15746
  " \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA"
14535
15747
  ] })
14536
15748
  ] }),
14537
- /* @__PURE__ */ jsxs21(
15749
+ /* @__PURE__ */ jsxs28(
14538
15750
  "button",
14539
15751
  {
14540
15752
  type: "button",
@@ -14543,14 +15755,14 @@ function SettingsAndActionsBlock({
14543
15755
  title: "\u05E0\u05E7\u05D4 \u05D1\u05D7\u05D9\u05E8\u05D4 \u05D0\u05D5\u05D8\u05D5\u05DE\u05D8\u05D9\u05EA",
14544
15756
  "aria-label": "Clear auto select count",
14545
15757
  children: [
14546
- /* @__PURE__ */ jsx25(X11, { className: "w-3 h-3" }),
14547
- /* @__PURE__ */ jsx25("span", { children: "\u05E0\u05E7\u05D4" })
15758
+ /* @__PURE__ */ jsx34(X11, { className: "w-3 h-3" }),
15759
+ /* @__PURE__ */ jsx34("span", { children: "\u05E0\u05E7\u05D4" })
14548
15760
  ]
14549
15761
  }
14550
15762
  )
14551
15763
  ] })
14552
15764
  ] }),
14553
- /* @__PURE__ */ jsx25("div", { className: "relative", children: /* @__PURE__ */ jsx25(
15765
+ /* @__PURE__ */ jsx34("div", { className: "relative", children: /* @__PURE__ */ jsx34(
14554
15766
  "input",
14555
15767
  {
14556
15768
  id: "whatsapp-auto-select-records",
@@ -14578,19 +15790,19 @@ function SettingsAndActionsBlock({
14578
15790
  }
14579
15791
  ) })
14580
15792
  ] }),
14581
- (selectedPhoneOption == null ? void 0 : selectedPhoneOption.type) === "SUBTABLE" && /* @__PURE__ */ jsxs21("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: [
14582
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 pb-1 border-b border-emerald-200/60", children: [
14583
- /* @__PURE__ */ jsx25(Users, { className: "w-3.5 h-3.5 text-emerald-700" }),
14584
- /* @__PURE__ */ jsxs21("span", { className: "text-[10.5px] font-bold text-emerald-900 truncate", children: [
15793
+ (selectedPhoneOption == null ? void 0 : selectedPhoneOption.type) === "SUBTABLE" && /* @__PURE__ */ jsxs28("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: [
15794
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1.5 pb-1 border-b border-emerald-200/60", children: [
15795
+ /* @__PURE__ */ jsx34(Users, { className: "w-3.5 h-3.5 text-emerald-700" }),
15796
+ /* @__PURE__ */ jsxs28("span", { className: "text-[10.5px] font-bold text-emerald-900 truncate", children: [
14585
15797
  "\u05D4\u05D2\u05D3\u05E8\u05D5\u05EA \u05E9\u05DC\u05D9\u05D7\u05D4 \u05DC\u05EA\u05EA-\u05D8\u05D1\u05DC\u05D4 \u05DE\u05E7\u05D5\u05E9\u05E8\u05EA (",
14586
15798
  selectedPhoneOption.parentColumnName,
14587
15799
  ")"
14588
15800
  ] })
14589
15801
  ] }),
14590
- /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
14591
- /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx25("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:" }) }),
14592
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14593
- /* @__PURE__ */ jsxs21(
15802
+ /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
15803
+ /* @__PURE__ */ jsx34("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx34("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:" }) }),
15804
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15805
+ /* @__PURE__ */ jsxs28(
14594
15806
  "select",
14595
15807
  {
14596
15808
  value: subtableFilterColumn,
@@ -14600,10 +15812,10 @@ function SettingsAndActionsBlock({
14600
15812
  },
14601
15813
  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",
14602
15814
  children: [
14603
- /* @__PURE__ */ jsx25("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)" }),
15815
+ /* @__PURE__ */ jsx34("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)" }),
14604
15816
  subtableFilterableColumns.map((col) => {
14605
15817
  var _a2;
14606
- return /* @__PURE__ */ jsxs21("option", { value: col.name, children: [
15818
+ return /* @__PURE__ */ jsxs28("option", { value: col.name, children: [
14607
15819
  col.name,
14608
15820
  " (",
14609
15821
  ((_a2 = col.type) == null ? void 0 : _a2.toUpperCase()) === "BOOLEAN" ? "\u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9" : "\u05E7\u05E9\u05E8",
@@ -14613,30 +15825,30 @@ function SettingsAndActionsBlock({
14613
15825
  ]
14614
15826
  }
14615
15827
  ),
14616
- /* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
15828
+ /* @__PURE__ */ jsx34(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
14617
15829
  ] })
14618
15830
  ] }),
14619
- selectedSubtableFilterCol && /* @__PURE__ */ jsxs21("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
14620
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14621
- /* @__PURE__ */ jsx25("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:" }),
14622
- !subtableFilterValue && /* @__PURE__ */ jsx25("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." })
15831
+ selectedSubtableFilterCol && /* @__PURE__ */ jsxs28("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
15832
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
15833
+ /* @__PURE__ */ jsx34("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:" }),
15834
+ !subtableFilterValue && /* @__PURE__ */ jsx34("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." })
14623
15835
  ] }),
14624
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14625
- /* @__PURE__ */ jsxs21(
15836
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15837
+ /* @__PURE__ */ jsxs28(
14626
15838
  "select",
14627
15839
  {
14628
15840
  value: subtableFilterValue,
14629
15841
  onChange: (e) => setSubtableFilterValue(e.target.value),
14630
15842
  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"}`,
14631
15843
  children: [
14632
- /* @__PURE__ */ jsx25("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF..." }),
14633
- ((_a = selectedSubtableFilterCol.type) == null ? void 0 : _a.toUpperCase()) === "BOOLEAN" ? /* @__PURE__ */ jsxs21(Fragment7, { children: [
14634
- /* @__PURE__ */ jsx25("option", { value: "true", children: "\u05DB\u05DF (true)" }),
14635
- /* @__PURE__ */ jsx25("option", { value: "false", children: "\u05DC\u05D0 (false)" })
15844
+ /* @__PURE__ */ jsx34("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA \u05DC\u05E1\u05D9\u05E0\u05D5\u05DF..." }),
15845
+ ((_a = selectedSubtableFilterCol.type) == null ? void 0 : _a.toUpperCase()) === "BOOLEAN" ? /* @__PURE__ */ jsxs28(Fragment9, { children: [
15846
+ /* @__PURE__ */ jsx34("option", { value: "true", children: "\u05DB\u05DF (true)" }),
15847
+ /* @__PURE__ */ jsx34("option", { value: "false", children: "\u05DC\u05D0 (false)" })
14636
15848
  ] }) : getRelationOptionsForCol(
14637
15849
  selectedSubtableFilterCol.name,
14638
15850
  selectedPhoneOption.parentColumnName
14639
- ).map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: getRelationOptionLabel(
15851
+ ).map((opt) => /* @__PURE__ */ jsx34("option", { value: opt.id, children: getRelationOptionLabel(
14640
15852
  opt,
14641
15853
  selectedSubtableFilterCol,
14642
15854
  relationOptions
@@ -14644,32 +15856,32 @@ function SettingsAndActionsBlock({
14644
15856
  ]
14645
15857
  }
14646
15858
  ),
14647
- /* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
15859
+ /* @__PURE__ */ jsx34(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
14648
15860
  ] })
14649
15861
  ] }),
14650
- /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
14651
- /* @__PURE__ */ jsx25("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:" }),
14652
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14653
- /* @__PURE__ */ jsxs21(
15862
+ /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
15863
+ /* @__PURE__ */ jsx34("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:" }),
15864
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15865
+ /* @__PURE__ */ jsxs28(
14654
15866
  "select",
14655
15867
  {
14656
15868
  value: subtableSendLimit,
14657
15869
  onChange: (e) => setSubtableSendLimit(e.target.value),
14658
15870
  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",
14659
15871
  children: [
14660
- /* @__PURE__ */ jsx25("option", { value: "PRIMARY", children: "\u05DC\u05E0\u05E6\u05D9\u05D2 \u05E8\u05D0\u05E9\u05D9 \u05D1\u05DC\u05D1\u05D3" }),
14661
- /* @__PURE__ */ jsx25("option", { value: "FIRST", children: "\u05E0\u05E6\u05D9\u05D2 \u05D0\u05D7\u05D3 \u05D1\u05DC\u05D1\u05D3" }),
14662
- /* @__PURE__ */ jsx25("option", { value: "ALL", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD" })
15872
+ /* @__PURE__ */ jsx34("option", { value: "PRIMARY", children: "\u05DC\u05E0\u05E6\u05D9\u05D2 \u05E8\u05D0\u05E9\u05D9 \u05D1\u05DC\u05D1\u05D3" }),
15873
+ /* @__PURE__ */ jsx34("option", { value: "FIRST", children: "\u05E0\u05E6\u05D9\u05D2 \u05D0\u05D7\u05D3 \u05D1\u05DC\u05D1\u05D3" }),
15874
+ /* @__PURE__ */ jsx34("option", { value: "ALL", children: "\u05DB\u05DC \u05D4\u05E0\u05E6\u05D9\u05D2\u05D9\u05DD" })
14663
15875
  ]
14664
15876
  }
14665
15877
  ),
14666
- /* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
15878
+ /* @__PURE__ */ jsx34(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
14667
15879
  ] })
14668
15880
  ] })
14669
15881
  ] }),
14670
- /* @__PURE__ */ jsxs21("div", { className: "pt-2 border-t border-slate-200/70 space-y-2", children: [
14671
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
14672
- /* @__PURE__ */ jsx25(
15882
+ /* @__PURE__ */ jsxs28("div", { className: "pt-2 border-t border-slate-200/70 space-y-2", children: [
15883
+ /* @__PURE__ */ jsxs28("label", { className: "flex items-center gap-2 cursor-pointer select-none", children: [
15884
+ /* @__PURE__ */ jsx34(
14673
15885
  "input",
14674
15886
  {
14675
15887
  type: "checkbox",
@@ -14686,13 +15898,13 @@ function SettingsAndActionsBlock({
14686
15898
  className: "w-3.5 h-3.5 rounded border-slate-300 text-emerald-600 focus:ring-emerald-500 cursor-pointer"
14687
15899
  }
14688
15900
  ),
14689
- /* @__PURE__ */ jsx25("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" })
15901
+ /* @__PURE__ */ jsx34("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" })
14690
15902
  ] }),
14691
- enablePostSendAction && /* @__PURE__ */ jsx25("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__ */ jsx25("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__ */ jsxs21(Fragment7, { children: [
14692
- /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
14693
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14694
- /* @__PURE__ */ jsx25("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" }),
14695
- selectedPostSendOption && /* @__PURE__ */ jsx25(
15903
+ enablePostSendAction && /* @__PURE__ */ jsx34("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__ */ jsx34("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__ */ jsxs28(Fragment9, { children: [
15904
+ /* @__PURE__ */ jsxs28("div", { className: "space-y-1", children: [
15905
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
15906
+ /* @__PURE__ */ jsx34("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" }),
15907
+ selectedPostSendOption && /* @__PURE__ */ jsx34(
14696
15908
  "span",
14697
15909
  {
14698
15910
  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"}`,
@@ -14700,8 +15912,8 @@ function SettingsAndActionsBlock({
14700
15912
  }
14701
15913
  )
14702
15914
  ] }),
14703
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14704
- /* @__PURE__ */ jsxs21(
15915
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15916
+ /* @__PURE__ */ jsxs28(
14705
15917
  "select",
14706
15918
  {
14707
15919
  value: postSendActionColumn,
@@ -14714,35 +15926,35 @@ function SettingsAndActionsBlock({
14714
15926
  },
14715
15927
  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",
14716
15928
  children: [
14717
- /* @__PURE__ */ jsx25("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
14718
- postSendActionTargetOptions.map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: opt.label }, opt.id))
15929
+ /* @__PURE__ */ jsx34("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05DE\u05D5\u05D3\u05D4..." }),
15930
+ postSendActionTargetOptions.map((opt) => /* @__PURE__ */ jsx34("option", { value: opt.id, children: opt.label }, opt.id))
14719
15931
  ]
14720
15932
  }
14721
15933
  ),
14722
- /* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
15934
+ /* @__PURE__ */ jsx34(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
14723
15935
  ] })
14724
15936
  ] }),
14725
- selectedPostSendOption && /* @__PURE__ */ jsxs21("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
14726
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14727
- /* @__PURE__ */ jsx25("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05E8\u05DA \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
14728
- !postSendActionValue && /* @__PURE__ */ jsx25("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D1\u05D7\u05D5\u05E8 \u05E2\u05E8\u05DA" })
15937
+ selectedPostSendOption && /* @__PURE__ */ jsxs28("div", { className: "space-y-1 animate-in fade-in duration-150", children: [
15938
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
15939
+ /* @__PURE__ */ jsx34("label", { className: "text-[10px] font-semibold text-slate-600 block", children: "\u05E2\u05E8\u05DA \u05DC\u05E2\u05D3\u05DB\u05D5\u05DF" }),
15940
+ !postSendActionValue && /* @__PURE__ */ jsx34("span", { className: "text-[9px] text-amber-600 font-medium", children: "\u05D7\u05D5\u05D1\u05D4 \u05DC\u05D1\u05D7\u05D5\u05E8 \u05E2\u05E8\u05DA" })
14729
15941
  ] }),
14730
- /* @__PURE__ */ jsxs21("div", { className: "relative", children: [
14731
- /* @__PURE__ */ jsxs21(
15942
+ /* @__PURE__ */ jsxs28("div", { className: "relative", children: [
15943
+ /* @__PURE__ */ jsxs28(
14732
15944
  "select",
14733
15945
  {
14734
15946
  value: postSendActionValue,
14735
15947
  onChange: (e) => setPostSendActionValue(e.target.value),
14736
15948
  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"}`,
14737
15949
  children: [
14738
- /* @__PURE__ */ jsx25("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." }),
14739
- selectedPostSendOption.type === "BOOLEAN" ? /* @__PURE__ */ jsxs21(Fragment7, { children: [
14740
- /* @__PURE__ */ jsx25("option", { value: "true", children: "\u05DB\u05DF (Yes)" }),
14741
- /* @__PURE__ */ jsx25("option", { value: "false", children: "\u05DC\u05D0 (No)" })
15950
+ /* @__PURE__ */ jsx34("option", { value: "", children: "\u05D1\u05D7\u05E8 \u05E2\u05E8\u05DA..." }),
15951
+ selectedPostSendOption.type === "BOOLEAN" ? /* @__PURE__ */ jsxs28(Fragment9, { children: [
15952
+ /* @__PURE__ */ jsx34("option", { value: "true", children: "\u05DB\u05DF (Yes)" }),
15953
+ /* @__PURE__ */ jsx34("option", { value: "false", children: "\u05DC\u05D0 (No)" })
14742
15954
  ] }) : getRelationOptionsForCol(
14743
15955
  selectedPostSendOption.columnName,
14744
15956
  selectedPostSendOption.parentColumnName
14745
- ).map((opt) => /* @__PURE__ */ jsx25("option", { value: opt.id, children: getRelationOptionLabel(
15957
+ ).map((opt) => /* @__PURE__ */ jsx34("option", { value: opt.id, children: getRelationOptionLabel(
14746
15958
  opt,
14747
15959
  selectedPostSendOption,
14748
15960
  relationOptions
@@ -14750,15 +15962,15 @@ function SettingsAndActionsBlock({
14750
15962
  ]
14751
15963
  }
14752
15964
  ),
14753
- /* @__PURE__ */ jsx25(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
15965
+ /* @__PURE__ */ jsx34(ChevronDown6, { className: "w-3 h-3 text-slate-400 absolute left-1.5 top-1/2 -translate-y-1/2 pointer-events-none" })
14754
15966
  ] })
14755
15967
  ] })
14756
15968
  ] }) })
14757
15969
  ] })
14758
15970
  ] })
14759
15971
  ] }),
14760
- /* @__PURE__ */ jsxs21("div", { className: "mt-auto pt-2.5 border-t border-slate-200/80 space-y-2 shrink-0", children: [
14761
- /* @__PURE__ */ jsxs21(
15972
+ /* @__PURE__ */ jsxs28("div", { className: "mt-auto pt-2.5 border-t border-slate-200/80 space-y-2 shrink-0", children: [
15973
+ /* @__PURE__ */ jsxs28(
14762
15974
  "button",
14763
15975
  {
14764
15976
  type: "button",
@@ -14767,23 +15979,23 @@ function SettingsAndActionsBlock({
14767
15979
  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"}`,
14768
15980
  title: testButtonTitle,
14769
15981
  children: [
14770
- /* @__PURE__ */ jsx25(Phone3, { className: "w-3 h-3" }),
14771
- /* @__PURE__ */ jsx25("span", { children: "\u05E9\u05DC\u05D7 \u05D8\u05E1\u05D8" })
15982
+ /* @__PURE__ */ jsx34(Phone3, { className: "w-3 h-3" }),
15983
+ /* @__PURE__ */ jsx34("span", { children: "\u05E9\u05DC\u05D7 \u05D8\u05E1\u05D8" })
14772
15984
  ]
14773
15985
  }
14774
15986
  ),
14775
- isSendingBroadcast ? /* @__PURE__ */ jsxs21(
15987
+ isSendingBroadcast ? /* @__PURE__ */ jsxs28(
14776
15988
  "div",
14777
15989
  {
14778
15990
  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",
14779
15991
  "data-testid": "live-broadcast-progress",
14780
15992
  children: [
14781
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-700", children: [
14782
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 text-emerald-800 font-bold", children: [
14783
- /* @__PURE__ */ jsx25(Loader26, { className: "w-3.5 h-3.5 animate-spin text-emerald-600 shrink-0" }),
14784
- /* @__PURE__ */ jsx25("span", { children: "\u05E9\u05D5\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05EA\u05E4\u05D5\u05E6\u05D4..." })
15993
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between text-[11px] font-semibold text-slate-700", children: [
15994
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1.5 text-emerald-800 font-bold", children: [
15995
+ /* @__PURE__ */ jsx34(Loader26, { className: "w-3.5 h-3.5 animate-spin text-emerald-600 shrink-0" }),
15996
+ /* @__PURE__ */ jsx34("span", { children: "\u05E9\u05D5\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D1\u05EA\u05E4\u05D5\u05E6\u05D4..." })
14785
15997
  ] }),
14786
- /* @__PURE__ */ jsxs21("span", { className: "text-emerald-700 font-bold", children: [
15998
+ /* @__PURE__ */ jsxs28("span", { className: "text-emerald-700 font-bold", children: [
14787
15999
  (broadcastProgress == null ? void 0 : broadcastProgress.percent) || 0,
14788
16000
  "% (",
14789
16001
  (broadcastProgress == null ? void 0 : broadcastProgress.current) || 0,
@@ -14792,7 +16004,7 @@ function SettingsAndActionsBlock({
14792
16004
  ")"
14793
16005
  ] })
14794
16006
  ] }),
14795
- /* @__PURE__ */ jsx25("div", { className: "w-full h-2.5 bg-slate-100 rounded-full overflow-hidden border border-slate-200", children: /* @__PURE__ */ jsx25(
16007
+ /* @__PURE__ */ jsx34("div", { className: "w-full h-2.5 bg-slate-100 rounded-full overflow-hidden border border-slate-200", children: /* @__PURE__ */ jsx34(
14796
16008
  "div",
14797
16009
  {
14798
16010
  className: "h-full bg-emerald-500 rounded-full transition-all duration-300 ease-out",
@@ -14801,18 +16013,18 @@ function SettingsAndActionsBlock({
14801
16013
  }
14802
16014
  }
14803
16015
  ) }),
14804
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-around pt-1 text-[11px] font-medium border-t border-slate-100", children: [
14805
- /* @__PURE__ */ jsxs21("span", { className: "text-emerald-700 flex items-center gap-1", title: "\u05E0\u05E9\u05DC\u05D7\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4", children: [
14806
- /* @__PURE__ */ jsx25("span", { children: "\u2705" }),
14807
- /* @__PURE__ */ jsx25("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.successful) || 0 })
16016
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-around pt-1 text-[11px] font-medium border-t border-slate-100", children: [
16017
+ /* @__PURE__ */ jsxs28("span", { className: "text-emerald-700 flex items-center gap-1", title: "\u05E0\u05E9\u05DC\u05D7\u05D5 \u05D1\u05D4\u05E6\u05DC\u05D7\u05D4", children: [
16018
+ /* @__PURE__ */ jsx34("span", { children: "\u2705" }),
16019
+ /* @__PURE__ */ jsx34("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.successful) || 0 })
14808
16020
  ] }),
14809
- /* @__PURE__ */ jsxs21("span", { className: "text-rose-600 flex items-center gap-1", title: "\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4", children: [
14810
- /* @__PURE__ */ jsx25("span", { children: "\u274C" }),
14811
- /* @__PURE__ */ jsx25("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.failed) || 0 })
16021
+ /* @__PURE__ */ jsxs28("span", { className: "text-rose-600 flex items-center gap-1", title: "\u05E9\u05DC\u05D9\u05D7\u05D4 \u05E0\u05DB\u05E9\u05DC\u05D4", children: [
16022
+ /* @__PURE__ */ jsx34("span", { children: "\u274C" }),
16023
+ /* @__PURE__ */ jsx34("span", { className: "font-bold", children: (broadcastProgress == null ? void 0 : broadcastProgress.failed) || 0 })
14812
16024
  ] }),
14813
- /* @__PURE__ */ jsxs21("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: [
14814
- /* @__PURE__ */ jsx25("span", { children: "\u26A0\uFE0F" }),
14815
- /* @__PURE__ */ jsxs21("span", { className: "font-bold", children: [
16025
+ /* @__PURE__ */ jsxs28("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: [
16026
+ /* @__PURE__ */ jsx34("span", { children: "\u26A0\uFE0F" }),
16027
+ /* @__PURE__ */ jsxs28("span", { className: "font-bold", children: [
14816
16028
  (broadcastProgress == null ? void 0 : broadcastProgress.skipped) || 0,
14817
16029
  " \u05DC\u05DC\u05D0 \u05D8\u05DC\u05E4\u05D5\u05DF"
14818
16030
  ] })
@@ -14820,8 +16032,8 @@ function SettingsAndActionsBlock({
14820
16032
  ] })
14821
16033
  ]
14822
16034
  }
14823
- ) : /* @__PURE__ */ jsxs21(Fragment7, { children: [
14824
- /* @__PURE__ */ jsxs21(
16035
+ ) : /* @__PURE__ */ jsxs28(Fragment9, { children: [
16036
+ /* @__PURE__ */ jsxs28(
14825
16037
  "button",
14826
16038
  {
14827
16039
  type: "button",
@@ -14830,56 +16042,56 @@ function SettingsAndActionsBlock({
14830
16042
  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"}`,
14831
16043
  title: sendButtonTitle,
14832
16044
  children: [
14833
- /* @__PURE__ */ jsx25(Send, { className: "w-3.5 h-3.5" }),
14834
- /* @__PURE__ */ jsx25("span", { children: finalRecipientCount > 0 ? `\u05E9\u05DC\u05D7 \u05DC-${finalRecipientCount} \u05E0\u05DE\u05E2\u05E0\u05D9\u05DD` : "\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" })
16045
+ /* @__PURE__ */ jsx34(Send, { className: "w-3.5 h-3.5" }),
16046
+ /* @__PURE__ */ jsx34("span", { children: finalRecipientCount > 0 ? `\u05E9\u05DC\u05D7 \u05DC-${finalRecipientCount} \u05E0\u05DE\u05E2\u05E0\u05D9\u05DD` : "\u05E9\u05DC\u05D7 \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" })
14835
16047
  ]
14836
16048
  }
14837
16049
  ),
14838
- validMainRowsCount > 0 && /* @__PURE__ */ jsxs21("div", { className: "text-center text-[10.5px] text-slate-500 font-medium pt-0.5", children: [
16050
+ validMainRowsCount > 0 && /* @__PURE__ */ jsxs28("div", { className: "text-center text-[10.5px] text-slate-500 font-medium pt-0.5", children: [
14839
16051
  "\u05DE\u05EA\u05D5\u05DA ",
14840
16052
  validMainRowsCount,
14841
16053
  " \u05E9\u05D5\u05E8\u05D5\u05EA \u05E8\u05D0\u05E9\u05D9\u05D5\u05EA"
14842
16054
  ] }),
14843
- broadcastSummary && /* @__PURE__ */ jsxs21(
16055
+ broadcastSummary && /* @__PURE__ */ jsxs28(
14844
16056
  "div",
14845
16057
  {
14846
16058
  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",
14847
16059
  "data-testid": "broadcast-summary-card",
14848
16060
  children: [
14849
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
14850
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-1.5 text-[11px] font-bold text-slate-700", children: [
14851
- /* @__PURE__ */ jsx25("span", { className: "text-xs", children: "\u{1F4CA}" }),
14852
- /* @__PURE__ */ jsx25("span", { children: "\u05E1\u05D9\u05DB\u05D5\u05DD \u05E9\u05D9\u05D3\u05D5\u05E8 \u05D0\u05D7\u05E8\u05D5\u05DF" })
16061
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between", children: [
16062
+ /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1.5 text-[11px] font-bold text-slate-700", children: [
16063
+ /* @__PURE__ */ jsx34("span", { className: "text-xs", children: "\u{1F4CA}" }),
16064
+ /* @__PURE__ */ jsx34("span", { children: "\u05E1\u05D9\u05DB\u05D5\u05DD \u05E9\u05D9\u05D3\u05D5\u05E8 \u05D0\u05D7\u05E8\u05D5\u05DF" })
14853
16065
  ] }),
14854
- clearBroadcastSummary && /* @__PURE__ */ jsx25(
16066
+ clearBroadcastSummary && /* @__PURE__ */ jsx34(
14855
16067
  "button",
14856
16068
  {
14857
16069
  type: "button",
14858
16070
  onClick: clearBroadcastSummary,
14859
16071
  className: "text-slate-400 hover:text-slate-600 p-0.5 rounded-md hover:bg-slate-200/60 transition-colors cursor-pointer",
14860
16072
  title: "\u05E1\u05D2\u05D5\u05E8 \u05E1\u05D9\u05DB\u05D5\u05DD",
14861
- children: /* @__PURE__ */ jsx25(X11, { className: "w-3.5 h-3.5" })
16073
+ children: /* @__PURE__ */ jsx34(X11, { className: "w-3.5 h-3.5" })
14862
16074
  }
14863
16075
  )
14864
16076
  ] }),
14865
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-1.5 pt-0.5", children: [
14866
- /* @__PURE__ */ jsxs21("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: [
14867
- /* @__PURE__ */ jsx25("span", { children: "\u2705" }),
14868
- /* @__PURE__ */ jsxs21("span", { children: [
16077
+ /* @__PURE__ */ jsxs28("div", { className: "flex flex-wrap items-center gap-1.5 pt-0.5", children: [
16078
+ /* @__PURE__ */ jsxs28("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: [
16079
+ /* @__PURE__ */ jsx34("span", { children: "\u2705" }),
16080
+ /* @__PURE__ */ jsxs28("span", { children: [
14869
16081
  broadcastSummary.successful,
14870
16082
  " \u05E0\u05E9\u05DC\u05D7\u05D5"
14871
16083
  ] })
14872
16084
  ] }),
14873
- broadcastSummary.failed > 0 && /* @__PURE__ */ jsxs21("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: [
14874
- /* @__PURE__ */ jsx25("span", { children: "\u274C" }),
14875
- /* @__PURE__ */ jsxs21("span", { children: [
16085
+ broadcastSummary.failed > 0 && /* @__PURE__ */ jsxs28("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: [
16086
+ /* @__PURE__ */ jsx34("span", { children: "\u274C" }),
16087
+ /* @__PURE__ */ jsxs28("span", { children: [
14876
16088
  broadcastSummary.failed,
14877
16089
  " \u05E0\u05DB\u05E9\u05DC\u05D5"
14878
16090
  ] })
14879
16091
  ] }),
14880
- broadcastSummary.skipped > 0 && /* @__PURE__ */ jsxs21("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: [
14881
- /* @__PURE__ */ jsx25("span", { children: "\u26A0\uFE0F" }),
14882
- /* @__PURE__ */ jsxs21("span", { children: [
16092
+ broadcastSummary.skipped > 0 && /* @__PURE__ */ jsxs28("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: [
16093
+ /* @__PURE__ */ jsx34("span", { children: "\u26A0\uFE0F" }),
16094
+ /* @__PURE__ */ jsxs28("span", { children: [
14883
16095
  broadcastSummary.skipped,
14884
16096
  " \u05DC\u05DC\u05D0 \u05D8\u05DC\u05E4\u05D5\u05DF"
14885
16097
  ] })
@@ -14894,19 +16106,19 @@ function SettingsAndActionsBlock({
14894
16106
  }
14895
16107
 
14896
16108
  // src/components/WhatsAppComponent/inbox/useInboxState.ts
14897
- import { useState as useState20, useEffect as useEffect17, useCallback as useCallback16, useRef as useRef18 } from "react";
16109
+ import { useState as useState25, useEffect as useEffect18, useCallback as useCallback18, useRef as useRef21 } from "react";
14898
16110
  function useInboxState(orgId, actions) {
14899
- const [conversations, setConversations] = useState20([]);
14900
- const [activeConversationId, setActiveConversationId] = useState20(null);
14901
- const [messages, setMessages] = useState20([]);
14902
- const [isLoading, setIsLoading] = useState20(false);
14903
- const [isSending, setIsSending] = useState20(false);
14904
- const [error, setError] = useState20(null);
14905
- const actionsRef = useRef18(actions);
14906
- useEffect17(() => {
16111
+ const [conversations, setConversations] = useState25([]);
16112
+ const [activeConversationId, setActiveConversationId] = useState25(null);
16113
+ const [messages, setMessages] = useState25([]);
16114
+ const [isLoading, setIsLoading] = useState25(false);
16115
+ const [isSending, setIsSending] = useState25(false);
16116
+ const [error, setError] = useState25(null);
16117
+ const actionsRef = useRef21(actions);
16118
+ useEffect18(() => {
14907
16119
  actionsRef.current = actions;
14908
16120
  });
14909
- const fetchConversations = useCallback16(async () => {
16121
+ const fetchConversations = useCallback18(async () => {
14910
16122
  if (!orgId) return;
14911
16123
  const res = await actionsRef.current.getConversations(orgId);
14912
16124
  if (res.success && res.data) {
@@ -14915,7 +16127,7 @@ function useInboxState(orgId, actions) {
14915
16127
  setError(res.error);
14916
16128
  }
14917
16129
  }, [orgId]);
14918
- const fetchMessages = useCallback16(async (conversationId, silent = false) => {
16130
+ const fetchMessages = useCallback18(async (conversationId, silent = false) => {
14919
16131
  if (!silent) setIsLoading(true);
14920
16132
  const res = await actionsRef.current.getMessages(conversationId);
14921
16133
  if (res.success && res.data) {
@@ -14928,7 +16140,7 @@ function useInboxState(orgId, actions) {
14928
16140
  }
14929
16141
  if (!silent) setIsLoading(false);
14930
16142
  }, []);
14931
- useEffect17(() => {
16143
+ useEffect18(() => {
14932
16144
  fetchConversations();
14933
16145
  const interval = setInterval(() => {
14934
16146
  fetchConversations();
@@ -14977,14 +16189,14 @@ function useInboxState(orgId, actions) {
14977
16189
 
14978
16190
  // src/components/WhatsAppComponent/inbox/ConversationList.tsx
14979
16191
  import { Search as Search4, User } from "lucide-react";
14980
- import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
16192
+ import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
14981
16193
  function ConversationList({ conversations, activeId, onSelect }) {
14982
- return /* @__PURE__ */ jsxs22("div", { className: "w-80 border-l border-slate-200 bg-white flex flex-col h-full shrink-0", children: [
14983
- /* @__PURE__ */ jsxs22("div", { className: "p-4 border-b border-slate-100 bg-slate-50", children: [
14984
- /* @__PURE__ */ jsx26("h2", { className: "text-lg font-bold text-slate-800 mb-3", children: "\u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05DB\u05E0\u05E1\u05D5\u05EA" }),
14985
- /* @__PURE__ */ jsxs22("div", { className: "relative", children: [
14986
- /* @__PURE__ */ jsx26(Search4, { className: "w-4 h-4 absolute right-3 top-1/2 -translate-y-1/2 text-slate-400" }),
14987
- /* @__PURE__ */ jsx26(
16194
+ return /* @__PURE__ */ jsxs29("div", { className: "w-80 border-l border-slate-200 bg-white flex flex-col h-full shrink-0", children: [
16195
+ /* @__PURE__ */ jsxs29("div", { className: "p-4 border-b border-slate-100 bg-slate-50", children: [
16196
+ /* @__PURE__ */ jsx35("h2", { className: "text-lg font-bold text-slate-800 mb-3", children: "\u05E9\u05D9\u05D7\u05D5\u05EA \u05E0\u05DB\u05E0\u05E1\u05D5\u05EA" }),
16197
+ /* @__PURE__ */ jsxs29("div", { className: "relative", children: [
16198
+ /* @__PURE__ */ jsx35(Search4, { className: "w-4 h-4 absolute right-3 top-1/2 -translate-y-1/2 text-slate-400" }),
16199
+ /* @__PURE__ */ jsx35(
14988
16200
  "input",
14989
16201
  {
14990
16202
  type: "text",
@@ -14994,27 +16206,27 @@ function ConversationList({ conversations, activeId, onSelect }) {
14994
16206
  )
14995
16207
  ] })
14996
16208
  ] }),
14997
- /* @__PURE__ */ jsx26("div", { className: "flex-1 overflow-y-auto", children: (() => {
16209
+ /* @__PURE__ */ jsx35("div", { className: "flex-1 overflow-y-auto", children: (() => {
14998
16210
  const sortedConversations = [...conversations].sort(
14999
16211
  (a, b) => new Date(b.lastMessageAt).getTime() - new Date(a.lastMessageAt).getTime()
15000
16212
  );
15001
- return sortedConversations.length === 0 ? /* @__PURE__ */ jsx26("div", { className: "p-6 text-center text-sm text-slate-400", children: "\u05D0\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E4\u05E2\u05D9\u05DC\u05D5\u05EA" }) : sortedConversations.map((conv) => {
16213
+ return sortedConversations.length === 0 ? /* @__PURE__ */ jsx35("div", { className: "p-6 text-center text-sm text-slate-400", children: "\u05D0\u05D9\u05DF \u05E9\u05D9\u05D7\u05D5\u05EA \u05E4\u05E2\u05D9\u05DC\u05D5\u05EA" }) : sortedConversations.map((conv) => {
15002
16214
  var _a, _b;
15003
- return /* @__PURE__ */ jsxs22(
16215
+ return /* @__PURE__ */ jsxs29(
15004
16216
  "button",
15005
16217
  {
15006
16218
  onClick: () => onSelect(conv.id),
15007
16219
  className: `w-full text-right p-4 border-b border-slate-100 transition-colors hover:bg-slate-50 flex items-start gap-3 ${activeId === conv.id ? "bg-emerald-50/50 border-r-4 border-r-emerald-500" : "border-r-4 border-r-transparent"}`,
15008
16220
  children: [
15009
- /* @__PURE__ */ jsx26("div", { className: "w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx26(User, { className: "w-5 h-5 text-slate-500" }) }),
15010
- /* @__PURE__ */ jsxs22("div", { className: "flex-1 overflow-hidden", children: [
15011
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-between items-center mb-1", children: [
15012
- /* @__PURE__ */ jsx26("span", { className: "font-semibold text-slate-800 text-sm truncate", children: conv.contactName || conv.contactPhone }),
15013
- /* @__PURE__ */ jsx26("span", { className: "text-[10px] text-slate-400", children: new Date(conv.lastMessageAt).toLocaleTimeString("he-IL", { hour: "2-digit", minute: "2-digit" }) })
16221
+ /* @__PURE__ */ jsx35("div", { className: "w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx35(User, { className: "w-5 h-5 text-slate-500" }) }),
16222
+ /* @__PURE__ */ jsxs29("div", { className: "flex-1 overflow-hidden", children: [
16223
+ /* @__PURE__ */ jsxs29("div", { className: "flex justify-between items-center mb-1", children: [
16224
+ /* @__PURE__ */ jsx35("span", { className: "font-semibold text-slate-800 text-sm truncate", children: conv.contactName || conv.contactPhone }),
16225
+ /* @__PURE__ */ jsx35("span", { className: "text-[10px] text-slate-400", children: new Date(conv.lastMessageAt).toLocaleTimeString("he-IL", { hour: "2-digit", minute: "2-digit" }) })
15014
16226
  ] }),
15015
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-between items-center", children: [
15016
- /* @__PURE__ */ jsx26("p", { className: "text-xs text-slate-500 truncate w-4/5", children: ((_b = (_a = conv.messages) == null ? void 0 : _a[0]) == null ? void 0 : _b.content) || "\u05D0\u05D9\u05DF \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" }),
15017
- conv.unreadCount > 0 && /* @__PURE__ */ jsx26("span", { className: "bg-emerald-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full min-w-[20px] text-center", children: conv.unreadCount })
16227
+ /* @__PURE__ */ jsxs29("div", { className: "flex justify-between items-center", children: [
16228
+ /* @__PURE__ */ jsx35("p", { className: "text-xs text-slate-500 truncate w-4/5", children: ((_b = (_a = conv.messages) == null ? void 0 : _a[0]) == null ? void 0 : _b.content) || "\u05D0\u05D9\u05DF \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA" }),
16229
+ conv.unreadCount > 0 && /* @__PURE__ */ jsx35("span", { className: "bg-emerald-500 text-white text-[10px] font-bold px-1.5 py-0.5 rounded-full min-w-[20px] text-center", children: conv.unreadCount })
15018
16230
  ] })
15019
16231
  ] })
15020
16232
  ]
@@ -15027,17 +16239,17 @@ function ConversationList({ conversations, activeId, onSelect }) {
15027
16239
  }
15028
16240
 
15029
16241
  // src/components/WhatsAppComponent/inbox/ChatWindow.tsx
15030
- import { useState as useState21, useRef as useRef19, useEffect as useEffect18 } from "react";
16242
+ import { useState as useState26, useRef as useRef22, useEffect as useEffect19 } from "react";
15031
16243
  import { Send as Send2, User as User2, Loader2 as Loader27 } from "lucide-react";
15032
- import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
16244
+ import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
15033
16245
  function ChatWindow({ activeConversation, messages, isLoading, isSending, onSendMessage }) {
15034
- const [inputText, setInputText] = useState21("");
15035
- const messagesTopRef = useRef19(null);
16246
+ const [inputText, setInputText] = useState26("");
16247
+ const messagesTopRef = useRef22(null);
15036
16248
  const scrollToTop = () => {
15037
16249
  var _a;
15038
16250
  (_a = messagesTopRef.current) == null ? void 0 : _a.scrollIntoView({ behavior: "smooth" });
15039
16251
  };
15040
- useEffect18(() => {
16252
+ useEffect19(() => {
15041
16253
  scrollToTop();
15042
16254
  }, [messages.length, activeConversation == null ? void 0 : activeConversation.id]);
15043
16255
  const handleSend = (e) => {
@@ -15047,34 +16259,34 @@ function ChatWindow({ activeConversation, messages, isLoading, isSending, onSend
15047
16259
  setInputText("");
15048
16260
  };
15049
16261
  if (!activeConversation) {
15050
- return /* @__PURE__ */ jsxs23("div", { className: "flex-1 bg-slate-50 flex items-center justify-center flex-col gap-4 text-slate-400", children: [
15051
- /* @__PURE__ */ jsx27("div", { className: "w-16 h-16 rounded-full bg-slate-200 flex items-center justify-center", children: /* @__PURE__ */ jsx27("svg", { className: "w-8 h-8 text-slate-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }),
15052
- /* @__PURE__ */ jsx27("p", { children: "\u05D1\u05D7\u05E8 \u05E9\u05D9\u05D7\u05D4 \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC" })
16262
+ return /* @__PURE__ */ jsxs30("div", { className: "flex-1 bg-slate-50 flex items-center justify-center flex-col gap-4 text-slate-400", children: [
16263
+ /* @__PURE__ */ jsx36("div", { className: "w-16 h-16 rounded-full bg-slate-200 flex items-center justify-center", children: /* @__PURE__ */ jsx36("svg", { className: "w-8 h-8 text-slate-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx36("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: "1.5", d: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }),
16264
+ /* @__PURE__ */ jsx36("p", { children: "\u05D1\u05D7\u05E8 \u05E9\u05D9\u05D7\u05D4 \u05DE\u05D4\u05E8\u05E9\u05D9\u05DE\u05D4 \u05DB\u05D3\u05D9 \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC" })
15053
16265
  ] });
15054
16266
  }
15055
- return /* @__PURE__ */ jsxs23("div", { className: "flex-1 flex flex-col bg-[#efeae2] h-full relative", children: [
15056
- /* @__PURE__ */ jsxs23("div", { className: "h-16 bg-white border-b border-slate-200 px-6 flex items-center gap-3 shrink-0 z-10 shadow-sm", children: [
15057
- /* @__PURE__ */ jsx27("div", { className: "w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center", children: /* @__PURE__ */ jsx27(User2, { className: "w-5 h-5 text-slate-500" }) }),
15058
- /* @__PURE__ */ jsxs23("div", { children: [
15059
- /* @__PURE__ */ jsx27("h3", { className: "font-bold text-slate-800", children: activeConversation.contactName || activeConversation.contactPhone }),
15060
- /* @__PURE__ */ jsx27("p", { className: "text-xs text-slate-500", dir: "ltr", children: activeConversation.contactPhone })
16267
+ return /* @__PURE__ */ jsxs30("div", { className: "flex-1 flex flex-col bg-[#efeae2] h-full relative", children: [
16268
+ /* @__PURE__ */ jsxs30("div", { className: "h-16 bg-white border-b border-slate-200 px-6 flex items-center gap-3 shrink-0 z-10 shadow-sm", children: [
16269
+ /* @__PURE__ */ jsx36("div", { className: "w-10 h-10 rounded-full bg-slate-200 flex items-center justify-center", children: /* @__PURE__ */ jsx36(User2, { className: "w-5 h-5 text-slate-500" }) }),
16270
+ /* @__PURE__ */ jsxs30("div", { children: [
16271
+ /* @__PURE__ */ jsx36("h3", { className: "font-bold text-slate-800", children: activeConversation.contactName || activeConversation.contactPhone }),
16272
+ /* @__PURE__ */ jsx36("p", { className: "text-xs text-slate-500", dir: "ltr", children: activeConversation.contactPhone })
15061
16273
  ] })
15062
16274
  ] }),
15063
- /* @__PURE__ */ jsxs23("div", { className: "flex-1 overflow-y-auto p-6 space-y-4", children: [
15064
- /* @__PURE__ */ jsx27("div", { ref: messagesTopRef }),
15065
- isLoading ? /* @__PURE__ */ jsx27("div", { className: "flex justify-center py-10", children: /* @__PURE__ */ jsx27(Loader27, { className: "w-6 h-6 animate-spin text-emerald-600" }) }) : messages.map((msg, idx) => {
16275
+ /* @__PURE__ */ jsxs30("div", { className: "flex-1 overflow-y-auto p-6 space-y-4", children: [
16276
+ /* @__PURE__ */ jsx36("div", { ref: messagesTopRef }),
16277
+ isLoading ? /* @__PURE__ */ jsx36("div", { className: "flex justify-center py-10", children: /* @__PURE__ */ jsx36(Loader27, { className: "w-6 h-6 animate-spin text-emerald-600" }) }) : messages.map((msg, idx) => {
15066
16278
  const isOutbound = msg.direction === "OUTBOUND";
15067
- return /* @__PURE__ */ jsx27("div", { className: `flex ${isOutbound ? "justify-start" : "justify-end"}`, children: /* @__PURE__ */ jsxs23("div", { className: `max-w-[70%] rounded-2xl px-4 py-2 shadow-sm relative ${isOutbound ? "bg-[#d9fdd3] text-slate-900 rounded-tr-none" : "bg-white text-slate-900 rounded-tl-none"}`, children: [
15068
- /* @__PURE__ */ jsx27("p", { className: "text-sm whitespace-pre-wrap", children: msg.content }),
15069
- /* @__PURE__ */ jsxs23("div", { className: "text-[11px] text-slate-600 mt-1 text-left flex items-center justify-end gap-1", children: [
16279
+ return /* @__PURE__ */ jsx36("div", { className: `flex ${isOutbound ? "justify-start" : "justify-end"}`, children: /* @__PURE__ */ jsxs30("div", { className: `max-w-[70%] rounded-2xl px-4 py-2 shadow-sm relative ${isOutbound ? "bg-[#d9fdd3] text-slate-900 rounded-tr-none" : "bg-white text-slate-900 rounded-tl-none"}`, children: [
16280
+ /* @__PURE__ */ jsx36("p", { className: "text-sm whitespace-pre-wrap", children: msg.content }),
16281
+ /* @__PURE__ */ jsxs30("div", { className: "text-[11px] text-slate-600 mt-1 text-left flex items-center justify-end gap-1", children: [
15070
16282
  new Date(msg.createdAt).toLocaleString("he-IL", { day: "2-digit", month: "2-digit", year: "numeric", hour: "2-digit", minute: "2-digit" }),
15071
- isOutbound && /* @__PURE__ */ jsx27("span", { className: msg.status === "READ" || msg.status === "DELIVERED" ? "text-blue-500" : "text-slate-500", children: msg.status === "READ" ? "\u2713\u2713" : msg.status === "DELIVERED" ? "\u2713\u2713" : "\u2713" })
16283
+ isOutbound && /* @__PURE__ */ jsx36("span", { className: msg.status === "READ" || msg.status === "DELIVERED" ? "text-blue-500" : "text-slate-500", children: msg.status === "READ" ? "\u2713\u2713" : msg.status === "DELIVERED" ? "\u2713\u2713" : "\u2713" })
15072
16284
  ] })
15073
16285
  ] }) }, msg.id || idx);
15074
16286
  })
15075
16287
  ] }),
15076
- /* @__PURE__ */ jsx27("div", { className: "bg-slate-50 p-4 border-t border-slate-200 shrink-0", children: /* @__PURE__ */ jsxs23("form", { onSubmit: handleSend, className: "flex items-end gap-2 max-w-4xl mx-auto", children: [
15077
- /* @__PURE__ */ jsx27("div", { className: "flex-1 bg-white border border-slate-300 rounded-2xl overflow-hidden focus-within:border-emerald-500 focus-within:ring-1 focus-within:ring-emerald-500", children: /* @__PURE__ */ jsx27(
16288
+ /* @__PURE__ */ jsx36("div", { className: "bg-slate-50 p-4 border-t border-slate-200 shrink-0", children: /* @__PURE__ */ jsxs30("form", { onSubmit: handleSend, className: "flex items-end gap-2 max-w-4xl mx-auto", children: [
16289
+ /* @__PURE__ */ jsx36("div", { className: "flex-1 bg-white border border-slate-300 rounded-2xl overflow-hidden focus-within:border-emerald-500 focus-within:ring-1 focus-within:ring-emerald-500", children: /* @__PURE__ */ jsx36(
15078
16290
  "textarea",
15079
16291
  {
15080
16292
  rows: 1,
@@ -15090,13 +16302,13 @@ function ChatWindow({ activeConversation, messages, isLoading, isSending, onSend
15090
16302
  className: "w-full max-h-32 min-h-[44px] p-3 text-sm bg-transparent outline-none resize-none"
15091
16303
  }
15092
16304
  ) }),
15093
- /* @__PURE__ */ jsx27(
16305
+ /* @__PURE__ */ jsx36(
15094
16306
  "button",
15095
16307
  {
15096
16308
  type: "submit",
15097
16309
  disabled: !inputText.trim() || isSending,
15098
16310
  className: `w-11 h-11 rounded-full flex items-center justify-center shrink-0 transition-colors ${!inputText.trim() || isSending ? "bg-slate-200 text-slate-400" : "bg-emerald-600 hover:bg-emerald-700 text-white shadow-md"}`,
15099
- children: isSending ? /* @__PURE__ */ jsx27(Loader27, { className: "w-5 h-5 animate-spin" }) : /* @__PURE__ */ jsx27(Send2, { className: "w-5 h-5 -ml-1" })
16311
+ children: isSending ? /* @__PURE__ */ jsx36(Loader27, { className: "w-5 h-5 animate-spin" }) : /* @__PURE__ */ jsx36(Send2, { className: "w-5 h-5 -ml-1" })
15100
16312
  }
15101
16313
  )
15102
16314
  ] }) })
@@ -15104,7 +16316,7 @@ function ChatWindow({ activeConversation, messages, isLoading, isSending, onSend
15104
16316
  }
15105
16317
 
15106
16318
  // src/components/WhatsAppComponent/inbox/WhatsAppInbox.tsx
15107
- import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
16319
+ import { jsx as jsx37, jsxs as jsxs31 } from "react/jsx-runtime";
15108
16320
  function WhatsAppInbox({
15109
16321
  orgId,
15110
16322
  getConversationsAction,
@@ -15125,8 +16337,8 @@ function WhatsAppInbox({
15125
16337
  sendMessage: sendInboxMessageAction
15126
16338
  });
15127
16339
  const activeConversation = conversations.find((c) => c.id === activeConversationId);
15128
- return /* @__PURE__ */ jsxs24("div", { className: "flex h-[calc(100vh-140px)] min-h-[600px] w-full border border-slate-200 rounded-2xl overflow-hidden bg-white shadow-xs", dir: "rtl", children: [
15129
- /* @__PURE__ */ jsx28(
16340
+ return /* @__PURE__ */ jsxs31("div", { className: "flex h-[calc(100vh-140px)] min-h-[600px] w-full border border-slate-200 rounded-2xl overflow-hidden bg-white shadow-xs", dir: "rtl", children: [
16341
+ /* @__PURE__ */ jsx37(
15130
16342
  ConversationList,
15131
16343
  {
15132
16344
  conversations,
@@ -15134,7 +16346,7 @@ function WhatsAppInbox({
15134
16346
  onSelect: handleSelectConversation
15135
16347
  }
15136
16348
  ),
15137
- /* @__PURE__ */ jsx28(
16349
+ /* @__PURE__ */ jsx37(
15138
16350
  ChatWindow,
15139
16351
  {
15140
16352
  activeConversation,
@@ -15148,21 +16360,21 @@ function WhatsAppInbox({
15148
16360
  }
15149
16361
 
15150
16362
  // src/components/WhatsAppComponent/WhatsAppComponent.tsx
15151
- import { Fragment as Fragment8, jsx as jsx29, jsxs as jsxs25 } from "react/jsx-runtime";
16363
+ import { Fragment as Fragment10, jsx as jsx38, jsxs as jsxs32 } from "react/jsx-runtime";
15152
16364
  function WhatsAppComponent(props) {
15153
16365
  var _a;
15154
16366
  const { className = "", settings, orgId, componentId, executeAction } = props;
15155
16367
  const state = useWhatsAppState(props);
15156
- const [activeTab, setActiveTab] = React21.useState("broadcast");
15157
- return /* @__PURE__ */ jsxs25(
16368
+ const [activeTab, setActiveTab] = React26.useState("broadcast");
16369
+ return /* @__PURE__ */ jsxs32(
15158
16370
  "div",
15159
16371
  {
15160
16372
  className: `w-full flex flex-col bg-white border border-slate-200 rounded-2xl shadow-xs overflow-hidden ${className}`,
15161
16373
  "data-testid": "whatsapp-component",
15162
16374
  dir: "rtl",
15163
16375
  children: [
15164
- /* @__PURE__ */ jsxs25("div", { className: "flex border-b border-slate-200 bg-slate-50 px-6 pt-3 gap-4 shrink-0", children: [
15165
- /* @__PURE__ */ jsx29(
16376
+ /* @__PURE__ */ jsxs32("div", { className: "flex border-b border-slate-200 bg-slate-50 px-6 pt-3 gap-4 shrink-0", children: [
16377
+ /* @__PURE__ */ jsx38(
15166
16378
  "button",
15167
16379
  {
15168
16380
  type: "button",
@@ -15171,7 +16383,7 @@ function WhatsAppComponent(props) {
15171
16383
  children: "\u{1F4E4} \u05E9\u05DC\u05D9\u05D7\u05EA \u05D4\u05D5\u05D3\u05E2\u05D5\u05EA \u05D5\u05EA\u05E4\u05D5\u05E6\u05D4"
15172
16384
  }
15173
16385
  ),
15174
- /* @__PURE__ */ jsx29(
16386
+ /* @__PURE__ */ jsx38(
15175
16387
  "button",
15176
16388
  {
15177
16389
  type: "button",
@@ -15181,7 +16393,7 @@ function WhatsAppComponent(props) {
15181
16393
  }
15182
16394
  )
15183
16395
  ] }),
15184
- activeTab === "inbox" ? /* @__PURE__ */ jsx29("div", { className: "p-4 flex-1", children: /* @__PURE__ */ jsx29(
16396
+ activeTab === "inbox" ? /* @__PURE__ */ jsx38("div", { className: "p-4 flex-1", children: /* @__PURE__ */ jsx38(
15185
16397
  WhatsAppInbox,
15186
16398
  {
15187
16399
  orgId: orgId || props.organizationId || "",
@@ -15220,37 +16432,37 @@ function WhatsAppComponent(props) {
15220
16432
  }
15221
16433
  }
15222
16434
  }
15223
- ) }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
15224
- state.feedback && /* @__PURE__ */ jsxs25(
16435
+ ) }) : /* @__PURE__ */ jsxs32(Fragment10, { children: [
16436
+ state.feedback && /* @__PURE__ */ jsxs32(
15225
16437
  "div",
15226
16438
  {
15227
16439
  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"}`,
15228
16440
  children: [
15229
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
15230
- state.feedback.type === "success" ? /* @__PURE__ */ jsx29(CheckCircle24, { className: "w-4 h-4 text-emerald-600 shrink-0" }) : /* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-rose-600 shrink-0" }),
15231
- /* @__PURE__ */ jsx29("span", { children: state.feedback.message })
16441
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
16442
+ state.feedback.type === "success" ? /* @__PURE__ */ jsx38(CheckCircle24, { className: "w-4 h-4 text-emerald-600 shrink-0" }) : /* @__PURE__ */ jsx38(AlertCircle5, { className: "w-4 h-4 text-rose-600 shrink-0" }),
16443
+ /* @__PURE__ */ jsx38("span", { children: state.feedback.message })
15232
16444
  ] }),
15233
- /* @__PURE__ */ jsx29(
16445
+ /* @__PURE__ */ jsx38(
15234
16446
  "button",
15235
16447
  {
15236
16448
  type: "button",
15237
16449
  onClick: () => state.setFeedback(null),
15238
16450
  className: "text-slate-400 hover:text-slate-700 cursor-pointer",
15239
- children: /* @__PURE__ */ jsx29(X12, { className: "w-4 h-4" })
16451
+ children: /* @__PURE__ */ jsx38(X12, { className: "w-4 h-4" })
15240
16452
  }
15241
16453
  )
15242
16454
  ]
15243
16455
  }
15244
16456
  ),
15245
- state.fetchError && !state.isLoadingTemplates && /* @__PURE__ */ jsxs25("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: [
15246
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2", children: [
15247
- /* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-amber-600 shrink-0" }),
15248
- /* @__PURE__ */ jsxs25("span", { children: [
16457
+ state.fetchError && !state.isLoadingTemplates && /* @__PURE__ */ jsxs32("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: [
16458
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2", children: [
16459
+ /* @__PURE__ */ jsx38(AlertCircle5, { className: "w-4 h-4 text-amber-600 shrink-0" }),
16460
+ /* @__PURE__ */ jsxs32("span", { children: [
15249
16461
  "\u05E9\u05D2\u05D9\u05D0\u05D4 \u05D1\u05D8\u05E2\u05D9\u05E0\u05EA \u05EA\u05D1\u05E0\u05D9\u05D5\u05EA \u05DE-Meta: ",
15250
16462
  state.fetchError
15251
16463
  ] })
15252
16464
  ] }),
15253
- /* @__PURE__ */ jsx29(
16465
+ /* @__PURE__ */ jsx38(
15254
16466
  "button",
15255
16467
  {
15256
16468
  type: "button",
@@ -15260,9 +16472,9 @@ function WhatsAppComponent(props) {
15260
16472
  }
15261
16473
  )
15262
16474
  ] }),
15263
- /* @__PURE__ */ jsxs25("div", { className: "p-4 flex flex-col gap-4", children: [
15264
- /* @__PURE__ */ jsxs25("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-4 shrink-0 items-stretch", children: [
15265
- /* @__PURE__ */ jsx29(
16475
+ /* @__PURE__ */ jsxs32("div", { className: "p-4 flex flex-col gap-4", children: [
16476
+ /* @__PURE__ */ jsxs32("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-4 shrink-0 items-stretch", children: [
16477
+ /* @__PURE__ */ jsx38(
15266
16478
  TemplateSelectionBlock,
15267
16479
  {
15268
16480
  selectedTemplate: state.selectedTemplate,
@@ -15290,7 +16502,7 @@ function WhatsAppComponent(props) {
15290
16502
  handleFileUpload: state.handleFileUpload
15291
16503
  }
15292
16504
  ),
15293
- /* @__PURE__ */ jsx29(
16505
+ /* @__PURE__ */ jsx38(
15294
16506
  DynamicFiltersBlock,
15295
16507
  {
15296
16508
  filterableColumns: state.filterableColumns,
@@ -15307,7 +16519,7 @@ function WhatsAppComponent(props) {
15307
16519
  isLoadingTableData: state.isLoadingTableData
15308
16520
  }
15309
16521
  ),
15310
- /* @__PURE__ */ jsx29(
16522
+ /* @__PURE__ */ jsx38(
15311
16523
  SettingsAndActionsBlock,
15312
16524
  {
15313
16525
  isScanningPhoneColumns: state.isScanningPhoneColumns,
@@ -15353,13 +16565,13 @@ function WhatsAppComponent(props) {
15353
16565
  }
15354
16566
  )
15355
16567
  ] }),
15356
- /* @__PURE__ */ jsx29("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__ */ jsxs25("div", { className: "flex-1 flex flex-col items-center justify-center p-12 text-center text-xs text-slate-400 gap-2", children: [
15357
- /* @__PURE__ */ jsx29(Loader28, { className: "w-6 h-6 animate-spin text-emerald-600" }),
15358
- /* @__PURE__ */ jsx29("span", { children: "\u05D8\u05D5\u05E2\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05D4\u05D8\u05D1\u05DC\u05D4..." })
15359
- ] }) : state.tableError ? /* @__PURE__ */ jsxs25("div", { className: "flex-1 flex items-center justify-center p-6 text-center text-xs text-rose-600 bg-rose-50 gap-2", children: [
15360
- /* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
15361
- /* @__PURE__ */ jsx29("span", { children: state.tableError })
15362
- ] }) : !(settings == null ? void 0 : settings.tableMetaId) ? /* @__PURE__ */ jsx29("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__ */ jsx29(
16568
+ /* @__PURE__ */ jsx38("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__ */ jsxs32("div", { className: "flex-1 flex flex-col items-center justify-center p-12 text-center text-xs text-slate-400 gap-2", children: [
16569
+ /* @__PURE__ */ jsx38(Loader28, { className: "w-6 h-6 animate-spin text-emerald-600" }),
16570
+ /* @__PURE__ */ jsx38("span", { children: "\u05D8\u05D5\u05E2\u05DF \u05E8\u05E9\u05D5\u05DE\u05D5\u05EA \u05DE\u05D4\u05D8\u05D1\u05DC\u05D4..." })
16571
+ ] }) : state.tableError ? /* @__PURE__ */ jsxs32("div", { className: "flex-1 flex items-center justify-center p-6 text-center text-xs text-rose-600 bg-rose-50 gap-2", children: [
16572
+ /* @__PURE__ */ jsx38(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
16573
+ /* @__PURE__ */ jsx38("span", { children: state.tableError })
16574
+ ] }) : !(settings == null ? void 0 : settings.tableMetaId) ? /* @__PURE__ */ jsx38("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__ */ jsx38(
15363
16575
  TableBlockClient,
15364
16576
  {
15365
16577
  settings: {
@@ -15381,7 +16593,7 @@ function WhatsAppComponent(props) {
15381
16593
  }
15382
16594
  ) })
15383
16595
  ] }),
15384
- /* @__PURE__ */ jsx29(
16596
+ /* @__PURE__ */ jsx38(
15385
16597
  CreateTemplateModal,
15386
16598
  {
15387
16599
  isOpen: state.isModalOpen,
@@ -15395,7 +16607,7 @@ function WhatsAppComponent(props) {
15395
16607
  orgId: state.orgId || orgId
15396
16608
  }
15397
16609
  ),
15398
- state.isTestPromptOpen && /* @__PURE__ */ jsx29(
16610
+ state.isTestPromptOpen && /* @__PURE__ */ jsx38(
15399
16611
  "div",
15400
16612
  {
15401
16613
  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",
@@ -15404,7 +16616,7 @@ function WhatsAppComponent(props) {
15404
16616
  state.setIsTestPromptOpen(false);
15405
16617
  state.setTestFeedback(null);
15406
16618
  },
15407
- children: /* @__PURE__ */ jsxs25(
16619
+ children: /* @__PURE__ */ jsxs32(
15408
16620
  "div",
15409
16621
  {
15410
16622
  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",
@@ -15413,15 +16625,15 @@ function WhatsAppComponent(props) {
15413
16625
  "aria-labelledby": "test-modal-title",
15414
16626
  onClick: (e) => e.stopPropagation(),
15415
16627
  children: [
15416
- /* @__PURE__ */ jsxs25("div", { className: "px-5 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
15417
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center gap-2.5", children: [
15418
- /* @__PURE__ */ jsx29("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx29(Phone4, { className: "w-4 h-4" }) }),
15419
- /* @__PURE__ */ jsxs25("div", { children: [
15420
- /* @__PURE__ */ jsx29("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)" }),
15421
- /* @__PURE__ */ jsx29("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" })
16628
+ /* @__PURE__ */ jsxs32("div", { className: "px-5 py-4 border-b border-slate-100 flex items-center justify-between bg-slate-50/70", children: [
16629
+ /* @__PURE__ */ jsxs32("div", { className: "flex items-center gap-2.5", children: [
16630
+ /* @__PURE__ */ jsx38("div", { className: "w-8 h-8 rounded-lg bg-emerald-100 text-emerald-700 flex items-center justify-center shrink-0", children: /* @__PURE__ */ jsx38(Phone4, { className: "w-4 h-4" }) }),
16631
+ /* @__PURE__ */ jsxs32("div", { children: [
16632
+ /* @__PURE__ */ jsx38("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)" }),
16633
+ /* @__PURE__ */ jsx38("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" })
15422
16634
  ] })
15423
16635
  ] }),
15424
- /* @__PURE__ */ jsx29(
16636
+ /* @__PURE__ */ jsx38(
15425
16637
  "button",
15426
16638
  {
15427
16639
  type: "button",
@@ -15433,25 +16645,25 @@ function WhatsAppComponent(props) {
15433
16645
  },
15434
16646
  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"}`,
15435
16647
  title: "\u05E1\u05D2\u05D5\u05E8",
15436
- children: /* @__PURE__ */ jsx29(X12, { className: "w-4 h-4" })
16648
+ children: /* @__PURE__ */ jsx38(X12, { className: "w-4 h-4" })
15437
16649
  }
15438
16650
  )
15439
16651
  ] }),
15440
- /* @__PURE__ */ jsxs25("div", { className: "p-5 space-y-4", children: [
15441
- /* @__PURE__ */ jsxs25("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
15442
- /* @__PURE__ */ jsx29("span", { className: "text-slate-500 font-medium", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05E0\u05D1\u05D7\u05E8\u05EA:" }),
15443
- /* @__PURE__ */ jsx29("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" })
16652
+ /* @__PURE__ */ jsxs32("div", { className: "p-5 space-y-4", children: [
16653
+ /* @__PURE__ */ jsxs32("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
16654
+ /* @__PURE__ */ jsx38("span", { className: "text-slate-500 font-medium", children: "\u05EA\u05D1\u05E0\u05D9\u05EA \u05E0\u05D1\u05D7\u05E8\u05EA:" }),
16655
+ /* @__PURE__ */ jsx38("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" })
15444
16656
  ] }),
15445
- state.selectedPhoneOption && /* @__PURE__ */ jsxs25("div", { className: "p-2 bg-emerald-50/50 border border-emerald-200/60 rounded-xl flex items-center justify-between text-[11px]", children: [
15446
- /* @__PURE__ */ jsx29("span", { className: "text-emerald-800 font-medium", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3:" }),
15447
- /* @__PURE__ */ jsx29("span", { className: "font-bold text-emerald-950 font-mono", children: state.selectedPhoneOption.label })
16657
+ state.selectedPhoneOption && /* @__PURE__ */ jsxs32("div", { className: "p-2 bg-emerald-50/50 border border-emerald-200/60 rounded-xl flex items-center justify-between text-[11px]", children: [
16658
+ /* @__PURE__ */ jsx38("span", { className: "text-emerald-800 font-medium", children: "\u05E2\u05DE\u05D5\u05D3\u05EA \u05D9\u05E2\u05D3:" }),
16659
+ /* @__PURE__ */ jsx38("span", { className: "font-bold text-emerald-950 font-mono", children: state.selectedPhoneOption.label })
15448
16660
  ] }),
15449
16661
  state.templateHeaderComp && (() => {
15450
16662
  const headerFormat = (state.templateHeaderComp.format || "").toUpperCase();
15451
16663
  const docFilename = resolveDocumentFilename(state.templateHeaderComp, state.headerMediaUrl);
15452
- return /* @__PURE__ */ jsxs25("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
15453
- /* @__PURE__ */ jsx29("div", { className: "flex items-center gap-2 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
15454
- /* @__PURE__ */ jsx29("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__ */ jsx29(
16664
+ return /* @__PURE__ */ jsxs32("div", { className: "p-2.5 bg-slate-50 border border-slate-200/80 rounded-xl flex items-center justify-between text-xs", children: [
16665
+ /* @__PURE__ */ jsx38("div", { className: "flex items-center gap-2 overflow-hidden", children: headerFormat === "IMAGE" ? /* @__PURE__ */ jsxs32(Fragment10, { children: [
16666
+ /* @__PURE__ */ jsx38("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__ */ jsx38(
15455
16667
  "img",
15456
16668
  {
15457
16669
  src: state.headerMediaUrl,
@@ -15461,28 +16673,28 @@ function WhatsAppComponent(props) {
15461
16673
  e.currentTarget.style.display = "none";
15462
16674
  }
15463
16675
  }
15464
- ) : /* @__PURE__ */ jsx29(ImageIcon3, { className: "w-3.5 h-3.5 text-emerald-600" }) }),
15465
- /* @__PURE__ */ jsx29("span", { className: "font-semibold text-slate-800 truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" })
15466
- ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
15467
- /* @__PURE__ */ jsx29("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__ */ jsx29(FileText4, { className: "w-3.5 h-3.5" }) }),
15468
- /* @__PURE__ */ jsxs25("div", { className: "overflow-hidden", children: [
15469
- /* @__PURE__ */ jsx29("span", { className: "font-semibold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
15470
- /* @__PURE__ */ jsx29("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: docFilename, children: docFilename })
16676
+ ) : /* @__PURE__ */ jsx38(ImageIcon3, { className: "w-3.5 h-3.5 text-emerald-600" }) }),
16677
+ /* @__PURE__ */ jsx38("span", { className: "font-semibold text-slate-800 truncate", children: "\u05EA\u05DE\u05D5\u05E0\u05EA \u05DB\u05D5\u05EA\u05E8\u05EA" })
16678
+ ] }) : headerFormat === "DOCUMENT" ? /* @__PURE__ */ jsxs32(Fragment10, { children: [
16679
+ /* @__PURE__ */ jsx38("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__ */ jsx38(FileText4, { className: "w-3.5 h-3.5" }) }),
16680
+ /* @__PURE__ */ jsxs32("div", { className: "overflow-hidden", children: [
16681
+ /* @__PURE__ */ jsx38("span", { className: "font-semibold text-slate-800 block truncate", children: "\u05DE\u05E1\u05DE\u05DA \u05DB\u05D5\u05EA\u05E8\u05EA (PDF)" }),
16682
+ /* @__PURE__ */ jsx38("span", { className: "text-[10px] text-slate-500 font-mono block truncate", title: docFilename, children: docFilename })
15471
16683
  ] })
15472
- ] }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
15473
- /* @__PURE__ */ jsx29("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__ */ jsx29(Video3, { className: "w-3.5 h-3.5" }) }),
15474
- /* @__PURE__ */ jsx29("span", { className: "font-semibold text-slate-800 truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" })
16684
+ ] }) : /* @__PURE__ */ jsxs32(Fragment10, { children: [
16685
+ /* @__PURE__ */ jsx38("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__ */ jsx38(Video3, { className: "w-3.5 h-3.5" }) }),
16686
+ /* @__PURE__ */ jsx38("span", { className: "font-semibold text-slate-800 truncate", children: "\u05E1\u05E8\u05D8\u05D5\u05DF \u05DB\u05D5\u05EA\u05E8\u05EA" })
15475
16687
  ] }) }),
15476
- state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx29("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__ */ jsx29("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" })
16688
+ state.headerMediaUrl && state.headerMediaUrl.startsWith("http") ? /* @__PURE__ */ jsx38("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__ */ jsx38("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" })
15477
16689
  ] });
15478
16690
  })(),
15479
- /* @__PURE__ */ jsxs25("div", { className: "space-y-1.5", children: [
15480
- /* @__PURE__ */ jsxs25("label", { className: "text-xs font-semibold text-slate-700 block", children: [
16691
+ /* @__PURE__ */ jsxs32("div", { className: "space-y-1.5", children: [
16692
+ /* @__PURE__ */ jsxs32("label", { className: "text-xs font-semibold text-slate-700 block", children: [
15481
16693
  "\u05DE\u05E1\u05E4\u05E8 \u05D8\u05DC\u05E4\u05D5\u05DF \u05DC\u05D8\u05E1\u05D8 ",
15482
- /* @__PURE__ */ jsx29("span", { className: "text-rose-500", children: "*" })
16694
+ /* @__PURE__ */ jsx38("span", { className: "text-rose-500", children: "*" })
15483
16695
  ] }),
15484
- /* @__PURE__ */ jsxs25("div", { className: "relative", children: [
15485
- /* @__PURE__ */ jsx29(
16696
+ /* @__PURE__ */ jsxs32("div", { className: "relative", children: [
16697
+ /* @__PURE__ */ jsx38(
15486
16698
  "input",
15487
16699
  {
15488
16700
  type: "tel",
@@ -15504,17 +16716,17 @@ function WhatsAppComponent(props) {
15504
16716
  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"
15505
16717
  }
15506
16718
  ),
15507
- /* @__PURE__ */ jsx29(Phone4, { className: "w-4 h-4 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
16719
+ /* @__PURE__ */ jsx38(Phone4, { className: "w-4 h-4 text-slate-400 absolute left-2.5 top-1/2 -translate-y-1/2 pointer-events-none" })
15508
16720
  ] }),
15509
- /* @__PURE__ */ jsx29("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." })
16721
+ /* @__PURE__ */ jsx38("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." })
15510
16722
  ] }),
15511
- state.testFeedback && /* @__PURE__ */ jsxs25("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: [
15512
- /* @__PURE__ */ jsx29(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
15513
- /* @__PURE__ */ jsx29("span", { children: state.testFeedback })
16723
+ state.testFeedback && /* @__PURE__ */ jsxs32("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: [
16724
+ /* @__PURE__ */ jsx38(AlertCircle5, { className: "w-4 h-4 text-rose-500 shrink-0" }),
16725
+ /* @__PURE__ */ jsx38("span", { children: state.testFeedback })
15514
16726
  ] })
15515
16727
  ] }),
15516
- /* @__PURE__ */ jsxs25("div", { className: "px-5 py-3.5 bg-slate-50/70 border-t border-slate-100 flex items-center justify-end gap-2", children: [
15517
- /* @__PURE__ */ jsx29(
16728
+ /* @__PURE__ */ jsxs32("div", { className: "px-5 py-3.5 bg-slate-50/70 border-t border-slate-100 flex items-center justify-end gap-2", children: [
16729
+ /* @__PURE__ */ jsx38(
15518
16730
  "button",
15519
16731
  {
15520
16732
  type: "button",
@@ -15528,7 +16740,7 @@ function WhatsAppComponent(props) {
15528
16740
  children: "\u05D1\u05D9\u05D8\u05D5\u05DC"
15529
16741
  }
15530
16742
  ),
15531
- /* @__PURE__ */ jsx29(
16743
+ /* @__PURE__ */ jsx38(
15532
16744
  "button",
15533
16745
  {
15534
16746
  type: "button",
@@ -15536,12 +16748,12 @@ function WhatsAppComponent(props) {
15536
16748
  onClick: state.handleSendTest,
15537
16749
  title: state.testButtonTitle,
15538
16750
  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"}`,
15539
- children: state.isSendingTest ? /* @__PURE__ */ jsxs25(Fragment8, { children: [
15540
- /* @__PURE__ */ jsx29(Loader28, { className: "w-3.5 h-3.5 animate-spin" }),
15541
- /* @__PURE__ */ jsx29("span", { children: "\u05E9\u05D5\u05DC\u05D7..." })
15542
- ] }) : /* @__PURE__ */ jsxs25(Fragment8, { children: [
15543
- /* @__PURE__ */ jsx29(Send3, { className: "w-3.5 h-3.5" }),
15544
- /* @__PURE__ */ jsx29("span", { children: "\u05E9\u05DC\u05D7 \u05E2\u05DB\u05E9\u05D9\u05D5" })
16751
+ children: state.isSendingTest ? /* @__PURE__ */ jsxs32(Fragment10, { children: [
16752
+ /* @__PURE__ */ jsx38(Loader28, { className: "w-3.5 h-3.5 animate-spin" }),
16753
+ /* @__PURE__ */ jsx38("span", { children: "\u05E9\u05D5\u05DC\u05D7..." })
16754
+ ] }) : /* @__PURE__ */ jsxs32(Fragment10, { children: [
16755
+ /* @__PURE__ */ jsx38(Send3, { className: "w-3.5 h-3.5" }),
16756
+ /* @__PURE__ */ jsx38("span", { children: "\u05E9\u05DC\u05D7 \u05E2\u05DB\u05E9\u05D9\u05D5" })
15545
16757
  ] })
15546
16758
  }
15547
16759
  )
@@ -15558,12 +16770,12 @@ function WhatsAppComponent(props) {
15558
16770
  }
15559
16771
 
15560
16772
  // src/components/FormBlock/FormBlock.tsx
15561
- import { useState as useState22, useEffect as useEffect19 } from "react";
16773
+ import { useState as useState27, useEffect as useEffect20 } from "react";
15562
16774
  import { Loader2 as Loader29, CheckCircle2 as CheckCircle25 } from "lucide-react";
15563
- import { jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
16775
+ import { jsx as jsx39, jsxs as jsxs33 } from "react/jsx-runtime";
15564
16776
 
15565
16777
  // src/components/FormBlock/StyledFormBlock.tsx
15566
- import { useState as useState23, useEffect as useEffect20, useId, useRef as useRef20 } from "react";
16778
+ import { useState as useState28, useEffect as useEffect21, useId, useRef as useRef23 } from "react";
15567
16779
  import { Loader2 as Loader210, CheckCircle2 as CheckCircle26 } from "lucide-react";
15568
16780
 
15569
16781
  // src/components/FormBlock/formDesign.ts
@@ -15805,7 +17017,7 @@ function applyFieldOrder(cols, design) {
15805
17017
  }
15806
17018
 
15807
17019
  // src/components/FormBlock/StyledFormBlock.tsx
15808
- import { jsx as jsx31, jsxs as jsxs27 } from "react/jsx-runtime";
17020
+ import { jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
15809
17021
  var SYSTEM_FIELDS = ["_id", "id", "createdAt", "updatedAt", "orgId", "tableId"];
15810
17022
  function StyledFormBlock({
15811
17023
  settings: schema,
@@ -15825,24 +17037,24 @@ function StyledFormBlock({
15825
17037
  const design = schema == null ? void 0 : schema.design;
15826
17038
  const d = resolveFormDesign(design);
15827
17039
  const t = d.tokens;
15828
- const [formData, setFormData] = useState23(initialValues || {});
15829
- const [isSubmitting, setIsSubmitting] = useState23(false);
15830
- const [isSubmitted, setIsSubmitted] = useState23(false);
15831
- const [formError, setFormError] = useState23(null);
15832
- const [missingNames, setMissingNames] = useState23([]);
15833
- const errorRef = useRef20(null);
15834
- const [columns, setColumns] = useState23((schema == null ? void 0 : schema.columns) || []);
15835
- const [isLoadingSchema, setIsLoadingSchema] = useState23(false);
15836
- const [dragName, setDragName] = useState23(null);
15837
- const [drop, setDrop] = useState23(null);
15838
- const [resizing, setResizing] = useState23(null);
15839
- const resizeRef = useRef20(null);
15840
- const gridRef = useRef20(null);
15841
- const relationDictRef = useRef20({});
15842
- const relationRequestedRef = useRef20(/* @__PURE__ */ new Set());
15843
- const [, bumpRelationLabels] = useState23(0);
17040
+ const [formData, setFormData] = useState28(initialValues || {});
17041
+ const [isSubmitting, setIsSubmitting] = useState28(false);
17042
+ const [isSubmitted, setIsSubmitted] = useState28(false);
17043
+ const [formError, setFormError] = useState28(null);
17044
+ const [missingNames, setMissingNames] = useState28([]);
17045
+ const errorRef = useRef23(null);
17046
+ const [columns, setColumns] = useState28((schema == null ? void 0 : schema.columns) || []);
17047
+ const [isLoadingSchema, setIsLoadingSchema] = useState28(false);
17048
+ const [dragName, setDragName] = useState28(null);
17049
+ const [drop, setDrop] = useState28(null);
17050
+ const [resizing, setResizing] = useState28(null);
17051
+ const resizeRef = useRef23(null);
17052
+ const gridRef = useRef23(null);
17053
+ const relationDictRef = useRef23({});
17054
+ const relationRequestedRef = useRef23(/* @__PURE__ */ new Set());
17055
+ const [, bumpRelationLabels] = useState28(0);
15844
17056
  const targetTableId = (schema == null ? void 0 : schema.tableMetaId) || (schema == null ? void 0 : schema.tableId) || (schema == null ? void 0 : schema.id);
15845
- useEffect20(() => {
17057
+ useEffect21(() => {
15846
17058
  let isMounted = true;
15847
17059
  if ((!(schema == null ? void 0 : schema.columns) || schema.columns.length === 0) && targetTableId && executeAction && !previewMode) {
15848
17060
  setIsLoadingSchema(true);
@@ -15861,13 +17073,13 @@ function StyledFormBlock({
15861
17073
  isMounted = false;
15862
17074
  };
15863
17075
  }, [schema == null ? void 0 : schema.columns, targetTableId]);
15864
- useEffect20(() => {
17076
+ useEffect21(() => {
15865
17077
  if (submitMode === "update" || previewMode || !columns || columns.length === 0) return;
15866
17078
  const defaults = buildDefaultValues(columns);
15867
17079
  if (Object.keys(defaults).length === 0) return;
15868
17080
  setFormData((prev) => __spreadValues(__spreadValues({}, defaults), prev));
15869
17081
  }, [columns, submitMode, previewMode]);
15870
- useEffect20(() => {
17082
+ useEffect21(() => {
15871
17083
  if (previewMode || !executeAction || !columns) return;
15872
17084
  for (const col of columns) {
15873
17085
  if ((col.type || "").toUpperCase() !== "RELATION") continue;
@@ -16174,30 +17386,30 @@ function StyledFormBlock({
16174
17386
  }
16175
17387
  `;
16176
17388
  if (isLoadingSchema) {
16177
- return /* @__PURE__ */ jsxs27("div", { className: "p-8 flex items-center justify-center gap-2 text-slate-500", dir: "rtl", children: [
16178
- /* @__PURE__ */ jsx31(Loader210, { className: "w-5 h-5 animate-spin", style: { color: d.primary } }),
16179
- /* @__PURE__ */ jsx31("span", { className: "text-sm", children: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D3\u05D5\u05EA \u05D8\u05D5\u05E4\u05E1..." })
17389
+ return /* @__PURE__ */ jsxs34("div", { className: "p-8 flex items-center justify-center gap-2 text-slate-500", dir: "rtl", children: [
17390
+ /* @__PURE__ */ jsx40(Loader210, { className: "w-5 h-5 animate-spin", style: { color: d.primary } }),
17391
+ /* @__PURE__ */ jsx40("span", { className: "text-sm", children: "\u05D8\u05D5\u05E2\u05DF \u05E9\u05D3\u05D5\u05EA \u05D8\u05D5\u05E4\u05E1..." })
16180
17392
  ] });
16181
17393
  }
16182
17394
  if (!formColumns || formColumns.length === 0) {
16183
- return /* @__PURE__ */ jsx31("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." });
17395
+ return /* @__PURE__ */ jsx40("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." });
16184
17396
  }
16185
17397
  const logoJustify = d.logoAlign === "center" ? "center" : d.logoAlign === "end" ? "flex-end" : "flex-start";
16186
- const headerBlock = (schema == null ? void 0 : schema.title) || d.subtitle || d.logoUrl ? /* @__PURE__ */ jsxs27(
17398
+ const headerBlock = (schema == null ? void 0 : schema.title) || d.subtitle || d.logoUrl ? /* @__PURE__ */ jsxs34(
16187
17399
  "div",
16188
17400
  {
16189
17401
  style: t.headerBand ? { background: d.primary, color: "#ffffff", padding: `${t.padding * 0.8}px ${t.padding}px` } : { marginBottom: t.gap + 4 },
16190
17402
  children: [
16191
- d.logoUrl && /* @__PURE__ */ jsx31("div", { style: { display: "flex", justifyContent: logoJustify, marginBottom: (schema == null ? void 0 : schema.title) || d.subtitle ? 12 : 0 }, children: /* @__PURE__ */ jsx31("img", { src: d.logoUrl, alt: "", style: { height: d.logoHeight, maxWidth: "100%", objectFit: "contain", display: "block" } }) }),
16192
- (schema == null ? void 0 : schema.title) && /* @__PURE__ */ jsx31("h2", { style: __spreadValues({ fontSize: t.titleSize, fontWeight: 800, margin: 0 }, d.titleColor ? { color: d.titleColor } : {}), children: schema.title }),
16193
- d.subtitle && /* @__PURE__ */ jsx31("p", { style: { fontSize: 14, margin: "6px 0 0", color: t.headerBand ? "rgba(255,255,255,0.9)" : muted }, children: d.subtitle })
17403
+ d.logoUrl && /* @__PURE__ */ jsx40("div", { style: { display: "flex", justifyContent: logoJustify, marginBottom: (schema == null ? void 0 : schema.title) || d.subtitle ? 12 : 0 }, children: /* @__PURE__ */ jsx40("img", { src: d.logoUrl, alt: "", style: { height: d.logoHeight, maxWidth: "100%", objectFit: "contain", display: "block" } }) }),
17404
+ (schema == null ? void 0 : schema.title) && /* @__PURE__ */ jsx40("h2", { style: __spreadValues({ fontSize: t.titleSize, fontWeight: 800, margin: 0 }, d.titleColor ? { color: d.titleColor } : {}), children: schema.title }),
17405
+ d.subtitle && /* @__PURE__ */ jsx40("p", { style: { fontSize: 14, margin: "6px 0 0", color: t.headerBand ? "rgba(255,255,255,0.9)" : muted }, children: d.subtitle })
16194
17406
  ]
16195
17407
  }
16196
17408
  ) : null;
16197
17409
  if (isSubmitted) {
16198
17410
  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.";
16199
- return /* @__PURE__ */ jsxs27("div", { id: componentId, dir: "rtl", className, style: __spreadProps(__spreadValues({}, cardStyle), { padding: t.padding || 24, textAlign: "center" }), children: [
16200
- /* @__PURE__ */ jsx31(
17411
+ return /* @__PURE__ */ jsxs34("div", { id: componentId, dir: "rtl", className, style: __spreadProps(__spreadValues({}, cardStyle), { padding: t.padding || 24, textAlign: "center" }), children: [
17412
+ /* @__PURE__ */ jsx40(
16201
17413
  "div",
16202
17414
  {
16203
17415
  style: {
@@ -16211,12 +17423,12 @@ function StyledFormBlock({
16211
17423
  background: t.invertText ? "rgba(255,255,255,0.2)" : "#ecfdf5",
16212
17424
  color: t.invertText ? "#ffffff" : "#059669"
16213
17425
  },
16214
- children: /* @__PURE__ */ jsx31(CheckCircle26, { className: "w-8 h-8" })
17426
+ children: /* @__PURE__ */ jsx40(CheckCircle26, { className: "w-8 h-8" })
16215
17427
  }
16216
17428
  ),
16217
- /* @__PURE__ */ jsx31("h3", { style: { fontSize: 24, fontWeight: 800, margin: "0 0 8px" }, children: "\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4" }),
16218
- /* @__PURE__ */ jsx31("p", { style: { fontSize: 16, color: muted, maxWidth: 420, margin: "0 auto", whiteSpace: "pre-wrap" }, children: customMessage }),
16219
- submitMode !== "update" && /* @__PURE__ */ jsx31(
17429
+ /* @__PURE__ */ jsx40("h3", { style: { fontSize: 24, fontWeight: 800, margin: "0 0 8px" }, children: "\u05D4\u05D5\u05D3\u05E2\u05D4 \u05E0\u05E9\u05DC\u05D7\u05D4" }),
17430
+ /* @__PURE__ */ jsx40("p", { style: { fontSize: 16, color: muted, maxWidth: 420, margin: "0 auto", whiteSpace: "pre-wrap" }, children: customMessage }),
17431
+ submitMode !== "update" && /* @__PURE__ */ jsx40(
16220
17432
  "button",
16221
17433
  {
16222
17434
  type: "button",
@@ -16228,11 +17440,11 @@ function StyledFormBlock({
16228
17440
  ] });
16229
17441
  }
16230
17442
  const justify = d.buttonAlign === "center" ? "center" : d.buttonAlign === "end" ? "flex-end" : d.buttonAlign === "full" ? "stretch" : "flex-start";
16231
- return /* @__PURE__ */ jsxs27("div", { id: componentId, dir: "rtl", className: `${uid} ${className}`, style: cardStyle, children: [
16232
- /* @__PURE__ */ jsx31("style", { children: css }),
17443
+ return /* @__PURE__ */ jsxs34("div", { id: componentId, dir: "rtl", className: `${uid} ${className}`, style: cardStyle, children: [
17444
+ /* @__PURE__ */ jsx40("style", { children: css }),
16233
17445
  headerBlock,
16234
- /* @__PURE__ */ jsx31("div", { style: t.headerBand ? { padding: t.padding } : void 0, children: /* @__PURE__ */ jsxs27("form", { onSubmit: handleSubmit, children: [
16235
- /* @__PURE__ */ jsx31("div", { className: "fdz-grid", ref: gridRef, children: (() => {
17446
+ /* @__PURE__ */ jsx40("div", { style: t.headerBand ? { padding: t.padding } : void 0, children: /* @__PURE__ */ jsxs34("form", { onSubmit: handleSubmit, children: [
17447
+ /* @__PURE__ */ jsx40("div", { className: "fdz-grid", ref: gridRef, children: (() => {
16236
17448
  const spanOf = (col) => {
16237
17449
  var _a;
16238
17450
  if (resizing && resizing.name === col.name) return resizing.span;
@@ -16250,7 +17462,7 @@ function StyledFormBlock({
16250
17462
  const fieldHeight = resizing && resizing.name === col.name ? resizing.height : (_e = (_d = design == null ? void 0 : design.fields) == null ? void 0 : _d[col.name]) == null ? void 0 : _e.height;
16251
17463
  const useTextarea = !!fieldHeight && fieldHeight > 56 && InputComponent === FORM_INPUTS.DEFAULT;
16252
17464
  const boxStyle = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, isBoolean ? booleanBoxStyle : inputBoxStyle), fieldHeight && !isBoolean ? __spreadValues({ minHeight: fieldHeight }, useTextarea ? { height: fieldHeight } : {}) : {}), canReorder ? { pointerEvents: "none" } : {}), missingNames.includes(col.name) ? t.inputStyle === "underline" ? { borderBottom: "2px solid #f43f5e" } : { border: "1px solid #f43f5e", boxShadow: "0 0 0 3px rgba(244,63,94,0.15)" } : {}), locked ? { background: t.inputStyle === "underline" ? "transparent" : "#f1f5f9", opacity: 0.85, cursor: "not-allowed" } : {});
16253
- return /* @__PURE__ */ jsxs27(
17465
+ return /* @__PURE__ */ jsxs34(
16254
17466
  "div",
16255
17467
  {
16256
17468
  "data-fdz-field": col.name,
@@ -16274,13 +17486,13 @@ function StyledFormBlock({
16274
17486
  borderRadius: 6
16275
17487
  } : {}),
16276
17488
  children: [
16277
- /* @__PURE__ */ jsxs27("label", { style: { fontSize: t.labelSize, fontWeight: 600, color: d.text }, children: [
17489
+ /* @__PURE__ */ jsxs34("label", { style: { fontSize: t.labelSize, fontWeight: 600, color: d.text }, children: [
16278
17490
  col.name,
16279
17491
  " ",
16280
- isFieldRequired(col, design) && !locked && /* @__PURE__ */ jsx31("span", { style: { color: t.invertText ? "#fecdd3" : "#f43f5e" }, children: "*" }),
16281
- locked && /* @__PURE__ */ jsx31("span", { style: { fontSize: 11, fontWeight: 400, opacity: 0.7 }, children: "(\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D9\u05DB\u05D4)" })
17492
+ isFieldRequired(col, design) && !locked && /* @__PURE__ */ jsx40("span", { style: { color: t.invertText ? "#fecdd3" : "#f43f5e" }, children: "*" }),
17493
+ locked && /* @__PURE__ */ jsx40("span", { style: { fontSize: 11, fontWeight: 400, opacity: 0.7 }, children: "(\u05DC\u05D0 \u05E0\u05D9\u05EA\u05DF \u05DC\u05E2\u05E8\u05D9\u05DB\u05D4)" })
16282
17494
  ] }),
16283
- /* @__PURE__ */ jsx31("div", { "data-fdz-box": true, style: boxStyle, children: useTextarea ? /* @__PURE__ */ jsx31(
17495
+ /* @__PURE__ */ jsx40("div", { "data-fdz-box": true, style: boxStyle, children: useTextarea ? /* @__PURE__ */ jsx40(
16284
17496
  "textarea",
16285
17497
  {
16286
17498
  value: shownValue,
@@ -16300,7 +17512,7 @@ function StyledFormBlock({
16300
17512
  boxSizing: "border-box"
16301
17513
  }
16302
17514
  }
16303
- ) : /* @__PURE__ */ jsx31(
17515
+ ) : /* @__PURE__ */ jsx40(
16304
17516
  InputComponent,
16305
17517
  {
16306
17518
  column: col,
@@ -16311,7 +17523,7 @@ function StyledFormBlock({
16311
17523
  context: { executeAction: previewMode ? void 0 : executeAction, tableId: targetTableId, relationDictionaryRef: relationDictRef, orgId: schema == null ? void 0 : schema.orgId }
16312
17524
  }
16313
17525
  ) }),
16314
- canReorder && dragName && drop && drop.name === col.name && /* @__PURE__ */ jsx31(
17526
+ canReorder && dragName && drop && drop.name === col.name && /* @__PURE__ */ jsx40(
16315
17527
  "div",
16316
17528
  {
16317
17529
  style: __spreadValues({
@@ -16326,7 +17538,7 @@ function StyledFormBlock({
16326
17538
  }, drop.side === "before" ? { insetInlineStart: -(t.gap / 2) - 2 } : { insetInlineEnd: -(t.gap / 2) - 2 })
16327
17539
  }
16328
17540
  ),
16329
- onFieldResize && !isBoolean && /* @__PURE__ */ jsx31(
17541
+ onFieldResize && !isBoolean && /* @__PURE__ */ jsx40(
16330
17542
  "div",
16331
17543
  {
16332
17544
  onMouseDown: (e) => e.stopPropagation(),
@@ -16356,7 +17568,7 @@ function StyledFormBlock({
16356
17568
  };
16357
17569
  return formColumns.map((col) => renderField(col));
16358
17570
  })() }),
16359
- formError && /* @__PURE__ */ jsx31(
17571
+ formError && /* @__PURE__ */ jsx40(
16360
17572
  "div",
16361
17573
  {
16362
17574
  ref: errorRef,
@@ -16375,7 +17587,7 @@ function StyledFormBlock({
16375
17587
  children: formError
16376
17588
  }
16377
17589
  ),
16378
- /* @__PURE__ */ jsx31(
17590
+ /* @__PURE__ */ jsx40(
16379
17591
  "div",
16380
17592
  {
16381
17593
  style: {
@@ -16385,7 +17597,7 @@ function StyledFormBlock({
16385
17597
  display: "flex",
16386
17598
  justifyContent: justify
16387
17599
  },
16388
- children: /* @__PURE__ */ jsxs27(
17600
+ children: /* @__PURE__ */ jsxs34(
16389
17601
  "button",
16390
17602
  {
16391
17603
  type: "submit",
@@ -16408,8 +17620,8 @@ function StyledFormBlock({
16408
17620
  opacity: isSubmitting ? 0.5 : 1
16409
17621
  },
16410
17622
  children: [
16411
- isSubmitting && /* @__PURE__ */ jsx31(Loader210, { className: "w-4 h-4 animate-spin" }),
16412
- /* @__PURE__ */ jsx31("span", { children: isSubmitting ? "\u05E9\u05D5\u05DE\u05E8..." : d.buttonText })
17623
+ isSubmitting && /* @__PURE__ */ jsx40(Loader210, { className: "w-4 h-4 animate-spin" }),
17624
+ /* @__PURE__ */ jsx40("span", { children: isSubmitting ? "\u05E9\u05D5\u05DE\u05E8..." : d.buttonText })
16413
17625
  ]
16414
17626
  }
16415
17627
  )
@@ -16420,8 +17632,8 @@ function StyledFormBlock({
16420
17632
  }
16421
17633
 
16422
17634
  // src/themes/ThemeScope.tsx
16423
- import * as React24 from "react";
16424
- import { jsx as jsx32 } from "react/jsx-runtime";
17635
+ import * as React29 from "react";
17636
+ import { jsx as jsx41 } from "react/jsx-runtime";
16425
17637
  var UNIVERSE_THEME_IDS = ["classic", "clean", "ocean", "warm"];
16426
17638
  function resolveUniverseTheme(value) {
16427
17639
  return typeof value === "string" && UNIVERSE_THEME_IDS.includes(value) ? value : "classic";
@@ -16431,7 +17643,7 @@ function withThemeScope(Component) {
16431
17643
  var _a, _b, _c;
16432
17644
  const p = props;
16433
17645
  const theme = resolveUniverseTheme((_c = (_a = p.settings) == null ? void 0 : _a.theme) != null ? _c : (_b = p.config) == null ? void 0 : _b.theme);
16434
- return /* @__PURE__ */ jsx32("div", { "data-theme": theme, style: { display: "contents" }, children: React24.createElement(Component, props) });
17646
+ return /* @__PURE__ */ jsx41("div", { "data-theme": theme, style: { display: "contents" }, children: React29.createElement(Component, props) });
16435
17647
  }
16436
17648
  ThemeScoped.displayName = `ThemeScoped(${Component.displayName || Component.name || "Component"})`;
16437
17649
  return ThemeScoped;
@@ -16442,7 +17654,8 @@ var UNIVERSE_COMPONENTS = {
16442
17654
  TABLE: withThemeScope(TableBlock),
16443
17655
  WHATSAPP: withThemeScope(WhatsAppComponent),
16444
17656
  FORM: withThemeScope(StyledFormBlock),
16445
- PLACEMENT: withThemeScope(PlacementBlock)
17657
+ PLACEMENT: withThemeScope(PlacementBlock),
17658
+ PAYMENT_REPORTS: withThemeScope(PaymentReportsBlock)
16446
17659
  };
16447
17660
  export {
16448
17661
  COLUMN_CAPABILITIES,
@@ -16460,6 +17673,9 @@ export {
16460
17673
  LinkPickerCell,
16461
17674
  NON_TEXT_TYPES,
16462
17675
  PASTEL_PALETTES,
17676
+ PAYMENT_REPORTS_ACTIONS,
17677
+ PAYMENT_REPORTS_REQUIRED,
17678
+ PaymentReportsBlock,
16463
17679
  PlacementBlock,
16464
17680
  PlacementSettings,
16465
17681
  PlacementStatusEditor,
@@ -16530,6 +17746,7 @@ export {
16530
17746
  isValidTemplateName,
16531
17747
  isWordToken,
16532
17748
  measureTextWidth,
17749
+ missingPaymentReportsFields,
16533
17750
  normalizePhoneForWhatsApp,
16534
17751
  normalizeRelationValue,
16535
17752
  openWhatsAppChat,