text: (this.webpackJsonpfeedrate=this.webpackJsonpfeedrate||[]).push([[0],{69:function(e,t,a){},70:function(e,t,a){},73:function(e,t,a){"use strict";a.r(t);var i=a(0),d=a.n(i),n=a(27),s=a.n(n),c=(a(69),a(19)),r=(a(70),a(112)),l=a(113),o=a(115),u=a(114),v=a(6);function j(e,t,a){return void 0!==a?{key:t,text:a,data:e}:{key:t,text:t.toString(),data:e}}var m={root:{flexGrow:1}},f=[{text:"mm",key:"mm",styles:m},{text:"inches",key:"inch",styles:m}],h=[j(2,"PowerRoute"),j(1,"M3"),j(.7,"CarveKing"),j(1.7,"MegaV")],b=[j(0,'1/16"'),j(1,'1/8"'),j(2,'3/16"'),j(3,'1/4"'),j(0,"2mm"),j(1,"3mm"),j(2,"5mm"),j(3,"6mm")],x=[j(1,1),j(2,2),j(3,3),j(4,4)],O=[j(.5,"Conservative"),j(1,"Normal"),j(1.33,"Aggressive")],p=[j({feedRate:[7e-4,9e-4,.001,.0011],depth:[.012,.018,.0175,.0175],frMult:new Map([["PowerRoute",1.6]])},"Aluminum (6061)"),j({feedRate:[.0015,.002,.0023,.0027],depth:[.05,.065,.075,.075],frMult:new Map([["PowerRoute",2]])},"Hard Plastic (i.e. acrylic, pvc)"),j({feedRate:[.0012,.0016,.002,.0023],depth:[.04,.06,.08,.08],frMult:new Map([["PowerRoute",2]])},"Hardwood (i.e. maple, oak, walnut)"),j({feedRate:[.0018,.002,.0023,.0027],depth:[.08,.12,.16,.17],frMult:new Map([["PowerRoute",2]])},"MDF"),j({feedRate:[.0016,.002,.0023,.0025],depth:[.06,.07,.08,.08],frMult:new Map([["PowerRoute",2]])},"Soft Plastic (i.e. abs, styrofoam)"),j({feedRate:[.0016,.0022,.0024,.0028],depth:[.06,.1,.14,.16],frMult:new Map([["PowerRoute",2]])},"Softwood (i.e. pine, cedar, fir)")];function w(e,t){var a=e.toFixed(t);if(a.indexOf(".")>-1)for(var i=a.length-1;i>0;i--)if("0"!==a[i])return a.substring(0,"."===a[i]?i:i+1);return a}var y=function(){var e=d.a.useState(0),t=Object(c.a)(e,2),a=t[0],i=t[1],n=d.a.useState("mm"),s=Object(c.a)(n,2),j=s[0],m=s[1],y=d.a.useState(1),C=Object(c.a)(y,2),g=C[0],R=C[1],M=d.a.useState(1),N=Object(c.a)(M,2),S=N[0],k=N[1],P=d.a.useState(1),F=Object(c.a)(P,2),D=F[0],K=F[1],A=d.a.useState(2),L=Object(c.a)(A,2),T=L[0],B=L[1],H=d.a.useState(15e3),I=Object(c.a)(H,2),J=I[0],E=I[1],G=0,U=0,V=0;if(void 0!==a&&void 0!==D&&void 0!==g&&void 0!==T&&void 0!==S){var q=p[T].data,z=b[g].data,Q=x[S].key,W=h[a].data,X=h[a].key,Y=O[D].data;if(void 0!==q&&void 0!==z&&void 0!==W&&void 0!==Y){var Z="mm"===j?25.4:1;G=q.feedRate[z]*J*Q;var $=q.frMult.get(X)||1;G=Math.min(320,G*$)*Z,U=q.depth[z]*W*Y*Z,V=G/(J*Q)*Z}}function _(e,t,a,i){return Object(v.jsxs)("div",{className:"divRow",children:[Object(v.jsx)("div",{className:"divCell",children:e}),Object(v.jsx)("div",{className:"divCell",children:Object(v.jsx)(r.a,{defaultSelectedKey:t[a].key,placeholder:e,options:t,onChange:function(e,t,a){return void 0!==a&&i(a)},selectedKey:t[a].key})})]})}function ee(e,t,a,i){return Object(v.jsxs)("div",{className:"divRow",children:[Object(v.jsx)("div",{className:"divCell",children:e}),Object(v.jsx)("div",{className:"divCell",children:Object(v.jsx)(l.a,{readOnly:!0,value:w(t,a)+" "+i})})]})}return Object(v.jsxs)("div",{children:[Object(v.jsx)("div",{className:"center-screen",children:Object(v.jsxs)("div",{children:[Object(v.jsx)("div",{className:"header",children:"Feed Rate Calculator"}),Object(v.jsxs)("div",{className:"divTable",children:[_("Select a machine",h,a,i),_("Cutter Diameter",b,g,R),_("# of Flutes",x,S,k),_("Aggression",O,D,K),_("Material",p,T,B),Object(v.jsxs)("div",{className:"divRow",children:[Object(v.jsx)("div",{className:"divCell",children:"RPM"}),Object(v.jsx)("div",{className:"divCell",children:Object(v.jsx)(o.a,{min:800,max:25e3,value:J,onChange:E})})]}),Object(v.jsxs)("div",{className:"divRow",children:[Object(v.jsx)("div",{className:"divCell",children:"Output Units"}),Object(v.jsx)("div",{className:"divCell",children:Object(v.jsx)(u.a,{styles:{flexContainer:{display:"flex"},root:{display:"inline"}},selectedKey:j,options:f,onChange:function(e,t){t&&m("mm"===t.key?"mm":"inch")}})})]}),ee("Feed Rate",G,4,j+"/min"),ee("Depth of Cut",U,4,j),ee("Chip Load",V,6,j)]})]})}),Object(v.jsx)("a",{href:"https://github.com/kevinfrei/feedrate",style:{position:"fixed",bottom:20,right:20},children:"Source Code"})]})},C=function(e){e&&e instanceof Function&&a.e(3).then(a.bind(null,118)).then((function(t){var a=t.getCLS,i=t.getFID,d=t.getFCP,n=t.getLCP,s=t.getTTFB;a(e),i(e),d(e),n(e),s(e)}))};s.a.render(Object(v.jsx)(d.a.StrictMode,{children:Object(v.jsx)(y,{})}),document.getElementById("root")),C()}},[[73,1,2]]]);
  //# sourceMappingURL=main.ac97b2c5.chunk.js.map