Spaces:
Sleeping
Sleeping
Add Dockerfile and pre-built artifacts
Browse files- Dockerfile +17 -0
- README.md +7 -6
- api-server/dist/app.mjs +0 -0
- api-server/dist/app.mjs.map +0 -0
- api-server/dist/index.mjs +0 -0
- api-server/dist/index.mjs.map +0 -0
- api-server/dist/pino-file.mjs +0 -0
- api-server/dist/pino-file.mjs.map +0 -0
- api-server/dist/pino-pretty.mjs +0 -0
- api-server/dist/pino-pretty.mjs.map +0 -0
- api-server/dist/pino-worker.mjs +0 -0
- api-server/dist/pino-worker.mjs.map +0 -0
- api-server/dist/thread-stream-worker.mjs +228 -0
- api-server/dist/thread-stream-worker.mjs.map +7 -0
- teamtasker/dist/public/assets/Combination-Dl0IQ_XO.js +41 -0
- teamtasker/dist/public/assets/admin-BoJs4kUF.js +1 -0
- teamtasker/dist/public/assets/alert-dialog-DeZev_w3.js +7 -0
- teamtasker/dist/public/assets/arrow-left-Byv1MVqW.js +1 -0
- teamtasker/dist/public/assets/circle-check-BuBb5ch0.js +1 -0
- teamtasker/dist/public/assets/client-detail-D5FUNb3z.js +1 -0
- teamtasker/dist/public/assets/clients-Bot2U4TB.js +1 -0
- teamtasker/dist/public/assets/clock-VJgbNp2_.js +1 -0
- teamtasker/dist/public/assets/constants-VszDEqUo.js +1 -0
- teamtasker/dist/public/assets/dashboard-D1GVWe9-.js +1 -0
- teamtasker/dist/public/assets/dialog-BuD-yXtG.js +1 -0
- teamtasker/dist/public/assets/eye-Bc6SRTsB.js +1 -0
- teamtasker/dist/public/assets/file-text-CsGLBE8z.js +1 -0
- teamtasker/dist/public/assets/index-DLB2cbrK.js +0 -0
- teamtasker/dist/public/assets/index-DlCrbd5f.css +0 -0
- teamtasker/dist/public/assets/index-oW74Oi68.js +5 -0
- teamtasker/dist/public/assets/list-todo-B_SnzIbB.js +1 -0
- teamtasker/dist/public/assets/notifications-DK-qPbHa.js +1 -0
- teamtasker/dist/public/assets/plus-q6nj6w0G.js +1 -0
- teamtasker/dist/public/assets/search-CJt7VdB4.js +1 -0
- teamtasker/dist/public/assets/select-CVvZTGtn.js +1 -0
- teamtasker/dist/public/assets/skeleton-Cni41WG0.js +1 -0
- teamtasker/dist/public/assets/task-detail-D9tjIR4o.js +1 -0
- teamtasker/dist/public/assets/task-new-BR5dj2Yc.js +1 -0
- teamtasker/dist/public/assets/tasks-DhrfiTIR.js +1 -0
- teamtasker/dist/public/assets/teams-C6zfIdM-.js +0 -0
- teamtasker/dist/public/assets/textarea-Cu0xuEdJ.js +1 -0
- teamtasker/dist/public/assets/trash-2-CUsOoE-U.js +1 -0
- teamtasker/dist/public/assets/types-DeMiYPlt.js +1 -0
- teamtasker/dist/public/assets/users-COyL-EpC.js +1 -0
- teamtasker/dist/public/index.html +25 -0
Dockerfile
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Copy pre-built API server
|
| 6 |
+
COPY api-server/dist ./api-server/dist
|
| 7 |
+
|
| 8 |
+
# Copy pre-built frontend
|
| 9 |
+
COPY teamtasker/dist ./teamtasker/dist
|
| 10 |
+
|
| 11 |
+
# Set environment variables
|
| 12 |
+
ENV PORT=7860
|
| 13 |
+
ENV NODE_ENV=production
|
| 14 |
+
|
| 15 |
+
EXPOSE 7860
|
| 16 |
+
|
| 17 |
+
CMD ["node", "--enable-source-maps", "api-server/dist/index.mjs"]
|
README.md
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title: Operation Cycle
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
colorTo: purple
|
| 6 |
sdk: docker
|
|
|
|
| 7 |
pinned: false
|
| 8 |
-
license: apache-2.0
|
| 9 |
-
short_description: operation cycle
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Operation Cycle - TeamTasker
|
| 3 |
+
emoji: 🚀
|
| 4 |
+
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
sdk: docker
|
| 7 |
+
app_port: 7860
|
| 8 |
pinned: false
|
|
|
|
|
|
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# TeamTasker - Operation Cycle
|
| 12 |
+
|
| 13 |
+
A full-stack team task management system built with React + Express + Supabase.
|
api-server/dist/app.mjs
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/app.mjs.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/index.mjs
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/index.mjs.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/pino-file.mjs
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/pino-file.mjs.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/pino-pretty.mjs
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/pino-pretty.mjs.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/pino-worker.mjs
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/pino-worker.mjs.map
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api-server/dist/thread-stream-worker.mjs
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { createRequire as __bannerCrReq } from 'node:module';
|
| 2 |
+
import __bannerPath from 'node:path';
|
| 3 |
+
import __bannerUrl from 'node:url';
|
| 4 |
+
|
| 5 |
+
globalThis.require = __bannerCrReq(import.meta.url);
|
| 6 |
+
globalThis.__filename = __bannerUrl.fileURLToPath(import.meta.url);
|
| 7 |
+
globalThis.__dirname = __bannerPath.dirname(globalThis.__filename);
|
| 8 |
+
|
| 9 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 10 |
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
| 11 |
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
| 12 |
+
}) : x)(function(x) {
|
| 13 |
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
| 14 |
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
| 15 |
+
});
|
| 16 |
+
var __commonJS = (cb, mod) => function __require2() {
|
| 17 |
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
| 18 |
+
};
|
| 19 |
+
|
| 20 |
+
// ../../node_modules/.pnpm/real-require@0.2.0/node_modules/real-require/src/index.js
|
| 21 |
+
var require_src = __commonJS({
|
| 22 |
+
"../../node_modules/.pnpm/real-require@0.2.0/node_modules/real-require/src/index.js"(exports, module) {
|
| 23 |
+
var realImport2 = new Function("modulePath", "return import(modulePath)");
|
| 24 |
+
function realRequire2(modulePath) {
|
| 25 |
+
if (typeof __non_webpack__require__ === "function") {
|
| 26 |
+
return __non_webpack__require__(modulePath);
|
| 27 |
+
}
|
| 28 |
+
return __require(modulePath);
|
| 29 |
+
}
|
| 30 |
+
module.exports = { realImport: realImport2, realRequire: realRequire2 };
|
| 31 |
+
}
|
| 32 |
+
});
|
| 33 |
+
|
| 34 |
+
// ../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js
|
| 35 |
+
var require_indexes = __commonJS({
|
| 36 |
+
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js"(exports, module) {
|
| 37 |
+
"use strict";
|
| 38 |
+
var WRITE_INDEX2 = 4;
|
| 39 |
+
var READ_INDEX2 = 8;
|
| 40 |
+
module.exports = {
|
| 41 |
+
WRITE_INDEX: WRITE_INDEX2,
|
| 42 |
+
READ_INDEX: READ_INDEX2
|
| 43 |
+
};
|
| 44 |
+
}
|
| 45 |
+
});
|
| 46 |
+
|
| 47 |
+
// ../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js
|
| 48 |
+
var require_wait = __commonJS({
|
| 49 |
+
"../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js"(exports, module) {
|
| 50 |
+
"use strict";
|
| 51 |
+
var MAX_TIMEOUT = 1e3;
|
| 52 |
+
function wait(state2, index, expected, timeout, done) {
|
| 53 |
+
const max = Date.now() + timeout;
|
| 54 |
+
let current = Atomics.load(state2, index);
|
| 55 |
+
if (current === expected) {
|
| 56 |
+
done(null, "ok");
|
| 57 |
+
return;
|
| 58 |
+
}
|
| 59 |
+
let prior = current;
|
| 60 |
+
const check = (backoff) => {
|
| 61 |
+
if (Date.now() > max) {
|
| 62 |
+
done(null, "timed-out");
|
| 63 |
+
} else {
|
| 64 |
+
setTimeout(() => {
|
| 65 |
+
prior = current;
|
| 66 |
+
current = Atomics.load(state2, index);
|
| 67 |
+
if (current === prior) {
|
| 68 |
+
check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : backoff * 2);
|
| 69 |
+
} else {
|
| 70 |
+
if (current === expected) done(null, "ok");
|
| 71 |
+
else done(null, "not-equal");
|
| 72 |
+
}
|
| 73 |
+
}, backoff);
|
| 74 |
+
}
|
| 75 |
+
};
|
| 76 |
+
check(1);
|
| 77 |
+
}
|
| 78 |
+
function waitDiff2(state2, index, expected, timeout, done) {
|
| 79 |
+
const max = Date.now() + timeout;
|
| 80 |
+
let current = Atomics.load(state2, index);
|
| 81 |
+
if (current !== expected) {
|
| 82 |
+
done(null, "ok");
|
| 83 |
+
return;
|
| 84 |
+
}
|
| 85 |
+
const check = (backoff) => {
|
| 86 |
+
if (Date.now() > max) {
|
| 87 |
+
done(null, "timed-out");
|
| 88 |
+
} else {
|
| 89 |
+
setTimeout(() => {
|
| 90 |
+
current = Atomics.load(state2, index);
|
| 91 |
+
if (current !== expected) {
|
| 92 |
+
done(null, "ok");
|
| 93 |
+
} else {
|
| 94 |
+
check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : backoff * 2);
|
| 95 |
+
}
|
| 96 |
+
}, backoff);
|
| 97 |
+
}
|
| 98 |
+
};
|
| 99 |
+
check(1);
|
| 100 |
+
}
|
| 101 |
+
module.exports = { wait, waitDiff: waitDiff2 };
|
| 102 |
+
}
|
| 103 |
+
});
|
| 104 |
+
|
| 105 |
+
// ../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/worker.js
|
| 106 |
+
var { realImport, realRequire } = require_src();
|
| 107 |
+
var { workerData, parentPort } = __require("worker_threads");
|
| 108 |
+
var { WRITE_INDEX, READ_INDEX } = require_indexes();
|
| 109 |
+
var { waitDiff } = require_wait();
|
| 110 |
+
var {
|
| 111 |
+
dataBuf,
|
| 112 |
+
filename,
|
| 113 |
+
stateBuf
|
| 114 |
+
} = workerData;
|
| 115 |
+
var destination;
|
| 116 |
+
var state = new Int32Array(stateBuf);
|
| 117 |
+
var data = Buffer.from(dataBuf);
|
| 118 |
+
async function start() {
|
| 119 |
+
let worker;
|
| 120 |
+
try {
|
| 121 |
+
if (filename.endsWith(".ts") || filename.endsWith(".cts")) {
|
| 122 |
+
if (!process[/* @__PURE__ */ Symbol.for("ts-node.register.instance")]) {
|
| 123 |
+
realRequire("ts-node/register");
|
| 124 |
+
} else if (process.env.TS_NODE_DEV) {
|
| 125 |
+
realRequire("ts-node-dev");
|
| 126 |
+
}
|
| 127 |
+
worker = realRequire(decodeURIComponent(filename.replace(process.platform === "win32" ? "file:///" : "file://", "")));
|
| 128 |
+
} else {
|
| 129 |
+
worker = await realImport(filename);
|
| 130 |
+
}
|
| 131 |
+
} catch (error) {
|
| 132 |
+
if ((error.code === "ENOTDIR" || error.code === "ERR_MODULE_NOT_FOUND") && filename.startsWith("file://")) {
|
| 133 |
+
worker = realRequire(decodeURIComponent(filename.replace("file://", "")));
|
| 134 |
+
} else if (error.code === void 0 || error.code === "ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING") {
|
| 135 |
+
try {
|
| 136 |
+
worker = realRequire(decodeURIComponent(filename.replace(process.platform === "win32" ? "file:///" : "file://", "")));
|
| 137 |
+
} catch {
|
| 138 |
+
throw error;
|
| 139 |
+
}
|
| 140 |
+
} else {
|
| 141 |
+
throw error;
|
| 142 |
+
}
|
| 143 |
+
}
|
| 144 |
+
if (typeof worker === "object") worker = worker.default;
|
| 145 |
+
if (typeof worker === "object") worker = worker.default;
|
| 146 |
+
destination = await worker(workerData.workerData);
|
| 147 |
+
destination.on("error", function(err) {
|
| 148 |
+
Atomics.store(state, WRITE_INDEX, -2);
|
| 149 |
+
Atomics.notify(state, WRITE_INDEX);
|
| 150 |
+
Atomics.store(state, READ_INDEX, -2);
|
| 151 |
+
Atomics.notify(state, READ_INDEX);
|
| 152 |
+
parentPort.postMessage({
|
| 153 |
+
code: "ERROR",
|
| 154 |
+
err
|
| 155 |
+
});
|
| 156 |
+
});
|
| 157 |
+
destination.on("close", function() {
|
| 158 |
+
const end = Atomics.load(state, WRITE_INDEX);
|
| 159 |
+
Atomics.store(state, READ_INDEX, end);
|
| 160 |
+
Atomics.notify(state, READ_INDEX);
|
| 161 |
+
setImmediate(() => {
|
| 162 |
+
process.exit(0);
|
| 163 |
+
});
|
| 164 |
+
});
|
| 165 |
+
}
|
| 166 |
+
start().then(function() {
|
| 167 |
+
parentPort.postMessage({
|
| 168 |
+
code: "READY"
|
| 169 |
+
});
|
| 170 |
+
process.nextTick(run);
|
| 171 |
+
});
|
| 172 |
+
function run() {
|
| 173 |
+
const current = Atomics.load(state, READ_INDEX);
|
| 174 |
+
const end = Atomics.load(state, WRITE_INDEX);
|
| 175 |
+
if (end === current) {
|
| 176 |
+
if (end === data.length) {
|
| 177 |
+
waitDiff(state, READ_INDEX, end, Infinity, run);
|
| 178 |
+
} else {
|
| 179 |
+
waitDiff(state, WRITE_INDEX, end, Infinity, run);
|
| 180 |
+
}
|
| 181 |
+
return;
|
| 182 |
+
}
|
| 183 |
+
if (end === -1) {
|
| 184 |
+
destination.end();
|
| 185 |
+
return;
|
| 186 |
+
}
|
| 187 |
+
const toWrite = data.toString("utf8", current, end);
|
| 188 |
+
const res = destination.write(toWrite);
|
| 189 |
+
if (res) {
|
| 190 |
+
Atomics.store(state, READ_INDEX, end);
|
| 191 |
+
Atomics.notify(state, READ_INDEX);
|
| 192 |
+
setImmediate(run);
|
| 193 |
+
} else {
|
| 194 |
+
destination.once("drain", function() {
|
| 195 |
+
Atomics.store(state, READ_INDEX, end);
|
| 196 |
+
Atomics.notify(state, READ_INDEX);
|
| 197 |
+
run();
|
| 198 |
+
});
|
| 199 |
+
}
|
| 200 |
+
}
|
| 201 |
+
process.on("unhandledRejection", function(err) {
|
| 202 |
+
parentPort.postMessage({
|
| 203 |
+
code: "ERROR",
|
| 204 |
+
err
|
| 205 |
+
});
|
| 206 |
+
process.exit(1);
|
| 207 |
+
});
|
| 208 |
+
process.on("uncaughtException", function(err) {
|
| 209 |
+
parentPort.postMessage({
|
| 210 |
+
code: "ERROR",
|
| 211 |
+
err
|
| 212 |
+
});
|
| 213 |
+
process.exit(1);
|
| 214 |
+
});
|
| 215 |
+
process.once("exit", (exitCode) => {
|
| 216 |
+
if (exitCode !== 0) {
|
| 217 |
+
process.exit(exitCode);
|
| 218 |
+
return;
|
| 219 |
+
}
|
| 220 |
+
if (destination?.writableNeedDrain && !destination?.writableEnded) {
|
| 221 |
+
parentPort.postMessage({
|
| 222 |
+
code: "WARNING",
|
| 223 |
+
err: new Error("ThreadStream: process exited before destination stream was drained. this may indicate that the destination stream try to write to a another missing stream")
|
| 224 |
+
});
|
| 225 |
+
}
|
| 226 |
+
process.exit(0);
|
| 227 |
+
});
|
| 228 |
+
//# sourceMappingURL=thread-stream-worker.mjs.map
|
api-server/dist/thread-stream-worker.mjs.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"version": 3,
|
| 3 |
+
"sources": ["../../../node_modules/.pnpm/real-require@0.2.0/node_modules/real-require/src/index.js", "../../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/indexes.js", "../../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/wait.js", "../../../node_modules/.pnpm/thread-stream@3.1.0/node_modules/thread-stream/lib/worker.js"],
|
| 4 |
+
"sourcesContent": ["/* eslint-disable no-new-func, camelcase */\n/* globals __non_webpack__require__ */\n\nconst realImport = new Function('modulePath', 'return import(modulePath)')\n\nfunction realRequire(modulePath) {\n if (typeof __non_webpack__require__ === 'function') {\n return __non_webpack__require__(modulePath)\n }\n\n return require(modulePath)\n}\n\nmodule.exports = { realImport, realRequire }\n", "'use strict'\n\nconst WRITE_INDEX = 4\nconst READ_INDEX = 8\n\nmodule.exports = {\n WRITE_INDEX,\n READ_INDEX\n}\n", "'use strict'\n\nconst MAX_TIMEOUT = 1000\n\nfunction wait (state, index, expected, timeout, done) {\n const max = Date.now() + timeout\n let current = Atomics.load(state, index)\n if (current === expected) {\n done(null, 'ok')\n return\n }\n let prior = current\n const check = (backoff) => {\n if (Date.now() > max) {\n done(null, 'timed-out')\n } else {\n setTimeout(() => {\n prior = current\n current = Atomics.load(state, index)\n if (current === prior) {\n check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : backoff * 2)\n } else {\n if (current === expected) done(null, 'ok')\n else done(null, 'not-equal')\n }\n }, backoff)\n }\n }\n check(1)\n}\n\n// let waitDiffCount = 0\nfunction waitDiff (state, index, expected, timeout, done) {\n // const id = waitDiffCount++\n // process._rawDebug(`>>> waitDiff ${id}`)\n const max = Date.now() + timeout\n let current = Atomics.load(state, index)\n if (current !== expected) {\n done(null, 'ok')\n return\n }\n const check = (backoff) => {\n // process._rawDebug(`${id} ${index} current ${current} expected ${expected}`)\n // process._rawDebug('' + backoff)\n if (Date.now() > max) {\n done(null, 'timed-out')\n } else {\n setTimeout(() => {\n current = Atomics.load(state, index)\n if (current !== expected) {\n done(null, 'ok')\n } else {\n check(backoff >= MAX_TIMEOUT ? MAX_TIMEOUT : backoff * 2)\n }\n }, backoff)\n }\n }\n check(1)\n}\n\nmodule.exports = { wait, waitDiff }\n", "'use strict'\n\nconst { realImport, realRequire } = require('real-require')\nconst { workerData, parentPort } = require('worker_threads')\nconst { WRITE_INDEX, READ_INDEX } = require('./indexes')\nconst { waitDiff } = require('./wait')\n\nconst {\n dataBuf,\n filename,\n stateBuf\n} = workerData\n\nlet destination\n\nconst state = new Int32Array(stateBuf)\nconst data = Buffer.from(dataBuf)\n\nasync function start () {\n let worker\n try {\n if (filename.endsWith('.ts') || filename.endsWith('.cts')) {\n // TODO: add support for the TSM modules loader ( https://github.com/lukeed/tsm ).\n if (!process[Symbol.for('ts-node.register.instance')]) {\n realRequire('ts-node/register')\n } else if (process.env.TS_NODE_DEV) {\n realRequire('ts-node-dev')\n }\n // TODO: Support ES imports once tsc, tap & ts-node provide better compatibility guarantees.\n // Remove extra forwardslash on Windows\n worker = realRequire(decodeURIComponent(filename.replace(process.platform === 'win32' ? 'file:///' : 'file://', '')))\n } else {\n worker = (await realImport(filename))\n }\n } catch (error) {\n // A yarn user that tries to start a ThreadStream for an external module\n // provides a filename pointing to a zip file.\n // eg. require.resolve('pino-elasticsearch') // returns /foo/pino-elasticsearch-npm-6.1.0-0c03079478-6915435172.zip/bar.js\n // The `import` will fail to try to load it.\n // This catch block executes the `require` fallback to load the module correctly.\n // In fact, yarn modifies the `require` function to manage the zipped path.\n // More details at https://github.com/pinojs/pino/pull/1113\n // The error codes may change based on the node.js version (ENOTDIR > 12, ERR_MODULE_NOT_FOUND <= 12 )\n if ((error.code === 'ENOTDIR' || error.code === 'ERR_MODULE_NOT_FOUND') &&\n filename.startsWith('file://')) {\n worker = realRequire(decodeURIComponent(filename.replace('file://', '')))\n } else if (error.code === undefined || error.code === 'ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING') {\n // When bundled with pkg, an undefined error is thrown when called with realImport\n // When bundled with pkg and using node v20, an ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING error is thrown when called with realImport\n // More info at: https://github.com/pinojs/thread-stream/issues/143\n try {\n worker = realRequire(decodeURIComponent(filename.replace(process.platform === 'win32' ? 'file:///' : 'file://', '')))\n } catch {\n throw error\n }\n } else {\n throw error\n }\n }\n\n // Depending on how the default export is performed, and on how the code is\n // transpiled, we may find cases of two nested \"default\" objects.\n // See https://github.com/pinojs/pino/issues/1243#issuecomment-982774762\n if (typeof worker === 'object') worker = worker.default\n if (typeof worker === 'object') worker = worker.default\n\n destination = await worker(workerData.workerData)\n\n destination.on('error', function (err) {\n Atomics.store(state, WRITE_INDEX, -2)\n Atomics.notify(state, WRITE_INDEX)\n\n Atomics.store(state, READ_INDEX, -2)\n Atomics.notify(state, READ_INDEX)\n\n parentPort.postMessage({\n code: 'ERROR',\n err\n })\n })\n\n destination.on('close', function () {\n // process._rawDebug('worker close emitted')\n const end = Atomics.load(state, WRITE_INDEX)\n Atomics.store(state, READ_INDEX, end)\n Atomics.notify(state, READ_INDEX)\n setImmediate(() => {\n process.exit(0)\n })\n })\n}\n\n// No .catch() handler,\n// in case there is an error it goes\n// to unhandledRejection\nstart().then(function () {\n parentPort.postMessage({\n code: 'READY'\n })\n\n process.nextTick(run)\n})\n\nfunction run () {\n const current = Atomics.load(state, READ_INDEX)\n const end = Atomics.load(state, WRITE_INDEX)\n\n // process._rawDebug(`pre state ${current} ${end}`)\n\n if (end === current) {\n if (end === data.length) {\n waitDiff(state, READ_INDEX, end, Infinity, run)\n } else {\n waitDiff(state, WRITE_INDEX, end, Infinity, run)\n }\n return\n }\n\n // process._rawDebug(`post state ${current} ${end}`)\n\n if (end === -1) {\n // process._rawDebug('end')\n destination.end()\n return\n }\n\n const toWrite = data.toString('utf8', current, end)\n // process._rawDebug('worker writing: ' + toWrite)\n\n const res = destination.write(toWrite)\n\n if (res) {\n Atomics.store(state, READ_INDEX, end)\n Atomics.notify(state, READ_INDEX)\n setImmediate(run)\n } else {\n destination.once('drain', function () {\n Atomics.store(state, READ_INDEX, end)\n Atomics.notify(state, READ_INDEX)\n run()\n })\n }\n}\n\nprocess.on('unhandledRejection', function (err) {\n parentPort.postMessage({\n code: 'ERROR',\n err\n })\n process.exit(1)\n})\n\nprocess.on('uncaughtException', function (err) {\n parentPort.postMessage({\n code: 'ERROR',\n err\n })\n process.exit(1)\n})\n\nprocess.once('exit', exitCode => {\n if (exitCode !== 0) {\n process.exit(exitCode)\n return\n }\n if (destination?.writableNeedDrain && !destination?.writableEnded) {\n parentPort.postMessage({\n code: 'WARNING',\n err: new Error('ThreadStream: process exited before destination stream was drained. this may indicate that the destination stream try to write to a another missing stream')\n })\n }\n\n process.exit(0)\n})\n"],
|
| 5 |
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAGA,QAAMA,cAAa,IAAI,SAAS,cAAc,2BAA2B;AAEzE,aAASC,aAAY,YAAY;AAC/B,UAAI,OAAO,6BAA6B,YAAY;AAClD,eAAO,yBAAyB,UAAU;AAAA,MAC5C;AAEA,aAAO,UAAQ,UAAU;AAAA,IAC3B;AAEA,WAAO,UAAU,EAAE,YAAAD,aAAY,aAAAC,aAAY;AAAA;AAAA;;;ACb3C;AAAA;AAAA;AAEA,QAAMC,eAAc;AACpB,QAAMC,cAAa;AAEnB,WAAO,UAAU;AAAA,MACf,aAAAD;AAAA,MACA,YAAAC;AAAA,IACF;AAAA;AAAA;;;ACRA;AAAA;AAAA;AAEA,QAAM,cAAc;AAEpB,aAAS,KAAMC,QAAO,OAAO,UAAU,SAAS,MAAM;AACpD,YAAM,MAAM,KAAK,IAAI,IAAI;AACzB,UAAI,UAAU,QAAQ,KAAKA,QAAO,KAAK;AACvC,UAAI,YAAY,UAAU;AACxB,aAAK,MAAM,IAAI;AACf;AAAA,MACF;AACA,UAAI,QAAQ;AACZ,YAAM,QAAQ,CAAC,YAAY;AACzB,YAAI,KAAK,IAAI,IAAI,KAAK;AACpB,eAAK,MAAM,WAAW;AAAA,QACxB,OAAO;AACL,qBAAW,MAAM;AACf,oBAAQ;AACR,sBAAU,QAAQ,KAAKA,QAAO,KAAK;AACnC,gBAAI,YAAY,OAAO;AACrB,oBAAM,WAAW,cAAc,cAAc,UAAU,CAAC;AAAA,YAC1D,OAAO;AACL,kBAAI,YAAY,SAAU,MAAK,MAAM,IAAI;AAAA,kBACpC,MAAK,MAAM,WAAW;AAAA,YAC7B;AAAA,UACF,GAAG,OAAO;AAAA,QACZ;AAAA,MACF;AACA,YAAM,CAAC;AAAA,IACT;AAGA,aAASC,UAAUD,QAAO,OAAO,UAAU,SAAS,MAAM;AAGxD,YAAM,MAAM,KAAK,IAAI,IAAI;AACzB,UAAI,UAAU,QAAQ,KAAKA,QAAO,KAAK;AACvC,UAAI,YAAY,UAAU;AACxB,aAAK,MAAM,IAAI;AACf;AAAA,MACF;AACA,YAAM,QAAQ,CAAC,YAAY;AAGzB,YAAI,KAAK,IAAI,IAAI,KAAK;AACpB,eAAK,MAAM,WAAW;AAAA,QACxB,OAAO;AACL,qBAAW,MAAM;AACf,sBAAU,QAAQ,KAAKA,QAAO,KAAK;AACnC,gBAAI,YAAY,UAAU;AACxB,mBAAK,MAAM,IAAI;AAAA,YACjB,OAAO;AACL,oBAAM,WAAW,cAAc,cAAc,UAAU,CAAC;AAAA,YAC1D;AAAA,UACF,GAAG,OAAO;AAAA,QACZ;AAAA,MACF;AACA,YAAM,CAAC;AAAA,IACT;AAEA,WAAO,UAAU,EAAE,MAAM,UAAAC,UAAS;AAAA;AAAA;;;AC1DlC,IAAM,EAAE,YAAY,YAAY,IAAI;AACpC,IAAM,EAAE,YAAY,WAAW,IAAI,UAAQ,gBAAgB;AAC3D,IAAM,EAAE,aAAa,WAAW,IAAI;AACpC,IAAM,EAAE,SAAS,IAAI;AAErB,IAAM;AAAA,EACJ;AAAA,EACA;AAAA,EACA;AACF,IAAI;AAEJ,IAAI;AAEJ,IAAM,QAAQ,IAAI,WAAW,QAAQ;AACrC,IAAM,OAAO,OAAO,KAAK,OAAO;AAEhC,eAAe,QAAS;AACtB,MAAI;AACJ,MAAI;AACF,QAAI,SAAS,SAAS,KAAK,KAAK,SAAS,SAAS,MAAM,GAAG;AAEzD,UAAI,CAAC,QAAQ,uBAAO,IAAI,2BAA2B,CAAC,GAAG;AACrD,oBAAY,kBAAkB;AAAA,MAChC,WAAW,QAAQ,IAAI,aAAa;AAClC,oBAAY,aAAa;AAAA,MAC3B;AAGA,eAAS,YAAY,mBAAmB,SAAS,QAAQ,QAAQ,aAAa,UAAU,aAAa,WAAW,EAAE,CAAC,CAAC;AAAA,IACtH,OAAO;AACL,eAAU,MAAM,WAAW,QAAQ;AAAA,IACrC;AAAA,EACF,SAAS,OAAO;AASd,SAAK,MAAM,SAAS,aAAa,MAAM,SAAS,2BAC/C,SAAS,WAAW,SAAS,GAAG;AAC/B,eAAS,YAAY,mBAAmB,SAAS,QAAQ,WAAW,EAAE,CAAC,CAAC;AAAA,IAC1E,WAAW,MAAM,SAAS,UAAa,MAAM,SAAS,0CAA0C;AAI9F,UAAI;AACF,iBAAS,YAAY,mBAAmB,SAAS,QAAQ,QAAQ,aAAa,UAAU,aAAa,WAAW,EAAE,CAAC,CAAC;AAAA,MACtH,QAAQ;AACN,cAAM;AAAA,MACR;AAAA,IACF,OAAO;AACL,YAAM;AAAA,IACR;AAAA,EACF;AAKA,MAAI,OAAO,WAAW,SAAU,UAAS,OAAO;AAChD,MAAI,OAAO,WAAW,SAAU,UAAS,OAAO;AAEhD,gBAAc,MAAM,OAAO,WAAW,UAAU;AAEhD,cAAY,GAAG,SAAS,SAAU,KAAK;AACrC,YAAQ,MAAM,OAAO,aAAa,EAAE;AACpC,YAAQ,OAAO,OAAO,WAAW;AAEjC,YAAQ,MAAM,OAAO,YAAY,EAAE;AACnC,YAAQ,OAAO,OAAO,UAAU;AAEhC,eAAW,YAAY;AAAA,MACrB,MAAM;AAAA,MACN;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AAED,cAAY,GAAG,SAAS,WAAY;AAElC,UAAM,MAAM,QAAQ,KAAK,OAAO,WAAW;AAC3C,YAAQ,MAAM,OAAO,YAAY,GAAG;AACpC,YAAQ,OAAO,OAAO,UAAU;AAChC,iBAAa,MAAM;AACjB,cAAQ,KAAK,CAAC;AAAA,IAChB,CAAC;AAAA,EACH,CAAC;AACH;AAKA,MAAM,EAAE,KAAK,WAAY;AACvB,aAAW,YAAY;AAAA,IACrB,MAAM;AAAA,EACR,CAAC;AAED,UAAQ,SAAS,GAAG;AACtB,CAAC;AAED,SAAS,MAAO;AACd,QAAM,UAAU,QAAQ,KAAK,OAAO,UAAU;AAC9C,QAAM,MAAM,QAAQ,KAAK,OAAO,WAAW;AAI3C,MAAI,QAAQ,SAAS;AACnB,QAAI,QAAQ,KAAK,QAAQ;AACvB,eAAS,OAAO,YAAY,KAAK,UAAU,GAAG;AAAA,IAChD,OAAO;AACL,eAAS,OAAO,aAAa,KAAK,UAAU,GAAG;AAAA,IACjD;AACA;AAAA,EACF;AAIA,MAAI,QAAQ,IAAI;AAEd,gBAAY,IAAI;AAChB;AAAA,EACF;AAEA,QAAM,UAAU,KAAK,SAAS,QAAQ,SAAS,GAAG;AAGlD,QAAM,MAAM,YAAY,MAAM,OAAO;AAErC,MAAI,KAAK;AACP,YAAQ,MAAM,OAAO,YAAY,GAAG;AACpC,YAAQ,OAAO,OAAO,UAAU;AAChC,iBAAa,GAAG;AAAA,EAClB,OAAO;AACL,gBAAY,KAAK,SAAS,WAAY;AACpC,cAAQ,MAAM,OAAO,YAAY,GAAG;AACpC,cAAQ,OAAO,OAAO,UAAU;AAChC,UAAI;AAAA,IACN,CAAC;AAAA,EACH;AACF;AAEA,QAAQ,GAAG,sBAAsB,SAAU,KAAK;AAC9C,aAAW,YAAY;AAAA,IACrB,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACD,UAAQ,KAAK,CAAC;AAChB,CAAC;AAED,QAAQ,GAAG,qBAAqB,SAAU,KAAK;AAC7C,aAAW,YAAY;AAAA,IACrB,MAAM;AAAA,IACN;AAAA,EACF,CAAC;AACD,UAAQ,KAAK,CAAC;AAChB,CAAC;AAED,QAAQ,KAAK,QAAQ,cAAY;AAC/B,MAAI,aAAa,GAAG;AAClB,YAAQ,KAAK,QAAQ;AACrB;AAAA,EACF;AACA,MAAI,aAAa,qBAAqB,CAAC,aAAa,eAAe;AACjE,eAAW,YAAY;AAAA,MACrB,MAAM;AAAA,MACN,KAAK,IAAI,MAAM,4JAA4J;AAAA,IAC7K,CAAC;AAAA,EACH;AAEA,UAAQ,KAAK,CAAC;AAChB,CAAC;",
|
| 6 |
+
"names": ["realImport", "realRequire", "WRITE_INDEX", "READ_INDEX", "state", "waitDiff"]
|
| 7 |
+
}
|
teamtasker/dist/public/assets/Combination-Dl0IQ_XO.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{a2 as u,ai as ge,p as ye,a4 as $,a5 as be,a0 as Ee,o as Se}from"./index-DLB2cbrK.js";var we=ye[" useId ".trim().toString()]||(()=>{}),Ce=0;function bt(e){const[t,n]=u.useState(we());return ge(()=>{n(r=>r??String(Ce++))},[e]),e||(t?`radix-${t}`:"")}var _=0;function Et(){u.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??q()),document.body.insertAdjacentElement("beforeend",e[1]??q()),_++,()=>{_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),_--}},[])}function q(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var j="focusScope.autoFocusOnMount",K="focusScope.autoFocusOnUnmount",Q={bubbles:!1,cancelable:!0},Re="FocusScope",ke=u.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:c,onUnmountAutoFocus:i,...s}=e,[a,S]=u.useState(null),b=$(c),g=$(i),f=u.useRef(null),v=be(t,o=>S(o)),h=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let o=function(p){if(h.paused||!a)return;const y=p.target;a.contains(y)?f.current=y:A(f.current,{select:!0})},l=function(p){if(h.paused||!a)return;const y=p.relatedTarget;y!==null&&(a.contains(y)||A(f.current,{select:!0}))},d=function(p){if(document.activeElement===document.body)for(const E of p)E.removedNodes.length>0&&A(a)};document.addEventListener("focusin",o),document.addEventListener("focusout",l);const m=new MutationObserver(d);return a&&m.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",o),document.removeEventListener("focusout",l),m.disconnect()}}},[r,a,h.paused]),u.useEffect(()=>{if(a){ee.add(h);const o=document.activeElement;if(!a.contains(o)){const d=new CustomEvent(j,Q);a.addEventListener(j,b),a.dispatchEvent(d),d.defaultPrevented||(Ae(Pe(ue(a)),{select:!0}),document.activeElement===o&&A(a))}return()=>{a.removeEventListener(j,b),setTimeout(()=>{const d=new CustomEvent(K,Q);a.addEventListener(K,g),a.dispatchEvent(d),d.defaultPrevented||A(o??document.body,{select:!0}),a.removeEventListener(K,g),ee.remove(h)},0)}}},[a,b,g,h]);const w=u.useCallback(o=>{if(!n&&!r||h.paused)return;const l=o.key==="Tab"&&!o.altKey&&!o.ctrlKey&&!o.metaKey,d=document.activeElement;if(l&&d){const m=o.currentTarget,[p,y]=Te(m);p&&y?!o.shiftKey&&d===y?(o.preventDefault(),n&&A(p,{select:!0})):o.shiftKey&&d===p&&(o.preventDefault(),n&&A(y,{select:!0})):d===m&&o.preventDefault()}},[n,r,h.paused]);return Ee.jsx(Se.div,{tabIndex:-1,...s,ref:v,onKeyDown:w})});ke.displayName=Re;function Ae(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(A(r,{select:t}),document.activeElement!==n)return}function Te(e){const t=ue(e),n=J(t,e),r=J(t.reverse(),e);return[n,r]}function ue(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const c=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||c?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function J(e,t){for(const n of e)if(!Ne(n,{upTo:t}))return n}function Ne(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Me(e){return e instanceof HTMLInputElement&&"select"in e}function A(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Me(e)&&t&&e.select()}}var ee=Fe();function Fe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=te(e,t),e.unshift(t)},remove(t){e=te(e,t),e[0]?.resume()}}}function te(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Pe(e){return e.filter(t=>t.tagName!=="A")}function St(e){const t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Oe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},T=new WeakMap,O=new WeakMap,L={},H=0,ie=function(e){return e&&(e.host||ie(e.parentNode))},Le=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=ie(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ie=function(e,t,n,r){var c=Le(t,Array.isArray(e)?e:[e]);L[n]||(L[n]=new WeakMap);var i=L[n],s=[],a=new Set,S=new Set(c),b=function(f){!f||a.has(f)||(a.add(f),b(f.parentNode))};c.forEach(b);var g=function(f){!f||S.has(f)||Array.prototype.forEach.call(f.children,function(v){if(a.has(v))g(v);else try{var h=v.getAttribute(r),w=h!==null&&h!=="false",o=(T.get(v)||0)+1,l=(i.get(v)||0)+1;T.set(v,o),i.set(v,l),s.push(v),o===1&&w&&O.set(v,!0),l===1&&v.setAttribute(n,"true"),w||v.setAttribute(r,"true")}catch(d){console.error("aria-hidden: cannot operate on ",v,d)}})};return g(t),a.clear(),H++,function(){s.forEach(function(f){var v=T.get(f)-1,h=i.get(f)-1;T.set(f,v),i.set(f,h),v||(O.has(f)||f.removeAttribute(r),O.delete(f)),h||f.removeAttribute(n)}),H--,H||(T=new WeakMap,T=new WeakMap,O=new WeakMap,L={})}},wt=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),c=Oe(e);return c?(r.push.apply(r,Array.from(c.querySelectorAll("[aria-live], script"))),Ie(r,c,n,"aria-hidden")):function(){return null}},C=function(){return C=Object.assign||function(t){for(var n,r=1,c=arguments.length;r<c;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},C.apply(this,arguments)};function le(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(e);c<r.length;c++)t.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(e,r[c])&&(n[r[c]]=e[r[c]]);return n}function xe(e,t,n){if(n||arguments.length===2)for(var r=0,c=t.length,i;r<c;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var W="right-scroll-bar-position",B="width-before-scroll-bar",We="with-scroll-bars-hidden",Be="--removed-body-scroll-bar-size";function V(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function De(e,t){var n=u.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var c=n.value;c!==r&&(n.value=r,n.callback(r,c))}}}})[0];return n.callback=t,n.facade}var Ue=typeof window<"u"?u.useLayoutEffect:u.useEffect,ne=new WeakMap;function _e(e,t){var n=De(null,function(r){return e.forEach(function(c){return V(c,r)})});return Ue(function(){var r=ne.get(n);if(r){var c=new Set(r),i=new Set(e),s=n.current;c.forEach(function(a){i.has(a)||V(a,null)}),i.forEach(function(a){c.has(a)||V(a,s)})}ne.set(n,e)},[e]),n}function je(e){return e}function Ke(e,t){t===void 0&&(t=je);var n=[],r=!1,c={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(a){return a!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(a){return i(a)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var a=n;n=[],a.forEach(i),s=n}var S=function(){var g=s;s=[],g.forEach(i)},b=function(){return Promise.resolve().then(S)};b(),n={push:function(g){s.push(g),b()},filter:function(g){return s=s.filter(g),n}}}};return c}function He(e){e===void 0&&(e={});var t=Ke(null);return t.options=C({async:!0,ssr:!1},e),t}var se=function(e){var t=e.sideCar,n=le(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return u.createElement(r,C({},n))};se.isSideCarExport=!0;function Ve(e,t){return e.useMedium(t),se}var fe=He(),X=function(){},D=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:X,onWheelCapture:X,onTouchMoveCapture:X}),c=r[0],i=r[1],s=e.forwardProps,a=e.children,S=e.className,b=e.removeScrollBar,g=e.enabled,f=e.shards,v=e.sideCar,h=e.noRelative,w=e.noIsolation,o=e.inert,l=e.allowPinchZoom,d=e.as,m=d===void 0?"div":d,p=e.gapMode,y=le(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=v,R=_e([n,t]),k=C(C({},y),c);return u.createElement(u.Fragment,null,g&&u.createElement(E,{sideCar:fe,removeScrollBar:b,shards:f,noRelative:h,noIsolation:w,inert:o,setCallbacks:i,allowPinchZoom:!!l,lockRef:n,gapMode:p}),s?u.cloneElement(u.Children.only(a),C(C({},k),{ref:R})):u.createElement(m,C({},k,{className:S,ref:R}),a))});D.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};D.classNames={fullWidth:B,zeroRight:W};var Xe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ye(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=Xe();return t&&e.setAttribute("nonce",t),e}function Ge(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function ze(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var Ze=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ye())&&(Ge(t,n),ze(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$e=function(){var e=Ze();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},de=function(){var e=$e(),t=function(n){var r=n.styles,c=n.dynamic;return e(r,c),null};return t},qe={left:0,top:0,right:0,gap:0},Y=function(e){return parseInt(e||"",10)||0},Qe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],c=t[e==="padding"?"paddingRight":"marginRight"];return[Y(n),Y(r),Y(c)]},Je=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return qe;var t=Qe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},et=de(),F="data-scroll-locked",tt=function(e,t,n,r){var c=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),`
|
| 2 |
+
.`.concat(We,` {
|
| 3 |
+
overflow: hidden `).concat(r,`;
|
| 4 |
+
padding-right: `).concat(a,"px ").concat(r,`;
|
| 5 |
+
}
|
| 6 |
+
body[`).concat(F,`] {
|
| 7 |
+
overflow: hidden `).concat(r,`;
|
| 8 |
+
overscroll-behavior: contain;
|
| 9 |
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
| 10 |
+
padding-left: `.concat(c,`px;
|
| 11 |
+
padding-top: `).concat(i,`px;
|
| 12 |
+
padding-right: `).concat(s,`px;
|
| 13 |
+
margin-left:0;
|
| 14 |
+
margin-top:0;
|
| 15 |
+
margin-right: `).concat(a,"px ").concat(r,`;
|
| 16 |
+
`),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),`
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.`).concat(W,` {
|
| 20 |
+
right: `).concat(a,"px ").concat(r,`;
|
| 21 |
+
}
|
| 22 |
+
|
| 23 |
+
.`).concat(B,` {
|
| 24 |
+
margin-right: `).concat(a,"px ").concat(r,`;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
.`).concat(W," .").concat(W,` {
|
| 28 |
+
right: 0 `).concat(r,`;
|
| 29 |
+
}
|
| 30 |
+
|
| 31 |
+
.`).concat(B," .").concat(B,` {
|
| 32 |
+
margin-right: 0 `).concat(r,`;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
body[`).concat(F,`] {
|
| 36 |
+
`).concat(Be,": ").concat(a,`px;
|
| 37 |
+
}
|
| 38 |
+
`)},re=function(){var e=parseInt(document.body.getAttribute(F)||"0",10);return isFinite(e)?e:0},nt=function(){u.useEffect(function(){return document.body.setAttribute(F,(re()+1).toString()),function(){var e=re()-1;e<=0?document.body.removeAttribute(F):document.body.setAttribute(F,e.toString())}},[])},rt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,c=r===void 0?"margin":r;nt();var i=u.useMemo(function(){return Je(c)},[c]);return u.createElement(et,{styles:tt(i,!t,c,n?"":"!important")})},G=!1;if(typeof window<"u")try{var I=Object.defineProperty({},"passive",{get:function(){return G=!0,!0}});window.addEventListener("test",I,I),window.removeEventListener("test",I,I)}catch{G=!1}var N=G?{passive:!1}:!1,at=function(e){return e.tagName==="TEXTAREA"},ve=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!at(e)&&n[t]==="visible")},ot=function(e){return ve(e,"overflowY")},ct=function(e){return ve(e,"overflowX")},ae=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var c=he(e,r);if(c){var i=me(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},ut=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},it=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},he=function(e,t){return e==="v"?ot(t):ct(t)},me=function(e,t){return e==="v"?ut(t):it(t)},lt=function(e,t){return e==="h"&&t==="rtl"?-1:1},st=function(e,t,n,r,c){var i=lt(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,S=t.contains(a),b=!1,g=s>0,f=0,v=0;do{if(!a)break;var h=me(e,a),w=h[0],o=h[1],l=h[2],d=o-l-i*w;(w||d)&&he(e,a)&&(f+=d,v+=w);var m=a.parentNode;a=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!S&&a!==document.body||S&&(t.contains(a)||t===a));return(g&&Math.abs(f)<1||!g&&Math.abs(v)<1)&&(b=!0),b},x=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},oe=function(e){return[e.deltaX,e.deltaY]},ce=function(e){return e&&"current"in e?e.current:e},ft=function(e,t){return e[0]===t[0]&&e[1]===t[1]},dt=function(e){return`
|
| 39 |
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
| 40 |
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
| 41 |
+
`)},vt=0,M=[];function ht(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),c=u.useState(vt++)[0],i=u.useState(de)[0],s=u.useRef(e);u.useEffect(function(){s.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(c));var o=xe([e.lockRef.current],(e.shards||[]).map(ce),!0).filter(Boolean);return o.forEach(function(l){return l.classList.add("allow-interactivity-".concat(c))}),function(){document.body.classList.remove("block-interactivity-".concat(c)),o.forEach(function(l){return l.classList.remove("allow-interactivity-".concat(c))})}}},[e.inert,e.lockRef.current,e.shards]);var a=u.useCallback(function(o,l){if("touches"in o&&o.touches.length===2||o.type==="wheel"&&o.ctrlKey)return!s.current.allowPinchZoom;var d=x(o),m=n.current,p="deltaX"in o?o.deltaX:m[0]-d[0],y="deltaY"in o?o.deltaY:m[1]-d[1],E,R=o.target,k=Math.abs(p)>Math.abs(y)?"h":"v";if("touches"in o&&k==="h"&&R.type==="range")return!1;var z=window.getSelection(),U=z&&z.anchorNode,pe=U?U===R||U.contains(R):!1;if(pe)return!1;var P=ae(k,R);if(!P)return!0;if(P?E=k:(E=k==="v"?"h":"v",P=ae(k,R)),!P)return!1;if(!r.current&&"changedTouches"in o&&(p||y)&&(r.current=E),!E)return!0;var Z=r.current||E;return st(Z,l,o,Z==="h"?p:y)},[]),S=u.useCallback(function(o){var l=o;if(!(!M.length||M[M.length-1]!==i)){var d="deltaY"in l?oe(l):x(l),m=t.current.filter(function(E){return E.name===l.type&&(E.target===l.target||l.target===E.shadowParent)&&ft(E.delta,d)})[0];if(m&&m.should){l.cancelable&&l.preventDefault();return}if(!m){var p=(s.current.shards||[]).map(ce).filter(Boolean).filter(function(E){return E.contains(l.target)}),y=p.length>0?a(l,p[0]):!s.current.noIsolation;y&&l.cancelable&&l.preventDefault()}}},[]),b=u.useCallback(function(o,l,d,m){var p={name:o,delta:l,target:d,should:m,shadowParent:mt(d)};t.current.push(p),setTimeout(function(){t.current=t.current.filter(function(y){return y!==p})},1)},[]),g=u.useCallback(function(o){n.current=x(o),r.current=void 0},[]),f=u.useCallback(function(o){b(o.type,oe(o),o.target,a(o,e.lockRef.current))},[]),v=u.useCallback(function(o){b(o.type,x(o),o.target,a(o,e.lockRef.current))},[]);u.useEffect(function(){return M.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:v}),document.addEventListener("wheel",S,N),document.addEventListener("touchmove",S,N),document.addEventListener("touchstart",g,N),function(){M=M.filter(function(o){return o!==i}),document.removeEventListener("wheel",S,N),document.removeEventListener("touchmove",S,N),document.removeEventListener("touchstart",g,N)}},[]);var h=e.removeScrollBar,w=e.inert;return u.createElement(u.Fragment,null,w?u.createElement(i,{styles:dt(c)}):null,h?u.createElement(rt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function mt(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const pt=Ve(fe,ht);var gt=u.forwardRef(function(e,t){return u.createElement(D,C({},e,{ref:t,sideCar:pt}))});gt.classNames=D.classNames;export{ke as F,gt as R,bt as a,St as b,wt as h,Et as u};
|
teamtasker/dist/public/assets/admin-BoJs4kUF.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as O,a2 as t,av as ve,ax as fe,a3 as ye,ao as Ne,ad as we,am as ke,ay as Ce,aC as Te,a0 as e,U as Se,C as o,j as m,k as x,h,r as X,i as u,d as Ue,e as Ae,S as Ee,B as Me,L as d,I as $,Z as _e,$ as F}from"./index-DLB2cbrK.js";import{S as k}from"./skeleton-Cni41WG0.js";import{D as Y,a as ee,b as se,c as ae}from"./dialog-BuD-yXtG.js";import{S as C,c as T,d as S,a as U,b as A}from"./select-CVvZTGtn.js";import{d as te,b as le}from"./constants-VszDEqUo.js";import{E as Le}from"./eye-Bc6SRTsB.js";import"./index-oW74Oi68.js";import"./Combination-Dl0IQ_XO.js";const $e=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Fe=O("chart-column",$e);const Oe=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],De=O("eye-off",Oe);const Ie=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],re=O("settings",Ie),qe=[{id:"users",label:"المستخدمون",icon:Se},{id:"analytics",label:"التحليلات",icon:Fe},{id:"taskTypes",label:"أنواع المهام",icon:re}],ne=[{value:"admin",label:"مدير النظام",cls:"bg-red-100 text-red-700 border-red-200"},{value:"head_of_team",label:"رئيس الفرق",cls:"bg-orange-100 text-orange-700 border-orange-200"},{value:"team_lead",label:"قائد فريق",cls:"bg-blue-100 text-blue-700 border-blue-200"},{value:"member",label:"عضو",cls:"bg-slate-100 text-slate-600 border-slate-200"}],Pe={admin:{label:"مدير النظام",cls:"bg-red-100 text-red-700 border-red-200"},head_of_team:{label:"رئيس الفرق",cls:"bg-orange-100 text-orange-700 border-orange-200"},team_lead:{label:"قائد فريق",cls:"bg-blue-100 text-blue-700 border-blue-200"},member:{label:"عضو",cls:"bg-slate-100 text-slate-600 border-slate-200"},dept_manager:{label:"قائد فريق",cls:"bg-blue-100 text-blue-700 border-blue-200"},team_leader:{label:"قائد فريق",cls:"bg-blue-100 text-blue-700 border-blue-200"}};function Ve({role:n}){const p=Pe[n]??{label:n,cls:"bg-slate-100 text-slate-500 border-slate-200"};return e.jsx("span",{className:`px-2 py-0.5 rounded-full text-[10px] font-bold border ${p.cls}`,children:p.label})}function Je(){const[n,p]=t.useState("users"),j=ve(),{toast:l}=fe(),{activeUser:E,token:ie}=ye(),{data:D,isLoading:de}=Ne(),{data:r,isLoading:ce}=we(),{data:g,isLoading:oe}=ke({}),me=Ce(),b=Te(),xe=s=>{me.mutate({id:s},{onSuccess:()=>{j.invalidateQueries({queryKey:_e()}),l({title:"تم تحديث حالة نوع المهمة"})},onError:()=>l({title:"فشل التحديث",variant:"destructive"})})},[v,M]=t.useState(null),[I,q]=t.useState(""),[P,V]=t.useState(""),[he,_]=t.useState(!1),[f,z]=t.useState(""),[y,Q]=t.useState(""),[N,R]=t.useState(""),[w,B]=t.useState(""),[K,W]=t.useState("member"),[L,H]=t.useState(!1),[G,J]=t.useState(!1),ue=s=>{M(s),q(s.team),V(s.role)},pe=()=>{v&&b.mutate({id:v.id,data:{team:I,role:P}},{onSuccess:()=>{j.invalidateQueries({queryKey:F()}),l({title:"تم تحديث بيانات المستخدم"}),M(null)},onError:()=>l({title:"فشل التحديث",variant:"destructive"})})},je=(s,a)=>{const i=a==="admin"?"team_lead":"admin",c=a==="admin"?"سيتم إلغاء صلاحيات الإدارة من هذا المستخدم. هل أنت متأكد؟":"سيتم منح صلاحيات الإدارة الكاملة لهذا المستخدم. هل أنت متأكد؟";window.confirm(c)&&b.mutate({id:s,data:{role:i}},{onSuccess:()=>{j.invalidateQueries({queryKey:F()}),l({title:a==="admin"?"تم إلغاء صلاحيات الإدارة":"تم منح صلاحيات الإدارة"})},onError:()=>l({title:"فشل التحديث",variant:"destructive"})})},ge=async s=>{if(s.preventDefault(),!(!f.trim()||!y.trim()||N.length<8||!w)){J(!0);try{const a=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${ie}`},body:JSON.stringify({name:f,email:y,password:N,team:w,role:K})}),i=await a.json();if(!a.ok)throw new Error(i.error||"حدث خطأ أثناء إضافة الموظف");j.invalidateQueries({queryKey:F()}),l({title:"تم إضافة الموظف بنجاح"}),_(!1),z(""),Q(""),R(""),B(""),W("member"),H(!1)}catch(a){l({title:a.message||"فشل إضافة الموظف",variant:"destructive"})}finally{J(!1)}}},be=!f.trim()||!y.trim()||N.length<8||!w;return e.jsxs("div",{className:"p-8 max-w-6xl mx-auto space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"لوحة الإدارة"}),e.jsx("p",{className:"text-slate-500 mt-1",children:"إدارة المستخدمين والأدوار والتحليلات"})]}),e.jsx("div",{className:"flex gap-1 bg-slate-100 rounded-lg p-1 w-fit",children:qe.map(s=>{const a=s.icon;return e.jsxs("button",{onClick:()=>p(s.id),className:`flex items-center gap-2 px-4 py-2 rounded-md text-sm font-medium transition-colors ${n===s.id?"bg-white text-slate-900 shadow-sm":"text-slate-600 hover:text-slate-900"}`,children:[e.jsx(a,{className:"h-4 w-4"}),s.label]},s.id)})}),n==="users"&&e.jsxs(o,{children:[e.jsx(m,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(x,{children:["جميع المستخدمين (",D?.length??0,")"]}),e.jsx(h,{size:"sm",variant:"default",onClick:()=>_(!0),children:"+ إضافة موظف"})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-amber-600 bg-amber-50 border border-amber-200 rounded-md px-2.5 py-1.5",children:[e.jsx(X,{className:"h-3.5 w-3.5"}),"صلاحية الإدارة — فقط لك كمدير النظام"]})]})}),e.jsx(u,{children:de?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(s=>e.jsx(k,{className:"h-16 w-full"},s))}):e.jsx("div",{className:"space-y-2",children:D?.map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg border hover:bg-slate-50 transition-colors",children:[e.jsx(Ue,{className:"h-10 w-10",children:e.jsx(Ae,{style:{backgroundColor:s.avatarColor,color:"#fff",fontSize:"12px"},children:s.name.substring(0,2)})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:s.name}),e.jsx("p",{className:"text-xs text-slate-400",children:s.email})]}),e.jsx("div",{className:"px-2.5 py-1 rounded-full text-xs font-medium text-white flex-shrink-0",style:{backgroundColor:te(s.team)},children:s.team}),e.jsx(Ve,{role:s.role}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[E?.role==="admin"&&s.id!==E?.id&&e.jsx(h,{variant:s.role==="admin"?"destructive":"outline",size:"sm",className:"text-xs gap-1.5",onClick:()=>je(s.id,s.role),title:s.role==="admin"?"إلغاء صلاحيات الإدارة":"منح صلاحيات الإدارة",children:s.role==="admin"?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{className:"h-3.5 w-3.5"})," إلغاء الإدارة"]}):e.jsxs(e.Fragment,{children:[e.jsx(X,{className:"h-3.5 w-3.5"})," منح إدارة"]})}),e.jsx(h,{variant:"outline",size:"sm",className:"text-xs flex-shrink-0",onClick:()=>ue(s),children:"تعديل"})]})]},s.id))})})]}),n==="analytics"&&e.jsx("div",{className:"space-y-6",children:ce?e.jsxs("div",{className:"space-y-4",children:[e.jsx(k,{className:"h-48 w-full"}),e.jsx(k,{className:"h-64 w-full"})]}):r?e.jsxs(e.Fragment,{children:[e.jsxs(o,{children:[e.jsx(m,{children:e.jsx(x,{children:"المهام هذا الأسبوع مقارنة بالأسبوع الماضي"})}),e.jsxs(u,{children:[e.jsx("div",{className:"flex items-end gap-2 h-40 mt-2",children:r.weekly.map(s=>{const a=Math.max(...r.weekly.flatMap(Z=>[Z.thisWeek,Z.lastWeek]),1),i=Math.round(s.thisWeek/a*100),c=Math.round(s.lastWeek/a*100);return e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[e.jsxs("div",{className:"flex items-end gap-0.5 w-full justify-center h-32",children:[e.jsx("div",{className:"w-4 rounded-t bg-primary/30 transition-all",style:{height:`${c}%`},title:`الأسبوع الماضي: ${s.lastWeek}`}),e.jsx("div",{className:"w-4 rounded-t bg-primary transition-all",style:{height:`${i}%`},title:`هذا الأسبوع: ${s.thisWeek}`})]}),e.jsx("span",{className:"text-xs text-slate-400",children:s.day})]},s.day)})}),e.jsxs("div",{className:"flex items-center gap-4 mt-3 text-xs text-slate-500 justify-center",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-3 h-3 rounded bg-primary/30"})," الأسبوع الماضي"]}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("div",{className:"w-3 h-3 rounded bg-primary"})," هذا الأسبوع"]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[e.jsxs(o,{children:[e.jsx(m,{children:e.jsx(x,{children:"المهام حسب الفريق"})}),e.jsx(u,{children:e.jsx("div",{className:"space-y-3",children:r.byTeam.filter(s=>s.totalTasks>0).map(s=>{const a=Math.max(...r.byTeam.map(c=>c.totalTasks),1),i=Math.round(s.totalTasks/a*100);return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-600 truncate max-w-[160px]",children:s.team}),e.jsx("span",{className:"font-semibold text-slate-800",children:s.totalTasks})]}),e.jsx("div",{className:"w-full bg-slate-100 rounded-full h-1.5",children:e.jsx("div",{className:"h-1.5 rounded-full transition-all",style:{width:`${i}%`,backgroundColor:te(s.team)}})})]},s.team)})})})]}),e.jsxs(o,{children:[e.jsx(m,{children:e.jsx(x,{children:"أكثر 5 عملاء نشاطاً"})}),e.jsx(u,{children:r.topClients.length===0?e.jsx("p",{className:"text-sm text-slate-400 text-center py-8",children:"لا توجد مهام مرتبطة بعملاء بعد"}):e.jsx("div",{className:"space-y-3",children:r.topClients.map((s,a)=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-slate-400 text-sm font-medium w-5 text-center",children:a+1}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:s?.name}),e.jsxs("p",{className:"text-xs text-slate-400",children:[s?.completedTasks," / ",s?.totalTasks," مكتملة"]})]}),e.jsx("div",{className:"w-16 bg-slate-100 rounded-full h-1.5",children:e.jsx("div",{className:"h-1.5 rounded-full bg-primary",style:{width:`${s?.totalTasks?Math.round((s?.completedTasks??0)/s.totalTasks*100):0}%`}})})]},s?.id))})})]})]})]}):null}),n==="taskTypes"&&e.jsxs(o,{children:[e.jsx(m,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs(x,{children:["أنواع المهام (",g?.length??0,")"]}),e.jsx("span",{className:"text-xs text-slate-400",children:"يمكن تفعيل/إيقاف كل نوع"})]})}),e.jsx(u,{children:oe?e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(k,{className:"h-14 w-full"},s))}):g&&g.length>0?e.jsx("div",{className:"space-y-2",children:g.map(s=>e.jsxs("div",{className:"flex items-center gap-4 p-3 rounded-lg border hover:bg-slate-50 transition-colors",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-medium text-sm",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 mt-0.5",children:[e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-blue-100 text-blue-700 font-medium",children:s.fromDeptSlug}),e.jsx("span",{children:"←"}),e.jsx("span",{className:"px-2 py-0.5 rounded-full bg-purple-100 text-purple-700 font-medium",children:s.toDeptSlug})]})]}),e.jsx(Me,{variant:"outline",className:`text-xs cursor-pointer select-none ${s.isActive?"text-green-600 border-green-200 bg-green-50 hover:bg-green-100":"text-slate-400 border-slate-200 bg-slate-50 hover:bg-slate-100"}`,onClick:()=>xe(s.id),children:s.isActive?"نشط":"متوقف"})]},s.id))}):e.jsxs("div",{className:"text-center py-10 text-slate-400",children:[e.jsx(re,{className:"h-10 w-10 mx-auto mb-3 opacity-40"}),e.jsx("p",{className:"text-sm",children:"لا توجد أنواع مهام محددة"})]})})]}),e.jsx(Y,{open:he,onOpenChange:_,children:e.jsxs(ee,{className:"sm:max-w-[425px]",children:[e.jsx(se,{children:e.jsx(ae,{children:"إضافة موظف جديد"})}),e.jsxs("form",{onSubmit:ge,className:"space-y-4 mt-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"name",children:"الاسم الكامل*"}),e.jsx($,{id:"name",value:f,onChange:s=>z(s.target.value),placeholder:"الاسم الكامل",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"email",children:"البريد الإلكتروني*"}),e.jsx($,{id:"email",type:"email",value:y,onChange:s=>Q(s.target.value),placeholder:"example@domain.com",required:!0})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"password",children:"كلمة المرور*"}),e.jsxs("div",{className:"relative",children:[e.jsx($,{id:"password",type:L?"text":"password",value:N,onChange:s=>R(s.target.value),placeholder:"كلمة المرور (8 أحرف على الأقل)",required:!0}),e.jsx("button",{type:"button",onClick:()=>H(!L),className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-800 focus:outline-none",children:L?e.jsx(De,{className:"h-4 w-4"}):e.jsx(Le,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"team",children:"القسم*"}),e.jsxs(C,{value:w,onValueChange:B,children:[e.jsx(T,{id:"team",children:e.jsx(S,{placeholder:"اختر القسم"})}),e.jsx(U,{children:le.map(s=>e.jsx(A,{value:s,children:s},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{htmlFor:"role",children:"الدور"}),e.jsxs(C,{value:K,onValueChange:W,children:[e.jsx(T,{id:"role",children:e.jsx(S,{placeholder:"اختر الدور"})}),e.jsx(U,{children:ne.map(s=>e.jsx(A,{value:s.value,children:s.label},s.value))})]})]}),e.jsx(h,{type:"submit",className:"w-full mt-4",disabled:be||G,children:G?"جاري الإضافة...":"إضافة موظف"})]})]})}),e.jsx(Y,{open:!!v,onOpenChange:s=>{s||M(null)},children:e.jsxs(ee,{children:[e.jsx(se,{children:e.jsxs(ae,{children:["تعديل بيانات: ",v?.name]})}),e.jsxs("div",{className:"space-y-4 mt-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{children:"الفريق"}),e.jsxs(C,{value:I,onValueChange:q,children:[e.jsx(T,{children:e.jsx(S,{})}),e.jsx(U,{children:le.map(s=>e.jsx(A,{value:s,children:s},s))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(d,{children:"الدور"}),e.jsxs(C,{value:P,onValueChange:V,children:[e.jsx(T,{children:e.jsx(S,{})}),e.jsx(U,{children:ne.filter(s=>E?.role==="admin"||s.value!=="admin").map(s=>e.jsx(A,{value:s.value,children:s.label},s.value))})]})]}),e.jsx(h,{onClick:pe,className:"w-full",disabled:b.isPending,children:b.isPending?"جاري الحفظ...":"حفظ التعديلات"})]})]})})]})}export{Je as default};
|
teamtasker/dist/public/assets/alert-dialog-DeZev_w3.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{G as g,a0 as o,a2 as s,a5 as u,x as F,K as G,F as H,v as n,t as A}from"./index-DLB2cbrK.js";import{R as q,b as V,c as D,P as W,W as Y,a as B,T as K,D as J,C as v,O as Q}from"./index-oW74Oi68.js";const U=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],_e=g("calendar",U);const X=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Re=g("loader-circle",X);const Z=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],Ce=g("message-square",Z);const ee=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],je=g("paperclip",ee);var y="AlertDialog",[ae]=H(y,[D]),i=D(),x=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(q,{...r,...t,modal:!0})};x.displayName=y;var te="AlertDialogTrigger",N=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(V,{...l,...r,ref:a})});N.displayName=te;var oe="AlertDialogPortal",h=e=>{const{__scopeAlertDialog:a,...t}=e,r=i(a);return o.jsx(W,{...r,...t})};h.displayName=oe;var re="AlertDialogOverlay",_=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(Q,{...l,...r,ref:a})});_.displayName=re;var c="AlertDialogContent",[se,le]=ae(c),ie=G("AlertDialogContent"),R=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,children:r,...l}=e,m=i(t),p=s.useRef(null),z=u(a,p),f=s.useRef(null);return o.jsx(Y,{contentName:c,titleName:C,docsSlug:"alert-dialog",children:o.jsx(se,{scope:t,cancelRef:f,children:o.jsxs(B,{role:"alertdialog",...m,...l,ref:z,onOpenAutoFocus:F(l.onOpenAutoFocus,d=>{d.preventDefault(),f.current?.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[o.jsx(ie,{children:r}),o.jsx(ce,{contentRef:p})]})})})});R.displayName=c;var C="AlertDialogTitle",j=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(K,{...l,...r,ref:a})});j.displayName=C;var b="AlertDialogDescription",w=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(J,{...l,...r,ref:a})});w.displayName=b;var ne="AlertDialogAction",E=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,l=i(t);return o.jsx(v,{...l,...r,ref:a})});E.displayName=ne;var P="AlertDialogCancel",S=s.forwardRef((e,a)=>{const{__scopeAlertDialog:t,...r}=e,{cancelRef:l}=le(P,t),m=i(t),p=u(a,l);return o.jsx(v,{...m,...r,ref:p})});S.displayName=P;var ce=({contentRef:e})=>{const a=`\`${c}\` requires a description for the component to be accessible for screen reader users.
|
| 2 |
+
|
| 3 |
+
You can add a description to the \`${c}\` by passing a \`${b}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
| 4 |
+
|
| 5 |
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${c}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
| 6 |
+
|
| 7 |
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(a)},[a,e]),null},de=x,pe=N,ge=h,T=_,M=R,O=E,$=S,k=j,I=w;const be=de,we=pe,me=ge,L=s.forwardRef(({className:e,...a},t)=>o.jsx(T,{className:n("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...a,ref:t}));L.displayName=T.displayName;const fe=s.forwardRef(({className:e,...a},t)=>o.jsxs(me,{children:[o.jsx(L,{}),o.jsx(M,{ref:t,className:n("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a})]}));fe.displayName=M.displayName;const ue=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col space-y-2 text-center sm:text-left",e),...a});ue.displayName="AlertDialogHeader";const Ae=({className:e,...a})=>o.jsx("div",{className:n("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...a});Ae.displayName="AlertDialogFooter";const De=s.forwardRef(({className:e,...a},t)=>o.jsx(k,{ref:t,className:n("text-lg font-semibold",e),...a}));De.displayName=k.displayName;const ve=s.forwardRef(({className:e,...a},t)=>o.jsx(I,{ref:t,className:n("text-sm text-muted-foreground",e),...a}));ve.displayName=I.displayName;const ye=s.forwardRef(({className:e,...a},t)=>o.jsx(O,{ref:t,className:n(A(),e),...a}));ye.displayName=O.displayName;const xe=s.forwardRef(({className:e,...a},t)=>o.jsx($,{ref:t,className:n(A({variant:"outline"}),"mt-2 sm:mt-0",e),...a}));xe.displayName=$.displayName;export{be as A,_e as C,Re as L,Ce as M,je as P,ye as a,xe as b,fe as c,ve as d,Ae as e,ue as f,De as g,we as h};
|
teamtasker/dist/public/assets/arrow-left-Byv1MVqW.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as o}from"./index-DLB2cbrK.js";const e=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],r=o("arrow-left",e);export{r as A};
|
teamtasker/dist/public/assets/circle-check-BuBb5ch0.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as c}from"./index-DLB2cbrK.js";const e=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],a=c("activity",e);const t=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],i=c("circle-check",t);export{a as A,i as C};
|
teamtasker/dist/public/assets/client-detail-D5FUNb3z.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a2 as l,a0 as e,o as F,x as T,F as W,y as Se,a5 as ke,a6 as Y,a4 as Fe,n as Ie,v as V,au as Re,av as z,as as Ae,at as Ee,ax as J,ac as De,aB as _e,az as Pe,A as Le,m as D,h as S,C as L,i as $,g as $e,B as K,j as Ke,k as Ge,N as G,_ as Me,a3 as Be}from"./index-DLB2cbrK.js";import{S as R}from"./skeleton-Cni41WG0.js";import{T as Ue}from"./textarea-Cu0xuEdJ.js";import{c as Oe,T as qe}from"./constants-VszDEqUo.js";import{u as X,S as Ve,c as ze,d as Qe,a as He,b as We}from"./select-CVvZTGtn.js";import{a as Z}from"./Combination-Dl0IQ_XO.js";import{A as Ye}from"./arrow-left-Byv1MVqW.js";import{L as M}from"./list-todo-B_SnzIbB.js";import{A as Je,C as Xe}from"./circle-check-BuBb5ch0.js";import{C as Ze}from"./clock-VJgbNp2_.js";import{F as ee}from"./file-text-CsGLBE8z.js";import{T as et}from"./trash-2-CUsOoE-U.js";var B="rovingFocusGroup.onEntryFocus",tt={bubbles:!1,cancelable:!0},A="RovingFocusGroup",[U,te,st]=Se(A),[at,se]=W(A,[st]),[nt,rt]=at(A),ae=l.forwardRef((t,s)=>e.jsx(U.Provider,{scope:t.__scopeRovingFocusGroup,children:e.jsx(U.Slot,{scope:t.__scopeRovingFocusGroup,children:e.jsx(it,{...t,ref:s})})}));ae.displayName=A;var it=l.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:a,orientation:n,loop:u=!1,dir:f,currentTabStopId:d,defaultCurrentTabStopId:v,onCurrentTabStopIdChange:r,onEntryFocus:p,preventScrollOnEntryFocus:o=!1,...x}=t,h=l.useRef(null),c=ke(s,h),g=X(f),[b,m]=Y({prop:d,defaultProp:v??null,onChange:r,caller:A}),[w,I]=l.useState(!1),j=Fe(p),y=te(a),i=l.useRef(!1),[C,E]=l.useState(0);return l.useEffect(()=>{const N=h.current;if(N)return N.addEventListener(B,j),()=>N.removeEventListener(B,j)},[j]),e.jsx(nt,{scope:a,orientation:n,dir:g,loop:u,currentTabStopId:b,onItemFocus:l.useCallback(N=>m(N),[m]),onItemShiftTab:l.useCallback(()=>I(!0),[]),onFocusableItemAdd:l.useCallback(()=>E(N=>N+1),[]),onFocusableItemRemove:l.useCallback(()=>E(N=>N-1),[]),children:e.jsx(F.div,{tabIndex:w||C===0?-1:0,"data-orientation":n,...x,ref:c,style:{outline:"none",...t.style},onMouseDown:T(t.onMouseDown,()=>{i.current=!0}),onFocus:T(t.onFocus,N=>{const ye=!i.current;if(N.target===N.currentTarget&&ye&&!w){const H=new CustomEvent(B,tt);if(N.currentTarget.dispatchEvent(H),!H.defaultPrevented){const P=y().filter(k=>k.focusable),we=P.find(k=>k.active),Te=P.find(k=>k.id===b),Ce=[we,Te,...P].filter(Boolean).map(k=>k.ref.current);ie(Ce,o)}}i.current=!1}),onBlur:T(t.onBlur,()=>I(!1))})})}),ne="RovingFocusGroupItem",re=l.forwardRef((t,s)=>{const{__scopeRovingFocusGroup:a,focusable:n=!0,active:u=!1,tabStopId:f,children:d,...v}=t,r=Z(),p=f||r,o=rt(ne,a),x=o.currentTabStopId===p,h=te(a),{onFocusableItemAdd:c,onFocusableItemRemove:g,currentTabStopId:b}=o;return l.useEffect(()=>{if(n)return c(),()=>g()},[n,c,g]),e.jsx(U.ItemSlot,{scope:a,id:p,focusable:n,active:u,children:e.jsx(F.span,{tabIndex:x?0:-1,"data-orientation":o.orientation,...v,ref:s,onMouseDown:T(t.onMouseDown,m=>{n?o.onItemFocus(p):m.preventDefault()}),onFocus:T(t.onFocus,()=>o.onItemFocus(p)),onKeyDown:T(t.onKeyDown,m=>{if(m.key==="Tab"&&m.shiftKey){o.onItemShiftTab();return}if(m.target!==m.currentTarget)return;const w=ct(m,o.orientation,o.dir);if(w!==void 0){if(m.metaKey||m.ctrlKey||m.altKey||m.shiftKey)return;m.preventDefault();let j=h().filter(y=>y.focusable).map(y=>y.ref.current);if(w==="last")j.reverse();else if(w==="prev"||w==="next"){w==="prev"&&j.reverse();const y=j.indexOf(m.currentTarget);j=o.loop?dt(j,y+1):j.slice(y+1)}setTimeout(()=>ie(j))}}),children:typeof d=="function"?d({isCurrentTabStop:x,hasTabStop:b!=null}):d})})});re.displayName=ne;var ot={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lt(t,s){return s!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function ct(t,s,a){const n=lt(t.key,a);if(!(s==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(s==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return ot[n]}function ie(t,s=!1){const a=document.activeElement;for(const n of t)if(n===a||(n.focus({preventScroll:s}),document.activeElement!==a))return}function dt(t,s){return t.map((a,n)=>t[(s+n)%t.length])}var ut=ae,mt=re,_="Tabs",[xt]=W(_,[se]),oe=se(),[ft,Q]=xt(_),le=l.forwardRef((t,s)=>{const{__scopeTabs:a,value:n,onValueChange:u,defaultValue:f,orientation:d="horizontal",dir:v,activationMode:r="automatic",...p}=t,o=X(v),[x,h]=Y({prop:n,onChange:u,defaultProp:f??"",caller:_});return e.jsx(ft,{scope:a,baseId:Z(),value:x,onValueChange:h,orientation:d,dir:o,activationMode:r,children:e.jsx(F.div,{dir:o,"data-orientation":d,...p,ref:s})})});le.displayName=_;var ce="TabsList",de=l.forwardRef((t,s)=>{const{__scopeTabs:a,loop:n=!0,...u}=t,f=Q(ce,a),d=oe(a);return e.jsx(ut,{asChild:!0,...d,orientation:f.orientation,dir:f.dir,loop:n,children:e.jsx(F.div,{role:"tablist","aria-orientation":f.orientation,...u,ref:s})})});de.displayName=ce;var ue="TabsTrigger",me=l.forwardRef((t,s)=>{const{__scopeTabs:a,value:n,disabled:u=!1,...f}=t,d=Q(ue,a),v=oe(a),r=pe(d.baseId,n),p=he(d.baseId,n),o=n===d.value;return e.jsx(mt,{asChild:!0,...v,focusable:!u,active:o,children:e.jsx(F.button,{type:"button",role:"tab","aria-selected":o,"aria-controls":p,"data-state":o?"active":"inactive","data-disabled":u?"":void 0,disabled:u,id:r,...f,ref:s,onMouseDown:T(t.onMouseDown,x=>{!u&&x.button===0&&x.ctrlKey===!1?d.onValueChange(n):x.preventDefault()}),onKeyDown:T(t.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&d.onValueChange(n)}),onFocus:T(t.onFocus,()=>{const x=d.activationMode!=="manual";!o&&!u&&x&&d.onValueChange(n)})})})});me.displayName=ue;var xe="TabsContent",fe=l.forwardRef((t,s)=>{const{__scopeTabs:a,value:n,forceMount:u,children:f,...d}=t,v=Q(xe,a),r=pe(v.baseId,n),p=he(v.baseId,n),o=n===v.value,x=l.useRef(o);return l.useEffect(()=>{const h=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(h)},[]),e.jsx(Ie,{present:u||o,children:({present:h})=>e.jsx(F.div,{"data-state":o?"active":"inactive","data-orientation":v.orientation,role:"tabpanel","aria-labelledby":r,hidden:!h,id:p,tabIndex:0,...d,ref:s,style:{...t.style,animationDuration:x.current?"0s":void 0},children:h&&f})})});fe.displayName=xe;function pe(t,s){return`${t}-trigger-${s}`}function he(t,s){return`${t}-content-${s}`}var pt=le,ve=de,ge=me,be=fe;const ht=pt,je=l.forwardRef(({className:t,...s},a)=>e.jsx(ve,{ref:a,className:V("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",t),...s}));je.displayName=ve.displayName;const O=l.forwardRef(({className:t,...s},a)=>e.jsx(ge,{ref:a,className:V("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",t),...s}));O.displayName=ge.displayName;const q=l.forwardRef(({className:t,...s},a)=>e.jsx(be,{ref:a,className:V("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...s}));q.displayName=be.displayName;function vt(){const t=localStorage.getItem("teamtasker_token");return t?{Authorization:`Bearer ${t}`}:{}}async function Ne(t,s={}){const a=await fetch(t,{...s,headers:{...vt(),...s.headers}});if(!a.ok){const n=await a.json().catch(()=>({}));throw new Error(n.error||`Request failed: ${a.status}`)}return a.json()}function gt(t){return Re({queryKey:["weeklyReports",t],queryFn:()=>Ne(`/api/clients/${t}/weekly-reports`),enabled:!!t})}function bt(t){const s=z();return Ae({mutationFn:a=>Ne(`/api/clients/${t}/weekly-reports/${a}`,{method:"DELETE"}),onSuccess:()=>{s.invalidateQueries({queryKey:["weeklyReports",t]})}})}const jt=[{value:"all",label:"الكل"},{value:"not_started",label:"لم تبدأ"},{value:"in_progress",label:"قيد التنفيذ"},{value:"completed",label:"مكتملة"}];function Nt(t){try{return new Date(t).toLocaleDateString("ar-EG",{day:"numeric",month:"long",year:"numeric"})}catch{return new Date(t).toLocaleDateString("ar")}}function yt(){const t=localStorage.getItem("teamtasker_token");return t?{Authorization:`Bearer ${t}`}:{}}function wt({clientId:t}){const{toast:s}=J(),{activeUser:a,token:n}=Be(),{data:u=[],isLoading:f}=gt(t),d=bt(t),v=z(),[r,p]=l.useState(!1);async function o(c){if(c.type!=="application/pdf"){s({title:"يُقبل ملف PDF فقط",variant:"destructive"});return}if(c.size>10*1024*1024){s({title:"الحجم الأقصى 10MB",variant:"destructive"});return}p(!0);const g=new FormData;g.append("file",c);try{const b=await fetch(`/api/clients/${t}/weekly-reports`,{method:"POST",headers:{Authorization:`Bearer ${n}`},body:g});if(!b.ok){const m=await b.json().catch(()=>({}));throw new Error(m.error||"Upload failed")}v.invalidateQueries({queryKey:["weekly-reports",t]}),s({title:"تم رفع التقرير بنجاح"})}catch(b){s({title:b.message||"فشل رفع التقرير",variant:"destructive"})}finally{p(!1)}}const x=(c,g)=>{confirm(`هل أنت متأكد من حذف "${g}"؟`)&&d.mutate(c,{onSuccess:()=>s({title:"تم حذف التقرير"}),onError:()=>s({title:"فشل حذف التقرير",variant:"destructive"})})},h=async(c,g)=>{try{const b=await fetch(`/api/clients/${t}/weekly-reports/${c}/download`,{headers:yt()});if(b.ok){const m=await b.json();window.open(m.signedUrl,"_blank")}else window.open(g,"_blank")}catch{window.open(g,"_blank")}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h3",{className:"font-medium text-slate-700 text-sm",children:"التقارير الأسبوعية للعميل"}),e.jsxs("div",{children:[e.jsx(S,{disabled:r,onClick:()=>document.getElementById("report-upload")?.click(),className:"gap-2",children:r?"جارٍ الرفع...":"+ رفع تقرير PDF"}),e.jsx("input",{id:"report-upload",type:"file",accept:".pdf",className:"hidden",onChange:c=>c.target.files?.[0]&&o(c.target.files[0])})]})]}),f?e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{className:"h-14 w-full"}),e.jsx(R,{className:"h-14 w-full"})]}):u.length===0?e.jsxs("div",{className:"text-center py-10 border border-dashed rounded-lg",children:[e.jsx(ee,{className:"h-12 w-12 text-slate-200 mx-auto mb-3"}),e.jsx("p",{className:"text-slate-400 text-sm",children:"لا توجد تقارير أسبوعية بعد"})]}):e.jsx("div",{className:"space-y-2",children:u.map(c=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover:border-primary/30 hover:bg-slate-50/50 transition-all",children:[e.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-red-50 flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"text-lg",children:"📄"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-sm text-slate-700 truncate",children:c.fileName}),e.jsx("p",{className:"text-xs text-slate-400 mt-0.5",children:Nt(c.createdAt)})]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{size:"sm",variant:"outline",onClick:()=>h(c.id,c.fileUrl),className:"text-xs",children:"تحميل"}),a?.role==="admin"&&e.jsx(S,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0 text-red-500 hover:text-red-700 hover:bg-red-50",onClick:()=>x(c.id,c.fileName),disabled:d.isPending,title:"حذف",children:e.jsx(et,{className:"h-4 w-4"})})]})]},c.id))})]})}function $t(){const{id:t}=Ee(),s=parseInt(t||"0"),a=z(),{toast:n}=J(),[u,f]=l.useState("all"),[d,v]=l.useState("tasks"),{data:r,isLoading:p,error:o}=De(s,{query:{enabled:!!s,queryKey:G(s)}}),x=_e(),h=Pe(),[c,g]=l.useState(!1),[b,m]=l.useState(""),w=(i,C)=>{x.mutate({id:i,data:{status:C}},{onSuccess:()=>{a.invalidateQueries({queryKey:G(s)}),a.invalidateQueries({queryKey:Me()}),n({title:"تم تحديث حالة المهمة"})}})};if(o?.status===403)return e.jsx(Le,{});if(p)return e.jsxs("div",{className:"p-8 max-w-5xl mx-auto space-y-6",children:[e.jsx(R,{className:"h-8 w-64"}),e.jsx(R,{className:"h-32 w-full"}),e.jsx(R,{className:"h-64 w-full"})]});if(!r)return e.jsxs("div",{className:"p-8 text-center",children:[e.jsx("p",{className:"text-slate-500",children:"العميل غير موجود"}),e.jsx(D,{href:"/clients",children:e.jsx(S,{className:"mt-4",variant:"outline",children:"العودة إلى العملاء"})})]});const I=()=>{h.mutate({id:s,data:{notes:b}},{onSuccess:()=>{a.invalidateQueries({queryKey:G(s)}),n({title:"تم حفظ بيانات العميل بنجاح"}),g(!1)},onError:()=>n({title:"فشل حفظ البيانات",variant:"destructive"})})},j=r.totalTasks>0?Math.round(r.completedTasks/r.totalTasks*100):0,y=(r.tasks??[]).filter(i=>u==="all"?!0:i.status===u);return e.jsxs("div",{className:"p-8 max-w-5xl mx-auto space-y-6",children:[e.jsxs("div",{children:[e.jsxs(D,{href:"/clients",className:"flex items-center gap-2 text-sm text-slate-500 hover:text-slate-900 transition-colors mb-4",children:[e.jsx(Ye,{className:"h-4 w-4"}),"العودة إلى العملاء"]}),e.jsx(L,{children:e.jsxs($,{className:"p-6",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-xl bg-primary/10 flex items-center justify-center flex-shrink-0",children:e.jsx($e,{className:"h-7 w-7 text-primary"})}),e.jsx("div",{className:"flex-1",children:e.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[e.jsx("h1",{className:"text-2xl font-bold",children:r.name}),e.jsx(K,{variant:r.isActive?"default":"secondary",children:r.isActive?"نشط":"غير نشط"}),r.industry&&e.jsx(K,{variant:"outline",children:r.industry})]})})]}),e.jsxs("div",{className:"grid grid-cols-4 gap-4 mt-6",children:[e.jsxs("div",{className:"bg-slate-50 rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mb-1",children:[e.jsx(M,{className:"h-4 w-4 text-slate-400"}),e.jsx("span",{className:"text-xs text-slate-500",children:"إجمالي"})]}),e.jsx("p",{className:"text-2xl font-bold text-slate-800",children:r.totalTasks})]}),e.jsxs("div",{className:"bg-blue-50 rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mb-1",children:[e.jsx(Je,{className:"h-4 w-4 text-blue-400"}),e.jsx("span",{className:"text-xs text-blue-500",children:"جارية"})]}),e.jsx("p",{className:"text-2xl font-bold text-blue-700",children:r.activeTasks})]}),e.jsxs("div",{className:"bg-green-50 rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mb-1",children:[e.jsx(Xe,{className:"h-4 w-4 text-green-400"}),e.jsx("span",{className:"text-xs text-green-500",children:"مكتملة"})]}),e.jsx("p",{className:"text-2xl font-bold text-green-700",children:r.completedTasks})]}),e.jsxs("div",{className:"bg-purple-50 rounded-lg p-4 text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mb-1",children:[e.jsx(Ze,{className:"h-4 w-4 text-purple-400"}),e.jsx("span",{className:"text-xs text-purple-500",children:"نسبة الإنجاز"})]}),e.jsxs("p",{className:"text-2xl font-bold text-purple-700",children:[j,"%"]})]})]}),r.totalTasks>0&&e.jsx("div",{className:"mt-4",children:e.jsx("div",{className:"w-full bg-slate-100 rounded-full h-2",children:e.jsx("div",{className:"h-2 rounded-full bg-primary transition-all",style:{width:`${j}%`}})})})]})})]}),e.jsxs(L,{children:[e.jsxs(Ke,{className:"flex flex-row items-center justify-between",children:[e.jsx(Ge,{children:"بيانات وإكسيزات العميل"}),c?e.jsxs("div",{className:"flex gap-2",children:[e.jsx(S,{variant:"ghost",size:"sm",onClick:()=>g(!1),children:"إلغاء"}),e.jsx(S,{size:"sm",onClick:I,disabled:h.isPending,children:h.isPending?"جاري الحفظ...":"حفظ"})]}):e.jsx(S,{variant:"outline",size:"sm",onClick:()=>{m(r.notes||""),g(!0)},children:"تعديل البيانات"})]}),e.jsx($,{children:c?e.jsx(Ue,{value:b,onChange:i=>m(i.target.value),placeholder:"اكتب هنا جميع بيانات الوصول، لينكات درايف، والملاحظات الخاصة بالعميل...",className:"min-h-[150px]"}):e.jsx("div",{className:"bg-slate-50 rounded-lg p-4 min-h-[80px] whitespace-pre-wrap text-sm text-slate-700",children:r.notes?r.notes:e.jsx("span",{className:"text-slate-400 italic",children:"لا توجد بيانات مسجلة للعميل حتى الآن..."})})})]}),e.jsx(L,{children:e.jsx($,{className:"p-0",children:e.jsxs(ht,{value:d,onValueChange:v,children:[e.jsx("div",{className:"border-b px-6 pt-4",children:e.jsxs(je,{className:"h-9 bg-transparent p-0 gap-6",children:[e.jsxs(O,{value:"tasks",className:"data-[state=active]:border-b-2 data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none rounded-none pb-3 text-sm font-medium",children:[e.jsx(M,{className:"h-4 w-4 mr-1.5"}),"مهام العميل",e.jsx(K,{variant:"secondary",className:"ml-2 text-[10px] px-1.5 py-0",children:r.tasks?.length??0})]}),e.jsxs(O,{value:"reports",className:"data-[state=active]:border-b-2 data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:shadow-none rounded-none pb-3 text-sm font-medium",children:[e.jsx(ee,{className:"h-4 w-4 mr-1.5"}),"التقارير الأسبوعية"]})]})}),e.jsxs(q,{value:"tasks",className:"p-6 pt-4 mt-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("p",{className:"text-sm text-slate-500",children:["مهام العميل (",r.tasks?.length??0,")"]}),e.jsx("div",{className:"flex items-center gap-2",children:jt.map(i=>e.jsx("button",{onClick:()=>f(i.value),className:`px-3 py-1 rounded-full text-xs font-medium transition-colors ${u===i.value?"bg-primary text-primary-foreground":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:i.label},i.value))})]}),y.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(M,{className:"h-12 w-12 text-slate-200 mx-auto mb-3"}),e.jsxs("p",{className:"text-slate-400",children:["لا توجد مهام ",u!=="all"?"بهذه الحالة":"لهذا العميل"]}),e.jsx(D,{href:"/tasks/new",children:e.jsx(S,{className:"mt-4 gap-2",size:"sm",children:"إنشاء مهمة جديدة"})})]}):e.jsx("div",{className:"space-y-2",children:y.map(i=>e.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border hover:border-primary/30 hover:bg-slate-50/50 transition-all",children:[e.jsx("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx(D,{href:`/tasks/${i.id}`,children:e.jsx("p",{className:"font-medium text-sm hover:text-primary transition-colors truncate",children:i.title})}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400 mt-0.5",children:[e.jsx("span",{children:i.taskType}),e.jsx("span",{children:"•"}),e.jsxs("span",{children:[i.fromTeam," → ",i.assignedTeam]}),i.dueDate&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"•"}),e.jsx("span",{className:new Date(i.dueDate)<new Date&&i.status!=="completed"?"text-red-500":"",children:new Date(i.dueDate).toLocaleDateString("ar")})]})]})]})}),e.jsx("div",{className:"ml-4 flex-shrink-0",children:e.jsxs(Ve,{value:i.status,onValueChange:C=>w(i.id,C),children:[e.jsx(ze,{className:`h-7 text-xs w-36 ${Oe(i.status)}`,children:e.jsx(Qe,{})}),e.jsx(He,{children:Object.entries(qe).map(([C,E])=>e.jsx(We,{value:C,className:"text-xs",children:E},C))})]})})]},i.id))})]}),e.jsx(q,{value:"reports",className:"p-6 pt-4 mt-0",children:e.jsx(wt,{clientId:s})})]})})})]})}export{$t as default};
|
teamtasker/dist/public/assets/clients-Bot2U4TB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G,a2 as n,a5 as D,a6 as V,a0 as e,o as I,x as W,aw as X,F as J,v as L,a3 as Y,av as Z,ax as ee,aj as te,a7 as se,az as ae,as as re,h as b,I as P,g as R,m as ne,E as oe,L as _,T as k}from"./index-DLB2cbrK.js";import{u as ie,t as de,o as ce,s as A}from"./types-DeMiYPlt.js";import{T as le}from"./textarea-Cu0xuEdJ.js";import{S as me}from"./skeleton-Cni41WG0.js";import{b as ue}from"./Combination-Dl0IQ_XO.js";import{D as xe,a as he,b as pe,c as fe}from"./dialog-BuD-yXtG.js";import{P as B}from"./plus-q6nj6w0G.js";import{S as je}from"./search-CJt7VdB4.js";import{T as ge}from"./trash-2-CUsOoE-U.js";import"./index-oW74Oi68.js";const ve=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ye=G("pencil",ve);var E="Switch",[Ne]=J(E),[be,we]=Ne(E),q=n.forwardRef((s,c)=>{const{__scopeSwitch:a,name:r,checked:o,defaultChecked:w,required:x,disabled:h,value:p="on",onCheckedChange:l,form:i,...g}=s,[m,v]=n.useState(null),y=D(c,j=>v(j)),f=n.useRef(!1),S=m?i||!!m.closest("form"):!0,[N,d]=V({prop:o,defaultProp:w??!1,onChange:l,caller:E});return e.jsxs(be,{scope:a,checked:N,disabled:h,children:[e.jsx(I.button,{type:"button",role:"switch","aria-checked":N,"aria-required":x,"data-state":K(N),"data-disabled":h?"":void 0,disabled:h,value:p,...g,ref:y,onClick:W(s.onClick,j=>{d(T=>!T),S&&(f.current=j.isPropagationStopped(),f.current||j.stopPropagation())})}),S&&e.jsx($,{control:m,bubbles:!f.current,name:r,value:p,checked:N,required:x,disabled:h,form:i,style:{transform:"translateX(-100%)"}})]})});q.displayName=E;var z="SwitchThumb",M=n.forwardRef((s,c)=>{const{__scopeSwitch:a,...r}=s,o=we(z,a);return e.jsx(I.span,{"data-state":K(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:c})});M.displayName=z;var Se="SwitchBubbleInput",$=n.forwardRef(({__scopeSwitch:s,control:c,checked:a,bubbles:r=!0,...o},w)=>{const x=n.useRef(null),h=D(x,w),p=ue(a),l=X(c);return n.useEffect(()=>{const i=x.current;if(!i)return;const g=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(g,"checked").set;if(p!==a&&v){const y=new Event("click",{bubbles:r});v.call(i,a),i.dispatchEvent(y)}},[p,a,r]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...o,tabIndex:-1,ref:h,style:{...o.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});$.displayName=Se;function K(s){return s?"checked":"unchecked"}var Q=q,ke=M;const U=n.forwardRef(({className:s,...c},a)=>e.jsx(Q,{className:L("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",s),...c,ref:a,children:e.jsx(ke,{className:L("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));U.displayName=Q.displayName;const Ce=ce({name:A().min(1,"اسم العميل مطلوب"),industry:A().optional(),notes:A().optional()});function qe(){const{activeUser:s,token:c}=Y(),a=Z(),{toast:r}=ee(),[o,w]=n.useState(""),[x,h]=n.useState(""),[p,l]=n.useState(!1);n.useEffect(()=>{const t=setTimeout(()=>{h(o)},300);return()=>clearTimeout(t)},[o]);const[i,g]=n.useState(null),{data:m,isLoading:v}=te({search:x||void 0},{query:{queryKey:k({search:x||void 0})}}),y=se(),f=ae(),S=re({mutationFn:async t=>{const u=await fetch(`/api/clients/${t}`,{method:"DELETE",headers:{"Content-Type":"application/json",Authorization:`Bearer ${c}`}});if(!u.ok){const C=await u.json();throw new Error(C.error||"فشل حذف العميل")}return u.json()}}),N=(t,u)=>{window.confirm(`هل أنت متأكد أنك تريد حذف العميل "${u}"؟`)&&S.mutate(t,{onSuccess:()=>{a.invalidateQueries({queryKey:k()}),r({title:"تم حذف العميل بنجاح"})},onError:C=>{r({title:"فشل حذف العميل",description:C instanceof Error?C.message:"حدث خطأ غير متوقع",variant:"destructive"})}})},d=ie({resolver:de(Ce),defaultValues:{name:"",industry:"",notes:""}}),j=()=>{g(null),d.reset({name:"",industry:"",notes:""}),l(!0)},T=t=>{g(t),d.reset({name:t.name,industry:t.industry??"",notes:t.notes??""}),l(!0)},H=t=>{i?f.mutate({id:i.id,data:{name:t.name,industry:t.industry||void 0,notes:t.notes||void 0}},{onSuccess:()=>{a.invalidateQueries({queryKey:k()}),r({title:"تم تحديث العميل"}),l(!1)},onError:()=>r({title:"فشل تحديث العميل",variant:"destructive"})}):y.mutate({data:{name:t.name,industry:t.industry||void 0,notes:t.notes||void 0,createdByUserId:s?.id}},{onSuccess:()=>{a.invalidateQueries({queryKey:k()}),r({title:"تم إضافة العميل"}),d.reset(),l(!1)},onError:()=>r({title:"فشل إضافة العميل",variant:"destructive"})})},F=(t,u)=>{f.mutate({id:t,data:{isActive:!u}},{onSuccess:()=>{a.invalidateQueries({queryKey:k()}),r({title:u?"تم إيقاف العميل":"تم تفعيل العميل"})},onError:()=>r({title:"فشل تغيير الحالة",variant:"destructive"})})},O=t=>new Date(t).toLocaleDateString("ar-EG",{day:"numeric",month:"short",year:"numeric"});return e.jsxs("div",{className:"p-8 max-w-7xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"العملاء"}),e.jsx("p",{className:"text-muted-foreground mt-1",children:"إدارة عملاء الوكالة وتتبع مهامهم"})]}),(s?.role==="admin"||s?.role==="head_of_team")&&e.jsxs(b,{onClick:j,className:"gap-2",children:[e.jsx(B,{className:"h-4 w-4"}),"إضافة عميل"]})]}),e.jsxs("div",{className:"bg-card border rounded-xl overflow-hidden shadow-sm",children:[e.jsx("div",{className:"p-4 border-b",children:e.jsxs("div",{className:"relative max-w-sm",children:[e.jsx(je,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(P,{placeholder:"بحث عن عميل...",value:o,onChange:t=>w(t.target.value),className:"pr-9"})]})}),v?e.jsx("div",{className:"p-6 space-y-3",children:[1,2,3].map(t=>e.jsx(me,{className:"h-14 w-full"},t))}):m&&m.length>0?e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b bg-muted/30",children:[e.jsx("th",{className:"text-right font-medium text-muted-foreground px-5 py-3",children:"العميل"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"القطاع"}),e.jsx("th",{className:"text-center font-medium text-muted-foreground px-4 py-3",children:"المهام الجارية"}),e.jsx("th",{className:"text-center font-medium text-muted-foreground px-4 py-3",children:"إجمالي المهام"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"تاريخ الإضافة"}),e.jsx("th",{className:"text-right font-medium text-muted-foreground px-4 py-3",children:"الحالة"}),e.jsx("th",{className:"px-4 py-3"})]})}),e.jsx("tbody",{className:"divide-y divide-border",children:m.map(t=>e.jsxs("tr",{className:`hover:bg-muted/20 transition-colors ${t.isActive?"":"opacity-60"}`,children:[e.jsx("td",{className:"px-5 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-9 h-9 rounded-lg bg-muted flex items-center justify-center flex-shrink-0",children:e.jsx(R,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-semibold text-foreground",children:t.name}),t.notes&&e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1 max-w-[200px]",children:t.notes})]})]})}),e.jsx("td",{className:"px-4 py-4",children:t.industry?e.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-md bg-muted text-foreground text-xs font-medium",children:t.industry}):e.jsx("span",{className:"text-muted-foreground text-xs",children:"—"})}),e.jsx("td",{className:"px-4 py-4 text-center",children:e.jsx("span",{className:`inline-flex items-center justify-center w-8 h-8 rounded-full text-sm font-semibold ${t.activeTasks>0?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:t.activeTasks})}),e.jsx("td",{className:"px-4 py-4 text-center",children:e.jsx("span",{className:"text-foreground font-medium",children:t.totalTasks})}),e.jsx("td",{className:"px-4 py-4 text-muted-foreground text-xs whitespace-nowrap",children:O(t.createdAt)}),e.jsx("td",{className:"px-4 py-4",children:e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(U,{checked:t.isActive,disabled:s?.role!=="admin"&&s?.role!=="head_of_team",onCheckedChange:()=>F(t.id,t.isActive),"aria-label":t.isActive?"إيقاف العميل":"تفعيل العميل"})})}),e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex items-center gap-1 justify-end",children:[e.jsx(ne,{href:`/clients/${t.id}`,children:e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",title:"عرض التفاصيل",children:e.jsx(oe,{className:"h-4 w-4"})})}),(s?.role==="admin"||s?.role==="head_of_team")&&e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",title:"تعديل",onClick:()=>T(t),children:e.jsx(ye,{className:"h-4 w-4"})}),s?.role==="admin"&&e.jsx(b,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",title:"حذف",onClick:()=>N(t.id,t.name),disabled:S.isPending,children:e.jsx(ge,{className:"h-4 w-4"})})]})})]},t.id))})]}),e.jsxs("div",{className:"px-5 py-3 border-t bg-muted/10 text-xs text-muted-foreground",children:[m.length," عملاء"]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-24",children:[e.jsx(R,{className:"h-16 w-16 text-muted/40 mb-4"}),e.jsx("h3",{className:"font-semibold text-foreground text-lg",children:"لا يوجد عملاء بعد"}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1 mb-6",children:"أضف أول عميل للوكالة للبدء في تتبع مهامه"}),e.jsxs(b,{onClick:j,className:"gap-2",children:[e.jsx(B,{className:"h-4 w-4"}),"إضافة أول عميل"]})]})]}),e.jsx(xe,{open:p,onOpenChange:l,children:e.jsxs(he,{children:[e.jsx(pe,{children:e.jsx(fe,{children:i?"تعديل العميل":"إضافة عميل جديد"})}),e.jsxs("form",{onSubmit:d.handleSubmit(H),className:"space-y-4 mt-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{children:"اسم العميل *"}),e.jsx(P,{placeholder:"اسم الشركة أو العميل",...d.register("name")}),d.formState.errors.name&&e.jsx("p",{className:"text-sm text-destructive",children:d.formState.errors.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(_,{children:["القطاع ",e.jsx("span",{className:"text-muted-foreground text-xs",children:"(اختياري)"})]}),e.jsx(P,{placeholder:"مثال: عقارات، تقنية، تجزئة...",...d.register("industry")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(_,{children:"ملاحظات"}),e.jsx(le,{placeholder:"معلومات إضافية عن العميل...",rows:3,...d.register("notes")})]}),e.jsx(b,{type:"submit",className:"w-full",disabled:y.isPending||f.isPending,children:i?"حفظ التعديلات":"إضافة العميل"})]})]})})]})}export{qe as default};
|
teamtasker/dist/public/assets/clock-VJgbNp2_.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as c}from"./index-DLB2cbrK.js";const o=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],r=c("clock",o);export{r as C};
|
teamtasker/dist/public/assets/constants-VszDEqUo.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
const t={not_started:"لم يبدأ",in_progress:"قيد التنفيذ",review:"قيد المراجعة",completed:"تم الإنجاز"},a=[{value:"not_started",label:"لم يبدأ"},{value:"in_progress",label:"قيد التنفيذ"},{value:"review",label:"قيد المراجعة"},{value:"completed",label:"تم الإنجاز"}],l=["Account Manager","Creative","SEO Specialist","Media Buying","Social Media","Operation"];function o(e){switch(e){case"not_started":return"text-slate-600 bg-slate-100 border-slate-200";case"in_progress":return"text-blue-700 bg-blue-50 border-blue-200";case"review":return"text-purple-700 bg-purple-50 border-purple-200";case"completed":return"text-green-700 bg-green-50 border-green-200";default:return"text-slate-600 bg-slate-100 border-slate-200"}}function s(e){switch(e){case"urgent":return"border-l-4 border-l-red-500";case"high":return"border-l-4 border-l-orange-400";case"medium":return"border-l-4 border-l-blue-400";case"low":return"border-l-4 border-l-slate-300";default:return"border-l-4 border-l-slate-200"}}function n(e){return{"Account Manager":"#6366f1",Creative:"#ec4899","SEO Specialist":"#06b6d4","Media Buying":"#f97316","Social Media":"#84cc16",Operation:"#a855f7"}[e]||"#94a3b8"}export{t as T,a,l as b,o as c,n as d,s as g};
|
teamtasker/dist/public/assets/dashboard-D1GVWe9-.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as f,a3 as y,ae as w,af as k,aj as C,a0 as e,C as i,j as c,k as n,i as d,m as a,B as T,g as o}from"./index-DLB2cbrK.js";import{S as m}from"./skeleton-Cni41WG0.js";import{T as L,c as S}from"./constants-VszDEqUo.js";import{L as $}from"./list-todo-B_SnzIbB.js";import{E as A}from"./eye-Bc6SRTsB.js";import{C as _,A as j}from"./circle-check-BuBb5ch0.js";import{C as R}from"./clock-VJgbNp2_.js";const D=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],E=f("circle-play",D);function H(){const{activeUser:p}=y(),{data:t,isLoading:u}=w(),{data:x,isLoading:b}=k({limit:10}),{data:l,isLoading:N}=C({}),r=p?.role??"member",h=r==="admin"||r==="head_of_team"||r==="team_lead"||r==="dept_manager",g=[{label:"لم يبدأ",value:t?.notStarted??0,icon:$,color:"text-slate-600",bg:"bg-slate-50",border:"border-slate-200"},{label:"قيد التنفيذ",value:t?.inProgress??0,icon:E,color:"text-blue-600",bg:"bg-blue-50",border:"border-blue-200"},{label:"قيد المراجعة",value:t?.inReview??0,icon:A,color:"text-purple-600",bg:"bg-purple-50",border:"border-purple-200"},{label:"تم الإنجاز",value:t?.completed??0,icon:_,color:"text-green-600",bg:"bg-green-50",border:"border-green-200",sub:t?`${Math.round(t.completionRate)}% نسبة الإنجاز`:void 0}];return e.jsxs("div",{className:"p-8 max-w-7xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"لوحة التحكم"}),e.jsx("p",{className:"text-slate-500",children:"تابع أداء الفريق وآخر المهام"})]}),u?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[1,2,3,4].map(s=>e.jsx(m,{className:"h-32 w-full rounded-xl"},s))}):t?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:g.map(s=>{const v=s.icon;return e.jsxs(i,{className:`border ${s.border}`,children:[e.jsxs(c,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsx(n,{className:"text-sm font-medium text-slate-500",children:s.label}),e.jsx("div",{className:`p-2 rounded-lg ${s.bg}`,children:e.jsx(v,{className:`h-4 w-4 ${s.color}`})})]}),e.jsxs(d,{children:[e.jsx("div",{className:`text-3xl font-bold ${s.color}`,children:s.value}),s.sub&&e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s.sub})]})]},s.label)})}):null,t&&t.overdue>0&&e.jsxs("div",{className:"flex items-center gap-3 bg-red-50 border border-red-200 rounded-lg px-4 py-3",children:[e.jsx(R,{className:"h-5 w-5 text-red-500 flex-shrink-0"}),e.jsxs("p",{className:"text-sm text-red-700 font-medium",children:["لديك ",e.jsx("span",{className:"font-bold",children:t.overdue})," مهمة متأخرة تجاوزت تاريخ التسليم"]}),e.jsx(a,{href:"/tasks",className:"mr-auto text-xs text-red-600 underline hover:text-red-800 font-medium",children:"عرض المهام"})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[e.jsxs(i,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"h-4 w-4 text-slate-400"}),e.jsx(n,{children:"آخر النشاطات"})]})}),e.jsx(d,{children:b?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx(m,{className:"h-14 w-full"},s))}):x&&x.length>0?e.jsx("div",{className:"space-y-4",children:x.map(s=>e.jsxs("div",{className:"flex items-start gap-3 text-sm border-b pb-4 last:border-0 last:pb-0",children:[e.jsx("div",{className:"w-2 h-2 mt-2 rounded-full bg-primary flex-shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx(a,{href:`/tasks/${s.taskId}`,children:e.jsx("p",{className:"font-medium hover:text-primary transition-colors truncate",children:s.taskTitle})}),e.jsxs("p",{className:"text-slate-500 mt-0.5 text-xs",children:[s.fromTeam," \\u2192 ",s.assignedTeam]}),e.jsxs("div",{className:"mt-1.5 flex items-center gap-2 text-xs text-slate-400",children:[e.jsx("span",{children:new Date(s.createdAt).toLocaleDateString("ar")}),e.jsx("span",{children:"\\u2022"}),e.jsx(T,{variant:"outline",className:`text-[10px] font-semibold ${S(s.status)}`,children:L[s.status]||s.status})]})]})]},s.id))}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(j,{className:"h-10 w-10 text-slate-200 mb-3"}),e.jsx("p",{className:"text-slate-400 text-sm",children:"لا توجد نشاطات حديثة"})]})})]}),h&&e.jsxs(i,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{className:"h-4 w-4 text-slate-400"}),e.jsx(n,{children:"ملخص العملاء"})]}),e.jsx(a,{href:"/clients",className:"text-xs text-primary hover:underline",children:"عرض الكل"})]})}),e.jsx(d,{children:N?e.jsx("div",{className:"space-y-3",children:[1,2,3].map(s=>e.jsx(m,{className:"h-10 w-full"},s))}):l&&l.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-4 text-xs text-slate-400 font-medium pb-2 border-b",children:[e.jsx("span",{className:"col-span-2",children:"العميل"}),e.jsx("span",{className:"text-center",children:"المهام النشطة"}),e.jsx("span",{className:"text-center",children:"الإجمالي"})]}),l.filter(s=>s.isActive).slice(0,8).map(s=>e.jsxs("div",{className:"grid grid-cols-4 text-sm py-1.5 border-b last:border-0 hover:bg-slate-50 rounded transition-colors",children:[e.jsxs("div",{className:"col-span-2",children:[e.jsx(a,{href:`/clients/${s.id}`,className:"font-medium hover:text-primary transition-colors",children:s.name}),s.industry&&e.jsx("p",{className:"text-xs text-slate-400",children:s.industry})]}),e.jsx("div",{className:"text-center",children:e.jsx("span",{className:`font-semibold ${s.activeTasks>0?"text-blue-600":"text-slate-400"}`,children:s.activeTasks})}),e.jsx("div",{className:"text-center text-slate-600",children:s.totalTasks})]},s.id)),l.filter(s=>s.isActive).length===0&&e.jsxs("div",{className:"text-center py-8",children:[e.jsx(o,{className:"h-8 w-8 text-slate-200 mx-auto mb-2"}),e.jsx("p",{className:"text-sm text-slate-400",children:"لا يوجد عملاء نشطون بعد"}),e.jsx(a,{href:"/clients",children:e.jsx("button",{className:"text-xs text-primary hover:underline mt-1",children:"إضافة أول عميل"})})]})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center",children:[e.jsx(o,{className:"h-10 w-10 text-slate-200 mb-3"}),e.jsx("p",{className:"text-slate-400 text-sm",children:"لا يوجد عملاء بعد"}),e.jsx(a,{href:"/clients",children:e.jsx("button",{className:"text-xs text-primary hover:underline mt-1",children:"إضافة أول عميل \\u2190"})})]})})]}),!h&&e.jsxs(i,{children:[e.jsx(c,{children:e.jsx(n,{children:"إحصائيات سريعة"})}),e.jsx(d,{children:t&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between text-sm mb-1.5",children:[e.jsx("span",{className:"text-slate-600",children:"نسبة الإنجاز الكلية"}),e.jsxs("span",{className:"font-bold text-green-600",children:[Math.round(t.completionRate),"%"]})]}),e.jsx("div",{className:"w-full bg-slate-100 rounded-full h-2.5",children:e.jsx("div",{className:"h-2.5 rounded-full bg-green-500 transition-all",style:{width:`${t.completionRate}%`}})})]}),e.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{label:"إجمالي المهام",value:t.totalTasks,color:"text-slate-700"},{label:"متأخرة",value:t.overdue,color:t.overdue>0?"text-red-600":"text-slate-400"}].map(s=>e.jsxs("div",{className:"bg-slate-50 rounded-lg p-3 text-center",children:[e.jsx("p",{className:`text-2xl font-bold ${s.color}`,children:s.value}),e.jsx("p",{className:"text-xs text-slate-500 mt-1",children:s.label})]},s.label))})]})})]})]})]})}export{H as default};
|
teamtasker/dist/public/assets/dialog-BuD-yXtG.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a2 as n,a0 as a,X as p,v as o}from"./index-DLB2cbrK.js";import{R as f,b as g,P as x,a as d,C as u,T as i,O as l,D as r}from"./index-oW74Oi68.js";const R=f,v=g,y=x,c=n.forwardRef(({className:t,...e},s)=>a.jsx(l,{ref:s,className:o("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));c.displayName=l.displayName;const N=n.forwardRef(({className:t,children:e,...s},m)=>a.jsxs(y,{children:[a.jsx(c,{}),a.jsxs(d,{ref:m,className:o("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s,children:[e,a.jsxs(u,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[a.jsx(p,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));N.displayName=d.displayName;const D=({className:t,...e})=>a.jsx("div",{className:o("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});D.displayName="DialogHeader";const b=n.forwardRef(({className:t,...e},s)=>a.jsx(i,{ref:s,className:o("text-lg font-semibold leading-none tracking-tight",t),...e}));b.displayName=i.displayName;const j=n.forwardRef(({className:t,...e},s)=>a.jsx(r,{ref:s,className:o("text-sm text-muted-foreground",t),...e}));j.displayName=r.displayName;export{R as D,N as a,D as b,b as c,v as d};
|
teamtasker/dist/public/assets/eye-Bc6SRTsB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as c}from"./index-DLB2cbrK.js";const e=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],r=c("eye",e);export{r as E};
|
teamtasker/dist/public/assets/file-text-CsGLBE8z.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as e}from"./index-DLB2cbrK.js";const t=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],h=e("file-text",t);export{h as F};
|
teamtasker/dist/public/assets/index-DLB2cbrK.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
teamtasker/dist/public/assets/index-DlCrbd5f.css
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
teamtasker/dist/public/assets/index-oW74Oi68.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import{a2 as i,a6 as B,a0 as s,a5 as R,o as p,x as g,n as _,P as H,F as V,z as q,D as z,J}from"./index-DLB2cbrK.js";import{a as C,h as K,R as U,u as Y,F as Z}from"./Combination-Dl0IQ_XO.js";var v="Dialog",[y,le]=V(v),[Q,u]=y(v),N=e=>{const{__scopeDialog:o,children:r,open:a,defaultOpen:n,onOpenChange:t,modal:l=!0}=e,c=i.useRef(null),f=i.useRef(null),[x,m]=B({prop:a,defaultProp:n??!1,onChange:t,caller:v});return s.jsx(Q,{scope:o,triggerRef:c,contentRef:f,contentId:C(),titleId:C(),descriptionId:C(),open:x,onOpenChange:m,onOpenToggle:i.useCallback(()=>m($=>!$),[m]),modal:l,children:r})};N.displayName=v;var O="DialogTrigger",I=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(O,r),t=R(o,n.triggerRef);return s.jsx(p.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":P(n.open),...a,ref:t,onClick:g(e.onClick,n.onOpenToggle)})});I.displayName=O;var h="DialogPortal",[X,A]=y(h,{forceMount:void 0}),T=e=>{const{__scopeDialog:o,forceMount:r,children:a,container:n}=e,t=u(h,o);return s.jsx(X,{scope:o,forceMount:r,children:i.Children.map(a,l=>s.jsx(_,{present:r||t.open,children:s.jsx(H,{asChild:!0,container:n,children:l})}))})};T.displayName=h;var D="DialogOverlay",b=i.forwardRef((e,o)=>{const r=A(D,e.__scopeDialog),{forceMount:a=r.forceMount,...n}=e,t=u(D,e.__scopeDialog);return t.modal?s.jsx(_,{present:a||t.open,children:s.jsx(te,{...n,ref:o})}):null});b.displayName=D;var ee=J("DialogOverlay.RemoveScroll"),te=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(D,r);return s.jsx(U,{as:ee,allowPinchZoom:!0,shards:[n.contentRef],children:s.jsx(p.div,{"data-state":P(n.open),...a,ref:o,style:{pointerEvents:"auto",...a.style}})})}),d="DialogContent",j=i.forwardRef((e,o)=>{const r=A(d,e.__scopeDialog),{forceMount:a=r.forceMount,...n}=e,t=u(d,e.__scopeDialog);return s.jsx(_,{present:a||t.open,children:t.modal?s.jsx(oe,{...n,ref:o}):s.jsx(ne,{...n,ref:o})})});j.displayName=d;var oe=i.forwardRef((e,o)=>{const r=u(d,e.__scopeDialog),a=i.useRef(null),n=R(o,r.contentRef,a);return i.useEffect(()=>{const t=a.current;if(t)return K(t)},[]),s.jsx(M,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,t=>{t.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,t=>{const l=t.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&t.preventDefault()}),onFocusOutside:g(e.onFocusOutside,t=>t.preventDefault())})}),ne=i.forwardRef((e,o)=>{const r=u(d,e.__scopeDialog),a=i.useRef(!1),n=i.useRef(!1);return s.jsx(M,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||r.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,t.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=t.target;r.triggerRef.current?.contains(l)&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&n.current&&t.preventDefault()}})}),M=i.forwardRef((e,o)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:t,...l}=e,c=u(d,r),f=i.useRef(null),x=R(o,f);return Y(),s.jsxs(s.Fragment,{children:[s.jsx(Z,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:t,children:s.jsx(z,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":P(c.open),...l,ref:x,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(re,{titleId:c.titleId}),s.jsx(se,{contentRef:f,descriptionId:c.descriptionId})]})]})}),E="DialogTitle",F=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(E,r);return s.jsx(p.h2,{id:n.titleId,...a,ref:o})});F.displayName=E;var w="DialogDescription",S=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(w,r);return s.jsx(p.p,{id:n.descriptionId,...a,ref:o})});S.displayName=w;var W="DialogClose",k=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(W,r);return s.jsx(p.button,{type:"button",...a,ref:o,onClick:g(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=W;function P(e){return e?"open":"closed"}var G="DialogTitleWarning",[ue,L]=q(G,{contentName:d,titleName:E,docsSlug:"dialog"}),re=({titleId:e})=>{const o=L(G),r=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
|
| 2 |
+
|
| 3 |
+
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
|
| 4 |
+
|
| 5 |
+
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ae="DialogDescriptionWarning",se=({contentRef:e,descriptionId:o})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L(ae).contentName}}.`;return i.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");o&&n&&(document.getElementById(o)||console.warn(a))},[a,e,o]),null},de=N,fe=I,ge=T,pe=b,De=j,ve=F,xe=S,me=k;export{me as C,xe as D,pe as O,ge as P,de as R,ve as T,ue as W,De as a,fe as b,le as c};
|
teamtasker/dist/public/assets/list-todo-B_SnzIbB.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as t}from"./index-DLB2cbrK.js";const o=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],h=t("list-todo",o);export{h as L};
|
teamtasker/dist/public/assets/notifications-DK-qPbHa.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as N,a3 as k,av as y,ax as f,ak as g,W as l,ar as v,aq as b,a0 as e,h as c,C as r,i as n,f as d,m as w,E as C}from"./index-DLB2cbrK.js";import{S as R}from"./skeleton-Cni41WG0.js";const I=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],q=N("check-check",I);function L(a){switch(a){case"task_assigned":return"bg-blue-100 text-blue-600";case"status_changed":return"bg-green-100 text-green-600";case"comment_added":return"bg-purple-100 text-purple-600";default:return"bg-slate-100 text-slate-600"}}function M(){const{activeUser:a}=k(),x=y(),{toast:m}=f(),{data:t,isLoading:o}=g({userId:a?.id||0},{query:{enabled:!!a?.id,queryKey:l({userId:a?.id||0})}}),u=v(),h=b(),j=s=>{u.mutate({id:s},{onSuccess:()=>{x.invalidateQueries({queryKey:l({userId:a?.id||0})})}})},p=()=>{a&&h.mutate({data:{userId:a.id}},{onSuccess:()=>{x.invalidateQueries({queryKey:l({userId:a.id})}),m({title:"تم تحديد جميع الإشعارات كمقروءة"})}})},i=t?.filter(s=>!s.isRead).length||0;return e.jsxs("div",{className:"p-8 max-w-3xl mx-auto space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"الإشعارات"}),e.jsx("p",{className:"text-slate-500 mt-1",children:i>0?`${i} إشعار غير مقروء`:"جميع الإشعارات مقروءة"})]}),i>0&&e.jsxs(c,{variant:"outline",size:"sm",onClick:p,"data-testid":"button-mark-all-read",className:"gap-2",children:[e.jsx(q,{className:"h-4 w-4"}),"تحديد الكل كمقروء"]})]}),a?o?e.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(s=>e.jsx(R,{className:"h-20 w-full"},s))}):t&&t.length>0?e.jsx("div",{className:"space-y-2",children:t.map(s=>e.jsx(r,{"data-testid":`notification-${s.id}`,className:`transition-all ${s.isRead?"opacity-70":"border-primary/30 bg-primary/5"}`,children:e.jsxs(n,{className:"p-4 flex items-start gap-4",children:[e.jsx("div",{className:`w-9 h-9 rounded-full flex items-center justify-center flex-shrink-0 ${L(s.type)}`,children:e.jsx(d,{className:"h-4 w-4"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`text-sm ${s.isRead?"text-slate-600":"font-medium text-slate-900"}`,children:s.message}),e.jsx("p",{className:"text-xs text-slate-400 mt-1",children:new Date(s.createdAt).toLocaleString("ar")})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.taskId&&e.jsx(w,{href:`/tasks/${s.taskId}`,children:e.jsx(c,{variant:"ghost",size:"icon",className:"h-8 w-8 text-slate-400 hover:text-primary",children:e.jsx(C,{className:"h-3.5 w-3.5"})})}),!s.isRead&&e.jsx(c,{variant:"ghost",size:"sm",onClick:()=>j(s.id),className:"text-xs h-8 px-2 text-slate-500","data-testid":`button-mark-read-${s.id}`,children:"قراءة"})]})]})},s.id))}):e.jsx(r,{children:e.jsxs(n,{className:"py-16 text-center",children:[e.jsx(d,{className:"h-12 w-12 text-slate-200 mx-auto mb-4"}),e.jsx("p",{className:"font-medium text-slate-500",children:"لا توجد إشعارات"}),e.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"ستظهر هنا إشعارات المهام الجديدة والتحديثات"})]})}):e.jsx(r,{children:e.jsxs(n,{className:"py-12 text-center",children:[e.jsx(d,{className:"h-12 w-12 text-slate-300 mx-auto mb-3"}),e.jsx("p",{className:"text-slate-500",children:"يرجى اختيار مستخدم لعرض الإشعارات"})]})})]})}export{M as default};
|
teamtasker/dist/public/assets/plus-q6nj6w0G.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as e}from"./index-DLB2cbrK.js";const o=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],t=e("plus",o);export{t as P};
|
teamtasker/dist/public/assets/search-CJt7VdB4.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as c}from"./index-DLB2cbrK.js";const e=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],o=c("search",e);export{o as S};
|
teamtasker/dist/public/assets/select-CVvZTGtn.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as Ie,a2 as o,a6 as be,a0 as r,q as mt,a5 as L,ai as z,o as j,H as Re,y as ht,V as vt,a as gt,x as b,P as xt,a1 as Ee,F as St,a4 as wt,D as yt,J as Ct,l as It,b as Tt,v as G}from"./index-DLB2cbrK.js";import{a as Te,b as Nt,h as bt,u as Pt,R as Rt,F as Et}from"./Combination-Dl0IQ_XO.js";const _t=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],jt=Ie("check",_t);const Mt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],_e=Ie("chevron-down",Mt);const At=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Dt=Ie("chevron-up",At);function Pe(t,[n,e]){return Math.min(e,Math.max(n,t))}var Ot=o.createContext(void 0);function Lt(t){const n=o.useContext(Ot);return t||n||"ltr"}var kt=[" ","Enter","ArrowUp","ArrowDown"],Bt=[" ","Enter"],Q="Select",[ie,de,Vt]=ht(Q),[oe]=St(Q,[Vt,Re]),ue=Re(),[Ht,Y]=oe(Q),[Ft,Ut]=oe(Q),je=t=>{const{__scopeSelect:n,children:e,open:l,defaultOpen:a,onOpenChange:u,value:s,defaultValue:c,onValueChange:i,dir:f,name:g,autoComplete:w,disabled:P,required:T,form:C}=t,d=ue(n),[h,x]=o.useState(null),[m,v]=o.useState(null),[U,M]=o.useState(!1),ne=Lt(f),[R,D]=be({prop:l,defaultProp:a??!1,onChange:u,caller:Q}),[W,X]=be({prop:s,defaultProp:c,onChange:i,caller:Q}),k=o.useRef(null),B=h?C||!!h.closest("form"):!0,[K,V]=o.useState(new Set),H=Array.from(K).map(E=>E.props.value).join(";");return r.jsx(mt,{...d,children:r.jsxs(Ht,{required:T,scope:n,trigger:h,onTriggerChange:x,valueNode:m,onValueNodeChange:v,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Te(),value:W,onValueChange:X,open:R,onOpenChange:D,dir:ne,triggerPointerDownPosRef:k,disabled:P,children:[r.jsx(ie.Provider,{scope:n,children:r.jsx(Ft,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(E=>{V(O=>new Set(O).add(E))},[]),onNativeOptionRemove:o.useCallback(E=>{V(O=>{const F=new Set(O);return F.delete(E),F})},[]),children:e})}),B?r.jsxs(tt,{"aria-hidden":!0,required:T,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:E=>X(E.target.value),disabled:P,form:C,children:[W===void 0?r.jsx("option",{value:""}):null,Array.from(K)]},H):null]})})};je.displayName=Q;var Me="SelectTrigger",Ae=o.forwardRef((t,n)=>{const{__scopeSelect:e,disabled:l=!1,...a}=t,u=ue(e),s=Y(Me,e),c=s.disabled||l,i=L(n,s.onTriggerChange),f=de(e),g=o.useRef("touch"),[w,P,T]=nt(d=>{const h=f().filter(v=>!v.disabled),x=h.find(v=>v.value===s.value),m=rt(h,d,x);m!==void 0&&s.onValueChange(m.value)}),C=d=>{c||(s.onOpenChange(!0),T()),d&&(s.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return r.jsx(gt,{asChild:!0,...u,children:r.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":ot(s.value)?"":void 0,...a,ref:i,onClick:b(a.onClick,d=>{d.currentTarget.focus(),g.current!=="mouse"&&C(d)}),onPointerDown:b(a.onPointerDown,d=>{g.current=d.pointerType;const h=d.target;h.hasPointerCapture(d.pointerId)&&h.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(C(d),d.preventDefault())}),onKeyDown:b(a.onKeyDown,d=>{const h=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&P(d.key),!(h&&d.key===" ")&&kt.includes(d.key)&&(C(),d.preventDefault())})})})});Ae.displayName=Me;var De="SelectValue",Oe=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:l,style:a,children:u,placeholder:s="",...c}=t,i=Y(De,e),{onValueNodeHasChildrenChange:f}=i,g=u!==void 0,w=L(n,i.onValueNodeChange);return z(()=>{f(g)},[f,g]),r.jsx(j.span,{...c,ref:w,style:{pointerEvents:"none"},children:ot(i.value)?r.jsx(r.Fragment,{children:s}):u})});Oe.displayName=De;var Wt="SelectIcon",Le=o.forwardRef((t,n)=>{const{__scopeSelect:e,children:l,...a}=t;return r.jsx(j.span,{"aria-hidden":!0,...a,ref:n,children:l||"▼"})});Le.displayName=Wt;var Kt="SelectPortal",ke=t=>r.jsx(xt,{asChild:!0,...t});ke.displayName=Kt;var ee="SelectContent",Be=o.forwardRef((t,n)=>{const e=Y(ee,t.__scopeSelect),[l,a]=o.useState();if(z(()=>{a(new DocumentFragment)},[]),!e.open){const u=l;return u?Ee.createPortal(r.jsx(Ve,{scope:t.__scopeSelect,children:r.jsx(ie.Slot,{scope:t.__scopeSelect,children:r.jsx("div",{children:t.children})})}),u):null}return r.jsx(He,{...t,ref:n})});Be.displayName=ee;var A=10,[Ve,q]=oe(ee),$t="SelectContentImpl",zt=Ct("SelectContent.RemoveScroll"),He=o.forwardRef((t,n)=>{const{__scopeSelect:e,position:l="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:u,onPointerDownOutside:s,side:c,sideOffset:i,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:P,collisionPadding:T,sticky:C,hideWhenDetached:d,avoidCollisions:h,...x}=t,m=Y(ee,e),[v,U]=o.useState(null),[M,ne]=o.useState(null),R=L(n,p=>U(p)),[D,W]=o.useState(null),[X,k]=o.useState(null),B=de(e),[K,V]=o.useState(!1),H=o.useRef(!1);o.useEffect(()=>{if(v)return bt(v)},[v]),Pt();const E=o.useCallback(p=>{const[I,..._]=B().map(N=>N.ref.current),[S]=_.slice(-1),y=document.activeElement;for(const N of p)if(N===y||(N?.scrollIntoView({block:"nearest"}),N===I&&M&&(M.scrollTop=0),N===S&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==y))return},[B,M]),O=o.useCallback(()=>E([D,v]),[E,D,v]);o.useEffect(()=>{K&&O()},[K,O]);const{onOpenChange:F,triggerPointerDownPosRef:$}=m;o.useEffect(()=>{if(v){let p={x:0,y:0};const I=S=>{p={x:Math.abs(Math.round(S.pageX)-($.current?.x??0)),y:Math.abs(Math.round(S.pageY)-($.current?.y??0))}},_=S=>{p.x<=10&&p.y<=10?S.preventDefault():v.contains(S.target)||F(!1),document.removeEventListener("pointermove",I),$.current=null};return $.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",_,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",_,{capture:!0})}}},[v,F,$]),o.useEffect(()=>{const p=()=>F(!1);return window.addEventListener("blur",p),window.addEventListener("resize",p),()=>{window.removeEventListener("blur",p),window.removeEventListener("resize",p)}},[F]);const[pe,ae]=nt(p=>{const I=B().filter(y=>!y.disabled),_=I.find(y=>y.ref.current===document.activeElement),S=rt(I,p,_);S&&setTimeout(()=>S.ref.current.focus())}),fe=o.useCallback((p,I,_)=>{const S=!H.current&&!_;(m.value!==void 0&&m.value===I||S)&&(W(p),S&&(H.current=!0))},[m.value]),me=o.useCallback(()=>v?.focus(),[v]),te=o.useCallback((p,I,_)=>{const S=!H.current&&!_;(m.value!==void 0&&m.value===I||S)&&k(p)},[m.value]),le=l==="popper"?xe:Fe,re=le===xe?{side:c,sideOffset:i,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:P,collisionPadding:T,sticky:C,hideWhenDetached:d,avoidCollisions:h}:{};return r.jsx(Ve,{scope:e,content:v,viewport:M,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:te,focusSelectedItem:O,selectedItemText:X,position:l,isPositioned:K,searchRef:pe,children:r.jsx(Rt,{as:zt,allowPinchZoom:!0,children:r.jsx(Et,{asChild:!0,trapped:m.open,onMountAutoFocus:p=>{p.preventDefault()},onUnmountAutoFocus:b(a,p=>{m.trigger?.focus({preventScroll:!0}),p.preventDefault()}),children:r.jsx(yt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:u,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:r.jsx(le,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:p=>p.preventDefault(),...x,...re,onPlaced:()=>V(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:b(x.onKeyDown,p=>{const I=p.ctrlKey||p.altKey||p.metaKey;if(p.key==="Tab"&&p.preventDefault(),!I&&p.key.length===1&&ae(p.key),["ArrowUp","ArrowDown","Home","End"].includes(p.key)){let S=B().filter(y=>!y.disabled).map(y=>y.ref.current);if(["ArrowUp","End"].includes(p.key)&&(S=S.slice().reverse()),["ArrowUp","ArrowDown"].includes(p.key)){const y=p.target,N=S.indexOf(y);S=S.slice(N+1)}setTimeout(()=>E(S)),p.preventDefault()}})})})})})})});He.displayName=$t;var Gt="SelectItemAlignedPosition",Fe=o.forwardRef((t,n)=>{const{__scopeSelect:e,onPlaced:l,...a}=t,u=Y(ee,e),s=q(ee,e),[c,i]=o.useState(null),[f,g]=o.useState(null),w=L(n,R=>g(R)),P=de(e),T=o.useRef(!1),C=o.useRef(!0),{viewport:d,selectedItem:h,selectedItemText:x,focusSelectedItem:m}=s,v=o.useCallback(()=>{if(u.trigger&&u.valueNode&&c&&f&&d&&h&&x){const R=u.trigger.getBoundingClientRect(),D=f.getBoundingClientRect(),W=u.valueNode.getBoundingClientRect(),X=x.getBoundingClientRect();if(u.dir!=="rtl"){const y=X.left-D.left,N=W.left-y,Z=R.left-N,J=R.width+Z,he=Math.max(J,D.width),ve=window.innerWidth-A,ge=Pe(N,[A,Math.max(A,ve-he)]);c.style.minWidth=J+"px",c.style.left=ge+"px"}else{const y=D.right-X.right,N=window.innerWidth-W.right-y,Z=window.innerWidth-R.right-N,J=R.width+Z,he=Math.max(J,D.width),ve=window.innerWidth-A,ge=Pe(N,[A,Math.max(A,ve-he)]);c.style.minWidth=J+"px",c.style.right=ge+"px"}const k=P(),B=window.innerHeight-A*2,K=d.scrollHeight,V=window.getComputedStyle(f),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),O=parseInt(V.borderBottomWidth,10),F=parseInt(V.paddingBottom,10),$=H+E+K+F+O,pe=Math.min(h.offsetHeight*5,$),ae=window.getComputedStyle(d),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),te=R.top+R.height/2-A,le=B-te,re=h.offsetHeight/2,p=h.offsetTop+re,I=H+E+p,_=$-I;if(I<=te){const y=k.length>0&&h===k[k.length-1].ref.current;c.style.bottom="0px";const N=f.clientHeight-d.offsetTop-d.offsetHeight,Z=Math.max(le,re+(y?me:0)+N+O),J=I+Z;c.style.height=J+"px"}else{const y=k.length>0&&h===k[0].ref.current;c.style.top="0px";const Z=Math.max(te,H+d.offsetTop+(y?fe:0)+re)+_;c.style.height=Z+"px",d.scrollTop=I-te+d.offsetTop}c.style.margin=`${A}px 0`,c.style.minHeight=pe+"px",c.style.maxHeight=B+"px",l?.(),requestAnimationFrame(()=>T.current=!0)}},[P,u.trigger,u.valueNode,c,f,d,h,x,u.dir,l]);z(()=>v(),[v]);const[U,M]=o.useState();z(()=>{f&&M(window.getComputedStyle(f).zIndex)},[f]);const ne=o.useCallback(R=>{R&&C.current===!0&&(v(),m?.(),C.current=!1)},[v,m]);return r.jsx(qt,{scope:e,contentWrapper:c,shouldExpandOnScrollRef:T,onScrollButtonChange:ne,children:r.jsx("div",{ref:i,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:r.jsx(j.div,{...a,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});Fe.displayName=Gt;var Yt="SelectPopperPosition",xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,align:l="start",collisionPadding:a=A,...u}=t,s=ue(e);return r.jsx(It,{...s,...u,ref:n,align:l,collisionPadding:a,style:{boxSizing:"border-box",...u.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=Yt;var[qt,Ne]=oe(ee,{}),Se="SelectViewport",Ue=o.forwardRef((t,n)=>{const{__scopeSelect:e,nonce:l,...a}=t,u=q(Se,e),s=Ne(Se,e),c=L(n,u.onViewportChange),i=o.useRef(0);return r.jsxs(r.Fragment,{children:[r.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:l}),r.jsx(ie.Slot,{scope:e,children:r.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:b(a.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:P}=s;if(P?.current&&w){const T=Math.abs(i.current-g.scrollTop);if(T>0){const C=window.innerHeight-A*2,d=parseFloat(w.style.minHeight),h=parseFloat(w.style.height),x=Math.max(d,h);if(x<C){const m=x+T,v=Math.min(C,m),U=m-v;w.style.height=v+"px",w.style.bottom==="0px"&&(g.scrollTop=U>0?U:0,w.style.justifyContent="flex-end")}}}i.current=g.scrollTop})})})]})});Ue.displayName=Se;var We="SelectGroup",[Xt,Zt]=oe(We),Jt=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=Te();return r.jsx(Xt,{scope:e,id:a,children:r.jsx(j.div,{role:"group","aria-labelledby":a,...l,ref:n})})});Jt.displayName=We;var Ke="SelectLabel",$e=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=Zt(Ke,e);return r.jsx(j.div,{id:a.id,...l,ref:n})});$e.displayName=Ke;var ce="SelectItem",[Qt,ze]=oe(ce),Ge=o.forwardRef((t,n)=>{const{__scopeSelect:e,value:l,disabled:a=!1,textValue:u,...s}=t,c=Y(ce,e),i=q(ce,e),f=c.value===l,[g,w]=o.useState(u??""),[P,T]=o.useState(!1),C=L(n,m=>i.itemRefCallback?.(m,l,a)),d=Te(),h=o.useRef("touch"),x=()=>{a||(c.onValueChange(l),c.onOpenChange(!1))};if(l==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return r.jsx(Qt,{scope:e,value:l,disabled:a,textId:d,isSelected:f,onItemTextChange:o.useCallback(m=>{w(v=>v||(m?.textContent??"").trim())},[]),children:r.jsx(ie.ItemSlot,{scope:e,value:l,disabled:a,textValue:g,children:r.jsx(j.div,{role:"option","aria-labelledby":d,"data-highlighted":P?"":void 0,"aria-selected":f&&P,"data-state":f?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:C,onFocus:b(s.onFocus,()=>T(!0)),onBlur:b(s.onBlur,()=>T(!1)),onClick:b(s.onClick,()=>{h.current!=="mouse"&&x()}),onPointerUp:b(s.onPointerUp,()=>{h.current==="mouse"&&x()}),onPointerDown:b(s.onPointerDown,m=>{h.current=m.pointerType}),onPointerMove:b(s.onPointerMove,m=>{h.current=m.pointerType,a?i.onItemLeave?.():h.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:b(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&i.onItemLeave?.()}),onKeyDown:b(s.onKeyDown,m=>{i.searchRef?.current!==""&&m.key===" "||(Bt.includes(m.key)&&x(),m.key===" "&&m.preventDefault())})})})})});Ge.displayName=ce;var se="SelectItemText",Ye=o.forwardRef((t,n)=>{const{__scopeSelect:e,className:l,style:a,...u}=t,s=Y(se,e),c=q(se,e),i=ze(se,e),f=Ut(se,e),[g,w]=o.useState(null),P=L(n,x=>w(x),i.onItemTextChange,x=>c.itemTextRefCallback?.(x,i.value,i.disabled)),T=g?.textContent,C=o.useMemo(()=>r.jsx("option",{value:i.value,disabled:i.disabled,children:T},i.value),[i.disabled,i.value,T]),{onNativeOptionAdd:d,onNativeOptionRemove:h}=f;return z(()=>(d(C),()=>h(C)),[d,h,C]),r.jsxs(r.Fragment,{children:[r.jsx(j.span,{id:i.textId,...u,ref:P}),i.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Ee.createPortal(u.children,s.valueNode):null]})});Ye.displayName=se;var qe="SelectItemIndicator",Xe=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t;return ze(qe,e).isSelected?r.jsx(j.span,{"aria-hidden":!0,...l,ref:n}):null});Xe.displayName=qe;var we="SelectScrollUpButton",Ze=o.forwardRef((t,n)=>{const e=q(we,t.__scopeSelect),l=Ne(we,t.__scopeSelect),[a,u]=o.useState(!1),s=L(n,l.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=i.scrollTop>0;u(f)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(Qe,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop-i.offsetHeight)}}):null});Ze.displayName=we;var ye="SelectScrollDownButton",Je=o.forwardRef((t,n)=>{const e=q(ye,t.__scopeSelect),l=Ne(ye,t.__scopeSelect),[a,u]=o.useState(!1),s=L(n,l.onScrollButtonChange);return z(()=>{if(e.viewport&&e.isPositioned){let c=function(){const f=i.scrollHeight-i.clientHeight,g=Math.ceil(i.scrollTop)<f;u(g)};const i=e.viewport;return c(),i.addEventListener("scroll",c),()=>i.removeEventListener("scroll",c)}},[e.viewport,e.isPositioned]),a?r.jsx(Qe,{...t,ref:s,onAutoScroll:()=>{const{viewport:c,selectedItem:i}=e;c&&i&&(c.scrollTop=c.scrollTop+i.offsetHeight)}}):null});Je.displayName=ye;var Qe=o.forwardRef((t,n)=>{const{__scopeSelect:e,onAutoScroll:l,...a}=t,u=q("SelectScrollButton",e),s=o.useRef(null),c=de(e),i=o.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return o.useEffect(()=>()=>i(),[i]),z(()=>{c().find(g=>g.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),r.jsx(j.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:b(a.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(l,50))}),onPointerMove:b(a.onPointerMove,()=>{u.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(l,50))}),onPointerLeave:b(a.onPointerLeave,()=>{i()})})}),eo="SelectSeparator",et=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t;return r.jsx(j.div,{"aria-hidden":!0,...l,ref:n})});et.displayName=eo;var Ce="SelectArrow",to=o.forwardRef((t,n)=>{const{__scopeSelect:e,...l}=t,a=ue(e),u=Y(Ce,e),s=q(Ce,e);return u.open&&s.position==="popper"?r.jsx(Tt,{...a,...l,ref:n}):null});to.displayName=Ce;var oo="SelectBubbleInput",tt=o.forwardRef(({__scopeSelect:t,value:n,...e},l)=>{const a=o.useRef(null),u=L(l,a),s=Nt(n);return o.useEffect(()=>{const c=a.current;if(!c)return;const i=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(i,"value").set;if(s!==n&&g){const w=new Event("change",{bubbles:!0});g.call(c,n),c.dispatchEvent(w)}},[s,n]),r.jsx(j.select,{...e,style:{...vt,...e.style},ref:u,defaultValue:n})});tt.displayName=oo;function ot(t){return t===""||t===void 0}function nt(t){const n=wt(t),e=o.useRef(""),l=o.useRef(0),a=o.useCallback(s=>{const c=e.current+s;n(c),(function i(f){e.current=f,window.clearTimeout(l.current),f!==""&&(l.current=window.setTimeout(()=>i(""),1e3))})(c)},[n]),u=o.useCallback(()=>{e.current="",window.clearTimeout(l.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(l.current),[]),[e,a,u]}function rt(t,n,e){const a=n.length>1&&Array.from(n).every(f=>f===n[0])?n[0]:n,u=e?t.indexOf(e):-1;let s=no(t,Math.max(u,0));a.length===1&&(s=s.filter(f=>f!==e));const i=s.find(f=>f.textValue.toLowerCase().startsWith(a.toLowerCase()));return i!==e?i:void 0}function no(t,n){return t.map((e,l)=>t[(n+l)%t.length])}var ro=je,st=Ae,so=Oe,ao=Le,lo=ke,at=Be,co=Ue,lt=$e,ct=Ge,io=Ye,uo=Xe,it=Ze,dt=Je,ut=et;const So=ro,wo=so,po=o.forwardRef(({className:t,children:n,...e},l)=>r.jsxs(st,{ref:l,className:G("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...e,children:[n,r.jsx(ao,{asChild:!0,children:r.jsx(_e,{className:"h-4 w-4 opacity-50"})})]}));po.displayName=st.displayName;const pt=o.forwardRef(({className:t,...n},e)=>r.jsx(it,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(Dt,{className:"h-4 w-4"})}));pt.displayName=it.displayName;const ft=o.forwardRef(({className:t,...n},e)=>r.jsx(dt,{ref:e,className:G("flex cursor-default items-center justify-center py-1",t),...n,children:r.jsx(_e,{className:"h-4 w-4"})}));ft.displayName=dt.displayName;const fo=o.forwardRef(({className:t,children:n,position:e="popper",...l},a)=>r.jsx(lo,{children:r.jsxs(at,{ref:a,className:G("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...l,children:[r.jsx(pt,{}),r.jsx(co,{className:G("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),r.jsx(ft,{})]})}));fo.displayName=at.displayName;const mo=o.forwardRef(({className:t,...n},e)=>r.jsx(lt,{ref:e,className:G("px-2 py-1.5 text-sm font-semibold",t),...n}));mo.displayName=lt.displayName;const ho=o.forwardRef(({className:t,children:n,...e},l)=>r.jsxs(ct,{ref:l,className:G("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...e,children:[r.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:r.jsx(uo,{children:r.jsx(jt,{className:"h-4 w-4"})})}),r.jsx(io,{children:n})]}));ho.displayName=ct.displayName;const vo=o.forwardRef(({className:t,...n},e)=>r.jsx(ut,{ref:e,className:G("-mx-1 my-1 h-px bg-muted",t),...n}));vo.displayName=ut.displayName;export{jt as C,So as S,fo as a,ho as b,po as c,wo as d,Lt as u};
|
teamtasker/dist/public/assets/skeleton-Cni41WG0.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a0 as r,v as s}from"./index-DLB2cbrK.js";function t({className:a,...e}){return r.jsx("div",{className:s("animate-pulse rounded-md bg-primary/10",a),...e})}export{t as S};
|
teamtasker/dist/public/assets/task-detail-D9tjIR4o.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as se,at as ae,ap as te,a3 as G,av as O,ax as V,a2 as k,ag as re,al as le,aB as ne,aA as ie,ao as ce,a9 as de,ab as oe,a0 as e,A as xe,m as Q,h as j,B as me,C as p,j as N,k as v,i as y,d as D,e as U,s as $,Q as _,_ as K,O as he,Y as q,au as ue}from"./index-DLB2cbrK.js";import{T as fe,c as je,a as ge}from"./constants-VszDEqUo.js";import{T as pe}from"./textarea-Cu0xuEdJ.js";import{S as w}from"./skeleton-Cni41WG0.js";import{S as E,c as B,d as I,a as z,b as L}from"./select-CVvZTGtn.js";import{A as Ne,h as ve,c as ye,f as we,g as be,d as ke,e as Se,b as Te,a as Ce,M as Ae,C as F,P,L as H}from"./alert-dialog-DeZev_w3.js";import{A as De}from"./arrow-left-Byv1MVqW.js";import{T as W}from"./trash-2-CUsOoE-U.js";import{F as Ue}from"./file-text-CsGLBE8z.js";import"./Combination-Dl0IQ_XO.js";import"./index-oW74Oi68.js";const _e=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Ke=se("download",_e);function qe(n){if(n===null||n===0)return"0 B";const x=1024,l=["B","KB","MB","GB"],a=Math.floor(Math.log(n)/Math.log(x));return parseFloat((n/Math.pow(x,a)).toFixed(1))+" "+l[a]}function Le(n){const x=Date.now()-new Date(n).getTime(),l=Math.floor(x/1e3),a=Math.floor(l/60),i=Math.floor(a/60),c=Math.floor(i/24),d=Math.floor(c/7),h=Math.floor(c/30);return l<60?"الآن":a<60?`منذ ${a} دقيقة`:i<24?`منذ ${i} ساعة`:c===1?"منذ يوم":c<7?`منذ ${c} أيام`:d===1?"منذ أسبوع":d<4?`منذ ${d} أسابيع`:h===1?"منذ شهر":`منذ ${h} أشهر`}function Me(n,x,l){const a=n?.startsWith("image/")||/\.(jpg|jpeg|png|gif|webp)$/i.test(l),i=n==="application/pdf"||/\.pdf$/i.test(l),c=n?.includes("word")||/\.(doc|docx)$/i.test(l),d=n?.includes("excel")||n?.includes("spreadsheet")||/\.(xls|xlsx)$/i.test(l);return a?e.jsx("img",{src:x,alt:l,className:"w-9 h-9 rounded-lg object-cover border border-slate-200",onError:h=>{h.target.style.display="none"}}):i?e.jsx("div",{className:"w-9 h-9 rounded-lg bg-red-50 flex items-center justify-center text-base",children:"📄"}):c?e.jsx("div",{className:"w-9 h-9 rounded-lg bg-blue-50 flex items-center justify-center text-base",children:"📝"}):d?e.jsx("div",{className:"w-9 h-9 rounded-lg bg-green-50 flex items-center justify-center text-base",children:"📊"}):e.jsx("div",{className:"w-9 h-9 rounded-lg bg-slate-100 flex items-center justify-center",children:e.jsx(Ue,{className:"h-5 w-5 text-slate-400"})})}function R(){const n=localStorage.getItem("teamtasker_token");return n?{Authorization:`Bearer ${n}`}:{}}const M=n=>["taskAttachments",n];function Qe({taskId:n}){const{activeUser:x}=G(),{toast:l}=V(),a=O(),i=k.useRef(null),[c,d]=k.useState(!1),[h,s]=k.useState(null),{data:g=[],isLoading:S}=ue({queryKey:M(n),queryFn:async()=>{const t=await fetch(`/api/tasks/${n}/attachments`,{headers:R()});if(!t.ok){const m=await t.json().catch(()=>({}));throw new Error(m.error||"فشل في جلب المرفقات")}return t.json()},enabled:!!n}),u=async t=>{const m=t.target.files?.[0];if(m){t.target.value="",d(!0);try{const o=new FormData;o.append("file",m);const f=localStorage.getItem("teamtasker_token"),b=await fetch(`/api/tasks/${n}/attachments`,{method:"POST",body:o,headers:f?{Authorization:`Bearer ${f}`}:{}});if(!b.ok){const A=await b.json().catch(()=>({}));throw new Error(A.error||"فشل رفع الملف")}await a.invalidateQueries({queryKey:M(n)}),l({title:"تم رفع الملف بنجاح ✅"})}catch(o){const f=o instanceof Error?o.message:"حدث خطأ أثناء رفع الملف";l({title:f,variant:"destructive"})}finally{d(!1)}}},T=async t=>{s(t.id);try{const m=await fetch(`/api/tasks/${n}/attachments/${t.id}`,{method:"DELETE",headers:R()});if(!m.ok){const o=await m.json().catch(()=>({}));throw new Error(o.error||"فشل حذف المرفق")}await a.invalidateQueries({queryKey:M(n)}),l({title:"تم حذف المرفق"})}catch(m){const o=m instanceof Error?m.message:"حدث خطأ أثناء الحذف";l({title:o,variant:"destructive"})}finally{s(null)}},C=t=>x?x.role==="admin"||x.id===t.uploadedByUserId:!1;return e.jsxs(p,{children:[e.jsx(N,{children:e.jsxs(v,{className:"text-sm font-medium text-slate-500 flex items-center gap-2",children:[e.jsx(P,{className:"h-4 w-4"}),"المرفقات (",g.length,")"]})}),e.jsxs(y,{className:"space-y-3",children:[S?e.jsx("div",{className:"space-y-2",children:[1,2].map(t=>e.jsx(w,{className:"h-12 w-full"},t))}):g.length===0?e.jsx("p",{className:"text-sm text-slate-400 text-center py-4",children:"لا توجد مرفقات بعد"}):e.jsx("div",{className:"space-y-2",children:g.map(t=>e.jsxs("div",{className:"flex items-center gap-3 p-2.5 rounded-lg border hover:bg-slate-50 transition-colors group",children:[e.jsx("div",{className:"flex-shrink-0",children:Me(t.mimeType,t.fileUrl,t.fileName)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("a",{href:t.fileUrl,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium hover:text-primary transition-colors truncate block",children:t.fileName}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400 mt-0.5",children:[e.jsx("span",{children:qe(t.fileSize)}),e.jsx("span",{children:"•"}),e.jsx("span",{children:t.uploadedByUser?.name??"مجهول"}),e.jsx("span",{children:"•"}),e.jsx("span",{children:Le(t.createdAt)})]})]}),e.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity flex-shrink-0",children:[e.jsx("a",{href:t.fileUrl,target:"_blank",rel:"noopener noreferrer",children:e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7",title:"فتح الملف",children:e.jsx(Ke,{className:"h-3.5 w-3.5"})})}),C(t)&&e.jsx(j,{variant:"ghost",size:"icon",className:"h-7 w-7 text-red-500 hover:text-red-700 hover:bg-red-50",title:"حذف المرفق",disabled:h===t.id,onClick:()=>T(t),children:h===t.id?e.jsx(H,{className:"h-3.5 w-3.5 animate-spin"}):e.jsx(W,{className:"h-3.5 w-3.5"})})]})]},t.id))}),e.jsxs("div",{className:"pt-2 border-t",children:[e.jsx("input",{ref:i,type:"file",accept:".jpg,.jpeg,.png,.gif,.webp,.pdf,.doc,.docx,.xls,.xlsx",className:"hidden",onChange:u,disabled:c}),e.jsx(j,{variant:"outline",size:"sm",className:"gap-2 text-slate-600",onClick:()=>i.current?.click(),disabled:c,children:c?e.jsxs(e.Fragment,{children:[e.jsx(H,{className:"h-4 w-4 animate-spin"}),"جارٍ الرفع..."]}):e.jsxs(e.Fragment,{children:[e.jsx(P,{className:"h-4 w-4"}),"📎 إرفاق ملف"]})})]})]})]})}function Ve(){const{id:n}=ae(),[,x]=te(),l=parseInt(n||"0"),{activeUser:a}=G(),i=O(),{toast:c}=V(),[d,h]=k.useState(""),{data:s,isLoading:g,error:S}=re(l,{query:{enabled:!!l,queryKey:_(l)}}),{data:u,isLoading:T}=le(l,{query:{enabled:!!l,queryKey:q(l)}}),C=ne(),t=ie(),{data:m}=ce(),o=de(),f=oe(),b=r=>{C.mutate({id:l,data:{status:r,changedByUserId:a?.id}},{onSuccess:()=>{i.invalidateQueries({queryKey:_(l)}),i.invalidateQueries({queryKey:K()}),i.invalidateQueries({queryKey:he()}),i.invalidateQueries({queryKey:q(l)}),c({title:"تم تحديث حالة المهمة"})}})},A=()=>{d.trim()&&o.mutate({id:l,data:{content:d,userId:a?.id}},{onSuccess:()=>{i.invalidateQueries({queryKey:q(l)}),h(""),c({title:"تم إضافة التعليق"})}})},Y=()=>{f.mutate({id:l},{onSuccess:()=>{i.invalidateQueries({queryKey:K()}),c({title:"تم حذف المهمة"}),x("/tasks")}})};if(S?.status===403)return e.jsx(xe,{});if(g)return e.jsxs("div",{className:"p-8 max-w-4xl mx-auto space-y-6",children:[e.jsx(w,{className:"h-8 w-64"}),e.jsx(w,{className:"h-48 w-full"}),e.jsx(w,{className:"h-32 w-full"})]});if(!s)return e.jsxs("div",{className:"p-8 text-center",children:[e.jsx("p",{className:"text-slate-500",children:"المهمة غير موجودة"}),e.jsx(Q,{href:"/tasks",children:e.jsx(j,{className:"mt-4",variant:"outline",children:"العودة إلى المهام"})})]});const J=a?.role==="admin"||a?.role==="head_of_team"||a?.role==="team_lead"&&s.assignedTeam===a.team,X=m?.filter(r=>r.team===s.assignedTeam)??[],Z=r=>{const ee=r==="__none__"?null:parseInt(r);t.mutate({id:s.id,data:{assignedUserId:ee}},{onSuccess:()=>{i.invalidateQueries({queryKey:_(s.id)}),i.invalidateQueries({queryKey:K()}),c({title:"تم تعيين المهمة بنجاح"})},onError:()=>c({title:"فشل تعيين المهمة",variant:"destructive"})})};return e.jsxs("div",{className:"p-8 max-w-4xl mx-auto space-y-6",children:[e.jsxs("div",{children:[e.jsxs(Q,{href:"/tasks",className:"flex items-center gap-2 text-sm text-slate-500 hover:text-slate-900 transition-colors mb-4",children:[e.jsx(De,{className:"h-4 w-4"}),"العودة إلى المهام"]}),e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:s.title}),e.jsxs("div",{className:"flex items-center gap-3 mt-2",children:[e.jsx(me,{variant:"outline",className:je(s.status),children:fe[s.status]||s.status}),e.jsx("span",{className:"text-sm text-slate-500 bg-slate-100 px-2 py-0.5 rounded",children:s.taskType})]})]}),(a?.role==="admin"||a?.role==="head_of_team"||a?.role==="team_lead"&&(s.assignedTeam===a.team||s.fromTeam===a.team))&&e.jsxs(Ne,{children:[e.jsx(ve,{asChild:!0,children:e.jsx(j,{variant:"ghost",size:"icon",className:"text-slate-400 hover:text-red-600","data-testid":"button-delete-task",children:e.jsx(W,{className:"h-4 w-4"})})}),e.jsxs(ye,{children:[e.jsxs(we,{children:[e.jsx(be,{children:"حذف المهمة"}),e.jsx(ke,{children:"هل أنت متأكد من حذف هذه المهمة؟ لا يمكن التراجع عن هذا الإجراء."})]}),e.jsxs(Se,{children:[e.jsx(Te,{children:"إلغاء"}),e.jsx(Ce,{onClick:Y,className:"bg-red-600 hover:bg-red-700",children:"حذف"})]})]})]})]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[e.jsxs("div",{className:"col-span-2 space-y-6",children:[s.description&&e.jsxs(p,{children:[e.jsx(N,{children:e.jsx(v,{className:"text-sm font-medium text-slate-500",children:"الوصف"})}),e.jsx(y,{children:e.jsx("p",{className:"text-sm leading-relaxed",children:s.description})})]}),e.jsxs(p,{children:[e.jsx(N,{children:e.jsxs(v,{className:"text-sm font-medium text-slate-500 flex items-center gap-2",children:[e.jsx(Ae,{className:"h-4 w-4"}),"التعليقات والملاحظات (",u?.length||0,")"]})}),e.jsxs(y,{className:"space-y-4",children:[T?e.jsx("div",{className:"space-y-3",children:[1,2].map(r=>e.jsx(w,{className:"h-16 w-full"},r))}):u&&u.length>0?e.jsx("div",{className:"space-y-4",children:u.map(r=>r.isSystem?e.jsxs("div",{className:"flex items-center gap-3 py-1","data-testid":`comment-${r.id}`,children:[e.jsx("div",{className:"flex-1 h-px bg-slate-200"}),e.jsx("span",{className:"text-xs text-slate-400 whitespace-nowrap flex-shrink-0 px-2 py-0.5 bg-slate-100 rounded-full",children:r.content}),e.jsx("div",{className:"flex-1 h-px bg-slate-200"})]},r.id):e.jsxs("div",{className:"flex gap-3","data-testid":`comment-${r.id}`,children:[e.jsx(D,{className:"h-8 w-8 flex-shrink-0",children:e.jsx(U,{style:{backgroundColor:r.user?.avatarColor||"#94a3b8",color:"#fff",fontSize:"11px"},children:r.user?.name?.substring(0,2)||"؟"})}),e.jsxs("div",{className:"flex-1 bg-slate-50 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-sm font-medium",children:r.user?.name||"مستخدم مجهول"}),e.jsx("span",{className:"text-xs text-slate-400",children:new Date(r.createdAt).toLocaleString("ar")})]}),e.jsx("p",{className:"text-sm text-slate-700",children:r.content})]})]},r.id))}):e.jsx("p",{className:"text-sm text-slate-400 text-center py-4",children:"لا توجد تعليقات بعد"}),e.jsxs("div",{className:"pt-4 border-t space-y-3",children:[e.jsx(pe,{placeholder:"أضف تعليقاً أو سؤالاً...",value:d,onChange:r=>h(r.target.value),rows:3,"data-testid":"input-comment"}),e.jsx(j,{onClick:A,disabled:!d.trim()||o.isPending,"data-testid":"button-add-comment",size:"sm",children:o.isPending?"جاري الإرسال...":"إضافة تعليق"})]})]})]}),e.jsx(Qe,{taskId:l})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs(p,{children:[e.jsx(N,{children:e.jsx(v,{className:"text-sm font-medium text-slate-500",children:"تحديث الحالة"})}),e.jsx(y,{children:e.jsxs(E,{value:s.status,onValueChange:b,disabled:a?.role!=="admin"&&a?.role!=="head_of_team"&&!(a?.role==="team_lead"&&(s.assignedTeam===a.team||s.fromTeam===a.team))&&!(a?.role==="member"&&(s.assignedUser?.id===a.id||s.createdByUserId===a.id)),children:[e.jsx(B,{"data-testid":"select-task-status",children:e.jsx(I,{})}),e.jsx(z,{children:ge.map(r=>e.jsx(L,{value:r.value,children:r.label},r.value))})]})})]}),e.jsxs(p,{children:[e.jsx(N,{children:e.jsx(v,{className:"text-sm font-medium text-slate-500",children:"التفاصيل"})}),e.jsxs(y,{className:"space-y-4 text-sm",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx($,{className:"h-4 w-4 text-slate-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"من (المرسل)"}),e.jsx("p",{className:"font-medium",children:s.createdByUser?.name||s.fromTeam})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx($,{className:"h-4 w-4 text-slate-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"إلى فريق"}),e.jsx("p",{className:"font-medium",children:s.assignedTeam})]})]}),J?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(D,{className:"h-6 w-6",children:e.jsx(U,{style:{backgroundColor:s.assignedUser?s.assignedUser?.avatarColor||"#94a3b8":"#e2e8f0",color:s.assignedUser?"#fff":"#94a3b8",fontSize:"10px"},children:s.assignedUser?s.assignedUser.name.substring(0,2):"؟"})}),e.jsxs("div",{className:"flex-1 max-w-[200px]",children:[e.jsxs("p",{className:"text-xs text-slate-400 mb-1",children:["تعيين إلى عضو (",s.assignedTeam,")"]}),e.jsxs(E,{value:s.assignedUserId?String(s.assignedUserId):"__none__",onValueChange:Z,children:[e.jsx(B,{className:"h-8 text-xs",children:e.jsx(I,{placeholder:"بدون تعيين"})}),e.jsxs(z,{children:[e.jsx(L,{value:"__none__",children:"بدون تعيين"}),X.map(r=>e.jsx(L,{value:String(r.id),children:r.name},r.id))]})]})]})]}):s.assignedUser?e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(D,{className:"h-6 w-6",children:e.jsx(U,{style:{backgroundColor:s.assignedUser?.avatarColor||"#94a3b8",color:"#fff",fontSize:"10px"},children:s.assignedUser.name.substring(0,2)})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"مُعيَّن إلى"}),e.jsx("p",{className:"font-medium",children:s.assignedUser.name})]})]}):null,s.dueDate&&e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(F,{className:"h-4 w-4 text-slate-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"تاريخ التسليم"}),e.jsx("p",{className:`font-medium ${new Date(s.dueDate)<new Date&&s.status!=="completed"?"text-red-600":""}`,children:new Date(s.dueDate).toLocaleDateString("ar")})]})]}),e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(F,{className:"h-4 w-4 text-slate-400 mt-0.5 flex-shrink-0"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"تاريخ الإنشاء"}),e.jsx("p",{className:"text-slate-600",children:new Date(s.createdAt).toLocaleDateString("ar")})]})]})]})]})]})]})]})}export{Ve as default};
|
teamtasker/dist/public/assets/task-new-BR5dj2Yc.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{ap as z,a3 as J,ao as W,aj as X,av as Y,a8 as Z,ax as ee,a2 as l,a0 as e,m as se,s as te,c as k,C as w,j as S,k as T,i as I,L as r,h as m,I as _,_ as ae}from"./index-DLB2cbrK.js";import{b as le,d as ie}from"./constants-VszDEqUo.js";import{T as re}from"./textarea-Cu0xuEdJ.js";import{C as h,S as ne,c as ce,d as de,a as oe,b as U}from"./select-CVvZTGtn.js";import{A as D}from"./arrow-left-Byv1MVqW.js";import{F as xe}from"./file-text-CsGLBE8z.js";import{C as me}from"./clock-VJgbNp2_.js";import"./Combination-Dl0IQ_XO.js";const F=[{id:1,label:"من وإلى؟",icon:te},{id:2,label:"ما هي المهمة؟",icon:xe},{id:3,label:"تاريخ التسليم",icon:me}];function ye(){const[,b]=z(),{activeUser:t}=J(),{data:N}=W(),{data:f}=X({}),E=Y(),v=Z(),{toast:u}=ee(),[c,j]=l.useState(1),[d,R]=l.useState(""),[p,he]=l.useState(t?.team||""),[a,$]=l.useState(""),[o,P]=l.useState(""),[x,Q]=l.useState(""),[y,q]=l.useState(""),[i,C]=l.useState(""),[g,B]=l.useState(""),L=N?.filter(s=>s.team===a)??[],G=!!p&&!!a,K=!!o.trim()&&!!x.trim(),V=()=>{if(!t){u({title:"يرجى تسجيل الدخول أولاً",variant:"destructive"});return}if(!x.trim()||!o.trim()||!p||!a){u({title:"يرجى إكمال جميع الحقول المطلوبة",variant:"destructive"});return}v.mutate({data:{title:x.trim(),description:y||void 0,taskType:o.trim(),fromTeam:p,assignedTeam:a,priority:"medium",createdByUserId:t.id,assignedUserId:i?parseInt(i):void 0,dueDate:g||void 0,clientId:d?parseInt(d):void 0}},{onSuccess:s=>{E.invalidateQueries({queryKey:ae()}),u({title:"تم إنشاء المهمة بنجاح"}),b(`/tasks/${s.id}`)},onError:()=>{u({title:"فشل إنشاء المهمة",variant:"destructive"})}})};return e.jsxs("div",{className:"p-8 max-w-2xl mx-auto",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs(se,{href:"/tasks",className:"flex items-center gap-2 text-sm text-slate-500 hover:text-slate-900 transition-colors mb-4",children:[e.jsx(D,{className:"h-4 w-4"}),"العودة إلى المهام"]}),e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"مهمة جديدة"}),e.jsx("p",{className:"text-slate-500 mt-1",children:"إنشاء مهمة وإرسالها إلى الفريق المناسب"})]}),e.jsx("div",{className:"flex items-center gap-2 mb-8",children:F.map((s,H)=>{const M=s.icon,O=c===s.id,A=c>s.id;return e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 rounded-lg flex-1 transition-all ${O?"bg-primary text-primary-foreground shadow-sm":A?"bg-green-100 text-green-700":"bg-slate-100 text-slate-400"}`,children:[A?e.jsx(h,{className:"h-4 w-4 flex-shrink-0"}):e.jsx(M,{className:"h-4 w-4 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-medium truncate",children:s.label})]}),H<F.length-1&&e.jsx(k,{className:"h-4 w-4 text-slate-300 flex-shrink-0"})]},s.id)})}),c===1&&e.jsxs(w,{children:[e.jsx(S,{children:e.jsx(T,{className:"text-base",children:"الخطوة 1: من وإلى؟"})}),e.jsxs(I,{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{children:["العميل ",e.jsx("span",{className:"text-slate-400 text-xs",children:"(اختياري)"})]}),e.jsxs(ne,{value:d||"__none__",onValueChange:s=>R(s==="__none__"?"":s),children:[e.jsx(ce,{children:e.jsx(de,{placeholder:"اختر العميل"})}),e.jsxs(oe,{children:[e.jsx(U,{value:"__none__",children:"بدون عميل"}),f?.filter(s=>s.isActive).map(s=>e.jsx(U,{value:String(s.id),children:s.name},s.id))]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(r,{children:"من (مرسل المهمة)"}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-slate-200 bg-slate-50",children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",style:{backgroundColor:t?.avatarColor||"#94a3b8"},children:t?.name?.substring(0,2)||"أنا"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium text-slate-800",children:t?.name}),e.jsx("p",{className:"text-xs text-slate-500",children:t?.team})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(r,{children:"إلى قسم *"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:le.map(s=>e.jsxs("button",{type:"button",onClick:()=>{$(s),C("")},className:`flex items-center gap-2.5 p-3 rounded-lg border-2 text-right transition-all ${a===s?"border-indigo-500 bg-indigo-50":"border-slate-200 hover:border-slate-300 bg-white"}`,children:[e.jsx("div",{className:"w-8 h-8 rounded-full flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",style:{backgroundColor:ie(s)},children:s.substring(0,2)}),e.jsx("span",{className:"text-sm font-medium text-slate-700",children:s}),a===s&&e.jsx(h,{className:"h-4 w-4 text-indigo-600 ml-auto"})]},s))})]}),e.jsxs(m,{onClick:()=>j(2),disabled:!G,className:"w-full gap-2",children:["التالي ",e.jsx(k,{className:"h-4 w-4"})]})]})]}),c===2&&e.jsxs(w,{children:[e.jsx(S,{children:e.jsx(T,{className:"text-base",children:"الخ��وة 2: ما هي المهمة؟"})}),e.jsxs(I,{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"taskType",children:"نوع المهمة *"}),e.jsx(_,{id:"taskType",placeholder:"مثال: تصميم، مراجعة، متابعة...",value:o,onChange:s=>P(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(r,{htmlFor:"title",children:"عنوان المهمة *"}),e.jsx(_,{id:"title",placeholder:"أدخل عنوان المهمة...",value:x,onChange:s=>Q(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{htmlFor:"description",children:["الوصف ",e.jsxs("span",{className:"text-slate-400 text-xs",children:["(",y.length,"/500)"]})]}),e.jsx(re,{id:"description",placeholder:"وصف تفصيلي للمهمة...",rows:3,maxLength:500,value:y,onChange:s=>q(s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{children:["تعيين إلى عضو من فريق (",a,") ",e.jsx("span",{className:"text-slate-400 text-xs",children:"(اختياري)"})]}),L.length>0?e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>C(""),className:`flex items-center gap-2 p-2.5 rounded-lg border-2 transition-all text-sm ${i?"border-slate-200 hover:border-slate-300":"border-slate-400 bg-slate-50"}`,children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-slate-200 flex items-center justify-center text-slate-500 text-xs font-bold",children:"؟"}),e.jsx("span",{className:"text-slate-500",children:"بدون تعيين"}),!i&&e.jsx(h,{className:"h-4 w-4 text-slate-600 ml-auto"})]}),L.map(s=>e.jsxs("button",{type:"button",onClick:()=>C(String(s.id)),className:`flex items-center gap-2 p-2.5 rounded-lg border-2 transition-all text-sm ${i===String(s.id)?"border-primary bg-primary/5":"border-slate-200 hover:border-slate-300"}`,children:[e.jsx("div",{className:"w-7 h-7 rounded-full flex items-center justify-center text-white text-[10px] font-bold flex-shrink-0",style:{backgroundColor:s.avatarColor||"#94a3b8"},children:s.name.substring(0,2)}),e.jsx("span",{className:"text-slate-700 truncate",children:s.name}),i===String(s.id)&&e.jsx(h,{className:"h-4 w-4 text-primary ml-auto"})]},s.id))]}):e.jsxs("p",{className:"text-xs text-slate-400 bg-slate-50 rounded-lg p-3",children:["لا يوجد أعضاء مسجلون في فريق ",a]})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(m,{variant:"outline",onClick:()=>j(1),className:"gap-2",children:[e.jsx(D,{className:"h-4 w-4"})," السابق"]}),e.jsxs(m,{onClick:()=>j(3),disabled:!K,className:"flex-1 gap-2",children:["التالي ",e.jsx(k,{className:"h-4 w-4"})]})]})]})]}),c===3&&e.jsxs(w,{children:[e.jsx(S,{children:e.jsx(T,{className:"text-base",children:"الخطوة 3: تاريخ التسليم"})}),e.jsxs(I,{className:"space-y-5",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs(r,{htmlFor:"dueDate",children:["تاريخ التسليم ",e.jsx("span",{className:"text-slate-400 text-xs",children:"(اختياري)"})]}),e.jsx(_,{id:"dueDate",type:"date",min:new Date().toISOString().split("T")[0],value:g,onChange:s=>B(s.target.value)})]}),e.jsxs("div",{className:"bg-slate-50 rounded-lg p-4 space-y-2 border",children:[e.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-3",children:"مراجعة المهمة"}),e.jsx(n,{label:"العنوان",value:x}),e.jsx(n,{label:"نوع المهمة",value:o}),e.jsx(n,{label:"من",value:t?.name||p}),e.jsx(n,{label:"إلى",value:a}),d&&f&&e.jsx(n,{label:"العميل",value:f.find(s=>String(s.id)===d)?.name??""}),i&&N&&e.jsx(n,{label:"مُعيَّن إلى",value:N.find(s=>String(s.id)===i)?.name??""}),g&&e.jsx(n,{label:"تاريخ التسليم",value:new Date(g).toLocaleDateString("ar")})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs(m,{variant:"outline",onClick:()=>j(2),className:"gap-2",children:[e.jsx(D,{className:"h-4 w-4"})," السابق"]}),e.jsxs(m,{onClick:V,disabled:v.isPending,className:"flex-1 gap-2",children:[v.isPending?"جاري الإنشاء...":"إنشاء المهمة",e.jsx(h,{className:"h-4 w-4"})]})]})]})]})]})}function n({label:b,value:t}){return t?e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{className:"text-slate-500",children:b}),e.jsx("span",{className:"font-medium text-slate-800",children:t})]}):null}export{ye as default};
|
teamtasker/dist/public/assets/tasks-DhrfiTIR.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as j,av as he,an as je,aj as ve,a3 as ue,a2 as l,_ as w,a0 as e,m as pe,h as b,I as X,s as Ne,X as Y,L as ne,C as be,i as ye,B as H,aB as we,ax as _e,al as De,Y as ie,a9 as Ce,ab as Se,aA as Te,ao as Le,d as Ae,e as $e}from"./index-DLB2cbrK.js";import{T as ke}from"./textarea-Cu0xuEdJ.js";import{b as Me,T as J,c as ee,g as fe}from"./constants-VszDEqUo.js";import{S as z}from"./skeleton-Cni41WG0.js";import{S as se,c as te,d as ae,a as le,b as L}from"./select-CVvZTGtn.js";import{M as R,C as Be,A as Ue,h as Fe,c as ze,f as Ie,g as qe,d as Ee,e as Ke,b as Oe,a as Qe,P as ce,L as Pe}from"./alert-dialog-DeZev_w3.js";import{P as He}from"./plus-q6nj6w0G.js";import{S as Re}from"./search-CJt7VdB4.js";import{L as de}from"./list-todo-B_SnzIbB.js";import{T as oe}from"./trash-2-CUsOoE-U.js";import{F as Ve}from"./file-text-CsGLBE8z.js";import"./Combination-Dl0IQ_XO.js";import"./index-oW74Oi68.js";const We=[["path",{d:"M17 7 7 17",key:"15tmo1"}],["path",{d:"M17 17H7V7",key:"1org7z"}]],Ge=j("arrow-down-left",We);const Ze=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Xe=j("arrow-up-right",Ze);const Ye=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],xe=j("calendar-range",Ye);const Je=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],es=j("chevron-right",Je);const ss=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],ts=j("file-image",ss);const as=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]],me=j("file",as);const ls=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],rs=j("layout-grid",ls);const ns=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],is=j("list",ns);const cs=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ds=j("send",cs),os=[{status:"not_started",label:"لم يبدأ",color:"border-slate-300",headerBg:"bg-slate-100",countBg:"bg-slate-200 text-slate-700"},{status:"in_progress",label:"قيد التنفيذ",color:"border-blue-300",headerBg:"bg-blue-50",countBg:"bg-blue-100 text-blue-700"},{status:"review",label:"قيد المراجعة",color:"border-purple-300",headerBg:"bg-purple-50",countBg:"bg-purple-100 text-purple-700"},{status:"completed",label:"تم الإنجاز",color:"border-green-300",headerBg:"bg-green-50",countBg:"bg-green-100 text-green-700"}];function xs({task:a,onClick:r}){const d=a.dueDate&&new Date(a.dueDate)<new Date&&a.status!=="completed",v=fe(a.priority);return a.priority,e.jsxs("div",{onClick:r,className:`bg-white rounded-lg border shadow-sm hover:shadow-md hover:border-primary/30 transition-all cursor-pointer p-3 space-y-2.5 ${v}`,children:[e.jsx("div",{className:"flex items-start justify-between gap-2",children:e.jsx("p",{className:"font-medium text-sm leading-snug line-clamp-2 flex-1",children:a.title})}),a.clientName&&e.jsx("div",{className:"inline-flex items-center gap-1 bg-purple-50 border border-purple-100 rounded-full px-2 py-0.5",children:e.jsx("span",{className:"text-[10px] text-purple-700 font-medium",children:a.clientName})}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[e.jsx("span",{className:"bg-slate-100 px-1.5 py-0.5 rounded text-slate-600",children:a.taskType}),e.jsx(es,{className:"h-3 w-3 text-slate-300"}),e.jsx("span",{className:"truncate",children:a.assignedTeam})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[a.assignedUser&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-500",children:[e.jsx("div",{className:"w-5 h-5 rounded-full flex items-center justify-center text-white text-[9px] font-bold flex-shrink-0",style:{backgroundColor:a.assignedUser.avatarColor||"#94a3b8"},children:a.assignedUser.name.substring(0,2)}),e.jsx("span",{className:"truncate max-w-[80px]",children:a.assignedUser.name})]}),e.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[a.commentCount>0&&e.jsxs("div",{className:"flex items-center gap-0.5 text-xs text-slate-400",children:[e.jsx(R,{className:"h-3 w-3"}),e.jsx("span",{children:a.commentCount})]}),a.dueDate&&e.jsxs("div",{className:`flex items-center gap-0.5 text-xs ${d?"text-red-500 font-medium":"text-slate-400"}`,children:[e.jsx(Be,{className:"h-3 w-3"}),e.jsx("span",{children:new Date(a.dueDate).toLocaleDateString("ar-SA",{month:"short",day:"numeric"})}),d&&e.jsx("span",{children:"⚠"})]})]})]})]})}function ms(a){if(a===0)return"0 B";const r=1024,d=["B","KB","MB"],v=Math.floor(Math.log(a)/Math.log(r));return parseFloat((a/Math.pow(r,v)).toFixed(2))+" "+d[v]}function hs(a){return a?a.startsWith("image/")?ts:a.includes("pdf")||a.includes("word")||a.includes("excel")||a.includes("sheet")?Ve:me:me}function us({task:a,onClose:r}){const d=he(),v=we(),{toast:n}=_e(),{activeUser:i,token:u}=ue(),[p,A]=l.useState(""),[x,I]=l.useState([]),[f,$]=l.useState(!1),[m,_]=l.useState(!1),[h,y]=l.useState(!1),g=l.useCallback(async()=>{if(u){$(!0);try{const t=await fetch(`/api/tasks/${a.id}/attachments`,{headers:{Authorization:`Bearer ${u}`}});if(t.ok){const c=await t.json();I(c)}}catch(t){console.error(t)}finally{$(!1)}}},[a.id,u]);l.useEffect(()=>{g()},[g]);const k=async t=>{if(!u)return;if(t.size>10*1024*1024){n({title:"حجم الملف يتجاوز الحد الأقصى 10 ميغابايت",variant:"destructive"});return}const c=["jpg","jpeg","png","gif","webp","pdf","doc","docx","xls","xlsx"],T=t.name.split(".").pop()?.toLowerCase();if(!T||!c.includes(T)){n({title:"نوع الملف غير مدعوم (المسموح: صور، PDF، Word، Excel)",variant:"destructive"});return}_(!0);const P=new FormData;P.append("file",t);try{const re=await fetch(`/api/tasks/${a.id}/attachments`,{method:"POST",headers:{Authorization:`Bearer ${u}`},body:P}),ge=await re.json();if(!re.ok){n({title:ge.error||"فشل رفع الملف",variant:"destructive"});return}n({title:"تم رفع المرفق بنجاح"}),g(),d.invalidateQueries({queryKey:w()})}catch{n({title:"حدث خطأ أثناء رفع الملف",variant:"destructive"})}finally{_(!1)}},q=t=>{t.preventDefault(),y(!0)},M=()=>{y(!1)},V=t=>{t.preventDefault(),y(!1),t.dataTransfer.files&&t.dataTransfer.files[0]&&k(t.dataTransfer.files[0])},E=t=>{t.target.files&&t.target.files[0]&&k(t.target.files[0])},D=async t=>{if(u&&confirm("هل أنت متأكد من رغبتك في حذف هذا المرفق؟"))try{const c=await fetch(`/api/tasks/${a.id}/attachments/${t}`,{method:"DELETE",headers:{Authorization:`Bearer ${u}`}});if(!c.ok){const T=await c.json();n({title:T.error||"فشل حذف المرفق",variant:"destructive"});return}n({title:"تم حذف المرفق بنجاح"}),g(),d.invalidateQueries({queryKey:w()})}catch{n({title:"حدث خطأ أثناء حذف المرفق",variant:"destructive"})}},{data:o,isLoading:B}=De(a.id,{query:{queryKey:ie(a.id)}}),U=Ce(),K=Se(),N=Te(),{data:O}=Le(),Q=i?.role==="admin"||i?.role==="head_of_team"||i?.role==="team_lead"&&a.assignedTeam===i.team,W=O?.filter(t=>t.team===a.assignedTeam)??[],C=t=>{const c=t==="__none__"?null:parseInt(t);N.mutate({id:a.id,data:{assignedUserId:c}},{onSuccess:()=>{d.invalidateQueries({queryKey:w()}),n({title:"تم تعيين المهمة بنجاح"})},onError:()=>n({title:"فشل تعيين المهمة",variant:"destructive"})})},G=()=>{K.mutate({id:a.id},{onSuccess:()=>{d.invalidateQueries({queryKey:w()}),n({title:"تم حذف المهمة"}),r()}})},Z=t=>{v.mutate({id:a.id,data:{status:t}},{onSuccess:()=>{d.invalidateQueries({queryKey:w()}),n({title:"تم تحديث الحالة"})}})},S=()=>{p.trim()&&U.mutate({id:a.id,data:{content:p.trim(),userId:i?.id}},{onSuccess:()=>{d.invalidateQueries({queryKey:ie(a.id)}),d.invalidateQueries({queryKey:w()}),A(""),n({title:"تم إضافة التعليق"})},onError:()=>n({title:"فشل إضافة التعليق",variant:"destructive"})})},s=a.dueDate&&new Date(a.dueDate)<new Date&&a.status!=="completed";return a.priority,e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 bg-black/30 z-40",onClick:r}),e.jsxs("div",{className:"fixed right-0 top-0 h-full w-[480px] bg-white shadow-2xl z-50 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.jsx(H,{variant:"outline",className:`text-xs ${ee(a.status)}`,children:J[a.status]||a.status})}),e.jsxs("div",{className:"flex items-center gap-1",children:[(i?.role==="admin"||i?.role==="head_of_team"||i?.role==="team_lead"&&(a.assignedTeam===i.team||a.fromTeam===i.team))&&e.jsxs(Ue,{children:[e.jsx(Fe,{asChild:!0,children:e.jsx("button",{className:"p-1.5 rounded hover:bg-red-50 text-slate-400 hover:text-red-500 transition-colors",title:"حذف المهمة",children:e.jsx(oe,{className:"h-5 w-5"})})}),e.jsxs(ze,{children:[e.jsxs(Ie,{children:[e.jsx(qe,{children:"حذف المهمة"}),e.jsx(Ee,{children:"هل أنت متأكد من حذف هذه المهمة؟ لا يمكن التراجع عن هذا الإجراء."})]}),e.jsxs(Ke,{children:[e.jsx(Oe,{children:"إلغاء"}),e.jsx(Qe,{onClick:G,className:"bg-red-600 hover:bg-red-700",children:"حذف"})]})]})]}),e.jsx("button",{onClick:r,className:"p-1.5 rounded hover:bg-slate-100 transition-colors",children:e.jsx(Y,{className:"h-5 w-5 text-slate-400"})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:e.jsxs("div",{className:"p-6 space-y-5",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-xl font-bold leading-tight",children:a.title}),a.clientName&&e.jsx(H,{className:"mt-2 bg-purple-100 text-purple-700 border-purple-200 hover:bg-purple-100",children:a.clientName})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide",children:"تحديث الحالة"}),e.jsx("div",{className:"flex gap-2 flex-wrap",children:Object.entries(J).map(([t,c])=>e.jsx("button",{onClick:()=>Z(t),className:`px-3 py-1.5 rounded-md text-xs font-medium border transition-all ${a.status===t?`${ee(t)} ring-2 ring-offset-1 ring-current`:"border-slate-200 text-slate-600 hover:bg-slate-50"}`,children:c},t))})]}),a.description&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-2",children:"الوصف"}),e.jsx("p",{className:"text-sm text-slate-700 leading-relaxed bg-slate-50 rounded-lg p-3",children:a.description})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3 bg-slate-50 rounded-lg p-4",children:[e.jsx(F,{label:"من (المرسل)",value:a.createdByUser?.name||a.fromTeam}),e.jsx(F,{label:"إلى فريق",value:a.assignedTeam}),e.jsx(F,{label:"نوع المهمة",value:a.taskType}),Q?e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs text-slate-400 mb-0.5",children:["تعيين إلى عضو (",a.assignedTeam,")"]}),e.jsxs(se,{value:a.assignedUserId?String(a.assignedUserId):"__none__",onValueChange:C,children:[e.jsx(te,{className:"h-7 text-xs border-slate-200",children:e.jsx(ae,{placeholder:"بدون تعيين"})}),e.jsxs(le,{children:[e.jsx(L,{value:"__none__",children:"بدون تعيين"}),W.map(t=>e.jsx(L,{value:String(t.id),children:t.name},t.id))]})]})]}):a.assignedUser?e.jsx(F,{label:"مُعيَّن إلى",value:a.assignedUser.name}):null,a.dueDate&&e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-0.5",children:"تاريخ التسليم"}),e.jsxs("p",{className:`text-sm font-medium ${s?"text-red-600":"text-slate-800"}`,children:[new Date(a.dueDate).toLocaleDateString("ar"),s&&" ⚠️ متأخرة"]})]}),e.jsx(F,{label:"تاريخ الإنشاء",value:new Date(a.createdAt).toLocaleDateString("ar")})]}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-3 flex items-center gap-1.5",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),"التعليقات ",o&&o.length>0?`(${o.length})`:""]}),B?e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{className:"h-14 w-full"}),e.jsx(z,{className:"h-14 w-full"})]}):o&&o.length>0?e.jsx("div",{className:"space-y-3",children:o.map(t=>e.jsxs("div",{className:"flex gap-3",children:[e.jsx(Ae,{className:"h-8 w-8 flex-shrink-0",children:e.jsx($e,{style:{backgroundColor:t.user?.avatarColor||"#94a3b8",color:"#fff",fontSize:"11px"},children:t.user?.name?.substring(0,2)??"؟"})}),e.jsxs("div",{className:"flex-1 bg-slate-50 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-xs font-semibold text-slate-700",children:t.user?.name??"مستخدم"}),e.jsx("p",{className:"text-[10px] text-slate-400",children:new Date(t.createdAt).toLocaleDateString("ar")})]}),e.jsx("p",{className:"text-sm text-slate-600",children:t.content})]})]},t.id))}):e.jsxs("div",{className:"text-center py-6 bg-slate-50 rounded-lg",children:[e.jsx(R,{className:"h-8 w-8 text-slate-200 mx-auto mb-2"}),e.jsx("p",{className:"text-xs text-slate-400",children:"لا توجد تعليقات بعد"})]}),e.jsxs("div",{className:"mt-3 flex gap-2",children:[e.jsx(ke,{placeholder:"أضف ملاحظة أو تعليق...",value:p,onChange:t=>A(t.target.value),rows:2,className:"text-sm resize-none",onKeyDown:t=>{t.key==="Enter"&&t.ctrlKey&&S()}}),e.jsx(b,{size:"icon",className:"self-end flex-shrink-0",onClick:S,disabled:!p.trim()||U.isPending,children:e.jsx(ds,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{className:"border-t pt-5 mt-5",children:[e.jsxs("p",{className:"text-xs font-medium text-slate-500 uppercase tracking-wide mb-3 flex items-center gap-1.5",children:[e.jsx(ce,{className:"h-3.5 w-3.5"}),"المرفقات ",x&&x.length>0?`(${x.length})`:""]}),e.jsxs("div",{onDragOver:q,onDragLeave:M,onDrop:V,className:`border-2 border-dashed rounded-lg p-4 text-center transition-all cursor-pointer ${h?"border-primary bg-primary/5":"border-slate-200 hover:border-slate-300 bg-slate-50/50"}`,onClick:()=>document.getElementById("file-upload")?.click(),children:[e.jsx("input",{type:"file",id:"file-upload",className:"hidden",onChange:E,accept:".jpg,.jpeg,.png,.gif,.webp,.pdf,.doc,.docx,.xls,.xlsx"}),m?e.jsxs("div",{className:"flex flex-col items-center justify-center py-2",children:[e.jsx(Pe,{className:"h-6 w-6 text-primary animate-spin mb-2"}),e.jsx("p",{className:"text-xs text-slate-500",children:"جاري رفع الملف..."})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-2",children:[e.jsx(ce,{className:"h-6 w-6 text-slate-400 mb-1"}),e.jsx("p",{className:"text-xs font-medium text-slate-700",children:"اسحب وأسقط الملف هنا أو اضغط للتصفح"}),e.jsx("p",{className:"text-[10px] text-slate-400 mt-1",children:"الحد الأقصى للحجم: 10 ميغابايت (صور، PDF، Word، Excel)"})]})]}),e.jsx("div",{className:"mt-4 space-y-2",children:f?e.jsxs("div",{className:"space-y-2",children:[e.jsx(z,{className:"h-10 w-full"}),e.jsx(z,{className:"h-10 w-full"})]}):x&&x.length>0?x.map(t=>{const c=hs(t.mimeType),T=i&&(t.uploadedByUserId===i.id||i.role==="admin");return e.jsxs("div",{className:"flex items-center justify-between p-2.5 rounded-lg border border-slate-100 hover:bg-slate-50 transition-all bg-white",children:[e.jsxs("a",{href:t.fileUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 min-w-0 flex-1 hover:text-primary transition-colors text-slate-700",children:[e.jsx("div",{className:"w-8 h-8 rounded bg-slate-100 flex items-center justify-center flex-shrink-0 text-slate-500",children:e.jsx(c,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("p",{className:"text-xs font-semibold truncate leading-tight",children:t.fileName}),e.jsxs("p",{className:"text-[10px] text-slate-400 mt-0.5 leading-none",children:[ms(t.fileSize)," · بواسطة ",t.uploadedByUser?.name??"مستخدم"]})]})]}),T&&e.jsx("button",{onClick:P=>{P.stopPropagation(),D(t.id)},className:"p-1 rounded text-slate-400 hover:text-red-500 hover:bg-red-50 transition-colors flex-shrink-0",children:e.jsx(oe,{className:"h-3.5 w-3.5"})})]},t.id)}):e.jsx("div",{className:"text-center py-6 border border-slate-100 rounded-lg bg-slate-50/50",children:e.jsx("p",{className:"text-xs text-slate-400",children:"لا توجد مرفقات لهذه المهمة"})})})]})]})}),e.jsxs("div",{className:"border-t p-4 flex gap-3",children:[e.jsx(pe,{href:`/tasks/${a.id}`,className:"flex-1",onClick:r,children:e.jsx(b,{variant:"outline",className:"w-full",children:"عرض المهمة كاملة"})}),e.jsx(b,{variant:"ghost",onClick:r,className:"flex-shrink-0",children:"إغلاق"})]})]})]})}function F({label:a,value:r}){return e.jsxs("div",{children:[e.jsx("p",{className:"text-xs text-slate-400 mb-0.5",children:a}),e.jsx("p",{className:"text-sm font-medium text-slate-800",children:r})]})}function Ts(){const a=he(),{data:r,isLoading:d}=je({}),{data:v}=ve({}),{activeUser:n}=ue(),[i,u]=l.useState("board"),[p,A]=l.useState(""),[x,I]=l.useState(""),[f,$]=l.useState(""),[m,_]=l.useState(""),[h,y]=l.useState(""),[g,k]=l.useState("all"),[q,M]=l.useState(null),[V,E]=l.useState(!1),D=n?.role??"member",o=n?.id,B=n?.team??"",U=D==="admin",K=D==="head_of_team",N=D==="team_lead",O=D==="member";l.useEffect(()=>{const s=setInterval(()=>{a.invalidateQueries({queryKey:w()})},3e4);return()=>clearInterval(s)},[a]);const Q=l.useMemo(()=>r?U||K||N?r:r.filter(s=>s.createdByUserId===o||s.assignedUserId===o||s.assignedUser?.id===o):[],[r,U,K,N,o]),W=!!(p||x||f||m||h||g!=="all"),C=l.useMemo(()=>Q.filter(s=>{if(p&&!s.title.toLowerCase().includes(p.toLowerCase())||x&&x!=="__all__"&&String(s.clientId)!==x||f&&f!=="__all__"&&s.fromTeam!==f&&s.assignedTeam!==f)return!1;if(m){const t=new Date(m);if(t.setHours(0,0,0,0),!s.dueDate||new Date(s.dueDate)<t)return!1}if(h){const t=new Date(h);if(t.setHours(23,59,59,999),!s.dueDate||new Date(s.dueDate)>t)return!1}if(g==="sent"){const t=s.createdByUserId;if(N){if(s.fromTeam!==B)return!1}else if(t!==o)return!1}if(g==="received"){if(N){if(s.assignedTeam!==B)return!1}else if(s.assignedUser?.id!==o)return!1}return!0}),[Q,p,x,f,m,h,g,N,o,B]),G=()=>{A(""),I(""),$(""),_(""),y(""),k("all")},Z=s=>C.filter(t=>t.status===s),S=m||h;return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"p-6 border-b bg-white flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"المهام"}),e.jsx("p",{className:"text-slate-500 text-sm",children:"إدارة ومتابعة مهام الفريق"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(pe,{href:"/tasks/new",children:e.jsxs(b,{size:"sm",className:"gap-1.5",children:[e.jsx(He,{className:"h-4 w-4"}),"مهمة جديدة"]})}),e.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 p-1 rounded-lg",children:[e.jsx("button",{onClick:()=>u("board"),className:`p-1.5 rounded-md transition-colors ${i==="board"?"bg-white shadow-sm text-slate-900":"text-slate-500 hover:text-slate-900"}`,children:e.jsx(rs,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>u("list"),className:`p-1.5 rounded-md transition-colors ${i==="list"?"bg-white shadow-sm text-slate-900":"text-slate-500 hover:text-slate-900"}`,children:e.jsx(is,{className:"w-4 h-4"})})]})]})]}),e.jsx("div",{className:"flex items-center gap-1 mb-3 bg-slate-100 p-1 rounded-lg w-fit",children:[{val:"all",label:"الكل",icon:null},{val:"sent",label:"المُرسَلة",icon:Xe},{val:"received",label:"المُستلَمة",icon:Ge}].map(s=>{const t=s.icon;return e.jsxs("button",{onClick:()=>k(s.val),className:`flex items-center gap-1 px-3 py-1.5 rounded-md text-xs font-medium transition-all ${g===s.val?"bg-white shadow-sm text-slate-900":"text-slate-500 hover:text-slate-800"}`,children:[t&&e.jsx(t,{className:"h-3 w-3"}),s.label]},s.val)})}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"relative flex-1 min-w-[160px] max-w-xs",children:[e.jsx(Re,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-slate-400"}),e.jsx(X,{placeholder:"بحث في المهام...",value:p,onChange:s=>A(s.target.value),className:"pl-8 h-9 text-sm"})]}),!O&&e.jsxs(se,{value:x||"__all__",onValueChange:s=>I(s==="__all__"?"":s),children:[e.jsx(te,{className:"h-9 text-sm w-40",children:e.jsx(ae,{placeholder:"كل العملاء"})}),e.jsxs(le,{children:[e.jsx(L,{value:"__all__",children:"كل العملاء"}),v?.map(s=>e.jsx(L,{value:String(s.id),children:s.name},s.id))]})]}),!O&&!N&&e.jsxs(se,{value:f||"__all__",onValueChange:s=>$(s==="__all__"?"":s),children:[e.jsxs(te,{className:`h-9 text-sm w-44 ${f?"border-indigo-400 bg-indigo-50 text-indigo-700":""}`,children:[e.jsx(Ne,{className:"h-3.5 w-3.5 ml-1 flex-shrink-0 text-slate-400"}),e.jsx(ae,{placeholder:"كل الأقسام"})]}),e.jsxs(le,{children:[e.jsx(L,{value:"__all__",children:"كل الأقسام"}),Me.map(s=>e.jsx(L,{value:s,children:s},s))]})]}),e.jsxs(b,{variant:"outline",size:"sm",className:`h-9 gap-1.5 text-sm font-normal ${S?"border-indigo-400 bg-indigo-50 text-indigo-700 hover:bg-indigo-100":"text-slate-600"}`,onClick:()=>E(s=>!s),children:[e.jsx(xe,{className:"h-3.5 w-3.5"}),S?`${m?new Date(m).toLocaleDateString("ar-SA",{month:"short",day:"numeric"}):"…"} ← ${h?new Date(h).toLocaleDateString("ar-SA",{month:"short",day:"numeric"}):"…"}`:"الفترة الزمنية"]}),W&&e.jsxs(b,{variant:"ghost",size:"sm",className:"h-9 text-xs gap-1 text-slate-500",onClick:G,children:[e.jsx(Y,{className:"h-3 w-3"}),"مسح الكل"]}),e.jsxs("span",{className:"text-sm text-slate-400 mr-auto",children:[C.length," مهمة"]})]}),V&&e.jsxs("div",{className:"mt-3 flex items-end gap-4 p-3 bg-slate-50 border border-slate-200 rounded-lg flex-wrap",children:[e.jsx(xe,{className:"h-4 w-4 text-indigo-500 flex-shrink-0 self-center"}),e.jsxs("div",{className:"flex items-end gap-3 flex-wrap flex-1",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(ne,{className:"text-xs text-slate-500",children:"من تاريخ"}),e.jsx(X,{type:"date",value:m,onChange:s=>_(s.target.value),className:"h-8 text-sm w-40",max:h||void 0})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(ne,{className:"text-xs text-slate-500",children:"إلى تاريخ"}),e.jsx(X,{type:"date",value:h,onChange:s=>y(s.target.value),className:"h-8 text-sm w-40",min:m||void 0})]}),S&&e.jsxs(b,{variant:"ghost",size:"sm",className:"h-8 text-xs text-slate-400 gap-1",onClick:()=>{_(""),y("")},children:[e.jsx(Y,{className:"h-3 w-3"}),"مسح التاريخ"]})]}),e.jsx(b,{variant:"ghost",size:"sm",className:"h-8 text-xs text-slate-400",onClick:()=>E(!1),children:"إخفاء"})]})]}),d?e.jsx("div",{className:"p-6 grid grid-cols-4 gap-4",children:[1,2,3,4].map(s=>e.jsx("div",{className:"space-y-3",children:[1,2].map(t=>e.jsx(z,{className:"h-32 w-full rounded-lg"},t))},s))}):i==="board"?e.jsx("div",{className:"flex-1 overflow-auto p-6",children:e.jsx("div",{className:"flex gap-4 h-full",style:{minWidth:"960px"},children:os.map(s=>{const t=Z(s.status);return e.jsxs("div",{className:"flex-1 flex flex-col min-w-[220px]",children:[e.jsxs("div",{className:`flex items-center justify-between px-3 py-2.5 rounded-t-lg border ${s.color} ${s.headerBg}`,children:[e.jsx("span",{className:"font-semibold text-sm",children:s.label}),e.jsx("span",{className:`text-xs font-bold px-2 py-0.5 rounded-full ${s.countBg}`,children:t.length})]}),e.jsx("div",{className:`flex-1 border border-t-0 rounded-b-lg ${s.color} bg-slate-50/50 p-2 space-y-2 overflow-y-auto min-h-[200px]`,children:t.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-24 text-slate-300",children:[e.jsx(de,{className:"h-8 w-8 mb-1"}),e.jsx("p",{className:"text-xs",children:"لا توجد مهام"})]}):t.map(c=>e.jsx(xs,{task:c,onClick:()=>M(c)},c.id))})]},s.status)})})}):e.jsx("div",{className:"flex-1 overflow-auto p-6",children:C.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center py-24 border rounded-xl bg-white",children:[e.jsx(de,{className:"h-16 w-16 text-slate-200 mb-4"}),e.jsx("h3",{className:"font-semibold text-slate-700 text-lg",children:"لا توجد مهام مطابقة"}),e.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"جرب تغيير الفلاتر أو ابحث بكلمة مختلفة"})]}):e.jsx("div",{className:"space-y-2",children:C.map(s=>e.jsx(be,{className:`hover:border-primary/40 transition-all cursor-pointer ${fe(s.priority)}`,onClick:()=>M(s),children:e.jsxs(ye,{className:"p-4 flex items-center justify-between gap-4",children:[e.jsx("div",{className:"flex items-start gap-4 flex-1 min-w-0",children:e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm truncate",children:s.title}),e.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-slate-500 flex-wrap",children:[e.jsx("span",{className:"font-medium bg-slate-100 px-1.5 py-0.5 rounded text-slate-700",children:s.taskType}),e.jsxs("span",{children:[s.createdByUser?.name?.split(" ")[0]||s.fromTeam," → ",s.assignedTeam]}),s.clientName&&e.jsx(H,{className:"text-[10px] bg-purple-50 text-purple-700 border-purple-200 hover:bg-purple-50",children:s.clientName}),s.dueDate&&e.jsxs("span",{className:new Date(s.dueDate)<new Date&&s.status!=="completed"?"text-red-500 font-medium":"",children:["· ",new Date(s.dueDate).toLocaleDateString("ar")]})]})]})}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[s.commentCount>0&&e.jsxs("span",{className:"flex items-center gap-1 text-xs text-slate-400",children:[e.jsx(R,{className:"h-3 w-3"}),s.commentCount]}),e.jsx(H,{variant:"outline",className:`text-xs ${ee(s.status)}`,children:J[s.status]||s.status})]})]})},s.id))})}),q&&e.jsx(us,{task:q,onClose:()=>M(null)})]})}export{Ts as default};
|
teamtasker/dist/public/assets/teams-C6zfIdM-.js
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
teamtasker/dist/public/assets/textarea-Cu0xuEdJ.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{a2 as s,a0 as t,v as o}from"./index-DLB2cbrK.js";const i=s.forwardRef(({className:e,...r},a)=>t.jsx("textarea",{className:o("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:a,...r}));i.displayName="Textarea";export{i as T};
|
teamtasker/dist/public/assets/trash-2-CUsOoE-U.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as a}from"./index-DLB2cbrK.js";const t=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],o=a("trash-2",t);export{o as T};
|
teamtasker/dist/public/assets/types-DeMiYPlt.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{R as G}from"./index-DLB2cbrK.js";var ze=t=>t.type==="checkbox",we=t=>t instanceof Date,Y=t=>t==null;const fr=t=>typeof t=="object";var M=t=>!Y(t)&&!Array.isArray(t)&&fr(t)&&!we(t),Dr=t=>M(t)&&t.target?ze(t.target)?t.target.checked:t.target.value:t,Zr=(t,e)=>e.split(".").some((r,s,i)=>!isNaN(Number(r))&&t.has(i.slice(0,s).join("."))),jr=t=>{const e=t.constructor&&t.constructor.prototype;return M(e)&&e.hasOwnProperty("isPrototypeOf")},vt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function $(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(vt&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(M(t)&&jr(t)))return t;const s=r?[]:Object.create(Object.getPrototypeOf(t));for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=$(t[i]));return s}var Ke=t=>/^\w*$/.test(t),j=t=>t===void 0,xt=t=>Array.isArray(t)?t.filter(Boolean):[],kt=t=>xt(t.replace(/["|']|\]/g,"").split(/\.|\[/)),v=(t,e,r)=>{if(!e||!M(t))return r;const i=(Ke(e)?[e]:kt(e)).reduce((a,o)=>Y(a)?void 0:a[o],t);return j(i)||i===t?j(t[e])?r:t[e]:i},ue=t=>typeof t=="boolean",ee=t=>typeof t=="function",D=(t,e,r)=>{let s=-1;const i=Ke(e)?[e]:kt(e),a=i.length,o=a-1;for(;++s<a;){const d=i[s];let h=r;if(s!==o){const p=t[d];h=M(p)||Array.isArray(p)?p:isNaN(+i[s+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;t[d]=h,t=t[d]}};const Te={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},ie={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},ae={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},dt="form",hr="root",Lr=G.createContext(null);Lr.displayName="HookFormControlContext";var Mr=(t,e,r,s=!0)=>{const i={};for(const a in t)Object.defineProperty(i,a,{get:()=>{const o=a;return e._proxyFormState[o]!==ie.all&&(e._proxyFormState[o]=!s||ie.all),t[o]}});return i};const $r=typeof window<"u"?G.useLayoutEffect:G.useEffect;var q=t=>typeof t=="string",Pr=(t,e,r,s,i)=>q(t)?(s&&e.watch.add(t),v(r,t,i)):Array.isArray(t)?t.map(a=>(s&&e.watch.add(a),v(r,a))):(s&&(e.watchAll=!0),r),ct=t=>Y(t)||!fr(t);function le(t,e,r=new WeakSet){if(t===e)return!0;if(ct(t)||ct(e))return Object.is(t,e);if(we(t)&&we(e))return Object.is(t.getTime(),e.getTime());const s=Object.keys(t),i=Object.keys(e);if(s.length!==i.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const a of s){const o=t[a];if(!(a in e))return!1;if(a!=="ref"){const d=e[a];if(we(o)&&we(d)||(M(o)||Array.isArray(o))&&(M(d)||Array.isArray(d))?!le(o,d,r):!Object.is(o,d))return!1}}return!0}const Ur=G.createContext(null);Ur.displayName="HookFormContext";var mr=(t,e,r,s,i)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[s]:i||!0}}:{},Me=t=>Array.isArray(t)?t:[t],Lt=()=>{let t=[];return{get observers(){return t},next:i=>{for(const a of t)a.next&&a.next(i)},subscribe:i=>(t.push(i),{unsubscribe:()=>{t=t.filter(a=>a!==i)}}),unsubscribe:()=>{t=[]}}};function yr(t,e){const r={};for(const s in t)if(t.hasOwnProperty(s)){const i=t[s],a=e[s];if(i&&M(i)&&a){const o=yr(i,a);M(o)&&(r[s]=o)}else t[s]&&(r[s]=a)}return r}var W=t=>M(t)&&!Object.keys(t).length,bt=t=>t.type==="file",qe=t=>{if(!vt)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},pr=t=>t.type==="select-multiple",wt=t=>t.type==="radio",Br=t=>wt(t)||ze(t),ut=t=>qe(t)&&t.isConnected;function zr(t,e){const r=e.slice(0,-1).length;let s=0;for(;s<r;){if(Y(t)){t=void 0;break}t=t[e[s]],s++}return t}function Wr(t){for(const e in t)if(t.hasOwnProperty(e)&&!j(t[e]))return!1;return!0}function P(t,e){if(q(e)&&Object.prototype.hasOwnProperty.call(t,e))return delete t[e],t;const r=Array.isArray(e)?e:Ke(e)?[e]:kt(e),s=r.length===1?t:zr(t,r),i=r.length-1,a=r[i];return s&&delete s[a],i!==0&&(M(s)&&W(s)||Array.isArray(s)&&Wr(s))&&P(t,r.slice(0,-1)),t}var qr=t=>{for(const e in t)if(ee(t[e]))return!0;return!1};function gr(t){return Array.isArray(t)||M(t)&&!qr(t)}function ft(t,e={}){for(const r in t){const s=t[r];gr(s)?(e[r]=Array.isArray(s)?[]:{},ft(s,e[r])):j(s)||(e[r]=!0)}return e}function ht(t){if(t!==!1){if(t===!0)return!0;if(Array.isArray(t)){const e=t.map(r=>ht(r));return e.some(r=>r!==void 0)?e:void 0}if(M(t)){const e={};for(const r in t){const s=ht(t[r]);j(s)||(e[r]=s)}return Object.keys(e).length?e:void 0}}}function je(t,e,r){r||(r=ft(e));for(const s in t){const i=t[s];if(gr(i))j(e)||ct(r[s])?r[s]=ft(i,Array.isArray(i)?[]:{}):je(i,Y(e)?{}:e[s],r[s]);else{const a=e[s];r[s]=!le(i,a)}}return ht(r)||{}}const Mt={value:!1,isValid:!1},$t={value:!0,isValid:!0};var _r=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!j(t[0].attributes.value)?j(t[0].value)||t[0].value===""?$t:{value:t[0].value,isValid:!0}:$t:Mt}return Mt},vr=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:s})=>j(t)?t:e?t===""?NaN:t&&+t:r&&q(t)?new Date(t):s?s(t):t;const Pt={isValid:!1,value:null};var xr=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,Pt):Pt;function Ut(t){const e=t.ref;return bt(e)?e.files:wt(e)?xr(t.refs).value:pr(e)?[...e.selectedOptions].map(({value:r})=>r):ze(e)?_r(t.refs).value:vr(j(e.value)?t.ref.value:e.value,t)}var Hr=(t,e,r,s)=>{const i={};for(const a of t){const o=v(e,a);o&&D(i,a,o._f)}return{criteriaMode:r,names:[...t],fields:i,shouldUseNativeValidation:s}},He=t=>t instanceof RegExp,Ze=t=>j(t)?t:He(t)?t.source:M(t)?He(t.value)?t.value.source:t.value:t,Bt=t=>({isOnSubmit:!t||t===ie.onSubmit,isOnBlur:t===ie.onBlur,isOnChange:t===ie.onChange,isOnAll:t===ie.all,isOnTouch:t===ie.onTouched});const zt="AsyncFunction";var Gr=t=>!!t&&!!t.validate&&!!(ee(t.validate)&&t.validate.constructor.name===zt||M(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===zt)),Yr=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),Wt=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(s=>t.startsWith(s)&&/^\.\w+/.test(t.slice(s.length))));const $e=(t,e,r,s)=>{for(const i of r||Object.keys(t)){const a=v(t,i);if(a){const{_f:o,...d}=a;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],i)&&!s)return!0;if(o.ref&&e(o.ref,o.name)&&!s)return!0;if($e(d,e))break}else if(M(d)&&$e(d,e))break}}};function qt(t,e,r){const s=v(t,r);if(s||Ke(r))return{error:s,name:r};const i=r.split(".");for(;i.length;){const a=i.join("."),o=v(e,a),d=v(t,a);if(o&&!Array.isArray(o)&&r!==a)return{name:r};if(d&&d.type)return{name:a,error:d};if(d&&d.root&&d.root.type)return{name:`${a}.root`,error:d.root};i.pop()}return{name:r}}var Jr=(t,e,r,s)=>{r(t);const{name:i,...a}=t;return W(a)||s&&Object.keys(a).length>=Object.keys(e).length||Object.keys(a).find(o=>e[o]===(!s||ie.all))},Qr=(t,e,r)=>!t||!e||t===e||Me(t).some(s=>s&&(r?s===e:s.startsWith(e)||e.startsWith(s))),Xr=(t,e,r,s,i)=>i.isOnAll?!1:!r&&i.isOnTouch?!(e||t):(r?s.isOnBlur:i.isOnBlur)?!t:(r?s.isOnChange:i.isOnChange)?t:!0,Kr=(t,e)=>!xt(v(t,e)).length&&P(t,e),es=(t,e,r)=>{const s=Me(v(t,r));return D(s,hr,e[r]),D(t,r,s),t};function Ht(t,e,r="validate"){if(q(t)||Array.isArray(t)&&t.every(q)||ue(t)&&!t)return{type:r,message:q(t)?t:"",ref:e}}var Ve=t=>M(t)&&!He(t)?t:{value:t,message:""},Gt=async(t,e,r,s,i,a)=>{const{ref:o,refs:d,required:h,maxLength:p,minLength:T,min:R,max:L,pattern:O,validate:fe,name:Q,valueAsNumber:re,mount:K}=t._f,E=v(r,Q);if(!K||e.has(Q))return{};const he=d?d[0]:o,me=C=>{i&&he.reportValidity&&(he.setCustomValidity(ue(C)?"":C||""),he.reportValidity())},B={},Ne=wt(o),Fe=ze(o),et=Ne||Fe,ne=(re||bt(o))&&j(o.value)&&j(E)||qe(o)&&o.value===""||E===""||Array.isArray(E)&&!E.length||re&&typeof E=="number"&&isNaN(E),be=mr.bind(null,Q,s,B),Ie=(C,I,Z,z=ae.maxLength,oe=ae.minLength)=>{const se=C?I:Z;B[Q]={type:C?z:oe,message:se,ref:o,...be(C?z:oe,se)}};if(a?!Array.isArray(E)||!E.length:h&&(!et&&(ne||Y(E))||ue(E)&&!E||Fe&&!_r(d).isValid||Ne&&!xr(d).isValid)){const{value:C,message:I}=q(h)?{value:!!h,message:h}:Ve(h);if(C&&(B[Q]={type:ae.required,message:I,ref:he,...be(ae.required,I)},!s))return me(I),B}if(!ne&&(!Y(R)||!Y(L))){let C,I;const Z=Ve(L),z=Ve(R);if(!Y(E)&&!isNaN(E)){const oe=o.valueAsNumber||E&&+E;Y(Z.value)||(C=oe>Z.value),Y(z.value)||(I=oe<z.value)}else{const oe=o.valueAsDate||new Date(E),se=tt=>new Date(new Date().toDateString()+" "+tt),De=o.type=="time",pe=o.type=="week";q(Z.value)&&E&&(C=De?se(E)>se(Z.value):pe?E>Z.value:oe>new Date(Z.value)),q(z.value)&&E&&(I=De?se(E)<se(z.value):pe?E<z.value:oe<new Date(z.value))}if((C||I)&&(Ie(!!C,Z.message,z.message,ae.max,ae.min),!s))return me(B[Q].message),B}if((p||T)&&!ne&&(q(E)||a&&Array.isArray(E))){const C=Ve(p),I=Ve(T),Z=!Y(C.value)&&E.length>+C.value,z=!Y(I.value)&&E.length<+I.value;if((Z||z)&&(Ie(Z,C.message,I.message),!s))return me(B[Q].message),B}if(O&&!ne&&q(E)){const{value:C,message:I}=Ve(O);if(He(C)&&!E.match(C)&&(B[Q]={type:ae.pattern,message:I,ref:o,...be(ae.pattern,I)},!s))return me(I),B}if(fe){if(ee(fe)){const C=await fe(E,r),I=Ht(C,he);if(I&&(B[Q]={...I,...be(ae.validate,I.message)},!s))return me(I.message),B}else if(M(fe)){let C={};for(const I in fe){if(!W(C)&&!s)break;const Z=Ht(await fe[I](E,r),he,I);Z&&(C={...Z,...be(I,Z.message)},me(Z.message),s&&(B[Q]=C))}if(!W(C)&&(B[Q]={ref:he,...C},!s))return B}}return me(!0),B};const ts={mode:ie.onSubmit,reValidateMode:ie.onChange,shouldFocusError:!0},kr={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function rs(t={}){let e={...ts,...t},r={...$(kr),isLoading:ee(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1},s={},i=M(e.defaultValues)||M(e.values)?$(e.defaultValues||e.values)||{}:{},a=e.shouldUnregister?{}:$(i),o={action:!1,mount:!1,watch:!1,keepIsValid:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},h,p=0;const T={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},R={...T};let L={...R};const O={array:Lt(),state:Lt()},fe=e.criteriaMode===ie.all,Q=n=>u=>{clearTimeout(p),p=setTimeout(n,u)},re=async n=>{if(!o.keepIsValid&&!e.disabled&&(R.isValid||L.isValid||n)){let u;e.resolver?(u=W((await ne()).errors),K()):u=await C({fields:s,onlyCheckValid:!0,eventType:Te.VALID}),u!==r.isValid&&O.state.next({isValid:u})}},K=(n,u)=>{!e.disabled&&(R.isValidating||R.validatingFields||L.isValidating||L.validatingFields)&&((n||Array.from(d.mount)).forEach(l=>{l&&(u?D(r.validatingFields,l,u):P(r.validatingFields,l))}),O.state.next({validatingFields:r.validatingFields,isValidating:!W(r.validatingFields)}))},E=()=>{r.dirtyFields=je(i,a)},he=(n,u=[],l,y,m=!0,f=!0)=>{if(y&&l&&!e.disabled){if(o.action=!0,f&&Array.isArray(v(s,n))){const _=l(v(s,n),y.argA,y.argB);m&&D(s,n,_)}if(f&&Array.isArray(v(r.errors,n))){const _=l(v(r.errors,n),y.argA,y.argB);m&&D(r.errors,n,_),Kr(r.errors,n)}if((R.touchedFields||L.touchedFields)&&f&&Array.isArray(v(r.touchedFields,n))){const _=l(v(r.touchedFields,n),y.argA,y.argB);m&&D(r.touchedFields,n,_)}(R.dirtyFields||L.dirtyFields)&&E(),O.state.next({name:n,isDirty:Z(n,u),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else D(a,n,u)},me=(n,u)=>{D(r.errors,n,u),O.state.next({errors:r.errors})},B=n=>{r.errors=n,O.state.next({errors:r.errors,isValid:!1})},Ne=(n,u,l,y)=>{const m=v(s,n);if(m){const f=j(v(a,n)),_=v(a,n,j(l)?v(i,n):l);j(_)||y&&y.defaultChecked||u?D(a,n,u?_:Ut(m._f)):se(n,_),o.mount&&!o.action&&(re(),f&&r.isDirty&&(R.isDirty||L.isDirty)&&(Z()||(r.isDirty=!1,O.state.next({...r}))))}},Fe=(n,u,l,y,m)=>{let f=!1,_=!1;const A={name:n};if(!e.disabled){if(!l||y){(R.isDirty||L.isDirty)&&(_=r.isDirty,r.isDirty=A.isDirty=Z(),f=_!==A.isDirty);const S=le(v(i,n),u);_=!!v(r.dirtyFields,n),S?P(r.dirtyFields,n):D(r.dirtyFields,n,!0),A.dirtyFields=r.dirtyFields,f=f||(R.dirtyFields||L.dirtyFields)&&_!==!S}if(l){const S=v(r.touchedFields,n);S||(D(r.touchedFields,n,l),A.touchedFields=r.touchedFields,f=f||(R.touchedFields||L.touchedFields)&&S!==l)}f&&m&&O.state.next(A)}return f?A:{}},et=(n,u,l,y)=>{const m=v(r.errors,n),f=(R.isValid||L.isValid)&&ue(u)&&r.isValid!==u;if(e.delayError&&l?(h=Q(()=>me(n,l)),h(e.delayError)):(clearTimeout(p),h=null,l?D(r.errors,n,l):P(r.errors,n)),(l?!le(m,l):m)||!W(y)||f){const _={...y,...f&&ue(u)?{isValid:u}:{},errors:r.errors,name:n};r={...r,..._},O.state.next(_)}},ne=async n=>(K(n,!0),await e.resolver(a,e.context,Hr(n||d.mount,s,e.criteriaMode,e.shouldUseNativeValidation))),be=async n=>{const{errors:u}=await ne(n);if(K(n),n)for(const l of n){const y=v(u,l);y?D(r.errors,l,y):P(r.errors,l)}else r.errors=u;return u},Ie=async({name:n,eventType:u})=>{if(t.validate){const l=await t.validate({formValues:a,formState:r,name:n,eventType:u});if(M(l))for(const y in l)l[y]&&We(`${dt}.${y}`,{message:q(l.message)?l.message:"",type:ae.validate});else q(l)||!l?We(dt,{message:l||"",type:ae.validate}):St(dt);return l}return!0},C=async({fields:n,onlyCheckValid:u,name:l,eventType:y,context:m={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(m.runRootValidation=!0,!await Ie({name:l,eventType:y})&&(m.valid=!1,u)))return m.valid;for(const f in n){const _=n[f];if(_){const{_f:A,...S}=_;if(A){const H=d.array.has(A.name),de=_._f&&Gr(_._f);de&&R.validatingFields&&K([A.name],!0);const J=await Gt(_,d.disabled,a,fe,e.shouldUseNativeValidation&&!u,H);if(de&&R.validatingFields&&K([A.name]),J[A.name]&&(m.valid=!1,u)||(!u&&(v(J,A.name)?H?es(r.errors,J,A.name):D(r.errors,A.name,J[A.name]):P(r.errors,A.name)),t.shouldUseNativeValidation&&J[A.name]))break}!W(S)&&await C({context:m,onlyCheckValid:u,fields:S,name:f,eventType:y})}}return m.valid},I=()=>{for(const n of d.unMount){const u=v(s,n);u&&(u._f.refs?u._f.refs.every(l=>!ut(l)):!ut(u._f.ref))&&st(n)}d.unMount=new Set},Z=(n,u)=>!e.disabled&&(n&&u&&D(a,n,u),!le(Ot(),i)),z=(n,u,l)=>Pr(n,d,{...o.mount?a:j(u)?i:q(n)?{[n]:u}:u},l,u),oe=n=>xt(v(o.mount?a:i,n,e.shouldUnregister?v(i,n,[]):[])),se=(n,u,l={})=>{const y=v(s,n);let m=u;if(y){const f=y._f;f&&(!f.disabled&&D(a,n,vr(u,f)),m=qe(f.ref)&&Y(u)?"":u,pr(f.ref)?[...f.ref.options].forEach(_=>_.selected=m.includes(_.value)):f.refs?ze(f.ref)?f.refs.forEach(_=>{(!_.defaultChecked||!_.disabled)&&(Array.isArray(m)?_.checked=!!m.find(A=>A===_.value):_.checked=m===_.value||!!m)}):f.refs.forEach(_=>_.checked=_.value===m):bt(f.ref)?f.ref.value="":(f.ref.value=m,f.ref.type||O.state.next({name:n,values:$(a)})))}(l.shouldDirty||l.shouldTouch)&&Fe(n,m,l.shouldTouch,l.shouldDirty,!0),l.shouldValidate&&rt(n)},De=(n,u,l)=>{for(const y in u){if(!u.hasOwnProperty(y))return;const m=u[y],f=n+"."+y,_=v(s,f);(d.array.has(n)||M(m)||_&&!_._f)&&!we(m)?De(f,m,l):se(f,m,l)}},pe=(n,u,l={})=>{const y=v(s,n),m=d.array.has(n),f=$(u),_=v(a,n),A=le(_,f);if(D(a,n,f),m)O.array.next({name:n,values:$(a)}),(R.isDirty||R.dirtyFields||L.isDirty||L.dirtyFields)&&l.shouldDirty&&(E(),O.state.next({name:n,dirtyFields:r.dirtyFields,isDirty:Z(n,f)}));else{const S=Array.isArray(f)&&!f.length||W(f);!y||y._f||Y(f)||S?se(n,f,l):De(n,f,l)}if(!A){const S=Wt(n,d);O.state.next({...S&&r,name:o.mount||S?n:void 0,values:$(a)})}},tt=n=>{const u=ee(n)?n(a):n;le(a,u)||(a={...a,...u},O.state.next({...r,values:a}))},Tt=async n=>{o.mount=!0;const u=n.target;let l=u.name,y=!0;const m=v(s,l),f=S=>{y=Number.isNaN(S)||we(S)&&isNaN(S.getTime())||le(S,v(a,l,S))},_=Bt(e.mode),A=Bt(e.reValidateMode);if(m){let S,H;const de=u.type?Ut(m._f):Dr(n),J=n.type===Te.BLUR||n.type===Te.FOCUS_OUT,Nr=!Yr(m._f)&&!t.validate&&!e.resolver&&!v(r.errors,l)&&!m._f.deps||Xr(J,v(r.touchedFields,l),r.isSubmitted,A,_),nt=Wt(l,d,J);D(a,l,de),J?(!u||!u.readOnly)&&(m._f.onBlur&&m._f.onBlur(n),h&&h(0)):m._f.onChange&&m._f.onChange(n);const ot=Fe(l,de,J),Fr=!W(ot)||nt;if(!J&&O.state.next({name:l,type:n.type,values:$(a)}),Nr)return(R.isValid||L.isValid)&&(e.mode==="onBlur"?J&&re():J||re()),Fr&&O.state.next({name:l,...nt?{}:ot});if(!e.resolver&&t.validate&&await Ie({name:l,eventType:n.type}),!J&&nt&&O.state.next({...r}),e.resolver){const{errors:Zt}=await ne([l]);if(K([l]),f(de),y){const Ir=qt(r.errors,s,l),jt=qt(Zt,s,Ir.name||l);S=jt.error,l=jt.name,H=W(Zt)}}else K([l],!0),S=(await Gt(m,d.disabled,a,fe,e.shouldUseNativeValidation))[l],K([l]),f(de),y&&(S?H=!1:(R.isValid||L.isValid)&&(H=await C({fields:s,onlyCheckValid:!0,name:l,eventType:n.type})));y&&(m._f.deps&&(!Array.isArray(m._f.deps)||m._f.deps.length>0)&&rt(m._f.deps),et(l,H,S,ot))}},Vt=(n,u)=>{if(v(r.errors,u)&&n.focus)return n.focus(),1},rt=async(n,u={})=>{let l,y;const m=Me(n);if(e.resolver){const f=await be(j(n)?n:m);l=W(f),y=n?!m.some(_=>v(f,_)):l}else n?(y=(await Promise.all(m.map(async f=>{const _=v(s,f);return await C({fields:_&&_._f?{[f]:_}:_,eventType:Te.TRIGGER})}))).every(Boolean),!(!y&&!r.isValid)&&re()):y=l=await C({fields:s,name:n,eventType:Te.TRIGGER});return O.state.next({...!q(n)||(R.isValid||L.isValid)&&l!==r.isValid?{}:{name:n},...e.resolver||!n?{isValid:l}:{},errors:r.errors}),u.shouldFocus&&!y&&$e(s,Vt,n?m:d.mount),y},Ot=(n,u)=>{let l={...o.mount?a:i};return u&&(l=yr(u.dirtyFields?r.dirtyFields:r.touchedFields,l)),j(n)?l:q(n)?v(l,n):n.map(y=>v(l,y))},Ct=(n,u)=>({invalid:!!v((u||r).errors,n),isDirty:!!v((u||r).dirtyFields,n),error:v((u||r).errors,n),isValidating:!!v(r.validatingFields,n),isTouched:!!v((u||r).touchedFields,n)}),St=n=>{const u=n?Me(n):void 0;u?.forEach(l=>P(r.errors,l)),u?u.forEach(l=>{O.state.next({name:l,errors:r.errors})}):O.state.next({errors:{}})},We=(n,u,l)=>{const y=(v(s,n,{_f:{}})._f||{}).ref,m=v(r.errors,n)||{},{ref:f,message:_,type:A,...S}=m;D(r.errors,n,{...S,...u,ref:y}),O.state.next({name:n,errors:r.errors,isValid:!1}),l&&l.shouldFocus&&y&&y.focus&&y.focus()},Vr=(n,u)=>ee(n)?O.state.subscribe({next:l=>"values"in l&&n(l.values||z(void 0,u),l)}):z(n,u,!0),Et=n=>O.state.subscribe({next:u=>{if(Qr(n.name,u.name,n.exact)&&Jr(u,n.formState||R,Rr,n.reRenderRoot)){const l={...a};n.callback({values:l,...r,...u,defaultValues:i})}}}).unsubscribe,Or=n=>(o.mount=!0,L={...L,...n.formState},Et({...n,formState:{...T,...n.formState}})),st=(n,u={})=>{for(const l of n?Me(n):d.mount)d.mount.delete(l),d.array.delete(l),u.keepValue||(P(s,l),P(a,l)),!u.keepError&&P(r.errors,l),!u.keepDirty&&P(r.dirtyFields,l),!u.keepTouched&&P(r.touchedFields,l),!u.keepIsValidating&&P(r.validatingFields,l),!e.shouldUnregister&&!u.keepDefaultValue&&P(i,l);O.state.next({values:$(a)}),O.state.next({...r,...u.keepDirty?{isDirty:Z()}:{}}),!u.keepIsValid&&re()},Rt=({disabled:n,name:u})=>{if(ue(n)&&o.mount||n||d.disabled.has(u)){const m=d.disabled.has(u)!==!!n;n?d.disabled.add(u):d.disabled.delete(u),m&&o.mount&&!o.action&&re()}},at=(n,u={})=>{let l=v(s,n);const y=ue(u.disabled)||ue(e.disabled),m=!d.registerName.has(n)&&l&&l._f&&!l._f.mount;return D(s,n,{...l||{},_f:{...l&&l._f?l._f:{ref:{name:n}},name:n,mount:!0,...u}}),d.mount.add(n),l&&!m?Rt({disabled:ue(u.disabled)?u.disabled:e.disabled,name:n}):Ne(n,!0,u.value),{...y?{disabled:u.disabled||e.disabled}:{},...e.progressive?{required:!!u.required,min:Ze(u.min),max:Ze(u.max),minLength:Ze(u.minLength),maxLength:Ze(u.maxLength),pattern:Ze(u.pattern)}:{},name:n,onChange:Tt,onBlur:Tt,ref:f=>{if(f){d.registerName.add(n),at(n,u),d.registerName.delete(n),l=v(s,n);const _=j(f.value)&&f.querySelectorAll&&f.querySelectorAll("input,select,textarea")[0]||f,A=Br(_),S=l._f.refs||[];if(A?S.find(H=>H===_):_===l._f.ref)return;D(s,n,{_f:{...l._f,...A?{refs:[...S.filter(ut),_,...Array.isArray(v(i,n))?[{}]:[]],ref:{type:_.type,name:n}}:{ref:_}}}),Ne(n,!1,void 0,_)}else l=v(s,n,{}),l._f&&(l._f.mount=!1),(e.shouldUnregister||u.shouldUnregister)&&!(Zr(d.array,n)&&o.action)&&d.unMount.add(n)}}},it=()=>e.shouldFocusError&&$e(s,Vt,d.mount),Cr=n=>{ue(n)&&(O.state.next({disabled:n}),$e(s,(u,l)=>{const y=v(s,l);y&&(u.disabled=y._f.disabled||n,Array.isArray(y._f.refs)&&y._f.refs.forEach(m=>{m.disabled=y._f.disabled||n}))},0,!1))},Nt=(n,u)=>async l=>{let y;l&&(l.preventDefault&&l.preventDefault(),l.persist&&l.persist());let m=$(a);if(O.state.next({isSubmitting:!0}),e.resolver){const{errors:f,values:_}=await ne();K(),r.errors=f,m=$(_)}else await C({fields:s,eventType:Te.SUBMIT});if(d.disabled.size)for(const f of d.disabled)P(m,f);if(P(r.errors,hr),W(r.errors)){O.state.next({errors:{}});try{await n(m,l)}catch(f){y=f}}else u&&await u({...r.errors},l),it(),setTimeout(it);if(O.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:W(r.errors)&&!y,submitCount:r.submitCount+1,errors:r.errors}),y)throw y},Sr=(n,u={})=>{v(s,n)&&(j(u.defaultValue)?pe(n,$(v(i,n))):(pe(n,u.defaultValue),D(i,n,$(u.defaultValue))),u.keepTouched||P(r.touchedFields,n),u.keepDirty||(P(r.dirtyFields,n),r.isDirty=u.defaultValue?Z(n,$(v(i,n))):Z()),u.keepError||(P(r.errors,n),R.isValid&&re()),O.state.next({...r}))},Ft=(n,u={})=>{const l=n?$(n):i,y=$(l),m=W(n),f=m?i:y;if(u.keepDefaultValues||(i=l),!u.keepValues){if(u.keepDirtyValues){const _=new Set([...d.mount,...Object.keys(je(i,a))]);for(const A of Array.from(_)){const S=v(r.dirtyFields,A),H=v(a,A),de=v(f,A);S&&!j(H)?D(f,A,H):!S&&!j(de)&&pe(A,de)}}else{if(vt&&j(n))for(const _ of d.mount){const A=v(s,_);if(A&&A._f){const S=Array.isArray(A._f.refs)?A._f.refs[0]:A._f.ref;if(qe(S)){const H=S.closest("form");if(H){H.reset();break}}}}if(u.keepFieldsRef)for(const _ of d.mount)pe(_,v(f,_));else s={}}a=e.shouldUnregister?u.keepDefaultValues?$(i):{}:$(f),O.array.next({values:{...f}}),O.state.next({values:{...f}})}d={mount:u.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!R.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!e.shouldUnregister&&!W(f),o.watch=!!e.shouldUnregister,o.keepIsValid=!!u.keepIsValid,o.action=!1,u.keepErrors||(r.errors={}),O.state.next({submitCount:u.keepSubmitCount?r.submitCount:0,isDirty:m?!1:u.keepDirty?r.isDirty:!!(u.keepDefaultValues&&!le(n,i)),isSubmitted:u.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:m?{}:u.keepDirtyValues?u.keepDefaultValues&&a?je(i,a):r.dirtyFields:u.keepDefaultValues&&n?je(i,n):u.keepDirty?r.dirtyFields:{},touchedFields:u.keepTouched?r.touchedFields:{},errors:u.keepErrors?r.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},It=(n,u)=>Ft(ee(n)?n(a):n,{...e.resetOptions,...u}),Er=(n,u={})=>{const l=v(s,n),y=l&&l._f;if(y){const m=y.refs?y.refs[0]:y.ref;m.focus&&setTimeout(()=>{m.focus(),u.shouldSelect&&ee(m.select)&&m.select()})}},Rr=n=>{r={...r,...n}},Dt={control:{register:at,unregister:st,getFieldState:Ct,handleSubmit:Nt,setError:We,_subscribe:Et,_runSchema:ne,_updateIsValidating:K,_focusError:it,_getWatch:z,_getDirty:Z,_setValid:re,_setFieldArray:he,_setDisabledField:Rt,_setErrors:B,_getFieldArray:oe,_reset:Ft,_resetDefaultValues:()=>ee(e.defaultValues)&&e.defaultValues().then(n=>{It(n,e.resetOptions),O.state.next({isLoading:!1})}),_removeUnmounted:I,_disableForm:Cr,_subjects:O,_proxyFormState:R,get _fields(){return s},get _formValues(){return a},get _state(){return o},set _state(n){o=n},get _defaultValues(){return i},get _names(){return d},set _names(n){d=n},get _formState(){return r},get _options(){return e},set _options(n){e={...e,...n}}},subscribe:Or,trigger:rt,register:at,handleSubmit:Nt,watch:Vr,setValue:pe,setValues:tt,getValues:Ot,reset:It,resetField:Sr,clearErrors:St,unregister:st,setError:We,setFocus:Er,getFieldState:Ct};return{...Dt,formControl:Dt}}function Is(t={}){const e=G.useRef(void 0),r=G.useRef(void 0),[s,i]=G.useState(()=>({...$(kr),isLoading:ee(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:ee(t.defaultValues)?void 0:t.defaultValues}));if(!e.current)if(t.formControl)e.current={...t.formControl,formState:s},t.defaultValues&&!ee(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...d}=rs(t);e.current={...d,formState:s}}const a=e.current.control;return a._options=t,$r(()=>{const o=a._subscribe({formState:a._proxyFormState,callback:()=>i({...a._formState}),reRenderRoot:!0});return i(d=>({...d,isReady:!0})),a._formState.isReady=!0,o},[a]),G.useEffect(()=>a._disableForm(t.disabled),[a,t.disabled]),G.useEffect(()=>{t.mode&&(a._options.mode=t.mode),t.reValidateMode&&(a._options.reValidateMode=t.reValidateMode)},[a,t.mode,t.reValidateMode]),G.useEffect(()=>{t.errors&&(a._setErrors(t.errors),a._focusError())},[a,t.errors]),G.useEffect(()=>{t.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,t.shouldUnregister]),G.useEffect(()=>{if(a._proxyFormState.isDirty){const o=a._getDirty();o!==s.isDirty&&a._subjects.state.next({isDirty:o})}},[a,s.isDirty]),G.useEffect(()=>{var o;t.values&&!le(t.values,r.current)?(a._reset(t.values,{keepFieldsRef:!0,...a._options.resetOptions}),!((o=a._options.resetOptions)===null||o===void 0)&&o.keepIsValid||a._setValid(),r.current=t.values,i(d=>({...d}))):a._resetDefaultValues()},[a,t.values]),G.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),e.current.formState=G.useMemo(()=>Mr(s,a),[a,s]),e.current}const Yt=(t,e,r)=>{if(t&&"reportValidity"in t){const s=v(r,e);t.setCustomValidity(s&&s.message||""),t.reportValidity()}},br=(t,e)=>{for(const r in e.fields){const s=e.fields[r];s&&s.ref&&"reportValidity"in s.ref?Yt(s.ref,r,t):s.refs&&s.refs.forEach(i=>Yt(i,r,t))}},ss=(t,e)=>{e.shouldUseNativeValidation&&br(t,e);const r={};for(const s in t){const i=v(e.fields,s),a=Object.assign(t[s]||{},{ref:i&&i.ref});if(as(e.names||Object.keys(t),s)){const o=Object.assign({},v(r,s));D(o,"root",a),D(r,s,o)}else D(r,s,a)}return r},as=(t,e)=>t.some(r=>r.startsWith(e+"."));var is=function(t,e){for(var r={};t.length;){var s=t[0],i=s.code,a=s.message,o=s.path.join(".");if(!r[o])if("unionErrors"in s){var d=s.unionErrors[0].errors[0];r[o]={message:d.message,type:d.code}}else r[o]={message:a,type:i};if("unionErrors"in s&&s.unionErrors.forEach(function(T){return T.errors.forEach(function(R){return t.push(R)})}),e){var h=r[o].types,p=h&&h[s.code];r[o]=mr(o,e,r,i,p?[].concat(p,s.message):s.message)}t.shift()}return r},Ds=function(t,e,r){return r===void 0&&(r={}),function(s,i,a){try{return Promise.resolve((function(o,d){try{var h=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](s,e)).then(function(p){return a.shouldUseNativeValidation&&br({},a),{errors:{},values:r.raw?s:p}})}catch(p){return d(p)}return h&&h.then?h.then(void 0,d):h})(0,function(o){if((function(d){return Array.isArray(d?.errors)})(o))return{values:{},errors:ss(is(o.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw o}))}catch(o){return Promise.reject(o)}}},F;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(d=>typeof i[i[d]]!="number"),o={};for(const d of a)o[d]=i[d];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(const o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function s(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=s,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(F||(F={}));var Jt;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Jt||(Jt={}));const x=F.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ge=t=>{switch(typeof t){case"undefined":return x.undefined;case"string":return x.string;case"number":return Number.isNaN(t)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(t)?x.array:t===null?x.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?x.promise:typeof Map<"u"&&t instanceof Map?x.map:typeof Set<"u"&&t instanceof Set?x.set:typeof Date<"u"&&t instanceof Date?x.date:x.object;default:return x.unknown}},c=F.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ye extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(a){return a.message},s={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)s._errors.push(r(o));else{let d=s,h=0;for(;h<o.path.length;){const p=o.path[h];h===o.path.length-1?(d[p]=d[p]||{_errors:[]},d[p]._errors.push(r(o))):d[p]=d[p]||{_errors:[]},d=d[p],h++}}};return i(this),s}static assert(e){if(!(e instanceof ye))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},s=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];r[a]=r[a]||[],r[a].push(e(i))}else s.push(e(i));return{formErrors:s,fieldErrors:r}}get formErrors(){return this.flatten()}}ye.create=t=>new ye(t);const mt=(t,e)=>{let r;switch(t.code){case c.invalid_type:t.received===x.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case c.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,F.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:r=`Unrecognized key(s) in object: ${F.joinValues(t.keys,", ")}`;break;case c.invalid_union:r="Invalid input";break;case c.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${F.joinValues(t.options)}`;break;case c.invalid_enum_value:r=`Invalid enum value. Expected ${F.joinValues(t.options)}, received '${t.received}'`;break;case c.invalid_arguments:r="Invalid function arguments";break;case c.invalid_return_type:r="Invalid function return type";break;case c.invalid_date:r="Invalid date";break;case c.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:F.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case c.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case c.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case c.custom:r="Invalid input";break;case c.invalid_intersection_types:r="Intersection results could not be merged";break;case c.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case c.not_finite:r="Number must be finite";break;default:r=e.defaultError,F.assertNever(t)}return{message:r}};let ns=mt;function os(){return ns}const ds=t=>{const{data:e,path:r,errorMaps:s,issueData:i}=t,a=[...r,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let d="";const h=s.filter(p=>!!p).slice().reverse();for(const p of h)d=p(o,{data:e,defaultError:d}).message;return{...i,path:a,message:d}};function g(t,e){const r=os(),s=ds({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===mt?void 0:mt].filter(i=>!!i)});t.common.issues.push(s)}class X{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const s=[];for(const i of r){if(i.status==="aborted")return b;i.status==="dirty"&&e.dirty(),s.push(i.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,r){const s=[];for(const i of r){const a=await i.key,o=await i.value;s.push({key:a,value:o})}return X.mergeObjectSync(e,s)}static mergeObjectSync(e,r){const s={};for(const i of r){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return b;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(s[a.value]=o.value)}return{status:e.value,value:s}}}const b=Object.freeze({status:"aborted"}),Le=t=>({status:"dirty",value:t}),te=t=>({status:"valid",value:t}),Qt=t=>t.status==="aborted",Xt=t=>t.status==="dirty",Ce=t=>t.status==="valid",Ge=t=>typeof Promise<"u"&&t instanceof Promise;var k;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(k||(k={}));class xe{constructor(e,r,s,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=s,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Kt=(t,e)=>{if(Ce(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new ye(t.common.issues);return this._error=r,this._error}}};function V(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:s,description:i}=t;if(e&&(r||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,d)=>{const{message:h}=t;return o.code==="invalid_enum_value"?{message:h??d.defaultError}:typeof d.data>"u"?{message:h??s??d.defaultError}:o.code!=="invalid_type"?{message:d.defaultError}:{message:h??r??d.defaultError}},description:i}}class N{get description(){return this._def.description}_getType(e){return ge(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ge(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new X,ctx:{common:e.parent.common,data:e.data,parsedType:ge(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ge(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const s=this.safeParse(e,r);if(s.success)return s.data;throw s.error}safeParse(e,r){const s={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)},i=this._parseSync({data:e,path:s.path,parent:s});return Kt(s,i)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:r});return Ce(s)?{value:s.value}:{issues:r.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(s=>Ce(s)?{value:s.value}:{issues:r.common.issues})}async parseAsync(e,r){const s=await this.safeParseAsync(e,r);if(s.success)return s.data;throw s.error}async safeParseAsync(e,r){const s={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ge(e)},i=this._parse({data:e,path:s.path,parent:s}),a=await(Ge(i)?i:Promise.resolve(i));return Kt(s,a)}refine(e,r){const s=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,a)=>{const o=e(i),d=()=>a.addIssue({code:c.custom,...s(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(h=>h?!0:(d(),!1)):o?!0:(d(),!1)})}refinement(e,r){return this._refinement((s,i)=>e(s)?!0:(i.addIssue(typeof r=="function"?r(s,i):r),!1))}_refinement(e){return new Ee({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ve.create(this,this._def)}nullable(){return Re.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ce.create(this)}promise(){return Xe.create(this,this._def)}or(e){return Je.create([this,e],this._def)}and(e){return Qe.create(this,e,this._def)}transform(e){return new Ee({...V(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new pt({...V(this._def),innerType:this,defaultValue:r,typeName:w.ZodDefault})}brand(){return new Rs({typeName:w.ZodBranded,type:this,...V(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new gt({...V(this._def),innerType:this,catchValue:r,typeName:w.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return At.create(this,e)}readonly(){return _t.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const us=/^c[^\s-]{8,}$/i,ls=/^[0-9a-z]+$/,cs=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fs=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,hs=/^[a-z0-9_-]{21}$/i,ms=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ys=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ps=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,gs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let lt;const _s=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vs=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,xs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ks=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,bs=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ws=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,wr="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",As=new RegExp(`^${wr}$`);function Ar(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Ts(t){return new RegExp(`^${Ar(t)}$`)}function Vs(t){let e=`${wr}T${Ar(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Os(t,e){return!!((e==="v4"||!e)&&_s.test(t)||(e==="v6"||!e)&&xs.test(t))}function Cs(t,e){if(!ms.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const s=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(s));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Ss(t,e){return!!((e==="v4"||!e)&&vs.test(t)||(e==="v6"||!e)&&ks.test(t))}class _e extends N{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==x.string){const a=this._getOrReturnCtx(e);return g(a,{code:c.invalid_type,expected:x.string,received:a.parsedType}),b}const s=new X;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,d=e.data.length<a.value;(o||d)&&(i=this._getOrReturnCtx(e,i),o?g(i,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):d&&g(i,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")ps.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")lt||(lt=new RegExp(gs,"u")),lt.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")fs.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="nanoid")hs.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"nanoid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")us.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")ls.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")cs.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),g(i,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),g(i,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),g(i,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?Vs(a).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="date"?As.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:c.invalid_string,validation:"date",message:a.message}),s.dirty()):a.kind==="time"?Ts(a).test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{code:c.invalid_string,validation:"time",message:a.message}),s.dirty()):a.kind==="duration"?ys.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"duration",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="ip"?Os(e.data,a.version)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="jwt"?Cs(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"jwt",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="cidr"?Ss(e.data,a.version)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"cidr",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64"?bs.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"base64",code:c.invalid_string,message:a.message}),s.dirty()):a.kind==="base64url"?ws.test(e.data)||(i=this._getOrReturnCtx(e,i),g(i,{validation:"base64url",code:c.invalid_string,message:a.message}),s.dirty()):F.assertNever(a);return{status:s.value,value:e.data}}_regex(e,r,s){return this.refinement(i=>e.test(i),{validation:r,code:c.invalid_string,...k.errToObj(s)})}_addCheck(e){return new _e({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...k.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...k.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...k.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...k.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...k.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...k.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...k.errToObj(r)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new _e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}_e.create=t=>new _e({checks:[],typeName:w.ZodString,coerce:t?.coerce??!1,...V(t)});function Es(t,e){const r=(t.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,i=r>s?r:s,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}class Pe extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==x.number){const a=this._getOrReturnCtx(e);return g(a,{code:c.invalid_type,expected:x.number,received:a.parsedType}),b}let s;const i=new X;for(const a of this._def.checks)a.kind==="int"?F.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?Es(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),g(s,{code:c.not_finite,message:a.message}),i.dirty()):F.assertNever(a);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,s,i){return new Pe({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:k.toString(i)}]})}_addCheck(e){return new Pe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&F.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(r===null||s.value>r)&&(r=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Pe.create=t=>new Pe({checks:[],typeName:w.ZodNumber,coerce:t?.coerce||!1,...V(t)});class Ue extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==x.bigint)return this._getInvalidInput(e);let s;const i=new X;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),g(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):F.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return g(r,{code:c.invalid_type,expected:x.bigint,received:r.parsedType}),b}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,s,i){return new Ue({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:s,message:k.toString(i)}]})}_addCheck(e){return new Ue({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Ue.create=t=>new Ue({checks:[],typeName:w.ZodBigInt,coerce:t?.coerce??!1,...V(t)});class er extends N{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==x.boolean){const s=this._getOrReturnCtx(e);return g(s,{code:c.invalid_type,expected:x.boolean,received:s.parsedType}),b}return te(e.data)}}er.create=t=>new er({typeName:w.ZodBoolean,coerce:t?.coerce||!1,...V(t)});class Ye extends N{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==x.date){const a=this._getOrReturnCtx(e);return g(a,{code:c.invalid_type,expected:x.date,received:a.parsedType}),b}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return g(a,{code:c.invalid_date}),b}const s=new X;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),g(i,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):F.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ye({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Ye.create=t=>new Ye({checks:[],coerce:t?.coerce||!1,typeName:w.ZodDate,...V(t)});class tr extends N{_parse(e){if(this._getType(e)!==x.symbol){const s=this._getOrReturnCtx(e);return g(s,{code:c.invalid_type,expected:x.symbol,received:s.parsedType}),b}return te(e.data)}}tr.create=t=>new tr({typeName:w.ZodSymbol,...V(t)});class rr extends N{_parse(e){if(this._getType(e)!==x.undefined){const s=this._getOrReturnCtx(e);return g(s,{code:c.invalid_type,expected:x.undefined,received:s.parsedType}),b}return te(e.data)}}rr.create=t=>new rr({typeName:w.ZodUndefined,...V(t)});class sr extends N{_parse(e){if(this._getType(e)!==x.null){const s=this._getOrReturnCtx(e);return g(s,{code:c.invalid_type,expected:x.null,received:s.parsedType}),b}return te(e.data)}}sr.create=t=>new sr({typeName:w.ZodNull,...V(t)});class ar extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return te(e.data)}}ar.create=t=>new ar({typeName:w.ZodAny,...V(t)});class ir extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return te(e.data)}}ir.create=t=>new ir({typeName:w.ZodUnknown,...V(t)});class ke extends N{_parse(e){const r=this._getOrReturnCtx(e);return g(r,{code:c.invalid_type,expected:x.never,received:r.parsedType}),b}}ke.create=t=>new ke({typeName:w.ZodNever,...V(t)});class nr extends N{_parse(e){if(this._getType(e)!==x.undefined){const s=this._getOrReturnCtx(e);return g(s,{code:c.invalid_type,expected:x.void,received:s.parsedType}),b}return te(e.data)}}nr.create=t=>new nr({typeName:w.ZodVoid,...V(t)});class ce extends N{_parse(e){const{ctx:r,status:s}=this._processInputParams(e),i=this._def;if(r.parsedType!==x.array)return g(r,{code:c.invalid_type,expected:x.array,received:r.parsedType}),b;if(i.exactLength!==null){const o=r.data.length>i.exactLength.value,d=r.data.length<i.exactLength.value;(o||d)&&(g(r,{code:o?c.too_big:c.too_small,minimum:d?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),s.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(g(r,{code:c.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),s.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(g(r,{code:c.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),s.dirty()),r.common.async)return Promise.all([...r.data].map((o,d)=>i.type._parseAsync(new xe(r,o,r.path,d)))).then(o=>X.mergeArray(s,o));const a=[...r.data].map((o,d)=>i.type._parseSync(new xe(r,o,r.path,d)));return X.mergeArray(s,a)}get element(){return this._def.type}min(e,r){return new ce({...this._def,minLength:{value:e,message:k.toString(r)}})}max(e,r){return new ce({...this._def,maxLength:{value:e,message:k.toString(r)}})}length(e,r){return new ce({...this._def,exactLength:{value:e,message:k.toString(r)}})}nonempty(e){return this.min(1,e)}}ce.create=(t,e)=>new ce({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...V(e)});function Oe(t){if(t instanceof U){const e={};for(const r in t.shape){const s=t.shape[r];e[r]=ve.create(Oe(s))}return new U({...t._def,shape:()=>e})}else return t instanceof ce?new ce({...t._def,type:Oe(t.element)}):t instanceof ve?ve.create(Oe(t.unwrap())):t instanceof Re?Re.create(Oe(t.unwrap())):t instanceof Ae?Ae.create(t.items.map(e=>Oe(e))):t}class U extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=F.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==x.object){const p=this._getOrReturnCtx(e);return g(p,{code:c.invalid_type,expected:x.object,received:p.parsedType}),b}const{status:s,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),d=[];if(!(this._def.catchall instanceof ke&&this._def.unknownKeys==="strip"))for(const p in i.data)o.includes(p)||d.push(p);const h=[];for(const p of o){const T=a[p],R=i.data[p];h.push({key:{status:"valid",value:p},value:T._parse(new xe(i,R,i.path,p)),alwaysSet:p in i.data})}if(this._def.catchall instanceof ke){const p=this._def.unknownKeys;if(p==="passthrough")for(const T of d)h.push({key:{status:"valid",value:T},value:{status:"valid",value:i.data[T]}});else if(p==="strict")d.length>0&&(g(i,{code:c.unrecognized_keys,keys:d}),s.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const p=this._def.catchall;for(const T of d){const R=i.data[T];h.push({key:{status:"valid",value:T},value:p._parse(new xe(i,R,i.path,T)),alwaysSet:T in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const p=[];for(const T of h){const R=await T.key,L=await T.value;p.push({key:R,value:L,alwaysSet:T.alwaysSet})}return p}).then(p=>X.mergeObjectSync(s,p)):X.mergeObjectSync(s,h)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new U({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,s)=>{const i=this._def.errorMap?.(r,s).message??s.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new U({...this._def,unknownKeys:"strip"})}passthrough(){return new U({...this._def,unknownKeys:"passthrough"})}extend(e){return new U({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new U({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new U({...this._def,catchall:e})}pick(e){const r={};for(const s of F.objectKeys(e))e[s]&&this.shape[s]&&(r[s]=this.shape[s]);return new U({...this._def,shape:()=>r})}omit(e){const r={};for(const s of F.objectKeys(this.shape))e[s]||(r[s]=this.shape[s]);return new U({...this._def,shape:()=>r})}deepPartial(){return Oe(this)}partial(e){const r={};for(const s of F.objectKeys(this.shape)){const i=this.shape[s];e&&!e[s]?r[s]=i:r[s]=i.optional()}return new U({...this._def,shape:()=>r})}required(e){const r={};for(const s of F.objectKeys(this.shape))if(e&&!e[s])r[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof ve;)a=a._def.innerType;r[s]=a}return new U({...this._def,shape:()=>r})}keyof(){return Tr(F.objectKeys(this.shape))}}U.create=(t,e)=>new U({shape:()=>t,unknownKeys:"strip",catchall:ke.create(),typeName:w.ZodObject,...V(e)});U.strictCreate=(t,e)=>new U({shape:()=>t,unknownKeys:"strict",catchall:ke.create(),typeName:w.ZodObject,...V(e)});U.lazycreate=(t,e)=>new U({shape:t,unknownKeys:"strip",catchall:ke.create(),typeName:w.ZodObject,...V(e)});class Je extends N{_parse(e){const{ctx:r}=this._processInputParams(e),s=this._def.options;function i(a){for(const d of a)if(d.result.status==="valid")return d.result;for(const d of a)if(d.result.status==="dirty")return r.common.issues.push(...d.ctx.common.issues),d.result;const o=a.map(d=>new ye(d.ctx.common.issues));return g(r,{code:c.invalid_union,unionErrors:o}),b}if(r.common.async)return Promise.all(s.map(async a=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const h of s){const p={...r,common:{...r.common,issues:[]},parent:null},T=h._parseSync({data:r.data,path:r.path,parent:p});if(T.status==="valid")return T;T.status==="dirty"&&!a&&(a={result:T,ctx:p}),p.common.issues.length&&o.push(p.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;const d=o.map(h=>new ye(h));return g(r,{code:c.invalid_union,unionErrors:d}),b}}get options(){return this._def.options}}Je.create=(t,e)=>new Je({options:t,typeName:w.ZodUnion,...V(e)});function yt(t,e){const r=ge(t),s=ge(e);if(t===e)return{valid:!0,data:t};if(r===x.object&&s===x.object){const i=F.objectKeys(e),a=F.objectKeys(t).filter(d=>i.indexOf(d)!==-1),o={...t,...e};for(const d of a){const h=yt(t[d],e[d]);if(!h.valid)return{valid:!1};o[d]=h.data}return{valid:!0,data:o}}else if(r===x.array&&s===x.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const o=t[a],d=e[a],h=yt(o,d);if(!h.valid)return{valid:!1};i.push(h.data)}return{valid:!0,data:i}}else return r===x.date&&s===x.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Qe extends N{_parse(e){const{status:r,ctx:s}=this._processInputParams(e),i=(a,o)=>{if(Qt(a)||Qt(o))return b;const d=yt(a.value,o.value);return d.valid?((Xt(a)||Xt(o))&&r.dirty(),{status:r.value,value:d.data}):(g(s,{code:c.invalid_intersection_types}),b)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Qe.create=(t,e,r)=>new Qe({left:t,right:e,typeName:w.ZodIntersection,...V(r)});class Ae extends N{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.array)return g(s,{code:c.invalid_type,expected:x.array,received:s.parsedType}),b;if(s.data.length<this._def.items.length)return g(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&s.data.length>this._def.items.length&&(g(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const a=[...s.data].map((o,d)=>{const h=this._def.items[d]||this._def.rest;return h?h._parse(new xe(s,o,s.path,d)):null}).filter(o=>!!o);return s.common.async?Promise.all(a).then(o=>X.mergeArray(r,o)):X.mergeArray(r,a)}get items(){return this._def.items}rest(e){return new Ae({...this._def,rest:e})}}Ae.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ae({items:t,typeName:w.ZodTuple,rest:null,...V(e)})};class or extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.map)return g(s,{code:c.invalid_type,expected:x.map,received:s.parsedType}),b;const i=this._def.keyType,a=this._def.valueType,o=[...s.data.entries()].map(([d,h],p)=>({key:i._parse(new xe(s,d,s.path,[p,"key"])),value:a._parse(new xe(s,h,s.path,[p,"value"]))}));if(s.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const h of o){const p=await h.key,T=await h.value;if(p.status==="aborted"||T.status==="aborted")return b;(p.status==="dirty"||T.status==="dirty")&&r.dirty(),d.set(p.value,T.value)}return{status:r.value,value:d}})}else{const d=new Map;for(const h of o){const p=h.key,T=h.value;if(p.status==="aborted"||T.status==="aborted")return b;(p.status==="dirty"||T.status==="dirty")&&r.dirty(),d.set(p.value,T.value)}return{status:r.value,value:d}}}}or.create=(t,e,r)=>new or({valueType:e,keyType:t,typeName:w.ZodMap,...V(r)});class Be extends N{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.parsedType!==x.set)return g(s,{code:c.invalid_type,expected:x.set,received:s.parsedType}),b;const i=this._def;i.minSize!==null&&s.data.size<i.minSize.value&&(g(s,{code:c.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&s.data.size>i.maxSize.value&&(g(s,{code:c.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());const a=this._def.valueType;function o(h){const p=new Set;for(const T of h){if(T.status==="aborted")return b;T.status==="dirty"&&r.dirty(),p.add(T.value)}return{status:r.value,value:p}}const d=[...s.data.values()].map((h,p)=>a._parse(new xe(s,h,s.path,p)));return s.common.async?Promise.all(d).then(h=>o(h)):o(d)}min(e,r){return new Be({...this._def,minSize:{value:e,message:k.toString(r)}})}max(e,r){return new Be({...this._def,maxSize:{value:e,message:k.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Be.create=(t,e)=>new Be({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...V(e)});class dr extends N{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}dr.create=(t,e)=>new dr({getter:t,typeName:w.ZodLazy,...V(e)});class ur extends N{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return g(r,{received:r.data,code:c.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}ur.create=(t,e)=>new ur({value:t,typeName:w.ZodLiteral,...V(e)});function Tr(t,e){return new Se({values:t,typeName:w.ZodEnum,...V(e)})}class Se extends N{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),s=this._def.values;return g(r,{expected:F.joinValues(s),received:r.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),s=this._def.values;return g(r,{received:r.data,code:c.invalid_enum_value,options:s}),b}return te(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Se.create(e,{...this._def,...r})}exclude(e,r=this._def){return Se.create(this.options.filter(s=>!e.includes(s)),{...this._def,...r})}}Se.create=Tr;class lr extends N{_parse(e){const r=F.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==x.string&&s.parsedType!==x.number){const i=F.objectValues(r);return g(s,{expected:F.joinValues(i),received:s.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(F.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=F.objectValues(r);return g(s,{received:s.data,code:c.invalid_enum_value,options:i}),b}return te(e.data)}get enum(){return this._def.values}}lr.create=(t,e)=>new lr({values:t,typeName:w.ZodNativeEnum,...V(e)});class Xe extends N{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==x.promise&&r.common.async===!1)return g(r,{code:c.invalid_type,expected:x.promise,received:r.parsedType}),b;const s=r.parsedType===x.promise?r.data:Promise.resolve(r.data);return te(s.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Xe.create=(t,e)=>new Xe({type:t,typeName:w.ZodPromise,...V(e)});class Ee extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:s}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{g(s,o),o.fatal?r.abort():r.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(s.data,a);if(s.common.async)return Promise.resolve(o).then(async d=>{if(r.value==="aborted")return b;const h=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return h.status==="aborted"?b:h.status==="dirty"||r.value==="dirty"?Le(h.value):h});{if(r.value==="aborted")return b;const d=this._def.schema._parseSync({data:o,path:s.path,parent:s});return d.status==="aborted"?b:d.status==="dirty"||r.value==="dirty"?Le(d.value):d}}if(i.type==="refinement"){const o=d=>{const h=i.refinement(d,a);if(s.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?b:(d.status==="dirty"&&r.dirty(),o(d.value),{status:r.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?b:(d.status==="dirty"&&r.dirty(),o(d.value).then(()=>({status:r.value,value:d.value}))))}if(i.type==="transform")if(s.common.async===!1){const o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ce(o))return b;const d=i.transform(o.value,a);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>Ce(o)?Promise.resolve(i.transform(o.value,a)).then(d=>({status:r.value,value:d})):b);F.assertNever(i)}}Ee.create=(t,e,r)=>new Ee({schema:t,typeName:w.ZodEffects,effect:e,...V(r)});Ee.createWithPreprocess=(t,e,r)=>new Ee({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...V(r)});class ve extends N{_parse(e){return this._getType(e)===x.undefined?te(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(t,e)=>new ve({innerType:t,typeName:w.ZodOptional,...V(e)});class Re extends N{_parse(e){return this._getType(e)===x.null?te(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Re.create=(t,e)=>new Re({innerType:t,typeName:w.ZodNullable,...V(e)});class pt extends N{_parse(e){const{ctx:r}=this._processInputParams(e);let s=r.data;return r.parsedType===x.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}pt.create=(t,e)=>new pt({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...V(e)});class gt extends N{_parse(e){const{ctx:r}=this._processInputParams(e),s={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Ge(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new ye(s.common.issues)},input:s.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ye(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}gt.create=(t,e)=>new gt({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...V(e)});class cr extends N{_parse(e){if(this._getType(e)!==x.nan){const s=this._getOrReturnCtx(e);return g(s,{code:c.invalid_type,expected:x.nan,received:s.parsedType}),b}return{status:"valid",value:e.data}}}cr.create=t=>new cr({typeName:w.ZodNaN,...V(t)});class Rs extends N{_parse(e){const{ctx:r}=this._processInputParams(e),s=r.data;return this._def.type._parse({data:s,path:r.path,parent:r})}unwrap(){return this._def.type}}class At extends N{_parse(e){const{status:r,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?b:a.status==="dirty"?(r.dirty(),Le(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{const i=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?b:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:s.path,parent:s})}}static create(e,r){return new At({in:e,out:r,typeName:w.ZodPipeline})}}class _t extends N{_parse(e){const r=this._def.innerType._parse(e),s=i=>(Ce(i)&&(i.value=Object.freeze(i.value)),i);return Ge(r)?r.then(i=>s(i)):s(r)}unwrap(){return this._def.innerType}}_t.create=(t,e)=>new _t({innerType:t,typeName:w.ZodReadonly,...V(e)});var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const Zs=_e.create;ke.create;ce.create;const js=U.create;Je.create;Qe.create;Ae.create;Se.create;Xe.create;ve.create;Re.create;export{js as o,Zs as s,Ds as t,Is as u};
|
teamtasker/dist/public/assets/users-COyL-EpC.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
import{G as R,ao as U,av as I,aa as M,a2 as q,ax as B,a3 as H,a0 as e,h as u,L as c,I as h,C as $,j as z,k as Q,B as F,i as K,d as G,e as Z,$ as J}from"./index-DLB2cbrK.js";import{u as W,t as X,o as Y,s as m}from"./types-DeMiYPlt.js";import{S as ee}from"./skeleton-Cni41WG0.js";import{D as se,d as ae,a as te,b as re,c as le}from"./dialog-BuD-yXtG.js";import{S as b,c as N,d as v,a as y,b as S}from"./select-CVvZTGtn.js";import{b as p,d as ie}from"./constants-VszDEqUo.js";import{P as oe}from"./plus-q6nj6w0G.js";import"./index-oW74Oi68.js";import"./Combination-Dl0IQ_XO.js";const ce=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],me=R("mail",ce),w=["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#06b6d4","#f97316","#84cc16","#a855f7","#ef4444"],C=[{value:"member",label:"عضو"},{value:"team_lead",label:"قائد فريق"},{value:"head_of_team",label:"رئيس الفرق"}],ne={admin:"مدير النظام",head_of_team:"رئيس الفرق",team_lead:"قائد فريق",member:"عضو"},de=Y({name:m().min(2,"الاسم مطلوب"),email:m().email("البريد الإلكتروني غير صحيح"),team:m().min(1,"الفريق مطلوب"),role:m().min(1,"الدور مطلوب"),password:m().min(8,"كلمة المرور يجب أن تكون 8 أحرف على الأقل").regex(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)/,"كلمة المرور يجب أن تحتوي على حرف كبير، حرف صغير، ورقم")});function ve(){const{data:_,isLoading:T}=U(),L=I(),d=M(),[A,j]=q.useState(!1),{toast:x}=B(),{activeUser:n}=H(),g=n?.role==="admin",O=n?.role==="head_of_team",r=n?.role==="team_lead",i=n?.team??"",k=r?p.filter(s=>s===i):[...p],E=g?[...C,{value:"admin",label:"مدير النظام"}]:C,a=W({resolver:X(de),defaultValues:{name:"",email:"",team:r?i:"",role:"member",password:""}}),V=s=>{if(r&&s.team!==i){x({title:"يمكنك إضافة أعضاء لفريقك فقط",variant:"destructive"});return}const l=w[Math.floor(Math.random()*w.length)];d.mutate({data:{name:s.name,email:s.email,team:s.team,role:s.role,password:s.password,avatarColor:l}},{onSuccess:()=>{L.invalidateQueries({queryKey:J()}),x({title:"تم إضافة العضو بنجاح"}),a.reset({name:"",email:"",team:r?i:"",role:"member",password:""}),j(!1)},onError:o=>{const P=(o instanceof Error?o.message:"حدث خطأ غير متوقع").replace(/^HTTP \d+ [^:]+:\s*/,"");x({title:"فشل إضافة العضو",description:P,variant:"destructive"})}})},f=r?[i]:[...p],D=f.reduce((s,l)=>(s[l]=_?.filter(o=>o.team===l)||[],s),{});return e.jsxs("div",{className:"p-8 max-w-7xl mx-auto space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"دليل الفريق"}),e.jsx("p",{className:"text-slate-500 mt-1",children:r?`أعضاء فريق ${i}`:"جميع أعضاء الفرق والأدوار"})]}),(g||O||r)&&e.jsxs(se,{open:A,onOpenChange:j,children:[e.jsx(ae,{asChild:!0,children:e.jsxs(u,{className:"gap-2",children:[e.jsx(oe,{className:"h-4 w-4"}),"إضافة عضو",r&&e.jsxs("span",{className:"text-xs opacity-70",children:["(",i,")"]})]})}),e.jsxs(te,{children:[e.jsx(re,{children:e.jsx(le,{children:"إضافة عضو جديد"})}),e.jsxs("form",{onSubmit:a.handleSubmit(V),className:"space-y-4 mt-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"الاسم الكامل *"}),e.jsx(h,{placeholder:"اسم العضو",...a.register("name")}),a.formState.errors.name&&e.jsx("p",{className:"text-sm text-red-600",children:a.formState.errors.name.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"البريد الإلكتروني *"}),e.jsx(h,{placeholder:"email@company.com",type:"email",...a.register("email")}),a.formState.errors.email&&e.jsx("p",{className:"text-sm text-red-600",children:a.formState.errors.email.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"الفريق *"}),e.jsxs(b,{value:a.watch("team"),onValueChange:s=>a.setValue("team",s),disabled:r,children:[e.jsx(N,{children:e.jsx(v,{placeholder:"اختر الفريق"})}),e.jsx(y,{children:k.map(s=>e.jsx(S,{value:s,children:s},s))})]}),r&&e.jsx("p",{className:"text-xs text-amber-600",children:"يمكنك إضافة أعضاء لفريقك فقط"}),a.formState.errors.team&&e.jsx("p",{className:"text-sm text-red-600",children:a.formState.errors.team.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"الدور *"}),e.jsxs(b,{value:a.watch("role"),onValueChange:s=>a.setValue("role",s),children:[e.jsx(N,{children:e.jsx(v,{placeholder:"اختر الدور"})}),e.jsx(y,{children:E.map(s=>e.jsx(S,{value:s.value,children:s.label},s.value))})]}),a.formState.errors.role&&e.jsx("p",{className:"text-sm text-red-600",children:a.formState.errors.role.message})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(c,{children:"كلمة المرور *"}),e.jsx(h,{placeholder:"كلمة مرور ��لعضو الجديد",type:"password",...a.register("password")}),a.formState.errors.password&&e.jsx("p",{className:"text-sm text-red-600",children:a.formState.errors.password.message})]}),e.jsx(u,{type:"submit",className:"w-full",disabled:d.isPending,children:d.isPending?"جاري الإضافة...":"إضافة العضو"})]})]})]})]}),T?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[1,2,3].map(s=>e.jsx(ee,{className:"h-48 w-full"},s))}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:f.map(s=>{const l=D[s]||[],o=ie(s);return e.jsxs($,{className:"overflow-hidden",children:[e.jsx("div",{className:"h-1.5",style:{backgroundColor:o}}),e.jsx(z,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(Q,{className:"text-base",children:s}),e.jsxs(F,{variant:"outline",className:"text-xs",children:[l.length," عضو"]})]})}),e.jsx(K,{className:"space-y-3",children:l.length===0?e.jsx("p",{className:"text-sm text-slate-400 text-center py-4",children:"لا يوجد أعضاء في هذا الفريق"}):l.map(t=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(G,{className:"h-9 w-9",children:e.jsx(Z,{style:{backgroundColor:t.avatarColor||o,color:"#fff",fontSize:"12px"},children:t.name.substring(0,2)})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium",children:t.name}),e.jsx("div",{className:"flex items-center gap-1.5 mt-0.5",children:e.jsx("span",{className:`text-[10px] font-semibold px-1.5 py-0.5 rounded-full ${t.role==="admin"?"bg-red-100 text-red-700":t.role==="head_of_team"?"bg-orange-100 text-orange-700":t.role==="team_lead"||t.role==="dept_manager"||t.role==="team_leader"?"bg-blue-100 text-blue-700":"bg-slate-100 text-slate-600"}`,children:ne[t.role]??t.role})})]}),e.jsx("a",{href:`mailto:${t.email}`,className:"text-slate-300 hover:text-primary transition-colors",children:e.jsx(me,{className:"h-4 w-4"})})]},t.id))})]},s)})})]})}export{ve as default};
|
teamtasker/dist/public/index.html
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8" />
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1" />
|
| 6 |
+
<title>TeamTasker</title>
|
| 7 |
+
<meta name="description" content="TeamTasker — built on Replit. Update this description to reflect the app." />
|
| 8 |
+
<meta name="robots" content="index, follow" />
|
| 9 |
+
<meta property="og:title" content="TeamTasker" />
|
| 10 |
+
<meta property="og:description" content="TeamTasker — built on Replit. Update this description to reflect the app." />
|
| 11 |
+
<meta property="og:type" content="website" />
|
| 12 |
+
<meta name="twitter:card" content="summary_large_image" />
|
| 13 |
+
<meta name="twitter:title" content="TeamTasker" />
|
| 14 |
+
<meta name="twitter:description" content="TeamTasker — built on Replit. Update this description to reflect the app." />
|
| 15 |
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
| 16 |
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
| 17 |
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
| 18 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
| 19 |
+
<script type="module" crossorigin src="/assets/index-DLB2cbrK.js"></script>
|
| 20 |
+
<link rel="stylesheet" crossorigin href="/assets/index-DlCrbd5f.css">
|
| 21 |
+
</head>
|
| 22 |
+
<body>
|
| 23 |
+
<div id="root"></div>
|
| 24 |
+
</body>
|
| 25 |
+
</html>
|