quantum-component-library 1.4.45-qa.5 → 1.4.45-qa.7
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/components.cjs +3 -3
- package/dist/components.js +30 -29
- package/dist/{dnd-core-vendor-LFMXiCD5.js → dnd-core-vendor-B7dYqFGj.js} +2 -2
- package/dist/{dnd-core-vendor-rqY4Q0Vq.cjs → dnd-core-vendor-fsFbP4EK.cjs} +1 -1
- package/dist/emotion-vendor-D6PQH2K8.cjs +1 -0
- package/dist/emotion-vendor-DNnoMT20.js +546 -0
- package/dist/floating-ui-vendor-BcB50aec.js +246 -0
- package/dist/floating-ui-vendor-Dsd5TAjM.cjs +1 -0
- package/dist/{graphql-vendor-DUv16c0G.js → graphql-vendor-BALJU0FA.js} +1 -1
- package/dist/{graphql-vendor-DRps04BT.cjs → graphql-vendor-zFhl4d7h.cjs} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +115 -115
- package/dist/{lodash-vendor-D5A6v3mw.cjs → lodash-vendor-CR237hSU.cjs} +1 -1
- package/dist/{lodash-vendor-Dz4vW7Gd.js → lodash-vendor-D4ZPCr77.js} +1 -1
- package/dist/moment-vendor-1cRqq0AH.cjs +10 -0
- package/dist/moment-vendor-DMLRxgRE.js +2589 -0
- package/dist/{other-TR0ap-t4.cjs → other-Dp3RPYfF.cjs} +1 -1
- package/dist/other-react-vendor-CbZyzO2N.cjs +36 -0
- package/dist/other-react-vendor-ZnZFHn3v.js +598 -0
- package/dist/providers.cjs +1 -1
- package/dist/providers.js +2 -2
- package/dist/react-dnd-vendor-Bsa3sIdS.cjs +2 -0
- package/dist/{react-dnd-vendor-Cuc51Scz.js → react-dnd-vendor-CnjZk49P.js} +35 -34
- package/dist/react-select-vendor-BFizJ8yU.cjs +4 -0
- package/dist/{react-select-vendor-BrXjJVof.js → react-select-vendor-F4s0M_nP.js} +12 -10
- package/dist/services.cjs +1 -1
- package/dist/services.js +1 -1
- package/dist/stylis-vendor-CdCMw5Aa.js +334 -0
- package/dist/stylis-vendor-DzcTLVj9.cjs +1 -0
- package/dist/types.cjs +1 -1
- package/dist/types.js +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +26 -25
- package/dist/vendor-Bc1whdE2.cjs +1 -0
- package/dist/vendor-BomSre9q.js +3717 -0
- package/package.json +2 -3
- package/dist/react-dnd-vendor-FieaWO8Z.cjs +0 -2
- package/dist/react-select-vendor-CVxjkFXv.cjs +0 -4
- package/dist/vendor-CPJGEWOn.cjs +0 -45
- package/dist/vendor-CoDHTSgb.js +0 -7981
- package/dist/{providers → lib/providers}/index.d.ts +0 -0
- package/dist/{providers → lib/providers}/quantum-library-provider.d.ts +0 -0
- package/dist/{other-CmpBz5tg.js → other-C4VnLmM6.js} +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import * as X from "react";
|
|
2
2
|
import { useState as Y, useCallback as T, useRef as q, useMemo as ue, createContext as Yt, useContext as zt, Component as kt, Fragment as we, useEffect as Ve, forwardRef as oe } from "react";
|
|
3
3
|
import { _ as ee, a as D, b as f, c as jt, d as me, e as x, f as Ut, g as Qt, h as $t, i as Kt, j as _t, k as de } from "./babel-vendor-BOM86iTb.js";
|
|
4
|
-
import {
|
|
5
|
-
import { createPortal as
|
|
4
|
+
import { a as A, c as gt, k as qt, j as S } from "./other-react-vendor-ZnZFHn3v.js";
|
|
5
|
+
import { createPortal as en } from "react-dom";
|
|
6
|
+
import { a as tn } from "./floating-ui-vendor-BcB50aec.js";
|
|
7
|
+
import { w as Je, x as nn } from "./vendor-BomSre9q.js";
|
|
6
8
|
import { useTheme as bt, useFormControl as un, useMultiStyleConfig as ae, Box as L, useColorModeValue as Qe, MenuIcon as an, chakra as ze, Menu as on, Spinner as rn, Divider as ln, useStyleConfig as sn, useBreakpointValue as cn, Icon as ke } from "@chakra-ui/react";
|
|
7
9
|
var dn = ["defaultInputValue", "defaultMenuIsOpen", "defaultValue", "inputValue", "menuIsOpen", "onChange", "onInputChange", "onMenuClose", "onMenuOpen", "value"];
|
|
8
10
|
function Fe(n) {
|
|
@@ -348,7 +350,7 @@ var vt = function(t) {
|
|
|
348
350
|
G();
|
|
349
351
|
}, [G]);
|
|
350
352
|
var C = T(function() {
|
|
351
|
-
typeof l.current == "function" && (l.current(), l.current = null), e && a.current && (l.current =
|
|
353
|
+
typeof l.current == "function" && (l.current(), l.current = null), e && a.current && (l.current = tn(e, a.current, G, {
|
|
352
354
|
elementResize: "ResizeObserver" in window
|
|
353
355
|
}));
|
|
354
356
|
}, [e, G]);
|
|
@@ -370,7 +372,7 @@ var vt = function(t) {
|
|
|
370
372
|
}), o), u);
|
|
371
373
|
return A(Ct.Provider, {
|
|
372
374
|
value: m
|
|
373
|
-
}, i ? /* @__PURE__ */
|
|
375
|
+
}, i ? /* @__PURE__ */ en(E, i) : E);
|
|
374
376
|
}, wn = function(t) {
|
|
375
377
|
var i = t.isDisabled, u = t.isRtl;
|
|
376
378
|
return {
|
|
@@ -493,7 +495,7 @@ var Kn = process.env.NODE_ENV === "production" ? {
|
|
|
493
495
|
return A("span", x({}, i, H(t, "indicatorSeparator", {
|
|
494
496
|
"indicator-separator": !0
|
|
495
497
|
})));
|
|
496
|
-
}, ui =
|
|
498
|
+
}, ui = qt(_e || (_e = Ut([`
|
|
497
499
|
0%, 80%, 100% { opacity: 0; }
|
|
498
500
|
40% { opacity: 1; }
|
|
499
501
|
`]))), ai = function(t, i) {
|
|
@@ -1244,7 +1246,7 @@ var yt = function(t) {
|
|
|
1244
1246
|
return t.replace(ji, function(i) {
|
|
1245
1247
|
return Bt[i];
|
|
1246
1248
|
});
|
|
1247
|
-
}, Ui =
|
|
1249
|
+
}, Ui = nn(yt), et = function(t) {
|
|
1248
1250
|
return t.replace(/^\s+|\s+$/g, "");
|
|
1249
1251
|
}, Qi = function(t) {
|
|
1250
1252
|
return "".concat(t.label, " ").concat(t.value);
|
|
@@ -2782,7 +2784,7 @@ var Wu = /* @__PURE__ */ oe(function(n, t) {
|
|
|
2782
2784
|
}, Re = xa, Ga = oe((n, t) => {
|
|
2783
2785
|
let i = Re(n);
|
|
2784
2786
|
return S.jsx(Su, { ref: t, ...i });
|
|
2785
|
-
}),
|
|
2787
|
+
}), Pa = Ga;
|
|
2786
2788
|
oe((n, t) => {
|
|
2787
2789
|
let i = Re(n);
|
|
2788
2790
|
return S.jsx(Ru, { ref: t, ...i });
|
|
@@ -2794,8 +2796,8 @@ oe((n, t) => {
|
|
|
2794
2796
|
var Va = oe((n, t) => {
|
|
2795
2797
|
let i = Re(n);
|
|
2796
2798
|
return S.jsx(Mu, { ref: t, ...i });
|
|
2797
|
-
}),
|
|
2799
|
+
}), Wa = Va;
|
|
2798
2800
|
export {
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
+
Pa as s,
|
|
2802
|
+
Wa as y
|
|
2801
2803
|
};
|
package/dist/services.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./types.cjs");require("./vendor-CPJGEWOn.cjs");const c=require("./utils.cjs"),j={sagittal:{__COMMENT__:"-Plantar Flexion, +Dorsi flexion",min:-20,max:30},frontal:{__COMMENT__:"-Inversion, +Eversion",min:-30,max:20},transverse:{__COMMENT__:"-Pronation, +Supination",min:-10,max:10}},y={sagittal:{__COMMENT__:"-Plantar Flexion, +Dorsi flexion",min:-20,max:30},frontal:{__COMMENT__:"-Inversion, +Eversion",min:-30,max:20},transverse:{__COMMENT__:"-Pronation, +Supination",min:-10,max:10}},$={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-5,max:142},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"N/A",min:0,max:0}},I={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-5,max:142},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"N/A",min:0,max:0}},z={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-18,max:134},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-20,max:40},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-40,max:50}},W={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-18,max:134},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-20,max:40},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-40,max:50}},q={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-75,max:60},frontal:{__COMMENT__:"-Bend Right, +Bend Left",min:-45,max:45},transverse:{__COMMENT__:"-Twist Right, +Twist Left",min:-80,max:80}},V={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-25,max:50},frontal:{__COMMENT__:"-Bend Right, +Bend Left",min:-25,max:25},transverse:{__COMMENT__:"-Twist Right, +Twist Left",min:-30,max:30}},X={__COMMENT__:"This is the sum of the ChestSpine and NavalSpine",sagittal:{__COMMENT__:"-Extension, +Flexion",min:-100,max:110},frontal:{__COMMENT__:"-Bend Right, +Bend Left",min:-70,max:70},transverse:{__COMMENT__:"-Twist Right, +Twist Left",min:-110,max:110}},G={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-50,max:180},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-50,max:180},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-90,max:90}},Q={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-50,max:180},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-50,max:180},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-90,max:90}},Y={sagittal:{__COMMENT__:"-Extension, +Flexion",min:0,max:140},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"-Pronation/+Supination (of forearm)",min:-80,max:80}},Z={sagittal:{__COMMENT__:"-Extension, +Flexion",min:0,max:140},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"-Pronation/+Supination (of forearm)",min:-80,max:80}},x={LeftAnkle:j,RightAnkle:y,LeftKnee:$,RightKnee:I,LeftHip:z,RightHip:W,NavalSpine:q,ChestSpine:V,TotalSpine:X,LeftShoulder:G,RightShoulder:Q,LeftElbow:Y,RightElbow:Z},i={LeftFoot:"Left Foot",RightFoot:"Right Foot",LeftShank:"Left Shank",RightShank:"Right Shank",LeftThigh:"Left Thigh",RightThigh:"Right Thigh",LeftPelvis:"Left Pelvis",RightPelvis:"Right Pelvis",LowerBack:"Pelvis",CenterBack:"Center Back",UpperBack:"Thorax",Head:"Head",LeftClavicle:"Left Clavicle",RightClavicle:"Right Clavicle",LeftUpperArm:"Left Upper Arm",RightUpperArm:"Right Upper Arm",LeftForearm:"Left Forearm",RightForearm:"Right Forearm"},a={LeftAnkle:"Left Ankle",RightAnkle:"Right Ankle",LeftKnee:"Left Knee",RightKnee:"Right Knee",LeftHip:"Left Hip",RightHip:"Right Hip",NavalSpine:"Lower Back",ChestSpine:"Upper Back",TotalSpine:"Total Spine",LeftShoulder:"Left Shoulder",RightShoulder:"Right Shoulder",LeftElbow:"Left Elbow",RightElbow:"Right Elbow",Neck:"Neck"},ee={LeftFoot:["LeftAnkle"],RightFoot:["RightAnkle"],LeftShank:["LeftKnee","LeftAnkle"],RightShank:["RightKnee","RightAnkle"],LeftThigh:["LeftHip","LeftKnee"],RightThigh:["RightHip","RightKnee"],LeftPelvis:["LeftHip"],RightPelvis:["RightHip"],LowerBack:["LeftHip","RightHip","NavalSpine","TotalSpine"],CenterBack:["NavalSpine","ChestSpine"],UpperBack:["ChestSpine","TotalSpine"],Head:["Neck"],LeftClavicle:["LeftShoulder"],RightClavicle:["RightShoulder"],LeftUpperArm:["LeftShoulder","LeftElbow"],RightUpperArm:["RightShoulder","RightElbow"],LeftForearm:["LeftElbow"],RightForearm:["RightElbow"]},R={LeftAnkle:["LeftFoot","LeftShank"],RightAnkle:["RightFoot","RightShank"],LeftKnee:["LeftShank","LeftThigh"],RightKnee:["RightShank","RightThigh"],LeftHip:["LeftThigh","LowerBack"],RightHip:["RightThigh","LowerBack"],NavalSpine:["LowerBack","CenterBack"],ChestSpine:["CenterBack","UpperBack"],TotalSpine:["UpperBack","LowerBack"],LeftShoulder:["LeftClavicle","LeftUpperArm"],RightShoulder:["RightClavicle","RightUpperArm"],LeftElbow:["LeftUpperArm","LeftForearm"],RightElbow:["RightUpperArm","RightForearm"],Neck:["Head","UpperBack"]},d=()=>[{id:"LeftFoot",name:i.LeftFoot},{id:"RightFoot",name:i.RightFoot},{id:"LeftShank",name:i.LeftShank},{id:"RightShank",name:i.RightShank},{id:"LeftThigh",name:i.LeftThigh},{id:"RightThigh",name:i.RightThigh},{id:"LowerBack",name:i.LowerBack},{id:"CenterBack",name:i.CenterBack},{id:"UpperBack",name:i.UpperBack},{id:"Head",name:i.Head},{id:"LeftUpperArm",name:i.LeftUpperArm},{id:"RightUpperArm",name:i.RightUpperArm},{id:"LeftForearm",name:i.LeftForearm},{id:"RightForearm",name:i.RightForearm}],te=t=>d().filter(e=>t.find(n=>n==e.id)),A=()=>[{id:"LeftAnkle",name:a.LeftAnkle},{id:"RightAnkle",name:a.RightAnkle},{id:"LeftKnee",name:a.LeftKnee},{id:"RightKnee",name:a.RightKnee},{id:"LeftHip",name:a.LeftHip},{id:"RightHip",name:a.RightHip},{id:"NavalSpine",name:a.NavalSpine},{id:"ChestSpine",name:a.ChestSpine},{id:"TotalSpine",name:a.TotalSpine},{id:"LeftShoulder",name:a.LeftShoulder},{id:"RightShoulder",name:a.RightShoulder},{id:"LeftElbow",name:a.LeftElbow},{id:"RightElbow",name:a.RightElbow},{id:"Neck",name:a.Neck}],_=()=>[{id:"LeftAnkle",name:a.LeftAnkle},{id:"RightAnkle",name:a.RightAnkle},{id:"LeftKnee",name:a.LeftKnee},{id:"RightKnee",name:a.RightKnee},{id:"LeftHip",name:a.LeftHip},{id:"RightHip",name:a.RightHip},{id:"NavalSpine",name:a.NavalSpine},{id:"ChestSpine",name:a.ChestSpine},{id:"TotalSpine",name:a.TotalSpine},{id:"LeftShoulder",name:a.LeftShoulder},{id:"RightShoulder",name:a.RightShoulder},{id:"Neck",name:a.Neck}],p=()=>[{id:"LeftAnkle",name:a.LeftAnkle},{id:"RightAnkle",name:a.RightAnkle},{id:"LeftKnee",name:a.LeftKnee},{id:"RightKnee",name:a.RightKnee},{id:"LeftHip",name:a.LeftHip},{id:"RightHip",name:a.RightHip},{id:"TotalSpine",name:a.TotalSpine},{id:"LeftShoulder",name:a.LeftShoulder},{id:"RightShoulder",name:a.RightShoulder},{id:"LeftElbow",name:a.LeftElbow},{id:"RightElbow",name:a.RightElbow},{id:"Neck",name:a.Neck}],ne=()=>[{id:"Head",name:i.Head},{id:"LeftThigh",name:i.LeftThigh},{id:"RightThigh",name:i.RightThigh},{id:"LeftShank",name:i.LeftShank},{id:"RightShank",name:i.RightShank},{id:"LeftFoot",name:i.LeftFoot},{id:"RightFoot",name:i.RightFoot},{id:"LowerBack",name:i.LowerBack},{id:"UpperBack",name:i.UpperBack},{id:"LeftUpperArm",name:i.LeftUpperArm},{id:"RightUpperArm",name:i.RightUpperArm},{id:"LeftForearm",name:i.LeftForearm},{id:"RightForearm",name:i.RightForearm}],ae=t=>_().filter(n=>R[n.id].every(s=>t.includes(s))),ie=t=>p().filter(n=>R[n.id].every(s=>t.includes(s))),k=(t,e,n)=>{if(n)return["frontal","sagittal","transverse"];switch(t){case"LeftKnee":case"RightKnee":return["sagittal"];case"LeftAnkle":case"RightAnkle":return e&&e==l.AngleDataSource.Pose?["sagittal"]:["frontal","sagittal"];case"TotalSpine":return e&&e==l.AngleDataSource.Pose?["frontal"]:["frontal","sagittal","transverse"];case"LeftElbow":case"RightElbow":return e&&e==l.AngleDataSource.Pose?["sagittal"]:["frontal","sagittal","transverse"]}return e&&e==l.AngleDataSource.Pose?["frontal","sagittal"]:["frontal","sagittal","transverse"]},S=(t,e)=>{if(e===l.AngleDataSource.Sensor)return["frontal","sagittal","transverse"];switch(t){case"Head":case"LeftThigh":case"RightThigh":case"LeftShank":case"RightShank":case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":return["frontal","sagittal"];case"LeftFoot":case"RightFoot":return["sagittal"];case"LowerBack":return["frontal"];case"UpperBack":return["frontal","sagittal"]}return[]},b=c.memo((t,e,n)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return n<0?"inversion":"eversion";case"sagittal":return n<0?"plantar flexion":"dorsi flexion";case"transverse":return n<0?"internal rotation":"external rotation"}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return n<0?"adduction":"abduction";case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"internal rotation":"external rotation"}case"LeftHip":case"RightHip":case"LeftShoulder":case"RightShoulder":switch(e){case"frontal":return n<0?"adduction":"abduction";case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"internal rotation":"external rotation"}case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return n<0?"right lateral flexion":"left lateral flexion";case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"right rotation":"left rotation"}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return null;case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"pronation":"supination"}}return null}),E=c.memo((t,e,n)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return n<0?"Inv.":"Ev.";case"sagittal":return n<0?"PF.":"DF.";case"transverse":return n<0?"IR.":"ER."}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return n<0?"Add.":"Abd.";case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"IR.":"ER."}case"LeftHip":case"RightHip":case"LeftShoulder":case"RightShoulder":switch(e){case"frontal":return n<0?"Add.":"Abd.";case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"IR.":"ER."}case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return n<0?"R. Bend":"L. Bend";case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"R. Rot.":"L. Rot."}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return null;case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"Pro.":"Sup."}}return null}),u=c.memo((t,e,n)=>{switch(t){case"LowerBack":case"LeftPelvis":case"RightPelvis":switch(e){case"frontal":return n<0?"right drop":"left drop";case"sagittal":return n<0?"anterior tilt":"posterior tilt";case"transverse":return n<0?"right rotation":"left rotation"}case"Head":case"UpperBack":case"CenterBack":case"LeftShank":case"RightShank":case"LeftThigh":case"RightThigh":case"LeftFoot":case"RightFoot":case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":switch(e){case"frontal":return n<0?"right tilt":"left tilt";case"sagittal":return n<0?"anterior tilt":"posterior tilt";case"transverse":return n<0?"right rotation":"left rotation"}default:return null}}),N=c.memo((t,e,n)=>{switch(t){case"LowerBack":case"LeftPelvis":case"RightPelvis":switch(e){case"frontal":return n<0?"R. Drop":"L. Drop";case"sagittal":return n<0?"Ant. Tilt":"Pos. Tilt";case"transverse":return n<0?"R. Rot.":"L. Rot."}case"Head":case"UpperBack":case"CenterBack":case"LeftShank":case"RightShank":case"LeftThigh":case"RightThigh":case"LeftFoot":case"RightFoot":case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":switch(e){case"frontal":return n<0?"R. Tilt":"L. Tilt";case"sagittal":return n<0?"Ant. Tilt":"Pos. Tilt";case"transverse":return n<0?"R. Rot.":"L. Rot."}default:return null}}),se=c.memo((t,e)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return{min:-20,max:20};case"sagittal":return{min:-30,max:30};case"transverse":return{min:-5,max:5}}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return{min:-5,max:5};case"sagittal":return{min:-5,max:90};case"transverse":return{min:-5,max:5}}case"LeftHip":case"RightHip":return{min:-30,max:30};case"LeftShoulder":case"RightShoulder":return{min:-50,max:50};case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return{min:-5,max:5};case"sagittal":return{min:-5,max:5};case"transverse":return{min:-5,max:5}}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return{min:-5,max:5};case"sagittal":return{min:-5,max:50};case"transverse":return{min:-5,max:5}}}return{min:-10,max:10}}),re=c.memo((t,e)=>{switch(t){case"LeftFoot":case"RightFoot":switch(e){case"frontal":return{min:-20,max:20};case"sagittal":return{min:-30,max:30};case"transverse":return{min:-5,max:5}}case"LeftShank":case"RightShank":switch(e){case"frontal":return{min:-35,max:35};case"sagittal":return{min:-35,max:35};case"transverse":return{min:-5,max:5}}case"LeftThigh":case"RightThigh":switch(e){case"frontal":return{min:-35,max:35};case"sagittal":return{min:-35,max:35};case"transverse":return{min:-10,max:5}}case"LeftPelvis":case"RightPelvis":switch(e){case"frontal":return{min:-15,max:15};case"sagittal":return{min:-10,max:10};case"transverse":return{min:-10,max:10}}case"LowerBack":case"CenterBack":case"UpperBack":case"Head":return{min:-5,max:5};case"LeftClavicle":case"RightClavicle":switch(e){case"frontal":return{min:-15,max:15};case"sagittal":return{min:-10,max:10};case"transverse":return{min:-10,max:10}}case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":switch(e){case"frontal":return{min:-45,max:45};case"sagittal":return{min:-45,max:45};case"transverse":return{min:-20,max:20}}}return{min:-10,max:10}}),oe=c.memo((t,e)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return{min:-40,max:30};case"sagittal":return{min:-80,max:50};case"transverse":return{min:-90,max:90}}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return{min:-15,max:5};case"sagittal":return{min:-10,max:160};case"transverse":return{min:-35,max:45}}case"LeftHip":case"RightHip":switch(e){case"frontal":return{min:-50,max:60};case"sagittal":return{min:-50,max:150};case"transverse":return{min:-60,max:70}}case"TotalSpine":switch(e){case"frontal":return{min:-60,max:60};case"sagittal":return{min:-50,max:150};case"transverse":return{min:-50,max:50}}case"ChestSpine":switch(e){case"frontal":return{min:-25,max:25};case"sagittal":return{min:-25,max:40};case"transverse":return{min:-35,max:35}}case"NavalSpine":switch(e){case"frontal":return{min:-25,max:25};case"sagittal":return{min:-35,max:60};case"transverse":return{min:-15,max:15}}default:return{min:-180,max:180}}}),w=(t,e)=>({kind:"joint",value:t,plane:e}),v=(t,e)=>({kind:"limb",value:t,plane:e}),T=(t,e)=>({kind:"acceleration",value:t,axis:e}),F=(t,e)=>({kind:"angular_velocity",value:t,plane:e}),M=t=>l.axes.includes(t),le=t=>l.planes.includes(t),C=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!d().find(e=>e.id===t.id),P=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!A().find(e=>e.id===t.id),ce=(t,e,n=!1)=>M(e)?C(t)?T(t,e):fe(`Can't make acceleration part from joint: ${t} ${e}`):P(t)?n?F(t,e):w(t,e):v(t,e),me=t=>t.kind==="acceleration"?t.axis:t.plane,ge=t=>t?.kind==="acceleration"?t.axis:null,he=t=>t?.kind==="acceleration"?null:t?.plane??null,fe=t=>{throw new Error(t)},m=t=>t in a?a[t]:t in i?i[t]:"Unknown",ue=t=>m(t).replace(/Left|Right/g,""),Le=t=>t in x,B=(t,e)=>{if(!Le(t))return null;const n=x[t];if(e in n){const{min:r,max:s}=n[e];return{min:r??0,max:s??0}}return null},Re=(...t)=>{const e=B(...t);return e?Math.abs(e.max-e.min):0},H=(t,e)=>{const n=Object.keys(i).find(s=>s===e),r=Object.keys(a).find(s=>s===e);return!n&&!r?null:n?t.limbs[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose:t.joints[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose},de=(t,e,n)=>{const r=Object.keys(a).find(o=>o===e),s=H(t,e);return s?r?k(e,s).includes(n):S(e,s).includes(n):!1},xe=(t,e,n)=>{const r=Object.keys(i).find(o=>o===e),s=Object.keys(a).find(o=>o===e);if(!r&&!s)throw new Error(`Unknown partId: ${e} - this invariant should've been enforced by typescript`);return r?l.limbAngle(t.limbs[e])?.[n]??null:l.jointAngle(t.joints[e],void 0,t.direction)?.[n]??null},f=(t=!1)=>t?"Internal/External Rotation":"External/Internal Rotation",O=(t,e,n=!1)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return n?"Inversion/Eversion":"Eversion/Inversion";case"sagittal":return n?"Plantar/Dorsi Flexion":"Dorsi/Plantar Flexion";case"transverse":return f(n)}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return f(n)}case"LeftHip":case"RightHip":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return f(n)}case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return"Lateral Bend";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return"Rotation"}case"LeftShoulder":case"RightShoulder":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return f(n)}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return n?"Pronation/Supination":"Supination/Pronation"}}},U=(t,e,n=!1)=>{const r=m(t),s=u(t,e,1),o=u(t,e,-1);if(s&&o){const g=c.capitalizeAll(s),h=c.capitalizeAll(o),D=n?`${h}/${g}`:`${g}/${h}`;return`${r} (${D})`}return`${r} (${e})`},Ae=(t,e)=>{let n;switch(e){case"x":n="Med./Lat.";break;case"y":n="Vertical";break;case"z":n="Ant./Post."}return`${m(t)} ${n}`},K=(t,e,n=!1)=>{const r=m(t),s=O(t,e,n);return s?`${r} (${s})`:null},_e=(t,e)=>K(t,e)||U(t,e),L=(t,e,n,r=!1)=>{const s=r?E:b,o=r?N:u,[g,h]=t==="joint"?[s(e,n,1),s(e,n,-1)]:[o(e,n,1),o(e,n,-1)];return{positive:g,negative:h}},J=(t,e=!1)=>t.partKind==="joint"?L("joint",t.partId,t.partDimension,e):L("segment",t.partId,t.partDimension,e),pe=(t,e,n=!1)=>{const{positive:r,negative:s}=J(e,n);return t>=0?r:s};exports.getAllAvailableJoints=A;exports.getAllAvailableLimbs=d;exports.getAllAvailablePoseJoints=p;exports.getAllAvailablePoseLimbs=ne;exports.getAllAvailableSensorJoints=_;exports.getAngleDirectionNames=L;exports.getAvailableLimbsForLimbIds=te;exports.getAvailablePoseJointsForLimbIds=ie;exports.getAvailableSensorJointsForLimbIds=ae;exports.getAxis=ge;exports.getDefaultAngleSource=H;exports.getDefaultJointRange=se;exports.getDefaultLimbRange=re;exports.getEnabledJointPlanes=k;exports.getEnabledSegmentPlanes=S;exports.getHumanBodyAngle=xe;exports.getIsDefaultAngleAllowed=de;exports.getJointAngleDirectionAbbr=E;exports.getJointAngleDirectionName=b;exports.getJointNameWithPlane=K;exports.getJointOrSegmentNameWithPlane=_e;exports.getJointPlaneName=O;exports.getNormativeJointRange=oe;exports.getParameterAngleDirectionName=pe;exports.getParameterDirectionNames=J;exports.getPartName=m;exports.getPartNameNoSide=ue;exports.getPlane=he;exports.getSegmentAngleDirectionAbbr=N;exports.getSegmentAngleDirectionName=u;exports.getSegmentNameWithPlane=U;exports.getSegmentXyzName=Ae;exports.getTypicalRom=B;exports.getTypicalRomSize=Re;exports.isAxis=M;exports.isJoint=P;exports.isLimb=C;exports.isPlane=le;exports.jointNames=a;exports.jointsUsedByLimbs=ee;exports.limbNames=i;exports.limbsRequiredForJoints=R;exports.mkAccelerationPart=T;exports.mkAngularVelocityPart=F;exports.mkHumanPart=ce;exports.mkJointPart=w;exports.mkLimbPart=v;exports.planeOrAxis=me;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./types.cjs");require("./moment-vendor-1cRqq0AH.cjs");const c=require("./utils.cjs"),j={sagittal:{__COMMENT__:"-Plantar Flexion, +Dorsi flexion",min:-20,max:30},frontal:{__COMMENT__:"-Inversion, +Eversion",min:-30,max:20},transverse:{__COMMENT__:"-Pronation, +Supination",min:-10,max:10}},y={sagittal:{__COMMENT__:"-Plantar Flexion, +Dorsi flexion",min:-20,max:30},frontal:{__COMMENT__:"-Inversion, +Eversion",min:-30,max:20},transverse:{__COMMENT__:"-Pronation, +Supination",min:-10,max:10}},$={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-5,max:142},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"N/A",min:0,max:0}},I={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-5,max:142},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"N/A",min:0,max:0}},z={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-18,max:134},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-20,max:40},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-40,max:50}},W={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-18,max:134},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-20,max:40},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-40,max:50}},q={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-75,max:60},frontal:{__COMMENT__:"-Bend Right, +Bend Left",min:-45,max:45},transverse:{__COMMENT__:"-Twist Right, +Twist Left",min:-80,max:80}},V={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-25,max:50},frontal:{__COMMENT__:"-Bend Right, +Bend Left",min:-25,max:25},transverse:{__COMMENT__:"-Twist Right, +Twist Left",min:-30,max:30}},X={__COMMENT__:"This is the sum of the ChestSpine and NavalSpine",sagittal:{__COMMENT__:"-Extension, +Flexion",min:-100,max:110},frontal:{__COMMENT__:"-Bend Right, +Bend Left",min:-70,max:70},transverse:{__COMMENT__:"-Twist Right, +Twist Left",min:-110,max:110}},G={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-50,max:180},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-50,max:180},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-90,max:90}},Q={sagittal:{__COMMENT__:"-Extension, +Flexion",min:-50,max:180},frontal:{__COMMENT__:"-Adduction, +Abduction",min:-50,max:180},transverse:{__COMMENT__:"-Internal Rotation, +External Rotation",min:-90,max:90}},Y={sagittal:{__COMMENT__:"-Extension, +Flexion",min:0,max:140},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"-Pronation/+Supination (of forearm)",min:-80,max:80}},Z={sagittal:{__COMMENT__:"-Extension, +Flexion",min:0,max:140},frontal:{__COMMENT__:"N/A",min:0,max:0},transverse:{__COMMENT__:"-Pronation/+Supination (of forearm)",min:-80,max:80}},x={LeftAnkle:j,RightAnkle:y,LeftKnee:$,RightKnee:I,LeftHip:z,RightHip:W,NavalSpine:q,ChestSpine:V,TotalSpine:X,LeftShoulder:G,RightShoulder:Q,LeftElbow:Y,RightElbow:Z},i={LeftFoot:"Left Foot",RightFoot:"Right Foot",LeftShank:"Left Shank",RightShank:"Right Shank",LeftThigh:"Left Thigh",RightThigh:"Right Thigh",LeftPelvis:"Left Pelvis",RightPelvis:"Right Pelvis",LowerBack:"Pelvis",CenterBack:"Center Back",UpperBack:"Thorax",Head:"Head",LeftClavicle:"Left Clavicle",RightClavicle:"Right Clavicle",LeftUpperArm:"Left Upper Arm",RightUpperArm:"Right Upper Arm",LeftForearm:"Left Forearm",RightForearm:"Right Forearm"},a={LeftAnkle:"Left Ankle",RightAnkle:"Right Ankle",LeftKnee:"Left Knee",RightKnee:"Right Knee",LeftHip:"Left Hip",RightHip:"Right Hip",NavalSpine:"Lower Back",ChestSpine:"Upper Back",TotalSpine:"Total Spine",LeftShoulder:"Left Shoulder",RightShoulder:"Right Shoulder",LeftElbow:"Left Elbow",RightElbow:"Right Elbow",Neck:"Neck"},ee={LeftFoot:["LeftAnkle"],RightFoot:["RightAnkle"],LeftShank:["LeftKnee","LeftAnkle"],RightShank:["RightKnee","RightAnkle"],LeftThigh:["LeftHip","LeftKnee"],RightThigh:["RightHip","RightKnee"],LeftPelvis:["LeftHip"],RightPelvis:["RightHip"],LowerBack:["LeftHip","RightHip","NavalSpine","TotalSpine"],CenterBack:["NavalSpine","ChestSpine"],UpperBack:["ChestSpine","TotalSpine"],Head:["Neck"],LeftClavicle:["LeftShoulder"],RightClavicle:["RightShoulder"],LeftUpperArm:["LeftShoulder","LeftElbow"],RightUpperArm:["RightShoulder","RightElbow"],LeftForearm:["LeftElbow"],RightForearm:["RightElbow"]},R={LeftAnkle:["LeftFoot","LeftShank"],RightAnkle:["RightFoot","RightShank"],LeftKnee:["LeftShank","LeftThigh"],RightKnee:["RightShank","RightThigh"],LeftHip:["LeftThigh","LowerBack"],RightHip:["RightThigh","LowerBack"],NavalSpine:["LowerBack","CenterBack"],ChestSpine:["CenterBack","UpperBack"],TotalSpine:["UpperBack","LowerBack"],LeftShoulder:["LeftClavicle","LeftUpperArm"],RightShoulder:["RightClavicle","RightUpperArm"],LeftElbow:["LeftUpperArm","LeftForearm"],RightElbow:["RightUpperArm","RightForearm"],Neck:["Head","UpperBack"]},d=()=>[{id:"LeftFoot",name:i.LeftFoot},{id:"RightFoot",name:i.RightFoot},{id:"LeftShank",name:i.LeftShank},{id:"RightShank",name:i.RightShank},{id:"LeftThigh",name:i.LeftThigh},{id:"RightThigh",name:i.RightThigh},{id:"LowerBack",name:i.LowerBack},{id:"CenterBack",name:i.CenterBack},{id:"UpperBack",name:i.UpperBack},{id:"Head",name:i.Head},{id:"LeftUpperArm",name:i.LeftUpperArm},{id:"RightUpperArm",name:i.RightUpperArm},{id:"LeftForearm",name:i.LeftForearm},{id:"RightForearm",name:i.RightForearm}],te=t=>d().filter(e=>t.find(n=>n==e.id)),A=()=>[{id:"LeftAnkle",name:a.LeftAnkle},{id:"RightAnkle",name:a.RightAnkle},{id:"LeftKnee",name:a.LeftKnee},{id:"RightKnee",name:a.RightKnee},{id:"LeftHip",name:a.LeftHip},{id:"RightHip",name:a.RightHip},{id:"NavalSpine",name:a.NavalSpine},{id:"ChestSpine",name:a.ChestSpine},{id:"TotalSpine",name:a.TotalSpine},{id:"LeftShoulder",name:a.LeftShoulder},{id:"RightShoulder",name:a.RightShoulder},{id:"LeftElbow",name:a.LeftElbow},{id:"RightElbow",name:a.RightElbow},{id:"Neck",name:a.Neck}],_=()=>[{id:"LeftAnkle",name:a.LeftAnkle},{id:"RightAnkle",name:a.RightAnkle},{id:"LeftKnee",name:a.LeftKnee},{id:"RightKnee",name:a.RightKnee},{id:"LeftHip",name:a.LeftHip},{id:"RightHip",name:a.RightHip},{id:"NavalSpine",name:a.NavalSpine},{id:"ChestSpine",name:a.ChestSpine},{id:"TotalSpine",name:a.TotalSpine},{id:"LeftShoulder",name:a.LeftShoulder},{id:"RightShoulder",name:a.RightShoulder},{id:"Neck",name:a.Neck}],p=()=>[{id:"LeftAnkle",name:a.LeftAnkle},{id:"RightAnkle",name:a.RightAnkle},{id:"LeftKnee",name:a.LeftKnee},{id:"RightKnee",name:a.RightKnee},{id:"LeftHip",name:a.LeftHip},{id:"RightHip",name:a.RightHip},{id:"TotalSpine",name:a.TotalSpine},{id:"LeftShoulder",name:a.LeftShoulder},{id:"RightShoulder",name:a.RightShoulder},{id:"LeftElbow",name:a.LeftElbow},{id:"RightElbow",name:a.RightElbow},{id:"Neck",name:a.Neck}],ne=()=>[{id:"Head",name:i.Head},{id:"LeftThigh",name:i.LeftThigh},{id:"RightThigh",name:i.RightThigh},{id:"LeftShank",name:i.LeftShank},{id:"RightShank",name:i.RightShank},{id:"LeftFoot",name:i.LeftFoot},{id:"RightFoot",name:i.RightFoot},{id:"LowerBack",name:i.LowerBack},{id:"UpperBack",name:i.UpperBack},{id:"LeftUpperArm",name:i.LeftUpperArm},{id:"RightUpperArm",name:i.RightUpperArm},{id:"LeftForearm",name:i.LeftForearm},{id:"RightForearm",name:i.RightForearm}],ae=t=>_().filter(n=>R[n.id].every(s=>t.includes(s))),ie=t=>p().filter(n=>R[n.id].every(s=>t.includes(s))),k=(t,e,n)=>{if(n)return["frontal","sagittal","transverse"];switch(t){case"LeftKnee":case"RightKnee":return["sagittal"];case"LeftAnkle":case"RightAnkle":return e&&e==l.AngleDataSource.Pose?["sagittal"]:["frontal","sagittal"];case"TotalSpine":return e&&e==l.AngleDataSource.Pose?["frontal"]:["frontal","sagittal","transverse"];case"LeftElbow":case"RightElbow":return e&&e==l.AngleDataSource.Pose?["sagittal"]:["frontal","sagittal","transverse"]}return e&&e==l.AngleDataSource.Pose?["frontal","sagittal"]:["frontal","sagittal","transverse"]},S=(t,e)=>{if(e===l.AngleDataSource.Sensor)return["frontal","sagittal","transverse"];switch(t){case"Head":case"LeftThigh":case"RightThigh":case"LeftShank":case"RightShank":case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":return["frontal","sagittal"];case"LeftFoot":case"RightFoot":return["sagittal"];case"LowerBack":return["frontal"];case"UpperBack":return["frontal","sagittal"]}return[]},b=c.memo((t,e,n)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return n<0?"inversion":"eversion";case"sagittal":return n<0?"plantar flexion":"dorsi flexion";case"transverse":return n<0?"internal rotation":"external rotation"}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return n<0?"adduction":"abduction";case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"internal rotation":"external rotation"}case"LeftHip":case"RightHip":case"LeftShoulder":case"RightShoulder":switch(e){case"frontal":return n<0?"adduction":"abduction";case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"internal rotation":"external rotation"}case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return n<0?"right lateral flexion":"left lateral flexion";case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"right rotation":"left rotation"}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return null;case"sagittal":return n<0?"extension":"flexion";case"transverse":return n<0?"pronation":"supination"}}return null}),E=c.memo((t,e,n)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return n<0?"Inv.":"Ev.";case"sagittal":return n<0?"PF.":"DF.";case"transverse":return n<0?"IR.":"ER."}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return n<0?"Add.":"Abd.";case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"IR.":"ER."}case"LeftHip":case"RightHip":case"LeftShoulder":case"RightShoulder":switch(e){case"frontal":return n<0?"Add.":"Abd.";case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"IR.":"ER."}case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return n<0?"R. Bend":"L. Bend";case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"R. Rot.":"L. Rot."}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return null;case"sagittal":return n<0?"Ext.":"Flex.";case"transverse":return n<0?"Pro.":"Sup."}}return null}),u=c.memo((t,e,n)=>{switch(t){case"LowerBack":case"LeftPelvis":case"RightPelvis":switch(e){case"frontal":return n<0?"right drop":"left drop";case"sagittal":return n<0?"anterior tilt":"posterior tilt";case"transverse":return n<0?"right rotation":"left rotation"}case"Head":case"UpperBack":case"CenterBack":case"LeftShank":case"RightShank":case"LeftThigh":case"RightThigh":case"LeftFoot":case"RightFoot":case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":switch(e){case"frontal":return n<0?"right tilt":"left tilt";case"sagittal":return n<0?"anterior tilt":"posterior tilt";case"transverse":return n<0?"right rotation":"left rotation"}default:return null}}),N=c.memo((t,e,n)=>{switch(t){case"LowerBack":case"LeftPelvis":case"RightPelvis":switch(e){case"frontal":return n<0?"R. Drop":"L. Drop";case"sagittal":return n<0?"Ant. Tilt":"Pos. Tilt";case"transverse":return n<0?"R. Rot.":"L. Rot."}case"Head":case"UpperBack":case"CenterBack":case"LeftShank":case"RightShank":case"LeftThigh":case"RightThigh":case"LeftFoot":case"RightFoot":case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":switch(e){case"frontal":return n<0?"R. Tilt":"L. Tilt";case"sagittal":return n<0?"Ant. Tilt":"Pos. Tilt";case"transverse":return n<0?"R. Rot.":"L. Rot."}default:return null}}),se=c.memo((t,e)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return{min:-20,max:20};case"sagittal":return{min:-30,max:30};case"transverse":return{min:-5,max:5}}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return{min:-5,max:5};case"sagittal":return{min:-5,max:90};case"transverse":return{min:-5,max:5}}case"LeftHip":case"RightHip":return{min:-30,max:30};case"LeftShoulder":case"RightShoulder":return{min:-50,max:50};case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return{min:-5,max:5};case"sagittal":return{min:-5,max:5};case"transverse":return{min:-5,max:5}}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return{min:-5,max:5};case"sagittal":return{min:-5,max:50};case"transverse":return{min:-5,max:5}}}return{min:-10,max:10}}),re=c.memo((t,e)=>{switch(t){case"LeftFoot":case"RightFoot":switch(e){case"frontal":return{min:-20,max:20};case"sagittal":return{min:-30,max:30};case"transverse":return{min:-5,max:5}}case"LeftShank":case"RightShank":switch(e){case"frontal":return{min:-35,max:35};case"sagittal":return{min:-35,max:35};case"transverse":return{min:-5,max:5}}case"LeftThigh":case"RightThigh":switch(e){case"frontal":return{min:-35,max:35};case"sagittal":return{min:-35,max:35};case"transverse":return{min:-10,max:5}}case"LeftPelvis":case"RightPelvis":switch(e){case"frontal":return{min:-15,max:15};case"sagittal":return{min:-10,max:10};case"transverse":return{min:-10,max:10}}case"LowerBack":case"CenterBack":case"UpperBack":case"Head":return{min:-5,max:5};case"LeftClavicle":case"RightClavicle":switch(e){case"frontal":return{min:-15,max:15};case"sagittal":return{min:-10,max:10};case"transverse":return{min:-10,max:10}}case"LeftUpperArm":case"RightUpperArm":case"LeftForearm":case"RightForearm":switch(e){case"frontal":return{min:-45,max:45};case"sagittal":return{min:-45,max:45};case"transverse":return{min:-20,max:20}}}return{min:-10,max:10}}),oe=c.memo((t,e)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return{min:-40,max:30};case"sagittal":return{min:-80,max:50};case"transverse":return{min:-90,max:90}}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return{min:-15,max:5};case"sagittal":return{min:-10,max:160};case"transverse":return{min:-35,max:45}}case"LeftHip":case"RightHip":switch(e){case"frontal":return{min:-50,max:60};case"sagittal":return{min:-50,max:150};case"transverse":return{min:-60,max:70}}case"TotalSpine":switch(e){case"frontal":return{min:-60,max:60};case"sagittal":return{min:-50,max:150};case"transverse":return{min:-50,max:50}}case"ChestSpine":switch(e){case"frontal":return{min:-25,max:25};case"sagittal":return{min:-25,max:40};case"transverse":return{min:-35,max:35}}case"NavalSpine":switch(e){case"frontal":return{min:-25,max:25};case"sagittal":return{min:-35,max:60};case"transverse":return{min:-15,max:15}}default:return{min:-180,max:180}}}),w=(t,e)=>({kind:"joint",value:t,plane:e}),v=(t,e)=>({kind:"limb",value:t,plane:e}),T=(t,e)=>({kind:"acceleration",value:t,axis:e}),F=(t,e)=>({kind:"angular_velocity",value:t,plane:e}),M=t=>l.axes.includes(t),le=t=>l.planes.includes(t),C=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!d().find(e=>e.id===t.id),P=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!A().find(e=>e.id===t.id),ce=(t,e,n=!1)=>M(e)?C(t)?T(t,e):fe(`Can't make acceleration part from joint: ${t} ${e}`):P(t)?n?F(t,e):w(t,e):v(t,e),me=t=>t.kind==="acceleration"?t.axis:t.plane,ge=t=>t?.kind==="acceleration"?t.axis:null,he=t=>t?.kind==="acceleration"?null:t?.plane??null,fe=t=>{throw new Error(t)},m=t=>t in a?a[t]:t in i?i[t]:"Unknown",ue=t=>m(t).replace(/Left|Right/g,""),Le=t=>t in x,B=(t,e)=>{if(!Le(t))return null;const n=x[t];if(e in n){const{min:r,max:s}=n[e];return{min:r??0,max:s??0}}return null},Re=(...t)=>{const e=B(...t);return e?Math.abs(e.max-e.min):0},H=(t,e)=>{const n=Object.keys(i).find(s=>s===e),r=Object.keys(a).find(s=>s===e);return!n&&!r?null:n?t.limbs[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose:t.joints[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose},de=(t,e,n)=>{const r=Object.keys(a).find(o=>o===e),s=H(t,e);return s?r?k(e,s).includes(n):S(e,s).includes(n):!1},xe=(t,e,n)=>{const r=Object.keys(i).find(o=>o===e),s=Object.keys(a).find(o=>o===e);if(!r&&!s)throw new Error(`Unknown partId: ${e} - this invariant should've been enforced by typescript`);return r?l.limbAngle(t.limbs[e])?.[n]??null:l.jointAngle(t.joints[e],void 0,t.direction)?.[n]??null},f=(t=!1)=>t?"Internal/External Rotation":"External/Internal Rotation",O=(t,e,n=!1)=>{switch(t){case"LeftAnkle":case"RightAnkle":switch(e){case"frontal":return n?"Inversion/Eversion":"Eversion/Inversion";case"sagittal":return n?"Plantar/Dorsi Flexion":"Dorsi/Plantar Flexion";case"transverse":return f(n)}case"LeftKnee":case"RightKnee":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return f(n)}case"LeftHip":case"RightHip":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return f(n)}case"NavalSpine":case"ChestSpine":case"TotalSpine":case"Neck":switch(e){case"frontal":return"Lateral Bend";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return"Rotation"}case"LeftShoulder":case"RightShoulder":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return f(n)}case"LeftElbow":case"RightElbow":switch(e){case"frontal":return n?"Adduction/Abduction":"Abduction/Adduction";case"sagittal":return n?"Extension/Flexion":"Flexion/Extension";case"transverse":return n?"Pronation/Supination":"Supination/Pronation"}}},U=(t,e,n=!1)=>{const r=m(t),s=u(t,e,1),o=u(t,e,-1);if(s&&o){const g=c.capitalizeAll(s),h=c.capitalizeAll(o),D=n?`${h}/${g}`:`${g}/${h}`;return`${r} (${D})`}return`${r} (${e})`},Ae=(t,e)=>{let n;switch(e){case"x":n="Med./Lat.";break;case"y":n="Vertical";break;case"z":n="Ant./Post."}return`${m(t)} ${n}`},K=(t,e,n=!1)=>{const r=m(t),s=O(t,e,n);return s?`${r} (${s})`:null},_e=(t,e)=>K(t,e)||U(t,e),L=(t,e,n,r=!1)=>{const s=r?E:b,o=r?N:u,[g,h]=t==="joint"?[s(e,n,1),s(e,n,-1)]:[o(e,n,1),o(e,n,-1)];return{positive:g,negative:h}},J=(t,e=!1)=>t.partKind==="joint"?L("joint",t.partId,t.partDimension,e):L("segment",t.partId,t.partDimension,e),pe=(t,e,n=!1)=>{const{positive:r,negative:s}=J(e,n);return t>=0?r:s};exports.getAllAvailableJoints=A;exports.getAllAvailableLimbs=d;exports.getAllAvailablePoseJoints=p;exports.getAllAvailablePoseLimbs=ne;exports.getAllAvailableSensorJoints=_;exports.getAngleDirectionNames=L;exports.getAvailableLimbsForLimbIds=te;exports.getAvailablePoseJointsForLimbIds=ie;exports.getAvailableSensorJointsForLimbIds=ae;exports.getAxis=ge;exports.getDefaultAngleSource=H;exports.getDefaultJointRange=se;exports.getDefaultLimbRange=re;exports.getEnabledJointPlanes=k;exports.getEnabledSegmentPlanes=S;exports.getHumanBodyAngle=xe;exports.getIsDefaultAngleAllowed=de;exports.getJointAngleDirectionAbbr=E;exports.getJointAngleDirectionName=b;exports.getJointNameWithPlane=K;exports.getJointOrSegmentNameWithPlane=_e;exports.getJointPlaneName=O;exports.getNormativeJointRange=oe;exports.getParameterAngleDirectionName=pe;exports.getParameterDirectionNames=J;exports.getPartName=m;exports.getPartNameNoSide=ue;exports.getPlane=he;exports.getSegmentAngleDirectionAbbr=N;exports.getSegmentAngleDirectionName=u;exports.getSegmentNameWithPlane=U;exports.getSegmentXyzName=Ae;exports.getTypicalRom=B;exports.getTypicalRomSize=Re;exports.isAxis=M;exports.isJoint=P;exports.isLimb=C;exports.isPlane=le;exports.jointNames=a;exports.jointsUsedByLimbs=ee;exports.limbNames=i;exports.limbsRequiredForJoints=R;exports.mkAccelerationPart=T;exports.mkAngularVelocityPart=F;exports.mkHumanPart=ce;exports.mkJointPart=w;exports.mkLimbPart=v;exports.planeOrAxis=me;
|
package/dist/services.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { axes as k, planes as A, AngleDataSource as c, limbAngle as S, jointAngle as E } from "./types.js";
|
|
2
|
-
import "./vendor-
|
|
2
|
+
import "./moment-vendor-DMLRxgRE.js";
|
|
3
3
|
import { memo as l, capitalizeAll as R } from "./utils.js";
|
|
4
4
|
const w = { sagittal: { __COMMENT__: "-Plantar Flexion, +Dorsi flexion", min: -20, max: 30 }, frontal: { __COMMENT__: "-Inversion, +Eversion", min: -30, max: 20 }, transverse: { __COMMENT__: "-Pronation, +Supination", min: -10, max: 10 } }, T = { sagittal: { __COMMENT__: "-Plantar Flexion, +Dorsi flexion", min: -20, max: 30 }, frontal: { __COMMENT__: "-Inversion, +Eversion", min: -30, max: 20 }, transverse: { __COMMENT__: "-Pronation, +Supination", min: -10, max: 10 } }, v = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -5, max: 142 }, frontal: { __COMMENT__: "N/A", min: 0, max: 0 }, transverse: { __COMMENT__: "N/A", min: 0, max: 0 } }, N = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -5, max: 142 }, frontal: { __COMMENT__: "N/A", min: 0, max: 0 }, transverse: { __COMMENT__: "N/A", min: 0, max: 0 } }, b = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -18, max: 134 }, frontal: { __COMMENT__: "-Adduction, +Abduction", min: -20, max: 40 }, transverse: { __COMMENT__: "-Internal Rotation, +External Rotation", min: -40, max: 50 } }, F = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -18, max: 134 }, frontal: { __COMMENT__: "-Adduction, +Abduction", min: -20, max: 40 }, transverse: { __COMMENT__: "-Internal Rotation, +External Rotation", min: -40, max: 50 } }, M = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -75, max: 60 }, frontal: { __COMMENT__: "-Bend Right, +Bend Left", min: -45, max: 45 }, transverse: { __COMMENT__: "-Twist Right, +Twist Left", min: -80, max: 80 } }, C = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -25, max: 50 }, frontal: { __COMMENT__: "-Bend Right, +Bend Left", min: -25, max: 25 }, transverse: { __COMMENT__: "-Twist Right, +Twist Left", min: -30, max: 30 } }, P = { __COMMENT__: "This is the sum of the ChestSpine and NavalSpine", sagittal: { __COMMENT__: "-Extension, +Flexion", min: -100, max: 110 }, frontal: { __COMMENT__: "-Bend Right, +Bend Left", min: -70, max: 70 }, transverse: { __COMMENT__: "-Twist Right, +Twist Left", min: -110, max: 110 } }, B = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -50, max: 180 }, frontal: { __COMMENT__: "-Adduction, +Abduction", min: -50, max: 180 }, transverse: { __COMMENT__: "-Internal Rotation, +External Rotation", min: -90, max: 90 } }, H = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: -50, max: 180 }, frontal: { __COMMENT__: "-Adduction, +Abduction", min: -50, max: 180 }, transverse: { __COMMENT__: "-Internal Rotation, +External Rotation", min: -90, max: 90 } }, U = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: 0, max: 140 }, frontal: { __COMMENT__: "N/A", min: 0, max: 0 }, transverse: { __COMMENT__: "-Pronation/+Supination (of forearm)", min: -80, max: 80 } }, O = { sagittal: { __COMMENT__: "-Extension, +Flexion", min: 0, max: 140 }, frontal: { __COMMENT__: "N/A", min: 0, max: 0 }, transverse: { __COMMENT__: "-Pronation/+Supination (of forearm)", min: -80, max: 80 } }, x = {
|
|
5
5
|
LeftAnkle: w,
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
var dr = "-ms-", kr = "-moz-", lr = "-webkit-", Q = "comm", V = "rule", X = "decl", y = "@import", rr = "@keyframes", ar = "@layer", nr = Math.abs, U = String.fromCharCode, er = Object.assign;
|
|
2
|
+
function wr(r, a) {
|
|
3
|
+
return l(r, 0) ^ 45 ? (((a << 2 ^ l(r, 0)) << 2 ^ l(r, 1)) << 2 ^ l(r, 2)) << 2 ^ l(r, 3) : 0;
|
|
4
|
+
}
|
|
5
|
+
function _(r) {
|
|
6
|
+
return r.trim();
|
|
7
|
+
}
|
|
8
|
+
function gr(r, a) {
|
|
9
|
+
return (r = a.exec(r)) ? r[0] : r;
|
|
10
|
+
}
|
|
11
|
+
function L(r, a, e) {
|
|
12
|
+
return r.replace(a, e);
|
|
13
|
+
}
|
|
14
|
+
function cr(r, a) {
|
|
15
|
+
return r.indexOf(a);
|
|
16
|
+
}
|
|
17
|
+
function l(r, a) {
|
|
18
|
+
return r.charCodeAt(a) | 0;
|
|
19
|
+
}
|
|
20
|
+
function j(r, a, e) {
|
|
21
|
+
return r.slice(a, e);
|
|
22
|
+
}
|
|
23
|
+
function E(r) {
|
|
24
|
+
return r.length;
|
|
25
|
+
}
|
|
26
|
+
function Z(r) {
|
|
27
|
+
return r.length;
|
|
28
|
+
}
|
|
29
|
+
function K(r, a) {
|
|
30
|
+
return a.push(r), r;
|
|
31
|
+
}
|
|
32
|
+
function pr(r, a) {
|
|
33
|
+
return r.map(a).join("");
|
|
34
|
+
}
|
|
35
|
+
var W = 1, T = 1, $ = 0, h = 0, s = 0, x = "";
|
|
36
|
+
function Y(r, a, e, c, t, d, w) {
|
|
37
|
+
return { value: r, root: a, parent: e, type: c, props: t, children: d, line: W, column: T, length: w, return: "" };
|
|
38
|
+
}
|
|
39
|
+
function mr(r, a) {
|
|
40
|
+
return er(Y("", null, null, "", null, null, 0), r, { length: -r.length }, a);
|
|
41
|
+
}
|
|
42
|
+
function sr() {
|
|
43
|
+
return s;
|
|
44
|
+
}
|
|
45
|
+
function tr() {
|
|
46
|
+
return s = h > 0 ? l(x, --h) : 0, T--, s === 10 && (T = 1, W--), s;
|
|
47
|
+
}
|
|
48
|
+
function b() {
|
|
49
|
+
return s = h < $ ? l(x, h++) : 0, T++, s === 10 && (T = 1, W++), s;
|
|
50
|
+
}
|
|
51
|
+
function R() {
|
|
52
|
+
return l(x, h);
|
|
53
|
+
}
|
|
54
|
+
function D() {
|
|
55
|
+
return h;
|
|
56
|
+
}
|
|
57
|
+
function q(r, a) {
|
|
58
|
+
return j(x, r, a);
|
|
59
|
+
}
|
|
60
|
+
function F(r) {
|
|
61
|
+
switch (r) {
|
|
62
|
+
// \0 \t \n \r \s whitespace token
|
|
63
|
+
case 0:
|
|
64
|
+
case 9:
|
|
65
|
+
case 10:
|
|
66
|
+
case 13:
|
|
67
|
+
case 32:
|
|
68
|
+
return 5;
|
|
69
|
+
// ! + , / > @ ~ isolate token
|
|
70
|
+
case 33:
|
|
71
|
+
case 43:
|
|
72
|
+
case 44:
|
|
73
|
+
case 47:
|
|
74
|
+
case 62:
|
|
75
|
+
case 64:
|
|
76
|
+
case 126:
|
|
77
|
+
// ; { } breakpoint token
|
|
78
|
+
case 59:
|
|
79
|
+
case 123:
|
|
80
|
+
case 125:
|
|
81
|
+
return 4;
|
|
82
|
+
// : accompanied token
|
|
83
|
+
case 58:
|
|
84
|
+
return 3;
|
|
85
|
+
// " ' ( [ opening delimit token
|
|
86
|
+
case 34:
|
|
87
|
+
case 39:
|
|
88
|
+
case 40:
|
|
89
|
+
case 91:
|
|
90
|
+
return 2;
|
|
91
|
+
// ) ] closing delimit token
|
|
92
|
+
case 41:
|
|
93
|
+
case 93:
|
|
94
|
+
return 1;
|
|
95
|
+
}
|
|
96
|
+
return 0;
|
|
97
|
+
}
|
|
98
|
+
function ir(r) {
|
|
99
|
+
return W = T = 1, $ = E(x = r), h = 0, [];
|
|
100
|
+
}
|
|
101
|
+
function ur(r) {
|
|
102
|
+
return x = "", r;
|
|
103
|
+
}
|
|
104
|
+
function B(r) {
|
|
105
|
+
return _(q(h - 1, P(r === 91 ? r + 2 : r === 40 ? r + 1 : r)));
|
|
106
|
+
}
|
|
107
|
+
function fr(r) {
|
|
108
|
+
for (; (s = R()) && s < 33; )
|
|
109
|
+
b();
|
|
110
|
+
return F(r) > 2 || F(s) > 3 ? "" : " ";
|
|
111
|
+
}
|
|
112
|
+
function or(r, a) {
|
|
113
|
+
for (; --a && b() && !(s < 48 || s > 102 || s > 57 && s < 65 || s > 70 && s < 97); )
|
|
114
|
+
;
|
|
115
|
+
return q(r, D() + (a < 6 && R() == 32 && b() == 32));
|
|
116
|
+
}
|
|
117
|
+
function P(r) {
|
|
118
|
+
for (; b(); )
|
|
119
|
+
switch (s) {
|
|
120
|
+
// ] ) " '
|
|
121
|
+
case r:
|
|
122
|
+
return h;
|
|
123
|
+
// " '
|
|
124
|
+
case 34:
|
|
125
|
+
case 39:
|
|
126
|
+
r !== 34 && r !== 39 && P(s);
|
|
127
|
+
break;
|
|
128
|
+
// (
|
|
129
|
+
case 40:
|
|
130
|
+
r === 41 && P(r);
|
|
131
|
+
break;
|
|
132
|
+
// \
|
|
133
|
+
case 92:
|
|
134
|
+
b();
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
137
|
+
return h;
|
|
138
|
+
}
|
|
139
|
+
function hr(r, a) {
|
|
140
|
+
for (; b() && r + s !== 57; )
|
|
141
|
+
if (r + s === 84 && R() === 47)
|
|
142
|
+
break;
|
|
143
|
+
return "/*" + q(a, h - 1) + "*" + U(r === 47 ? r : b());
|
|
144
|
+
}
|
|
145
|
+
function vr(r) {
|
|
146
|
+
for (; !F(R()); )
|
|
147
|
+
b();
|
|
148
|
+
return q(r, h);
|
|
149
|
+
}
|
|
150
|
+
function Er(r) {
|
|
151
|
+
return ur(N("", null, null, null, [""], r = ir(r), 0, [0], r));
|
|
152
|
+
}
|
|
153
|
+
function N(r, a, e, c, t, d, w, f, S) {
|
|
154
|
+
for (var A = 0, p = 0, i = w, M = 0, C = 0, g = 0, v = 1, z = 1, o = 1, u = 0, m = "", I = t, O = d, k = c, n = m; z; )
|
|
155
|
+
switch (g = u, u = b()) {
|
|
156
|
+
// (
|
|
157
|
+
case 40:
|
|
158
|
+
if (g != 108 && l(n, i - 1) == 58) {
|
|
159
|
+
cr(n += L(B(u), "&", "&\f"), "&\f") != -1 && (o = -1);
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
// " ' [
|
|
163
|
+
case 34:
|
|
164
|
+
case 39:
|
|
165
|
+
case 91:
|
|
166
|
+
n += B(u);
|
|
167
|
+
break;
|
|
168
|
+
// \t \n \r \s
|
|
169
|
+
case 9:
|
|
170
|
+
case 10:
|
|
171
|
+
case 13:
|
|
172
|
+
case 32:
|
|
173
|
+
n += fr(g);
|
|
174
|
+
break;
|
|
175
|
+
// \
|
|
176
|
+
case 92:
|
|
177
|
+
n += or(D() - 1, 7);
|
|
178
|
+
continue;
|
|
179
|
+
// /
|
|
180
|
+
case 47:
|
|
181
|
+
switch (R()) {
|
|
182
|
+
case 42:
|
|
183
|
+
case 47:
|
|
184
|
+
K(br(hr(b(), D()), a, e), S);
|
|
185
|
+
break;
|
|
186
|
+
default:
|
|
187
|
+
n += "/";
|
|
188
|
+
}
|
|
189
|
+
break;
|
|
190
|
+
// {
|
|
191
|
+
case 123 * v:
|
|
192
|
+
f[A++] = E(n) * o;
|
|
193
|
+
// } ; \0
|
|
194
|
+
case 125 * v:
|
|
195
|
+
case 59:
|
|
196
|
+
case 0:
|
|
197
|
+
switch (u) {
|
|
198
|
+
// \0 }
|
|
199
|
+
case 0:
|
|
200
|
+
case 125:
|
|
201
|
+
z = 0;
|
|
202
|
+
// ;
|
|
203
|
+
case 59 + p:
|
|
204
|
+
o == -1 && (n = L(n, /\f/g, "")), C > 0 && E(n) - i && K(C > 32 ? H(n + ";", c, e, i - 1) : H(L(n, " ", "") + ";", c, e, i - 2), S);
|
|
205
|
+
break;
|
|
206
|
+
// @ ;
|
|
207
|
+
case 59:
|
|
208
|
+
n += ";";
|
|
209
|
+
// { rule/at-rule
|
|
210
|
+
default:
|
|
211
|
+
if (K(k = G(n, a, e, A, p, t, f, m, I = [], O = [], i), d), u === 123)
|
|
212
|
+
if (p === 0)
|
|
213
|
+
N(n, a, k, k, I, d, i, f, O);
|
|
214
|
+
else
|
|
215
|
+
switch (M === 99 && l(n, 3) === 110 ? 100 : M) {
|
|
216
|
+
// d l m s
|
|
217
|
+
case 100:
|
|
218
|
+
case 108:
|
|
219
|
+
case 109:
|
|
220
|
+
case 115:
|
|
221
|
+
N(r, k, k, c && K(G(r, k, k, 0, 0, t, f, m, t, I = [], i), O), t, O, i, f, c ? I : O);
|
|
222
|
+
break;
|
|
223
|
+
default:
|
|
224
|
+
N(n, k, k, k, [""], O, 0, f, O);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
A = p = C = 0, v = o = 1, m = n = "", i = w;
|
|
228
|
+
break;
|
|
229
|
+
// :
|
|
230
|
+
case 58:
|
|
231
|
+
i = 1 + E(n), C = g;
|
|
232
|
+
default:
|
|
233
|
+
if (v < 1) {
|
|
234
|
+
if (u == 123)
|
|
235
|
+
--v;
|
|
236
|
+
else if (u == 125 && v++ == 0 && tr() == 125)
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
switch (n += U(u), u * v) {
|
|
240
|
+
// &
|
|
241
|
+
case 38:
|
|
242
|
+
o = p > 0 ? 1 : (n += "\f", -1);
|
|
243
|
+
break;
|
|
244
|
+
// ,
|
|
245
|
+
case 44:
|
|
246
|
+
f[A++] = (E(n) - 1) * o, o = 1;
|
|
247
|
+
break;
|
|
248
|
+
// @
|
|
249
|
+
case 64:
|
|
250
|
+
R() === 45 && (n += B(b())), M = R(), p = i = E(m = n += vr(D())), u++;
|
|
251
|
+
break;
|
|
252
|
+
// -
|
|
253
|
+
case 45:
|
|
254
|
+
g === 45 && E(n) == 2 && (v = 0);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return d;
|
|
258
|
+
}
|
|
259
|
+
function G(r, a, e, c, t, d, w, f, S, A, p) {
|
|
260
|
+
for (var i = t - 1, M = t === 0 ? d : [""], C = Z(M), g = 0, v = 0, z = 0; g < c; ++g)
|
|
261
|
+
for (var o = 0, u = j(r, i + 1, i = nr(v = w[g])), m = r; o < C; ++o)
|
|
262
|
+
(m = _(v > 0 ? M[o] + " " + u : L(u, /&\f/g, M[o]))) && (S[z++] = m);
|
|
263
|
+
return Y(r, a, e, t === 0 ? V : f, S, A, p);
|
|
264
|
+
}
|
|
265
|
+
function br(r, a, e) {
|
|
266
|
+
return Y(r, a, e, Q, U(sr()), j(r, 2, -2), 0);
|
|
267
|
+
}
|
|
268
|
+
function H(r, a, e, c) {
|
|
269
|
+
return Y(r, a, e, X, j(r, 0, c), j(r, c + 1, -1), c);
|
|
270
|
+
}
|
|
271
|
+
function J(r, a) {
|
|
272
|
+
for (var e = "", c = Z(r), t = 0; t < c; t++)
|
|
273
|
+
e += a(r[t], t, r, a) || "";
|
|
274
|
+
return e;
|
|
275
|
+
}
|
|
276
|
+
function Mr(r, a, e, c) {
|
|
277
|
+
switch (r.type) {
|
|
278
|
+
case ar:
|
|
279
|
+
if (r.children.length) break;
|
|
280
|
+
case y:
|
|
281
|
+
case X:
|
|
282
|
+
return r.return = r.return || r.value;
|
|
283
|
+
case Q:
|
|
284
|
+
return "";
|
|
285
|
+
case rr:
|
|
286
|
+
return r.return = r.value + "{" + J(r.children, c) + "}";
|
|
287
|
+
case V:
|
|
288
|
+
r.value = r.props.join(",");
|
|
289
|
+
}
|
|
290
|
+
return E(e = J(r.children, c)) ? r.return = r.value + "{" + e + "}" : "";
|
|
291
|
+
}
|
|
292
|
+
function Or(r) {
|
|
293
|
+
var a = Z(r);
|
|
294
|
+
return function(e, c, t, d) {
|
|
295
|
+
for (var w = "", f = 0; f < a; f++)
|
|
296
|
+
w += r[f](e, c, t, d) || "";
|
|
297
|
+
return w;
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
function Rr(r) {
|
|
301
|
+
return function(a) {
|
|
302
|
+
a.root || (a = a.return) && r(a);
|
|
303
|
+
};
|
|
304
|
+
}
|
|
305
|
+
export {
|
|
306
|
+
X as D,
|
|
307
|
+
rr as K,
|
|
308
|
+
dr as M,
|
|
309
|
+
V as R,
|
|
310
|
+
lr as W,
|
|
311
|
+
Mr as a,
|
|
312
|
+
pr as b,
|
|
313
|
+
Er as c,
|
|
314
|
+
mr as d,
|
|
315
|
+
L as e,
|
|
316
|
+
ur as f,
|
|
317
|
+
ir as g,
|
|
318
|
+
wr as h,
|
|
319
|
+
l as i,
|
|
320
|
+
E as j,
|
|
321
|
+
cr as k,
|
|
322
|
+
kr as l,
|
|
323
|
+
Or as m,
|
|
324
|
+
gr as n,
|
|
325
|
+
b as o,
|
|
326
|
+
U as p,
|
|
327
|
+
R as q,
|
|
328
|
+
Rr as r,
|
|
329
|
+
J as s,
|
|
330
|
+
F as t,
|
|
331
|
+
B as u,
|
|
332
|
+
q as v,
|
|
333
|
+
h as w
|
|
334
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var er="-ms-",ar="-moz-",cr="-webkit-",V="comm",q="rule",G="decl",ir="@import",X="@keyframes",tr="@layer",sr=Math.abs,F=String.fromCharCode,ur=Object.assign;function or(r,n){return l(r,0)^45?(((n<<2^l(r,0))<<2^l(r,1))<<2^l(r,2))<<2^l(r,3):0}function _(r){return r.trim()}function fr(r,n){return(r=n.exec(r))?r[0]:r}function x(r,n,a){return r.replace(n,a)}function $(r,n){return r.indexOf(n)}function l(r,n){return r.charCodeAt(n)|0}function I(r,n,a){return r.slice(n,a)}function w(r){return r.length}function H(r){return r.length}function N(r,n){return n.push(r),r}function hr(r,n){return r.map(n).join("")}var U=1,T=1,y=0;exports.position=0;var i=0,S="";function W(r,n,a,c,t,d,p){return{value:r,root:n,parent:a,type:c,props:t,children:d,line:U,column:T,length:p,return:""}}function vr(r,n){return ur(W("",null,null,"",null,null,0),r,{length:-r.length},n)}function lr(){return i}function dr(){return i=exports.position>0?l(S,--exports.position):0,T--,i===10&&(T=1,U--),i}function h(){return i=exports.position<y?l(S,exports.position++):0,T++,i===10&&(T=1,U++),i}function E(){return l(S,exports.position)}function Y(){return exports.position}function L(r,n){return I(S,r,n)}function D(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function rr(r){return U=T=1,y=w(S=r),exports.position=0,[]}function nr(r){return S="",r}function j(r){return _(L(exports.position-1,Z(r===91?r+2:r===40?r+1:r)))}function br(r){for(;(i=E())&&i<33;)h();return D(r)>2||D(i)>3?"":" "}function pr(r,n){for(;--n&&h()&&!(i<48||i>102||i>57&&i<65||i>70&&i<97););return L(r,Y()+(n<6&&E()==32&&h()==32))}function Z(r){for(;h();)switch(i){case r:return exports.position;case 34:case 39:r!==34&&r!==39&&Z(i);break;case 40:r===41&&Z(r);break;case 92:h();break}return exports.position}function kr(r,n){for(;h()&&r+i!==57;)if(r+i===84&&E()===47)break;return"/*"+L(n,exports.position-1)+"*"+F(r===47?r:h())}function wr(r){for(;!D(E());)h();return L(r,exports.position)}function gr(r){return nr(B("",null,null,null,[""],r=rr(r),0,[0],r))}function B(r,n,a,c,t,d,p,o,C){for(var O=0,g=0,s=p,M=0,R=0,k=0,v=1,z=1,f=1,u=0,m="",K=t,A=d,b=c,e=m;z;)switch(k=u,u=h()){case 40:if(k!=108&&l(e,s-1)==58){$(e+=x(j(u),"&","&\f"),"&\f")!=-1&&(f=-1);break}case 34:case 39:case 91:e+=j(u);break;case 9:case 10:case 13:case 32:e+=br(k);break;case 92:e+=pr(Y()-1,7);continue;case 47:switch(E()){case 42:case 47:N(mr(kr(h(),Y()),n,a),C);break;default:e+="/"}break;case 123*v:o[O++]=w(e)*f;case 125*v:case 59:case 0:switch(u){case 0:case 125:z=0;case 59+g:f==-1&&(e=x(e,/\f/g,"")),R>0&&w(e)-s&&N(R>32?Q(e+";",c,a,s-1):Q(x(e," ","")+";",c,a,s-2),C);break;case 59:e+=";";default:if(N(b=J(e,n,a,O,g,t,o,m,K=[],A=[],s),d),u===123)if(g===0)B(e,n,b,b,K,d,s,o,A);else switch(M===99&&l(e,3)===110?100:M){case 100:case 108:case 109:case 115:B(r,b,b,c&&N(J(r,b,b,0,0,t,o,m,t,K=[],s),A),t,A,s,o,c?K:A);break;default:B(e,b,b,b,[""],A,0,o,A)}}O=g=R=0,v=f=1,m=e="",s=p;break;case 58:s=1+w(e),R=k;default:if(v<1){if(u==123)--v;else if(u==125&&v++==0&&dr()==125)continue}switch(e+=F(u),u*v){case 38:f=g>0?1:(e+="\f",-1);break;case 44:o[O++]=(w(e)-1)*f,f=1;break;case 64:E()===45&&(e+=j(h())),M=E(),g=s=w(m=e+=wr(Y())),u++;break;case 45:k===45&&w(e)==2&&(v=0)}}return d}function J(r,n,a,c,t,d,p,o,C,O,g){for(var s=t-1,M=t===0?d:[""],R=H(M),k=0,v=0,z=0;k<c;++k)for(var f=0,u=I(r,s+1,s=sr(v=p[k])),m=r;f<R;++f)(m=_(v>0?M[f]+" "+u:x(u,/&\f/g,M[f])))&&(C[z++]=m);return W(r,n,a,t===0?q:o,C,O,g)}function mr(r,n,a){return W(r,n,a,V,F(lr()),I(r,2,-2),0)}function Q(r,n,a,c){return W(r,n,a,G,I(r,0,c),I(r,c+1,-1),c)}function P(r,n){for(var a="",c=H(r),t=0;t<c;t++)a+=n(r[t],t,r,n)||"";return a}function Er(r,n,a,c){switch(r.type){case tr:if(r.children.length)break;case ir:case G:return r.return=r.return||r.value;case V:return"";case X:return r.return=r.value+"{"+P(r.children,c)+"}";case q:r.value=r.props.join(",")}return w(a=P(r.children,c))?r.return=r.value+"{"+a+"}":""}function Mr(r){var n=H(r);return function(a,c,t,d){for(var p="",o=0;o<n;o++)p+=r[o](a,c,t,d)||"";return p}}function Ar(r){return function(n){n.root||(n=n.return)&&r(n)}}exports.DECLARATION=G;exports.KEYFRAMES=X;exports.MOZ=ar;exports.MS=er;exports.RULESET=q;exports.WEBKIT=cr;exports.alloc=rr;exports.charat=l;exports.combine=hr;exports.compile=gr;exports.copy=vr;exports.dealloc=nr;exports.delimit=j;exports.from=F;exports.hash=or;exports.indexof=$;exports.match=fr;exports.middleware=Mr;exports.next=h;exports.peek=E;exports.replace=x;exports.rulesheet=Ar;exports.serialize=P;exports.slice=L;exports.stringify=Er;exports.strlen=w;exports.token=D;
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./services.cjs"),r=require("./generated-ChsGaiYd.cjs"),m=require("./lodash-vendor-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./services.cjs"),r=require("./generated-ChsGaiYd.cjs"),m=require("./lodash-vendor-CR237hSU.cjs"),p=require("./utils.cjs"),l=(e,t)=>t==="left"||t==="right"?{sagittal:e.sagittal}:t==="forward"||t==="backward"?{frontal:e.frontal}:null,S=(e,t,n)=>t==="sensor"?e?.sensor_angle??null:t==="pose"?(e?.pose_angle&&l(e.pose_angle,n))??null:e?.sensor_angle?l(e.sensor_angle)??null:(e?.pose_angle&&l(e.pose_angle,n))??null,k=(e,t)=>(t==="sensor"?e?.sensor_angle:t==="pose"?e?.pose_angle:e?.sensor_angle||e?.pose_angle)||null,R=["frontal","sagittal","transverse"],T=e=>"limbs"in e,v=(e,t)=>t==="y"&&(e==="LeftFoot"||e==="RightFoot"||e==="LeftShank"||e==="RightShank"),F=(e,t)=>{switch(e){case"Head":return"Head";case"UpperBack":return"UpperBack";case"CenterBack":return"CenterBack";case"LowerBack":return"LowerBack";case"Thigh":return t==="left"?"LeftThigh":"RightThigh";case"Shank":return t==="left"?"LeftShank":"RightShank";case"Foot":return t==="left"?"LeftFoot":"RightFoot";case"UpperArm":return t==="left"?"LeftUpperArm":"RightUpperArm";case"Forearm":return t==="left"?"LeftForearm":"RightForearm";case"Pelvis":return t==="left"?"LeftPelvis":"RightPelvis";case"Clavicle":return t==="left"?"LeftClavicle":"RightClavicle"}},A=e=>e.startsWith("Left")?"left":e.startsWith("Right")?"right":null,b=(e,t)=>{switch(e){case"Ankle":return t==="left"?"LeftAnkle":"RightAnkle";case"Knee":return t==="left"?"LeftKnee":"RightKnee";case"Hip":return t==="left"?"LeftHip":"RightHip";case"Shoulder":return t==="left"?"LeftShoulder":"RightShoulder";case"Elbow":return t==="left"?"LeftElbow":"RightElbow";case"Spine":return"TotalSpine";case"Neck":return"Neck"}},u=e=>{switch(e){case"LeftAnkle":case"RightAnkle":return"Ankle";case"LeftKnee":case"RightKnee":return"Knee";case"LeftHip":case"RightHip":return"Hip";case"LeftShoulder":case"RightShoulder":return"Shoulder";case"LeftElbow":case"RightElbow":return"Elbow";case"ChestSpine":case"NavalSpine":case"TotalSpine":return"Spine";case"Neck":return"Neck"}},h=e=>{switch(e){case"Head":return"Head";case"UpperBack":return"UpperBack";case"CenterBack":return"CenterBack";case"LowerBack":return"LowerBack";case"LeftThigh":case"RightThigh":return"Thigh";case"LeftShank":case"RightShank":return"Shank";case"LeftFoot":case"RightFoot":return"Foot";case"LeftUpperArm":case"RightUpperArm":return"UpperArm";case"LeftForearm":case"RightForearm":return"Forearm";case"LeftPelvis":case"RightPelvis":return"Pelvis";case"LeftClavicle":case"RightClavicle":return"Clavicle"}};var g=(e=>(e.Sensor="sensor",e.Pose="pose",e))(g||{});const U=e=>"joint"in e?u(e.joint):h(e.segment),w=["joint","limb","acceleration","angular_velocity"],B=["frontal","sagittal","transverse"],P=["x","y","z"],j=e=>{switch(`${e}`){case r.SensorLocation.Thorax:return"UpperBack";case r.SensorLocation.CenterBack:return"CenterBack";case r.SensorLocation.Pelvis:return"LowerBack";case r.SensorLocation.LeftThigh:return"LeftThigh";case r.SensorLocation.RightThigh:return"RightThigh";case r.SensorLocation.LeftShank:return"LeftShank";case r.SensorLocation.RightShank:return"RightShank";case r.SensorLocation.LeftFoot:return"LeftFoot";case r.SensorLocation.RightFoot:return"RightFoot";case r.SensorLocation.LeftUpperArm:return"LeftUpperArm";case r.SensorLocation.RightUpperArm:return"RightUpperArm";case r.SensorLocation.LeftForearm:return"LeftForearm";case r.SensorLocation.RightForearm:return"RightForearm";case r.SensorLocation.Head:return"Head"}return console.warn(`Unknown sensor location: ${e}`),null},N=e=>{switch(e){case r.SensorLocation.Thorax:return"Thorax";case r.SensorLocation.CenterBack:return"Center Back";case r.SensorLocation.Pelvis:return"Pelvis";case r.SensorLocation.LeftThigh:return"Left Thigh";case r.SensorLocation.RightThigh:return"Right Thigh";case r.SensorLocation.LeftShank:return"Left Shank";case r.SensorLocation.RightShank:return"Right Shank";case r.SensorLocation.LeftFoot:return"Left Foot";case r.SensorLocation.RightFoot:return"Right Foot";case r.SensorLocation.LeftUpperArm:return"Left Upper Arm";case r.SensorLocation.RightUpperArm:return"Right Upper Arm";case r.SensorLocation.LeftForearm:return"Left Forearm";case r.SensorLocation.RightForearm:return"Right Forearm";case r.SensorLocation.Head:return"Head"}return console.warn(`Unknown sensor location: ${e}`),"Unknown"},C=()=>{const e=[],t={add:(n,o,a,c,s=!1)=>{const f={unit:"Count",value:0};return o?e.push({desc:{name:n,hint:a||null},value:o,isLoading:s,suffix:c||void 0}):s&&e.push({desc:{name:n,hint:a||null},value:f,isLoading:s,suffix:c||void 0}),t},build:()=>e};return t},d=(e,t)=>({unit:e,value:t}),H=(e,t)=>{if(t!=null)return d(e,t)},L=e=>"joint"in e?e.joint:e.segment,O=e=>L(e).toString(),y=e=>"plane"in e?e.plane:e.axis,x=e=>"plane"in e?e.plane:e.axis,I=e=>"joint"in e?i.jointNames[e.joint]:i.limbNames[e.segment],E=e=>{if(!e)return"Loading...";if(!e.action)return e.name??"Unknown Action";const t=e.action.name??"Unknown Action",n=e.actionSide?`${e.actionSide}`:"";return`${t} ${n} (Trial ${e.name??"1"})`},K=e=>typeof e=="object"&&"SyncError"in e,_=(e,t)=>Object.values(e).some(n=>t.id in n&&Object.keys(n[t.id]).length>0),$=(e,t)=>Math.max(...Object.values(e).map(n=>t.id in n?Object.keys(n[t.id]).length:0)),q=(e,t,n)=>Object.values(e).some(o=>t.id in o&&n in o[t.id]),J=(e,t)=>e[t.kind]?.[t.value.id]?.[i.planeOrAxis(t)],M=(e,t,n)=>{const o=structuredClone(e);if(n===void 0){const a=i.planeOrAxis(t);t.kind in o&&t.value.id in o[t.kind]&&a in o[t.kind][t.value.id]&&delete o[t.kind][t.value.id][a]}else m.merge(o,{[t.kind]:{[t.value.id]:{[i.planeOrAxis(t)]:n}}});return o},W=e=>Object.entries(e).flatMap(([t,n])=>Object.entries(n).flatMap(([o,a])=>Object.entries(a).map(([c,s])=>({min:s.min,max:s.max,kind:p.safelyConvertEnum(s.kind),partDimension:c,partId:o,partKind:t})))),D=e=>e.reduce((t,n)=>({...t,[n.partKind]:{...t[n.partKind]||{},[n.partId]:{...t[n.partKind]?.[n.partId]||{},[n.partDimension]:{kind:n.kind,min:n.min,max:n.max}}}}),{joint:{},limb:{},acceleration:{}}),V=e=>Object.values(e).every(t=>Object.keys(t).length===0),z=(e,t)=>{if(e.kind!==t.kind)return!1;switch(e.kind){case"Zed":return e.id===t.id;case"Usb":return e.name===t.name;case"GoPro":return e.id===t.id}};exports.AngleDataSource=g;exports.analysisStatBuilder=C;exports.areThresholdsEmpty=V;exports.availablePlanes=R;exports.axes=P;exports.canBeVerticalForce=v;exports.dimensionName=x;exports.dimensionToLegacy=y;exports.getAnalysisName=E;exports.getAnalysisPartIdNoSide=U;exports.getJointIdNoSide=u;exports.getJointIdWithSide=b;exports.getLimbIdNoSide=h;exports.getLimbIdWithSide=F;exports.getPointSide=A;exports.isDeviceEqual=z;exports.isLimbTrackingFrame=T;exports.isSyncError=K;exports.jointAngle=S;exports.jointOrLimbHasThreshold=_;exports.jointOrLimbThresholdCount=$;exports.limbAngle=k;exports.mkUnit=d;exports.partAndPlaneHasThreshold=q;exports.partIdName=I;exports.partIdToJointLimbId=L;exports.partIdToString=O;exports.partKinds=w;exports.planes=B;exports.sensorLocationName=N;exports.sensorLocationToLimbId=j;exports.thresholdForPart=J;exports.thresholdFragmentsToThresholds=D;exports.thresholdsToInput=W;exports.tryMkUnit=H;exports.updateThreshold=M;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jointNames as h, limbNames as f, planeOrAxis as l } from "./services.js";
|
|
2
2
|
import { S as n } from "./generated-GfcSQz21.js";
|
|
3
|
-
import { m as g } from "./lodash-vendor-
|
|
3
|
+
import { m as g } from "./lodash-vendor-D4ZPCr77.js";
|
|
4
4
|
import { safelyConvertEnum as p } from "./utils.js";
|
|
5
5
|
const c = (e, t) => t === "left" || t === "right" ? {
|
|
6
6
|
sagittal: e.sagittal
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./vendor-Bc1whdE2.cjs"),p=require("./services.cjs"),i=require("./moment-vendor-1cRqq0AH.cjs"),d=require("./generated-ChsGaiYd.cjs"),$=t=>t*39.3700787402,M=t=>t/39.3700787402,l=t=>t*2.20462262185,f=t=>t/2.20462262185,c=(t,n=!1)=>t==null?null:n?t*180/Math.PI:Math.round(t*(180/Math.PI)),P=t=>t==null?null:t*(Math.PI/180),S=t=>i.hooks.duration(t,"ms").humanize({ss:1}),F=(t,n=!1,s=!0)=>{const r=i.hooks.duration(t,"ms"),e=s?r.minutes().toString().padStart(2,"0"):r.minutes().toString(),o=r.seconds().toString().padStart(2,"0"),m=Math.round(r.milliseconds()).toString().padStart(3,"0");return n?`${e}:${o}.${m}`:`${e}:${o}`},k=(t,n=!1)=>{const s=i.hooks.duration(t,"seconds"),e=(s.minutes()+s.hours()*60).toString().padStart(2,"0"),o=s.seconds().toString().padStart(2,"0");if(n){const m=Math.round(s.milliseconds()).toString().padStart(3,"0");return`${e}:${o}.${m}`}return`${e}:${o}`},h=t=>{const n=i.hooks.duration(t,"ms"),s=n.hours(),r=n.minutes(),e=n.seconds(),o=n.milliseconds();return r<1?`${e}.${Math.floor(o/100)} seconds`:s<1?`${r} minutes`:`${s} hours`},b=t=>{const n=i.hooks.duration(t,"ms"),s=n.hours().toString().padStart(2,"0"),r=n.minutes().toString().padStart(2,"0"),e=n.seconds().toString().padStart(2,"0");return`${s}:${r}:${e}`},y=t=>{const n=i.hooks.duration(t,"seconds"),s=n.hours().toString().padStart(2,"0"),r=n.minutes().toString().padStart(2,"0"),e=n.seconds().toString().padStart(2,"0");return`${s}:${r}:${e}`},I=(t,n=!1)=>{const[s,r,e]=t.split(":").map(Number),o=n?999:0;return i.hooks.duration({hours:s,minutes:r,seconds:e,milliseconds:o}).asMilliseconds()},a=(t,n)=>{const s=new Intl.NumberFormat("en-US",{maximumFractionDigits:2});switch(t){case"Milliseconds":return h(n);case"DeltaMilliseconds":return S(n);case"Meters":return`${s.format(n)}m`;case"MetersPerSecond":return`${s.format(n)}m/s`;case"MetersPerSecondSq":return`${s.format(n)}m/s²`;case"Kg":return`${Math.round(l(n))}lbs`;case"Rad":return`${s.format(c(n)??0)}°`;case"RadPerSecond":return`${s.format(c(n)??0)}°/s`;case"RadPerSecondSq":return`${s.format(c(n)??0)}°/s²`;case"Frame":return`${s.format(n)}`;case"Percent":return new Intl.NumberFormat("en-US",{style:"percent"}).format(n);case"Count":return Math.round(n).toString();case"Centimeters":return`${s.format(n)}cm`;case"PassFail":return n>0?"Pass":"Fail";default:return n.toFixed(2)}},D=t=>a(t.unit,t.value),K=t=>t,R=t=>{const n=s=>p.getParameterAngleDirectionName(s,t);switch(t.partKind){case"joint":return s=>`${a("Rad",Math.abs(s))} ${n(s)}`;case"segment":return s=>`${a("Rad",Math.abs(s))} ${n(s)}`;case"acceleration":return s=>`${a("MetersPerSecondSq",s)} ${n(s)}`;case"angular_velocity":return s=>`${a("RadPerSecond",s)} ${n(s)}`;default:return s=>s.toString()}},q=t=>{const n=new Map;return((...s)=>{const r=JSON.stringify(s);if(n.has(r))return n.get(r);const e=t(...s);return n.set(r,e),e})},T=t=>({partId:"segment"in t.id?t.id.segment:t.id.joint,partKind:"segment"in t.id?"limb":"joint",partDimension:t.plane,min:t.min,max:t.max,kind:t.kind}),x=t=>t.map(T),g=t=>({id:t.partKind==="limb"?{segment:t.partId}:{joint:t.partId},plane:t.partDimension,min:t.min,max:t.max,kind:t.kind===d.ThresholdKind.Limit?d.ThresholdKind.Limit:d.ThresholdKind.Target}),U=t=>t.map(g),j=t=>t.split(" ").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "),A=(t,n)=>n===1?t:`${t}s`;function z(...t){return u.twMerge(u.clsx(t))}exports.capitalizeAll=j;exports.cn=z;exports.degToRad=P;exports.getFormatterForParameter=R;exports.getUnitFormatted=D;exports.getUnitValueFormatted=a;exports.hourMinSecStrToMs=I;exports.inchesToMeters=M;exports.kgToPounds=l;exports.memo=q;exports.metersToInches=$;exports.msToDurationStr=S;exports.msToHourMinSecStr=b;exports.msToPrettyStr=h;exports.msToTimestampStr=F;exports.parameterToThreshold=T;exports.parametersToThresholds=x;exports.pluralize=A;exports.poundsToKg=f;exports.radToDeg=c;exports.sToTimestampStr=k;exports.safelyConvertEnum=K;exports.secondsToTimestampStr=y;exports.thresholdToParameter=g;exports.thresholdsToParameters=U;
|