@kmanueldc/vue-odontogram 0.1.1
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/LICENSE +21 -0
- package/README.md +720 -0
- package/THIRD_PARTY_NOTICES.md +37 -0
- package/dist/catalogs/nts-peru.d.ts +277 -0
- package/dist/components/ConditionLabels.vue.d.ts +40 -0
- package/dist/components/FindingPrimitives.vue.d.ts +6 -0
- package/dist/components/Odontogram.vue.d.ts +131 -0
- package/dist/components/OdontogramTooltip.vue.d.ts +82 -0
- package/dist/components/SurfaceDiagrams.vue.d.ts +33 -0
- package/dist/components/SurfaceGuide.vue.d.ts +47 -0
- package/dist/components/Tooth.vue.d.ts +56 -0
- package/dist/components/ToothInspector.vue.d.ts +57 -0
- package/dist/composables/useOdontogram.d.ts +43 -0
- package/dist/composables/useToothSelection.d.ts +11 -0
- package/dist/data/index.d.ts +1 -0
- package/dist/data/permanent-horizontal.d.ts +8 -0
- package/dist/data/permanent.d.ts +8 -0
- package/dist/data/primary-horizontal.d.ts +19 -0
- package/dist/data/primary.d.ts +14 -0
- package/dist/index.d.ts +26 -0
- package/dist/types/findings.d.ts +154 -0
- package/dist/types/geometry.d.ts +18 -0
- package/dist/types/odontogram.d.ts +119 -0
- package/dist/types/surfaces.d.ts +21 -0
- package/dist/utils/anchors.d.ts +37 -0
- package/dist/utils/compositions.d.ts +41 -0
- package/dist/utils/dentition-layout.d.ts +27 -0
- package/dist/utils/finding-records.d.ts +82 -0
- package/dist/utils/findings.d.ts +74 -0
- package/dist/utils/labels.d.ts +4 -0
- package/dist/utils/layout.d.ts +19 -0
- package/dist/utils/mixed-layout.d.ts +20 -0
- package/dist/utils/navigation.d.ts +11 -0
- package/dist/utils/notation.d.ts +26 -0
- package/dist/utils/numbers.d.ts +28 -0
- package/dist/utils/primary-horizontal-layout.d.ts +13 -0
- package/dist/utils/primary-layout.d.ts +34 -0
- package/dist/utils/quadrants.d.ts +6 -0
- package/dist/utils/state-marks.d.ts +35 -0
- package/dist/utils/surfaces.d.ts +118 -0
- package/dist/utils/svg-geometry.d.ts +36 -0
- package/dist/utils/tooth-frames.d.ts +51 -0
- package/dist/vue-odontogram.css +1 -0
- package/dist/vue-odontogram.js +3202 -0
- package/dist/vue-odontogram.umd.cjs +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,3202 @@
|
|
|
1
|
+
var ln = Object.defineProperty;
|
|
2
|
+
var un = (t, e, n) => e in t ? ln(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var ce = (t, e, n) => un(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { computed as T, toValue as ot, watch as kt, defineComponent as mt, openBlock as g, createElementBlock as y, Fragment as Z, renderList as O, toDisplayString as P, createElementVNode as B, normalizeStyle as ht, normalizeClass as rt, createCommentVNode as q, createVNode as jt, ref as et, renderSlot as Ht, createTextVNode as pt, nextTick as Rt, useSlots as dn, onBeforeUnmount as hn, unref as X, createBlock as Zt, mergeProps as le, createSlots as fn, withCtx as mn, normalizeProps as ue, guardReactiveProps as de, withModifiers as gn, withDirectives as he, vModelSelect as yn, vModelRadio as vn } from "vue";
|
|
5
|
+
const pn = [
|
|
6
|
+
{
|
|
7
|
+
position: 1,
|
|
8
|
+
type: "Central Incisor",
|
|
9
|
+
outlinePath: "M397.992 51.339C396.126 51.1841 393.495 50.5617 393.495 50.5617C393.495 50.5617 388.804 49.6453 386.903 48.5677C384.873 47.4162 382.213 45.7195 381.838 44.0514C381.487 42.4836 381.216 40.0226 381.478 38.243L381.503 38.0727C381.82 35.9287 382.29 32.7452 382.642 29.3191C382.817 27.6207 382.583 26.5905 383.332 24.0911C384.118 21.4652 384.555 20.2179 385.09 19.2766C385.648 18.2937 386.375 17.5159 386.841 16.5072C387.593 14.8802 388.91 12.8822 390.18 11.3573C390.902 10.4905 391.602 9.74461 392.207 9.11454C393.08 8.20669 394.629 6.4959 395.556 5.46719C396.866 4.01329 398.196 2.73364 399.344 2.32547C400.382 1.95648 401.652 1.80289 402.575 1.56192C403.741 1.25751 404.7 1.04041 406.481 1.59988C407.789 2.01078 408.79 2.15093 410.175 3.6958C411.909 5.63147 412.563 6.70795 413.119 7.75747C414.007 9.43534 415.224 11.7273 416.073 13.2435C416.584 14.1554 417.935 15.8859 419.471 20.7919C420.739 24.8422 421.417 27.4048 421.716 28.4564C422.057 29.6562 422.602 31.5093 422.815 33.7313C423.154 37.2832 423.699 40.0978 423.625 43.1077C423.562 45.6958 423.671 47.3905 422.667 48.4567C421.852 49.3227 420.962 50.1403 419.837 50.5815C418.166 51.2367 416.619 51.7043 415.323 51.8901C414.174 52.0548 409.33 52.1292 405.791 51.8445C404.461 51.7375 402.725 51.7319 397.992 51.339Z",
|
|
10
|
+
shadowPath: "M410.562 10.2393C426.588 45.9698 419.344 47.3813 414.383 48.2436C409.421 49.1058 390.229 45.8566 389.156 45.6013C388.783 45.4122 381.586 45.5268 385.27 28.9613C388.307 15.307 399.25 6.5008 400.149 5.94125C402.84 4.2654 407.678 3.81025 410.562 10.2393Z",
|
|
11
|
+
lineHighlightPath: "M386.65 40.1568C386.979 40.5013 390.29 43.0038 394.2 44.879C396.819 46.1347 400.79 46.3275 403.707 46.4582C411.145 46.8422 412.214 45.7688 414.456 45.2944C414.934 45.1809 415.23 45.0675 415.965 44.8037"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
position: 2,
|
|
15
|
+
type: "Lateral Incisor",
|
|
16
|
+
outlinePath: "M339.362 5.90227C342.255 3.71416 346.038 1.25774 347.807 1.15688C351.997 0.918049 355.515 3.10622 357.625 6.73623C361.668 13.6941 364.043 21.5609 365.951 29.3396C366.793 32.7727 371.064 45.061 366.866 47.897C360.805 55.8472 336.444 55.8684 329.833 49.9979C323.057 43.9805 325.09 29.7675 327.77 22.2921C329.981 16.1281 334.178 9.82403 339.362 5.90227Z",
|
|
17
|
+
shadowPath: "M340.341 10.7533C342.637 9.01674 345.639 7.06721 347.044 6.98717C350.369 6.79762 353.161 8.53425 354.835 11.4152C358.044 16.9373 359.929 23.1807 361.443 29.3542C362.112 32.0788 365.502 41.8314 362.169 44.0822C357.359 50.3918 338.025 50.4086 332.779 45.7496C327.401 40.9738 329.014 29.6938 331.142 23.761C332.896 18.869 336.227 13.8658 340.341 10.7533Z",
|
|
18
|
+
lineHighlightPath: "M334.964 39.2131C335.743 39.9998 343.128 45.3167 349.494 44.3903C352.66 43.9297 359.564 41.7577 360.67 41.2767"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
position: 3,
|
|
22
|
+
type: "Canine",
|
|
23
|
+
outlinePath: "M275.285 36.7016C275.461 34.8357 275.849 18.5473 286.018 5.57867C288.971 1.81325 299.434 0.829071 303.316 3.82989C310.408 9.31139 313.426 28.9506 310.396 37.4059C308.951 41.4393 297.215 55.4587 291.42 52.8366C285.975 50.3727 274.6 43.9742 275.285 36.7016Z",
|
|
24
|
+
shadowPath: "M301.598 7.93945C307.291 12.3406 309.864 28.5513 307.396 35.4392C306.212 38.7427 296.601 50.225 291.854 48.0774C287.984 46.3265 281.376 42.5321 279.505 38.5086C275.156 29.1535 286.937 -3.39247 301.598 7.93945Z",
|
|
25
|
+
lineHighlightPath: "M281.255 35.7132C281.766 36.2349 283.933 38.6225 286.307 40.4563C289.837 43.1816 290.269 43.5706 291.974 44.5673C293.243 45.3091 296.192 46.2724 304.782 36.2803 M287.379 19.4012C287.632 19.2016 291.839 21.1066 296.933 17.499"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
position: 4,
|
|
29
|
+
type: "First Premolar",
|
|
30
|
+
outlinePath: "M236.98 4.87854C231.34 8.91989 227.474 33.8121 227.41 33.9971C227.423 35.3948 224.346 44.1157 245.059 53.0117C246.025 53.4266 247.125 52.888 247.86 52.4695C248.67 52.0073 250.354 50.8376 253.096 48.11C254.772 46.4429 261.519 39.4872 261.637 34.8665C261.691 32.7406 261.314 28.4868 260.916 24.2565C260.517 20.0262 259.172 12.5851 258.255 9.7502C257.37 7.00905 252.569 -3.57975 236.98 4.87854Z",
|
|
31
|
+
shadowPath: "M238.114 7.66346C233.204 11.182 229.838 32.8544 229.782 33.0155C229.793 34.2324 227.114 41.8252 245.148 49.5706C245.989 49.9317 246.947 49.4629 247.586 49.0985C248.293 48.6961 249.758 47.6777 252.146 45.3029C253.605 43.8514 259.479 37.7955 259.582 33.7724C259.629 31.9215 259.301 28.218 258.954 24.5348C258.607 20.8517 257.435 14.3731 256.638 11.905C255.866 9.51838 251.687 0.299255 238.114 7.66346Z",
|
|
32
|
+
lineHighlightPath: "M232.699 39.8277C232.885 39.9138 233.796 40.4028 238.753 42.4719C241.555 43.6416 243.526 43.4623 245.192 43.1391C246.68 42.8502 249.007 41.9121 250.856 40.686C251.932 39.8864 252.954 38.9499 254.698 37.0231C255.147 36.4782 255.449 36.0189 256.052 35.3458 M239.545 12.8442C241.885 10.1252 250.366 10.5793 250.366 10.5793"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
position: 5,
|
|
36
|
+
type: "Second Premolar",
|
|
37
|
+
outlinePath: "M186.485 45.8905C188.39 47.4915 194.878 52.668 197.762 53.1457C200.384 53.5801 211.318 44.6344 213.743 37.254C214.322 35.4928 215.038 15.1384 208.58 4.13152C202.248 -2.02701 189.273 -0.756658 185.395 11.0477C183.218 17.6734 180.668 30.608 180.423 32.2205C180.177 33.8383 180.188 36.0117 180.547 38.1716C180.751 39.3933 180.853 40.0649 181.221 40.6135C181.726 41.3662 183.233 43.1574 186.485 45.8905Z",
|
|
38
|
+
shadowPath: "M188.107 43.3403C189.761 44.7301 195.393 49.2236 197.896 49.6383C200.172 50.0154 209.664 42.2499 211.769 35.8432C212.271 34.3143 212.893 16.6453 207.287 7.09053C201.791 1.74449 190.527 2.84724 187.16 13.0943C185.271 18.8458 183.057 30.074 182.845 31.4738C182.631 32.8782 182.641 34.7648 182.953 36.6398C183.129 37.7003 183.218 38.2832 183.537 38.7594C183.976 39.4129 185.284 40.9678 188.107 43.3403Z",
|
|
39
|
+
lineHighlightPath: "M185.566 38.954C200.902 47.5796 204.772 37.6999 208.388 34.1061 M191.566 11.1268C196.702 7.12464 201.745 8.78762 202.549 8.92105"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
position: 6,
|
|
43
|
+
type: "First Molar",
|
|
44
|
+
outlinePath: "M128.904 45.8941C130.676 47.3001 145.884 61.9755 162.145 45.1423C163.249 43.9986 172.589 28.7255 163.065 9.88792C162.022 7.82514 161.32 5.92758 160.392 4.9355C159.008 3.45593 158.296 2.7052 156.622 2.60279C155.155 2.51311 153.656 3.01459 150.242 3.84879C148.517 4.2702 147.372 4.53309 144.251 3.3168C143.121 2.87675 141.495 2.08665 139.43 1.98738C137.768 1.90751 136.636 1.9765 135.262 2.89208C133.14 4.30717 131.556 6.06007 130.301 8.67838C129.938 9.43672 129.094 10.8117 127.581 13.8497C126.625 15.77 125.381 18.4495 124.394 20.9063C123.406 23.3631 122.657 25.5204 122.24 27.0814C121.585 29.5351 120.898 32.0017 121.468 34.2957L121.471 34.3102C121.817 35.7 122.322 37.7345 123.709 39.8068C125.153 41.9637 126.819 44.2397 128.904 45.8941Z",
|
|
45
|
+
shadowPath: "M131.01 43.4559C132.509 44.7414 145.836 57.4979 160.034 42.7994C160.999 41.8008 169.154 28.4646 160.838 12.016C159.927 10.2149 159.315 8.55796 158.504 7.6917C157.296 6.39976 156.674 5.74424 155.212 5.65482C153.932 5.57651 152.623 6.01439 149.641 6.7428C148.135 7.11076 147.135 7.34032 144.41 6.27827C143.424 5.89404 142.004 5.20414 140.2 5.11746C129.959 4.62519 125.555 25.666 125.191 27.029L125.189 27.0338C124.616 29.1822 122.705 36.3359 131.01 43.4559Z",
|
|
46
|
+
lineHighlightPath: "M153.854 27.4742C149.502 26.6409 144.049 27.8519 142.802 30.5372C143.302 25.2189 138.067 23.5889 133.932 23.5051 M153.854 27.4742C156.709 28.0209 159.09 29.4476 159.498 31.9153 M153.854 27.4742C155.556 27.6746 159.3 27.5062 160.657 25.2286 M129.139 24.6538C129.507 24.1665 131.326 23.4523 133.932 23.5051 M133.932 23.5051C132.471 22.6048 129.672 20.364 130.173 18.6034"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
position: 7,
|
|
50
|
+
type: "Second Molar",
|
|
51
|
+
outlinePath: "M60.6793 25.3418C59.9161 27.6449 57.3636 48.9037 84.9129 53.0846C99.7889 54.3626 106.055 39.2037 106.365 36.7909C108.564 30.6549 106.469 17.6337 105.276 14.6833C103.739 10.8816 102.7 8.48706 101.946 7.37378C100.442 5.15401 99.23 3.29064 98.43 2.92655C97.2983 2.41145 95.3919 1.13034 91.2714 2.68435C88.4359 3.75373 86.0838 3.4998 83.6256 2.76604C80.7363 1.9036 76.9082 0.690209 75.4367 0.962055C74.4606 1.14236 73.4249 1.15689 72.6333 1.98215C71.4867 3.17764 70.1618 4.75807 67.8021 9.5839C66.634 11.9729 64.7932 15.7196 63.8949 17.7849C62.387 21.2519 61.3298 23.3785 60.6793 25.3418Z",
|
|
52
|
+
shadowPath: "M63.8099 25.4532C63.1456 27.4579 60.9238 45.9624 84.9037 49.6015C97.8523 50.7139 103.307 37.5191 103.576 35.419C106.215 28.0569 104.202 16.4153 99.73 9.81324C98.4211 7.88108 97.3658 6.25914 96.6695 5.94222C95.6844 5.49387 93.796 4.7905 90.2093 6.14316C87.7412 7.07399 85.9229 6.4412 83.7832 5.80251C81.4234 5.09812 76.4488 2.79134 74.2151 5.12018C73.2171 6.16077 72.0638 7.53645 70.0098 11.737C67.83 16.195 65.3744 20.7318 63.8099 25.4532Z",
|
|
53
|
+
lineHighlightPath: "M92.3375 21.9418C89.3377 22.2849 84.8906 23.6339 83.7253 27.9829C84.7838 23.138 77.3962 22.8185 73.5022 23.7247 M92.3375 21.9418C96.1666 21.5038 99.585 23.1101 100.215 24.165 M92.3375 21.9418C94.4127 21.402 98.5317 19.898 99.5584 17.8597 M68.7524 26.3173C69.2513 25.49 70.8242 24.3479 73.5022 23.7247 M73.5022 23.7247C71.8339 23.4169 68.3955 22.3238 67.9878 20.414"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
position: 8,
|
|
57
|
+
type: "Third Molar",
|
|
58
|
+
outlinePath: "M22.8836 52.8066C23.9272 53.0915 25.7986 52.8756 26.2096 52.9116C26.501 52.9372 29.1459 52.7852 30.9534 52.2805C33.3552 51.4149 34.9901 50.7777 35.8495 50.1498C37.4391 48.9886 39.8965 46.9387 41.9506 44.3052C43.4092 42.4352 44.6381 40.2207 45.6008 37.6721C46.2927 35.8405 46.8536 34.1203 46.9928 31.3837C47.0827 29.6169 47.0888 27.1207 46.8396 24.256C46.5904 21.3913 46.1008 18.2531 45.5737 15.8629C45.0466 13.4727 44.4986 11.8788 43.9103 10.4861C43.3219 9.09334 42.7016 7.94145 42.3718 7.27535C41.7672 6.05446 41.3188 4.92976 40.5172 4.18705C38.9052 2.69353 37.6504 2.08716 36.39 1.85884C35.3031 1.66195 33.6407 1.67752 32.5207 2.07341C30.9374 2.63304 30.0912 3.2864 27.6613 3.30729C24.3667 3.3356 22.5667 1.96049 20.5098 1.81402C17.0827 1.56998 15.2376 1.60216 14.1182 2.20976C13.2193 2.69768 12.0927 3.47083 9.80979 6.74515C9.14188 7.70312 8.43252 8.93509 6.93122 12.162C5.88407 14.4128 4.32452 17.8482 3.48639 19.6641C2.55627 21.6793 1.61739 23.4684 0.935372 26.3698C0.449847 28.4352 0.305589 30.9466 0.839682 33.6862C1.20408 35.5554 1.8879 38.1004 4.17249 41.0505C6.62542 44.218 8.40151 46.3149 9.38601 47.091C10.2686 47.7868 11.1762 48.4668 12.4397 49.0231C14.0734 49.7423 15.5681 50.8399 17.5147 51.4152C19.7705 52.0818 21.1395 52.3305 22.8836 52.8066Z",
|
|
59
|
+
shadowPath: "M22.9904 49.6908C23.9066 49.9409 25.5494 49.7513 25.9103 49.783C26.166 49.8054 28.488 49.6719 30.0748 49.2289C32.1834 48.469 33.6186 47.9096 34.3731 47.3584C35.7686 46.3389 37.9259 44.5394 39.7292 42.2274C41.0097 40.5858 42.0885 38.6416 42.9337 36.4042C43.5411 34.7963 44.0335 33.2862 44.1557 30.8837C44.2346 29.3326 44.24 27.1413 44.0212 24.6263C43.8025 22.1114 43.3726 19.3564 42.9099 17.2581C42.4472 15.1598 41.9661 13.7604 41.4496 12.5378C40.9331 11.3151 40.3885 10.3039 40.099 9.71911C39.5682 8.64729 39.1745 7.65993 38.4708 7.00789C37.0556 5.69674 35.9541 5.16442 34.8476 4.96398C33.8934 4.79113 32.434 4.8048 31.4507 5.15234C30.0608 5.64364 29.3179 6.21722 27.1847 6.23556C24.2924 6.26042 22.7122 5.05321 20.9064 4.92463C17.8978 4.71038 16.2779 4.73864 15.2953 5.27204C14.5061 5.70039 13.5171 6.37914 11.5129 9.25365C10.9266 10.0946 10.3038 11.1762 8.98585 14.0091C8.06656 15.9851 6.69744 19.001 5.96165 20.5951C5.1451 22.3642 4.32086 23.9349 3.72212 26.482C3.29588 28.2953 3.16924 30.4999 3.63812 32.9051C3.95802 34.546 4.55834 36.7803 6.56397 39.3702C8.71739 42.1509 10.2766 43.9917 11.1409 44.6731C11.9158 45.2839 12.7125 45.8809 13.8217 46.3692C15.256 47.0006 16.5682 47.9643 18.2771 48.4693C20.2574 49.0544 21.4592 49.2728 22.9904 49.6908Z",
|
|
60
|
+
lineHighlightPath: "M7.13742 27.9101C7.89327 26.717 10.2562 25.7846 12.8627 25.483M38.0458 27.6444C37.0983 25.9368 34.2284 24.8447 31.1328 24.7739M37.58 21.3626C36.685 22.4687 34.1426 24.6994 31.1328 24.7739M31.1328 24.7739C27.1226 24.6823 22.7336 26.3048 21.6544 30.5239C21.9221 26.1555 17.0744 24.9957 12.8627 25.483M6.646 21.8371C7.23084 23.1942 9.29296 25.8232 12.8627 25.483"
|
|
61
|
+
}
|
|
62
|
+
], xn = [
|
|
63
|
+
{
|
|
64
|
+
position: 1,
|
|
65
|
+
type: "Central Incisor",
|
|
66
|
+
outlinePath: "M173.951 1.698c-2.198.16-5.302.862-5.302.862s-5.531 1.025-7.781 2.27c-2.403 1.333-5.553 3.299-6.013 5.258-.432 1.84-.78 4.734-.491 6.832l.027.2c.348 2.527.865 6.28 1.239 10.316.186 2-.101 3.21.751 6.16.895 3.1 1.395 4.573 2.013 5.687.646 1.164 1.493 2.087 2.03 3.28.866 1.924 2.393 4.29 3.87 6.1a48.805 48.805 0 0 0 2.36 2.663c1.016 1.078 2.819 3.11 3.898 4.331 1.526 1.727 3.076 3.248 4.423 3.742 1.217.446 2.709.642 3.793.936 1.369.372 2.494.638 4.597 0 1.545-.468 2.725-.621 4.372-2.424 2.064-2.258 2.846-3.517 3.512-4.746 1.065-1.964 2.524-4.648 3.541-6.422.611-1.068 2.221-3.089 4.086-8.845 1.54-4.752 2.367-7.76 2.731-8.994.415-1.408 1.079-3.583 1.355-6.196.44-4.176 1.114-7.482 1.062-11.026-.044-3.046.104-5.04-1.065-6.306-.95-1.029-1.988-2.001-3.306-2.534-1.959-.79-3.775-1.358-5.298-1.592-1.351-.207-7.05-.35-11.219-.057-1.567.11-3.61.097-9.185.505Z",
|
|
67
|
+
shadowPath: "M188.269 50.215c19.275-41.867 10.766-43.612 4.937-44.684-5.829-1.073-28.455 2.53-29.72 2.817-.442.218-8.911 0-4.767 19.54 3.416 16.105 16.193 26.596 17.244 27.265 3.148 2.003 8.837 2.595 12.306-4.938Z",
|
|
68
|
+
lineHighlightPath: "M160.472 14.727c.392-.402 4.317-3.309 8.941-5.47 3.097-1.448 7.773-1.629 11.207-1.749 8.759-.365 10.004.91 12.637 1.495.562.139.909.276 1.771.595"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
position: 2,
|
|
72
|
+
type: "Lateral Incisor",
|
|
73
|
+
outlinePath: "M135.016 60.41c3.443 1.355 7.834 2.73 9.601 2.346 4.185-.91 7.044-4.017 8.123-8.152 2.069-7.927 2.249-16.288 1.995-24.436-.113-3.596.72-16.81-4.184-18.444-8.135-6.14-32.088.494-36.979 8.055-5.013 7.751.878 21.131 5.56 27.728 3.862 5.44 9.714 10.474 15.884 12.903Z",
|
|
74
|
+
shadowPath: "M134.65 55.386c2.732 1.076 6.217 2.167 7.62 1.862 3.321-.723 5.59-3.188 6.446-6.47 1.642-6.29 1.786-12.927 1.583-19.393-.089-2.854.572-13.342-3.32-14.638-6.456-4.873-25.466.392-29.348 6.393-3.979 6.152.696 16.77 4.413 22.006 3.064 4.317 7.709 8.313 12.606 10.24Z",
|
|
75
|
+
lineHighlightPath: "M121.569 28.952c.551-.984 6.354-8.214 12.866-9.045 3.238-.413 10.619-.17 11.838 0"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
position: 3,
|
|
79
|
+
type: "Canine",
|
|
80
|
+
outlinePath: "M77.63 64.236c1.692 1.401 15.516 14.583 34.698 16.903 5.569.674 15.058-7.184 15.789-12.89 1.335-10.423-12.444-29.205-21.965-33.703-4.542-2.145-25.892-4.039-28.523 2.939-2.471 6.557-6.596 21.29 0 26.751Z",
|
|
81
|
+
shadowPath: "M123.285 66.267c1.072-8.368-10.234-23.94-17.99-27.603-3.72-1.757-21.206-3.308-23.36 2.407-1.757 4.66-4.09 13.284-2.306 18.17 4.15 11.36 40.897 28.573 43.656 7.026Z",
|
|
82
|
+
lineHighlightPath: [
|
|
83
|
+
"M82.84 60.043c-.01-.855-.193-4.63.256-8.12.667-5.185.703-5.866 1.29-8.106.437-1.666 2.083-4.91 17.487-3.748",
|
|
84
|
+
"M101.438 68.49c.376-.045 2.284-5.112 9.498-6.344"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
position: 4,
|
|
89
|
+
type: "First Premolar",
|
|
90
|
+
outlinePath: "M93.684 108.748c-7.498 3.397-35.368-7.397-35.596-7.441-1.429-.842-12.215-2.854-9.068-29.414.147-1.238 1.353-2.05 2.218-2.556.956-.559 3.157-1.595 7.587-2.794 2.707-.734 13.856-3.54 18.674-.92 2.216 1.206 6.363 4.117 10.473 7.036 4.11 2.919 10.958 8.715 13.327 11.338 2.291 2.537 10.324 13.75-7.615 24.751Z",
|
|
91
|
+
shadowPath: "M91.495 105.931c-6.528 2.958-30.793-6.44-30.992-6.478-1.243-.734-10.634-2.486-7.895-25.61.128-1.078 1.178-1.785 1.932-2.225.832-.487 2.748-1.39 6.605-2.433 2.357-.639 12.064-3.082 16.258-.8 1.93 1.05 5.54 3.584 9.12 6.125 3.578 2.541 9.54 7.588 11.603 9.872 1.994 2.208 8.987 11.971-6.63 21.549Z",
|
|
92
|
+
lineHighlightPath: [
|
|
93
|
+
"M55.234 92.414c.022-.242.06-1.469.875-7.79.46-3.573 1.813-5.49 3.134-7.01 1.18-1.359 3.524-3.193 5.88-4.365 1.46-.632 3.029-1.126 6.044-1.776.826-.138 1.477-.175 2.526-.395",
|
|
94
|
+
"M87.02 101.387c4.183-.792 8.747-9.774 8.747-9.774"
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
position: 5,
|
|
99
|
+
type: "Second Premolar",
|
|
100
|
+
outlinePath: "M33.396 127.652c-1.088-2.713-4.486-11.852-3.962-15.246.477-3.085 14.47-12.008 23.595-12.008 2.178 0 25.157 6.665 35.073 17.908 4.551 9.324-1.624 23.339-16.22 23.339-8.193 0-23.563-1.897-25.453-2.215-1.896-.319-4.317-1.128-6.596-2.321-1.289-.675-2-1.035-2.478-1.647-.655-.84-2.101-3.178-3.96-7.81Z",
|
|
101
|
+
shadowPath: "M36.837 126.778c-.945-2.356-3.895-10.289-3.44-13.235.414-2.679 12.561-10.424 20.483-10.424 1.89 0 21.837 5.785 30.445 15.545 3.951 8.094-1.41 20.26-14.08 20.26-7.112 0-20.454-1.647-22.095-1.922-1.645-.277-3.747-.98-5.725-2.015-1.12-.586-1.737-.899-2.151-1.43-.57-.729-1.825-2.759-3.437-6.779Z",
|
|
102
|
+
lineHighlightPath: [
|
|
103
|
+
"M40.8 131.221c-4.003-20.278 8.442-20.974 13.779-23.692",
|
|
104
|
+
"M74.056 134.729c6.35-4.264 6.343-10.503 6.489-11.448"
|
|
105
|
+
]
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
position: 6,
|
|
109
|
+
type: "First Molar",
|
|
110
|
+
outlinePath: "M35.539 203.323c-3.363.196-32.788-4.02-28.495-42.465 3.631-20.408 26.21-23.364 29.557-22.912 9.019-.745 25.727 6.743 29.255 9.403 4.546 3.427 7.384 5.681 8.606 7.092 2.436 2.814 4.499 5.11 4.7 6.313.284 1.703 1.317 4.72-2.248 9.687-2.453 3.418-2.957 6.663-2.856 10.223.118 4.185.37 9.754-.524 11.63-.592 1.244-.984 2.627-2.375 3.392-2.015 1.108-4.61 2.317-11.93 3.748-3.623.708-9.309 1.83-12.401 2.292-5.19.777-8.423 1.43-11.289 1.597Z",
|
|
111
|
+
shadowPath: "M36.515 199.085c-2.927.17-28.54-3.499-24.803-36.963 3.16-17.764 22.814-20.337 25.727-19.944 10.82-.893 25.709 5.989 32.955 14.358 2.12 2.45 3.917 4.448 4.091 5.495.248 1.482.513 4.268-2.59 8.591-2.135 2.975-1.94 5.641-1.852 8.74.096 3.417 1.402 10.917-2.523 13.076-1.754.964-4.013 2.016-10.384 3.261-6.762 1.322-13.728 2.984-20.621 3.386Z",
|
|
112
|
+
lineHighlightPath: [
|
|
113
|
+
"M37.132 192.147c1.288-.372 3.385-2.071 5.183-5.438m9.008-35.98c1.188 1.224 2.114 6.385.15 11.363m0 0c-1.537 3.899-4.944 9.378-11.195 9.378 6.877.321 4.651 10.343 2.037 15.239m9.159-24.617c1.47-2.589 4.966-7.572 8.068-8.217m-17.227 32.834c-.186 2.348.044 7.351 2.458 8.584"
|
|
114
|
+
]
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
position: 7,
|
|
118
|
+
type: "Second Molar",
|
|
119
|
+
outlinePath: "M4.969 248.132c-1.188-2.74-14.708-27.152 12.319-42.139 1.836-1.018 24.508-7.711 45.28 10.874 2.274 2.035 4.455 3.579 5.403 5.102 1.414 2.271 2.128 3.435 1.687 5.606-.387 1.901-1.54 3.642-3.77 7.711-1.127 2.056-1.854 3.427-1.369 7.824.175 1.59.627 3.935.048 6.603-.466 2.147-.941 3.567-2.578 5.006-2.53 2.224-5.307 3.645-9.076 4.35-1.091.204-3.133.811-7.525 1.702-2.776.563-6.619 1.234-10.09 1.654-3.47.42-6.478.638-8.612.636-3.353-.002-6.734.031-9.465-1.48l-.018-.01c-1.654-.915-4.076-2.255-6.245-4.732-2.258-2.579-4.591-5.482-5.989-8.707Z",
|
|
120
|
+
shadowPath: "M8.799 246.28c-1.128-2.352-12.843-23.709 10.756-36.796 1.604-.889 21.4-6.732 39.538 9.496 1.986 1.777 3.89 3.125 4.717 4.454 1.235 1.983 1.859 3 1.473 4.895-.337 1.66-1.343 3.18-3.291 6.734-.984 1.795-1.619 2.992-1.196 6.831.154 1.389.548 3.436.042 5.766-2.872 13.231-31.213 11.657-33.076 11.656h-.007c-2.936-.003-12.714-.01-18.956-13.036Z",
|
|
121
|
+
lineHighlightPath: [
|
|
122
|
+
"M32.14 255.091c.748-.303 2.28-2.378 3.103-5.721m-1.99-35.481c3.009 1.363 4.015 4.888 3.736 8.716m0 0c-.424 5.835-3.832 12.377-7.683 13.049 6.954 1.18 7.244 8.414 5.937 13.716m1.746-26.765c.327-2.24 1.82-6.958 5.19-7.91m-6.936 34.675c.65 2.172 2.55 6.507 4.967 6.471"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
position: 8,
|
|
127
|
+
type: "Third Molar",
|
|
128
|
+
outlinePath: "M.895 291.331c-.362-1.218-.116-3.411-.164-3.892-.035-.34.124-3.438.727-5.558 1.04-2.82 1.808-4.74 2.573-5.752 1.413-1.872 3.913-4.769 7.135-7.2 2.288-1.726 5.003-3.187 8.133-4.339 2.249-.828 4.362-1.502 7.732-1.693 2.175-.123 5.25-.155 8.782.108s7.403.804 10.353 1.397 4.92 1.218 6.641 1.893c1.722.675 3.148 1.389 3.972 1.768 1.51.696 2.9 1.209 3.824 2.14 1.857 1.872 2.617 3.334 2.912 4.807.254 1.27.252 3.216-.224 4.531-.672 1.859-1.468 2.856-1.468 5.7 0 3.857 1.713 5.95 1.915 8.356.337 4.008.317 6.168-.42 7.485-.591 1.057-1.532 2.383-5.541 5.088-1.173.791-2.684 1.634-6.643 3.424-2.762 1.248-6.977 3.108-9.205 4.107-2.473 1.109-4.667 2.226-8.234 3.053-2.54.589-5.631.784-9.012.186-2.307-.408-5.449-1.183-9.107-3.827-3.928-2.839-6.53-4.897-7.497-6.041-.866-1.026-1.714-2.082-2.412-3.555-.904-1.905-2.272-3.643-3-5.916-.846-2.633-1.167-4.233-1.772-6.27Z",
|
|
129
|
+
shadowPath: "M4.732 291.175c-.317-1.07-.101-2.994-.144-3.416-.03-.299.11-3.019.638-4.88.914-2.476 1.588-4.161 2.26-5.05 1.24-1.643 3.434-4.187 6.263-6.321 2.009-1.515 4.393-2.797 7.14-3.809 1.974-.727 3.83-1.318 6.788-1.486 1.91-.108 4.61-.136 7.71.095 3.1.231 6.498.706 9.088 1.226 2.59.521 4.319 1.07 5.83 1.662 1.512.592 2.764 1.22 3.487 1.553 1.326.61 2.547 1.061 3.357 1.878 1.63 1.643 2.298 2.927 2.557 4.22.223 1.115.221 2.824-.196 3.978-.59 1.632-1.29 2.507-1.29 5.004 0 3.385 1.504 5.223 1.682 7.335.296 3.519.278 5.416-.369 6.571-.52.928-1.345 2.093-4.865 4.467-1.03.695-2.355 1.435-5.831 3.006-2.425 1.096-6.126 2.728-8.082 3.606-2.17.973-4.096 1.954-7.228 2.68-2.229.517-4.944.688-7.912.163-2.024-.358-4.783-1.038-7.995-3.359-3.448-2.493-5.732-4.299-6.58-5.304-.761-.901-1.505-1.827-2.119-3.121-.793-1.672-1.994-3.198-2.634-5.193-.742-2.312-1.024-3.717-1.555-5.505Z",
|
|
130
|
+
lineHighlightPath: [
|
|
131
|
+
"M31.732 309.511c1.462-.897 2.585-3.672 2.93-6.726m-2.93-29.453c2.114 1.092 3.49 4.44 3.61 8.062m4.133-7.58c-1.353 1.058-4.074 4.057-4.134 7.58m0 0c.155 4.693-1.797 9.846-6.983 11.152 5.379-.357 6.859 5.305 6.303 10.239m4.557 7.24c-1.678-.671-4.938-3.058-4.557-7.24"
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
], wn = [
|
|
135
|
+
{
|
|
136
|
+
position: 1,
|
|
137
|
+
type: "Primary Central Incisor",
|
|
138
|
+
transform: "translate(360.75 13.3) scale(-0.75 0.75)",
|
|
139
|
+
outlinePath: "M176 5C170 6 165 10 164 17c-1 8 1 18 4 25 3 7 7 12 12 15 4 2 10 2 14-1 6-5 10-13 12-22 1-7 1-14-2-19-4-7-12-11-18-10Z",
|
|
140
|
+
shadowPath: "M178 10c-5 1-8 5-9 10-1 7 1 15 4 21 2 5 5 9 9 11 3 1 7 1 10-2 5-4 8-10 9-18 1-6 1-11-2-15-3-5-9-8-15-7Z",
|
|
141
|
+
lineHighlightPath: "M170 19c4-5 15-7 24-3"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
position: 2,
|
|
145
|
+
type: "Primary Lateral Incisor",
|
|
146
|
+
transform: "translate(36.75 10.5) scale(0.75)",
|
|
147
|
+
outlinePath: "M177 21c5-5 15-6 22-3 7 3 11 10 11 18 0 10-5 20-12 25-6 4-14 3-20-2-6-5-9-13-8-22 0-7 2-12 7-16Z",
|
|
148
|
+
shadowPath: "M180 25c4-4 12-4 17-2 6 3 8 8 8 15 0 8-4 16-10 20-5 3-11 2-15-2-4-4-6-10-5-17 0-6 2-11 5-14Z",
|
|
149
|
+
lineHighlightPath: "M178 36c5-4 14-5 20-1"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
position: 3,
|
|
153
|
+
type: "Primary Canine",
|
|
154
|
+
transform: "translate(24.75 10.25) scale(0.75)",
|
|
155
|
+
outlinePath: "M135 49c1-12 7-24 16-32 4-4 10-4 14-1 7 6 8 17 5 27-3 11-10 20-19 23-6 2-13-2-15-8-2-3-2-6-1-9Z",
|
|
156
|
+
shadowPath: "M140 49c1-10 6-19 13-26 3-3 7-3 10 0 5 5 5 14 3 22-3 9-8 16-15 19-4 1-9-2-10-6-1-3-1-6-1-9Z",
|
|
157
|
+
lineHighlightPath: ["M142 52c2-10 7-18 14-24", "M156 28c4 8 3 17-1 25"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
position: 4,
|
|
161
|
+
type: "Primary First Molar",
|
|
162
|
+
transform: "translate(19.5 11) scale(0.75)",
|
|
163
|
+
outlinePath: "M82 19c10-7 26-7 36 0 9 7 12 19 8 30-4 12-15 19-28 20-13 1-25-4-31-14-6-11-3-26 15-36Z",
|
|
164
|
+
shadowPath: "M85 24c8-5 21-5 29 1 7 5 9 15 6 24-4 9-12 15-23 16-11 1-20-3-25-11-5-9-2-20 13-26Z",
|
|
165
|
+
lineHighlightPath: [
|
|
166
|
+
"M78 42c6-5 13-7 19-4 5 2 7 7 8 11",
|
|
167
|
+
"M105 49c5-6 11-7 16-3",
|
|
168
|
+
"M97 27c1 7 1 15 0 22"
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
position: 5,
|
|
173
|
+
type: "Primary Second Molar",
|
|
174
|
+
transform: "translate(4.5 11.25) scale(0.75)",
|
|
175
|
+
outlinePath: "M23 16c11-6 28-5 39 3 10 8 13 21 9 33-5 13-17 21-32 22-16 1-29-5-35-17-6-12-1-31 19-41Z",
|
|
176
|
+
shadowPath: "M27 21c9-5 23-4 32 3 8 6 10 17 7 27-4 10-14 17-27 18-13 1-23-4-28-14-5-10-1-25 16-34Z",
|
|
177
|
+
lineHighlightPath: [
|
|
178
|
+
"M18 43c7-6 15-8 23-5 5 3 8 8 10 13",
|
|
179
|
+
"M51 51c6-7 14-8 20-3",
|
|
180
|
+
"M40 28c2 8 2 17 0 26"
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
], bn = [
|
|
184
|
+
{
|
|
185
|
+
position: 1,
|
|
186
|
+
type: "Primary Central Incisor",
|
|
187
|
+
outlinePath: "M176 5C170 6 165 10 164 17c-1 8 1 18 4 25 3 7 7 12 12 15 4 2 10 2 14-1 6-5 10-13 12-22 1-7 1-14-2-19-4-7-12-11-18-10Z",
|
|
188
|
+
shadowPath: "M178 10c-5 1-8 5-9 10-1 7 1 15 4 21 2 5 5 9 9 11 3 1 7 1 10-2 5-4 8-10 9-18 1-6 1-11-2-15-3-5-9-8-15-7Z",
|
|
189
|
+
lineHighlightPath: "M170 19c4-5 15-7 24-3"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
position: 2,
|
|
193
|
+
type: "Primary Lateral Incisor",
|
|
194
|
+
outlinePath: "M137 15c-6 1-11 5-13 10-3 7-2 16 1 23 3 7 8 12 14 15 5 2 11 1 15-3 5-5 7-12 7-20 0-7-2-14-6-18-5-6-12-8-18-7Z",
|
|
195
|
+
shadowPath: "M139 20c-5 1-8 4-10 8-2 6-1 13 2 19 2 5 6 9 10 11 4 1 8 1 11-3 4-4 5-10 5-16 0-6-2-11-5-14-4-4-8-6-13-5Z",
|
|
196
|
+
lineHighlightPath: "M130 29c5-5 15-7 23-3"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
position: 3,
|
|
200
|
+
type: "Primary Canine",
|
|
201
|
+
outlinePath: "M95 38c1-9 6-16 13-21 5-4 13-3 18 1 6 5 9 13 8 21-1 8-6 16-12 21-5 5-12 8-18 5-7-3-11-11-9-27Z",
|
|
202
|
+
shadowPath: "M100 40c1-7 5-12 10-16 4-3 10-2 14 1 5 4 6 10 6 16-1 7-4 13-10 18-4 3-9 5-13 3-5-3-8-9-7-22Z",
|
|
203
|
+
lineHighlightPath: [
|
|
204
|
+
"M102 47c2-8 7-14 14-18",
|
|
205
|
+
"M116 29c4 7 4 15 1 23"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
position: 4,
|
|
210
|
+
type: "Primary First Molar",
|
|
211
|
+
outlinePath: "M57 108c3-9 12-15 23-16 12-1 24 4 30 13 5 8 5 19 0 27-5 9-16 14-28 15-12 1-24-3-29-12-5-8-3-19 4-27Z",
|
|
212
|
+
shadowPath: "M62 111c3-7 10-11 19-12 10-1 20 3 25 10 4 6 4 14 0 21-5 7-13 10-24 11-10 1-19-2-24-9-4-6-2-14 4-21Z",
|
|
213
|
+
lineHighlightPath: [
|
|
214
|
+
"M67 120c5-5 10-7 15-5 4 2 6 5 8 8",
|
|
215
|
+
"M90 123c5-5 11-6 16-2",
|
|
216
|
+
"M82 107c1 6 1 12 0 18"
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
position: 5,
|
|
221
|
+
type: "Primary Second Molar",
|
|
222
|
+
outlinePath: "M13 162c4-11 15-19 29-20 15-2 29 3 37 14 7 10 7 23 1 34-7 12-20 18-35 19-15 1-29-4-36-15-6-10-3-22 4-32Z",
|
|
223
|
+
shadowPath: "M19 165c4-8 12-14 24-16 12-1 24 3 30 12 5 8 5 18 1 27-6 9-16 14-30 15-12 1-24-3-30-12-5-8-2-18 5-26Z",
|
|
224
|
+
lineHighlightPath: [
|
|
225
|
+
"M24 178c5-7 13-10 20-7 5 2 7 7 9 12",
|
|
226
|
+
"M53 183c6-7 14-8 21-3",
|
|
227
|
+
"M43 157c2 8 2 17 0 26"
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
], Mt = {
|
|
231
|
+
arch: {
|
|
232
|
+
viewBox: "0 0 409 694",
|
|
233
|
+
quadrants: [
|
|
234
|
+
{ quadrant: 1, transform: "" },
|
|
235
|
+
{ quadrant: 2, transform: "scale(-1, 1) translate(-409, 0)" },
|
|
236
|
+
{ quadrant: 4, transform: "scale(1, -1) translate(0, -694)" },
|
|
237
|
+
{ quadrant: 3, transform: "scale(-1, -1) translate(-409, -694)" }
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
horizontal: {
|
|
241
|
+
viewBox: "0 0 900 150",
|
|
242
|
+
quadrants: [
|
|
243
|
+
{ quadrant: 1, transform: "" },
|
|
244
|
+
{ quadrant: 2, transform: "translate(840, 0) scale(-1, 1) translate(-55,0)" },
|
|
245
|
+
{ quadrant: 4, transform: "scale(1, -1) translate(0, -150)" },
|
|
246
|
+
{ quadrant: 3, transform: "translate(840, 0) scale(-1, -1) translate(-55,-150)" }
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
function fe(t, e, n = !1) {
|
|
251
|
+
return `scale(${n ? -1 : 1}, -1) translate(${n ? -409 : 0}, -${e})`;
|
|
252
|
+
}
|
|
253
|
+
const Mn = {
|
|
254
|
+
/**
|
|
255
|
+
* Mirrors each central incisor while moving it four units away from the
|
|
256
|
+
* midline. The pair gains eight units of clearance, about 20% of its
|
|
257
|
+
* provisional width.
|
|
258
|
+
*/
|
|
259
|
+
"Primary Central Incisor": "translate(366 0) scale(-1 1)",
|
|
260
|
+
/**
|
|
261
|
+
* Moves each lateral incisor away from the midline only on the x-axis. Its
|
|
262
|
+
* SVG geometry is already correctly aligned, so no rotation is applied.
|
|
263
|
+
*/
|
|
264
|
+
"Primary Lateral Incisor": "translate(-6 0)",
|
|
265
|
+
/**
|
|
266
|
+
* Moves the canine only on the x-axis to keep a compact two-unit clearance
|
|
267
|
+
* from the lateral incisor, so the lower arch stays an exact vertical
|
|
268
|
+
* reflection of the upper curve.
|
|
269
|
+
*/
|
|
270
|
+
"Primary Canine": "translate(209 20) scale(-1 1)",
|
|
271
|
+
/**
|
|
272
|
+
* Keeps 54/84 20 units left and 64/74 20 units right in screen space;
|
|
273
|
+
* horizontal quadrant reflection reverses the local x-axis for 64 and 74.
|
|
274
|
+
*/
|
|
275
|
+
"Primary First Molar": "translate(-20 -4)",
|
|
276
|
+
"Primary Second Molar": "translate(0 6)"
|
|
277
|
+
}, At = {
|
|
278
|
+
viewBox: "0 0 409 461",
|
|
279
|
+
quadrants: [
|
|
280
|
+
{ quadrant: 5, transform: "" },
|
|
281
|
+
{ quadrant: 6, transform: "scale(-1, 1) translate(-409, 0)" },
|
|
282
|
+
{ quadrant: 8, transform: fe(409, 461) },
|
|
283
|
+
{ quadrant: 7, transform: fe(409, 461, !0) }
|
|
284
|
+
],
|
|
285
|
+
toothTransforms: Mn
|
|
286
|
+
}, xt = (t) => Math.round(t * 1e3) / 1e3, Cn = 447.5, kn = 260, $n = 1.1, me = 16.9, ge = 66.9, Sn = 53.7, Pn = 95.8, In = 150, ye = 80, Tn = 40;
|
|
287
|
+
function Bn() {
|
|
288
|
+
const t = $n, e = xt(Cn - kn * t), n = Sn + ye, a = xt(n - me * t), o = a + ge * t, s = xt(o + Tn + ge * t), r = s - me * t, i = xt(r + ye - Pn), l = Math.ceil(In + i), u = (h) => `translate(${e}, ${h}) scale(${t})`, d = Mt.horizontal.quadrants.map(({ quadrant: h, transform: c }) => ({
|
|
289
|
+
quadrant: h,
|
|
290
|
+
transform: h === 3 || h === 4 ? `translate(0, ${i}) ${c}`.trim() : c
|
|
291
|
+
}));
|
|
292
|
+
return {
|
|
293
|
+
viewBox: `0 0 900 ${l}`,
|
|
294
|
+
permanent: d,
|
|
295
|
+
primary: [
|
|
296
|
+
{ quadrant: 5, transform: u(a) },
|
|
297
|
+
{ quadrant: 6, transform: `${u(a)} translate(520, 0) scale(-1, 1)` },
|
|
298
|
+
{ quadrant: 8, transform: `${u(s)} scale(1, -1)` },
|
|
299
|
+
{ quadrant: 7, transform: `${u(s)} translate(520, 0) scale(-1, -1)` }
|
|
300
|
+
]
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
const _n = 409, Fn = 694, Ln = 461, zn = 0.58, Nn = 140, Dn = 4.8;
|
|
304
|
+
function Zn() {
|
|
305
|
+
const t = zn, e = xt(_n / 2 * (1 - t)), n = xt(Nn - Dn * t), a = xt(Fn - n - Ln * t), o = (s) => `translate(${e}, ${s}) scale(${t})`;
|
|
306
|
+
return {
|
|
307
|
+
viewBox: Mt.arch.viewBox,
|
|
308
|
+
permanent: Mt.arch.quadrants,
|
|
309
|
+
primary: At.quadrants.map(({ quadrant: s, transform: r }) => ({
|
|
310
|
+
quadrant: s,
|
|
311
|
+
transform: `${o(s === 5 || s === 6 ? n : a)} ${r}`.trim()
|
|
312
|
+
}))
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
const En = {
|
|
316
|
+
arch: Zn(),
|
|
317
|
+
horizontal: Bn()
|
|
318
|
+
}, qn = {
|
|
319
|
+
permanent: {
|
|
320
|
+
upper: { right: 1, left: 2 },
|
|
321
|
+
lower: { right: 4, left: 3 }
|
|
322
|
+
},
|
|
323
|
+
primary: {
|
|
324
|
+
upper: { right: 5, left: 6 },
|
|
325
|
+
lower: { right: 8, left: 7 }
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
function Ws(t, e, n) {
|
|
329
|
+
return qn[t][e][n];
|
|
330
|
+
}
|
|
331
|
+
function Hn(t, e) {
|
|
332
|
+
const n = t === "permanent" ? 1 : 5;
|
|
333
|
+
return Number.isInteger(e) && e >= n && e <= n + 3;
|
|
334
|
+
}
|
|
335
|
+
const Le = {
|
|
336
|
+
permanent: 8,
|
|
337
|
+
primary: 5
|
|
338
|
+
};
|
|
339
|
+
function Rn(t, e, n, a = "FDI") {
|
|
340
|
+
if (!Hn(t, e))
|
|
341
|
+
throw new RangeError(`Quadrant ${e} is not valid for ${t} dentition.`);
|
|
342
|
+
const o = Le[t];
|
|
343
|
+
if (!Number.isInteger(n) || n < 1 || n > o)
|
|
344
|
+
throw new RangeError(
|
|
345
|
+
`Position ${n} is not valid for ${t} dentition; expected 1–${o}.`
|
|
346
|
+
);
|
|
347
|
+
if (a !== "FDI")
|
|
348
|
+
throw new Error(`Tooth IDs are always FDI; format ${a} numbers with formatToothNumber.`);
|
|
349
|
+
return `${e}${n}`;
|
|
350
|
+
}
|
|
351
|
+
const An = ["upper-right", "upper-left", "lower-left", "lower-right"], On = {
|
|
352
|
+
"upper-right": (t) => `${t}┘`,
|
|
353
|
+
"upper-left": (t) => `└${t}`,
|
|
354
|
+
"lower-left": (t) => `┌${t}`,
|
|
355
|
+
"lower-right": (t) => `${t}┐`
|
|
356
|
+
}, Vn = {
|
|
357
|
+
"upper-right": "UR",
|
|
358
|
+
"upper-left": "UL",
|
|
359
|
+
"lower-left": "LL",
|
|
360
|
+
"lower-right": "LR"
|
|
361
|
+
};
|
|
362
|
+
function te(t) {
|
|
363
|
+
const e = /^([1-8])([1-8])$/.exec(t), n = Number(e == null ? void 0 : e[1]), a = Number(e == null ? void 0 : e[2]), o = n > 4;
|
|
364
|
+
if (!e || a > Le[o ? "primary" : "permanent"])
|
|
365
|
+
throw new RangeError(`"${t}" is not a valid FDI tooth ID.`);
|
|
366
|
+
return { quadrant: n, position: a, primary: o };
|
|
367
|
+
}
|
|
368
|
+
const jn = [
|
|
369
|
+
"Central Incisor",
|
|
370
|
+
"Lateral Incisor",
|
|
371
|
+
"Canine",
|
|
372
|
+
"First Premolar",
|
|
373
|
+
"Second Premolar",
|
|
374
|
+
"First Molar",
|
|
375
|
+
"Second Molar",
|
|
376
|
+
"Third Molar"
|
|
377
|
+
], Qn = [
|
|
378
|
+
"Primary Central Incisor",
|
|
379
|
+
"Primary Lateral Incisor",
|
|
380
|
+
"Primary Canine",
|
|
381
|
+
"Primary First Molar",
|
|
382
|
+
"Primary Second Molar"
|
|
383
|
+
];
|
|
384
|
+
function Wn(t) {
|
|
385
|
+
const { position: e, primary: n } = te(t);
|
|
386
|
+
return (n ? Qn : jn)[e - 1];
|
|
387
|
+
}
|
|
388
|
+
function ze(t) {
|
|
389
|
+
const { quadrant: e } = te(t);
|
|
390
|
+
return An[(e - 1) % 4];
|
|
391
|
+
}
|
|
392
|
+
function ft(t, e, n = "symbol") {
|
|
393
|
+
if (e === "FDI")
|
|
394
|
+
return t;
|
|
395
|
+
const { quadrant: a, position: o, primary: s } = te(t);
|
|
396
|
+
if (e === "Universal") {
|
|
397
|
+
const l = s ? 5 : 8, u = (a - 1) % 4, d = u === 0 || u === 2, h = u * l + (d ? l - o : o - 1);
|
|
398
|
+
return s ? String.fromCharCode(65 + h) : String(h + 1);
|
|
399
|
+
}
|
|
400
|
+
const r = s ? String.fromCharCode(64 + o) : String(o), i = ze(t);
|
|
401
|
+
return n === "symbol" ? On[i](r) : `${Vn[i]}${r}`;
|
|
402
|
+
}
|
|
403
|
+
const ee = {
|
|
404
|
+
viewBox: "0 0 520 180",
|
|
405
|
+
quadrants: [
|
|
406
|
+
{ quadrant: 5, transform: "translate(0, 105)" },
|
|
407
|
+
{ quadrant: 6, transform: "translate(520, 105) scale(-1, 1)" },
|
|
408
|
+
{ quadrant: 8, transform: "translate(0, 75) scale(1, -1)" },
|
|
409
|
+
{ quadrant: 7, transform: "translate(520, 75) scale(-1, -1)" }
|
|
410
|
+
]
|
|
411
|
+
};
|
|
412
|
+
ee.quadrants.map(({ quadrant: t }) => t);
|
|
413
|
+
const Yt = {
|
|
414
|
+
arch: { dentition: "permanent", quadrants: Mt.arch.quadrants, shapes: xn },
|
|
415
|
+
horizontal: {
|
|
416
|
+
dentition: "permanent",
|
|
417
|
+
quadrants: Mt.horizontal.quadrants,
|
|
418
|
+
shapes: pn
|
|
419
|
+
}
|
|
420
|
+
}, Jt = {
|
|
421
|
+
arch: {
|
|
422
|
+
dentition: "primary",
|
|
423
|
+
quadrants: At.quadrants,
|
|
424
|
+
shapes: bn,
|
|
425
|
+
toothTransforms: At.toothTransforms
|
|
426
|
+
},
|
|
427
|
+
horizontal: {
|
|
428
|
+
dentition: "primary",
|
|
429
|
+
quadrants: ee.quadrants,
|
|
430
|
+
shapes: wn
|
|
431
|
+
}
|
|
432
|
+
};
|
|
433
|
+
function ve(t) {
|
|
434
|
+
const { viewBox: e, permanent: n, primary: a } = En[t];
|
|
435
|
+
return {
|
|
436
|
+
viewBox: e,
|
|
437
|
+
parts: [
|
|
438
|
+
{ ...Yt[t], quadrants: n },
|
|
439
|
+
{ ...Jt[t], quadrants: a }
|
|
440
|
+
]
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
const Xn = {
|
|
444
|
+
permanent: {
|
|
445
|
+
arch: { viewBox: Mt.arch.viewBox, parts: [Yt.arch] },
|
|
446
|
+
horizontal: { viewBox: Mt.horizontal.viewBox, parts: [Yt.horizontal] }
|
|
447
|
+
},
|
|
448
|
+
primary: {
|
|
449
|
+
arch: { viewBox: At.viewBox, parts: [Jt.arch] },
|
|
450
|
+
horizontal: { viewBox: ee.viewBox, parts: [Jt.horizontal] }
|
|
451
|
+
},
|
|
452
|
+
mixed: {
|
|
453
|
+
arch: ve("arch"),
|
|
454
|
+
horizontal: ve("horizontal")
|
|
455
|
+
}
|
|
456
|
+
};
|
|
457
|
+
function Ne(t, e) {
|
|
458
|
+
return Xn[t][e];
|
|
459
|
+
}
|
|
460
|
+
function ne(t, e) {
|
|
461
|
+
return Ne(t, e).parts.flatMap(
|
|
462
|
+
(n) => n.quadrants.map(({ quadrant: a, transform: o }) => ({
|
|
463
|
+
quadrant: a,
|
|
464
|
+
transform: o,
|
|
465
|
+
teeth: n.shapes.map((s) => {
|
|
466
|
+
var r;
|
|
467
|
+
return {
|
|
468
|
+
tooth: {
|
|
469
|
+
id: Rn(n.dentition, a, s.position),
|
|
470
|
+
position: s.position,
|
|
471
|
+
quadrant: a,
|
|
472
|
+
dentition: n.dentition,
|
|
473
|
+
type: s.type,
|
|
474
|
+
shape: s
|
|
475
|
+
},
|
|
476
|
+
transform: (r = n.toothTransforms) == null ? void 0 : r[s.type]
|
|
477
|
+
};
|
|
478
|
+
})
|
|
479
|
+
}))
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
function Kn(t, e) {
|
|
483
|
+
return ne(t, e).flatMap(({ teeth: n }) => n.map(({ tooth: a }) => a.id));
|
|
484
|
+
}
|
|
485
|
+
const Un = [1, 0, 0, 1, 0, 0];
|
|
486
|
+
function _t(t, e) {
|
|
487
|
+
const [n, a, o, s, r, i] = t, [l, u, d, h, c, m] = e;
|
|
488
|
+
return [
|
|
489
|
+
n * l + o * u,
|
|
490
|
+
a * l + s * u,
|
|
491
|
+
n * d + o * h,
|
|
492
|
+
a * d + s * h,
|
|
493
|
+
n * c + o * m + r,
|
|
494
|
+
a * c + s * m + i
|
|
495
|
+
];
|
|
496
|
+
}
|
|
497
|
+
function Gn([t, e, n, a, o, s], { x: r, y: i }) {
|
|
498
|
+
return { x: t * r + n * i + o, y: e * r + a * i + s };
|
|
499
|
+
}
|
|
500
|
+
const Yn = /(matrix|translate|scale|rotate|skewX|skewY)\s*\(([^)]*)\)/g;
|
|
501
|
+
function Gt(t) {
|
|
502
|
+
let e = Un;
|
|
503
|
+
for (const [, n, a] of (t ?? "").matchAll(Yn)) {
|
|
504
|
+
const o = a.trim().split(/[\s,]+/).filter(Boolean).map(Number);
|
|
505
|
+
e = _t(e, Jn(n, o));
|
|
506
|
+
}
|
|
507
|
+
return e;
|
|
508
|
+
}
|
|
509
|
+
function Jn(t, e) {
|
|
510
|
+
switch (t) {
|
|
511
|
+
case "matrix":
|
|
512
|
+
return [e[0], e[1], e[2], e[3], e[4], e[5]];
|
|
513
|
+
case "translate":
|
|
514
|
+
return [1, 0, 0, 1, e[0] ?? 0, e[1] ?? 0];
|
|
515
|
+
case "scale":
|
|
516
|
+
return [e[0], 0, 0, e[1] ?? e[0], 0, 0];
|
|
517
|
+
case "rotate": {
|
|
518
|
+
const n = (e[0] ?? 0) * Math.PI / 180, a = Math.cos(n), o = Math.sin(n), s = e[1] ?? 0, r = e[2] ?? 0, i = [a, o, -o, a, 0, 0];
|
|
519
|
+
return _t(
|
|
520
|
+
_t([1, 0, 0, 1, s, r], i),
|
|
521
|
+
[1, 0, 0, 1, -s, -r]
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
case "skewX":
|
|
525
|
+
return [1, 0, Math.tan((e[0] ?? 0) * Math.PI / 180), 1, 0, 0];
|
|
526
|
+
default:
|
|
527
|
+
return [1, Math.tan((e[0] ?? 0) * Math.PI / 180), 0, 1, 0, 0];
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function Lt(t) {
|
|
531
|
+
if (!t.length)
|
|
532
|
+
return { x: 0, y: 0, width: 0, height: 0 };
|
|
533
|
+
let e = 1 / 0, n = 1 / 0, a = -1 / 0, o = -1 / 0;
|
|
534
|
+
for (const { x: s, y: r } of t)
|
|
535
|
+
e = Math.min(e, s), n = Math.min(n, r), a = Math.max(a, s), o = Math.max(o, r);
|
|
536
|
+
return { x: e, y: n, width: a - e, height: o - n };
|
|
537
|
+
}
|
|
538
|
+
function to(t, e) {
|
|
539
|
+
return Lt(
|
|
540
|
+
[
|
|
541
|
+
{ x: e.x, y: e.y },
|
|
542
|
+
{ x: e.x + e.width, y: e.y },
|
|
543
|
+
{ x: e.x, y: e.y + e.height },
|
|
544
|
+
{ x: e.x + e.width, y: e.y + e.height }
|
|
545
|
+
].map((n) => Gn(t, n))
|
|
546
|
+
);
|
|
547
|
+
}
|
|
548
|
+
function De(t) {
|
|
549
|
+
return Lt(eo(t));
|
|
550
|
+
}
|
|
551
|
+
function eo(t) {
|
|
552
|
+
const e = new oo(t), n = [];
|
|
553
|
+
let a = { x: 0, y: 0 }, o = a, s, r = "", i = "";
|
|
554
|
+
for (; e.hasMore(); ) {
|
|
555
|
+
const l = e.readCommand();
|
|
556
|
+
if (l)
|
|
557
|
+
i = l;
|
|
558
|
+
else if (!i)
|
|
559
|
+
throw new SyntaxError(`Invalid SVG path: ${t}`);
|
|
560
|
+
const u = i === i.toLowerCase(), d = u ? a : { x: 0, y: 0 }, h = () => ({
|
|
561
|
+
x: d.x + e.readNumber(),
|
|
562
|
+
y: d.y + e.readNumber()
|
|
563
|
+
});
|
|
564
|
+
let c;
|
|
565
|
+
switch (i.toUpperCase()) {
|
|
566
|
+
case "M":
|
|
567
|
+
a = h(), o = a, n.push(a), i = u ? "l" : "L";
|
|
568
|
+
break;
|
|
569
|
+
case "L":
|
|
570
|
+
a = h(), n.push(a);
|
|
571
|
+
break;
|
|
572
|
+
case "H":
|
|
573
|
+
a = { x: (u ? a.x : 0) + e.readNumber(), y: a.y }, n.push(a);
|
|
574
|
+
break;
|
|
575
|
+
case "V":
|
|
576
|
+
a = { x: a.x, y: (u ? a.y : 0) + e.readNumber() }, n.push(a);
|
|
577
|
+
break;
|
|
578
|
+
case "C": {
|
|
579
|
+
const m = h();
|
|
580
|
+
c = h();
|
|
581
|
+
const p = h();
|
|
582
|
+
n.push(...be(a, m, c, p)), a = p;
|
|
583
|
+
break;
|
|
584
|
+
}
|
|
585
|
+
case "S": {
|
|
586
|
+
const m = pe(a, s, r, "CS");
|
|
587
|
+
c = h();
|
|
588
|
+
const p = h();
|
|
589
|
+
n.push(...be(a, m, c, p)), a = p;
|
|
590
|
+
break;
|
|
591
|
+
}
|
|
592
|
+
case "Q": {
|
|
593
|
+
c = h();
|
|
594
|
+
const m = h();
|
|
595
|
+
n.push(...Me(a, c, m)), a = m;
|
|
596
|
+
break;
|
|
597
|
+
}
|
|
598
|
+
case "T": {
|
|
599
|
+
c = pe(a, s, r, "QT");
|
|
600
|
+
const m = h();
|
|
601
|
+
n.push(...Me(a, c, m)), a = m;
|
|
602
|
+
break;
|
|
603
|
+
}
|
|
604
|
+
case "A": {
|
|
605
|
+
const m = Math.abs(e.readNumber()), p = Math.abs(e.readNumber()), b = e.readNumber(), C = e.readFlag(), M = e.readFlag(), w = h();
|
|
606
|
+
n.push(...no(a, m, p, b, C, M, w)), a = w;
|
|
607
|
+
break;
|
|
608
|
+
}
|
|
609
|
+
case "Z":
|
|
610
|
+
a = o;
|
|
611
|
+
break;
|
|
612
|
+
default:
|
|
613
|
+
throw new SyntaxError(`Unsupported SVG path command "${i}".`);
|
|
614
|
+
}
|
|
615
|
+
s = c, r = i.toUpperCase(), r === "Z" && (i = "");
|
|
616
|
+
}
|
|
617
|
+
return n;
|
|
618
|
+
}
|
|
619
|
+
function pe(t, e, n, a) {
|
|
620
|
+
return !e || !a.includes(n) ? t : { x: 2 * t.x - e.x, y: 2 * t.y - e.y };
|
|
621
|
+
}
|
|
622
|
+
function xe(t, e, n, a, o) {
|
|
623
|
+
const s = 1 - o;
|
|
624
|
+
return s * s * s * t + 3 * s * s * o * e + 3 * s * o * o * n + o * o * o * a;
|
|
625
|
+
}
|
|
626
|
+
function we(t, e, n, a) {
|
|
627
|
+
const o = -t + 3 * e - 3 * n + a, s = 2 * (t - 2 * e + n), r = e - t, i = 1e-12;
|
|
628
|
+
if (Math.abs(o) < i)
|
|
629
|
+
return Math.abs(s) < i ? [] : [-r / s];
|
|
630
|
+
const l = s * s - 4 * o * r;
|
|
631
|
+
if (l < 0)
|
|
632
|
+
return [];
|
|
633
|
+
const u = Math.sqrt(l);
|
|
634
|
+
return [(-s + u) / (2 * o), (-s - u) / (2 * o)];
|
|
635
|
+
}
|
|
636
|
+
function be(t, e, n, a) {
|
|
637
|
+
return [
|
|
638
|
+
...[
|
|
639
|
+
...we(t.x, e.x, n.x, a.x),
|
|
640
|
+
...we(t.y, e.y, n.y, a.y)
|
|
641
|
+
].filter((s) => s > 0 && s < 1).map((s) => ({
|
|
642
|
+
x: xe(t.x, e.x, n.x, a.x, s),
|
|
643
|
+
y: xe(t.y, e.y, n.y, a.y, s)
|
|
644
|
+
})),
|
|
645
|
+
a
|
|
646
|
+
];
|
|
647
|
+
}
|
|
648
|
+
function Me(t, e, n) {
|
|
649
|
+
const a = [];
|
|
650
|
+
for (const o of ["x", "y"]) {
|
|
651
|
+
const s = t[o] - 2 * e[o] + n[o];
|
|
652
|
+
if (s === 0)
|
|
653
|
+
continue;
|
|
654
|
+
const r = (t[o] - e[o]) / s;
|
|
655
|
+
if (r > 0 && r < 1) {
|
|
656
|
+
const i = 1 - r;
|
|
657
|
+
a.push({
|
|
658
|
+
x: i * i * t.x + 2 * i * r * e.x + r * r * n.x,
|
|
659
|
+
y: i * i * t.y + 2 * i * r * e.y + r * r * n.y
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
return [...a, n];
|
|
664
|
+
}
|
|
665
|
+
function no(t, e, n, a, o, s, r) {
|
|
666
|
+
if (e === 0 || n === 0 || t.x === r.x && t.y === r.y)
|
|
667
|
+
return [r];
|
|
668
|
+
const i = a * Math.PI / 180, l = Math.cos(i), u = Math.sin(i), d = (t.x - r.x) / 2, h = (t.y - r.y) / 2, c = l * d + u * h, m = -u * d + l * h, p = c * c / (e * e) + m * m / (n * n);
|
|
669
|
+
if (p > 1) {
|
|
670
|
+
const j = Math.sqrt(p);
|
|
671
|
+
e *= j, n *= j;
|
|
672
|
+
}
|
|
673
|
+
const b = e * e * n * n - e * e * m * m - n * n * c * c, C = e * e * m * m + n * n * c * c, w = (o === s ? -1 : 1) * Math.sqrt(Math.max(0, b / C)), k = w * e * m / n, v = -w * n * c / e, f = l * k - u * v + (t.x + r.x) / 2, I = u * k + l * v + (t.y + r.y) / 2, E = (j, J) => Math.atan2(J, j), F = E((c - k) / e, (m - v) / n);
|
|
674
|
+
let L = E((-c - k) / e, (-m - v) / n) - F;
|
|
675
|
+
s && L < 0 ? L += 2 * Math.PI : !s && L > 0 && (L -= 2 * Math.PI);
|
|
676
|
+
const _ = (j) => ({
|
|
677
|
+
x: f + e * l * Math.cos(j) - n * u * Math.sin(j),
|
|
678
|
+
y: I + e * u * Math.cos(j) + n * l * Math.sin(j)
|
|
679
|
+
}), N = Math.atan2(-n * u, e * l), D = Math.atan2(n * l, e * u), Q = [];
|
|
680
|
+
for (const j of [N, N + Math.PI, D, D + Math.PI]) {
|
|
681
|
+
const J = 2 * Math.PI;
|
|
682
|
+
(s ? ((j - F) % J + J) % J : ((F - j) % J + J) % J) < Math.abs(L) && Q.push(_(j));
|
|
683
|
+
}
|
|
684
|
+
return [...Q, r];
|
|
685
|
+
}
|
|
686
|
+
class oo {
|
|
687
|
+
constructor(e) {
|
|
688
|
+
ce(this, "index", 0);
|
|
689
|
+
this.source = e;
|
|
690
|
+
}
|
|
691
|
+
hasMore() {
|
|
692
|
+
return this.skipSeparators(), this.index < this.source.length;
|
|
693
|
+
}
|
|
694
|
+
readCommand() {
|
|
695
|
+
this.skipSeparators();
|
|
696
|
+
const e = this.source[this.index];
|
|
697
|
+
if (e && /[MmLlHhVvCcSsQqTtAaZz]/.test(e))
|
|
698
|
+
return this.index += 1, e;
|
|
699
|
+
}
|
|
700
|
+
readNumber() {
|
|
701
|
+
this.skipSeparators();
|
|
702
|
+
const e = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/.exec(
|
|
703
|
+
this.source.slice(this.index)
|
|
704
|
+
);
|
|
705
|
+
if (!e)
|
|
706
|
+
throw new SyntaxError(`Expected a number at ${this.index} in SVG path.`);
|
|
707
|
+
return this.index += e[0].length, Number(e[0]);
|
|
708
|
+
}
|
|
709
|
+
/** Arc flags are a single 0/1 character and may touch the next number. */
|
|
710
|
+
readFlag() {
|
|
711
|
+
this.skipSeparators();
|
|
712
|
+
const e = this.source[this.index];
|
|
713
|
+
if (e !== "0" && e !== "1")
|
|
714
|
+
throw new SyntaxError(`Expected an arc flag at ${this.index} in SVG path.`);
|
|
715
|
+
return this.index += 1, e === "1";
|
|
716
|
+
}
|
|
717
|
+
skipSeparators() {
|
|
718
|
+
for (; this.index < this.source.length && /[\s,]/.test(this.source[this.index]); )
|
|
719
|
+
this.index += 1;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
const ao = /* @__PURE__ */ new Set([1, 2, 5, 6]), Ce = /* @__PURE__ */ new Map(), ke = /* @__PURE__ */ new Map();
|
|
723
|
+
function so(t) {
|
|
724
|
+
let e = Ce.get(t);
|
|
725
|
+
return e || (e = De(t), Ce.set(t, e)), e;
|
|
726
|
+
}
|
|
727
|
+
function ro(t) {
|
|
728
|
+
const [e = 0, n = 0, a = 0, o = 0] = t.trim().split(/[\s,]+/).map(Number);
|
|
729
|
+
return { x: e, y: n, width: a, height: o };
|
|
730
|
+
}
|
|
731
|
+
function io(t, e) {
|
|
732
|
+
const n = `${t}:${e}`, a = ke.get(n);
|
|
733
|
+
if (a)
|
|
734
|
+
return a;
|
|
735
|
+
const o = ne(t, e).flatMap(({ quadrant: s, transform: r, teeth: i }) => {
|
|
736
|
+
const l = Gt(r);
|
|
737
|
+
return i.map(({ tooth: u, transform: d }) => {
|
|
738
|
+
const h = _t(
|
|
739
|
+
_t(l, Gt(u.shape.transform)),
|
|
740
|
+
Gt(d)
|
|
741
|
+
), c = to(h, so(u.shape.outlinePath)), m = ao.has(s) ? "upper" : "lower", p = u.dentition;
|
|
742
|
+
return {
|
|
743
|
+
toothId: u.id,
|
|
744
|
+
quadrant: s,
|
|
745
|
+
arch: m,
|
|
746
|
+
dentition: p,
|
|
747
|
+
row: `${m}-${p}`,
|
|
748
|
+
box: c,
|
|
749
|
+
center: { x: c.x + c.width / 2, y: c.y + c.height / 2 }
|
|
750
|
+
};
|
|
751
|
+
});
|
|
752
|
+
});
|
|
753
|
+
return ke.set(n, o), o;
|
|
754
|
+
}
|
|
755
|
+
function co(t, e) {
|
|
756
|
+
return ro(Ne(t, e).viewBox);
|
|
757
|
+
}
|
|
758
|
+
const lo = 0.24, $e = /* @__PURE__ */ new Set([1, 4, 5, 8]);
|
|
759
|
+
function $t({ x: t, y: e }) {
|
|
760
|
+
const n = Math.hypot(t, e) || 1;
|
|
761
|
+
return { x: t / n, y: e / n };
|
|
762
|
+
}
|
|
763
|
+
function Ft(t, e, n) {
|
|
764
|
+
const a = n.x ? t / 2 / Math.abs(n.x) : 1 / 0, o = n.y ? e / 2 / Math.abs(n.y) : 1 / 0;
|
|
765
|
+
return Math.min(a, o);
|
|
766
|
+
}
|
|
767
|
+
function Ze(t) {
|
|
768
|
+
return Math.hypot(t.width, t.height) / 2 * 0.82;
|
|
769
|
+
}
|
|
770
|
+
function Ee(t) {
|
|
771
|
+
return Math.max(1, t * 0.06);
|
|
772
|
+
}
|
|
773
|
+
function uo(t) {
|
|
774
|
+
const e = [...t].sort((a, o) => a - o), n = Math.floor(e.length / 2);
|
|
775
|
+
return e.length % 2 ? e[n] : (e[n - 1] + e[n]) / 2;
|
|
776
|
+
}
|
|
777
|
+
function qe(t, e, n) {
|
|
778
|
+
const a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = t.length ? Math.round(lo * uo(t.map(({ box: i }) => i.width)) * 10) / 10 : 0, r = { x: e.x + e.width / 2, y: e.y + e.height / 2 };
|
|
779
|
+
for (const i of new Set(t.map(({ row: l }) => l))) {
|
|
780
|
+
const l = (d) => {
|
|
781
|
+
const h = Number(d.toothId.slice(1));
|
|
782
|
+
return $e.has(d.quadrant) ? -h : h;
|
|
783
|
+
}, u = t.filter((d) => d.row === i).sort((d, h) => l(d) - l(h));
|
|
784
|
+
o.set(
|
|
785
|
+
i,
|
|
786
|
+
u.map(({ toothId: d }) => d)
|
|
787
|
+
), u.forEach((d, h) => {
|
|
788
|
+
const { center: c, box: m } = d, p = { x: r.x - c.x, y: r.y - c.y }, b = { x: 0, y: Math.sign(p.y) || 1 }, C = u[h - 1] ?? d, M = u[h + 1] ?? d, w = u.length > 1 ? $t({ x: M.center.x - C.center.x, y: M.center.y - C.center.y }) : { x: 1, y: 0 };
|
|
789
|
+
let k;
|
|
790
|
+
n === "horizontal" ? k = b : u.length > 1 ? (k = { x: -w.y, y: w.x }, k.x * p.x + k.y * p.y < 0 && (k = { x: -k.x, y: -k.y })) : k = $t(p);
|
|
791
|
+
const v = $e.has(d.quadrant) ? w : { x: -w.x, y: -w.y };
|
|
792
|
+
a.set(d.toothId, {
|
|
793
|
+
toothId: d.toothId,
|
|
794
|
+
arch: d.arch,
|
|
795
|
+
row: i,
|
|
796
|
+
box: m,
|
|
797
|
+
center: c,
|
|
798
|
+
size: Math.min(m.width, m.height),
|
|
799
|
+
inner: k,
|
|
800
|
+
outer: { x: -k.x, y: -k.y },
|
|
801
|
+
occlusal: b,
|
|
802
|
+
mesial: v
|
|
803
|
+
});
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
return { frames: a, order: o, fontSize: s, gap: s * 0.3 };
|
|
807
|
+
}
|
|
808
|
+
const ho = 0.62, He = 0.2, Et = (t) => Math.round(t * 100) / 100;
|
|
809
|
+
function Re(t, e, n, a, o) {
|
|
810
|
+
const s = o === "Palmer", r = s ? ft(t, o, "text").slice(2) : ft(t, o), i = s ? a * He : 0, l = a * ho * r.length + 2 * i, u = a + 2 * i, d = { x: e - l / 2, y: n - u / 2, width: l, height: u };
|
|
811
|
+
return {
|
|
812
|
+
toothId: t,
|
|
813
|
+
text: r,
|
|
814
|
+
x: e,
|
|
815
|
+
y: n,
|
|
816
|
+
fontSize: a,
|
|
817
|
+
...s ? { corner: fo(ze(t), d) } : {},
|
|
818
|
+
box: d
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
function fo(t, { x: e, y: n, width: a, height: o }) {
|
|
822
|
+
const s = t.startsWith("upper"), r = t.endsWith("right"), i = Et(s ? n + o : n), l = Et(s ? n : n + o), u = Et(r ? e + a : e);
|
|
823
|
+
return `M${Et(r ? e : e + a)} ${i} L${u} ${i} L${u} ${l}`;
|
|
824
|
+
}
|
|
825
|
+
function mo(t, e, n, a = "FDI") {
|
|
826
|
+
if (!t.length)
|
|
827
|
+
return [];
|
|
828
|
+
const { frames: o, fontSize: s, gap: r } = qe(t, e, n), i = { x: e.x + e.width / 2, y: e.y + e.height / 2 };
|
|
829
|
+
if (n === "horizontal")
|
|
830
|
+
return go(t, i, s, r, a);
|
|
831
|
+
const l = [];
|
|
832
|
+
for (const { toothId: u, box: d, center: h } of t) {
|
|
833
|
+
const c = o.get(u).inner, m = (k) => Re(u, h.x + c.x * k, h.y + c.y * k, s, a), { width: p, height: b } = m(0).box, C = Ft(d.width, d.height, c) + r + Ft(p, b, c), M = C + s * 4;
|
|
834
|
+
let w = m(C);
|
|
835
|
+
for (let k = C; k <= M && (w = m(k), !!(t.some((f) => Se(f.box, w.box)) || l.some((f) => Se(f.box, w.box)))); k += r)
|
|
836
|
+
;
|
|
837
|
+
l.push(w);
|
|
838
|
+
}
|
|
839
|
+
return l;
|
|
840
|
+
}
|
|
841
|
+
function go(t, e, n, a, o) {
|
|
842
|
+
const s = /* @__PURE__ */ new Map();
|
|
843
|
+
for (const r of new Set(t.map(({ row: i }) => i))) {
|
|
844
|
+
const i = t.filter((c) => c.row === r), l = i.reduce((c, { center: m }) => c + m.y, 0) / i.length, u = e.y >= l, d = u ? Math.max(...i.map(({ box: c }) => c.y + c.height)) : Math.min(...i.map(({ box: c }) => c.y)), h = n / 2 + (o === "Palmer" ? n * He : 0);
|
|
845
|
+
s.set(r, d + (u ? 1 : -1) * (a + h));
|
|
846
|
+
}
|
|
847
|
+
return t.map(
|
|
848
|
+
({ toothId: r, row: i, center: l }) => Re(r, l.x, s.get(i), n, o)
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
function Se(t, e) {
|
|
852
|
+
return t.x < e.x + e.width && e.x < t.x + t.width && t.y < e.y + e.height && e.y < t.y + t.height;
|
|
853
|
+
}
|
|
854
|
+
const St = {
|
|
855
|
+
// Surfaces.
|
|
856
|
+
caries: { name: "Lesión de caries dental", symbol: { kind: "fill" }, tone: "bad" },
|
|
857
|
+
restoration: { name: "Restauración definitiva", symbol: { kind: "fill" }, tone: "good" },
|
|
858
|
+
"temporary-restoration": {
|
|
859
|
+
name: "Restauración temporal",
|
|
860
|
+
symbol: { kind: "outline" },
|
|
861
|
+
tone: "bad"
|
|
862
|
+
},
|
|
863
|
+
// Whole-tooth symbols.
|
|
864
|
+
extraction: { name: "Extracción", symbol: { kind: "cross" }, tone: "bad" },
|
|
865
|
+
fracture: { name: "Fractura", symbol: { kind: "line" }, tone: "bad" },
|
|
866
|
+
crown: { name: "Corona definitiva", symbol: { kind: "circle" }, tone: "good" },
|
|
867
|
+
"temporary-crown": { name: "Corona temporal", symbol: { kind: "circle" }, tone: "bad" },
|
|
868
|
+
extruded: {
|
|
869
|
+
name: "Diente extruido",
|
|
870
|
+
symbol: { kind: "arrow", direction: "occlusal" },
|
|
871
|
+
tone: "good"
|
|
872
|
+
},
|
|
873
|
+
intruded: {
|
|
874
|
+
name: "Diente intruido",
|
|
875
|
+
symbol: { kind: "arrow", direction: "apical" },
|
|
876
|
+
tone: "good"
|
|
877
|
+
},
|
|
878
|
+
rotated: { name: "Giroversión", symbol: { kind: "curved-arrow" }, tone: "good" },
|
|
879
|
+
migrated: { name: "Migración", symbol: { kind: "arrow", direction: "auto" }, tone: "good" },
|
|
880
|
+
erupting: { name: "Pieza dentaria en erupción", symbol: { kind: "zigzag" }, tone: "good" },
|
|
881
|
+
supernumerary: {
|
|
882
|
+
name: "Supernumerario",
|
|
883
|
+
symbol: { kind: "encircled-text", text: "S" },
|
|
884
|
+
tone: "good"
|
|
885
|
+
},
|
|
886
|
+
fusion: { name: "Fusión", symbol: { kind: "double-circle" }, tone: "good" },
|
|
887
|
+
peg: { name: "Diente en clavija", symbol: { kind: "triangle" }, tone: "good" },
|
|
888
|
+
// Abbreviations.
|
|
889
|
+
implant: { name: "Implante dental", symbol: { kind: "text", text: "IMP" }, tone: "good" },
|
|
890
|
+
"root-remnant": {
|
|
891
|
+
name: "Remanente radicular",
|
|
892
|
+
symbol: { kind: "text", text: "RR" },
|
|
893
|
+
tone: "bad"
|
|
894
|
+
},
|
|
895
|
+
mobility: { name: "Movilidad", symbol: { kind: "text", text: "M1" }, tone: "bad" },
|
|
896
|
+
discolored: { name: "Diente discrómico", symbol: { kind: "text", text: "DIS" }, tone: "bad" },
|
|
897
|
+
ectopic: { name: "Diente ectópico", symbol: { kind: "text", text: "E" }, tone: "bad" },
|
|
898
|
+
impacted: { name: "Impactación", symbol: { kind: "text", text: "I" }, tone: "bad" },
|
|
899
|
+
"semi-impacted": {
|
|
900
|
+
name: "Semi-impactación",
|
|
901
|
+
symbol: { kind: "text", text: "SI" },
|
|
902
|
+
tone: "bad"
|
|
903
|
+
},
|
|
904
|
+
macrodontia: { name: "Macrodoncia", symbol: { kind: "text", text: "MAC" }, tone: "good" },
|
|
905
|
+
microdontia: { name: "Microdoncia", symbol: { kind: "text", text: "MIC" }, tone: "good" },
|
|
906
|
+
worn: { name: "Superficie desgastada", symbol: { kind: "text", text: "DES" }, tone: "bad" },
|
|
907
|
+
"pulp-treatment": {
|
|
908
|
+
name: "Tratamiento pulpar",
|
|
909
|
+
symbol: { kind: "text", text: "TC" },
|
|
910
|
+
tone: "good"
|
|
911
|
+
},
|
|
912
|
+
"enamel-defect": {
|
|
913
|
+
name: "Defecto de desarrollo del esmalte",
|
|
914
|
+
symbol: { kind: "text", text: "HP" },
|
|
915
|
+
tone: "bad"
|
|
916
|
+
},
|
|
917
|
+
// Between two teeth.
|
|
918
|
+
diastema: { name: "Diastema", symbol: { kind: "diastema" }, tone: "good" },
|
|
919
|
+
transposition: { name: "Transposición", symbol: { kind: "transposition" }, tone: "good" },
|
|
920
|
+
// Across several teeth.
|
|
921
|
+
"fixed-prosthesis": { name: "Prótesis fija", symbol: { kind: "bridge" }, tone: "good" },
|
|
922
|
+
"removable-prosthesis": {
|
|
923
|
+
name: "Prótesis removible",
|
|
924
|
+
symbol: { kind: "double-line" },
|
|
925
|
+
tone: "good"
|
|
926
|
+
},
|
|
927
|
+
"complete-prosthesis": {
|
|
928
|
+
name: "Prótesis total",
|
|
929
|
+
symbol: { kind: "double-line" },
|
|
930
|
+
tone: "good"
|
|
931
|
+
},
|
|
932
|
+
"fixed-orthodontic-appliance": {
|
|
933
|
+
name: "Aparato ortodóntico fijo",
|
|
934
|
+
symbol: { kind: "brackets" },
|
|
935
|
+
tone: "good"
|
|
936
|
+
},
|
|
937
|
+
"removable-orthodontic-appliance": {
|
|
938
|
+
name: "Aparato ortodóntico removible",
|
|
939
|
+
symbol: { kind: "zigzag-line" },
|
|
940
|
+
tone: "good"
|
|
941
|
+
},
|
|
942
|
+
edentulous: { name: "Edéntulo total", symbol: { kind: "center-line" }, tone: "good" }
|
|
943
|
+
}, G = [
|
|
944
|
+
"vestibular",
|
|
945
|
+
"mesial",
|
|
946
|
+
"occlusal",
|
|
947
|
+
"distal",
|
|
948
|
+
"lingual"
|
|
949
|
+
], Xs = ["square", "circle"], yo = 2.4, vo = 0.4, po = 0.45, qt = 12, Pe = 3, Ae = /* @__PURE__ */ new Set([1, 2, 5, 6]), Ot = (t) => Math.round(t * 100) / 100;
|
|
950
|
+
function xo(t, { x: e, y: n }) {
|
|
951
|
+
return Math.hypot(t.width / 2 * e, t.height / 2 * n);
|
|
952
|
+
}
|
|
953
|
+
function wt(t, e) {
|
|
954
|
+
return t === "occlusal" && Number(e.slice(1)) <= 3 ? "incisal" : t === "lingual" && Ae.has(Number(e[0])) ? "palatal" : t;
|
|
955
|
+
}
|
|
956
|
+
function Oe(t) {
|
|
957
|
+
return `${t.map(({ x: e, y: n }, a) => `${a ? "L" : "M"}${Ot(e)} ${Ot(n)}`).join(" ")} Z`;
|
|
958
|
+
}
|
|
959
|
+
function wo(t, e, n, a) {
|
|
960
|
+
const o = ({ x: r, y: i }) => r * e.x + i * e.y, s = (r, i) => r.flatMap((l, u) => {
|
|
961
|
+
const d = r[(u + 1) % r.length], h = i(l), c = i(d), m = h >= 0 ? [l] : [];
|
|
962
|
+
if (h >= 0 != c >= 0) {
|
|
963
|
+
const p = h / (h - c);
|
|
964
|
+
m.push({ x: l.x + (d.x - l.x) * p, y: l.y + (d.y - l.y) * p });
|
|
965
|
+
}
|
|
966
|
+
return m;
|
|
967
|
+
});
|
|
968
|
+
return s(s(t, (r) => o(r) - n), (r) => a - o(r));
|
|
969
|
+
}
|
|
970
|
+
function bo(t, e, n, a) {
|
|
971
|
+
if (a <= 1)
|
|
972
|
+
return e.points;
|
|
973
|
+
const o = e.surface === "mesial" || e.surface === "distal" ? t.axes.vestibular : t.axes.mesial, s = e.points.map(({ x: l, y: u }) => l * o.x + u * o.y), r = Math.min(...s), i = (Math.max(...s) - r) / a;
|
|
974
|
+
return wo(e.points, o, r + i * n, r + i * (n + 1));
|
|
975
|
+
}
|
|
976
|
+
function Mo(t, e, n = "square") {
|
|
977
|
+
return n === "circle" ? $o(t, t * po) : ko(t, e);
|
|
978
|
+
}
|
|
979
|
+
const Co = 0.22, Ie = 4;
|
|
980
|
+
function ko(t, e) {
|
|
981
|
+
const n = (s, r, i, l) => {
|
|
982
|
+
const u = s * Co, d = (m) => m * Math.PI / 180, h = (s - u) * Math.sign(Math.round(Math.cos(d(r)) * 1e9)), c = (s - u) * Math.sign(Math.round(Math.sin(d(r)) * 1e9));
|
|
983
|
+
return Array.from({ length: Ie + 1 }, (m, p) => {
|
|
984
|
+
const b = d(i + (l - i) * p / Ie);
|
|
985
|
+
return [h + u * Math.cos(b), c + u * Math.sin(b)];
|
|
986
|
+
});
|
|
987
|
+
}, a = (s, r) => [
|
|
988
|
+
...n(s, r - 45, r - 45, r),
|
|
989
|
+
...n(s, r + 45, r, r + 45)
|
|
990
|
+
], o = (s) => [...a(t, s), ...a(e, s).reverse()];
|
|
991
|
+
return {
|
|
992
|
+
vestibular: o(0),
|
|
993
|
+
mesial: o(90),
|
|
994
|
+
lingual: o(180),
|
|
995
|
+
distal: o(270),
|
|
996
|
+
occlusal: [0, 90, 180, 270].flatMap((s) => a(e, s).slice(1))
|
|
997
|
+
};
|
|
998
|
+
}
|
|
999
|
+
function $o(t, e) {
|
|
1000
|
+
const n = (s, r) => {
|
|
1001
|
+
const i = r * Math.PI / 180;
|
|
1002
|
+
return [s * Math.cos(i), s * Math.sin(i)];
|
|
1003
|
+
}, a = (s, r, i) => Array.from({ length: qt + 1 }, (l, u) => n(s, r + (i - r) * u / qt)), o = (s) => [...a(t, s - 45, s + 45), ...a(e, s + 45, s - 45)];
|
|
1004
|
+
return {
|
|
1005
|
+
vestibular: o(0),
|
|
1006
|
+
mesial: o(90),
|
|
1007
|
+
lingual: o(180),
|
|
1008
|
+
distal: o(270),
|
|
1009
|
+
occlusal: Array.from({ length: qt * 4 }, (s, r) => n(e, 360 * r / (qt * 4)))
|
|
1010
|
+
};
|
|
1011
|
+
}
|
|
1012
|
+
function Ve(t, e, n, a, o = Math.max(0.5, Ot(a * 0.05)), s = "square") {
|
|
1013
|
+
const { vestibular: r, mesial: i } = n, l = Mo(a / 2, a / 2 * vo, s), u = ([m, p]) => ({
|
|
1014
|
+
x: e.x + r.x * m + i.x * p,
|
|
1015
|
+
y: e.y + r.y * m + i.y * p
|
|
1016
|
+
}), d = G.map((m) => {
|
|
1017
|
+
const p = l[m].map(u);
|
|
1018
|
+
return { surface: m, name: wt(m, t), d: Oe(p), points: p };
|
|
1019
|
+
}), h = Lt(d.flatMap(({ points: m }) => m)), c = o / 2;
|
|
1020
|
+
return {
|
|
1021
|
+
toothId: t,
|
|
1022
|
+
center: e,
|
|
1023
|
+
size: a,
|
|
1024
|
+
axes: n,
|
|
1025
|
+
strokeWidth: o,
|
|
1026
|
+
surfaces: d,
|
|
1027
|
+
box: {
|
|
1028
|
+
x: h.x - c,
|
|
1029
|
+
y: h.y - c,
|
|
1030
|
+
width: h.width + o,
|
|
1031
|
+
height: h.height + o
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
const So = /* @__PURE__ */ new Set([1, 4, 5, 8]);
|
|
1036
|
+
function Po(t) {
|
|
1037
|
+
const e = Number(t[0]);
|
|
1038
|
+
return {
|
|
1039
|
+
vestibular: { x: 0, y: Ae.has(e) ? -1 : 1 },
|
|
1040
|
+
mesial: { x: So.has(e) ? 1 : -1, y: 0 }
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
function je({ points: t }) {
|
|
1044
|
+
return {
|
|
1045
|
+
x: t.reduce((e, { x: n }) => e + n, 0) / t.length,
|
|
1046
|
+
y: t.reduce((e, { y: n }) => e + n, 0) / t.length
|
|
1047
|
+
};
|
|
1048
|
+
}
|
|
1049
|
+
const Io = 0.12;
|
|
1050
|
+
function To(t, e) {
|
|
1051
|
+
return t.map(
|
|
1052
|
+
(n, a) => Math.max(...t.map((o, s) => o - e * Math.abs(a - s)))
|
|
1053
|
+
);
|
|
1054
|
+
}
|
|
1055
|
+
function Bo(t, e, n) {
|
|
1056
|
+
const a = (o) => {
|
|
1057
|
+
const { center: s, outer: r } = t[o];
|
|
1058
|
+
return { x: s.x + r.x * e[o], y: s.y + r.y * e[o] };
|
|
1059
|
+
};
|
|
1060
|
+
return e.map((o, s) => {
|
|
1061
|
+
if (s < 2 || s > t.length - 3 || e.slice(s - 2, s + 3).some((b, C) => C !== 2 && b >= o))
|
|
1062
|
+
return o;
|
|
1063
|
+
const [i, l, u, d] = [a(s - 2), a(s - 1), a(s + 1), a(s + 2)], h = { x: (-i.x + 9 * l.x + 9 * u.x - d.x) / 16, y: (-i.y + 9 * l.y + 9 * u.y - d.y) / 16 }, { center: c, outer: m } = t[s], p = (h.x - c.x) * m.x + (h.y - c.y) * m.y;
|
|
1064
|
+
return p < o ? Math.max(p, n[s]) : o;
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1067
|
+
function _o(t) {
|
|
1068
|
+
return t.slice(1, -1).map((e, n) => {
|
|
1069
|
+
const [a, o] = [t[n], t[n + 2]], s = Math.atan2(o.y - e.y, o.x - e.x) - Math.atan2(e.y - a.y, e.x - a.x);
|
|
1070
|
+
return Math.atan2(Math.sin(s), Math.cos(s)) * 180 / Math.PI;
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
const Te = 120;
|
|
1074
|
+
function Fo(t, e, n, a) {
|
|
1075
|
+
const o = [...e], s = (r, i = o[r]) => {
|
|
1076
|
+
const { center: l, outer: u } = t[r];
|
|
1077
|
+
return { x: l.x + u.x * i, y: l.y + u.y * i };
|
|
1078
|
+
};
|
|
1079
|
+
return t.forEach((r, i) => {
|
|
1080
|
+
if (!(r.row.endsWith("primary") && r.toothId[1] === "3") || i < 1 || i > t.length - 2)
|
|
1081
|
+
return;
|
|
1082
|
+
const u = Math.max(0, i - 3), d = Math.min(t.length - 1, i + 3), h = (C) => {
|
|
1083
|
+
const M = t.slice(u, d + 1).map(
|
|
1084
|
+
(k, v) => u + v === i ? s(i, C) : s(u + v)
|
|
1085
|
+
), w = _o(M);
|
|
1086
|
+
return w.slice(1).reduce((k, v, f) => k + (v - w[f]) ** 2, 0);
|
|
1087
|
+
}, c = n[i], m = e[i] + a;
|
|
1088
|
+
let p = e[i], b = h(p);
|
|
1089
|
+
for (let C = 0; C <= Te; C++) {
|
|
1090
|
+
const M = c + (m - c) * C / Te, w = h(M);
|
|
1091
|
+
w < b && (p = M, b = w);
|
|
1092
|
+
}
|
|
1093
|
+
o[i] = p;
|
|
1094
|
+
}), o;
|
|
1095
|
+
}
|
|
1096
|
+
function Lo({ frames: t, order: e, fontSize: n, gap: a }, o = {}) {
|
|
1097
|
+
const s = Ot(n * yo), r = s / 2, i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
1098
|
+
for (const c of t.values()) {
|
|
1099
|
+
const m = xo(c.box, c.outer), p = Math.max(m, Ze(c.box) + Ee(c.size) / 2);
|
|
1100
|
+
i.set(c.toothId, p + a + Pe + r), l.set(c.toothId, m + a + r);
|
|
1101
|
+
}
|
|
1102
|
+
const u = /* @__PURE__ */ new Map();
|
|
1103
|
+
for (const c of e.values()) {
|
|
1104
|
+
const m = c.map((w) => t.get(w)), p = c.map((w) => i.get(w)), b = o.fairCurve ? Bo(m, p, c.map((w) => l.get(w))) : p;
|
|
1105
|
+
if (o.alignRows) {
|
|
1106
|
+
const w = (v, f) => (v.center.x + v.outer.x * f) * v.outer.x + (v.center.y + v.outer.y * f) * v.outer.y, k = Math.max(...m.map((v, f) => w(v, p[f])));
|
|
1107
|
+
m.forEach((v) => u.set(v.toothId, k - w(v, 0)));
|
|
1108
|
+
continue;
|
|
1109
|
+
}
|
|
1110
|
+
const C = To(b, s * Io), M = o.fairCurve ? Fo(m, C, c.map((w) => l.get(w)), s) : C;
|
|
1111
|
+
c.forEach((w, k) => u.set(w, M[k]));
|
|
1112
|
+
}
|
|
1113
|
+
const d = [];
|
|
1114
|
+
let h = 0;
|
|
1115
|
+
for (const c of t.values()) {
|
|
1116
|
+
const m = c.outer;
|
|
1117
|
+
let p = { x: -m.y, y: m.x };
|
|
1118
|
+
p.x * c.mesial.x + p.y * c.mesial.y < 0 && (p = { x: -p.x, y: -p.y });
|
|
1119
|
+
const b = u.get(c.toothId) ?? i.get(c.toothId), C = {
|
|
1120
|
+
x: c.center.x + m.x * b,
|
|
1121
|
+
y: c.center.y + m.y * b
|
|
1122
|
+
};
|
|
1123
|
+
d.push(Ve(c.toothId, C, { vestibular: m, mesial: p }, s, void 0, o.shape));
|
|
1124
|
+
const M = b + r - Ft(c.box.width, c.box.height, m);
|
|
1125
|
+
h = Math.max(h, M + Pe);
|
|
1126
|
+
}
|
|
1127
|
+
return { diagrams: d, reserved: h };
|
|
1128
|
+
}
|
|
1129
|
+
function zo(t, e, n) {
|
|
1130
|
+
const a = new Set((t == null ? void 0 : t[e]) ?? []);
|
|
1131
|
+
a.has(n) ? a.delete(n) : a.add(n);
|
|
1132
|
+
const o = { ...t };
|
|
1133
|
+
return a.size ? o[e] = G.filter((s) => a.has(s)) : delete o[e], o;
|
|
1134
|
+
}
|
|
1135
|
+
const No = /* @__PURE__ */ new Set(["fill", "outline"]), Do = /* @__PURE__ */ new Set(["diastema", "transposition"]), Zo = /* @__PURE__ */ new Set([
|
|
1136
|
+
"bridge",
|
|
1137
|
+
"double-line",
|
|
1138
|
+
"brackets",
|
|
1139
|
+
"zigzag-line",
|
|
1140
|
+
"center-line"
|
|
1141
|
+
]), Qe = /* @__PURE__ */ new Set(["text", "encircled-text"]), Eo = 0.62;
|
|
1142
|
+
function Ct(t) {
|
|
1143
|
+
return No.has(t.kind) ? "surface" : Do.has(t.kind) ? "between" : Zo.has(t.kind) ? "span" : "tooth";
|
|
1144
|
+
}
|
|
1145
|
+
const W = (t, e, n = 1) => ({ x: t.x + e.x * n, y: t.y + e.y * n }), oe = ({ x: t, y: e }) => ({ x: -e, y: t }), Be = ({ x: t, y: e }, n) => {
|
|
1146
|
+
const a = n * Math.PI / 180, o = Math.cos(a), s = Math.sin(a);
|
|
1147
|
+
return { x: t * o - e * s, y: t * s + e * o };
|
|
1148
|
+
}, bt = (t) => Math.round(t * 100) / 100, ut = ({ x: t, y: e }) => `${bt(t)} ${bt(e)}`, st = (t) => t.map((e, n) => `${n ? "L" : "M"}${ut(e)}`).join(" ");
|
|
1149
|
+
function Vt(t, e, n) {
|
|
1150
|
+
const a = { x: -e.x, y: -e.y };
|
|
1151
|
+
return st([W(t, Be(a, 28), n), t, W(t, Be(a, -28), n)]);
|
|
1152
|
+
}
|
|
1153
|
+
function qo(t, e, n) {
|
|
1154
|
+
const a = $t({ x: e.x - t.x, y: e.y - t.y });
|
|
1155
|
+
return [
|
|
1156
|
+
{ type: "path", d: st([t, e]) },
|
|
1157
|
+
{ type: "path", d: Vt(e, a, n) }
|
|
1158
|
+
];
|
|
1159
|
+
}
|
|
1160
|
+
function We(t, e, n, a) {
|
|
1161
|
+
const o = { x: (e.x - t.x) / n, y: (e.y - t.y) / n }, s = oe($t(o));
|
|
1162
|
+
return Array.from({ length: n + 1 }, (r, i) => {
|
|
1163
|
+
const l = W(t, o, i);
|
|
1164
|
+
return i === 0 || i === n ? l : W(l, s, i % 2 ? a : -a);
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
function Ho(t, e, n) {
|
|
1168
|
+
const a = e === "auto" ? n ?? "mesial" : e;
|
|
1169
|
+
return {
|
|
1170
|
+
occlusal: t.occlusal,
|
|
1171
|
+
apical: { x: -t.occlusal.x, y: -t.occlusal.y },
|
|
1172
|
+
mesial: t.mesial,
|
|
1173
|
+
distal: { x: -t.mesial.x, y: -t.mesial.y }
|
|
1174
|
+
}[a];
|
|
1175
|
+
}
|
|
1176
|
+
function Xe(t, e, n) {
|
|
1177
|
+
const { box: a, center: o, size: s, occlusal: r, mesial: i } = e, l = s * 0.7, u = s * 0.18;
|
|
1178
|
+
switch (t.kind) {
|
|
1179
|
+
case "line":
|
|
1180
|
+
return [
|
|
1181
|
+
{
|
|
1182
|
+
type: "path",
|
|
1183
|
+
d: st([
|
|
1184
|
+
{ x: a.x + a.width * 0.2, y: a.y + a.height * 0.8 },
|
|
1185
|
+
{ x: a.x + a.width * 0.8, y: a.y + a.height * 0.2 }
|
|
1186
|
+
])
|
|
1187
|
+
}
|
|
1188
|
+
];
|
|
1189
|
+
case "cross": {
|
|
1190
|
+
const d = s * 0.12, [h, c] = [a.x + d, a.x + a.width - d], [m, p] = [a.y + d, a.y + a.height - d];
|
|
1191
|
+
return [
|
|
1192
|
+
{ type: "path", d: st([{ x: h, y: m }, { x: c, y: p }]) },
|
|
1193
|
+
{ type: "path", d: st([{ x: c, y: m }, { x: h, y: p }]) }
|
|
1194
|
+
];
|
|
1195
|
+
}
|
|
1196
|
+
case "circle":
|
|
1197
|
+
return [
|
|
1198
|
+
{ type: "circle", cx: o.x, cy: o.y, r: Ze(a) }
|
|
1199
|
+
];
|
|
1200
|
+
case "double-circle": {
|
|
1201
|
+
const d = s * 0.36;
|
|
1202
|
+
return [-1, 1].map((h) => {
|
|
1203
|
+
const c = W(o, i, h * s * 0.2);
|
|
1204
|
+
return { type: "circle", cx: c.x, cy: c.y, r: d };
|
|
1205
|
+
});
|
|
1206
|
+
}
|
|
1207
|
+
case "triangle": {
|
|
1208
|
+
const d = s * 0.38, h = oe(r), c = W(o, r, d), m = W(o, r, -d * 0.5);
|
|
1209
|
+
return [
|
|
1210
|
+
{ type: "path", d: `${st([c, W(m, h, d * 0.87), W(m, h, -d * 0.87)])} Z` }
|
|
1211
|
+
];
|
|
1212
|
+
}
|
|
1213
|
+
case "arrow": {
|
|
1214
|
+
const d = Ho(e, t.direction, n.direction);
|
|
1215
|
+
return qo(W(o, d, -l / 2), W(o, d, l / 2), u);
|
|
1216
|
+
}
|
|
1217
|
+
case "curved-arrow": {
|
|
1218
|
+
const d = s * 0.3, h = 160 * Math.PI / 180, c = 380 * Math.PI / 180, m = { x: o.x + d * Math.cos(h), y: o.y + d * Math.sin(h) }, p = { x: o.x + d * Math.cos(c), y: o.y + d * Math.sin(c) }, b = { x: -Math.sin(c), y: Math.cos(c) };
|
|
1219
|
+
return [
|
|
1220
|
+
{ type: "path", d: `M${ut(m)} A${bt(d)} ${bt(d)} 0 1 1 ${ut(p)}` },
|
|
1221
|
+
{ type: "path", d: Vt(p, b, u) }
|
|
1222
|
+
];
|
|
1223
|
+
}
|
|
1224
|
+
case "zigzag": {
|
|
1225
|
+
const d = W(o, r, -l / 2), h = W(o, r, l / 2);
|
|
1226
|
+
return [
|
|
1227
|
+
{ type: "path", d: st(We(d, h, 5, s * 0.1)) },
|
|
1228
|
+
{ type: "path", d: Vt(h, r, u) }
|
|
1229
|
+
];
|
|
1230
|
+
}
|
|
1231
|
+
default:
|
|
1232
|
+
return [];
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
function Ke(t, e) {
|
|
1236
|
+
return { width: Math.max(1, t.length) * e * Eo, height: e };
|
|
1237
|
+
}
|
|
1238
|
+
function Ue(t, e, n, a) {
|
|
1239
|
+
const o = [{ type: "text", x: e.x, y: e.y, text: t, fontSize: n }];
|
|
1240
|
+
return a && o.unshift({ type: "circle", cx: e.x, cy: e.y, r: n * 0.72 }), o;
|
|
1241
|
+
}
|
|
1242
|
+
function Ge(t, e, n) {
|
|
1243
|
+
const a = Math.min(e.size, n.size), o = { x: (e.center.x + n.center.x) / 2, y: (e.center.y + n.center.y) / 2 }, s = $t({ x: n.center.x - e.center.x, y: n.center.y - e.center.y }), r = oe(s), i = a * 0.12, l = a * 0.35;
|
|
1244
|
+
if (t.kind === "diastema")
|
|
1245
|
+
return [-1, 1].map((d) => {
|
|
1246
|
+
const h = W(o, s, d * i * 1.6), c = W(o, s, d * i * 0.2);
|
|
1247
|
+
return {
|
|
1248
|
+
type: "path",
|
|
1249
|
+
d: `M${ut(W(h, r, l))} Q${ut(c)} ${ut(W(h, r, -l))}`
|
|
1250
|
+
};
|
|
1251
|
+
});
|
|
1252
|
+
const u = a * 0.16;
|
|
1253
|
+
return [1, -1].flatMap((d) => {
|
|
1254
|
+
const [h, c] = d > 0 ? [e.center, n.center] : [n.center, e.center], m = W(o, r, d * l * 1.4), p = $t({ x: c.x - m.x, y: c.y - m.y });
|
|
1255
|
+
return [
|
|
1256
|
+
{ type: "path", d: `M${ut(h)} Q${ut(m)} ${ut(c)}` },
|
|
1257
|
+
{ type: "path", d: Vt(c, p, u) }
|
|
1258
|
+
];
|
|
1259
|
+
});
|
|
1260
|
+
}
|
|
1261
|
+
function Ye(t, e) {
|
|
1262
|
+
return W(t.center, t.outer, Ft(t.box.width, t.box.height, t.outer) + e);
|
|
1263
|
+
}
|
|
1264
|
+
function Je(t, e, n, a = 0) {
|
|
1265
|
+
const o = Math.min(...e.map(({ size: r }) => r));
|
|
1266
|
+
if (t.kind === "center-line")
|
|
1267
|
+
return [{ type: "path", d: st(e.map(({ center: r }) => r)) }];
|
|
1268
|
+
const s = e.map((r) => Ye(r, a + n));
|
|
1269
|
+
switch (t.kind) {
|
|
1270
|
+
case "bridge": {
|
|
1271
|
+
const r = [e[0], e[e.length - 1]].map((i, l) => {
|
|
1272
|
+
const u = s[l ? s.length - 1 : 0];
|
|
1273
|
+
return { type: "path", d: st([u, W(u, i.outer, -n * 1.5)]) };
|
|
1274
|
+
});
|
|
1275
|
+
return [{ type: "path", d: st(s) }, ...r];
|
|
1276
|
+
}
|
|
1277
|
+
case "double-line":
|
|
1278
|
+
return [0.4, -0.4].map((r) => ({
|
|
1279
|
+
type: "path",
|
|
1280
|
+
d: st(e.map((i, l) => W(s[l], i.outer, n * r)))
|
|
1281
|
+
}));
|
|
1282
|
+
case "brackets": {
|
|
1283
|
+
const r = o * 0.09;
|
|
1284
|
+
return [
|
|
1285
|
+
{ type: "path", d: st(s) },
|
|
1286
|
+
...s.map((i) => ({
|
|
1287
|
+
type: "path",
|
|
1288
|
+
d: `M${ut({ x: i.x - r, y: i.y - r })} h${bt(r * 2)} v${bt(r * 2)} h${bt(-r * 2)} Z`
|
|
1289
|
+
}))
|
|
1290
|
+
];
|
|
1291
|
+
}
|
|
1292
|
+
case "zigzag-line": {
|
|
1293
|
+
const r = s.flatMap(
|
|
1294
|
+
(i, l) => l ? We(s[l - 1], i, 4, n * 0.6).slice(1) : [i]
|
|
1295
|
+
);
|
|
1296
|
+
return [{ type: "path", d: st(r) }];
|
|
1297
|
+
}
|
|
1298
|
+
default:
|
|
1299
|
+
return [];
|
|
1300
|
+
}
|
|
1301
|
+
}
|
|
1302
|
+
function Ro(t, e, n, a) {
|
|
1303
|
+
return t.kind !== "fill" ? e.surfaces.filter(({ surface: o }) => n.includes(o)).map(({ d: o }) => ({ type: "path", d: o })) : e.surfaces.filter(({ surface: o }) => n.includes(o)).map((o) => {
|
|
1304
|
+
const { index: s, count: r } = a(o.surface);
|
|
1305
|
+
return { type: "area", d: r > 1 ? Oe(bo(e, o, s, r)) : o.d };
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
function _e(t) {
|
|
1309
|
+
var e;
|
|
1310
|
+
return (e = t.surfaces) != null && e.length ? G.filter((n) => t.surfaces.includes(n)) : [...G];
|
|
1311
|
+
}
|
|
1312
|
+
function Ao(t, e) {
|
|
1313
|
+
return t.tone ? t.tone : t.status === "planned" ? "bad" : t.status === "done" ? "good" : e.tone;
|
|
1314
|
+
}
|
|
1315
|
+
function Oo(t, e) {
|
|
1316
|
+
const n = t.flatMap((s) => {
|
|
1317
|
+
if (s.type === "circle") {
|
|
1318
|
+
const { cx: d, cy: h, r: c } = s;
|
|
1319
|
+
return [
|
|
1320
|
+
{ x: d - c, y: h - c },
|
|
1321
|
+
{ x: d + c, y: h + c }
|
|
1322
|
+
];
|
|
1323
|
+
}
|
|
1324
|
+
if (s.type === "text") {
|
|
1325
|
+
const { width: d, height: h } = Ke(s.text, s.fontSize);
|
|
1326
|
+
return [
|
|
1327
|
+
{ x: s.x - d / 2, y: s.y - h / 2 },
|
|
1328
|
+
{ x: s.x + d / 2, y: s.y + h / 2 }
|
|
1329
|
+
];
|
|
1330
|
+
}
|
|
1331
|
+
const { x: r, y: i, width: l, height: u } = De(s.d);
|
|
1332
|
+
return [
|
|
1333
|
+
{ x: r, y: i },
|
|
1334
|
+
{ x: r + l, y: i + u }
|
|
1335
|
+
];
|
|
1336
|
+
}), a = Lt(n), o = e / 2;
|
|
1337
|
+
return { x: a.x - o, y: a.y - o, width: a.width + e, height: a.height + e };
|
|
1338
|
+
}
|
|
1339
|
+
function tn(t, e, { frames: n, order: a, fontSize: o, gap: s }, r) {
|
|
1340
|
+
const i = (r == null ? void 0 : r.reserved) ?? 0, l = new Map(r == null ? void 0 : r.diagrams.map((f) => [f.toothId, f])), u = [], d = [], h = o * 0.9, c = /* @__PURE__ */ new Map(), m = (f, I, E, F, L, _, N = Ee(_)) => ({
|
|
1341
|
+
key: f,
|
|
1342
|
+
code: I.code,
|
|
1343
|
+
name: E.name,
|
|
1344
|
+
status: I.status ?? "existing",
|
|
1345
|
+
tone: Ao(I, E),
|
|
1346
|
+
...I.color ? { color: I.color } : {},
|
|
1347
|
+
teeth: F,
|
|
1348
|
+
strokeWidth: N,
|
|
1349
|
+
primitives: L,
|
|
1350
|
+
box: Oo(L, N)
|
|
1351
|
+
}), p = /* @__PURE__ */ new Map();
|
|
1352
|
+
t.forEach((f, I) => {
|
|
1353
|
+
var E;
|
|
1354
|
+
if (((E = e[f.code]) == null ? void 0 : E.symbol.kind) === "fill")
|
|
1355
|
+
for (const F of f.teeth)
|
|
1356
|
+
for (const L of _e(f)) {
|
|
1357
|
+
const _ = `${F}:${L}`;
|
|
1358
|
+
p.set(_, [...p.get(_) ?? [], I]);
|
|
1359
|
+
}
|
|
1360
|
+
});
|
|
1361
|
+
const b = (f, I) => (E) => {
|
|
1362
|
+
const F = p.get(`${I}:${E}`) ?? [f];
|
|
1363
|
+
return { index: F.indexOf(f), count: F.length };
|
|
1364
|
+
}, C = t.map((f, I) => ({ finding: f, index: I })), M = ({ finding: f }) => {
|
|
1365
|
+
const I = e[f.code];
|
|
1366
|
+
return I ? Ct(I.symbol) : "tooth";
|
|
1367
|
+
}, w = [
|
|
1368
|
+
...C.filter((f) => M(f) === "span"),
|
|
1369
|
+
...C.filter((f) => M(f) !== "span")
|
|
1370
|
+
];
|
|
1371
|
+
for (const { finding: f, index: I } of w) {
|
|
1372
|
+
const E = e[f.code];
|
|
1373
|
+
if (!E) {
|
|
1374
|
+
d.push(`Unknown finding code "${f.code}".`);
|
|
1375
|
+
continue;
|
|
1376
|
+
}
|
|
1377
|
+
const { symbol: F } = E, L = f.teeth.filter((A) => n.has(A)), _ = Ct(F);
|
|
1378
|
+
if (_ === "surface") {
|
|
1379
|
+
if (!L.length)
|
|
1380
|
+
continue;
|
|
1381
|
+
if (!l.size) {
|
|
1382
|
+
d.push(`Finding "${f.code}" is drawn on tooth surfaces and needs showSurfaces.`);
|
|
1383
|
+
continue;
|
|
1384
|
+
}
|
|
1385
|
+
const A = _e(f);
|
|
1386
|
+
for (const nt of L) {
|
|
1387
|
+
const it = l.get(nt), ct = it.strokeWidth * (F.kind === "outline" ? 2.5 : 1);
|
|
1388
|
+
u.push({
|
|
1389
|
+
...m(
|
|
1390
|
+
`${I}:${nt}`,
|
|
1391
|
+
f,
|
|
1392
|
+
E,
|
|
1393
|
+
[nt],
|
|
1394
|
+
Ro(F, it, A, b(I, nt)),
|
|
1395
|
+
it.size,
|
|
1396
|
+
ct
|
|
1397
|
+
),
|
|
1398
|
+
surfaces: A
|
|
1399
|
+
});
|
|
1400
|
+
}
|
|
1401
|
+
continue;
|
|
1402
|
+
}
|
|
1403
|
+
if (_ === "tooth") {
|
|
1404
|
+
for (const A of L) {
|
|
1405
|
+
const nt = n.get(A);
|
|
1406
|
+
let it;
|
|
1407
|
+
if (Qe.has(F.kind)) {
|
|
1408
|
+
const ct = f.label ?? F.text, zt = F.kind === "encircled-text", { width: Qt, height: Wt } = zt ? { width: h * 1.44, height: h * 1.44 } : Ke(ct, h), U = c.get(A) ?? i, Pt = Ft(Qt, Wt, nt.outer), Y = U + s + Pt;
|
|
1409
|
+
it = Ue(ct, Ye(nt, Y), h, zt), c.set(A, Y + Pt);
|
|
1410
|
+
} else
|
|
1411
|
+
it = Xe(F, nt, f);
|
|
1412
|
+
u.push(m(`${I}:${A}`, f, E, [A], it, nt.size));
|
|
1413
|
+
}
|
|
1414
|
+
continue;
|
|
1415
|
+
}
|
|
1416
|
+
if (L.length !== f.teeth.length)
|
|
1417
|
+
continue;
|
|
1418
|
+
const N = new Set(L.map((A) => n.get(A).row));
|
|
1419
|
+
if (!(_ === "between" ? L.length === 2 : L.length >= 2) || N.size !== 1) {
|
|
1420
|
+
d.push(
|
|
1421
|
+
`Finding "${f.code}" needs ${_ === "between" ? "two teeth" : "at least two teeth"} of the same arch and dentition.`
|
|
1422
|
+
);
|
|
1423
|
+
continue;
|
|
1424
|
+
}
|
|
1425
|
+
if (_ === "between") {
|
|
1426
|
+
const [A, nt] = L.map((it) => n.get(it));
|
|
1427
|
+
u.push(
|
|
1428
|
+
m(`${I}`, f, E, L, Ge(F, A, nt), Math.min(A.size, nt.size))
|
|
1429
|
+
);
|
|
1430
|
+
continue;
|
|
1431
|
+
}
|
|
1432
|
+
const Q = a.get([...N][0]), j = L.map((A) => Q.indexOf(A)), J = Q.slice(Math.min(...j), Math.max(...j) + 1), gt = J.map((A) => n.get(A));
|
|
1433
|
+
u.push(
|
|
1434
|
+
m(
|
|
1435
|
+
`${I}`,
|
|
1436
|
+
f,
|
|
1437
|
+
E,
|
|
1438
|
+
J,
|
|
1439
|
+
Je(F, gt, s, i),
|
|
1440
|
+
Math.min(...gt.map(({ size: A }) => A))
|
|
1441
|
+
)
|
|
1442
|
+
);
|
|
1443
|
+
for (const A of J)
|
|
1444
|
+
c.set(A, Math.max(c.get(A) ?? i, i + s * 1.6));
|
|
1445
|
+
}
|
|
1446
|
+
const k = ({ code: f }) => {
|
|
1447
|
+
var I;
|
|
1448
|
+
return ((I = e[f]) == null ? void 0 : I.symbol.kind) === "outline" ? 1 : 0;
|
|
1449
|
+
}, v = (f) => Number(f.split(":")[0]);
|
|
1450
|
+
return u.sort((f, I) => k(f) - k(I) || v(f.key) - v(I.key)), { findings: u, issues: d };
|
|
1451
|
+
}
|
|
1452
|
+
function Vo(t, e, n) {
|
|
1453
|
+
const { toothId: a, box: o, center: s, size: r } = n, i = t.filter(({ code: d, teeth: h }) => {
|
|
1454
|
+
const c = e[d];
|
|
1455
|
+
return h.includes(a) && c && Ct(c.symbol) === "surface";
|
|
1456
|
+
}).map((d) => ({ ...d, teeth: [a] })), l = { ...Tt(a, o), center: s, size: r };
|
|
1457
|
+
return tn(i, e, { frames: /* @__PURE__ */ new Map([[a, l]]), order: /* @__PURE__ */ new Map(), fontSize: 0, gap: 0 }, { diagrams: [n], reserved: 0 }).findings;
|
|
1458
|
+
}
|
|
1459
|
+
function Tt(t, e) {
|
|
1460
|
+
return {
|
|
1461
|
+
toothId: t,
|
|
1462
|
+
arch: "upper",
|
|
1463
|
+
row: "upper-permanent",
|
|
1464
|
+
box: e,
|
|
1465
|
+
center: { x: e.x + e.width / 2, y: e.y + e.height / 2 },
|
|
1466
|
+
size: Math.min(e.width, e.height),
|
|
1467
|
+
inner: { x: 0, y: 1 },
|
|
1468
|
+
outer: { x: 0, y: -1 },
|
|
1469
|
+
occlusal: { x: 0, y: 1 },
|
|
1470
|
+
mesial: { x: 1, y: 0 }
|
|
1471
|
+
};
|
|
1472
|
+
}
|
|
1473
|
+
function jo(t) {
|
|
1474
|
+
const e = Ct(t);
|
|
1475
|
+
if (e === "surface") {
|
|
1476
|
+
const n = (o, s) => `M${o} ${o} h${s} v${s} h${-s} Z`, a = n(5.5, 5);
|
|
1477
|
+
return [
|
|
1478
|
+
{ type: "path", d: n(1.5, 13) },
|
|
1479
|
+
t.kind === "fill" ? { type: "area", d: a } : { type: "path", d: a }
|
|
1480
|
+
];
|
|
1481
|
+
}
|
|
1482
|
+
if (e === "between")
|
|
1483
|
+
return Ge(t, Tt("a", { x: -2, y: 2, width: 10, height: 12 }), Tt("b", { x: 8, y: 2, width: 10, height: 12 }));
|
|
1484
|
+
if (e === "span") {
|
|
1485
|
+
const n = [1, 6.5, 12].map((a, o) => Tt(`${o}`, { x: a, y: 9, width: 3, height: 5 }));
|
|
1486
|
+
return Je(t, n, 1.5);
|
|
1487
|
+
}
|
|
1488
|
+
if (Qe.has(t.kind)) {
|
|
1489
|
+
const { text: n } = t, a = n.length > 2 ? 5.5 : 8;
|
|
1490
|
+
return Ue(n, { x: 8, y: 8 }, t.kind === "encircled-text" ? 7 : a, t.kind === "encircled-text");
|
|
1491
|
+
}
|
|
1492
|
+
return Xe(t, Tt("t", { x: 2, y: 2, width: 12, height: 12 }), {});
|
|
1493
|
+
}
|
|
1494
|
+
const Qo = /* @__PURE__ */ new Set([1, 2, 5, 6]);
|
|
1495
|
+
function Fe(t, e) {
|
|
1496
|
+
const n = Lt(
|
|
1497
|
+
t.flatMap(({ x: a, y: o, width: s, height: r }) => [
|
|
1498
|
+
{ x: a, y: o },
|
|
1499
|
+
{ x: a + s, y: o + r }
|
|
1500
|
+
])
|
|
1501
|
+
);
|
|
1502
|
+
return {
|
|
1503
|
+
x: n.x - e,
|
|
1504
|
+
y: n.y - e,
|
|
1505
|
+
width: n.width + 2 * e,
|
|
1506
|
+
height: n.height + 2 * e
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
function Wo(t) {
|
|
1510
|
+
const e = () => ot(t.dentition), n = () => ot(t.layout), a = () => ot(t.showHalf) ?? "full", o = () => ot(t.showNumbers) ?? !1, s = (v) => a() === "full" || a() === "upper" === Qo.has(v), r = T(() => {
|
|
1511
|
+
const v = ot(t.teeth);
|
|
1512
|
+
return v ? new Set(v) : void 0;
|
|
1513
|
+
}), i = (v) => !r.value || r.value.has(v);
|
|
1514
|
+
kt(
|
|
1515
|
+
() => [ot(t.teeth), e()],
|
|
1516
|
+
([v, f]) => {
|
|
1517
|
+
if (!v)
|
|
1518
|
+
return;
|
|
1519
|
+
const I = new Set(Kn(f, "arch")), E = v.filter((F) => !I.has(F));
|
|
1520
|
+
E.length && console.warn(`[vue-odontogram] Teeth ${E.join(", ")} are not part of the ${f} dentition.`);
|
|
1521
|
+
},
|
|
1522
|
+
{ immediate: !0 }
|
|
1523
|
+
);
|
|
1524
|
+
const l = T(
|
|
1525
|
+
() => ne(e(), n()).filter(({ quadrant: v }) => s(v)).map((v) => ({ ...v, teeth: v.teeth.filter(({ tooth: f }) => i(f.id)) })).filter(({ teeth: v }) => v.length)
|
|
1526
|
+
), u = T(() => co(e(), n())), d = T(
|
|
1527
|
+
() => io(e(), n()).filter(
|
|
1528
|
+
({ quadrant: v, toothId: f }) => s(v) && i(f)
|
|
1529
|
+
)
|
|
1530
|
+
), h = T(
|
|
1531
|
+
() => Object.fromEntries(d.value.map((v) => [v.toothId, v]))
|
|
1532
|
+
), c = T(
|
|
1533
|
+
() => o() ? mo(d.value, u.value, n(), ot(t.notation)) : []
|
|
1534
|
+
), m = T(() => qe(d.value, u.value, n())), p = T(
|
|
1535
|
+
() => ot(t.showSurfaces) ? Lo(m.value, {
|
|
1536
|
+
fairCurve: n() === "arch",
|
|
1537
|
+
alignRows: n() === "horizontal",
|
|
1538
|
+
shape: ot(t.surfaceShape)
|
|
1539
|
+
}) : { diagrams: [], reserved: 0 }
|
|
1540
|
+
), b = T(() => {
|
|
1541
|
+
const v = ot(t.findings) ?? [];
|
|
1542
|
+
return v.length ? tn(
|
|
1543
|
+
v,
|
|
1544
|
+
ot(t.findingCatalog) ?? St,
|
|
1545
|
+
m.value,
|
|
1546
|
+
p.value
|
|
1547
|
+
) : { findings: [], issues: [] };
|
|
1548
|
+
});
|
|
1549
|
+
kt(
|
|
1550
|
+
() => b.value.issues,
|
|
1551
|
+
(v) => v.forEach((f) => console.warn(`[vue-odontogram] ${f}`)),
|
|
1552
|
+
{ immediate: !0 }
|
|
1553
|
+
);
|
|
1554
|
+
const C = T(() => {
|
|
1555
|
+
const v = /* @__PURE__ */ new Map();
|
|
1556
|
+
for (const f of b.value.findings)
|
|
1557
|
+
for (const I of f.teeth)
|
|
1558
|
+
v.set(I, [...v.get(I) ?? [], f]);
|
|
1559
|
+
return v;
|
|
1560
|
+
}), M = T(() => {
|
|
1561
|
+
const v = u.value, f = [
|
|
1562
|
+
...c.value.map(({ box: L }) => L),
|
|
1563
|
+
...p.value.diagrams.map(({ box: L }) => L),
|
|
1564
|
+
...b.value.findings.map(({ box: L }) => L)
|
|
1565
|
+
], I = m.value.fontSize || 4;
|
|
1566
|
+
if (a() === "full") {
|
|
1567
|
+
if (!f.length)
|
|
1568
|
+
return v;
|
|
1569
|
+
const L = Fe(f, I / 2), _ = Math.min(v.x, L.x), N = Math.min(v.y, L.y);
|
|
1570
|
+
return {
|
|
1571
|
+
x: _,
|
|
1572
|
+
y: N,
|
|
1573
|
+
width: Math.max(v.x + v.width, L.x + L.width) - _,
|
|
1574
|
+
height: Math.max(v.y + v.height, L.y + L.height) - N
|
|
1575
|
+
};
|
|
1576
|
+
}
|
|
1577
|
+
const E = [...d.value.map(({ box: L }) => L), ...f];
|
|
1578
|
+
if (!E.length)
|
|
1579
|
+
return v;
|
|
1580
|
+
const F = Fe(E, I);
|
|
1581
|
+
return { x: v.x, y: F.y, width: v.width, height: F.height };
|
|
1582
|
+
}), w = T(() => {
|
|
1583
|
+
const { x: v, y: f, width: I, height: E } = M.value, F = (L) => Math.round(L * 100) / 100;
|
|
1584
|
+
return [v, f, I, E].map(F).join(" ");
|
|
1585
|
+
}), k = T(() => {
|
|
1586
|
+
const v = /* @__PURE__ */ new Map();
|
|
1587
|
+
for (const f of ot(t.conditions) ?? [])
|
|
1588
|
+
for (const I of f.teeth)
|
|
1589
|
+
v.set(I, f);
|
|
1590
|
+
return v;
|
|
1591
|
+
});
|
|
1592
|
+
return {
|
|
1593
|
+
viewBox: w,
|
|
1594
|
+
viewBoxRect: M,
|
|
1595
|
+
quadrants: l,
|
|
1596
|
+
anchors: h,
|
|
1597
|
+
anchorList: d,
|
|
1598
|
+
numberLabels: c,
|
|
1599
|
+
surfaceDiagrams: T(() => p.value.diagrams),
|
|
1600
|
+
findingLayout: b,
|
|
1601
|
+
findingsByTooth: C,
|
|
1602
|
+
conditionByTooth: k
|
|
1603
|
+
};
|
|
1604
|
+
}
|
|
1605
|
+
function Xo(t) {
|
|
1606
|
+
const e = T(() => [...new Set(ot(t.modelValue) ?? [])]);
|
|
1607
|
+
function n(o) {
|
|
1608
|
+
return e.value.includes(o);
|
|
1609
|
+
}
|
|
1610
|
+
function a(o) {
|
|
1611
|
+
const s = e.value;
|
|
1612
|
+
return ot(t.singleSelect) ? s.includes(o) ? [] : [o] : s.includes(o) ? s.filter((r) => r !== o) : [...s, o];
|
|
1613
|
+
}
|
|
1614
|
+
return { isSelected: n, selectedTeeth: e, toggle: a };
|
|
1615
|
+
}
|
|
1616
|
+
const Ko = [
|
|
1617
|
+
"present",
|
|
1618
|
+
"missing",
|
|
1619
|
+
"extracted",
|
|
1620
|
+
"implant",
|
|
1621
|
+
"unerupted"
|
|
1622
|
+
], lt = {
|
|
1623
|
+
odontogram: "Odontogram",
|
|
1624
|
+
chartTitles: {
|
|
1625
|
+
permanent: "permanent odontogram",
|
|
1626
|
+
primary: "primary odontogram",
|
|
1627
|
+
mixed: "mixed odontogram"
|
|
1628
|
+
},
|
|
1629
|
+
tooth: "Tooth",
|
|
1630
|
+
type: "Type",
|
|
1631
|
+
selected: "Selected",
|
|
1632
|
+
yes: "Yes",
|
|
1633
|
+
no: "No",
|
|
1634
|
+
condition: "Condition",
|
|
1635
|
+
legend: "Tooth condition legend",
|
|
1636
|
+
toothTypes: {},
|
|
1637
|
+
state: "State",
|
|
1638
|
+
states: {
|
|
1639
|
+
present: "Present",
|
|
1640
|
+
missing: "Missing",
|
|
1641
|
+
extracted: "Extracted",
|
|
1642
|
+
implant: "Implant",
|
|
1643
|
+
unerupted: "Unerupted"
|
|
1644
|
+
},
|
|
1645
|
+
findings: "Findings",
|
|
1646
|
+
findingStatuses: {
|
|
1647
|
+
existing: "Existing",
|
|
1648
|
+
planned: "Planned",
|
|
1649
|
+
done: "Done"
|
|
1650
|
+
},
|
|
1651
|
+
surfaces: "Tooth surfaces",
|
|
1652
|
+
surface: "Surface",
|
|
1653
|
+
surfaceSummary: "Surfaces",
|
|
1654
|
+
surfaceNames: {
|
|
1655
|
+
vestibular: "Vestibular",
|
|
1656
|
+
mesial: "Mesial",
|
|
1657
|
+
occlusal: "Occlusal",
|
|
1658
|
+
incisal: "Incisal",
|
|
1659
|
+
distal: "Distal",
|
|
1660
|
+
lingual: "Lingual",
|
|
1661
|
+
palatal: "Palatal"
|
|
1662
|
+
},
|
|
1663
|
+
surfaceLetters: {
|
|
1664
|
+
vestibular: "V",
|
|
1665
|
+
mesial: "M",
|
|
1666
|
+
occlusal: "O",
|
|
1667
|
+
incisal: "I",
|
|
1668
|
+
distal: "D",
|
|
1669
|
+
lingual: "L",
|
|
1670
|
+
palatal: "P"
|
|
1671
|
+
},
|
|
1672
|
+
surfaceDescriptions: {
|
|
1673
|
+
vestibular: "Faces the lips or cheeks (outward).",
|
|
1674
|
+
mesial: "Closest to the midline of the mouth.",
|
|
1675
|
+
occlusal: "Chewing surface of molars and premolars.",
|
|
1676
|
+
incisal: "Cutting edge of incisors and canines.",
|
|
1677
|
+
distal: "Farthest from the midline of the mouth.",
|
|
1678
|
+
lingual: "Faces the tongue (lower teeth).",
|
|
1679
|
+
palatal: "Faces the palate (upper teeth)."
|
|
1680
|
+
},
|
|
1681
|
+
surfaceGuide: "Surface guide",
|
|
1682
|
+
surfaceMenu: "Surface findings",
|
|
1683
|
+
inspector: {
|
|
1684
|
+
title: "Tooth details",
|
|
1685
|
+
surfaceFindings: "Findings by surface",
|
|
1686
|
+
toothFindings: "Whole tooth",
|
|
1687
|
+
noFindings: "No findings",
|
|
1688
|
+
addFinding: "Add a finding",
|
|
1689
|
+
finding: "Finding",
|
|
1690
|
+
status: "Status",
|
|
1691
|
+
add: "Add",
|
|
1692
|
+
remove: "Remove",
|
|
1693
|
+
chooseSurfaces: "Choose the surfaces on the diagram.",
|
|
1694
|
+
onSurfaces: "On surfaces",
|
|
1695
|
+
onTooth: "On the whole tooth"
|
|
1696
|
+
}
|
|
1697
|
+
};
|
|
1698
|
+
function ae(t) {
|
|
1699
|
+
return {
|
|
1700
|
+
...lt,
|
|
1701
|
+
...t,
|
|
1702
|
+
chartTitles: { ...lt.chartTitles, ...t == null ? void 0 : t.chartTitles },
|
|
1703
|
+
toothTypes: { ...lt.toothTypes, ...t == null ? void 0 : t.toothTypes },
|
|
1704
|
+
states: { ...lt.states, ...t == null ? void 0 : t.states },
|
|
1705
|
+
surfaceNames: { ...lt.surfaceNames, ...t == null ? void 0 : t.surfaceNames },
|
|
1706
|
+
surfaceLetters: { ...lt.surfaceLetters, ...t == null ? void 0 : t.surfaceLetters },
|
|
1707
|
+
surfaceDescriptions: { ...lt.surfaceDescriptions, ...t == null ? void 0 : t.surfaceDescriptions },
|
|
1708
|
+
findingStatuses: { ...lt.findingStatuses, ...t == null ? void 0 : t.findingStatuses },
|
|
1709
|
+
inspector: { ...lt.inspector, ...t == null ? void 0 : t.inspector }
|
|
1710
|
+
};
|
|
1711
|
+
}
|
|
1712
|
+
const en = /* @__PURE__ */ new Set([
|
|
1713
|
+
"ArrowLeft",
|
|
1714
|
+
"ArrowRight",
|
|
1715
|
+
"ArrowUp",
|
|
1716
|
+
"ArrowDown",
|
|
1717
|
+
"Home",
|
|
1718
|
+
"End"
|
|
1719
|
+
]);
|
|
1720
|
+
function Uo(t, e) {
|
|
1721
|
+
return t.center.x - e.center.x;
|
|
1722
|
+
}
|
|
1723
|
+
function Go(t) {
|
|
1724
|
+
const e = /* @__PURE__ */ new Map();
|
|
1725
|
+
for (const { row: n, center: a } of t) {
|
|
1726
|
+
const o = e.get(n) ?? { total: 0, count: 0 };
|
|
1727
|
+
e.set(n, { total: o.total + a.y, count: o.count + 1 });
|
|
1728
|
+
}
|
|
1729
|
+
return new Map([...e].map(([n, { total: a, count: o }]) => [n, a / o]));
|
|
1730
|
+
}
|
|
1731
|
+
function nn(t, e, n) {
|
|
1732
|
+
var r, i, l, u, d, h;
|
|
1733
|
+
const a = t.find(({ toothId: c }) => c === e);
|
|
1734
|
+
if (!a)
|
|
1735
|
+
return;
|
|
1736
|
+
const o = t.filter(({ row: c }) => c === a.row).sort(Uo), s = o.indexOf(a);
|
|
1737
|
+
switch (n) {
|
|
1738
|
+
case "ArrowLeft":
|
|
1739
|
+
return (r = o[s - 1]) == null ? void 0 : r.toothId;
|
|
1740
|
+
case "ArrowRight":
|
|
1741
|
+
return (i = o[s + 1]) == null ? void 0 : i.toothId;
|
|
1742
|
+
case "Home":
|
|
1743
|
+
return (l = o[0]) == null ? void 0 : l.toothId;
|
|
1744
|
+
case "End":
|
|
1745
|
+
return (u = o[o.length - 1]) == null ? void 0 : u.toothId;
|
|
1746
|
+
default: {
|
|
1747
|
+
const c = n === "ArrowDown", m = Go(t), p = m.get(a.row), C = (d = [...m].filter(
|
|
1748
|
+
([w, k]) => w !== a.row && (c ? k > p : k < p)
|
|
1749
|
+
).sort(
|
|
1750
|
+
([, w], [, k]) => Math.abs(w - p) - Math.abs(k - p)
|
|
1751
|
+
)[0]) == null ? void 0 : d[0];
|
|
1752
|
+
return (h = t.filter(({ row: w }) => w === C).reduce(
|
|
1753
|
+
(w, k) => !w || Math.abs(k.center.x - a.center.x) < Math.abs(w.center.x - a.center.x) ? k : w,
|
|
1754
|
+
void 0
|
|
1755
|
+
)) == null ? void 0 : h.toothId;
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
}
|
|
1759
|
+
const se = /* @__PURE__ */ new Set(["missing", "extracted"]);
|
|
1760
|
+
function re(t, e) {
|
|
1761
|
+
return (t == null ? void 0 : t[e]) ?? "present";
|
|
1762
|
+
}
|
|
1763
|
+
function Yo(t, e) {
|
|
1764
|
+
return {
|
|
1765
|
+
x: t.x + t.width * e,
|
|
1766
|
+
y: t.y + t.height * e,
|
|
1767
|
+
width: t.width * (1 - 2 * e),
|
|
1768
|
+
height: t.height * (1 - 2 * e)
|
|
1769
|
+
};
|
|
1770
|
+
}
|
|
1771
|
+
function Jo(t, e) {
|
|
1772
|
+
const n = [];
|
|
1773
|
+
for (const { toothId: a, box: o } of t) {
|
|
1774
|
+
const s = re(e, a), r = Math.max(1, Math.min(o.width, o.height) * 0.06);
|
|
1775
|
+
if (s === "extracted") {
|
|
1776
|
+
const i = Yo(o, 0.12);
|
|
1777
|
+
n.push({
|
|
1778
|
+
kind: "cross",
|
|
1779
|
+
toothId: a,
|
|
1780
|
+
strokeWidth: r,
|
|
1781
|
+
lines: [
|
|
1782
|
+
{ x1: i.x, y1: i.y, x2: i.x + i.width, y2: i.y + i.height },
|
|
1783
|
+
{ x1: i.x + i.width, y1: i.y, x2: i.x, y2: i.y + i.height }
|
|
1784
|
+
]
|
|
1785
|
+
});
|
|
1786
|
+
} else if (s === "implant") {
|
|
1787
|
+
const i = Math.min(o.width, o.height) * 0.22, l = o.height * 0.62, u = {
|
|
1788
|
+
x: o.x + (o.width - i) / 2,
|
|
1789
|
+
y: o.y + (o.height - l) / 2,
|
|
1790
|
+
width: i,
|
|
1791
|
+
height: l
|
|
1792
|
+
}, d = 4, h = i * 0.35, c = Array.from({ length: d }, (m, p) => {
|
|
1793
|
+
const b = u.y + u.height * (p + 1) / (d + 1);
|
|
1794
|
+
return { x1: u.x - h, y1: b, x2: u.x + i + h, y2: b };
|
|
1795
|
+
});
|
|
1796
|
+
n.push({ kind: "implant", toothId: a, body: u, threads: c, strokeWidth: r * 0.8 });
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
return n;
|
|
1800
|
+
}
|
|
1801
|
+
const ta = [
|
|
1802
|
+
[1, 2],
|
|
1803
|
+
[4, 3],
|
|
1804
|
+
[5, 6],
|
|
1805
|
+
[8, 7]
|
|
1806
|
+
];
|
|
1807
|
+
function ea(t) {
|
|
1808
|
+
const e = Number(t[0]), [n, a] = ta.find((r) => r.includes(e)) ?? [e, e], o = n > 4 ? 5 : 8, s = (r) => Array.from({ length: o }, (i, l) => `${r}${l + 1}`);
|
|
1809
|
+
return [...s(n).reverse(), ...s(a)];
|
|
1810
|
+
}
|
|
1811
|
+
function na(t, e) {
|
|
1812
|
+
const n = ea(e), a = t.teeth.map((s) => n.indexOf(s));
|
|
1813
|
+
if (a.some((s) => s < 0) || !a.length)
|
|
1814
|
+
return !1;
|
|
1815
|
+
const o = n.indexOf(e);
|
|
1816
|
+
return o >= Math.min(...a) && o <= Math.max(...a);
|
|
1817
|
+
}
|
|
1818
|
+
function on(t) {
|
|
1819
|
+
var e;
|
|
1820
|
+
return (e = t.surfaces) != null && e.length ? G.filter((n) => t.surfaces.includes(n)) : [...G];
|
|
1821
|
+
}
|
|
1822
|
+
function Bt(t, e, n = St) {
|
|
1823
|
+
const a = {
|
|
1824
|
+
toothId: t,
|
|
1825
|
+
surfaces: Object.fromEntries(G.map((o) => [o, []])),
|
|
1826
|
+
tooth: []
|
|
1827
|
+
};
|
|
1828
|
+
return e.forEach((o, s) => {
|
|
1829
|
+
const r = n[o.code], i = r ? Ct(r.symbol) : "unknown";
|
|
1830
|
+
if (!(i === "span" ? na(o, t) : o.teeth.includes(t)))
|
|
1831
|
+
return;
|
|
1832
|
+
const u = { index: s, finding: o, definition: r, scope: i };
|
|
1833
|
+
i === "surface" ? on(o).forEach((d) => a.surfaces[d].push(u)) : a.tooth.push(u);
|
|
1834
|
+
}), a;
|
|
1835
|
+
}
|
|
1836
|
+
function oa(t, e) {
|
|
1837
|
+
return t.code === e.code && (t.status ?? "existing") === (e.status ?? "existing") && t.tone === e.tone && t.color === e.color && t.label === void 0 && t.direction === void 0;
|
|
1838
|
+
}
|
|
1839
|
+
function aa(t, e) {
|
|
1840
|
+
var o;
|
|
1841
|
+
const n = G.filter((s) => e.surfaces.includes(s)), a = t.findIndex(
|
|
1842
|
+
(s) => s.teeth.length === 1 && s.teeth[0] === e.toothId && oa(s, e)
|
|
1843
|
+
);
|
|
1844
|
+
if (a >= 0) {
|
|
1845
|
+
const s = t[a], r = (o = s.surfaces) != null && o.length ? G.filter((i) => s.surfaces.includes(i) || n.includes(i)) : void 0;
|
|
1846
|
+
return t.map(
|
|
1847
|
+
(i, l) => l === a ? { ...s, ...r ? { surfaces: r } : {} } : i
|
|
1848
|
+
);
|
|
1849
|
+
}
|
|
1850
|
+
return [
|
|
1851
|
+
...t,
|
|
1852
|
+
{
|
|
1853
|
+
code: e.code,
|
|
1854
|
+
teeth: [e.toothId],
|
|
1855
|
+
surfaces: n,
|
|
1856
|
+
...e.status ? { status: e.status } : {},
|
|
1857
|
+
...e.tone ? { tone: e.tone } : {},
|
|
1858
|
+
...e.color ? { color: e.color } : {}
|
|
1859
|
+
}
|
|
1860
|
+
];
|
|
1861
|
+
}
|
|
1862
|
+
function Ks(t, e, n = St) {
|
|
1863
|
+
const a = n[e.code];
|
|
1864
|
+
return a && Ct(a.symbol) === "surface" ? aa(t, { ...e, surfaces: e.surfaces ?? [] }) : [
|
|
1865
|
+
...t,
|
|
1866
|
+
{
|
|
1867
|
+
code: e.code,
|
|
1868
|
+
teeth: [e.toothId],
|
|
1869
|
+
...e.status ? { status: e.status } : {},
|
|
1870
|
+
...e.tone ? { tone: e.tone } : {},
|
|
1871
|
+
...e.color ? { color: e.color } : {}
|
|
1872
|
+
}
|
|
1873
|
+
];
|
|
1874
|
+
}
|
|
1875
|
+
function Us(t, { index: e, toothId: n, surface: a }) {
|
|
1876
|
+
const o = t[e];
|
|
1877
|
+
if (!(o != null && o.teeth.includes(n)))
|
|
1878
|
+
return [...t];
|
|
1879
|
+
const s = o.teeth.filter((l) => l !== n), r = a ? on(o).filter((l) => l !== a) : [], i = [
|
|
1880
|
+
...s.length ? [{ ...o, teeth: s }] : [],
|
|
1881
|
+
...r.length ? [{ ...o, teeth: [n], surfaces: r }] : []
|
|
1882
|
+
];
|
|
1883
|
+
return [...t.slice(0, e), ...i, ...t.slice(e + 1)];
|
|
1884
|
+
}
|
|
1885
|
+
const sa = ["d"], ra = ["d"], ia = ["cx", "cy", "r"], ca = ["x", "y", "font-size"], ie = /* @__PURE__ */ mt({
|
|
1886
|
+
__name: "FindingPrimitives",
|
|
1887
|
+
props: {
|
|
1888
|
+
primitives: {}
|
|
1889
|
+
},
|
|
1890
|
+
setup(t) {
|
|
1891
|
+
return (e, n) => (g(!0), y(Z, null, O(t.primitives, (a, o) => (g(), y(Z, { key: o }, [
|
|
1892
|
+
a.type === "path" ? (g(), y("path", {
|
|
1893
|
+
key: 0,
|
|
1894
|
+
class: "odontogram-finding__stroke",
|
|
1895
|
+
d: a.d
|
|
1896
|
+
}, null, 8, sa)) : a.type === "area" ? (g(), y("path", {
|
|
1897
|
+
key: 1,
|
|
1898
|
+
class: "odontogram-finding__area",
|
|
1899
|
+
d: a.d
|
|
1900
|
+
}, null, 8, ra)) : a.type === "circle" ? (g(), y("circle", {
|
|
1901
|
+
key: 2,
|
|
1902
|
+
class: "odontogram-finding__stroke",
|
|
1903
|
+
cx: a.cx,
|
|
1904
|
+
cy: a.cy,
|
|
1905
|
+
r: a.r
|
|
1906
|
+
}, null, 8, ia)) : (g(), y("text", {
|
|
1907
|
+
key: 3,
|
|
1908
|
+
class: "odontogram-finding__text",
|
|
1909
|
+
x: a.x,
|
|
1910
|
+
y: a.y,
|
|
1911
|
+
"font-size": a.fontSize,
|
|
1912
|
+
"text-anchor": "middle",
|
|
1913
|
+
"dominant-baseline": "central"
|
|
1914
|
+
}, P(a.text), 9, ca))
|
|
1915
|
+
], 64))), 128));
|
|
1916
|
+
}
|
|
1917
|
+
}), la = ["aria-label"], ua = ["data-state"], da = {
|
|
1918
|
+
"aria-hidden": "true",
|
|
1919
|
+
class: "odontogram-condition-labels__icon",
|
|
1920
|
+
viewBox: "0 0 16 16",
|
|
1921
|
+
fill: "none"
|
|
1922
|
+
}, ha = ["stroke-dasharray"], fa = {
|
|
1923
|
+
key: 0,
|
|
1924
|
+
class: "odontogram-state-mark--cross"
|
|
1925
|
+
}, ma = {
|
|
1926
|
+
key: 1,
|
|
1927
|
+
class: "odontogram-state-mark--implant"
|
|
1928
|
+
}, ga = ["data-finding", "data-status", "data-tone"], ya = /* @__PURE__ */ mt({
|
|
1929
|
+
__name: "ConditionLabels",
|
|
1930
|
+
props: {
|
|
1931
|
+
conditions: { default: void 0 },
|
|
1932
|
+
states: { default: () => [] },
|
|
1933
|
+
findings: { default: () => [] },
|
|
1934
|
+
ariaLabel: { default: "Tooth condition legend" }
|
|
1935
|
+
},
|
|
1936
|
+
setup(t) {
|
|
1937
|
+
return (e, n) => {
|
|
1938
|
+
var a;
|
|
1939
|
+
return (a = t.conditions) != null && a.length || t.states.length || t.findings.length ? (g(), y("ul", {
|
|
1940
|
+
key: 0,
|
|
1941
|
+
class: "odontogram-condition-labels",
|
|
1942
|
+
"aria-label": t.ariaLabel
|
|
1943
|
+
}, [
|
|
1944
|
+
(g(!0), y(Z, null, O(t.conditions, (o, s) => (g(), y("li", {
|
|
1945
|
+
key: `${s}-${o.label}`,
|
|
1946
|
+
class: "odontogram-condition-labels__item"
|
|
1947
|
+
}, [
|
|
1948
|
+
B("span", {
|
|
1949
|
+
"aria-hidden": "true",
|
|
1950
|
+
class: "odontogram-condition-labels__swatch",
|
|
1951
|
+
style: ht({
|
|
1952
|
+
background: o.fillColor,
|
|
1953
|
+
borderColor: o.outlineColor ?? o.fillColor
|
|
1954
|
+
})
|
|
1955
|
+
}, null, 4),
|
|
1956
|
+
B("span", null, P(o.label), 1)
|
|
1957
|
+
]))), 128)),
|
|
1958
|
+
(g(!0), y(Z, null, O(t.states, ({ state: o, label: s }) => (g(), y("li", {
|
|
1959
|
+
key: `state-${o}`,
|
|
1960
|
+
class: "odontogram-condition-labels__item",
|
|
1961
|
+
"data-state": o
|
|
1962
|
+
}, [
|
|
1963
|
+
(g(), y("svg", da, [
|
|
1964
|
+
B("rect", {
|
|
1965
|
+
class: rt(["odontogram-condition-labels__icon-tooth", `odontogram-condition-labels__icon-tooth--${o}`]),
|
|
1966
|
+
x: "2",
|
|
1967
|
+
y: "2",
|
|
1968
|
+
width: "12",
|
|
1969
|
+
height: "12",
|
|
1970
|
+
rx: "4",
|
|
1971
|
+
"stroke-dasharray": o === "missing" || o === "extracted" ? "2.5 2" : void 0
|
|
1972
|
+
}, null, 10, ha),
|
|
1973
|
+
o === "extracted" ? (g(), y("g", fa, [...n[0] || (n[0] = [
|
|
1974
|
+
B("line", {
|
|
1975
|
+
x1: "3",
|
|
1976
|
+
y1: "3",
|
|
1977
|
+
x2: "13",
|
|
1978
|
+
y2: "13"
|
|
1979
|
+
}, null, -1),
|
|
1980
|
+
B("line", {
|
|
1981
|
+
x1: "13",
|
|
1982
|
+
y1: "3",
|
|
1983
|
+
x2: "3",
|
|
1984
|
+
y2: "13"
|
|
1985
|
+
}, null, -1)
|
|
1986
|
+
])])) : o === "implant" ? (g(), y("g", ma, [...n[1] || (n[1] = [
|
|
1987
|
+
B("rect", {
|
|
1988
|
+
x: "6.5",
|
|
1989
|
+
y: "4",
|
|
1990
|
+
width: "3",
|
|
1991
|
+
height: "8"
|
|
1992
|
+
}, null, -1),
|
|
1993
|
+
B("line", {
|
|
1994
|
+
x1: "5.5",
|
|
1995
|
+
y1: "6",
|
|
1996
|
+
x2: "10.5",
|
|
1997
|
+
y2: "6"
|
|
1998
|
+
}, null, -1),
|
|
1999
|
+
B("line", {
|
|
2000
|
+
x1: "5.5",
|
|
2001
|
+
y1: "8",
|
|
2002
|
+
x2: "10.5",
|
|
2003
|
+
y2: "8"
|
|
2004
|
+
}, null, -1),
|
|
2005
|
+
B("line", {
|
|
2006
|
+
x1: "5.5",
|
|
2007
|
+
y1: "10",
|
|
2008
|
+
x2: "10.5",
|
|
2009
|
+
y2: "10"
|
|
2010
|
+
}, null, -1)
|
|
2011
|
+
])])) : q("", !0)
|
|
2012
|
+
])),
|
|
2013
|
+
B("span", null, P(s), 1)
|
|
2014
|
+
], 8, ua))), 128)),
|
|
2015
|
+
(g(!0), y(Z, null, O(t.findings, (o) => (g(), y("li", {
|
|
2016
|
+
key: o.key,
|
|
2017
|
+
class: "odontogram-condition-labels__item",
|
|
2018
|
+
"data-finding": o.code,
|
|
2019
|
+
"data-status": o.status,
|
|
2020
|
+
"data-tone": o.tone
|
|
2021
|
+
}, [
|
|
2022
|
+
(g(), y("svg", {
|
|
2023
|
+
"aria-hidden": "true",
|
|
2024
|
+
class: rt(["odontogram-condition-labels__icon odontogram-finding", [`odontogram-finding--${o.tone}`, `odontogram-finding--${o.status}`]]),
|
|
2025
|
+
style: ht(o.color ? { color: o.color } : void 0),
|
|
2026
|
+
viewBox: "0 0 16 16",
|
|
2027
|
+
fill: "none",
|
|
2028
|
+
"stroke-width": "1.4"
|
|
2029
|
+
}, [
|
|
2030
|
+
jt(ie, {
|
|
2031
|
+
primitives: o.icon
|
|
2032
|
+
}, null, 8, ["primitives"])
|
|
2033
|
+
], 6)),
|
|
2034
|
+
B("span", null, P(o.name), 1)
|
|
2035
|
+
], 8, ga))), 128))
|
|
2036
|
+
], 8, la)) : q("", !0);
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
}), va = {
|
|
2040
|
+
key: 0,
|
|
2041
|
+
class: "odontogram-tooltip__description"
|
|
2042
|
+
}, pa = { key: 1 }, xa = { key: 2 }, wa = { key: 0 }, ba = { key: 1 }, Ma = ["data-summary-surface"], Ca = { class: "odontogram-tooltip__letter" }, ka = { key: 3 }, $a = /* @__PURE__ */ mt({
|
|
2043
|
+
__name: "OdontogramTooltip",
|
|
2044
|
+
props: {
|
|
2045
|
+
active: { type: Boolean },
|
|
2046
|
+
tooth: {},
|
|
2047
|
+
selected: { type: Boolean, default: !1 },
|
|
2048
|
+
condition: { default: void 0 },
|
|
2049
|
+
state: { default: "present" },
|
|
2050
|
+
findings: { default: () => [] },
|
|
2051
|
+
number: { default: void 0 },
|
|
2052
|
+
surface: { default: void 0 },
|
|
2053
|
+
surfaceName: { default: void 0 },
|
|
2054
|
+
surfaceDescription: { default: void 0 },
|
|
2055
|
+
surfaceSummary: { default: () => [] },
|
|
2056
|
+
anchorRect: { default: void 0 },
|
|
2057
|
+
placement: { default: "top" },
|
|
2058
|
+
margin: { default: 10 },
|
|
2059
|
+
labels: { default: () => lt }
|
|
2060
|
+
},
|
|
2061
|
+
setup(t) {
|
|
2062
|
+
const e = t, n = et(null), a = et({ left: -9999, top: -9999, isBelow: !1 });
|
|
2063
|
+
function o(r, i, l) {
|
|
2064
|
+
return Math.min(Math.max(r, i), l);
|
|
2065
|
+
}
|
|
2066
|
+
async function s() {
|
|
2067
|
+
if (!(e.active && e.anchorRect && n.value))
|
|
2068
|
+
return;
|
|
2069
|
+
await Rt();
|
|
2070
|
+
const r = n.value.getBoundingClientRect(), i = 8, l = 12, u = e.placement.startsWith("bottom"), d = e.anchorRect.left + (e.anchorRect.right - e.anchorRect.left) / 2, h = Math.max(i, window.innerWidth - r.width - i), c = o(d - r.width / 2, i, h), m = e.anchorRect.top - r.height - e.margin - l, p = e.anchorRect.bottom + e.margin + l, b = Math.max(i, window.innerHeight - r.height - i);
|
|
2071
|
+
let C = u, M = u ? p : m;
|
|
2072
|
+
!C && M < i && (C = !0, M = p), C && M > b && (C = !1, M = m), a.value = { left: c, top: o(M, i, b), isBelow: C };
|
|
2073
|
+
}
|
|
2074
|
+
return kt(
|
|
2075
|
+
() => [e.active, e.anchorRect, e.placement, e.margin],
|
|
2076
|
+
() => void s(),
|
|
2077
|
+
{ deep: !0, flush: "post" }
|
|
2078
|
+
), (r, i) => t.active && t.tooth ? (g(), y("div", {
|
|
2079
|
+
key: 0,
|
|
2080
|
+
ref_key: "tooltip",
|
|
2081
|
+
ref: n,
|
|
2082
|
+
class: "odontogram-tooltip",
|
|
2083
|
+
role: "tooltip",
|
|
2084
|
+
style: ht({
|
|
2085
|
+
position: "fixed",
|
|
2086
|
+
left: `${a.value.left}px`,
|
|
2087
|
+
top: `${a.value.top}px`,
|
|
2088
|
+
opacity: a.value.left === -9999 ? 0 : 1
|
|
2089
|
+
})
|
|
2090
|
+
}, [
|
|
2091
|
+
Ht(r.$slots, "default", {
|
|
2092
|
+
tooth: t.tooth,
|
|
2093
|
+
selected: t.selected,
|
|
2094
|
+
condition: t.condition,
|
|
2095
|
+
state: t.state,
|
|
2096
|
+
findings: t.findings,
|
|
2097
|
+
number: t.number ?? t.tooth.id,
|
|
2098
|
+
surface: t.surface,
|
|
2099
|
+
surfaceName: t.surfaceName,
|
|
2100
|
+
surfaceSummary: t.surfaceSummary
|
|
2101
|
+
}, () => {
|
|
2102
|
+
var l;
|
|
2103
|
+
return [
|
|
2104
|
+
t.surface ? (g(), y(Z, { key: 0 }, [
|
|
2105
|
+
B("div", null, P(t.labels.tooth) + ": " + P(t.number ?? t.tooth.id), 1),
|
|
2106
|
+
B("div", null, P(t.labels.surface) + ": " + P(t.surfaceName ?? t.surface), 1),
|
|
2107
|
+
t.surfaceDescription ? (g(), y("div", va, P(t.surfaceDescription), 1)) : q("", !0),
|
|
2108
|
+
t.state !== "present" ? (g(), y("div", pa, P(t.labels.state) + ": " + P(t.labels.states[t.state]), 1)) : q("", !0),
|
|
2109
|
+
t.findings.length ? (g(), y("div", xa, P(t.labels.findings) + ": " + P(t.findings.join(", ")), 1)) : q("", !0),
|
|
2110
|
+
B("div", null, P(t.labels.selected) + ": " + P(t.selected ? t.labels.yes : t.labels.no), 1)
|
|
2111
|
+
], 64)) : (g(), y(Z, { key: 1 }, [
|
|
2112
|
+
B("div", null, P(t.labels.tooth) + ": " + P(t.number ?? t.tooth.id), 1),
|
|
2113
|
+
B("div", null, P(t.labels.type) + ": " + P(t.labels.toothTypes[t.tooth.type] ?? t.tooth.type), 1),
|
|
2114
|
+
t.state !== "present" ? (g(), y("div", wa, P(t.labels.state) + ": " + P(t.labels.states[t.state]), 1)) : q("", !0),
|
|
2115
|
+
t.findings.length ? (g(), y("div", ba, P(t.labels.findings) + ": " + P(t.findings.join(", ")), 1)) : q("", !0),
|
|
2116
|
+
t.surfaceSummary.length ? (g(), y(Z, { key: 2 }, [
|
|
2117
|
+
B("div", null, P(t.labels.surfaceSummary) + ":", 1),
|
|
2118
|
+
(g(!0), y(Z, null, O(t.surfaceSummary, (u) => (g(), y("div", {
|
|
2119
|
+
key: u.surface,
|
|
2120
|
+
class: "odontogram-tooltip__summary",
|
|
2121
|
+
"data-summary-surface": u.surface
|
|
2122
|
+
}, [
|
|
2123
|
+
B("span", Ca, P(u.letter), 1),
|
|
2124
|
+
pt(" " + P(u.name) + ": " + P(u.findings.join(", ")), 1)
|
|
2125
|
+
], 8, Ma))), 128))
|
|
2126
|
+
], 64)) : q("", !0),
|
|
2127
|
+
B("div", null, P(t.labels.selected) + ": " + P(t.selected ? t.labels.yes : t.labels.no), 1),
|
|
2128
|
+
(l = t.condition) != null && l.label ? (g(), y("div", ka, P(t.labels.condition) + ": " + P(t.condition.label), 1)) : q("", !0)
|
|
2129
|
+
], 64))
|
|
2130
|
+
];
|
|
2131
|
+
}),
|
|
2132
|
+
B("span", {
|
|
2133
|
+
"aria-hidden": "true",
|
|
2134
|
+
class: rt(["odontogram-tooltip__arrow", { "odontogram-tooltip__arrow--below": a.value.isBelow }])
|
|
2135
|
+
}, null, 2)
|
|
2136
|
+
], 4)) : q("", !0);
|
|
2137
|
+
}
|
|
2138
|
+
}), Sa = ["aria-label"], Pa = ["data-surfaces-for", "stroke-width"], Ia = ["d", "role", "aria-label", "aria-checked", "aria-haspopup", "aria-expanded", "aria-disabled", "tabindex", "data-surface-tooth", "data-surface", "onClick", "onFocus", "onMouseenter", "onKeydown"], Ta = /* @__PURE__ */ mt({
|
|
2139
|
+
__name: "SurfaceDiagrams",
|
|
2140
|
+
props: {
|
|
2141
|
+
diagrams: {},
|
|
2142
|
+
anchors: {},
|
|
2143
|
+
surfaces: {},
|
|
2144
|
+
disabled: { type: Boolean },
|
|
2145
|
+
inactiveTeeth: {},
|
|
2146
|
+
labels: {},
|
|
2147
|
+
spokenNumber: { type: Function },
|
|
2148
|
+
menu: { type: Boolean },
|
|
2149
|
+
openMenu: {}
|
|
2150
|
+
},
|
|
2151
|
+
emits: ["activate", "enter", "leave"],
|
|
2152
|
+
setup(t, { emit: e }) {
|
|
2153
|
+
const n = t, a = e, o = et(null), s = et();
|
|
2154
|
+
function r(b, C, M) {
|
|
2155
|
+
s.value = { toothId: b, surface: C }, a("enter", b, C, M);
|
|
2156
|
+
}
|
|
2157
|
+
function i(b, C) {
|
|
2158
|
+
var M;
|
|
2159
|
+
return ((M = n.surfaces[b]) == null ? void 0 : M.includes(C)) ?? !1;
|
|
2160
|
+
}
|
|
2161
|
+
const l = T(() => n.diagrams.filter(({ toothId: b }) => !n.inactiveTeeth.has(b))), u = T(() => {
|
|
2162
|
+
const b = l.value;
|
|
2163
|
+
if (s.value && b.some(({ toothId: C }) => C === s.value.toothId))
|
|
2164
|
+
return s.value;
|
|
2165
|
+
for (const { toothId: C } of b) {
|
|
2166
|
+
const M = G.find((w) => i(C, w));
|
|
2167
|
+
if (M)
|
|
2168
|
+
return { toothId: C, surface: M };
|
|
2169
|
+
}
|
|
2170
|
+
return b[0] ? { toothId: b[0].toothId, surface: G[0] } : void 0;
|
|
2171
|
+
});
|
|
2172
|
+
function d(b, C) {
|
|
2173
|
+
var M;
|
|
2174
|
+
return ((M = u.value) == null ? void 0 : M.toothId) === b && u.value.surface === C;
|
|
2175
|
+
}
|
|
2176
|
+
function h(b, C, M) {
|
|
2177
|
+
!n.disabled && !n.inactiveTeeth.has(b) && M.currentTarget instanceof SVGElement && (s.value = { toothId: b, surface: C }, a("activate", b, C, M.currentTarget));
|
|
2178
|
+
}
|
|
2179
|
+
function c(b, C) {
|
|
2180
|
+
var M;
|
|
2181
|
+
return ((M = n.openMenu) == null ? void 0 : M.toothId) === b && n.openMenu.surface === C;
|
|
2182
|
+
}
|
|
2183
|
+
function m(b, C, M) {
|
|
2184
|
+
if (M === "ArrowUp" || M === "ArrowDown") {
|
|
2185
|
+
const v = G.indexOf(C) + (M === "ArrowDown" ? 1 : -1);
|
|
2186
|
+
return G[v] ? { toothId: b, surface: G[v] } : void 0;
|
|
2187
|
+
}
|
|
2188
|
+
const w = n.anchors.filter((v) => !n.inactiveTeeth.has(v.toothId) || v.toothId === b), k = nn(w, b, M);
|
|
2189
|
+
return k && k !== b ? { toothId: k, surface: C } : void 0;
|
|
2190
|
+
}
|
|
2191
|
+
async function p(b, C, M) {
|
|
2192
|
+
var k, v;
|
|
2193
|
+
if (b.key === "Enter" || b.key === " ") {
|
|
2194
|
+
b.preventDefault(), h(C, M, b);
|
|
2195
|
+
return;
|
|
2196
|
+
}
|
|
2197
|
+
if (!en.has(b.key))
|
|
2198
|
+
return;
|
|
2199
|
+
b.preventDefault();
|
|
2200
|
+
const w = m(C, M, b.key);
|
|
2201
|
+
w && (s.value = w, await Rt(), (v = (k = o.value) == null ? void 0 : k.querySelector(`[data-surface-tooth="${w.toothId}"][data-surface="${w.surface}"]`)) == null || v.focus());
|
|
2202
|
+
}
|
|
2203
|
+
return (b, C) => (g(), y("g", {
|
|
2204
|
+
ref_key: "root",
|
|
2205
|
+
ref: o,
|
|
2206
|
+
class: "odontogram__surfaces",
|
|
2207
|
+
role: "group",
|
|
2208
|
+
"aria-label": t.labels.surfaces
|
|
2209
|
+
}, [
|
|
2210
|
+
(g(!0), y(Z, null, O(t.diagrams, (M) => (g(), y("g", {
|
|
2211
|
+
key: M.toothId,
|
|
2212
|
+
class: rt(["odontogram-surfaces", { "odontogram-surfaces--inactive": t.inactiveTeeth.has(M.toothId) }]),
|
|
2213
|
+
"data-surfaces-for": M.toothId,
|
|
2214
|
+
"stroke-width": M.strokeWidth
|
|
2215
|
+
}, [
|
|
2216
|
+
(g(!0), y(Z, null, O(M.surfaces, ({ surface: w, name: k, d: v }) => (g(), y("path", {
|
|
2217
|
+
key: w,
|
|
2218
|
+
class: rt(["odontogram-surface", { "odontogram-surface--selected": i(M.toothId, w) }]),
|
|
2219
|
+
d: v,
|
|
2220
|
+
role: t.menu ? "button" : "checkbox",
|
|
2221
|
+
"aria-label": `${t.labels.tooth} ${t.spokenNumber(M.toothId)}, ${t.labels.surfaceNames[k]}`,
|
|
2222
|
+
"aria-checked": t.menu ? void 0 : i(M.toothId, w),
|
|
2223
|
+
"aria-haspopup": t.menu ? "dialog" : void 0,
|
|
2224
|
+
"aria-expanded": t.menu ? c(M.toothId, w) : void 0,
|
|
2225
|
+
"aria-disabled": t.disabled || t.inactiveTeeth.has(M.toothId) || void 0,
|
|
2226
|
+
tabindex: !t.disabled && d(M.toothId, w) ? 0 : -1,
|
|
2227
|
+
"data-surface-tooth": M.toothId,
|
|
2228
|
+
"data-surface": w,
|
|
2229
|
+
onClick: (f) => h(M.toothId, w, f),
|
|
2230
|
+
onFocus: (f) => r(M.toothId, w, f),
|
|
2231
|
+
onBlur: C[0] || (C[0] = (f) => a("leave")),
|
|
2232
|
+
onMouseenter: (f) => a("enter", M.toothId, w, f),
|
|
2233
|
+
onMouseleave: C[1] || (C[1] = (f) => a("leave")),
|
|
2234
|
+
onKeydown: (f) => p(f, M.toothId, w)
|
|
2235
|
+
}, null, 42, Ia))), 128))
|
|
2236
|
+
], 10, Pa))), 128))
|
|
2237
|
+
], 8, Sa));
|
|
2238
|
+
}
|
|
2239
|
+
}), Ba = ["role", "aria-label", "data-tooth-state", "aria-selected", "aria-disabled", "tabindex", "data-tooth-id", "transform"], _a = ["stroke", "stroke-dasharray", "d"], Fa = ["fill", "d", "data-colored"], La = ["stroke", "d"], za = ["stroke", "d"], Na = /* @__PURE__ */ mt({
|
|
2240
|
+
__name: "Tooth",
|
|
2241
|
+
props: {
|
|
2242
|
+
tooth: {},
|
|
2243
|
+
selected: { type: Boolean, default: !1 },
|
|
2244
|
+
disabled: { type: Boolean, default: !1 },
|
|
2245
|
+
condition: { default: void 0 },
|
|
2246
|
+
layoutTransform: { default: void 0 },
|
|
2247
|
+
label: { default: "Tooth" },
|
|
2248
|
+
focusable: { type: Boolean, default: !0 },
|
|
2249
|
+
state: { default: "present" },
|
|
2250
|
+
stateLabel: { default: void 0 },
|
|
2251
|
+
description: { default: void 0 },
|
|
2252
|
+
number: { default: void 0 },
|
|
2253
|
+
spokenNumber: { default: void 0 }
|
|
2254
|
+
},
|
|
2255
|
+
emits: ["select", "mouseenter", "mouseleave", "focus", "blur", "navigate"],
|
|
2256
|
+
setup(t, { emit: e }) {
|
|
2257
|
+
const n = t, a = T(() => se.has(n.state)), o = T(
|
|
2258
|
+
() => [
|
|
2259
|
+
`${n.label} ${n.spokenNumber ?? n.number ?? n.tooth.id}`,
|
|
2260
|
+
n.state !== "present" ? n.stateLabel : void 0,
|
|
2261
|
+
n.description
|
|
2262
|
+
].filter(Boolean).join(", ")
|
|
2263
|
+
), s = e, r = T(
|
|
2264
|
+
() => {
|
|
2265
|
+
var h;
|
|
2266
|
+
return ((h = n.condition) == null ? void 0 : h.outlineColor) ?? (n.selected ? "var(--odontogram-selected-stroke-color, #b8c0cc)" : "currentColor");
|
|
2267
|
+
}
|
|
2268
|
+
), i = T(() => {
|
|
2269
|
+
var h;
|
|
2270
|
+
return ((h = n.condition) == null ? void 0 : h.fillColor) ?? "currentColor";
|
|
2271
|
+
}), l = T(() => {
|
|
2272
|
+
const h = [n.tooth.shape.transform, n.layoutTransform].filter(
|
|
2273
|
+
(c) => !!c
|
|
2274
|
+
);
|
|
2275
|
+
return h.length ? h.join(" ") : void 0;
|
|
2276
|
+
});
|
|
2277
|
+
function u() {
|
|
2278
|
+
n.disabled || s("select", n.tooth);
|
|
2279
|
+
}
|
|
2280
|
+
function d(h) {
|
|
2281
|
+
h.key === "Enter" || h.key === " " ? (h.preventDefault(), u()) : en.has(h.key) && (h.preventDefault(), s("navigate", n.tooth, h.key));
|
|
2282
|
+
}
|
|
2283
|
+
return (h, c) => (g(), y("g", {
|
|
2284
|
+
class: rt(["odontogram-tooth", {
|
|
2285
|
+
"odontogram-tooth--selected": t.selected,
|
|
2286
|
+
"odontogram-tooth--disabled": t.disabled,
|
|
2287
|
+
"odontogram-tooth--absent": a.value,
|
|
2288
|
+
[`odontogram-tooth--${t.state}`]: t.state !== "present"
|
|
2289
|
+
}]),
|
|
2290
|
+
role: t.disabled ? void 0 : "option",
|
|
2291
|
+
"aria-label": o.value,
|
|
2292
|
+
"data-tooth-state": t.state,
|
|
2293
|
+
"aria-selected": t.disabled ? void 0 : t.selected,
|
|
2294
|
+
"aria-disabled": t.disabled,
|
|
2295
|
+
tabindex: t.disabled || !t.focusable ? -1 : 0,
|
|
2296
|
+
"data-tooth-id": t.tooth.id,
|
|
2297
|
+
style: ht({ cursor: t.disabled ? "default" : "pointer", color: r.value }),
|
|
2298
|
+
transform: l.value,
|
|
2299
|
+
onClick: u,
|
|
2300
|
+
onKeydown: d,
|
|
2301
|
+
onMouseenter: c[0] || (c[0] = (m) => s("mouseenter", t.tooth, m)),
|
|
2302
|
+
onMouseleave: c[1] || (c[1] = (m) => s("mouseleave", t.tooth, m)),
|
|
2303
|
+
onFocus: c[2] || (c[2] = (m) => s("focus", t.tooth, m)),
|
|
2304
|
+
onBlur: c[3] || (c[3] = (m) => s("blur", t.tooth, m))
|
|
2305
|
+
}, [
|
|
2306
|
+
B("title", null, P(t.number ?? t.tooth.id), 1),
|
|
2307
|
+
B("path", {
|
|
2308
|
+
stroke: r.value,
|
|
2309
|
+
"stroke-width": "2",
|
|
2310
|
+
"stroke-linecap": "round",
|
|
2311
|
+
"stroke-linejoin": "round",
|
|
2312
|
+
"stroke-dasharray": a.value ? "4 3" : void 0,
|
|
2313
|
+
d: t.tooth.shape.outlinePath
|
|
2314
|
+
}, null, 8, _a),
|
|
2315
|
+
t.tooth.shape.shadowPath ? (g(), y("path", {
|
|
2316
|
+
key: 0,
|
|
2317
|
+
fill: i.value,
|
|
2318
|
+
d: t.tooth.shape.shadowPath,
|
|
2319
|
+
"data-colored": t.condition && !a.value ? "true" : void 0,
|
|
2320
|
+
style: ht({ opacity: t.condition && !a.value ? 1 : void 0 })
|
|
2321
|
+
}, null, 12, Fa)) : q("", !0),
|
|
2322
|
+
a.value ? (g(), y(Z, { key: 1 }, [], 64)) : Array.isArray(t.tooth.shape.lineHighlightPath) ? (g(!0), y(Z, { key: 2 }, O(t.tooth.shape.lineHighlightPath, (m) => (g(), y("path", {
|
|
2323
|
+
key: m,
|
|
2324
|
+
stroke: r.value,
|
|
2325
|
+
"stroke-linecap": "round",
|
|
2326
|
+
"stroke-linejoin": "round",
|
|
2327
|
+
d: m
|
|
2328
|
+
}, null, 8, La))), 128)) : t.tooth.shape.lineHighlightPath ? (g(), y("path", {
|
|
2329
|
+
key: 3,
|
|
2330
|
+
stroke: r.value,
|
|
2331
|
+
"stroke-linecap": "round",
|
|
2332
|
+
"stroke-linejoin": "round",
|
|
2333
|
+
d: t.tooth.shape.lineHighlightPath
|
|
2334
|
+
}, null, 8, za)) : q("", !0)
|
|
2335
|
+
], 46, Ba));
|
|
2336
|
+
}
|
|
2337
|
+
}), Da = ["aria-label", "aria-multiselectable", "aria-disabled"], Za = ["viewBox", "aria-label"], Ea = ["transform"], qa = {
|
|
2338
|
+
key: 0,
|
|
2339
|
+
class: "odontogram__state-marks",
|
|
2340
|
+
"aria-hidden": "true"
|
|
2341
|
+
}, Ha = ["data-mark-for", "stroke-width"], Ra = ["data-mark-for", "stroke-width"], Aa = ["x", "y", "width", "height", "rx"], Oa = {
|
|
2342
|
+
key: 2,
|
|
2343
|
+
class: "odontogram__findings",
|
|
2344
|
+
"aria-hidden": "true"
|
|
2345
|
+
}, Va = ["data-finding", "data-status", "data-teeth", "stroke-width", "stroke-dasharray"], ja = {
|
|
2346
|
+
key: 3,
|
|
2347
|
+
class: "odontogram__surface-letters",
|
|
2348
|
+
"aria-hidden": "true"
|
|
2349
|
+
}, Qa = ["data-letter-for", "x", "y", "font-size"], Wa = {
|
|
2350
|
+
key: 4,
|
|
2351
|
+
class: "odontogram__numbers",
|
|
2352
|
+
"aria-hidden": "true"
|
|
2353
|
+
}, Xa = ["data-number-for", "x", "y", "font-size"], Ka = ["data-corner-for", "d", "stroke-width"], Ua = {
|
|
2354
|
+
key: 5,
|
|
2355
|
+
class: "odontogram__overlay"
|
|
2356
|
+
}, Ga = ["aria-label", "data-menu-for"], Gs = /* @__PURE__ */ mt({
|
|
2357
|
+
__name: "Odontogram",
|
|
2358
|
+
props: {
|
|
2359
|
+
modelValue: { default: () => [] },
|
|
2360
|
+
dentition: { default: "permanent" },
|
|
2361
|
+
notation: { default: "FDI" },
|
|
2362
|
+
singleSelect: { type: Boolean, default: !1 },
|
|
2363
|
+
disabled: { type: Boolean, default: !1 },
|
|
2364
|
+
showLabels: { type: Boolean, default: !1 },
|
|
2365
|
+
showTooltip: { type: Boolean, default: !0 },
|
|
2366
|
+
conditions: { default: void 0 },
|
|
2367
|
+
layout: { default: "arch" },
|
|
2368
|
+
labels: { default: void 0 },
|
|
2369
|
+
showNumbers: { type: Boolean, default: !1 },
|
|
2370
|
+
showHalf: { default: "full" },
|
|
2371
|
+
toothStates: { default: void 0 },
|
|
2372
|
+
findings: { default: void 0 },
|
|
2373
|
+
findingCatalog: { default: () => St },
|
|
2374
|
+
showSurfaces: { type: Boolean, default: !1 },
|
|
2375
|
+
showSurfaceLetters: { type: Boolean, default: !1 },
|
|
2376
|
+
surfaceShape: { default: "square" },
|
|
2377
|
+
surfaces: { default: () => ({}) },
|
|
2378
|
+
teeth: { default: void 0 }
|
|
2379
|
+
},
|
|
2380
|
+
emits: ["update:modelValue", "change", "tooth-click", "update:surfaces", "surface-click"],
|
|
2381
|
+
setup(t, { emit: e }) {
|
|
2382
|
+
const n = t, a = e, {
|
|
2383
|
+
viewBox: o,
|
|
2384
|
+
viewBoxRect: s,
|
|
2385
|
+
quadrants: r,
|
|
2386
|
+
anchors: i,
|
|
2387
|
+
anchorList: l,
|
|
2388
|
+
numberLabels: u,
|
|
2389
|
+
surfaceDiagrams: d,
|
|
2390
|
+
findingLayout: h,
|
|
2391
|
+
findingsByTooth: c,
|
|
2392
|
+
conditionByTooth: m
|
|
2393
|
+
} = Wo({
|
|
2394
|
+
dentition: () => n.dentition,
|
|
2395
|
+
layout: () => n.layout,
|
|
2396
|
+
notation: () => n.notation,
|
|
2397
|
+
conditions: () => n.conditions,
|
|
2398
|
+
showHalf: () => n.showHalf,
|
|
2399
|
+
showNumbers: () => n.showNumbers,
|
|
2400
|
+
findings: () => n.findings,
|
|
2401
|
+
findingCatalog: () => n.findingCatalog,
|
|
2402
|
+
showSurfaces: () => n.showSurfaces,
|
|
2403
|
+
teeth: () => n.teeth,
|
|
2404
|
+
surfaceShape: () => n.surfaceShape
|
|
2405
|
+
});
|
|
2406
|
+
function p(x) {
|
|
2407
|
+
const { surfaceNames: $, findingStatuses: z } = U.value, H = ({ name: K, surfaces: tt, status: S }) => {
|
|
2408
|
+
const V = [
|
|
2409
|
+
...(tt ?? []).map((R) => $[wt(R, x)]),
|
|
2410
|
+
...S === "existing" ? [] : [z[S]]
|
|
2411
|
+
];
|
|
2412
|
+
return V.length ? `${K} (${V.join(", ")})` : K;
|
|
2413
|
+
};
|
|
2414
|
+
return [...new Set((c.value.get(x) ?? []).map(H))];
|
|
2415
|
+
}
|
|
2416
|
+
const b = T(() => {
|
|
2417
|
+
const x = /* @__PURE__ */ new Map();
|
|
2418
|
+
for (const $ of h.value.findings) {
|
|
2419
|
+
const z = [$.code, $.status, $.tone, $.color ?? ""].join(":");
|
|
2420
|
+
x.set(z, x.get(z) ?? $);
|
|
2421
|
+
}
|
|
2422
|
+
return [...x.entries()].map(([$, { code: z, name: H, status: K, tone: tt, color: S }]) => ({
|
|
2423
|
+
key: $,
|
|
2424
|
+
code: z,
|
|
2425
|
+
name: K === "existing" ? H : `${H} (${U.value.findingStatuses[K]})`,
|
|
2426
|
+
status: K,
|
|
2427
|
+
tone: tt,
|
|
2428
|
+
color: S,
|
|
2429
|
+
icon: jo(n.findingCatalog[z].symbol)
|
|
2430
|
+
}));
|
|
2431
|
+
});
|
|
2432
|
+
function C(x) {
|
|
2433
|
+
return re(n.toothStates, x);
|
|
2434
|
+
}
|
|
2435
|
+
function M(x) {
|
|
2436
|
+
return ft(x, n.notation);
|
|
2437
|
+
}
|
|
2438
|
+
function w(x) {
|
|
2439
|
+
return ft(x, n.notation, "text");
|
|
2440
|
+
}
|
|
2441
|
+
const k = T(
|
|
2442
|
+
() => n.showSurfaceLetters ? d.value.flatMap(
|
|
2443
|
+
(x) => x.surfaces.map(($) => ({
|
|
2444
|
+
key: `${x.toothId}:${$.surface}`,
|
|
2445
|
+
...je($),
|
|
2446
|
+
fontSize: x.size * 0.24,
|
|
2447
|
+
text: U.value.surfaceLetters[$.name]
|
|
2448
|
+
}))
|
|
2449
|
+
) : []
|
|
2450
|
+
), v = T(
|
|
2451
|
+
() => new Set(l.value.filter(({ toothId: x }) => se.has(C(x))).map(({ toothId: x }) => x))
|
|
2452
|
+
), f = T(
|
|
2453
|
+
() => new Map(r.value.flatMap(({ teeth: x }) => x.map(({ tooth: $ }) => [$.id, $])))
|
|
2454
|
+
);
|
|
2455
|
+
function I(x, $) {
|
|
2456
|
+
const z = zo(n.surfaces, x, $);
|
|
2457
|
+
a("update:surfaces", z), a("surface-click", f.value.get(x), $, z);
|
|
2458
|
+
}
|
|
2459
|
+
const E = dn(), F = et(), L = et(null), _ = et({ left: -9999, top: -9999 });
|
|
2460
|
+
function N(x, $, z) {
|
|
2461
|
+
if (!E["surface-menu"]) {
|
|
2462
|
+
I(x, $);
|
|
2463
|
+
return;
|
|
2464
|
+
}
|
|
2465
|
+
a("surface-click", f.value.get(x), $, n.surfaces), Dt(), F.value = { toothId: x, surface: $, element: z }, D();
|
|
2466
|
+
}
|
|
2467
|
+
async function D() {
|
|
2468
|
+
var at, dt;
|
|
2469
|
+
_.value = { left: -9999, top: -9999 }, await Rt();
|
|
2470
|
+
const x = L.value, $ = (at = F.value) == null ? void 0 : at.element;
|
|
2471
|
+
if (!x || !$)
|
|
2472
|
+
return;
|
|
2473
|
+
const z = 8, H = $.getBoundingClientRect(), { width: K, height: tt } = x.getBoundingClientRect(), S = (vt, cn) => Math.min(Math.max(vt, z), Math.max(z, cn)), V = H.bottom + z, R = V + tt > window.innerHeight - z ? H.top - tt - z : V;
|
|
2474
|
+
_.value = {
|
|
2475
|
+
left: S(H.left + H.width / 2 - K / 2, window.innerWidth - K - z),
|
|
2476
|
+
top: S(R, window.innerHeight - tt - z)
|
|
2477
|
+
}, (dt = x.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')) == null || dt.focus();
|
|
2478
|
+
}
|
|
2479
|
+
function Q(x = !0) {
|
|
2480
|
+
var z;
|
|
2481
|
+
const $ = (z = F.value) == null ? void 0 : z.element;
|
|
2482
|
+
F.value = void 0, x && ($ == null || $.focus());
|
|
2483
|
+
}
|
|
2484
|
+
const j = T(() => {
|
|
2485
|
+
const x = F.value;
|
|
2486
|
+
if (x)
|
|
2487
|
+
return {
|
|
2488
|
+
toothId: x.toothId,
|
|
2489
|
+
tooth: f.value.get(x.toothId),
|
|
2490
|
+
surface: x.surface,
|
|
2491
|
+
surfaceName: U.value.surfaceNames[wt(x.surface, x.toothId)],
|
|
2492
|
+
record: Bt(x.toothId, n.findings ?? [], n.findingCatalog),
|
|
2493
|
+
close: () => Q()
|
|
2494
|
+
};
|
|
2495
|
+
});
|
|
2496
|
+
function J(x) {
|
|
2497
|
+
var z;
|
|
2498
|
+
const $ = x.target;
|
|
2499
|
+
F.value && $ && !((z = L.value) != null && z.contains($)) && $ !== F.value.element && Q(!1);
|
|
2500
|
+
}
|
|
2501
|
+
function gt(x) {
|
|
2502
|
+
F.value && x.key === "Escape" && (x.preventDefault(), Q());
|
|
2503
|
+
}
|
|
2504
|
+
kt(
|
|
2505
|
+
() => !!F.value,
|
|
2506
|
+
(x) => {
|
|
2507
|
+
x ? (document.addEventListener("pointerdown", J, !0), document.addEventListener("keydown", gt)) : (document.removeEventListener("pointerdown", J, !0), document.removeEventListener("keydown", gt));
|
|
2508
|
+
}
|
|
2509
|
+
), kt(
|
|
2510
|
+
() => F.value && !d.value.some(({ toothId: x }) => x === F.value.toothId),
|
|
2511
|
+
(x) => x && Q(!1)
|
|
2512
|
+
), hn(() => {
|
|
2513
|
+
document.removeEventListener("pointerdown", J, !0), document.removeEventListener("keydown", gt);
|
|
2514
|
+
});
|
|
2515
|
+
const A = T(() => Jo(l.value, n.toothStates)), nt = T(() => {
|
|
2516
|
+
const x = new Set(l.value.map(({ toothId: $ }) => C($)));
|
|
2517
|
+
return Ko.filter(($) => $ !== "present" && x.has($)).map(($) => ({ state: $, label: U.value.states[$] }));
|
|
2518
|
+
}), it = et(null), ct = et(), zt = T(() => {
|
|
2519
|
+
var $;
|
|
2520
|
+
const x = i.value;
|
|
2521
|
+
return ct.value && x[ct.value] ? ct.value : n.modelValue.find((z) => x[z]) ?? (($ = l.value[0]) == null ? void 0 : $.toothId);
|
|
2522
|
+
});
|
|
2523
|
+
function Qt(x, $) {
|
|
2524
|
+
ct.value = x.id, Kt(x, $);
|
|
2525
|
+
}
|
|
2526
|
+
async function Wt(x, $) {
|
|
2527
|
+
var H, K;
|
|
2528
|
+
const z = nn(l.value, x.id, $);
|
|
2529
|
+
z && (ct.value = z, await Rt(), (K = (H = it.value) == null ? void 0 : H.querySelector(`[data-tooth-id="${z}"]`)) == null || K.focus());
|
|
2530
|
+
}
|
|
2531
|
+
const U = T(() => ae(n.labels)), Pt = T(() => U.value.chartTitles[n.dentition]), Y = et(), It = et(), Xt = et(), { isSelected: Nt, toggle: an } = Xo({
|
|
2532
|
+
modelValue: () => n.modelValue,
|
|
2533
|
+
singleSelect: () => n.singleSelect
|
|
2534
|
+
});
|
|
2535
|
+
function Kt(x, $) {
|
|
2536
|
+
const z = $.currentTarget;
|
|
2537
|
+
if (!(z instanceof SVGElement))
|
|
2538
|
+
return;
|
|
2539
|
+
const H = z.getBoundingClientRect();
|
|
2540
|
+
Y.value = x, It.value = void 0, Xt.value = {
|
|
2541
|
+
top: H.top,
|
|
2542
|
+
right: H.right,
|
|
2543
|
+
bottom: H.bottom,
|
|
2544
|
+
left: H.left
|
|
2545
|
+
};
|
|
2546
|
+
}
|
|
2547
|
+
function Dt() {
|
|
2548
|
+
Y.value = void 0, It.value = void 0, Xt.value = void 0;
|
|
2549
|
+
}
|
|
2550
|
+
function sn(x, $, z) {
|
|
2551
|
+
const H = f.value.get(x);
|
|
2552
|
+
H && (Kt(H, z), It.value = $);
|
|
2553
|
+
}
|
|
2554
|
+
const Ut = T(() => {
|
|
2555
|
+
const x = Y.value;
|
|
2556
|
+
if (!x || It.value)
|
|
2557
|
+
return;
|
|
2558
|
+
const { surfaceNames: $, surfaceLetters: z, findingStatuses: H } = U.value, K = ({ finding: R, definition: at }) => {
|
|
2559
|
+
const dt = R.status ?? "existing", vt = (at == null ? void 0 : at.name) ?? R.code;
|
|
2560
|
+
return dt === "existing" ? vt : `${vt} (${H[dt]})`;
|
|
2561
|
+
}, tt = Bt(x.id, n.findings ?? [], n.findingCatalog), S = G.filter((R) => tt.surfaces[R].length).map((R) => {
|
|
2562
|
+
const at = wt(R, x.id);
|
|
2563
|
+
return {
|
|
2564
|
+
surface: R,
|
|
2565
|
+
letter: z[at],
|
|
2566
|
+
name: $[at],
|
|
2567
|
+
findings: [...new Set(tt.surfaces[R].map(K))]
|
|
2568
|
+
};
|
|
2569
|
+
}), V = [
|
|
2570
|
+
...new Set(
|
|
2571
|
+
(c.value.get(x.id) ?? []).filter(({ surfaces: R }) => !R).map(
|
|
2572
|
+
(R) => R.status === "existing" ? R.name : `${R.name} (${H[R.status]})`
|
|
2573
|
+
)
|
|
2574
|
+
)
|
|
2575
|
+
];
|
|
2576
|
+
return { summary: S, findings: V };
|
|
2577
|
+
}), yt = T(() => {
|
|
2578
|
+
var V;
|
|
2579
|
+
const x = Y.value, $ = It.value;
|
|
2580
|
+
if (!x || !$)
|
|
2581
|
+
return;
|
|
2582
|
+
const { surfaceNames: z, surfaceDescriptions: H, findingStatuses: K } = U.value, tt = wt($, x.id), S = Bt(x.id, n.findings ?? [], n.findingCatalog).surfaces[$].map(
|
|
2583
|
+
({ finding: R, definition: at }) => {
|
|
2584
|
+
const dt = R.status ?? "existing", vt = (at == null ? void 0 : at.name) ?? R.code;
|
|
2585
|
+
return dt === "existing" ? vt : `${vt} (${K[dt]})`;
|
|
2586
|
+
}
|
|
2587
|
+
);
|
|
2588
|
+
return {
|
|
2589
|
+
surface: $,
|
|
2590
|
+
name: z[tt],
|
|
2591
|
+
description: H[tt],
|
|
2592
|
+
findings: [...new Set(S)],
|
|
2593
|
+
selected: ((V = n.surfaces[x.id]) == null ? void 0 : V.includes($)) ?? !1
|
|
2594
|
+
};
|
|
2595
|
+
});
|
|
2596
|
+
function rn(x) {
|
|
2597
|
+
const $ = an(x.id);
|
|
2598
|
+
a("update:modelValue", $), a("change", $), a("tooth-click", x, $);
|
|
2599
|
+
}
|
|
2600
|
+
return (x, $) => {
|
|
2601
|
+
var z, H, K, tt;
|
|
2602
|
+
return g(), y("div", {
|
|
2603
|
+
class: "odontogram",
|
|
2604
|
+
role: "listbox",
|
|
2605
|
+
"aria-label": U.value.odontogram,
|
|
2606
|
+
"aria-multiselectable": !t.singleSelect,
|
|
2607
|
+
"aria-disabled": t.disabled
|
|
2608
|
+
}, [
|
|
2609
|
+
(g(), y("svg", {
|
|
2610
|
+
ref_key: "svgElement",
|
|
2611
|
+
ref: it,
|
|
2612
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2613
|
+
fill: "none",
|
|
2614
|
+
viewBox: X(o),
|
|
2615
|
+
class: "odontogram__svg",
|
|
2616
|
+
"aria-label": Pt.value
|
|
2617
|
+
}, [
|
|
2618
|
+
B("title", null, P(Pt.value), 1),
|
|
2619
|
+
(g(!0), y(Z, null, O(X(r), (S) => (g(), y("g", {
|
|
2620
|
+
key: S.quadrant,
|
|
2621
|
+
transform: S.transform
|
|
2622
|
+
}, [
|
|
2623
|
+
(g(!0), y(Z, null, O(S.teeth, ({ tooth: V, transform: R }) => (g(), Zt(Na, {
|
|
2624
|
+
key: V.id,
|
|
2625
|
+
tooth: V,
|
|
2626
|
+
selected: X(Nt)(V.id),
|
|
2627
|
+
disabled: t.disabled,
|
|
2628
|
+
condition: X(m).get(V.id),
|
|
2629
|
+
"layout-transform": R,
|
|
2630
|
+
label: U.value.tooth,
|
|
2631
|
+
focusable: V.id === zt.value,
|
|
2632
|
+
state: C(V.id),
|
|
2633
|
+
"state-label": U.value.states[C(V.id)],
|
|
2634
|
+
description: p(V.id).join(", ") || void 0,
|
|
2635
|
+
number: M(V.id),
|
|
2636
|
+
"spoken-number": w(V.id),
|
|
2637
|
+
onSelect: rn,
|
|
2638
|
+
onMouseenter: Kt,
|
|
2639
|
+
onMouseleave: Dt,
|
|
2640
|
+
onFocus: Qt,
|
|
2641
|
+
onBlur: Dt,
|
|
2642
|
+
onNavigate: Wt
|
|
2643
|
+
}, null, 8, ["tooth", "selected", "disabled", "condition", "layout-transform", "label", "focusable", "state", "state-label", "description", "number", "spoken-number"]))), 128))
|
|
2644
|
+
], 8, Ea))), 128)),
|
|
2645
|
+
A.value.length ? (g(), y("g", qa, [
|
|
2646
|
+
(g(!0), y(Z, null, O(A.value, (S) => (g(), y(Z, {
|
|
2647
|
+
key: S.toothId
|
|
2648
|
+
}, [
|
|
2649
|
+
S.kind === "cross" ? (g(), y("g", {
|
|
2650
|
+
key: 0,
|
|
2651
|
+
class: "odontogram-state-mark--cross",
|
|
2652
|
+
"data-mark-for": S.toothId,
|
|
2653
|
+
"stroke-width": S.strokeWidth
|
|
2654
|
+
}, [
|
|
2655
|
+
(g(!0), y(Z, null, O(S.lines, (V, R) => (g(), y("line", le({ key: R }, { ref_for: !0 }, V), null, 16))), 128))
|
|
2656
|
+
], 8, Ha)) : (g(), y("g", {
|
|
2657
|
+
key: 1,
|
|
2658
|
+
class: "odontogram-state-mark--implant",
|
|
2659
|
+
"data-mark-for": S.toothId,
|
|
2660
|
+
"stroke-width": S.strokeWidth
|
|
2661
|
+
}, [
|
|
2662
|
+
B("rect", {
|
|
2663
|
+
x: S.body.x,
|
|
2664
|
+
y: S.body.y,
|
|
2665
|
+
width: S.body.width,
|
|
2666
|
+
height: S.body.height,
|
|
2667
|
+
rx: S.body.width / 4
|
|
2668
|
+
}, null, 8, Aa),
|
|
2669
|
+
(g(!0), y(Z, null, O(S.threads, (V, R) => (g(), y("line", le({ key: R }, { ref_for: !0 }, V), null, 16))), 128))
|
|
2670
|
+
], 8, Ra))
|
|
2671
|
+
], 64))), 128))
|
|
2672
|
+
])) : q("", !0),
|
|
2673
|
+
X(d).length ? (g(), Zt(Ta, {
|
|
2674
|
+
key: 1,
|
|
2675
|
+
diagrams: X(d),
|
|
2676
|
+
anchors: X(l),
|
|
2677
|
+
surfaces: t.surfaces,
|
|
2678
|
+
disabled: t.disabled,
|
|
2679
|
+
"inactive-teeth": v.value,
|
|
2680
|
+
labels: U.value,
|
|
2681
|
+
"spoken-number": w,
|
|
2682
|
+
menu: !!x.$slots["surface-menu"],
|
|
2683
|
+
"open-menu": F.value,
|
|
2684
|
+
onActivate: N,
|
|
2685
|
+
onEnter: sn,
|
|
2686
|
+
onLeave: Dt
|
|
2687
|
+
}, null, 8, ["diagrams", "anchors", "surfaces", "disabled", "inactive-teeth", "labels", "menu", "open-menu"])) : q("", !0),
|
|
2688
|
+
X(h).findings.length ? (g(), y("g", Oa, [
|
|
2689
|
+
(g(!0), y(Z, null, O(X(h).findings, (S) => (g(), y("g", {
|
|
2690
|
+
key: S.key,
|
|
2691
|
+
class: rt(["odontogram-finding", [`odontogram-finding--${S.tone}`, `odontogram-finding--${S.status}`]]),
|
|
2692
|
+
style: ht(S.color ? { color: S.color } : void 0),
|
|
2693
|
+
"data-finding": S.code,
|
|
2694
|
+
"data-status": S.status,
|
|
2695
|
+
"data-teeth": S.teeth.join(" "),
|
|
2696
|
+
"stroke-width": S.strokeWidth,
|
|
2697
|
+
"stroke-dasharray": S.status === "planned" ? `${S.strokeWidth * 2} ${S.strokeWidth * 1.6}` : void 0
|
|
2698
|
+
}, [
|
|
2699
|
+
jt(ie, {
|
|
2700
|
+
primitives: S.primitives
|
|
2701
|
+
}, null, 8, ["primitives"])
|
|
2702
|
+
], 14, Va))), 128))
|
|
2703
|
+
])) : q("", !0),
|
|
2704
|
+
k.value.length ? (g(), y("g", ja, [
|
|
2705
|
+
(g(!0), y(Z, null, O(k.value, (S) => (g(), y("text", {
|
|
2706
|
+
key: S.key,
|
|
2707
|
+
class: "odontogram__surface-letter",
|
|
2708
|
+
"data-letter-for": S.key,
|
|
2709
|
+
x: S.x,
|
|
2710
|
+
y: S.y,
|
|
2711
|
+
"font-size": S.fontSize,
|
|
2712
|
+
"text-anchor": "middle",
|
|
2713
|
+
"dominant-baseline": "central"
|
|
2714
|
+
}, P(S.text), 9, Qa))), 128))
|
|
2715
|
+
])) : q("", !0),
|
|
2716
|
+
X(u).length ? (g(), y("g", Wa, [
|
|
2717
|
+
(g(!0), y(Z, null, O(X(u), (S) => (g(), y(Z, {
|
|
2718
|
+
key: S.toothId
|
|
2719
|
+
}, [
|
|
2720
|
+
B("text", {
|
|
2721
|
+
class: rt(["odontogram__number", { "odontogram__number--selected": X(Nt)(S.toothId) }]),
|
|
2722
|
+
"data-number-for": S.toothId,
|
|
2723
|
+
x: S.x,
|
|
2724
|
+
y: S.y,
|
|
2725
|
+
"font-size": S.fontSize,
|
|
2726
|
+
"text-anchor": "middle",
|
|
2727
|
+
"dominant-baseline": "central"
|
|
2728
|
+
}, P(S.text), 11, Xa),
|
|
2729
|
+
S.corner ? (g(), y("path", {
|
|
2730
|
+
key: 0,
|
|
2731
|
+
class: rt(["odontogram__number-corner", { "odontogram__number-corner--selected": X(Nt)(S.toothId) }]),
|
|
2732
|
+
"data-corner-for": S.toothId,
|
|
2733
|
+
d: S.corner,
|
|
2734
|
+
"stroke-width": S.fontSize * 0.08
|
|
2735
|
+
}, null, 10, Ka)) : q("", !0)
|
|
2736
|
+
], 64))), 128))
|
|
2737
|
+
])) : q("", !0),
|
|
2738
|
+
x.$slots.overlay ? (g(), y("g", Ua, [
|
|
2739
|
+
Ht(x.$slots, "overlay", {
|
|
2740
|
+
anchors: X(i),
|
|
2741
|
+
viewBox: X(s),
|
|
2742
|
+
dentition: t.dentition,
|
|
2743
|
+
layout: t.layout,
|
|
2744
|
+
surfaceDiagrams: X(d)
|
|
2745
|
+
})
|
|
2746
|
+
])) : q("", !0)
|
|
2747
|
+
], 8, Za)),
|
|
2748
|
+
t.showTooltip ? (g(), Zt($a, {
|
|
2749
|
+
key: 0,
|
|
2750
|
+
active: !!Y.value && !F.value,
|
|
2751
|
+
tooth: Y.value,
|
|
2752
|
+
selected: yt.value ? yt.value.selected : Y.value ? X(Nt)(Y.value.id) : !1,
|
|
2753
|
+
condition: Y.value ? X(m).get(Y.value.id) : void 0,
|
|
2754
|
+
state: Y.value ? C(Y.value.id) : "present",
|
|
2755
|
+
findings: yt.value ? yt.value.findings : Ut.value ? Ut.value.findings : [],
|
|
2756
|
+
number: Y.value ? M(Y.value.id) : void 0,
|
|
2757
|
+
surface: (z = yt.value) == null ? void 0 : z.surface,
|
|
2758
|
+
"surface-name": (H = yt.value) == null ? void 0 : H.name,
|
|
2759
|
+
"surface-description": (K = yt.value) == null ? void 0 : K.description,
|
|
2760
|
+
"surface-summary": ((tt = Ut.value) == null ? void 0 : tt.summary) ?? [],
|
|
2761
|
+
"anchor-rect": Xt.value,
|
|
2762
|
+
labels: U.value
|
|
2763
|
+
}, fn({ _: 2 }, [
|
|
2764
|
+
x.$slots.tooltip ? {
|
|
2765
|
+
name: "default",
|
|
2766
|
+
fn: mn((S) => [
|
|
2767
|
+
Ht(x.$slots, "tooltip", ue(de(S)))
|
|
2768
|
+
]),
|
|
2769
|
+
key: "0"
|
|
2770
|
+
} : void 0
|
|
2771
|
+
]), 1032, ["active", "tooth", "selected", "condition", "state", "findings", "number", "surface", "surface-name", "surface-description", "surface-summary", "anchor-rect", "labels"])) : q("", !0),
|
|
2772
|
+
j.value && x.$slots["surface-menu"] ? (g(), y("div", {
|
|
2773
|
+
key: 1,
|
|
2774
|
+
ref_key: "surfaceMenuElement",
|
|
2775
|
+
ref: L,
|
|
2776
|
+
class: "odontogram-surface-menu",
|
|
2777
|
+
role: "dialog",
|
|
2778
|
+
"aria-label": `${U.value.surfaceMenu}: ${U.value.tooth} ${w(j.value.toothId)}, ${j.value.surfaceName}`,
|
|
2779
|
+
"data-menu-for": `${j.value.toothId}:${j.value.surface}`,
|
|
2780
|
+
style: ht({
|
|
2781
|
+
position: "fixed",
|
|
2782
|
+
left: `${_.value.left}px`,
|
|
2783
|
+
top: `${_.value.top}px`,
|
|
2784
|
+
opacity: _.value.left === -9999 ? 0 : 1
|
|
2785
|
+
})
|
|
2786
|
+
}, [
|
|
2787
|
+
Ht(x.$slots, "surface-menu", ue(de(j.value)))
|
|
2788
|
+
], 12, Ga)) : q("", !0),
|
|
2789
|
+
t.showLabels ? (g(), Zt(ya, {
|
|
2790
|
+
key: 2,
|
|
2791
|
+
conditions: t.conditions,
|
|
2792
|
+
states: nt.value,
|
|
2793
|
+
findings: b.value,
|
|
2794
|
+
"aria-label": U.value.legend
|
|
2795
|
+
}, null, 8, ["conditions", "states", "findings", "aria-label"])) : q("", !0)
|
|
2796
|
+
], 8, Da);
|
|
2797
|
+
};
|
|
2798
|
+
}
|
|
2799
|
+
}), Ya = ["aria-label", "data-tooth-id"], Ja = { class: "odontogram-surface-guide__title" }, ts = ["d", "stroke-width", "data-guide-surface", "onMouseenter", "onClick"], es = { class: "odontogram-surface-guide__findings" }, ns = ["stroke-width", "data-finding"], os = ["d", "data-highlight"], as = ["x", "y"], ss = {
|
|
2800
|
+
key: 0,
|
|
2801
|
+
class: "odontogram-surface-guide__list"
|
|
2802
|
+
}, rs = ["aria-pressed", "disabled", "data-guide-item", "onMouseenter", "onFocus", "onClick"], is = {
|
|
2803
|
+
class: "odontogram-surface-guide__badge",
|
|
2804
|
+
"aria-hidden": "true"
|
|
2805
|
+
}, cs = { class: "odontogram-surface-guide__text" }, ls = {
|
|
2806
|
+
key: 0,
|
|
2807
|
+
class: "odontogram-surface-guide__findings-text"
|
|
2808
|
+
}, us = 84, ds = /* @__PURE__ */ mt({
|
|
2809
|
+
__name: "SurfaceGuide",
|
|
2810
|
+
props: {
|
|
2811
|
+
toothId: {},
|
|
2812
|
+
findings: { default: () => [] },
|
|
2813
|
+
findingCatalog: { default: () => St },
|
|
2814
|
+
selected: { default: () => [] },
|
|
2815
|
+
active: { default: void 0 },
|
|
2816
|
+
labels: { default: void 0 },
|
|
2817
|
+
notation: { default: "FDI" },
|
|
2818
|
+
disabled: { type: Boolean, default: !1 },
|
|
2819
|
+
shape: { default: "square" },
|
|
2820
|
+
showList: { type: Boolean, default: !0 }
|
|
2821
|
+
},
|
|
2822
|
+
emits: ["surface-click", "update:active"],
|
|
2823
|
+
setup(t, { emit: e }) {
|
|
2824
|
+
const n = t, a = e, o = { x: 50, y: 50 }, s = T(() => ae(n.labels)), r = T(() => ft(n.toothId, n.notation)), i = T(() => ft(n.toothId, n.notation, "text")), l = T(
|
|
2825
|
+
() => Ve(n.toothId, o, Po(n.toothId), us, 1.2, n.shape)
|
|
2826
|
+
), u = T(
|
|
2827
|
+
() => Vo(n.findings, n.findingCatalog, l.value)
|
|
2828
|
+
), d = T(() => Bt(n.toothId, n.findings, n.findingCatalog));
|
|
2829
|
+
function h(k) {
|
|
2830
|
+
const { findingStatuses: v } = s.value;
|
|
2831
|
+
return d.value.surfaces[k].map(({ finding: f, definition: I }) => {
|
|
2832
|
+
const E = (I == null ? void 0 : I.name) ?? f.code, F = f.status ?? "existing";
|
|
2833
|
+
return F === "existing" ? E : `${E} (${v[F]})`;
|
|
2834
|
+
});
|
|
2835
|
+
}
|
|
2836
|
+
const c = et(), m = T(() => c.value ?? n.active);
|
|
2837
|
+
function p(k) {
|
|
2838
|
+
c.value = k, a("update:active", k);
|
|
2839
|
+
}
|
|
2840
|
+
function b(k) {
|
|
2841
|
+
n.disabled || a("surface-click", k);
|
|
2842
|
+
}
|
|
2843
|
+
const C = T(
|
|
2844
|
+
() => l.value.surfaces.map((k) => ({
|
|
2845
|
+
...k,
|
|
2846
|
+
center: je(k),
|
|
2847
|
+
letter: s.value.surfaceLetters[k.name]
|
|
2848
|
+
}))
|
|
2849
|
+
), M = T(() => C.value.find(({ surface: k }) => k === m.value)), w = T(
|
|
2850
|
+
() => G.map((k) => {
|
|
2851
|
+
const { name: v, letter: f } = C.value.find((I) => I.surface === k);
|
|
2852
|
+
return {
|
|
2853
|
+
surface: k,
|
|
2854
|
+
letter: f,
|
|
2855
|
+
name: s.value.surfaceNames[v],
|
|
2856
|
+
description: s.value.surfaceDescriptions[v],
|
|
2857
|
+
findings: h(k),
|
|
2858
|
+
selected: n.selected.includes(k)
|
|
2859
|
+
};
|
|
2860
|
+
})
|
|
2861
|
+
);
|
|
2862
|
+
return (k, v) => (g(), y("section", {
|
|
2863
|
+
class: "odontogram-surface-guide",
|
|
2864
|
+
"aria-label": `${s.value.surfaceGuide}, ${s.value.tooth} ${i.value}`,
|
|
2865
|
+
"data-tooth-id": t.toothId
|
|
2866
|
+
}, [
|
|
2867
|
+
B("p", Ja, P(s.value.tooth) + " " + P(r.value), 1),
|
|
2868
|
+
(g(), y("svg", {
|
|
2869
|
+
class: "odontogram-surface-guide__diagram",
|
|
2870
|
+
viewBox: "0 0 100 100",
|
|
2871
|
+
fill: "none",
|
|
2872
|
+
"aria-hidden": "true",
|
|
2873
|
+
onMouseleave: v[0] || (v[0] = (f) => p(void 0))
|
|
2874
|
+
}, [
|
|
2875
|
+
(g(!0), y(Z, null, O(C.value, (f) => (g(), y("path", {
|
|
2876
|
+
key: f.surface,
|
|
2877
|
+
class: rt(["odontogram-surface", { "odontogram-surface--selected": t.selected.includes(f.surface) }]),
|
|
2878
|
+
d: f.d,
|
|
2879
|
+
"stroke-width": l.value.strokeWidth,
|
|
2880
|
+
"data-guide-surface": f.surface,
|
|
2881
|
+
onMouseenter: (I) => p(f.surface),
|
|
2882
|
+
onClick: (I) => b(f.surface)
|
|
2883
|
+
}, null, 42, ts))), 128)),
|
|
2884
|
+
B("g", es, [
|
|
2885
|
+
(g(!0), y(Z, null, O(u.value, (f) => (g(), y("g", {
|
|
2886
|
+
key: f.key,
|
|
2887
|
+
class: rt(["odontogram-finding", [`odontogram-finding--${f.tone}`, `odontogram-finding--${f.status}`]]),
|
|
2888
|
+
style: ht(f.color ? { color: f.color } : void 0),
|
|
2889
|
+
"stroke-width": f.strokeWidth,
|
|
2890
|
+
"data-finding": f.code
|
|
2891
|
+
}, [
|
|
2892
|
+
jt(ie, {
|
|
2893
|
+
primitives: f.primitives
|
|
2894
|
+
}, null, 8, ["primitives"])
|
|
2895
|
+
], 14, ns))), 128))
|
|
2896
|
+
]),
|
|
2897
|
+
M.value ? (g(), y("path", {
|
|
2898
|
+
key: 0,
|
|
2899
|
+
class: "odontogram-surface-guide__highlight",
|
|
2900
|
+
d: M.value.d,
|
|
2901
|
+
"data-highlight": M.value.surface
|
|
2902
|
+
}, null, 8, os)) : q("", !0),
|
|
2903
|
+
(g(!0), y(Z, null, O(C.value, (f) => (g(), y("text", {
|
|
2904
|
+
key: `letter-${f.surface}`,
|
|
2905
|
+
class: rt(["odontogram-surface-guide__letter", { "odontogram-surface-guide__letter--active": f.surface === m.value }]),
|
|
2906
|
+
x: f.center.x,
|
|
2907
|
+
y: f.center.y,
|
|
2908
|
+
"text-anchor": "middle",
|
|
2909
|
+
"dominant-baseline": "central"
|
|
2910
|
+
}, P(f.letter), 11, as))), 128))
|
|
2911
|
+
], 32)),
|
|
2912
|
+
t.showList ? (g(), y("ul", ss, [
|
|
2913
|
+
(g(!0), y(Z, null, O(w.value, (f) => (g(), y("li", {
|
|
2914
|
+
key: f.surface
|
|
2915
|
+
}, [
|
|
2916
|
+
B("button", {
|
|
2917
|
+
type: "button",
|
|
2918
|
+
class: rt(["odontogram-surface-guide__item", { "odontogram-surface-guide__item--active": f.surface === m.value }]),
|
|
2919
|
+
"aria-pressed": f.selected,
|
|
2920
|
+
disabled: t.disabled,
|
|
2921
|
+
"data-guide-item": f.surface,
|
|
2922
|
+
onMouseenter: (I) => p(f.surface),
|
|
2923
|
+
onMouseleave: v[1] || (v[1] = (I) => p(void 0)),
|
|
2924
|
+
onFocus: (I) => p(f.surface),
|
|
2925
|
+
onBlur: v[2] || (v[2] = (I) => p(void 0)),
|
|
2926
|
+
onClick: (I) => b(f.surface)
|
|
2927
|
+
}, [
|
|
2928
|
+
B("span", is, P(f.letter), 1),
|
|
2929
|
+
B("span", cs, [
|
|
2930
|
+
B("strong", null, P(f.name), 1),
|
|
2931
|
+
B("span", null, P(f.description), 1),
|
|
2932
|
+
f.findings.length ? (g(), y("span", ls, P(s.value.findings) + ": " + P(f.findings.join(", ")), 1)) : q("", !0)
|
|
2933
|
+
])
|
|
2934
|
+
], 42, rs)
|
|
2935
|
+
]))), 128))
|
|
2936
|
+
])) : q("", !0)
|
|
2937
|
+
], 8, Ya));
|
|
2938
|
+
}
|
|
2939
|
+
}), hs = ["existing", "planned", "done"], fs = ["aria-label", "data-tooth-id"], ms = { class: "odontogram-inspector__header" }, gs = { class: "odontogram-inspector__title" }, ys = { class: "odontogram-inspector__type" }, vs = ["data-state"], ps = { class: "odontogram-inspector__body" }, xs = { class: "odontogram-inspector__details" }, ws = { class: "odontogram-inspector__section" }, bs = { class: "odontogram-inspector__heading" }, Ms = {
|
|
2940
|
+
key: 0,
|
|
2941
|
+
class: "odontogram-inspector__list"
|
|
2942
|
+
}, Cs = ["data-inspector-surface"], ks = {
|
|
2943
|
+
class: "odontogram-inspector__badge",
|
|
2944
|
+
"aria-hidden": "true"
|
|
2945
|
+
}, $s = { class: "odontogram-inspector__surface-name" }, Ss = { class: "odontogram-inspector__entries" }, Ps = ["aria-label", "onClick"], Is = {
|
|
2946
|
+
key: 1,
|
|
2947
|
+
class: "odontogram-inspector__empty"
|
|
2948
|
+
}, Ts = { class: "odontogram-inspector__section" }, Bs = { class: "odontogram-inspector__heading" }, _s = {
|
|
2949
|
+
key: 0,
|
|
2950
|
+
class: "odontogram-inspector__list"
|
|
2951
|
+
}, Fs = { class: "odontogram-inspector__entry" }, Ls = ["aria-label", "onClick"], zs = {
|
|
2952
|
+
key: 1,
|
|
2953
|
+
class: "odontogram-inspector__empty"
|
|
2954
|
+
}, Ns = { class: "odontogram-inspector__heading" }, Ds = { class: "odontogram-inspector__field" }, Zs = ["label"], Es = ["value"], qs = ["label"], Hs = ["value"], Rs = {
|
|
2955
|
+
key: 0,
|
|
2956
|
+
class: "odontogram-inspector__hint",
|
|
2957
|
+
"data-inspector-chosen": ""
|
|
2958
|
+
}, As = { class: "odontogram-inspector__status" }, Os = ["value"], Vs = ["disabled"], Ys = /* @__PURE__ */ mt({
|
|
2959
|
+
__name: "ToothInspector",
|
|
2960
|
+
props: {
|
|
2961
|
+
toothId: {},
|
|
2962
|
+
findings: { default: () => [] },
|
|
2963
|
+
findingCatalog: { default: () => St },
|
|
2964
|
+
toothStates: { default: void 0 },
|
|
2965
|
+
labels: { default: void 0 },
|
|
2966
|
+
notation: { default: "FDI" },
|
|
2967
|
+
shape: { default: "square" },
|
|
2968
|
+
disabled: { type: Boolean, default: !1 },
|
|
2969
|
+
selectedSurfaces: { default: void 0 }
|
|
2970
|
+
},
|
|
2971
|
+
emits: ["add-finding", "remove-finding", "update:selectedSurfaces"],
|
|
2972
|
+
setup(t, { emit: e }) {
|
|
2973
|
+
var F, L;
|
|
2974
|
+
const n = t, a = e, o = T(() => ae(n.labels)), s = T(() => ft(n.toothId, n.notation)), r = T(() => ft(n.toothId, n.notation, "text")), i = T(() => {
|
|
2975
|
+
const _ = Wn(n.toothId);
|
|
2976
|
+
return o.value.toothTypes[_] ?? _;
|
|
2977
|
+
}), l = T(() => re(n.toothStates, n.toothId)), u = T(() => se.has(l.value)), d = T(() => Bt(n.toothId, n.findings, n.findingCatalog)), h = T(
|
|
2978
|
+
() => G.filter((_) => d.value.surfaces[_].length).map((_) => {
|
|
2979
|
+
const N = wt(_, n.toothId);
|
|
2980
|
+
return {
|
|
2981
|
+
surface: _,
|
|
2982
|
+
name: o.value.surfaceNames[N],
|
|
2983
|
+
letter: o.value.surfaceLetters[N],
|
|
2984
|
+
entries: d.value.surfaces[_]
|
|
2985
|
+
};
|
|
2986
|
+
})
|
|
2987
|
+
);
|
|
2988
|
+
function c({ finding: _, definition: N }) {
|
|
2989
|
+
const D = _.status ?? "existing", Q = (N == null ? void 0 : N.name) ?? _.code;
|
|
2990
|
+
return D === "existing" ? Q : `${Q} (${o.value.findingStatuses[D]})`;
|
|
2991
|
+
}
|
|
2992
|
+
function m({ scope: _, finding: N }) {
|
|
2993
|
+
return (_ === "tooth" || _ === "unknown") && N.teeth.includes(n.toothId);
|
|
2994
|
+
}
|
|
2995
|
+
const p = T(() => {
|
|
2996
|
+
const _ = Object.entries(n.findingCatalog).map(([N, D]) => ({
|
|
2997
|
+
code: N,
|
|
2998
|
+
name: D.name,
|
|
2999
|
+
scope: Ct(D.symbol)
|
|
3000
|
+
}));
|
|
3001
|
+
return {
|
|
3002
|
+
surface: _.filter(({ scope: N }) => N === "surface"),
|
|
3003
|
+
tooth: _.filter(({ scope: N }) => N === "tooth")
|
|
3004
|
+
};
|
|
3005
|
+
}), b = et(((F = p.value.surface[0]) == null ? void 0 : F.code) ?? ((L = p.value.tooth[0]) == null ? void 0 : L.code) ?? ""), C = et("existing"), M = et([]), w = T({
|
|
3006
|
+
get: () => n.selectedSurfaces ?? M.value,
|
|
3007
|
+
set: (_) => {
|
|
3008
|
+
M.value = _, a("update:selectedSurfaces", _);
|
|
3009
|
+
}
|
|
3010
|
+
});
|
|
3011
|
+
kt(
|
|
3012
|
+
() => n.toothId,
|
|
3013
|
+
() => {
|
|
3014
|
+
M.value = [];
|
|
3015
|
+
}
|
|
3016
|
+
);
|
|
3017
|
+
const k = T(() => p.value.surface.some((_) => _.code === b.value)), v = T(
|
|
3018
|
+
() => !n.disabled && !!b.value && (!k.value || w.value.length > 0 && !u.value)
|
|
3019
|
+
);
|
|
3020
|
+
function f(_) {
|
|
3021
|
+
w.value = w.value.includes(_) ? w.value.filter((N) => N !== _) : G.filter((N) => N === _ || w.value.includes(N));
|
|
3022
|
+
}
|
|
3023
|
+
function I() {
|
|
3024
|
+
v.value && (a("add-finding", {
|
|
3025
|
+
code: b.value,
|
|
3026
|
+
toothId: n.toothId,
|
|
3027
|
+
...k.value ? { surfaces: [...w.value] } : {},
|
|
3028
|
+
...C.value === "existing" ? {} : { status: C.value }
|
|
3029
|
+
}), w.value = []);
|
|
3030
|
+
}
|
|
3031
|
+
function E(_, N) {
|
|
3032
|
+
n.disabled || a("remove-finding", { index: _.index, toothId: n.toothId, ...N ? { surface: N } : {} });
|
|
3033
|
+
}
|
|
3034
|
+
return (_, N) => (g(), y("section", {
|
|
3035
|
+
class: "odontogram-inspector",
|
|
3036
|
+
"aria-label": `${o.value.inspector.title}, ${o.value.tooth} ${r.value}`,
|
|
3037
|
+
"data-tooth-id": t.toothId
|
|
3038
|
+
}, [
|
|
3039
|
+
B("div", ms, [
|
|
3040
|
+
B("strong", gs, P(o.value.tooth) + " " + P(s.value), 1),
|
|
3041
|
+
B("span", ys, P(i.value), 1),
|
|
3042
|
+
l.value !== "present" ? (g(), y("span", {
|
|
3043
|
+
key: 0,
|
|
3044
|
+
class: "odontogram-inspector__state",
|
|
3045
|
+
"data-state": l.value
|
|
3046
|
+
}, P(o.value.states[l.value]), 9, vs)) : q("", !0)
|
|
3047
|
+
]),
|
|
3048
|
+
B("div", ps, [
|
|
3049
|
+
jt(ds, {
|
|
3050
|
+
class: "odontogram-inspector__guide",
|
|
3051
|
+
"tooth-id": t.toothId,
|
|
3052
|
+
findings: t.findings,
|
|
3053
|
+
"finding-catalog": t.findingCatalog,
|
|
3054
|
+
selected: w.value,
|
|
3055
|
+
labels: t.labels,
|
|
3056
|
+
notation: t.notation,
|
|
3057
|
+
shape: t.shape,
|
|
3058
|
+
disabled: t.disabled || u.value,
|
|
3059
|
+
"show-list": !1,
|
|
3060
|
+
onSurfaceClick: f
|
|
3061
|
+
}, null, 8, ["tooth-id", "findings", "finding-catalog", "selected", "labels", "notation", "shape", "disabled"]),
|
|
3062
|
+
B("div", xs, [
|
|
3063
|
+
B("div", ws, [
|
|
3064
|
+
B("p", bs, P(o.value.inspector.surfaceFindings), 1),
|
|
3065
|
+
h.value.length ? (g(), y("ul", Ms, [
|
|
3066
|
+
(g(!0), y(Z, null, O(h.value, (D) => (g(), y("li", {
|
|
3067
|
+
key: D.surface,
|
|
3068
|
+
"data-inspector-surface": D.surface
|
|
3069
|
+
}, [
|
|
3070
|
+
B("span", ks, P(D.letter), 1),
|
|
3071
|
+
B("span", $s, P(D.name), 1),
|
|
3072
|
+
B("span", Ss, [
|
|
3073
|
+
(g(!0), y(Z, null, O(D.entries, (Q) => (g(), y("span", {
|
|
3074
|
+
key: Q.index,
|
|
3075
|
+
class: "odontogram-inspector__entry"
|
|
3076
|
+
}, [
|
|
3077
|
+
pt(P(c(Q)) + " ", 1),
|
|
3078
|
+
t.disabled ? q("", !0) : (g(), y("button", {
|
|
3079
|
+
key: 0,
|
|
3080
|
+
type: "button",
|
|
3081
|
+
class: "odontogram-inspector__remove",
|
|
3082
|
+
"aria-label": `${o.value.inspector.remove}: ${c(Q)}, ${D.name}`,
|
|
3083
|
+
onClick: (j) => E(Q, D.surface)
|
|
3084
|
+
}, " × ", 8, Ps))
|
|
3085
|
+
]))), 128))
|
|
3086
|
+
])
|
|
3087
|
+
], 8, Cs))), 128))
|
|
3088
|
+
])) : (g(), y("p", Is, P(o.value.inspector.noFindings), 1))
|
|
3089
|
+
]),
|
|
3090
|
+
B("div", Ts, [
|
|
3091
|
+
B("p", Bs, P(o.value.inspector.toothFindings), 1),
|
|
3092
|
+
d.value.tooth.length ? (g(), y("ul", _s, [
|
|
3093
|
+
(g(!0), y(Z, null, O(d.value.tooth, (D) => (g(), y("li", {
|
|
3094
|
+
key: D.index,
|
|
3095
|
+
"data-inspector-tooth-finding": ""
|
|
3096
|
+
}, [
|
|
3097
|
+
B("span", Fs, [
|
|
3098
|
+
pt(P(c(D)) + " ", 1),
|
|
3099
|
+
!t.disabled && m(D) ? (g(), y("button", {
|
|
3100
|
+
key: 0,
|
|
3101
|
+
type: "button",
|
|
3102
|
+
class: "odontogram-inspector__remove",
|
|
3103
|
+
"aria-label": `${o.value.inspector.remove}: ${c(D)}`,
|
|
3104
|
+
onClick: (Q) => E(D)
|
|
3105
|
+
}, " × ", 8, Ls)) : q("", !0)
|
|
3106
|
+
])
|
|
3107
|
+
]))), 128))
|
|
3108
|
+
])) : (g(), y("p", zs, P(o.value.inspector.noFindings), 1))
|
|
3109
|
+
]),
|
|
3110
|
+
t.disabled ? q("", !0) : (g(), y("form", {
|
|
3111
|
+
key: 0,
|
|
3112
|
+
class: "odontogram-inspector__section odontogram-inspector__form",
|
|
3113
|
+
onSubmit: gn(I, ["prevent"])
|
|
3114
|
+
}, [
|
|
3115
|
+
B("p", Ns, P(o.value.inspector.addFinding), 1),
|
|
3116
|
+
B("label", Ds, [
|
|
3117
|
+
pt(P(o.value.inspector.finding) + " ", 1),
|
|
3118
|
+
he(B("select", {
|
|
3119
|
+
"onUpdate:modelValue": N[0] || (N[0] = (D) => b.value = D),
|
|
3120
|
+
name: "finding"
|
|
3121
|
+
}, [
|
|
3122
|
+
p.value.surface.length ? (g(), y("optgroup", {
|
|
3123
|
+
key: 0,
|
|
3124
|
+
label: o.value.inspector.onSurfaces
|
|
3125
|
+
}, [
|
|
3126
|
+
(g(!0), y(Z, null, O(p.value.surface, (D) => (g(), y("option", {
|
|
3127
|
+
key: D.code,
|
|
3128
|
+
value: D.code
|
|
3129
|
+
}, P(D.name), 9, Es))), 128))
|
|
3130
|
+
], 8, Zs)) : q("", !0),
|
|
3131
|
+
p.value.tooth.length ? (g(), y("optgroup", {
|
|
3132
|
+
key: 1,
|
|
3133
|
+
label: o.value.inspector.onTooth
|
|
3134
|
+
}, [
|
|
3135
|
+
(g(!0), y(Z, null, O(p.value.tooth, (D) => (g(), y("option", {
|
|
3136
|
+
key: D.code,
|
|
3137
|
+
value: D.code
|
|
3138
|
+
}, P(D.name), 9, Hs))), 128))
|
|
3139
|
+
], 8, qs)) : q("", !0)
|
|
3140
|
+
], 512), [
|
|
3141
|
+
[yn, b.value]
|
|
3142
|
+
])
|
|
3143
|
+
]),
|
|
3144
|
+
k.value ? (g(), y("p", Rs, [
|
|
3145
|
+
w.value.length ? (g(), y(Z, { key: 0 }, [
|
|
3146
|
+
pt(P(w.value.map((D) => o.value.surfaceNames[X(wt)(D, t.toothId)]).join(", ")), 1)
|
|
3147
|
+
], 64)) : (g(), y(Z, { key: 1 }, [
|
|
3148
|
+
pt(P(o.value.inspector.chooseSurfaces), 1)
|
|
3149
|
+
], 64))
|
|
3150
|
+
])) : q("", !0),
|
|
3151
|
+
B("fieldset", As, [
|
|
3152
|
+
B("legend", null, P(o.value.inspector.status), 1),
|
|
3153
|
+
(g(!0), y(Z, null, O(X(hs), (D) => (g(), y("label", { key: D }, [
|
|
3154
|
+
he(B("input", {
|
|
3155
|
+
"onUpdate:modelValue": N[1] || (N[1] = (Q) => C.value = Q),
|
|
3156
|
+
type: "radio",
|
|
3157
|
+
name: "status",
|
|
3158
|
+
value: D
|
|
3159
|
+
}, null, 8, Os), [
|
|
3160
|
+
[vn, C.value]
|
|
3161
|
+
]),
|
|
3162
|
+
pt(" " + P(o.value.findingStatuses[D]), 1)
|
|
3163
|
+
]))), 128))
|
|
3164
|
+
]),
|
|
3165
|
+
B("button", {
|
|
3166
|
+
type: "submit",
|
|
3167
|
+
class: "odontogram-inspector__add",
|
|
3168
|
+
disabled: !v.value
|
|
3169
|
+
}, P(o.value.inspector.add), 9, Vs)
|
|
3170
|
+
], 32))
|
|
3171
|
+
])
|
|
3172
|
+
])
|
|
3173
|
+
], 8, fs));
|
|
3174
|
+
}
|
|
3175
|
+
});
|
|
3176
|
+
export {
|
|
3177
|
+
Gs as Odontogram,
|
|
3178
|
+
ds as SurfaceGuide,
|
|
3179
|
+
Na as Tooth,
|
|
3180
|
+
Ys as ToothInspector,
|
|
3181
|
+
Ks as addFinding,
|
|
3182
|
+
aa as addSurfaceFinding,
|
|
3183
|
+
Rn as buildToothId,
|
|
3184
|
+
lt as defaultOdontogramLabels,
|
|
3185
|
+
hs as findingStatuses,
|
|
3186
|
+
ft as formatToothNumber,
|
|
3187
|
+
Ct as getFindingScope,
|
|
3188
|
+
co as getLayoutViewBox,
|
|
3189
|
+
ze as getPalmerQuadrant,
|
|
3190
|
+
Ws as getQuadrant,
|
|
3191
|
+
wt as getSurfaceName,
|
|
3192
|
+
io as getToothAnchors,
|
|
3193
|
+
Bt as getToothRecord,
|
|
3194
|
+
Wn as getToothType,
|
|
3195
|
+
St as ntsPeruFindingCatalog,
|
|
3196
|
+
Us as removeSurfaceFinding,
|
|
3197
|
+
Ao as resolveFindingTone,
|
|
3198
|
+
Xs as surfaceShapeKinds,
|
|
3199
|
+
zo as toggleSurface,
|
|
3200
|
+
Ko as toothStates,
|
|
3201
|
+
G as toothSurfaces
|
|
3202
|
+
};
|