@nice2dev/ui-math 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +7 -1
- package/dist/index.mjs +1042 -699
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var ue = (e, t, r) => t in e ?
|
|
3
|
-
var
|
|
1
|
+
var me = Object.defineProperty;
|
|
2
|
+
var ue = (e, t, r) => t in e ? me(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var z = (e, t, r) => ue(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
import { jsx as d, jsxs as v, Fragment as oe } from "react/jsx-runtime";
|
|
5
|
-
import { NiceAppShell as
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
const
|
|
5
|
+
import { NiceAppShell as ye, NiceIcon as N } from "@nice2dev/ui";
|
|
6
|
+
import { useNiceTranslation as xe, NiceTutorialButton as he, resolveTutorial as fe, resolveCssColor as D, NiceIcon as j } from "@nice2dev/ui-core";
|
|
7
|
+
import be, { useMemo as ae, useContext as F, createContext as O, useState as M, useRef as U, useCallback as R, useEffect as Y } from "react";
|
|
8
|
+
const K = {
|
|
9
9
|
en: {
|
|
10
10
|
"calculator.matrixA": "Matrix A",
|
|
11
11
|
"calculator.matrixB": "Matrix B",
|
|
@@ -26,7 +26,44 @@ const J = {
|
|
|
26
26
|
"editor.handwritingNote": "Draw your equation above. Handwriting recognition requires external API integration.",
|
|
27
27
|
"editor.templates": "Templates",
|
|
28
28
|
"editor.copyLatex": "Copy LaTeX",
|
|
29
|
-
"plotter.close": "Close"
|
|
29
|
+
"plotter.close": "Close",
|
|
30
|
+
"calculator.standard": "Standard",
|
|
31
|
+
"calculator.scientific": "Scientific",
|
|
32
|
+
"calculator.programmer": "Programmer",
|
|
33
|
+
"calculator.matrix": "Matrix",
|
|
34
|
+
"calculator.calculus": "Calculus",
|
|
35
|
+
"calculator.units": "Units",
|
|
36
|
+
"geometry.select": "Select",
|
|
37
|
+
"geometry.point": "Point",
|
|
38
|
+
"geometry.segment": "Segment",
|
|
39
|
+
"geometry.line": "Line",
|
|
40
|
+
"geometry.ray": "Ray",
|
|
41
|
+
"geometry.circle": "Circle",
|
|
42
|
+
"geometry.polygon": "Polygon",
|
|
43
|
+
"geometry.perpendicular": "Perpendicular",
|
|
44
|
+
"geometry.parallel": "Parallel",
|
|
45
|
+
"geometry.midpoint": "Midpoint",
|
|
46
|
+
"geometry.angleBisector": "Angle Bisector",
|
|
47
|
+
"geometry.intersection": "Intersection",
|
|
48
|
+
"geometry.reflect": "Reflect",
|
|
49
|
+
"geometry.rotate": "Rotate",
|
|
50
|
+
"geometry.measure": "Measure",
|
|
51
|
+
"geometry.arc": "Arc",
|
|
52
|
+
"geometry.angle": "Angle",
|
|
53
|
+
"geometry.tangent": "Tangent",
|
|
54
|
+
"geometry.translate": "Translate",
|
|
55
|
+
"geometry.dilate": "Dilate",
|
|
56
|
+
"geometry.text": "Text",
|
|
57
|
+
"geometry.tool": "Tool: {tool}",
|
|
58
|
+
"geometry.objects": "Objects: {elements}",
|
|
59
|
+
"geometry.points": "Points: {pointCount}",
|
|
60
|
+
"geometry.scaleX": "Scale: {scale}x",
|
|
61
|
+
"plotter.parametricXTYT": "Parametric (x(t), y(t))",
|
|
62
|
+
"plotter.polarRF": "Polar r = f(θ)",
|
|
63
|
+
"plotter.n3dSurfaceZFX": "3D Surface z = f(x,y)",
|
|
64
|
+
"plotter.expression": "Expression...",
|
|
65
|
+
"plotter.addPlot": "+ Add Plot",
|
|
66
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Preview (requires KaTeX/MathJax integration):"
|
|
30
67
|
},
|
|
31
68
|
pl: {
|
|
32
69
|
"calculator.matrixA": "Macierz A",
|
|
@@ -48,7 +85,44 @@ const J = {
|
|
|
48
85
|
"editor.handwritingNote": "Narysuj równanie powyżej. Rozpoznawanie pisma wymaga zewnętrznej integracji API.",
|
|
49
86
|
"editor.templates": "Szablony",
|
|
50
87
|
"editor.copyLatex": "Kopiuj LaTeX",
|
|
51
|
-
"plotter.close": "Zamknij"
|
|
88
|
+
"plotter.close": "Zamknij",
|
|
89
|
+
"calculator.standard": "Standardowy",
|
|
90
|
+
"calculator.scientific": "Naukowy",
|
|
91
|
+
"calculator.programmer": "Programisty",
|
|
92
|
+
"calculator.matrix": "Macierze",
|
|
93
|
+
"calculator.calculus": "Analiza",
|
|
94
|
+
"calculator.units": "Jednostki",
|
|
95
|
+
"geometry.select": "Zaznacz",
|
|
96
|
+
"geometry.point": "Punkt",
|
|
97
|
+
"geometry.segment": "Odcinek",
|
|
98
|
+
"geometry.line": "Prosta",
|
|
99
|
+
"geometry.ray": "Półprosta",
|
|
100
|
+
"geometry.circle": "Okrąg",
|
|
101
|
+
"geometry.polygon": "Wielokąt",
|
|
102
|
+
"geometry.perpendicular": "Prostopadła",
|
|
103
|
+
"geometry.parallel": "Równoległa",
|
|
104
|
+
"geometry.midpoint": "Środek odcinka",
|
|
105
|
+
"geometry.angleBisector": "Dwusieczna kąta",
|
|
106
|
+
"geometry.intersection": "Przecięcie",
|
|
107
|
+
"geometry.reflect": "Odbicie",
|
|
108
|
+
"geometry.rotate": "Obrót",
|
|
109
|
+
"geometry.measure": "Pomiar",
|
|
110
|
+
"geometry.arc": "Łuk",
|
|
111
|
+
"geometry.angle": "Kąt",
|
|
112
|
+
"geometry.tangent": "Styczna",
|
|
113
|
+
"geometry.translate": "Przesunięcie",
|
|
114
|
+
"geometry.dilate": "Jednokładność",
|
|
115
|
+
"geometry.text": "Tekst",
|
|
116
|
+
"geometry.tool": "Narzędzie: {tool}",
|
|
117
|
+
"geometry.objects": "Obiekty: {elements}",
|
|
118
|
+
"geometry.points": "Punkty: {pointCount}",
|
|
119
|
+
"geometry.scaleX": "Skala: {scale}x",
|
|
120
|
+
"plotter.parametricXTYT": "Parametryczny (x(t), y(t))",
|
|
121
|
+
"plotter.polarRF": "Biegunowy r = f(θ)",
|
|
122
|
+
"plotter.n3dSurfaceZFX": "Powierzchnia 3D z = f(x,y)",
|
|
123
|
+
"plotter.expression": "Wyrażenie...",
|
|
124
|
+
"plotter.addPlot": "+ Dodaj wykres",
|
|
125
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Podgląd (wymaga integracji KaTeX/MathJax):"
|
|
52
126
|
},
|
|
53
127
|
de: {
|
|
54
128
|
"calculator.matrixA": "Matrix A",
|
|
@@ -70,7 +144,44 @@ const J = {
|
|
|
70
144
|
"editor.handwritingNote": "Zeichnen Sie Ihre Gleichung oben. Die Handschrifterkennung erfordert eine externe API-Integration.",
|
|
71
145
|
"editor.templates": "Vorlagen",
|
|
72
146
|
"editor.copyLatex": "LaTeX kopieren",
|
|
73
|
-
"plotter.close": "Schließen"
|
|
147
|
+
"plotter.close": "Schließen",
|
|
148
|
+
"calculator.standard": "Standard",
|
|
149
|
+
"calculator.scientific": "Wissenschaftlich",
|
|
150
|
+
"calculator.programmer": "Programmierer",
|
|
151
|
+
"calculator.matrix": "Matrix",
|
|
152
|
+
"calculator.calculus": "Analysis",
|
|
153
|
+
"calculator.units": "Einheiten",
|
|
154
|
+
"geometry.select": "Auswählen",
|
|
155
|
+
"geometry.point": "Punkt",
|
|
156
|
+
"geometry.segment": "Strecke",
|
|
157
|
+
"geometry.line": "Gerade",
|
|
158
|
+
"geometry.ray": "Strahl",
|
|
159
|
+
"geometry.circle": "Kreis",
|
|
160
|
+
"geometry.polygon": "Polygon",
|
|
161
|
+
"geometry.perpendicular": "Senkrechte",
|
|
162
|
+
"geometry.parallel": "Parallele",
|
|
163
|
+
"geometry.midpoint": "Mittelpunkt",
|
|
164
|
+
"geometry.angleBisector": "Winkelhalbierende",
|
|
165
|
+
"geometry.intersection": "Schnittpunkt",
|
|
166
|
+
"geometry.reflect": "Spiegeln",
|
|
167
|
+
"geometry.rotate": "Drehen",
|
|
168
|
+
"geometry.measure": "Messen",
|
|
169
|
+
"geometry.arc": "Bogen",
|
|
170
|
+
"geometry.angle": "Winkel",
|
|
171
|
+
"geometry.tangent": "Tangente",
|
|
172
|
+
"geometry.translate": "Verschieben",
|
|
173
|
+
"geometry.dilate": "Strecken",
|
|
174
|
+
"geometry.text": "Text",
|
|
175
|
+
"geometry.tool": "Werkzeug: {tool}",
|
|
176
|
+
"geometry.objects": "Objekte: {elements}",
|
|
177
|
+
"geometry.points": "Punkte: {pointCount}",
|
|
178
|
+
"geometry.scaleX": "Maßstab: {scale}x",
|
|
179
|
+
"plotter.parametricXTYT": "Parametrisch (x(t), y(t))",
|
|
180
|
+
"plotter.polarRF": "Polar r = f(θ)",
|
|
181
|
+
"plotter.n3dSurfaceZFX": "3D-Fläche z = f(x,y)",
|
|
182
|
+
"plotter.expression": "Ausdruck...",
|
|
183
|
+
"plotter.addPlot": "+ Diagramm hinzufügen",
|
|
184
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Vorschau (erfordert KaTeX/MathJax-Integration):"
|
|
74
185
|
},
|
|
75
186
|
fr: {
|
|
76
187
|
"calculator.matrixA": "Matrice A",
|
|
@@ -92,7 +203,44 @@ const J = {
|
|
|
92
203
|
"editor.handwritingNote": "Dessinez votre équation ci-dessus. La reconnaissance d'écriture nécessite une intégration API externe.",
|
|
93
204
|
"editor.templates": "Modèles",
|
|
94
205
|
"editor.copyLatex": "Copier le LaTeX",
|
|
95
|
-
"plotter.close": "Fermer"
|
|
206
|
+
"plotter.close": "Fermer",
|
|
207
|
+
"calculator.standard": "Standard",
|
|
208
|
+
"calculator.scientific": "Scientifique",
|
|
209
|
+
"calculator.programmer": "Programmeur",
|
|
210
|
+
"calculator.matrix": "Matrice",
|
|
211
|
+
"calculator.calculus": "Analyse",
|
|
212
|
+
"calculator.units": "Unités",
|
|
213
|
+
"geometry.select": "Sélectionner",
|
|
214
|
+
"geometry.point": "Point",
|
|
215
|
+
"geometry.segment": "Segment",
|
|
216
|
+
"geometry.line": "Droite",
|
|
217
|
+
"geometry.ray": "Demi-droite",
|
|
218
|
+
"geometry.circle": "Cercle",
|
|
219
|
+
"geometry.polygon": "Polygone",
|
|
220
|
+
"geometry.perpendicular": "Perpendiculaire",
|
|
221
|
+
"geometry.parallel": "Parallèle",
|
|
222
|
+
"geometry.midpoint": "Milieu",
|
|
223
|
+
"geometry.angleBisector": "Bissectrice",
|
|
224
|
+
"geometry.intersection": "Intersection",
|
|
225
|
+
"geometry.reflect": "Réflexion",
|
|
226
|
+
"geometry.rotate": "Rotation",
|
|
227
|
+
"geometry.measure": "Mesurer",
|
|
228
|
+
"geometry.arc": "Arc",
|
|
229
|
+
"geometry.angle": "Angle",
|
|
230
|
+
"geometry.tangent": "Tangente",
|
|
231
|
+
"geometry.translate": "Translation",
|
|
232
|
+
"geometry.dilate": "Homothétie",
|
|
233
|
+
"geometry.text": "Texte",
|
|
234
|
+
"geometry.tool": "Outil : {tool}",
|
|
235
|
+
"geometry.objects": "Objets : {elements}",
|
|
236
|
+
"geometry.points": "Points : {pointCount}",
|
|
237
|
+
"geometry.scaleX": "Échelle : {scale}x",
|
|
238
|
+
"plotter.parametricXTYT": "Paramétrique (x(t), y(t))",
|
|
239
|
+
"plotter.polarRF": "Polaire r = f(θ)",
|
|
240
|
+
"plotter.n3dSurfaceZFX": "Surface 3D z = f(x,y)",
|
|
241
|
+
"plotter.expression": "Expression...",
|
|
242
|
+
"plotter.addPlot": "+ Ajouter un tracé",
|
|
243
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Aperçu (nécessite l'intégration KaTeX/MathJax) :"
|
|
96
244
|
},
|
|
97
245
|
es: {
|
|
98
246
|
"calculator.matrixA": "Matriz A",
|
|
@@ -114,7 +262,44 @@ const J = {
|
|
|
114
262
|
"editor.handwritingNote": "Dibuja tu ecuación arriba. El reconocimiento de escritura requiere integración con una API externa.",
|
|
115
263
|
"editor.templates": "Plantillas",
|
|
116
264
|
"editor.copyLatex": "Copiar LaTeX",
|
|
117
|
-
"plotter.close": "Cerrar"
|
|
265
|
+
"plotter.close": "Cerrar",
|
|
266
|
+
"calculator.standard": "Estándar",
|
|
267
|
+
"calculator.scientific": "Científica",
|
|
268
|
+
"calculator.programmer": "Programador",
|
|
269
|
+
"calculator.matrix": "Matriz",
|
|
270
|
+
"calculator.calculus": "Cálculo",
|
|
271
|
+
"calculator.units": "Unidades",
|
|
272
|
+
"geometry.select": "Seleccionar",
|
|
273
|
+
"geometry.point": "Punto",
|
|
274
|
+
"geometry.segment": "Segmento",
|
|
275
|
+
"geometry.line": "Recta",
|
|
276
|
+
"geometry.ray": "Semirrecta",
|
|
277
|
+
"geometry.circle": "Circunferencia",
|
|
278
|
+
"geometry.polygon": "Polígono",
|
|
279
|
+
"geometry.perpendicular": "Perpendicular",
|
|
280
|
+
"geometry.parallel": "Paralela",
|
|
281
|
+
"geometry.midpoint": "Punto medio",
|
|
282
|
+
"geometry.angleBisector": "Bisectriz",
|
|
283
|
+
"geometry.intersection": "Intersección",
|
|
284
|
+
"geometry.reflect": "Reflejar",
|
|
285
|
+
"geometry.rotate": "Girar",
|
|
286
|
+
"geometry.measure": "Medir",
|
|
287
|
+
"geometry.arc": "Arco",
|
|
288
|
+
"geometry.angle": "Ángulo",
|
|
289
|
+
"geometry.tangent": "Tangente",
|
|
290
|
+
"geometry.translate": "Trasladar",
|
|
291
|
+
"geometry.dilate": "Homotecia",
|
|
292
|
+
"geometry.text": "Texto",
|
|
293
|
+
"geometry.tool": "Herramienta: {tool}",
|
|
294
|
+
"geometry.objects": "Objetos: {elements}",
|
|
295
|
+
"geometry.points": "Puntos: {pointCount}",
|
|
296
|
+
"geometry.scaleX": "Escala: {scale}x",
|
|
297
|
+
"plotter.parametricXTYT": "Paramétrica (x(t), y(t))",
|
|
298
|
+
"plotter.polarRF": "Polar r = f(θ)",
|
|
299
|
+
"plotter.n3dSurfaceZFX": "Superficie 3D z = f(x,y)",
|
|
300
|
+
"plotter.expression": "Expresión...",
|
|
301
|
+
"plotter.addPlot": "+ Añadir gráfica",
|
|
302
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Vista previa (requiere integración con KaTeX/MathJax):"
|
|
118
303
|
},
|
|
119
304
|
it: {
|
|
120
305
|
"calculator.matrixA": "Matrice A",
|
|
@@ -136,7 +321,44 @@ const J = {
|
|
|
136
321
|
"editor.handwritingNote": "Disegna la tua equazione qui sopra. Il riconoscimento della scrittura richiede un’integrazione API esterna.",
|
|
137
322
|
"editor.templates": "Modelli",
|
|
138
323
|
"editor.copyLatex": "Copia LaTeX",
|
|
139
|
-
"plotter.close": "Chiudi"
|
|
324
|
+
"plotter.close": "Chiudi",
|
|
325
|
+
"calculator.standard": "Standard",
|
|
326
|
+
"calculator.scientific": "Scientifica",
|
|
327
|
+
"calculator.programmer": "Programmatore",
|
|
328
|
+
"calculator.matrix": "Matrice",
|
|
329
|
+
"calculator.calculus": "Analisi",
|
|
330
|
+
"calculator.units": "Unità",
|
|
331
|
+
"geometry.select": "Seleziona",
|
|
332
|
+
"geometry.point": "Punto",
|
|
333
|
+
"geometry.segment": "Segmento",
|
|
334
|
+
"geometry.line": "Retta",
|
|
335
|
+
"geometry.ray": "Semiretta",
|
|
336
|
+
"geometry.circle": "Circonferenza",
|
|
337
|
+
"geometry.polygon": "Poligono",
|
|
338
|
+
"geometry.perpendicular": "Perpendicolare",
|
|
339
|
+
"geometry.parallel": "Parallela",
|
|
340
|
+
"geometry.midpoint": "Punto medio",
|
|
341
|
+
"geometry.angleBisector": "Bisettrice",
|
|
342
|
+
"geometry.intersection": "Intersezione",
|
|
343
|
+
"geometry.reflect": "Rifletti",
|
|
344
|
+
"geometry.rotate": "Ruota",
|
|
345
|
+
"geometry.measure": "Misura",
|
|
346
|
+
"geometry.arc": "Arco",
|
|
347
|
+
"geometry.angle": "Angolo",
|
|
348
|
+
"geometry.tangent": "Tangente",
|
|
349
|
+
"geometry.translate": "Trasla",
|
|
350
|
+
"geometry.dilate": "Omotetia",
|
|
351
|
+
"geometry.text": "Testo",
|
|
352
|
+
"geometry.tool": "Strumento: {tool}",
|
|
353
|
+
"geometry.objects": "Oggetti: {elements}",
|
|
354
|
+
"geometry.points": "Punti: {pointCount}",
|
|
355
|
+
"geometry.scaleX": "Scala: {scale}x",
|
|
356
|
+
"plotter.parametricXTYT": "Parametrico (x(t), y(t))",
|
|
357
|
+
"plotter.polarRF": "Polare r = f(θ)",
|
|
358
|
+
"plotter.n3dSurfaceZFX": "Superficie 3D z = f(x,y)",
|
|
359
|
+
"plotter.expression": "Espressione...",
|
|
360
|
+
"plotter.addPlot": "+ Aggiungi grafico",
|
|
361
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Anteprima (richiede l'integrazione KaTeX/MathJax):"
|
|
140
362
|
},
|
|
141
363
|
pt: {
|
|
142
364
|
"calculator.matrixA": "Matriz A",
|
|
@@ -158,7 +380,44 @@ const J = {
|
|
|
158
380
|
"editor.handwritingNote": "Desenhe a sua equação acima. O reconhecimento de escrita requer integração com uma API externa.",
|
|
159
381
|
"editor.templates": "Modelos",
|
|
160
382
|
"editor.copyLatex": "Copiar LaTeX",
|
|
161
|
-
"plotter.close": "Fechar"
|
|
383
|
+
"plotter.close": "Fechar",
|
|
384
|
+
"calculator.standard": "Padrão",
|
|
385
|
+
"calculator.scientific": "Científica",
|
|
386
|
+
"calculator.programmer": "Programador",
|
|
387
|
+
"calculator.matrix": "Matriz",
|
|
388
|
+
"calculator.calculus": "Cálculo",
|
|
389
|
+
"calculator.units": "Unidades",
|
|
390
|
+
"geometry.select": "Selecionar",
|
|
391
|
+
"geometry.point": "Ponto",
|
|
392
|
+
"geometry.segment": "Segmento",
|
|
393
|
+
"geometry.line": "Reta",
|
|
394
|
+
"geometry.ray": "Semirreta",
|
|
395
|
+
"geometry.circle": "Circunferência",
|
|
396
|
+
"geometry.polygon": "Polígono",
|
|
397
|
+
"geometry.perpendicular": "Perpendicular",
|
|
398
|
+
"geometry.parallel": "Paralela",
|
|
399
|
+
"geometry.midpoint": "Ponto médio",
|
|
400
|
+
"geometry.angleBisector": "Bissetriz",
|
|
401
|
+
"geometry.intersection": "Interseção",
|
|
402
|
+
"geometry.reflect": "Refletir",
|
|
403
|
+
"geometry.rotate": "Rodar",
|
|
404
|
+
"geometry.measure": "Medir",
|
|
405
|
+
"geometry.arc": "Arco",
|
|
406
|
+
"geometry.angle": "Ângulo",
|
|
407
|
+
"geometry.tangent": "Tangente",
|
|
408
|
+
"geometry.translate": "Transladar",
|
|
409
|
+
"geometry.dilate": "Homotetia",
|
|
410
|
+
"geometry.text": "Texto",
|
|
411
|
+
"geometry.tool": "Ferramenta: {tool}",
|
|
412
|
+
"geometry.objects": "Objetos: {elements}",
|
|
413
|
+
"geometry.points": "Pontos: {pointCount}",
|
|
414
|
+
"geometry.scaleX": "Escala: {scale}x",
|
|
415
|
+
"plotter.parametricXTYT": "Paramétrico (x(t), y(t))",
|
|
416
|
+
"plotter.polarRF": "Polar r = f(θ)",
|
|
417
|
+
"plotter.n3dSurfaceZFX": "Superfície 3D z = f(x,y)",
|
|
418
|
+
"plotter.expression": "Expressão...",
|
|
419
|
+
"plotter.addPlot": "+ Adicionar gráfico",
|
|
420
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Pré-visualização (requer integração KaTeX/MathJax):"
|
|
162
421
|
},
|
|
163
422
|
cs: {
|
|
164
423
|
"calculator.matrixA": "Matice A",
|
|
@@ -180,7 +439,44 @@ const J = {
|
|
|
180
439
|
"editor.handwritingNote": "Nakreslete svou rovnici výše. Rozpoznávání rukopisu vyžaduje externí integraci API.",
|
|
181
440
|
"editor.templates": "Šablony",
|
|
182
441
|
"editor.copyLatex": "Kopírovat LaTeX",
|
|
183
|
-
"plotter.close": "Zavřít"
|
|
442
|
+
"plotter.close": "Zavřít",
|
|
443
|
+
"calculator.standard": "Standardní",
|
|
444
|
+
"calculator.scientific": "Vědecká",
|
|
445
|
+
"calculator.programmer": "Programátorská",
|
|
446
|
+
"calculator.matrix": "Matice",
|
|
447
|
+
"calculator.calculus": "Analýza",
|
|
448
|
+
"calculator.units": "Jednotky",
|
|
449
|
+
"geometry.select": "Vybrat",
|
|
450
|
+
"geometry.point": "Bod",
|
|
451
|
+
"geometry.segment": "Úsečka",
|
|
452
|
+
"geometry.line": "Přímka",
|
|
453
|
+
"geometry.ray": "Polopřímka",
|
|
454
|
+
"geometry.circle": "Kružnice",
|
|
455
|
+
"geometry.polygon": "Mnohoúhelník",
|
|
456
|
+
"geometry.perpendicular": "Kolmice",
|
|
457
|
+
"geometry.parallel": "Rovnoběžka",
|
|
458
|
+
"geometry.midpoint": "Střed",
|
|
459
|
+
"geometry.angleBisector": "Osa úhlu",
|
|
460
|
+
"geometry.intersection": "Průsečík",
|
|
461
|
+
"geometry.reflect": "Zrcadlit",
|
|
462
|
+
"geometry.rotate": "Otočit",
|
|
463
|
+
"geometry.measure": "Měřit",
|
|
464
|
+
"geometry.arc": "Oblouk",
|
|
465
|
+
"geometry.angle": "Úhel",
|
|
466
|
+
"geometry.tangent": "Tečna",
|
|
467
|
+
"geometry.translate": "Posunout",
|
|
468
|
+
"geometry.dilate": "Stejnolehlost",
|
|
469
|
+
"geometry.text": "Text",
|
|
470
|
+
"geometry.tool": "Nástroj: {tool}",
|
|
471
|
+
"geometry.objects": "Objekty: {elements}",
|
|
472
|
+
"geometry.points": "Body: {pointCount}",
|
|
473
|
+
"geometry.scaleX": "Měřítko: {scale}x",
|
|
474
|
+
"plotter.parametricXTYT": "Parametrický (x(t), y(t))",
|
|
475
|
+
"plotter.polarRF": "Polární r = f(θ)",
|
|
476
|
+
"plotter.n3dSurfaceZFX": "3D plocha z = f(x,y)",
|
|
477
|
+
"plotter.expression": "Výraz...",
|
|
478
|
+
"plotter.addPlot": "+ Přidat graf",
|
|
479
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Náhled (vyžaduje integraci KaTeX/MathJax):"
|
|
184
480
|
},
|
|
185
481
|
uk: {
|
|
186
482
|
"calculator.matrixA": "Матриця A",
|
|
@@ -202,23 +498,59 @@ const J = {
|
|
|
202
498
|
"editor.handwritingNote": "Намалюйте своє рівняння вище. Розпізнавання рукопису потребує зовнішньої інтеграції з API.",
|
|
203
499
|
"editor.templates": "Шаблони",
|
|
204
500
|
"editor.copyLatex": "Копіювати LaTeX",
|
|
205
|
-
"plotter.close": "Закрити"
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
501
|
+
"plotter.close": "Закрити",
|
|
502
|
+
"calculator.standard": "Стандартний",
|
|
503
|
+
"calculator.scientific": "Науковий",
|
|
504
|
+
"calculator.programmer": "Програміста",
|
|
505
|
+
"calculator.matrix": "Матриці",
|
|
506
|
+
"calculator.calculus": "Аналіз",
|
|
507
|
+
"calculator.units": "Одиниці",
|
|
508
|
+
"geometry.select": "Вибрати",
|
|
509
|
+
"geometry.point": "Точка",
|
|
510
|
+
"geometry.segment": "Відрізок",
|
|
511
|
+
"geometry.line": "Пряма",
|
|
512
|
+
"geometry.ray": "Промінь",
|
|
513
|
+
"geometry.circle": "Коло",
|
|
514
|
+
"geometry.polygon": "Многокутник",
|
|
515
|
+
"geometry.perpendicular": "Перпендикуляр",
|
|
516
|
+
"geometry.parallel": "Паралельна",
|
|
517
|
+
"geometry.midpoint": "Середина",
|
|
518
|
+
"geometry.angleBisector": "Бісектриса",
|
|
519
|
+
"geometry.intersection": "Перетин",
|
|
520
|
+
"geometry.reflect": "Відбити",
|
|
521
|
+
"geometry.rotate": "Повернути",
|
|
522
|
+
"geometry.measure": "Виміряти",
|
|
523
|
+
"geometry.arc": "Дуга",
|
|
524
|
+
"geometry.angle": "Кут",
|
|
525
|
+
"geometry.tangent": "Дотична",
|
|
526
|
+
"geometry.translate": "Перенести",
|
|
527
|
+
"geometry.dilate": "Гомотетія",
|
|
528
|
+
"geometry.text": "Текст",
|
|
529
|
+
"geometry.tool": "Інструмент: {tool}",
|
|
530
|
+
"geometry.objects": "Об'єкти: {elements}",
|
|
531
|
+
"geometry.points": "Точки: {pointCount}",
|
|
532
|
+
"geometry.scaleX": "Масштаб: {scale}x",
|
|
533
|
+
"plotter.parametricXTYT": "Параметричний (x(t), y(t))",
|
|
534
|
+
"plotter.polarRF": "Полярний r = f(θ)",
|
|
535
|
+
"plotter.n3dSurfaceZFX": "3D-поверхня z = f(x,y)",
|
|
536
|
+
"plotter.expression": "Вираз...",
|
|
537
|
+
"plotter.addPlot": "+ Додати графік",
|
|
538
|
+
"editor.previewRequiresKatexMathjaxIntegration": "Попередній перегляд (потрібна інтеграція KaTeX/MathJax):"
|
|
539
|
+
}
|
|
540
|
+
}, ne = /* @__PURE__ */ O(null);
|
|
541
|
+
function ie(e, t) {
|
|
542
|
+
const r = { ...K.en, ...K[e], ...t };
|
|
543
|
+
return { locale: e, t: (a, n) => r[a] ?? n ?? a };
|
|
544
|
+
}
|
|
545
|
+
function et({ locale: e = "en", overrides: t, children: r }) {
|
|
546
|
+
const o = ae(() => ie(e, t), [e, t]);
|
|
547
|
+
return be.createElement(ne.Provider, { value: o }, r);
|
|
217
548
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
549
|
+
function E() {
|
|
550
|
+
const e = F(ne), { lang: t } = xe(), r = K[t] ? t : "en", o = ae(() => ie(r), [r]);
|
|
551
|
+
return e ?? o;
|
|
220
552
|
}
|
|
221
|
-
const
|
|
553
|
+
const ve = [
|
|
222
554
|
{
|
|
223
555
|
target: ".nice-math-editor",
|
|
224
556
|
titleKey: "tutorial.mathEditor.intro.title",
|
|
@@ -227,7 +559,7 @@ const fe = [
|
|
|
227
559
|
content: "Write equations as LaTeX or insert symbols from the palette; switch to handwriting input, and preview the rendered formula live.",
|
|
228
560
|
placement: "auto"
|
|
229
561
|
}
|
|
230
|
-
],
|
|
562
|
+
], we = [
|
|
231
563
|
// Greek lowercase
|
|
232
564
|
{ name: "alpha", latex: "\\alpha", category: "greek", preview: "α" },
|
|
233
565
|
{ name: "beta", latex: "\\beta", category: "greek", preview: "β" },
|
|
@@ -404,10 +736,10 @@ const fe = [
|
|
|
404
736
|
preview: "{ }"
|
|
405
737
|
}
|
|
406
738
|
];
|
|
407
|
-
function
|
|
408
|
-
return
|
|
739
|
+
function ke(e) {
|
|
740
|
+
return we.filter((t) => t.category === e);
|
|
409
741
|
}
|
|
410
|
-
const
|
|
742
|
+
const Pe = [
|
|
411
743
|
// Basic
|
|
412
744
|
{ name: "Fraction", latex: "\\frac{a}{b}", category: "basic" },
|
|
413
745
|
{ name: "Square root", latex: "\\sqrt{x}", category: "basic" },
|
|
@@ -466,11 +798,11 @@ const we = [
|
|
|
466
798
|
category: "physics"
|
|
467
799
|
}
|
|
468
800
|
];
|
|
469
|
-
class
|
|
801
|
+
class Me {
|
|
470
802
|
constructor(t = {}) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
803
|
+
z(this, "equations", /* @__PURE__ */ new Map());
|
|
804
|
+
z(this, "config");
|
|
805
|
+
z(this, "nextNumber");
|
|
474
806
|
this.config = {
|
|
475
807
|
enableNumbering: t.enableNumbering ?? !0,
|
|
476
808
|
startNumber: t.startNumber ?? 1,
|
|
@@ -539,8 +871,8 @@ class ke {
|
|
|
539
871
|
r.push(this.createEquation(a[1].trim()));
|
|
540
872
|
const n = /\\begin\{equation\}([\s\S]*?)\\end\{equation\}/g;
|
|
541
873
|
for (; (a = n.exec(t)) !== null; ) {
|
|
542
|
-
const i = a[1].match(/\\label\{([^}]+)\}/),
|
|
543
|
-
r.push(this.createEquation(
|
|
874
|
+
const i = a[1].match(/\\label\{([^}]+)\}/), l = a[1].replace(/\\label\{[^}]+\}/, "").trim();
|
|
875
|
+
r.push(this.createEquation(l, i == null ? void 0 : i[1]));
|
|
544
876
|
}
|
|
545
877
|
return r;
|
|
546
878
|
}
|
|
@@ -548,8 +880,8 @@ class ke {
|
|
|
548
880
|
return Date.now().toString(36) + Math.random().toString(36).substring(2, 8);
|
|
549
881
|
}
|
|
550
882
|
}
|
|
551
|
-
function
|
|
552
|
-
return new
|
|
883
|
+
function tt(e) {
|
|
884
|
+
return new Me(e);
|
|
553
885
|
}
|
|
554
886
|
async function Ce(e) {
|
|
555
887
|
return await new Promise((r) => setTimeout(r, 500)), {
|
|
@@ -558,9 +890,9 @@ async function Ce(e) {
|
|
|
558
890
|
alternatives: ["x", "X", "\\times"]
|
|
559
891
|
};
|
|
560
892
|
}
|
|
561
|
-
const
|
|
893
|
+
const se = /* @__PURE__ */ O(null);
|
|
562
894
|
function W() {
|
|
563
|
-
const e =
|
|
895
|
+
const e = F(se);
|
|
564
896
|
if (!e)
|
|
565
897
|
throw new Error("useMathEditor must be used within MathEditorProvider");
|
|
566
898
|
return e;
|
|
@@ -648,7 +980,7 @@ const A = {
|
|
|
648
980
|
cursor: "crosshair"
|
|
649
981
|
}
|
|
650
982
|
};
|
|
651
|
-
function
|
|
983
|
+
function rt({
|
|
652
984
|
service: e,
|
|
653
985
|
initialLatex: t = "",
|
|
654
986
|
onChange: r,
|
|
@@ -656,67 +988,67 @@ function et({
|
|
|
656
988
|
style: a,
|
|
657
989
|
tutorial: n
|
|
658
990
|
}) {
|
|
659
|
-
const { t: i } =
|
|
991
|
+
const { t: i } = E(), [l, g] = M(t), [s, p] = M("input"), u = U(null), x = R(
|
|
660
992
|
(b) => {
|
|
661
|
-
|
|
993
|
+
g(b), r == null || r(b);
|
|
662
994
|
},
|
|
663
995
|
[r]
|
|
664
996
|
), f = R(
|
|
665
997
|
(b) => {
|
|
666
|
-
const
|
|
667
|
-
if (!
|
|
668
|
-
|
|
998
|
+
const c = u.current;
|
|
999
|
+
if (!c) {
|
|
1000
|
+
x(l + b);
|
|
669
1001
|
return;
|
|
670
1002
|
}
|
|
671
|
-
const
|
|
672
|
-
|
|
673
|
-
|
|
1003
|
+
const m = c.selectionStart, k = c.selectionEnd, C = l.slice(0, m) + b + l.slice(k);
|
|
1004
|
+
x(C), setTimeout(() => {
|
|
1005
|
+
c.focus(), c.selectionStart = c.selectionEnd = m + b.length;
|
|
674
1006
|
}, 0);
|
|
675
1007
|
},
|
|
676
|
-
[
|
|
677
|
-
),
|
|
1008
|
+
[l, x]
|
|
1009
|
+
), w = R(
|
|
678
1010
|
(b) => {
|
|
679
1011
|
f(b.latex);
|
|
680
1012
|
},
|
|
681
1013
|
[f]
|
|
682
|
-
),
|
|
1014
|
+
), y = {
|
|
683
1015
|
service: e,
|
|
684
|
-
latex:
|
|
685
|
-
setLatex:
|
|
1016
|
+
latex: l,
|
|
1017
|
+
setLatex: x,
|
|
686
1018
|
insertSymbol: f,
|
|
687
|
-
insertTemplate:
|
|
1019
|
+
insertTemplate: w,
|
|
688
1020
|
mode: s,
|
|
689
1021
|
setMode: p
|
|
690
1022
|
};
|
|
691
|
-
return /* @__PURE__ */ d(
|
|
692
|
-
|
|
1023
|
+
return /* @__PURE__ */ d(se.Provider, { value: y, children: /* @__PURE__ */ v(
|
|
1024
|
+
ye,
|
|
693
1025
|
{
|
|
694
1026
|
flush: !0,
|
|
695
1027
|
className: `nice-math-editor ${o ?? ""}`,
|
|
696
1028
|
style: { position: "relative", ...a },
|
|
697
|
-
toolbar: /* @__PURE__ */ d(
|
|
698
|
-
sidebar: /* @__PURE__ */ d(
|
|
1029
|
+
toolbar: /* @__PURE__ */ d(Se, {}),
|
|
1030
|
+
sidebar: /* @__PURE__ */ d(Be, {}),
|
|
699
1031
|
children: [
|
|
700
|
-
/* @__PURE__ */ d("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ d(
|
|
1032
|
+
/* @__PURE__ */ d("span", { style: { position: "absolute", top: 6, right: 6, zIndex: 30 }, children: /* @__PURE__ */ d(he, { steps: fe(n, ve) }) }),
|
|
701
1033
|
/* @__PURE__ */ d("div", { style: A.editor, children: s === "input" ? /* @__PURE__ */ v(oe, { children: [
|
|
702
1034
|
/* @__PURE__ */ d(
|
|
703
1035
|
"textarea",
|
|
704
1036
|
{
|
|
705
|
-
ref:
|
|
706
|
-
value:
|
|
707
|
-
onChange: (b) =>
|
|
1037
|
+
ref: u,
|
|
1038
|
+
value: l,
|
|
1039
|
+
onChange: (b) => x(b.target.value),
|
|
708
1040
|
placeholder: i("editor.latexPlaceholder", "Enter LaTeX equation..."),
|
|
709
1041
|
style: A.input
|
|
710
1042
|
}
|
|
711
1043
|
),
|
|
712
|
-
/* @__PURE__ */ d(
|
|
713
|
-
] }) : /* @__PURE__ */ d(
|
|
1044
|
+
/* @__PURE__ */ d(Te, { latex: l })
|
|
1045
|
+
] }) : /* @__PURE__ */ d(Re, {}) })
|
|
714
1046
|
]
|
|
715
1047
|
}
|
|
716
1048
|
) });
|
|
717
1049
|
}
|
|
718
|
-
function
|
|
719
|
-
const { t: e } =
|
|
1050
|
+
function Se() {
|
|
1051
|
+
const { t: e } = E(), { mode: t, setMode: r, latex: o, insertTemplate: a } = W(), [n, i] = M(!1);
|
|
720
1052
|
return /* @__PURE__ */ v("div", { style: A.toolbar, children: [
|
|
721
1053
|
/* @__PURE__ */ v(
|
|
722
1054
|
"button",
|
|
@@ -729,7 +1061,7 @@ function Pe() {
|
|
|
729
1061
|
color: t === "input" ? "var(--nice-color-white, #fff)" : "var(--nice-text-primary, #fff)"
|
|
730
1062
|
},
|
|
731
1063
|
children: [
|
|
732
|
-
/* @__PURE__ */ d(
|
|
1064
|
+
/* @__PURE__ */ d(N, { name: "keyboard", size: 14 }),
|
|
733
1065
|
" ",
|
|
734
1066
|
e("editor.latexInput", "LaTeX Input")
|
|
735
1067
|
]
|
|
@@ -745,7 +1077,7 @@ function Pe() {
|
|
|
745
1077
|
color: t === "handwriting" ? "var(--nice-color-white, #fff)" : "var(--nice-text-primary, #fff)"
|
|
746
1078
|
},
|
|
747
1079
|
children: [
|
|
748
|
-
/* @__PURE__ */ d(
|
|
1080
|
+
/* @__PURE__ */ d(N, { name: "pen", size: 14 }),
|
|
749
1081
|
" ",
|
|
750
1082
|
e("editor.handwriting", "Handwriting")
|
|
751
1083
|
]
|
|
@@ -763,11 +1095,11 @@ function Pe() {
|
|
|
763
1095
|
),
|
|
764
1096
|
/* @__PURE__ */ v("div", { style: { position: "relative" }, children: [
|
|
765
1097
|
/* @__PURE__ */ v("button", { onClick: () => i(!n), style: A.button, children: [
|
|
766
|
-
/* @__PURE__ */ d(
|
|
1098
|
+
/* @__PURE__ */ d(N, { name: "ruler", size: 14 }),
|
|
767
1099
|
" ",
|
|
768
1100
|
e("editor.templates", "Templates"),
|
|
769
1101
|
" ",
|
|
770
|
-
/* @__PURE__ */ d(
|
|
1102
|
+
/* @__PURE__ */ d(N, { name: "chevron-down", size: 12 })
|
|
771
1103
|
] }),
|
|
772
1104
|
n && /* @__PURE__ */ d(
|
|
773
1105
|
"div",
|
|
@@ -786,13 +1118,13 @@ function Pe() {
|
|
|
786
1118
|
overflow: "auto"
|
|
787
1119
|
},
|
|
788
1120
|
children: ["basic", "calculus", "algebra", "geometry", "statistics", "physics"].map(
|
|
789
|
-
(
|
|
790
|
-
/* @__PURE__ */ d("div", { style: A.categoryHeader, children:
|
|
791
|
-
|
|
1121
|
+
(l) => /* @__PURE__ */ v("div", { children: [
|
|
1122
|
+
/* @__PURE__ */ d("div", { style: A.categoryHeader, children: l }),
|
|
1123
|
+
Pe.filter((g) => g.category === l).map((g) => /* @__PURE__ */ v(
|
|
792
1124
|
"div",
|
|
793
1125
|
{
|
|
794
1126
|
onClick: () => {
|
|
795
|
-
a(
|
|
1127
|
+
a(g), i(!1);
|
|
796
1128
|
},
|
|
797
1129
|
style: {
|
|
798
1130
|
padding: "8px 12px",
|
|
@@ -802,7 +1134,7 @@ function Pe() {
|
|
|
802
1134
|
onMouseOver: (s) => s.target.style.backgroundColor = "var(--nice-bg-secondary, #f5f5f5)",
|
|
803
1135
|
onMouseOut: (s) => s.target.style.backgroundColor = "transparent",
|
|
804
1136
|
children: [
|
|
805
|
-
/* @__PURE__ */ d("div", { style: { fontWeight: 500 }, children:
|
|
1137
|
+
/* @__PURE__ */ d("div", { style: { fontWeight: 500 }, children: g.name }),
|
|
806
1138
|
/* @__PURE__ */ v(
|
|
807
1139
|
"div",
|
|
808
1140
|
{
|
|
@@ -812,16 +1144,16 @@ function Pe() {
|
|
|
812
1144
|
fontFamily: "monospace"
|
|
813
1145
|
},
|
|
814
1146
|
children: [
|
|
815
|
-
|
|
816
|
-
|
|
1147
|
+
g.latex.substring(0, 40),
|
|
1148
|
+
g.latex.length > 40 ? "..." : ""
|
|
817
1149
|
]
|
|
818
1150
|
}
|
|
819
1151
|
)
|
|
820
1152
|
]
|
|
821
1153
|
},
|
|
822
|
-
|
|
1154
|
+
g.name
|
|
823
1155
|
))
|
|
824
|
-
] },
|
|
1156
|
+
] }, l)
|
|
825
1157
|
)
|
|
826
1158
|
}
|
|
827
1159
|
)
|
|
@@ -833,7 +1165,7 @@ function Pe() {
|
|
|
833
1165
|
onClick: () => navigator.clipboard.writeText(o),
|
|
834
1166
|
style: { ...A.button, backgroundColor: "var(--nice-success, #4caf50)" },
|
|
835
1167
|
children: [
|
|
836
|
-
/* @__PURE__ */ d(
|
|
1168
|
+
/* @__PURE__ */ d(N, { name: "copy", size: 14 }),
|
|
837
1169
|
" ",
|
|
838
1170
|
e("editor.copyLatex", "Copy LaTeX")
|
|
839
1171
|
]
|
|
@@ -841,8 +1173,8 @@ function Pe() {
|
|
|
841
1173
|
)
|
|
842
1174
|
] });
|
|
843
1175
|
}
|
|
844
|
-
function
|
|
845
|
-
const { insertSymbol: e } = W(), [t, r] =
|
|
1176
|
+
function Be() {
|
|
1177
|
+
const { insertSymbol: e } = W(), [t, r] = M("greek"), o = [
|
|
846
1178
|
"greek",
|
|
847
1179
|
"operators",
|
|
848
1180
|
"relations",
|
|
@@ -854,7 +1186,7 @@ function Me() {
|
|
|
854
1186
|
"logic",
|
|
855
1187
|
"calculus",
|
|
856
1188
|
"matrices"
|
|
857
|
-
], a =
|
|
1189
|
+
], a = ke(t);
|
|
858
1190
|
return /* @__PURE__ */ v("div", { style: A.sidebar, children: [
|
|
859
1191
|
/* @__PURE__ */ d("div", { style: { display: "flex", flexWrap: "wrap", padding: "8px", gap: "4px" }, children: o.map((n) => /* @__PURE__ */ d(
|
|
860
1192
|
"button",
|
|
@@ -885,94 +1217,98 @@ function Me() {
|
|
|
885
1217
|
)) })
|
|
886
1218
|
] });
|
|
887
1219
|
}
|
|
888
|
-
function
|
|
1220
|
+
function Te({ latex: e }) {
|
|
1221
|
+
const { t } = E();
|
|
889
1222
|
return /* @__PURE__ */ v("div", { style: A.preview, children: [
|
|
890
1223
|
/* @__PURE__ */ d(
|
|
891
1224
|
"div",
|
|
892
1225
|
{
|
|
893
1226
|
style: { fontSize: "12px", color: "var(--nice-text-secondary, #666)", marginBottom: "8px" },
|
|
894
|
-
children:
|
|
1227
|
+
children: t(
|
|
1228
|
+
"editor.previewRequiresKatexMathjaxIntegration",
|
|
1229
|
+
"Preview (requires KaTeX/MathJax integration):"
|
|
1230
|
+
)
|
|
895
1231
|
}
|
|
896
1232
|
),
|
|
897
1233
|
/* @__PURE__ */ d("code", { style: { fontSize: "16px" }, children: e || "(empty)" })
|
|
898
1234
|
] });
|
|
899
1235
|
}
|
|
900
|
-
function
|
|
901
|
-
const { t: e } =
|
|
902
|
-
const
|
|
903
|
-
if (!
|
|
1236
|
+
function Re() {
|
|
1237
|
+
const { t: e } = E(), { setLatex: t, setMode: r } = W(), o = U(null), [a, n] = M([]), [i, l] = M([]), [g, s] = M(!1), [p, u] = M(!1), x = (c) => {
|
|
1238
|
+
const m = o.current;
|
|
1239
|
+
if (!m)
|
|
904
1240
|
return;
|
|
905
1241
|
s(!0);
|
|
906
|
-
const
|
|
907
|
-
|
|
1242
|
+
const k = m.getBoundingClientRect();
|
|
1243
|
+
l([
|
|
908
1244
|
{
|
|
909
|
-
x:
|
|
910
|
-
y:
|
|
911
|
-
pressure:
|
|
1245
|
+
x: c.clientX - k.left,
|
|
1246
|
+
y: c.clientY - k.top,
|
|
1247
|
+
pressure: c.pressure,
|
|
912
1248
|
timestamp: Date.now()
|
|
913
1249
|
}
|
|
914
1250
|
]);
|
|
915
|
-
}, f = (
|
|
916
|
-
if (!
|
|
1251
|
+
}, f = (c) => {
|
|
1252
|
+
if (!g)
|
|
917
1253
|
return;
|
|
918
|
-
const
|
|
919
|
-
if (!
|
|
1254
|
+
const m = o.current, k = m == null ? void 0 : m.getContext("2d");
|
|
1255
|
+
if (!m || !k)
|
|
920
1256
|
return;
|
|
921
|
-
const
|
|
922
|
-
x:
|
|
923
|
-
y:
|
|
924
|
-
pressure:
|
|
1257
|
+
const C = m.getBoundingClientRect(), h = {
|
|
1258
|
+
x: c.clientX - C.left,
|
|
1259
|
+
y: c.clientY - C.top,
|
|
1260
|
+
pressure: c.pressure,
|
|
925
1261
|
timestamp: Date.now()
|
|
926
1262
|
};
|
|
927
|
-
if (
|
|
928
|
-
const
|
|
929
|
-
|
|
1263
|
+
if (l((P) => [...P, h]), i.length > 0) {
|
|
1264
|
+
const P = i[i.length - 1];
|
|
1265
|
+
k.beginPath(), k.moveTo(P.x, P.y), k.lineTo(h.x, h.y), k.strokeStyle = D("var(--nice-text, #000)", k.canvas), k.lineWidth = 2, k.lineCap = "round", k.stroke();
|
|
930
1266
|
}
|
|
931
|
-
},
|
|
932
|
-
if (
|
|
1267
|
+
}, w = () => {
|
|
1268
|
+
if (g) {
|
|
933
1269
|
if (s(!1), i.length > 1) {
|
|
934
|
-
const
|
|
1270
|
+
const c = {
|
|
935
1271
|
id: Date.now().toString(),
|
|
936
1272
|
points: [...i]
|
|
937
1273
|
};
|
|
938
|
-
n((
|
|
1274
|
+
n((m) => [...m, c]);
|
|
939
1275
|
}
|
|
940
|
-
|
|
1276
|
+
l([]);
|
|
941
1277
|
}
|
|
942
|
-
},
|
|
943
|
-
const
|
|
944
|
-
|
|
1278
|
+
}, y = () => {
|
|
1279
|
+
const c = o.current, m = c == null ? void 0 : c.getContext("2d");
|
|
1280
|
+
m && c && m.clearRect(0, 0, c.width, c.height), n([]);
|
|
945
1281
|
}, b = async () => {
|
|
946
1282
|
if (a.length !== 0) {
|
|
947
|
-
|
|
1283
|
+
u(!0);
|
|
948
1284
|
try {
|
|
949
|
-
const
|
|
950
|
-
t(
|
|
1285
|
+
const c = await Ce(a);
|
|
1286
|
+
t(c.latex), r("input");
|
|
951
1287
|
} finally {
|
|
952
|
-
|
|
1288
|
+
u(!1);
|
|
953
1289
|
}
|
|
954
1290
|
}
|
|
955
1291
|
};
|
|
956
|
-
return
|
|
957
|
-
const
|
|
958
|
-
|
|
1292
|
+
return Y(() => {
|
|
1293
|
+
const c = o.current;
|
|
1294
|
+
c && (c.width = c.offsetWidth, c.height = 200);
|
|
959
1295
|
}, []), /* @__PURE__ */ v("div", { children: [
|
|
960
1296
|
/* @__PURE__ */ d(
|
|
961
1297
|
"canvas",
|
|
962
1298
|
{
|
|
963
1299
|
ref: o,
|
|
964
1300
|
style: A.canvas,
|
|
965
|
-
onPointerDown:
|
|
1301
|
+
onPointerDown: x,
|
|
966
1302
|
onPointerMove: f,
|
|
967
|
-
onPointerUp:
|
|
968
|
-
onPointerLeave:
|
|
1303
|
+
onPointerUp: w,
|
|
1304
|
+
onPointerLeave: w
|
|
969
1305
|
}
|
|
970
1306
|
),
|
|
971
1307
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: "8px", marginTop: "12px" }, children: [
|
|
972
1308
|
/* @__PURE__ */ d(
|
|
973
1309
|
"button",
|
|
974
1310
|
{
|
|
975
|
-
onClick:
|
|
1311
|
+
onClick: y,
|
|
976
1312
|
style: { ...A.button, backgroundColor: "var(--nice-danger, #f44336)" },
|
|
977
1313
|
children: e("editor.clear", "Clear")
|
|
978
1314
|
}
|
|
@@ -993,14 +1329,14 @@ function Be() {
|
|
|
993
1329
|
) })
|
|
994
1330
|
] });
|
|
995
1331
|
}
|
|
996
|
-
const
|
|
1332
|
+
const ze = {
|
|
997
1333
|
pi: Math.PI,
|
|
998
1334
|
PI: Math.PI,
|
|
999
1335
|
e: Math.E,
|
|
1000
1336
|
E: Math.E,
|
|
1001
1337
|
phi: (1 + Math.sqrt(5)) / 2,
|
|
1002
1338
|
tau: Math.PI * 2
|
|
1003
|
-
},
|
|
1339
|
+
}, Ae = {
|
|
1004
1340
|
sin: Math.sin,
|
|
1005
1341
|
cos: Math.cos,
|
|
1006
1342
|
tan: Math.tan,
|
|
@@ -1032,11 +1368,11 @@ const $e = {
|
|
|
1032
1368
|
cot: (e) => 1 / Math.tan(e),
|
|
1033
1369
|
ln: Math.log
|
|
1034
1370
|
};
|
|
1035
|
-
class
|
|
1371
|
+
class le {
|
|
1036
1372
|
constructor(t = {}) {
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1373
|
+
z(this, "pos", 0);
|
|
1374
|
+
z(this, "expr", "");
|
|
1375
|
+
z(this, "options");
|
|
1040
1376
|
this.options = t;
|
|
1041
1377
|
}
|
|
1042
1378
|
parse(t) {
|
|
@@ -1132,7 +1468,7 @@ class ie {
|
|
|
1132
1468
|
case "variable": {
|
|
1133
1469
|
if (t.name in r)
|
|
1134
1470
|
return r[t.name];
|
|
1135
|
-
const o = this.lookup({
|
|
1471
|
+
const o = this.lookup({ ...ze, ...this.options.constants }, t.name);
|
|
1136
1472
|
if (o !== void 0)
|
|
1137
1473
|
return o;
|
|
1138
1474
|
throw new Error(`Unknown variable: ${t.name}`);
|
|
@@ -1157,7 +1493,7 @@ class ie {
|
|
|
1157
1493
|
}
|
|
1158
1494
|
}
|
|
1159
1495
|
case "call": {
|
|
1160
|
-
const o = this.lookup({ ...
|
|
1496
|
+
const o = this.lookup({ ...Ae, ...this.options.functions }, t.name);
|
|
1161
1497
|
if (!o)
|
|
1162
1498
|
throw new Error(`Unknown function: ${t.name}`);
|
|
1163
1499
|
const a = t.args.map((n) => this.evaluate(n, r));
|
|
@@ -1168,11 +1504,11 @@ class ie {
|
|
|
1168
1504
|
}
|
|
1169
1505
|
}
|
|
1170
1506
|
}
|
|
1171
|
-
class
|
|
1507
|
+
class $e {
|
|
1172
1508
|
constructor(t = {}) {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1509
|
+
z(this, "plots", /* @__PURE__ */ new Map());
|
|
1510
|
+
z(this, "parser", new le());
|
|
1511
|
+
z(this, "config");
|
|
1176
1512
|
this.config = {
|
|
1177
1513
|
defaultResolution: t.defaultResolution ?? 200,
|
|
1178
1514
|
maxResolution: t.maxResolution ?? 1e3
|
|
@@ -1218,9 +1554,9 @@ class Te {
|
|
|
1218
1554
|
}
|
|
1219
1555
|
/** Compute 2D function points */
|
|
1220
1556
|
compute2DFunction(t, r, o, a) {
|
|
1221
|
-
const n = this.parser.parse(t), i = [],
|
|
1222
|
-
for (let
|
|
1223
|
-
const s = r.min +
|
|
1557
|
+
const n = this.parser.parse(t), i = [], l = (r.max - r.min) / o;
|
|
1558
|
+
for (let g = 0; g <= o; g++) {
|
|
1559
|
+
const s = r.min + g * l;
|
|
1224
1560
|
try {
|
|
1225
1561
|
const p = n({ x: s, ...a });
|
|
1226
1562
|
Number.isFinite(p) && i.push({ x: s, y: p });
|
|
@@ -1231,27 +1567,27 @@ class Te {
|
|
|
1231
1567
|
}
|
|
1232
1568
|
/** Compute 2D parametric curve */
|
|
1233
1569
|
compute2DParametric(t, r, o, a, n) {
|
|
1234
|
-
const i = this.parser.parse(t),
|
|
1570
|
+
const i = this.parser.parse(t), l = this.parser.parse(r), g = [], s = (o.max - o.min) / a;
|
|
1235
1571
|
for (let p = 0; p <= a; p++) {
|
|
1236
|
-
const
|
|
1572
|
+
const u = o.min + p * s;
|
|
1237
1573
|
try {
|
|
1238
|
-
const
|
|
1239
|
-
Number.isFinite(
|
|
1574
|
+
const x = i({ t: u, ...n }), f = l({ t: u, ...n });
|
|
1575
|
+
Number.isFinite(x) && Number.isFinite(f) && g.push({ x, y: f });
|
|
1240
1576
|
} catch {
|
|
1241
1577
|
}
|
|
1242
1578
|
}
|
|
1243
|
-
return
|
|
1579
|
+
return g;
|
|
1244
1580
|
}
|
|
1245
1581
|
/** Compute 2D polar curve */
|
|
1246
1582
|
compute2DPolar(t, r, o, a) {
|
|
1247
|
-
const n = this.parser.parse(t), i = [],
|
|
1248
|
-
for (let
|
|
1249
|
-
const s = r.min +
|
|
1583
|
+
const n = this.parser.parse(t), i = [], l = (r.max - r.min) / o;
|
|
1584
|
+
for (let g = 0; g <= o; g++) {
|
|
1585
|
+
const s = r.min + g * l;
|
|
1250
1586
|
try {
|
|
1251
1587
|
const p = n({ theta: s, t: s, ...a });
|
|
1252
1588
|
if (Number.isFinite(p)) {
|
|
1253
|
-
const
|
|
1254
|
-
i.push({ x:
|
|
1589
|
+
const u = p * Math.cos(s), x = p * Math.sin(s);
|
|
1590
|
+
i.push({ x: u, y: x });
|
|
1255
1591
|
}
|
|
1256
1592
|
} catch {
|
|
1257
1593
|
}
|
|
@@ -1260,52 +1596,52 @@ class Te {
|
|
|
1260
1596
|
}
|
|
1261
1597
|
/** Compute 3D surface points */
|
|
1262
1598
|
compute3DSurface(t, r, o, a, n) {
|
|
1263
|
-
const i = this.parser.parse(t),
|
|
1599
|
+
const i = this.parser.parse(t), l = [], g = (r.max - r.min) / a, s = (o.max - o.min) / a;
|
|
1264
1600
|
for (let p = 0; p <= a; p++) {
|
|
1265
|
-
const
|
|
1601
|
+
const u = [], x = r.min + p * g;
|
|
1266
1602
|
for (let f = 0; f <= a; f++) {
|
|
1267
|
-
const
|
|
1603
|
+
const w = o.min + f * s;
|
|
1268
1604
|
try {
|
|
1269
|
-
const
|
|
1270
|
-
Number.isFinite(
|
|
1605
|
+
const y = i({ x, y: w, ...n });
|
|
1606
|
+
Number.isFinite(y) ? u.push({ x, y: w, z: y }) : u.push({ x, y: w, z: 0 });
|
|
1271
1607
|
} catch {
|
|
1272
|
-
|
|
1608
|
+
u.push({ x, y: w, z: 0 });
|
|
1273
1609
|
}
|
|
1274
1610
|
}
|
|
1275
|
-
|
|
1611
|
+
l.push(u);
|
|
1276
1612
|
}
|
|
1277
|
-
return
|
|
1613
|
+
return l;
|
|
1278
1614
|
}
|
|
1279
1615
|
/** Export plot data as SVG */
|
|
1280
1616
|
exportSVG(t, r, o, a) {
|
|
1281
|
-
const i = o - 80,
|
|
1617
|
+
const i = o - 80, l = a - 80, g = (u) => 40 + (u - r.xRange.min) / (r.xRange.max - r.xRange.min) * i, s = (u) => a - 40 - (u - r.yRange.min) / (r.yRange.max - r.yRange.min) * l, p = [
|
|
1282
1618
|
`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${a}">`,
|
|
1283
1619
|
`<rect width="100%" height="100%" fill="rgb(${r.backgroundColor.r},${r.backgroundColor.g},${r.backgroundColor.b})"/>`
|
|
1284
1620
|
];
|
|
1285
1621
|
if (r.showGrid) {
|
|
1286
1622
|
p.push('<g stroke="var(--nice-border, #ddd)" stroke-width="0.5">');
|
|
1287
|
-
for (let
|
|
1288
|
-
const
|
|
1289
|
-
p.push(`<line x1="${
|
|
1623
|
+
for (let u = Math.ceil(r.xRange.min); u <= r.xRange.max; u++) {
|
|
1624
|
+
const x = g(u);
|
|
1625
|
+
p.push(`<line x1="${x}" y1="40" x2="${x}" y2="${a - 40}"/>`);
|
|
1290
1626
|
}
|
|
1291
|
-
for (let
|
|
1292
|
-
const
|
|
1293
|
-
p.push(`<line x1="40" y1="${
|
|
1627
|
+
for (let u = Math.ceil(r.yRange.min); u <= r.yRange.max; u++) {
|
|
1628
|
+
const x = s(u);
|
|
1629
|
+
p.push(`<line x1="40" y1="${x}" x2="${o - 40}" y2="${x}"/>`);
|
|
1294
1630
|
}
|
|
1295
1631
|
p.push("</g>");
|
|
1296
1632
|
}
|
|
1297
1633
|
if (r.showAxes) {
|
|
1298
1634
|
p.push('<g stroke="var(--nice-text, #333)" stroke-width="1">');
|
|
1299
|
-
const
|
|
1300
|
-
p.push(`<line x1="40" y1="${
|
|
1635
|
+
const u = s(0), x = g(0);
|
|
1636
|
+
p.push(`<line x1="40" y1="${u}" x2="${o - 40}" y2="${u}"/>`), p.push(`<line x1="${x}" y1="40" x2="${x}" y2="${a - 40}"/>`), p.push("</g>");
|
|
1301
1637
|
}
|
|
1302
|
-
for (const
|
|
1303
|
-
if (
|
|
1304
|
-
const
|
|
1305
|
-
if (
|
|
1306
|
-
const f =
|
|
1638
|
+
for (const u of t.filter((x) => x.visible))
|
|
1639
|
+
if (u.type === "2d-function") {
|
|
1640
|
+
const x = this.compute2DFunction(u.expression, r.xRange, u.resolution || 200);
|
|
1641
|
+
if (x.length > 0) {
|
|
1642
|
+
const f = x.map((w, y) => `${y === 0 ? "M" : "L"}${g(w.x)},${s(w.y)}`).join(" ");
|
|
1307
1643
|
p.push(
|
|
1308
|
-
`<path d="${f}" fill="none" stroke="rgb(${
|
|
1644
|
+
`<path d="${f}" fill="none" stroke="rgb(${u.color.r},${u.color.g},${u.color.b})" stroke-width="${u.lineWidth}"/>`
|
|
1309
1645
|
);
|
|
1310
1646
|
}
|
|
1311
1647
|
}
|
|
@@ -1319,26 +1655,26 @@ class Te {
|
|
|
1319
1655
|
/** Export as PNG (data URL) */
|
|
1320
1656
|
async exportPNG(t, r, o, a) {
|
|
1321
1657
|
const n = this.exportSVG(t, r, o, a);
|
|
1322
|
-
return new Promise((i,
|
|
1323
|
-
const
|
|
1324
|
-
|
|
1658
|
+
return new Promise((i, l) => {
|
|
1659
|
+
const g = new Image();
|
|
1660
|
+
g.onload = () => {
|
|
1325
1661
|
const s = document.createElement("canvas");
|
|
1326
1662
|
s.width = o, s.height = a;
|
|
1327
1663
|
const p = s.getContext("2d");
|
|
1328
1664
|
if (!p) {
|
|
1329
|
-
|
|
1665
|
+
l(new Error("Could not get canvas context"));
|
|
1330
1666
|
return;
|
|
1331
1667
|
}
|
|
1332
|
-
p.drawImage(
|
|
1333
|
-
},
|
|
1668
|
+
p.drawImage(g, 0, 0), i(s.toDataURL("image/png"));
|
|
1669
|
+
}, g.onerror = l, g.src = "data:image/svg+xml;base64," + btoa(n);
|
|
1334
1670
|
});
|
|
1335
1671
|
}
|
|
1336
1672
|
generateId() {
|
|
1337
1673
|
return Date.now().toString(36) + Math.random().toString(36).substring(2, 8);
|
|
1338
1674
|
}
|
|
1339
1675
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return new
|
|
1676
|
+
function ot(e) {
|
|
1677
|
+
return new $e(e);
|
|
1342
1678
|
}
|
|
1343
1679
|
const ee = [
|
|
1344
1680
|
// Basic
|
|
@@ -1423,14 +1759,14 @@ const ee = [
|
|
|
1423
1759
|
type: "3d-surface",
|
|
1424
1760
|
category: "3d"
|
|
1425
1761
|
}
|
|
1426
|
-
],
|
|
1427
|
-
function
|
|
1428
|
-
const e =
|
|
1762
|
+
], ce = /* @__PURE__ */ O(null);
|
|
1763
|
+
function V() {
|
|
1764
|
+
const e = F(ce);
|
|
1429
1765
|
if (!e)
|
|
1430
1766
|
throw new Error("useGraph must be used within GraphProvider");
|
|
1431
1767
|
return e;
|
|
1432
1768
|
}
|
|
1433
|
-
const
|
|
1769
|
+
const T = {
|
|
1434
1770
|
container: {
|
|
1435
1771
|
display: "flex",
|
|
1436
1772
|
height: "100%",
|
|
@@ -1489,14 +1825,14 @@ const $ = {
|
|
|
1489
1825
|
backgroundColor: "var(--nice-bg-secondary, #fafafa)"
|
|
1490
1826
|
}
|
|
1491
1827
|
};
|
|
1492
|
-
function
|
|
1828
|
+
function at({
|
|
1493
1829
|
service: e,
|
|
1494
1830
|
width: t = 800,
|
|
1495
1831
|
height: r = 600,
|
|
1496
1832
|
className: o,
|
|
1497
1833
|
style: a
|
|
1498
1834
|
}) {
|
|
1499
|
-
const [n, i] =
|
|
1835
|
+
const [n, i] = M([]), [l, g] = M({
|
|
1500
1836
|
xRange: { min: -10, max: 10 },
|
|
1501
1837
|
yRange: { min: -10, max: 10 },
|
|
1502
1838
|
zRange: { min: -5, max: 5 },
|
|
@@ -1507,59 +1843,59 @@ function rt({
|
|
|
1507
1843
|
cameraRotationX: 30,
|
|
1508
1844
|
cameraRotationY: 45,
|
|
1509
1845
|
cameraDistance: 5
|
|
1510
|
-
}), [s, p] =
|
|
1846
|
+
}), [s, p] = M({
|
|
1511
1847
|
isPlaying: !1,
|
|
1512
1848
|
parameter: "a",
|
|
1513
1849
|
currentValue: 0,
|
|
1514
1850
|
minValue: -5,
|
|
1515
1851
|
maxValue: 5,
|
|
1516
1852
|
speed: 1
|
|
1517
|
-
}),
|
|
1853
|
+
}), u = R(() => {
|
|
1518
1854
|
i(e.getPlots());
|
|
1519
|
-
}, [e]),
|
|
1520
|
-
|
|
1521
|
-
}, []), f = R((
|
|
1522
|
-
p((
|
|
1523
|
-
}, []),
|
|
1524
|
-
(
|
|
1525
|
-
e.addPlot(
|
|
1855
|
+
}, [e]), x = R((m) => {
|
|
1856
|
+
g((k) => ({ ...k, ...m }));
|
|
1857
|
+
}, []), f = R((m) => {
|
|
1858
|
+
p((k) => ({ ...k, ...m }));
|
|
1859
|
+
}, []), w = R(
|
|
1860
|
+
(m) => {
|
|
1861
|
+
e.addPlot(m), u();
|
|
1526
1862
|
},
|
|
1527
|
-
[e,
|
|
1528
|
-
),
|
|
1529
|
-
(
|
|
1530
|
-
e.removePlot(
|
|
1863
|
+
[e, u]
|
|
1864
|
+
), y = R(
|
|
1865
|
+
(m) => {
|
|
1866
|
+
e.removePlot(m), u();
|
|
1531
1867
|
},
|
|
1532
|
-
[e,
|
|
1868
|
+
[e, u]
|
|
1533
1869
|
), b = R(
|
|
1534
|
-
(
|
|
1535
|
-
e.updatePlot(
|
|
1870
|
+
(m, k) => {
|
|
1871
|
+
e.updatePlot(m, k), u();
|
|
1536
1872
|
},
|
|
1537
|
-
[e,
|
|
1538
|
-
),
|
|
1873
|
+
[e, u]
|
|
1874
|
+
), c = {
|
|
1539
1875
|
service: e,
|
|
1540
1876
|
plots: n,
|
|
1541
|
-
view:
|
|
1542
|
-
setView:
|
|
1543
|
-
addPlot:
|
|
1544
|
-
removePlot:
|
|
1877
|
+
view: l,
|
|
1878
|
+
setView: x,
|
|
1879
|
+
addPlot: w,
|
|
1880
|
+
removePlot: y,
|
|
1545
1881
|
updatePlot: b,
|
|
1546
1882
|
animation: s,
|
|
1547
1883
|
setAnimation: f,
|
|
1548
|
-
refresh:
|
|
1884
|
+
refresh: u
|
|
1549
1885
|
};
|
|
1550
|
-
return /* @__PURE__ */ d(
|
|
1551
|
-
/* @__PURE__ */ v("div", { style:
|
|
1552
|
-
/* @__PURE__ */ d(
|
|
1553
|
-
/* @__PURE__ */ d(
|
|
1886
|
+
return /* @__PURE__ */ d(ce.Provider, { value: c, children: /* @__PURE__ */ v("div", { className: o, style: { ...T.container, ...a }, children: [
|
|
1887
|
+
/* @__PURE__ */ v("div", { style: T.sidebar, children: [
|
|
1888
|
+
/* @__PURE__ */ d(Ie, {}),
|
|
1889
|
+
/* @__PURE__ */ d(Ee, {})
|
|
1554
1890
|
] }),
|
|
1555
|
-
/* @__PURE__ */ v("div", { style:
|
|
1556
|
-
/* @__PURE__ */ d(
|
|
1557
|
-
/* @__PURE__ */ d(
|
|
1891
|
+
/* @__PURE__ */ v("div", { style: T.main, children: [
|
|
1892
|
+
/* @__PURE__ */ d(De, { width: t, height: r }),
|
|
1893
|
+
/* @__PURE__ */ d(Le, { width: t, height: r })
|
|
1558
1894
|
] })
|
|
1559
1895
|
] }) });
|
|
1560
1896
|
}
|
|
1561
|
-
function
|
|
1562
|
-
const { t: e } =
|
|
1897
|
+
function Ie() {
|
|
1898
|
+
const { t: e } = E(), { addPlot: t } = V(), [r, o] = M("sin(x)"), [a, n] = M("2d-function"), [i, l] = M("cos(x)"), g = () => {
|
|
1563
1899
|
t({
|
|
1564
1900
|
type: a,
|
|
1565
1901
|
expression: r,
|
|
@@ -1577,12 +1913,12 @@ function Ae() {
|
|
|
1577
1913
|
{
|
|
1578
1914
|
value: a,
|
|
1579
1915
|
onChange: (s) => n(s.target.value),
|
|
1580
|
-
style: {
|
|
1916
|
+
style: { ...T.input, width: "100%" },
|
|
1581
1917
|
children: [
|
|
1582
1918
|
/* @__PURE__ */ d("option", { value: "2d-function", children: "y = f(x)" }),
|
|
1583
|
-
/* @__PURE__ */ d("option", { value: "2d-parametric", children: "Parametric (x(t), y(t))" }),
|
|
1584
|
-
/* @__PURE__ */ d("option", { value: "2d-polar", children: "Polar r = f(θ)" }),
|
|
1585
|
-
/* @__PURE__ */ d("option", { value: "3d-surface", children: "3D Surface z = f(x,y)" })
|
|
1919
|
+
/* @__PURE__ */ d("option", { value: "2d-parametric", children: e("plotter.parametricXTYT", "Parametric (x(t), y(t))") }),
|
|
1920
|
+
/* @__PURE__ */ d("option", { value: "2d-polar", children: e("plotter.polarRF", "Polar r = f(θ)") }),
|
|
1921
|
+
/* @__PURE__ */ d("option", { value: "3d-surface", children: e("plotter.n3dSurfaceZFX", "3D Surface z = f(x,y)") })
|
|
1586
1922
|
]
|
|
1587
1923
|
}
|
|
1588
1924
|
) }),
|
|
@@ -1592,8 +1928,8 @@ function Ae() {
|
|
|
1592
1928
|
type: "text",
|
|
1593
1929
|
value: r,
|
|
1594
1930
|
onChange: (s) => o(s.target.value),
|
|
1595
|
-
placeholder: a === "2d-parametric" ? "x(t) = ..." : "Expression...",
|
|
1596
|
-
style: {
|
|
1931
|
+
placeholder: a === "2d-parametric" ? "x(t) = ..." : e("plotter.expression", "Expression..."),
|
|
1932
|
+
style: { ...T.input, width: "100%" }
|
|
1597
1933
|
}
|
|
1598
1934
|
) }),
|
|
1599
1935
|
a === "2d-parametric" && /* @__PURE__ */ d("div", { style: { marginBottom: "8px" }, children: /* @__PURE__ */ d(
|
|
@@ -1601,17 +1937,17 @@ function Ae() {
|
|
|
1601
1937
|
{
|
|
1602
1938
|
type: "text",
|
|
1603
1939
|
value: i,
|
|
1604
|
-
onChange: (s) =>
|
|
1940
|
+
onChange: (s) => l(s.target.value),
|
|
1605
1941
|
placeholder: "y(t) = ...",
|
|
1606
|
-
style: {
|
|
1942
|
+
style: { ...T.input, width: "100%" }
|
|
1607
1943
|
}
|
|
1608
1944
|
) }),
|
|
1609
|
-
/* @__PURE__ */ d("button", { onClick:
|
|
1945
|
+
/* @__PURE__ */ d("button", { onClick: g, style: { ...T.button, width: "100%" }, children: e("plotter.addPlot", "+ Add Plot") }),
|
|
1610
1946
|
/* @__PURE__ */ v(
|
|
1611
1947
|
"select",
|
|
1612
1948
|
{
|
|
1613
1949
|
onChange: (s) => {
|
|
1614
|
-
const p = ee.find((
|
|
1950
|
+
const p = ee.find((u) => u.name === s.target.value);
|
|
1615
1951
|
p && t({
|
|
1616
1952
|
type: p.type,
|
|
1617
1953
|
expression: p.expression,
|
|
@@ -1624,7 +1960,7 @@ function Ae() {
|
|
|
1624
1960
|
}
|
|
1625
1961
|
});
|
|
1626
1962
|
},
|
|
1627
|
-
style: {
|
|
1963
|
+
style: { ...T.input, width: "100%", marginTop: "8px" },
|
|
1628
1964
|
value: "",
|
|
1629
1965
|
children: [
|
|
1630
1966
|
/* @__PURE__ */ d("option", { value: "", disabled: !0, children: e("plotter.quickAdd", "Quick add preset...") }),
|
|
@@ -1638,9 +1974,9 @@ function Ae() {
|
|
|
1638
1974
|
)
|
|
1639
1975
|
] });
|
|
1640
1976
|
}
|
|
1641
|
-
function
|
|
1642
|
-
const { t: e } =
|
|
1643
|
-
return /* @__PURE__ */ v("div", { style:
|
|
1977
|
+
function Ee() {
|
|
1978
|
+
const { t: e } = E(), { plots: t, removePlot: r, updatePlot: o } = V();
|
|
1979
|
+
return /* @__PURE__ */ v("div", { style: T.plotList, children: [
|
|
1644
1980
|
t.length === 0 && /* @__PURE__ */ d(
|
|
1645
1981
|
"div",
|
|
1646
1982
|
{
|
|
@@ -1652,7 +1988,7 @@ function ze() {
|
|
|
1652
1988
|
children: e("plotter.noPlots", "No plots added yet")
|
|
1653
1989
|
}
|
|
1654
1990
|
),
|
|
1655
|
-
t.map((a) => /* @__PURE__ */ v("div", { style:
|
|
1991
|
+
t.map((a) => /* @__PURE__ */ v("div", { style: T.plotItem, children: [
|
|
1656
1992
|
/* @__PURE__ */ v("div", { style: { display: "flex", alignItems: "center", gap: "8px", marginBottom: "8px" }, children: [
|
|
1657
1993
|
/* @__PURE__ */ d(
|
|
1658
1994
|
"input",
|
|
@@ -1688,7 +2024,7 @@ function ze() {
|
|
|
1688
2024
|
cursor: "pointer",
|
|
1689
2025
|
fontSize: "12px"
|
|
1690
2026
|
},
|
|
1691
|
-
children: /* @__PURE__ */ d(
|
|
2027
|
+
children: /* @__PURE__ */ d(j, { name: "close", size: 14 })
|
|
1692
2028
|
}
|
|
1693
2029
|
)
|
|
1694
2030
|
] }),
|
|
@@ -1712,15 +2048,15 @@ function ze() {
|
|
|
1712
2048
|
] }, a.id))
|
|
1713
2049
|
] });
|
|
1714
2050
|
}
|
|
1715
|
-
function
|
|
1716
|
-
const { t: r } =
|
|
1717
|
-
const s = o.exportSVG(a, n, e, t), p = new Blob([s], { type: "image/svg+xml" }),
|
|
1718
|
-
|
|
1719
|
-
},
|
|
2051
|
+
function De({ width: e, height: t }) {
|
|
2052
|
+
const { t: r } = E(), { service: o, plots: a, view: n, setView: i } = V(), l = () => {
|
|
2053
|
+
const s = o.exportSVG(a, n, e, t), p = new Blob([s], { type: "image/svg+xml" }), u = URL.createObjectURL(p), x = document.createElement("a");
|
|
2054
|
+
x.href = u, x.download = "graph.svg", x.click(), URL.revokeObjectURL(u);
|
|
2055
|
+
}, g = async () => {
|
|
1720
2056
|
const s = await o.exportPNG(a, n, e, t), p = document.createElement("a");
|
|
1721
2057
|
p.href = s, p.download = "graph.png", p.click();
|
|
1722
2058
|
};
|
|
1723
|
-
return /* @__PURE__ */ v("div", { style:
|
|
2059
|
+
return /* @__PURE__ */ v("div", { style: T.toolbar, children: [
|
|
1724
2060
|
/* @__PURE__ */ v("label", { style: { fontSize: "12px" }, children: [
|
|
1725
2061
|
"X: [",
|
|
1726
2062
|
" ",
|
|
@@ -1730,7 +2066,7 @@ function Ee({ width: e, height: t }) {
|
|
|
1730
2066
|
type: "number",
|
|
1731
2067
|
value: n.xRange.min,
|
|
1732
2068
|
onChange: (s) => i({ xRange: { ...n.xRange, min: Number(s.target.value) } }),
|
|
1733
|
-
style: {
|
|
2069
|
+
style: { ...T.input, width: "50px" }
|
|
1734
2070
|
}
|
|
1735
2071
|
),
|
|
1736
2072
|
",",
|
|
@@ -1741,7 +2077,7 @@ function Ee({ width: e, height: t }) {
|
|
|
1741
2077
|
type: "number",
|
|
1742
2078
|
value: n.xRange.max,
|
|
1743
2079
|
onChange: (s) => i({ xRange: { ...n.xRange, max: Number(s.target.value) } }),
|
|
1744
|
-
style: {
|
|
2080
|
+
style: { ...T.input, width: "50px" }
|
|
1745
2081
|
}
|
|
1746
2082
|
),
|
|
1747
2083
|
"]"
|
|
@@ -1755,7 +2091,7 @@ function Ee({ width: e, height: t }) {
|
|
|
1755
2091
|
type: "number",
|
|
1756
2092
|
value: n.yRange.min,
|
|
1757
2093
|
onChange: (s) => i({ yRange: { ...n.yRange, min: Number(s.target.value) } }),
|
|
1758
|
-
style: {
|
|
2094
|
+
style: { ...T.input, width: "50px" }
|
|
1759
2095
|
}
|
|
1760
2096
|
),
|
|
1761
2097
|
",",
|
|
@@ -1766,7 +2102,7 @@ function Ee({ width: e, height: t }) {
|
|
|
1766
2102
|
type: "number",
|
|
1767
2103
|
value: n.yRange.max,
|
|
1768
2104
|
onChange: (s) => i({ yRange: { ...n.yRange, max: Number(s.target.value) } }),
|
|
1769
|
-
style: {
|
|
2105
|
+
style: { ...T.input, width: "50px" }
|
|
1770
2106
|
}
|
|
1771
2107
|
),
|
|
1772
2108
|
"]"
|
|
@@ -1797,10 +2133,10 @@ function Ee({ width: e, height: t }) {
|
|
|
1797
2133
|
/* @__PURE__ */ v(
|
|
1798
2134
|
"button",
|
|
1799
2135
|
{
|
|
1800
|
-
onClick:
|
|
1801
|
-
style: {
|
|
2136
|
+
onClick: l,
|
|
2137
|
+
style: { ...T.button, backgroundColor: "var(--nice-success, #4caf50)" },
|
|
1802
2138
|
children: [
|
|
1803
|
-
/* @__PURE__ */ d(
|
|
2139
|
+
/* @__PURE__ */ d(j, { name: "download", size: 14 }),
|
|
1804
2140
|
" SVG"
|
|
1805
2141
|
]
|
|
1806
2142
|
}
|
|
@@ -1808,97 +2144,97 @@ function Ee({ width: e, height: t }) {
|
|
|
1808
2144
|
/* @__PURE__ */ v(
|
|
1809
2145
|
"button",
|
|
1810
2146
|
{
|
|
1811
|
-
onClick:
|
|
1812
|
-
style: {
|
|
2147
|
+
onClick: g,
|
|
2148
|
+
style: { ...T.button, backgroundColor: "var(--nice-warning, #ff9800)" },
|
|
1813
2149
|
children: [
|
|
1814
|
-
/* @__PURE__ */ d(
|
|
2150
|
+
/* @__PURE__ */ d(j, { name: "download", size: 14 }),
|
|
1815
2151
|
" PNG"
|
|
1816
2152
|
]
|
|
1817
2153
|
}
|
|
1818
2154
|
)
|
|
1819
2155
|
] });
|
|
1820
2156
|
}
|
|
1821
|
-
function
|
|
1822
|
-
const r = U(null), { service: o, plots: a, view: n, animation: i } =
|
|
1823
|
-
return
|
|
1824
|
-
const
|
|
1825
|
-
if (!
|
|
2157
|
+
function Le({ width: e, height: t }) {
|
|
2158
|
+
const r = U(null), { service: o, plots: a, view: n, animation: i } = V(), l = 40;
|
|
2159
|
+
return Y(() => {
|
|
2160
|
+
const g = r.current, s = g == null ? void 0 : g.getContext("2d");
|
|
2161
|
+
if (!g || !s)
|
|
1826
2162
|
return;
|
|
1827
2163
|
s.fillStyle = `rgb(${n.backgroundColor.r},${n.backgroundColor.g},${n.backgroundColor.b})`, s.fillRect(0, 0, e, t);
|
|
1828
|
-
const p = e -
|
|
2164
|
+
const p = e - l * 2, u = t - l * 2, x = (y) => l + (y - n.xRange.min) / (n.xRange.max - n.xRange.min) * p, f = (y) => t - l - (y - n.yRange.min) / (n.yRange.max - n.yRange.min) * u;
|
|
1829
2165
|
if (n.showGrid) {
|
|
1830
|
-
s.strokeStyle =
|
|
1831
|
-
for (let
|
|
1832
|
-
const b = y
|
|
1833
|
-
s.beginPath(), s.moveTo(b,
|
|
2166
|
+
s.strokeStyle = D("var(--nice-border, #e0e0e0)", s.canvas), s.lineWidth = 0.5;
|
|
2167
|
+
for (let y = Math.ceil(n.xRange.min); y <= n.xRange.max; y++) {
|
|
2168
|
+
const b = x(y);
|
|
2169
|
+
s.beginPath(), s.moveTo(b, l), s.lineTo(b, t - l), s.stroke();
|
|
1834
2170
|
}
|
|
1835
|
-
for (let
|
|
1836
|
-
const b = f(
|
|
1837
|
-
s.beginPath(), s.moveTo(
|
|
2171
|
+
for (let y = Math.ceil(n.yRange.min); y <= n.yRange.max; y++) {
|
|
2172
|
+
const b = f(y);
|
|
2173
|
+
s.beginPath(), s.moveTo(l, b), s.lineTo(e - l, b), s.stroke();
|
|
1838
2174
|
}
|
|
1839
2175
|
}
|
|
1840
2176
|
if (n.showAxes) {
|
|
1841
|
-
s.strokeStyle =
|
|
1842
|
-
const
|
|
1843
|
-
s.beginPath(), s.moveTo(
|
|
1844
|
-
const b =
|
|
1845
|
-
if (s.beginPath(), s.moveTo(b,
|
|
1846
|
-
s.fillStyle =
|
|
1847
|
-
for (let
|
|
1848
|
-
|
|
1849
|
-
for (let
|
|
1850
|
-
|
|
2177
|
+
s.strokeStyle = D("var(--nice-text, #333)", s.canvas), s.lineWidth = 1;
|
|
2178
|
+
const y = f(0);
|
|
2179
|
+
s.beginPath(), s.moveTo(l, y), s.lineTo(e - l, y), s.stroke();
|
|
2180
|
+
const b = x(0);
|
|
2181
|
+
if (s.beginPath(), s.moveTo(b, l), s.lineTo(b, t - l), s.stroke(), n.showLabels) {
|
|
2182
|
+
s.fillStyle = D("var(--nice-text, #333)", s.canvas), s.font = "12px sans-serif", s.textAlign = "center", s.fillText("x", e - l + 15, y + 4), s.fillText("y", b, l - 10), s.font = "10px sans-serif";
|
|
2183
|
+
for (let c = Math.ceil(n.xRange.min); c <= n.xRange.max; c++)
|
|
2184
|
+
c !== 0 && s.fillText(String(c), x(c), y + 15);
|
|
2185
|
+
for (let c = Math.ceil(n.yRange.min); c <= n.yRange.max; c++)
|
|
2186
|
+
c !== 0 && (s.textAlign = "right", s.fillText(String(c), b - 5, f(c) + 4));
|
|
1851
2187
|
}
|
|
1852
2188
|
}
|
|
1853
|
-
const
|
|
1854
|
-
for (const
|
|
1855
|
-
const b = `rgb(${
|
|
1856
|
-
s.strokeStyle = b, s.lineWidth =
|
|
1857
|
-
let
|
|
1858
|
-
switch (
|
|
2189
|
+
const w = i.isPlaying ? { [i.parameter]: i.currentValue } : {};
|
|
2190
|
+
for (const y of a.filter((b) => b.visible)) {
|
|
2191
|
+
const b = `rgb(${y.color.r},${y.color.g},${y.color.b})`;
|
|
2192
|
+
s.strokeStyle = b, s.lineWidth = y.lineWidth || 2;
|
|
2193
|
+
let c = [];
|
|
2194
|
+
switch (y.type) {
|
|
1859
2195
|
case "2d-function":
|
|
1860
|
-
|
|
1861
|
-
|
|
2196
|
+
c = o.compute2DFunction(
|
|
2197
|
+
y.expression,
|
|
1862
2198
|
n.xRange,
|
|
1863
|
-
|
|
1864
|
-
|
|
2199
|
+
y.resolution || 200,
|
|
2200
|
+
w
|
|
1865
2201
|
);
|
|
1866
2202
|
break;
|
|
1867
2203
|
case "2d-parametric":
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
2204
|
+
c = o.compute2DParametric(
|
|
2205
|
+
y.expression,
|
|
2206
|
+
y.expressionY || "sin(t)",
|
|
2207
|
+
y.parameterRange || { min: 0, max: 2 * Math.PI },
|
|
2208
|
+
y.resolution || 200,
|
|
2209
|
+
w
|
|
1874
2210
|
);
|
|
1875
2211
|
break;
|
|
1876
2212
|
case "2d-polar":
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
2213
|
+
c = o.compute2DPolar(
|
|
2214
|
+
y.expression,
|
|
2215
|
+
y.parameterRange || { min: 0, max: 2 * Math.PI },
|
|
2216
|
+
y.resolution || 200,
|
|
2217
|
+
w
|
|
1882
2218
|
);
|
|
1883
2219
|
break;
|
|
1884
2220
|
}
|
|
1885
|
-
if (
|
|
2221
|
+
if (c.length > 0) {
|
|
1886
2222
|
s.beginPath();
|
|
1887
|
-
let
|
|
1888
|
-
for (const
|
|
1889
|
-
const
|
|
2223
|
+
let m = !1;
|
|
2224
|
+
for (const k of c) {
|
|
2225
|
+
const C = x(k.x), h = f(k.y);
|
|
1890
2226
|
if (h < 0 || h > t) {
|
|
1891
|
-
|
|
2227
|
+
m = !1;
|
|
1892
2228
|
continue;
|
|
1893
2229
|
}
|
|
1894
|
-
|
|
2230
|
+
m ? s.lineTo(C, h) : (s.moveTo(C, h), m = !0);
|
|
1895
2231
|
}
|
|
1896
2232
|
s.stroke();
|
|
1897
2233
|
}
|
|
1898
2234
|
}
|
|
1899
|
-
}, [a, n, i, o, e, t]), /* @__PURE__ */ d("canvas", { ref: r, width: e, height: t, style:
|
|
2235
|
+
}, [a, n, i, o, e, t]), /* @__PURE__ */ d("canvas", { ref: r, width: e, height: t, style: T.canvas });
|
|
1900
2236
|
}
|
|
1901
|
-
const
|
|
2237
|
+
const G = [
|
|
1902
2238
|
// Length
|
|
1903
2239
|
{ name: "Meter", symbol: "m", category: "Length", toBase: (e) => e, fromBase: (e) => e },
|
|
1904
2240
|
{
|
|
@@ -2168,7 +2504,7 @@ const O = [
|
|
|
2168
2504
|
fromBase: (e) => e / 1099511627776
|
|
2169
2505
|
},
|
|
2170
2506
|
{ name: "Bit", symbol: "bit", category: "Data", toBase: (e) => e / 8, fromBase: (e) => e * 8 }
|
|
2171
|
-
],
|
|
2507
|
+
], $ = {
|
|
2172
2508
|
create(e, t, r = 0) {
|
|
2173
2509
|
const o = [];
|
|
2174
2510
|
for (let a = 0; a < e; a++)
|
|
@@ -2245,8 +2581,8 @@ const O = [
|
|
|
2245
2581
|
if (n === t)
|
|
2246
2582
|
continue;
|
|
2247
2583
|
let i = 0;
|
|
2248
|
-
for (let
|
|
2249
|
-
|
|
2584
|
+
for (let l = 0; l < e.cols; l++)
|
|
2585
|
+
l !== r && (o.data[a][i] = e.data[n][l], i++);
|
|
2250
2586
|
a++;
|
|
2251
2587
|
}
|
|
2252
2588
|
return o;
|
|
@@ -2258,8 +2594,8 @@ const O = [
|
|
|
2258
2594
|
const r = e.rows, o = this.create(r, r);
|
|
2259
2595
|
for (let a = 0; a < r; a++)
|
|
2260
2596
|
for (let n = 0; n < r; n++) {
|
|
2261
|
-
const i = Math.pow(-1, a + n),
|
|
2262
|
-
o.data[n][a] = i *
|
|
2597
|
+
const i = Math.pow(-1, a + n), l = this.determinant(this.minor(e, a, n));
|
|
2598
|
+
o.data[n][a] = i * l;
|
|
2263
2599
|
}
|
|
2264
2600
|
return this.scalar(o, 1 / t);
|
|
2265
2601
|
},
|
|
@@ -2274,11 +2610,11 @@ const O = [
|
|
|
2274
2610
|
eigenvalues2x2(e) {
|
|
2275
2611
|
if (e.rows !== 2 || e.cols !== 2)
|
|
2276
2612
|
throw new Error("Only 2x2 matrices supported for eigenvalues");
|
|
2277
|
-
const t = e.data[0][0], r = e.data[0][1], o = e.data[1][0], a = e.data[1][1], n = t + a, i = t * a - r * o,
|
|
2278
|
-
if (
|
|
2613
|
+
const t = e.data[0][0], r = e.data[0][1], o = e.data[1][0], a = e.data[1][1], n = t + a, i = t * a - r * o, l = n * n - 4 * i;
|
|
2614
|
+
if (l < 0)
|
|
2279
2615
|
throw new Error("Complex eigenvalues not supported");
|
|
2280
|
-
const
|
|
2281
|
-
return [(n +
|
|
2616
|
+
const g = Math.sqrt(l);
|
|
2617
|
+
return [(n + g) / 2, (n - g) / 2];
|
|
2282
2618
|
},
|
|
2283
2619
|
toString(e, t = 4) {
|
|
2284
2620
|
return e.data.map((r) => "[ " + r.map((o) => o.toFixed(t).padStart(10)).join(" ") + " ]").join(`
|
|
@@ -2299,8 +2635,8 @@ const O = [
|
|
|
2299
2635
|
const a = (r - t) / o;
|
|
2300
2636
|
let n = e(t) + e(r);
|
|
2301
2637
|
for (let i = 1; i < o; i++) {
|
|
2302
|
-
const
|
|
2303
|
-
n += i % 2 === 0 ? 2 * e(
|
|
2638
|
+
const l = t + i * a;
|
|
2639
|
+
n += i % 2 === 0 ? 2 * e(l) : 4 * e(l);
|
|
2304
2640
|
}
|
|
2305
2641
|
return a / 3 * n;
|
|
2306
2642
|
},
|
|
@@ -2311,10 +2647,10 @@ const O = [
|
|
|
2311
2647
|
const i = e(a);
|
|
2312
2648
|
if (Math.abs(i) < r)
|
|
2313
2649
|
return a;
|
|
2314
|
-
const
|
|
2315
|
-
if (
|
|
2650
|
+
const l = this.derivative(e, a);
|
|
2651
|
+
if (l === 0)
|
|
2316
2652
|
throw new Error("Derivative is zero, Newton-Raphson failed");
|
|
2317
|
-
a = a - i /
|
|
2653
|
+
a = a - i / l;
|
|
2318
2654
|
}
|
|
2319
2655
|
throw new Error("Newton-Raphson did not converge");
|
|
2320
2656
|
},
|
|
@@ -2360,12 +2696,12 @@ const O = [
|
|
|
2360
2696
|
return [(-t + a) / (2 * e), (-t - a) / (2 * e)];
|
|
2361
2697
|
}
|
|
2362
2698
|
};
|
|
2363
|
-
class
|
|
2699
|
+
class qe {
|
|
2364
2700
|
constructor(t = {}) {
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2701
|
+
z(this, "history", []);
|
|
2702
|
+
z(this, "memory", 0);
|
|
2703
|
+
z(this, "variables", /* @__PURE__ */ new Map());
|
|
2704
|
+
z(this, "config");
|
|
2369
2705
|
this.config = {
|
|
2370
2706
|
precision: t.precision ?? 12,
|
|
2371
2707
|
angleUnit: t.angleUnit ?? "rad"
|
|
@@ -2378,24 +2714,24 @@ class Le {
|
|
|
2378
2714
|
* `log` is base 10 like the key, `ln` natural; trig functions follow `angleUnit`.
|
|
2379
2715
|
*/
|
|
2380
2716
|
evaluate(t) {
|
|
2381
|
-
const r = this.config.angleUnit === "deg", o = (
|
|
2717
|
+
const r = this.config.angleUnit === "deg", o = (l) => r ? l * Math.PI / 180 : l, a = (l) => r ? l * 180 / Math.PI : l, n = new le({
|
|
2382
2718
|
strict: !0,
|
|
2383
2719
|
ignoreCase: !0,
|
|
2384
2720
|
functions: {
|
|
2385
2721
|
log: Math.log10,
|
|
2386
|
-
sin: (
|
|
2387
|
-
cos: (
|
|
2388
|
-
tan: (
|
|
2389
|
-
asin: (
|
|
2390
|
-
acos: (
|
|
2391
|
-
atan: (
|
|
2722
|
+
sin: (l) => Math.sin(o(l)),
|
|
2723
|
+
cos: (l) => Math.cos(o(l)),
|
|
2724
|
+
tan: (l) => Math.tan(o(l)),
|
|
2725
|
+
asin: (l) => a(Math.asin(l)),
|
|
2726
|
+
acos: (l) => a(Math.acos(l)),
|
|
2727
|
+
atan: (l) => a(Math.atan(l))
|
|
2392
2728
|
}
|
|
2393
2729
|
});
|
|
2394
2730
|
let i;
|
|
2395
2731
|
try {
|
|
2396
2732
|
i = n.parse(t)(Object.fromEntries(this.variables));
|
|
2397
|
-
} catch (
|
|
2398
|
-
throw new Error(`Invalid expression: ${
|
|
2733
|
+
} catch (l) {
|
|
2734
|
+
throw new Error(`Invalid expression: ${l.message}`);
|
|
2399
2735
|
}
|
|
2400
2736
|
if (!Number.isFinite(i))
|
|
2401
2737
|
throw new Error("Invalid expression: Invalid result");
|
|
@@ -2448,7 +2784,7 @@ class Le {
|
|
|
2448
2784
|
}
|
|
2449
2785
|
/** Convert units */
|
|
2450
2786
|
convertUnits(t, r, o) {
|
|
2451
|
-
const a =
|
|
2787
|
+
const a = G.find((l) => l.symbol === r), n = G.find((l) => l.symbol === o);
|
|
2452
2788
|
if (!a || !n)
|
|
2453
2789
|
throw new Error("Unknown unit");
|
|
2454
2790
|
if (a.category !== n.category)
|
|
@@ -2458,11 +2794,11 @@ class Le {
|
|
|
2458
2794
|
}
|
|
2459
2795
|
/** Get units by category */
|
|
2460
2796
|
getUnitsByCategory(t) {
|
|
2461
|
-
return
|
|
2797
|
+
return G.filter((r) => r.category === t);
|
|
2462
2798
|
}
|
|
2463
2799
|
/** Get all unit categories */
|
|
2464
2800
|
getUnitCategories() {
|
|
2465
|
-
return [...new Set(
|
|
2801
|
+
return [...new Set(G.map((t) => t.category))];
|
|
2466
2802
|
}
|
|
2467
2803
|
/** Format number with precision */
|
|
2468
2804
|
format(t) {
|
|
@@ -2470,12 +2806,12 @@ class Le {
|
|
|
2470
2806
|
return Math.abs(t) < 1e-10 ? "0" : Math.abs(t) > 1e10 || Math.abs(t) < 1e-6 ? t.toExponential(r) : parseFloat(t.toPrecision(r)).toString();
|
|
2471
2807
|
}
|
|
2472
2808
|
}
|
|
2473
|
-
function
|
|
2474
|
-
return new
|
|
2809
|
+
function nt(e) {
|
|
2810
|
+
return new qe(e);
|
|
2475
2811
|
}
|
|
2476
|
-
const
|
|
2477
|
-
function
|
|
2478
|
-
const e =
|
|
2812
|
+
const de = /* @__PURE__ */ O(null);
|
|
2813
|
+
function X() {
|
|
2814
|
+
const e = F(de);
|
|
2479
2815
|
if (!e)
|
|
2480
2816
|
throw new Error("useCalculator must be used within CalculatorProvider");
|
|
2481
2817
|
return e;
|
|
@@ -2538,76 +2874,77 @@ const B = {
|
|
|
2538
2874
|
backgroundColor: "var(--nice-bg-tertiary, #505050)"
|
|
2539
2875
|
}
|
|
2540
2876
|
};
|
|
2541
|
-
function
|
|
2877
|
+
function it({
|
|
2542
2878
|
service: e,
|
|
2543
2879
|
className: t,
|
|
2544
2880
|
style: r
|
|
2545
2881
|
}) {
|
|
2546
|
-
const [o, a] =
|
|
2547
|
-
(
|
|
2548
|
-
s && /[0-9.]/.test(
|
|
2882
|
+
const [o, a] = M("0"), [n, i] = M("standard"), [l, g] = M([]), [s, p] = M(!1), u = R(
|
|
2883
|
+
(y) => {
|
|
2884
|
+
s && /[0-9.]/.test(y) ? (a(y), p(!1)) : (a((b) => b === "0" && y !== "." ? y : b + y), p(!1));
|
|
2549
2885
|
},
|
|
2550
2886
|
[s]
|
|
2551
|
-
),
|
|
2887
|
+
), x = R(() => {
|
|
2552
2888
|
a("0"), p(!1);
|
|
2553
2889
|
}, []), f = R(() => {
|
|
2554
2890
|
try {
|
|
2555
|
-
const
|
|
2556
|
-
e.addHistory(o, b, n),
|
|
2891
|
+
const y = e.evaluate(o), b = e.format(y);
|
|
2892
|
+
e.addHistory(o, b, n), g(e.getHistory()), a(b), p(!0);
|
|
2557
2893
|
} catch {
|
|
2558
2894
|
a("Error"), p(!0);
|
|
2559
2895
|
}
|
|
2560
|
-
}, [o, n, e]),
|
|
2896
|
+
}, [o, n, e]), w = {
|
|
2561
2897
|
service: e,
|
|
2562
2898
|
display: o,
|
|
2563
2899
|
setDisplay: a,
|
|
2564
2900
|
mode: n,
|
|
2565
2901
|
setMode: i,
|
|
2566
|
-
history:
|
|
2902
|
+
history: l,
|
|
2567
2903
|
calculate: f,
|
|
2568
|
-
appendDigit:
|
|
2569
|
-
clear:
|
|
2904
|
+
appendDigit: u,
|
|
2905
|
+
clear: x
|
|
2570
2906
|
};
|
|
2571
|
-
return /* @__PURE__ */ d(
|
|
2572
|
-
/* @__PURE__ */ d(
|
|
2573
|
-
/* @__PURE__ */ d(
|
|
2574
|
-
n === "standard" && /* @__PURE__ */ d(
|
|
2575
|
-
n === "scientific" && /* @__PURE__ */ d(
|
|
2576
|
-
n === "programmer" && /* @__PURE__ */ d(
|
|
2577
|
-
n === "matrix" && /* @__PURE__ */ d(
|
|
2578
|
-
n === "calculus" && /* @__PURE__ */ d(
|
|
2579
|
-
n === "units" && /* @__PURE__ */ d(
|
|
2907
|
+
return /* @__PURE__ */ d(de.Provider, { value: w, children: /* @__PURE__ */ v("div", { className: t, style: { ...B.container, ...r }, children: [
|
|
2908
|
+
/* @__PURE__ */ d(Xe, {}),
|
|
2909
|
+
/* @__PURE__ */ d(Ne, {}),
|
|
2910
|
+
n === "standard" && /* @__PURE__ */ d(pe, {}),
|
|
2911
|
+
n === "scientific" && /* @__PURE__ */ d(je, {}),
|
|
2912
|
+
n === "programmer" && /* @__PURE__ */ d(Fe, {}),
|
|
2913
|
+
n === "matrix" && /* @__PURE__ */ d(Oe, {}),
|
|
2914
|
+
n === "calculus" && /* @__PURE__ */ d(Ge, {}),
|
|
2915
|
+
n === "units" && /* @__PURE__ */ d(Ue, {})
|
|
2580
2916
|
] }) });
|
|
2581
2917
|
}
|
|
2582
|
-
function
|
|
2583
|
-
const {
|
|
2584
|
-
{ id: "standard", label: "Standard" },
|
|
2585
|
-
{ id: "scientific", label: "Scientific" },
|
|
2586
|
-
{ id: "programmer", label: "Programmer" },
|
|
2587
|
-
{ id: "matrix", label: "Matrix" },
|
|
2588
|
-
{ id: "calculus", label: "Calculus" },
|
|
2589
|
-
{ id: "units", label: "Units" }
|
|
2918
|
+
function Xe() {
|
|
2919
|
+
const { t: e } = E(), { mode: t, setMode: r } = X(), o = [
|
|
2920
|
+
{ id: "standard", label: e("calculator.standard", "Standard") },
|
|
2921
|
+
{ id: "scientific", label: e("calculator.scientific", "Scientific") },
|
|
2922
|
+
{ id: "programmer", label: e("calculator.programmer", "Programmer") },
|
|
2923
|
+
{ id: "matrix", label: e("calculator.matrix", "Matrix") },
|
|
2924
|
+
{ id: "calculus", label: e("calculator.calculus", "Calculus") },
|
|
2925
|
+
{ id: "units", label: e("calculator.units", "Units") }
|
|
2590
2926
|
];
|
|
2591
|
-
return /* @__PURE__ */ d("div", { style: B.modeSelector, children:
|
|
2927
|
+
return /* @__PURE__ */ d("div", { style: B.modeSelector, children: o.map((a) => /* @__PURE__ */ d(
|
|
2592
2928
|
"button",
|
|
2593
2929
|
{
|
|
2594
|
-
onClick: () =>
|
|
2930
|
+
onClick: () => r(a.id),
|
|
2595
2931
|
style: {
|
|
2596
2932
|
...B.modeButton,
|
|
2597
|
-
backgroundColor:
|
|
2598
|
-
color:
|
|
2933
|
+
backgroundColor: t === a.id ? "var(--nice-primary-hover, #1976d2)" : "transparent",
|
|
2934
|
+
color: t === a.id ? "var(--nice-color-white, #fff)" : "var(--nice-text-secondary, #888)"
|
|
2599
2935
|
},
|
|
2600
|
-
children:
|
|
2936
|
+
children: a.label
|
|
2601
2937
|
},
|
|
2602
|
-
|
|
2938
|
+
a.id
|
|
2603
2939
|
)) });
|
|
2604
2940
|
}
|
|
2605
|
-
function
|
|
2606
|
-
const { display: e } =
|
|
2941
|
+
function Ne() {
|
|
2942
|
+
const { display: e } = X();
|
|
2607
2943
|
return /* @__PURE__ */ d("div", { style: B.display, children: /* @__PURE__ */ d("div", { style: B.displayText, children: e }) });
|
|
2608
2944
|
}
|
|
2609
|
-
function
|
|
2610
|
-
const { appendDigit: e, clear: t, calculate: r, setDisplay: o, display: a } =
|
|
2945
|
+
function pe() {
|
|
2946
|
+
const { appendDigit: e, clear: t, calculate: r, setDisplay: o, display: a } = X(), n = [
|
|
2947
|
+
// audit-allow: i18n — the calculator key, the same in every language
|
|
2611
2948
|
{ label: "AC", action: t, style: B.keyFunction },
|
|
2612
2949
|
{
|
|
2613
2950
|
label: "±",
|
|
@@ -2633,16 +2970,16 @@ function le() {
|
|
|
2633
2970
|
{ label: "⌫", action: () => o(a.length > 1 ? a.slice(0, -1) : "0") },
|
|
2634
2971
|
{ label: "=", action: r, style: B.keyOperator }
|
|
2635
2972
|
];
|
|
2636
|
-
return /* @__PURE__ */ d("div", { style: B.keypad, children: n.map((i,
|
|
2973
|
+
return /* @__PURE__ */ d("div", { style: B.keypad, children: n.map((i, l) => /* @__PURE__ */ d("button", { onClick: i.action, style: { ...B.key, ...i.style || {} }, children: i.label }, l)) });
|
|
2637
2974
|
}
|
|
2638
|
-
function
|
|
2975
|
+
function je() {
|
|
2639
2976
|
const {
|
|
2640
2977
|
appendDigit: e,
|
|
2641
2978
|
clear: t,
|
|
2642
2979
|
calculate: r,
|
|
2643
2980
|
setDisplay: o,
|
|
2644
2981
|
display: a
|
|
2645
|
-
} =
|
|
2982
|
+
} = X(), n = [
|
|
2646
2983
|
{ label: "sin", action: () => e("sin(") },
|
|
2647
2984
|
{ label: "cos", action: () => e("cos(") },
|
|
2648
2985
|
{ label: "tan", action: () => e("tan(") },
|
|
@@ -2651,34 +2988,37 @@ function Ne() {
|
|
|
2651
2988
|
], i = [
|
|
2652
2989
|
{ label: "x²", action: () => e("^2") },
|
|
2653
2990
|
{ label: "x³", action: () => e("^3") },
|
|
2991
|
+
// audit-allow: i18n — math notation
|
|
2654
2992
|
{ label: "xʸ", action: () => e("^") },
|
|
2655
2993
|
{ label: "√", action: () => e("sqrt(") },
|
|
2994
|
+
// audit-allow: i18n — math notation
|
|
2656
2995
|
{ label: "eˣ", action: () => e("exp(") }
|
|
2657
|
-
],
|
|
2996
|
+
], l = [
|
|
2658
2997
|
{ label: "(", action: () => e("(") },
|
|
2659
2998
|
{ label: ")", action: () => e(")") },
|
|
2660
2999
|
{ label: "π", action: () => e("π") },
|
|
2661
3000
|
{ label: "e", action: () => e("e") },
|
|
3001
|
+
// audit-allow: i18n — the calculator key, the same in every language
|
|
2662
3002
|
{ label: "AC", action: t }
|
|
2663
3003
|
];
|
|
2664
3004
|
return /* @__PURE__ */ v("div", { children: [
|
|
2665
|
-
/* @__PURE__ */ d("div", { style: { ...B.keypad, gridTemplateColumns: "repeat(5, 1fr)" }, children: [...n, ...i, ...
|
|
3005
|
+
/* @__PURE__ */ d("div", { style: { ...B.keypad, gridTemplateColumns: "repeat(5, 1fr)" }, children: [...n, ...i, ...l].map((g, s) => /* @__PURE__ */ d(
|
|
2666
3006
|
"button",
|
|
2667
3007
|
{
|
|
2668
|
-
onClick:
|
|
3008
|
+
onClick: g.action,
|
|
2669
3009
|
style: { ...B.key, ...B.keyFunction, padding: "12px" },
|
|
2670
|
-
children:
|
|
3010
|
+
children: g.label
|
|
2671
3011
|
},
|
|
2672
3012
|
s
|
|
2673
3013
|
)) }),
|
|
2674
|
-
/* @__PURE__ */ d(
|
|
3014
|
+
/* @__PURE__ */ d(pe, {})
|
|
2675
3015
|
] });
|
|
2676
3016
|
}
|
|
2677
|
-
function
|
|
2678
|
-
const { display: e, setDisplay: t, service: r } =
|
|
3017
|
+
function Fe() {
|
|
3018
|
+
const { display: e, setDisplay: t, service: r } = X(), [o, a] = M("DEC"), n = (l) => {
|
|
2679
3019
|
try {
|
|
2680
|
-
const
|
|
2681
|
-
t(
|
|
3020
|
+
const g = r.convertBase(e, o, l);
|
|
3021
|
+
t(g), a(l);
|
|
2682
3022
|
} catch {
|
|
2683
3023
|
t("Error");
|
|
2684
3024
|
}
|
|
@@ -2693,33 +3033,33 @@ function Xe() {
|
|
|
2693
3033
|
padding: "8px",
|
|
2694
3034
|
backgroundColor: "var(--nice-bg-secondary, #252525)"
|
|
2695
3035
|
},
|
|
2696
|
-
children: ["BIN", "OCT", "DEC", "HEX"].map((
|
|
3036
|
+
children: ["BIN", "OCT", "DEC", "HEX"].map((l) => /* @__PURE__ */ d(
|
|
2697
3037
|
"button",
|
|
2698
3038
|
{
|
|
2699
|
-
onClick: () => n(
|
|
3039
|
+
onClick: () => n(l),
|
|
2700
3040
|
style: {
|
|
2701
3041
|
flex: 1,
|
|
2702
3042
|
padding: "8px",
|
|
2703
3043
|
border: "none",
|
|
2704
3044
|
borderRadius: "4px",
|
|
2705
|
-
backgroundColor: o ===
|
|
3045
|
+
backgroundColor: o === l ? "var(--nice-primary-hover, #1976d2)" : "var(--nice-border, #3c3c3c)",
|
|
2706
3046
|
color: "var(--nice-color-white, #fff)",
|
|
2707
3047
|
cursor: "pointer"
|
|
2708
3048
|
},
|
|
2709
|
-
children:
|
|
3049
|
+
children: l
|
|
2710
3050
|
},
|
|
2711
|
-
|
|
3051
|
+
l
|
|
2712
3052
|
))
|
|
2713
3053
|
}
|
|
2714
3054
|
),
|
|
2715
|
-
i.length > 0 && /* @__PURE__ */ d("div", { style: { ...B.keypad, gridTemplateColumns: "repeat(6, 1fr)" }, children: i.map((
|
|
3055
|
+
i.length > 0 && /* @__PURE__ */ d("div", { style: { ...B.keypad, gridTemplateColumns: "repeat(6, 1fr)" }, children: i.map((l) => /* @__PURE__ */ d(
|
|
2716
3056
|
"button",
|
|
2717
3057
|
{
|
|
2718
|
-
onClick: () => t(e === "0" ?
|
|
3058
|
+
onClick: () => t(e === "0" ? l : e + l),
|
|
2719
3059
|
style: B.key,
|
|
2720
|
-
children:
|
|
3060
|
+
children: l
|
|
2721
3061
|
},
|
|
2722
|
-
|
|
3062
|
+
l
|
|
2723
3063
|
)) }),
|
|
2724
3064
|
/* @__PURE__ */ d("div", { style: { ...B.keypad, gridTemplateColumns: "repeat(4, 1fr)" }, children: [
|
|
2725
3065
|
"7",
|
|
@@ -2738,31 +3078,33 @@ function Xe() {
|
|
|
2738
3078
|
"NOT",
|
|
2739
3079
|
"<<",
|
|
2740
3080
|
">>"
|
|
2741
|
-
].map((
|
|
2742
|
-
const
|
|
3081
|
+
].map((l) => {
|
|
3082
|
+
const g = ["AND", "OR", "XOR", "NOT", "<<", ">>"].includes(l);
|
|
2743
3083
|
return /* @__PURE__ */ d(
|
|
2744
3084
|
"button",
|
|
2745
3085
|
{
|
|
2746
|
-
onClick: () => t(e === "0" ?
|
|
2747
|
-
style: { ...B.key, ...
|
|
2748
|
-
children:
|
|
3086
|
+
onClick: () => t(e === "0" ? l : e + l),
|
|
3087
|
+
style: { ...B.key, ...g ? B.keyFunction : {} },
|
|
3088
|
+
children: l
|
|
2749
3089
|
},
|
|
2750
|
-
|
|
3090
|
+
l
|
|
2751
3091
|
);
|
|
2752
3092
|
}) })
|
|
2753
3093
|
] });
|
|
2754
3094
|
}
|
|
2755
|
-
function
|
|
2756
|
-
const { t: e } =
|
|
2757
|
-
const
|
|
2758
|
-
|
|
2759
|
-
},
|
|
2760
|
-
{ label: "A + B", fn: () =>
|
|
2761
|
-
{ label: "A - B", fn: () =>
|
|
2762
|
-
{ label: "A × B", fn: () =>
|
|
2763
|
-
|
|
2764
|
-
{ label: "A
|
|
2765
|
-
|
|
3095
|
+
function Oe() {
|
|
3096
|
+
const { t: e } = E(), [t, r] = M($.create(2, 2)), [o, a] = M($.create(2, 2)), [n, i] = M(""), l = (s, p, u, x, f) => {
|
|
3097
|
+
const w = { ...s, data: s.data.map((y) => [...y]) };
|
|
3098
|
+
w.data[u][x] = parseFloat(f) || 0, p(w);
|
|
3099
|
+
}, g = [
|
|
3100
|
+
{ label: "A + B", fn: () => $.toString($.add(t, o)) },
|
|
3101
|
+
{ label: "A - B", fn: () => $.toString($.subtract(t, o)) },
|
|
3102
|
+
{ label: "A × B", fn: () => $.toString($.multiply(t, o)) },
|
|
3103
|
+
// audit-allow: i18n — math notation
|
|
3104
|
+
{ label: "det(A)", fn: () => $.determinant(t).toFixed(4) },
|
|
3105
|
+
// audit-allow: i18n — math notation
|
|
3106
|
+
{ label: "Aᵀ", fn: () => $.toString($.transpose(t)) },
|
|
3107
|
+
{ label: "A⁻¹", fn: () => $.toString($.inverse(t)) }
|
|
2766
3108
|
];
|
|
2767
3109
|
return /* @__PURE__ */ v("div", { style: { padding: "12px", backgroundColor: "var(--nice-bg-secondary, #252525)" }, children: [
|
|
2768
3110
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: "12px", marginBottom: "12px" }, children: [
|
|
@@ -2772,7 +3114,7 @@ function Ge() {
|
|
|
2772
3114
|
re,
|
|
2773
3115
|
{
|
|
2774
3116
|
matrix: t,
|
|
2775
|
-
onChange: (s, p,
|
|
3117
|
+
onChange: (s, p, u) => l(t, r, s, p, u)
|
|
2776
3118
|
}
|
|
2777
3119
|
)
|
|
2778
3120
|
] }),
|
|
@@ -2782,12 +3124,12 @@ function Ge() {
|
|
|
2782
3124
|
re,
|
|
2783
3125
|
{
|
|
2784
3126
|
matrix: o,
|
|
2785
|
-
onChange: (s, p,
|
|
3127
|
+
onChange: (s, p, u) => l(o, a, s, p, u)
|
|
2786
3128
|
}
|
|
2787
3129
|
)
|
|
2788
3130
|
] })
|
|
2789
3131
|
] }),
|
|
2790
|
-
/* @__PURE__ */ d("div", { style: { display: "flex", gap: "4px", flexWrap: "wrap", marginBottom: "12px" }, children:
|
|
3132
|
+
/* @__PURE__ */ d("div", { style: { display: "flex", gap: "4px", flexWrap: "wrap", marginBottom: "12px" }, children: g.map((s) => /* @__PURE__ */ d(
|
|
2791
3133
|
"button",
|
|
2792
3134
|
{
|
|
2793
3135
|
onClick: () => {
|
|
@@ -2853,8 +3195,8 @@ function re({
|
|
|
2853
3195
|
}
|
|
2854
3196
|
);
|
|
2855
3197
|
}
|
|
2856
|
-
function
|
|
2857
|
-
const { t: e } =
|
|
3198
|
+
function Ge() {
|
|
3199
|
+
const { t: e } = E(), [t, r] = M("x^2"), [o, a] = M("");
|
|
2858
3200
|
return /* @__PURE__ */ v("div", { style: { padding: "12px", backgroundColor: "var(--nice-bg-secondary, #252525)" }, children: [
|
|
2859
3201
|
/* @__PURE__ */ d(
|
|
2860
3202
|
"input",
|
|
@@ -2921,24 +3263,24 @@ function je() {
|
|
|
2921
3263
|
)
|
|
2922
3264
|
] });
|
|
2923
3265
|
}
|
|
2924
|
-
function
|
|
2925
|
-
const { t: e } =
|
|
3266
|
+
function Ue() {
|
|
3267
|
+
const { t: e } = E(), { service: t } = X(), [r, o] = M("1"), [a, n] = M("m"), [i, l] = M("ft"), [g, s] = M("Length"), [p, u] = M(""), x = t.getUnitCategories(), f = t.getUnitsByCategory(g), w = () => {
|
|
2926
3268
|
try {
|
|
2927
|
-
const
|
|
2928
|
-
|
|
2929
|
-
} catch (
|
|
2930
|
-
|
|
3269
|
+
const y = t.convertUnits(parseFloat(r), a, i);
|
|
3270
|
+
u(`${r} ${a} = ${t.format(y)} ${i}`);
|
|
3271
|
+
} catch (y) {
|
|
3272
|
+
u(y.message);
|
|
2931
3273
|
}
|
|
2932
3274
|
};
|
|
2933
3275
|
return /* @__PURE__ */ v("div", { style: { padding: "12px", backgroundColor: "var(--nice-bg-secondary, #252525)" }, children: [
|
|
2934
3276
|
/* @__PURE__ */ d(
|
|
2935
3277
|
"select",
|
|
2936
3278
|
{
|
|
2937
|
-
value:
|
|
2938
|
-
onChange: (
|
|
2939
|
-
s(
|
|
2940
|
-
const b = t.getUnitsByCategory(
|
|
2941
|
-
b.length >= 2 && (n(b[0].symbol),
|
|
3279
|
+
value: g,
|
|
3280
|
+
onChange: (y) => {
|
|
3281
|
+
s(y.target.value);
|
|
3282
|
+
const b = t.getUnitsByCategory(y.target.value);
|
|
3283
|
+
b.length >= 2 && (n(b[0].symbol), l(b[1].symbol));
|
|
2942
3284
|
},
|
|
2943
3285
|
style: {
|
|
2944
3286
|
width: "100%",
|
|
@@ -2949,7 +3291,7 @@ function Fe() {
|
|
|
2949
3291
|
border: "1px solid var(--nice-border-color, #555)",
|
|
2950
3292
|
borderRadius: "4px"
|
|
2951
3293
|
},
|
|
2952
|
-
children:
|
|
3294
|
+
children: x.map((y) => /* @__PURE__ */ d("option", { value: y, children: y }, y))
|
|
2953
3295
|
}
|
|
2954
3296
|
),
|
|
2955
3297
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: "8px", alignItems: "center", marginBottom: "12px" }, children: [
|
|
@@ -2958,7 +3300,7 @@ function Fe() {
|
|
|
2958
3300
|
{
|
|
2959
3301
|
type: "number",
|
|
2960
3302
|
value: r,
|
|
2961
|
-
onChange: (
|
|
3303
|
+
onChange: (y) => o(y.target.value),
|
|
2962
3304
|
style: {
|
|
2963
3305
|
flex: 1,
|
|
2964
3306
|
padding: "8px",
|
|
@@ -2973,7 +3315,7 @@ function Fe() {
|
|
|
2973
3315
|
"select",
|
|
2974
3316
|
{
|
|
2975
3317
|
value: a,
|
|
2976
|
-
onChange: (
|
|
3318
|
+
onChange: (y) => n(y.target.value),
|
|
2977
3319
|
style: {
|
|
2978
3320
|
padding: "8px",
|
|
2979
3321
|
backgroundColor: "var(--nice-border, #3c3c3c)",
|
|
@@ -2981,22 +3323,22 @@ function Fe() {
|
|
|
2981
3323
|
border: "1px solid var(--nice-border-color, #555)",
|
|
2982
3324
|
borderRadius: "4px"
|
|
2983
3325
|
},
|
|
2984
|
-
children: f.map((
|
|
2985
|
-
|
|
3326
|
+
children: f.map((y) => /* @__PURE__ */ v("option", { value: y.symbol, children: [
|
|
3327
|
+
y.name,
|
|
2986
3328
|
" (",
|
|
2987
|
-
|
|
3329
|
+
y.symbol,
|
|
2988
3330
|
")"
|
|
2989
|
-
] },
|
|
3331
|
+
] }, y.symbol))
|
|
2990
3332
|
}
|
|
2991
3333
|
)
|
|
2992
3334
|
] }),
|
|
2993
3335
|
/* @__PURE__ */ v("div", { style: { display: "flex", gap: "8px", alignItems: "center", marginBottom: "12px" }, children: [
|
|
2994
|
-
/* @__PURE__ */ d("span", { style: { color: "var(--nice-text-secondary, #888)" }, children: /* @__PURE__ */ d(
|
|
3336
|
+
/* @__PURE__ */ d("span", { style: { color: "var(--nice-text-secondary, #888)" }, children: /* @__PURE__ */ d(j, { name: "arrow-right", size: 12 }) }),
|
|
2995
3337
|
/* @__PURE__ */ d(
|
|
2996
3338
|
"select",
|
|
2997
3339
|
{
|
|
2998
3340
|
value: i,
|
|
2999
|
-
onChange: (
|
|
3341
|
+
onChange: (y) => l(y.target.value),
|
|
3000
3342
|
style: {
|
|
3001
3343
|
flex: 1,
|
|
3002
3344
|
padding: "8px",
|
|
@@ -3005,19 +3347,19 @@ function Fe() {
|
|
|
3005
3347
|
border: "1px solid var(--nice-border-color, #555)",
|
|
3006
3348
|
borderRadius: "4px"
|
|
3007
3349
|
},
|
|
3008
|
-
children: f.map((
|
|
3009
|
-
|
|
3350
|
+
children: f.map((y) => /* @__PURE__ */ v("option", { value: y.symbol, children: [
|
|
3351
|
+
y.name,
|
|
3010
3352
|
" (",
|
|
3011
|
-
|
|
3353
|
+
y.symbol,
|
|
3012
3354
|
")"
|
|
3013
|
-
] },
|
|
3355
|
+
] }, y.symbol))
|
|
3014
3356
|
}
|
|
3015
3357
|
)
|
|
3016
3358
|
] }),
|
|
3017
3359
|
/* @__PURE__ */ d(
|
|
3018
3360
|
"button",
|
|
3019
3361
|
{
|
|
3020
|
-
onClick:
|
|
3362
|
+
onClick: w,
|
|
3021
3363
|
style: {
|
|
3022
3364
|
width: "100%",
|
|
3023
3365
|
padding: "12px",
|
|
@@ -3045,7 +3387,7 @@ function Fe() {
|
|
|
3045
3387
|
)
|
|
3046
3388
|
] });
|
|
3047
3389
|
}
|
|
3048
|
-
const
|
|
3390
|
+
const I = {
|
|
3049
3391
|
/** Distance between two points */
|
|
3050
3392
|
distance(e, t) {
|
|
3051
3393
|
return Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2);
|
|
@@ -3082,21 +3424,21 @@ const E = {
|
|
|
3082
3424
|
},
|
|
3083
3425
|
/** Circle-line intersection */
|
|
3084
3426
|
circleLineIntersection(e, t, r, o) {
|
|
3085
|
-
const a = o.x - r.x, n = o.y - r.y, i = r.x - e.x,
|
|
3086
|
-
if (
|
|
3427
|
+
const a = o.x - r.x, n = o.y - r.y, i = r.x - e.x, l = r.y - e.y, g = a * a + n * n, s = 2 * (i * a + l * n), p = i * i + l * l - t * t, u = s * s - 4 * g * p;
|
|
3428
|
+
if (u < 0)
|
|
3087
3429
|
return [];
|
|
3088
|
-
const
|
|
3089
|
-
return f >= 0 && f <= 1 &&
|
|
3430
|
+
const x = Math.sqrt(u), f = (-s - x) / (2 * g), w = (-s + x) / (2 * g), y = [];
|
|
3431
|
+
return f >= 0 && f <= 1 && y.push({ x: r.x + f * a, y: r.y + f * n }), w >= 0 && w <= 1 && Math.abs(w - f) > 1e-10 && y.push({ x: r.x + w * a, y: r.y + w * n }), y;
|
|
3090
3432
|
},
|
|
3091
3433
|
/** Circle-circle intersection */
|
|
3092
3434
|
circleCircleIntersection(e, t, r, o) {
|
|
3093
3435
|
const a = this.distance(e, r);
|
|
3094
3436
|
if (a > t + o || a < Math.abs(t - o) || a === 0)
|
|
3095
3437
|
return [];
|
|
3096
|
-
const n = (t * t - o * o + a * a) / (2 * a), i = Math.sqrt(t * t - n * n),
|
|
3438
|
+
const n = (t * t - o * o + a * a) / (2 * a), i = Math.sqrt(t * t - n * n), l = e.x + n * (r.x - e.x) / a, g = e.y + n * (r.y - e.y) / a;
|
|
3097
3439
|
return [
|
|
3098
|
-
{ x:
|
|
3099
|
-
{ x:
|
|
3440
|
+
{ x: l + i * (r.y - e.y) / a, y: g - i * (r.x - e.x) / a },
|
|
3441
|
+
{ x: l - i * (r.y - e.y) / a, y: g + i * (r.x - e.x) / a }
|
|
3100
3442
|
];
|
|
3101
3443
|
},
|
|
3102
3444
|
/** Perpendicular line through point */
|
|
@@ -3193,10 +3535,10 @@ const E = {
|
|
|
3193
3535
|
};
|
|
3194
3536
|
}
|
|
3195
3537
|
};
|
|
3196
|
-
class
|
|
3538
|
+
class Ye {
|
|
3197
3539
|
constructor() {
|
|
3198
|
-
|
|
3199
|
-
|
|
3540
|
+
z(this, "elements", /* @__PURE__ */ new Map());
|
|
3541
|
+
z(this, "nextLabel", 1);
|
|
3200
3542
|
}
|
|
3201
3543
|
/** Add element */
|
|
3202
3544
|
addElement(t) {
|
|
@@ -3330,7 +3672,7 @@ class Oe {
|
|
|
3330
3672
|
const o = this.getPoint(t), a = this.getPoint(r);
|
|
3331
3673
|
if (!o || !a)
|
|
3332
3674
|
return null;
|
|
3333
|
-
const n =
|
|
3675
|
+
const n = I.midpoint(o, a), i = this.createPoint(n.x, n.y);
|
|
3334
3676
|
return i.dependencies = [t, r], i.color = { r: 0, g: 150, b: 0 }, i;
|
|
3335
3677
|
}
|
|
3336
3678
|
/** Create perpendicular */
|
|
@@ -3338,7 +3680,7 @@ class Oe {
|
|
|
3338
3680
|
const a = this.getPoint(t), n = this.getPoint(r), i = this.getPoint(o);
|
|
3339
3681
|
if (!a || !n || !i)
|
|
3340
3682
|
return null;
|
|
3341
|
-
const
|
|
3683
|
+
const l = I.perpendicularThrough(a, n, i), g = this.createPoint(l.p2.x, l.p2.y), s = this.createLine(o, g.id);
|
|
3342
3684
|
return s.dependencies = [t, r, o], s;
|
|
3343
3685
|
}
|
|
3344
3686
|
/** Create parallel */
|
|
@@ -3346,7 +3688,7 @@ class Oe {
|
|
|
3346
3688
|
const a = this.getPoint(t), n = this.getPoint(r), i = this.getPoint(o);
|
|
3347
3689
|
if (!a || !n || !i)
|
|
3348
3690
|
return null;
|
|
3349
|
-
const
|
|
3691
|
+
const l = I.parallelThrough(a, n, i), g = this.createPoint(l.p2.x, l.p2.y), s = this.createLine(o, g.id);
|
|
3350
3692
|
return s.dependencies = [t, r, o], s;
|
|
3351
3693
|
}
|
|
3352
3694
|
/** Create intersection point */
|
|
@@ -3356,36 +3698,36 @@ class Oe {
|
|
|
3356
3698
|
return [];
|
|
3357
3699
|
const n = [], i = (s) => {
|
|
3358
3700
|
if (s.type === "line" || s.type === "segment" || s.type === "ray") {
|
|
3359
|
-
const p = s,
|
|
3360
|
-
if (
|
|
3361
|
-
return [
|
|
3701
|
+
const p = s, u = this.getPoint(p.point1Id ?? p.originId), x = this.getPoint(p.point2Id ?? p.throughId);
|
|
3702
|
+
if (u && x)
|
|
3703
|
+
return [u, x];
|
|
3362
3704
|
}
|
|
3363
3705
|
return null;
|
|
3364
|
-
},
|
|
3365
|
-
if (
|
|
3366
|
-
const s =
|
|
3706
|
+
}, l = i(o), g = i(a);
|
|
3707
|
+
if (l && g) {
|
|
3708
|
+
const s = I.lineIntersection(l[0], l[1], g[0], g[1]);
|
|
3367
3709
|
if (s) {
|
|
3368
3710
|
const p = this.createPoint(s.x, s.y);
|
|
3369
3711
|
p.dependencies = [t, r], p.color = { r: 255, g: 0, b: 0 }, n.push(p);
|
|
3370
3712
|
}
|
|
3371
3713
|
}
|
|
3372
|
-
if (o.type === "circle" &&
|
|
3714
|
+
if (o.type === "circle" && g) {
|
|
3373
3715
|
const s = o, p = this.getPoint(s.centerId);
|
|
3374
3716
|
if (p) {
|
|
3375
|
-
const
|
|
3376
|
-
for (const
|
|
3377
|
-
const f = this.createPoint(
|
|
3717
|
+
const u = I.circleLineIntersection(p, s.radius, g[0], g[1]);
|
|
3718
|
+
for (const x of u) {
|
|
3719
|
+
const f = this.createPoint(x.x, x.y);
|
|
3378
3720
|
f.dependencies = [t, r], f.color = { r: 255, g: 0, b: 0 }, n.push(f);
|
|
3379
3721
|
}
|
|
3380
3722
|
}
|
|
3381
3723
|
}
|
|
3382
3724
|
if (o.type === "circle" && a.type === "circle") {
|
|
3383
|
-
const s = o, p = a,
|
|
3384
|
-
if (
|
|
3385
|
-
const f =
|
|
3386
|
-
for (const
|
|
3387
|
-
const
|
|
3388
|
-
|
|
3725
|
+
const s = o, p = a, u = this.getPoint(s.centerId), x = this.getPoint(p.centerId);
|
|
3726
|
+
if (u && x) {
|
|
3727
|
+
const f = I.circleCircleIntersection(u, s.radius, x, p.radius);
|
|
3728
|
+
for (const w of f) {
|
|
3729
|
+
const y = this.createPoint(w.x, w.y);
|
|
3730
|
+
y.dependencies = [t, r], y.color = { r: 255, g: 0, b: 0 }, n.push(y);
|
|
3389
3731
|
}
|
|
3390
3732
|
}
|
|
3391
3733
|
}
|
|
@@ -3397,13 +3739,13 @@ class Oe {
|
|
|
3397
3739
|
case "distance": {
|
|
3398
3740
|
const o = this.getPoint(r[0]), a = this.getPoint(r[1]);
|
|
3399
3741
|
if (o && a)
|
|
3400
|
-
return
|
|
3742
|
+
return I.distance(o, a);
|
|
3401
3743
|
break;
|
|
3402
3744
|
}
|
|
3403
3745
|
case "angle": {
|
|
3404
3746
|
const o = this.getPoint(r[0]), a = this.getPoint(r[1]), n = this.getPoint(r[2]);
|
|
3405
3747
|
if (o && a && n)
|
|
3406
|
-
return
|
|
3748
|
+
return I.angleDegrees(o, a, n);
|
|
3407
3749
|
break;
|
|
3408
3750
|
}
|
|
3409
3751
|
case "area":
|
|
@@ -3411,7 +3753,7 @@ class Oe {
|
|
|
3411
3753
|
const o = this.elements.get(r[0]);
|
|
3412
3754
|
if ((o == null ? void 0 : o.type) === "polygon") {
|
|
3413
3755
|
const a = o.pointIds.map((n) => this.getPoint(n)).filter(Boolean);
|
|
3414
|
-
return t === "area" ?
|
|
3756
|
+
return t === "area" ? I.polygonArea(a) : I.polygonPerimeter(a);
|
|
3415
3757
|
}
|
|
3416
3758
|
break;
|
|
3417
3759
|
}
|
|
@@ -3426,19 +3768,19 @@ class Oe {
|
|
|
3426
3768
|
a.push(
|
|
3427
3769
|
`<rect width="100%" height="100%" fill="rgb(${o.backgroundColor.r},${o.backgroundColor.g},${o.backgroundColor.b})"/>`
|
|
3428
3770
|
);
|
|
3429
|
-
const n = (i,
|
|
3771
|
+
const n = (i, l) => ({
|
|
3430
3772
|
x: t / 2 + (i - o.centerX) * o.scale,
|
|
3431
|
-
y: r / 2 - (
|
|
3773
|
+
y: r / 2 - (l - o.centerY) * o.scale
|
|
3432
3774
|
});
|
|
3433
3775
|
if (o.showGrid) {
|
|
3434
3776
|
a.push('<g stroke="var(--nice-border, #ddd)" stroke-width="0.5">');
|
|
3435
3777
|
for (let i = Math.floor(-t / 2 / o.scale + o.centerX); i <= t / 2 / o.scale + o.centerX; i += o.gridSpacing) {
|
|
3436
|
-
const
|
|
3437
|
-
a.push(`<line x1="${
|
|
3778
|
+
const l = n(i, 0);
|
|
3779
|
+
a.push(`<line x1="${l.x}" y1="0" x2="${l.x}" y2="${r}"/>`);
|
|
3438
3780
|
}
|
|
3439
3781
|
for (let i = Math.floor(-r / 2 / o.scale + o.centerY); i <= r / 2 / o.scale + o.centerY; i += o.gridSpacing) {
|
|
3440
|
-
const
|
|
3441
|
-
a.push(`<line x1="0" y1="${
|
|
3782
|
+
const l = n(0, i);
|
|
3783
|
+
a.push(`<line x1="0" y1="${l.y}" x2="${t}" y2="${l.y}"/>`);
|
|
3442
3784
|
}
|
|
3443
3785
|
a.push("</g>");
|
|
3444
3786
|
}
|
|
@@ -3449,39 +3791,39 @@ class Oe {
|
|
|
3449
3791
|
for (const i of this.getAllElements()) {
|
|
3450
3792
|
if (!i.visible)
|
|
3451
3793
|
continue;
|
|
3452
|
-
const
|
|
3794
|
+
const l = `rgb(${i.color.r},${i.color.g},${i.color.b})`;
|
|
3453
3795
|
switch (i.type) {
|
|
3454
3796
|
case "point": {
|
|
3455
|
-
const
|
|
3456
|
-
a.push(`<circle cx="${
|
|
3797
|
+
const g = n(i.x, i.y);
|
|
3798
|
+
a.push(`<circle cx="${g.x}" cy="${g.y}" r="${i.size}" fill="${l}"/>`), i.label && a.push(`<text x="${g.x + 8}" y="${g.y - 8}" font-size="12">${i.label}</text>`);
|
|
3457
3799
|
break;
|
|
3458
3800
|
}
|
|
3459
3801
|
case "segment": {
|
|
3460
|
-
const
|
|
3461
|
-
if (
|
|
3462
|
-
const p = n(
|
|
3802
|
+
const g = this.getPoint(i.point1Id), s = this.getPoint(i.point2Id);
|
|
3803
|
+
if (g && s) {
|
|
3804
|
+
const p = n(g.x, g.y), u = n(s.x, s.y);
|
|
3463
3805
|
a.push(
|
|
3464
|
-
`<line x1="${p.x}" y1="${p.y}" x2="${
|
|
3806
|
+
`<line x1="${p.x}" y1="${p.y}" x2="${u.x}" y2="${u.y}" stroke="${l}" stroke-width="${i.width}"/>`
|
|
3465
3807
|
);
|
|
3466
3808
|
}
|
|
3467
3809
|
break;
|
|
3468
3810
|
}
|
|
3469
3811
|
case "circle": {
|
|
3470
|
-
const
|
|
3471
|
-
if (
|
|
3472
|
-
const s = n(
|
|
3812
|
+
const g = this.getPoint(i.centerId);
|
|
3813
|
+
if (g) {
|
|
3814
|
+
const s = n(g.x, g.y), p = i.radius * o.scale, u = i.fill ? `rgba(${i.fill.r},${i.fill.g},${i.fill.b},${i.fill.a ?? 0.2})` : "none";
|
|
3473
3815
|
a.push(
|
|
3474
|
-
`<circle cx="${s.x}" cy="${s.y}" r="${p}" fill="${
|
|
3816
|
+
`<circle cx="${s.x}" cy="${s.y}" r="${p}" fill="${u}" stroke="${l}" stroke-width="${i.width}"/>`
|
|
3475
3817
|
);
|
|
3476
3818
|
}
|
|
3477
3819
|
break;
|
|
3478
3820
|
}
|
|
3479
3821
|
case "polygon": {
|
|
3480
|
-
const
|
|
3481
|
-
if (
|
|
3482
|
-
const p =
|
|
3822
|
+
const g = i.pointIds.map((s) => this.getPoint(s)).filter(Boolean);
|
|
3823
|
+
if (g.length > 0) {
|
|
3824
|
+
const p = g.map((x) => n(x.x, x.y)).map((x, f) => `${f === 0 ? "M" : "L"}${x.x},${x.y}`).join(" ") + " Z", u = i.fill ? `rgba(${i.fill.r},${i.fill.g},${i.fill.b},${i.fill.a ?? 0.2})` : "none";
|
|
3483
3825
|
a.push(
|
|
3484
|
-
`<path d="${p}" fill="${
|
|
3826
|
+
`<path d="${p}" fill="${u}" stroke="${l}" stroke-width="${i.width}"/>`
|
|
3485
3827
|
);
|
|
3486
3828
|
}
|
|
3487
3829
|
break;
|
|
@@ -3499,12 +3841,12 @@ class Oe {
|
|
|
3499
3841
|
return this.nextLabel++, r < 26 ? t[r] : t[r % 26] + Math.floor(r / 26);
|
|
3500
3842
|
}
|
|
3501
3843
|
}
|
|
3502
|
-
function
|
|
3503
|
-
return new
|
|
3844
|
+
function st() {
|
|
3845
|
+
return new Ye();
|
|
3504
3846
|
}
|
|
3505
|
-
const
|
|
3847
|
+
const ge = /* @__PURE__ */ O(null);
|
|
3506
3848
|
function H() {
|
|
3507
|
-
const e =
|
|
3849
|
+
const e = F(ge);
|
|
3508
3850
|
if (!e)
|
|
3509
3851
|
throw new Error("useGeometry must be used within GeometryProvider");
|
|
3510
3852
|
return e;
|
|
@@ -3558,14 +3900,14 @@ const q = {
|
|
|
3558
3900
|
color: "var(--nice-text-secondary, #666)"
|
|
3559
3901
|
}
|
|
3560
3902
|
};
|
|
3561
|
-
function
|
|
3903
|
+
function lt({
|
|
3562
3904
|
service: e,
|
|
3563
3905
|
width: t = 800,
|
|
3564
3906
|
height: r = 600,
|
|
3565
3907
|
className: o,
|
|
3566
3908
|
style: a
|
|
3567
3909
|
}) {
|
|
3568
|
-
const [n, i] =
|
|
3910
|
+
const [n, i] = M([]), [l, g] = M("point"), [s, p] = M([]), [u, x] = M({
|
|
3569
3911
|
centerX: 0,
|
|
3570
3912
|
centerY: 0,
|
|
3571
3913
|
scale: 40,
|
|
@@ -3577,119 +3919,134 @@ function it({
|
|
|
3577
3919
|
backgroundColor: { r: 255, g: 255, b: 255 }
|
|
3578
3920
|
}), f = R(() => {
|
|
3579
3921
|
i(e.getAllElements());
|
|
3580
|
-
}, [e]),
|
|
3581
|
-
|
|
3922
|
+
}, [e]), w = R((b) => {
|
|
3923
|
+
x((c) => ({ ...c, ...b }));
|
|
3582
3924
|
}, []);
|
|
3583
|
-
|
|
3925
|
+
Y(() => {
|
|
3584
3926
|
f();
|
|
3585
3927
|
}, [f]);
|
|
3586
|
-
const
|
|
3928
|
+
const y = {
|
|
3587
3929
|
service: e,
|
|
3588
3930
|
elements: n,
|
|
3589
|
-
tool:
|
|
3590
|
-
setTool:
|
|
3591
|
-
view:
|
|
3592
|
-
setView:
|
|
3931
|
+
tool: l,
|
|
3932
|
+
setTool: g,
|
|
3933
|
+
view: u,
|
|
3934
|
+
setView: w,
|
|
3593
3935
|
selectedIds: s,
|
|
3594
3936
|
setSelectedIds: p,
|
|
3595
3937
|
refresh: f
|
|
3596
3938
|
};
|
|
3597
|
-
return /* @__PURE__ */ d(
|
|
3598
|
-
/* @__PURE__ */ d(
|
|
3939
|
+
return /* @__PURE__ */ d(ge.Provider, { value: y, children: /* @__PURE__ */ v("div", { className: o, style: { ...q.container, ...a }, children: [
|
|
3940
|
+
/* @__PURE__ */ d(Ve, {}),
|
|
3599
3941
|
/* @__PURE__ */ v("div", { style: q.main, children: [
|
|
3600
|
-
/* @__PURE__ */ d(
|
|
3601
|
-
/* @__PURE__ */ d(
|
|
3942
|
+
/* @__PURE__ */ d(Ke, { width: t, height: r }),
|
|
3943
|
+
/* @__PURE__ */ d(We, { width: t, height: r })
|
|
3602
3944
|
] })
|
|
3603
3945
|
] }) });
|
|
3604
3946
|
}
|
|
3605
|
-
function
|
|
3606
|
-
const {
|
|
3607
|
-
{ id: "select", icon: "cursor", title: "Select" },
|
|
3608
|
-
{ id: "point", icon: "
|
|
3609
|
-
{ id: "segment", icon: "
|
|
3610
|
-
{ id: "line", icon: "line", title: "Line" },
|
|
3611
|
-
{ id: "ray", icon: "arrow-right", title: "Ray" },
|
|
3612
|
-
{ id: "circle", icon: "circle", title: "Circle" },
|
|
3613
|
-
{ id: "polygon", icon: "triangle", title: "Polygon" },
|
|
3614
|
-
{
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
{ id: "
|
|
3620
|
-
{ id: "
|
|
3621
|
-
{
|
|
3947
|
+
function Ve() {
|
|
3948
|
+
const { t: e } = E(), { tool: t, setTool: r } = H(), o = [
|
|
3949
|
+
{ id: "select", icon: "cursor", title: e("geometry.select", "Select") },
|
|
3950
|
+
{ id: "point", icon: "point", title: e("geometry.point", "Point") },
|
|
3951
|
+
{ id: "segment", icon: "segment", title: e("geometry.segment", "Segment") },
|
|
3952
|
+
{ id: "line", icon: "line", title: e("geometry.line", "Line") },
|
|
3953
|
+
{ id: "ray", icon: "arrow-right", title: e("geometry.ray", "Ray") },
|
|
3954
|
+
{ id: "circle", icon: "circle", title: e("geometry.circle", "Circle") },
|
|
3955
|
+
{ id: "polygon", icon: "triangle", title: e("geometry.polygon", "Polygon") },
|
|
3956
|
+
{
|
|
3957
|
+
id: "perpendicular",
|
|
3958
|
+
icon: "perpendicular",
|
|
3959
|
+
title: e("geometry.perpendicular", "Perpendicular")
|
|
3960
|
+
},
|
|
3961
|
+
{ id: "parallel", icon: "parallel", title: e("geometry.parallel", "Parallel") },
|
|
3962
|
+
{ id: "midpoint", icon: "midpoint", title: e("geometry.midpoint", "Midpoint") },
|
|
3963
|
+
{
|
|
3964
|
+
id: "bisector",
|
|
3965
|
+
icon: "angle-bisector",
|
|
3966
|
+
title: e("geometry.angleBisector", "Angle Bisector")
|
|
3967
|
+
},
|
|
3968
|
+
{ id: "intersection", icon: "close", title: e("geometry.intersection", "Intersection") },
|
|
3969
|
+
{ id: "reflect", icon: "shuffle", title: e("geometry.reflect", "Reflect") },
|
|
3970
|
+
{ id: "rotate", icon: "refresh", title: e("geometry.rotate", "Rotate") },
|
|
3971
|
+
{ id: "measure", icon: "ruler", title: e("geometry.measure", "Measure") }
|
|
3622
3972
|
];
|
|
3623
|
-
return /* @__PURE__ */ d("div", { style: q.toolbar, children:
|
|
3973
|
+
return /* @__PURE__ */ d("div", { style: q.toolbar, children: o.map((a) => /* @__PURE__ */ d(
|
|
3624
3974
|
"button",
|
|
3625
3975
|
{
|
|
3626
|
-
onClick: () =>
|
|
3627
|
-
title:
|
|
3976
|
+
onClick: () => r(a.id),
|
|
3977
|
+
title: a.title,
|
|
3628
3978
|
style: {
|
|
3629
3979
|
...q.toolButton,
|
|
3630
|
-
backgroundColor:
|
|
3631
|
-
color:
|
|
3980
|
+
backgroundColor: t === a.id ? "var(--nice-primary-hover, #1976d2)" : "transparent",
|
|
3981
|
+
color: t === a.id ? "var(--nice-color-white, #fff)" : "var(--nice-text, #333)"
|
|
3632
3982
|
},
|
|
3633
|
-
children:
|
|
3983
|
+
children: /* @__PURE__ */ d(j, { name: a.icon, size: 16 })
|
|
3634
3984
|
},
|
|
3635
|
-
|
|
3985
|
+
a.id
|
|
3636
3986
|
)) });
|
|
3637
3987
|
}
|
|
3638
|
-
function
|
|
3639
|
-
const r = U(null), { service: o, elements: a, tool: n, view: i, selectedIds:
|
|
3640
|
-
(b,
|
|
3641
|
-
const
|
|
3988
|
+
function Ke({ width: e, height: t }) {
|
|
3989
|
+
const r = U(null), { service: o, elements: a, tool: n, view: i, selectedIds: l, setSelectedIds: g, refresh: s } = H(), [p, u] = M([]), x = R(
|
|
3990
|
+
(b, c) => {
|
|
3991
|
+
const m = (b - e / 2) / i.scale + i.centerX, k = -(c - t / 2) / i.scale + i.centerY;
|
|
3642
3992
|
return i.snapToGrid ? {
|
|
3643
|
-
x: Math.round(
|
|
3644
|
-
y: Math.round(
|
|
3645
|
-
} : { x:
|
|
3993
|
+
x: Math.round(m / i.gridSpacing) * i.gridSpacing,
|
|
3994
|
+
y: Math.round(k / i.gridSpacing) * i.gridSpacing
|
|
3995
|
+
} : { x: m, y: k };
|
|
3646
3996
|
},
|
|
3647
3997
|
[e, t, i]
|
|
3648
3998
|
), f = R(
|
|
3649
|
-
(b,
|
|
3999
|
+
(b, c) => ({
|
|
3650
4000
|
x: e / 2 + (b - i.centerX) * i.scale,
|
|
3651
|
-
y: t / 2 - (
|
|
4001
|
+
y: t / 2 - (c - i.centerY) * i.scale
|
|
3652
4002
|
}),
|
|
3653
4003
|
[e, t, i]
|
|
3654
|
-
),
|
|
4004
|
+
), w = R(
|
|
3655
4005
|
(b) => {
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
|
|
4006
|
+
for (const m of a)
|
|
4007
|
+
if (m.type === "point" && I.distance(m, b) < 0.5)
|
|
4008
|
+
return m;
|
|
4009
|
+
},
|
|
4010
|
+
[a]
|
|
4011
|
+
), y = R(
|
|
4012
|
+
(b) => {
|
|
4013
|
+
var k;
|
|
4014
|
+
const c = (k = r.current) == null ? void 0 : k.getBoundingClientRect();
|
|
4015
|
+
if (!c)
|
|
3659
4016
|
return;
|
|
3660
|
-
const
|
|
4017
|
+
const m = x(b.clientX - c.left, b.clientY - c.top);
|
|
3661
4018
|
switch (n) {
|
|
3662
4019
|
case "point": {
|
|
3663
|
-
o.createPoint(
|
|
4020
|
+
o.createPoint(m.x, m.y), s();
|
|
3664
4021
|
break;
|
|
3665
4022
|
}
|
|
3666
4023
|
case "segment":
|
|
3667
4024
|
case "line":
|
|
3668
4025
|
case "ray": {
|
|
3669
|
-
const
|
|
3670
|
-
if (
|
|
3671
|
-
|
|
3672
|
-
const
|
|
3673
|
-
return
|
|
4026
|
+
const C = w(m);
|
|
4027
|
+
if (C)
|
|
4028
|
+
u((h) => {
|
|
4029
|
+
const P = [...h, C.id];
|
|
4030
|
+
return P.length === 2 ? (n === "segment" ? o.createSegment(P[0], P[1]) : n === "line" ? o.createLine(P[0], P[1]) : n === "ray" && o.createRay(P[0], P[1]), s(), []) : P;
|
|
3674
4031
|
});
|
|
3675
4032
|
else {
|
|
3676
|
-
const h = o.createPoint(
|
|
3677
|
-
|
|
3678
|
-
const S = [...
|
|
4033
|
+
const h = o.createPoint(m.x, m.y);
|
|
4034
|
+
u((P) => {
|
|
4035
|
+
const S = [...P, h.id];
|
|
3679
4036
|
return S.length === 2 ? (n === "segment" ? o.createSegment(S[0], S[1]) : n === "line" ? o.createLine(S[0], S[1]) : n === "ray" && o.createRay(S[0], S[1]), s(), []) : S;
|
|
3680
4037
|
}), s();
|
|
3681
4038
|
}
|
|
3682
4039
|
break;
|
|
3683
4040
|
}
|
|
3684
4041
|
case "circle": {
|
|
3685
|
-
const
|
|
3686
|
-
if (
|
|
3687
|
-
|
|
4042
|
+
const C = w(m);
|
|
4043
|
+
if (C)
|
|
4044
|
+
u((h) => {
|
|
3688
4045
|
if (h.length === 0)
|
|
3689
|
-
return [
|
|
3690
|
-
const
|
|
3691
|
-
if (
|
|
3692
|
-
const S =
|
|
4046
|
+
return [C.id];
|
|
4047
|
+
const P = o.getPoint(h[0]);
|
|
4048
|
+
if (P) {
|
|
4049
|
+
const S = I.distance(P, m);
|
|
3693
4050
|
o.createCircle(h[0], S), s();
|
|
3694
4051
|
}
|
|
3695
4052
|
return [];
|
|
@@ -3697,202 +4054,188 @@ function Ve({ width: e, height: t }) {
|
|
|
3697
4054
|
else if (p.length === 1) {
|
|
3698
4055
|
const h = o.getPoint(p[0]);
|
|
3699
4056
|
if (h) {
|
|
3700
|
-
const
|
|
3701
|
-
o.createCircle(p[0],
|
|
4057
|
+
const P = I.distance(h, m);
|
|
4058
|
+
o.createCircle(p[0], P), s(), u([]);
|
|
3702
4059
|
}
|
|
3703
4060
|
} else {
|
|
3704
|
-
const h = o.createPoint(
|
|
3705
|
-
|
|
4061
|
+
const h = o.createPoint(m.x, m.y);
|
|
4062
|
+
u([h.id]), s();
|
|
3706
4063
|
}
|
|
3707
4064
|
break;
|
|
3708
4065
|
}
|
|
3709
4066
|
case "midpoint": {
|
|
3710
|
-
const
|
|
3711
|
-
|
|
3712
|
-
const
|
|
3713
|
-
return
|
|
4067
|
+
const C = w(m);
|
|
4068
|
+
C && u((h) => {
|
|
4069
|
+
const P = [...h, C.id];
|
|
4070
|
+
return P.length === 2 ? (o.createMidpoint(P[0], P[1]), s(), []) : P;
|
|
3714
4071
|
});
|
|
3715
4072
|
break;
|
|
3716
4073
|
}
|
|
3717
4074
|
case "select": {
|
|
3718
|
-
const
|
|
3719
|
-
|
|
4075
|
+
const C = w(m);
|
|
4076
|
+
g(C ? [C.id] : []);
|
|
3720
4077
|
break;
|
|
3721
4078
|
}
|
|
3722
4079
|
}
|
|
3723
4080
|
},
|
|
3724
|
-
[n, o, s,
|
|
3725
|
-
)
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
for (let h = w; h < e; h += g)
|
|
3737
|
-
l.beginPath(), l.moveTo(h, 0), l.lineTo(h, t), l.stroke();
|
|
3738
|
-
for (let h = M; h < t; h += g)
|
|
3739
|
-
l.beginPath(), l.moveTo(0, h), l.lineTo(e, h), l.stroke();
|
|
4081
|
+
[n, o, s, x, p, g, w]
|
|
4082
|
+
);
|
|
4083
|
+
return Y(() => {
|
|
4084
|
+
const b = r.current, c = b == null ? void 0 : b.getContext("2d");
|
|
4085
|
+
if (!(!b || !c)) {
|
|
4086
|
+
if (c.fillStyle = `rgb(${i.backgroundColor.r},${i.backgroundColor.g},${i.backgroundColor.b})`, c.fillRect(0, 0, e, t), i.showGrid) {
|
|
4087
|
+
c.strokeStyle = D("var(--nice-border, #e0e0e0)", c.canvas), c.lineWidth = 0.5;
|
|
4088
|
+
const m = i.gridSpacing * i.scale, k = (e / 2 - i.centerX * i.scale) % m, C = (t / 2 + i.centerY * i.scale) % m;
|
|
4089
|
+
for (let h = k; h < e; h += m)
|
|
4090
|
+
c.beginPath(), c.moveTo(h, 0), c.lineTo(h, t), c.stroke();
|
|
4091
|
+
for (let h = C; h < t; h += m)
|
|
4092
|
+
c.beginPath(), c.moveTo(0, h), c.lineTo(e, h), c.stroke();
|
|
3740
4093
|
}
|
|
3741
4094
|
if (i.showAxes) {
|
|
3742
|
-
const
|
|
3743
|
-
|
|
4095
|
+
const m = f(0, 0);
|
|
4096
|
+
c.strokeStyle = D("var(--nice-text, #333)", c.canvas), c.lineWidth = 1, c.beginPath(), c.moveTo(0, m.y), c.lineTo(e, m.y), c.stroke(), c.beginPath(), c.moveTo(m.x, 0), c.lineTo(m.x, t), c.stroke();
|
|
3744
4097
|
}
|
|
3745
|
-
for (const
|
|
3746
|
-
if (!
|
|
4098
|
+
for (const m of a) {
|
|
4099
|
+
if (!m.visible)
|
|
3747
4100
|
continue;
|
|
3748
|
-
const
|
|
3749
|
-
switch (
|
|
4101
|
+
const k = `rgb(${m.color.r},${m.color.g},${m.color.b})`, C = l.includes(m.id);
|
|
4102
|
+
switch (m.type) {
|
|
3750
4103
|
case "point": {
|
|
3751
|
-
const h = f(
|
|
3752
|
-
|
|
4104
|
+
const h = f(m.x, m.y);
|
|
4105
|
+
c.beginPath(), c.arc(h.x, h.y, C ? m.size + 2 : m.size, 0, 2 * Math.PI), c.fillStyle = C ? D("var(--nice-primary-hover, #1976d2)", c.canvas) : k, c.fill(), m.label && (c.fillStyle = D("var(--nice-text, #333)", c.canvas), c.font = "12px sans-serif", c.fillText(m.label, h.x + 8, h.y - 8));
|
|
3753
4106
|
break;
|
|
3754
4107
|
}
|
|
3755
4108
|
case "segment": {
|
|
3756
|
-
const h = o.getPoint(
|
|
3757
|
-
if (h &&
|
|
3758
|
-
const S = f(h.x, h.y),
|
|
3759
|
-
|
|
4109
|
+
const h = o.getPoint(m.point1Id), P = o.getPoint(m.point2Id);
|
|
4110
|
+
if (h && P) {
|
|
4111
|
+
const S = f(h.x, h.y), L = f(P.x, P.y);
|
|
4112
|
+
c.strokeStyle = k, c.lineWidth = m.width, c.beginPath(), c.moveTo(S.x, S.y), c.lineTo(L.x, L.y), c.stroke();
|
|
3760
4113
|
}
|
|
3761
4114
|
break;
|
|
3762
4115
|
}
|
|
3763
4116
|
case "line": {
|
|
3764
|
-
const h = o.getPoint(
|
|
3765
|
-
if (h &&
|
|
3766
|
-
const S =
|
|
3767
|
-
|
|
4117
|
+
const h = o.getPoint(m.point1Id), P = o.getPoint(m.point2Id);
|
|
4118
|
+
if (h && P) {
|
|
4119
|
+
const S = P.x - h.x, L = P.y - h.y, _ = -1e3, Z = 1e3, J = f(h.x + _ * S, h.y + _ * L), Q = f(h.x + Z * S, h.y + Z * L);
|
|
4120
|
+
c.strokeStyle = k, c.lineWidth = m.width, c.beginPath(), c.moveTo(J.x, J.y), c.lineTo(Q.x, Q.y), c.stroke();
|
|
3768
4121
|
}
|
|
3769
4122
|
break;
|
|
3770
4123
|
}
|
|
3771
4124
|
case "circle": {
|
|
3772
|
-
const h = o.getPoint(
|
|
4125
|
+
const h = o.getPoint(m.centerId);
|
|
3773
4126
|
if (h) {
|
|
3774
|
-
const
|
|
3775
|
-
|
|
4127
|
+
const P = f(h.x, h.y), S = m.radius * i.scale;
|
|
4128
|
+
c.beginPath(), c.arc(P.x, P.y, S, 0, 2 * Math.PI), m.fill && (c.fillStyle = `rgba(${m.fill.r},${m.fill.g},${m.fill.b},${m.fill.a ?? 0.2})`, c.fill()), c.strokeStyle = k, c.lineWidth = m.width, c.stroke();
|
|
3776
4129
|
}
|
|
3777
4130
|
break;
|
|
3778
4131
|
}
|
|
3779
4132
|
case "polygon": {
|
|
3780
|
-
const h =
|
|
4133
|
+
const h = m.pointIds.map((P) => o.getPoint(P)).filter(Boolean);
|
|
3781
4134
|
if (h.length > 0) {
|
|
3782
|
-
|
|
3783
|
-
const
|
|
3784
|
-
|
|
4135
|
+
c.beginPath();
|
|
4136
|
+
const P = f(h[0].x, h[0].y);
|
|
4137
|
+
c.moveTo(P.x, P.y);
|
|
3785
4138
|
for (let S = 1; S < h.length; S++) {
|
|
3786
|
-
const
|
|
3787
|
-
|
|
4139
|
+
const L = f(h[S].x, h[S].y);
|
|
4140
|
+
c.lineTo(L.x, L.y);
|
|
3788
4141
|
}
|
|
3789
|
-
|
|
4142
|
+
c.closePath(), m.fill && (c.fillStyle = `rgba(${m.fill.r},${m.fill.g},${m.fill.b},${m.fill.a ?? 0.2})`, c.fill()), c.strokeStyle = k, c.lineWidth = m.width, c.stroke();
|
|
3790
4143
|
}
|
|
3791
4144
|
break;
|
|
3792
4145
|
}
|
|
3793
4146
|
}
|
|
3794
4147
|
}
|
|
3795
4148
|
if (p.length > 0) {
|
|
3796
|
-
|
|
4149
|
+
c.fillStyle = D(
|
|
3797
4150
|
"var(--nice-primary-tint-30, rgba(25, 118, 210, 0.3))",
|
|
3798
|
-
|
|
4151
|
+
c.canvas
|
|
3799
4152
|
);
|
|
3800
|
-
for (const
|
|
3801
|
-
const
|
|
3802
|
-
if (
|
|
3803
|
-
const
|
|
3804
|
-
|
|
4153
|
+
for (const m of p) {
|
|
4154
|
+
const k = o.getPoint(m);
|
|
4155
|
+
if (k) {
|
|
4156
|
+
const C = f(k.x, k.y);
|
|
4157
|
+
c.beginPath(), c.arc(C.x, C.y, 12, 0, 2 * Math.PI), c.fill();
|
|
3805
4158
|
}
|
|
3806
4159
|
}
|
|
3807
4160
|
}
|
|
3808
4161
|
}
|
|
3809
|
-
}, [a, i, e, t,
|
|
4162
|
+
}, [a, i, e, t, l, p, o, f]), /* @__PURE__ */ d(
|
|
3810
4163
|
"canvas",
|
|
3811
4164
|
{
|
|
3812
4165
|
ref: r,
|
|
3813
4166
|
width: e,
|
|
3814
4167
|
height: t,
|
|
3815
4168
|
style: q.canvas,
|
|
3816
|
-
onClick:
|
|
4169
|
+
onClick: y
|
|
3817
4170
|
}
|
|
3818
4171
|
);
|
|
3819
4172
|
}
|
|
3820
|
-
function
|
|
4173
|
+
function We({
|
|
3821
4174
|
width: e,
|
|
3822
4175
|
height: t
|
|
3823
4176
|
}) {
|
|
3824
|
-
const {
|
|
3825
|
-
select: "Select",
|
|
3826
|
-
point: "Point",
|
|
3827
|
-
line: "Line",
|
|
3828
|
-
ray: "Ray",
|
|
3829
|
-
segment: "Segment",
|
|
3830
|
-
circle: "Circle",
|
|
3831
|
-
arc: "Arc",
|
|
3832
|
-
polygon: "Polygon",
|
|
3833
|
-
angle: "Angle",
|
|
3834
|
-
perpendicular: "Perpendicular",
|
|
3835
|
-
parallel: "Parallel",
|
|
3836
|
-
bisector: "Angle Bisector",
|
|
3837
|
-
midpoint: "Midpoint",
|
|
3838
|
-
tangent: "Tangent",
|
|
3839
|
-
intersection: "Intersection",
|
|
3840
|
-
reflect: "Reflect",
|
|
3841
|
-
rotate: "Rotate",
|
|
3842
|
-
translate: "Translate",
|
|
3843
|
-
dilate: "Dilate",
|
|
3844
|
-
measure: "Measure",
|
|
3845
|
-
text: "Text"
|
|
3846
|
-
},
|
|
4177
|
+
const { t: r } = E(), { tool: o, elements: a, view: n, service: i } = H(), [l, g] = M(null), s = {
|
|
4178
|
+
select: r("geometry.select", "Select"),
|
|
4179
|
+
point: r("geometry.point", "Point"),
|
|
4180
|
+
line: r("geometry.line", "Line"),
|
|
4181
|
+
ray: r("geometry.ray", "Ray"),
|
|
4182
|
+
segment: r("geometry.segment", "Segment"),
|
|
4183
|
+
circle: r("geometry.circle", "Circle"),
|
|
4184
|
+
arc: r("geometry.arc", "Arc"),
|
|
4185
|
+
polygon: r("geometry.polygon", "Polygon"),
|
|
4186
|
+
angle: r("geometry.angle", "Angle"),
|
|
4187
|
+
perpendicular: r("geometry.perpendicular", "Perpendicular"),
|
|
4188
|
+
parallel: r("geometry.parallel", "Parallel"),
|
|
4189
|
+
bisector: r("geometry.angleBisector", "Angle Bisector"),
|
|
4190
|
+
midpoint: r("geometry.midpoint", "Midpoint"),
|
|
4191
|
+
tangent: r("geometry.tangent", "Tangent"),
|
|
4192
|
+
intersection: r("geometry.intersection", "Intersection"),
|
|
4193
|
+
reflect: r("geometry.reflect", "Reflect"),
|
|
4194
|
+
rotate: r("geometry.rotate", "Rotate"),
|
|
4195
|
+
translate: r("geometry.translate", "Translate"),
|
|
4196
|
+
dilate: r("geometry.dilate", "Dilate"),
|
|
4197
|
+
measure: r("geometry.measure", "Measure"),
|
|
4198
|
+
text: r("geometry.text", "Text")
|
|
4199
|
+
}, p = a.filter((u) => u.type === "point").length;
|
|
3847
4200
|
return /* @__PURE__ */ v("div", { style: q.statusBar, children: [
|
|
3848
|
-
/* @__PURE__ */
|
|
3849
|
-
"Tool: ",
|
|
3850
|
-
u[r]
|
|
3851
|
-
] }),
|
|
4201
|
+
/* @__PURE__ */ d("span", { children: r("geometry.tool", "Tool: {tool}").replace("{tool}", String(s[o])) }),
|
|
3852
4202
|
/* @__PURE__ */ d("span", { style: { margin: "0 16px" }, children: "|" }),
|
|
3853
|
-
/* @__PURE__ */
|
|
3854
|
-
"
|
|
3855
|
-
|
|
3856
|
-
|
|
4203
|
+
/* @__PURE__ */ d("span", { children: r("geometry.objects", "Objects: {elements}").replace(
|
|
4204
|
+
"{elements}",
|
|
4205
|
+
String(a.length)
|
|
4206
|
+
) }),
|
|
3857
4207
|
/* @__PURE__ */ d("span", { style: { margin: "0 16px" }, children: "|" }),
|
|
3858
|
-
/* @__PURE__ */
|
|
3859
|
-
"Points: ",
|
|
3860
|
-
s
|
|
3861
|
-
] }),
|
|
4208
|
+
/* @__PURE__ */ d("span", { children: r("geometry.points", "Points: {pointCount}").replace("{pointCount}", String(p)) }),
|
|
3862
4209
|
/* @__PURE__ */ d("span", { style: { margin: "0 16px" }, children: "|" }),
|
|
3863
|
-
/* @__PURE__ */
|
|
3864
|
-
"Scale: ",
|
|
3865
|
-
a.scale.toFixed(1),
|
|
3866
|
-
"x"
|
|
3867
|
-
] })
|
|
4210
|
+
/* @__PURE__ */ d("span", { children: r("geometry.scaleX", "Scale: {scale}x").replace("{scale}", String(n.scale.toFixed(1))) })
|
|
3868
4211
|
] });
|
|
3869
4212
|
}
|
|
3870
4213
|
export {
|
|
3871
|
-
|
|
4214
|
+
qe as CalculatorService,
|
|
3872
4215
|
te as CalculusOps,
|
|
3873
|
-
|
|
3874
|
-
|
|
4216
|
+
Pe as EQUATION_TEMPLATES,
|
|
4217
|
+
le as ExpressionParser,
|
|
3875
4218
|
ee as FUNCTION_PRESETS,
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
4219
|
+
I as GeoMath,
|
|
4220
|
+
Ye as GeometryService,
|
|
4221
|
+
$e as GraphService,
|
|
4222
|
+
we as MATH_SYMBOLS,
|
|
4223
|
+
Me as MathEditorService,
|
|
4224
|
+
$ as MatrixOps,
|
|
4225
|
+
it as NiceCalculator,
|
|
4226
|
+
lt as NiceGeometry,
|
|
4227
|
+
at as NiceGraphPlotter,
|
|
4228
|
+
et as NiceI18nProvider,
|
|
4229
|
+
rt as NiceMathEditor,
|
|
4230
|
+
nt as createCalculatorService,
|
|
4231
|
+
st as createGeometryService,
|
|
4232
|
+
ot as createGraphService,
|
|
4233
|
+
tt as createMathEditorService,
|
|
4234
|
+
ke as getSymbolsByCategory,
|
|
3892
4235
|
Ce as recognizeHandwriting,
|
|
3893
|
-
|
|
4236
|
+
X as useCalculator,
|
|
3894
4237
|
H as useGeometry,
|
|
3895
|
-
|
|
4238
|
+
V as useGraph,
|
|
3896
4239
|
W as useMathEditor,
|
|
3897
|
-
|
|
4240
|
+
E as useNiceTranslation
|
|
3898
4241
|
};
|