quantum-component-library 1.4.50-dev.0 → 1.4.50-dev.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/components.cjs +1 -1
- package/dist/components.js +549 -543
- package/dist/{dnd-core-vendor-BtUZf9Ev.cjs → dnd-core-vendor-CewhYmpg.cjs} +1 -1
- package/dist/{dnd-core-vendor-DLG1XK6O.js → dnd-core-vendor-MevRgDB0.js} +2 -2
- package/dist/{graphql-vendor-BYC3nhzS.cjs → graphql-vendor-BppBsUpc.cjs} +1 -1
- package/dist/{graphql-vendor-N74bYJtL.js → graphql-vendor-uvLTmCiR.js} +1 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +80 -98
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/lib/hooks/use-all-part-parameters.d.ts +1 -8
- package/dist/lib/types/parameters.d.ts +1 -0
- package/dist/{lodash-vendor-l9HldpVa.js → lodash-vendor-B-xpwrnm.js} +1 -1
- package/dist/{lodash-vendor-C3e6C_PJ.cjs → lodash-vendor-CWf2psR2.cjs} +1 -1
- package/dist/{other-q0es350N.cjs → other-Cad4iUZr.cjs} +1 -1
- package/dist/{other-DE6uy3y4.js → other-OzryMihZ.js} +2 -2
- package/dist/{react-dnd-vendor-BDOGawvX.js → react-dnd-vendor-BYAS_HOo.js} +2 -2
- package/dist/{react-dnd-vendor-BGRUqrp9.cjs → react-dnd-vendor-BqsnzPKT.cjs} +1 -1
- package/dist/{react-select-vendor-C3wpaSL1.js → react-select-vendor-_26lPW2Z.js} +1 -1
- package/dist/{react-select-vendor-CZ69mhgt.cjs → react-select-vendor-sW1B_api.cjs} +1 -1
- package/dist/{services-human-CGLf7B6Q.cjs → services-human-B4_65njx.cjs} +1 -1
- package/dist/{services-human-CI19qLdG.js → services-human-BIz3wOu_.js} +6 -6
- package/dist/services.cjs +1 -1
- package/dist/services.js +1 -1
- package/dist/types.cjs +1 -1
- package/dist/types.js +3 -3
- package/dist/{utils-conversion-sLq5wEdq.cjs → utils-conversion-BYVStK4S.cjs} +1 -1
- package/dist/{utils-conversion-zKwO4dYF.js → utils-conversion-pcEG40AR.js} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/dist/{vendor--D-cya0B.js → vendor-BHWxqW4x.js} +1 -1
- package/dist/{vendor-jpI6KZW2.cjs → vendor-Dj-hzYUa.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const l=require("./types.cjs"),a=require("./generated-graphql.cjs"),A=require("./services-rom-DmV5X8yu.cjs");require("./moment-vendor-1cRqq0AH.cjs");const h=require("./utils-memo-BJJP2KfI.cjs"),p=require("./utils-text-lORqO4uI.cjs"),s={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"},i={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"},I={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"]},S=()=>[{id:"LeftFoot",name:s.LeftFoot},{id:"RightFoot",name:s.RightFoot},{id:"LeftShank",name:s.LeftShank},{id:"RightShank",name:s.RightShank},{id:"LeftThigh",name:s.LeftThigh},{id:"RightThigh",name:s.RightThigh},{id:"LowerBack",name:s.LowerBack},{id:"CenterBack",name:s.CenterBack},{id:"UpperBack",name:s.UpperBack},{id:"Head",name:s.Head},{id:"LeftUpperArm",name:s.LeftUpperArm},{id:"RightUpperArm",name:s.RightUpperArm},{id:"LeftForearm",name:s.LeftForearm},{id:"RightForearm",name:s.RightForearm}],W=t=>S().filter(e=>t.find(n=>n==e.id)),k=()=>[{id:"LeftAnkle",name:i.LeftAnkle},{id:"RightAnkle",name:i.RightAnkle},{id:"LeftKnee",name:i.LeftKnee},{id:"RightKnee",name:i.RightKnee},{id:"LeftHip",name:i.LeftHip},{id:"RightHip",name:i.RightHip},{id:"NavalSpine",name:i.NavalSpine},{id:"ChestSpine",name:i.ChestSpine},{id:"TotalSpine",name:i.TotalSpine},{id:"LeftShoulder",name:i.LeftShoulder},{id:"RightShoulder",name:i.RightShoulder},{id:"LeftElbow",name:i.LeftElbow},{id:"RightElbow",name:i.RightElbow},{id:"Neck",name:i.Neck}],x=()=>[{id:"LeftAnkle",name:i.LeftAnkle},{id:"RightAnkle",name:i.RightAnkle},{id:"LeftKnee",name:i.LeftKnee},{id:"RightKnee",name:i.RightKnee},{id:"LeftHip",name:i.LeftHip},{id:"RightHip",name:i.RightHip},{id:"NavalSpine",name:i.NavalSpine},{id:"ChestSpine",name:i.ChestSpine},{id:"TotalSpine",name:i.TotalSpine},{id:"LeftShoulder",name:i.LeftShoulder},{id:"RightShoulder",name:i.RightShoulder},{id:"Neck",name:i.Neck}],b=()=>[{id:"LeftAnkle",name:i.LeftAnkle},{id:"RightAnkle",name:i.RightAnkle},{id:"LeftKnee",name:i.LeftKnee},{id:"RightKnee",name:i.RightKnee},{id:"LeftHip",name:i.LeftHip},{id:"RightHip",name:i.RightHip},{id:"TotalSpine",name:i.TotalSpine},{id:"LeftShoulder",name:i.LeftShoulder},{id:"RightShoulder",name:i.RightShoulder},{id:"LeftElbow",name:i.LeftElbow},{id:"RightElbow",name:i.RightElbow},{id:"Neck",name:i.Neck}],_=()=>[{id:"Head",name:s.Head},{id:"LeftThigh",name:s.LeftThigh},{id:"RightThigh",name:s.RightThigh},{id:"LeftShank",name:s.LeftShank},{id:"RightShank",name:s.RightShank},{id:"LeftFoot",name:s.LeftFoot},{id:"RightFoot",name:s.RightFoot},{id:"LowerBack",name:s.LowerBack},{id:"UpperBack",name:s.UpperBack},{id:"LeftUpperArm",name:s.LeftUpperArm},{id:"RightUpperArm",name:s.RightUpperArm},{id:"LeftForearm",name:s.LeftForearm},{id:"RightForearm",name:s.RightForearm}],O=t=>x().filter(n=>R[n.id].every(r=>t.includes(r))),M=t=>b().filter(n=>R[n.id].every(r=>t.includes(r))),w=(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"]},F=(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[]},v=h.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}),P=h.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}),d=h.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}}),T=h.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}}),V=h.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}}),X=h.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}}),G=h.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}}}),N=(t,e)=>({kind:"joint",value:t,plane:e}),E=(t,e)=>({kind:"limb",value:t,plane:e}),U=(t,e)=>({kind:"acceleration",value:t,axis:e}),H=(t,e)=>({kind:"angular_velocity",value:t,plane:e}),B=t=>l.axes.includes(t),Q=t=>l.planes.includes(t),J=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!S().find(e=>e.id===t.id),K=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!k().find(e=>e.id===t.id),Y=(t,e,n=!1)=>B(e)?J(t)?U(t,e):ne(`Can't make acceleration part from joint: ${t} ${e}`):K(t)?n?H(t,e):N(t,e):E(t,e),Z=t=>t.kind==="acceleration"?t.axis:t.plane,ee=t=>t?.kind==="acceleration"?t.axis:null,te=t=>t?.kind==="acceleration"?null:t?.plane??null,ne=t=>{throw new Error(t)},g=t=>t in i?i[t]:t in s?s[t]:"Unknown",ae=t=>g(t).replace(/Left|Right/g,""),ie=t=>t in A.romJson,C=(t,e)=>{if(!ie(t))return null;const n=A.romJson[t];if(e in n){const{min:o,max:r}=n[e];return{min:o??0,max:r??0}}return null},re=(...t)=>{const e=C(...t);return e?Math.abs(e.max-e.min):0},D=(t,e)=>{const n=Object.keys(s).find(r=>r===e),o=Object.keys(i).find(r=>r===e);return!n&&!o?null:n?t.limbs[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose:t.joints[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose},se=(t,e,n)=>{const o=Object.keys(i).find(c=>c===e),r=D(t,e);return r?o?w(e,r).includes(n):F(e,r).includes(n):!1},oe=(t,e,n)=>{const o=Object.keys(s).find(c=>c===e),r=Object.keys(i).find(c=>c===e);if(!o&&!r)throw new Error(`Unknown partId: ${e} - this invariant should've been enforced by typescript`);return o?l.limbAngle(t.limbs[e])?.[n]??null:l.jointAngle(t.joints[e],void 0,t.direction)?.[n]??null},L=(t=!1)=>t?"Internal/External Rotation":"External/Internal Rotation",j=(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 L(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 L(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 L(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 L(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"}}},y=(t,e,n=!1)=>{const o=g(t),r=d(t,e,1),c=d(t,e,-1);if(r&&c){const m=p.capitalizeAll(r),f=p.capitalizeAll(c),z=n?`${f}/${m}`:`${m}/${f}`;return`${o} (${z})`}return`${o} (${e})`},ce=(t,e)=>{let n;switch(e){case"x":n="Med./Lat.";break;case"y":n="Vertical";break;case"z":n="Ant./Post."}return`${g(t)} ${n}`},$=(t,e,n=!1)=>{const o=g(t),r=j(t,e,n);return r?`${o} (${r})`:null},le=(t,e)=>$(t,e)||y(t,e),u=(t,e,n,o=!1)=>{const r=o?P:v,c=o?T:d,[m,f]=t==="joint"?[r(e,n,1),r(e,n,-1)]:[c(e,n,1),c(e,n,-1)];return{positive:m,negative:f}},q=(t,e=!1)=>t.partKind==="joint"?u("joint",t.partId,t.partDimension,e):u("segment",t.partId,t.partDimension,e),he=(t,e,n=!1)=>{const{positive:o,negative:r}=q(e,n);return t>=0?o:r},ge=t=>{const e=new Set;return t.forEach(n=>{const o=n.includes("Left"),r=n.includes("Right");n.includes("Knee")?o?(e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.LeftShank)):r?(e.add(a.SensorLocation.RightThigh),e.add(a.SensorLocation.RightShank)):(e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.RightThigh),e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.RightShank)):n.includes("Hip")?(e.add(a.SensorLocation.Pelvis),o?e.add(a.SensorLocation.LeftThigh):(r||e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.RightThigh))):n.includes("Ankle")?o?(e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.LeftFoot)):r?(e.add(a.SensorLocation.RightShank),e.add(a.SensorLocation.RightFoot)):(e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.RightShank),e.add(a.SensorLocation.LeftFoot),e.add(a.SensorLocation.RightFoot)):n.includes("Shoulder")?(e.add(a.SensorLocation.Thorax),o?e.add(a.SensorLocation.LeftUpperArm):(r||e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.RightUpperArm))):n.includes("Elbow")&&(o?(e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.LeftForearm)):r?(e.add(a.SensorLocation.RightUpperArm),e.add(a.SensorLocation.RightForearm)):(e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.RightUpperArm),e.add(a.SensorLocation.LeftForearm),e.add(a.SensorLocation.RightForearm))),n.includes("Thigh")?o?e.add(a.SensorLocation.LeftThigh):(r||e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.RightThigh)):n.includes("Shank")?o?e.add(a.SensorLocation.LeftShank):(r||e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.RightShank)):n.includes("Foot")?o?e.add(a.SensorLocation.LeftFoot):(r||e.add(a.SensorLocation.LeftFoot),e.add(a.SensorLocation.RightFoot)):n.includes("UpperArm")?o?e.add(a.SensorLocation.LeftUpperArm):(r||e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.RightUpperArm)):n.includes("Forearm")?o?e.add(a.SensorLocation.LeftForearm):(r||e.add(a.SensorLocation.LeftForearm),e.add(a.SensorLocation.RightForearm)):n.includes("Back")&&(e.add(a.SensorLocation.Thorax),e.add(a.SensorLocation.CenterBack))}),Array.from(e)};exports.getAllAvailableJoints=k;exports.getAllAvailableLimbs=S;exports.getAllAvailablePoseJoints=b;exports.getAllAvailablePoseLimbs=_;exports.getAllAvailableSensorJoints=x;exports.getAngleDirectionNames=u;exports.getAvailableLimbsForLimbIds=W;exports.getAvailablePoseJointsForLimbIds=M;exports.getAvailableSensorJointsForLimbIds=O;exports.getAxis=ee;exports.getDefaultAngleSource=D;exports.getDefaultJointRange=V;exports.getDefaultLimbRange=X;exports.getEnabledJointPlanes=w;exports.getEnabledSegmentPlanes=F;exports.getHumanBodyAngle=oe;exports.getIsDefaultAngleAllowed=se;exports.getJointAngleDirectionAbbr=P;exports.getJointAngleDirectionName=v;exports.getJointNameWithPlane=$;exports.getJointOrSegmentNameWithPlane=le;exports.getJointPlaneName=j;exports.getNormativeJointRange=G;exports.getParameterAngleDirectionName=he;exports.getParameterDirectionNames=q;exports.getPartName=g;exports.getPartNameNoSide=ae;exports.getPlane=te;exports.getSegmentAngleDirectionAbbr=T;exports.getSegmentAngleDirectionName=d;exports.getSegmentNameWithPlane=y;exports.getSegmentXyzName=ce;exports.getSuggestedSensorLocations=ge;exports.getTypicalRom=C;exports.getTypicalRomSize=re;exports.isAxis=B;exports.isJoint=K;exports.isLimb=J;exports.isPlane=Q;exports.jointNames=i;exports.jointsUsedByLimbs=I;exports.limbNames=s;exports.limbsRequiredForJoints=R;exports.mkAccelerationPart=U;exports.mkAngularVelocityPart=H;exports.mkHumanPart=Y;exports.mkJointPart=N;exports.mkLimbPart=E;exports.planeOrAxis=Z;
|
|
1
|
+
"use strict";const l=require("./types.cjs"),a=require("./generated-graphql.cjs"),A=require("./services-rom-DmV5X8yu.cjs");require("./moment-vendor-1cRqq0AH.cjs");const h=require("./utils-memo-BJJP2KfI.cjs"),p=require("./utils-text-lORqO4uI.cjs"),s={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"},i={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"},I={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"]},S=()=>[{id:"LeftFoot",name:s.LeftFoot},{id:"RightFoot",name:s.RightFoot},{id:"LeftShank",name:s.LeftShank},{id:"RightShank",name:s.RightShank},{id:"LeftThigh",name:s.LeftThigh},{id:"RightThigh",name:s.RightThigh},{id:"LowerBack",name:s.LowerBack},{id:"CenterBack",name:s.CenterBack},{id:"UpperBack",name:s.UpperBack},{id:"Head",name:s.Head},{id:"LeftUpperArm",name:s.LeftUpperArm},{id:"RightUpperArm",name:s.RightUpperArm},{id:"LeftForearm",name:s.LeftForearm},{id:"RightForearm",name:s.RightForearm}],W=t=>S().filter(e=>t.find(n=>n==e.id)),k=()=>[{id:"LeftAnkle",name:i.LeftAnkle},{id:"RightAnkle",name:i.RightAnkle},{id:"LeftKnee",name:i.LeftKnee},{id:"RightKnee",name:i.RightKnee},{id:"LeftHip",name:i.LeftHip},{id:"RightHip",name:i.RightHip},{id:"NavalSpine",name:i.NavalSpine},{id:"ChestSpine",name:i.ChestSpine},{id:"TotalSpine",name:i.TotalSpine},{id:"LeftShoulder",name:i.LeftShoulder},{id:"RightShoulder",name:i.RightShoulder},{id:"LeftElbow",name:i.LeftElbow},{id:"RightElbow",name:i.RightElbow},{id:"Neck",name:i.Neck}],x=()=>[{id:"LeftAnkle",name:i.LeftAnkle},{id:"RightAnkle",name:i.RightAnkle},{id:"LeftKnee",name:i.LeftKnee},{id:"RightKnee",name:i.RightKnee},{id:"LeftHip",name:i.LeftHip},{id:"RightHip",name:i.RightHip},{id:"NavalSpine",name:i.NavalSpine},{id:"ChestSpine",name:i.ChestSpine},{id:"TotalSpine",name:i.TotalSpine},{id:"LeftShoulder",name:i.LeftShoulder},{id:"RightShoulder",name:i.RightShoulder},{id:"Neck",name:i.Neck}],b=()=>[{id:"LeftAnkle",name:i.LeftAnkle},{id:"RightAnkle",name:i.RightAnkle},{id:"LeftKnee",name:i.LeftKnee},{id:"RightKnee",name:i.RightKnee},{id:"LeftHip",name:i.LeftHip},{id:"RightHip",name:i.RightHip},{id:"TotalSpine",name:i.TotalSpine},{id:"LeftShoulder",name:i.LeftShoulder},{id:"RightShoulder",name:i.RightShoulder},{id:"LeftElbow",name:i.LeftElbow},{id:"RightElbow",name:i.RightElbow},{id:"Neck",name:i.Neck}],_=()=>[{id:"Head",name:s.Head},{id:"LeftThigh",name:s.LeftThigh},{id:"RightThigh",name:s.RightThigh},{id:"LeftShank",name:s.LeftShank},{id:"RightShank",name:s.RightShank},{id:"LeftFoot",name:s.LeftFoot},{id:"RightFoot",name:s.RightFoot},{id:"LowerBack",name:s.LowerBack},{id:"UpperBack",name:s.UpperBack},{id:"LeftUpperArm",name:s.LeftUpperArm},{id:"RightUpperArm",name:s.RightUpperArm},{id:"LeftForearm",name:s.LeftForearm},{id:"RightForearm",name:s.RightForearm}],O=t=>x().filter(n=>R[n.id].every(r=>t.includes(r))),M=t=>b().filter(n=>R[n.id].every(r=>t.includes(r))),w=(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"]},F=(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[]},v=h.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}),P=h.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}),d=h.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}}),T=h.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}}),V=h.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}}),X=h.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}}),G=h.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}}}),N=(t,e)=>({kind:"joint",value:t,plane:e}),E=(t,e)=>({kind:"limb",value:t,plane:e}),U=(t,e)=>({kind:"acceleration",value:t,axis:e}),H=(t,e)=>({kind:"angular_velocity",value:t,plane:e}),B=t=>l.axes.includes(t),Q=t=>l.planes.includes(t),J=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!S().find(e=>e.id===t.id),C=t=>typeof t=="object"&&t!==null&&"id"in t&&"name"in t&&!!k().find(e=>e.id===t.id),Y=(t,e,n=!1)=>B(e)?J(t)?U(t,e):ne(`Can't make acceleration part from joint: ${t} ${e}`):C(t)?n?H(t,e):N(t,e):E(t,e),Z=t=>t.kind==="acceleration"?t.axis:t.plane,ee=t=>t?.kind==="acceleration"?t.axis:null,te=t=>t?.kind==="acceleration"?null:t?.plane??null,ne=t=>{throw new Error(t)},g=t=>t in i?i[t]:t in s?s[t]:"Unknown",ae=t=>g(t).replace(/Left|Right/g,""),ie=t=>t in A.romJson,K=(t,e)=>{if(!ie(t))return null;const n=A.romJson[t];if(e in n){const{min:o,max:r}=n[e];return{min:o??0,max:r??0}}return null},re=(...t)=>{const e=K(...t);return e?Math.abs(e.max-e.min):0},D=(t,e)=>{const n=Object.keys(s).find(r=>r===e),o=Object.keys(i).find(r=>r===e);return!n&&!o?null:n?t.limbs[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose:t.joints[e].sensor_angle?l.AngleDataSource.Sensor:l.AngleDataSource.Pose},se=(t,e,n)=>{const o=Object.keys(i).find(c=>c===e),r=D(t,e);return r?o?w(e,r).includes(n):F(e,r).includes(n):!1},oe=(t,e,n)=>{const o=Object.keys(s).find(c=>c===e),r=Object.keys(i).find(c=>c===e);if(!o&&!r)throw new Error(`Unknown partId: ${e} - this invariant should've been enforced by typescript`);return o?l.limbAngle(t.limbs[e])?.[n]??null:l.jointAngle(t.joints[e],void 0,t.direction)?.[n]??null},L=(t=!1)=>t?"Internal/External Rotation":"External/Internal Rotation",j=(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 L(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 L(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 L(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 L(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"}}},y=(t,e,n=!1)=>{const o=g(t),r=d(t,e,1),c=d(t,e,-1);if(r&&c){const m=p.capitalizeAll(r),f=p.capitalizeAll(c),z=n?`${f}/${m}`:`${m}/${f}`;return`${o} (${z})`}return`${o} (${e})`},ce=(t,e)=>{let n;switch(e){case"x":n="Med./Lat.";break;case"y":n="Vertical";break;case"z":n="Ant./Post."}return`${g(t)} ${n}`},$=(t,e,n=!1)=>{const o=g(t),r=j(t,e,n);return r?`${o} (${r})`:null},le=(t,e)=>$(t,e)||y(t,e),u=(t,e,n,o=!1)=>{const r=o?P:v,c=o?T:d,[m,f]=t==="joint"?[r(e,n,1),r(e,n,-1)]:[c(e,n,1),c(e,n,-1)];return{positive:m,negative:f}},q=(t,e=!1)=>t.partKind==="joint"?u("joint",t.partId,t.partDimension,e):u("segment",t.partId,t.partDimension,e),he=(t,e,n=!1)=>{const{positive:o,negative:r}=q(e,n);return t>=0?o:r},ge=t=>{const e=new Set;return t.forEach(n=>{const o=n.includes("Left"),r=n.includes("Right");n.includes("Knee")?o?(e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.LeftShank)):r?(e.add(a.SensorLocation.RightThigh),e.add(a.SensorLocation.RightShank)):(e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.RightThigh),e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.RightShank)):n.includes("Hip")?(e.add(a.SensorLocation.Pelvis),o?e.add(a.SensorLocation.LeftThigh):(r||e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.RightThigh))):n.includes("Ankle")?o?(e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.LeftFoot)):r?(e.add(a.SensorLocation.RightShank),e.add(a.SensorLocation.RightFoot)):(e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.RightShank),e.add(a.SensorLocation.LeftFoot),e.add(a.SensorLocation.RightFoot)):n.includes("Shoulder")?(e.add(a.SensorLocation.Thorax),o?e.add(a.SensorLocation.LeftUpperArm):(r||e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.RightUpperArm))):n.includes("Elbow")?o?(e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.LeftForearm)):r?(e.add(a.SensorLocation.RightUpperArm),e.add(a.SensorLocation.RightForearm)):(e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.RightUpperArm),e.add(a.SensorLocation.LeftForearm),e.add(a.SensorLocation.RightForearm)):(n.includes("Neck")||n.includes("Head"))&&e.add(a.SensorLocation.Head),n.includes("Thigh")?o?e.add(a.SensorLocation.LeftThigh):(r||e.add(a.SensorLocation.LeftThigh),e.add(a.SensorLocation.RightThigh)):n.includes("Shank")?o?e.add(a.SensorLocation.LeftShank):(r||e.add(a.SensorLocation.LeftShank),e.add(a.SensorLocation.RightShank)):n.includes("Foot")?o?e.add(a.SensorLocation.LeftFoot):(r||e.add(a.SensorLocation.LeftFoot),e.add(a.SensorLocation.RightFoot)):n.includes("UpperArm")?o?e.add(a.SensorLocation.LeftUpperArm):(r||e.add(a.SensorLocation.LeftUpperArm),e.add(a.SensorLocation.RightUpperArm)):n.includes("Forearm")?o?e.add(a.SensorLocation.LeftForearm):(r||e.add(a.SensorLocation.LeftForearm),e.add(a.SensorLocation.RightForearm)):n.includes("Back")||n.includes("Spine")?(e.add(a.SensorLocation.Thorax),e.add(a.SensorLocation.CenterBack)):n.includes("Pelvis")&&(e.add(a.SensorLocation.CenterBack),e.add(a.SensorLocation.Pelvis))}),Array.from(e)};exports.getAllAvailableJoints=k;exports.getAllAvailableLimbs=S;exports.getAllAvailablePoseJoints=b;exports.getAllAvailablePoseLimbs=_;exports.getAllAvailableSensorJoints=x;exports.getAngleDirectionNames=u;exports.getAvailableLimbsForLimbIds=W;exports.getAvailablePoseJointsForLimbIds=M;exports.getAvailableSensorJointsForLimbIds=O;exports.getAxis=ee;exports.getDefaultAngleSource=D;exports.getDefaultJointRange=V;exports.getDefaultLimbRange=X;exports.getEnabledJointPlanes=w;exports.getEnabledSegmentPlanes=F;exports.getHumanBodyAngle=oe;exports.getIsDefaultAngleAllowed=se;exports.getJointAngleDirectionAbbr=P;exports.getJointAngleDirectionName=v;exports.getJointNameWithPlane=$;exports.getJointOrSegmentNameWithPlane=le;exports.getJointPlaneName=j;exports.getNormativeJointRange=G;exports.getParameterAngleDirectionName=he;exports.getParameterDirectionNames=q;exports.getPartName=g;exports.getPartNameNoSide=ae;exports.getPlane=te;exports.getSegmentAngleDirectionAbbr=T;exports.getSegmentAngleDirectionName=d;exports.getSegmentNameWithPlane=y;exports.getSegmentXyzName=ce;exports.getSuggestedSensorLocations=ge;exports.getTypicalRom=K;exports.getTypicalRomSize=re;exports.isAxis=B;exports.isJoint=C;exports.isLimb=J;exports.isPlane=Q;exports.jointNames=i;exports.jointsUsedByLimbs=I;exports.limbNames=s;exports.limbsRequiredForJoints=R;exports.mkAccelerationPart=U;exports.mkAngularVelocityPart=H;exports.mkHumanPart=Y;exports.mkJointPart=N;exports.mkLimbPart=E;exports.planeOrAxis=Z;
|
|
@@ -578,11 +578,11 @@ const o = {
|
|
|
578
578
|
return { min: -180, max: 180 };
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
),
|
|
581
|
+
), C = (t, e) => ({
|
|
582
582
|
kind: "joint",
|
|
583
583
|
value: t,
|
|
584
584
|
plane: e
|
|
585
|
-
}),
|
|
585
|
+
}), K = (t, e) => ({
|
|
586
586
|
kind: "limb",
|
|
587
587
|
value: t,
|
|
588
588
|
plane: e
|
|
@@ -596,7 +596,7 @@ const o = {
|
|
|
596
596
|
plane: e
|
|
597
597
|
}), y = (t) => x.includes(t), le = (t) => w.includes(t), $ = (t) => typeof t == "object" && t !== null && "id" in t && "name" in t && !!S().find((e) => e.id === t.id), D = (t) => typeof t == "object" && t !== null && "id" in t && "name" in t && !!v().find((e) => e.id === t.id), he = (t, e, a = !1) => y(e) ? $(t) ? j(t, e) : z(
|
|
598
598
|
`Can't make acceleration part from joint: ${t} ${e}`
|
|
599
|
-
) : D(t) ? a ? J(t, e) :
|
|
599
|
+
) : D(t) ? a ? J(t, e) : C(t, e) : K(t, e), me = (t) => t.kind === "acceleration" ? t.axis : t.plane, fe = (t) => t?.kind === "acceleration" ? t.axis : null, ge = (t) => t?.kind === "acceleration" ? null : t?.plane ?? null, z = (t) => {
|
|
600
600
|
throw new Error(t);
|
|
601
601
|
}, d = (t) => t in i ? i[t] : t in o ? o[t] : "Unknown", de = (t) => d(t).replace(/Left|Right/g, ""), _ = (t) => t in p, W = (t, e) => {
|
|
602
602
|
if (!_(t))
|
|
@@ -750,11 +750,11 @@ const o = {
|
|
|
750
750
|
const e = /* @__PURE__ */ new Set();
|
|
751
751
|
return t.forEach((a) => {
|
|
752
752
|
const r = a.includes("Left"), s = a.includes("Right");
|
|
753
|
-
a.includes("Knee") ? r ? (e.add(n.LeftThigh), e.add(n.LeftShank)) : s ? (e.add(n.RightThigh), e.add(n.RightShank)) : (e.add(n.LeftThigh), e.add(n.RightThigh), e.add(n.LeftShank), e.add(n.RightShank)) : a.includes("Hip") ? (e.add(n.Pelvis), r ? e.add(n.LeftThigh) : s ? e.add(n.RightThigh) : (e.add(n.LeftThigh), e.add(n.RightThigh))) : a.includes("Ankle") ? r ? (e.add(n.LeftShank), e.add(n.LeftFoot)) : s ? (e.add(n.RightShank), e.add(n.RightFoot)) : (e.add(n.LeftShank), e.add(n.RightShank), e.add(n.LeftFoot), e.add(n.RightFoot)) : a.includes("Shoulder") ? (e.add(n.Thorax), r ? e.add(n.LeftUpperArm) : s ? e.add(n.RightUpperArm) : (e.add(n.LeftUpperArm), e.add(n.RightUpperArm))) : a.includes("Elbow")
|
|
753
|
+
a.includes("Knee") ? r ? (e.add(n.LeftThigh), e.add(n.LeftShank)) : s ? (e.add(n.RightThigh), e.add(n.RightShank)) : (e.add(n.LeftThigh), e.add(n.RightThigh), e.add(n.LeftShank), e.add(n.RightShank)) : a.includes("Hip") ? (e.add(n.Pelvis), r ? e.add(n.LeftThigh) : s ? e.add(n.RightThigh) : (e.add(n.LeftThigh), e.add(n.RightThigh))) : a.includes("Ankle") ? r ? (e.add(n.LeftShank), e.add(n.LeftFoot)) : s ? (e.add(n.RightShank), e.add(n.RightFoot)) : (e.add(n.LeftShank), e.add(n.RightShank), e.add(n.LeftFoot), e.add(n.RightFoot)) : a.includes("Shoulder") ? (e.add(n.Thorax), r ? e.add(n.LeftUpperArm) : s ? e.add(n.RightUpperArm) : (e.add(n.LeftUpperArm), e.add(n.RightUpperArm))) : a.includes("Elbow") ? r ? (e.add(n.LeftUpperArm), e.add(n.LeftForearm)) : s ? (e.add(n.RightUpperArm), e.add(n.RightForearm)) : (e.add(n.LeftUpperArm), e.add(n.RightUpperArm), e.add(n.LeftForearm), e.add(n.RightForearm)) : (a.includes("Neck") || a.includes("Head")) && e.add(n.Head), a.includes("Thigh") ? r ? e.add(n.LeftThigh) : s ? e.add(n.RightThigh) : (e.add(n.LeftThigh), e.add(n.RightThigh)) : a.includes("Shank") ? r ? e.add(n.LeftShank) : s ? e.add(n.RightShank) : (e.add(n.LeftShank), e.add(n.RightShank)) : a.includes("Foot") ? r ? e.add(n.LeftFoot) : s ? e.add(n.RightFoot) : (e.add(n.LeftFoot), e.add(n.RightFoot)) : a.includes("UpperArm") ? r ? e.add(n.LeftUpperArm) : s ? e.add(n.RightUpperArm) : (e.add(n.LeftUpperArm), e.add(n.RightUpperArm)) : a.includes("Forearm") ? r ? e.add(n.LeftForearm) : s ? e.add(n.RightForearm) : (e.add(n.LeftForearm), e.add(n.RightForearm)) : a.includes("Back") || a.includes("Spine") ? (e.add(n.Thorax), e.add(n.CenterBack)) : a.includes("Pelvis") && (e.add(n.CenterBack), e.add(n.Pelvis));
|
|
754
754
|
}), Array.from(e);
|
|
755
755
|
};
|
|
756
756
|
export {
|
|
757
|
-
|
|
757
|
+
K as A,
|
|
758
758
|
j as B,
|
|
759
759
|
J as C,
|
|
760
760
|
y as D,
|
|
@@ -802,5 +802,5 @@ export {
|
|
|
802
802
|
se as w,
|
|
803
803
|
B as x,
|
|
804
804
|
N as y,
|
|
805
|
-
|
|
805
|
+
C as z
|
|
806
806
|
};
|
package/dist/services.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./services-action-DBOzfgMl.cjs"),e=require("./services-human-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./services-action-DBOzfgMl.cjs"),e=require("./services-human-B4_65njx.cjs");exports.getActivityKindFromActivityType=t.getActivityKindFromActivityType;exports.mapActivityTypeEnumToLabel=t.mapActivityTypeEnumToLabel;exports.mapSessionTypeEnumToLabel=t.mapSessionTypeEnumToLabel;exports.getAllAvailableJoints=e.getAllAvailableJoints;exports.getAllAvailableLimbs=e.getAllAvailableLimbs;exports.getAllAvailablePoseJoints=e.getAllAvailablePoseJoints;exports.getAllAvailablePoseLimbs=e.getAllAvailablePoseLimbs;exports.getAllAvailableSensorJoints=e.getAllAvailableSensorJoints;exports.getAngleDirectionNames=e.getAngleDirectionNames;exports.getAvailableLimbsForLimbIds=e.getAvailableLimbsForLimbIds;exports.getAvailablePoseJointsForLimbIds=e.getAvailablePoseJointsForLimbIds;exports.getAvailableSensorJointsForLimbIds=e.getAvailableSensorJointsForLimbIds;exports.getAxis=e.getAxis;exports.getDefaultAngleSource=e.getDefaultAngleSource;exports.getDefaultJointRange=e.getDefaultJointRange;exports.getDefaultLimbRange=e.getDefaultLimbRange;exports.getEnabledJointPlanes=e.getEnabledJointPlanes;exports.getEnabledSegmentPlanes=e.getEnabledSegmentPlanes;exports.getHumanBodyAngle=e.getHumanBodyAngle;exports.getIsDefaultAngleAllowed=e.getIsDefaultAngleAllowed;exports.getJointAngleDirectionAbbr=e.getJointAngleDirectionAbbr;exports.getJointAngleDirectionName=e.getJointAngleDirectionName;exports.getJointNameWithPlane=e.getJointNameWithPlane;exports.getJointOrSegmentNameWithPlane=e.getJointOrSegmentNameWithPlane;exports.getJointPlaneName=e.getJointPlaneName;exports.getNormativeJointRange=e.getNormativeJointRange;exports.getParameterAngleDirectionName=e.getParameterAngleDirectionName;exports.getParameterDirectionNames=e.getParameterDirectionNames;exports.getPartName=e.getPartName;exports.getPartNameNoSide=e.getPartNameNoSide;exports.getPlane=e.getPlane;exports.getSegmentAngleDirectionAbbr=e.getSegmentAngleDirectionAbbr;exports.getSegmentAngleDirectionName=e.getSegmentAngleDirectionName;exports.getSegmentNameWithPlane=e.getSegmentNameWithPlane;exports.getSegmentXyzName=e.getSegmentXyzName;exports.getSuggestedSensorLocations=e.getSuggestedSensorLocations;exports.getTypicalRom=e.getTypicalRom;exports.getTypicalRomSize=e.getTypicalRomSize;exports.isAxis=e.isAxis;exports.isJoint=e.isJoint;exports.isLimb=e.isLimb;exports.isPlane=e.isPlane;exports.jointNames=e.jointNames;exports.jointsUsedByLimbs=e.jointsUsedByLimbs;exports.limbNames=e.limbNames;exports.limbsRequiredForJoints=e.limbsRequiredForJoints;exports.mkAccelerationPart=e.mkAccelerationPart;exports.mkAngularVelocityPart=e.mkAngularVelocityPart;exports.mkHumanPart=e.mkHumanPart;exports.mkJointPart=e.mkJointPart;exports.mkLimbPart=e.mkLimbPart;exports.planeOrAxis=e.planeOrAxis;
|
package/dist/services.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { g as t, m as s, a as i } from "./services-action-CfZFwhy-.js";
|
|
2
|
-
import { n as l, j as g, m as o, u as m, t as r, U as A, s as b, w as P, v as c, J, O as N, i as S, l as L, h as d, k as u, Q as v, P as y, x as D, b as p, a as T, T as f, R, d as k, W as x, V as F, e as E, L as I, K as h, y as W, c as j, g as z, S as B, f as H, M as O, N as q, D as w, G as K, F as U, E as V, q as C, r as G, p as M, o as Q, B as X, C as Y, H as Z, z as _, A as $, I as ee } from "./services-human-
|
|
2
|
+
import { n as l, j as g, m as o, u as m, t as r, U as A, s as b, w as P, v as c, J, O as N, i as S, l as L, h as d, k as u, Q as v, P as y, x as D, b as p, a as T, T as f, R, d as k, W as x, V as F, e as E, L as I, K as h, y as W, c as j, g as z, S as B, f as H, M as O, N as q, D as w, G as K, F as U, E as V, q as C, r as G, p as M, o as Q, B as X, C as Y, H as Z, z as _, A as $, I as ee } from "./services-human-BIz3wOu_.js";
|
|
3
3
|
export {
|
|
4
4
|
t as getActivityKindFromActivityType,
|
|
5
5
|
l as getAllAvailableJoints,
|
package/dist/types.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./services-human-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./services-human-B4_65njx.cjs"),r=require("./generated-graphql.cjs"),m=require("./lodash-vendor-CWf2psR2.cjs"),p=require("./utils-conversion-BYVStK4S.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=()=>{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}),C=(e,t)=>{if(t!=null)return d(e,t)},L=e=>"joint"in e?e.joint:e.segment,N=e=>L(e).toString(),H=e=>"plane"in e?e.plane:e.axis,O=e=>"plane"in e?e.plane:e.axis,y=e=>"joint"in e?i.jointNames[e.joint]:i.limbNames[e.segment],x=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"})`},I=e=>typeof e=="object"&&"SyncError"in e,E=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},K=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"},_=(e,t)=>Object.values(e).some(n=>t.id in n&&Object.keys(n[t.id]).length>0),q=(e,t)=>Math.max(...Object.values(e).map(n=>t.id in n?Object.keys(n[t.id]).length:0)),$=(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),G=(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=j;exports.areThresholdsEmpty=V;exports.availablePlanes=R;exports.axes=P;exports.canBeVerticalForce=v;exports.dimensionName=O;exports.dimensionToLegacy=H;exports.getAnalysisName=x;exports.getAnalysisPartIdNoSide=U;exports.getJointIdNoSide=u;exports.getJointIdWithSide=b;exports.getLimbIdNoSide=h;exports.getLimbIdWithSide=F;exports.getPointSide=A;exports.isDeviceEqual=G;exports.isLimbTrackingFrame=T;exports.isSyncError=I;exports.jointAngle=S;exports.jointOrLimbHasThreshold=_;exports.jointOrLimbThresholdCount=q;exports.limbAngle=k;exports.mkUnit=d;exports.partAndPlaneHasThreshold=$;exports.partIdName=y;exports.partIdToJointLimbId=L;exports.partIdToString=N;exports.partKinds=w;exports.planes=B;exports.sensorLocationName=K;exports.sensorLocationToLimbId=E;exports.thresholdForPart=J;exports.thresholdFragmentsToThresholds=D;exports.thresholdsToInput=W;exports.tryMkUnit=C;exports.updateThreshold=M;
|
package/dist/types.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { q as h, p as f, I as l } from "./services-human-
|
|
1
|
+
import { q as h, p as f, I as l } from "./services-human-BIz3wOu_.js";
|
|
2
2
|
import { SensorLocation as n } from "./generated-graphql.js";
|
|
3
|
-
import { m as g } from "./lodash-vendor-
|
|
4
|
-
import { l as p } from "./utils-conversion-
|
|
3
|
+
import { m as g } from "./lodash-vendor-B-xpwrnm.js";
|
|
4
|
+
import { l as p } from "./utils-conversion-pcEG40AR.js";
|
|
5
5
|
const c = (e, t) => t === "left" || t === "right" ? {
|
|
6
6
|
sagittal: e.sagittal
|
|
7
7
|
} : t === "forward" || t === "backward" ? {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const $=require("./services-human-
|
|
1
|
+
"use strict";const $=require("./services-human-B4_65njx.cjs"),c=require("./moment-vendor-1cRqq0AH.cjs"),h=s=>s*39.3700787402,l=s=>s/39.3700787402,m=s=>s*2.20462262185,g=s=>s/2.20462262185,i=(s,t=!1)=>s==null?null:t?s*180/Math.PI:Math.round(s*(180/Math.PI)),T=s=>s==null?null:s*(Math.PI/180),d=s=>c.hooks.duration(s,"ms").humanize({ss:1}),M=(s,t=!1,r=!0)=>{const n=c.hooks.duration(s,"ms"),o=r?n.minutes().toString().padStart(2,"0"):n.minutes().toString(),e=n.seconds().toString().padStart(2,"0"),u=Math.round(n.milliseconds()).toString().padStart(3,"0");return t?`${o}:${e}.${u}`:`${o}:${e}`},f=(s,t=!1)=>{const r=c.hooks.duration(s,"seconds"),o=(r.minutes()+r.hours()*60).toString().padStart(2,"0"),e=r.seconds().toString().padStart(2,"0");if(t){const u=Math.round(r.milliseconds()).toString().padStart(3,"0");return`${o}:${e}.${u}`}return`${o}:${e}`},S=s=>{const t=c.hooks.duration(s,"ms"),r=t.hours(),n=t.minutes(),o=t.seconds(),e=t.milliseconds();return n<1?`${o}.${Math.floor(e/100)} seconds`:r<1?`${n} minutes`:`${r} hours`},p=s=>{const t=c.hooks.duration(s,"ms"),r=t.hours().toString().padStart(2,"0"),n=t.minutes().toString().padStart(2,"0"),o=t.seconds().toString().padStart(2,"0");return`${r}:${n}:${o}`},P=s=>{const t=c.hooks.duration(s,"seconds"),r=t.hours().toString().padStart(2,"0"),n=t.minutes().toString().padStart(2,"0"),o=t.seconds().toString().padStart(2,"0");return`${r}:${n}:${o}`},F=(s,t=!1)=>{const[r,n,o]=s.split(":").map(Number),e=t?999:0;return c.hooks.duration({hours:r,minutes:n,seconds:o,milliseconds:e}).asMilliseconds()},a=(s,t)=>{const r=new Intl.NumberFormat("en-US",{maximumFractionDigits:2});switch(s){case"Milliseconds":return S(t);case"DeltaMilliseconds":return d(t);case"Meters":return`${r.format(t)}m`;case"MetersPerSecond":return`${r.format(t)}m/s`;case"MetersPerSecondSq":return`${r.format(t)}m/s²`;case"Kg":return`${Math.round(m(t))}lbs`;case"Rad":return`${r.format(i(t)??0)}°`;case"RadPerSecond":return`${r.format(i(t)??0)}°/s`;case"RadPerSecondSq":return`${r.format(i(t)??0)}°/s²`;case"Frame":return`${r.format(t)}`;case"Percent":return new Intl.NumberFormat("en-US",{style:"percent"}).format(t);case"Count":return Math.round(t).toString();case"Centimeters":return`${r.format(t)}cm`;case"PassFail":return t>0?"Pass":"Fail";default:return t.toFixed(2)}},k=s=>a(s.unit,s.value),R=s=>s,D=s=>{const t=r=>$.getParameterAngleDirectionName(r,s);switch(s.partKind){case"joint":return r=>`${a("Rad",Math.abs(r))} ${t(r)}`;case"segment":return r=>`${a("Rad",Math.abs(r))} ${t(r)}`;case"acceleration":return r=>`${a("MetersPerSecondSq",r)} ${t(r)}`;case"angular_velocity":return r=>`${a("RadPerSecond",r)} ${t(r)}`;default:return r=>r.toString()}};exports.degToRad=T;exports.getFormatterForParameter=D;exports.getUnitFormatted=k;exports.getUnitValueFormatted=a;exports.hourMinSecStrToMs=F;exports.inchesToMeters=l;exports.kgToPounds=m;exports.metersToInches=h;exports.msToDurationStr=d;exports.msToHourMinSecStr=p;exports.msToPrettyStr=S;exports.msToTimestampStr=M;exports.poundsToKg=g;exports.radToDeg=i;exports.sToTimestampStr=f;exports.safelyConvertEnum=R;exports.secondsToTimestampStr=P;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as d } from "./services-human-
|
|
1
|
+
import { W as d } from "./services-human-BIz3wOu_.js";
|
|
2
2
|
import { h as a } from "./moment-vendor-DMLRxgRE.js";
|
|
3
3
|
const g = (s) => s * 39.3700787402, f = (s) => s / 39.3700787402, m = (s) => s * 2.20462262185, p = (s) => s / 2.20462262185, u = (s, t = !1) => s == null ? null : t ? s * 180 / Math.PI : Math.round(s * (180 / Math.PI)), M = (s) => s == null ? null : s * (Math.PI / 180), S = (s) => a.duration(s, "ms").humanize({ ss: 1 }), P = (s, t = !1, n = !0) => {
|
|
4
4
|
const r = a.duration(s, "ms"), o = n ? r.minutes().toString().padStart(2, "0") : r.minutes().toString(), e = r.seconds().toString().padStart(2, "0"), i = Math.round(r.milliseconds()).toString().padStart(3, "0");
|
package/dist/utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./utils-cn-FIKrq5Mb.cjs"),e=require("./utils-conversion-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./utils-cn-FIKrq5Mb.cjs"),e=require("./utils-conversion-BYVStK4S.cjs"),s=require("./utils-memo-BJJP2KfI.cjs"),t=require("./utils-parameters-dwKmz1VU.cjs"),r=require("./utils-text-lORqO4uI.cjs");exports.cn=o.cn;exports.degToRad=e.degToRad;exports.getFormatterForParameter=e.getFormatterForParameter;exports.getUnitFormatted=e.getUnitFormatted;exports.getUnitValueFormatted=e.getUnitValueFormatted;exports.hourMinSecStrToMs=e.hourMinSecStrToMs;exports.inchesToMeters=e.inchesToMeters;exports.kgToPounds=e.kgToPounds;exports.metersToInches=e.metersToInches;exports.msToDurationStr=e.msToDurationStr;exports.msToHourMinSecStr=e.msToHourMinSecStr;exports.msToPrettyStr=e.msToPrettyStr;exports.msToTimestampStr=e.msToTimestampStr;exports.poundsToKg=e.poundsToKg;exports.radToDeg=e.radToDeg;exports.sToTimestampStr=e.sToTimestampStr;exports.safelyConvertEnum=e.safelyConvertEnum;exports.secondsToTimestampStr=e.secondsToTimestampStr;exports.memo=s.memo;exports.parameterToThreshold=t.parameterToThreshold;exports.parametersToThresholds=t.parametersToThresholds;exports.thresholdToParameter=t.thresholdToParameter;exports.thresholdsToParameters=t.thresholdsToParameters;exports.capitalizeAll=r.capitalizeAll;exports.pluralize=r.pluralize;
|
package/dist/utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as e } from "./utils-cn-CgdSr4hO.js";
|
|
2
|
-
import { d as o, n as t, j as m, g as T, h as p, i as n, k as d, m as i, a as h, e as l, c, b as S, p as g, r as u, s as f, l as x, f as P } from "./utils-conversion-
|
|
2
|
+
import { d as o, n as t, j as m, g as T, h as p, i as n, k as d, m as i, a as h, e as l, c, b as S, p as g, r as u, s as f, l as x, f as P } from "./utils-conversion-pcEG40AR.js";
|
|
3
3
|
import { m as M } from "./utils-memo-DtXdOqCT.js";
|
|
4
4
|
import { p as k, a as y, t as z, b as D } from "./utils-parameters-DkefNhWo.js";
|
|
5
5
|
import { c as j, p as v } from "./utils-text-CN3zLiZ7.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const q=require("react"),L=require("./other-
|
|
1
|
+
"use strict";const q=require("react"),L=require("./other-Cad4iUZr.cjs");var k=()=>{},m=k;function E(r){return{tag:0,0:r}}function w(r){return{tag:1,0:r}}var S=()=>typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator",T=r=>r;function M(r){return t=>e=>{var n=m;t((o=>{o===0?e(0):o.tag===0?(n=o[0],e(o)):r(o[0])?e(o):n(0)}))}}function C(r){return t=>e=>t((n=>{n===0||n.tag===0?e(n):e(w(r(n[0])))}))}function Y(r){return t=>e=>{var n=[],o=m,s=!1,i=!1;t((u=>{i||(u===0?(i=!0,n.length||e(0)):u.tag===0?o=u[0]:(s=!1,(function(d){var p=m;d((c=>{if(c===0){if(n.length){var v=n.indexOf(p);v>-1&&(n=n.slice()).splice(v,1),n.length||(i?e(0):s||(s=!0,o(0)))}}else c.tag===0?(n.push(p=c[0]),p(0)):n.length&&(e(c),p(0))}))})(r(u[0])),s||(s=!0,o(0))))})),e(E((u=>{if(u===1){i||(i=!0,o(1));for(var a=0,d=n,p=n.length;a<p;a++)d[a](1);n.length=0}else{!i&&!s?(s=!0,o(0)):s=!1;for(var c=0,v=n,x=n.length;c<x;c++)v[c](0)}})))}}function z(r){return Y(T)(r)}function F(r){return z(H(r))}function W(r){return t=>e=>t((n=>{n===0?e(0):n.tag===0?(e(n),r()):e(n)}))}function $(r){var t=[],e=m,n=!1;return o=>{t.push(o),t.length===1&&r((s=>{if(s===0){for(var i=0,u=t,a=t.length;i<a;i++)u[i](0);t.length=0}else if(s.tag===0)e=s[0];else{n=!1;for(var d=0,p=t,c=t.length;d<c;d++)p[d](s)}})),o(E((s=>{if(s===1){var i=t.indexOf(o);i>-1&&(t=t.slice()).splice(i,1),t.length||e(1)}else n||(n=!0,e(0))})))}}function K(r){return t=>e=>{var n=m,o=!1,s=0;t((i=>{o||(i===0?(o=!0,e(0)):i.tag===0?n=i[0]:s++<r?(e(i),!o&&s>=r&&(o=!0,e(0),n(1))):e(i))})),e(E((i=>{i===1&&!o?(o=!0,n(1)):i===0&&!o&&s<r&&n(0)})))}}function B(r){return t=>{var e=r[S()]&&r[S()]()||r,n=!1,o=!1,s=!1,i;t(E((async u=>{if(u===1)n=!0,e.return&&e.return();else if(o)s=!0;else{for(s=o=!0;s&&!n;)if((i=await e.next()).done)n=!0,e.return&&await e.return(),t(0);else try{s=!1,t(w(i.value))}catch(a){if(e.throw)(n=!!(await e.throw(a)).done)&&t(0);else throw a}o=!1}})))}}function G(r){return r[Symbol.asyncIterator]?B(r):t=>{var e=r[Symbol.iterator](),n=!1,o=!1,s=!1,i;t(E((u=>{if(u===1)n=!0,e.return&&e.return();else if(o)s=!0;else{for(s=o=!0;s&&!n;)if((i=e.next()).done)n=!0,e.return&&e.return(),t(0);else try{s=!1,t(w(i.value))}catch(a){if(e.throw)(n=!!e.throw(a).done)&&t(0);else throw a}o=!1}})))}}var H=G;function J(r){return t=>{var e=!1,n=r({next(o){e||t(w(o))},complete(){e||(e=!0,t(0))}});t(E((o=>{o===1&&!e&&(e=!0,n())})))}}function Q(){var r,t;return{source:$(J((e=>(r=e.next,t=e.complete,k)))),next(e){r&&r(e)},complete(){t&&t()}}}function U(r){return new Promise((t=>{var e=m,n;r((o=>{o===0?Promise.resolve(n).then(t):o.tag===0?(e=o[0])(0):(n=o[0],e(0))}))}))}var X=q.useLayoutEffect,D=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Z(r,t){return!!(r===t||D(r)&&D(t))}function ee(r,t){if(r.length!==t.length)return!1;for(var e=0;e<r.length;e++)if(!Z(r[e],t[e]))return!1;return!0}function te(r,t){t===void 0&&(t=ee);var e=null;function n(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];if(e&&e.lastThis===this&&t(o,e.lastArgs))return e.lastResult;var i=r.apply(this,o);return e={lastResult:i,lastArgs:o,lastThis:this},i}return n.clear=function(){e=null},n}function l(r){return"Minified Redux error #"+r+"; visit https://redux.js.org/Errors?code="+r+" for the full message or use the non-minified dev environment for full errors. "}var j=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),I=function(){return Math.random().toString(36).substring(7).split("").join(".")},P={INIT:"@@redux/INIT"+I(),REPLACE:"@@redux/REPLACE"+I()};function re(r){if(typeof r!="object"||r===null)return!1;for(var t=r;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(r)===t}function ne(r){if(r===void 0)return"undefined";if(r===null)return"null";var t=typeof r;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(r))return"array";if(ie(r))return"date";if(se(r))return"error";var e=oe(r);switch(e){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return e}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")}function oe(r){return typeof r.constructor=="function"?r.constructor.name:null}function se(r){return r instanceof Error||typeof r.message=="string"&&r.constructor&&typeof r.constructor.stackTraceLimit=="number"}function ie(r){return r instanceof Date?!0:typeof r.toDateString=="function"&&typeof r.getDate=="function"&&typeof r.setDate=="function"}function y(r){var t=typeof r;return process.env.NODE_ENV!=="production"&&(t=ne(r)),t}function V(r,t,e){var n;if(typeof t=="function"&&typeof e=="function"||typeof e=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?l(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof t=="function"&&typeof e>"u"&&(e=t,t=void 0),typeof e<"u"){if(typeof e!="function")throw new Error(process.env.NODE_ENV==="production"?l(1):"Expected the enhancer to be a function. Instead, received: '"+y(e)+"'");return e(V)(r,t)}if(typeof r!="function")throw new Error(process.env.NODE_ENV==="production"?l(2):"Expected the root reducer to be a function. Instead, received: '"+y(r)+"'");var o=r,s=t,i=[],u=i,a=!1;function d(){u===i&&(u=i.slice())}function p(){if(a)throw new Error(process.env.NODE_ENV==="production"?l(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return s}function c(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?l(4):"Expected the listener to be a function. Instead, received: '"+y(f)+"'");if(a)throw new Error(process.env.NODE_ENV==="production"?l(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var g=!0;return d(),u.push(f),function(){if(g){if(a)throw new Error(process.env.NODE_ENV==="production"?l(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");g=!1,d();var h=u.indexOf(f);u.splice(h,1),i=null}}}function v(f){if(!re(f))throw new Error(process.env.NODE_ENV==="production"?l(7):"Actions must be plain objects. Instead, the actual type was: '"+y(f)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof f.type>"u")throw new Error(process.env.NODE_ENV==="production"?l(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(a)throw new Error(process.env.NODE_ENV==="production"?l(9):"Reducers may not dispatch actions.");try{a=!0,s=o(s,f)}finally{a=!1}for(var g=i=u,b=0;b<g.length;b++){var h=g[b];h()}return f}function x(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?l(10):"Expected the nextReducer to be a function. Instead, received: '"+y(f));o=f,v({type:P.REPLACE})}function R(){var f,g=c;return f={subscribe:function(h){if(typeof h!="object"||h===null)throw new Error(process.env.NODE_ENV==="production"?l(11):"Expected the observer to be an object. Instead, received: '"+y(h)+"'");function N(){h.next&&h.next(p())}N();var _=g(N);return{unsubscribe:_}}},f[j]=function(){return this},f}return v({type:P.INIT}),n={dispatch:v,subscribe:c,getState:p,replaceReducer:x},n[j]=R,n}var O,A;function ue(){return A||(A=1,O=function r(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var n,o,s;if(Array.isArray(t)){if(n=t.length,n!=e.length)return!1;for(o=n;o--!==0;)if(!r(t[o],e[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[o]))return!1;for(o=n;o--!==0;){var i=s[o];if(!r(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}),O}var ae=ue();const fe=L.getDefaultExportFromCjs(ae);exports.createStore=V;exports.equal=fe;exports.filter=M;exports.index=X;exports.makeSubject=Q;exports.map=C;exports.memoizeOne=te;exports.merge=F;exports.onStart=W;exports.take=K;exports.toPromise=U;
|