@seedtactics/insight-client 17.0.4 → 17.0.6

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.
Files changed (69) hide show
  1. package/dist/assets/{index-B0B_a7c8.js → index-BqTNkPt2.js} +1 -1
  2. package/dist/components/station-monitor/StationToolbar.js +2 -1
  3. package/dist/index.html +1 -1
  4. package/docs/client-efficiency.md +158 -291
  5. package/docs/client-engineering.md +29 -36
  6. package/docs/client-launch.md +35 -34
  7. package/docs/client-operations.md +40 -61
  8. package/docs/client-quality.md +32 -47
  9. package/docs/client-sales.md +22 -39
  10. package/docs/client-scanners.md +21 -27
  11. package/docs/client-station-monitor.md +75 -100
  12. package/docs/client-tools-programs.md +30 -59
  13. package/docs/improve-fms.md +55 -121
  14. package/docs/makino.md +10 -11
  15. package/docs/material-quarantine.md +40 -54
  16. package/docs/material-tracking.md +65 -183
  17. package/docs/mazak.md +31 -49
  18. package/docs/niigata.md +61 -89
  19. package/docs/operator-procedures.md +83 -96
  20. package/docs/part-instructions.md +43 -57
  21. package/docs/screenshots/insight-analysis-pallets.png +0 -0
  22. package/docs/screenshots/insight-analysis-part-completed.png +0 -0
  23. package/docs/screenshots/insight-analysis-sankey.png +0 -0
  24. package/docs/screenshots/insight-analysis-station-oee.png +0 -0
  25. package/docs/screenshots/insight-basket-work.png +0 -0
  26. package/docs/screenshots/insight-buffer-occupancy.png +0 -0
  27. package/docs/screenshots/insight-closeout.png +0 -0
  28. package/docs/screenshots/insight-cost-percentages.png +0 -0
  29. package/docs/screenshots/insight-dashboard.png +0 -0
  30. package/docs/screenshots/insight-inspection.png +0 -0
  31. package/docs/screenshots/insight-load-station-details.png +0 -0
  32. package/docs/screenshots/insight-load-station.png +0 -0
  33. package/docs/screenshots/insight-loadcycle-graph.png +0 -0
  34. package/docs/screenshots/insight-machinecycle-graph.png +0 -0
  35. package/docs/screenshots/insight-machinecycle-table.png +0 -0
  36. package/docs/screenshots/insight-machinecycles.png +0 -0
  37. package/docs/screenshots/insight-machinehours.png +0 -0
  38. package/docs/screenshots/insight-machineoutliers.png +0 -0
  39. package/docs/screenshots/insight-monthly-schedules.png +0 -0
  40. package/docs/screenshots/insight-operations-material.png +0 -0
  41. package/docs/screenshots/insight-operations-overview.png +0 -0
  42. package/docs/screenshots/insight-operations-reports.png +0 -0
  43. package/docs/screenshots/insight-part-cost.png +0 -0
  44. package/docs/screenshots/insight-program-report.png +0 -0
  45. package/docs/screenshots/insight-quality-material-details.png +0 -0
  46. package/docs/screenshots/insight-quality-material.png +0 -0
  47. package/docs/screenshots/insight-quality-sankey.png +0 -0
  48. package/docs/screenshots/insight-quality-similar-paths.png +0 -0
  49. package/docs/screenshots/insight-quarantine.png +0 -0
  50. package/docs/screenshots/insight-queue-details.png +0 -0
  51. package/docs/screenshots/insight-queues-jobs-table.png +0 -0
  52. package/docs/screenshots/insight-queues.png +0 -0
  53. package/docs/screenshots/insight-sim-day-usage.png +0 -0
  54. package/docs/screenshots/insight-system-overview.png +0 -0
  55. package/docs/screenshots/insight-tool-replacements.png +0 -0
  56. package/docs/screenshots/insight-tool-report.png +0 -0
  57. package/docs/screenshots/insight-workorder-gantt.png +0 -0
  58. package/docs/screenshots/insight-workorders.png +0 -0
  59. package/docs/security.md +98 -131
  60. package/docs/server-config.md +39 -22
  61. package/docs/server-errors.md +26 -18
  62. package/package.json +1 -1
  63. package/docs/screenshots/insight-all-material.png +0 -0
  64. package/docs/screenshots/insight-choose-analysis-month.png +0 -0
  65. package/docs/screenshots/insight-loadstation-small.jpg +0 -0
  66. package/docs/screenshots/insight-quality-quarantine.png +0 -0
  67. package/docs/screenshots/insight-station-system-overview-buttons.png +0 -0
  68. package/docs/screenshots/insight-station-system-overview.png +0 -0
  69. package/docs/screenshots/insight-toolbar-btns.png +0 -0
@@ -329,7 +329,7 @@ a=extmap-allow-mixed`)!==-1){let n=t.sdp.split(`
329
329
  <thead><tr>`;r+=`<th>Tool</th><th>Machine</th><th>Pocket</th>`,t&&(r+=`<th>Scheduled Use (min)</th><th>Current Use (min)</th><th>Lifetime (min)</th><th>Remaining Life (min)</th>`),n&&(r+=`<th>Scheduled Use (cnt)</th><th>Current Use (cnt)</th><th>Lifetime (cnt)</th><th>Remaining Life (cnt)</th>`),r+=`</tr></thead>
330
330
  <tbody>
331
331
  `;for(let i of e)for(let e of i.machines){if(r+=`<tr><td>${i.toolName}</td><td>${e.machineName}</td><td>${e.pocket}</td>`,t){let t=Q.of(i.parts).sumBy(e=>e.scheduledUseMinutes*e.quantity);r+=`<td>`+t.toFixed(1)+`</td>`,r+=`<td>`+(e.currentUseMinutes?e.currentUseMinutes.toFixed(1):``)+`</td>`,r+=`<td>`+(e.lifetimeMinutes?e.lifetimeMinutes.toFixed(1):``)+`</td>`,r+=`<td>`+(e.remainingMinutes?e.remainingMinutes.toFixed(1):``)+`</td>`}if(n){let t=Q.of(i.parts).sumBy(e=>e.scheduledUseCnt*e.quantity);r+=`<td>`+t.toFixed(1)+`</td>`,r+=`<td>`+(e.currentUseCnt?e.currentUseCnt.toFixed(1):``)+`</td>`,r+=`<td>`+(e.lifetimeCnt?e.lifetimeCnt.toFixed(1):``)+`</td>`,r+=`<td>`+(e.remainingCnt?e.remainingCnt.toFixed(1):``)+`</td>`}r+=`</tr>
332
- `}return r+=`</tbody></table>`,r}function Fae(){let e=_e();return(0,F.useCallback)(()=>{let t=e.get(D3);t&&EA(Pae(t))},[e])}function Iae(e,t,n,r,i){let a=C3(e,!0),o=e.keysToLazySeq().toRMap(e=>[e.operation,e],(e,t)=>t),s=Q.of(r);i!=null&&(s=s.filter(e=>i.has(e.programName)));let c=n?.valuesToLazySeq().flatMap(e=>Q.of(e.procsAndPaths).flatMap(e=>e.paths).flatMap(t=>Q.of(t.stops).collect(n=>{let r=Ak(n.expectedCycleTime);return n.program&&r>0?{program:n.program,plannedMins:r/t.partsPerPallet,start:e.routeStartUTC}:null}))).toOrderedMap(e=>[e.program,e],(e,t)=>e.start>t.start?e:t),l=s.map(e=>{let n=o.get(e.programName);return{programName:e.programName,cellControllerProgramName:e.cellControllerProgramName,comment:e.comment??null,revision:e.revision??null,partName:n?.part??null,statisticalCycleTime:n?t.get(n)??null:null,toolUse:n?a.get(n)??null:null,plannedMins:c?.get(e.programName)?.plannedMins??null}}).toRArray();return{time:new Date,programs:l,hasRevisions:l.some(e=>e.revision!==null),cellNameDifferentFromProgName:l.some(e=>e.cellControllerProgramName!==e.programName)}}var A3=d(`AllPrograms`),j3=d(null),M3=d(e=>e(j3)?.time??null,async(e,t,n)=>{t(j3,{progs:await Qt.getProgramsInCellController(),time:n})}),Lae=d(e=>{if(e(M3)===null)return null;let t=e(A3),n=null;if(t===`ActivePrograms`){let t=e(vk);n=new Set(Q.ofObject(t.jobs).flatMap(([,e])=>e.procsAndPaths).flatMap(e=>e.paths).flatMap(e=>e.stops).filter(e=>e.program!==null&&e.program!==void 0&&e.program!==``).map(e=>e.program??``))}let r=e(j3);return r===null?null:Iae(e(SR),e(Nk),e(KO),r.progs,n)}),N3=d(null),Rae=d(async e=>{let t=e(N3);return t===null?``:t.revision===null?await Qt.getLatestProgramRevisionContent(t.programName):await Qt.getProgramRevisionContent(t.programName,t.revision)}),P3=d(null),F3=new Intl.NumberFormat(`en-US`,{minimumFractionDigits:0,maximumFractionDigits:1}),I3=W(PT,{shouldForwardProp:e=>e.toString()[0]!==`$`})(({theme:e,$noBorderBottom:t,$highlightedRow:n,$noticeRow:r})=>({...t&&{"& > *":{borderBottom:`unset`}},[e.breakpoints.up(`lg`)]:{"& td:not(:last-child), & th:not(:last-child)":{whiteSpace:`nowrap`},"& td:last-child, & th:last-child":{width:`100%`}},backgroundColor:n?`#BDBDBD`:r?`#E0E0E0`:void 0})),L3=W(PT,{shouldForwardProp:e=>e.toString()[0]!==`$`})(({$borderBottom:e})=>({...e&&{"&:not(:last-child)":{borderBottom:`2px solid black`}}})),zae=W(`span`)({fontSize:`x-large`,fontWeight:`lighter`});function R3({min:e,cnt:t,showZero:n,extraMin:r,extraCnt:i}){e??=0,t??=0;let a=r?(0,V.jsx)(X,{title:r,children:(0,V.jsxs)(`span`,{children:[e.toFixed(1),` min`]})}):e.toFixed(1)+` min`,o=i?(0,V.jsx)(X,{title:i,children:(0,V.jsxs)(`span`,{children:[F3.format(t),` cnt`]})}):F3.format(t)+` cnt`;return e===0&&t===0?n?`0`:``:e>0&&t===0?a:e===0&&t>0?o:(0,V.jsxs)(`span`,{children:[a,` `,(0,V.jsx)(zae,{children:`|`}),` `,o]})}function z3({tool:e,machine:t}){let n=t?Q.of(e.parts).filter(e=>e.machines.has(t)):Q.of(e.parts);return(0,V.jsxs)($w,{size:`small`,sx:{width:`auto`,ml:`10em`,mb:`1em`},children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Part`}),(0,V.jsx)(Z,{children:`Program`}),t?void 0:(0,V.jsx)(Z,{children:`Machines`}),(0,V.jsx)(Z,{align:`right`,children:`Quantity`}),(0,V.jsx)(Z,{align:`right`,children:`Use/Cycle (min)`}),(0,V.jsx)(Z,{align:`right`,children:`Use/Cycle (cnt)`})]})}),(0,V.jsx)(oT,{children:n.isEmpty()?(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{colSpan:5,children:`No programs use this machine`})}):n.map((e,n)=>(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.partAndProg.part,size:20}),(0,V.jsx)(`span`,{children:e.partAndProg.part})]})}),(0,V.jsx)(Z,{children:e.partAndProg.operation}),t?void 0:(0,V.jsx)(Z,{children:e.machines.foldl((e,t)=>(e.length>0?e+`, `:``)+t,``)}),(0,V.jsx)(Z,{align:`right`,children:e.quantity}),(0,V.jsx)(Z,{align:`right`,children:e.scheduledUseMinutes>0?e.scheduledUseMinutes.toFixed(1):``}),(0,V.jsx)(Z,{align:`right`,children:e.scheduledUseCnt>0?F3.format(e.scheduledUseCnt):``})]},n))})]})}function Bae({machines:e}){let t=I(O3),n=Q.of(e).toLookupOrderedMap(e=>e.machineName,e=>e.pocket),r=n.size>1&&n.valuesToAscLazySeq().some(e=>e.size>1);return(0,V.jsxs)($w,{size:`small`,sx:{width:`auto`,ml:`10em`,mb:`1em`},children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Machine`}),(0,V.jsx)(Z,{align:`right`,children:`Pocket`}),t?(0,V.jsx)(Z,{children:`Serial`}):void 0,(0,V.jsx)(Z,{align:`right`,children:`Current Use `}),(0,V.jsx)(Z,{align:`right`,children:`Lifetime `}),(0,V.jsx)(Z,{align:`right`,children:`Remaining Use `})]})}),(0,V.jsxs)(oT,{children:[n.toAscLazySeq().map(([e,i])=>(0,V.jsxs)(F.Fragment,{children:[i.valuesToAscLazySeq().map((e,n)=>(0,V.jsxs)(L3,{$borderBottom:r&&i.size===1,children:[(0,V.jsx)(Z,{children:e.machineName}),(0,V.jsx)(Z,{align:`right`,children:e.pocket}),t?(0,V.jsx)(Z,{children:e.serial??``}):void 0,(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:e.currentUseMinutes,cnt:e.currentUseCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:e.lifetimeMinutes,cnt:e.lifetimeCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:e.remainingMinutes,cnt:e.remainingCnt,showZero:!0})})]},n)),n.size>1&&i.size>1?(0,V.jsxs)(L3,{$borderBottom:!0,children:[(0,V.jsx)(Z,{colSpan:t?4:3}),(0,V.jsx)(Z,{children:`Subtotal`}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:i.valuesToAscLazySeq().sumBy(e=>e.remainingMinutes??0),cnt:i.valuesToAscLazySeq().sumBy(e=>e.remainingCnt??0)})})]}):void 0]},e)),(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{colSpan:t?4:3}),(0,V.jsx)(Z,{children:`Total`}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:Q.of(e).sumBy(e=>e.remainingMinutes??0),cnt:Q.of(e).sumBy(e=>e.remainingCnt??0)})})]})]})]})}function Vae(){let e=I(k3);return(0,V.jsxs)(I3,{children:[(0,V.jsx)(Z,{}),(0,V.jsx)(Z,{children:`Tool`}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Expected use for all currently scheduled parts.`+(e?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Scheduled Use`})})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Remaining use summed over all machines which have a scheduled part.`+(e?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Total Remaining Use`})})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Machine with the least remaining use.`+(e?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Smallest Remaining Use`})})}),(0,V.jsx)(Z,{})]})}function Hae({tool:e}){let[t,n]=(0,F.useState)(!1),r=Q.of(e.machines).filter(t=>e.parts.some(e=>e.machines.has(t.machineName))),i=Q.of(e.parts).sumBy(e=>e.scheduledUseMinutes*e.quantity),a=Q.of(e.parts).sumBy(e=>e.scheduledUseCnt*e.quantity),o=r.sumBy(e=>e.remainingMinutes??0),s=r.sumBy(e=>e.remainingCnt??0),c=r.groupBy(e=>e.machineName).map(([e,t])=>({mach:e,remainMin:Q.of(t).sumBy(e=>e.remainingMinutes??0)})).minBy(({remainMin:e})=>e),l=r.groupBy(e=>e.machineName).map(([e,t])=>({mach:e,remainCnt:Q.of(t).sumBy(e=>e.remainingCnt??0)})).minBy(({remainCnt:e})=>e);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(I3,{$noBorderBottom:!0,$highlightedRow:i>o||a>s,$noticeRow:i<=o&&a<=s&&(c&&i>c.remainMin||l&&a>l.remainCnt),children:[(0,V.jsx)(Z,{children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n(!t),children:t?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})}),(0,V.jsx)(Z,{children:e.toolName}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:i,cnt:a})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:o,cnt:s})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:c?.remainMin,cnt:l?.remainCnt,showZero:!0,extraMin:c?.mach,extraCnt:l?.mach})}),(0,V.jsx)(Z,{})]}),(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:6,children:(0,V.jsx)(om,{in:t,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsxs)(J,{sx:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-around`,ml:`1em`,mr:`1em`},children:[(0,V.jsx)(`div`,{children:(0,V.jsx)(Bae,{machines:e.machines})}),e.parts.length===0?void 0:(0,V.jsx)(`div`,{children:(0,V.jsx)(z3,{tool:e})})]})})})})]})}function Uae({machine:e}){let t=I(k3),n=I(O3);return(0,V.jsxs)(I3,{children:[(0,V.jsx)(Z,{}),(0,V.jsxs)(Z,{children:[`Tool In `,e]}),(0,V.jsx)(Z,{align:`right`,children:`Pocket`}),n?(0,V.jsx)(Z,{children:`Serial`}):void 0,(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Expected use for all currently scheduled parts.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Scheduled Use`})})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Current recorded usage of this tool.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Current Use`})})}),(0,V.jsxs)(Z,{align:`right`,children:[(0,V.jsx)(X,{title:`Current configured lifetime of this tool.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Lifetime`})}),` `]}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Lifetime minus current use.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Remaining Use`})})}),(0,V.jsx)(Z,{})]})}function Wae({report:e,pocket:t}){let[n,r]=(0,F.useState)(!1),i=I(O3),a=i?9:8,o=Q.of(e.parts).filter(e=>e.machines.has(t.machineName)).sumBy(e=>e.scheduledUseMinutes*e.quantity),s=Q.of(e.parts).filter(e=>e.machines.has(t.machineName)).sumBy(e=>e.scheduledUseCnt*e.quantity);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(I3,{$noBorderBottom:!0,children:[(0,V.jsx)(Z,{children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>r(!n),children:n?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})}),(0,V.jsx)(Z,{children:e.toolName}),(0,V.jsx)(Z,{align:`right`,children:t.pocket}),i?(0,V.jsx)(Z,{children:t.serial??``}):void 0,(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:o,cnt:s})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:t.currentUseMinutes,cnt:t.currentUseCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:t.lifetimeMinutes,cnt:t.lifetimeCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:t.remainingMinutes,cnt:t.remainingCnt})}),(0,V.jsx)(Z,{})]}),(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:a,children:(0,V.jsx)(om,{in:n,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsx)(z3,{tool:e,machine:t.machineName})})})})]})}var B3=`__Insight__FilterAnyMachine__`,V3=d(null);function Gae(){let e=I(V3),t=I(D3);return t===null?(0,V.jsx)(`div`,{}):(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(ST,{children:e===null?(0,V.jsx)(Vae,{}):(0,V.jsx)(Uae,{machine:e})}),(0,V.jsx)(oT,{children:t.map(t=>e===null?(0,V.jsx)(Hae,{tool:t},t.toolName):(0,V.jsx)(F.Fragment,{children:t.machines.filter(t=>t.machineName===e).map(e=>(0,V.jsx)(Wae,{report:t,pocket:e},e.pocket))},t.toolName))})]})}function Kae(){let[e,t]=R(V3),[n,r]=R(Mae),[i,a]=(0,F.useState)(!1),o=I(Nae),s=Fae(),c=IL();function l(){a(!0),r(new Date).catch(console.log).finally(()=>a(!1))}return c?(0,V.jsx)(`div`,{}):n===null?(0,V.jsx)(`main`,{style:{margin:`2em`,display:`flex`,justifyContent:`center`},children:(0,V.jsx)(tb,{color:`secondary`,size:`large`,variant:`extended`,style:{margin:`2em`},onClick:l,disabled:i,children:(0,V.jsxs)(V.Fragment,{children:[i?(0,V.jsx)(Sh,{size:10,style:{marginRight:`1em`}}):(0,V.jsx)(_E,{fontSize:`inherit`,style:{marginRight:`1em`}}),`Load Tools`]})})}):(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(X,{title:`Refresh Tools`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{onClick:l,disabled:i,size:`small`,children:i?(0,V.jsx)(Sh,{size:10}):(0,V.jsx)(_E,{fontSize:`inherit`})})})}),(0,V.jsxs)(`span`,{style:{marginLeft:`1em`},children:[`Tools from `,(0,V.jsx)(sB,{date:n})]}),(0,V.jsx)(`div`,{style:{flexGrow:`1`}}),(0,V.jsx)(db,{size:`small`,children:(0,V.jsxs)(fC,{autoWidth:!0,displayEmpty:!0,value:e??B3,style:{marginLeft:`1em`},onChange:e=>{e.target.value===B3?t(null):t(e.target.value)},children:[(0,V.jsx)(sS,{value:B3,children:(0,V.jsx)(`em`,{children:`All Machines`})}),o.map(e=>(0,V.jsx)(sS,{value:e,children:(0,V.jsx)(`div`,{style:{display:`flex`,alignItems:`center`},children:(0,V.jsx)(`span`,{style:{marginRight:`1em`},children:e})})},e))]})}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:s,size:`large`,children:(0,V.jsx)(lE,{})})})]})}function H3(){return LL(`Tool Report`),(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsx)(Kae,{}),(0,V.jsx)(`main`,{children:(0,V.jsx)(oW,{children:(0,V.jsx)(Gae,{})})})]})}var qae=W(PT)(()=>({"& > *":{borderBottom:`unset`}}));function U3(e){if(e.length===0)return``;let t=e.lastIndexOf(`\\`);return t>=0&&t<e.length-2?e.substr(t+1):e}var Jae=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2});function Yae(e){let[t,n]=(0,F.useState)(!1),r=L(N3),i=L(P3),a=8+ +!!e.showCellCtrlCol+ +!!e.showRevCol,o=e.program.toolUse!==null&&e.program.toolUse.tools.length>0&&Q.of(e.program.toolUse.tools).some(e=>e.cycleUsageMinutes>0),s=e.program.toolUse!==null&&e.program.toolUse.tools.length>0&&Q.of(e.program.toolUse.tools).some(e=>e.cycleUsageCnt>0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qae,{children:[(0,V.jsx)(Z,{children:e.program.toolUse===null||e.program.toolUse.tools.length===0?void 0:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n(!t),children:t?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})}),(0,V.jsx)(Z,{children:U3(e.program.programName)}),e.showCellCtrlCol?(0,V.jsx)(Z,{children:e.program.cellControllerProgramName}):void 0,(0,V.jsx)(Z,{children:e.program.partName===null?void 0:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.program.partName,size:20}),(0,V.jsx)(`span`,{children:e.program.partName})]})}),(0,V.jsx)(Z,{children:e.program.comment??``}),e.showRevCol?(0,V.jsx)(Z,{children:e.program.revision===null?``:e.program.revision.toFixed()}):void 0,(0,V.jsx)(Z,{align:`right`,children:e.program.statisticalCycleTime===null?``:e.program.statisticalCycleTime.medianMinutesForSingleMat.toFixed(2)}),(0,V.jsx)(Z,{align:`right`,children:e.program.statisticalCycleTime===null?``:e.program.statisticalCycleTime.MAD_aboveMinutes.toFixed(2)}),(0,V.jsx)(Z,{align:`right`,children:e.program.statisticalCycleTime===null?``:e.program.statisticalCycleTime.MAD_belowMinutes.toFixed(2)}),(0,V.jsx)(Z,{align:`right`,children:e.program.plannedMins===null?``:Jae.format(e.program.plannedMins)}),(0,V.jsxs)(Z,{children:[(0,V.jsx)(X,{title:`Load Program Content`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>r(e.program),children:(0,V.jsx)(eE,{})})}),e.program.revision===null?void 0:(0,V.jsx)(X,{title:`Revision History`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>i(e.program),children:(0,V.jsx)(rre,{})})})]})]}),(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:a,children:(0,V.jsx)(om,{in:t,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsx)(J,{sx:{mr:`1em`,ml:`3em`},children:e.program.toolUse===null||e.program.toolUse.tools.length===0?void 0:(0,V.jsxs)($w,{size:`small`,sx:{width:`auto`,ml:`10em`,mr:`1em`},children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Tool`}),o?(0,V.jsx)(Z,{align:`right`,children:`Estimated Usage (min)`}):void 0,s?(0,V.jsx)(Z,{align:`right`,children:`Estimated Usage (count)`}):void 0]})}),(0,V.jsx)(oT,{children:Q.of(e.program.toolUse.tools).map((e,t)=>(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:e.toolName}),o?(0,V.jsx)(Z,{align:`right`,children:e.cycleUsageMinutes===0?``:e.cycleUsageMinutes.toFixed(1)}):void 0,s?(0,V.jsx)(Z,{align:`right`,children:e.cycleUsageCnt===0?``:e.cycleUsageCnt.toFixed(1)}):void 0]},t))})]})})})})})]})}function Xae(){let e=I(Lae),[t,n]=(0,F.useState)(`ProgramName`),[r,i]=(0,F.useState)(`asc`);if(e===null)return(0,V.jsx)(`div`,{});let a=Q.of(e.programs).sortWith((e,n)=>{let i=0;switch(t){case`ProgramName`:i=U3(e.programName).localeCompare(U3(n.programName));break;case`CellProgName`:i=e.cellControllerProgramName.localeCompare(n.cellControllerProgramName);break;case`Comment`:i=e.comment===null&&n.comment===null?0:e.comment===null?1:n.comment===null?-1:e.comment.localeCompare(n.comment);break;case`Revision`:i=e.revision===null&&n.revision===null?0:e.revision===null?1:n.revision===null?-1:e.revision-n.revision;break;case`PartName`:i=e.partName===null&&n.partName===null?0:e.partName===null?1:n.partName===null?-1:e.partName.localeCompare(n.partName);break;case`MedianTime`:i=e.statisticalCycleTime===null&&n.statisticalCycleTime===null?0:e.statisticalCycleTime===null?1:n.statisticalCycleTime===null?-1:e.statisticalCycleTime.medianMinutesForSingleMat-n.statisticalCycleTime.medianMinutesForSingleMat;break;case`DeviationAbove`:i=e.statisticalCycleTime===null&&n.statisticalCycleTime===null?0:e.statisticalCycleTime===null?1:n.statisticalCycleTime===null?-1:e.statisticalCycleTime.MAD_aboveMinutes-n.statisticalCycleTime.MAD_aboveMinutes;break;case`DeviationBelow`:i=e.statisticalCycleTime===null&&n.statisticalCycleTime===null?0:e.statisticalCycleTime===null?1:n.statisticalCycleTime===null?-1:e.statisticalCycleTime.MAD_belowMinutes-n.statisticalCycleTime.MAD_belowMinutes;break;case`Planned`:i=e.plannedMins===null&&n.plannedMins===null?0:e.plannedMins===null?1:n.plannedMins===null?-1:e.plannedMins-n.plannedMins}return i===0?0:i<0&&r===`asc`||i>0&&r===`desc`?-1:1});function o(e){e===t?i(r===`asc`?`desc`:`asc`):n(e)}return(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{}),(0,V.jsx)(Z,{sortDirection:t===`ProgramName`&&r,children:(0,V.jsx)(VT,{active:t===`ProgramName`,direction:r,onClick:()=>o(`ProgramName`),children:`Program Name`})}),e.cellNameDifferentFromProgName?(0,V.jsx)(Z,{sortDirection:t===`CellProgName`&&r,children:(0,V.jsx)(VT,{active:t===`CellProgName`,direction:r,onClick:()=>o(`CellProgName`),children:`Cell Controller Program`})}):void 0,(0,V.jsx)(Z,{sortDirection:t===`PartName`&&r,children:(0,V.jsx)(VT,{active:t===`PartName`,direction:r,onClick:()=>o(`PartName`),children:`Part`})}),(0,V.jsx)(Z,{sortDirection:t===`Comment`&&r,children:(0,V.jsx)(VT,{active:t===`Comment`,direction:r,onClick:()=>o(`Comment`),children:`Comment`})}),e.hasRevisions?(0,V.jsx)(Z,{sortDirection:t===`Revision`&&r,children:(0,V.jsx)(VT,{active:t===`Revision`,direction:r,onClick:()=>o(`Revision`),children:`Revision`})}):void 0,(0,V.jsx)(Z,{sortDirection:t===`MedianTime`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`MedianTime`,direction:r,onClick:()=>o(`MedianTime`),children:`Median Time / Material (min)`})}),(0,V.jsx)(Z,{sortDirection:t===`DeviationAbove`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`DeviationAbove`,direction:r,onClick:()=>o(`DeviationAbove`),children:`Deviation Above Median`})}),(0,V.jsx)(Z,{sortDirection:t===`DeviationBelow`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`DeviationBelow`,direction:r,onClick:()=>o(`DeviationBelow`),children:`Deviation Below Median`})}),(0,V.jsx)(Z,{sortDirection:t===`Planned`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`Planned`,direction:r,onClick:()=>o(`Planned`),children:`Planned Time (min)`})}),(0,V.jsx)(Z,{})]})}),(0,V.jsx)(oT,{children:Q.of(a).map((t,n)=>(0,V.jsx)(Yae,{program:t,showCellCtrlCol:e.cellNameDifferentFromProgName,showRevCol:e.hasRevisions},n))})]})}function W3(){let e=I(Rae),[t,n]=(0,F.useState)(null),r=(0,F.useMemo)(()=>new Worker(new URL(`/assets/ProgramHighlight-C5uXGNDz.js`,``+import.meta.url),{type:`module`}),[]);return(0,F.useEffect)(()=>{let e=e=>n(e),t=t=>e(t.data);return r.addEventListener(`message`,t),()=>{e=()=>null,r.removeEventListener(`message`,t),r.terminate(),n(null)}},[r]),(0,F.useEffect)(()=>{e&&e!==``&&r.postMessage(e,[])},[e,r]),(0,V.jsx)(`pre`,{children:t===null?(0,V.jsx)(`code`,{className:`gcode`,children:e}):(0,V.jsx)(`code`,{className:`gcode`,dangerouslySetInnerHTML:{__html:t}})})}function Zae(){let[e,t]=R(N3),n=I(P3);return(0,V.jsxs)(jy,{open:e!==null&&n===null,onClose:()=>t(null),maxWidth:`lg`,children:[(0,V.jsx)(Wy,{children:e?.partName?(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.partName}),(0,V.jsxs)(`div`,{style:{marginLeft:`10px`,marginRight:`3em`},children:[e?.programName??`Program`,` `,e?.revision?` rev`+e.revision.toFixed():``,` `,(0,V.jsxs)(q,{variant:`subtitle1`,component:`span`,children:[`(`,e.partName,`)`]})]})]}):(0,V.jsxs)(V.Fragment,{children:[e?.programName??`Program`,` `,e?.revision?` rev`+e.revision.toFixed():``]})}),(0,V.jsx)(Vy,{children:e===null||n!==null?(0,V.jsx)(`div`,{}):(0,V.jsx)(oW,{children:(0,V.jsx)(W3,{})})}),(0,V.jsx)(Fy,{children:(0,V.jsx)(Y,{onClick:()=>t(null),children:`Close`})})]})}var G3=10;function Qae(e){let t=I(P3),n=L(N3);return(0,V.jsxs)($w,{children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Revision`}),(0,V.jsx)(Z,{children:`Comment`}),(0,V.jsx)(Z,{children:`Cell Controller Program`}),(0,V.jsx)(Z,{})]})}),(0,V.jsx)(oT,{children:e.loading?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{colSpan:4,children:(0,V.jsx)(Sh,{})})}),Q.ofRange(0,9).map(e=>(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{colSpan:4})},e))]}):Q.of(e.revisions).drop(e.page*G3).take(G3).map(e=>(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:e.revision}),(0,V.jsx)(Z,{children:e.comment??``}),(0,V.jsx)(Z,{children:e.cellControllerProgramName??``}),(0,V.jsx)(Z,{children:(0,V.jsx)(X,{title:`Load Program Content`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n({...e,partName:t?.partName??null}),children:(0,V.jsx)(eE,{})})})})]},e.revision))})]})}function $ae(){let[e,t]=R(P3),[n,r]=R(N3),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)({page:0,hasMore:!1}),[c,l]=(0,F.useState)(0),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(null);(0,F.useEffect)(()=>{(async()=>{if(e===null)a(null),l(0),s({page:0,hasMore:!1});else if(e!==null&&i===null){d(!0),p(null);try{let t=await Qt.getProgramRevisionsInDescendingOrderOfRevision(e.programName,G3,void 0);a(t),s({page:0,hasMore:t.length===G3})}catch(e){p(e instanceof Error?e:String(e))}finally{d(!1)}}})().catch(console.error)},[e,i]);function m(){if(c<o.page)l(c+1);else if(o.hasMore&&e!==null&&i!==null&&i.length>0){d(!0),p(null);let t=i[i.length-1];Qt.getProgramRevisionsInDescendingOrderOfRevision(e.programName,G3,t?t.revision-1:void 0).then(e=>{a(t=>t===null?e:t.concat(e)),s({page:c+1,hasMore:e.length===G3}),l(c+1)}).catch(p).finally(()=>d(!1))}}return(0,V.jsxs)(jy,{open:e!==null,onClose:()=>t(null),maxWidth:`lg`,children:[(0,V.jsx)(Wy,{children:e?.partName?(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.partName}),(0,V.jsxs)(`div`,{style:{marginLeft:`10px`,marginRight:`3em`},children:[e.programName??`Program`,` `,(0,V.jsxs)(q,{variant:`subtitle1`,component:`span`,children:[`(`,e.partName,`)`]})]})]}):(0,V.jsx)(V.Fragment,{children:e?.programName??`Program`})}),(0,V.jsxs)(Vy,{children:[f===null?void 0:(0,V.jsx)(jv,{children:(0,V.jsx)(Fv,{children:typeof f==`string`?f:f.message})}),n===null?i===null?u?(0,V.jsx)(Sh,{}):void 0:(0,V.jsx)(Qae,{page:c,revisions:i,loading:u}):(0,V.jsx)(oW,{children:(0,V.jsx)(W3,{})})]}),(0,V.jsx)(Fy,{children:(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,width:`100%`},children:[n===null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{title:`Latest Revisions`,children:(0,V.jsx)(`span`,{children:(0,V.jsx)(Oh,{onClick:()=>l(0),disabled:u||c===0,size:`large`,children:(0,V.jsx)(oE,{})})})}),(0,V.jsx)(X,{title:`Previous Page`,children:(0,V.jsx)(`span`,{children:(0,V.jsx)(Oh,{onClick:()=>l(c-1),disabled:u||c===0,size:`large`,children:(0,V.jsx)(dE,{})})})}),(0,V.jsx)(X,{title:`Next Page`,children:(0,V.jsx)(`span`,{children:(0,V.jsx)(Oh,{onClick:()=>m(),disabled:u||c===o.page&&!o.hasMore,size:`large`,children:(0,V.jsx)(fE,{})})})})]}):void 0,(0,V.jsx)(`div`,{style:{flexGrow:1}}),n===null?void 0:(0,V.jsx)(Y,{onClick:()=>r(null),children:`Back to History`}),(0,V.jsx)(Y,{onClick:()=>t(null),children:`Close`})]})})]})}function eoe(){let[e,t]=R(M3),[n,r]=(0,F.useState)(!1),i=IL(),[a,o]=R(A3);function s(){r(!0),t(new Date).catch(console.log).finally(()=>r(!1))}return i?(0,V.jsx)(`div`,{}):e===null?(0,V.jsx)(`main`,{style:{margin:`2em`,display:`flex`,justifyContent:`center`},children:(0,V.jsx)(tb,{color:`secondary`,size:`large`,variant:`extended`,style:{margin:`2em`},onClick:s,disabled:n,children:(0,V.jsxs)(V.Fragment,{children:[n?(0,V.jsx)(Sh,{size:10,style:{marginRight:`1em`}}):(0,V.jsx)(_E,{fontSize:`inherit`,style:{marginRight:`1em`}}),`Load Programs`]})})}):(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(X,{title:`Refresh Programs`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{onClick:s,disabled:n,size:`small`,children:n?(0,V.jsx)(Sh,{size:10}):(0,V.jsx)(_E,{fontSize:`inherit`})})})}),(0,V.jsxs)(`span`,{style:{marginLeft:`1em`},children:[`Programs from `,(0,V.jsx)(sB,{date:e})]}),(0,V.jsx)(`div`,{style:{flexGrow:1}}),(0,V.jsx)(db,{size:`small`,children:(0,V.jsxs)(fC,{autoWidth:!0,value:a,onChange:e=>o(e.target.value),children:[(0,V.jsx)(sS,{value:`AllPrograms`,children:`All Programs`},`AllPrograms`),(0,V.jsx)(sS,{value:`ActivePrograms`,children:`Active Programs`},`ActivePrograms`)]})})]})}function K3(){return LL(`Programs`),(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsx)(eoe,{}),(0,V.jsx)(`main`,{children:(0,V.jsx)(oW,{children:(0,V.jsx)(Xae,{})})}),(0,V.jsx)(Zae,{}),(0,V.jsx)($ae,{})]})}var q3=[{id:0,label:`Date`,numeric:!1,getDisplay:e=>e.routeStartTime.toLocaleString(),getForSort:e=>e.routeStartTime.getTime(),getForExport:e=>e.routeStartTime.toISOString()},{id:1,label:`Part`,numeric:!1,getDisplay:e=>e.partName},{id:2,label:`Scheduled`,numeric:!0,getDisplay:e=>e.scheduledQty.toString(),getForSort:e=>e.scheduledQty},{id:3,label:`Removed`,numeric:!0,getDisplay:e=>e.decrementedQty.toString(),getForSort:e=>e.decrementedQty},{id:4,label:`Completed`,numeric:!0,getDisplay:e=>e.completedQty.toString()}];function toe({job:e}){let[t,n]=(0,F.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(xZ,{children:[q3.map(t=>(0,V.jsx)(Z,{align:t.numeric?`right`:`left`,children:t.id===1?(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(J,{sx:{mr:`0.2em`},children:(0,V.jsx)(yW,{part:e.partName,size:25})}),(0,V.jsx)(`div`,{children:e.partName})]}):t.getDisplay(e)},t.id)),(0,V.jsx)(Z,{children:(0,V.jsx)(X,{title:`Show Details`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n(!t),children:t?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})})})]}),(0,V.jsx)(SZ,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:q3.length+1,children:(0,V.jsx)(om,{in:t,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsx)(nY,{job:e.inProcJob?e.inProcJob:e.historicJob,checkAnalysisMonth:!0})})})})]})}function noe(){let e=I(sz),t=e2(),n=$0(e),r=t2(0,q3),i=I(e.type===`Last30`?gR:vR),a=I(e.type===`Last30`?KO:XO),o=(0,F.useMemo)(()=>PJ(n.zoomRange,i.matsById,a,null),[n,i.matsById,a]),s=(0,F.useMemo)(()=>Q.of(o).sortBy(r.sortOn).drop(t.page*t.rowsPerPage).take(t.rowsPerPage),[o,r,t]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(K0,{columns:q3,sort:r,showDetailsCol:!0,copyToClipboardRows:o}),(0,V.jsx)(oT,{children:s.map((e,t)=>(0,V.jsx)(toe,{job:e},e.historicJob?.unique??e.inProcJob?.unique??t))})]}),(0,V.jsx)(Z0,{tpage:t,zoom:n.zoom,count:o.length})]})}function roe(){return LL(`Scheduled Jobs`),(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(`main`,{style:{padding:`24px`},children:(0,V.jsx)(noe,{})})})}function ioe(){LL(`Quality`);let e=I(sz),t=I(e.type===`Last30`?fR:Zie),n=e.type===`Last30`?`Last30Days`:`ZoomIntoRange`,r=e.type===`Last30`?[AE(YE(),-29),AE(YE(),1)]:[e.month,jE(e.month,1)];return(0,V.jsx)(y2,{subtitle:`Inspection decisions grouped by path`,inspectionlogs:t,zoomType:n,default_date_range:r})}var aoe={display:`flex`,backgroundColor:`#E0E0E0`,paddingLeft:`24px`,paddingRight:`24px`,paddingBottom:`4px`,height:`2.5em`,alignItems:`flex-end`},ooe={display:`flex`,alignSelf:`center`,alignItems:`flex-end`},J3=`@@all_inspection_display@@`,Y3=`@@recent_completed_material@@`;function X3(e){return typeof e==`string`?e.split(`,`):e}function soe(){let[e,t]=R(LJ);return(0,V.jsx)(hb,{control:(0,V.jsx)(Jv,{size:`small`,checked:e,onChange:e=>t(e.target.checked)}),label:`Hide Non-Loading Material`,sx:{pl:2,pr:2}})}function Z3(){let[e,t]=R(FL),n=I(KL),r=Q.of(Object.keys(I(vk).queues)).toSortedArray(e=>e),i=I(Dr),a=qT(Xd().breakpoints.down(`md`));function o(n){let r=parseFloat(n);!isNaN(r)&&isFinite(r)&&(e.route===$.Station_LoadMonitor?t({route:$.Station_LoadMonitor,loadNum:r,queues:e.queues,completed:e.completed}):t({route:$.Station_LoadMonitor,loadNum:r,queues:[],completed:!1}))}function s(e){t(e===J3?{route:$.Station_InspectionMonitor}:{route:$.Station_InspectionMonitorWithType,inspType:e})}function c(n){let r=n.includes(Y3);n=n.filter(e=>e!==Y3).slice(0,2),e.route===$.Station_LoadMonitor?t({route:$.Station_LoadMonitor,loadNum:e.loadNum,queues:n,completed:r}):t({route:$.Station_LoadMonitor,loadNum:1,queues:n,completed:r})}function l(e){t({route:$.Station_Queues,queues:e})}let u=`LoadUnload`,d=1,f=null,p=[];switch(e.route){case $.Station_LoadMonitor:u=`LoadUnload`,d=e.loadNum,p=e.queues,e.completed&&(p=p.concat(Y3));break;case $.Station_InspectionMonitor:u=`Inspection`,f=``;break;case $.Station_InspectionMonitorWithType:u=`Inspection`,f=e.inspType;break;case $.Station_Queues:u=`Queues`,p=e.queues;break;case $.Station_Closeout:u=`CloseOut`;break;default:u=`AllMaterial`}return(0,V.jsxs)(J,{component:`nav`,sx:a?aoe:ooe,children:[u===`LoadUnload`?i.loadStationNames&&Object.keys(i.loadStationNames).length>0?(0,V.jsx)(fC,{value:d,onChange:e=>o(e.target.value.toString()),variant:`standard`,style:{marginLeft:`1em`,minWidth:`8em`},children:Q.of(Object.entries(i.loadStationNames)).sortBy(([e])=>parseInt(e)).map(([e,t])=>(0,V.jsx)(sS,{value:parseInt(e),children:t},e))},`loadnumselect`):(0,V.jsx)(Rb,{type:`number`,placeholder:`Load Station Number`,value:d,onChange:e=>o(e.target.value),style:{width:`3em`,marginLeft:`1em`}},`loadnumselect`):void 0,u===`Inspection`?(0,V.jsxs)(fC,{value:f||J3,onChange:e=>s(e.target.value),variant:`standard`,style:{marginLeft:`1em`},children:[(0,V.jsx)(sS,{value:J3,children:(0,V.jsx)(`em`,{children:`All`})},J3),Q.of(n).sortBy(e=>e).map(e=>(0,V.jsx)(sS,{value:e,children:e},e))]},`inspselect`):void 0,u===`LoadUnload`?(0,V.jsxs)(db,{style:{marginLeft:`1em`},children:[p.length===0?(0,V.jsx)(`label`,{style:{position:`absolute`,top:`10px`,left:0,color:`rgba(0,0,0,0.54)`,fontSize:`0.9rem`},children:`Display queue(s)`}):void 0,(0,V.jsxs)(fC,{multiple:!0,displayEmpty:!0,variant:`standard`,value:p,inputProps:{id:`queueselect`},style:{minWidth:`10em`,marginTop:`0`},onChange:e=>c(X3(e.target.value)),children:[r.map((e,t)=>(0,V.jsx)(sS,{value:e,children:e},t)),(0,V.jsx)(sS,{value:Y3,children:(0,V.jsx)(`i`,{children:`Completed`})}),(0,V.jsx)(Xy,{}),(0,V.jsx)(soe,{})]})]}):void 0,u===`Queues`?(0,V.jsxs)(db,{style:{marginLeft:`1em`,minWidth:`10em`},children:[p.length===0?(0,V.jsx)(`label`,{style:{position:`absolute`,top:`10px`,left:0,color:`rgba(0,0,0,0.54)`,fontSize:`0.9rem`},children:`Select queue(s)`}):void 0,(0,V.jsx)(fC,{multiple:!0,displayEmpty:!0,variant:`standard`,value:p,inputProps:{id:`queueselect`},style:{marginTop:`0`},onChange:e=>l(X3(e.target.value)),children:r.map((e,t)=>(0,V.jsx)(sS,{value:e,children:e},t))})]}):void 0]})}function Q3(){let e=qT(Xd().breakpoints.down(`md`));return(0,V.jsx)(J,{sx:{display:`flex`,alignItems:`center`,height:`100%`,bgcolor:e?`#E0E0E0`:void 0},children:(0,V.jsx)(I4,{full:e})})}var $3=sk(`shift-starts`,[[1,360],[2,840],[3,1320]]),e6=d(e=>new Map(e($3)),(e,t,n)=>{let r=new Map(e($3));n(r),t($3,Array.from(r.entries()))});function t6(e){let t=I(e6);return(0,F.useMemo)(()=>{let n=[];for(let e=1;e<=3;e++){let r=t.get(e);r!==void 0&&(n.length>=1&&n[n.length-1]>=r||n.push(r))}if(n.length===0)return[{start:e,end:AE(e,1)}];let r=RE(AE(e,1),n[0]),i=[];for(let t=0;t<n.length;t++)i.push({start:RE(e,n[t]),end:t===n.length-1?r:RE(e,n[t+1])});return i},[t,e])}function coe(e){let[t,n]=e.split(`:`);return parseInt(t,10)*60+parseInt(n,10)}function loe(e){let t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,`0`)}:${n.toString().padStart(2,`0`)}`}function uoe(e,t){let n=t.get(e);if(n===void 0)return!1;if(e===1){let e=t.get(2)??t.get(3);return e!==void 0&&e<=n}if(e===2){let e=t.get(1),r=t.get(3);return e!==void 0&&e>=n||r!==void 0&&r<=n}if(e===3){let e=t.get(2)??t.get(1);return e!==void 0&&e>=n}return!1}function n6({shiftNum:e}){let[t,n]=R(e6),r=t.get(e);return(0,V.jsx)(GT,{type:`time`,label:`Shift ${e} Start`,error:uoe(e,t),value:r===void 0?``:loe(r),onChange:t=>{let r=t.target.value;n(r===``?t=>t.delete(e):t=>t.set(e,coe(r)))},variant:`standard`,size:`small`,slotProps:{inputLabel:{shrink:!0},input:e===1?void 0:{endAdornment:(0,V.jsx)(X,{title:`Clear/Disable Shift`,children:(0,V.jsx)($m,{sx:{mb:`4px`},onClick:()=>n(t=>t.delete(e)),children:(0,V.jsx)($T,{fontSize:`small`})})})}}})}function doe(){return(0,V.jsxs)(tw,{direction:`row`,spacing:2,children:[(0,V.jsx)(n6,{shiftNum:1}),(0,V.jsx)(n6,{shiftNum:2}),(0,V.jsx)(n6,{shiftNum:3})]})}function r6(e,t){return n=>{let r=e(n);for(let e=0;e<t.length;e++){let i=t[e];if(r>=i.start&&r<i.end)return{val:n,shift:e}}return null}}function foe(e,t){return Q.of(e).filter(e=>e.finalProcess).collect(r6(e=>e.completeTime,t)).toLookupOrderedMap(e=>e.val.partName,e=>e.shift,e=>e.val.quantity,(e,t)=>e+t)}function poe(e,t){return e.valuesToLazySeq().filter(e=>Kk(e)&&e.operation===`UNLOAD`&&Q.of(e.material).some(e=>e.proc===e.numproc)).collect(r6(e=>e.endTime,t)).toLookupOrderedMap(e=>e.val.part,e=>e.shift,e=>Q.of(e.val.material).sumBy(e=>+(e.proc===e.numproc)),(e,t)=>e+t)}function moe(e){let t=I(sA),n=I(rR),r=t6(e);return(0,F.useMemo)(()=>{let e=foe(n,r),i=poe(t,r);return e.mapValues(e=>({planned:e})).adjust(i,(e,t)=>e?{...e,completed:t}:{completed:t}).toAscLazySeq().map(([e,{planned:t,completed:n}])=>({part:e,planned:t??zO.empty(),completed:n??zO.empty()})).toRArray()},[t,n,r])}var hoe=new Intl.DateTimeFormat(void 0,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`});function goe({row:e}){return(0,V.jsxs)(tw,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.part,size:25}),(0,V.jsx)(`span`,{children:e.part})]})}function _oe(e){let t=t6(e).length;return(0,F.useMemo)(()=>{let e=[{id:0,numeric:!1,label:`Part`,getDisplay:e=>e.part,getForTotal:()=>0,Cell:goe},{id:1,numeric:!0,label:`Shift 1 Planned`,getDisplay:e=>e.planned.get(0)?.toString()??``,getForSort:e=>e.planned.get(0)??0,getForTotal:e=>e.planned.get(0)??0},{id:4,numeric:!0,label:`Shift 1 Completed`,getDisplay:e=>e.completed.get(0)?.toString()??``,getForSort:e=>e.completed.get(0)??0,getForTotal:e=>e.completed.get(0)??0}];return t>=2&&(e.push({id:2,numeric:!0,label:`Shift 2 Planned`,getDisplay:e=>e.planned.get(1)?.toString()??``,getForSort:e=>e.planned.get(1)??0,getForTotal:e=>e.planned.get(1)??0}),e.push({id:5,numeric:!0,label:`Shift 2 Completed`,getDisplay:e=>e.completed.get(1)?.toString()??``,getForSort:e=>e.completed.get(1)??0,getForTotal:e=>e.completed.get(1)??0})),t===3&&(e.push({id:3,numeric:!0,label:`Shift 3 Planned`,getDisplay:e=>e.planned.get(2)?.toString()??``,getForSort:e=>e.planned.get(2)??0,getForTotal:e=>e.planned.get(2)??0}),e.push({id:6,numeric:!0,label:`Shift 3 Completed`,getDisplay:e=>e.completed.get(2)?.toString()??``,getForSort:e=>e.completed.get(2)??0,getForTotal:e=>e.completed.get(2)??0})),e},[t])}function voe({columns:e,rows:t}){return(0,V.jsx)(PT,{children:e.map(e=>(0,V.jsx)(Z,{align:e.numeric?`right`:`left`,children:e.id===0?`Total`:Q.of(t).sumBy(e.getForTotal)},e.id))})}var yoe=(0,F.memo)(function({columns:e,rows:t}){let n=t2(0,e);return(0,V.jsx)(J,{sx:{overflowX:`auto`},children:(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(K0,{columns:e,sort:n,showDetailsCol:!1}),(0,V.jsx)(Q0,{columns:e,pageData:Q.of(t).toSortedArray(n.sortOn,e=>e.part)}),(0,V.jsx)(gT,{children:(0,V.jsx)(voe,{columns:e,rows:t})})]})})});function boe({day:e,setDay:t}){let n=YE();return(0,V.jsxs)(tw,{direction:`row`,spacing:2,sx:{alignItems:`center`},children:[(0,V.jsx)(X,{title:`Previous Day`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{disabled:e<=AE(n,-28),onClick:()=>t(e=>AE(e,-1)),children:(0,V.jsx)(SE,{})})})}),(0,V.jsx)(q,{sx:{minWidth:`14em`,textAlign:`center`},children:hoe.format(e)}),(0,V.jsx)(X,{title:`Next Day`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{disabled:e>=n,onClick:()=>t(e=>AE(e,1)),children:(0,V.jsx)(xE,{})})})})]})}var xoe=`"shifts day export" auto / 1fr 1fr 1fr`,Soe=`"shifts export" auto
332
+ `}return r+=`</tbody></table>`,r}function Fae(){let e=_e();return(0,F.useCallback)(()=>{let t=e.get(D3);t&&EA(Pae(t))},[e])}function Iae(e,t,n,r,i){let a=C3(e,!0),o=e.keysToLazySeq().toRMap(e=>[e.operation,e],(e,t)=>t),s=Q.of(r);i!=null&&(s=s.filter(e=>i.has(e.programName)));let c=n?.valuesToLazySeq().flatMap(e=>Q.of(e.procsAndPaths).flatMap(e=>e.paths).flatMap(t=>Q.of(t.stops).collect(n=>{let r=Ak(n.expectedCycleTime);return n.program&&r>0?{program:n.program,plannedMins:r/t.partsPerPallet,start:e.routeStartUTC}:null}))).toOrderedMap(e=>[e.program,e],(e,t)=>e.start>t.start?e:t),l=s.map(e=>{let n=o.get(e.programName);return{programName:e.programName,cellControllerProgramName:e.cellControllerProgramName,comment:e.comment??null,revision:e.revision??null,partName:n?.part??null,statisticalCycleTime:n?t.get(n)??null:null,toolUse:n?a.get(n)??null:null,plannedMins:c?.get(e.programName)?.plannedMins??null}}).toRArray();return{time:new Date,programs:l,hasRevisions:l.some(e=>e.revision!==null),cellNameDifferentFromProgName:l.some(e=>e.cellControllerProgramName!==e.programName)}}var A3=d(`AllPrograms`),j3=d(null),M3=d(e=>e(j3)?.time??null,async(e,t,n)=>{t(j3,{progs:await Qt.getProgramsInCellController(),time:n})}),Lae=d(e=>{if(e(M3)===null)return null;let t=e(A3),n=null;if(t===`ActivePrograms`){let t=e(vk);n=new Set(Q.ofObject(t.jobs).flatMap(([,e])=>e.procsAndPaths).flatMap(e=>e.paths).flatMap(e=>e.stops).filter(e=>e.program!==null&&e.program!==void 0&&e.program!==``).map(e=>e.program??``))}let r=e(j3);return r===null?null:Iae(e(SR),e(Nk),e(KO),r.progs,n)}),N3=d(null),Rae=d(async e=>{let t=e(N3);return t===null?``:t.revision===null?await Qt.getLatestProgramRevisionContent(t.programName):await Qt.getProgramRevisionContent(t.programName,t.revision)}),P3=d(null),F3=new Intl.NumberFormat(`en-US`,{minimumFractionDigits:0,maximumFractionDigits:1}),I3=W(PT,{shouldForwardProp:e=>e.toString()[0]!==`$`})(({theme:e,$noBorderBottom:t,$highlightedRow:n,$noticeRow:r})=>({...t&&{"& > *":{borderBottom:`unset`}},[e.breakpoints.up(`lg`)]:{"& td:not(:last-child), & th:not(:last-child)":{whiteSpace:`nowrap`},"& td:last-child, & th:last-child":{width:`100%`}},backgroundColor:n?`#BDBDBD`:r?`#E0E0E0`:void 0})),L3=W(PT,{shouldForwardProp:e=>e.toString()[0]!==`$`})(({$borderBottom:e})=>({...e&&{"&:not(:last-child)":{borderBottom:`2px solid black`}}})),zae=W(`span`)({fontSize:`x-large`,fontWeight:`lighter`});function R3({min:e,cnt:t,showZero:n,extraMin:r,extraCnt:i}){e??=0,t??=0;let a=r?(0,V.jsx)(X,{title:r,children:(0,V.jsxs)(`span`,{children:[e.toFixed(1),` min`]})}):e.toFixed(1)+` min`,o=i?(0,V.jsx)(X,{title:i,children:(0,V.jsxs)(`span`,{children:[F3.format(t),` cnt`]})}):F3.format(t)+` cnt`;return e===0&&t===0?n?`0`:``:e>0&&t===0?a:e===0&&t>0?o:(0,V.jsxs)(`span`,{children:[a,` `,(0,V.jsx)(zae,{children:`|`}),` `,o]})}function z3({tool:e,machine:t}){let n=t?Q.of(e.parts).filter(e=>e.machines.has(t)):Q.of(e.parts);return(0,V.jsxs)($w,{size:`small`,sx:{width:`auto`,ml:`10em`,mb:`1em`},children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Part`}),(0,V.jsx)(Z,{children:`Program`}),t?void 0:(0,V.jsx)(Z,{children:`Machines`}),(0,V.jsx)(Z,{align:`right`,children:`Quantity`}),(0,V.jsx)(Z,{align:`right`,children:`Use/Cycle (min)`}),(0,V.jsx)(Z,{align:`right`,children:`Use/Cycle (cnt)`})]})}),(0,V.jsx)(oT,{children:n.isEmpty()?(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{colSpan:5,children:`No programs use this machine`})}):n.map((e,n)=>(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.partAndProg.part,size:20}),(0,V.jsx)(`span`,{children:e.partAndProg.part})]})}),(0,V.jsx)(Z,{children:e.partAndProg.operation}),t?void 0:(0,V.jsx)(Z,{children:e.machines.foldl((e,t)=>(e.length>0?e+`, `:``)+t,``)}),(0,V.jsx)(Z,{align:`right`,children:e.quantity}),(0,V.jsx)(Z,{align:`right`,children:e.scheduledUseMinutes>0?e.scheduledUseMinutes.toFixed(1):``}),(0,V.jsx)(Z,{align:`right`,children:e.scheduledUseCnt>0?F3.format(e.scheduledUseCnt):``})]},n))})]})}function Bae({machines:e}){let t=I(O3),n=Q.of(e).toLookupOrderedMap(e=>e.machineName,e=>e.pocket),r=n.size>1&&n.valuesToAscLazySeq().some(e=>e.size>1);return(0,V.jsxs)($w,{size:`small`,sx:{width:`auto`,ml:`10em`,mb:`1em`},children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Machine`}),(0,V.jsx)(Z,{align:`right`,children:`Pocket`}),t?(0,V.jsx)(Z,{children:`Serial`}):void 0,(0,V.jsx)(Z,{align:`right`,children:`Current Use `}),(0,V.jsx)(Z,{align:`right`,children:`Lifetime `}),(0,V.jsx)(Z,{align:`right`,children:`Remaining Use `})]})}),(0,V.jsxs)(oT,{children:[n.toAscLazySeq().map(([e,i])=>(0,V.jsxs)(F.Fragment,{children:[i.valuesToAscLazySeq().map((e,n)=>(0,V.jsxs)(L3,{$borderBottom:r&&i.size===1,children:[(0,V.jsx)(Z,{children:e.machineName}),(0,V.jsx)(Z,{align:`right`,children:e.pocket}),t?(0,V.jsx)(Z,{children:e.serial??``}):void 0,(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:e.currentUseMinutes,cnt:e.currentUseCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:e.lifetimeMinutes,cnt:e.lifetimeCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:e.remainingMinutes,cnt:e.remainingCnt,showZero:!0})})]},n)),n.size>1&&i.size>1?(0,V.jsxs)(L3,{$borderBottom:!0,children:[(0,V.jsx)(Z,{colSpan:t?4:3}),(0,V.jsx)(Z,{children:`Subtotal`}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:i.valuesToAscLazySeq().sumBy(e=>e.remainingMinutes??0),cnt:i.valuesToAscLazySeq().sumBy(e=>e.remainingCnt??0)})})]}):void 0]},e)),(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{colSpan:t?4:3}),(0,V.jsx)(Z,{children:`Total`}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:Q.of(e).sumBy(e=>e.remainingMinutes??0),cnt:Q.of(e).sumBy(e=>e.remainingCnt??0)})})]})]})]})}function Vae(){let e=I(k3);return(0,V.jsxs)(I3,{children:[(0,V.jsx)(Z,{}),(0,V.jsx)(Z,{children:`Tool`}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Expected use for all currently scheduled parts.`+(e?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Scheduled Use`})})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Remaining use summed over all machines which have a scheduled part.`+(e?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Total Remaining Use`})})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Machine with the least remaining use.`+(e?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Smallest Remaining Use`})})}),(0,V.jsx)(Z,{})]})}function Hae({tool:e}){let[t,n]=(0,F.useState)(!1),r=Q.of(e.machines).filter(t=>e.parts.some(e=>e.machines.has(t.machineName))),i=Q.of(e.parts).sumBy(e=>e.scheduledUseMinutes*e.quantity),a=Q.of(e.parts).sumBy(e=>e.scheduledUseCnt*e.quantity),o=r.sumBy(e=>e.remainingMinutes??0),s=r.sumBy(e=>e.remainingCnt??0),c=r.groupBy(e=>e.machineName).map(([e,t])=>({mach:e,remainMin:Q.of(t).sumBy(e=>e.remainingMinutes??0)})).minBy(({remainMin:e})=>e),l=r.groupBy(e=>e.machineName).map(([e,t])=>({mach:e,remainCnt:Q.of(t).sumBy(e=>e.remainingCnt??0)})).minBy(({remainCnt:e})=>e);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(I3,{$noBorderBottom:!0,$highlightedRow:i>o||a>s,$noticeRow:i<=o&&a<=s&&(c&&i>c.remainMin||l&&a>l.remainCnt),children:[(0,V.jsx)(Z,{children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n(!t),children:t?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})}),(0,V.jsx)(Z,{children:e.toolName}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:i,cnt:a})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:o,cnt:s})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:c?.remainMin,cnt:l?.remainCnt,showZero:!0,extraMin:c?.mach,extraCnt:l?.mach})}),(0,V.jsx)(Z,{})]}),(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:6,children:(0,V.jsx)(om,{in:t,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsxs)(J,{sx:{display:`flex`,flexWrap:`wrap`,justifyContent:`space-around`,ml:`1em`,mr:`1em`},children:[(0,V.jsx)(`div`,{children:(0,V.jsx)(Bae,{machines:e.machines})}),e.parts.length===0?void 0:(0,V.jsx)(`div`,{children:(0,V.jsx)(z3,{tool:e})})]})})})})]})}function Uae({machine:e}){let t=I(k3),n=I(O3);return(0,V.jsxs)(I3,{children:[(0,V.jsx)(Z,{}),(0,V.jsxs)(Z,{children:[`Tool In `,e]}),(0,V.jsx)(Z,{align:`right`,children:`Pocket`}),n?(0,V.jsx)(Z,{children:`Serial`}):void 0,(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Expected use for all currently scheduled parts.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Scheduled Use`})})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Current recorded usage of this tool.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Current Use`})})}),(0,V.jsxs)(Z,{align:`right`,children:[(0,V.jsx)(X,{title:`Current configured lifetime of this tool.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Lifetime`})}),` `]}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(X,{title:`Lifetime minus current use.`+(t?` Counts are estimates.`:``),children:(0,V.jsx)(`span`,{children:`Remaining Use`})})}),(0,V.jsx)(Z,{})]})}function Wae({report:e,pocket:t}){let[n,r]=(0,F.useState)(!1),i=I(O3),a=i?9:8,o=Q.of(e.parts).filter(e=>e.machines.has(t.machineName)).sumBy(e=>e.scheduledUseMinutes*e.quantity),s=Q.of(e.parts).filter(e=>e.machines.has(t.machineName)).sumBy(e=>e.scheduledUseCnt*e.quantity);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(I3,{$noBorderBottom:!0,children:[(0,V.jsx)(Z,{children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>r(!n),children:n?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})}),(0,V.jsx)(Z,{children:e.toolName}),(0,V.jsx)(Z,{align:`right`,children:t.pocket}),i?(0,V.jsx)(Z,{children:t.serial??``}):void 0,(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:o,cnt:s})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:t.currentUseMinutes,cnt:t.currentUseCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:t.lifetimeMinutes,cnt:t.lifetimeCnt})}),(0,V.jsx)(Z,{align:`right`,children:(0,V.jsx)(R3,{min:t.remainingMinutes,cnt:t.remainingCnt})}),(0,V.jsx)(Z,{})]}),(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:a,children:(0,V.jsx)(om,{in:n,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsx)(z3,{tool:e,machine:t.machineName})})})})]})}var B3=`__Insight__FilterAnyMachine__`,V3=d(null);function Gae(){let e=I(V3),t=I(D3);return t===null?(0,V.jsx)(`div`,{}):(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(ST,{children:e===null?(0,V.jsx)(Vae,{}):(0,V.jsx)(Uae,{machine:e})}),(0,V.jsx)(oT,{children:t.map(t=>e===null?(0,V.jsx)(Hae,{tool:t},t.toolName):(0,V.jsx)(F.Fragment,{children:t.machines.filter(t=>t.machineName===e).map(e=>(0,V.jsx)(Wae,{report:t,pocket:e},e.pocket))},t.toolName))})]})}function Kae(){let[e,t]=R(V3),[n,r]=R(Mae),[i,a]=(0,F.useState)(!1),o=I(Nae),s=Fae(),c=IL();function l(){a(!0),r(new Date).catch(console.log).finally(()=>a(!1))}return c?(0,V.jsx)(`div`,{}):n===null?(0,V.jsx)(`main`,{style:{margin:`2em`,display:`flex`,justifyContent:`center`},children:(0,V.jsx)(tb,{color:`secondary`,size:`large`,variant:`extended`,style:{margin:`2em`},onClick:l,disabled:i,children:(0,V.jsxs)(V.Fragment,{children:[i?(0,V.jsx)(Sh,{size:10,style:{marginRight:`1em`}}):(0,V.jsx)(_E,{fontSize:`inherit`,style:{marginRight:`1em`}}),`Load Tools`]})})}):(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(X,{title:`Refresh Tools`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{onClick:l,disabled:i,size:`small`,children:i?(0,V.jsx)(Sh,{size:10}):(0,V.jsx)(_E,{fontSize:`inherit`})})})}),(0,V.jsxs)(`span`,{style:{marginLeft:`1em`},children:[`Tools from `,(0,V.jsx)(sB,{date:n})]}),(0,V.jsx)(`div`,{style:{flexGrow:`1`}}),(0,V.jsx)(db,{size:`small`,children:(0,V.jsxs)(fC,{autoWidth:!0,displayEmpty:!0,value:e??B3,style:{marginLeft:`1em`},onChange:e=>{e.target.value===B3?t(null):t(e.target.value)},children:[(0,V.jsx)(sS,{value:B3,children:(0,V.jsx)(`em`,{children:`All Machines`})}),o.map(e=>(0,V.jsx)(sS,{value:e,children:(0,V.jsx)(`div`,{style:{display:`flex`,alignItems:`center`},children:(0,V.jsx)(`span`,{style:{marginRight:`1em`},children:e})})},e))]})}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:s,size:`large`,children:(0,V.jsx)(lE,{})})})]})}function H3(){return LL(`Tool Report`),(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsx)(Kae,{}),(0,V.jsx)(`main`,{children:(0,V.jsx)(oW,{children:(0,V.jsx)(Gae,{})})})]})}var qae=W(PT)(()=>({"& > *":{borderBottom:`unset`}}));function U3(e){if(e.length===0)return``;let t=e.lastIndexOf(`\\`);return t>=0&&t<e.length-2?e.substr(t+1):e}var Jae=new Intl.NumberFormat(`en-US`,{maximumFractionDigits:2});function Yae(e){let[t,n]=(0,F.useState)(!1),r=L(N3),i=L(P3),a=8+ +!!e.showCellCtrlCol+ +!!e.showRevCol,o=e.program.toolUse!==null&&e.program.toolUse.tools.length>0&&Q.of(e.program.toolUse.tools).some(e=>e.cycleUsageMinutes>0),s=e.program.toolUse!==null&&e.program.toolUse.tools.length>0&&Q.of(e.program.toolUse.tools).some(e=>e.cycleUsageCnt>0);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(qae,{children:[(0,V.jsx)(Z,{children:e.program.toolUse===null||e.program.toolUse.tools.length===0?void 0:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n(!t),children:t?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})}),(0,V.jsx)(Z,{children:U3(e.program.programName)}),e.showCellCtrlCol?(0,V.jsx)(Z,{children:e.program.cellControllerProgramName}):void 0,(0,V.jsx)(Z,{children:e.program.partName===null?void 0:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.program.partName,size:20}),(0,V.jsx)(`span`,{children:e.program.partName})]})}),(0,V.jsx)(Z,{children:e.program.comment??``}),e.showRevCol?(0,V.jsx)(Z,{children:e.program.revision===null?``:e.program.revision.toFixed()}):void 0,(0,V.jsx)(Z,{align:`right`,children:e.program.statisticalCycleTime===null?``:e.program.statisticalCycleTime.medianMinutesForSingleMat.toFixed(2)}),(0,V.jsx)(Z,{align:`right`,children:e.program.statisticalCycleTime===null?``:e.program.statisticalCycleTime.MAD_aboveMinutes.toFixed(2)}),(0,V.jsx)(Z,{align:`right`,children:e.program.statisticalCycleTime===null?``:e.program.statisticalCycleTime.MAD_belowMinutes.toFixed(2)}),(0,V.jsx)(Z,{align:`right`,children:e.program.plannedMins===null?``:Jae.format(e.program.plannedMins)}),(0,V.jsxs)(Z,{children:[(0,V.jsx)(X,{title:`Load Program Content`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>r(e.program),children:(0,V.jsx)(eE,{})})}),e.program.revision===null?void 0:(0,V.jsx)(X,{title:`Revision History`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>i(e.program),children:(0,V.jsx)(rre,{})})})]})]}),(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:a,children:(0,V.jsx)(om,{in:t,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsx)(J,{sx:{mr:`1em`,ml:`3em`},children:e.program.toolUse===null||e.program.toolUse.tools.length===0?void 0:(0,V.jsxs)($w,{size:`small`,sx:{width:`auto`,ml:`10em`,mr:`1em`},children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Tool`}),o?(0,V.jsx)(Z,{align:`right`,children:`Estimated Usage (min)`}):void 0,s?(0,V.jsx)(Z,{align:`right`,children:`Estimated Usage (count)`}):void 0]})}),(0,V.jsx)(oT,{children:Q.of(e.program.toolUse.tools).map((e,t)=>(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:e.toolName}),o?(0,V.jsx)(Z,{align:`right`,children:e.cycleUsageMinutes===0?``:e.cycleUsageMinutes.toFixed(1)}):void 0,s?(0,V.jsx)(Z,{align:`right`,children:e.cycleUsageCnt===0?``:e.cycleUsageCnt.toFixed(1)}):void 0]},t))})]})})})})})]})}function Xae(){let e=I(Lae),[t,n]=(0,F.useState)(`ProgramName`),[r,i]=(0,F.useState)(`asc`);if(e===null)return(0,V.jsx)(`div`,{});let a=Q.of(e.programs).sortWith((e,n)=>{let i=0;switch(t){case`ProgramName`:i=U3(e.programName).localeCompare(U3(n.programName));break;case`CellProgName`:i=e.cellControllerProgramName.localeCompare(n.cellControllerProgramName);break;case`Comment`:i=e.comment===null&&n.comment===null?0:e.comment===null?1:n.comment===null?-1:e.comment.localeCompare(n.comment);break;case`Revision`:i=e.revision===null&&n.revision===null?0:e.revision===null?1:n.revision===null?-1:e.revision-n.revision;break;case`PartName`:i=e.partName===null&&n.partName===null?0:e.partName===null?1:n.partName===null?-1:e.partName.localeCompare(n.partName);break;case`MedianTime`:i=e.statisticalCycleTime===null&&n.statisticalCycleTime===null?0:e.statisticalCycleTime===null?1:n.statisticalCycleTime===null?-1:e.statisticalCycleTime.medianMinutesForSingleMat-n.statisticalCycleTime.medianMinutesForSingleMat;break;case`DeviationAbove`:i=e.statisticalCycleTime===null&&n.statisticalCycleTime===null?0:e.statisticalCycleTime===null?1:n.statisticalCycleTime===null?-1:e.statisticalCycleTime.MAD_aboveMinutes-n.statisticalCycleTime.MAD_aboveMinutes;break;case`DeviationBelow`:i=e.statisticalCycleTime===null&&n.statisticalCycleTime===null?0:e.statisticalCycleTime===null?1:n.statisticalCycleTime===null?-1:e.statisticalCycleTime.MAD_belowMinutes-n.statisticalCycleTime.MAD_belowMinutes;break;case`Planned`:i=e.plannedMins===null&&n.plannedMins===null?0:e.plannedMins===null?1:n.plannedMins===null?-1:e.plannedMins-n.plannedMins}return i===0?0:i<0&&r===`asc`||i>0&&r===`desc`?-1:1});function o(e){e===t?i(r===`asc`?`desc`:`asc`):n(e)}return(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{}),(0,V.jsx)(Z,{sortDirection:t===`ProgramName`&&r,children:(0,V.jsx)(VT,{active:t===`ProgramName`,direction:r,onClick:()=>o(`ProgramName`),children:`Program Name`})}),e.cellNameDifferentFromProgName?(0,V.jsx)(Z,{sortDirection:t===`CellProgName`&&r,children:(0,V.jsx)(VT,{active:t===`CellProgName`,direction:r,onClick:()=>o(`CellProgName`),children:`Cell Controller Program`})}):void 0,(0,V.jsx)(Z,{sortDirection:t===`PartName`&&r,children:(0,V.jsx)(VT,{active:t===`PartName`,direction:r,onClick:()=>o(`PartName`),children:`Part`})}),(0,V.jsx)(Z,{sortDirection:t===`Comment`&&r,children:(0,V.jsx)(VT,{active:t===`Comment`,direction:r,onClick:()=>o(`Comment`),children:`Comment`})}),e.hasRevisions?(0,V.jsx)(Z,{sortDirection:t===`Revision`&&r,children:(0,V.jsx)(VT,{active:t===`Revision`,direction:r,onClick:()=>o(`Revision`),children:`Revision`})}):void 0,(0,V.jsx)(Z,{sortDirection:t===`MedianTime`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`MedianTime`,direction:r,onClick:()=>o(`MedianTime`),children:`Median Time / Material (min)`})}),(0,V.jsx)(Z,{sortDirection:t===`DeviationAbove`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`DeviationAbove`,direction:r,onClick:()=>o(`DeviationAbove`),children:`Deviation Above Median`})}),(0,V.jsx)(Z,{sortDirection:t===`DeviationBelow`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`DeviationBelow`,direction:r,onClick:()=>o(`DeviationBelow`),children:`Deviation Below Median`})}),(0,V.jsx)(Z,{sortDirection:t===`Planned`&&r,align:`right`,children:(0,V.jsx)(VT,{active:t===`Planned`,direction:r,onClick:()=>o(`Planned`),children:`Planned Time (min)`})}),(0,V.jsx)(Z,{})]})}),(0,V.jsx)(oT,{children:Q.of(a).map((t,n)=>(0,V.jsx)(Yae,{program:t,showCellCtrlCol:e.cellNameDifferentFromProgName,showRevCol:e.hasRevisions},n))})]})}function W3(){let e=I(Rae),[t,n]=(0,F.useState)(null),r=(0,F.useMemo)(()=>new Worker(new URL(`/assets/ProgramHighlight-C5uXGNDz.js`,``+import.meta.url),{type:`module`}),[]);return(0,F.useEffect)(()=>{let e=e=>n(e),t=t=>e(t.data);return r.addEventListener(`message`,t),()=>{e=()=>null,r.removeEventListener(`message`,t),r.terminate(),n(null)}},[r]),(0,F.useEffect)(()=>{e&&e!==``&&r.postMessage(e,[])},[e,r]),(0,V.jsx)(`pre`,{children:t===null?(0,V.jsx)(`code`,{className:`gcode`,children:e}):(0,V.jsx)(`code`,{className:`gcode`,dangerouslySetInnerHTML:{__html:t}})})}function Zae(){let[e,t]=R(N3),n=I(P3);return(0,V.jsxs)(jy,{open:e!==null&&n===null,onClose:()=>t(null),maxWidth:`lg`,children:[(0,V.jsx)(Wy,{children:e?.partName?(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.partName}),(0,V.jsxs)(`div`,{style:{marginLeft:`10px`,marginRight:`3em`},children:[e?.programName??`Program`,` `,e?.revision?` rev`+e.revision.toFixed():``,` `,(0,V.jsxs)(q,{variant:`subtitle1`,component:`span`,children:[`(`,e.partName,`)`]})]})]}):(0,V.jsxs)(V.Fragment,{children:[e?.programName??`Program`,` `,e?.revision?` rev`+e.revision.toFixed():``]})}),(0,V.jsx)(Vy,{children:e===null||n!==null?(0,V.jsx)(`div`,{}):(0,V.jsx)(oW,{children:(0,V.jsx)(W3,{})})}),(0,V.jsx)(Fy,{children:(0,V.jsx)(Y,{onClick:()=>t(null),children:`Close`})})]})}var G3=10;function Qae(e){let t=I(P3),n=L(N3);return(0,V.jsxs)($w,{children:[(0,V.jsx)(ST,{children:(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:`Revision`}),(0,V.jsx)(Z,{children:`Comment`}),(0,V.jsx)(Z,{children:`Cell Controller Program`}),(0,V.jsx)(Z,{})]})}),(0,V.jsx)(oT,{children:e.loading?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{colSpan:4,children:(0,V.jsx)(Sh,{})})}),Q.ofRange(0,9).map(e=>(0,V.jsx)(PT,{children:(0,V.jsx)(Z,{colSpan:4})},e))]}):Q.of(e.revisions).drop(e.page*G3).take(G3).map(e=>(0,V.jsxs)(PT,{children:[(0,V.jsx)(Z,{children:e.revision}),(0,V.jsx)(Z,{children:e.comment??``}),(0,V.jsx)(Z,{children:e.cellControllerProgramName??``}),(0,V.jsx)(Z,{children:(0,V.jsx)(X,{title:`Load Program Content`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n({...e,partName:t?.partName??null}),children:(0,V.jsx)(eE,{})})})})]},e.revision))})]})}function $ae(){let[e,t]=R(P3),[n,r]=R(N3),[i,a]=(0,F.useState)(null),[o,s]=(0,F.useState)({page:0,hasMore:!1}),[c,l]=(0,F.useState)(0),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(null);(0,F.useEffect)(()=>{(async()=>{if(e===null)a(null),l(0),s({page:0,hasMore:!1});else if(e!==null&&i===null){d(!0),p(null);try{let t=await Qt.getProgramRevisionsInDescendingOrderOfRevision(e.programName,G3,void 0);a(t),s({page:0,hasMore:t.length===G3})}catch(e){p(e instanceof Error?e:String(e))}finally{d(!1)}}})().catch(console.error)},[e,i]);function m(){if(c<o.page)l(c+1);else if(o.hasMore&&e!==null&&i!==null&&i.length>0){d(!0),p(null);let t=i[i.length-1];Qt.getProgramRevisionsInDescendingOrderOfRevision(e.programName,G3,t?t.revision-1:void 0).then(e=>{a(t=>t===null?e:t.concat(e)),s({page:c+1,hasMore:e.length===G3}),l(c+1)}).catch(p).finally(()=>d(!1))}}return(0,V.jsxs)(jy,{open:e!==null,onClose:()=>t(null),maxWidth:`lg`,children:[(0,V.jsx)(Wy,{children:e?.partName?(0,V.jsxs)(`div`,{style:{display:`flex`,flexWrap:`wrap`,alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.partName}),(0,V.jsxs)(`div`,{style:{marginLeft:`10px`,marginRight:`3em`},children:[e.programName??`Program`,` `,(0,V.jsxs)(q,{variant:`subtitle1`,component:`span`,children:[`(`,e.partName,`)`]})]})]}):(0,V.jsx)(V.Fragment,{children:e?.programName??`Program`})}),(0,V.jsxs)(Vy,{children:[f===null?void 0:(0,V.jsx)(jv,{children:(0,V.jsx)(Fv,{children:typeof f==`string`?f:f.message})}),n===null?i===null?u?(0,V.jsx)(Sh,{}):void 0:(0,V.jsx)(Qae,{page:c,revisions:i,loading:u}):(0,V.jsx)(oW,{children:(0,V.jsx)(W3,{})})]}),(0,V.jsx)(Fy,{children:(0,V.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,width:`100%`},children:[n===null?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{title:`Latest Revisions`,children:(0,V.jsx)(`span`,{children:(0,V.jsx)(Oh,{onClick:()=>l(0),disabled:u||c===0,size:`large`,children:(0,V.jsx)(oE,{})})})}),(0,V.jsx)(X,{title:`Previous Page`,children:(0,V.jsx)(`span`,{children:(0,V.jsx)(Oh,{onClick:()=>l(c-1),disabled:u||c===0,size:`large`,children:(0,V.jsx)(dE,{})})})}),(0,V.jsx)(X,{title:`Next Page`,children:(0,V.jsx)(`span`,{children:(0,V.jsx)(Oh,{onClick:()=>m(),disabled:u||c===o.page&&!o.hasMore,size:`large`,children:(0,V.jsx)(fE,{})})})})]}):void 0,(0,V.jsx)(`div`,{style:{flexGrow:1}}),n===null?void 0:(0,V.jsx)(Y,{onClick:()=>r(null),children:`Back to History`}),(0,V.jsx)(Y,{onClick:()=>t(null),children:`Close`})]})})]})}function eoe(){let[e,t]=R(M3),[n,r]=(0,F.useState)(!1),i=IL(),[a,o]=R(A3);function s(){r(!0),t(new Date).catch(console.log).finally(()=>r(!1))}return i?(0,V.jsx)(`div`,{}):e===null?(0,V.jsx)(`main`,{style:{margin:`2em`,display:`flex`,justifyContent:`center`},children:(0,V.jsx)(tb,{color:`secondary`,size:`large`,variant:`extended`,style:{margin:`2em`},onClick:s,disabled:n,children:(0,V.jsxs)(V.Fragment,{children:[n?(0,V.jsx)(Sh,{size:10,style:{marginRight:`1em`}}):(0,V.jsx)(_E,{fontSize:`inherit`,style:{marginRight:`1em`}}),`Load Programs`]})})}):(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(X,{title:`Refresh Programs`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{onClick:s,disabled:n,size:`small`,children:n?(0,V.jsx)(Sh,{size:10}):(0,V.jsx)(_E,{fontSize:`inherit`})})})}),(0,V.jsxs)(`span`,{style:{marginLeft:`1em`},children:[`Programs from `,(0,V.jsx)(sB,{date:e})]}),(0,V.jsx)(`div`,{style:{flexGrow:1}}),(0,V.jsx)(db,{size:`small`,children:(0,V.jsxs)(fC,{autoWidth:!0,value:a,onChange:e=>o(e.target.value),children:[(0,V.jsx)(sS,{value:`AllPrograms`,children:`All Programs`},`AllPrograms`),(0,V.jsx)(sS,{value:`ActivePrograms`,children:`Active Programs`},`ActivePrograms`)]})})]})}function K3(){return LL(`Programs`),(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsx)(eoe,{}),(0,V.jsx)(`main`,{children:(0,V.jsx)(oW,{children:(0,V.jsx)(Xae,{})})}),(0,V.jsx)(Zae,{}),(0,V.jsx)($ae,{})]})}var q3=[{id:0,label:`Date`,numeric:!1,getDisplay:e=>e.routeStartTime.toLocaleString(),getForSort:e=>e.routeStartTime.getTime(),getForExport:e=>e.routeStartTime.toISOString()},{id:1,label:`Part`,numeric:!1,getDisplay:e=>e.partName},{id:2,label:`Scheduled`,numeric:!0,getDisplay:e=>e.scheduledQty.toString(),getForSort:e=>e.scheduledQty},{id:3,label:`Removed`,numeric:!0,getDisplay:e=>e.decrementedQty.toString(),getForSort:e=>e.decrementedQty},{id:4,label:`Completed`,numeric:!0,getDisplay:e=>e.completedQty.toString()}];function toe({job:e}){let[t,n]=(0,F.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(xZ,{children:[q3.map(t=>(0,V.jsx)(Z,{align:t.numeric?`right`:`left`,children:t.id===1?(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[(0,V.jsx)(J,{sx:{mr:`0.2em`},children:(0,V.jsx)(yW,{part:e.partName,size:25})}),(0,V.jsx)(`div`,{children:e.partName})]}):t.getDisplay(e)},t.id)),(0,V.jsx)(Z,{children:(0,V.jsx)(X,{title:`Show Details`,children:(0,V.jsx)(Oh,{size:`small`,onClick:()=>n(!t),children:t?(0,V.jsx)(pE,{}):(0,V.jsx)(uE,{})})})})]}),(0,V.jsx)(SZ,{children:(0,V.jsx)(Z,{sx:{pb:`0`,pt:`0`},colSpan:q3.length+1,children:(0,V.jsx)(om,{in:t,timeout:`auto`,unmountOnExit:!0,children:(0,V.jsx)(nY,{job:e.inProcJob?e.inProcJob:e.historicJob,checkAnalysisMonth:!0})})})})]})}function noe(){let e=I(sz),t=e2(),n=$0(e),r=t2(0,q3),i=I(e.type===`Last30`?gR:vR),a=I(e.type===`Last30`?KO:XO),o=(0,F.useMemo)(()=>PJ(n.zoomRange,i.matsById,a,null),[n,i.matsById,a]),s=(0,F.useMemo)(()=>Q.of(o).sortBy(r.sortOn).drop(t.page*t.rowsPerPage).take(t.rowsPerPage),[o,r,t]);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(K0,{columns:q3,sort:r,showDetailsCol:!0,copyToClipboardRows:o}),(0,V.jsx)(oT,{children:s.map((e,t)=>(0,V.jsx)(toe,{job:e},e.historicJob?.unique??e.inProcJob?.unique??t))})]}),(0,V.jsx)(Z0,{tpage:t,zoom:n.zoom,count:o.length})]})}function roe(){return LL(`Scheduled Jobs`),(0,V.jsx)(V.Fragment,{children:(0,V.jsx)(`main`,{style:{padding:`24px`},children:(0,V.jsx)(noe,{})})})}function ioe(){LL(`Quality`);let e=I(sz),t=I(e.type===`Last30`?fR:Zie),n=e.type===`Last30`?`Last30Days`:`ZoomIntoRange`,r=e.type===`Last30`?[AE(YE(),-29),AE(YE(),1)]:[e.month,jE(e.month,1)];return(0,V.jsx)(y2,{subtitle:`Inspection decisions grouped by path`,inspectionlogs:t,zoomType:n,default_date_range:r})}var aoe={display:`flex`,backgroundColor:`#E0E0E0`,paddingLeft:`24px`,paddingRight:`24px`,paddingBottom:`4px`,height:`2.5em`,alignItems:`flex-end`},ooe={display:`flex`,alignSelf:`center`,alignItems:`flex-end`},J3=`@@all_inspection_display@@`,Y3=`@@recent_completed_material@@`;function X3(e){return typeof e==`string`?e.split(`,`):e}function soe(){let[e,t]=R(LJ);return(0,V.jsx)(hb,{control:(0,V.jsx)(Jv,{size:`small`,checked:e,onChange:e=>t(e.target.checked)}),label:`Hide Non-Loading Material`,sx:{pl:2,pr:2}})}function Z3(){let[e,t]=R(FL),n=I(KL),r=Q.of(Object.keys(I(vk).queues)).toSortedArray(e=>e),i=I(Dr),a=qT(Xd().breakpoints.down(`md`));function o(n){let r=parseFloat(n);!isNaN(r)&&isFinite(r)&&(e.route===$.Station_LoadMonitor?t({route:$.Station_LoadMonitor,loadNum:r,queues:e.queues,completed:e.completed}):t({route:$.Station_LoadMonitor,loadNum:r,queues:[],completed:!1}))}function s(e){t(e===J3?{route:$.Station_InspectionMonitor}:{route:$.Station_InspectionMonitorWithType,inspType:e})}function c(n){let r=n.includes(Y3);n=n.filter(e=>e!==Y3).slice(0,2),e.route===$.Station_LoadMonitor?t({route:$.Station_LoadMonitor,loadNum:e.loadNum,queues:n,completed:r}):t({route:$.Station_LoadMonitor,loadNum:1,queues:n,completed:r})}function l(e){t({route:$.Station_Queues,queues:e})}let u=`LoadUnload`,d=1,f=null,p=[];switch(e.route){case $.Station_LoadMonitor:u=`LoadUnload`,d=e.loadNum,p=e.queues,e.completed&&(p=p.concat(Y3));break;case $.Station_InspectionMonitor:u=`Inspection`,f=``;break;case $.Station_InspectionMonitorWithType:u=`Inspection`,f=e.inspType;break;case $.Station_Queues:u=`Queues`,p=e.queues;break;case $.Station_Closeout:u=`CloseOut`;break;default:u=`AllMaterial`}return(0,V.jsxs)(J,{component:`nav`,sx:a?aoe:ooe,children:[u===`LoadUnload`?i.loadStationNames&&Object.keys(i.loadStationNames).length>0?(0,V.jsx)(fC,{value:d,onChange:e=>o(e.target.value.toString()),variant:`standard`,style:{marginLeft:`1em`,minWidth:`8em`},children:Q.of(Object.entries(i.loadStationNames)).sortBy(([e])=>parseInt(e)).map(([e,t])=>(0,V.jsx)(sS,{value:parseInt(e),children:t},e))},`loadnumselect`):(0,V.jsx)(Rb,{type:`number`,placeholder:`Load Station Number`,value:d,onChange:e=>o(e.target.value),style:{width:`3em`,marginLeft:`1em`}},`loadnumselect`):void 0,u===`Inspection`?(0,V.jsxs)(fC,{value:f||J3,onChange:e=>s(e.target.value),variant:`standard`,style:{marginLeft:`1em`},children:[(0,V.jsx)(sS,{value:J3,children:(0,V.jsx)(`em`,{children:`All`})},J3),Q.of(n).concat(f?[f]:[]).distinctAndSortBy(e=>e).map(e=>(0,V.jsx)(sS,{value:e,children:e},e))]},`inspselect`):void 0,u===`LoadUnload`?(0,V.jsxs)(db,{style:{marginLeft:`1em`},children:[p.length===0?(0,V.jsx)(`label`,{style:{position:`absolute`,top:`10px`,left:0,color:`rgba(0,0,0,0.54)`,fontSize:`0.9rem`},children:`Display queue(s)`}):void 0,(0,V.jsxs)(fC,{multiple:!0,displayEmpty:!0,variant:`standard`,value:p,inputProps:{id:`queueselect`},style:{minWidth:`10em`,marginTop:`0`},onChange:e=>c(X3(e.target.value)),children:[r.map((e,t)=>(0,V.jsx)(sS,{value:e,children:e},t)),(0,V.jsx)(sS,{value:Y3,children:(0,V.jsx)(`i`,{children:`Completed`})}),(0,V.jsx)(Xy,{}),(0,V.jsx)(soe,{})]})]}):void 0,u===`Queues`?(0,V.jsxs)(db,{style:{marginLeft:`1em`,minWidth:`10em`},children:[p.length===0?(0,V.jsx)(`label`,{style:{position:`absolute`,top:`10px`,left:0,color:`rgba(0,0,0,0.54)`,fontSize:`0.9rem`},children:`Select queue(s)`}):void 0,(0,V.jsx)(fC,{multiple:!0,displayEmpty:!0,variant:`standard`,value:p,inputProps:{id:`queueselect`},style:{marginTop:`0`},onChange:e=>l(X3(e.target.value)),children:r.map((e,t)=>(0,V.jsx)(sS,{value:e,children:e},t))})]}):void 0]})}function Q3(){let e=qT(Xd().breakpoints.down(`md`));return(0,V.jsx)(J,{sx:{display:`flex`,alignItems:`center`,height:`100%`,bgcolor:e?`#E0E0E0`:void 0},children:(0,V.jsx)(I4,{full:e})})}var $3=sk(`shift-starts`,[[1,360],[2,840],[3,1320]]),e6=d(e=>new Map(e($3)),(e,t,n)=>{let r=new Map(e($3));n(r),t($3,Array.from(r.entries()))});function t6(e){let t=I(e6);return(0,F.useMemo)(()=>{let n=[];for(let e=1;e<=3;e++){let r=t.get(e);r!==void 0&&(n.length>=1&&n[n.length-1]>=r||n.push(r))}if(n.length===0)return[{start:e,end:AE(e,1)}];let r=RE(AE(e,1),n[0]),i=[];for(let t=0;t<n.length;t++)i.push({start:RE(e,n[t]),end:t===n.length-1?r:RE(e,n[t+1])});return i},[t,e])}function coe(e){let[t,n]=e.split(`:`);return parseInt(t,10)*60+parseInt(n,10)}function loe(e){let t=Math.floor(e/60),n=e%60;return`${t.toString().padStart(2,`0`)}:${n.toString().padStart(2,`0`)}`}function uoe(e,t){let n=t.get(e);if(n===void 0)return!1;if(e===1){let e=t.get(2)??t.get(3);return e!==void 0&&e<=n}if(e===2){let e=t.get(1),r=t.get(3);return e!==void 0&&e>=n||r!==void 0&&r<=n}if(e===3){let e=t.get(2)??t.get(1);return e!==void 0&&e>=n}return!1}function n6({shiftNum:e}){let[t,n]=R(e6),r=t.get(e);return(0,V.jsx)(GT,{type:`time`,label:`Shift ${e} Start`,error:uoe(e,t),value:r===void 0?``:loe(r),onChange:t=>{let r=t.target.value;n(r===``?t=>t.delete(e):t=>t.set(e,coe(r)))},variant:`standard`,size:`small`,slotProps:{inputLabel:{shrink:!0},input:e===1?void 0:{endAdornment:(0,V.jsx)(X,{title:`Clear/Disable Shift`,children:(0,V.jsx)($m,{sx:{mb:`4px`},onClick:()=>n(t=>t.delete(e)),children:(0,V.jsx)($T,{fontSize:`small`})})})}}})}function doe(){return(0,V.jsxs)(tw,{direction:`row`,spacing:2,children:[(0,V.jsx)(n6,{shiftNum:1}),(0,V.jsx)(n6,{shiftNum:2}),(0,V.jsx)(n6,{shiftNum:3})]})}function r6(e,t){return n=>{let r=e(n);for(let e=0;e<t.length;e++){let i=t[e];if(r>=i.start&&r<i.end)return{val:n,shift:e}}return null}}function foe(e,t){return Q.of(e).filter(e=>e.finalProcess).collect(r6(e=>e.completeTime,t)).toLookupOrderedMap(e=>e.val.partName,e=>e.shift,e=>e.val.quantity,(e,t)=>e+t)}function poe(e,t){return e.valuesToLazySeq().filter(e=>Kk(e)&&e.operation===`UNLOAD`&&Q.of(e.material).some(e=>e.proc===e.numproc)).collect(r6(e=>e.endTime,t)).toLookupOrderedMap(e=>e.val.part,e=>e.shift,e=>Q.of(e.val.material).sumBy(e=>+(e.proc===e.numproc)),(e,t)=>e+t)}function moe(e){let t=I(sA),n=I(rR),r=t6(e);return(0,F.useMemo)(()=>{let e=foe(n,r),i=poe(t,r);return e.mapValues(e=>({planned:e})).adjust(i,(e,t)=>e?{...e,completed:t}:{completed:t}).toAscLazySeq().map(([e,{planned:t,completed:n}])=>({part:e,planned:t??zO.empty(),completed:n??zO.empty()})).toRArray()},[t,n,r])}var hoe=new Intl.DateTimeFormat(void 0,{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`});function goe({row:e}){return(0,V.jsxs)(tw,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,V.jsx)(yW,{part:e.part,size:25}),(0,V.jsx)(`span`,{children:e.part})]})}function _oe(e){let t=t6(e).length;return(0,F.useMemo)(()=>{let e=[{id:0,numeric:!1,label:`Part`,getDisplay:e=>e.part,getForTotal:()=>0,Cell:goe},{id:1,numeric:!0,label:`Shift 1 Planned`,getDisplay:e=>e.planned.get(0)?.toString()??``,getForSort:e=>e.planned.get(0)??0,getForTotal:e=>e.planned.get(0)??0},{id:4,numeric:!0,label:`Shift 1 Completed`,getDisplay:e=>e.completed.get(0)?.toString()??``,getForSort:e=>e.completed.get(0)??0,getForTotal:e=>e.completed.get(0)??0}];return t>=2&&(e.push({id:2,numeric:!0,label:`Shift 2 Planned`,getDisplay:e=>e.planned.get(1)?.toString()??``,getForSort:e=>e.planned.get(1)??0,getForTotal:e=>e.planned.get(1)??0}),e.push({id:5,numeric:!0,label:`Shift 2 Completed`,getDisplay:e=>e.completed.get(1)?.toString()??``,getForSort:e=>e.completed.get(1)??0,getForTotal:e=>e.completed.get(1)??0})),t===3&&(e.push({id:3,numeric:!0,label:`Shift 3 Planned`,getDisplay:e=>e.planned.get(2)?.toString()??``,getForSort:e=>e.planned.get(2)??0,getForTotal:e=>e.planned.get(2)??0}),e.push({id:6,numeric:!0,label:`Shift 3 Completed`,getDisplay:e=>e.completed.get(2)?.toString()??``,getForSort:e=>e.completed.get(2)??0,getForTotal:e=>e.completed.get(2)??0})),e},[t])}function voe({columns:e,rows:t}){return(0,V.jsx)(PT,{children:e.map(e=>(0,V.jsx)(Z,{align:e.numeric?`right`:`left`,children:e.id===0?`Total`:Q.of(t).sumBy(e.getForTotal)},e.id))})}var yoe=(0,F.memo)(function({columns:e,rows:t}){let n=t2(0,e);return(0,V.jsx)(J,{sx:{overflowX:`auto`},children:(0,V.jsxs)($w,{stickyHeader:!0,children:[(0,V.jsx)(K0,{columns:e,sort:n,showDetailsCol:!1}),(0,V.jsx)(Q0,{columns:e,pageData:Q.of(t).toSortedArray(n.sortOn,e=>e.part)}),(0,V.jsx)(gT,{children:(0,V.jsx)(voe,{columns:e,rows:t})})]})})});function boe({day:e,setDay:t}){let n=YE();return(0,V.jsxs)(tw,{direction:`row`,spacing:2,sx:{alignItems:`center`},children:[(0,V.jsx)(X,{title:`Previous Day`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{disabled:e<=AE(n,-28),onClick:()=>t(e=>AE(e,-1)),children:(0,V.jsx)(SE,{})})})}),(0,V.jsx)(q,{sx:{minWidth:`14em`,textAlign:`center`},children:hoe.format(e)}),(0,V.jsx)(X,{title:`Next Day`,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Oh,{disabled:e>=n,onClick:()=>t(e=>AE(e,1)),children:(0,V.jsx)(xE,{})})})})]})}var xoe=`"shifts day export" auto / 1fr 1fr 1fr`,Soe=`"shifts export" auto
333
333
  "day day" auto / 1fr auto`,Coe=function({day:e,setDay:t,columns:n,rows:r}){return(0,V.jsxs)(J,{component:`nav`,sx:{display:`grid`,gridTemplate:{md:xoe,xs:Soe},minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsx)(J,{sx:{gridArea:`shifts`,justifySelf:`flex-start`},children:(0,V.jsx)(doe,{})}),(0,V.jsx)(J,{sx:{gridArea:`day`,justifySelf:`center`},children:(0,V.jsx)(boe,{day:e,setDay:t})}),(0,V.jsx)(J,{sx:{gridArea:`export`,justifySelf:`flex-end`},children:(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{onClick:()=>r2(n,r),children:(0,V.jsx)(lE,{})})})})]})};function woe(){LL(`Recent Completed Parts`);let[e,t]=(0,F.useState)(YE),n=_oe(e),r=moe(e);return(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsx)(Coe,{day:e,setDay:t,rows:r,columns:n}),(0,V.jsx)(`main`,{children:(0,V.jsx)(yoe,{rows:r,columns:n})})]})}function Toe(){let[e,t]=(0,F.useState)(!1);function n(){t(!0),Yt.enableVerboseLoggingForFiveMinutes(),setTimeout(()=>t(!1),3e5)}return(0,V.jsx)(`main`,{style:{marginTop:`4em`},children:(0,V.jsxs)(`div`,{style:{maxWidth:`50em`,marginLeft:`auto`,marginRight:`auto`,textAlign:`center`},children:[(0,V.jsx)(`p`,{style:{marginBottom:`1em`},children:`Verbose logging generates a large amount of additional data in the FMS Insight Server debug log file.`}),(0,V.jsx)(Y,{disabled:e,onClick:n,variant:`contained`,children:e?(0,V.jsx)(`span`,{children:`Verbose Logging is Enabled`}):(0,V.jsx)(`span`,{children:`Enable Verbose Logging For 5 minutes`})})]})})}function Eoe(){return(0,V.jsxs)(`svg`,{width:`30px`,height:`30px`,viewBox:`0 0 170 170`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,V.jsxs)(`defs`,{children:[(0,V.jsx)(`path`,{id:`t`,d:`m307.5 125v77.5h-40c6.92-6.52 11.25-10.6 12.98-12.23 10.65-10.04 13.56-25.81 7.21-38.99-1.7-3.5-5.92-12.26-12.69-26.28z`}),(0,V.jsx)(`path`,{id:`ag`,d:`m273.88 120.52c-0.13 0.28-4.87 3.3-11.17 0.5-6.3-2.81-11.99-9.96-11.67-10.67 0.32-0.72 9.44-1.27 15.74 1.53 6.3 2.81 7.23 8.35 7.1 8.64z`}),(0,V.jsx)(`path`,{id:`m`,d:`m259 102.25c-0.13 0.29-4.2 3.61-9.02 1.46-4.81-2.14-8.75-8.51-8.43-9.23 0.31-0.71 7.69-2.05 12.5 0.1 4.82 2.14 5.07 7.39 4.95 7.67z`}),(0,V.jsx)(`path`,{id:`x`,d:`m282.79 114.2c-0.2 0.24-5.59 1.84-10.87-2.59-5.29-4.44-8.78-12.88-8.28-13.48 0.5-0.59 9.42 1.38 14.7 5.82 5.29 4.43 4.65 10.02 4.45 10.25z`}),(0,V.jsx)(`path`,{id:`k`,d:`m268.39 125.43c-0.12-0.28-4.33-3.54-9.45-1.26s-9.41 8.81-9.1 9.52c0.32 0.71 8.05 1.89 13.17-0.39s5.51-7.58 5.38-7.87z`}),(0,V.jsx)(`path`,{id:`ae`,d:`m243.83 111.58c0 0.31-2.61 5-8.43 5s-12.65-4.22-12.65-5 6.83-5 12.65-5 8.43 4.69 8.43 5z`}),(0,V.jsx)(`path`,{id:`l`,d:`m304.24 109.88c-0.31 0.04-5.38-2.38-6.34-9.21s2.09-15.44 2.86-15.55 6.08 7.33 7.04 14.16-3.25 10.55-3.56 10.6z`}),(0,V.jsx)(`path`,{id:`u`,d:`m306.79 80.57c-0.31 0.05-5.31-1.83-6.1-7.47-0.79-5.63 2.45-12.84 3.23-12.95 0.77-0.11 5.88 5.92 6.67 11.56s-3.49 8.82-3.8 8.86z`}),(0,V.jsx)(`path`,{id:`a`,d:`m306.13 58.04c-0.31 0.05-5.23-1.3-5.86-5.74-0.62-4.43 2.83-10.24 3.6-10.34 0.77-0.11 5.68 4.51 6.31 8.95 0.62 4.44-3.74 7.09-4.05 7.13z`}),(0,V.jsx)(`path`,{id:`f`,d:`m295.52 118.45c-0.29 0.13-6.1-1.39-9.5-9.02-3.39-7.64-3.53-18.31-2.82-18.63 0.72-0.32 8.56 6.93 11.96 14.56s0.64 12.97 0.36 13.09z`}),(0,V.jsx)(`path`,{id:`b`,d:`m272.35 90.11c-0.26 0.19-5.76 0.58-9.58-4.67-3.82-5.26-4.88-13.9-4.25-14.36s8.52 3.23 12.34 8.48 1.74 10.37 1.49 10.55z`}),(0,V.jsx)(`path`,{id:`s`,d:`m289.97 85.66c-0.28 0.13-5.97-0.97-9.17-7.84-3.21-6.87-3.15-16.73-2.44-17.06s8.3 5.96 11.5 12.83 0.4 11.94 0.11 12.07z`}),(0,V.jsx)(`path`,{id:`n`,d:`m270.16 65.57c-0.28 0.14-5.38 0.38-7.35-3.65-1.96-4.03-0.48-10.62 0.22-10.96s6.8 2.54 8.77 6.58c1.97 4.03-1.36 7.9-1.64 8.03z`}),(0,V.jsx)(`path`,{id:`ah`,d:`m250 80c-0.17 0.26-4.4 3.11-8.12 0.69s-5.79-8.79-5.37-9.45c0.43-0.65 7.1-1.35 10.82 1.06 3.72 2.42 2.84 7.44 2.67 7.7z`}),(0,V.jsx)(`path`,{id:`y`,d:`m236.47 96.58c-0.11 0.29-3.72 3.89-7.83 2.23-4.12-1.66-7.37-7.53-7.07-8.25 0.29-0.72 6.7-2.68 10.81-1.02 4.12 1.66 4.21 6.75 4.09 7.04z`}),(0,V.jsx)(`path`,{id:`aa`,d:`m290.52 56.48c-0.28 0.14-5.35 0.58-7.44-3.33-2.08-3.92-0.8-10.5-0.11-10.87s6.86 2.25 8.94 6.17c2.09 3.92-1.12 7.88-1.39 8.03z`}),(0,V.jsx)(`path`,{id:`af`,d:`m274.18 138.46c-0.16-0.26-5.28-2.6-11.13 1.06s-10.48 11.53-10.07 12.19 9.52-0.05 15.37-3.71 6-9.27 5.83-9.54z`}),(0,V.jsx)(`path`,{id:`z`,d:`m247.89 137.78c0.11 0.29-0.65 5.6-6.08 7.69-5.43 2.08-13.32 0.59-13.6-0.14s4.58-7.11 10.01-9.2c5.44-2.08 9.56 1.36 9.67 1.65z`}),(0,V.jsx)(`path`,{id:`h`,d:`m235.06 125.39c0.1 0.3-0.26 5.38-4.46 6.83-4.19 1.44-10.49-0.85-10.75-1.59-0.25-0.74 3.3-6.42 7.5-7.87 4.19-1.44 7.61 2.34 7.71 2.63z`}),(0,V.jsx)(`path`,{id:`ab`,d:`m317.14 85.63c0.28 0.13 5.97-0.98 9.17-7.85 3.21-6.87 3.14-16.72 2.44-17.05-0.71-0.33-8.3 5.95-11.5 12.82-3.21 6.87-0.4 11.94-0.11 12.08z`}),(0,V.jsx)(`path`,{id:`ac`,d:`m299.61 124.96v77.5h40c-6.93-6.52-11.25-10.6-12.99-12.23-10.64-10.03-13.56-25.81-7.2-38.99 1.69-3.5 5.92-12.26 12.69-26.28z`}),(0,V.jsx)(`path`,{id:`c`,d:`m348.11 102.22c0.13 0.28 4.2 3.6 9.01 1.46 4.82-2.15 8.76-8.52 8.44-9.23-0.32-0.72-7.69-2.05-12.5 0.09-4.82 2.14-5.08 7.39-4.95 7.68z`}),(0,V.jsx)(`path`,{id:`p`,d:`m324.32 114.17c0.2 0.24 5.59 1.83 10.87-2.6 5.29-4.43 8.78-12.87 8.28-13.47s-9.42 1.38-14.71 5.81c-5.28 4.43-4.64 10.02-4.44 10.26z`}),(0,V.jsx)(`path`,{id:`o`,d:`m338.71 125.4c0.13-0.29 4.34-3.55 9.46-1.27s9.41 8.81 9.09 9.52c-0.31 0.72-8.04 1.9-13.16-0.38s-5.51-7.59-5.39-7.87z`}),(0,V.jsx)(`path`,{id:`j`,d:`m363.28 111.54c0 0.32 2.61 5 8.43 5s12.65-4.21 12.65-5c0-0.78-6.83-5-12.65-5s-8.43 4.69-8.43 5z`}),(0,V.jsx)(`path`,{id:`w`,d:`m311.59 118.42c0.29 0.12 6.1-1.4 9.49-9.03 3.4-7.63 3.54-18.31 2.82-18.63-0.71-0.32-8.55 6.93-11.95 14.56s-0.64 12.97-0.36 13.1z`}),(0,V.jsx)(`path`,{id:`i`,d:`m334.76 90.08c0.25 0.18 5.76 0.57 9.58-4.68 3.81-5.25 4.88-13.9 4.25-14.36s-8.53 3.23-12.34 8.48c-3.82 5.26-1.74 10.37-1.49 10.56z`}),(0,V.jsx)(`path`,{id:`r`,d:`m333.23 120.48c0.12 0.29 4.86 3.31 11.17 0.5 6.3-2.81 11.98-9.96 11.67-10.67-0.32-0.71-9.44-1.27-15.74 1.53-6.3 2.81-7.23 8.35-7.1 8.64z`}),(0,V.jsx)(`path`,{id:`ad`,d:`m336.95 65.54c0.28 0.13 5.38 0.38 7.35-3.66 1.96-4.03 0.48-10.61-0.22-10.96-0.7-0.34-6.81 2.55-8.77 6.58-1.97 4.03 1.36 7.9 1.64 8.04z`}),(0,V.jsx)(`path`,{id:`ai`,d:`m357.11 79.96c0.17 0.27 4.39 3.11 8.12 0.69 3.72-2.41 5.79-8.79 5.36-9.44-0.42-0.66-7.09-1.36-10.81 1.06-3.72 2.41-2.84 7.43-2.67 7.69z`}),(0,V.jsx)(`path`,{id:`d`,d:`m370.63 96.55c0.12 0.29 3.73 3.89 7.84 2.22 4.11-1.66 7.37-7.52 7.07-8.25-0.29-0.72-6.7-2.68-10.82-1.02-4.11 1.66-4.2 6.76-4.09 7.05z`}),(0,V.jsx)(`path`,{id:`q`,d:`m316.59 56.44c0.28 0.15 5.35 0.59 7.43-3.33 2.09-3.92 0.81-10.5 0.12-10.87-0.69-0.36-6.86 2.26-8.95 6.17-2.08 3.92 1.12 7.88 1.4 8.03z`}),(0,V.jsx)(`path`,{id:`v`,d:`m332.93 138.42c0.16-0.26 5.28-2.59 11.13 1.06 5.85 3.66 10.48 11.53 10.07 12.19-0.42 0.66-9.52-0.05-15.37-3.71-5.85-3.65-6-9.27-5.83-9.54z`}),(0,V.jsx)(`path`,{id:`g`,d:`m359.22 137.74c-0.11 0.29 0.65 5.61 6.08 7.69 5.43 2.09 13.32 0.59 13.6-0.13 0.28-0.73-4.59-7.12-10.02-9.21-5.43-2.08-9.55 1.36-9.66 1.65z`}),(0,V.jsx)(`path`,{id:`e`,d:`m372.05 125.36c-0.1 0.29 0.26 5.37 4.45 6.82 4.2 1.44 10.5-0.85 10.75-1.59 0.26-0.74-3.29-6.42-7.49-7.87-4.2-1.44-7.61 2.34-7.71 2.64z`})]}),(0,V.jsx)(`g`,{transform:`translate(-219.32 -33)`,visibility:`inherit`,children:(0,V.jsxs)(`g`,{visibility:`inherit`,children:[(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#t`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#t`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ag`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#ag`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#m`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#m`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#x`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#x`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#k`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#k`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ae`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#ae`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#l`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#l`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#u`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#u`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#a`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#a`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#f`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#f`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#b`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#b`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#s`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#s`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#n`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#n`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ah`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#y`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#y`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#aa`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#aa`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#af`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#af`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#z`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#z`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#h`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#h`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ab`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#ab`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ac`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#ac`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#c`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#c`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#p`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#p`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#o`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#o`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#j`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#j`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#w`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#w`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#i`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#i`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#r`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#r`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ad`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#ad`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#ai`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#d`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#d`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#q`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#q`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#v`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#v`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#g`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#g`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fill:`#DBA72E`,href:`#e`}),(0,V.jsx)(`use`,{width:`100%`,height:`100%`,fillOpacity:`0`,stroke:`#DBA72E`,href:`#e`})]})})]})}var i6=`__FMS_INSIGHT_NEW_OPERATOR__`,Doe=(0,F.memo)(function(){let e=I(Dr),[t,n]=R(gk),[r,i]=R(hk),[a,o]=(0,F.useState)(!1),[s,c]=(0,F.useState)(``);function l(e){e.target.value===i6?o(!0):n(e.target.value)}function u(e){i(t=>t.filter(t=>t!==e))}function d(){s!==``&&(i(e=>[...e.filter(e=>e!==s),s]),n(s),c(``),o(!1))}return e.user?(0,V.jsx)(`div`,{children:e.user.profile.name||e.user.profile.sub}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(fC,{value:t||``,onChange:l,variant:`standard`,renderValue:e=>e,children:[Q.of(r).sortBy(e=>e).map((e,t)=>(0,V.jsxs)(sS,{value:e,children:[(0,V.jsx)(sx,{primary:e}),(0,V.jsx)(nx,{children:(0,V.jsx)(Oh,{edge:`end`,onClick:()=>u(e),size:`large`,children:(0,V.jsx)(Yne,{})})})]},t)),(0,V.jsx)(sS,{value:i6,children:(0,V.jsx)(`em`,{children:`Create New Operator`})},`new`)]}),(0,V.jsxs)(jy,{open:a,onClose:()=>{o(!1),c(``)},children:[(0,V.jsx)(Wy,{children:`Create New Operator`}),(0,V.jsx)(Vy,{children:(0,V.jsx)(GT,{value:s,onChange:e=>c(e.target.value),label:`New Name`,variant:`outlined`,autoFocus:!0,sx:{mt:`0.5em`},onKeyUp:e=>{e.keyCode===13&&d()}})}),(0,V.jsxs)(Fy,{children:[(0,V.jsxs)(Y,{disabled:s===``,onClick:d,children:[`Create `,s]}),(0,V.jsx)(Y,{onClick:()=>{c(``),o(!1)},children:`Cancel`})]})]})]})}),Ooe=(0,F.memo)(function(){let e=I(pG),t=I(uz),n=I(vG),r=I(fz),i=I(FL).route===$.ChooseMode,[a,o]=(0,F.useState)(!1);return(0,V.jsxs)(V.Fragment,{children:[!i&&(n!=null||r!=null)?(0,V.jsx)(X,{title:`Error`,children:(0,V.jsx)(Oh,{"aria-label":`Error`,onClick:()=>o(!0),size:`large`,children:(0,V.jsx)($ne,{})})}):void 0,e||t?(0,V.jsx)(X,{title:`Loading`,children:(0,V.jsx)(Sh,{"data-testid":`loading-icon`,color:`secondary`})}):void 0,(0,V.jsxs)(jy,{open:a&&!i,onClose:()=>o(!1),children:[(0,V.jsx)(Wy,{children:`Error`}),(0,V.jsxs)(Vy,{children:[n===null?void 0:(0,V.jsx)(`p`,{children:n}),r===null?void 0:(0,V.jsx)(`p`,{children:r})]}),(0,V.jsx)(Fy,{children:(0,V.jsx)(Y,{onClick:()=>o(!1),children:`Close`})})]})]})}),koe=(0,F.memo)(function(){let e=I(Dr)?.customStationMonitorDialogUrl,[t,n]=(0,F.useState)(!1);if(!e)return null;let r=e.split(`/`),i=r[r.length-1];return i=i[0].toUpperCase()+i.substr(1),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{title:i,children:(0,V.jsx)(Oh,{onClick:()=>n(!0),size:`large`,children:(0,V.jsx)(fre,{})})}),(0,V.jsxs)(jy,{open:t,onClose:()=>n(!1),fullWidth:!0,maxWidth:`md`,children:[(0,V.jsx)(Wy,{children:i}),(0,V.jsx)(Vy,{children:(0,V.jsx)(`iframe`,{width:`100%`,src:e,sandbox:`allow-scripts`,style:{border:0,height:`calc(100vh - 250px)`}})}),(0,V.jsx)(Fy,{children:(0,V.jsx)(Y,{color:`primary`,onClick:()=>n(!1),children:`Close`})})]})]})});function Aoe({d:e}){let t=HE(e,YE());return t>7?null:t>=0?(0,V.jsxs)(q,{variant:`subtitle1`,children:[`License expires on `,e.toDateString()]}):(0,V.jsxs)(q,{variant:`h6`,children:[`License expired on `,e.toDateString()]})}function a6(){let e=I(Dr),t=``;return t=e.name?(e.name||``)+` `+(e.version||``):`SeedTactic FMS Insight`,(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{title:t,children:(0,V.jsx)(`div`,{children:(0,V.jsx)(Eoe,{})})}),(0,V.jsx)(q,{variant:`h6`,style:{marginLeft:`1em`,marginRight:`2em`},children:`Insight`}),e?.licenseExpires?(0,V.jsx)(Aoe,{d:e.licenseExpires}):void 0]})}function joe(){let e=I(vk).alarms,[t,n]=(0,F.useState)(!1),r=(0,F.useId)(),i=e.length,a=i===0?`No alarms`:`${i} ${i===1?`alarm`:`alarms`}`,o=i===1?e[0]:a;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(X,{title:o,children:(0,V.jsx)(Oh,{"aria-label":a,"aria-haspopup":`dialog`,color:i>0?`error`:`inherit`,size:`large`,onClick:()=>n(!0),children:(0,V.jsx)(hv,{badgeContent:i,color:`error`,children:(0,V.jsx)(cre,{})})})}),(0,V.jsxs)(jy,{open:t,onClose:()=>n(!1),"aria-labelledby":r,fullWidth:!0,maxWidth:`sm`,scroll:`paper`,children:[(0,V.jsx)(Wy,{id:r,children:`System alarms`}),(0,V.jsx)(Vy,{dividers:!0,children:i===0?(0,V.jsx)(q,{children:`No alarms.`}):(0,V.jsx)(ex,{disablePadding:!0,children:e.map((e,t)=>(0,V.jsx)(rx,{disableGutters:!0,divider:t<i-1,children:(0,V.jsx)(sx,{primary:e,slotProps:{primary:{sx:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`}}}})},t))})}),(0,V.jsx)(Fy,{children:(0,V.jsx)(Y,{onClick:()=>n(!1),children:`Close`})})]})]})}function Moe(){let e=I(FL);return(0,V.jsx)(X,{title:`Help`,children:(0,V.jsx)(Oh,{"aria-label":`Help`,href:Aie(e),target:`_help`,size:`large`,children:(0,V.jsx)(sE,{})})})}function Noe(){return(0,V.jsx)(X,{title:`Logout`,children:(0,V.jsx)(Oh,{"aria-label":`Logout`,onClick:kr,size:`large`,children:(0,V.jsx)(ere,{})})})}function o6({showAlarms:e,showLogout:t,showSearch:n}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Ooe,{}),(0,V.jsx)(koe,{}),n?(0,V.jsx)(jJ,{}):void 0,n?(0,V.jsx)(IX,{}):void 0,(0,V.jsx)(Moe,{}),t?(0,V.jsx)(Noe,{}):void 0,e?(0,V.jsx)(joe,{}):void 0]})}function Poe({menuNavs:e}){let t=I(Dr),[n,r]=R(FL),[i,a]=(0,F.useTransition)();return(0,V.jsx)(db,{size:`small`,children:(0,V.jsx)(fC,{value:n.route,sx:{width:`16.5em`},onChange:t=>a(()=>{let n=e.find(e=>`separator`in e?!1:e.route.route===t.target.value);!n||`separator`in n||r(n.route)}),renderValue:()=>{let r=e.find(e=>`separator`in e?!1:e.route.route===n.route);return!r||`separator`in r?null:(0,V.jsxs)(J,{sx:{display:`flex`,alignItems:`center`},children:[r.icon,(0,V.jsxs)(q,{variant:`h6`,style:{marginLeft:`1em`},children:[typeof r.name==`string`?r.name:r.name(t),i?`...`:``]})]})},children:e.map((e,n)=>`separator`in e?(0,V.jsx)(F_,{children:e.separator},e.separator):e.hidden?.(t)?void 0:(0,V.jsxs)(sS,{value:e.route.route,children:[(0,V.jsx)(ax,{children:e.icon}),(0,V.jsx)(sx,{primary:typeof e.name==`string`?e.name:e.name(t)})]},n))})})}function Foe({showAlarms:e,showLogout:t,showSearch:n,showOperator:r,Nav1:i,Nav2:a,menuNavs:o}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(eg,{position:`static`,sx:{display:{xs:`none`,md:`block`}},children:(0,V.jsx)(ET,{children:(0,V.jsxs)(J,{sx:{display:`grid`,gridTemplateColumns:a?`1fr auto 1fr`:`minmax(200px, 1fr) auto`,width:`100vw`,gridTemplateAreas:a?`"nav navCenter tools"`:`"nav tools"`},children:[(0,V.jsxs)(J,{sx:{gridArea:`nav`,display:`flex`,alignItems:`center`},children:[(0,V.jsx)(a6,{}),i?(0,V.jsx)(i,{}):void 0]}),a?(0,V.jsx)(J,{sx:{gridArea:`navCenter`},children:(0,V.jsx)(a,{})}):void 0,(0,V.jsxs)(J,{sx:{gridArea:`tools`,display:`flex`,alignItems:`center`,justifyContent:`flex-end`},children:[r?(0,V.jsx)(Doe,{}):void 0,(0,V.jsx)(o6,{showAlarms:e,showLogout:t,showSearch:n})]})]})})}),(0,V.jsxs)(eg,{position:`static`,sx:{display:{xs:`block`,md:`none`}},children:[(0,V.jsxs)(ET,{children:[(0,V.jsx)(a6,{}),(0,V.jsx)(`div`,{style:{flexGrow:1}}),(0,V.jsx)(o6,{showAlarms:e,showLogout:t,showSearch:n})]}),(0,V.jsxs)(J,{sx:{display:`grid`,gridTemplateColumns:`minmax(200px, 1fr) auto`},children:[(0,V.jsx)(J,{sx:{gridColumn:`1`},children:i?(0,V.jsx)(i,{}):void 0}),(0,V.jsx)(J,{sx:{gridColumn:`2`},children:a?(0,V.jsx)(a,{}):void 0})]})]}),o&&o.length>0?(0,V.jsx)(um,{elevation:4,square:!0,component:`nav`,sx:{display:{xs:`block`,xl:`none`},padding:`2px`},children:(0,V.jsx)(Poe,{menuNavs:o})}):void 0]})}function Ioe({menuItems:e}){let t=I(Dr),[n,r]=R(FL),[i,a]=(0,F.useTransition)();return!e||e.length===0?null:(0,V.jsx)(um,{elevation:3,square:!0,sx:{flexShrink:0,display:{xs:`none`,xl:`block`},minHeight:`calc(100vh - 64px)`,zIndex:1},children:(0,V.jsx)(ex,{dense:!0,children:e?.map((e,o)=>`separator`in e?(0,V.jsx)(F_,{children:e.separator},e.separator):e.hidden?.(t)?void 0:(0,V.jsx)(rx,{children:(0,V.jsxs)(tx,{selected:n.route===e.route.route,onClick:()=>a(()=>r(e.route)),children:[(0,V.jsx)(ax,{children:e.icon}),(0,V.jsx)(sx,{primary:typeof e.name==`string`?e.name:e.name(t),sx:i?e=>({color:e.palette.grey[700]}):void 0})]})},o))})})}function Loe(e,t,n){return[{id:0,numeric:!1,label:`Date`,getDisplay:e=>e.endTime.toLocaleString(),getForSort:e=>e.endTime.getTime()},{id:1,numeric:!1,label:`Part`,getDisplay:e=>e.part+`-`+Q.of(e.material).map(e=>e.proc).distinctAndSortBy(e=>e).toRArray().join(`:`)},{id:2,numeric:!1,label:`Station`,getDisplay:e=>eA(e.stationGroup,e.stationNumber,t)},{id:6,numeric:!1,label:`Operation`,getDisplay:e=>e.operation},{id:3,numeric:!1,label:`Carrier`,getDisplay:e=>rA(e,n),getForSort:e=>iA(e)},{id:4,numeric:!1,label:`Serial`,getDisplay:e=>e.material.filter(e=>e.serial).map(e=>e.serial).join(`, `)},{id:5,numeric:!1,label:`Workorder`,getDisplay:e=>e.material.filter(e=>e.workorder).map(e=>e.workorder).join(`, `)},{id:7,numeric:!1,label:`Inspection`,getDisplay:t=>FA(t,e),getForSort:t=>Q.of(t.material).collect(t=>e.get(t.id)).flatMap(e=>e.signaledInspections).distinct().toSortedArray(e=>e).join(`,`)},{id:8,numeric:!0,label:`Elapsed Min`,getDisplay:e=>(e.elapsedMinsPerMaterial*e.material.length).toFixed(1)},{id:9,numeric:!0,label:`Target Min`,getDisplay:e=>e.activeMinutes.toFixed(1)},{id:10,numeric:!0,label:`Median Elapsed Min`,getDisplay:e=>e.medianCycleMinutes.toFixed(1)},{id:11,numeric:!0,label:`Median Deviation`,getDisplay:e=>e.MAD_aboveMinutes.toFixed(1)}]}function Roe(e,t,n,r,i){let a;for(let e of t)e.id===r&&(a=e.getForSort||e.getDisplay);a===void 0&&(a=t[0].getForSort||t[0].getDisplay);let o=a,s=Q.of(e.values()).flatMap(e=>e);return(n?s.filter(e=>e.endTime>=n.start&&e.endTime<=n.end):s).toSortedArray(i===`desc`?{desc:o}:{asc:o},i===`desc`?{desc:e=>e.endTime.getTime()}:{asc:e=>e.endTime.getTime()})}function zoe(e){let t,n=e.set_date_zoom_range;return n&&(t=e.period.type===`Last30`?{type:`Last30Days`,set_days_back:e=>{if(e){let t=new Date;n({zoom:{start:AE(t,-e),end:NE(t,1)}})}else n({zoom:void 0})}}:{type:`ZoomIntoRange`,default_date_range:[e.period.month,jE(e.period.month,1)],current_date_zoom:e.current_date_zoom,set_date_zoom_range:e=>n({zoom:e})}),{zoom:t,zoomRange:e.current_date_zoom}}var s6=(0,F.memo)(function(e){let t=I(Dr),n=Loe(e.matsById,t.loadStationNames,nA(t.basketName)),r=t2(0,n),i=e2(),a=zoe(e),[o,s]=(0,F.useState)(null),c=L(cL),l=Roe(e.points,n,e.current_date_zoom,r.orderBy,r.order),u=l.length,d=l.slice(i.page*i.rowsPerPage,(i.page+1)*i.rowsPerPage),f=n.filter(t=>!(!e.showWorkorderAndInspect&&t.id===5||!e.showWorkorderAndInspect&&t.id===7||e.hideMedian&&t.id===10||e.hideMedian&&t.id===11));return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)($w,{children:[(0,V.jsx)(K0,{columns:f,sort:r,showDetailsCol:!0}),(0,V.jsx)(Q0,{columns:f,pageData:d,rowsPerPage:i.rowsPerPage,onClickDetails:(e,t)=>{t.material.length!==0&&(t.material.length===1?c({type:`LogMat`,logMat:t.material[0]}):s({anchorEl:e.currentTarget,material:t.material}))},emptyMessage:e.emptyMessage})]}),(0,V.jsx)(Z0,{zoom:a.zoom,tpage:i,count:u}),(0,V.jsx)(rS,{anchorEl:o?.anchorEl,keepMounted:!0,open:o!==null,onClose:()=>s(null),children:o?.material.map((e,t)=>(0,V.jsx)(sS,{onClick:()=>{c({type:`LogMat`,logMat:e}),s(null)},children:e.serial||`Material`},t))})]})});function c6({outlierTy:e}){LL(e===`machine`?`Machine Outliers`:`L/U Outliers`);let t=I(gR),n=I(Dr),r=YE(),i=I(sA),a=(0,F.useMemo)(()=>{let t=YE(),n=AE(t,-4),r=AE(t,1);return{seriesLabel:`Part`,data:i.valuesToLazySeq().filter(t=>t.isOutlier&&t.endTime>=n&&t.endTime<r&&Kk(t)===(e===`labor`)).toRLookup(e=>e.part+`-`+e.material[0].proc.toString())}},[e,i]);return(0,V.jsxs)(J,{sx:{paddingLeft:`24px`,paddingRight:`24px`,paddingTop:`10px`},children:[(0,V.jsxs)(J,{component:`nav`,sx:{display:`flex`,minHeight:`2.5em`,alignItems:`center`,maxWidth:`calc(100vw - 24px - 24px)`},children:[(0,V.jsxs)(q,{variant:`subtitle1`,children:[e===`labor`?`Load/Unload`:`Machine`,` cycles from the past 5 days statistically outside expected range`]}),(0,V.jsx)(J,{sx:{flexGrow:1}}),(0,V.jsx)(X,{title:`Copy to Clipboard`,children:(0,V.jsx)(Oh,{style:{height:`25px`,paddingTop:0,paddingBottom:0},onClick:()=>IA(a,t.matsById,void 0,void 0,n.loadStationNames,n.basketName),size:`large`,children:(0,V.jsx)(lE,{})})})]}),(0,V.jsx)(`main`,{children:(0,V.jsx)(s6,{points:a.data,matsById:t.matsById,current_date_zoom:{start:AE(r,-4),end:AE(r,1)},set_date_zoom_range:void 0,period:{type:`Last30`},showWorkorderAndInspect:!1,defaultSortDesc:!0})})]})}var l6=class e{constructor(e,t){this.day=e,this.station=t}compare(e){let t=this.day.getTime()-e.day.getTime();return t===0?this.station.localeCompare(e.station):t}hash(){return oO(this.day,this.station)}toString(){return`{day: ${this.day.toISOString()}}, station: ${this.station}}`}adjustDay(t){return new e(t(this.day),this.station)}};function u6(e,t,n){let r=LE(e),i=LE(t);if(r.getTime()===i.getTime())return[{day:r,value:n}];{let a=[],o=t.getTime()-e.getTime();for(let s=r;s<=i;s=AE(s,1)){let r=VE([s,e]),i=(Cre([AE(s,1),t]).getTime()-r.getTime())/o;a.push({day:s,value:n*i})}return a}}function d6(e,t){return Bk(Q.of(e),e=>e.stationLabel,e=>e.endTime).flatMap(([e,n])=>n.flatMap(e=>{let n=Q.of(e).sumBy(e=>e.elapsedMinsPerMaterial*e.material.length),r=zE(e[0].endTime,-n*60),i=Q.of(e).sumBy(e=>t(e));return u6(r,e[0].endTime,i)}).map(t=>({...t,statNameAndNum:e}))).buildHashMap(e=>new l6(e.day,e.statNameAndNum),(e,t)=>t.value+(e??0))}function f6(e){return d6(e,e=>e.activeMinutes)}function Boe(e){return d6(e,e=>e.elapsedMinsPerMaterial*e.material.length)}function p6(e){let t=[];for(let n of e)if(t.length===0)t.push(n);else{let e=t[t.length-1];n.start<=e.end?t[t.length-1]={start:e.start,end:VE([e.end,n.end])}:t.push(n)}return t}function m6(e){return Q.of(e).filter(e=>e.plannedDown).toLookupOrderedMap(e=>e.stationLabel,e=>e.start).toAscLazySeq().flatMap(([e,t])=>p6(t.valuesToAscLazySeq()).flatMap(t=>u6(t.start,t.end,KE(t.end,t.start)).map(t=>({...t,station:e})))).toHashMap(e=>[new l6(e.day,e.station),e.value],(e,t)=>e+t)}function h6(e){let t=Q.of(e).filter(e=>e.plannedDown).toLookupOrderedMap(e=>e.stationLabel,e=>e.start).mapValues(e=>p6(e.valuesToAscLazySeq()));return Q.of(e).filter(e=>!e.plannedDown).toLookupOrderedMap(e=>e.stationLabel,e=>e.start).toAscLazySeq().flatMap(([e,n])=>{let r=p6(n.valuesToAscLazySeq()),i=t.get(e)??[];for(let e=0,t=0;t<r.length;)if(e<i.length&&i[e].end<=r[t].start)e++;else if(e<i.length&&i[e].start<r[t].end){let n=r[t].start,a=r[t].end,o=i[e].start,s=i[e].end;o<=n&&s>=a?r.splice(t,1):o<=n?(r[t]={start:s,end:a},e+=1):s>=a?(r[t]={start:n,end:o},t+=1):(r[t]={start:n,end:o},r.splice(t+1,0,{start:s,end:a}),e++,t++)}else t++;return r.flatMap(t=>u6(t.start,t.end,KE(t.end,t.start)).map(t=>({...t,station:e})))}).toHashMap(e=>[new l6(e.day,e.station),e.value],(e,t)=>e+t)}function Voe(e,t,n,r,i){let a=f6(Q.of(r).filter(r=>n===`labor`===Kk(r)&&r.endTime>=e&&r.endTime<=t)),o=Q.of(i).filter(r=>n===`labor`===r.station.startsWith(`L/U`)&&r.end>=e&&r.start<=t),s=m6(o),c=h6(o),l=[],u=a.keysToLazySeq().concat(c.keysToLazySeq()).map(e=>e.station).distinct().toSortedArray(e=>e);for(let n of u){let r=[];for(let i=e;i<t;i=AE(i,1)){let e=new l6(i,n),t=a.get(e),o=c.get(e),l=s.get(e)??0;r.push({x:i.toLocaleDateString(),y:(t??0)/60,plannedHours:(o??0)/60,actualOee:l<1440?(t??0)/(1440-l):0,plannedOee:l<1440?(o??0)/(1440-l):0,station:n,day:i})}l.push({station:n,points:r})}return l}var g6=class{constructor(e,t){this.x=e,this.y=t}compare(e){let t=this.x-e.x;return t===0?this.y.localeCompare(e.y):t}hash(){return oO(this.x,this.y)}toString(){return`{x: ${new Date(this.x).toISOString()}, y: ${this.y}}`}};function Hoe(e,t){let n=Q.of(t).toHashMap(e=>[new g6(e.x.getTime(),e.y),e],(e,t)=>t),r=Q.of(t).map(e=>e.x.getTime()).distinct().toSortedArray(e=>e),i=Q.of(t).map(e=>e.y).distinct().toSortedArray(e=>e),a=`<table>
334
334
  <thead><tr><th>`+e+`</th>`;for(let e of r)a+=`<th>`+new Date(e).toDateString()+`</th>`;a+=`</tr></thead>
335
335
  <tbody>
@@ -168,7 +168,8 @@ export function StationToolbar() {
168
168
  return (_jsxs(Box, { component: "nav", sx: full ? toolbarStyle : inHeaderStyle, children: [curType === StationMonitorType.LoadUnload ? (fmsInfo.loadStationNames && Object.keys(fmsInfo.loadStationNames).length > 0 ? (_jsx(Select, { value: loadNum, onChange: (e) => setLoadNumber(e.target.value.toString()), variant: "standard", style: { marginLeft: "1em", minWidth: "8em" }, children: LazySeq.of(Object.entries(fmsInfo.loadStationNames))
169
169
  .sortBy(([key]) => parseInt(key))
170
170
  .map(([stationNum, name]) => (_jsx(MenuItem, { value: parseInt(stationNum), children: name }, stationNum))) }, "loadnumselect")) : (_jsx(Input, { type: "number", placeholder: "Load Station Number", value: loadNum, onChange: (e) => setLoadNumber(e.target.value), style: { width: "3em", marginLeft: "1em" } }, "loadnumselect"))) : undefined, curType === StationMonitorType.Inspection ? (_jsxs(Select, { value: curInspType || allInspSym, onChange: (e) => setInspType(e.target.value), variant: "standard", style: { marginLeft: "1em" }, children: [_jsx(MenuItem, { value: allInspSym, children: _jsx("em", { children: "All" }) }, allInspSym), LazySeq.of(inspTypes)
171
- .sortBy((x) => x)
171
+ .concat(curInspType ? [curInspType] : [])
172
+ .distinctAndSortBy((x) => x)
172
173
  .map((ty) => (_jsx(MenuItem, { value: ty, children: ty }, ty)))] }, "inspselect")) : undefined, curType === StationMonitorType.LoadUnload ? (_jsxs(FormControl, { style: { marginLeft: "1em" }, children: [currentQueues.length === 0 ? (_jsx("label", { style: {
173
174
  position: "absolute",
174
175
  top: "10px",
package/dist/index.html CHANGED
@@ -6,7 +6,7 @@
6
6
  <link rel="shortcut icon" href="/assets/favicon-gWFxiJK2.ico" />
7
7
  <title>SeedTactic FMS Insight</title>
8
8
  <style type="text/css">.download-loader{width:100px;height:100px;display:inline-block}.download-circular{width:100px;height:100px;animation:2s linear infinite rotate}.download-path{stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;stroke:#8d6e63;animation:1.5s ease-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}</style>
9
- <script type="module" crossorigin src="/assets/index-B0B_a7c8.js"></script>
9
+ <script type="module" crossorigin src="/assets/index-BqTNkPt2.js"></script>
10
10
  <link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
11
11
  </head>
12
12
  <body>