2 lines
41 KiB
JavaScript
2 lines
41 KiB
JavaScript
(function(t){function e(e){for(var r,a,s=e[0],c=e[1],d=e[2],u=0,b=[];u<s.length;u++)a=s[u],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&b.push(i[a][0]),i[a]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(t[r]=c[r]);l&&l(e);while(b.length)b.shift()();return o.push.apply(o,d||[]),n()}function n(){for(var t,e=0;e<o.length;e++){for(var n=o[e],r=!0,s=1;s<n.length;s++){var c=n[s];0!==i[c]&&(r=!1)}r&&(o.splice(e--,1),t=a(a.s=n[0]))}return t}var r={},i={app:0},o=[];function a(e){if(r[e])return r[e].exports;var n=r[e]={i:e,l:!1,exports:{}};return t[e].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=t,a.c=r,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=e,s=s.slice();for(var d=0;d<s.length;d++)e(s[d]);var l=c;o.push([0,"chunk-vendors"]),n()})({0:function(t,e,n){t.exports=n("56d7")},"1cce":function(t,e,n){},"20ec":function(t,e,n){"use strict";n("f248")},"43c8":function(t,e,n){},"56d7":function(t,e,n){"use strict";n.r(e);n("e260"),n("e6cf"),n("cca6"),n("a79d");var r=n("7a23"),i=Object(r["y"])("data-v-5bc914fd");Object(r["m"])("data-v-5bc914fd");var o={class:"sidebar hideOnPrint"},a={class:"toolbar"},s=Object(r["f"])(" Settings"),c=Object(r["f"])(" Wood"),d=Object(r["f"])(" Layers"),l=Object(r["f"])(" Save / load"),u=Object(r["f"])(" Print"),b=Object(r["f"])(" About"),h={class:"tabs"},g={class:"tab"},f={class:"tab"},O={class:"tab"},p={class:"tab"},j=Object(r["g"])("p",null," Use your browser's built-in print functionality (for example, Ctrl+P on Windows) or click the button below to get a printable version of your board and cutting list. ",-1),v=Object(r["g"])("label",{for:"printEndGrain"}," End grain preview",-1),m=Object(r["g"])("label",{for:"printEdgeGrain"}," Edge grain preview",-1),w=Object(r["g"])("label",{for:"printCuttingList"}," Cutting list and bill of materials",-1),y=Object(r["g"])("br",null,null,-1),k={class:"tab"},x=Object(r["g"])("p",null," Below you can download the current settings or load them again from a file. You can also bookmark the current page or copy the URL from the address bar instead, as it is automatically updated whenever you change anything. ",-1),P={type:"file",ref:"loadFile",accept:".json"},L={class:"tab"},B=Object(r["g"])("p",null,[Object(r["f"])(" Created by Mark van Renswoude. Open-source and available under the Unlicense to the public domain on "),Object(r["g"])("a",{href:"https://github.com/MvRens/CuttingBoard",target:"_blank"},"Github"),Object(r["f"])(", where feedback is welcome under Issues. ")],-1),W=Object(r["g"])("p",null,[Object(r["f"])(" Heavily inspired by "),Object(r["g"])("a",{href:"http://www.lastalias.com/cbdesigner/"},"CBdesigner"),Object(r["f"])(". ")],-1),C={class:"content"},G=Object(r["g"])("h1",null,"End grain",-1),E=Object(r["g"])("h1",null,"Edge grain",-1),T={key:0},I=Object(r["g"])("h1",null,"Cutting list",-1);Object(r["l"])();var $=i((function(t,e,n,i,$,M){var D=Object(r["p"])("font-awesome-icon"),S=Object(r["p"])("Settings"),A=Object(r["p"])("Layers"),q=Object(r["p"])("Wood"),U=Object(r["p"])("EndGrainPreview"),_=Object(r["p"])("EdgeGrainPreview"),F=Object(r["p"])("CuttingList");return Object(r["k"])(),Object(r["c"])(r["a"],null,[Object(r["g"])("div",o,[Object(r["g"])("div",a,[Object(r["g"])("a",{class:{active:"settings"===$.tab},onClick:e[1]||(e[1]=function(t){return $.tab="settings"})},[Object(r["g"])(D,{icon:"sliders-h",size:"2x","fixed-width":""}),s],2),Object(r["g"])("a",{class:{active:"wood"===$.tab},onClick:e[2]||(e[2]=function(t){return $.tab="wood"})},[Object(r["g"])(D,{icon:"tree",size:"2x","fixed-width":""}),c],2),Object(r["g"])("a",{class:{active:"layers"===$.tab},onClick:e[3]||(e[3]=function(t){return $.tab="layers"})},[Object(r["g"])(D,{icon:"layer-group",size:"2x","fixed-width":""}),d],2),Object(r["g"])("a",{class:{active:"saveLoad"===$.tab},onClick:e[4]||(e[4]=function(t){return $.tab="saveLoad"})},[Object(r["g"])(D,{icon:"save",size:"2x","fixed-width":""}),l],2),Object(r["g"])("a",{class:{active:"print"===$.tab},onClick:e[5]||(e[5]=function(t){return $.tab="print"})},[Object(r["g"])(D,{icon:"print",size:"2x","fixed-width":""}),u],2),Object(r["g"])("a",{class:{active:"about"===$.tab},onClick:e[6]||(e[6]=function(t){return $.tab="about"})},[Object(r["g"])(D,{icon:"info-circle",size:"2x","fixed-width":""}),b],2)]),Object(r["g"])("div",h,[Object(r["w"])(Object(r["g"])("div",g,[Object(r["g"])(S)],512),[[r["u"],"settings"===$.tab]]),Object(r["w"])(Object(r["g"])("div",f,[Object(r["g"])(A)],512),[[r["u"],"layers"===$.tab]]),Object(r["w"])(Object(r["g"])("div",O,[Object(r["g"])(q)],512),[[r["u"],"wood"===$.tab]]),Object(r["w"])(Object(r["g"])("div",p,[j,Object(r["g"])("div",null,[Object(r["w"])(Object(r["g"])("input",{type:"checkbox","onUpdate:modelValue":e[7]||(e[7]=function(t){return $.printEndGrain=t}),id:"printEndGrain"},null,512),[[r["r"],$.printEndGrain]]),v]),Object(r["g"])("div",null,[Object(r["w"])(Object(r["g"])("input",{type:"checkbox","onUpdate:modelValue":e[8]||(e[8]=function(t){return $.printEdgeGrain=t}),id:"printEdgeGrain"},null,512),[[r["r"],$.printEdgeGrain]]),m]),Object(r["g"])("div",null,[Object(r["w"])(Object(r["g"])("input",{type:"checkbox","onUpdate:modelValue":e[9]||(e[9]=function(t){return $.printCuttingList=t}),id:"printCuttingList"},null,512),[[r["r"],$.printCuttingList]]),w]),y,Object(r["g"])("button",{onClick:e[10]||(e[10]=function(){return M.print&&M.print.apply(M,arguments)})},"Print")],512),[[r["u"],"print"===$.tab]]),Object(r["w"])(Object(r["g"])("div",k,[x,Object(r["g"])("p",null,[Object(r["w"])(Object(r["g"])("input",{type:"text","onUpdate:modelValue":e[11]||(e[11]=function(t){return $.saveFilename=t})},null,512),[[r["t"],$.saveFilename]]),Object(r["g"])("button",{onClick:e[12]||(e[12]=function(){return M.save&&M.save.apply(M,arguments)})},"Save")]),Object(r["g"])("p",null,[Object(r["g"])("input",P,null,512),Object(r["g"])("button",{onClick:e[13]||(e[13]=function(){return M.load&&M.load.apply(M,arguments)})},"Load")])],512),[[r["u"],"saveLoad"===$.tab]]),Object(r["w"])(Object(r["g"])("div",L,[B,W],512),[[r["u"],"about"===$.tab]])])]),Object(r["g"])("div",C,[Object(r["g"])("div",{class:{hideOnPrint:!$.printEndGrain}},[G,Object(r["g"])(U,{scale:1})],2),Object(r["g"])("div",{class:{hideOnPrint:!$.printEdgeGrain}},[E,(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(M.boards,(function(t,e){return Object(r["k"])(),Object(r["c"])(r["a"],null,[M.boards.length>1?(Object(r["k"])(),Object(r["c"])("h2",T,"Board "+Object(r["q"])(e+1),1)):Object(r["d"])("",!0),Object(r["g"])(_,{board:t,scale:1},null,8,["board"])],64)})),256))],2),Object(r["g"])("div",{class:{hideOnPrint:!$.printCuttingList}},[I,Object(r["g"])(F)],2)])],64)})),M=(n("b0c0"),n("8a79"),Object(r["y"])("data-v-7067c7c7"));Object(r["m"])("data-v-7067c7c7");var D={class:"settings"},S=Object(r["g"])("h2",null,"Designer",-1),A=Object(r["g"])("label",{for:"units"},"Units",-1),q=Object(r["g"])("option",{value:"mm"},"Millimeters",-1),U=Object(r["g"])("option",{value:"cm"},"Centimeters",-1),_=Object(r["g"])("option",{value:"inchdecimal"},"Inches (decimal)",-1),F=Object(r["g"])("h2",null,"Tools",-1),H=Object(r["g"])("label",{for:"bladeKerf"},"Blade kerf",-1),K=Object(r["g"])("h2",null,"End grain",-1),R=Object(r["g"])("label",{for:"crosscutWidth"},"Crosscut width",-1);Object(r["l"])();var N=M((function(t,e,n,i,o,a){return Object(r["k"])(),Object(r["c"])("div",D,[S,A,Object(r["g"])("select",{id:"units",value:a.settings.units,onChange:e[1]||(e[1]=function(e){return t.$store.commit("updateSettings",{units:e.target.value})})},[q,U,_],40,["value"]),F,H,Object(r["g"])("input",{id:"bladeKerf",type:"number",value:a.settings.bladeKerf,onChange:e[2]||(e[2]=function(e){return t.$store.commit("updateSettings",{bladeKerf:a.parseFloatDef(e.target.value)})})},null,40,["value"]),K,R,Object(r["g"])("input",{id:"crosscutWidth",type:"number",value:a.settings.crosscutWidth,onChange:e[3]||(e[3]=function(e){return t.$store.commit("updateSettings",{crosscutWidth:a.parseFloatDef(e.target.value)})})},null,40,["value"])])})),V=(n("2b19"),25.4),z=10,X=1,Y={convert:function(t,e,n){var r=this.toMillimeters(t,e);return this.fromMillimeters(r,n)},toPixels:function(t,e){return Math.ceil(this.toMillimeters(t,e)*X)},toMillimeters:function(t,e){switch(e){case"mm":return t;case"cm":return t*z;case"inchdecimal":return t*V}return console.error("Invalid units type: "+e),0},fromMillimeters:function(t,e){switch(e){case"mm":return t;case"cm":return t/z;case"inchdecimal":return t/V}return console.error("Invalid units type: "+e),0},display:function(t,e){var n=this.limitDecimals(t,3);switch(e){case"mm":return n+" mm";case"cm":return n+" cm";case"inchdecimal":return n+" inch"}return console.error("Invalid units type: "+e),n},limitDecimals:function(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}},J={computed:{settings:function(){return this.$store.state.settings}},methods:{parseFloatDef:function(t){var e=parseFloat(t);return Object.is(e,NaN)?0:e}}};n("e9ae");J.render=N,J.__scopeId="data-v-7067c7c7";var Q=J,Z=Object(r["y"])("data-v-01187e40");Object(r["m"])("data-v-01187e40");var tt={class:"board"},et={class:"name"},nt={class:"boardsettings"},rt=Object(r["g"])("label",{for:"boardLength"},"Board length",-1),it=Object(r["g"])("label",{for:"boardThickness"},"Board thickness",-1),ot={class:"layers"},at=Object(r["e"])('<div class="hint" data-v-01187e40> Tip: click and drag the layer number to move a layer </div><span class="header" data-v-01187e40> </span><span class="header" data-v-01187e40>Wood species</span><span class="header" data-v-01187e40>Width</span><span class="header" data-v-01187e40> </span>',5),st={class:"remove"},ct={key:0,class:"widthwarning"},dt={class:"add"},lt=Object(r["g"])("h2",null,"Preview settings",-1),ut=Object(r["g"])("label",{for:"borders"}," Show borders",-1),bt=Object(r["g"])("h2",null,"End grain layer direction",-1),ht=Object(r["g"])("label",{for:"directionUniform"}," Uniform",-1),gt=Object(r["g"])("label",{for:"directionAlternate"}," Alternate",-1),ft=Object(r["g"])("label",{for:"directionCustom"}," Custom",-1),Ot={key:0},pt=Object(r["f"])(" Click the strips in the preview to reverse their direction. "),jt={key:0},vt=Object(r["f"])("This may be easier if you "),mt=Object(r["f"])(" the 'Show borders' setting.");Object(r["l"])();var wt=Z((function(t,e,n,i,o,a){return Object(r["k"])(),Object(r["c"])(r["a"],null,[Object(r["g"])("div",tt,[Object(r["g"])("button",{onClick:e[1]||(e[1]=function(){return a.previousBoard&&a.previousBoard.apply(a,arguments)}),disabled:0==o.boardIndex},"<",8,["disabled"]),Object(r["g"])("div",et,"Board "+Object(r["q"])(o.boardIndex+1)+" of "+Object(r["q"])(a.boards.length),1),a.boards.length>1?(Object(r["k"])(),Object(r["c"])("button",{key:0,onClick:e[2]||(e[2]=function(){return a.removeBoard&&a.removeBoard.apply(a,arguments)})},"Remove")):Object(r["d"])("",!0),Object(r["g"])("button",{onClick:e[3]||(e[3]=function(){return a.addBoard&&a.addBoard.apply(a,arguments)})},"Add"),Object(r["g"])("button",{onClick:e[4]||(e[4]=function(){return a.nextBoard&&a.nextBoard.apply(a,arguments)}),disabled:o.boardIndex==a.boards.length-1},">",8,["disabled"])]),null!==a.currentBoard?(Object(r["k"])(),Object(r["c"])(r["a"],{key:0},[Object(r["g"])("div",nt,[rt,Object(r["g"])("input",{id:"boardLength",type:"number",value:a.currentBoard.length,onChange:e[5]||(e[5]=function(e){return t.$store.commit("updateBoard",{board:o.boardIndex,values:{length:a.parseFloatDef(e.target.value)}})})},null,40,["value"]),it,Object(r["g"])("input",{id:"boardThickness",type:"number",value:a.currentBoard.thickness,onChange:e[6]||(e[6]=function(e){return t.$store.commit("updateBoard",{board:o.boardIndex,values:{thickness:a.parseFloatDef(e.target.value)}})})},null,40,["value"])]),Object(r["g"])("div",ot,[at,(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.currentBoard.layers,(function(t,e){return Object(r["k"])(),Object(r["c"])(r["a"],null,[Object(r["g"])("div",{class:["index",{dropTargetAbove:o.dropTarget===e,dropTargetBelow:o.dropTarget===a.currentBoard.layers.length&&e===a.currentBoard.layers.length-1}],ref:"layer"+e,onMousedown:Object(r["x"])((function(t){return a.startDrag(e)}),["prevent"])},Object(r["q"])(e+1),43,["onMousedown"]),Object(r["w"])(Object(r["g"])("select",{"onUpdate:modelValue":function(e){return t.wood=e},class:"wood"},[(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.wood,(function(t,e){return Object(r["k"])(),Object(r["c"])("option",{value:e},Object(r["q"])(t.name),9,["value"])})),256))],8,["onUpdate:modelValue"]),[[r["s"],t.wood]]),Object(r["g"])("input",{type:"number",class:"width",value:t.width,onInput:function(e){return t.width=a.parseFloatDef(e.target.value)}},null,40,["value","onInput"]),Object(r["g"])("div",st,[Object(r["g"])("button",{onClick:function(t){return a.removeLayer(e)}},"X",8,["onClick"])])],64)})),256)),null!==a.widthWarning?(Object(r["k"])(),Object(r["c"])("div",ct,Object(r["q"])(a.widthWarning),1)):Object(r["d"])("",!0),Object(r["g"])("div",dt,[Object(r["g"])("button",{onClick:e[7]||(e[7]=function(t){return a.addLayer()})},"Add layer")])]),Object(r["g"])("div",null,[lt,Object(r["g"])("input",{id:"borders",type:"checkbox",checked:a.settings.borders,onChange:e[8]||(e[8]=function(e){return t.$store.commit("updateSettings",{borders:e.target.checked})})},null,40,["checked"]),ut]),Object(r["g"])("div",null,[bt,Object(r["g"])("div",null,[Object(r["g"])("input",{id:"directionUniform",type:"radio",checked:"uniform"===a.settings.direction,onChange:e[9]||(e[9]=function(t){return a.setDirection(t,"uniform")})},null,40,["checked"]),ht]),Object(r["g"])("div",null,[Object(r["g"])("input",{id:"directionAlternate",type:"radio",checked:"alternate"===a.settings.direction,onChange:e[10]||(e[10]=function(t){return a.setDirection(t,"alternate")})},null,40,["checked"]),gt]),Object(r["g"])("div",null,[Object(r["g"])("input",{id:"directionCustom",type:"radio",checked:"custom"===a.settings.direction,onChange:e[11]||(e[11]=function(t){return a.setDirection(t,"custom")})},null,40,["checked"]),ft,"custom"===a.settings.direction?(Object(r["k"])(),Object(r["c"])("p",Ot,[pt,a.settings.borders?Object(r["d"])("",!0):(Object(r["k"])(),Object(r["c"])("span",jt,[vt,Object(r["g"])("a",{href:"#",onClick:e[12]||(e[12]=Object(r["x"])((function(e){return t.$store.commit("updateSettings",{borders:!0})}),["prevent"]))},"turn on"),mt]))])):Object(r["d"])("",!0)])])],64)):Object(r["d"])("",!0)],64)})),yt=(n("4160"),n("d81d"),n("13d5"),n("159b"),{data:function(){return{boardIndex:0,dragIndex:null,dropTarget:null}},computed:{settings:function(){return this.$store.state.settings},wood:function(){return this.$store.state.wood},boards:function(){return this.$store.state.boards},currentBoard:function(){return this.boardIndex>=0&&this.boardIndex<this.boards.length?this.boards[this.boardIndex]:null},widthWarning:function(){var t=this;if(null===t.currentBoard||1==t.boards.length)return null;var e=null,n=null,r=null;if(t.boards.forEach((function(i,o){var a=Y.limitDecimals(i.layers.map((function(t){return t.width})).reduce((function(t,e){return t+e}),0),3);o==t.boardIndex&&(n=a),(null===e||a<e)&&(e=a),(null===r||a>r)&&(r=a)})),e==r)return null;var i="Your board are not of equal width. The current board is "+Y.display(n,this.settings.units)+" ";return i+=n<r?"while the widest is "+Y.display(r,this.settings.units)+". ":"while the smallest is "+Y.display(e,this.settings.units)+". ",i+="The end grain board will not align.",i},maxBoardWidth:function(){return this.boards.map((function(t){return t.layers.map((function(t){return t.width})).reduce((function(t,e){return t+e}),0)})).reduce((function(t,e){return e>t?e:t}),0)}},methods:{parseFloatDef:function(t){var e=parseFloat(t);return Object.is(e,NaN)?0:e},previousBoard:function(){this.boardIndex>0&&this.boardIndex--},nextBoard:function(){this.boardIndex<this.boards.length-1&&this.boardIndex++},addBoard:function(){this.$store.commit("addBoard",this.boardIndex),this.boardIndex=this.boards.length-1},removeBoard:function(){this.boards.length<=1||(this.$store.commit("removeBoard",this.boardIndex),this.boardIndex>=this.boards.length&&(this.boardIndex=this.boards.length-1))},addLayer:function(){this.$store.commit("addLayer",this.boardIndex)},removeLayer:function(t){this.$store.commit("removeLayer",{board:this.boardIndex,layer:t})},startDrag:function(t){var e=this,n=this;n.dragIndex=t,n.dropTarget=t;var r,i=function(t){n.dropTarget=n.getTargetLayer(t.pageY)};r=function(){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",r),n.dragIndex!==n.dropTarget&&n.$store.commit("moveLayer",{board:e.boardIndex,from:n.dragIndex,to:n.dropTarget}),n.dropTarget=null,n.dragIndex=null},document.addEventListener("mousemove",i),document.addEventListener("mouseup",r)},getTargetLayer:function(t){if(null===this.currentBoard||0==this.currentBoard.layers.length)return null;var e=this.getPageOffsetRect(this.$refs.layer0),n=this.getPageOffsetRect(this.$refs["layer"+(this.currentBoard.layers.length-1)]);if(t<=e.bottom)return 0;if(t>=n.bottom)return this.currentBoard.layers.length;if(t>=n.top)return this.currentBoard.layers.length-1;if(null!==this.dropTarget&&this.dropTarget>0&&this.dropTarget<this.currentBoard.layers.length-1){var r=this.getPageOffsetRect(this.$refs["layer"+this.dropTarget]);if(t>=r.top&&t<r.bottom)return this.dropTarget}for(var i=1;i<this.currentBoard.layers.length-1;i++){var o=this.getPageOffsetRect(this.$refs["layer"+i]);if(t>=o.top&&t<o.bottom)return i}return null},getPageOffsetRect:function(t){var e=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+r,left:e.left+n,right:e.right+n,bottom:e.bottom+r}},setDirection:function(t,e){t.target.checked&&this.$store.commit("updateSettings",{direction:e})}}});n("e909");yt.render=wt,yt.__scopeId="data-v-01187e40";var kt=yt,xt=Object(r["y"])("data-v-15338ab0");Object(r["m"])("data-v-15338ab0");var Pt={class:"wood"},Lt=Object(r["g"])("span",{class:"header"},"Name",-1),Bt=Object(r["g"])("span",{class:"header"},"Colour",-1),Wt=Object(r["g"])("span",{class:"header"}," ",-1),Ct={class:"remove"},Gt={class:"add"};Object(r["l"])();var Et=xt((function(t,e,n,i,o,a){return Object(r["k"])(),Object(r["c"])("div",Pt,[Lt,Bt,Wt,(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.wood,(function(t,e){return Object(r["k"])(),Object(r["c"])(r["a"],null,[Object(r["w"])(Object(r["g"])("input",{type:"text",class:"name","onUpdate:modelValue":function(e){return t.name=e}},null,8,["onUpdate:modelValue"]),[[r["t"],t.name]]),Object(r["w"])(Object(r["g"])("input",{type:"color",class:"color","onUpdate:modelValue":function(e){return t.color=e}},null,8,["onUpdate:modelValue"]),[[r["t"],t.color]]),Object(r["g"])("div",Ct,[Object(r["g"])("button",{onClick:function(t){return a.removeWood(e)}},"X",8,["onClick"])])],64)})),256)),Object(r["g"])("div",Gt,[Object(r["g"])("button",{onClick:e[1]||(e[1]=function(t){return a.addWood()})},"Add wood species")])])})),Tt={computed:{settings:function(){return this.$store.state.settings},wood:function(){return this.$store.state.wood}},methods:{addWood:function(){this.$store.commit("addWood")},removeWood:function(t){this.$store.commit("removeWood",t)}}};n("8b67");Tt.render=Et,Tt.__scopeId="data-v-15338ab0";var It=Tt,$t=Object(r["y"])("data-v-61e0967d");Object(r["m"])("data-v-61e0967d");var Mt={class:"preview"},Dt={class:"dimensions"},St={key:0,class:"draghint hideOnPrint"},At={id:"dropTarget"};Object(r["l"])();var qt=$t((function(t,e,n,i,o,a){return Object(r["k"])(),Object(r["c"])("div",Mt,[Object(r["g"])("div",Dt,"Dimensions: "+Object(r["q"])(a.display(a.boardWidth))+" x "+Object(r["q"])(a.display(a.boardHeight))+" x "+Object(r["q"])(a.display(a.settings.crosscutWidth)),1),a.boards.length>1?(Object(r["k"])(),Object(r["c"])("div",St,"Click and drag strips to reorder them. Click once to reverse the direction.")):Object(r["d"])("",!0),(Object(r["k"])(),Object(r["c"])("svg",{width:a.viewportWidth,height:a.viewportHeight,viewBox:a.viewBox,class:{dragging:null!==o.dropTarget}},[Object(r["g"])("defs",null,[(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.boards,(function(t,e){return Object(r["k"])(),Object(r["c"])("g",{id:"strip"+e},[(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(t.layers,(function(e,n){return Object(r["k"])(),Object(r["c"])("rect",{width:a.toPixels(t.thickness),height:a.toPixels(e.width),x:"0",y:a.getBoardLayerOffset(t,n),style:a.getBoardLayerStyle(t,n)},null,12,["width","height","y"])})),256))],8,["id"])})),256)),Object(r["g"])("g",At,[Object(r["g"])("line",{x1:"0",y1:"0",x2:"0",y2:a.boardPixelHeight,style:{stroke:"white","stroke-width":"2"}},null,8,["y2"])])]),(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.endGrain,(function(t,e){return Object(r["k"])(),Object(r["c"])("use",{ref:"strip"+e,href:"#strip"+t.board,x:a.getLayerOffset(e),y:"0",transform:a.getLayerTransform(e),onMousedown:Object(r["x"])((function(t){return a.mouseDown(e,t)}),["prevent"])},null,40,["href","x","transform","onMousedown"])})),256)),null!==o.dropTarget?(Object(r["k"])(),Object(r["c"])("use",{key:0,href:"#dropTarget",x:a.getLayerOffset(o.dropTarget)},null,8,["x"])):Object(r["d"])("",!0)],10,["width","height","viewBox"]))])})),Ut=(n("a9e3"),{props:{scale:Number},data:function(){return{dragIndex:null,dropTarget:null}},computed:{settings:function(){return this.$store.state.settings},boards:function(){return this.$store.state.boards},wood:function(){return this.$store.state.wood},endGrain:function(){return this.$store.state.endGrain},boardWidth:function(){var t=this;return this.endGrain.map((function(e){return e.board>=0&&e.board<t.boards.length?t.boards[e.board].thickness:0})).reduce((function(t,e){return t+e}),0)},boardHeight:function(){return this.boards.map((function(t){return t.layers.map((function(t){return t.width})).reduce((function(t,e){return t+e}),0)})).reduce((function(t,e){return e>t?e:t}),0)},boardPixelWidth:function(){return this.toPixels(this.boardWidth)},boardPixelHeight:function(){return this.toPixels(this.boardHeight)},viewportWidth:function(){return Math.floor(this.boardPixelWidth*this.scale)},viewportHeight:function(){return Math.floor(this.boardPixelHeight*this.scale)},viewBox:function(){return"0 0 "+this.boardPixelWidth+" "+this.boardPixelHeight}},methods:{toPixels:function(t){return Y.toPixels(t,this.settings.units)},display:function(t){return Y.display(t,this.settings.units)},getBoardLayerOffset:function(t,e){if(e<0||e>=t.layers.length)return 0;for(var n=0,r=0;r<e;r++)n+=t.layers[r].width;return this.toPixels(n)},getBoardLayerStyle:function(t,e){if(e<0||e>=t.layers.length)return"fill: fuchsia";var n=t.layers[e].wood;if(n<0||n>=this.wood.length)return"";var r=this.settings.borders?"; stroke-width: 1; stroke: black":"";return"fill: "+this.wood[n].color+r},getLayerOffset:function(t){if(t<0||t>this.endGrain.length)return 0;for(var e=0,n=0;n<t;n++){var r=this.endGrain[n].board;r>=0&&r<this.boards.length&&(e+=this.boards[r].thickness)}return this.toPixels(e)},getLayerTransform:function(t){var e=!1;switch(this.settings.direction){case"alternate":e=t%2==0;break;case"custom":e=t>=0&&t<this.endGrain.length&&this.endGrain[t].reversed;break}return e?"scale(1, -1) translate(0, -"+this.boardPixelHeight+")":""},reverseLayer:function(t){"custom"===this.settings.direction&&(t<0||t>=this.endGrain.length||(this.endGrain[t].reversed=!this.endGrain[t].reversed))},mouseDown:function(t,e){var n,r=this,i=e.pageX,o=!1,a=function(e){o||Math.abs(e.pageX-i)>=5&&(r.dragIndex=t,o=!0),o&&(r.dropTarget=r.getTargetStrip(e.pageX))};n=function(){document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",n),o?(r.dragIndex!==r.dropTarget&&r.$store.commit("moveEndgrain",{from:r.dragIndex,to:r.dropTarget}),r.dropTarget=null,r.dragIndex=null):r.reverseLayer(t)},document.addEventListener("mousemove",a),document.addEventListener("mouseup",n)},getTargetStrip:function(t){if(0==this.endGrain.length)return null;var e=this.getPageOffsetRect(this.$refs.strip0),n=this.getPageOffsetRect(this.$refs["strip"+(this.endGrain.length-1)]);if(t<=e.right)return 0;if(t>=n.right)return this.endGrain.length;if(t>=n.left)return this.endGrain.length-1;if(null!==this.dropTarget&&this.dropTarget>0&&this.dropTarget<this.endGrain.length-1){var r=this.getPageOffsetRect(this.$refs["strip"+this.dropTarget]);if(t>=r.left&&t<r.right)return this.dropTarget}for(var i=1;i<this.endGrain.length-1;i++){var o=this.getPageOffsetRect(this.$refs["strip"+i]);if(t>=o.left&&t<o.right)return i}return null},getPageOffsetRect:function(t){var e=t.getBoundingClientRect(),n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop;return{top:e.top+r,left:e.left+n,right:e.right+n,bottom:e.bottom+r}}}});n("9279");Ut.render=qt,Ut.__scopeId="data-v-61e0967d";var _t=Ut,Ft=Object(r["y"])("data-v-a5fd011a");Object(r["m"])("data-v-a5fd011a");var Ht={class:"preview"},Kt={class:"dimensions"};Object(r["l"])();var Rt=Ft((function(t,e,n,i,o,a){return Object(r["k"])(),Object(r["c"])("div",Ht,[Object(r["g"])("div",Kt,"Dimensions: "+Object(r["q"])(a.display(a.boardWidth))+" x "+Object(r["q"])(a.display(a.boardHeight))+" x "+Object(r["q"])(a.display(n.board.thickness)),1),(Object(r["k"])(),Object(r["c"])("svg",{width:a.viewportWidth,height:a.viewportHeight,viewBox:a.viewBox},[(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.layers,(function(t,e){return Object(r["k"])(),Object(r["c"])("rect",{width:a.toPixels(n.board.length),height:a.toPixels(t.width),x:"0",y:a.getLayerOffset(e),style:a.getLayerStyle(e)},null,12,["width","height","y"])})),256))],8,["width","height","viewBox"]))])})),Nt={props:{scale:Number,board:Object},computed:{settings:function(){return this.$store.state.settings},wood:function(){return this.$store.state.wood},layers:function(){return this.board.layers},boardWidth:function(){return this.board.length},boardHeight:function(){return 0==this.layers.length?0:this.layers.map((function(t){return t.width})).reduce((function(t,e){return t+e}),0)},boardPixelWidth:function(){return this.toPixels(this.boardWidth)},boardPixelHeight:function(){return this.toPixels(this.boardHeight)},viewportWidth:function(){return Math.floor(this.boardPixelWidth*this.scale)},viewportHeight:function(){return Math.floor(this.boardPixelHeight*this.scale)},viewBox:function(){return"0 0 "+this.boardPixelWidth+" "+this.boardPixelHeight}},methods:{toPixels:function(t){return Y.toPixels(t,this.settings.units)},display:function(t){return Y.display(t,this.settings.units)},getLayerOffset:function(t){if(t<0||t>=this.layers.length)return 0;for(var e=0,n=0;n<t;n++)e+=this.layers[n].width;return this.toPixels(e)},getLayerStyle:function(t){if(t<0||t>=this.layers.length)return"fill: fuchsia";var e=this.layers[t].wood;if(e<0||e>=this.wood.length)return"";var n=this.settings.borders?"; stroke-width: 1; stroke: black":"";return"fill: "+this.wood[e].color+n}}};n("6dfb");Nt.render=Rt,Nt.__scopeId="data-v-a5fd011a";var Vt=Nt,zt=Object(r["y"])("data-v-30665a8d");Object(r["m"])("data-v-30665a8d");var Xt={class:"list"},Yt=Object(r["g"])("tr",null,[Object(r["g"])("th",null,"Layer"),Object(r["g"])("th",null,"Wood species"),Object(r["g"])("th",{class:"dimension"},"Width")],-1),Jt={key:0,class:"board"},Qt={colspan:"3"},Zt={class:"dimension"},te=Object(r["g"])("h2",null,"Bill of materials",-1),ee={class:"list"},ne=Object(r["g"])("tr",null,[Object(r["g"])("th",null,"Wood species"),Object(r["g"])("th",{class:"dimension"},"Length"),Object(r["g"])("th",{class:"dimension"},"Width"),Object(r["g"])("th",{class:"dimension"},"Thickness")],-1),re={key:0,class:"board"},ie={colspan:"3"},oe={class:"dimension"},ae={class:"dimension"},se={class:"dimension"};Object(r["l"])();var ce=zt((function(t,e,n,i,o,a){return Object(r["k"])(),Object(r["c"])(r["a"],null,[Object(r["g"])("table",Xt,[Yt,(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.boards,(function(t,e){return Object(r["k"])(),Object(r["c"])(r["a"],null,[a.boards.length>1?(Object(r["k"])(),Object(r["c"])("tr",Jt,[Object(r["g"])("td",Qt,"Board "+Object(r["q"])(e+1),1)])):Object(r["d"])("",!0),(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(t.layers,(function(e,n){return Object(r["k"])(),Object(r["c"])("tr",null,[Object(r["g"])("td",null,Object(r["q"])(n+1),1),Object(r["g"])("td",null,Object(r["q"])(a.getLayerWood(t,n)),1),Object(r["g"])("td",Zt,Object(r["q"])(a.getLayerWidth(t,n)),1)])})),256))],64)})),256))]),te,Object(r["g"])("table",ee,[ne,(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(a.bom,(function(t,e){return Object(r["k"])(),Object(r["c"])(r["a"],null,[a.bom.length>1?(Object(r["k"])(),Object(r["c"])("tr",re,[Object(r["g"])("td",ie,"Board "+Object(r["q"])(e+1),1)])):Object(r["d"])("",!0),(Object(r["k"])(!0),Object(r["c"])(r["a"],null,Object(r["o"])(t,(function(t){return Object(r["k"])(),Object(r["c"])("tr",null,[Object(r["g"])("td",null,Object(r["q"])(t.woodName),1),Object(r["g"])("td",oe,Object(r["q"])(a.display(t.length)),1),Object(r["g"])("td",ae,Object(r["q"])(a.display(t.width)),1),Object(r["g"])("td",se,Object(r["q"])(a.display(t.thickness)),1)])})),256))],64)})),256))])],64)})),de={computed:{settings:function(){return this.$store.state.settings},boards:function(){return this.$store.state.boards},wood:function(){return this.$store.state.wood},bom:function(){var t=this;return t.boards.map((function(e,n){var r=[],i={};for(var o in e.layers.forEach((function(e){i.hasOwnProperty(e.wood)?i[e.wood]+=e.width+t.settings.bladeKerf:i[e.wood]=e.width})),i)i.hasOwnProperty(o)&&r.push({board:n,woodName:o>=0&&o<t.wood.length?t.wood[o].name:"",length:e.length,width:i[o],thickness:e.thickness});return r}))}},methods:{getLayerWood:function(t,e){if(e<0||e>=t.layers.length)return"";var n=t.layers[e].wood;return n<0||n>=this.wood.length?"":this.wood[n].name},getLayerWidth:function(t,e){return e<0||e>=t.layers.length?"":this.display(t.layers[e].width)},display:function(t){return Y.display(t,this.settings.units)}}};n("978e");de.render=ce,de.__scopeId="data-v-30665a8d";var le=de,ue=n("21a6"),be=(n("c975"),n("d3b7"),n("5cc6"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7"),["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"]),he=[255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,62,255,255,255,63,52,53,54,55,56,57,58,59,60,61,255,255,255,0,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51];function ge(t){if(t>=he.length)throw new Error("Unable to parse base64 string.");var e=he[t];if(255===e)throw new Error("Unable to parse base64 string.");return e}function fe(t){var e,n="",r=t.length;for(e=2;e<r;e+=3)n+=be[t[e-2]>>2],n+=be[(3&t[e-2])<<4|t[e-1]>>4],n+=be[(15&t[e-1])<<2|t[e]>>6],n+=be[63&t[e]];return e===r+1&&(n+=be[t[e-2]>>2],n+=be[(3&t[e-2])<<4],n+="=="),e===r&&(n+=be[t[e-2]>>2],n+=be[(3&t[e-2])<<4|t[e-1]>>4],n+=be[(15&t[e-1])<<2],n+="="),n}function Oe(t){if(t.length%4!==0)throw new Error("Unable to parse base64 string.");var e=t.indexOf("=");if(-1!==e&&e<t.length-2)throw new Error("Unable to parse base64 string.");for(var n,r=t.endsWith("==")?2:t.endsWith("=")?1:0,i=t.length,o=new Uint8Array(i/4*3),a=0,s=0;a<i;a+=4,s+=3)n=ge(t.charCodeAt(a))<<18|ge(t.charCodeAt(a+1))<<12|ge(t.charCodeAt(a+2))<<6|ge(t.charCodeAt(a+3)),o[s]=n>>16,o[s+1]=n>>8&255,o[s+2]=255&n;return o.subarray(0,o.length-r)}var pe={name:"App",components:{EndGrainPreview:_t,EdgeGrainPreview:Vt,Settings:Q,Layers:kt,Wood:It,CuttingList:le},data:function(){return{tab:"settings",saveFilename:"My cutting board",printEdgeGrain:!0,printEndGrain:!0,printCuttingList:!0}},created:function(){var t=this,e=function(){if(location.hash){var e=location.hash.substring(1);try{var n=Oe(e);n&&t.$store.commit("loadMsgPack",n)}catch(r){console.error(r)}}};e(),window.addEventListener("hashchange",(function(){e()}))},computed:{boards:function(){return this.$store.state.boards},hash:function(){return fe(this.$store.getters.saveMsgPack)}},methods:{save:function(){var t=this.$store.getters.save,e=new Blob([t],{type:"text/plain; charset=utf-8"});Object(ue["saveAs"])(e,this.saveFilename+".json")},load:function(){var t=this,e=this.$refs.loadFile.files[0];if(e){this.saveFilename=e.name.toLowerCase().endsWith(".json")?e.name.substring(0,e.name.length-5):e.name;var n=new FileReader;n.addEventListener("load",(function(e){t.$store.commit("load",e.target.result)})),n.readAsBinaryString(e)}},print:function(){window.print()}},watch:{hash:function(t){history.replaceState({},"","#"+t)}}};n("6dc0"),n("20ec");pe.render=$,pe.__scopeId="data-v-5bc914fd";var je=pe,ve=(n("a434"),n("ddb0"),n("5502")),me={mm:"mm",cm:"cm",inchdecimal:"inchdecimal",isValid:function(t){switch(t){case me.mm:case me.cm:case me.inchdecimal:return!0;default:return!1}}},we={uniform:"uniform",alternate:"alternate",custom:"custom",isValid:function(t){switch(t){case we.uniform:case we.alternate:case we.custom:return t;default:return we.uniform}}},ye=n("d8b3");function ke(){return{units:me.cm,borders:!1,bladeKerf:.35,crosscutWidth:3,direction:we.alternate}}function xe(){return[{name:"Walnut",color:"#58443f"},{name:"Maple",color:"#f2e0aa"},{name:"Cherry",color:"#bb8359"},{name:"Mahogany",color:"#98473f"},{name:"Yellowheart",color:"#ffff84"},{name:"White oak",color:"#fdf4b9"},{name:"Bubinga",color:"#7e3c34"},{name:"Jatoba",color:"#9b281c"},{name:"Padouk",color:"#933350"}]}function Pe(){return[{thickness:2,length:70,layers:[{wood:8,width:1},{wood:1,width:1.5},{wood:8,width:2},{wood:1,width:2},{wood:8,width:15},{wood:1,width:2},{wood:8,width:1.5},{wood:1,width:1}]}]}function Le(){var t=ke(),e=Pe(),n=[];return Ce(n,t,e),n}var Be=Object(ve["a"])({state:{settings:ke(),wood:xe(),boards:Pe(),endGrain:Le()},mutations:{addLayer:function(t,e){e<0||e>=t.boards.length||t.boards[e].layers.push({wood:0,width:Y.fromMillimeters(20,t.settings.units)})},removeLayer:function(t,e){if(!(e.board<0||e.board>=t.boards.length)){var n=t.boards[e.board];e.layer<0||e.layer>=n.layers.length||n.layers.splice(e.layer,1)}},moveLayer:function(t,e){if(!(e.board<0||e.board>=t.boards.length)){var n=t.boards[e.board];We(n.layers,e.from,e.to)}},addWood:function(t){t.wood.push({name:"Wood #"+(t.wood.length+1),color:"#f2e0aa"})},removeWood:function(t,e){e<0||e>=t.wood.length||(t.boards.forEach((function(t){t.layers.forEach((function(t){t.wood===e?t.wood=-1:t.wood>e&&t.wood--}))})),t.wood.splice(e,1))},updateSettings:function(t,e){var n=t.settings.units;Ge(e,t.settings),n!==t.settings.units&&(t.settings.bladeKerf=Y.limitDecimals(Y.convert(t.settings.bladeKerf,n,t.settings.units),3),t.settings.crosscutWidth=Y.limitDecimals(Y.convert(t.settings.crosscutWidth,n,t.settings.units),3),t.boards.forEach((function(e){e.thickness=Y.limitDecimals(Y.convert(e.thickness,n,t.settings.units),3),e.length=Y.limitDecimals(Y.convert(e.length,n,t.settings.units),3),e.layers.forEach((function(e){e.width=Y.limitDecimals(Y.convert(e.width,n,t.settings.units),3)}))})))},addBoard:function(t,e){if(e<0||e>=t.boards.length)t.boards.push({thickness:2,length:70,layers:[]});else{var n=t.boards[e];t.boards.push({thickness:n.thickness,length:n.length,layers:n.layers.map((function(t){return{wood:t.wood,width:t.width}}))}),Ce(t.endGrain,t.settings,t.boards)}},removeBoard:function(t,e){e<0||e>=t.boards.length||(t.boards.splice(e,1),t.endGrain.forEach((function(t){t.board==e?t.board=-1:t.board>e&&t.board--})),Ce(t.endGrain,t.settings,t.boards))},updateBoard:function(t,e){if(!(e.board<0||e.board>=t.boards.length)){var n=t.boards[e.board],r=n.length;Ge(e.values,n),r!==n.length&&Ce(t.endGrain,t.settings,t.boards)}},moveEndgrain:function(t,e){We(t.endGrain,e.from,e.to)},load:function(t,e){var n=JSON.parse(e);Ie(t,n)},loadMsgPack:function(t,e){try{var n=Object(ye["deserialize"])(e);n&&Ie(t,n)}catch(r){console.error(r)}}},getters:{save:function(t){var e=De(t,!1);return JSON.stringify(e)},saveMsgPack:function(t){var e=De(t,!0);return Object(ye["serialize"])(e)}}});function We(t,e,n){if(!(e<0||e>=t.length)&&!(n<0||n>t.length))if(n==t.length)t.push(t[e]),t.splice(e,1);else{var r=t[e];t.splice(e,1),n>e&&n--,t.splice(n,0,r)}}function Ce(t,e,n){for(var r=[],i=0;i<n.length;i++)r[i]=n[i].length+e.bladeKerf;var o=e.crosscutWidth+e.bladeKerf,a=[];t.forEach((function(t,e){var i=!1;t.board>=0&&t.board<n.length&&(i=r[t.board]>=o,i&&(r[t.board]-=o)),i||a.push(e)}));for(var s=a.length-1;s>=0;s--)t.splice(a[s],1);r.forEach((function(e,n){while(e>=o)t.push({board:n,reversed:!1}),e-=o,e=Y.limitDecimals(e,3)}))}function Ge(t,e){for(var n in t)t.hasOwnProperty(n)&&e.hasOwnProperty(n)&&(e[n]=t[n])}function Ee(t){var e=parseFloat(t);return isNaN(e)?0:e}function Te(t){var e=parseInt(t);return isNaN(e)?0:e}function Ie(t,e){var n=_e(e);Ge(n.settings,t.settings),t.wood=n.wood,t.boards=n.boards,t.endGrain=n.endGrain,Ce(t.endGrain,t.settings,t.boards)}var $e={settings:{self:"settings",units:"units",borders:"borders",bladeKerf:"bladeKerf",crosscutWidth:"crosscutWidth",direction:"direction"},wood:{self:"wood",name:"name",color:"color"},boards:{self:"boards",thickness:"thickness",length:"length",layers:{self:"layers",wood:"wood",width:"width"}},endGrain:{self:"endGrain",board:"board",reversed:"reversed"}},Me={settings:{self:"s",units:"u",borders:"b",bladeKerf:"k",crosscutWidth:"c",direction:"d"},wood:{self:"w",name:"n",color:"c"},boards:{self:"b",thickness:"t",length:"x",layers:{self:"l",wood:"w",width:"x"}},endGrain:{self:"e",board:"b",reversed:"r"}};function De(t,e){var n=e?Me:$e,r={};return r[n.settings.self]=Se(t.settings,n),r[n.wood.self]=Ae(t.wood,n),r[n.boards.self]=qe(t.boards,n),r[n.endGrain.self]=Ue(t.endGrain,n),r}function Se(t,e){var n={};return n[e.settings.units]=t.units,n[e.settings.borders]=t.borders,n[e.settings.bladeKerf]=t.bladeKerf,n[e.settings.crosscutWidth]=t.crosscutWidth,n[e.settings.direction]=t.direction,n}function Ae(t,e){return 0===t.length?[]:t.map((function(t){var n={};return n[e.wood.name]=t.name,n[e.wood.color]=t.color,n}))}function qe(t,e){return t.map((function(t){var n={};return n[e.boards.length]=t.length,n[e.boards.thickness]=t.thickness,n[e.boards.layers.self]=t.layers.map((function(t){var n={};return n[e.boards.layers.wood]=t.wood,n[e.boards.layers.width]=t.width,n})),n}))}function Ue(t,e){return t.map((function(t){var n={};return n[e.endGrain.board]=t.board,n[e.endGrain.reversed]=t.reversed,n}))}function _e(t){var e=t.hasOwnProperty(Me.settings.self)?Me:$e,n={settings:Fe(t,e),wood:He(t,e),boards:Ke(t,e),endGrain:Re(t,e)};return t.hasOwnProperty("settings")&&(t.settings.hasOwnProperty("alternateDirection")&&(n.settings.direction=t.settings.alternateDirection?we.alternate:we.uniform),t.settings.hasOwnProperty("boardLength")&&(n.boards[0].length=Ee(t.settings.boardLength)),t.settings.hasOwnProperty("boardThickness")&&(n.boards[0].thickness=Ee(t.settings.boardThickness))),0===n.endGrain.length&&Ce(n.endGrain,n.settings,n.boards),n}function Fe(t,e){if(!t.hasOwnProperty(e.settings.self))return ke();var n=t[e.settings.self];return{units:me.isValid(n[e.settings.units])?n[e.settings.units]:me.cm,borders:!0===n[e.settings.borders],bladeKerf:Ee(n[e.settings.bladeKerf]),crosscutWidth:Ee(n[e.settings.crosscutWidth]),direction:we.isValid(n[e.settings.direction])?n[e.settings.direction]:we.uniform}}function He(t,e){return t.hasOwnProperty(e.wood.self)&&Array.isArray(t[e.wood.self])?t[e.wood.self].map((function(t){return{name:t[e.wood.name],color:/^#[0-9A-F]{6}$/i.test(t[e.wood.color]||"")?t[e.wood.color]:"#000000"}})):[]}function Ke(t,e){if(!t.hasOwnProperty(e.boards.self)||!Array.isArray(t[e.boards.self]))return[];var n=t[e.boards.self].map((function(t){var n={thickness:Ee(t[e.boards.thickness]),length:Ee(t[e.boards.length]),layers:[]};return t.hasOwnProperty(e.boards.layers.self)&&Array.isArray(t[e.boards.layers.self])&&(n.layers=t[e.boards.layers.self].map((function(t){return{wood:Te(t[e.boards.layers.wood]),width:Ee(t[e.boards.layers.width])}}))),n}));return n.length>0?n:{length:0,thickness:0,layers:[]}}function Re(t,e){return t.hasOwnProperty(e.endGrain.self)&&Array.isArray(t[e.endGrain.self])?t[e.endGrain.self].map((function(t){return{board:Te(t[e.endGrain.board]),reversed:!0===t[e.endGrain.reversed]}})):[]}var Ne=n("ecee"),Ve=n("c074"),ze=n("ad3d");Ne["c"].add(Ve["e"],Ve["b"],Ve["d"],Ve["c"],Ve["a"],Ve["f"]),Object(r["b"])(je).use(Be).component("font-awesome-icon",ze["a"]).mount("#app")},"6dc0":function(t,e,n){"use strict";n("43c8")},"6dfb":function(t,e,n){"use strict";n("1cce")},"8b67":function(t,e,n){"use strict";n("c355")},9279:function(t,e,n){"use strict";n("d7cc")},"978e":function(t,e,n){"use strict";n("bfd1")},"9e1e":function(t,e,n){},bfd1:function(t,e,n){},c355:function(t,e,n){},d106:function(t,e,n){},d7cc:function(t,e,n){},e909:function(t,e,n){"use strict";n("d106")},e9ae:function(t,e,n){"use strict";n("9e1e")},f248:function(t,e,n){}});
|
||
//# sourceMappingURL=app.a1173833.js.map
|