odontogram-view 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/index.cjs +23 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1199 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/components/Odontogram/Odontogram.d.ts +2 -0
- package/dist/lib/components/Quadrant/Quadrant.d.ts +15 -0
- package/dist/lib/components/Toolbar/Toolbar.d.ts +7 -0
- package/dist/lib/components/Tooth/Tooth.d.ts +14 -0
- package/dist/lib/components/Tooth/ToothSurface.d.ts +14 -0
- package/dist/lib/components/Tooth/toothGeometry.d.ts +18 -0
- package/dist/lib/constants.d.ts +27 -0
- package/dist/lib/types.d.ts +57 -0
- package/dist/lib/utils/odontogram.d.ts +8 -0
- package/dist/styles.css +1 -0
- package/package.json +44 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1199 @@
|
|
|
1
|
+
import de, { memo as L, useMemo as I, useCallback as _, useState as se } from "react";
|
|
2
|
+
var Y = { exports: {} }, C = {};
|
|
3
|
+
/**
|
|
4
|
+
* @license React
|
|
5
|
+
* react-jsx-runtime.production.js
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the MIT license found in the
|
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/
|
|
12
|
+
var le;
|
|
13
|
+
function me() {
|
|
14
|
+
if (le) return C;
|
|
15
|
+
le = 1;
|
|
16
|
+
var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
17
|
+
function n(o, a, l) {
|
|
18
|
+
var u = null;
|
|
19
|
+
if (l !== void 0 && (u = "" + l), a.key !== void 0 && (u = "" + a.key), "key" in a) {
|
|
20
|
+
l = {};
|
|
21
|
+
for (var v in a)
|
|
22
|
+
v !== "key" && (l[v] = a[v]);
|
|
23
|
+
} else l = a;
|
|
24
|
+
return a = l.ref, {
|
|
25
|
+
$$typeof: t,
|
|
26
|
+
type: o,
|
|
27
|
+
key: u,
|
|
28
|
+
ref: a !== void 0 ? a : null,
|
|
29
|
+
props: l
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return C.Fragment = r, C.jsx = n, C.jsxs = n, C;
|
|
33
|
+
}
|
|
34
|
+
var P = {};
|
|
35
|
+
/**
|
|
36
|
+
* @license React
|
|
37
|
+
* react-jsx-runtime.development.js
|
|
38
|
+
*
|
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
40
|
+
*
|
|
41
|
+
* This source code is licensed under the MIT license found in the
|
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
|
43
|
+
*/
|
|
44
|
+
var ce;
|
|
45
|
+
function be() {
|
|
46
|
+
return ce || (ce = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
47
|
+
function t(e) {
|
|
48
|
+
if (e == null) return null;
|
|
49
|
+
if (typeof e == "function")
|
|
50
|
+
return e.$$typeof === q ? null : e.displayName || e.name || null;
|
|
51
|
+
if (typeof e == "string") return e;
|
|
52
|
+
switch (e) {
|
|
53
|
+
case h:
|
|
54
|
+
return "Fragment";
|
|
55
|
+
case y:
|
|
56
|
+
return "Profiler";
|
|
57
|
+
case O:
|
|
58
|
+
return "StrictMode";
|
|
59
|
+
case z:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case G:
|
|
62
|
+
return "SuspenseList";
|
|
63
|
+
case N:
|
|
64
|
+
return "Activity";
|
|
65
|
+
}
|
|
66
|
+
if (typeof e == "object")
|
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
|
+
), e.$$typeof) {
|
|
70
|
+
case S:
|
|
71
|
+
return "Portal";
|
|
72
|
+
case k:
|
|
73
|
+
return e.displayName || "Context";
|
|
74
|
+
case d:
|
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
+
case g:
|
|
77
|
+
var s = e.render;
|
|
78
|
+
return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
+
case B:
|
|
80
|
+
return s = e.displayName || null, s !== null ? s : t(e.type) || "Memo";
|
|
81
|
+
case p:
|
|
82
|
+
s = e._payload, e = e._init;
|
|
83
|
+
try {
|
|
84
|
+
return t(e(s));
|
|
85
|
+
} catch {
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function r(e) {
|
|
91
|
+
return "" + e;
|
|
92
|
+
}
|
|
93
|
+
function n(e) {
|
|
94
|
+
try {
|
|
95
|
+
r(e);
|
|
96
|
+
var s = !1;
|
|
97
|
+
} catch {
|
|
98
|
+
s = !0;
|
|
99
|
+
}
|
|
100
|
+
if (s) {
|
|
101
|
+
s = console;
|
|
102
|
+
var f = s.error, m = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return f.call(
|
|
104
|
+
s,
|
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
+
m
|
|
107
|
+
), r(e);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function o(e) {
|
|
111
|
+
if (e === h) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === p)
|
|
113
|
+
return "<...>";
|
|
114
|
+
try {
|
|
115
|
+
var s = t(e);
|
|
116
|
+
return s ? "<" + s + ">" : "<...>";
|
|
117
|
+
} catch {
|
|
118
|
+
return "<...>";
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function a() {
|
|
122
|
+
var e = J.A;
|
|
123
|
+
return e === null ? null : e.getOwner();
|
|
124
|
+
}
|
|
125
|
+
function l() {
|
|
126
|
+
return Error("react-stack-top-frame");
|
|
127
|
+
}
|
|
128
|
+
function u(e) {
|
|
129
|
+
if (ee.call(e, "key")) {
|
|
130
|
+
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
|
+
if (s && s.isReactWarning) return !1;
|
|
132
|
+
}
|
|
133
|
+
return e.key !== void 0;
|
|
134
|
+
}
|
|
135
|
+
function v(e, s) {
|
|
136
|
+
function f() {
|
|
137
|
+
re || (re = !0, console.error(
|
|
138
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
|
+
s
|
|
140
|
+
));
|
|
141
|
+
}
|
|
142
|
+
f.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: f,
|
|
144
|
+
configurable: !0
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
function Q() {
|
|
148
|
+
var e = t(this.type);
|
|
149
|
+
return te[e] || (te[e] = !0, console.error(
|
|
150
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
|
+
}
|
|
153
|
+
function w(e, s, f, m, D, H) {
|
|
154
|
+
var b = f.ref;
|
|
155
|
+
return e = {
|
|
156
|
+
$$typeof: M,
|
|
157
|
+
type: e,
|
|
158
|
+
key: s,
|
|
159
|
+
props: f,
|
|
160
|
+
_owner: m
|
|
161
|
+
}, (b !== void 0 ? b : null) !== null ? Object.defineProperty(e, "ref", {
|
|
162
|
+
enumerable: !1,
|
|
163
|
+
get: Q
|
|
164
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
165
|
+
configurable: !1,
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
writable: !0,
|
|
168
|
+
value: 0
|
|
169
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
|
170
|
+
configurable: !1,
|
|
171
|
+
enumerable: !1,
|
|
172
|
+
writable: !0,
|
|
173
|
+
value: null
|
|
174
|
+
}), Object.defineProperty(e, "_debugStack", {
|
|
175
|
+
configurable: !1,
|
|
176
|
+
enumerable: !1,
|
|
177
|
+
writable: !0,
|
|
178
|
+
value: D
|
|
179
|
+
}), Object.defineProperty(e, "_debugTask", {
|
|
180
|
+
configurable: !1,
|
|
181
|
+
enumerable: !1,
|
|
182
|
+
writable: !0,
|
|
183
|
+
value: H
|
|
184
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
185
|
+
}
|
|
186
|
+
function x(e, s, f, m, D, H) {
|
|
187
|
+
var b = s.children;
|
|
188
|
+
if (b !== void 0)
|
|
189
|
+
if (m)
|
|
190
|
+
if (fe(b)) {
|
|
191
|
+
for (m = 0; m < b.length; m++)
|
|
192
|
+
E(b[m]);
|
|
193
|
+
Object.freeze && Object.freeze(b);
|
|
194
|
+
} else
|
|
195
|
+
console.error(
|
|
196
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
197
|
+
);
|
|
198
|
+
else E(b);
|
|
199
|
+
if (ee.call(s, "key")) {
|
|
200
|
+
b = t(e);
|
|
201
|
+
var A = Object.keys(s).filter(function(ve) {
|
|
202
|
+
return ve !== "key";
|
|
203
|
+
});
|
|
204
|
+
m = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", ae[b + m] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
205
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
206
|
+
let props = %s;
|
|
207
|
+
<%s {...props} />
|
|
208
|
+
React keys must be passed directly to JSX without using spread:
|
|
209
|
+
let props = %s;
|
|
210
|
+
<%s key={someKey} {...props} />`,
|
|
211
|
+
m,
|
|
212
|
+
b,
|
|
213
|
+
A,
|
|
214
|
+
b
|
|
215
|
+
), ae[b + m] = !0);
|
|
216
|
+
}
|
|
217
|
+
if (b = null, f !== void 0 && (n(f), b = "" + f), u(s) && (n(s.key), b = "" + s.key), "key" in s) {
|
|
218
|
+
f = {};
|
|
219
|
+
for (var Z in s)
|
|
220
|
+
Z !== "key" && (f[Z] = s[Z]);
|
|
221
|
+
} else f = s;
|
|
222
|
+
return b && v(
|
|
223
|
+
f,
|
|
224
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
225
|
+
), w(
|
|
226
|
+
e,
|
|
227
|
+
b,
|
|
228
|
+
f,
|
|
229
|
+
a(),
|
|
230
|
+
D,
|
|
231
|
+
H
|
|
232
|
+
);
|
|
233
|
+
}
|
|
234
|
+
function E(e) {
|
|
235
|
+
T(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === p && (e._payload.status === "fulfilled" ? T(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
236
|
+
}
|
|
237
|
+
function T(e) {
|
|
238
|
+
return typeof e == "object" && e !== null && e.$$typeof === M;
|
|
239
|
+
}
|
|
240
|
+
var R = de, M = Symbol.for("react.transitional.element"), S = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), y = Symbol.for("react.profiler"), d = Symbol.for("react.consumer"), k = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), z = Symbol.for("react.suspense"), G = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), p = Symbol.for("react.lazy"), N = Symbol.for("react.activity"), q = Symbol.for("react.client.reference"), J = R.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, ee = Object.prototype.hasOwnProperty, fe = Array.isArray, X = console.createTask ? console.createTask : function() {
|
|
241
|
+
return null;
|
|
242
|
+
};
|
|
243
|
+
R = {
|
|
244
|
+
react_stack_bottom_frame: function(e) {
|
|
245
|
+
return e();
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
var re, te = {}, oe = R.react_stack_bottom_frame.bind(
|
|
249
|
+
R,
|
|
250
|
+
l
|
|
251
|
+
)(), ne = X(o(l)), ae = {};
|
|
252
|
+
P.Fragment = h, P.jsx = function(e, s, f) {
|
|
253
|
+
var m = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
254
|
+
return x(
|
|
255
|
+
e,
|
|
256
|
+
s,
|
|
257
|
+
f,
|
|
258
|
+
!1,
|
|
259
|
+
m ? Error("react-stack-top-frame") : oe,
|
|
260
|
+
m ? X(o(e)) : ne
|
|
261
|
+
);
|
|
262
|
+
}, P.jsxs = function(e, s, f) {
|
|
263
|
+
var m = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return x(
|
|
265
|
+
e,
|
|
266
|
+
s,
|
|
267
|
+
f,
|
|
268
|
+
!0,
|
|
269
|
+
m ? Error("react-stack-top-frame") : oe,
|
|
270
|
+
m ? X(o(e)) : ne
|
|
271
|
+
);
|
|
272
|
+
};
|
|
273
|
+
})()), P;
|
|
274
|
+
}
|
|
275
|
+
var ie;
|
|
276
|
+
function xe() {
|
|
277
|
+
return ie || (ie = 1, process.env.NODE_ENV === "production" ? Y.exports = me() : Y.exports = be()), Y.exports;
|
|
278
|
+
}
|
|
279
|
+
var i = xe();
|
|
280
|
+
const he = {
|
|
281
|
+
1: "incisor",
|
|
282
|
+
2: "incisor",
|
|
283
|
+
3: "canine",
|
|
284
|
+
4: "premolar",
|
|
285
|
+
5: "premolar",
|
|
286
|
+
6: "molar",
|
|
287
|
+
7: "molar",
|
|
288
|
+
8: "molar"
|
|
289
|
+
}, Qe = {
|
|
290
|
+
1: "incisor",
|
|
291
|
+
2: "incisor",
|
|
292
|
+
3: "canine",
|
|
293
|
+
4: "molar",
|
|
294
|
+
5: "molar"
|
|
295
|
+
}, ye = {
|
|
296
|
+
11: 1,
|
|
297
|
+
12: 1,
|
|
298
|
+
13: 1,
|
|
299
|
+
14: 2,
|
|
300
|
+
15: 1,
|
|
301
|
+
16: 3,
|
|
302
|
+
17: 3,
|
|
303
|
+
18: 3,
|
|
304
|
+
21: 1,
|
|
305
|
+
22: 1,
|
|
306
|
+
23: 1,
|
|
307
|
+
24: 2,
|
|
308
|
+
25: 1,
|
|
309
|
+
26: 3,
|
|
310
|
+
27: 3,
|
|
311
|
+
28: 3,
|
|
312
|
+
31: 1,
|
|
313
|
+
32: 1,
|
|
314
|
+
33: 1,
|
|
315
|
+
34: 1,
|
|
316
|
+
35: 1,
|
|
317
|
+
36: 2,
|
|
318
|
+
37: 2,
|
|
319
|
+
38: 2,
|
|
320
|
+
41: 1,
|
|
321
|
+
42: 1,
|
|
322
|
+
43: 1,
|
|
323
|
+
44: 1,
|
|
324
|
+
45: 1,
|
|
325
|
+
46: 2,
|
|
326
|
+
47: 2,
|
|
327
|
+
48: 2,
|
|
328
|
+
51: 1,
|
|
329
|
+
52: 1,
|
|
330
|
+
53: 1,
|
|
331
|
+
54: 3,
|
|
332
|
+
55: 3,
|
|
333
|
+
61: 1,
|
|
334
|
+
62: 1,
|
|
335
|
+
63: 1,
|
|
336
|
+
64: 3,
|
|
337
|
+
65: 3,
|
|
338
|
+
71: 1,
|
|
339
|
+
72: 1,
|
|
340
|
+
73: 1,
|
|
341
|
+
74: 2,
|
|
342
|
+
75: 2,
|
|
343
|
+
81: 1,
|
|
344
|
+
82: 1,
|
|
345
|
+
83: 1,
|
|
346
|
+
84: 2,
|
|
347
|
+
85: 2
|
|
348
|
+
}, we = (t, r, n) => {
|
|
349
|
+
const o = ye[t] ?? 1;
|
|
350
|
+
return r === "incisor" ? {
|
|
351
|
+
centerLabel: "I",
|
|
352
|
+
roots: o,
|
|
353
|
+
surfaces: 5,
|
|
354
|
+
crownWidth: 32,
|
|
355
|
+
crownHeight: 42,
|
|
356
|
+
rootStyle: "single"
|
|
357
|
+
} : r === "canine" ? {
|
|
358
|
+
centerLabel: "I",
|
|
359
|
+
roots: o,
|
|
360
|
+
surfaces: 5,
|
|
361
|
+
crownWidth: 36,
|
|
362
|
+
crownHeight: 44,
|
|
363
|
+
rootStyle: "singleLong"
|
|
364
|
+
} : r === "premolar" ? {
|
|
365
|
+
centerLabel: "O",
|
|
366
|
+
roots: o,
|
|
367
|
+
surfaces: 5,
|
|
368
|
+
crownWidth: 42,
|
|
369
|
+
crownHeight: 42,
|
|
370
|
+
rootStyle: o === 2 ? "double" : "single"
|
|
371
|
+
} : {
|
|
372
|
+
centerLabel: "O",
|
|
373
|
+
roots: o,
|
|
374
|
+
surfaces: 5,
|
|
375
|
+
crownWidth: 48,
|
|
376
|
+
crownHeight: 42,
|
|
377
|
+
rootStyle: o === 3 || n === "upper" ? "triple" : "double"
|
|
378
|
+
};
|
|
379
|
+
}, j = (t, r, n, o) => {
|
|
380
|
+
const a = o === "permanent" ? he : Qe;
|
|
381
|
+
return r.map((l) => {
|
|
382
|
+
const u = a[l], v = `${t}${l}`;
|
|
383
|
+
return {
|
|
384
|
+
id: v,
|
|
385
|
+
type: u,
|
|
386
|
+
arch: n,
|
|
387
|
+
dentition: o,
|
|
388
|
+
label: v,
|
|
389
|
+
visual: we(v, u, n)
|
|
390
|
+
};
|
|
391
|
+
});
|
|
392
|
+
}, Ee = j(1, [8, 7, 6, 5, 4, 3, 2, 1], "upper", "permanent"), _e = j(2, [1, 2, 3, 4, 5, 6, 7, 8], "upper", "permanent"), Te = j(4, [8, 7, 6, 5, 4, 3, 2, 1], "lower", "permanent"), Re = j(3, [1, 2, 3, 4, 5, 6, 7, 8], "lower", "permanent"), ke = j(5, [5, 4, 3, 2, 1], "upper", "primary"), ge = j(6, [1, 2, 3, 4, 5], "upper", "primary"), je = j(8, [5, 4, 3, 2, 1], "lower", "primary"), Oe = j(7, [1, 2, 3, 4, 5], "lower", "primary"), $ = {
|
|
393
|
+
upper: [...Ee, ..._e],
|
|
394
|
+
lower: [...Te, ...Re]
|
|
395
|
+
}, F = {
|
|
396
|
+
upper: [...ke, ...ge],
|
|
397
|
+
lower: [...je, ...Oe]
|
|
398
|
+
}, Ne = [
|
|
399
|
+
{
|
|
400
|
+
id: "upper-permanent",
|
|
401
|
+
label: "Superior permanente",
|
|
402
|
+
teeth: $.upper
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
id: "upper-primary",
|
|
406
|
+
label: "Superior temporal",
|
|
407
|
+
teeth: F.upper
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
id: "lower-primary",
|
|
411
|
+
label: "Inferior temporal",
|
|
412
|
+
teeth: F.lower
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
id: "lower-permanent",
|
|
416
|
+
label: "Inferior permanente",
|
|
417
|
+
teeth: $.lower
|
|
418
|
+
}
|
|
419
|
+
], K = [
|
|
420
|
+
{ id: "CARIES", label: "Caries", color: "#ef4444", scope: "both" },
|
|
421
|
+
{ id: "CROWN", label: "Corona", color: "#f59e0b", scope: "both" },
|
|
422
|
+
{ id: "EXTRACTION", label: "Extracción", color: "#7c3aed", scope: "both" },
|
|
423
|
+
{ id: "IMPLANT", label: "Implante", color: "#2563eb", scope: "both" },
|
|
424
|
+
{ id: "FRACTURE", label: "Fractura", color: "#fb7185", scope: "both" },
|
|
425
|
+
{ id: "RESIN", label: "Resina", color: "#10b981", scope: "both" },
|
|
426
|
+
{ id: "ENDO", label: "Endodoncia", color: "#0f172a", scope: "both" },
|
|
427
|
+
{ id: "MISSING", label: "Ausente", color: "#64748b", scope: "both" },
|
|
428
|
+
{ id: "SEALANT", label: "Sellante", color: "#14b8a6", scope: "both" }
|
|
429
|
+
], Me = new Map(
|
|
430
|
+
K.map((t) => [t.id, t])
|
|
431
|
+
), W = (t = []) => Array.from(new Set(t)), U = (t) => [...t].sort((r, n) => r.localeCompare(n)), ue = (t = []) => {
|
|
432
|
+
const r = {};
|
|
433
|
+
return t.forEach((n) => {
|
|
434
|
+
r[n.tooth] = {
|
|
435
|
+
tooth: n.tooth,
|
|
436
|
+
conditions: n.conditions ? U(W(n.conditions)) : void 0,
|
|
437
|
+
surfaces: n.surfaces ? Object.fromEntries(
|
|
438
|
+
Object.entries(n.surfaces).map(([o, a]) => [
|
|
439
|
+
o,
|
|
440
|
+
a != null && a.length ? U(W(a)) : void 0
|
|
441
|
+
]).filter(([, o]) => !!(o != null && o.length))
|
|
442
|
+
) : void 0
|
|
443
|
+
};
|
|
444
|
+
}), r;
|
|
445
|
+
}, Ae = (t) => Object.values(t).filter(Boolean).map((r) => {
|
|
446
|
+
var o;
|
|
447
|
+
const n = { tooth: r.tooth };
|
|
448
|
+
return (o = r == null ? void 0 : r.conditions) != null && o.length && (n.conditions = r.conditions), r != null && r.surfaces && Object.keys(r.surfaces).length > 0 && (n.surfaces = r.surfaces), n;
|
|
449
|
+
}).filter((r) => {
|
|
450
|
+
var n;
|
|
451
|
+
return ((n = r.conditions) == null ? void 0 : n.length) || Object.keys(r.surfaces ?? {}).length;
|
|
452
|
+
}).sort((r, n) => r.tooth.localeCompare(n.tooth)), V = (t) => {
|
|
453
|
+
var a;
|
|
454
|
+
const r = t.surfaces ? Object.fromEntries(
|
|
455
|
+
Object.entries(t.surfaces).filter(([, l]) => !!(l != null && l.length))
|
|
456
|
+
) : void 0, n = !!((a = t.conditions) != null && a.length), o = !!(r && Object.keys(r).length > 0);
|
|
457
|
+
if (!(!n && !o))
|
|
458
|
+
return {
|
|
459
|
+
tooth: t.tooth,
|
|
460
|
+
conditions: n ? t.conditions : void 0,
|
|
461
|
+
surfaces: o ? r : void 0
|
|
462
|
+
};
|
|
463
|
+
}, Se = (t, r, n, o) => {
|
|
464
|
+
var Q;
|
|
465
|
+
if (!Me.get(o))
|
|
466
|
+
return t;
|
|
467
|
+
const l = t[r] ?? {}, u = ((Q = l.surfaces) == null ? void 0 : Q[n]) ?? [], v = {
|
|
468
|
+
tooth: r,
|
|
469
|
+
conditions: l.conditions,
|
|
470
|
+
surfaces: {
|
|
471
|
+
...l.surfaces ?? {},
|
|
472
|
+
[n]: U(W([...u, o]))
|
|
473
|
+
}
|
|
474
|
+
};
|
|
475
|
+
return {
|
|
476
|
+
...t,
|
|
477
|
+
[r]: V(v)
|
|
478
|
+
};
|
|
479
|
+
}, Ce = (t, r, n) => {
|
|
480
|
+
const o = t[r] ?? {}, a = {
|
|
481
|
+
tooth: r,
|
|
482
|
+
surfaces: o.surfaces,
|
|
483
|
+
conditions: U(W([...o.conditions ?? [], n]))
|
|
484
|
+
};
|
|
485
|
+
return {
|
|
486
|
+
...t,
|
|
487
|
+
[r]: V(a)
|
|
488
|
+
};
|
|
489
|
+
}, Pe = (t, r, n) => {
|
|
490
|
+
var l, u;
|
|
491
|
+
const o = t[r];
|
|
492
|
+
if (!((u = (l = o == null ? void 0 : o.surfaces) == null ? void 0 : l[n]) != null && u.length))
|
|
493
|
+
return t;
|
|
494
|
+
const a = { ...o.surfaces ?? {} };
|
|
495
|
+
return delete a[n], {
|
|
496
|
+
...t,
|
|
497
|
+
[r]: V({
|
|
498
|
+
tooth: r,
|
|
499
|
+
conditions: o.conditions,
|
|
500
|
+
surfaces: a
|
|
501
|
+
})
|
|
502
|
+
};
|
|
503
|
+
}, Ie = (t, r) => {
|
|
504
|
+
if (!t[r])
|
|
505
|
+
return t;
|
|
506
|
+
const o = V({
|
|
507
|
+
tooth: r,
|
|
508
|
+
conditions: void 0,
|
|
509
|
+
surfaces: void 0
|
|
510
|
+
});
|
|
511
|
+
if (!o) {
|
|
512
|
+
const a = { ...t };
|
|
513
|
+
return delete a[r], a;
|
|
514
|
+
}
|
|
515
|
+
return {
|
|
516
|
+
...t,
|
|
517
|
+
[r]: o
|
|
518
|
+
};
|
|
519
|
+
}, pe = (t) => {
|
|
520
|
+
var r;
|
|
521
|
+
return ((r = K.find((n) => n.id === t)) == null ? void 0 : r.color) ?? "#dbe4ea";
|
|
522
|
+
}, Le = L(function({
|
|
523
|
+
surface: r,
|
|
524
|
+
label: n,
|
|
525
|
+
path: o,
|
|
526
|
+
textX: a,
|
|
527
|
+
textY: l,
|
|
528
|
+
condition: u,
|
|
529
|
+
onApply: v,
|
|
530
|
+
onClear: Q,
|
|
531
|
+
disabled: w
|
|
532
|
+
}) {
|
|
533
|
+
return /* @__PURE__ */ i.jsxs("g", { children: [
|
|
534
|
+
/* @__PURE__ */ i.jsx(
|
|
535
|
+
"path",
|
|
536
|
+
{
|
|
537
|
+
d: o,
|
|
538
|
+
fill: pe(u),
|
|
539
|
+
stroke: "#1f2937",
|
|
540
|
+
strokeWidth: 1.4,
|
|
541
|
+
strokeLinejoin: "round",
|
|
542
|
+
className: w ? "" : "ov-cursor-pointer ov-transition-opacity hover:ov-opacity-85",
|
|
543
|
+
onClick: w ? void 0 : () => v(r),
|
|
544
|
+
onContextMenu: w ? void 0 : (x) => {
|
|
545
|
+
x.preventDefault(), Q(r);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
),
|
|
549
|
+
/* @__PURE__ */ i.jsx(
|
|
550
|
+
"text",
|
|
551
|
+
{
|
|
552
|
+
x: a,
|
|
553
|
+
y: l,
|
|
554
|
+
textAnchor: "middle",
|
|
555
|
+
className: "ov-pointer-events-none ov-select-none ov-fill-slate-700 ov-text-[10px] ov-font-semibold",
|
|
556
|
+
children: n
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
] });
|
|
560
|
+
}), c = (...t) => `${t.join(" ")} Z`, De = (t) => {
|
|
561
|
+
const r = c(
|
|
562
|
+
"M 21 20",
|
|
563
|
+
"Q 31 13 41 20",
|
|
564
|
+
"Q 47 27 45 38",
|
|
565
|
+
"Q 43 50 31 55",
|
|
566
|
+
"Q 19 50 17 38",
|
|
567
|
+
"Q 15 27 21 20"
|
|
568
|
+
), n = [
|
|
569
|
+
{
|
|
570
|
+
key: "V",
|
|
571
|
+
label: "V",
|
|
572
|
+
path: c(
|
|
573
|
+
"M 21 20",
|
|
574
|
+
"Q 31 14 41 20",
|
|
575
|
+
"Q 39 26 36 30",
|
|
576
|
+
"Q 31 32 26 30",
|
|
577
|
+
"Q 23 26 21 20"
|
|
578
|
+
),
|
|
579
|
+
text: { x: 31, y: 25 }
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
key: "M",
|
|
583
|
+
label: "M",
|
|
584
|
+
path: c(
|
|
585
|
+
"M 17 38",
|
|
586
|
+
"Q 17 28 21 20",
|
|
587
|
+
"Q 23 26 26 30",
|
|
588
|
+
"Q 25 39 26 47",
|
|
589
|
+
"Q 20 46 17 38"
|
|
590
|
+
),
|
|
591
|
+
text: { x: 22, y: 38 }
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
key: t,
|
|
595
|
+
label: t,
|
|
596
|
+
path: c(
|
|
597
|
+
"M 26 30",
|
|
598
|
+
"Q 31 26 36 30",
|
|
599
|
+
"Q 39 38 36 46",
|
|
600
|
+
"Q 31 51 26 46",
|
|
601
|
+
"Q 23 38 26 30"
|
|
602
|
+
),
|
|
603
|
+
text: { x: 31, y: 40 }
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
key: "D",
|
|
607
|
+
label: "D",
|
|
608
|
+
path: c(
|
|
609
|
+
"M 45 38",
|
|
610
|
+
"Q 45 28 41 20",
|
|
611
|
+
"Q 39 26 36 30",
|
|
612
|
+
"Q 37 39 36 47",
|
|
613
|
+
"Q 42 46 45 38"
|
|
614
|
+
),
|
|
615
|
+
text: { x: 40, y: 38 }
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
key: "L",
|
|
619
|
+
label: "L",
|
|
620
|
+
path: c(
|
|
621
|
+
"M 24 45",
|
|
622
|
+
"Q 31 54 38 45",
|
|
623
|
+
"Q 42 47 45 38",
|
|
624
|
+
"Q 43 54 31 59",
|
|
625
|
+
"Q 19 54 17 38",
|
|
626
|
+
"Q 20 47 24 45"
|
|
627
|
+
),
|
|
628
|
+
text: { x: 31, y: 55 }
|
|
629
|
+
}
|
|
630
|
+
];
|
|
631
|
+
return {
|
|
632
|
+
crownOutline: r,
|
|
633
|
+
crownCap: r,
|
|
634
|
+
rootPaths: [
|
|
635
|
+
c(
|
|
636
|
+
"M 27 54",
|
|
637
|
+
"Q 31 58 35 54",
|
|
638
|
+
"Q 38 65 36 84",
|
|
639
|
+
"Q 34 100 31 112",
|
|
640
|
+
"Q 28 100 26 84",
|
|
641
|
+
"Q 24 65 27 54"
|
|
642
|
+
)
|
|
643
|
+
],
|
|
644
|
+
surfaces: n
|
|
645
|
+
};
|
|
646
|
+
}, Ye = () => {
|
|
647
|
+
const t = c(
|
|
648
|
+
"M 24 23",
|
|
649
|
+
"Q 31 12 38 23",
|
|
650
|
+
"Q 44 31 42 41",
|
|
651
|
+
"Q 40 52 31 58",
|
|
652
|
+
"Q 22 52 20 41",
|
|
653
|
+
"Q 18 31 24 23"
|
|
654
|
+
), r = [
|
|
655
|
+
{
|
|
656
|
+
key: "V",
|
|
657
|
+
label: "V",
|
|
658
|
+
path: c(
|
|
659
|
+
"M 24 23",
|
|
660
|
+
"Q 31 13 38 23",
|
|
661
|
+
"Q 36 29 35 31",
|
|
662
|
+
"Q 31 34 27 31",
|
|
663
|
+
"Q 26 29 24 23"
|
|
664
|
+
),
|
|
665
|
+
text: { x: 31, y: 26 }
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
key: "M",
|
|
669
|
+
label: "M",
|
|
670
|
+
path: c(
|
|
671
|
+
"M 20 41",
|
|
672
|
+
"Q 20 31 24 23",
|
|
673
|
+
"Q 26 29 27 31",
|
|
674
|
+
"Q 26 40 27 49",
|
|
675
|
+
"Q 22 47 20 41"
|
|
676
|
+
),
|
|
677
|
+
text: { x: 23, y: 40 }
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
key: "I",
|
|
681
|
+
label: "I",
|
|
682
|
+
path: c(
|
|
683
|
+
"M 27 31",
|
|
684
|
+
"Q 31 28 35 31",
|
|
685
|
+
"Q 37 40 35 48",
|
|
686
|
+
"Q 31 53 27 48",
|
|
687
|
+
"Q 25 40 27 31"
|
|
688
|
+
),
|
|
689
|
+
text: { x: 31, y: 40 }
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
key: "D",
|
|
693
|
+
label: "D",
|
|
694
|
+
path: c(
|
|
695
|
+
"M 42 41",
|
|
696
|
+
"Q 42 31 38 23",
|
|
697
|
+
"Q 36 29 35 31",
|
|
698
|
+
"Q 36 40 35 49",
|
|
699
|
+
"Q 40 47 42 41"
|
|
700
|
+
),
|
|
701
|
+
text: { x: 39, y: 40 }
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
key: "L",
|
|
705
|
+
label: "L",
|
|
706
|
+
path: c(
|
|
707
|
+
"M 25 47",
|
|
708
|
+
"Q 31 56 37 47",
|
|
709
|
+
"Q 40 49 42 41",
|
|
710
|
+
"Q 40 54 31 60",
|
|
711
|
+
"Q 22 54 20 41",
|
|
712
|
+
"Q 22 49 25 47"
|
|
713
|
+
),
|
|
714
|
+
text: { x: 31, y: 55 }
|
|
715
|
+
}
|
|
716
|
+
];
|
|
717
|
+
return {
|
|
718
|
+
crownOutline: t,
|
|
719
|
+
crownCap: t,
|
|
720
|
+
rootPaths: [
|
|
721
|
+
c(
|
|
722
|
+
"M 27 58",
|
|
723
|
+
"Q 31 62 35 58",
|
|
724
|
+
"Q 39 73 37 92",
|
|
725
|
+
"Q 35 112 31 122",
|
|
726
|
+
"Q 27 112 25 92",
|
|
727
|
+
"Q 23 73 27 58"
|
|
728
|
+
)
|
|
729
|
+
],
|
|
730
|
+
surfaces: r
|
|
731
|
+
};
|
|
732
|
+
}, $e = () => {
|
|
733
|
+
const t = c(
|
|
734
|
+
"M 20 20",
|
|
735
|
+
"Q 31 15 42 20",
|
|
736
|
+
"Q 48 28 46 39",
|
|
737
|
+
"Q 44 52 31 57",
|
|
738
|
+
"Q 18 52 16 39",
|
|
739
|
+
"Q 14 28 20 20"
|
|
740
|
+
), r = [
|
|
741
|
+
{
|
|
742
|
+
key: "V",
|
|
743
|
+
label: "V",
|
|
744
|
+
path: c(
|
|
745
|
+
"M 20 20",
|
|
746
|
+
"Q 31 14 42 20",
|
|
747
|
+
"Q 39 28 36 31",
|
|
748
|
+
"Q 31 33 26 31",
|
|
749
|
+
"Q 23 28 20 20"
|
|
750
|
+
),
|
|
751
|
+
text: { x: 31, y: 25 }
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
key: "M",
|
|
755
|
+
label: "M",
|
|
756
|
+
path: c(
|
|
757
|
+
"M 16 39",
|
|
758
|
+
"Q 15 29 20 20",
|
|
759
|
+
"Q 23 28 26 31",
|
|
760
|
+
"Q 24 40 26 49",
|
|
761
|
+
"Q 20 48 16 39"
|
|
762
|
+
),
|
|
763
|
+
text: { x: 22, y: 40 }
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
key: "O",
|
|
767
|
+
label: "O",
|
|
768
|
+
path: c(
|
|
769
|
+
"M 26 31",
|
|
770
|
+
"Q 31 27 36 31",
|
|
771
|
+
"Q 39 39 36 48",
|
|
772
|
+
"Q 31 52 26 48",
|
|
773
|
+
"Q 23 39 26 31"
|
|
774
|
+
),
|
|
775
|
+
text: { x: 31, y: 40 }
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
key: "D",
|
|
779
|
+
label: "D",
|
|
780
|
+
path: c(
|
|
781
|
+
"M 46 39",
|
|
782
|
+
"Q 47 29 42 20",
|
|
783
|
+
"Q 39 28 36 31",
|
|
784
|
+
"Q 38 40 36 49",
|
|
785
|
+
"Q 42 48 46 39"
|
|
786
|
+
),
|
|
787
|
+
text: { x: 40, y: 40 }
|
|
788
|
+
},
|
|
789
|
+
{
|
|
790
|
+
key: "L",
|
|
791
|
+
label: "L",
|
|
792
|
+
path: c(
|
|
793
|
+
"M 24 47",
|
|
794
|
+
"Q 31 56 38 47",
|
|
795
|
+
"Q 43 49 46 39",
|
|
796
|
+
"Q 44 54 31 59",
|
|
797
|
+
"Q 18 54 16 39",
|
|
798
|
+
"Q 19 49 24 47"
|
|
799
|
+
),
|
|
800
|
+
text: { x: 31, y: 56 }
|
|
801
|
+
}
|
|
802
|
+
];
|
|
803
|
+
return {
|
|
804
|
+
crownOutline: t,
|
|
805
|
+
crownCap: t,
|
|
806
|
+
rootPaths: [
|
|
807
|
+
c(
|
|
808
|
+
"M 22 57",
|
|
809
|
+
"Q 25 60 28 57",
|
|
810
|
+
"Q 28 71 25 90",
|
|
811
|
+
"Q 23 101 20 109",
|
|
812
|
+
"Q 17 99 17 86",
|
|
813
|
+
"Q 17 71 22 57"
|
|
814
|
+
),
|
|
815
|
+
c(
|
|
816
|
+
"M 34 57",
|
|
817
|
+
"Q 37 60 40 57",
|
|
818
|
+
"Q 45 71 45 86",
|
|
819
|
+
"Q 45 99 42 109",
|
|
820
|
+
"Q 39 101 37 90",
|
|
821
|
+
"Q 34 71 34 57"
|
|
822
|
+
)
|
|
823
|
+
],
|
|
824
|
+
surfaces: r
|
|
825
|
+
};
|
|
826
|
+
}, Fe = (t) => {
|
|
827
|
+
const r = c(
|
|
828
|
+
"M 16 22",
|
|
829
|
+
"Q 31 13 46 22",
|
|
830
|
+
"Q 52 32 49 43",
|
|
831
|
+
"Q 46 56 31 61",
|
|
832
|
+
"Q 16 56 13 43",
|
|
833
|
+
"Q 10 32 16 22"
|
|
834
|
+
), n = [
|
|
835
|
+
{
|
|
836
|
+
key: "V",
|
|
837
|
+
label: "V",
|
|
838
|
+
path: c(
|
|
839
|
+
"M 16 22",
|
|
840
|
+
"Q 31 12 46 22",
|
|
841
|
+
"Q 42 31 38 34",
|
|
842
|
+
"Q 31 36 24 34",
|
|
843
|
+
"Q 20 31 16 22"
|
|
844
|
+
),
|
|
845
|
+
text: { x: 31, y: 26 }
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
key: "M",
|
|
849
|
+
label: "M",
|
|
850
|
+
path: c(
|
|
851
|
+
"M 13 43",
|
|
852
|
+
"Q 11 32 16 22",
|
|
853
|
+
"Q 20 31 24 34",
|
|
854
|
+
"Q 22 44 24 53",
|
|
855
|
+
"Q 17 52 13 43"
|
|
856
|
+
),
|
|
857
|
+
text: { x: 21, y: 43 }
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
key: "O",
|
|
861
|
+
label: "O",
|
|
862
|
+
path: c(
|
|
863
|
+
"M 24 34",
|
|
864
|
+
"Q 31 29 38 34",
|
|
865
|
+
"Q 41 43 38 52",
|
|
866
|
+
"Q 31 56 24 52",
|
|
867
|
+
"Q 21 43 24 34"
|
|
868
|
+
),
|
|
869
|
+
text: { x: 31, y: 43 }
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
key: "D",
|
|
873
|
+
label: "D",
|
|
874
|
+
path: c(
|
|
875
|
+
"M 49 43",
|
|
876
|
+
"Q 51 32 46 22",
|
|
877
|
+
"Q 42 31 38 34",
|
|
878
|
+
"Q 40 44 38 53",
|
|
879
|
+
"Q 45 52 49 43"
|
|
880
|
+
),
|
|
881
|
+
text: { x: 41, y: 43 }
|
|
882
|
+
},
|
|
883
|
+
{
|
|
884
|
+
key: "L",
|
|
885
|
+
label: "L",
|
|
886
|
+
path: c(
|
|
887
|
+
"M 22 51",
|
|
888
|
+
"Q 31 62 40 51",
|
|
889
|
+
"Q 46 52 49 43",
|
|
890
|
+
"Q 46 58 31 64",
|
|
891
|
+
"Q 16 58 13 43",
|
|
892
|
+
"Q 16 52 22 51"
|
|
893
|
+
),
|
|
894
|
+
text: { x: 31, y: 60 }
|
|
895
|
+
}
|
|
896
|
+
], o = t === "upper" ? [
|
|
897
|
+
c(
|
|
898
|
+
"M 17 61",
|
|
899
|
+
"Q 20 64 23 61",
|
|
900
|
+
"Q 24 73 22 91",
|
|
901
|
+
"Q 20 103 17 111",
|
|
902
|
+
"Q 14 101 14 88",
|
|
903
|
+
"Q 14 73 17 61"
|
|
904
|
+
),
|
|
905
|
+
c(
|
|
906
|
+
"M 28 61",
|
|
907
|
+
"Q 31 65 34 61",
|
|
908
|
+
"Q 36 76 35 96",
|
|
909
|
+
"Q 34 111 31 122",
|
|
910
|
+
"Q 28 111 27 96",
|
|
911
|
+
"Q 26 76 28 61"
|
|
912
|
+
),
|
|
913
|
+
c(
|
|
914
|
+
"M 39 61",
|
|
915
|
+
"Q 42 64 45 61",
|
|
916
|
+
"Q 48 73 48 88",
|
|
917
|
+
"Q 48 101 45 111",
|
|
918
|
+
"Q 42 103 40 91",
|
|
919
|
+
"Q 38 73 39 61"
|
|
920
|
+
)
|
|
921
|
+
] : [
|
|
922
|
+
c(
|
|
923
|
+
"M 22 61",
|
|
924
|
+
"Q 26 64 29 61",
|
|
925
|
+
"Q 29 76 26 96",
|
|
926
|
+
"Q 24 109 20 118",
|
|
927
|
+
"Q 17 107 17 92",
|
|
928
|
+
"Q 17 75 22 61"
|
|
929
|
+
),
|
|
930
|
+
c(
|
|
931
|
+
"M 33 61",
|
|
932
|
+
"Q 36 64 40 61",
|
|
933
|
+
"Q 45 75 45 92",
|
|
934
|
+
"Q 45 107 42 118",
|
|
935
|
+
"Q 38 109 36 96",
|
|
936
|
+
"Q 33 76 33 61"
|
|
937
|
+
)
|
|
938
|
+
];
|
|
939
|
+
return {
|
|
940
|
+
crownOutline: r,
|
|
941
|
+
crownCap: r,
|
|
942
|
+
rootPaths: o,
|
|
943
|
+
surfaces: n
|
|
944
|
+
};
|
|
945
|
+
}, We = (t) => t.type === "incisor" ? De(t.visual.centerLabel) : t.type === "canine" ? Ye() : t.type === "premolar" ? $e() : Fe(t.arch), Ue = {
|
|
946
|
+
sm: {
|
|
947
|
+
wrapper: "ov-min-w-[64px] ov-gap-0.5",
|
|
948
|
+
label: "ov-text-[11px]",
|
|
949
|
+
svg: "ov-h-[124px] ov-w-[62px]"
|
|
950
|
+
},
|
|
951
|
+
md: {
|
|
952
|
+
wrapper: "ov-min-w-[74px] ov-gap-0.5",
|
|
953
|
+
label: "ov-text-xs",
|
|
954
|
+
svg: "ov-h-[138px] ov-w-[98px]"
|
|
955
|
+
},
|
|
956
|
+
lg: {
|
|
957
|
+
wrapper: "ov-min-w-[84px] ov-gap-0.5",
|
|
958
|
+
label: "ov-text-sm",
|
|
959
|
+
svg: "ov-h-[154px] ov-w-[108px]"
|
|
960
|
+
}
|
|
961
|
+
}, Ve = L(function({
|
|
962
|
+
definition: r,
|
|
963
|
+
record: n,
|
|
964
|
+
editable: o,
|
|
965
|
+
selectedCondition: a,
|
|
966
|
+
size: l,
|
|
967
|
+
onApplySurface: u,
|
|
968
|
+
onApplyTooth: v,
|
|
969
|
+
onClearSurface: Q,
|
|
970
|
+
onClearTooth: w
|
|
971
|
+
}) {
|
|
972
|
+
const x = Ue[l], E = I(() => We(r), [r]), T = (n == null ? void 0 : n.conditions) ?? [], R = I(
|
|
973
|
+
() => T.length ? pe(T[0]) : "#f8fafc",
|
|
974
|
+
[T]
|
|
975
|
+
), M = I(() => r.type === "incisor" ? "ov-border-sky-100" : r.type === "canine" ? "ov-border-amber-100" : r.type === "premolar" ? "ov-border-emerald-100" : "ov-border-rose-100", [r.type]), S = _(
|
|
976
|
+
(d) => u(r.id, d, a),
|
|
977
|
+
[r.id, u, a]
|
|
978
|
+
), h = _(
|
|
979
|
+
(d) => Q(r.id, d),
|
|
980
|
+
[r.id, Q]
|
|
981
|
+
), O = _(() => {
|
|
982
|
+
v(r.id, a);
|
|
983
|
+
}, [r.id, v, a]), y = _(() => {
|
|
984
|
+
w(r.id);
|
|
985
|
+
}, [r.id, w]);
|
|
986
|
+
return /* @__PURE__ */ i.jsxs("div", { className: ["ov-flex ov-flex-col ov-items-center", M, x.wrapper].join(" "), children: [
|
|
987
|
+
/* @__PURE__ */ i.jsx("span", { className: ["ov-font-semibold ov-text-clinic-700", x.label].join(" "), children: r.label }),
|
|
988
|
+
/* @__PURE__ */ i.jsxs("svg", { viewBox: "0 0 62 128", className: x.svg, children: [
|
|
989
|
+
E.rootPaths.map((d, k) => /* @__PURE__ */ i.jsx(
|
|
990
|
+
"path",
|
|
991
|
+
{
|
|
992
|
+
d,
|
|
993
|
+
fill: R,
|
|
994
|
+
stroke: "#1f2937",
|
|
995
|
+
strokeWidth: 1.4,
|
|
996
|
+
strokeLinejoin: "round",
|
|
997
|
+
className: o ? "ov-cursor-pointer ov-transition-opacity hover:ov-opacity-85" : "",
|
|
998
|
+
onClick: o ? O : void 0,
|
|
999
|
+
onContextMenu: o ? (g) => {
|
|
1000
|
+
g.preventDefault(), y();
|
|
1001
|
+
} : void 0
|
|
1002
|
+
},
|
|
1003
|
+
`${r.id}-root-${k}`
|
|
1004
|
+
)),
|
|
1005
|
+
/* @__PURE__ */ i.jsx("path", { d: E.crownCap, fill: R, stroke: "#1f2937", strokeWidth: 1.6 }),
|
|
1006
|
+
E.surfaces.map((d) => {
|
|
1007
|
+
var k, g;
|
|
1008
|
+
return /* @__PURE__ */ i.jsx(
|
|
1009
|
+
Le,
|
|
1010
|
+
{
|
|
1011
|
+
surface: d.key,
|
|
1012
|
+
label: d.label,
|
|
1013
|
+
path: d.path,
|
|
1014
|
+
textX: d.text.x,
|
|
1015
|
+
textY: d.text.y,
|
|
1016
|
+
condition: (g = (k = n == null ? void 0 : n.surfaces) == null ? void 0 : k[d.key]) == null ? void 0 : g[0],
|
|
1017
|
+
onApply: S,
|
|
1018
|
+
onClear: h,
|
|
1019
|
+
disabled: !o
|
|
1020
|
+
},
|
|
1021
|
+
`${r.id}-${d.key}`
|
|
1022
|
+
);
|
|
1023
|
+
}),
|
|
1024
|
+
/* @__PURE__ */ i.jsx(
|
|
1025
|
+
"path",
|
|
1026
|
+
{
|
|
1027
|
+
d: E.crownOutline,
|
|
1028
|
+
fill: "none",
|
|
1029
|
+
stroke: "#0f172a",
|
|
1030
|
+
strokeWidth: 1.6,
|
|
1031
|
+
strokeLinejoin: "round",
|
|
1032
|
+
className: o ? "ov-cursor-pointer" : "",
|
|
1033
|
+
onClick: o ? O : void 0,
|
|
1034
|
+
onContextMenu: o ? (d) => {
|
|
1035
|
+
d.preventDefault(), y();
|
|
1036
|
+
} : void 0
|
|
1037
|
+
}
|
|
1038
|
+
)
|
|
1039
|
+
] })
|
|
1040
|
+
] });
|
|
1041
|
+
}), ze = L(function({
|
|
1042
|
+
teeth: r,
|
|
1043
|
+
records: n,
|
|
1044
|
+
editable: o,
|
|
1045
|
+
selectedCondition: a,
|
|
1046
|
+
size: l,
|
|
1047
|
+
onApplySurface: u,
|
|
1048
|
+
onApplyTooth: v,
|
|
1049
|
+
onClearSurface: Q,
|
|
1050
|
+
onClearTooth: w
|
|
1051
|
+
}) {
|
|
1052
|
+
return /* @__PURE__ */ i.jsx("section", { children: /* @__PURE__ */ i.jsx("div", { className: "ov-overflow-x-auto ov-pb-1", children: /* @__PURE__ */ i.jsx("div", { className: "ov-flex ov-min-w-max ov-justify-center ov-gap-0.5", children: r.map((x) => /* @__PURE__ */ i.jsx(
|
|
1053
|
+
Ve,
|
|
1054
|
+
{
|
|
1055
|
+
definition: x,
|
|
1056
|
+
record: n[x.id],
|
|
1057
|
+
editable: o,
|
|
1058
|
+
selectedCondition: a,
|
|
1059
|
+
size: l,
|
|
1060
|
+
onApplySurface: u,
|
|
1061
|
+
onApplyTooth: v,
|
|
1062
|
+
onClearSurface: Q,
|
|
1063
|
+
onClearTooth: w
|
|
1064
|
+
},
|
|
1065
|
+
x.id
|
|
1066
|
+
)) }) }) });
|
|
1067
|
+
}), Ge = L(function({ selectedCondition: r, onSelect: n }) {
|
|
1068
|
+
return /* @__PURE__ */ i.jsxs("div", { className: "ov-rounded-3xl ov-border ov-border-slate-200 ov-bg-white ov-p-4 ov-shadow-panel", children: [
|
|
1069
|
+
/* @__PURE__ */ i.jsxs("div", { className: "ov-mb-3 ov-flex ov-items-center ov-justify-between ov-gap-3", children: [
|
|
1070
|
+
/* @__PURE__ */ i.jsxs("div", { children: [
|
|
1071
|
+
/* @__PURE__ */ i.jsx("p", { className: "ov-text-xs ov-font-semibold ov-uppercase ov-tracking-[0.22em] ov-text-clinic-600", children: "Estados clínicos" }),
|
|
1072
|
+
/* @__PURE__ */ i.jsx("p", { className: "ov-text-sm ov-text-slate-500", children: "Click izquierdo aplica. Click derecho limpia solo la pieza o superficie elegida." })
|
|
1073
|
+
] }),
|
|
1074
|
+
/* @__PURE__ */ i.jsxs("div", { className: "ov-rounded-full ov-bg-clinic-50 ov-px-3 ov-py-1 ov-text-xs ov-font-medium ov-text-clinic-700", children: [
|
|
1075
|
+
"Activo: ",
|
|
1076
|
+
r
|
|
1077
|
+
] })
|
|
1078
|
+
] }),
|
|
1079
|
+
/* @__PURE__ */ i.jsx("div", { className: "ov-flex ov-flex-wrap ov-gap-2", children: K.map((o) => {
|
|
1080
|
+
const a = o.id === r;
|
|
1081
|
+
return /* @__PURE__ */ i.jsxs(
|
|
1082
|
+
"button",
|
|
1083
|
+
{
|
|
1084
|
+
type: "button",
|
|
1085
|
+
onClick: () => n(o.id),
|
|
1086
|
+
className: [
|
|
1087
|
+
"ov-flex ov-items-center ov-gap-2 ov-rounded-full ov-border ov-px-3 ov-py-2 ov-text-sm ov-transition",
|
|
1088
|
+
a ? "ov-border-clinic-700 ov-bg-clinic-900 ov-text-white" : "ov-border-slate-200 ov-bg-slate-50 ov-text-slate-700 hover:ov-border-clinic-400 hover:ov-bg-white"
|
|
1089
|
+
].join(" "),
|
|
1090
|
+
children: [
|
|
1091
|
+
/* @__PURE__ */ i.jsx(
|
|
1092
|
+
"span",
|
|
1093
|
+
{
|
|
1094
|
+
className: "ov-h-3 ov-w-3 ov-rounded-full ov-border ov-border-white/40",
|
|
1095
|
+
style: { backgroundColor: o.color }
|
|
1096
|
+
}
|
|
1097
|
+
),
|
|
1098
|
+
/* @__PURE__ */ i.jsx("span", { children: o.label })
|
|
1099
|
+
]
|
|
1100
|
+
},
|
|
1101
|
+
o.id
|
|
1102
|
+
);
|
|
1103
|
+
}) })
|
|
1104
|
+
] });
|
|
1105
|
+
}), Be = "CARIES", Je = L(function({
|
|
1106
|
+
value: r,
|
|
1107
|
+
defaultValue: n,
|
|
1108
|
+
onChange: o,
|
|
1109
|
+
dentition: a = "mixed",
|
|
1110
|
+
selectedCondition: l,
|
|
1111
|
+
onSelectedConditionChange: u,
|
|
1112
|
+
editable: v = !0,
|
|
1113
|
+
size: Q = "md",
|
|
1114
|
+
className: w,
|
|
1115
|
+
theme: x
|
|
1116
|
+
}) {
|
|
1117
|
+
const E = typeof r < "u", [T, R] = se(
|
|
1118
|
+
() => ue(n)
|
|
1119
|
+
), [M, S] = se(Be), h = I(
|
|
1120
|
+
() => E ? ue(r) : T,
|
|
1121
|
+
[T, E, r]
|
|
1122
|
+
), O = l ?? M, y = _(
|
|
1123
|
+
(p) => {
|
|
1124
|
+
E || R(p), o == null || o(Ae(p));
|
|
1125
|
+
},
|
|
1126
|
+
[E, o]
|
|
1127
|
+
), d = _(
|
|
1128
|
+
(p) => {
|
|
1129
|
+
l || S(p), u == null || u(p);
|
|
1130
|
+
},
|
|
1131
|
+
[u, l]
|
|
1132
|
+
), k = _(
|
|
1133
|
+
(p, N, q) => {
|
|
1134
|
+
y(Se(h, p, N, q));
|
|
1135
|
+
},
|
|
1136
|
+
[h, y]
|
|
1137
|
+
), g = _(
|
|
1138
|
+
(p, N) => {
|
|
1139
|
+
y(Ce(h, p, N));
|
|
1140
|
+
},
|
|
1141
|
+
[h, y]
|
|
1142
|
+
), z = _(
|
|
1143
|
+
(p, N) => {
|
|
1144
|
+
y(Pe(h, p, N));
|
|
1145
|
+
},
|
|
1146
|
+
[h, y]
|
|
1147
|
+
), G = _(
|
|
1148
|
+
(p) => {
|
|
1149
|
+
y(Ie(h, p));
|
|
1150
|
+
},
|
|
1151
|
+
[h, y]
|
|
1152
|
+
), B = I(() => a === "permanent" ? [
|
|
1153
|
+
{ id: "permanent-upper", label: "Superior permanente", teeth: $.upper },
|
|
1154
|
+
{ id: "permanent-lower", label: "Inferior permanente", teeth: $.lower }
|
|
1155
|
+
] : a === "primary" ? [
|
|
1156
|
+
{ id: "primary-upper", label: "Superior temporal", teeth: F.upper },
|
|
1157
|
+
{ id: "primary-lower", label: "Inferior temporal", teeth: F.lower }
|
|
1158
|
+
] : [...Ne], [a]);
|
|
1159
|
+
return /* @__PURE__ */ i.jsx(
|
|
1160
|
+
"div",
|
|
1161
|
+
{
|
|
1162
|
+
className: [
|
|
1163
|
+
"ov-odontogram ov-w-full ov-max-w-full ov-overflow-hidden ov-rounded-[28px] ov-border ov-border-slate-200 ov-bg-[radial-gradient(circle_at_top_left,_rgba(255,255,255,0.98),_rgba(240,248,249,0.98)_40%,_rgba(229,239,241,1)_100%)] ov-p-4 ov-text-slate-900 ov-shadow-panel md:ov-p-6",
|
|
1164
|
+
w ?? ""
|
|
1165
|
+
].join(" "),
|
|
1166
|
+
style: x == null ? void 0 : x.panelStyle,
|
|
1167
|
+
onContextMenu: (p) => {
|
|
1168
|
+
p.preventDefault();
|
|
1169
|
+
},
|
|
1170
|
+
children: /* @__PURE__ */ i.jsxs("div", { className: "ov-space-y-5", children: [
|
|
1171
|
+
/* @__PURE__ */ i.jsx(Ge, { selectedCondition: O, onSelect: d }),
|
|
1172
|
+
/* @__PURE__ */ i.jsx("div", { className: "ov-overflow-x-auto ov-overflow-y-hidden", children: /* @__PURE__ */ i.jsx("div", { className: "ov-grid ov-min-w-max ov-gap-5", children: B.map((p) => /* @__PURE__ */ i.jsx(
|
|
1173
|
+
ze,
|
|
1174
|
+
{
|
|
1175
|
+
label: p.label,
|
|
1176
|
+
teeth: p.teeth,
|
|
1177
|
+
records: h,
|
|
1178
|
+
editable: v,
|
|
1179
|
+
selectedCondition: O,
|
|
1180
|
+
size: Q,
|
|
1181
|
+
onApplySurface: k,
|
|
1182
|
+
onApplyTooth: g,
|
|
1183
|
+
onClearSurface: z,
|
|
1184
|
+
onClearTooth: G
|
|
1185
|
+
},
|
|
1186
|
+
p.id
|
|
1187
|
+
)) }) })
|
|
1188
|
+
] })
|
|
1189
|
+
}
|
|
1190
|
+
);
|
|
1191
|
+
});
|
|
1192
|
+
export {
|
|
1193
|
+
K as CLINICAL_CONDITIONS,
|
|
1194
|
+
Ne as MIXED_DENTITION_LAYOUT,
|
|
1195
|
+
Je as Odontogram,
|
|
1196
|
+
$ as PERMANENT_DENTITION_LAYOUT,
|
|
1197
|
+
F as PRIMARY_DENTITION_LAYOUT
|
|
1198
|
+
};
|
|
1199
|
+
//# sourceMappingURL=index.js.map
|