HEX
Server: LiteSpeed
System: Linux CentOS-79-64-minimal 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: vishn3436 (5293)
PHP: 8.0.15
Disabled: NONE
Upload Files
File: //data/geometra-4-host-prod/static/js/main.7491a5e4.chunk.js
(this["webpackJsonpgeometra-antd"]=this["webpackJsonpgeometra-antd"]||[]).push([[0],{101:function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"f",(function(){return s})),n.d(t,"e",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return u}));var a=n(33),o=n(34),i=function(e){return e.type&&"folder"===e.type?"folder":".".concat(e.title.split(".").pop())},r=function(e,t){var n=e.split("."),a=n.at(-1)===t.type,o=n.slice(0,-1).join(".");return e&&"folder"===t.type?e:n.length>1&&a?o:e},s=function(e){var t=Object(a.a)(e,1)[0],n={};if(t){try{n=JSON.parse(JSON.stringify(t))}catch(o){console.log(o)}!function e(t,n){0===n&&(t.path=t.title),t.children&&(t.children.map((function(e){return e.path="".concat(t.path," > ").concat(e.title)})),t.children.length>0&&t.children.map((function(t){return e(t,n+1)})))}(n,0)}return[n]},l=function(e){var t=Object(a.a)(e,1)[0],n={};if(t){try{n=JSON.parse(JSON.stringify(t))}catch(i){console.log(i)}!function e(t,n){var a=0,i=[];0===n&&(t.pos="0"),t.children&&t.children.forEach((function(e){"folder"===e.type&&(e.pos="".concat(t.pos,"-").concat(a),i=[].concat(Object(o.a)(i),[e]),a++)})),t.children=i,t.children.forEach((function(t){"folder"===t.type&&e(t,n+1)}))}(n,0)}return[n]},c=function(e,t){return"folder"===t.type?e:"".concat(e).concat(i(t))},u=function(e,t,n){return[e.length>t?"...":null,e.length>t?e.map((function(e,t,n){return n.slice(-t)})).filter((function(e){return e.length===t})):e].flat(2).filter(Boolean).join(n)}},102:function(e,t,n){"use strict";n.d(t,"c",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"a",(function(){return d})),n.d(t,"d",(function(){return p}));var a=n(55),o=n(45),i=n(113),r=n(5),s=n(10),l=void 0,c=function(e){return{xScale:s.a.fromJS(i.a.getScale(a.e,e)),yScale:s.a.fromJS(i.a.getScale(a.f,e))}},u=function(){return i.a.getSelection()},d=function(e){var t=c(e),n=t.xScale,a=t.yScale;return!(!n||!a)&&(n.size>0&&a.size>0)},p=function(e,t){if(t!==e[a.b]){if("imperial"===o.a.getProjectUnitsByID()){if(e[a.b]===l.translateImperial(t))return;r.a.onRequestScaleUpdate2({id:e.id,value:String(l.translateImperial(t)),key:"length"})}"imperial"!==o.a.getProjectUnitsByID()&&r.a.onRequestScaleUpdate2({id:e.id,value:String(t),key:"length"})}}},105:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(25),o=n(29),i=n(594),r=n(593),s=n(49),l=n(57),c=n(12),u=n.n(c),d=Object(i.a)(r.a,{}),p=function(){function e(t,n,o,i){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:void 0;if(Object(a.a)(this,e),this.height=t,this.xScale=1,this.yScale=1,o&&(this.xScale=this.getScaleValueFromXfdf(o.get("xdf"),o.get("length")),this.yScale=this.xScale),r&&(this.yScale=this.getScaleValueFromXfdf(r.get("xdf"),r.get("length"))),this.quantity=n,this.fileName=void 0,i){var s=l.a.getFileById(i.get("id"));s&&(this.fileName=s.name)}}return Object(o.a)(e,[{key:"getRectFromXfdf",value:function(e){if(!e)return{};var t=void 0,n=(new DOMParser).parseFromString(e,"text/xml").querySelector("annots").children;return u.a.forEach(n,(function(e){t=e.getAttribute("rect")})),t=JSON.parse("["+t+"]")}},{key:"getVerticesFromXfdf",value:function(e){var t=void 0,n=(new DOMParser).parseFromString(e,"text/xml"),a=n.getElementsByTagName("vertices")[0];return a||(a=n.getElementsByTagName("gesture")[0]),a&&(t=a.childNodes[0].nodeValue)&&(t=t.split(";").map((function(e){var t=e.split(",");return[parseFloat(t[0]),parseFloat(t[1])]}))),t}},{key:"getCenterPoint",value:function(e){var t=this.getRectFromXfdf(e.get("xfdf")||e.get("xdf")),n=t[0],a=t[1];return[n+(t[2]-n)/2,a+(t[3]-a)/2]}},{key:"getCenterPointFromXfdf",value:function(e){var t=this.getRectFromXfdf(e),n=t[0],a=t[1];return[n+(t[2]-n)/2,a+(t[3]-a)/2]}},{key:"getScaleValueFromXfdf",value:function(e,t){var n=this.getVerticesFromXfdf(e);return d.divide(t,d.distance(n[0],n[1])).valueOf()}},{key:"crossProduct2d",value:function(e,t){return e[0]*t[1]-e[1]*t[0]}},{key:"calculatePolygonArea",value:function(e){var t=0;if(!(e&&e.length<3)){for(var n=0;n<e.length-1;n++)t+=this.crossProduct2d(e[n],e[(n+1)%(e.length-1)]);var a=d.chain(t).multiply(.5).multiply(this.quantity).abs().multiply(this.xScale).multiply(this.yScale).valueOf();return this.quantity<0?-1*a:a}}},{key:"calculatePolygonLenghts",value:function(e){var t=[],n=0;if(e){for(var a=0;a<e.length-1;a++){var o=(e[a][0]-e[(a+1)%(e.length-1)][0])*this.xScale,i=(e[a][1]-e[(a+1)%(e.length-1)][1])*this.yScale,r=Math.sqrt(Math.pow(o,2)+Math.pow(i,2));n+=r,t.push(r*this.quantity)}return{"ESTIMATE.ANNOTATION_VALUES.LENGTH":d.multiply(n,this.quantity).valueOf(),"ESTIMATE.ANNOTATION_VALUES.LENGTHS":t}}}},{key:"calculatePolygonWalls",value:function(e){var t=this;return this.calculatePolygonLenghts(e)["ESTIMATE.ANNOTATION_VALUES.LENGTHS"].map((function(e){return d.chain(e).multiply(t.height).valueOf()}))}},{key:"calculatePolygonVolume",value:function(e){if(e&&void 0!=this.height)return d.chain(this.calculatePolygonArea(e)).multiply(this.height).valueOf()}},{key:"calculatePolygonSurfaceArea",value:function(e){if(e&&void 0!=this.height)return d.chain(this.calculatePolygonLenghts(e)["ESTIMATE.ANNOTATION_VALUES.LENGTH"]).multiply(this.height).valueOf()}},{key:"calculatePolygonPoints",value:function(e){if(e&&void 0!=this.quantity)return(e.length-1)*this.quantity}},{key:"calculateOuterDimX",value:function(e){var t=0,n=0;if(e){t=e[0][1],n=e[0][1];for(var a=0;a<e.length-1;a++)t>e[a][1]&&(t=e[a][1]),n<e[a][1]&&(n=e[a][1])}return d.chain(n-t).multiply(this.xScale).valueOf()}},{key:"calculateOuterDimY",value:function(e){var t=0,n=0;if(e){t=e[0][0],n=e[0][0];for(var a=0;a<e.length-1;a++)t>e[a][0]&&(t=e[a][0]),n<e[a][0]&&(n=e[a][0])}return d.chain(n-t).multiply(this.yScale).valueOf()}},{key:"calculatePolygonValues",value:function(e){var t=this.calculatePolygonLenghts(e),n=this.calculatePolygonArea(e),a=this.calculatePolygonVolume(e),o=this.calculatePolygonSurfaceArea(e);return{"ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME":this.fileName,"ESTIMATE.ANNOTATION_VALUES.AREA":n,"ESTIMATE.ANNOTATION_VALUES.LENGTH":t["ESTIMATE.ANNOTATION_VALUES.LENGTH"],"ESTIMATE.ANNOTATION_VALUES.VOLUME":a,"ESTIMATE.ANNOTATION_VALUES.WALL":o,"ESTIMATE.ANNOTATION_VALUES.NET_AREA":n,"ESTIMATE.ANNOTATION_VALUES.NET_LENGTH":t["ESTIMATE.ANNOTATION_VALUES.LENGTH"],"ESTIMATE.ANNOTATION_VALUES.NET_VOLUME":a,"ESTIMATE.ANNOTATION_VALUES.NET_WALL":o,"ESTIMATE.ANNOTATION_VALUES.POINTS":this.calculatePolygonPoints(e),"ESTIMATE.ANNOTATION_PROPERTIES.COUNT":this.quantity,"ESTIMATE.ANNOTATION_PROPERTIES.HEIGHT":this.height,"ESTIMATE.ANNOTATION_VALUES.LENGTHS":t["ESTIMATE.ANNOTATION_VALUES.LENGTHS"],"ESTIMATE.ANNOTATION_VALUES.WALLS":this.calculatePolygonWalls(e),"ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X":this.calculateOuterDimX(e),"ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y":this.calculateOuterDimY(e)}}},{key:"calculateFormulae",value:function(e){return e&&e.get("annotationData")&&(e.get("formulaNA")&&(e=this.calculateValueFormula(e,"ESTIMATE.ANNOTATION_VALUES.NET_AREA","formulaNA")),e.get("formulaNL")&&(e=this.calculateValueFormula(e,"ESTIMATE.ANNOTATION_VALUES.NET_LENGTH","formulaNL")),e.get("formulaNVO")&&(e=this.calculateValueFormula(e,"ESTIMATE.ANNOTATION_VALUES.NET_VOLUME","formulaNVO")),e.get("formulaNV")&&(e=this.calculateValueFormula(e,"ESTIMATE.ANNOTATION_VALUES.NET_WALL","formulaNV"))),e}},{key:"calculateValueFormula",value:function(e,t,n){var a=e.get("annotationData"),o=isNaN(e.get(n))||e.get(n).includes("+")||e.get(n).includes("-")?s.a.parseExpressionToValues(a.get(t)+e.get(n),a):e.get(n);return a=a.set(t,o),e.set("annotationData",a)}},{key:"calculateLineLength",value:function(e){var t=[],n=0;if(e){for(var a=0;a<e.length-1;a++){var o=(e[a][0]-e[a+1][0])*this.xScale,i=(e[a][1]-e[a+1][1])*this.yScale,r=Math.sqrt(Math.pow(o,2)+Math.pow(i,2));n+=r,t.push(r*this.quantity)}return{"ESTIMATE.ANNOTATION_VALUES.LENGTH":d.multiply(n,this.quantity).valueOf(),"ESTIMATE.ANNOTATION_VALUES.LENGTHS":t}}}},{key:"calculateLineSurfaceArea",value:function(e){if(e&&void 0!=this.height)return d.chain(this.calculateLineLength(e)["ESTIMATE.ANNOTATION_VALUES.LENGTH"]).multiply(this.height).valueOf()}},{key:"calculateLineWalls",value:function(e){var t=this;return this.calculateLineLength(e)["ESTIMATE.ANNOTATION_VALUES.LENGTHS"].map((function(e){return d.chain(e).multiply(t.height).valueOf()}))}},{key:"calculateLineValues",value:function(e){var t=this.calculateLineLength(e),n=this.calculateLineSurfaceArea(e);return{"ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME":this.fileName,"ESTIMATE.ANNOTATION_VALUES.LENGTH":t["ESTIMATE.ANNOTATION_VALUES.LENGTH"],"ESTIMATE.ANNOTATION_VALUES.NET_LENGTH":t["ESTIMATE.ANNOTATION_VALUES.LENGTH"],"ESTIMATE.ANNOTATION_VALUES.WALL":n,"ESTIMATE.ANNOTATION_VALUES.NET_WALL":n,"ESTIMATE.ANNOTATION_VALUES.WALLS":this.calculateLineWalls(e),"ESTIMATE.ANNOTATION_VALUES.LENGTHS":t["ESTIMATE.ANNOTATION_VALUES.LENGTHS"],"ESTIMATE.ANNOTATION_VALUES.POINTS":this.calculateLinePoints(e),"ESTIMATE.ANNOTATION_PROPERTIES.COUNT":this.quantity,"ESTIMATE.ANNOTATION_PROPERTIES.HEIGHT":this.height}}},{key:"calculateLinePoints",value:function(e){if(e&&void 0!=this.quantity)return e.length*this.quantity}},{key:"calculateEllipseArea",value:function(e){if(e&&4===e.length){var t={x:e[0],y:e[1]},n={x:e[2],y:e[3]},a=d.chain(t.x).subtract(n.x).divide(2).abs().multiply(this.xScale).valueOf(),o=d.chain(t.y).subtract(n.y).divide(2).abs().multiply(this.yScale).valueOf();return d.chain(a).multiply(o).multiply(d.pi.valueOf()).multiply(this.quantity).valueOf()}}},{key:"calculateEllipseCircumference",value:function(e){if(e&&4===e.length){var t={x:e[0],y:e[1]},n={x:e[2],y:e[3]},a=d.chain(t.x).subtract(n.x).abs().multiply(this.xScale).divide(2).valueOf(),o=d.chain(t.y).subtract(n.y).abs().multiply(this.yScale).divide(2).valueOf();return d.multiply(d.evaluate("4 * (a+b) * (pi/4)^(4*a*b/((a+b)^2))",{a:a,b:o}),this.quantity)}}},{key:"calculateEllipseVolume",value:function(e){return d.chain(this.calculateEllipseArea(e)).multiply(this.height).valueOf()}},{key:"calculateEllipseSurfaceArea",value:function(e){return d.chain(this.calculateEllipseCircumference(e)).multiply(this.height).valueOf()}},{key:"calculateEllipseValues",value:function(e){var t=d.chain(e[0]).subtract(e[2]).divide(2).abs().multiply(this.xScale).valueOf(),n=d.chain(e[1]).subtract(e[3]).divide(2).abs().multiply(this.yScale).valueOf(),a=this.calculateEllipseArea(e),o=this.calculateEllipseVolume(e),i=this.calculateEllipseSurfaceArea(e),r=this.calculateEllipseCircumference(e);return{"ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME":this.fileName,"ESTIMATE.ANNOTATION_VALUES.AREA":a,"ESTIMATE.ANNOTATION_VALUES.LENGTH":this.calculateEllipseCircumference(e),"ESTIMATE.ANNOTATION_VALUES.VOLUME":o,"ESTIMATE.ANNOTATION_VALUES.WALL":i,"ESTIMATE.ANNOTATION_VALUES.NET_AREA":a,"ESTIMATE.ANNOTATION_VALUES.NET_LENGTH":r,"ESTIMATE.ANNOTATION_VALUES.NET_VOLUME":o,"ESTIMATE.ANNOTATION_VALUES.NET_WALL":i,"ESTIMATE.ANNOTATION_VALUES.RADIUS_X":t,"ESTIMATE.ANNOTATION_VALUES.RADIUS_Y":n,"ESTIMATE.ANNOTATION_VALUES.DIAMETER_X":d.chain(t).multiply(2).valueOf(),"ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y":d.chain(n).multiply(2).valueOf(),"ESTIMATE.ANNOTATION_PROPERTIES.COUNT":this.quantity,"ESTIMATE.ANNOTATION_PROPERTIES.HEIGHT":this.height}}},{key:"calculateTilesForAnnotation",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=e.get("annotationData");if(e.has("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")&&e.has("annotationData")){var o=e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"),i=e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y");if(o&&o>0&&i&&i>0){var r=a.get("ESTIMATE.ANNOTATION_VALUES.NET_AREA"),s=a.get("ESTIMATE.ANNOTATION_VALUES.LENGTH"),l=e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"),c=e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"),u=e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"),d=o*i/1e4,p=r/d,g=p*((o+i)/100)+s/2+t/2,h=g/2*(l/100)+g/2*(c/100),m=(r-h)/d+n,f=h*u;a=a.set("ESTIMATE.ANNOTATION_VALUES.AREA_TILES",m).set("ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_LENGTH",g).set("ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_VOLUME",f),e=e.set("annotationData",a)}}if(e.has("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")&&e.has("annotationData")){var A=e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"),E=e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y");if(A&&A>0&&E&&E>0){var T=a.get("ESTIMATE.ANNOTATION_VALUES.NET_WALL"),S=a.get("ESTIMATE.ANNOTATION_VALUES.LENGTH"),b=e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"),I=e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"),y=e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH"),v=A*E/1e4,N=T/v,O=N*((A+E)/100)+S/2+t/2,w=O/2*(b/100)+O/2*(I/100),P=(T-w)/v+n,R=w*y;a=a.set("ESTIMATE.ANNOTATION_VALUES.WALL_TILES",P).set("ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_LENGTH",O).set("ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_VOLUME",R),e=e.set("annotationData",a)}}return e}},{key:"getNextNumberString",value:function(e){if(this.isNumber(e)){var t=e.length,n=Number.parseInt(e);return(++n).toString().padStart(t,"0")}try{return this.isNumber(e.charAt(e.length-1))?this.adjustNumeric(e):this.adjustCharacters(e)}catch(a){console.log("erro calc: "+a.stack)}}},{key:"isNumber",value:function(e){for(var t=0;t<e.length;t++){var n=e.charAt(t).charCodeAt(0);if(!(n>=48&&n<=57))return!1}return!0}},{key:"isLetter",value:function(e){return e>=65&&e<=90||e>=97&&e<=122}},{key:"adjustCharacters",value:function(e){for(var t=e.split(""),n=!1,a=t.length-1;a>=0;a--){var o=t[a].charCodeAt(0);if(!this.isLetter(o))break;if(o>64&&o<90||o>96&&o<122){n=!0,t[a]=String.fromCharCode(o+1);break}t[t.length-1].charCodeAt(0)<=90?t[a]="A":t[t.length-1].charCodeAt(0)<=122&&(t[a]="a")}return n||(t[t.length-1].charCodeAt(0)<=90?t.push("A"):t[t.length-1].charCodeAt(0)<=122&&t.push("a")),t.join("")}},{key:"adjustNumeric",value:function(e){var t=e.split(""),n=t[t.length-1].charCodeAt(0);if(n<57)return t[t.length-1]=String.fromCharCode(n+1),t.join("");var a=this.getNumberIndexFromLeft(t),o=e.slice(-(e.length-a)),i=o.length,r=e.slice(0,a),s=Number.parseInt(o);return r+(++s).toString().padStart(i,"0")}},{key:"getNumberIndexFromLeft",value:function(e){for(var t=e.length-1;t>=0;t--)if(!this.isNumber(e[t]))return t+1;return 0}}]),e}()},110:function(e,t,n){"use strict";var a=n(48);t.a=Object(a.createActions)(["messageReceived","requestDeleteRowsForFeature","requestDeleteRow","requestCreateRow","requestUpdateRow","requestDeleteReductionFromRow","requestDeleteSelectedRows","updateRowTemplate"])},113:function(e,t,n){"use strict";var a=n(48),o=n(19),i=n(61),r=n(37),s=n(55);t.a=Object(a.createStore)({init:function(){this.lengthX="",this.lengthY="",this.selection=null},getScale:function(e,t){if(t){var n=-1===o.a.getActiveEstimate()?null:o.a.getActiveEstimate().get("id"),a=o.a.getScale({fileId:o.a.getActiveFileId(),estimateId:n,page:t,type:e});return a&&e===s.e&&(this.lengthX=a.length),a&&e===s.f&&(this.lengthY=a.length),a}return null},getSelection:function(){return this.selection},getLength:function(e){return e===s.e?this.lengthX:e===s.f?this.lengthY:void 0},setSelection:function(e){this.selection=e},selectScale:function(e){e&&(i.a.setTreeSelection([]),o.a.setScaleTypeMap(e)),this.setSelection(e)},onGeoScaleMessageHandler:function(e){var t=e.action,n=e.payload;switch(t){case r.h.CREATE:o.a.onScaleCreate(n);break;case r.h.DELETE:o.a.onScaleDelete(n);break;case r.h.UPDATE:o.a.onScaleUpdate(n)}}})},117:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return u}));var a=n(594),o=n(593),i=n(15),r=Object(a.a)(o.a,{epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null});function s(e,t){var n=r.fraction(0,1);if(e){var a=r.splitUnit(r.unit(e,t),["ft","in"]),o=a[1].toNumeric()%1;return a[1]=r.unit(r.floor(a[1].toNumeric()),"in"),r.smaller(o,1/64)?o=0:r.larger(o,63/64)&&(o=0,a[1]=r.unit(r.floor(a[1].toNumeric())+1,"in")),r.equal(o,0)||(a[2]=r.fraction(r.floor(o/(1/64))/64)),a.filter((function(e,t){return 2===t?0!==r.round(r.number(e),4)&&r.unequal(e,n):0!==r.floor(r.round(e.toNumeric(),4))&&r.floor(r.round(e.toNumeric(),4))>0})).reduce((function(e,t){return"Unit"===r.typeof(t)?e+t.toNumeric().toLocaleString()+" "+t.units[0].unit.name+" ":e+r.format(t,{fraction:"ratio",precision:4,notation:"fixed"})+" "}),"").trim().replace(/ in/gi,'"').replace(/ ft/gi,"'")}return""}function l(e,t){return r.unit(e,t).to("sqft").toNumeric().toLocaleString(i.a.language)+" ft\xb2"}function c(e,t){return r.unit(e,t).to("cuft").toNumeric().toLocaleString(i.a.language)+" ft\xb3"}function u(e){var t=0,n=e.trim().replace(/ /gi,"");n=n.replace(/"/gi,"in ").replace(/'/gi,"ft ").trim().toLocaleLowerCase().split(" ");for(var a=0;a<n.length;a++)n[a].includes("yd")?(n[a]=n[a].slice(0,n[a].indexOf("yd")),t=r.add(r.bignumber(t),r.bignumber(r.unit(n[a],"yd").to("m").toNumeric()))):n[a].includes("ft")?(n[a]=n[a].slice(0,n[a].indexOf("ft")),t=r.add(r.bignumber(t),r.bignumber(r.unit(n[a],"ft").to("m").toNumeric()))):n[a].includes("in")?(n[a]=n[a].slice(0,n[a].indexOf("in")),t=r.add(r.bignumber(t),r.bignumber(r.unit(n[a],"in").to("m").toNumeric()))):t=r.add(r.bignumber(t),r.unit(r.bignumber(r.eval(n[a])),"in").to("m").toNumeric());return t.toPrecision(10)}},125:function(e,t,n){"use strict";n.d(t,"d",(function(){return u})),n.d(t,"e",(function(){return d})),n.d(t,"b",(function(){return p})),n.d(t,"c",(function(){return g})),n.d(t,"a",(function(){return h}));var a=n(35),o=n(5),i=(n(10),n(252)),r=n(74),s=n(86),l=n(241),c=n(240),u=function(e){var t=e.button,n=o.a.isActiveIfcFile(),a=o.a.WebViewer.docViewer.getTool(o.a.WebViewer.Tools.ToolNames.PAN);switch(t){case 1:n||(e.preventDefault(),e.stopPropagation(),o.a.setToolMode("Pan",!0),a.mouseLeftDown(e))}},d=function(e){var t=e.button,n=o.a.isActiveIfcFile(),a=o.a.WebViewer.docViewer.getTool(o.a.WebViewer.Tools.ToolNames.PAN);switch(t){case 1:n||(e.preventDefault(),e.stopPropagation(),a.mouseLeftUp(e),o.a.backToPreviousToolMode())}},p=function(e){var t=e.key,n=e.keyCode,a=o.a.isActiveIfcFile();switch("Control"===t&&o.a.setIsCtrlPressed(!1),n){case 32:a||(o.a.backToPreviousToolMode(),e.preventDefault(),e.stopPropagation())}},g=function(e){var t=o.b.getRole(),n=e.keyCode,u=e.ctrlKey,d=e.altKey,p=e.shiftKey,g=new i.a,h=o.q.getCurrentlySelectedNodes(),m=o.a.isActiveIfcFile();if(u&&o.a.setIsCtrlPressed(!0),!Object(l.a)(e))switch(Object(c.a)(e),n){case 27:o.a.handleEscapeButtonInCalculate();break;case 48:case 96:u&&!m&&t?(o.a.setToolMode("AnnotationCreateScale"),e.preventDefault(),e.stopPropagation()):d&&!m?(o.a.setFitToScreen(),e.preventDefault(),e.stopPropagation()):d&&m&&(o.k.onResetView(),e.preventDefault(),e.stopPropagation());break;case 49:case 97:u&&d?(o.a.changeAnnotsStatus("notStarted"),e.preventDefault(),e.stopPropagation()):d&&p?(o.a.onToggleDocument(),e.preventDefault(),e.stopPropagation()):u&&!m?(o.a.setToolMode("AnnotationEdit"),e.preventDefault(),e.stopPropagation()):d&&m&&(o.k.setActiveTool(s.a.FREE_ORBIT),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 50:case 98:u&&d?(o.a.changeAnnotsStatus("progress"),e.preventDefault(),e.stopPropagation()):d&&p?(o.a.onToggleRows(),e.preventDefault(),e.stopPropagation()):u&&!m&&t?(o.a.setToolMode("AnnotationCreatePoint"),e.preventDefault(),e.stopPropagation()):d&&m&&(o.k.setActiveTool(s.a.PAN),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 51:case 99:u&&d?(o.a.changeAnnotsStatus("review"),e.preventDefault(),e.stopPropagation()):d&&p?(o.a.onToggleProperties(),e.preventDefault(),e.stopPropagation()):u&&!m&&t?(o.a.setToolMode("AnnotationCreatePolyline"),e.preventDefault(),e.stopPropagation()):d&&m&&(o.k.setActiveTool(s.a.ZOOM),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 52:case 100:u&&d?(o.a.changeAnnotsStatus("complete"),e.preventDefault(),e.stopPropagation()):u&&p&&!o.a.isReductionToolDisabled()&&t?(o.a.setToolMode("AnnotationCreateReduction"),e.preventDefault(),e.stopPropagation()):u&&!m&&t?(o.a.setToolMode("AnnotationCreatePolygon"),e.preventDefault(),e.stopPropagation()):d&&m&&(o.k.setActiveTool(s.a.FIRST_PERSON),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 53:case 101:u&&!m&&t&&(o.a.setToolMode("AnnotationCreateEllipse"),e.preventDefault(),e.stopPropagation());break;case 54:case 102:u&&!m&&t&&(o.a.setToolMode("AnnotationCreateFreeHand"),e.preventDefault(),e.stopPropagation());break;case 55:case 103:u&&!m&&t&&(o.a.setToolMode("AnnotationCreateFreeText"),e.preventDefault(),e.stopPropagation());break;case 56:case 104:u&&!m&&t&&(o.a.setToolMode("AnnotationCreateStamp"),e.preventDefault(),e.stopPropagation());break;case 57:case 105:u&&!m&&t&&(o.a.setToolMode("AnnotationCreateArrow"),e.preventDefault(),e.stopPropagation());break;case 78:u&&d&&t&&(a.a.requestAnnotationFolderCreate("Folder"),e.preventDefault(),e.stopPropagation());break;case 71:u&&!m&&(o.a.toggleSnapon1(),e.preventDefault(),e.stopPropagation());break;case 46:var f=o.a.getAnnotationsLists();p?f.readOnlyList.size>0?(o.a.toggleDeleteModal(),e.preventDefault(),e.stopPropagation()):f.readWriteList.size>0&&(g.deleteAnnotations(f.readWriteList),o.q.clearSelectedAnnotations(),o.a.deSelectAllAnnotationsFromGui(),e.preventDefault(),e.stopPropagation()):(f.readWriteList.size>0||f.readOnlyList.size>0)&&(o.a.toggleDeleteModal(),e.preventDefault(),e.stopPropagation());break;case 90:u&&!m&&t?(o.a.undoDrawing(e),e.preventDefault(),e.stopPropagation()):d&&!m&&(o.a.setToolMode("MarqueeZoomTool"),e.preventDefault(),e.stopPropagation());break;case 65:u&&p?(o.q.calculateTreeSelect([],{selectedNodes:[]}),e.preventDefault(),e.stopPropagation()):u&&(o.a.selectAll(),e.preventDefault(),e.stopPropagation());break;case 69:u&&d?(o.a.expandAll(),e.preventDefault(),e.stopPropagation()):u&&(o.a.onShowFileExportModal(),e.preventDefault(),e.stopPropagation());break;case 87:u&&d&&(o.q.setTreeExpansion([]),e.preventDefault(),e.stopPropagation());break;case 76:if(u&&p&&t){var A=Object(r.c)(h),E=h.filter((function(e){return"group"!==e.get("type")})).toJS();E.length>0&&o.a.onRequestAnnotationUpdate({annots:E,key:"readOnly",value:!A}),e.preventDefault(),e.stopPropagation()}break;case 113:t&&(o.a.onFocusNameInput(),e.preventDefault(),e.stopPropagation());break;case 114:t&&(o.a.onFocusNrTagInput(),e.preventDefault(),e.stopPropagation());break;case 115:t&&(e.preventDefault(),e.stopPropagation(),o.a.onShowFillColour());break;case 116:t&&(e.preventDefault(),e.stopPropagation(),o.a.onShowBorderColour());break;case 120:!m&&t&&(o.a.onShowTiles(),e.preventDefault(),e.stopPropagation());break;case 121:!m&&t&&(o.a.onShowAngles(),e.preventDefault(),e.stopPropagation());break;case 67:u&&p&&d&&h.size>0&&t?(o.d.copyAnnotationProperties(),e.preventDefault(),e.stopPropagation()):u&&d&&h.size>0&&t?(o.d.copyAnnotationStyles(),e.preventDefault(),e.stopPropagation()):u&&p&&h.size>0&&t?(o.n.copyAnnotationRows(h),e.preventDefault(),e.stopPropagation()):u&&!m&&t&&(o.a.copyAnnotations(),e.preventDefault(),e.stopPropagation());break;case 86:u&&p&&d&&o.d.getPropertiecCopy().size>0&&h.size>0&&t?(o.d.pasteAnnotationProperties(h),e.preventDefault(),e.stopPropagation()):u&&d&&o.d.getStylesCopy().size>0&&h.size>0&&t?(o.d.pasteAnnotationStyles(h),e.preventDefault(),e.stopPropagation()):u&&p&&o.n.getCopyAnnotationRows().size>0&&h.size>0&&t?(o.n.pasteAnnotationRows(h),e.preventDefault(),e.stopPropagation()):u&&!m&&t&&(o.a.pasteAnnotations(),e.preventDefault(),e.stopPropagation());break;case 68:u&&p&&t?(o.a.onshowReplaceRowsConfirmation(),e.preventDefault(),e.stopPropagation()):u&&!m&&t&&(o.a.copyAnnotations(),o.a.pasteAnnotations(),e.preventDefault(),e.stopPropagation());break;case 80:u&&!m&&(o.a.saveDocumentToPdf(),e.preventDefault(),e.stopPropagation());break;case 38:d&&!m&&(o.a.zoomInPDF(),e.preventDefault(),e.stopPropagation());break;case 40:d&&!m&&(o.a.zoomOutPDF(),e.preventDefault(),e.stopPropagation());break;case 37:d&&!m&&(o.a.rotateLeftPDF(),e.preventDefault(),e.stopPropagation());break;case 39:d&&!m&&(o.a.rotatePDF(),e.preventDefault(),e.stopPropagation())}},h=function(e){var t=e.keyCode,n=o.a.isActiveIfcFile();switch(t){case 32:n||(o.a.setToolMode("Pan",!0),e.preventDefault(),e.stopPropagation())}}},132:function(e,t,n){"use strict";var a=n(48),o=n(587),i=n(60),r=n(5),s=n(37),l=n(49),c=n(182),u=n(113),d=n(35),p=n(57);t.a=Object(a.createStore)({init:function(){this.socket=null,this.Manager=null},getSocketStatus:function(){return!!this.socket&&this.socket.connected},onInitSocket:function(){var e=this;this.socket&&this.Manager||(this.Manager=new o.a("".concat("https://api.geometra.rukkor.io"),{reconnectionDelay:"2000",reconnectionDelayMax:"10000",closeOnBeforeunload:!1}),this.socket=this.Manager.socket("/",{auth:{token:i.a.getJwt()}}),this.socket.on(s.i.CONNECT,(function(){console.log("Connected to socket. Connection id: ".concat(e.socket.id)),d.b.messageReceived(200)})),this.socket.on(s.i.RECONNECT,(function(){return console.log("Reconnecting..")})),this.socket.on(s.i.DISCONNECT,(function(){return console.log("Socket disconnected")})),this.socket.on(s.i.RECONNECT_ERR,(function(e){return console.log("Reconect error",e)})),this.socket.on(s.i.ERROR,(function(e){return console.log(e)})),this.socket.on(s.i.BUNDLE_REFRESH,(function(){return i.a.setIsNewAppVersion(!0)})),this.socket.on(s.f.GEO_PROJECT,(function(e){return r.m.onGeoProjectMessageHandler(e)})),this.socket.on(s.f.GEO_FILE,(function(e){return p.a.onGeoFileMessageHandler(e)})),this.socket.on(s.f.GEO_ANNOTATION,(function(e){return r.a.onGeoAnnotationMessageHandler(e)})),this.socket.on(s.f.GEO_ANNOTATION_ROW,(function(e){return l.a.onGeoAnnotationRowMessageHandler(e)})),this.socket.on(s.f.GEO_ESTIMATE,(function(e){return c.a.onGeoEstimateMessageHandler(e)})),this.socket.on(s.f.GEO_SCALE,(function(e){return u.a.onGeoScaleMessageHandler(e)})),this.socket.on(s.f.AUTH,(function(e){return i.a.onAuthMessageHandler(e)})))},onSendMessage:function(e,t){try{var n;(null===(n=this.socket)||void 0===n?void 0:n.connected)&&this.socket.emit(e,t)}catch(a){console.log(a)}},onSetActiveProjectId:function(e){this.onSendMessage(s.f.GEO_PROJECT,{action:s.g.OPEN,geoProjectId:e})},closeSocket:function(){this.socket&&this.socket.connected&&this.socket.disconnect(),this.socket=null,this.Manager=null}})},133:function(e,t,n){"use strict";var a=n(28),o=n(48),i=n(10),r=n(19),s=n(49),l=n(110),c=n(12);t.a=Object(o.createStore)({init:function(){this.copiedRows=new i.a.List},getCopyAnnotationRows:function(){return this.copiedRows},copySelectedRows:function(e){this.copiedRows=this.copiedRows.clear(),this.copiedRows=this.copiedRows.concat(e)},copyAnnotationRows:function(e){var t=this;this.copiedRows=this.copiedRows.clear(),this.getAnnotationsToUpdate(e).forEach((function(e){var n=s.a.getAllRowsForAnnotation(e);t.copiedRows=t.copiedRows.concat(n)}))},pasteAnnotationRows:function(e){var t=e.filter((function(e){return"group"!==e.get("type")}));if(this.copiedRows.size){var n=this.getAnnotationsToUpdate(t).filter((function(e){return"CenterValue"!==e.get("type")&&"PeripheralValue"!==e.get("type")})).map((function(e){return e.get("id")})).toJS(),a=this.copiedRows.map((function(e){return e.get("id")})).toJS();n.length>0&&s.a.onRequestPasteRows(n,a)}},replaceSelectedRows:function(e){var t=this;if(this.copiedRows.size){var n=new i.a.List,o=this.getAnnotationsToUpdate(e,!0);if(o.forEach((function(e){t.copiedRows.forEach((function(t){t=(t=t.set("geoAnnotation",i.a.fromJS({id:e.id}))).set("annotationRow",JSON.stringify(t.get("annotationRow"))),n=n.push(t)}))})),n.size>0){var r=Object(c.map)(this.copiedRows.toJS(),(function(e){return Object(a.a)(Object(a.a)({},e),{},{annotationRow:JSON.stringify(e.annotationRow)})}));s.a.onRequestDeleteSelectedRows(),l.a.requestCreateRow({annotationIds:Object(c.map)(o,(function(e){return e.id})),newRows:r})}}},replaceAnnotationRows:function(e){var t=this;if(this.copiedRows.size){var n=new i.a.List,o=this.getAnnotationsToUpdate(e,!0);if(o.forEach((function(e){t.copiedRows.forEach((function(t){t=(t=t.set("geoAnnotation",i.a.fromJS({id:e.id}))).set("annotationRow",JSON.stringify(t.get("annotationRow"))),n=n.push(t)}))})),n.size>0){var r=Object(c.map)(this.copiedRows.toJS(),(function(e){return Object(a.a)(Object(a.a)({},e),{},{annotationRow:JSON.stringify(e.annotationRow)})}));s.a.onRequestDeleteRowsForAnnotations(i.a.fromJS(o)),l.a.requestCreateRow({annotationIds:Object(c.map)(o,(function(e){return e.id})),newRows:r})}}},getAllAnnotationRows:function(e){var t=[];return this.getAnnotationsToUpdate(e,!0).forEach((function(e){s.a.getAllRowsForAnnotation(i.a.fromJS(e)).toJS().forEach((function(e){return t.push(e)}))})),t},getAnnotationsToUpdate:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=new i.a.List;return e.forEach((function(e){if("group"===e.get("type")){var t=r.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return"group"!==e.get("type")}));n=n.concat(t)}else n=n.push(e)})),t?Object(c.uniqBy)(n.toJS(),"id"):n}})},144:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["initializeEstimates","requestAnnotationUpdate","requestAnnotationCreate","requestAnnotationDelete","requestAnnotationFolderCreate","messageReceived","setActiveFileId","setActivePageId","setActiveParentId","setActiveLayerId","toggleDisplayValues","toggleReductionShowValues","toggleScaleDisplayValues","deleteReductionFeature","triggerDeleteScale","focusNameField"]);t.a=o},147:function(e,t,n){"use strict";var a=n(48);t.a=Object(a.createStore)({init:function(){this.contextMenuCalculateRowsOpen=!1},isContextMenuCalculateRowsOpen:function(){return this.contextMenuCalculateRowsOpen},setContextMenuCalculateRowsOpen:function(e){this.contextMenuCalculateRowsOpen=e}})},15:function(e,t,n){"use strict";var a=n(430),o=n(591),i=n(258),r=function(){var e=localStorage.getItem("language")||"en";switch(e){case"es":return"es-ES";default:return e}};a.a.use(o.a).use(i.e).init({fallbackLng:r(),debug:!1,saveMissing:!0,saveMissingTo:"all",keySeparator:!1,nsSeparator:!1,interpolation:{escapeValue:!1},backend:{projectId:"3e82a4db-f62c-451e-948f-8951b6bd86ff",apiKey:"3e73a957-5bc9-4274-ac7c-26bd8d4e31aa",referenceLng:r()},react:{useSuspense:!1}}),t.a=a.a},155:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["login","logout","messageReceived","loginWithStoredCredentials","requestNewPassword","setUserData","updateTermsOfService"]);t.a=o},156:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["sendCreateRootFolder","sendCreateFolder","sendRemoveFolder","sendUpdateFile","fileInserted","folderInserted","filesDeleted","fileUpdated","requestGetFiles","clearFileList","setExpandedKeys","setSelectedFileNodes","buildTree","addNodeToTree","updateTree","uploadFileChannelOpen","uploadFile","deleteFile","incrementLoader","deleteFolder"]);t.a=o},158:function(e,t,n){"use strict";n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return s})),n.d(t,"b",(function(){return g}));var a=function(){var e="Unknown OS";return-1!=navigator.appVersion.indexOf("Win")&&(e="Windows"),-1!=navigator.appVersion.indexOf("Mac")&&(e="MacOS"),-1!=navigator.appVersion.indexOf("X11")&&(e="UNIX"),-1!=navigator.appVersion.indexOf("Linux")&&(e="Linux"),e},o=n(28),i=n(109),r=n(57),s=function(e){var t=l(),n=d(t,e),a=u(n[0])[0];return c(a)},l=function(){var e=r.a.getRootFolder();return[p(e)]},c=function(e){return e.pop(),e},u=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t.children&&0!==t.children.length||a.push(n.concat(t.title)),t.children){var o,r=Object(i.a)(t.children);try{for(r.s();!(o=r.n()).done;){var s=o.value;e(s,n.concat(t.title),a)}}catch(l){r.e(l)}finally{r.f()}}return a},d=function e(t,n){return t.reduce((function(t,a){if(a.key===n)t.push(a);else if(a.children&&a.children.length>0){var i=e(a.children,n);i.length>0&&t.push(Object(o.a)(Object(o.a)({},a),{},{children:i}))}return t}),[])},p=function e(t){var n=r.a.getChildren(t.id),a={title:t.name,key:t.id,type:t.type};return"folder"===t.type&&(a.children=n.map((function(t){return e(t)}))),a},g=function(e){return"".concat("https://rukkor-bimerconverter-out-prod.s3.amazonaws.com/").concat(e,"/").concat(e,".json")}},161:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(25),o=n(29),i=function(){function e(){Object(a.a)(this,e);var t=new DOMParser;this.xfdfElements=t.parseFromString('<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><fields /><add> </add><modify></modify><delete> </delete></xfdf>',"text/xml"),this.modify=this.xfdfElements.querySelector("modify"),this.add=this.xfdfElements.querySelector("add"),this.delete=this.xfdfElements.querySelector("delete")}return Object(o.a)(e,[{key:"addAddedCommand",value:function(e){var t=(new DOMParser).parseFromString(e,"text/xml").querySelector("annots").firstElementChild;return t&&this.add.appendChild(t),t}},{key:"addModifyCommand",value:function(e){if(this.xfdfElements){var t=(new DOMParser).parseFromString(e,"text/xml").querySelector("annots").firstElementChild;this.modify.appendChild(t)}}},{key:"addDeletedCommand",value:function(e){if(this.xfdfElements){var t=this.xfdfElements.createElement("id"),n=(new DOMParser).parseFromString(e,"text/xml").querySelector("annots").firstElementChild,a=this.xfdfElements.createTextNode(n.getAttribute("name"));t.setAttribute("page",n.getAttribute("page")),t.appendChild(a),this.delete.appendChild(t)}}},{key:"getAnnotCommand",value:function(){var e=void 0;this.xfdfElements&&(e=(new XMLSerializer).serializeToString(this.xfdfElements));return e}},{key:"getModifyList",value:function(e){return(new DOMParser).parseFromString(e,"text/xml").querySelector("modify").children}}]),e}()},162:function(e,t,n){"use strict";n.d(t,"b",(function(){return s})),n.d(t,"c",(function(){return l})),n.d(t,"a",(function(){return c}));var a=n(86),o=n(5),i=n(240),r=n(241),s=function(e){var t,n=e.button,a="ifc"===(null===(t=o.i.getSelectedFiles()[0])||void 0===t?void 0:t.type),i=o.i.webViewer.docViewer.getTool(o.i.webViewer.Tools.ToolNames.PAN);switch(n){case 1:a||(e.preventDefault(),e.stopPropagation(),o.i.setToolMode("Pan",!0),i.mouseLeftDown(e))}},l=function(e){var t,n=e.button,a="ifc"===(null===(t=o.i.getSelectedFiles()[0])||void 0===t?void 0:t.type),i=o.i.webViewer.docViewer.getTool(o.i.webViewer.Tools.ToolNames.PAN);switch(n){case 1:a||(e.preventDefault(),e.stopPropagation(),i.mouseLeftUp(e),o.i.backToPreviousToolMode())}},c=function(e){var t,n=o.b.getRole(),s="ifc"===(null===(t=o.i.getSelectedFiles()[0])||void 0===t?void 0:t.type),l=e.keyCode,c=e.ctrlKey,u=e.altKey,d=e.shiftKey;if(!Object(r.a)(e))switch(Object(i.a)(e),l){case 78:u&&c&&n&&(o.i.onOpenFolderModal(),e.preventDefault(),e.stopPropagation());break;case 85:c&&n&&(o.i.onOpenUploadModal(),e.preventDefault(),e.stopPropagation());break;case 68:c&&(o.i.onDownloadFile(),e.preventDefault(),e.stopPropagation());break;case 79:c&&(o.i.onOpenInCalculate(),e.preventDefault(),e.stopPropagation());break;case 46:d?(o.i.deleteWithoutConfirmation(),e.preventDefault(),e.stopPropagation()):o.i.getCheckedItemsIds().length>0&&(o.i.showDeleteConfirmation(),e.preventDefault(),e.stopPropagation());break;case 69:u&&c&&(o.i.onExpandAll(),e.preventDefault(),e.stopPropagation());break;case 87:u&&c&&(o.i.onCollapseAll(),e.preventDefault(),e.stopPropagation());break;case 48:case 96:u&&!s?(o.i.setFitToScreen(),e.preventDefault(),e.stopPropagation()):u&&s&&(o.k.onResetView(),e.preventDefault(),e.stopPropagation());break;case 49:case 97:u&&c?(o.i.onUpdateCheckedNodesStatuses("notStarted"),e.preventDefault(),e.stopPropagation()):u&&s&&(o.k.setActiveTool(a.a.FREE_ORBIT),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 50:case 98:u&&c?(o.i.onUpdateCheckedNodesStatuses("progress"),e.preventDefault(),e.stopPropagation()):u&&s&&(o.k.setActiveTool(a.a.PAN),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 51:case 99:u&&c?(o.i.onUpdateCheckedNodesStatuses("review"),e.preventDefault(),e.stopPropagation()):u&&s&&(o.k.setActiveTool(a.a.ZOOM),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 52:case 100:u&&c?(o.i.onUpdateCheckedNodesStatuses("complete"),e.preventDefault(),e.stopPropagation()):u&&s&&(o.k.setActiveTool(a.a.FIRST_PERSON),o.k.onChangeActiveTool(),e.preventDefault(),e.stopPropagation());break;case 90:u&&!s&&(o.i.onSetMarqueeZoomTool(),e.preventDefault(),e.stopPropagation())}}},170:function(e,t,n){"use strict";var a=n(48);t.a=Object(a.createStore)({listenables:[],init:function(){this.appSearch=""},setAppSearch:function(e){this.appSearch=e,this.trigger("appSearchUpdated")},onFocusSearchInput:function(){this.trigger("focusSearchInput")},showFeedbackDialog:function(){this.trigger("showFeedbackDialog")},getAppSearch:function(){return this.appSearch}})},173:function(e,t,n){"use strict";n.d(t,"a",(function(){return l}));var a=n(0),o=n.n(a),i=n(83),r=n(319),s=n(24),l=[{value:"notStarted",StatusIcon:function(){return o.a.createElement(s.m,{notStarted:!0})},label:"Not started"},{value:"progress",StatusIcon:function(){return o.a.createElement(s.m,{progress:!0})},label:"In Progress"},{value:"review",StatusIcon:function(){return o.a.createElement(s.m,{review:!0})},label:"Review"},{value:"complete",StatusIcon:function(){return o.a.createElement(s.m,{complete:!0})},label:"Complete"}];r.a,i.a,i.g,i.d},178:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["openProjectButtonClicked","openProjectInNewWindowButtonClicked","newProjectButtonClicked","deleteProjectsButtonClicked","filterProjectsButtonClicked","removeFilterProjectsButtonClicked","helpButtonClicked","setOpenProjectBlur","setOpenProjectInNewWindowBlur","setProjectState","uploadFileClicked","downloadFilesClicked","deleteFileClicked","addFolderClicked","setFilesState","selectDrawingOnMapClicked","openCalculationClicked","drawAreaButtonClicked","drawLineButtonClicked","drawPointButtonClicked","drawFreehandButtonClicked","drawCircleButtonClicked","drawScaleButtonClicked","commentButtonClicked","search","searchEstimate","rotateMapButtonClicked","fitToScreenButtonClicked","zoomInButtonClicked","zoomOutButtonClicked","createFolderButtonClicked","pageChanged","pageChangedByFeatureTable","updateButtonState","editDrawingButtonClicked","deleteCalculationRowClicked","addCalculationRowClicked","exportButtonClicked","focusSearchField","focusSearchFieldEstimate","printMapButtonClicked","saveToPDFButtonClicked","enableReductionDrawingTool","disableReductionDrawingTool","drawAreaReductionClicked","feedbackButtonClicked","supportButtonClicked","panButtonClicked","copyButtonClicked","pasteButtonClicked","duplicateButtonClicked","setSelectState","deleteAnnotations","toggleEstimateRows","togglePropertiesPane","togglePDFView","toggleSnapon"]);t.a=o},18:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a={VISIBLE:"ESTIMATE.ANNOTATION_PROPERTIES.VISIBLE",TURN_OFF_FILL:"ESTIMATE.ANNOTATION_PROPERTIES.FILL",NUMBER:"ESTIMATE.ANNOTATION_PROPERTIES.NUMBER",NAME:"ESTIMATE.ANNOTATION_PROPERTIES.NAME",AREA:"ESTIMATE.ANNOTATION_VALUES.AREA",NET_AREA:"ESTIMATE.ANNOTATION_VALUES.NET_AREA",RED_AREA:"ESTIMATE.ANNOTATION_VALUES.RED_AREA",LENGTHS:"ESTIMATE.ANNOTATION_VALUES.LENGTHS",VOLUME:"ESTIMATE.ANNOTATION_VALUES.VOLUME",NET_VOLUME:"ESTIMATE.ANNOTATION_VALUES.NET_VOLUME",RED_VOLUME:"ESTIMATE.ANNOTATION_VALUES.RED_VOLUME",WALLS:"ESTIMATE.ANNOTATION_VALUES.WALLS",TOTAL_WALL:"ESTIMATE.ANNOTATION_VALUES.WALL",TOTAL_NET_WALL:"ESTIMATE.ANNOTATION_VALUES.NET_WALL",TOTAL_RED_WALL:"ESTIMATE.ANNOTATION_VALUES.RED_WALL",VARIABLES:"ESTIMATE.ANNOTATION_VALUES.VARIABLES",REDUCTION:"ESTIMATE.DEFAULT_VALUES.REDUCTION",REDUCTIONS:"ESTIMATE.DEFAULT_VALUES.REDUCTIONS",LENGTH:"ESTIMATE.ANNOTATION_VALUES.LENGTH",SCALE_LENGTH:"ESTIMATE.ANNOTATION_VALUES.SCALE_LENGTH",NET_LENGTH:"ESTIMATE.ANNOTATION_VALUES.NET_LENGTH",RED_LENGTH:"ESTIMATE.ANNOTATION_VALUES.RED_LENGTH",SHOW_VALUES_TREE:"ESTIMATE.ANNOTATION_VALUES.TREE",EDGES:"ESTIMATE.ANNOTATION_VALUES.EDGES",SIDES:"ESTIMATE.ANNOTATION_VALUES.S",SIDE_LENGTHS:"ESTIMATE.ANNOTATION_VALUES.SL",POINTS:"ESTIMATE.ANNOTATION_VALUES.POINTS",COUNT:"ESTIMATE.ANNOTATION_PROPERTIES.COUNT",HEIGHT:"ESTIMATE.ANNOTATION_PROPERTIES.HEIGHT",OUTER_DIM_X:"ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X",OUTER_DIM_Y:"ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y",AREA_TILES:"ESTIMATE.ANNOTATION_VALUES.AREA_TILES",AREA_JOINT_LENGTH:"ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_LENGTH",AREA_JOINT_VOLUME:"ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_VOLUME",WALL_TILES:"ESTIMATE.ANNOTATION_VALUES.WALL_TILES",WALL_JOINT_LENGTH:"ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_LENGTH",WALL_JOINT_VOLUME:"ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_VOLUME",RADIUS_X:"ESTIMATE.ANNOTATION_VALUES.RADIUS_X",RADIUS_Y:"ESTIMATE.ANNOTATION_VALUES.RADIUS_Y",DIAMETER_X:"ESTIMATE.ANNOTATION_VALUES.DIAMETER_X",DIAMETER_Y:"ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y"}},182:function(e,t,n){"use strict";var a=n(28),o=n(76),i=n(48),r=n(12),s=n(35),l=n(19),c=n(37);t.a=Object(i.createStore)({listenables:[s.e],init:function(){this.estimates=[],this.annotations=[],this.activeEstimate={},this.activeAnnotations=[]},getEstimates:function(){return this.estimates},getAnnotations:function(){return this.annotations},getActiveEstimate:function(){return this.activeEstimate},getActiveAnnotations:function(){return this.activeAnnotations},setActiveEstimate:function(e){this.activeEstimate=e,localStorage.setItem("activeEstimate",JSON.stringify(e)),this.trigger("updateActiveEstimate"),window.location.reload()},setActiveAnnotations:function(){this.activeAnnotations=Object(r.get)(Object(r.find)(this.annotations,(function(e){return e.estimateId===l.a.getActiveEstimate().get("id")})),"annotations")},onSetEstimates:function(e){this.annotations=[],this.estimates=e;var t=JSON.parse(localStorage.getItem("activeEstimate"));e[0].geoProject.id===Object(r.get)(t,"geoProject.id")?this.activeEstimate=t:(this.activeEstimate=e[0],localStorage.setItem("activeEstimate",JSON.stringify(e[0])),this.trigger("updateActiveEstimate")),this.trigger("updateEstimates")},updateAnnotationsInDrive:function(e){var t=e.toJS().filter((function(e){return"group"!==e.type})).map((function(e){var t=e.type,n=e.xfdf,i=Object(o.a)(e,["type","xfdf"]);return Object(a.a)(Object(a.a)({},i),{},{type:t,xfdf:"3DModel"===t?JSON.stringify(n):n})}));this.onSetAnnotations(t)},setAnnotationsFromJava:function(e){var t=this;Object(r.forEach)(e,(function(n){t.onSetAnnotations(n.theGeoAnnotationList),s.f.incrementLoader(50/e.length,null,!0)}))},onSetAnnotations:function(e){var t=Object(r.get)(e[0],"geoEstimate.id");if(e&&t){var n=Object(r.map)(Object(r.groupBy)(e,(function(e){return Object(r.get)(e,"geoFile.id")})),(function(e){return{fileId:Object(r.get)(e[0],"geoFile.id"),annotations:e}})),a={estimateId:t,annotations:n},o=this.annotations.findIndex((function(e){return e.estimateId===t}));-1===o?this.annotations.push(a):this.annotations[o]=a,this.setActiveAnnotations(),this.trigger("annotationsUpdated")}},onSetAnnotationsFromPDF:function(e){var t=e,n=Object(r.groupBy)(t,(function(e){return e.geoFile.id})),a=Object(r.map)(n,(function(e){return{fileId:e[0].geoFile.id,annotations:e}}));Object(r.find)(this.annotations,(function(t){return t.estimateId===e[0].geoEstimate.id})).annotations.push(a[0]),this.setActiveAnnotations()},onAddEstimate:function(e){this.estimates.push(e),this.trigger("updateEstimates")},onDeleteEstimate:function(e){this.estimates=this.estimates.filter((function(t){return t.id!==e.id})),this.activeEstimate.id===e.id&&(this.activeEstimate=this.estimates[0],localStorage.setItem("activeEstimate",JSON.stringify(this.estimates[0])),this.trigger("updateActiveEstimate"),window.location.reload()),this.trigger("updateEstimates")},onEditEstimate:function(e){var t=this.estimates.findIndex((function(t){return t.id==e.id}));this.estimates[t].name=e.name,JSON.parse(localStorage.getItem("activeEstimate")).id===e.id&&(localStorage.setItem("activeEstimate",JSON.stringify(e)),this.activeEstimate=e),this.trigger("updateEstimates")},onCopyEstimate:function(e){this.estimates.push(e),this.trigger("updateEstimates")},onLockEstimate:function(e){var t=this.estimates.findIndex((function(t){return t.id==e.id}));this.estimates[t].locked=e.locked,this.activeEstimate.id===e.id&&window.location.reload(),this.trigger("updateEstimates")},onGeoEstimateMessageHandler:function(e){var t=e.payload;switch(e.action){case c.d.DUPLICATE:this.onCopyEstimate(t);break;default:return}}})},19:function(e,t,n){"use strict";var a=n(76),o=n(30),i=n(34),r=n(28),s=n(26),l=n.n(s),c=n(47),u=n(12),d=n.n(u),p=n(77),g=n(212),h=n.n(g),m=n(234),f=n(33),A=function(e){return e.replace(/;$/,"").split(";").reduce((function(e,t){var n=t.split(":"),a=n[0].trim(),i=n[1].trim();return Object(r.a)(Object(r.a)({},e),{},Object(o.a)({},a,i))}),{})},E=function(e){for(var t="",n=0,a=Object.entries(e);n<a.length;n++){var o=Object(f.a)(a[n],2),i=o[0],r=o[1];t="".concat(t).concat(i,": ").concat(r,";")}return t},T=n(117),S=n(161),b=n(144),I=n(178),y=n(60),v=n(49),N=n(99),O=n(25),w=n(29),P=n(18),R=n(10),L=function(){function e(){Object(O.a)(this,e),this.parser=new DOMParser}return Object(w.a)(e,[{key:"getDisplayListForAnnotation",value:function(e){var t,n=new R.a.List,a=void 0;a="x-scale"===e.get("type")||"y-scale"===e.get("type")?e.get("xdf"):e.get("xfdf");var o=this.parser.parseFromString(a,"text/xml"),i=null===o||void 0===o||null===(t=o.querySelector("annots"))||void 0===t?void 0:t.children[0];if(i){switch(null===e||void 0===e?void 0:e.get("type")){case"x-scale":case"y-scale":"true"===i.getAttribute("showLengths")&&(n=n.push(P.a.SCALE_LENGTH));break;case"Point":"true"===i.getAttribute("Hidden")&&(n=n.push(P.a.VISIBLE)),"true"===i.getAttribute("showNumber")&&(n=n.push(P.a.NUMBER)),"true"===i.getAttribute("showName")&&(n=n.push(P.a.NAME)),"true"===i.getAttribute("showValuesTree")&&(n=n.push(P.a.SHOW_VALUES_TREE));break;case"Polygon":"true"===i.getAttribute("Hidden")&&(n=n.push(P.a.VISIBLE)),"true"===i.getAttribute("showReduction")&&(n=n.push(P.a.REDUCTION));case"Reduction":"true"===i.getAttribute("Hidden")&&(n=n.push(P.a.VISIBLE)),"true"===i.getAttribute("showNumber")&&(n=n.push(P.a.NUMBER)),"true"===i.getAttribute("showName")&&(n=n.push(P.a.NAME)),"true"===i.getAttribute("showArea")&&(n=n.push(P.a.AREA)),"true"===i.getAttribute("showNetArea")&&(n=n.push(P.a.NET_AREA)),"true"===i.getAttribute("showLengths")&&(n=n.push(P.a.LENGTHS)),"true"===i.getAttribute("showLength")&&(n=n.push(P.a.LENGTH)),"true"===i.getAttribute("showNetLength")&&(n=n.push(P.a.NET_LENGTH)),"true"===i.getAttribute("showVolume")&&(n=n.push(P.a.VOLUME)),"true"===i.getAttribute("showNetVolume")&&(n=n.push(P.a.NET_VOLUME)),"true"===i.getAttribute("showWall")&&(n=n.push(P.a.WALLS)),"true"===i.getAttribute("showTotalWall")&&(n=n.push(P.a.TOTAL_WALL)),"true"===i.getAttribute("showTotalNetWall")&&(n=n.push(P.a.TOTAL_NET_WALL)),"true"===i.getAttribute("showVariables")&&(n=n.push(P.a.VARIABLES)),"true"===i.getAttribute("turnOffFill")&&(n=n.push(P.a.TURN_OFF_FILL)),"true"===i.getAttribute("showValuesTree")&&(n=n.push(P.a.SHOW_VALUES_TREE));break;case"Polyline":"true"===i.getAttribute("Hidden")&&(n=n.push(P.a.VISIBLE)),"true"===i.getAttribute("showNumber")&&(n=n.push(P.a.NUMBER)),"true"===i.getAttribute("showName")&&(n=n.push(P.a.NAME)),"true"===i.getAttribute("showLengths")&&(n=n.push(P.a.LENGTHS)),"true"===i.getAttribute("showNetLength")&&(n=n.push(P.a.NET_LENGTH)),"true"===i.getAttribute("showWall")&&(n=n.push(P.a.WALLS)),"true"===i.getAttribute("showNetWall")&&(n=n.push(P.a.NET_WALL)),"true"===i.getAttribute("showVariables")&&(n=n.push(P.a.VARIABLES)),"true"===i.getAttribute("turnOffFill")&&(n=n.push(P.a.TURN_OFF_FILL)),"true"===i.getAttribute("showValuesTree")&&(n=n.push(P.a.SHOW_VALUES_TREE));break;case"Free text":case"Arrow":"true"===i.getAttribute("Hidden")&&(n=n.push(P.a.VISIBLE));break;case"Ellipse":case"annotation.freeHand":case"Free Hand":case"Free hand":"true"===i.getAttribute("Hidden")&&(n=n.push(P.a.VISIBLE)),"true"===i.getAttribute("showNumber")&&(n=n.push(P.a.NUMBER)),"true"===i.getAttribute("showName")&&(n=n.push(P.a.NAME)),"true"===i.getAttribute("showArea")&&(n=n.push(P.a.AREA)),"true"===i.getAttribute("showNetArea")&&(n=n.push(P.a.NET_AREA)),"true"===i.getAttribute("showLength")&&(n=n.push(P.a.LENGTH)),"true"===i.getAttribute("showNetLength")&&(n=n.push(P.a.NET_LENGTH)),"true"===i.getAttribute("showVolume")&&(n=n.push(P.a.VOLUME)),"true"===i.getAttribute("showNetVolume")&&(n=n.push(P.a.NET_VOLUME)),"true"===i.getAttribute("showTotalWall")&&(n=n.push(P.a.TOTAL_WALL)),"true"===i.getAttribute("showTotalNetWall")&&(n=n.push(P.a.TOTAL_NET_WALL)),"true"===i.getAttribute("showVariables")&&(n=n.push(P.a.VARIABLES)),"true"===i.getAttribute("turnOffFill")&&(n=n.push(P.a.TURN_OFF_FILL)),"true"===i.getAttribute("showValuesTree")&&(n=n.push(P.a.SHOW_VALUES_TREE))}return n}}}]),e}(),C=n(57),_=n(105),M=n(170),k=n(232),D=n(43),x=n(44),F=function(){function e(t){var n=t.number,a=t.color,o=t.name,i=t.height,r=t.interiorColor,s=t.lineSize,l=void 0===s?0:s,c=t.width,u=t.geometraOpacity,d=t.geometraBorderOpacity,p=t.style,g=t.strokeColor,h=t.fontSize,m=t.decoration,f=t.maintainAspectRatio,A=t.areaTilesX,E=t.areaTilesY,T=t.areaJointX,S=t.areaJointY,b=t.areaJointDepth,I=t.wallTilesX,y=t.wallTilesY,v=t.wallJointX,N=t.wallJointY,w=t.wallJointDepth;Object(O.a)(this,e),this.number=n,this.color=a||"#F5B200",this.interiorColor=r||"#00CF83",this.name=o,this.height=i,this.showName=!1,this.showNumber=!1,this.showArea=!1,this.showNetArea=!1,this.showLength=!1,this.showLengths=!1,this.showNetLength=!1,this.showVolume=!1,this.showNetVolume=!1,this.showWall=!1,this.showTotalWall=!1,this.showTotalNetWall=!1,this.showVariables=!1,this.turnOffFill=!1,this.showReduction=!1,this.geometraOpacity=u||.6,this.geometraBorderOpacity=d||.8,this.style=p||"solid",this.width=c||1,this.lineSize=l,this.strokeColor=g||"#f1c232",this.fontSize=h||12,this.decoration=m,this.maintainAspectRatio=f||!0,this.areaTilesX=A||"",this.areaTilesY=E||"",this.areaJointX=T||"",this.areaJointY=S||"",this.areaJointDepth=b||"",this.wallTilesX=I||"",this.wallTilesY=y||"",this.wallJointX=v||"",this.wallJointY=N||"",this.wallJointDepth=w||""}return Object(w.a)(e,[{key:"getNumber",value:function(){if(this.number){var e=new _.a;this.number=e.getNextNumberString(this.number)}return this.number}},{key:"getTiles",value:function(){return{areaTilesX:this.areaTilesX,areaTilesY:this.areaTilesY,areaJointX:this.areaJointX,areaJointY:this.areaJointY,areaJointDepth:this.areaJointDepth,wallTilesX:this.wallTilesX,wallTilesY:this.wallTilesY,wallJointX:this.wallJointX,wallJointY:this.wallJointY,wallJointDepth:this.wallJointDepth}}},{key:"getColor",value:function(){return this.color}},{key:"getMaintainAspectRatio",value:function(){return this.maintainAspectRatio}},{key:"getInteriorColor",value:function(){return this.interiorColor}},{key:"getName",value:function(){return this.name}},{key:"getHeight",value:function(){return this.height}},{key:"getGeometraOpacity",value:function(){return this.geometraOpacity}},{key:"getGeometraBorderOpacity",value:function(){return this.geometraBorderOpacity}},{key:"getLineSize",value:function(){return this.lineSize}},{key:"getWidth",value:function(){return this.width}},{key:"getStyle",value:function(){return this.style}},{key:"getStrokeColor",value:function(){return this.strokeColor}},{key:"getFontSize",value:function(){return this.fontSize}},{key:"getDecoration",value:function(){return this.decoration}},{key:"setLineSize",value:function(e){return this.lineSize=e}},{key:"setNumber",value:function(e){this.number=e}},{key:"setColor",value:function(e){this.color=e}},{key:"setInteriorColor",value:function(e){this.interiorColor=e}},{key:"setName",value:function(e){this.name=e}},{key:"setHeight",value:function(e){this.height=e}},{key:"setGeometraOpacity",value:function(e){this.geometraOpacity=e}},{key:"setGeometraBorderOpacity",value:function(e){this.geometraBorderOpacity=e}},{key:"setShowValueState",value:function(e,t){switch(t){case"Point":this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName");break;case"Polygon":this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showArea="true"===e.getAttribute("showArea"),this.showNetArea="true"===e.getAttribute("showNetArea"),this.showLength="true"===e.getAttribute("showLength"),this.showLengths="true"===e.getAttribute("showLengths"),this.showNetLength="true"===e.getAttribute("showNetLength"),this.showVolume="true"===e.getAttribute("showVolume"),this.showNetVolume="true"===e.getAttribute("showNetVolume"),this.showWall="true"===e.getAttribute("showWall"),this.showTotalWall="true"===e.getAttribute("showTotalWall"),this.showTotalNetWall="true"===e.getAttribute("showTotalNetWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.turnOffFill="true"===e.getAttribute("turnOffFill"),this.showReduction="true"===e.getAttribute("showReduction");break;case"Reduction":this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showArea="true"===e.getAttribute("showArea"),this.showNetArea="true"===e.getAttribute("showNetArea"),this.showLength="true"===e.getAttribute("showLength"),this.showLengths="true"===e.getAttribute("showLengths"),this.showNetLength="true"===e.getAttribute("showNetLength"),this.showVolume="true"===e.getAttribute("showVolume"),this.showNetVolume="true"===e.getAttribute("showNetVolume"),this.showWall="true"===e.getAttribute("showWall"),this.showTotalWall="true"===e.getAttribute("showTotalWall"),this.showTotalNetWall="true"===e.getAttribute("showTotalNetWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.turnOffFill="true"===e.getAttribute("turnOffFill");break;case"Polyline":this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showLengths="true"===e.getAttribute("showLengths"),this.showWall="true"===e.getAttribute("showWall"),this.showVariables="true"===e.getAttribute("showVariables");break;case"Ellipse":case"annotation.freeHand":case"Free hand":case"Free Hand":this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showArea="true"===e.getAttribute("showArea"),this.showNetArea="true"===e.getAttribute("showNetArea"),this.showLength="true"===e.getAttribute("showLength"),this.showNetLength="true"===e.getAttribute("showNetLength"),this.showVolume="true"===e.getAttribute("showVolume"),this.showNetVolume="true"===e.getAttribute("showNetVolume"),this.showTotalWall="true"===e.getAttribute("showTotalWall"),this.showTotalNetWall="true"===e.getAttribute("showTotalNetWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.turnOffFill="true"===e.getAttribute("turnOffFill")}}},{key:"getShowValueState",value:function(e,t){switch(t){case"Point":e.setAttribute("showNumber",this.showNumber),e.setAttribute("showName",this.showName);break;case"Polygon":e.setAttribute("showNumber",this.showNumber),e.setAttribute("showName",this.showName),e.setAttribute("showArea",this.showArea),e.setAttribute("showNetArea",this.showNetArea),e.setAttribute("showLength",this.showLength),e.setAttribute("showLengths",this.showLengths),e.setAttribute("showNetLength",this.showNetLength),e.setAttribute("showVolume",this.showVolume),e.setAttribute("showWall",this.showWall),e.setAttribute("showTotalWall",this.showTotalWall),e.setAttribute("showTotalNetWall",this.showTotalNetWall),e.setAttribute("showVariables",this.showVariables),e.setAttribute("turnOffFill",this.turnOffFill),e.setAttribute("showReduction",this.showReduction);break;case"Reduction":e.setAttribute("showNumber",this.showNumber),e.setAttribute("showName",this.showName),e.setAttribute("showArea",this.showArea),e.setAttribute("showNetArea",this.showNetArea),e.setAttribute("showLength",this.showLength),e.setAttribute("showLengths",this.showLengths),e.setAttribute("showNetLength",this.showNetLength),e.setAttribute("showVolume",this.showVolume),e.setAttribute("showWall",this.showWall),e.setAttribute("showTotalWall",this.showTotalWall),e.setAttribute("showTotalNetWall",this.showTotalNetWall),e.setAttribute("showVariables",this.showVariables),e.setAttribute("turnOffFill",this.turnOffFill);break;case"Polyline":e.setAttribute("showNumber",this.showNumber),e.setAttribute("showName",this.showName),e.setAttribute("showLengths",this.showLengths),e.setAttribute("showWall",this.showWall),e.setAttribute("showVariables",this.showVariables);break;case"Ellipse":case"annotation.freeHand":case"Free hand":case"Free Hand":e.setAttribute("showNumber",this.showNumber),e.setAttribute("showName",this.showName),e.setAttribute("showArea",this.showArea),e.setAttribute("showNetArea",this.showNetArea),e.setAttribute("showLength",this.showLength),e.setAttribute("showNetLength",this.showNetLength),e.setAttribute("showVolume",this.showVolume),e.setAttribute("showNetVolume",this.showNetVolume),e.setAttribute("showTotalWall",this.showTotalWall),e.setAttribute("showTotalNetWall",this.showTotalNetWall),e.setAttribute("showVariables",this.showVariables),e.setAttribute("turnOffFill",this.turnOffFill)}}}]),e}(),j=function(e){Object(D.a)(n,e);var t=Object(x.a)(n);function n(e){var a,o=e.number,i=e.color,r=e.name,s=e.height,l=e.lineSize,c=e.geometraOpacity,u=e.geometraLineStart,d=e.geometraLineEnd,p=e.style,g=e.width,h=e.wallTilesX,m=e.wallTilesY,f=e.wallJointX,A=e.wallJointY,E=e.wallJointDepth;return Object(O.a)(this,n),(a=t.call(this,{number:o,color:i,name:r,height:s,lineSize:l,style:p,width:g,wallTilesX:h,wallTilesY:m,wallJointX:f,wallJointY:A,wallJointDepth:E})).color=i||"#0AB1E1",a.geometraLineStart=u||"-",a.geometraLineEnd=d||"-",a.geometraOpacity=c||.6,a}return Object(w.a)(n,[{key:"getGeometraOpacity",value:function(){return this.geometraOpacity}},{key:"getGeometraLineStart",value:function(){return this.geometraLineStart}},{key:"setGeometraLineStart",value:function(e){this.geometraLineStart=e}},{key:"getGeometraLineEnd",value:function(){return this.geometraLineEnd}},{key:"setGeometraLineEnd",value:function(e){this.geometraLineEnd=e}}]),n}(F),V=function(e){Object(D.a)(n,e);var t=Object(x.a)(n);function n(e){var a,o=e.number,i=e.interiorColor,r=e.name,s=e.height,l=e.pointSize,c=e.iconType,u=e.geometraOpacity;return Object(O.a)(this,n),(a=t.call(this,{number:o,name:r,height:s,geometraOpacity:u})).pointSize=l,a.iconType=c,a.rotation=0,a.interiorColor=i,a}return Object(w.a)(n,[{key:"getPointSize",value:function(){return this.pointSize||10}},{key:"getInteriorColor",value:function(){return this.interiorColor}},{key:"setPointSize",value:function(e){this.pointSize=e}},{key:"getGeometraBorderOpacity",value:function(){return this.geometraOpacity}},{key:"getIconType",value:function(){return this.iconType||"none"}},{key:"setIconType",value:function(e){this.iconType=e}},{key:"getRotation",value:function(){return this.rotation}},{key:"setRotation",value:function(e){this.rotation=e}}]),n}(F),U=n(45),W=n(61),B=n(5),H=n(318),J=function(e){Object(D.a)(n,e);var t=Object(x.a)(n);function n(){return Object(O.a)(this,n),t.apply(this,arguments)}return Object(w.a)(n,[{key:"init",value:function(){var e=this;try{var t=this.webviewer.Annotations;this.calculator.setWindow(this.webviewer),this.initAnnotation.init(this.webviewer),this.initPointAnnotation.init(this.webviewer,this.calculator),this.initPolygonAnnotation.init(this,this.webviewer,this.calculator),this.initEllipseAnnotation.init(this.webviewer,this.calculator),this.initFreeHandAnnotation.init(this,this.webviewer,this.calculator),this.initPolylineAnnotation.init(this,this.webviewer,this.calculator),this.initFreeTextAnnotation.init(this.webviewer),this.initStampAnnotation.init(this.webviewer),this.arrowAnnotationCustomizer.init(this.webviewer),this.initAnnotationEdit.init(this.webviewer,this.calculator),this.initEllipseTool.init(this,this.webviewer,this.calculator),this.initFreeHandTool.init(this,this.webviewer),this.initPointTool.init(this,this.webviewer),this.initPolygonTool.init(this,this.webviewer,this.calculator),this.initPolylineTool.init(this,this.webviewer,this.calculator),this.initTool.init(this.webviewer,this.calculator),this.printHelper.init(this.webviewer,this.calculator),this.freeTextToolCustomizer.init(this,this.webviewer),this.initArrowTool.init(this.webviewer);var n=this.webviewer.annotManager,a=new(this.initPolylineTool.getScaleCreateTool())(this.webviewer.docViewer);this.webviewer.registerTool({toolName:"AnnotationCreateScale",toolObject:a}),n.registerAnnotationType(t.PolylineAnnotation.prototype.elementName,t.PolylineAnnotation);var o=new(this.initPointTool.getPointCreateTool())(this.webviewer.docViewer);this.webviewer.registerTool({toolName:"AnnotationCreatePoint",toolObject:o});var i=this.initPointAnnotation.getPointAnnotation();n.registerAnnotationType("point",i);var r=new(this.initPolygonTool.getReductionCreateTool())(this.webviewer.docViewer);this.webviewer.registerTool({toolName:"AnnotationCreateReduction",toolObject:r}),n.on("annotationChanged",(function(t,n){for(var a=0;a<t.length;a++)switch(n){case"add":case"modify":"x-scale"!==t[a].Subject&&"y-scale"!==t[a].Subject||e.calculator.setScale(t[a].getPageNumber(),t[a]);break;case"delete":"x-scale"!==t[a].Subject&&"y-scale"!==t[a].Subject||e.calculator.deleteScale(t[a].getPageNumber(),t[a])}}));var s=this.webviewer.docViewer.getToolModeMap();for(var l in s)if(s.hasOwnProperty(l)&&s[l].defaults)switch(s[l].setAllowCreationOverAnnotation&&s[l].setAllowCreationOverAnnotation(!0),l){case"AnnotationCreateScale":s[l].defaults.FillColor=new t.Color(204,0,0,.85),s[l].defaults.StrokeColor=new t.Color(204,0,0,.85);break;case"AnnotationCreateReduction":s[l].defaults.FillColor=new t.Color(128,128,128,.8),s[l].defaults.StrokeColor=new t.Color(128,128,128,.8);break;case"AnnotationCreateFreeText":s[l].initialText="";break;default:s[l].defaults.FillColor=new t.Color(35,145,35,.8),s[l].defaults.StrokeColor=new t.Color(35,145,35,.8)}}catch(c){console.log("error in WebViewerInit: "+c.stack)}}}]),n}(n(350).a),z=function(){var e=Object(c.a)(l.a.mark((function e(t,n){var a;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=0;case 1:if(!(a<t.length)){e.next=7;break}return e.next=4,n(t[a],a,t);case 4:a++,e.next=1;break;case 7:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),G=n(48),q=n(15),X=n(55),Y=n(496),K=n.n(Y),Z=n(497),Q=n.n(Z),$=n(498),ee=n.n($),te=n(37),ne=n(35),ae=n(125);n(87),t.a=Object(G.createStore)({init:function(){this.bucketURL="https://geometra3.s3.eu-west-1.amazonaws.com/",this.listenables=b.a,this.Annotations=new R.a.List,this.reductions=new R.a.List,this.displayValueAnnotations=new R.a.List,this.WebViewer=void 0,this.element=void 0,this.ActiveParentId=void 0,this.lastActiveParentId=void 0,this.ActiveEstimate=void 0,this.ActiveLayerId=void 0,this.ActivePageId=void 0,this.ActiveFileId=void 0,this.activeProjectId=void 0,this.ActiveScale=1,this.DefaultHeight=2.5,this.DefaultStrokeSize=1,this.DefaultPointSize=1,this.SelectedAnnotations=new R.a.List,this.xScaleList=new R.a.List,this.yScaleList=new R.a.List,this.ActiveReductionParentId=void 0,this.currentToolMode=void 0,this.previousToolMode=null,this.isHotkeyLongPress=!1,this.copiedAnnotationContainers=[],this.fitModeButtonPressed=!1,this.jumpAnnotId=void 0,this.annotationsToDeleteByPdfTron=new R.a.List,this.annotationManagerSelectionLock=!1,this.copiedScaleContainers=[],this.ellipseValueInheritance=void 0,this.polygonValueInheritance=void 0,this.reductionValueInheritance=void 0,this.polylineValueInheritance=void 0,this.pointValueInheritance=void 0,this.freehandValueInheritance=void 0,this.freeTextValueInheritance=void 0,this.stampValueInheritance=void 0,this.arrowValueInheritance=void 0,this.typeInheritanceMap=void 0,this.activeAnnotation=void 0,this.activeAnnotationsWithVisuals=new R.a.List,this.allAnnotationsSelected=!1,this.type=void 0,this.nbrAnnots=0,this.calculatedSum=new R.a.Map,this.displayAnnot=void 0,this.progressBarMinValue=0,this.progressBarMaxValue=0,this.progressBarCurrentValue=0,this.annotationTypeMap=new R.a.Map,this.receivedAnnotationList=void 0,this.call=0,this.sequenceNumberMap=new R.a.Map,this.modifyAnnotationLock=!1,this.printLock=!1,this.snapMode=void 0,this.snaponEnabled=void 0,this.pageCount=void 0,this.userLoadingAnnotations=!1,this.documentLoaded=!1,this.treeFilter="PageAndFile",this.annotationActionDone=!1,this.useYScaleOnly=!1,this.isAltKeyEnabledForScale=!1,this.isActiveIfc=!1,this.duplicateAnnotsModalInfo={duplicatingAnnots:!1,annotsToDuplicate:0,annotsDuplicated:0,annotsDuplicatedList:[],annotsRowsDuplicatedList:[],userId:null},this.selectedFolderAnnotations=[],this.selectedParentFolders=[],this.addedAnnotInfo=null,this.isCtrlPressed=!1,this.isAltPressed=!1,this.isReductionCreated=!1,this.pageRotation=0,this.fetchingDataLoader=!1,this.createYScale=!1},getFetchingDataLoader:function(){return this.fetchingDataLoader},setFetchingDataLoader:function(e){this.fetchingDataLoader=e,this.trigger("fetchingDataLoaderChanged")},getCreateYScale:function(){return this.createYScale},setCreateYScale:function(e){this.createYScale=e},setIsReductionCreated:function(e){this.isReductionCreated=e},getIsReductionCreated:function(){return this.isReductionCreated},setAddedAnnotInfo:function(e){this.addedAnnotInfo=e},getAddedAnnotInfo:function(){return this.addedAnnotInfo},setIsCtrlPressed:function(e){this.isCtrlPressed=e},setIsAltPressed:function(e){this.isAltPressed=e},setSelectedParentFolders:function(e){this.selectedParentFolders.push(e)},setArrayOfParentFolders:function(e){this.selectedParentFolders=e},clearSelectedParentFolders:function(){this.selectedParentFolders=[]},getSelectedParentFolders:function(){return this.selectedParentFolders},setSelectFolderAnnotations:function(e){this.selectedFolderAnnotations=e},getSelectedChildren:function(){return this.selectedFolderAnnotations},clearSelectedChildren:function(){this.selectedFolderAnnotations=[]},setIfcIsActive:function(e){this.isActiveIfc=e},isActiveIfcFile:function(){return this.isActiveIfc},setUseYScaleOnly:function(e){this.useYScaleOnly=e},setIsAltKeyEnabledForScale:function(e){this.isAltKeyEnabledForScale=e},setAnnotationActionDone:function(e){this.annotationActionDone=e},updateSelectedTool:function(){this.trigger("toolChange")},toggleDeleteModal:function(){this.trigger("toggleDeleteModal")},onFocusNameInput:function(){this.trigger("focusNameInput")},onFocusNrTagInput:function(){this.trigger("focusNrTagInput")},onShowFillColour:function(){this.trigger("showFillColour")},onShowBorderColour:function(){this.trigger("showBorderColour")},onShowTiles:function(){this.trigger("showTiles")},onShowAngles:function(){this.trigger("showAngles")},onshowReplaceRowsConfirmation:function(){this.trigger("showReplaceRowsConfirmation")},onShowFileExportModal:function(){this.trigger("showFileExportModal")},onToggleDocument:function(){this.trigger("toggleDocument")},onToggleRows:function(){this.trigger("toggleRows")},onToggleProperties:function(){this.trigger("toggleProperties")},isAnnotationActionDone:function(){return this.annotationActionDone},getCurrentToolNode:function(){return this.currentToolMode},setSnapMode:function(e){this.snapMode=e,this.trigger("snapModeUpdated")},setSnaponEnabled:function(e){this.snaponEnabled=e},getSnaponEnabled:function(){return this.snaponEnabled},toggleSnapon1:function(){var e="true"===this.snaponEnabled;this.snaponEnabled=e?"false":"true",this.trigger("toggleSnapon")},isSnaponEnabled:function(){return"true"===this.snaponEnabled},getSnapMode:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!e)return this.snapMode;if(this.WebViewer)switch(this.snapMode){case"end-of-line":return this.WebViewer.docViewer.SnapMode.PATH_ENDPOINT;case"points":return this.WebViewer.docViewer.SnapMode.POINT_ON_LINE;case"end-mid-line":return this.WebViewer.docViewer.SnapMode.LINE_MID_POINT}},getElement:function(){return this.element},getDuplicateAnnotsModalInfo:function(){return this.duplicateAnnotsModalInfo},setAnnotations:function(e){this.Annotations=e},setDisplayValueAnnotations:function(e){this.displayValueAnnotations=e},setReductions:function(e){this.reductions=e},setDisplayMode:function(e){if(this.WebViewer&&this.WebViewer.docViewer&&this.WebViewer.docViewer.getDocument()){var t,n=this.WebViewer.docViewer.getDisplayModeManager();switch(this.displayMode=e,e){case"single":t=new this.WebViewer.CoreControls.DisplayMode(this.WebViewer.docViewer,this.WebViewer.CoreControls.DisplayModes.Single,!0);break;case"single-noscroll":break;case"multi":t=new this.WebViewer.CoreControls.DisplayMode(this.WebViewer.docViewer,this.WebViewer.CoreControls.DisplayModes.Continuous,!0);break;default:console.log("setDisplayMode did not handle mode "+e)}t&&n.setDisplayMode(t),this.trigger("displayModeUpdated")}},setLayoutMode:function(e){this.WebViewer&&this.WebViewer.docViewer&&this.WebViewer.docViewer.getDocument()&&(localStorage.setItem("webviewerLayoutMode",e),this.WebViewer.setLayoutMode(e),this.trigger("layoutModeUpdated"))},getDisplayMode:function(){return this.displayMode},getLayoutMode:function(){return localStorage.getItem("webviewerLayoutMode")},getSnapModeList:function(){var e=new R.a.List;if(this.WebViewer){var t=this.WebViewer.docViewer.SnapMode;e=(e=(e=(e=(e=e.push({value:t.DEFAULT,key:t.DEFAULT,label:"DEFAULT"})).push({value:t.POINT_ON_LINE,key:t.POINT_ON_LINE,label:"POINT_ON_LINE"})).push({value:t.LINE_MID_POINT,key:t.LINE_MID_POINT,label:"LINE_MID_POINT"})).push({value:t.LINE_INTERSECTION,key:t.LINE_INTERSECTION,label:"LINE_INTERSECTION"})).push({value:t.PATH_ENDPOINT,key:t.PATH_ENDPOINT,label:"PATH_ENDPOINT"})}return e},getLayoutModeList:function(){var e=new R.a.List;if(this.WebViewer){var t=this.WebViewer.LayoutMode;e=(e=e.push({value:t.Single,key:t.Single,label:"Single mode"})).push({value:t.Continuous,key:t.Continuous,label:"Continuous mode"})}return e},lockAnnotationManagerModify:function(){this.modifyAnnotationLock=!0},unlockAnnotationManagerModify:function(){this.modifyAnnotationLock=!1},updatePdfTronSelectionState:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!e||!t.WebViewer){n.next=4;break}return a=t.WebViewer.annotManager,n.next=4,a.drawAnnotationsFromList(a.getAnnotationsList());case 4:case"end":return n.stop()}}),n)})))()},updateSequenceInformtion:function(e,t,n){try{if(this.sequenceNumberMap.has(e)){var a=this.sequenceNumberMap.get(e);a=a.set("sequenceNumber",e).set("nrReceivedMessages",a.get("nrReceivedMessages")+t),n&&(a=a.set("numberSequenceMessages",n)),this.sequenceNumberMap=this.sequenceNumberMap.set(e,a)}else{var o=(new R.a.Map).set("sequenceNumber",e).set("nrReceivedMessages",t);n&&(o=o.set("numberSequenceMessages",n)),this.sequenceNumberMap=this.sequenceNumberMap.set(e,o)}}catch(i){console.log("Annotation Store Error: updateSequenceInformation: "+i)}},getPointValueInheritance:function(){return this.pointValueInheritance},getSequenceInformation:function(e){return this.sequenceNumberMap.get(e)},resetSequenceInformation:function(e){this.sequenceNumberMap.has(e)&&(this.sequenceNumberMap=this.sequenceNumberMap.delete(e))},resetAnnotationTypeMap:function(){this.annotationTypeMap=this.annotationTypeMap.clear(),this.annotationTypeMap=this.annotationTypeMap.set("group",0),this.annotationTypeMap=this.annotationTypeMap.set("Point",0),this.annotationTypeMap=this.annotationTypeMap.set("Polyline",0),this.annotationTypeMap=this.annotationTypeMap.set("Polygon",0),this.annotationTypeMap=this.annotationTypeMap.set("Reduction",0),this.annotationTypeMap=this.annotationTypeMap.set("Ellipse",0),this.annotationTypeMap=this.annotationTypeMap.set("Free hand",0),this.annotationTypeMap=this.annotationTypeMap.set("Free text",0),this.annotationTypeMap=this.annotationTypeMap.set("x-scale",0),this.annotationTypeMap=this.annotationTypeMap.set("y-scale",0),this.annotationTypeMap=this.annotationTypeMap.set("nrSelected",0),this.annotationTypeMap=this.annotationTypeMap.set("Stamp",0),this.annotationTypeMap=this.annotationTypeMap.set("CenterValue",0),this.annotationTypeMap=this.annotationTypeMap.set("PeripheralValue",0),this.annotationTypeMap=this.annotationTypeMap.set("Arrow",0),this.annotationTypeMap=this.annotationTypeMap.set("3DModel",0)},setScaleTypeMap:function(e){this.resetAnnotationTypeMap(),this.annotationTypeMap=this.annotationTypeMap.set("nrSelected",1),e===X.e&&(this.annotationTypeMap=this.annotationTypeMap.set("x-scale",1)),e===X.f&&(this.annotationTypeMap=this.annotationTypeMap.set("y-scale",1))},isReductionToolDisabled:function(){if(this.annotationTypeMap){var e=1===this.annotationTypeMap.get("nrSelected")&&1===this.annotationTypeMap.get("Polygon");return"AnnotationCreateReduction"!==this.currentToolMode&&!e}return!0},getNrSelectedAnnotations:function(){return this.annotationTypeMap.get("nrSelected")},calculateValues:function(){for(var e=this.calulateSumAndDerivedType(),t=e.next();!t.done;)t=e.next();var n=this.calculateDisplayAnnot();for(t=n.next();!t.done;)t=n.next();v.a.calculateValues()},getTypeConversion:function(e){return"annotation.freeHand"===e||"Free Hand"===e||"Free hand"===e?e="Free hand":"Free Text"!==e&&"Free text"!==e||(e="Free text"),e},increaseAnnotationTypeMapSelection:function(e){e&&(e=this.getTypeConversion(e),this.annotationTypeMap=this.annotationTypeMap.set(e,1+(this.annotationTypeMap.get(e)<<0)),"group"!==e&&(this.annotationTypeMap=this.annotationTypeMap.set("nrSelected",1+(this.annotationTypeMap.get("nrSelected")<<0))))},decreaseAnnotationTypeMapSelection:function(e){e&&(e=this.getTypeConversion(e),this.annotationTypeMap=this.annotationTypeMap.set(e,(this.annotationTypeMap.get(e)<<0)-1),"group"!==e&&(this.annotationTypeMap=this.annotationTypeMap.set("nrSelected",(this.annotationTypeMap.get("nrSelected")<<0)-1)))},getNrSelectedFolders:function(){return this.annotationTypeMap.get("group")},enableAnnotationSelectionLock:function(){this.annotationManagerSelectionLock=!0},disableAnnotationSelectionLock:function(){this.annotationManagerSelectionLock=!1},getDisplayFomula:function(e){if(this.displayAnnot&&e)switch(e){case"NA":return this.displayAnnot.get("formulaNA");case"NL":return this.displayAnnot.get("formulaNL");case"NVO":return this.displayAnnot.get("formulaNVO");case"NV":return this.displayAnnot.get("formulaNV");default:console.log("Unrecoginzed formulavariable: "+e)}},getNrSelectedReductions:function(){return this.annotationTypeMap.get("Reduction")},getCurrentSelectionType:function(){var e=this;if(this.annotationTypeMap.get("group")>0)return"group";var t=void 0;return this.annotationTypeMap.keySeq().forEach((function(n){var a=n;if("nrSelected"!==a&&e.annotationTypeMap.get(a)>0){if("x-scale"!==a&&"y-scale"!==a||(a="scale"),t&&a!==t)return t="group",!1;t=a}})),t},setProgressBarMinValue:function(e){this.progressBarMinValue=e},setProgressBarMaxValue:function(e){this.progressBarMaxValue=e},setProgressBarCurrentValue:function(e){this.progressBarCurrentValue=e},getTheDisplayAnnot:function(){return this.displayAnnot},getProgressBarMinValue:function(){return this.progressBarMinValue},getProgressBarMaxValue:function(){return this.progressBarMaxValue},getProgressBarCurrentValue:function(){return this.progressBarCurrentValue},getType:function(){return this.type},getCalculatedSum:function(){return this.calculatedSum},triggerMultiSelectfromStoreProgressBarAll:function(){this.allAnnotationsSelected=!this.allAnnotationsSelected,this.progressBarMaxValue=this.Annotations.size+v.a.getAllRows().size,this.trigger("showMultiSelectFromStoreProgressBar",void 0)},triggerMultiSelectfromStoreProgressBar:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.allAnnotationsSelected=!1,this.progressBarMaxValue=e.size,this.trigger("showMultiSelectFromStoreProgressBar",e)},triggerMultiSelectFromGuiProgressBar:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.trigger("showMultiSelectFromGuiProgressBar",e)},triggerAllSelected:function(){this.trigger("allAnnotationSelected"),this.trigger("allSelectedStateUpdated")},triggerAnnotationSelected:function(){this.trigger("annotationSelectedFromGui"),this.trigger("allSelectedStateUpdated")},triggerShowSetTilesDialog:function(){this.trigger("showSetTilesDialog")},triggerShowSetAngleDialog:function(){this.trigger("showSetAngleDialog")},updateAnnotationNumberByProjectId:function(e,t){var n=JSON.parse(localStorage.getItem("annotationNumberByProject"));n[this.activeProjectId][e]=t,localStorage.setItem("annotationNumberByProject",JSON.stringify(n))},initLocalStortageValueInheritance:function(e){localStorage.getItem("annotationNumberByProject")||localStorage.setItem("annotationNumberByProject",JSON.stringify({}));var t=JSON.parse(localStorage.getItem("annotationNumberByProject"));t[e]||(t[e]={Ellipse:"000","Free hand":"000",Reduction:"000",Polygon:"000",Polyline:"000",Point:"000","Free text":"000",Stamp:"000",Arrow:"000","3DModel":"000"},localStorage.setItem("annotationNumberByProject",JSON.stringify(t)))},initValueInheritance:function(e){this.activeProjectId=e,this.initLocalStortageValueInheritance(e);var t=JSON.parse(localStorage.getItem("annotationNumberByProject"))[e],n=JSON.parse(sessionStorage.getItem("inheritance"));this.ellipseValueInheritance=new F((null===n||void 0===n?void 0:n.Ellipse)?n.Ellipse:{number:t.Ellipse,name:q.a.t("Ellipse"),height:2.5,interiorColor:"#F5B200",color:"#0AB1E1",style:"solid",width:1}),this.polygonValueInheritance=new F((null===n||void 0===n?void 0:n.Polygon)?n.Polygon:{number:t.Polygon,name:q.a.t("Area"),height:2.5,interiorColor:"#00CF83",color:"#F5B200",style:"solid"}),this.reductionValueInheritance=new F((null===n||void 0===n?void 0:n.Reduction)?n.Reduction:{number:t.Reduction,name:q.a.t("Reduction"),height:2.5,interiorColor:"#A7ACB1",color:"#4E5256",style:"dotted",geometraOpacity:.5,geometraBorderOpacity:.6,width:.5}),this.freehandValueInheritance=new F((null===n||void 0===n?void 0:n["Free hand"])?n["Free hand"]:{number:t["Free hand"],name:q.a.t("Draw"),height:2.5,interiorColor:"#9775FA",color:"#FF6921",style:"dotted",width:.5}),this.freeTextValueInheritance=new F((null===n||void 0===n?void 0:n["Free text"])?n["Free text"]:{number:t["Free text"],name:q.a.t("Comment"),strokeColor:"#2C3135",interiorColor:"#FF0000",fontSize:"0",style:"dashed",geometraOpacity:1,geometraBorderOpacity:0,width:.5}),this.polylineValueInheritance=new j((null===n||void 0===n?void 0:n.Polyline)?n.Polyline:{number:t.Polyline,name:q.a.t("Line"),height:2.5,color:"#0AB1E1",width:2,style:"solid"}),this.arrowValueInheritance=new j((null===n||void 0===n?void 0:n.Arrow)?n.Arrow:{number:t.Arrow,name:q.a.t("Arrow"),height:2.5,color:"#E61C27",geometraOpacity:.8}),this.pointValueInheritance=new V((null===n||void 0===n?void 0:n.Point)?n.Point:{number:t.Point,name:q.a.t("Point"),height:2.5,interiorColor:"#FF6921",pointSize:12,geometraOpacity:.8}),this.stampValueInheritance=new F((null===n||void 0===n?void 0:n.Stamp)?n.Stamp:{number:t.Stamp,name:q.a.t("Image"),height:2.5,color:"#4E5256",style:"solid",geometraBorderOpacity:"0.0"}),this.typeInheritanceMap=new R.a.Map,this.typeInheritanceMap=this.typeInheritanceMap.set("Ellipse",this.ellipseValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free hand",this.freehandValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free Hand",this.freehandValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Reduction",this.reductionValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Polygon",this.polygonValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Polyline",this.polylineValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Point",this.pointValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free text",this.freeTextValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free Text",this.freeTextValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Stamp",this.stampValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Arrow",this.arrowValueInheritance)},changeAnnotationInheritance:function(e){var t=e.type,n=e.styles,a=e.properties,o=e.tiles,i=JSON.parse(localStorage.getItem("annotationNumberByProject"))[this.activeProjectId];switch(this.typeInheritanceMap=new R.a.Map,t){case"Ellipse":this.ellipseValueInheritance=new F(Object(r.a)(Object(r.a)(Object(r.a)({number:i.Ellipse},a),n),o));break;case"Polygon":this.polygonValueInheritance=new F(Object(r.a)(Object(r.a)(Object(r.a)({number:i.Polygon},a),n),o));break;case"Reduction":this.reductionValueInheritance=new F(Object(r.a)(Object(r.a)(Object(r.a)({number:i.Reduction},a),n),o));break;case"Freehand":case"Free hand":this.freehandValueInheritance=new F(Object(r.a)(Object(r.a)(Object(r.a)({number:i["Free hand"]},a),n),o));break;case"Free text":n.interiorColor=n.TextColor,this.freeTextValueInheritance=new F(Object(r.a)(Object(r.a)({number:i["Free text"]},a),n));break;case"Polyline":this.polylineValueInheritance=new j(Object(r.a)(Object(r.a)(Object(r.a)({number:i.Polyline},a),n),o));break;case"Arrow":n.geometraOpacity=n.geometraBorderOpacity,this.arrowValueInheritance=new j(Object(r.a)(Object(r.a)({number:i.Arrow},a),n));break;case"Point":this.pointValueInheritance=new V(Object(r.a)(Object(r.a)({number:i.Point},a),n));break;case"Stamp":this.stampValueInheritance=new F(Object(r.a)(Object(r.a)({number:i.Stamp},a),n))}this.typeInheritanceMap=new R.a.Map,this.typeInheritanceMap=this.typeInheritanceMap.set("Ellipse",this.ellipseValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free hand",this.freehandValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free Hand",this.freehandValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Reduction",this.reductionValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Polygon",this.polygonValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Polyline",this.polylineValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Point",this.pointValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free text",this.freeTextValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Free Text",this.freeTextValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Stamp",this.stampValueInheritance),this.typeInheritanceMap=this.typeInheritanceMap.set("Arrow",this.arrowValueInheritance),sessionStorage.setItem("inheritance",JSON.stringify(Object.assign({},JSON.parse(sessionStorage.getItem("inheritance")),this.typeInheritanceMap.toJS())))},isValueInheritanceInitiated:function(){return void 0!==this.ellipseValueInheritance},calculateValuesForAnnotation:function(e){var t,n=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.getScaleForAnnotation(e);if(o&&o.get("x-scale"))t=new _.a(e.get("height"),e.get("quantity"),o.get("x-scale"),e.get("geoFile"),o.get("y-scale"));else if("3DModel"!==e.get("type"))return e;switch(e.get("type")){case"3DModel":var i=this.getIFCAnnotData(e);return e=e.set("annotationData",R.a.fromJS(i));case"Circle":case"Ellipse":var r=t.getRectFromXfdf(e.get("xfdf"));return e=e.set("annotationData",R.a.fromJS(t.calculateEllipseValues(r))),e=t.calculateFormulae(e),t.calculateTilesForAnnotation(e,0);case"annotation.freeHand":case"Free Hand":case"Free hand":var s=t.getVerticesFromXfdf(e.get("xfdf"));return e=e.set("annotationData",R.a.fromJS(t.calculatePolygonValues(s))).deleteIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.LENGTHS"]).deleteIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.WALLS"]).deleteIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.POINTS"]),e=t.calculateFormulae(e),t.calculateTilesForAnnotation(e,0);case"Rectangle":case"Reduction":var l=t.getVerticesFromXfdf(e.get("xfdf")),c=(e=e.set("annotationData",R.a.fromJS(t.calculatePolygonValues(l)))).get("annotationData");return e.set("annotationData",c),e=t.calculateFormulae(e),t.calculateTilesForAnnotation(e);case"Polygon":var u=t.getVerticesFromXfdf(e.get("xfdf")),d=(e=e.set("annotationData",R.a.fromJS(t.calculatePolygonValues(u)))).get("annotationData");e=e.set("annotationData",d);var p=new R.a.List,g=0,h=0,m=0,f=0,A=0,E=0;return this.getReductionByParentAnnotationId(e.get("annotationId")).sort((function(e,t){return e.get("id")<t.get("id")?-1:e.get("id")>t.get("id")?1:0})).forEach((function(e){var t=new _.a(e.get("height"),e.get("quantity"),o.get("x-scale"),e.get("geoFile"),o.get("y-scale")),i=t.getVerticesFromXfdf(e.get("xfdf"));e=e.set("annotationData",R.a.fromJS(t.calculatePolygonValues(i)));var r=(e=t.calculateFormulae(e)).getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.POINTS"]),s=e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.AREA"]),l=e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.LENGTH"]),c=e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.WALL"]);g+=s,h+=s*e.get("height"),m+=l,A+=r,p=p.push(s),f+=c,!a&&e.has("ESTIMATE.ANNOTATION_VALUES.TILES_X")&&n.isSelected(e.get("annotationId"),e.get("id"))&&(e=t.calculateTilesForAnnotation(e),E+=e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.TILES"]))})),p.size>0&&(e=(e=(e=(e=(e=(e=(e=(e=(e=e.set("annotationData",e.get("annotationData").set("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS",p))).set("annotationData",e.get("annotationData").set("ESTIMATE.ANNOTATION_VALUES.RED_AREA",g))).set("annotationData",e.get("annotationData").set("ESTIMATE.ANNOTATION_VALUES.RED_LENGTH",m))).setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.NET_AREA"],e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.NET_AREA"])-g)).setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.NET_VOLUME"],e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.NET_VOLUME"])-h)).setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.RED_VOLUME"],h)).setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.NET_LENGTH"],e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.LENGTH"])-m)).setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.NET_WALL"],e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.WALL"])-f)).setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.RED_WALL"],f),a||(e=e.setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.POINTS"],e.getIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.POINTS"])+A))),e=t.calculateFormulae(e),t.calculateTilesForAnnotation(e,m,E);case"Polyline":var T=t.getVerticesFromXfdf(e.get("xfdf"));return e=e.set("annotationData",R.a.fromJS(t.calculateLineValues(T))),e=t.calculateFormulae(e),t.calculateTilesForAnnotation(e,0);case"Point":var S=e.get("geoFile"),b=void 0;if(S){var I=C.a.getFileById(S.get("id"));I&&(b=I.name)}return e.setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.POINTS"],e.get("quantity")).setIn(["annotationData","ESTIMATE.ANNOTATION_PROPERTIES.COUNT"],e.get("quantity")).setIn(["annotationData","ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME"],b);case"Stamp":case"Arrow":var y=e.get("geoFile"),v=void 0;if(y){var N=C.a.getFileById(y.get("id"));N&&(v=N.name)}return e.setIn(["annotationData","ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME"],v);case"Free text":var O=e.get("geoFile"),w=void 0;if(O){var P=C.a.getFileById(O.get("id"));P&&(w=P.name)}return e.setIn(["annotationData","ESTIMATE.ANNOTATION_VALUES.TEXT_CONTENTS"],e.get("textContents")).setIn(["annotationData","ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME"],w);default:return e.set("annotationData",new R.a.Map)}},getIFCAnnotData:function(e){var t=C.a.getFileById(e.getIn(["geoFile","id"])),n=e.get("xfdf"),a={"ESTIMATE.ANNOTATION_PROPERTIES.FILE_NAME":t.name,"ESTIMATE.ANNOTATION_PROPERTIES.COUNT":1};if(!Object(u.isNil)(n.get("area"))){var o={"ESTIMATE.ANNOTATION_VALUES.AREA":n.get("area")};a=Object.assign({},a,o)}if(!Object(u.isNil)(n.get("volume"))){var i={"ESTIMATE.ANNOTATION_VALUES.VOLUME":n.get("volume")};a=Object.assign({},a,i)}if(!Object(u.isNil)(n.get("netArea"))){var r={"ESTIMATE.ANNOTATION_VALUES.NET_AREA":n.get("netArea")};a=Object.assign({},a,r)}if(!Object(u.isNil)(n.get("netVolume"))){var s={"ESTIMATE.ANNOTATION_VALUES.NET_VOLUME":n.get("netVolume")};a=Object.assign({},a,s)}if(!Object(u.isNil)(n.get("edges"))){var l=n.get("edges").toJS(),c=Object.keys(l).sort((function(e,t){return e.slice(1)-t.slice(1)})).map((function(e){return l[e].length}));a=Object.assign({},a,{"ESTIMATE.ANNOTATION_VALUES.EDGES":c})}if(!Object(u.isNil)(n.get("sides"))){var d=n.get("sides").toJS(),p=Object.keys(d).sort((function(e,t){return e.slice(1)-t.slice(1)})).map((function(e){return d[e].circumference})),g=Object.keys(d).sort((function(e,t){return e.slice(1)-t.slice(1)})).map((function(e){return d[e].area}));a=Object.assign({},a,{"ESTIMATE.ANNOTATION_VALUES.SL":p},{"ESTIMATE.ANNOTATION_VALUES.S":g})}return a},sumValuesForMultipleAnnotations:function(e,t){return e.filter((function(e){return("Reduction"===t||"Reduction"!==e.get("type"))&&e.has("annotationData")})).map((function(t){return e.size>1?t.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y"):t.get("annotationData")})).reduce((function(e,t){return e.isEmpty()?t:e.mergeWith((function(e,t){return R.a.List.isList(e)?e.concat(t):(Number(e)&&(e=Number(e)),Number(t)&&(t=Number(t)),t+(e||0))}),t)}),new R.a.Map({}))},minfiedRetraction:function(e){return e.reduce((function(e,t){return e.isEmpty()?t:e.mergeWith((function(e,t){return R.a.List.isList(e)?e.concat(t):(Number(e)&&(e=Number(e)),Number(t)&&(t=Number(t)),e-t)}),t)}))},minfiedSummation:function(e){return e.reduce((function(e,t){return e.isEmpty()?t:e.mergeWith((function(e,t){return R.a.List.isList(e)?e.concat(t):(Number(e)&&(e=Number(e)),Number(t)&&(t=Number(t)),t+(e||0))}),t)}),new R.a.Map({}))},calculateDisplayAnnot:function(){var e=l.a.mark(n),t=this;function n(){var n,a,o,i,r,s;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=W.a.getCurrentlySelectedNodes().toJS(),a=new R.a.List,!n){e.next=16;break}o=void 0,o=0;case 5:if(!(o<n.length)){e.next=15;break}if(o%1e3!==0){e.next=9;break}return void(e.next=9);case 9:"group"===(i=R.a.fromJS(n[o])).get("type")&&(r=t.getAllAnnotationsFromParent(i.get("id")).filter((function(e){return"group"!==e.get("type")})))&&r.size>0&&(s=t.getDisplayAnnot(r),i=(i=i.set("color",s.get("color"))).set("interior-color",s.get("interior-color"))),a=a.push(i);case 12:o++,e.next=5;break;case 15:t.displayAnnot=t.getDisplayAnnot(a);case 16:case"end":return e.stop()}}),e)}return this.displayAnnot=void 0,n()},getMergedFolderData:function(){var e=this.selectedParentFolders;if(e.length>0){var t=e[0].name,n=e[0].number,a=e.every((function(e){return e.name===t})),o=e.every((function(e){return e.number===n}));return{name:a?t:void 0,number:o?n:void 0}}return{}},getDisplayAnnot:function(e){var t=this.getAnnotListWithIFCStatuses(e);return t.reduce((function(e,t){var n=e;return e.get("quantity")!==t.get("quantity")&&(n=n.set("quantity","#")),e.get("name")!==t.get("name")&&(n=n.set("name",void 0)),e.get("number")!==t.get("number")&&(n=n.set("number",void 0)),e.get("height")!==t.get("height")&&(n=n.set("height","#")),e.get("color")!==t.get("color")&&(n=n.set("color","#333333")),e.get("interior-color")!==t.get("interior-color")&&(n=n.set("interior-color","#0000FF")),e.get("displayValueList")&&t.get("displayValueList")&&R.a.is(e.get("displayValueList"),t.get("displayValueList"))||(n=n.set("displayValueList",new R.a.List)),e.get("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")||(n=(n=(n=(n=(n=n.set("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X","")).set("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y","")).set("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X","")).set("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y","")).set("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH","")),e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH")||(n=(n=(n=(n=(n=n.set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X","")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y","")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X","")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y","")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH","")),e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")&&e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")===t.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")||(n=(n=(n=(n=(n=n.set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X","")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y","")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X","")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y","")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH","")),e.get("length")!==t.get("length")&&(n=n.set("length",void 0)),!e.get("formulaNA")&&t.get("formulaNA")&&(n=n.set("formulaNA",t.get("formulaNA"))),!e.get("formulaNL")&&t.get("formulaNL")&&(n=n.set("formulaNL",t.get("formulaNL"))),!e.get("formulaNVO")&&t.get("formulaNVO")&&(n=n.set("formulaNVO",t.get("formulaNVO"))),!e.get("formulaNV")&&t.get("formulaNV")&&(n=n.set("formulaNV",t.get("formulaNV"))),e.get("maintainAspectRatio")!==t.get("maintainAspectRatio")&&(n=n.set("maintainAspectRatio",!1)),e.get("readOnly")!==t.get("readOnly")&&(n=n.set("readOnly",!1)),e.get("parentId")!==t.get("parentId")&&(n=n.set("parentId",void 0)),e.get("status")!==t.get("status")&&(n=n.set("status",void 0)),n}),t.first())},getAnnotListWithIFCStatuses:function(e){return e.map((function(e){return"3DModel"===e.get("type")?e.set("status",e.getIn(["xfdf","status"])):e}))},calulateSumAndDerivedType:function(){var e=l.a.mark(n),t=this;function n(){var n,a,o,i,r,s,c,u,d;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t.type=void 0,t.calculatedSum=void 0,n=new R.a.Map,a=new R.a.List,o=0,i=t.getSelectedAnnotations().size,r=t.getSelectedAnnotations().toJS(),s=void 0,s=0;s<i;s++)c=R.a.fromJS(r[s].storeAnnotation),u=!1,"Reduction"===c.get("type")&&"Reduction"!==t.getCurrentSelectionType()&&(u=!0),d=t.calculateValuesForAnnotation(c),u||("group"!=d.get("type")&&n.isEmpty()?(o++,"x-scale"!=d.get("type")&&"y-scale"!=d.get("type")&&(i>1?d.get("annotationData")&&(n=d.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S")):d.get("annotationData")&&(n=d.get("annotationData")))):"group"!=d.get("type")&&(o++,"x-scale"!=d.get("type")&&"y-scale"!=d.get("type")&&(i>1&&d.get("annotationData")&&(d=d.set("annotationData",d.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S"))),a=(a=a.clear()).push(n).push(d.get("annotationData")),n=t.minfiedSummation(a))));t.type=t.getCurrentSelectionType(),t.calculatedSum=n?n.set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",o):void 0;case 11:case"end":return e.stop()}}),e)}return n()},createWebViewer:function(e,t){var n=this;return Object(c.a)(l.a.mark((function a(){var o;return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return n.onSetActiveFileId(e),n.onSetActivePageId(1),n.onSetActiveParentId(void 0,!0),n.documentLoaded=!1,a.next=6,new h.a({type:"html5,html5Mobile",path:"/webviewer",showLocalFilePicker:!1,showToolbarControl:!1,showPageHistoryButtons:!1,hideAnnotationPanel:!0,l:"Rukkor AB(rukkor.com):OEM:Geometra::B+:AMS(20220604):BBA5883D0427060A7360B13AC982737860614F9BFF68AD1BBD72558495873E8E4AB431F5C7",annotationUser:y.a.getUserId(),enableAnnotations:!0,backgroundColor:"#333333",autoCreate:!0,fullAPI:!0,isAdminUser:!0,streaming:!1,enableOfflineMode:!1,annotationAdmin:!0,serverUrl:null,useDownloader:!1,disabledElements:["annotationStylePopup","annotationDeleteButton","toolsOverlay","searchOverlay","toolbarGroup-Shapes","toolbarGroup-Edit","toolbarGroup-Insert","linkButton","menuOverlay","toolsHeader","pageNavOverlay"]},t);case 6:n.WebViewer=a.sent,n.WebViewer.disableElements(["redoButton","undoButton"]),n.WebViewer.hotkeys.off(n.WebViewer.hotkeys.Keys.CTRL_Z),n.WebViewer.hotkeys.off(n.WebViewer.hotkeys.Keys.CTRL_Y),n.element=t,y.a.getRole()?n.webviewerInit=new J(n.WebViewer):n.webviewerInit=new H.a(n.WebViewer),o=n.WebViewer.Feature,n.WebViewer.disableFeatures([o.Copy]),n.webviewerInit.init(),localStorage.getItem("toggleSnapOn")||localStorage.setItem("toggleSnapOn","false"),n.snaponEnabled=localStorage.getItem("toggleSnapOn"),localStorage.getItem("calculatePageLayout")||localStorage.setItem("calculatePageLayout","single"),n.displayMode=localStorage.getItem("calculatePageLayout"),localStorage.getItem("snapMode")||localStorage.setItem("snapMode","end-of-line"),n.snapMode=localStorage.getItem("snapMode"),n.initializeEventHandlers(),n.trigger("displayModeUpdated"),n.trigger("snapModeUpdated"),n.trigger("toggleSnapon"),n.WebViewer.contextMenuPopup.update([]);case 26:case"end":return a.stop()}}),a)})))()},setContextMenuPopupContent:function(e){var t=this;if(this.WebViewer&&e&&e.size>0&&"AnnotationEdit"===this.currentToolMode){var n=[];e.forEach((function(e){switch(e.get("type")){case"Polygon":case"Line":case"Polyline":case"Free hand":n.push({type:"actionButton",img:ee.a,onClick:function(){return t.switchRotationControlEnabled(W.a.getCurrentlySelectedNodes(),!0)}});break;case"Stamp":case"Free text":case"CenterValue":case"PeripheralValue":case"Point":n.push({type:"actionButton",img:K.a,onClick:function(){return t.onRotate(-90)}},{type:"actionButton",img:Q.a,onClick:function(){return t.onRotate(90)}});break;default:return}}));var a=n.filter((function(e,t){return n.findIndex((function(t){return t.onClick.toString()===e.onClick.toString()}))===t}));this.isActiveIfcFile()||this.WebViewer.contextMenuPopup.update(a)}else this.WebViewer&&this.WebViewer.contextMenuPopup.update([])},clampRotation:function(e,t){var n=e+t;return n<0&&(n=360+t),n>360&&(n=0+t),n},onRotate:function(e){var t=this,n={};W.a.getCurrentlySelectedNodes().forEach((function(a){var o=t.clampRotation(a.get("rotation")||0,e);n[o]||(n[o]=new R.a.List),n[o]=n[o].push(a)})),Object.keys(n).forEach((function(e){t.changeRotation(n[e],e)}))},showUsUnits:function(){var e=this.getSelectedAnnotations();return!(!e||!e.first())&&"imperial"===U.a.getProjectUnitsByID(this.getProjectIdFromEstimateId(e.first().getIn(["storeAnnnotation","geoEstimate","id"])))},toUsValue:function(e){return Object(T.b)(e,"m")},toUsVolume:function(e){return Object(T.d)(e,"m3")},toUsSquared:function(e){return Object(T.c)(e,"m2")},removePointFromAnnotationFromConfig:function(e,t){if(this.WebViewer&&e){var n=this.getAnnotationByAnnotationId(e.Id);if(n){e.Hidden=!0;var a=new XMLSerializer,o=void 0,i=(new DOMParser).parseFromString(n.get("xfdf"),"text/xml"),r=i.getElementsByTagName("vertices")[0];switch(r||(r=i.getElementsByTagName("gesture")[0]),r&&(o=r.childNodes[0].nodeValue)&&(o=o.split(";").map((function(e){var t=e.split(",");return[parseFloat(t[0]),parseFloat(t[1])]}))),e.Subject){case"Polygon":case"Reduction":0===t||t===o.length-1?(o.splice(o.length-1,1),o.splice(t,1),o.push(o[0])):o.splice(t,1);break;case"Polyline":o.splice(t,1)}for(var s="",l=0;l<o.length;l++)l===o.length-1?s+=o[l][0]+","+o[l][1]:s+=o[l][0]+","+o[l][1]+";";r.childNodes[0].nodeValue=s;var c=a.serializeToString(i);n=n.set("xfdf",c),this.onRequestAnnotationUpdateArray((new R.a.List).push(n))}}},addPointToAnnotationFromConfig:function(e,t,n){if(this.WebViewer&&e){var a=this.getAnnotationByAnnotationId(e.Id);if(a){e.Hidden=!0;var o=new XMLSerializer,i=void 0,r=(new DOMParser).parseFromString(a.get("xfdf"),"text/xml"),s=r.getElementsByTagName("vertices")[0];s||(s=r.getElementsByTagName("gesture")[0]),s&&(i=s.childNodes[0].nodeValue)&&(i=i.split(";").map((function(e){var t=e.split(",");return[parseFloat(t[0]),parseFloat(t[1])]})));var l=[t.x,t.y];i.splice(n,0,l);for(var c="",u=0;u<i.length;u++)u===i.length-1?c+=i[u][0]+","+i[u][1]:c+=i[u][0]+","+i[u][1]+";";s.childNodes[0].nodeValue=c;var d=o.serializeToString(r);a=a.set("xfdf",d),this.onRequestAnnotationUpdateArray((new R.a.List).push(a))}}},parseFormulaFromConfig:function(e,t,n){try{if(e&&t)switch(e.Subject){case"Polygon":case"annotation.freeHand":case"Free hand":case"Free Hand":case"Reduction":var a=this.getScaleForFileAndPage(this.getActiveFileId(),e.PageNumber),o=new _.a(e.annotationHeight,1,a.get("x-scale"),void 0,a.get("y-scale")),i=void 0;i="annotation.freeHand"===e.Subject||"Free Hand"===e.Subject||"Free hand"===e.Subject?e.getPath(0).map((function(e){return[e.x,e.y]})):e.getPath().map((function(e){return[e.x,e.y]}));var r=R.a.fromJS(o.calculatePolygonValues(i));if("Polygon"===e.Subject){var s=r.get(n);this.getReductionByParentAnnotationId(e.Id).forEach((function(e){var t=new _.a(e.get("height"),e.get("quantity"),a.get("x-scale"),void 0,a.get("y-scale")),o=t.getVerticesFromXfdf(e.get("xfdf")),i=R.a.fromJS(t.calculatePolygonValues(o));s-=i.get(n)})),r=r.set(n,s)}return v.a.parseExpressionToValues(r.get(n)+t,r);case"Ellipse":var l=this.getScaleForFileAndPage(this.getActiveFileId(),e.PageNumber),c=new _.a(e.annotationHeight,1,l.get("x-scale"),void 0,l.get("y-scale")),u=e.getRect(),d=[];d.push(u.x1),d.push(u.y1),d.push(u.x2),d.push(u.y2);var p=R.a.fromJS(c.calculateEllipseValues(d));return v.a.parseExpressionToValues(p.get(n)+t,p);case"Polyline":var g=this.getScaleForFileAndPage(this.getActiveFileId(),e.PageNumber),h=e.getPath().map((function(e){return[e.x,e.y]})),m=new _.a(e.annotationHeight,1,g.get("x-scale"),void 0,g.get("y-scale")),f=R.a.fromJS(m.calculateLineValues(h));return v.a.parseExpressionToValues(f.get(n)+t,f)}}catch(A){console.log("erro in parseFormulaFromConfig: "+A.stack)}},setPointAnnotationForIconAddTool:function(e){this.pointAnnotationForIconAddTool=e},getIconStoreForConfig:function(){return k.a},cleanup:function(){if(this.element&&this.element.querySelector("iframe").contentWindow){var e=this.element.querySelector("iframe").contentWindow.document;e.querySelector("body").removeEventListener("keydown",ae.c),e.querySelector("body").removeEventListener("keydown",ae.a),e.querySelector("body").removeEventListener("keyup",ae.b),e.querySelector("body").removeEventListener("mousedown",ae.d),e.querySelector("body").removeEventListener("mouseup",ae.e)}this.WebViewer&&(this.WebViewer.dispose(),this.WebViewer=void 0),this.webviewerInit&&(this.webviewerInit.cleanup(),this.webviewerInit=void 0),this.documentLoaded=!1},getAnnotationsLists:function(){var e=this,t=new R.a.List;return W.a.getCurrentlySelectedNodes().forEach((function(n){var a=[n];if("group"===n.get("type")&&e.getAllFolderChildresToDelete(n.get("id").toString(),a),"Polygon"===n.get("type")){var o=e.getReductionByParentAnnotationId(n.get("annotationId"));o.size>0&&a.push.apply(a,Object(i.a)(o))}a.forEach((function(e){t.every((function(t){return t.get("id")!==e.get("id")}))&&(t=t.push(e))}))})),this.groupAnnotsByPreventEditing(t)},groupAnnotsByPreventEditing:function(e){var t=new R.a.List,n=new R.a.List;return e.forEach((function(e){if("x-scale"!==e.get("type")&&"y-scale"!==e.get("type")){var a=new DOMParser;if("3DModel"===e.get("type"))return void(e.getIn(["xfdf","readOnly"])?n=n.push(e):t=t.push(e));var o=a.parseFromString(e.get("xfdf"),"text/xml");if("group"!==e.get("type")&&e.get("type")!==X.e&&e.get("type")!==X.f)"true"!==o.querySelector("annots").firstElementChild.getAttribute("readOnly")?t=t.push(e):n=n.push(e);else t=t.push(e)}})),{readWriteList:t,readOnlyList:n}},changeAnnotsStatus:function(e){var t=this.getAnnotationsLists().readWriteList.toJS();t.length>0&&this.onRequestAnnotationUpdate({annots:t,key:"status",value:e})},clearTreeSelection:function(){(W.a.deselectAnnotationsFromList(new R.a.List),this.WebViewer)&&this.WebViewer.annotManager.deselectAllAnnotations();this.SelectedAnnotations=this.SelectedAnnotations.clear(),this.trigger("annotationSelected")},initializeEventHandlers:function(){var e=this;if(this.WebViewer){var t=C.a.getFileById(this.ActiveFileId),n="";t&&(n=t.name),this.pageCount=void 0,this.documentLoaded=!1,this.WebViewer.loadDocument(this.bucketURL+this.ActiveFileId,{documentId:this.ActiveFileId,filename:n});var a=this.WebViewer.docViewer,o=this.element.querySelector("iframe").contentWindow.document;o.querySelector("body").addEventListener("keydown",ae.c),o.querySelector("body").addEventListener("keydown",ae.a),o.querySelector("body").addEventListener("keyup",ae.b),o.querySelector("body").addEventListener("mousedown",ae.d),o.querySelector("body").addEventListener("mouseup",ae.e);var i=this.WebViewer.annotManager;a.on("keyDown",(function(t){switch(t.key){case"Control":e.setIsCtrlPressed(!0);break;case"Alt":e.setIsAltPressed(!0)}})),a.on("keyUp",(function(t){switch(t.key){case"Control":e.setIsCtrlPressed(!1);break;case"Alt":e.setIsAltPressed(!1)}})),a.on("mouseLeftDown",(function(){W.a.getTreeSelection().length>0&&0===i.getSelectedAnnotations().length&&!e.isCtrlPressed&&e.clearTreeSelection(),e.trigger("closeSubMenu")})),a.on("fitModeUpdated",(function(){e.fitModeButtonPressed&&(e.fitModeButtonPressed=!1,e.WebViewer.setCurrentPageNumber(e.WebViewer.getCurrentPageNumber()))})),i.on("annotationChanged",function(){var t=Object(c.a)(l.a.mark((function t(n,a,o){var r,s,c,u,p,g,h,m,f,A,E,T,b,I,y;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o.imported){t.next=60;break}t.t0=a,t.next="add"===t.t0?5:"modify"===t.t0?9:"delete"===t.t0?52:59;break;case 5:return t.next=7,i.exportAnnotCommand();case 7:return d.a.forEach(n,(function(t){"x-scale"===t.Subject||"y-scale"===t.Subject?i.exportAnnotations({annotList:[t]}).then((function(n){try{e.onRequestScaleCreate(n,t.Subject,e.ActiveFileId,t.getPageNumber(),t.length||1)}catch(a){console.log("error: ",a.stack)}})):("Stamp"!==t.Subject&&"Free text"!==t.Subject&&i.deleteAnnotation(t,!0,!0),"Free text"===t.Subject&&t.setContents(q.a.t("Comment")),i.exportAnnotations({annotList:[t]}).then((function(n){var a=n.length/1e5;"Stamp"===t.Subject&&a>5?(i.deleteAnnotations([t]),e.deSelectAllAnnotationsFromGui(),e.trigger("showStampTooHeavyDialog")):e.onRequestAnnotationCreate(R.a.fromJS([{annotXfdf:n,type:t.Subject,fileId:e.ActiveFileId,annotationId:t.Id}]))})))})),t.abrupt("break",60);case 9:if(!e.modifyAnnotationLock){t.next=13;break}return t.next=12,i.exportAnnotCommand();case 12:return t.abrupt("return");case 13:return t.next=15,i.exportAnnotCommand();case 15:r=t.sent,s=new S.a,c=s.getModifyList(r),u=new R.a.List,p=c.length,g=0,g=0;case 22:if(!(g<p)){t.next=50;break}if(c[0]){t.next=25;break}return t.abrupt("continue",47);case 25:if(h=!1,m=void 0,"Reduction"===c[0].getAttribute("subject")?m=e.getReductionByAnnotationId(c[0].getAttribute("name")):"CenterValue"===c[0].getAttribute("subject")||"PeripheralValue"===c[0].getAttribute("subject")?(f=c[0].getAttribute("name"),m=e.getDisplayValueAnnotationByAnnotationId(f)):m=e.getAnnotationByAnnotationId(c[0].getAttribute("name")),A=void 0,m){t.next=37;break}if(m=e.getScaleByAnnotationId(c[0].getAttribute("name"))){t.next=33;break}return t.abrupt("continue",47);case 33:A=m.get("xdf"),h=!0,t.next=38;break;case 37:A=m.get("xfdf");case 38:if(E=new DOMParser,T=E.parseFromString(A,"text/xml"),b=T.querySelector("annots"),"CenterValue"===c[0].getAttribute("subject")||"PeripheralValue"===c[0].getAttribute("subject")?c[0].setAttribute("FontSize",0):c[0].setAttribute("FontSize",b.firstElementChild.getAttribute("FontSize")||0),b.removeChild(b.firstElementChild),b.appendChild(c[0]),I=new XMLSerializer,y=I.serializeToString(T),h){m=m.set("xdf",y);try{e.onRequestScaleUpdate(m,m.get("xdf"))}catch(l){console.log("Error | Updating Scale: "+l)}}else m=m.set("xfdf",y),u=u.push(R.a.fromJS({type:m.get("type"),annotationId:m.get("annotationId"),xfdf:m.get("xfdf")}));case 47:g++,t.next=22;break;case 50:try{u.size>0&&e.onRequestAnnotationUpdateArray(u)}catch(l){console.log("Error | Modify: "+l)}return t.abrupt("break",60);case 52:return t.next=54,i.exportAnnotCommand();case 54:return e.annotationsToDeleteByPdfTron=e.annotationsToDeleteByPdfTron.clear(),d.a.forEach(n,(function(t){var n=void 0;(n="x-scale"===t.Subject||"y-scale"===t.Subject?e.getScaleByAnnotationId(t.Id):"Reduction"===t.Subject?e.getReductionByAnnotationId(t.Id):e.getAnnotationByAnnotationId(t.Id))&&(e.annotationsToDeleteByPdfTron=e.annotationsToDeleteByPdfTron.push(n))})),e.onTriggerDeleteAnnotations(),e.annotationManagerSelectionLock=!1,t.abrupt("break",60);case 59:return t.abrupt("break",60);case 60:case"end":return t.stop()}}),t)})));return function(e,n,a){return t.apply(this,arguments)}}());i.on("annotationSelected",(function(t,n){var a=[],o=[];if(!e.annotationManagerSelectionLock){switch(n){case"selected":1!==t.length||e.isCtrlPressed||(W.a.deselectAnnotationsFromList(new R.a.List),e.SelectedAnnotations=e.SelectedAnnotations.clear());var r=void 0;if(d.a.forEach(t,(function(n){(r=function(t){var n=t.annot,a=t.annotationList;switch(n.Subject){case"x-scale":case"y-scale":if(!(a.length>1))return e.getScaleByAnnotationId(n.Id);i.deselectAnnotation(n);break;case"Reduction":return e.initPdfAnnotationAsSelected(n),e.getReductionByAnnotationId(n.Id);case"CenterValue":case"PeripheralValue":if(!(a.length>1)||e.isAltPressed)return e.initPdfAnnotationAsSelected(n),e.getDisplayValueAnnotationByAnnotationId(n.Id);i.deselectAnnotation(n);break;default:return e.initPdfAnnotationAsSelected(n),e.getAnnotationByAnnotationId(n.Id)}}({annot:n,annotationList:t}))&&(a.push(r),"x-scale"===r.get("type")||"y-scale"===r.get("type")?o.push(r.get("type")):o.push(r.get("id")),e.updateSelectedAnnotationsToStore(n.Id,r?r.get("id"):void 0,n.Subject,r))})),r)switch(r.get("type")){case"Reduction":case"CenterValue":case"PeripherlaValue":var s=e.getAnnotationByAnnotationId(r.get("parentId"));s&&e.onSetActiveParentId(s.get("parentId"),!0);break;default:e.onSetActiveParentId(r.get("parentId"),!0)}break;case"deselected":if(e.allAnnotationsSelected=!1,e.clearSelectedParentFolders(),t){var l=void 0;if(d.a.forEach(t,(function(t){(l=function(t){var n=t.annot;switch(n.Subject){case"x-scale":case"y-scale":return e.getScaleByAnnotationId(n.Id);case"Reduction":return e.initPdfAnnotationAsDeselected(n),e.getReductionByAnnotationId(n.Id);default:return e.initPdfAnnotationAsDeselected(n),e.getAnnotationByAnnotationId(n.Id)}}({annot:t}))&&(a.push(l),"x-scale"===l.get("type")||"y-scale"===l.get("type")?o.push(l.get("type")):o.push(l.get("id"))),e.updateDeSelectAnnotationToStore(t.Id,l?l.get("id"):void 0)})),l){var c=i.getSelectedAnnotations();if(c&&c.length>0){var u=e.getAnnotationByAnnotationId(c[0].Id);if(u)switch(u.get("type")){case"Reduction":case"CenterValue":case"PeripheralValue":var p=e.getAnnotationById(u.get("parentId"));p&&e.onSetActiveParentId(p.get("parentId"));break;default:e.onSetActiveParentId(u.get("parentId"))}}else c&&0===c.length&&e.onSetActiveParentId(void 0)}}else e.SelectedAnnotations.forEach((function(t){var n=i.getAnnotationById(t.get("annotationId"));n&&"x-scale"!==n.Subject&&"y-scale"!==n.Subject&&e.initPdfAnnotationAsDeselected(n)})),e.SelectedAnnotations=e.SelectedAnnotations.clear(),e.resetAnnotationTypeMap(),e.calculatedSum&&(e.calculatedSum=void 0),e.onSetActiveParentId(void 0)}if(1===i.getSelectedAnnotations().length&&"Polygon"===i.getSelectedAnnotations()[0].Subject?(e.setActiveReductionParentId(i.getSelectedAnnotations()[0]),I.a.enableReductionDrawingTool()):"AnnotationCreateReduction"!==e.currentToolMode&&I.a.disableReductionDrawingTool(),"deselected"===n)if(t&&e.getNrSelectedFolders()>0){var g=[];o.splice(0,o.length),e.SelectedAnnotations=e.SelectedAnnotations.filter((function(t){return"group"===t.get("type")?(e.decreaseAnnotationTypeMapSelection(t.get("type")),!1):("x-scale"===t.get("type")||"y-scale"===t.get("type")?o.push(t.get("type")):o.push(t.get("id")),g.push(t.get("storeAnnotation")),!0)})),W.a.deselectAnnotationsFromList(new R.a.List),W.a.selectAnnotationsFromList(R.a.fromJS(g),R.a.fromJS(o))}else W.a.deselectAnnotationsFromList(R.a.fromJS(a));else W.a.selectAnnotationsFromList(R.a.fromJS(a),R.a.fromJS(o));e.calculateValues(),e.trigger("annotationSelected")}})),this.WebViewer.docViewer.on("documentLoaded",Object(c.a)(l.a.mark((function t(){var n,a,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.documentLoaded=!0,e.userLoadingAnnotations=!1,n=e.WebViewer.annotManager,a=C.a.getFileById(e.ActiveFileId),e.pageRotation=e.WebViewer.docViewer.getCompleteRotation(e.WebViewer.docViewer.getCurrentPage()),a&&a.rotation&&((o=a.get("rotation")).has("0")&&(o=o.delete("0")),e.WebViewer.docViewer.setPageRotations(o.toJS())),e.setToolMode(e.WebViewer.Tools.ToolNames.EDIT),e.setDisplayMode(localStorage.getItem("calculatePageLayout")),e.WebViewer.setSideWindowVisibility(!1),n.disableFreeTextEditing(),t.prev=10,e.pageCount=e.WebViewer.docViewer.getPageCount(),t.next=14,e.loadAllAnnotations();case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(10),console.log("error 2"+t.t0);case 19:W.a.calculateTreeSelect([],{selectedNodes:[]}),e.trigger("documentLoaded");case 21:case"end":return t.stop()}}),t,null,[[10,16]])})))),this.WebViewer.docViewer.on("pageNumberUpdated",(function(){if(e.onSetActivePageId(e.WebViewer.getCurrentPageNumber()),e.webviewerInit&&e.webviewerInit.isDrawing()){var t=e.currentToolMode;e.WebViewer.ToolMode&&e.setToolMode(e.WebViewer.ToolMode.AnnotationEdit),e.setToolMode(t),e.webviewerInit.setIsDrawing(!1)}else"PageAndFile"===e.getAnnotationTableFilter()&&W.a.calculateTreeSelect([],{selectedNodes:[]})})),this.WebViewer.docViewer.on("toolModeUpdated",(function(){"AnnotationCreateReduction"!==e.currentToolMode&&I.a.disableReductionDrawingTool(),"AnnotationEdit"===e.currentToolMode?e.WebViewer.Tools.Tool.ENABLE_ANNOTATION_HOVER_CURSORS=!0:e.WebViewer.Tools.Tool.ENABLE_ANNOTATION_HOVER_CURSORS=!1,e.currentToolMode!==e.WebViewer.getToolMode()&&(e.setToolMode(e.currentToolMode),e.updateSelectedTool())})),I.a.disableReductionDrawingTool()}},updatePageRotationState:function(){var e;this.pageRotation=(null===(e=this.WebViewer)||void 0===e?void 0:e.docViewer.getCompleteRotation(this.WebViewer.docViewer.getCurrentPage()))||0},getPageRotation:function(){return this.pageRotation},loadAllAnnotations:function(){var e=this;return Object(c.a)(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.userLoadingAnnotations=!0,t.prev=1,t.next=4,e.loadAnnotations(e.Annotations);case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),console.log("Error | Loading Annotations: "+t.t0);case 9:return t.prev=9,t.next=12,e.loadScales(e.xScaleList);case 12:return t.next=14,e.loadScales(e.yScaleList);case 14:t.next=19;break;case 16:t.prev=16,t.t1=t.catch(9),console.log(t.t1);case 19:return t.next=21,e.WebViewer.annotManager.drawAnnotationsFromList(e.WebViewer.annotManager.getAnnotationsList());case 21:return t.next=23,e.WebViewer.annotManager.exportAnnotCommand();case 23:e.jumpAnnotId?(e.jumpToAnnotation(e.jumpAnnotId,!0),e.jumpAnnotId=void 0):e.WebViewer.setCurrentPageNumber(C.a.getLastViewedPageNr());case 24:case"end":return t.stop()}}),t,null,[[1,6],[9,16]])})))()},setScaleStyleValues:function(e,t,n,a){return t||this.onRequestScaleUpdate(n,a),e.push(R.a.fromJS({type:n.get("type"),annotationId:n.get("annotationId"),xdf:a}))},changeColor:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{if(this.WebViewer&&e){var o=new R.a.List,i=new DOMParser,r=new XMLSerializer;if(e.forEach((function(e){if("group"!==e.get("type")){var s=void 0;s="x-scale"===e.get("type")||"y-scale"===e.get("type")?i.parseFromString(e.get("xdf"),"text/xml"):i.parseFromString(e.get("xfdf"),"text/xml"),n.typeInheritanceMap.get(n.getTypeConversion(e.get("type")))&&n.typeInheritanceMap.get(n.getTypeConversion(e.get("type"))).setColor(t);var l=Object(u.get)(s.querySelector("annots"),"children");d.a.forEach(l,(function(a){switch(n.getTypeConversion(e.get("type"))){case"Point":case"Polygon":case"Ellipse":case"Free Hand":case"Free hand":case"Reduction":case"Stamp":a.setAttribute("color",t);break;case"Polyline":case"Arrow":case"x-scale":case"y-scale":a.setAttribute("color",t);break;case"FreeText":case"Free text":case"Freetext":case"Free Text":a.setAttribute("TextColor",t)}}));var c=r.serializeToString(s);o="x-scale"===e.get("type")||"y-scale"===e.get("type")?n.setScaleStyleValues(o,a,e,c):o.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:c}))}})),a)return o;o.size>0&&this.onRequestAnnotationUpdateArray(o)}}catch(s){console.log("Error | Changing Color: "+s.stack)}},changeColor2:function(e,t){var n=this;try{if(this.WebViewer&&e){if(e.type===X.e||e.type===X.f)return void this.onRequestScaleUpdate2({id:e.id,value:t,key:"color"});var a={annots:[],key:"color",value:t},o={annots:[],key:"TextColor",value:t};e.forEach((function(e){if("group"!==e.type){switch(n.typeInheritanceMap.get(n.getTypeConversion(e.type))&&n.typeInheritanceMap.get(n.getTypeConversion(e.type)).setColor(t),n.getTypeConversion(e.type)){case"Point":case"Polygon":case"Ellipse":case"Free Hand":case"Free hand":case"Reduction":case"Stamp":case"Polyline":case"Arrow":case"x-scale":case"y-scale":a.annots.push(e);break;case"FreeText":case"Free text":case"Freetext":case"Free Text":o.annots.push(e)}a.annots.length>0&&n.onRequestAnnotationUpdate(a),o.annots.length>0&&n.onRequestAnnotationUpdate(o)}}))}}catch(i){console.log("Error | Changing Color: "+i.stack)}},changeInteriorColor:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{if(this.WebViewer&&e){var o=new R.a.List,i=new DOMParser,r=new XMLSerializer;if(e.forEach((function(e){if("group"!==e.get("type")){var s=void 0;s="x-scale"===e.get("type")||"y-scale"===e.get("type")?i.parseFromString(e.get("xdf"),"text/xml"):i.parseFromString(e.get("xfdf"),"text/xml"),n.typeInheritanceMap.get(n.getTypeConversion(e.get("type")))&&n.typeInheritanceMap.get(n.getTypeConversion(e.get("type"))).setInteriorColor(t);var l=Object(u.get)(s.querySelector("annots"),"children");d.a.forEach(l,(function(a){switch(n.getTypeConversion(e.get("type"))){case"Point":case"Polygon":case"Ellipse":case"Free Hand":case"Free hand":case"Reduction":a.setAttribute("interior-color",t);break;case"Polyline":case"x-scale":case"y-scale":a.setAttribute("interior-color",t)}}));var c=r.serializeToString(s);o="x-scale"===e.get("type")||"y-scale"===e.get("type")?n.setScaleStyleValues(o,a,e,c):o.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:c}))}})),a)return o;o.size>0&&this.onRequestAnnotationUpdateArray(o)}}catch(s){console.log("Error | Changing Interior Color: "+s.stack)}},changeStyle:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{return this.changeAnnotationAttribute(e,"style",t,n)}catch(a){console.log("Error | Changing style: "+a.stack)}},changeStatus:function(e,t){try{if(this.WebViewer&&e){var n=new R.a.List,a=new DOMParser;e.forEach((function(e){var o=void 0,i=new XMLSerializer,r=void 0;switch(e.get("type")){case"x-scale":case"y-scale":case"group":case"CenterValue":case"PeripheralValue":break;default:(o=a.parseFromString(e.get("xfdf"),"text/xml")).querySelector("annots").firstElementChild.setAttribute("status",t),r=i.serializeToString(o);var s=e.set("xfdf",r);n=n.push(s)}})),n.size>0&&this.onRequestAnnotationUpdateArray(n)}}catch(o){console.log("Error | Changing attribute: "+o.stack)}},changeAnnotationAttribute:function(e,t,n){var a=this,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{if(e){var i=new R.a.List,r=new DOMParser;if(e.forEach((function(e){if("group"!==e.get("type")){var s=void 0,l=new XMLSerializer,c=void 0;if("x-scale"===e.get("type")||"y-scale"===e.get("type"))(s=r.parseFromString(e.get("xdf"),"text/xml")).querySelector("annots").children[0].setAttribute(t,n),c=l.serializeToString(s),e.set("xdf",c),i=a.setScaleStyleValues(i,o,e,c);else s=r.parseFromString(e.get("xfdf"),"text/xml"),e.set(t,n),s.querySelector("annots").children[0].setAttribute(t,n),c=l.serializeToString(s),o?(e=e.set("xfdf",c),i=i.push(e)):i=i.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:c}))}})),o)return i;i.size>0&&this.onRequestAnnotationUpdateArray(i)}}catch(s){console.log("Error | Changing attribute: "+s.stack)}},changeStrokeThickness:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.WebViewer&&e){var o=new R.a.List,i=new DOMParser;if(e.forEach((function(e){var r=void 0,s=new XMLSerializer,l=void 0;if("x-scale"===e.get("type")||"y-scale"===e.get("type")){var c=(r=i.parseFromString(e.get("xdf"),"text/xml")).querySelector("annots").children[0];c.setAttribute("width",t),c.removeAttribute("strokeSize"),l=s.serializeToString(r),e.set("xdf",l),o=n.setScaleStyleValues(o,a,e,l)}else{n.typeInheritanceMap.get(e.get("type")).setLineSize(t),(r=i.parseFromString(e.get("xfdf"),"text/xml")).querySelector("annots").children[0].setAttribute("width",t),l=s.serializeToString(r),a?(e=e.set("xfdf",l),o=o.push(e)):o=o.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:l}))}})),a)return o;o.size>0&&this.onRequestAnnotationUpdateArray(o)}},changePointSize:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var a=new R.a.List,o=new DOMParser,i=new XMLSerializer;if(this.typeInheritanceMap.get("Point").setPointSize(t),e.forEach((function(e){var r=o.parseFromString(e.get("xfdf"),"text/xml"),s=Object(u.get)(r.querySelector("annots"),"children");d.a.forEach(s,(function(e){e.setAttribute("pointSize",t)}));var l=i.serializeToString(r);n?(e=e.set("xfdf",l),a=a.push(e)):a=a.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:l}))})),n)return a;a.size>0&&this.onRequestAnnotationUpdateArray(a)}},changeIconType:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var a=new R.a.List,o=new DOMParser,i=new XMLSerializer;if(this.typeInheritanceMap.get("Point").setIconType(t),e.forEach((function(e){var r=o.parseFromString(e.get("xfdf"),"text/xml"),s=Object(u.get)(r.querySelector("annots"),"children");d.a.forEach(s,(function(e){e.setAttribute("iconType",t)}));var l=i.serializeToString(r);n?(e=e.set("xfdf",l),a=a.push(e)):a=a.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:l}))})),n)return a;a.size>0&&this.onRequestAnnotationUpdateArray(a)}},switchRotationControlEnabled:function(e,t){if(e){var n=new R.a.List,a=new DOMParser,o=new XMLSerializer;e.forEach((function(e){switch(e.get("type")){case"Polygon":case"Line":case"Polyline":case"Free hand":var i=a.parseFromString(e.get("xfdf"),"text/xml"),r=Object(u.get)(i.querySelector("annots"),"children");d.a.forEach(r,(function(a){if(a.getAttribute("rotationControlEnabled")!==t.toString()){a.setAttribute("rotationControlEnabled",t);var r=o.serializeToString(i);n=n.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:r}))}}))}})),n.size>0&&this.onRequestAnnotationUpdateArray(n)}},changeRotation:function(e,t){if(e){var n=new R.a.List,a=new DOMParser,o=new XMLSerializer;this.typeInheritanceMap.get("Point").setRotation(t),e.forEach((function(e){if("group"!==e.get("type")){var i=a.parseFromString(e.get("xfdf"),"text/xml"),r=Object(u.get)(i.querySelector("annots"),"children");e.rotation=t,e.set("rotation",t),d.a.forEach(r,(function(e){e.setAttribute("rotation",t)}));var s=o.serializeToString(i);n=n.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:s}))}})),n.size>0&&this.onRequestAnnotationUpdateArray(n)}},changeGeometraOpacity:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var i=new R.a.List,r=new DOMParser,s=new XMLSerializer;if(e.forEach((function(e){if("group"!=e.get("type")){var l="xfdf",c=void 0;"x-scale"===e.get("type")||"y-scale"===e.get("type")?(c=r.parseFromString(e.get("xdf"),"text/xml"),l="xdf"):(c=r.parseFromString(e.get("xfdf"),"text/xml"),n.typeInheritanceMap.get(n.getTypeConversion(e.get("type"))).setGeometraOpacity(t));var p=Object(u.get)(c.querySelector("annots"),"children");d.a.forEach(p,(function(n){"Polyline"===e.get("type")&&n.removeAttribute("geometraBorderOpacity"),n.setAttribute("geometraOpacity",t)}));var g=s.serializeToString(c);a?(e=e.set(l,g),i=i.push(e)):i="xdf"===l?n.setScaleStyleValues(i,a,e,g):i.push(R.a.fromJS(Object(o.a)({type:e.get("type"),annotationId:e.get("annotationId")},l,g)))}})),a)return i;i.size>0&&this.onRequestAnnotationUpdateArray(i)}},changeGeometraBorderOpacity:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var o=new R.a.List,i=new DOMParser,r=new XMLSerializer;if(e.forEach((function(e){if("group"!=e.get("type")){n.typeInheritanceMap.get(n.getTypeConversion(e.get("type"))).setGeometraBorderOpacity(t);var s=i.parseFromString(e.get("xfdf"),"text/xml"),l=Object(u.get)(s.querySelector("annots"),"children");d.a.forEach(l,(function(e){e.setAttribute("geometraBorderOpacity",t)}));var c=r.serializeToString(s);a?(e=e.set("xfdf",c),o=o.push(e)):o=o.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:c}))}})),a)return o;o.size>0&&this.onRequestAnnotationUpdateArray(o)}},changeTextContents:function(e,t){if(e){var n=new R.a.List,a=new DOMParser,o=new XMLSerializer;e.forEach((function(e){var i=a.parseFromString(e.get("xfdf"),"text/xml");i.getElementsByTagName("contents")[0]&&i.getElementsByTagName("contents")[0].childNodes[0]&&(i.getElementsByTagName("contents")[0].childNodes[0].nodeValue=t||" ");var r=o.serializeToString(i);n=n.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:r}))})),n.size>0&&this.onRequestAnnotationUpdateArray(n)}},changeTextStyle:function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(e){var o=new R.a.List,i=new DOMParser,r=new XMLSerializer;if(e.forEach((function(e){var s=i.parseFromString(e.get("xfdf"),"text/xml");s.querySelector("annots").firstElementChild.setAttribute(t,n);var l=s.querySelector("defaultstyle").textContent,c=A(l);null!==n?c[t]=n:delete c[t];var u=E(c);s.querySelector("defaultstyle").textContent=u;var d=r.serializeToString(s);a?(e=e.set("xfdf",d),o=o.push(e)):o=o.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:d}))})),a)return o;o.size>0&&this.onRequestAnnotationUpdateArray(o)}},setRichTextStyle:function(e,t){var n=arguments,a=this;return Object(c.a)(l.a.mark((function o(){var i,s;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(i=n.length>2&&void 0!==n[2]&&n[2],!e){o.next=10;break}return s=new R.a.List,o.next=5,z(e.toJS(),function(){var e=Object(c.a)(l.a.mark((function e(n){var o,i;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(o=a.WebViewer.annotManager.getAnnotationById(n.annotationId))){e.next=8;break}return o.setRichTextStyle({0:t}),e.next=5,a.WebViewer.annotManager.exportAnnotations({annotList:[o]});case 5:i=e.sent,n.xfdf=i,s=s.push(R.a.fromJS(Object(r.a)({},n)));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 5:if(!i){o.next=9;break}return o.abrupt("return",s);case 9:s.size>0&&a.changeColor2(s.toJS(),t.color);case 10:case"end":return o.stop()}}),o)})))()},changeStrokeColor:function(e,t){var n=arguments,a=this;return Object(c.a)(l.a.mark((function o(){var i,s;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(i=n.length>2&&void 0!==n[2]&&n[2],!e){o.next=10;break}return s=new R.a.List,o.next=5,z(e.toJS(),function(){var e=Object(c.a)(l.a.mark((function e(n){var o,i,c,u,d,p;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(o=a.WebViewer.annotManager.getAnnotationById(n.annotationId))){e.next=16;break}return i=Object(m.a)(t),o.StrokeColor.R=i.r,o.StrokeColor.G=i.g,o.StrokeColor.B=i.b,e.next=8,a.WebViewer.annotManager.exportAnnotations({annotList:[o]});case 8:c=e.sent,u=new DOMParser,d=new XMLSerializer,p=u.parseFromString(c,"text/xml"),p.querySelector("annots").children[0].setAttribute("strokeColor",t),n.xfdf=d.serializeToString(p),s=s.push(R.a.fromJS(Object(r.a)({},n)));case 16:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 5:if(!i){o.next=9;break}return o.abrupt("return",s);case 9:s.size>0&&a.onRequestAnnotationUpdateArray(s);case 10:case"end":return o.stop()}}),o)})))()},setBold:function(e,t){var n=this;return Object(c.a)(l.a.mark((function a(){return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:e&&n.setRichTextStyle(e,{"font-weight":t?"bold":"normal"});case 1:case"end":return a.stop()}}),a)})))()},setItalic:function(e,t){var n=this;return Object(c.a)(l.a.mark((function a(){return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:e&&n.setRichTextStyle(e,{"font-style":t?"italic":"normal"});case 1:case"end":return a.stop()}}),a)})))()},changeFontSize:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e){var a=new R.a.List,o=new DOMParser,i=new XMLSerializer;if(e.forEach((function(e){var r=o.parseFromString(e.get("xfdf"),"text/xml");r.querySelector("annots").firstElementChild.setAttribute("FontSize",t);var s=r.querySelector("defaultappearance").textContent,l=r.querySelector("defaultstyle").textContent,c=s.match(/[a-z]+\s+(\d+)/),u=l.match(/(\d+)(?:pt)/);if(c&&u){var d=s.replace(c[1],t),p=l.replace(u[1],t);r.querySelector("defaultappearance").textContent=d,r.querySelector("defaultstyle").textContent=p;var g=i.serializeToString(r);n?(e=e.set("xfdf",g),a=a.push(e)):a=a.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:g}))}})),n)return a;a.size>0&&this.onRequestAnnotationUpdateArray(a)}},changeFormula:function(e,t,n,a){var o=this;if(e){var i=new R.a.List,r=new DOMParser,s=new XMLSerializer;e.filter((function(e){return"3DModel"!==e.get("type")})).forEach((function(e){var a=r.parseFromString(e.get("xfdf"),"text/xml"),l=!1,c=a.querySelector("annots").firstElementChild;switch(o.getTypeConversion(e.get("type"))){case"Polygon":case"Reduction":case"Ellipse":case"Free hand":n.includes("NA")&&(l=!0,c.setAttribute("formulaNA",t)),n.includes("NL")&&(l=!0,c.setAttribute("formulaNL",t)),n.includes("NVO")&&(l=!0,c.setAttribute("formulaNVO",t)),n.includes("NV")&&(l=!0,c.setAttribute("formulaNV",t));break;case"Polyline":n.includes("NL")&&(l=!0,c.setAttribute("formulaNL",t)),n.includes("NV")&&(l=!0,c.setAttribute("formulaNV",t))}if(l){var u=s.serializeToString(a);i=i.push(R.a.fromJS({type:e.get("type"),annotationId:e.get("annotationId"),xfdf:u}))}})),i.size>0&&this.onRequestAnnotationUpdateArray(i)}},deleteScale:function(e){var t=this.WebViewer.docViewer.getAnnotationManager();if(e){this.annotationManagerSelectionLock=!0;var n=t.getAnnotationById(e.get("annotationId"));if(n)try{t.deleteAnnotation(n,!0,!0)}catch(a){console.log("Exception deleting from annotation manager: "+a),console.log("Caught by Geometra and seems to be legitimate.")}this.updateDeSelectAnnotationToStore(e.get("annotationId"),e.get("id")),this.annotationManagerSelectionLock=!1}},updateScale:function(e){var t=arguments,n=this;return Object(c.a)(l.a.mark((function a(){var o,i,r,s,c,u,d;return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(o=t.length>1&&void 0!==t[1]&&t[1],a.prev=1,n.annotationManagerSelectionLock=!0,i=n.WebViewer.annotManager,!e||e.getIn(["geoFile","id"])!==n.ActiveFileId){a.next=22;break}return r=!1,(s=i.getAnnotationById(e.get("annotationId")))&&(r=i.isAnnotationSelected(s),i.deleteAnnotation(s,!0,!0)),a.next=10,i.importAnnotations(e.get("xdf"));case 10:return c=a.sent,(u=c[0]).StrokeColor.A=.85,u.Opacity=u.geometraOpacity,"x-scale"===e.get("type")&&(u.Subject="x-scale"),u.length=e.get("length"),i.deleteAnnotation(u,!0,!0),o&&(u.converted=!0),i.addAnnotation(u,!0),r?((d=i.getSelectedAnnotations()).push(u),i.selectAnnotations(d)):i.redrawAnnotation(u),a.next=22,i.exportAnnotCommand();case 22:a.next=26;break;case 24:a.prev=24,a.t0=a.catch(1);case 26:n.annotationManagerSelectionLock=!1;case 27:case"end":return a.stop()}}),a,null,[[1,24]])})))()},deselectDeletedAnnotation:function(e){e&&(this.updateDeSelectAnnotationToStore(e.get("annotationId"),e.get("id")),"group"===e.get("type")&&this.ActiveParentId===e.get("id")&&(this.activeAnnotation=void 0,this.onSetActiveParentId(void 0,!0)))},initPdfAnnotationAsDeselected:function(e){if(e)switch(e.Opacity=1,e.Subject){case"Point":case"Polygon":case"Ellipse":case"annotation.freeHand":case"Free Hand":case"Free hand":case"Reduction":e.FillColor&&(e.turnOffFill?e.FillColor.A=0:e.FillColor.A=e.geometraOpacity),e.StrokeColor&&(e.StrokeColor.A=e.geometraBorderOpacity),"Point"===e.Subject&&e.iconType&&"none"!==e.iconType&&this.WebViewer.annotManager.redrawAnnotation(e);break;case"Polyline":case"Arrow":e.StrokeColor.A=e.geometraBorderOpacity;break;case"Free text":case"Free Text":e.TextColor.A=e.geometraOpacity,e.Opacity=e.geometraOpacity;break;case"Stamp":e.Opacity=e.geometraOpacity}},initPdfAnnotationAsSelected:function(e){if(e)switch(e.Opacity=1,e.Subject){case"Point":case"Polygon":case"Ellipse":case"annotation.freeHand":case"Free Hand":case"Free hand":case"Reduction":e.FillColor&&(e.turnOffFill?e.FillColor.A=0:e.FillColor.A=.8),"Point"===e.Subject&&e.iconType&&"none"!==e.iconType&&this.WebViewer.annotManager.redrawAnnotation(e);break;case"Polyline":case"Arrow":e.StrokeColor.A=.8;break;case"Free text":case"Free Text":e.TextColor.A=.8,e.Opacity=.8;break;case"Stamp":e.Opacity=.8}},loadAnnotations:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i,r,s,c,u,d,p,g,h,m,f;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,a=t.WebViewer.annotManager,o=e,n.next=5,a.exportAnnotCommand();case 5:for(i=new S.a,r=0;r<o.size;r++)"group"!==(s=o.get(r)).get("type")&&t.ActiveFileId==s.getIn(["geoFile","id"])&&i.addAddedCommand(s.get("xfdf"));for(c=t.reductions,u=0;u<c.size;u++)"group"!==(d=c.get(u)).get("type")&&t.ActiveFileId==d.getIn(["geoFile","id"])&&i.addAddedCommand(d.get("xfdf"));for(p=t.displayValueAnnotations,g=0;g<p.size;g++)"group"!==(h=p.get(g)).get("type")&&t.ActiveFileId==h.getIn(["geoFile","id"])&&i.addAddedCommand(h.get("xfdf"));return n.prev=11,n.next=14,t.WebViewer.annotManager.importAnnotCommand(i.getAnnotCommand());case 14:for(m=n.sent,f=0;f<m.length;f++)"Stamp"!==m[f].Subject&&t.initPdfAnnotationAsDeselected(m[f]);n.next=21;break;case 18:n.prev=18,n.t0=n.catch(11),console.log("error "+n.t0);case 21:return n.next=23,a.exportAnnotCommand();case 23:n.next=28;break;case 25:n.prev=25,n.t1=n.catch(0),console.log("err oloading annots: ",n.t1.stack);case 28:case"end":return n.stop()}}),n,null,[[0,25],[11,18]])})))()},loadScales:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i,r,s,c,u,d;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=t.WebViewer.annotManager,n.next=3,a.exportAnnotCommand();case 3:o=e,i=0;case 5:if(!(i<o.size)){n.next=31;break}if("x-scale"!==(r=o.get(i)).get("type")||r.getIn(["geoFile","id"])!=t.ActiveFileId){n.next=19;break}return n.next=10,a.importAnnotations(r.get("xdf"));case 10:s=n.sent,(c=s[0]).length=r.get("length"),c.Subject="x-scale",c.StrokeColor.A=.85,a.deleteAnnotation(c,!0,!0),a.addAnnotation(c,!0),n.next=28;break;case 19:if("y-scale"!==r.get("type")||r.getIn(["geoFile","id"])!=t.ActiveFileId){n.next=28;break}return n.next=22,a.importAnnotations(r.get("xdf"));case 22:u=n.sent,(d=u[0]).length=r.get("length"),d.StrokeColor.A=.85,a.deleteAnnotation(d,!0,!0),a.addAnnotation(d,!0);case 28:i++,n.next=5;break;case 31:return n.next=33,a.exportAnnotCommand();case 33:case"end":return n.stop()}}),n)})))()},setToolMode:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.WebViewer&&(t&&!this.isHotkeyLongPress&&(this.previousToolMode=this.currentToolMode,this.isHotkeyLongPress=!0),this.currentToolMode=e,this.WebViewer.setToolMode(e),this.deSelectAllAnnotationsFromGui())},backToPreviousToolMode:function(){this.isHotkeyLongPress=!1,this.currentToolMode=this.previousToolMode,this.WebViewer.setToolMode(this.previousToolMode)},startPrintJob:function(){var e=this;return Object(c.a)(l.a.mark((function t(){var n,a;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.WebViewer||!e.WebViewer.docViewer.getDocument()){t.next=12;break}return e.printLock=!0,n=e.WebViewer.docViewer.getAnnotationManager(),d.a.forEach(n.getAnnotationsList(),(function(e){e.Printable=!1})),t.next=6,e.webviewerInit.getPrintHelper().getDisplayValuesAnnotations(n);case 6:a=t.sent,n.addAnnotations(a,!0),e.WebViewer.print(),n.deleteAnnotations(a,!0,!0),d.a.forEach(n.getSelectedAnnotations(),(function(t){e.initPdfAnnotationAsSelected(t)})),e.printLock=!1;case 12:case"end":return t.stop()}}),t)})))()},getMoveFolderTree:function(){var e=this.SelectedAnnotations,t=W.a.getCurrentlySelectedNodes(),n=[];if(!e.size&&!t.size)return new R.a.List;t.forEach((function(e){"group"===e.get("type")&&n.push(Number.parseInt(e.get("id"),10))})),e.forEach((function(e){"group"===e.get("type")&&n.push(Number.parseInt(e.get("id"),10))}));var a=this.getAllFolders(),o=function e(t){var o=new R.a.List;return a=a.filter((function(e){return!n.includes(e.get("parentId"))&&!n.includes(e.get("id"))&&(e.get("parentId")!=t||(o=o.push(e.set("title",e.get("name")).set("key",""+e.get("id"))),!1))})),o=o.map((function(t){var n=e(t.get("id"));if(n.size){var a=t;return a=a.set("children",n)}return t}))}(null),i=R.a.fromJS({title:">",key:"root"});i=i.set("children",o);var r=new R.a.List;return r=r.push(i)},saveDocumentToPdf:function(){var e=this;return Object(c.a)(l.a.mark((function t(){var n,a,o,i,r,s,u,p,g,h,m;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.WebViewer){t.next=36;break}if(n=new DOMParser,a=e.WebViewer.docViewer.getDocument()){t.next=5;break}return t.abrupt("return");case 5:return e.printLock=!0,o=e.WebViewer.docViewer.getAnnotationManager(),t.next=9,d.a.forEach(o.getSelectedAnnotations(),function(){var e=Object(c.a)(l.a.mark((function e(t){var a,i,r,s,c,u,d,p,g;return l.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.Printable=!0,"Stamp"!==t.Subject){e.next=19;break}return e.next=4,o.exportAnnotations({annotList:[t]});case 4:a=e.sent,i=n.parseFromString(a,"text/xml"),r=i.querySelector("annots").firstElementChild,s=r.getAttribute("style"),c=r.getAttribute("maintainAspectRatio"),u=r.getAttribute("rotationControlEnabled"),d=r.getAttribute("geometraOpacity"),p=r.getAttribute("geometraBorderOpacity"),g=r.getAttribute("status"),t.setCustomData("style",s),t.setCustomData("maintainAspectRatio",c),t.setCustomData("rotationControlEnabled",u),t.setCustomData("geometraOpacity",d),t.setCustomData("geometraBorderOpacity",p),t.setCustomData("status",g);case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 9:return t.prev=9,t.next=12,e.webviewerInit.getPrintHelper().getDisplayValuesAnnotations(o);case 12:return i=(i=t.sent).concat(o.getSelectedAnnotations()),t.next=16,o.exportAnnotations({annotList:i});case 16:return r=t.sent,s={xfdfString:r},t.next=20,a.getFileData(s);case 20:u=t.sent,p=new Blob([u],{type:"application/pdf"}),(g=document.createElement("a")).href=window.URL.createObjectURL(p),h="",(m=C.a.getFileById(e.ActiveFileId))&&(h=m.name),g.download=h,g.click(),d.a.forEach(o.getSelectedAnnotations(),(function(t){e.initPdfAnnotationAsSelected(t)})),t.next=35;break;case 32:t.prev=32,t.t0=t.catch(9),console.log("error: ",t.t0.stack);case 35:e.printLock=!1;case 36:case"end":return t.stop()}}),t,null,[[9,32]])})))()},rotatePDF:function(){if(this.WebViewer){this.WebViewer.docViewer.rotateClockwise(this.WebViewer.docViewer.getCurrentPage());var e=C.a.getFileById(this.ActiveFileId);if(e){var t=e.rotation;t||(t=new R.a.Map),t.has("0")&&(t=t.delete("0")),t=t.set(""+this.WebViewer.docViewer.getCurrentPage(),this.WebViewer.docViewer.getRotation(this.WebViewer.docViewer.getCurrentPage()))}}},rotateLeftPDF:function(){if(this.WebViewer){this.WebViewer.docViewer.rotateCounterClockwise(this.WebViewer.docViewer.getCurrentPage());var e=C.a.getFileById(this.ActiveFileId);if(e){var t=e.rotation;t||(t=new R.a.Map),t.has("0")&&(t=t.delete("0")),t=t.set(""+this.WebViewer.docViewer.getCurrentPage(),this.WebViewer.docViewer.getRotation(this.WebViewer.docViewer.getCurrentPage()))}}},setFitToScreen:function(){this.WebViewer&&(this.fitModeButtonPressed=!0,this.WebViewer.setFitMode(this.WebViewer.FitMode.FitPage))},zoomInPDF:function(){this.WebViewer&&this.WebViewer.setZoomLevel(1.25*this.WebViewer.getZoomLevel())},zoomOutPDF:function(){this.WebViewer&&this.WebViewer.setZoomLevel(.8*this.WebViewer.getZoomLevel())},handleEscapeButtonInCalculate:function(){this.webviewerInit&&this.webviewerInit.isDrawing()?this.webviewerInit.setIsDrawing(!1):"AnnotationEdit"===this.currentToolMode?this.clearTreeSelection():this.setToolMode("AnnotationEdit")},undoDrawing:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.WebViewer&&(t||e.ctrlKey)&&this.WebViewer.docViewer.getToolMode().annotation)switch(this.WebViewer.docViewer.getToolMode().name){case this.WebViewer.Tools.ToolNames.POLYGON:case this.WebViewer.Tools.ToolNames.POLYLINE:case"AnnotationCreateReduction":var n=this.WebViewer.docViewer.getToolMode().annotation;n.getPath().length>2&&(n.popPath(),this.WebViewer.annotManager.redrawAnnotation(n));break;default:console.log("did not undo")}},jumpToAnnotation:function(e,t){var n=this;return Object(c.a)(l.a.mark((function a(){var o,i,r,s,c,u,d,p;return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!n.WebViewer){a.next=8;break}return a.next=3,n.WebViewer.docViewer.getAnnotationsLoadedPromise();case 3:o=n.WebViewer.annotManager,(i=n.getAnnotationByAnnotationId(e))||(i=n.getScaleByAnnotationId(e)),i||(i=n.getDisplayValueAnnotationByAnnotationId(e)),i&&i.hasIn(["geoFile","id"])&&(i.getIn(["geoFile","id"])===n.ActiveFileId?(r=o.getAnnotationById(i.get("annotationId")))&&n.WebViewer.docViewer.getDocument()&&(s=Math.max(r.Width,r.Height),c=Math.min(window.innerHeight,window.innerWidth),u=Number.parseFloat(c)/Number.parseFloat(s),u*=.5,n.WebViewer.setZoomLevel(u),n.annotationManagerSelectionLock=!0,o.jumpToAnnotation(r),t?(n.annotationManagerSelectionLock=!1,o.selectAnnotation(r),n.onFocusNameField()):(n.onFocusNameField(),n.annotationManagerSelectionLock=!1)):(n.jumpAnnotId=e,n.onSetActiveFileId(i.getIn(["geoFile","id"])),n.onSetActivePageId(1),d="",(p=C.a.getFileById(n.ActiveFileId))&&(d=p.name),n.pageCount=void 0,n.documentLoaded=!1,n.WebViewer.loadDocument(n.bucketURL+i.getIn(["geoFile","id"]),{documentId:i.getIn(["geoFile","id"]),filename:d})));case 8:case"end":return a.stop()}}),a)})))()},jumpToFile:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=C.a.getFileById(t.ActiveFileId),"ifc"!==e.type&&"ifc"!==a.type){n.next=5;break}window.location.replace("/projects/".concat(U.a.getActiveProjectId(),"/calculate/").concat(e.id)),n.next=9;break;case 5:if(!t.WebViewer){n.next=9;break}return n.next=8,t.WebViewer.docViewer.getAnnotationsLoadedPromise();case 8:e.id!==t.ActiveFileId&&(t.onSetActiveFileId(e.id),t.onSetActivePageId(1),o="",(i=C.a.getFileById(t.ActiveFileId))&&(o=i.name),t.pageCount=void 0,t.documentLoaded=!1,t.WebViewer.loadDocument(t.bucketURL+e.id,{documentId:e.id,filename:o}));case 9:case"end":return n.stop()}}),n)})))()},exchangeSelectedIfSelected:function(e){try{this.SelectedAnnotations=this.SelectedAnnotations.map((function(t){return t.get("id")===e.get("id")&&t.get("type")===e.get("type")?t.set("storeAnnotation",e):t})),W.a.updateSelection(e)}catch(t){console.log("Error | exchangeSelectedIfSelected: "+t)}},updateSelectedAnnotationsToStore:function(e,t,n,a){a&&-1===this.SelectedAnnotations.findIndex((function(n){return n.get("annotationId")?n.get("annotationId")===e:!!n.get("id")&&n.get("id")==t}))&&(this.SelectedAnnotations=this.SelectedAnnotations.push(new R.a.Map({id:t,annotationId:e,type:n,storeAnnotation:a})),this.increaseAnnotationTypeMapSelection(n))},updateDeSelectAnnotationToStore:function(e,t){var n=void 0,a=this.SelectedAnnotations.findIndex((function(a){return a.get("id")==t&&a.get("annotationId")==e&&(n=a.get("type"),!0)}));a>-1&&(this.SelectedAnnotations=this.SelectedAnnotations.splice(a,1),this.decreaseAnnotationTypeMapSelection(n))},selectAnnotationFromGui:function(e){this.annotationManagerSelectionLock=!0,this.allAnnotationsSelected=!1;var t=e,n=e.get("annotationId"),a=e.get("id");if(n&&t.getIn(["geoFile","id"])===this.ActiveFileId){if(this.WebViewer){var o=this.WebViewer.annotManager;if(0===this.SelectedAnnotations.size)switch(t.get("type")){case"Reduction":case"CenterValue":case"PeripheralValue":var i=this.getAnnotationByAnnotationId(t.get("parentId"));this.activeAnnotation=i,i&&this.onSetActiveParentId(i.get("parentId"),!0);break;case"x-scale":case"y-scale":this.onSetActiveParentId(void 0,!0),this.activeAnnotation=void 0;break;default:this.activeAnnotation=t,this.onSetActiveParentId(t.get("parentId"),!0)}var r=o.getAnnotationById(n);if("x-scale"!==t.get("type")&&"y-scale"!==t.get("type")){this.setAnnotationSelected(r,t);var s=!1;if("Reduction"===t.get("type")&&"Reduction"!==this.getCurrentSelectionType()&&(s=!0),s)this.calulateSumAndDerivedType();else{var l=this.calculateValuesForAnnotation(t);if(l.get("annotationData"))if(this.annotationTypeMap.get("nrSelected")<<0===1)this.calculatedSum=l.get("annotationData");else if(this.annotationTypeMap.get("nrSelected")<<0>1){var c=new R.a.List;this.calculatedSum||(this.calculatedSum=new R.a.Map),c=c.push(this.calculatedSum.delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S")).push(l.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S")),this.calculatedSum=this.minfiedSummation(c),this.calculatedSum=this.calculatedSum.set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",this.annotationTypeMap.get("nrSelected"))}}}else this.updateSelectedAnnotationsToStore(t.get("annotationId"),a,t.get("type"),t);this.type=this.getCurrentSelectionType();for(var u=this.calculateDisplayAnnot(),d=u.next();!d.done;)d=u.next();v.a.calculateValues(),o.selectAnnotation(o.getAnnotationById(n))}else this.updateSelectedAnnotationsToStore(t.get("annotationId"),a,t.get("type"),t);if(this.WebViewer&&"AnnotationCreateReduction"===this.currentToolMode){var p=this.WebViewer.annotManager,g=p.getSelectedAnnotations();I.a.setSelectState(),this.setToolMode(this.WebViewer.Tools.ToolNames.EDIT),p.selectAnnotations(g)}}else if(this.WebViewer){if(0===this.SelectedAnnotations.size)switch(t.get("type")){case"group":this.onSetActiveParentId(t.get("id"),!0),this.activeAnnotation=t;break;case"x-scale":case"y-scale":this.onSetActiveParentId(void 0,!0),this.activeAnnotation=void 0;break;case"Reduction":case"CenterValue":case"PeripheralValue":var h=this.getAnnotationByAnnotationId(t.get("parentId"));h&&(this.onSetActiveParentId(h.get("parentId"),!0),this.activeAnnotation=h);break;default:this.onSetActiveParentId(t.get("parentId"),!0),this.activeAnnotation=t}if(this.updateSelectedAnnotationsToStore(t.get("annotationId"),a,t.get("type"),t),"x-scale"!=t.get("type")&&"y-scale"!=t.get("type")){var m=this.calculateValuesForAnnotation(t);if(m.get("annotationData"))if(this.annotationTypeMap.get("nrSelected")<<0===1)this.calculatedSum=m.get("annotationData").set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",this.annotationTypeMap.get("nrSelected"));else if(this.annotationTypeMap.get("nrSelected")<<0>1){var f=new R.a.List;this.calculatedSum||(this.calculatedSum=new R.a.Map),f=f.push(this.calculatedSum.delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S")).push(m.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S")),this.calculatedSum=this.minfiedSummation(f),this.calculatedSum=this.calculatedSum.set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",this.annotationTypeMap.get("nrSelected"))}}this.type=this.getCurrentSelectionType();for(var A=this.calculateDisplayAnnot(),E=A.next();!E.done;)E=A.next();v.a.calculateValues()}this.annotationManagerSelectionLock=!1,this.trigger("annotationSelectedFromGui")},setAnnotationSelected:function(e,t){e&&"x-scale"!==e.Subject&&"y-scale"!==e.Subject&&this.initPdfAnnotationAsSelected(e),e&&t&&this.updateSelectedAnnotationsToStore(e.Id,t.get("id"),t.get("type"),t)},setAnnotationDeselected:function(e,t){e&&"x-scale"!==e.Subject&&"y-scale"!==e.Subject&&this.initPdfAnnotationAsDeselected(e),this.updateDeSelectAnnotationToStore(t.get("annotationId"),t.get("id"))},deSelectAnnotationFromGui:function(e){this.annotationManagerSelectionLock=!0;var t=e,n=e.get("type"),a=e.get("id"),o=e.get("annotationId");if(!t||o&&t.getIn(["geoFile","id"])===this.ActiveFileId){if(this.WebViewer){var i=this.WebViewer.annotManager;if(o){var r=i.getAnnotationById(o);if(this.annotationManagerSelectionLock=!0,this.setAnnotationDeselected(r,e),i.deselectAnnotation(r),"x-scale"!==n&&"y-scale"!==n){if(this.annotationTypeMap.get("nrSelected")<<0===0)this.calculatedSum=void 0,this.displayAnnot=void 0;else if(this.annotationTypeMap.get("nrSelected")<<0===1){var s=this.SelectedAnnotations.find((function(e){return"group"!==e.get("type")}));if(s){var l=this.calculateValuesForAnnotation(s.get("storeAnnotation"));if(l.get("annotationData")){this.calculatedSum=l.get("annotationData");for(var c=this.calculateDisplayAnnot(),u=c.next();!u.done;)u=c.next()}}}else{var d=this.calculateValuesForAnnotation(e);if(d.get("annotationData")){d=d.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S");var p=new R.a.List;p=p.push(this.calculatedSum).push(d),this.calculatedSum=this.minfiedRetraction(p),this.calculatedSum=this.calculatedSum.set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",this.annotationTypeMap.get("nrSelected"));for(var g=this.calculateDisplayAnnot(),h=g.next();!h.done;)h=g.next()}}v.a.calculateValues(),this.type=this.getCurrentSelectionType(),this.trigger("annotationDeSelectedFromGui"),this.annotationManagerSelectionLock=!1}else{if(this.annotationTypeMap.get("nrSelected")>1){for(var m=this.calculateDisplayAnnot(),f=m.next();!f.done;)f=m.next();this.type=this.getCurrentSelectionType()}else this.calculateValues();this.trigger("annotationDeSelectedFromGui")}}else this.updateDeSelectAnnotationToStore(o,a),this.trigger("annotationDeSelectedFromGui")}}else{if(this.updateDeSelectAnnotationToStore(o,a),this.annotationTypeMap.get("nrSelected")<<0===0)this.displayAnnot=void 0,this.calculatedSum=void 0;else if(this.annotationTypeMap.get("nrSelected")<<0===1){var A=this.SelectedAnnotations.find((function(e){return"group"!==e.get("type")}));if(A){var E=this.calculateValuesForAnnotation(A.get("storeAnnotation"));if(E.get("annotationData")){this.calculatedSum=E.get("annotationData"),this.calculatedSum=this.calculatedSum.set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",this.annotationTypeMap.get("nrSelected")<<0);for(var T=this.calculateDisplayAnnot(),S=T.next();!S.done;)S=T.next()}}}else{var b=this.calculateValuesForAnnotation(e);if(b.get("annotationData")){b=b.get("annotationData").delete("ESTIMATE.ANNOTATION_VALUES.LENGTHS").delete("ESTIMATE.ANNOTATION_VALUES.WALLS").delete("ESTIMATE.ANNOTATION_VALUES.REDUCTIONS").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X").delete("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_X").delete("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X").delete("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y").delete("ESTIMATE.ANNOTATION_VALUES.EDGES").delete("ESTIMATE.ANNOTATION_VALUES.SL").delete("ESTIMATE.ANNOTATION_VALUES.S");var y=new R.a.List;y=y.push(this.calculatedSum).push(b),this.calculatedSum=this.minfiedRetraction(y),this.calculatedSum=this.calculatedSum.set("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS",this.annotationTypeMap.get("nrSelected"));for(var N=this.calculateDisplayAnnot(),O=N.next();!O.done;)O=N.next()}}v.a.calculateValues(),this.type=this.getCurrentSelectionType(),this.trigger("annotationDeSelectedFromGui")}if(this.WebViewer&&"AnnotationCreateReduction"===this.currentToolMode){var w=this.WebViewer.annotManager,P=w.getSelectedAnnotations();I.a.setSelectState(),this.setToolMode(this.WebViewer.Tools.ToolNames.EDIT),w.selectAnnotations(P)}this.annotationManagerSelectionLock=!1},deSelectAllAnnotationsFromGui:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.WebViewer){this.annotationManagerSelectionLock=!0;var n=this.WebViewer.annotManager;try{n.getSelectedAnnotations().forEach((function(t){e.initPdfAnnotationAsDeselected(t)})),n.deselectAllAnnotations()}catch(a){console.log("Error | AnnotationManager: ",a.message)}this.resetAnnotationTypeMap(),this.annotationManagerSelectionLock=!1}this.SelectedAnnotations=this.SelectedAnnotations.clear(),t.length>0?"group"!==t[0].data.type&&this.selectAllAnnotationsFromGui(t,!1):(this.activeAnnotation=void 0,this.onSetActiveParentId(void 0)),this.calculateValues(),v.a.calculateValues(),this.trigger("annotationSelectedFromGui")},selectAllAnnotationsFromGui:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this;n.annotationManagerSelectionLock=!0,n.WebViewer&&("AnnotationCreateReduction"!==n.currentToolMode||this.getIsReductionCreated()||(I.a.setSelectState(),n.setToolMode(n.WebViewer.Tools.ToolNames.EDIT)));var a=[],o=void 0;for(o=0;o<e.length;o++){var i=e[o].data;if(0===n.SelectedAnnotations.size){var r=R.a.fromJS(i);switch(r.get("type")){case"group":n.onSetActiveParentId(r.get("id"),!0),n.activeAnnotation=r;break;case"x-scale":case"y-scale":n.onSetActiveParentId(void 0,!0),n.activeAnnotation=void 0;break;case"Reduction":case"CenterValue":case"PeripheralValue":var s=n.getAnnotationByAnnotationId(r.get("parentId"));s&&(n.onSetActiveParentId(s.get("parentId"),!0),n.activeAnnotation=s);break;case"Polygon":this.setActiveReductionParentId({Id:i.annotationId});break;default:n.onSetActiveParentId(r.get("parentId"),!0),n.activeAnnotation=r}}var l=i.annotationId,c=i.id,u=i.type;if("x-scale"===u||"y-scale"===u)if(n.WebViewer){var d=n.WebViewer.annotManager,p=d.getAnnotationById(l);p&&d.isAnnotationSelected(p)?d.deselectAnnotation(p):(a.push(p),n.updateSelectedAnnotationsToStore(l,c,u,R.a.fromJS(i)))}else n.updateDeSelectAnnotationToStore(l,c);else if(!l||i.geoFile&&i.geoFile.id!==n.ActiveFileId)"group"===i.type&&function(){var e=n.getAllAnnotationsFromParent(c),t=n.WebViewer&&n.WebViewer.annotManager;e.size>0&&e.forEach((function(e){if("group"!==e.get("type")){var o=t&&t.getAnnotationById(e.get("annotationId"));o?(a.push(o),n.setAnnotationSelected(o,e)):n.updateSelectedAnnotationsToStore(e.get("annotationId"),e.get("id"),e.get("type"),e),"Polygon"===e.get("type")&&n.getReductionByParentAnnotationId(e.get("annotationId")).forEach((function(e){if(o){var i=t.getAnnotationById(e.get("annotationId"));i&&(a.push(i),n.setAnnotationSelected(i,e))}else n.updateSelectedAnnotationsToStore(e.get("annotationId"),e.get("id"),e.get("type"),e)}))}}))}(),n.updateSelectedAnnotationsToStore(l,c,u,R.a.fromJS(i));else if(n.WebViewer){var g=n.WebViewer.annotManager;if(l){var h=g.getAnnotationById(l);a.push(h),n.setAnnotationSelected(h,R.a.fromJS(i))}}else n.updateSelectedAnnotationsToStore(l,c,u,R.a.fromJS(i))}if(n.WebViewer){var m=n.WebViewer.annotManager;m.selectAnnotations(a)}t&&(this.calculateValues(),this.trigger("annotationSelectedFromGui")),n.annotationManagerSelectionLock=!1},triggerSelectAllAnnotationsFromGUI:function(){this.triggerMultiSelectfromStoreProgressBarAll()},isSelected:function(e,t){return-1!==this.SelectedAnnotations.findIndex((function(n){return n.get("id")==t&&n.get("annotationId")==e}))},isFreeTextSelected:function(){var e=!1,t=this.WebViewer.annotManager;return d.a.forEach(t.getSelectedAnnotations(),(function(t){"Free text"===t.Subject&&(e=!0)})),e},isAllSelected:function(e){var t=this;return this.getAllAnnotationsFromParentIfParentElseIfCurrentElseRoot(void 0,e).every((function(e){return t.isSelected(e.get("annotationId"),e.get("id"))}))},getCopiedAnnotation:function(){return this.copiedAnnotationContainers},copyAnnotations:function(){var e=this;if(this.WebViewer)try{this.copiedAnnotationContainers=[],this.copiedScaleContainers=[];var t=this.WebViewer.annotManager,n=t.getSelectedAnnotations().filter((function(e){return"CenterValue"!==e.Subject&&"PeripheralValue"!==e.Subject}));d.a.forEach(n,(function(n){if("x-scale"===n.Subject||"y-scale"===n.Subject){var a=e.getScaleByAnnotationId(n.Id);if(a){var o=t.getAnnotationCopy(n);e.copiedScaleContainers.push({copiedScale:o,length:a.get("length"),type:a.get("type")})}}else{var i=n.av,r=n.Subject,s="Reduction"===r?e.getReductionByAnnotationId(i):e.getAnnotationByAnnotationId(i);if(!s)return;e.copiedAnnotationContainers.push({annotationId:i,type:r,id:s.get("id")})}}))}catch(a){console.log("Error | copyAnnots: "+a)}},prepareRedXfdfAnnotation:function(e,t,n){var a=this;return Object(c.a)(l.a.mark((function o(){var i,r,s;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return i=a.WebViewer.annotManager,o.next=3,i.exportAnnotations({annotList:[e.copiedAnnotation]});case 3:return r=o.sent,s={annotXfdf:r,type:e.copiedAnnotation.Subject,fileId:a.ActiveFileId,annotationId:e.copiedAnnotation.Id,copiedGeoAnnotationsRows:n,name:e.name,number:e.number,height:e.height,quantity:e.quantity,parentId:t},o.abrupt("return",s);case 6:case"end":return o.stop()}}),o)})))()},prepareAnnotation:function(e,t,n){var a=arguments,o=this;return Object(c.a)(l.a.mark((function i(){var r,s,c,u;return l.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return r=a.length>3&&void 0!==a[3]?a[3]:[],s=o.WebViewer.annotManager,i.next=4,s.exportAnnotations({annotList:[n]});case 4:return c=i.sent,u={annotXfdf:c,type:n.Subject,fileId:o.ActiveFileId,annotationId:n.Id,copiedGeoAnnotationsRows:r,name:e.name,number:e.number,height:e.height,quantity:e.quantity,parentId:t},i.abrupt("return",u);case 7:case"end":return i.stop()}}),i)})))()},copyScale:function(){var e=this;return Object(c.a)(l.a.mark((function t(){var n,a,o,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.WebViewer.annotManager,a=0;case 2:if(!(a<e.copiedScaleContainers.length)){t.next=13;break}return(o=e.copiedScaleContainers[a]).copiedScale.Id=e.generateUUID(),o.copiedScale.PageNumber=e.WebViewer.getCurrentPageNumber(),t.next=8,n.exportAnnotations({annotList:[o.copiedScale]});case 8:i=t.sent,e.onRequestScaleCreate(i,o.type,e.getActiveFileId(),o.copiedScale.PageNumber,o.length);case 10:a++,t.next=2;break;case 13:case"end":return t.stop()}}),t)})))()},pasteAnnotations:function(){var e=this;return Object(c.a)(l.a.mark((function t(){var n,a,o;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.copiedAnnotationContainers,e.WebViewer&&(e.copiedAnnotationContainers.length>0||e.copiedScaleContainers.length>0)){t.next=4;break}return t.abrupt("return");case 4:a=new Set,o=n.map((function(e){return e.id})),n.forEach((function(t){if(a.add(t.id),"Polygon"===t.type){var n=[],i=e.getReductionByParentAnnotationId(t.annotationId);if(0===i.size)return;var r=i.map((function(e){return e.get("id")})).toJS();r.forEach((function(e){o.includes(e)&&n.push(e)})),n.length>0?n.forEach((function(e){return a.add(e)})):r.forEach((function(e){return a.add(e)}))}})),e.copyScale(),a.size>50&&e.initDuplicateAnnotsModal(a.size,y.a.getUserId()),B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.DUPLICATE,ids:Object(i.a)(a),parentId:e.ActiveParentId?e.ActiveParentId.toString():e.ActiveParentId,fileId:e.getActiveFileId(),geoEstimateId:e.ActiveEstimate.get("id"),page:e.getActivePageId()-1});case 10:case"end":return t.stop()}}),t)})))()},duplicateAnnotations:function(){var e=this;return Object(c.a)(l.a.mark((function t(){return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.WebViewer){t.next=4;break}return e.copyAnnotations(),t.next=4,e.pasteAnnotations();case 4:case"end":return t.stop()}}),t)})))()},initDuplicateAnnotsModal:function(e,t){this.duplicateAnnotsModalInfo.duplicatingAnnots=!0,this.duplicateAnnotsModalInfo.annotsToDuplicate=e,this.duplicateAnnotsModalInfo.annotsDuplicated=0,this.duplicateAnnotsModalInfo.annotsDuplicatedList=[],this.duplicateAnnotsModalInfo.annotsRowsDuplicatedList=[],this.duplicateAnnotsModalInfo.userId=t,this.trigger("duplicatingAnnotsInfoChanged")},resetDuplicateAnnotsModalInfo:function(){this.duplicateAnnotsModalInfo.duplicatingAnnots=!1,this.duplicateAnnotsModalInfo.annotsToDuplicate=0,this.duplicateAnnotsModalInfo.annotsDuplicated=0,this.duplicateAnnotsModalInfo.annotsDuplicatedList=[],this.duplicateAnnotsModalInfo.annotsRowsDuplicatedList=[],this.duplicateAnnotsModalInfo.userId=null},annotationIsOnFileCurrentPage:function(e){return"3DModel"===e.get("type")&&this.getActiveFileId()===e.getIn(["geoFile","id"])||!!e.hasIn(["geoFile","id"])&&(this.getActiveFileId()===e.getIn(["geoFile","id"])&&this.getActivePageId()===e.get("pageNumber"))},loadFile:function(e){if(this.WebViewer){var t=C.a.getFileById(e);if(t){this.onSetActiveFileId(e),this.onSetActivePageId(1);var n=t.get("name");this.pageCount=void 0,this.documentLoaded=!1,this.WebViewer.loadDocument(this.bucketURL+e,{documentId:e,filename:n})}}},isAllSelectedNow:function(){return this.allAnnotationsSelected},getNrSelelctedAnnotaiotns:function(){return this.annotationTypeMap.get("nrSelected")},getActiveAnnotation:function(){return this.activeAnnotation},setActiveAnnotationsWithVisuals:function(e){this.activeAnnotationsWithVisuals=e},setActiveAnnotation:function(e){return this.activeAnnotation=e},getParentsForPdfAnnotationAnnotations:function(e){var t=new R.a.List;if(e&&"Reduction"!==e.get("type"))for(var n=this.getAnnotationById(e.get("parentId"));n;)t=t.push(n),n=this.getAnnotationById(n.get("parentId"));return t},getAnnotationTableFilter:function(){return this.treeFilter},getAnnotationsToDeleteByPdfTron:function(){return this.annotationsToDeleteByPdfTron},getAnnotations:function(){return this.Annotations},getDisplayValueAnnotations:function(){return this.displayValueAnnotations},getDisplayValueAnnotationByAnnotationId:function(e){return this.displayValueAnnotations.find((function(t){return t.get("annotationId")===e}))},getDisplayValueAnnotationsByParentAnnotationId:function(e){return this.displayValueAnnotations.filter((function(t){return t.get("parentId")===e}))},getDisplayValueAnnotationIdsForParent:function(e){var t=[];return this.displayValueAnnotations.forEach((function(n){n.get("parentId")===e&&t.push(n.get("id"))})),t},getTotalNrAnnotations:function(){var e=this.Annotations.size+this.reductions.size,t=this.getScaleForFileAndPage(this.ActiveFileId,this.ActivePageId);return t.get("x-scale")&&e++,t.get("y-scale")&&e++,e},getAnnotationById:function(e){return this.Annotations.find((function(t){return t.get("id")==e}))},getScaleForAnnotation:function(e){if(e){var t=this.xScaleList.find((function(t){return t.getIn(["geoFile","id"])===e.getIn(["geoFile","id"])&&t.get("page")===e.get("pageNumber")})),n=this.yScaleList.find((function(t){return t.getIn(["geoFile","id"])===e.getIn(["geoFile","id"])&&t.get("page")===e.get("pageNumber")}));return(new R.a.Map).set("x-scale",t).set("y-scale",n)}},getScaleByAnnotationId:function(e){var t=this.xScaleList.find((function(t){return t.get("annotationId")===e}));return t||this.yScaleList.find((function(t){return t.get("annotationId")===e}))},getScaleById:function(e){var t=this.xScaleList.find((function(t){return t.get("id")===e}));return t||this.yScaleList.find((function(t){return t.get("id")===e}))},getScalesForFile:function(e){var t=this.xScaleList.filter((function(t){return t.getIn(["geoFile","id"])==e})),n=this.yScaleList.filter((function(t){return t.getIn(["geoFile","id"])==e}));return t.concat(n)},getYscaleForFileAndPage:function(e){return this.yScaleList.find((function(t){return t.getIn(["geoFile","id"])==e.getIn(["geoFile","id"])&&t.get("page")==e.get("page")}))},getScaleForFileAndPage:function(e,t){var n=this.xScaleList.find((function(n){return n.getIn(["geoFile","id"])==e&&n.get("page")==t})),a=this.yScaleList.find((function(n){return n.getIn(["geoFile","id"])==e&&n.get("page")==t}));return(new R.a.Map).set("x-scale",n).set("y-scale",a)},getReductions:function(){return this.reductions},getReductionByAnnotationId:function(e){return this.reductions.find((function(t){return"Reduction"===t.get("type")&&t.get("annotationId")===e}))},getReductionById:function(e){return this.reductions.find((function(t){return"Reduction"===t.get("type")&&t.get("id")===e}))},getReductionByParentAnnotationId:function(e){return this.reductions.filter((function(t){return"Reduction"===t.get("type")&&t.get("parentId")===e}))},hasReductions:function(e){return this.reductions.filter((function(t){return"Reduction"===t.get("type")&&t.get("parentId")===e}))},getReductionAnnotationIdsForParentAnnotationId:function(e){var t=[];return this.reductions.forEach((function(n){"Reduction"===n.get("type")&&n.get("parentId")===e&&t.push(n.get("annotationId"))})),t},getRedcuctionIdsForParent:function(e){var t=[];return this.reductions.forEach((function(n){"Reduction"===n.get("type")&&n.get("parentId")===e&&t.push(n.get("id"))})),t},getProjectIdFromEstimateId:function(){return this.ActiveEstimate.getIn(["geoProject","id"])},getAnnotationByAnnotationId:function(e){return this.Annotations.find((function(t){return t.get("annotationId")===e}))},getAllAnnotationsFromParentIfParentElseIfCurrentElseRoot:function(e,t){var n=this;return e?this.Annotations.filter((function(a){return"PageAndFile"===t?e===a.get("parentId")&&("group"===a.get("type")||n.annotationIsOnFileCurrentPage(a)):e===a.get("parentId")})):this.ActiveParentId?this.Annotations.filter((function(e){return"PageAndFile"===t?n.ActiveParentId==e.get("parentId")&&("group"===e.get("type")||n.annotationIsOnFileCurrentPage(e)):n.ActiveParentId==e.get("parentId")})):this.Annotations.filter((function(e){return"PageAndFile"===t?(!e.has("parentId")||!e.get("parentId"))&&("group"===e.get("type")||n.annotationIsOnFileCurrentPage(e)):!e.has("parentId")||!e.get("parentId")}))},getAnnotaionsInFolderFirstLevel:function(e){var t=this,n=new R.a.List;return this.Annotations.forEach((function(a){a.get("parentId")==e&&(n=n.push(a),"Polygon"===a.get("type")&&t.getReductionByParentAnnotationId(a.get("annotationId")).forEach((function(e){n=n.push(e)})))})),n},getAllAnnotationsFromParent:function(e){var t=this,n=M.a.getAppSearch(),a=this.Annotations.filter((function(a){return"PageAndFile"===t.getAnnotationTableFilter()?"group"===a.get("type")?e==a.get("parentId"):!("group"!==a.get("type")&&n&&(!a.get("name")||a.get("name")&&-1==a.get("name").toLowerCase().indexOf(n.toLowerCase())))&&(e==a.get("parentId")&&t.annotationIsOnFileCurrentPage(a)):!("group"!==a.get("type")&&n&&(!a.get("name")||a.get("name")&&-1==a.get("name").toLowerCase().indexOf(n.toLowerCase())))&&e==a.get("parentId")}));return a.forEach((function(e){"group"===e.get("type")&&(a=a.concat(t.getAllAnnotationsFromParent(e.get("id"))))})),a},getAllAnnotationsFromParentForDeletion:function(e){var t=this,n=this.Annotations.filter((function(t){return e==t.get("parentId")}));return n.forEach((function(e){"group"===e.get("type")&&(n=n.concat(t.getAllAnnotationsFromParentForDeletion(e.get("id"))))})),n},getAllFolders:function(){var e=this;return this.Annotations.filter((function(t){return"group"===t.get("type")&&t.getIn(["geoEstimate","id"])===e.ActiveEstimate.get("id")}))},getPathForAnnotation:function(e){var t=this.getAnnotationById(e);return t&&t.get("parentId")?"".concat(this.getPathForAnnotation(t.get("parentId"))," > ").concat(t.get("name")):t?t.get("name"):""},getTypeTranslation:function(e){switch(e){case"annotation.freeHand":case"FreeHand":case"Free Hand":case"Free hand":return q.a.t("Draw");case"Polygon":return q.a.t("Area");case"Ellipse":return q.a.t("Circle");case"Reduction":return q.a.t("Reduction");case"Polyline":return q.a.t("Line");case"Point":return q.a.t("Point");case"Free Text":case"Free text":return q.a.t("Comment");case"Stamp":return q.a.t("Image");case"group":return q.a.t("Folder");case"x-scale":return q.a.t("X-scale");case"y-scale":return q.a.t("Y-scale");default:console.log("did not handle type: "+e)}},getAllFolderPaths:function(){var e=this;return this.Annotations.filter((function(t){return"group"===t.get("type")&&t.getIn(["geoEstimate","id"])===e.ActiveEstimate.get("id")})).map((function(t){return e.getPathForAnnotation(t.get("id"))}))},getSortedFolderPaths:function(e){var t=new R.a.List,n=new R.a.Map,a=new R.a.Map,o=void 0;o=e?new R.a.List:this.SelectedAnnotations.filter((function(e){return"group"===e.get("type")})),a=a.set("id",void 0),n=(n=(n=n.set("title",">")).set("folder",a)).set("key","root"),t=t.push(n);var i=this.getAllFolders(),r=function e(t,n){var a=i.filter((function(e){return e.get("parentId")==t&&!o.find((function(t){return t.get("id")===e.get("id")}))})).sort((function(e,t){return e.get("number")<t.get("number")?-1:e.get("number")>t.get("number")?1:e.get("name")<t.get("name")?-1:e.get("name")>t.get("name")?1:0})),r=new R.a.List;return a.forEach((function(t){var a=new R.a.Map,o=n+" ("+t.get("number")+") "+t.get("name");a=(a=(a=a.set("title",o)).set("folder",t)).set("key",""+t.get("id")),r=(r=r.push(a)).concat(e(t.get("id"),o+" >"))})),r}(void 0,n.get("title"));return t=t.concat(r)},getActiveFileId:function(){return this.ActiveFileId?this.ActiveFileId:-1},getActivePageId:function(){return this.ActivePageId?this.ActivePageId:-1},getActiveParentId:function(){return this.ActiveParentId?this.ActiveParentId:-1},getActiveLayerId:function(){return this.ActiveLayerId?this.ActiveLayerId:-1},getActiveEstimate:function(){return this.ActiveEstimate?this.ActiveEstimate:-1},getDefaultHeight:function(){return this.DefaultHeight?this.DefaultHeight:-1},getSelectedAnnotationIds:function(){return this.SelectedAnnotations},getSelectedAnnotations:function(){return this.SelectedAnnotations},getAllFolderChildresToDelete:function(e,t){var n=this.Annotations.filter((function(t){return t.get("parentId")==e})),a=this;(function e(t,n,o){t.forEach((function(t){if(n.push(t),"Polygon"===t.get("type")){var r=a.getReductionByParentAnnotationId(t.get("annotationId"));r.size>0&&n.push.apply(n,Object(i.a)(r))}"group"===t.get("type")&&e(o.filter((function(e){return e.get("parentId")==t.get("id")})),n,o)}))}).apply(this,[n,t,this.Annotations])},onFocusNameField:function(){this.trigger("focusNameField")},onSetActiveFileId:function(e){this.ActiveFileId=e,this.trigger("fileChanged")},onSetActivePageId:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.ActivePageId=e,t&&this.WebViewer&&this.WebViewer.docViewer.setCurrentPage(e),this.updatePageRotationState(),this.trigger("pageChanged")},onSetActiveParentId:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.ActiveParentId=e,t&&(this.lastActiveParentId=e)},onSetActiveLayerId:function(e){this.ActiveLayerId=e,this.trigger("layerChanged")},setActiveReductionParentId:function(e){this.ActiveReductionParentId=e?e.Id:void 0},getWebViewerFileInformation:function(){return R.a.fromJS({activePage:this.ActivePageId,pageCount:this.pageCount})},setAnnotationTableFilter:function(e){this.treeFilter=e?"PageAndFile":"all"},onRestoreAnnotations:function(){var e=this;return Object(c.a)(l.a.mark((function t(){var n,a,o,i;return l.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.WebViewer){t.next=16;break}return n=e.WebViewer.annotManager,a=new S.a,t.next=5,n.exportAnnotCommand();case 5:return e.annotationsToDeleteByPdfTron.forEach((function(e){a.addAddedCommand(e.get("xfdf"))})),o=a.getAnnotCommand(),t.next=9,n.importAnnotCommand(o);case 9:return i=t.sent,d.a.forEach(i,(function(t){e.initPdfAnnotationAsSelected(t)})),e.annotationManagerSelectionLock=!0,n.selectAnnotations(i),e.annotationManagerSelectionLock=!1,t.next=16,n.exportAnnotCommand();case 16:case"end":return t.stop()}}),t)})))()},onRequestChangeFlags:function(e,t,n){var a=this;e.forEach((function(e){var o=null;if(o="Reduction"===e.get("type")?a.getReductionByAnnotationId(e.get("annotationId")):e.get("annotationId")?a.getAnnotationByAnnotationId(e.get("annotationId")):a.getAnnotationById(e.get("id"))){var r=new XMLSerializer,s=(new DOMParser).parseFromString(o.get("xfdf"),"text/xml"),l=s.querySelector("ink"),c=l.getAttribute("flags").split(",");n?(c=[].concat(Object(i.a)(c),Object(i.a)(t)),c=Object(i.a)(new Set(c))):c=c.filter((function(e){return t.indexOf(e)<0}));var u=c.join(",");l.setAttribute("flags",u);var d=r.serializeToString(s);o=o.set("xfdf",d),a.onRequestAnnotationUpdateArray((new R.a.List).push(o))}}))},selectAll:function(){var e=this;console.time("ctrl a select");var t=null,n=null;this.WebViewer&&(t=this.WebViewer.annotManager,n=t.getAnnotationsList()),this.annotationManagerSelectionLock=!0;var a=[],o=[],i=[],r=W.a.getTreeFilter();this.Annotations.forEach((function(s){var l=s.toJS(),c=l.annotationId,u=l.id,d=l.type;if((!r||e.annotationIsOnFileCurrentPage(s)||"group"===d)&&(o.push(s),i.push(u),e.updateSelectedAnnotationsToStore(c,u,d,s),t&&n.length>0)){var p=n.find((function(e){return e.av===c}));p&&(a.push(p),e.initPdfAnnotationAsSelected(p))}})),this.onSetActiveParentId(void 0,!0),W.a.selectAnnotationsFromList(R.a.fromJS(o),R.a.fromJS(i),!0),this.WebViewer&&a.length>0&&t.selectAnnotations(a),this.calculateValues(),this.trigger("annotationSelectedFromGui"),this.annotationManagerSelectionLock=!1,console.timeEnd("ctrl a select")},getAllKeysAndNodes:function(e){var t=[];return{keys:function e(n){return n.reduce((function(n,a){return n.push(a.key),t.push(a),a.children&&n.push.apply(n,Object(i.a)(e(a.children))),n}),[])}(e),nodes:t}},expandAll:function(){var e=this.getAllKeys(W.a.buildTree().get("treeData").toJS());W.a.setTreeExpansion(e)},getAllKeys:function(e){var t=this;return e.reduce((function(e,n){return e.push(n.key),n.children&&e.push.apply(e,Object(i.a)(t.getAllKeys(n.children))),e}),[])},onRequestAnnotationUpdateArray:function(e,t,n){var i=this,s={update_array:[]};e.forEach((function(e){var a=e.get("type"),r=e.get("annotationId");if("x-scale"!==a&&"y-scale"!==a){var l=void 0;if(l="CenterValue"===a||"PeripheralValue"===a?i.getDisplayValueAnnotationByAnnotationId(r):"Reduction"===a?i.getReductionByAnnotationId(r):r?i.getAnnotationByAnnotationId(r):i.getAnnotationById(e.get("id"))){var c=!1;if(t&&n!==e.get(t)){e=e.set(t,n),c=!0;var d=i.typeInheritanceMap.get(i.getTypeConversion(a));if(d)switch(t){case"name":d.setName(n);break;case"number":d.setNumber(n),i.updateAnnotationNumberByProjectId(i.getTypeConversion(a),n);break;case"height":d.setHeight(n)}}if(!t||t&&c){var p=l.merge(e).toJS();if(p.height=JSON.stringify(p.height),delete p.interiorColor,delete p["interior-color"],delete p.pageNumber,delete p.strokeSize,p.annotationData&&delete p.annotationData,p.strokeColor&&delete p.strokeColor,p.displayValueList&&delete p.displayValueList,p.xfdf&&"3DModel"!==p.type){var g,h=new DOMParser,m=new XMLSerializer,f=h.parseFromString(p.xfdf,"text/xml"),A=f.querySelector("annots").children[0];A.setAttribute("annotationName",p.name),A.setAttribute("annotationNumber",p.number),A.setAttribute("annotationHeight",p.height),"Point"===p.type&&A.setAttribute("geometraBorderOpacity","0"),0===p.geometraBorderOpacity&&!A.getAttribute("color")&&p.color&&A.setAttribute("color",p.color);var E=(g={},Object(o.a)(g,"interiorColor",A.getAttribute("interior-color")),Object(o.a)(g,"geometraOpacity",A.getAttribute("geometraOpacity")),Object(o.a)(g,"color",A.getAttribute("color")),Object(o.a)(g,"geometraBorderOpacity",A.getAttribute("geometraBorderOpacity")),Object(o.a)(g,"style",A.getAttribute("style")),Object(o.a)(g,"width",A.getAttribute("width")),Object(o.a)(g,"fontSize",A.getAttribute("FontSize")),Object(o.a)(g,"decoration",i.parseRichTextStyleFromXfdf(p.xfdf)),Object(o.a)(g,"strokeColor",A.getAttribute("strokeColor")),Object(o.a)(g,"geometraLineStart",A.getAttribute("geometraLineStart")),Object(o.a)(g,"geometraLineEnd",A.getAttribute("geometraLineEnd")),Object(o.a)(g,"pointSize",A.getAttribute("pointSize")),Object(o.a)(g,"iconType",A.getAttribute("iconType")),g),T={areaTilesX:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"),areaTilesY:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"),areaJointX:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"),areaJointY:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"),areaJointDepth:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"),wallTilesX:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"),wallTilesY:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"),wallJointX:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"),wallJointY:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"),wallJointDepth:A.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")},S={name:p.name,height:p.height,maintainAspectRatio:A.getAttribute("maintainAspectRatio")};i.changeAnnotationInheritance({type:a,styles:E,properties:S,tiles:T}),p.xfdf=m.serializeToString(f)}delete p.color,p.textContents&&delete p.textContents,Object(u.isNil)(p.fontSize)||delete p.fontSize,(p.geometraOpacity||0===p.geometraOpacity)&&delete p.geometraOpacity,(p.geometraBorderOpacity||0===p.geometraBorderOpacity)&&delete p.geometraBorderOpacity,p.hasOwnProperty("geometraLineEnd")&&delete p.geometraLineEnd,Object(u.isNil)(p.maintainAspectRatio)||delete p.maintainAspectRatio,p.hasOwnProperty("geometraLineStart")&&delete p.geometraLineStart,(p.geometraFlip||null===p.geometraFlip||""===p.geometraFlip)&&delete p.geometraFlip,p.pattern&&delete p.pattern,p.iconType&&delete p.iconType,p.hasOwnProperty("labels")&&delete p.labels,delete p["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"],delete p["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH"],delete p.rotation,delete p.formulaNA,delete p.formulaNL,delete p.formulaNVO,delete p.formulaNV,delete p.status,delete p.pointSize,delete p.layerId,delete p.geoEstimateId,delete p.fileId,delete p.indexPosition,p.geoFile&&delete p.geoFile.nodeStatus,s.update_array.push(p)}}}}));var l=Object(u.map)(s.update_array,(function(e){var t=e.geoEstimate,n=e.geoFile,o=Object(a.a)(e,["geoEstimate","geoFile"]),i=Object(r.a)({geoEstimateId:t.id},o);return"group"===e.type?i:Object(r.a)(Object(r.a)({},i),{},{fileId:n.id})}));(null===l||void 0===l?void 0:l.length)>0&&B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.UPDATE,annotations:l})},onRequestAnnotationDelete:function(e){var t=this,n={action:"delete_annotations",ids:e.filter((function(e){return"scale"!==e.get("type")})).map((function(e){var n=e.get("displayValueList")&&e.get("displayValueList").size?t.getDisplayValueAnnotationIdsForParent(e.get("annotationId")):[];return[e.get("id")].concat(Object(i.a)(n))})).toJS().flat(),projectId:this.getProjectIdFromEstimateId(),estimateId:this.ActiveEstimate.toJS().id};ne.i.sendMessage(n)},onDeleteAnnotations:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i,r,s,c,u;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(a=e.ids,W.a.clearSelectedAnnotations(),t.onSetActiveParentId(void 0,!0),t.deSelectAllAnnotationsFromGui(),o=new R.a.List,i=new R.a.List,r=new R.a.List,s=new R.a.List,c=[],t.getAnnotations().forEach((function(e){a.every((function(t){return t!==e.get("id")}))?o=o.push(e):t.shouldReloadAnnotation(e)&&c.push(e.get("annotationId"))})),t.getReductions().forEach((function(e){a.every((function(t){return t!==e.get("id")}))?i=i.push(e):t.shouldReloadAnnotation(e)&&c.push(e.get("annotationId"))})),t.getDisplayValueAnnotations().forEach((function(e){a.every((function(t){return t!==e.get("id")}))?r=r.push(e):(N.a.getInstance().removeDisplayAnnotations(e.get("parentId"),e),t.shouldReloadAnnotation(e)&&c.push(e.get("annotationId")))})),v.a.getAllRows().forEach((function(e){a.every((function(t){return t!==e.getIn(["geoAnnotation","id"])}))&&(s=s.push(e))})),t.setAnnotations(o),t.setReductions(i),t.setDisplayValueAnnotations(r),v.a.setRows(s),!t.WebViewer||!t.documentLoaded){n.next=25;break}return u=t.WebViewer.annotManager,n.next=21,u.exportAnnotCommand();case 21:return n.next=23,t.reloadAnnotations(c);case 23:return n.next=25,u.exportAnnotCommand();case 25:t.calculateValues(),t.trigger("AnnotationDeleted");case 27:case"end":return n.stop()}}),n)})))()},onRequestValuesCreate:function(e){var t=this,n=new DOMParser,a=new XMLSerializer,o=Object(u.map)(e,(function(e){var o=t.getTypeConversion(e.type),i=e.annotXfdf,r=n.parseFromString(i,"text/xml");r.querySelector("annots").children[0].setAttribute("rotation",String(90*t.getPageRotation()));var s=a.serializeToString(r);return{annotationId:e.annotationId,geoEstimateId:t.ActiveEstimate.get("id"),fileId:e.fileId,layerId:null,parentId:e.parentId,name:o,type:o,xfdf:s,indexPosition:null}}));B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.CREATE,annotations:o})},onRequestAnnotationCreate:function(e){var t=this;try{e.forEach((function(e){var n=e.get("annotXfdf"),a=t.getTypeConversion(e.get("type")),o=e.get("fileId"),i=e.get("annotationId"),r=e.get("parentId"),s=void 0,l=void 0,c=void 0,u=void 0,d=void 0,p=void 0,g=void 0,h=void 0,m=void 0,f=void 0,A=void 0,E=void 0,T=void 0,S=void 0,b=void 0;if("Reduction"===a){if(!t.ActiveReductionParentId)return;r=t.ActiveReductionParentId}else r||(r=t.lastActiveParentId);switch(a){case"Circle":case"Ellipse":c=t.ellipseValueInheritance.getName(),s=t.ellipseValueInheritance.getHeight(),l=t.ellipseValueInheritance.getNumber(),u=t.ellipseValueInheritance.getColor(),d=t.ellipseValueInheritance.getInteriorColor(),p=t.ellipseValueInheritance.getGeometraOpacity(),g=t.ellipseValueInheritance.getGeometraBorderOpacity(),h=t.ellipseValueInheritance.getWidth(),m=t.ellipseValueInheritance.getStyle(),S=t.ellipseValueInheritance.getMaintainAspectRatio(),b=t.ellipseValueInheritance.getTiles();var I=(new DOMParser).parseFromString(n,"text/xml"),y=I.querySelector("annots").children[0];y.setAttribute("color",u),y.setAttribute("interior-color",d),y.setAttribute("annotationName",c),y.setAttribute("annotationNumber",l),y.setAttribute("annotationHeight",s),y.setAttribute("geometraOpacity",p),y.setAttribute("geometraBorderOpacity",g),y.setAttribute("status","notStarted"),y.setAttribute("maintainAspectRatio",S),y.setAttribute("readOnly",!1),y.setAttribute("width",h),y.setAttribute("style",m),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",b.areaTilesX),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",b.areaTilesY),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",b.areaJointX),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",b.areaJointY),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",b.areaJointDepth),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",b.wallTilesX),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",b.wallTilesY),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",b.wallJointX),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",b.wallJointY),y.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",b.wallJointDepth),t.ellipseValueInheritance.getShowValueState(y,a),n=(new XMLSerializer).serializeToString(I);break;case"Polygon":c=t.polygonValueInheritance.getName(),s=t.polygonValueInheritance.getHeight(),l=t.polygonValueInheritance.getNumber(),u=t.polygonValueInheritance.getColor(),d=t.polygonValueInheritance.getInteriorColor(),p=t.polygonValueInheritance.getGeometraOpacity(),g=t.polygonValueInheritance.getGeometraBorderOpacity(),h=t.polygonValueInheritance.getWidth(),m=t.polygonValueInheritance.getStyle(),b=t.polygonValueInheritance.getTiles();var v,N=(new DOMParser).parseFromString(n,"text/xml");try{v=N.querySelector("annots").children[0]}catch(Y){console.log("polygon create error "+Y)}v.setAttribute("color",u),v.setAttribute("interior-color",d),v.setAttribute("annotationName",c),v.setAttribute("annotationNumber",l),v.setAttribute("annotationHeight",s),v.setAttribute("geometraOpacity",p),v.setAttribute("geometraBorderOpacity",g),v.setAttribute("status","notStarted"),v.setAttribute("readOnly",!1),v.setAttribute("width",h),v.setAttribute("style",m),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",b.areaTilesX),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",b.areaTilesY),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",b.areaJointX),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",b.areaJointY),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",b.areaJointDepth),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",b.wallTilesX),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",b.wallTilesY),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",b.wallJointX),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",b.wallJointY),v.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",b.wallJointDepth),t.polygonValueInheritance.getShowValueState(v,a),n=(new XMLSerializer).serializeToString(N),t.setActiveReductionParentId({Id:i});break;case"Reduction":c=t.reductionValueInheritance.getName(),s=t.reductionValueInheritance.getHeight(),l=t.reductionValueInheritance.getNumber(),u=t.reductionValueInheritance.getColor(),d=t.reductionValueInheritance.getInteriorColor(),p=t.reductionValueInheritance.getGeometraOpacity(),g=t.reductionValueInheritance.getGeometraBorderOpacity(),h=t.reductionValueInheritance.getWidth(),m=t.reductionValueInheritance.getStyle(),b=t.reductionValueInheritance.getTiles();var O=(new DOMParser).parseFromString(n,"text/xml"),w=O.querySelector("annots").children[0];w.setAttribute("color",u),w.setAttribute("interior-color",d),w.setAttribute("annotationName",c),w.setAttribute("annotationNumber",l),w.setAttribute("annotationHeight",s),w.setAttribute("geometraOpacity",p),w.setAttribute("geometraBorderOpacity",g),w.setAttribute("status","notStarted"),w.setAttribute("readOnly",!1),w.setAttribute("width",h),w.setAttribute("style",m),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",b.areaTilesX),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",b.areaTilesY),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",b.areaJointX),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",b.areaJointY),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",b.areaJointDepth),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",b.wallTilesX),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",b.wallTilesY),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",b.wallJointX),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",b.wallJointY),w.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",b.wallJointDepth),t.reductionValueInheritance.getShowValueState(w,a),n=(new XMLSerializer).serializeToString(O);break;case"annotation.freeHand":case"Free Hand":case"Free hand":c=t.freehandValueInheritance.getName(),s=t.freehandValueInheritance.getHeight(),l=t.freehandValueInheritance.getNumber(),u=t.freehandValueInheritance.getColor(),d=t.freehandValueInheritance.getInteriorColor(),p=t.freehandValueInheritance.getGeometraOpacity(),g=t.freehandValueInheritance.getGeometraBorderOpacity(),h=t.freehandValueInheritance.getWidth(),m=t.freehandValueInheritance.getStyle(),S=t.freehandValueInheritance.getMaintainAspectRatio(),b=t.freehandValueInheritance.getTiles();var P=(new DOMParser).parseFromString(n,"text/xml"),R=P.querySelector("annots").children[0];R.setAttribute("color",u),R.setAttribute("interior-color",d),R.setAttribute("annotationName",c),R.setAttribute("annotationNumber",l),R.setAttribute("annotationHeight",s),R.setAttribute("geometraOpacity",p),R.setAttribute("geometraBorderOpacity",g),R.setAttribute("status","notStarted"),R.setAttribute("maintainAspectRatio",S),R.setAttribute("readOnly",!1),R.setAttribute("width",h),R.setAttribute("style",m),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",b.areaTilesX),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",b.areaTilesY),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",b.areaJointX),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",b.areaJointY),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",b.areaJointDepth),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",b.wallTilesX),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",b.wallTilesY),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",b.wallJointX),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",b.wallJointY),R.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",b.wallJointDepth),t.freehandValueInheritance.getShowValueState(R,a),n=(new XMLSerializer).serializeToString(P);break;case"Freetext":case"FreeText":case"Free Text":case"Free text":c=t.freeTextValueInheritance.getName(),l=t.freeTextValueInheritance.getNumber(),p=t.freeTextValueInheritance.getGeometraOpacity(),g=t.freeTextValueInheritance.getGeometraBorderOpacity(),h=t.freeTextValueInheritance.getWidth(),m=t.freeTextValueInheritance.getStyle(),f=t.freeTextValueInheritance.getStrokeColor(),T=t.freeTextValueInheritance.getFontSize(),t.freeTextValueInheritance.getDecoration(),d=t.freeTextValueInheritance.getInteriorColor();var L=(new DOMParser).parseFromString(n,"text/xml"),C=L.querySelector("annots").children[0];C.setAttribute("FontSize",T),C.setAttribute("geometraOpacity",p),C.setAttribute("geometraBorderOpacity",g),C.setAttribute("width",h),C.setAttribute("status","notStarted"),C.setAttribute("readOnly",!1),C.setAttribute("strokeColor",f),C.setAttribute("style",m),C.setAttribute("TextColor",d),n=(new XMLSerializer).serializeToString(L);break;case"Polyline":c=t.polylineValueInheritance.getName(),s=t.polylineValueInheritance.getHeight(),l=t.polylineValueInheritance.getNumber(),u=t.polylineValueInheritance.getColor(),d=t.polylineValueInheritance.getInteriorColor();var _=t.polylineValueInheritance.getWidth();p=t.polylineValueInheritance.getGeometraOpacity(),A=t.polylineValueInheritance.getGeometraLineStart(),E=t.polylineValueInheritance.getGeometraLineEnd(),m=t.polylineValueInheritance.getStyle(),b=t.polylineValueInheritance.getTiles();var M=(new DOMParser).parseFromString(n,"text/xml"),k=M.querySelector("annots").children[0];k.setAttribute("color",u),k.setAttribute("interior-color",d),k.setAttribute("width",_),k.setAttribute("annotationName",c),k.setAttribute("annotationNumber",l),k.setAttribute("annotationHeight",s),k.setAttribute("geometraOpacity",p),k.setAttribute("status","notStarted"),k.setAttribute("readOnly",!1),k.setAttribute("style",m),k.setAttribute("geometraLineStart",A),k.setAttribute("geometraLineEnd",E),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",b.areaTilesX),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",b.areaTilesY),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",b.areaJointX),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",b.areaJointY),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",b.areaJointDepth),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",b.wallTilesX),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",b.wallTilesY),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",b.wallJointX),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",b.wallJointY),k.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",b.wallJointDepth),k.removeAttribute("geometraBorderOpacity"),t.polylineValueInheritance.getShowValueState(k,a),n=(new XMLSerializer).serializeToString(M);break;case"Arrow":c=t.arrowValueInheritance.getName(),l=t.arrowValueInheritance.getNumber(),u=t.arrowValueInheritance.getColor(),d=t.arrowValueInheritance.getInteriorColor();var D=t.arrowValueInheritance.getLineSize();p=t.arrowValueInheritance.getGeometraOpacity(),m=t.arrowValueInheritance.getStyle(),h=t.arrowValueInheritance.getWidth();var x=(new DOMParser).parseFromString(n,"text/xml"),F=x.querySelector("annots").children[0];F.setAttribute("color",u),F.setAttribute("width",D),F.setAttribute("annotationName",c),F.setAttribute("annotationNumber",l),F.setAttribute("geometraOpacity",p),F.setAttribute("geometraBorderOpacity",p),F.setAttribute("status","notStarted"),F.setAttribute("readOnly",!1),F.setAttribute("style",m),F.setAttribute("width",h),t.arrowValueInheritance.getShowValueState(F,a),n=(new XMLSerializer).serializeToString(x);break;case"Point":c=t.pointValueInheritance.getName(),s=t.pointValueInheritance.getHeight(),l=t.pointValueInheritance.getNumber(),d=t.pointValueInheritance.getInteriorColor(),p=t.pointValueInheritance.getGeometraOpacity(),g=t.pointValueInheritance.getGeometraBorderOpacity();var j=t.pointValueInheritance.getPointSize(),V=t.pointValueInheritance.getIconType(),U=t.pointValueInheritance.getRotation(),W=(new DOMParser).parseFromString(n,"text/xml"),H=W.querySelector("annots").children[0];H.setAttribute("interior-color",d),H.setAttribute("pointSize",j),H.setAttribute("iconType",V),H.setAttribute("rotation",U),H.setAttribute("annotationName",c),H.setAttribute("annotationNumber",l),H.setAttribute("geometraOpacity",p),H.setAttribute("geometraBorderOpacity",g),H.setAttribute("status","notStarted"),H.setAttribute("readOnly",!1),t.pointValueInheritance.getShowValueState(H,a),n=(new XMLSerializer).serializeToString(W);break;case"Stamp":c=t.stampValueInheritance.getName(),l=t.stampValueInheritance.getNumber(),p=t.stampValueInheritance.getGeometraOpacity(),g=t.stampValueInheritance.getGeometraBorderOpacity(),u=t.stampValueInheritance.getColor(),m=t.stampValueInheritance.getStyle(),h=t.stampValueInheritance.getWidth();var J=(new DOMParser).parseFromString(n,"text/xml"),z=J.querySelector("annots").children[0];z.setAttribute("geometraOpacity",p),z.setAttribute("geometraBorderOpacity",g),z.setAttribute("status","notStarted"),z.setAttribute("maintainAspectRatio",!0),z.setAttribute("readOnly",!1),z.setAttribute("color",u),z.setAttribute("style",m),z.setAttribute("width",h),n=(new XMLSerializer).serializeToString(J);break;case"CenterValue":case"PeripheralValue":c=a;break;default:c=q.a.t("Unknown")}t.updateAnnotationNumberByProjectId(a,l);var G=-1===r||!r,X={annotationId:i,geoEstimateId:t.ActiveEstimate.get("id"),fileId:o,height:"number"===typeof s?JSON.stringify(s):s,layerId:null,parentId:G?null:r.toString(),name:c,number:l,quantity:1,type:a,xfdf:n,indexPosition:null};B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.CREATE,annotations:[X]})}))}catch(n){console.log("Error: "+n.stack)}},onRequestAnnotationUpdate:function(e){var t=this,n=e.annots,a=e.key,i=e.value;d.a.forEach(n,(function(e){var n=e.type,r=e.annotationId;if("x-scale"!==n&&"y-scale"!==n){var s=void 0;if(s="CenterValue"===n||"PeripheralValue"===n?t.getDisplayValueAnnotationByAnnotationId(r):"Reduction"===n?t.getReductionByAnnotationId(r):r?t.getAnnotationByAnnotationId(r):t.getAnnotationById(e.id)){var l=!1;if(a&&i!==e[a]){e[a]=i,l=!0;var c=t.typeInheritanceMap.get(t.getTypeConversion(n));if(c)switch(a){case"name":c.setName(i);break;case"number":c.setNumber(i),t.updateAnnotationNumberByProjectId(t.getTypeConversion(n),i);break;case"height":c.setHeight(i)}}if("3DModel"===n)return;if(!a||a&&l){var u=s.merge(R.a.fromJS(e)).toJS();if(u.xfdf){var d,p=(new DOMParser).parseFromString(u.xfdf,"text/xml").querySelector("annots").children[0];p.setAttribute("annotationName",u.name),p.setAttribute("annotationNumber",u.number),p.setAttribute("annotationHeight",u.height),"Point"===u.type&&p.setAttribute("geometraBorderOpacity","0"),0===u.geometraBorderOpacity&&!p.getAttribute("color")&&u.color&&p.setAttribute("color",u.color),"FontSize"===a&&p.setAttribute("fontSize",i),p.setAttribute(a,i);var g=(d={},Object(o.a)(d,"interiorColor",p.getAttribute("interior-color")),Object(o.a)(d,"geometraOpacity",p.getAttribute("geometraOpacity")),Object(o.a)(d,"color",p.getAttribute("color")),Object(o.a)(d,"geometraBorderOpacity",p.getAttribute("geometraBorderOpacity")),Object(o.a)(d,"style",p.getAttribute("style")),Object(o.a)(d,"width",p.getAttribute("width")),Object(o.a)(d,"fontSize",p.getAttribute("fontSize")),Object(o.a)(d,"decoration",t.parseRichTextStyleFromXfdf(u.xfdf)),Object(o.a)(d,"strokeColor",p.getAttribute("strokeColor")),Object(o.a)(d,"geometraLineStart",p.getAttribute("geometraLineStart")),Object(o.a)(d,"geometraLineEnd",p.getAttribute("geometraLineEnd")),Object(o.a)(d,"pointSize",p.getAttribute("pointSize")),Object(o.a)(d,"iconType",p.getAttribute("iconType")),Object(o.a)(d,"TextColor",p.getAttribute("TextColor")),d),h={areaTilesX:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"),areaTilesY:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"),areaJointX:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"),areaJointY:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"),areaJointDepth:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"),wallTilesX:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"),wallTilesY:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"),wallJointX:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"),wallJointY:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"),wallJointDepth:p.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")},m={name:u.name,height:u.height,maintainAspectRatio:p.getAttribute("maintainAspectRatio")};t.changeAnnotationInheritance({type:n,styles:g,properties:m,tiles:h})}}}}})),"readOnly"===a&&v.a.updateReadOnlyRows({annotationIds:d.a.map(n,(function(e){return e.id})),value:i}),B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.UPDATE,ids:d.a.map(n,(function(e){return e.id})),parameter:a,value:i})},onRequestNAorNVOAnnotationUpdate:function(e,t,n){var a=e.filter((function(e){return"3DModel"===e.type})),o=e.filter((function(e){return"3DModel"!==e.type}));if(a.length>0){var i="formulaNA"===t?"netArea":"netVolume";B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.UPDATE,ids:d.a.map(a,(function(e){return e.id})),parameter:i,value:n})}o.length>0&&B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.UPDATE,ids:d.a.map(o,(function(e){return e.id})),parameter:t,value:n})},onRequestScaleUpdate2:function(e){B.l.onSendMessage(te.f.GEO_SCALE,Object(r.a)({action:te.h.UPDATE},e))},onScaleUpdate:function(e){var t=this;try{var n=void 0,a=e.scale;if(a){if("x-scale"===a.type)if(a.convertedScale){var o=this.parseScales(R.a.fromJS([a])).first();this.yScaleList=this.yScaleList.filter((function(e){return e.get("id")!==e.id||(o=e.merge(o),!1)})),o.has("geoEstimate")&&o.has("geoFile")&&(this.xScaleList=this.xScaleList.push(o),this.exchangeSelectedIfSelected(o),this.WebViewer&&this.documentLoaded&&(this.updateScale(o,!0),this.WebViewer.annotManager.exportAnnotCommand()))}else this.xScaleList=this.xScaleList.map((function(e){if(e.get("id")===a.id){var o=t.parseScales(R.a.fromJS([a]));return n=e.merge(o.first()),t.exchangeSelectedIfSelected(n),t.WebViewer&&t.documentLoaded&&(t.updateScale(n),t.WebViewer.annotManager.exportAnnotCommand()),n}return e}));else"y-scale"===a.type&&(this.yScaleList=this.yScaleList.map((function(e){if(e.get("id")===a.id){var o=t.parseScales(R.a.fromJS([a]));return n=e.merge(o.first()),t.exchangeSelectedIfSelected(n),t.WebViewer&&t.documentLoaded&&(t.updateScale(n),t.WebViewer.annotManager.exportAnnotCommand()),n}return e})));this.calculateValues(),this.trigger("AnnotationUpdated")}}catch(i){console.log(i.stack)}},onGeoAnnotationMessageHandler:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i,r,s,c,p,g,h,m,f;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:a=e.payload,o=a.annotations,i=a.userId,r=e.action,n.t0=r,n.next=n.t0===te.a.CREATE?4:n.t0===te.a.UPDATE?6:n.t0===te.a.DUPLICATE?42:44;break;case 4:return Object(u.forEach)(o,(function(e){return t.onAnnotationCreateSwitch(e,i)})),n.abrupt("break",45);case 6:if(n.prev=6,s=new R.a.List,c=new S.a,d.a.forEach(e.payload.annotations,(function(e){"Reduction"===e.type?t.reductions=t.reductions.map((function(n){if(n.get("id")===e.id){var a=n.merge(R.a.fromJS(t.parseAnnotation(e)));return n.has("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&!e["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"]&&(a=(a=(a=(a=(a=a.delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")),t.exchangeSelectedIfSelected(a),t.activeAnnotation&&t.activeAnnotation.get("id")===a.get("id")&&(t.onSetActiveParentId(a.get("parentId")),t.activeAnnotation=a),s=s.push(a),a.getIn(["geoFile","id"])===t.getActiveFileId()&&c.addModifyCommand(a.get("xfdf")),a}return n})):"CenterValue"===e.type||"PeripheralValue"===e.type?t.displayValueAnnotations=t.displayValueAnnotations.map((function(n){if(n.get("id")===e.id){var a=n.merge(R.a.fromJS(t.parseAnnotation(e)));return t.exchangeSelectedIfSelected(a),N.a.getInstance().addDisplayAnnotations(a.get("parentId"),a),a.getIn(["geoFile","id"])===t.getActiveFileId()&&c.addModifyCommand(a.get("xfdf")),a}return n})):t.Annotations=t.Annotations.map((function(n){if(n.get("id")===e.id){var a=t.parseAnnotation(e),o=n.merge(R.a.fromJS(a));return n.has("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&!e["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"]&&(o=(o=(o=(o=(o=o.delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")),t.exchangeSelectedIfSelected(o),t.activeAnnotation&&t.activeAnnotation.get("id")===o.get("id")&&("group"===o.get("type")?t.onSetActiveParentId(o.get("id")):t.onSetActiveParentId(o.get("parentId")),t.activeAnnotation=o),s=s.push(o),o.getIn(["geoFile","id"])===t.getActiveFileId()&&"3DModel"!==o.get("type")&&c.addModifyCommand(o.get("xfdf")),o}return n}))})),!t.WebViewer||!t.documentLoaded){n.next=19;break}return p=c.getAnnotCommand(),n.next=14,t.WebViewer.annotManager.exportAnnotCommand();case 14:return n.next=16,t.WebViewer.annotManager.importAnnotCommand(p);case 16:(g=n.sent)&&(h=t.WebViewer.annotManager,d.a.forEach(g,(function(e){h.isAnnotationSelected(e)?t.initPdfAnnotationAsSelected(e):t.initPdfAnnotationAsDeselected(e)}))),t.WebViewer.annotManager.exportAnnotCommand();case 19:if(t.calculateValues(),t.trigger("AnnotationUpdated"),n.prev=21,!t.WebViewer||!t.documentLoaded){n.next=31;break}m=t.WebViewer.docViewer.getPageCount(),f=1;case 25:if(!(f<=m)){n.next=31;break}return n.next=28,t.WebViewer.annotManager.drawAnnotations(f);case 28:f++,n.next=25;break;case 31:n.next=36;break;case 33:n.prev=33,n.t1=n.catch(21),console.log("error 10 "+n.t1);case 36:n.next=41;break;case 38:n.prev=38,n.t2=n.catch(6),console.log("Error | actions.updateArray "+n.t2.stack);case 41:return n.abrupt("break",45);case 42:return t.onAnnotationsDuplicateHandler(e.payload),n.abrupt("break",45);case 44:return n.abrupt("return");case 45:case"end":return n.stop()}}),n,null,[[6,38],[21,33]])})))()},onAnnotationCreateSwitch:function(e,t){switch(e.type){case"3DModel":B.k.addCreatedIfcAnnotation(e,t);break;case"group":this.onCreateFolder(e,t);break;default:this.onAnnotationCreate(e,t)}},onAnnotationCreate:function(e,t){var n=this;return Object(c.a)(l.a.mark((function a(){var o,i,r,s,c,u,p,g,h;return l.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(o=e.fileId,i=e.geoEstimateId,r=e.id,i===n.ActiveEstimate.get("id")){a.next=3;break}return a.abrupt("return");case 3:if(s=n.getParsedAnnotation(e),c=new S.a,s.getIn(["geoFile","id"])===n.getActiveFileId()&&c.addAddedCommand(s.get("xfdf")),"Reduction"===s.get("type")?n.reductions=n.reductions.push(s):"CenterValue"===s.get("type")||"PeripheralValue"===s.get("type")?(n.displayValueAnnotations=n.displayValueAnnotations.push(s),N.a.getInstance().addDisplayAnnotations(s.get("parentId"),s)):n.Annotations=n.Annotations.push(s),n.getActiveFileId()!==o){a.next=33;break}if(!n.WebViewer||!n.documentLoaded){a.next=22;break}return p=c.getAnnotCommand(),n.WebViewer.annotManager.exportAnnotCommand(),a.prev=11,a.next=14,n.WebViewer.annotManager.importAnnotCommand(p);case 14:u=a.sent,a.next=20;break;case 17:a.prev=17,a.t0=a.catch(11),console.log("error 5"+a.t0.stack);case 20:n.WebViewer.annotManager.exportAnnotCommand(),u&&d.a.forEach(u,(function(e){n.initPdfAnnotationAsDeselected(e)}));case 22:if(t!==y.a.getUserId()){a.next=30;break}"Reduction"===s.get("type")&&n.setIsReductionCreated(!0),g={node:{data:s.toJS()},selectedNodes:[{data:s.toJS()}]},W.a.calculateTreeCheck([r],g),h="Reduction"===s.toJS().type,n.addedAnnotInfo={id:h?n.getAnnotationByAnnotationId(s.get("parentId")).get("id"):r,type:s.get("type")},a.next=33;break;case 30:if(!n.WebViewer||!n.documentLoaded){a.next=33;break}return a.next=33,n.WebViewer.annotManager.drawAnnotations(n.WebViewer.docViewer.getCurrentPage());case 33:n.calculateValues(),n.trigger("annotationsInserted");case 35:case"end":return a.stop()}}),a,null,[[11,17]])})))()},onScaleCreate:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var o,i,s,c,d,p,g,h,m,f,A;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(o=e.scale,i=e.userId,s=e.removedScaleNames,c=o.fileId,d=o.geoEstimateId,p=Object(a.a)(o,["fileId","geoEstimateId"]),g=Object(r.a)({geoFile:{id:c},geoEstimate:{id:d}},p),d===B.f.getActiveEstimate().id){n.next=5;break}return n.abrupt("return");case 5:if(h=t.parseScales(R.a.fromJS([g])),"x-scale"===(m=h.first()).get("type")?t.xScaleList=t.xScaleList.push(m):t.yScaleList=t.yScaleList.push(m),!t.WebViewer||!t.documentLoaded){n.next=23;break}return n.prev=9,f=t.WebViewer.annotManager,Object(u.forEach)(s,(function(e){var n=f.getAnnotationById(e);n&&(f.deleteAnnotation(n,!0,!0),t.xScaleList=t.xScaleList.filter((function(t){return t.get("annotationId")!==e})),t.yScaleList=t.yScaleList.filter((function(t){return t.get("annotationId")!==e})))})),n.next=14,t.insertScale(m);case 14:return A=n.sent,n.next=17,t.WebViewer.annotManager.exportAnnotCommand();case 17:i===y.a.getUserId()&&(t.WebViewer.annotManager.selectAnnotation(A),t.trigger("UserAddedScale")),n.next=23;break;case 20:n.prev=20,n.t0=n.catch(9),console.log("Error | Insert Scale: "+n.t0);case 23:t.calculateValues(),t.trigger("AnnotationAdded",g.id),t.trigger("scaleInserted");case 26:case"end":return n.stop()}}),n,null,[[9,20]])})))()},getScale:function(e){var t=e.fileId,n=e.estimateId,a=e.page,o=e.type;return o===X.e?Object(u.last)(Object(u.filter)(this.xScaleList.toJS(),(function(e){return e.page===a&&e.geoEstimate.id===n&&e.geoFile.id===t}))):o===X.f?Object(u.last)(Object(u.filter)(this.yScaleList.toJS(),(function(e){return e.page===a&&e.geoEstimate.id===n&&e.geoFile.id===t}))):void 0},insertScale:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.annotationManagerSelectionLock=!0,a=t.WebViewer.annotManager,!e||t.ActiveFileId!=e.getIn(["geoFile","id"])){n.next=15;break}return n.next=5,a.importAnnotations(e.get("xdf"));case 5:return o=n.sent,i=o[0],"x-scale"===e.get("type")&&(i.Subject="x-scale"),i.length=e.get("length"),n.next=11,a.redrawAnnotation(i);case 11:return n.next=13,a.exportAnnotCommand();case 13:return t.annotationManagerSelectionLock=!1,n.abrupt("return",i);case 15:t.annotationManagerSelectionLock=!1;case 16:case"end":return n.stop()}}),n)})))()},onScaleDelete:function(e){var t=this,n=e.ids;this.WebViewer&&this.documentLoaded&&n.forEach((function(e){t.deleteScale(t.getScaleById(e))})),this.xScaleList=this.xScaleList.filter((function(e){return!n.includes(e.get("id"))})),this.yScaleList=this.yScaleList.filter((function(e){return!n.includes(e.get("id"))})),this.calculateValues(),this.WebViewer&&this.documentLoaded&&this.WebViewer.annotManager.drawAnnotations(this.WebViewer.getCurrentPageNumber()),this.trigger("AnnotationDeleted")},onAnnotationsDuplicateHandler:function(e){var t,n,a=this,o=e.annotations,r=e.annotationRows,s=e.userId,l=e.length,c=e.totalLength;c&&l===c?this.onAnnotationsDuplicate(o,r,s):(this.duplicateAnnotsModalInfo.duplicatingAnnots=!0,this.duplicateAnnotsModalInfo.annotsToDuplicate=c,this.duplicateAnnotsModalInfo.annotsDuplicated+=l,(t=this.duplicateAnnotsModalInfo.annotsDuplicatedList).push.apply(t,Object(i.a)(o)),(n=this.duplicateAnnotsModalInfo.annotsRowsDuplicatedList).push.apply(n,Object(i.a)(r)),this.duplicateAnnotsModalInfo.userId=s,this.trigger("duplicatingAnnotsInfoChanged"),this.duplicateAnnotsModalInfo.annotsDuplicated===c&&setTimeout((function(){return a.onAnnotationsDuplicate(a.duplicateAnnotsModalInfo.annotsDuplicatedList,a.duplicateAnnotsModalInfo.annotsRowsDuplicatedList,s)}),300))},onAnnotationsDuplicate:function(e,t,n){var a=this;return Object(c.a)(l.a.mark((function o(){var i,s,c,u,p,g,h;return l.a.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(e[0].geoEstimateId===a.ActiveEstimate.get("id")){o.next=2;break}return o.abrupt("return");case 2:if(i=[],s=[],c=[],u=new S.a,d.a.forEach(e,(function(e){var t=e.fileId,n=e.id,o=a.getParsedAnnotation(e);switch(i.push(o.toJS()),s.push({data:o.toJS()}),c.push(n),a.getActiveFileId()===t&&u.addAddedCommand(o.get("xfdf")),o.get("type")){case"Reduction":a.reductions=a.reductions.push(o);break;case"CenterValue":case"PeripheralValue":a.displayValueAnnotations=a.displayValueAnnotations.push(o),N.a.getInstance().addDisplayAnnotations(o.get("parentId"),o);break;default:a.Annotations=a.Annotations.push(o)}})),p=new R.a.List(v.a.getAllRows()),d.a.forEach(t,(function(e){var t=e.annotationRow,n=e.geoAnnotationId,a=e.id,o=JSON.parse(t);p=p.push(R.a.fromJS({id:a,geoAnnotation:{id:n},annotationRow:Object(r.a)(Object(r.a)({},o),{},{amount:o.amount?v.a.convertToFloat(o.amount):0,pricePerUnit:o.pricePerUnit?v.a.convertToFloat(o.pricePerUnit):0})}))})),v.a.setRows(p),v.a.setNewAnnotationRows(t),!a.WebViewer||!a.documentLoaded){o.next=36;break}return h=u.getAnnotCommand(),a.WebViewer.annotManager.exportAnnotCommand(),o.prev=14,o.next=17,a.WebViewer.annotManager.importAnnotCommand(h);case 17:g=o.sent,o.next=23;break;case 20:o.prev=20,o.t0=o.catch(14),console.log("error 5"+o.t0.stack);case 23:if(a.WebViewer.annotManager.exportAnnotCommand(),g&&d.a.forEach(g,(function(e){a.initPdfAnnotationAsDeselected(e)})),n!==y.a.getUserId()){o.next=34;break}a.deSelectAllAnnotationsFromGui(),a.WebViewer.annotManager.selectAnnotations(g),a.clearSelectedParentFolders(),W.a.setCurrentlySelectedNodes=R.a.fromJS(i),W.a.calculateTreeSelect(c,{selectedNodes:s}),a.selectAllAnnotationsFromGui(s),o.next=36;break;case 34:return o.next=36,a.WebViewer.annotManager.drawAnnotations(a.WebViewer.docViewer.getCurrentPage());case 36:a.calculateValues(),a.trigger("annotationsInserted");case 38:case"end":return o.stop()}}),o,null,[[14,20]])})))()},onRequestAnnotationFolderCreate:function(e){var t=-1===this.ActiveParentId||!this.ActiveParentId,n={geoEstimateId:this.ActiveEstimate.get("id"),parentId:t?null:this.ActiveParentId.toString(),name:e,number:this.getFolderTagNumber(),type:"group"};B.l.onSendMessage(te.f.GEO_ANNOTATION,{action:te.a.CREATE,annotations:[n]})},onCreateFolder:function(e,t){var n=e.geoEstimateId,a=e.id,o=e.name,i=e.number,r=e.parentId,s=e.type;if(n===this.ActiveEstimate.get("id")){var l=R.a.fromJS(this.parseAnnotation({geoEstimate:this.ActiveEstimate,id:a,parentId:r,name:o,number:i,type:s}));if(this.Annotations=this.Annotations.push(l),t===y.a.getUserId()){var c={node:{data:l.toJS()},selectedNodes:[{data:l.toJS()}]};W.a.calculateTreeCheck([a],c),this.addedAnnotInfo={id:a,type:s}}this.calculateValues(),this.trigger("folderInserted")}},onRequestScaleDelete:function(e,t){var n=this,a=new R.a.List,o=[];if(e&&e.size>0){var i=e.map((function(e){return e.get("id")})).toJS();if(e.forEach((function(e){var t=void 0,r=e.get("displayValueList")&&e.get("displayValueList").size;o=o.concat(r?n.getDisplayValueAnnotationIdsForParent(e.get("annotationId")):[]),"x-scale"===e.get("type")&&(t=n.getYscaleForFileAndPage(e))&&!i.includes(t.get("id"))&&(a=a.push(t))})),o.length>0){var r={action:"delete_annotations",ids:o,projectId:this.getProjectIdFromEstimateId(),estimateId:this.ActiveEstimate.toJS().id};ne.i.sendMessage(r)}if(B.l.onSendMessage(te.f.GEO_SCALE,{action:te.h.DELETE,ids:i}),t)return;var s=new DOMParser,l=new XMLSerializer;a.forEach((function(e){var t=s.parseFromString(e.get("xdf"),"text/xml");t.querySelector("annots").children[0].setAttribute("subject","x-scale");var a=l.serializeToString(t);e=(e=e.set("xdf",a)).set("type","x-scale"),n.onRequestScaleUpdate(e,e.get("xdf"),!0)}))}},onRequestScaleUpdate:function(e,t){var n=this.getScaleByAnnotationId(e.get("annotationId")).merge(e).delete("color").delete("interior-color").delete("strokeSize").delete("width").delete("annotationId").delete("geoEstimate").delete("geoFile").delete("displayValueList").delete("geometraOpacity").delete("geometraLineStart").delete("geometraLineEnd");t&&(n=(n=n.set("xdf",t)).set("length",String(n.get("length")))),n&&B.l.onSendMessage(te.f.GEO_SCALE,{action:te.h.UPDATE,scale:n.toJS()})},onRequestScaleCreate:function(e,t,n,a,o){var i=this;e=this.changeXfdfAttribute(e,{geometraLineStart:"|<-",geometraLineEnd:"|<-",width:"1"});var s=[];if(("x-scale"===t?this.xScaleList:this.yScaleList).forEach((function(e){var t=e.get("displayValueList")&&e.get("displayValueList").size;s=s.concat(t?i.getDisplayValueAnnotationIdsForParent(e.get("annotationId")):[])})),s.length>0){var l={action:"delete_annotations",ids:s,projectId:this.getProjectIdFromEstimateId(),estimateId:this.ActiveEstimate.toJS().id};ne.i.sendMessage(l)}var c={geoEstimateId:this.ActiveEstimate.get("id"),fileId:n,page:a,xdf:e,type:t,length:String(o||0)};B.l.onSendMessage(te.f.GEO_SCALE,Object(r.a)({action:te.h.CREATE},c))},onDeleteReductionFeature:function(e){var t=void 0,n=this.getSelectedAnnotationIds().first();if(n&&this.getReductionByParentAnnotationId(n.get("annotationId")).sort((function(e,t){return e.get("id")<t.get("id")?-1:e.get("id")>t.get("id")?1:0})).forEach((function(n,a){return e<<0!==a<<0||(t=n,!1)})),t){var a=new R.a.List;this.onRequestAnnotationDelete(a.push(t))}},onMessageReceived:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i,r,s,c,u,g,h,m,f,A,E,T,b,I,v,O,w,P,L,C,_,M,k,D;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:n.t0=e.action,n.next=n.t0===p.a.importAnnotations||n.t0===p.a.insertArray?3:n.t0===p.a.update?49:n.t0===p.a.updateArray?51:n.t0===p.a.delete?95:127;break;case 3:if(n.prev=3,a=!1,t.receivedAnnotationList||(t.receivedAnnotationList=new R.a.List),o=e.payload.userId,i=e.payload.currentSequenceNumber,r=void 0,1,e.payload.numberSequenceMessages&&(r=e.payload.numberSequenceMessages),t.updateSequenceInformtion(i,1,r),s=new S.a,d.a.forEach(e.payload.insert_array,(function(e){e.finalMessage&&e.multiMessage&&(a=!0),delete e.finalMessage,delete e.multiMessage;var n=R.a.fromJS(t.parseAnnotation(e));t.receivedAnnotationList=t.receivedAnnotationList.push(n),"group"!==n.get("type")&&"3DModel"!==n.get("type")&&n.getIn(["geoFile","id"])===t.getActiveFileId()&&s.addAddedCommand(n.get("xfdf")),"Reduction"===n.get("type")?t.reductions=t.reductions.push(n):"CenterValue"===n.get("type")||"PeripheralValue"===n.get("type")?(t.displayValueAnnotations=t.displayValueAnnotations.push(n),N.a.getInstance().addDisplayAnnotations(n.get("parentId"),n)):t.Annotations=t.Annotations.push(n)})),!t.WebViewer||!t.documentLoaded){n.next=28;break}return u=s.getAnnotCommand(),t.WebViewer.annotManager.exportAnnotCommand(),n.prev=17,n.next=20,t.WebViewer.annotManager.importAnnotCommand(u);case 20:c=n.sent,n.next=26;break;case 23:n.prev=23,n.t1=n.catch(17),console.log("error 5"+n.t1.stack);case 26:t.WebViewer.annotManager.exportAnnotCommand(),c&&d.a.forEach(c,(function(e){t.initPdfAnnotationAsDeselected(e)}));case 28:if(!((g=t.getSequenceInformation(i)).get("numberSequenceMessages")>0&&g.get("numberSequenceMessages")===g.get("nrReceivedMessages"))){n.next=43;break}if(a=g.get("numberSequenceMessages")>1,t.trigger("annotationsInserted"),h=void 0,o!==y.a.getUserId()){n.next=38;break}t.trigger("userInsertedAnnotations"),a?h&&(m=t.receivedAnnotationList,h.then((function(){t.triggerMultiSelectfromStoreProgressBar(m)}),(function(e){console.log("Error | MultiSelect: ",e)}))):1===t.receivedAnnotationList.size&&"group"===t.receivedAnnotationList.first().get("type")?(t.deSelectAllAnnotationsFromGui(),W.a.deselectAnnotationsFromList(new R.a.List),t.trigger("annotationSelected"),t.updateSelectedAnnotationsToStore(void 0,t.receivedAnnotationList.first().get("id"),t.receivedAnnotationList.first().get("type"),t.receivedAnnotationList.first()),t.onSetActiveParentId(t.receivedAnnotationList.first().get("id"),!0),t.activeAnnotation=t.receivedAnnotationList.first(),W.a.selectAnnotationsFromList(t.receivedAnnotationList,t.receivedAnnotationList.map((function(e){return e.get("id")}))),t.calculateValues(),t.trigger("folderInserted")):t.receivedAnnotationList.size>=1&&t.WebViewer&&t.documentLoaded&&(t.deSelectAllAnnotationsFromGui(),W.a.clearSelectedAnnotations(),t.WebViewer.annotManager.selectAnnotations(c)),n.next=41;break;case 38:if(!t.WebViewer||!t.documentLoaded){n.next=41;break}return n.next=41,t.WebViewer.annotManager.drawAnnotations(t.WebViewer.docViewer.getCurrentPage());case 41:t.receivedAnnotationList=void 0,t.resetSequenceInformation(i);case 43:n.next=48;break;case 45:n.prev=45,n.t2=n.catch(3),console.log("Error | actions.insertArray "+n.t2.stack);case 48:return n.abrupt("break",128);case 49:try{f=void 0,e.payload.geoScale&&("x-scale"===e.payload.geoScale.type?e.payload.convertedScale?(A=t.parseScales(R.a.fromJS([e.payload.geoScale])),E=A.first(),t.yScaleList=t.yScaleList.filter((function(t){return t.get("id")!==e.payload.geoScale.id||(E=t.merge(E),!1)})),E.has("geoEstimate")&&E.has("geoFile")&&(t.xScaleList=t.xScaleList.push(E),t.exchangeSelectedIfSelected(E),t.WebViewer&&t.documentLoaded&&(t.updateScale(E,!0),t.WebViewer.annotManager.exportAnnotCommand()))):t.xScaleList=t.xScaleList.map((function(n){if(n.get("id")===e.payload.geoScale.id){var a=t.parseScales(R.a.fromJS([e.payload.geoScale]));return f=n.merge(a.first()),t.exchangeSelectedIfSelected(f),t.WebViewer&&t.documentLoaded&&(t.updateScale(f),t.WebViewer.annotManager.exportAnnotCommand()),f}return n})):"y-scale"===e.payload.geoScale.type&&(t.yScaleList=t.yScaleList.map((function(n){if(n.get("id")===e.payload.geoScale.id){var a=t.parseScales(R.a.fromJS([e.payload.geoScale]));return f=n.merge(a.first()),t.exchangeSelectedIfSelected(f),t.WebViewer&&t.documentLoaded&&(t.updateScale(f),t.WebViewer.annotManager.exportAnnotCommand()),f}return n}))),t.calculateValues(),t.trigger("AnnotationUpdated"))}catch(l){console.log(l.stack)}return n.abrupt("break",128);case 51:if(T=new R.a.List,n.prev=52,b=e.payload.currentSequenceNumber,I=void 0,1,e.payload.numberSequenceMessages&&(I=e.payload.numberSequenceMessages),t.updateSequenceInformtion(b,1,I),v=t.getSequenceInformation(b),O=new S.a,d.a.forEach(e.payload.update_array,(function(e){delete e.finalMessage,delete e.multiMessage,"Reduction"===e.type?t.reductions=t.reductions.map((function(n){if(n.get("id")===e.id){var a=n.merge(R.a.fromJS(t.parseAnnotation(e)));return n.has("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&!e["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"]&&(a=(a=(a=(a=(a=a.delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")),t.exchangeSelectedIfSelected(a),t.activeAnnotation&&t.activeAnnotation.get("id")===a.get("id")&&(t.onSetActiveParentId(a.get("parentId")),t.activeAnnotation=a),T=T.push(a),a.getIn(["geoFile","id"])===t.getActiveFileId()&&O.addModifyCommand(a.get("xfdf")),a}return n})):"CenterValue"===e.type||"PeripheralValue"===e.type?t.displayValueAnnotations=t.displayValueAnnotations.map((function(n){if(n.get("id")===e.id){var a=n.merge(R.a.fromJS(t.parseAnnotation(e)));return t.exchangeSelectedIfSelected(a),N.a.getInstance().addDisplayAnnotations(a.get("parentId"),a),a.getIn(["geoFile","id"])===t.getActiveFileId()&&O.addModifyCommand(a.get("xfdf")),a}return n})):t.Annotations=t.Annotations.map((function(n){if(n.get("id")===e.id){var a=t.parseAnnotation(e),o=n.merge(R.a.fromJS(a));return n.has("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&!e["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"]&&(o=(o=(o=(o=(o=o.delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")).delete("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")),t.exchangeSelectedIfSelected(o),t.activeAnnotation&&t.activeAnnotation.get("id")===o.get("id")&&("group"===o.get("type")?t.onSetActiveParentId(o.get("id")):t.onSetActiveParentId(o.get("parentId")),t.activeAnnotation=o),T=T.push(o),o.getIn(["geoFile","id"])===t.getActiveFileId()&&"3DModel"!==o.get("type")&&O.addModifyCommand(o.get("xfdf")),o}return n}))})),w=O.getAnnotCommand(),!t.WebViewer||!t.documentLoaded){n.next=70;break}return n.next=65,t.WebViewer.annotManager.exportAnnotCommand();case 65:return n.next=67,t.WebViewer.annotManager.importAnnotCommand(w);case 67:(P=n.sent)&&(L=t.WebViewer.annotManager,d.a.forEach(P,(function(e){L.isAnnotationSelected(e)?t.initPdfAnnotationAsSelected(e):t.initPdfAnnotationAsDeselected(e)}))),t.WebViewer.annotManager.exportAnnotCommand();case 70:if(!(v.get("numberSequenceMessages")>0&&v.get("numberSequenceMessages")===v.get("nrReceivedMessages"))){n.next=89;break}if(t.calculateValues(),t.trigger("AnnotationUpdated"),n.prev=73,!t.WebViewer||!t.documentLoaded){n.next=83;break}C=t.WebViewer.docViewer.getPageCount(),_=1;case 77:if(!(_<=C)){n.next=83;break}return n.next=80,t.WebViewer.annotManager.drawAnnotations(_);case 80:_++,n.next=77;break;case 83:n.next=88;break;case 85:n.prev=85,n.t3=n.catch(73),console.log("error 10 "+n.t3);case 88:t.resetSequenceInformation(b);case 89:n.next=94;break;case 91:n.prev=91,n.t4=n.catch(52),console.log("Error | actions.updateArray "+n.t4.stack);case 94:return n.abrupt("break",128);case 95:if(M=new R.a.List,k=[],n.prev=97,"geoScale"!==e.group){n.next=107;break}t.WebViewer&&t.documentLoaded&&e.payload.ids.forEach((function(e){t.deleteScale(t.getScaleById(e))})),t.xScaleList=t.xScaleList.filter((function(t){return!e.payload.ids.includes(t.get("id"))})),t.yScaleList=t.yScaleList.filter((function(t){return!e.payload.ids.includes(t.get("id"))})),t.calculateValues(),t.WebViewer&&t.documentLoaded&&t.WebViewer.annotManager.drawAnnotations(t.WebViewer.getCurrentPageNumber()),t.trigger("AnnotationDeleted"),n.next=121;break;case 107:if(t.Annotations=t.Annotations.filter((function(n){var a=!e.payload.ids.includes(n.get("id"));return a||(M=M.push(n),t.deselectDeletedAnnotation(n),"group"!==n.get("type")&&n.getIn(["geoFile","id"])===t.getActiveFileId()&&k.push(n.get("annotationId"))),a})),t.reductions=t.reductions.filter((function(n){var a=!e.payload.ids.includes(n.get("id"));return a||(M=M.push(n),t.deselectDeletedAnnotation(n),"group"!==n.get("type")&&n.getIn(["geoFile","id"])===t.getActiveFileId()&&k.push(n.get("annotationId"))),a})),t.displayValueAnnotations=t.displayValueAnnotations.filter((function(n){var a=!e.payload.ids.includes(n.get("id"));return a||(M=M.push(n),t.deselectDeletedAnnotation(n),N.a.getInstance().removeDisplayAnnotations(n.get("parentId"),n),"group"!==n.get("type")&&n.getIn(["geoFile","id"])===t.getActiveFileId()&&k.push(n.get("annotationId"))),a})),!t.WebViewer||!t.documentLoaded){n.next=120;break}return D=t.WebViewer.annotManager,n.next=114,D.exportAnnotCommand();case 114:return n.next=116,t.reloadAnnotations(k);case 116:return W.a.deselectAnnotationsFromList(M),t.calculateValues(),n.next=120,D.exportAnnotCommand();case 120:t.trigger("AnnotationDeleted");case 121:n.next=126;break;case 123:n.prev=123,n.t5=n.catch(97),console.log("Error | Delete: "+n.t5);case 126:case 127:return n.abrupt("break",128);case 128:case"end":return n.stop()}}),n,null,[[3,45],[17,23],[52,91],[73,85],[97,123]])})))()},onTriggerDeleteAnnotations:function(){this.trigger("deleteAnnotations")},onTriggerAnnotationUpdated:function(){this.trigger("AnnotationUpdated")},onTriggerreloadTreeSelection:function(){this.trigger("reloadTreeSelection")},onInitializeEstimates:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,s;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.Annotations=t.Annotations.clear(),t.SelectedAnnotations=t.SelectedAnnotations.clear(),t.resetAnnotationTypeMap(),t.xScaleList=t.xScaleList.clear(),t.yScaleList=t.yScaleList.clear(),t.reductions=t.reductions.clear(),t.displayValueAnnotations=t.displayValueAnnotations.clear(),a=JSON.parse(localStorage.getItem("activeEstimate")),o={},o=e[0].theGeoEstimate.geoProject.id===Object(u.get)(a,"geoProject.id")&&e.find((function(e){return e.theGeoEstimate.id===a.id}))||e[0],s=[],Object(u.forEach)(o.theGeoAnnotationList,(function(e){var n;if(null===(n=e.rows)||void 0===n?void 0:n.length){var a=t.getReadOnlyParameter(e),o=Object(u.map)(e.rows,(function(e){return Object(r.a)({readOnly:a},e)}));s.push.apply(s,Object(i.a)(o))}})),v.a.onInitializeCalculationRows(s),t.ActiveEstimate=R.a.fromJS(o.theGeoEstimate),o.theGeoAnnotationList&&(t.Annotations=R.a.fromJS(t.parseAnnotations(o.theGeoAnnotationList)),t.Annotations=t.Annotations.filter((function(e){return"Reduction"===e.get("type")?(t.reductions=t.reductions.push(e),!1):"CenterValue"!==e.get("type")&&"PeripheralValue"!==e.get("type")||(N.a.getInstance().addDisplayAnnotations(e.get("parentId"),e),t.displayValueAnnotations=t.displayValueAnnotations.push(e),!1)}))),o.theGeoScaleList)try{t.xScaleList=t.parseScales(R.a.fromJS(o.theGeoScaleList)),t.xScaleList=t.xScaleList.filter((function(e){return"y-scale"!==e.get("type")||(t.yScaleList=t.yScaleList.push(e),!1)}))}catch(l){console.log(l)}t.setFetchingDataLoader(!1);try{t.WebViewer&&t.documentLoaded&&t.loadAllAnnotations()}catch(c){console.log(c)}B.f.setAnnotationsFromJava(e),t.setAnnotationActionDone(!0),t.trigger("EstimateInitialized");case 21:case"end":return n.stop()}}),n)})))()},reloadAnnotations:function(e){var t=this;return Object(c.a)(l.a.mark((function n(){var a,o,i,r,s,c;return l.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!t.WebViewer){n.next=29;break}return t.annotationManagerSelectionLock=!0,a=t.WebViewer.annotManager,n.next=6,a.exportAnnotCommand();case 6:for(o=a.getSelectedAnnotations(),i=t.WebViewer.annotManager.getAnnotationsList(),r=0;r<i.length;r++)e.includes(i[r].Id)&&("Point"===i[r].Subject&&(i[r].iconType="none"),i.splice(r,1),r--);return d.a.forEach(o,(function(e){t.initPdfAnnotationAsSelected(e)})),a.selectAnnotations(o),n.next=13,a.exportAnnotCommand();case 13:n.prev=13,s=t.WebViewer.docViewer.getPageCount(),c=1;case 16:if(!(c<=s)){n.next=22;break}return n.next=19,t.WebViewer.annotManager.drawAnnotations(c);case 19:c++,n.next=16;break;case 22:n.next=27;break;case 24:n.prev=24,n.t0=n.catch(13),console.log("error 1 "+n.t0);case 27:return n.next=29,a.exportAnnotCommand();case 29:n.next=34;break;case 31:n.prev=31,n.t1=n.catch(0),console.log("Error reloading AnnotationManager: "+n.t1.stack);case 34:t.annotationManagerSelectionLock=!1;case 35:case"end":return n.stop()}}),n,null,[[0,31],[13,24]])})))()},onDeleteFileHandler:function(e){W.a.onDeleteFilesHandler([e]),this.displayAnnot&&this.displayAnnot.getIn(["geoFile","id"])===e&&(this.displayAnnot=void 0),this.Annotations=this.Annotations.filter((function(t){return t.getIn(["geoFile","id"])!==e})),this.trigger("AnnotationDeleted")},onDeleteDriveFolderHandler:function(e){var t=this;W.a.onDeleteFilesHandler(e),this.displayAnnot&&e.some((function(e){return e===t.displayAnnot.getIn(["geoFile","id"])}))&&(this.displayAnnot=void 0),this.Annotations=this.Annotations.filter((function(t){return e.every((function(e){return e!==t.getIn(["geoFile","id"])}))})),this.trigger("AnnotationDeleted")},changeXfdfAttribute:function(e,t,n){var a=new DOMParser,o=new XMLSerializer,i=a.parseFromString(e,"text/xml"),r=i.querySelector("annots").children[0];return"object"===typeof t&&null!==t?Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})):r.setAttribute(t,n),o.serializeToString(i)},parseAnnotationTextContentsAndFontSizeFromXfdf:function(e){var t=void 0,n=void 0;try{var a=(new DOMParser).parseFromString(e,"text/xml"),o=a.getElementsByTagName("contents");d.a.forEach(o,(function(e){t=e.childNodes[0].nodeValue}));var i=a.querySelector("annots").firstElementChild;n=parseInt(i.getAttribute("FontSize"))}catch(r){console.log("Error | Parsing Text Contents: "+r)}return{textContents:t,fontSize:n}},parseDefaultStyleFromXfdf:function(e){var t;try{var n=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("defaultstyle");d.a.forEach(n,(function(e){t=e.childNodes[0].nodeValue}))}catch(a){console.log("Error | Parsing Default style: "+a)}return t?A(t):{}},parseDefaultAppearanceFromXfdf:function(e){var t;try{var n=(new DOMParser).parseFromString(e,"text/xml").getElementsByTagName("defaultappearance");d.a.forEach(n,(function(e){t=e.childNodes[0].nodeValue}))}catch(a){console.log("Error | Parsing Default apperance: "+a)}return t||null},parseStyleFromXfdf:function(e){if(!e)return"";var t,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t=e.getAttribute("style")})),"undefined"!==t?t:"solid"},parseRichTextStyleFromXfdf:function(e){var t=(new DOMParser).parseFromString(e,"text/xml").querySelector("freetext");if(!t)return{};var n=t.querySelector("contents-richtext");if(!n)return{};var a=n.querySelector("body > p > span").getAttribute("style");return A(a)},parseAnnotationFormula:function(e){try{switch(e.type){case"Polygon":case"Reduction":case"Ellipse":case"Free hand":case"Free Hand":case"annotation.freeHand":var t=e.xfdf,n=(new DOMParser).parseFromString(t,"text/xml").querySelector("annots").firstElementChild;(n.getAttribute("formulaNA")||""===n.getAttribute("formulaNA"))&&(e.formulaNA=n.getAttribute("formulaNA")),(n.getAttribute("formulaNL")||""===n.getAttribute("formulaNL"))&&(e.formulaNL=n.getAttribute("formulaNL")),(n.getAttribute("formulaNVO")||""===n.getAttribute("formulaNVO"))&&(e.formulaNVO=n.getAttribute("formulaNVO")),(n.getAttribute("formulaNV")||""===n.getAttribute("formulaNV"))&&(e.formulaNV=n.getAttribute("formulaNV"));break;case"Polyline":var a=e.xfdf,o=(new DOMParser).parseFromString(a,"text/xml").querySelector("annots").firstElementChild;(o.getAttribute("formulaNL")||""===o.getAttribute("formulaNL"))&&(e.formulaNL=o.getAttribute("formulaNL")),(o.getAttribute("formulaNV")||""===o.getAttribute("formulaNV"))&&(e.formulaNV=o.getAttribute("formulaNV"))}}catch(i){console.log("Error | Parsing Text Contents: "+i)}return e},parseAnnotationColorFromXfdf:function(e,t){var n,a=(new DOMParser).parseFromString(e,"text/xml"),o=Object(u.get)(a.querySelector("annots"),"children");return d.a.forEach(o,(function(e){n="Free text"===t||"Freetext"===t||"Free Text"===t?e.getAttribute("TextColor"):e.getAttribute("color")})),n},parseAnnotationStatus:function(e){var t=(new DOMParser).parseFromString(e,"text/xml").querySelector("annots").firstElementChild;return t&&t.getAttribute("status")},parseAnnotationInteriorColorFromXfdf:function(e){var t,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t=e.getAttribute("interior-color")})),t},parseAnnotationStrokeColorFromXfdf:function(e){var t,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t=e.getAttribute("strokeColor")})),t},parseValueFromXfdf:function(e,t){if(e){var n,a=(new DOMParser).parseFromString(e,"text/xml"),o=Object(u.get)(a.querySelector("annots"),"children");return d.a.forEach(o,(function(e){n=e.getAttribute(t)})),n}},parseAnnotationFlagsFromXfdf:function(e){if(!e)return[];var t=new Set,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t.add.apply(t,Object(i.a)(e.getAttribute("flags").split(",")))})),Object(i.a)(t)},parseAnnotationPageFromXfdf:function(e){var t,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t=e.getAttribute("page")})),parseInt(t)+1},parseAnnotationRotationFromXfdf:function(e){var t,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t=e.getAttribute("rotation")})),parseInt(t)},parseAnnotationGeometraFlipFromXfdf:function(e){var t,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){t=e.getAttribute("geometraFlip")})),t},parseAnnotationStrokeSizeXfdf:function(e){var t=1,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){var n=parseFloat(e.getAttribute("width"));Number.isNaN(n)||(t=n)})),t},parseAnnotationPointWidthHeightXfdf:function(e){var t=2,n="none",a=(new DOMParser).parseFromString(e,"text/xml"),o=Object(u.get)(a.querySelector("annots"),"children");return d.a.forEach(o,(function(e){t=parseFloat(e.getAttribute("pointSize")),n=e.getAttribute("iconType")})),{pointSize:t,iconType:n}},parseAnnotationGeometraOpacityXfdf:function(e){var t=.5,n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){var n=parseFloat(e.getAttribute("geometraOpacity"));Number.isNaN(n)||(t=n)})),t},parseAnnotationGeometraBorderOpacityXfdf:function(e,t){var n=t?null:.5,a=(new DOMParser).parseFromString(e,"text/xml"),o=Object(u.get)(a.querySelector("annots"),"children");return d.a.forEach(o,(function(e){var t=parseFloat(e.getAttribute("geometraBorderOpacity"));Number.isNaN(t)||(n=t)})),n},parseAnnotationGeometraLineStartEndXfdf:function(e){var t="-",n="-",a=(new DOMParser).parseFromString(e,"text/xml"),o=Object(u.get)(a.querySelector("annots"),"children");return d.a.forEach(o,(function(e){n=e.getAttribute("geometraLineEnd"),t=e.getAttribute("geometraLineStart")})),{lineStart:t,lineEnd:n}},parseAnnotationPattenrXfdf:function(e){var t="none",n=(new DOMParser).parseFromString(e,"text/xml"),a=Object(u.get)(n.querySelector("annots"),"children");return d.a.forEach(a,(function(e){var n=e.getAttribute("pattern");n&&(t=n)})),t},parseTiles:function(e){switch(e.type){case"Polygon":case"Circle":case"Ellipse":case"annotation.freeHand":case"Free hand":case"Free Hand":case"Reduction":case"Polyline":var t=(new DOMParser).parseFromString(e.xfdf,"text/xml"),n=Object(u.get)(t.querySelector("annots"),"children");d.a.forEach(n,(function(t){t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&(e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH"))),t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")&&(e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")),e["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"))),t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")&&(e["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")),e["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")),e["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")),e["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")),e["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH"]=Number.parseFloat(t.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")))}))}},parseScales:function(e){var t=new DOMParser,n=new L;return e.map((function(e){var a=t.parseFromString(e.get("xdf"),"text/xml").querySelector("annots").children,o=e;return d.a.forEach(a,(function(t){o=e.set("annotationId",t.getAttribute("name")).set("color",t.getAttribute("color")).set("interior-color",t.getAttribute("interior-color")).set("width",t.getAttribute("width")||"1").set("geometraLineStart",t.getAttribute("geometraLineStart")||"|<-").set("geometraLineEnd",t.getAttribute("geometraLineEnd")||"|<-");var n=1,a=parseFloat(t.getAttribute("geometraOpacity"));Number.isNaN(a)||(n=a),t.getAttribute("strokeSize")&&(o=o.set("strokeSize",t.getAttribute("strokeSize"))),o=o.set("geometraOpacity",n)})),o=(o=o.set("displayValueList",n.getDisplayListForAnnotation(o))).set("length",parseFloat(JSON.parse(o.get("length"))))}))},parseAnnotation:function(e){if("group"!==e.type||e.parentId){if("3DModel"===e.type)e.xfdf=JSON.parse(e.xfdf),e.parentId=""===e.parentId?void 0:e.parentId;else if(e.xfdf&&"group"!==e.type){e.height&&(e.height=JSON.parse(e.height)),e.height||(e.height=0),e.quantity||(e.quantity=1),e.parentId||(e.parentId=void 0),this.addStatusToXfdfIfMissing(e),this.parseTiles(e),this.parseAnnotationFormula(e),e.strokeSize=this.parseAnnotationStrokeSizeXfdf(e.xfdf),e.color=this.parseAnnotationColorFromXfdf(e.xfdf,e.type),e.interiorColor=this.parseAnnotationInteriorColorFromXfdf(e.xfdf),e.status=this.parseAnnotationStatus(e.xfdf),e.geometraFlip=this.parseAnnotationGeometraFlipFromXfdf(e.xfdf),e.pageNumber=this.parseAnnotationPageFromXfdf(e.xfdf),e.rotation=this.parseAnnotationRotationFromXfdf(e.xfdf);var t=new L;if(e.displayValueList=t.getDisplayListForAnnotation(R.a.fromJS(e)),"Point"===e.type){var n=this.parseAnnotationPointWidthHeightXfdf(e.xfdf);e.pointSize=n.pointSize,e.iconType=n.iconType}else if("Free text"===e.type||"Free Text"===e.type){var o=this.parseAnnotationTextContentsAndFontSizeFromXfdf(e.xfdf);e.strokeColor=this.parseAnnotationStrokeColorFromXfdf(e.xfdf),e.textContents=o.textContents,e.fontSize=o.fontSize}else if("Polygon"===e.type||"Reduction"===e.type||"Free hand"===e.type||"Free Hand"===e.type)e.pattern=this.parseAnnotationPattenrXfdf(e.xfdf);else if("Polyline"===e.type||"x-scale"===e.type||"y-scale"===e.type){var i=this.parseAnnotationGeometraLineStartEndXfdf(e.xfdf);e.geometraLineStart=i.lineStart,e.geometraLineEnd=i.lineEnd}if("Polyline"===e.type){var r=this.parseAnnotationGeometraOpacityXfdf(e.xfdf),s=this.parseAnnotationGeometraBorderOpacityXfdf(e.xfdf,!0);e.geometraOpacity=s||r}else e.geometraOpacity=this.parseAnnotationGeometraOpacityXfdf(e.xfdf),e.geometraBorderOpacity=this.parseAnnotationGeometraBorderOpacityXfdf(e.xfdf);if("Free Hand"===e.type&&(e.type="Free hand"),"Free Text"===e.type&&(e.type="Free text"),null===e||void 0===e?void 0:e.rows){e.rows;return Object(a.a)(e,["rows"])}}}else e.parentId=void 0;return e},parseAnnotations:function(e){var t=this;try{return e.map((function(e){return e=t.parseAnnotation(e)}))}catch(n){throw n}},generateUUID:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))},shouldReloadAnnotation:function(e){return"group"!==e.get("type")&&e.getIn(["geoFile","id"])===this.getActiveFileId()},getFolderTagNumber:function(){return(this.Annotations.count((function(e){return"group"===e.get("type")}))+1).toString()},getParsedAnnotation:function(e){var t=e.annotationId,n=e.fileId,a=e.height,o=e.id,i=e.name,r=e.number,s=e.parentId,l=e.quantity,c=e.type,u=e.xfdf;return R.a.fromJS(this.parseAnnotation({annotationId:t,geoFile:{id:n,pages:0},geoEstimate:this.ActiveEstimate,height:a,id:o,name:i,number:r,parentId:s,quantity:l,type:c,xfdf:u}))},addStatusToXfdfIfMissing:function(e){if("3DModel"!==e.type){var t=(new DOMParser).parseFromString(e.xfdf,"text/xml");if(!t.querySelector("annots").children[0].getAttribute("status")){t.querySelector("annots").children[0].setAttribute("status","notStarted");var n=(new XMLSerializer).serializeToString(t);e.xfdf=n}}},getReadOnlyParameter:function(e){if("3DModel"===e.type)return JSON.parse(e.xfdf).readOnly;var t=new DOMParser,n=e.xfdf;return"true"===t.parseFromString(n,"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")}})},190:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var a=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,o=/^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/},192:function(e,t,n){"use strict";t.a={d:function(e,t){1},e:function(e,t){1},f:function(e,t){},i:function(e,t){1}}},196:function(e,t,n){"use strict";var a=n(0),o=n.n(a),i=n(16);t.a=function(e){var t=e.type,n=e.status;switch(t){case"folder":return o.a.createElement(i.a,{icon:["fal","folder"],style:{color:"#F5B200"}});case"pdf":case"file-pdf":return o.a.createElement(i.a,{icon:["fal","file-pdf"],style:{color:"#E61C27"}});case"word":case"file-word":case"file-docx":case"docx":return o.a.createElement(i.a,{icon:["fal","file-word"],style:{color:"#0AB1E1"}});case"excel":case"file-excel":case"file-xlsx":case"xlsx":case"xls":return o.a.createElement(i.a,{icon:["fal","file-excel"],style:{color:"#008000"}});case"powerpoint":case"pptx":case"ppt":case"file-ppt":return o.a.createElement(i.a,{icon:["fal","file-powerpoint"],style:{color:"#F5B200"}});case"jpeg":case"jpg":case"file-jpg":case"file-image":case"png":case"svg":return o.a.createElement(i.a,{icon:["fal","file-image"]});case"txt":return o.a.createElement(i.a,{icon:["fal","file-alt"]});case"zip":return o.a.createElement(i.a,{icon:["fal","file-archive"]});case"file-ifc":case"ifc":switch(n){case"converted":return o.a.createElement(i.a,{icon:["fal","cube"],style:{color:"#0AB1E1"}});case"conversion_failed":return o.a.createElement(i.a,{icon:["fal","exclamation-triangle"],style:{color:"#E61C27"}})}case"loader":return o.a.createElement(i.a,{icon:["fal","spinner"],className:"Spinner"});default:return o.a.createElement(i.a,{icon:["fal","file"]})}}},197:function(e,t,n){"use strict";var a=n(48),o=n(60),i=n(77),r=n(35);t.a=Object(a.createStore)({listenables:[r.i],init:function(){this.listenables=r.i,this.socket=null},onInitSocket:function(e){var t=this;if(null===this.socket){try{this.socket=new window.WebSocket("".concat("wss://ws-sls.api.geometra.rukkor.io","?Auth=").concat(o.a.getJwt()))}catch(n){n.reason="The server is unreachable at this time",n.code=1005,r.d.socketError(n)}this.socket.onclose=function(e){o.a.tryReconnectV2()},this.socket.onerror=function(e){r.d.error(e)},this.socket.onopen=function(n){o.a.resetNrConnectTriesV2(),t.onSendMessage(e)},this.socket.onmessage=function(e){try{var t=JSON.parse(e.data);switch(t.group){case"error":r.d.errorReceived(t);break;case i.a.login:r.g.messageReceived(t);break;case i.a.heartbeat:break;default:r.g.messageReceived(t)}}catch(n){r.d.error(n)}}}},onSendMessage:function(e){var t=this;e&&this.waitForConnection((function(){t.socket.send(JSON.stringify(e))}),1e3)},waitForConnection:function(e,t){if(this.socket&&1===this.socket.readyState)e();else{var n=this;setTimeout((function(){n.waitForConnection(e,t)}),t)}},getSocketReadyState:function(){return this.socket?this.socket.readyState:3},onCloseSocket:function(){this.socket&&(this.socket.close(),this.socket=null)}})},230:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["requestDepartmentUserAccess","initializeDepartmentUserAccess"]);t.a=o},232:function(e,t,n){"use strict";var a=n(48);t.a=Object(a.createStore)({listenables:[],init:function(){this.iconBaselineNewReleases24px='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path fill="green" fill-opacity="0.4" d="M23 12l-2.44-2.78.34-3.68-3.61-.82-1.89-3.18L12 3 8.6 1.54 6.71 4.72l-3.61.81.34 3.68L1 12l2.44 2.78-.34 3.69 3.61.82 1.89 3.18L12 21l3.4 1.46 1.89-3.18 3.61-.82-.34-3.68L23 12zm-10 5h-2v-2h2v2zm0-4h-2V7h2v6z"/></svg>',this.baselineRemoveCircleOutline24px='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path fill="green" fill-opacity="0.4" d="M7 11v2h10v-2H7zm5-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>',this.baselineRoom24px='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="green" fill-opacity="0.4" d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>',this.baselineStarRate24px='<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18"><path fill="green" fill-opacity="0.4" d="M9 11.3l3.71 2.7-1.42-4.36L15 7h-4.55L9 2.5 7.55 7H3l3.71 2.64L5.29 14z"/><path fill="none" d="M0 0h18v18H0z"/></svg>',this.baselineToys24px='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="green" fill-opacity="0.4" d="M12 12c0-3 2.5-5.5 5.5-5.5S23 9 23 12H12zm0 0c0 3-2.5 5.5-5.5 5.5S1 15 1 12h11zm0 0c-3 0-5.5-2.5-5.5-5.5S9 1 12 1v11zm0 0c3 0 5.5 2.5 5.5 5.5S15 23 12 23V12z"/><path fill="none" d="M0 0h24v24H0z"/></svg>'},getIcon:function(e){switch(e){case"iconBaselineNewReleases24px":return this.iconBaselineNewReleases24px;case"baselineRemoveCircleOutline24px":return this.baselineRemoveCircleOutline24px;case"baselineRoom24px":return this.baselineRoom24px;case"baselineStarRate24px":return this.baselineStarRate24px;case"baselineToys24px":return this.baselineToys24px;default:console.log("Could not find case for IconType in IconTypeStore.  "+e)}}})},234:function(e,t,n){"use strict";t.a=function(e){var t=0,n=0,a=0;return 4===e.length?(t="0x"+e[1]+e[1],n="0x"+e[2]+e[2],a="0x"+e[3]+e[3]):7===e.length&&(t="0x"+e[1]+e[2],n="0x"+e[3]+e[4],a="0x"+e[5]+e[6]),{r:parseInt(t),g:parseInt(n),b:parseInt(a)}}},238:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["sendUpdate","messageReceived"]);t.a=o},24:function(e,t,n){"use strict";n.d(t,"h",(function(){return g})),n.d(t,"c",(function(){return f})),n.d(t,"l",(function(){return S})),n.d(t,"a",(function(){return I})),n.d(t,"o",(function(){return v})),n.d(t,"j",(function(){return w})),n.d(t,"d",(function(){return P})),n.d(t,"b",(function(){return L})),n.d(t,"k",(function(){return k})),n.d(t,"q",(function(){return j})),n.d(t,"p",(function(){return V})),n.d(t,"f",(function(){return se})),n.d(t,"n",(function(){return ge})),n.d(t,"g",(function(){return he.a})),n.d(t,"i",(function(){return Ie})),n.d(t,"e",(function(){return ye})),n.d(t,"m",(function(){return ve}));var a,o=n(33),i=n(76),r=n(0),s=n.n(r),l=n(422),c=n(259),u=n(165),d=n(431),p=n(12),g=(n(745),function(e){var t=e.propsRef,n=e.label,a=e.value,g=(e.onChange,e.onAccept),h=e.type,m=void 0===h?"text":h,f=e.min,A=e.max,E=e.isPositive,T=e.addonBefore,S=e.disabled,b=e.suffix,I=e.heightAndQuantityType,y=Object(i.a)(e,["propsRef","label","value","onChange","onAccept","type","min","max","isPositive","addonBefore","disabled","suffix","heightAndQuantityType"]),v=Object(r.useState)(a),N=Object(o.a)(v,2),O=N[0],w=N[1],P=Object(l.a)().t,R="number"===m;Object(r.useEffect)((function(){w(a)}),[a]);var L=function(e){w(R?_(e,R):e.target.value)},C=function(e){a!==O&&g(R?_(e,R):e)},_=function(e,t){return!t||Object(p.isNil)(f)||Object(p.isNil)(A)?E&&!Number.isNaN(Math.abs(e.target.value))?Math.abs(e.target.value):e.target.value:function(e,t,n){return!Number.isNaN(e)&&e>=t&&e<=n}(e.target.value,f,A)?e.target.value:O};return s.a.createElement(c.a,{className:"Input_Wrapper"},I&&"number"===m&&s.a.createElement(s.a.Fragment,null,s.a.createElement(u.a,{span:24,id:"".concat(n.toLowerCase().replaceAll(" ","-"),"_input-title")},P(n)),s.a.createElement(u.a,{span:24,id:"".concat(n.toLowerCase().replaceAll(" ","-"),"_input")},s.a.createElement(d.a,Object.assign({ref:t,type:"number",value:O,onChange:L,addonBefore:T,suffix:b,disabled:S,onPressEnter:C,onBlur:C,step:"Q"===T?1:.1},y)))),("text"===m||"number"===m&&!I)&&s.a.createElement(s.a.Fragment,null,s.a.createElement(u.a,{span:24,id:"".concat(n.toLowerCase().replaceAll(" ","-"),"_input-title")},P(n)),s.a.createElement(u.a,{span:24,id:"".concat(n.toLowerCase().replaceAll(" ","-"),"_input")},s.a.createElement(d.a,Object.assign({ref:t,type:"text",value:O,onChange:L,addonBefore:T,suffix:b,disabled:S,onPressEnter:C,onBlur:C},y)))),"textArea"===m&&s.a.createElement(u.a,{span:24},s.a.createElement(d.a.TextArea,Object.assign({ref:t,value:O,onChange:L,disabled:S,onPressEnter:C,onBlur:C},y,{id:"text_input",onFocus:function(e){return e.target.select()}}))))}),h=n(85),m=(n(755),/^#([0-9a-f]{6})$/i),f=function(e){var t=e.propsRef,n=e.label,a=e.color,i=e.showColorPicker,p=e.changeColor,g=e.disabled,f=Object(r.useState)(a||""),A=Object(o.a)(f,2),E=A[0],T=A[1],S=Object(l.a)().t;Object(r.useEffect)((function(){T(a)}),[a]);var b=function(e){a!==E&&m.test(e.target.value)&&p({hex:e.target.value})};return s.a.createElement("label",{className:"Color_Picker_Wrapper",id:"colour-picker_".concat(n.toLowerCase().replaceAll(" ","-"),"--button")},S(n),s.a.createElement(h.a,{className:"Color_Picker"},s.a.createElement(c.a,{wrap:!1},s.a.createElement(u.a,null,s.a.createElement(c.a,{justify:"center",align:"middle",className:"Color_Picker_Icon_Wrapper",onClick:function(){return!g&&i()}},s.a.createElement(u.a,null,s.a.createElement("div",{style:{background:a},className:"Color_Picker_Icon"})))),s.a.createElement(u.a,null,s.a.createElement(d.a,{ref:t,className:"Color_Picker_Input",value:E,onChange:function(e){T(e.target.value)},onPressEnter:b,onBlur:b,disabled:g})))))},A=n(191),E=n(83),T=n(16),S=(n(756),function(e){var t=e.label,n=e.options,a=Object(i.a)(e,["label","options"]),o=Object(l.a)().t,r=Object(p.map)(n,(function(e){return s.a.createElement(A.a.Option,{value:e.value,key:e.value,id:"select-".concat(e.value.toLowerCase().replaceAll(" ","-"),"--option")},s.a.createElement("div",{className:"Select_Option ".concat(e.centered?"Select_Option_Centered":""," ").concat(e.rotated?"Select_Option_Rotated":""),style:e.font&&{fontFamily:e.value},id:"selected-".concat(e.value.toLowerCase().replaceAll(" ","-"),"--option")},e.iconName&&s.a.createElement("img",{src:e.iconName,className:"Select_Option_Icon"}),e.name))}));return s.a.createElement(c.a,{className:"Select_Wrapper",id:"select-".concat(t.toLowerCase().replaceAll(" ","-"),"--button")},s.a.createElement(u.a,{span:24,id:"select-".concat(t.toLowerCase().replaceAll(" ","-"),"--title")},o(t)),s.a.createElement(u.a,{span:24},s.a.createElement(A.a,Object.assign({suffixIcon:s.a.createElement(T.a,{icon:E.c})},a),r)))}),b=n(2608),I=(n(757),function(e){var t=e.label,n=e.options,a=e.value,d=e.onSelect,g=e.type,h=void 0===g?"text":g,m=Object(i.a)(e,["label","options","value","onSelect","type"]),f=Object(l.a)().t,A=Object(r.useState)(a),E=Object(o.a)(A,2),T=E[0],S=E[1],I=Object(r.useState)(n),y=Object(o.a)(I,2),v=y[0],N=y[1];return Object(r.useEffect)((function(){S(a)}),[a]),s.a.createElement(c.a,{className:"Autocomplete_Wrapper",id:"autocomplete-".concat(t.toLowerCase().replaceAll(" ","-"),"--button")},s.a.createElement(u.a,{span:24},f(t)),s.a.createElement(u.a,{span:24},s.a.createElement(b.a,Object.assign({value:T,options:v,onSelect:d,onSearch:function(e){return N(e?Object(p.filter)(n,(function(t){return Object(p.includes)(t.value.toString(),e)})):[])},onChange:function(e){return"text"===h||"number"===h&&!isNaN(e)&&S(e)},onBlur:function(){return d(T)}},m))))}),y=n(2625),v=(n(758),function(e){var t=e.label,n=e.onChange,a=e.checked,o=void 0!==a&&a,r=e.reverseValue,d=void 0!==r&&r,p=Object(i.a)(e,["label","onChange","checked","reverseValue"]),g=Object(l.a)().t;return s.a.createElement(c.a,{wrap:!1,align:"middle",gutter:[16,0],className:"Toggle_Wrapper"},s.a.createElement(u.a,null,s.a.createElement(y.a,Object.assign({checked:d?!o:o,onChange:function(e){return n(d?!e:e)}},p))),s.a.createElement(u.a,{className:"Toggle_Label"},g(t)))}),N=n(2623),O=n(2609),w=(n(759),function(e){var t=e.children,n=e.title,a=e.submitButtonTitle,o=e.onOk,c=e.onCancel,u=e.activeButtons,d=e.className,p=e.disabledOkButton,g=e.closable,m=e.onPressEnter,f=Object(i.a)(e,["children","title","submitButtonTitle","onOk","onCancel","activeButtons","className","disabledOkButton","closable","onPressEnter"]),A=Object(l.a)().t;Object(r.useEffect)((function(){return document.addEventListener("keydown",E,!0),function(){return document.removeEventListener("keydown",E,!0)}}),[]);var E=function(e){"Enter"===e.key&&m&&m()};return s.a.createElement(N.a,Object.assign({onOk:o,onCancel:c,title:n,centered:!0,closable:!0===g,closeIcon:s.a.createElement(T.a,{icon:["fal","times"]}),footer:[c?s.a.createElement(h.a,{onClick:c,type:"text",key:"onCancelModal"},A("Cancel")):s.a.createElement("div",null),u||s.a.createElement(h.a,{type:"primary",key:"onOKModal",onClick:o,disabled:p},A(a||"OK"))]},f,{className:"Modal_Wrapper ".concat(d&&d)}),n&&t&&s.a.createElement(O.a,null),t)}),P=function(e){return e.vertical?s.a.createElement(O.a,{type:"vertical",style:{height:"100%"}}):s.a.createElement(O.a,null)},R=n(283),L=function(e){var t=e.name,n=e.onChange,a=e.label,o=e.checked,i=Object(l.a)().t;return s.a.createElement("label",null,s.a.createElement(R.a,{name:t,onChange:n,checked:o})," ",i(a))},C=n(2616),_=n(173),M=n(5),k=function(e){var t=e.oldData,n=e.newData,a=Object(l.a)().t,o=[{title:a("Status"),dataIndex:"status",key:"status",render:function(e,t){var n=_.a.find((function(e){return e.value===t.annotationRow.status}));return s.a.createElement(c.a,{wrap:!1,gutter:6},s.a.createElement(u.a,null,s.a.createElement(n.StatusIcon,null)),s.a.createElement(u.a,null,a(n.label)))}},{title:a("Profession"),dataIndex:"profession",key:"profession",render:function(e,t){return s.a.createElement("div",null,t.annotationRow.profession)}},{title:a("Phase"),dataIndex:"phase",key:"phase",render:function(e,t){return s.a.createElement("div",null,t.annotationRow.phase)}},{title:a("Segment"),dataIndex:"segment",key:"segment",render:function(e,t){return s.a.createElement("div",null,t.annotationRow.segment)}},{title:a("Action"),dataIndex:"action",key:"action",render:function(e,t){return s.a.createElement("div",null,t.annotationRow.action)}},{title:a("Material"),dataIndex:"material",key:"material",render:function(e,t){return s.a.createElement("div",null,t.annotationRow.material)}},{title:a("Amount"),dataIndex:"amount",key:"amount",render:function(e,t){var n=M.c.getRowById(t.id);return s.a.createElement("div",{className:"Right_Align"},n.getIn(["annotationRow","amount"]))}},{title:a("Unit"),dataIndex:"unit",key:"unit",render:function(e,t){return s.a.createElement("div",null,t.annotationRow.unit)}},{title:a("Unit Price"),dataIndex:"pricePerUnit",key:"pricePerUnit",render:function(e,t){return s.a.createElement("div",{className:"Right_Align"},M.c.formatCurrencyValue(t.annotationRow.pricePerUnit))}},{title:a("Unit Time"),dataIndex:"unitTime",key:"unitTime",render:function(e,t){return s.a.createElement("div",{className:"Right_Align"},t.annotationRow.unitTime||"00:00")}},{title:a("Total Price"),dataIndex:"totalPrice",key:"totalPrice",render:function(e,t){return s.a.createElement("div",{className:"Right_Align"},M.c.formatCurrencyValue(t.annotationRow.totalPrice))}},{title:a("Total Time"),dataIndex:"totalTime",key:"totalTime",render:function(e,t){var n=t.annotationRow.totalTime.split(":");return s.a.createElement("div",{className:"Right_Align"},isNaN(n[0])&&isNaN(n[1])?"0:00":"".concat(n[0],":").concat(n[1]))}}];return s.a.createElement("div",null,s.a.createElement(C.a,{dataSource:t,columns:o,pagination:!1,bordered:!0,size:"small",className:"Calculate_Rows_Table",scroll:{y:"200px"}}),s.a.createElement("p",null,a("Will be replace with following")),s.a.createElement(C.a,{dataSource:n,columns:o,pagination:!1,bordered:!0,size:"small",className:"Calculate_Rows_Table",scroll:{y:"200px"}}))},D=n(590),x=[{type:"edit",title:"EDIT_TOOL_TITLE",description:"EDIT_TOOL_DESCRIPTION",shortcut:"EDIT_TOOL_SHORTCUT"},{type:"pan",title:"PAN_TOOL_TITLE",description:"PAN_TOOL_DESCRIPTION",shortcut:"PAN_TOOL_SHORTCUT"},{type:"point",title:"POINT_TOOL_TITLE",description:"POINT_TOOL_DESCRIPTION",shortcut:"POINT_TOOL_SHORTCUT"},{type:"line",title:"Line Tool",description:"Create a polyline which can be expanded to contain many sections.Hold Shift to get a 45 degree angle lock while drawing.",shortcut:"Ctrl + 3"},{type:"polygon",title:"Area Tool",description:"Create a polygon/area which contains most values. You can draw diagonally and get a perfect rectangle by right clicking the second point",shortcut:"Ctrl + 4"},{type:"ellipse",title:"ELlIPSE_TOOL_TITLE",description:"ElLIPSE_TOOL_DESCRIPTION",shortcut:"ELLIPSE_TOOL_SHORTCUT"},{type:"freehand",title:"FREEHAND_TOOL_TITLE",description:"FREEHAND_TOOL_DESCRIPTION",shortcut:"FREEHAND_TOOL_SHORTCUT"},{type:"reduction",title:"REDUCTION_TOOL_TITLE",description:"REDUCTION_TOOL_DESCRIPTION",shortcut:"REDUCTION_TOOL_SHORTCUT"},{type:"text",title:"TEXT_TOOL_TITLE",description:"TEXT_TOOL_DESCRIPTION",shortcut:"TEXT_TOOL_SHORTCUT"},{type:"stamp",title:"STAMP_TOOL_TITLE",description:"STAMP_TOOL_DESCRIPTION",shortcut:"STAMP_TOOL_SHORTCUT"},{type:"arrow",title:"ARROW_TOOL_TITLE",description:"ARROW_TOOL_DESCRIPTION",shortcut:"ARROW_TOOL_SHORTCUT"},{type:"zoom",title:"ZOOM_TOOL_TITLE",description:"ZOOM_TOOL_DESCRIPTION",shortcut:"ZOOM_TOOL_SHORTCUT"},{type:"fit",title:"FIT_TO_SCREEN_TOOL_TITLE",description:"FIT_TO_SCREEN_TOOL_DESCRIPTION",shortcut:"FIT_TO_SCREEN_TOOL_SHORTCUT"},{type:"download",title:"DOWNLOAD_FILE_TITLE",description:"DOWNLOAD_FILE_DESCRIPTION",shortcut:"DOWNLOAD_FILE_SHORTCUT"},{type:"export",title:"EXPORT_FILE_TITLE",description:"EXPORT_FILE_DESCRIPTION",shortcut:"EXPORT_FILE_SHORTCUT"},{type:"filter",title:"FILETER_TOOL_TITLE",description:"FILTER_TOOL_DESCRIPTION",shortcut:"FILTER_TOOL_SHORTCUT"},{type:"snapOn",title:"SNAPON_TOOL_TITLE",description:"SNAPON_TOOL_DESCRIPTION",shortcut:"SNAPON_TOOL_SHORTCUT"},{type:"template",title:"TEMPLATE_TOOL_TITLE",description:"TEMPLATE_TOOL_DESCRIPTION",shortcut:"TEMPLATE_TOOL_SHORTCUT"}],F=n(257),j=(n(833),function(e){a=setTimeout((function(){!function(e){var t=x.find((function(t){return t.type===e}));D.a.open({message:s.a.createElement(F.b,{message:t.title,shortcut:t.shortcut}),description:s.a.createElement(F.a,{description:t.description}),placement:"bottomRight",duration:0,className:"Tooltip"})}(e)}),1250)}),V=function(){clearTimeout(a),D.a.destroy()},U=n(25),W=n(29),B=n(43),H=n(44),J=n(355),z=n(345),G=n(284),q=n(179),X=n(2610),Y=function(e){var t=e.item,n=e.onBlur,a=e.onPressEnter,l=Object(i.a)(e,["item","onBlur","onPressEnter"]),c=Object(r.useState)(null===t||void 0===t?void 0:t.name),u=Object(o.a)(c,2),p=u[0],g=u[1];return s.a.createElement(d.a,Object.assign({placeholder:null===t||void 0===t?void 0:t.name,autoFocus:!0,onBlur:n,value:p,onChange:function(e){return g(e.target.value)},onPressEnter:function(){a(t.geoProject.id,t.id,p),n()}},l))},K=n(34),Z=n(63),Q=n(2622),$=n(196),ee=(n(834),n(347)),te=function(e){var t=e.filterValue,n=e.onDoubleClickDrive,a=e.onCancel,i=localStorage.getItem("quickSwitchexpandedKeys_".concat(M.m.getActiveProjectId()))?new Set(JSON.parse(localStorage.getItem("quickSwitchexpandedKeys_".concat(M.m.getActiveProjectId())))):new Set,l=Object(r.useState)(i),c=Object(o.a)(l,2),u=c[0],d=c[1],g=Object(Z.g)(),h=function(e,t){var n=t?"Tree_Icon Tree_Circle_Icon List_Icon":"Tree_Status";return s.a.createElement("div",{className:n},"folder"!==e.type&&s.a.createElement(ve,{notStarted:"notStarted"===e.nodeStatus||!e.nodeStatus,progress:"progress"===e.nodeStatus,review:"review"===e.nodeStatus,complete:"complete"===e.nodeStatus}),"folder"===e.type&&e.statuses&&Object.values(e.statuses).some((function(e){return e>0}))&&s.a.createElement(ve,{notStarted:e.statuses.notStarted>0,progress:e.statuses.progress>0,review:e.statuses.review>0,complete:e.statuses.complete>0}))},m=function(e,t){if(g.location.pathname.includes("drive"))n(t);else if(t.id!==M.a.getActiveFileId()){switch(t.type){case"folder":g.push("/projects/".concat(M.m.getActiveProjectId(),"/drive#").concat(t.key));break;default:M.a.jumpToFile(t)}a()}};return""===t?s.a.createElement(Q.a,{checkStrictly:!0,treeData:Object(ee.a)(M.i.getTreeData()),titleRender:function(e){return s.a.createElement("div",null,s.a.createElement("label",{className:"TreeItem_Label"},e.title),h(e,!1))},defaultExpandAll:!0,defaultSelectedKeys:[M.a.getActiveFileId()],showLine:{showLeafIcon:!1},showIcon:!0,onClick:m,onExpand:function(e){d(e),localStorage.setItem("quickSwitchexpandedKeys_".concat(M.m.getActiveProjectId()),JSON.stringify(e))},expandedKeys:Object(K.a)(u),className:"Estimates_Tree"}):function(e,t){return Object(p.filter)(e,(function(e){return Object(p.includes)(e.name.toLowerCase(),t.toLowerCase())}))}(M.i.getTreeList(),t).map((function(e){return function(e){var t="folder"===e.type?s.a.createElement($.a,{type:"folder"}):e.icon;return s.a.createElement("div",{className:"ListItemContainer",onDoubleClick:function(t){return m(t,e)}},s.a.createElement("div",{className:"ItemIcon"},t),s.a.createElement("label",null,e.title),h(e,!0))}(e)}))},ne=(n(836),function(e){var t=e.visible,n=e.onCancel,a=e.onAccept,i=e.title,g=e.addEstimate,m=e.estimates,f=e.activeEstimate,A=e.isAdding,E=e.idUpdating,S=e.onDeleteEstimate,b=e.onRenameEstimate,I=e.onCopyEstimate,y=e.onLockEstimate,v=e.onDoubleClickDrive,N=Object(l.a)().t,P=M.b.getRole(),R=Object(r.useState)(""),L=Object(o.a)(R,2),C=L[0],_=L[1],k=Object(r.useState)(),D=Object(o.a)(k,2),x=D[0],F=D[1],j=Object(r.useState)(!1),V=Object(o.a)(j,2),U=V[0],W=V[1],B=Object(r.useState)(""),H=Object(o.a)(B,2),K=H[0],Z=H[1],Q=N("DELETE");Object(r.useEffect)((function(){return function(){_(""),F(),W(!1),Z("")}}),[]);var $=function(){F(),W(!1),Z("")},ee=s.a.createElement(X.a,{spin:!0}),ne=s.a.createElement(J.a.Group,{value:f.id},function(e,t){return Object(p.filter)(e,(function(e){return Object(p.includes)(e.name.toLowerCase(),t.toLowerCase())}))}(m,C).map((function(e,t){return s.a.createElement(J.a,{key:t,value:e.id,onClick:function(){return function(e){e.id!==M.f.getActiveEstimate().id&&M.f.setActiveEstimate(e)}(e)}},e.id!==(null===x||void 0===x?void 0:x.id)||U?s.a.createElement("div",{className:"Template_Estimate_Name"},N(e.name)):s.a.createElement(Y,{item:e,onBlur:function(){return F()},onPressEnter:b}),E===e.id?s.a.createElement(z.a,{indicator:ee}):s.a.createElement(G.a,{overlay:s.a.createElement(q.a,{className:"Calculate_Rows_ContextMenu"},s.a.createElement(q.a.Item,{disabled:!P,key:"rename",onClick:function(){return F(e)}},s.a.createElement(T.a,{icon:["fal","edit"]}),N("Rename")),s.a.createElement(q.a.Item,{disabled:!P,key:"duplicate",onClick:function(){return I(e.geoProject.id,e.id)}},s.a.createElement(T.a,{icon:["fal","copy"]}),N("Duplicate")),s.a.createElement(q.a.Item,{disabled:!P,key:"lock-estimate",onClick:function(){return y(e.geoProject.id,e.id,!e.locked)}},s.a.createElement(T.a,{icon:["fal",e.locked?"unlock":"lock"]}),N(e.locked?"Unlock Estimate":"Lock Estimate")),s.a.createElement(O.a,null),s.a.createElement(q.a.Item,{key:"delete",onClick:function(){return function(e){F(e),W(!0)}(e)},danger:!0,disabled:E===e.id||1===m.length||!P},s.a.createElement(T.a,{icon:["fal","trash"]}),N("Delete"))),trigger:["click"]},s.a.createElement(h.a,{type:"text",icon:s.a.createElement(T.a,{icon:["fal","ellipsis-h-alt"]})})))})));return s.a.createElement(s.a.Fragment,null,U&&s.a.createElement(w,{title:N("Delete Estimate"),visible:U,onCancel:$,activeButtons:s.a.createElement(h.a,{key:"submit",type:"danger",onClick:function(){S(M.m.getActiveProjectId(),x.id),$()},disabled:K!==Q,autoFocus:!0},N("Delete")),destroyOnClose:!0},s.a.createElement("label",null,"".concat(N("Are you sure you wish to permanently delete estimate"),": ").concat(null===x||void 0===x?void 0:x.name)),s.a.createElement("br",null),s.a.createElement("label",null,"\n".concat(N("Please enter 'DELETE' in the field below to confirm"),".")),s.a.createElement(d.a,{className:"Delete_Input",placeholder:N("DELETE"),onChange:function(e){return Z(e.target.value)},value:K,autoFocus:!0})),s.a.createElement(w,{title:s.a.createElement(c.a,{justify:"space-between",align:"middle",className:"Modal_Title"},s.a.createElement(u.a,null,N(i)),s.a.createElement(u.a,{className:"Modal_Title_Filter"},s.a.createElement(d.a,{placeholder:"Search",prefix:s.a.createElement(T.a,{icon:["fal","search"]}),type:"text",onChange:function(e){return _(e.target.value)}}))),visible:t,onOk:a,onCancel:n,closable:!0,footer:null,className:"Modal_Container Modal_Container_Top"},s.a.createElement("div",{className:"Template_Container"},s.a.createElement("div",{className:"Template_Section"},s.a.createElement("p",null,N("Estimates")),s.a.createElement(h.a,{type:"text",icon:s.a.createElement(T.a,{icon:["fal","plus-circle"]}),className:"Action_Button",onClick:g,disabled:A||!P,loading:A},N("Add New Estimate")),ne),s.a.createElement("div",{className:"Divider_Section"},s.a.createElement(O.a,{type:"vertical"})),s.a.createElement("div",{className:"Folder_Section"},s.a.createElement("p",null,N("Files")),s.a.createElement(te,{filterValue:C,onDoubleClickDrive:v,onCancel:n})))))}),ae=n(35),oe=n(592),ie=n(37),re=function(e){Object(B.a)(n,e);var t=Object(H.a)(n);function n(){var e;Object(U.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={isAdding:!1,idUpdating:"",estimates:[],activeEstimate:{}},e.estimateStoreUpdated=function(t){switch(t){case"updateEstimates":e.setState({estimates:M.f.getEstimates(),isAdding:!1,idUpdating:""});break;case"updateActiveEstimate":e.setState({activeEstimate:M.f.getActiveEstimate()})}},e.addEstimate=function(){e.setState({isAdding:!0}),ae.g.sendUpdate({action:"add_estimate",projectId:M.m.getActiveProjectId(),name:e.props.t("Tender")})},e.onDeleteEstimate=function(t,n){e.setState({idUpdating:n}),ae.g.sendUpdate({action:"delete_estimate",projectId:t,estimateId:n})},e.onRenameEstimate=function(t,n,a){e.setState({idUpdating:n}),ae.g.sendUpdate({action:"edit_estimate",projectId:t,estimateId:n,name:a})},e.onCopyEstimate=function(t,n){e.setState({idUpdating:n}),M.l.onSendMessage(ie.f.GEO_ESTIMATE,{action:ie.d.DUPLICATE,geoProjectId:t,estimateId:n})},e.onLockEstimate=function(t,n,a){e.setState({idUpdating:n}),ae.g.sendUpdate({action:"lock_estimate",projectId:t,estimateId:n,locked:a})},e}return Object(W.a)(n,[{key:"componentDidMount",value:function(){this.setState({estimates:M.f.getEstimates(),activeEstimate:M.f.getActiveEstimate()}),this.unsubscribeEstimateStore=M.f.listen(this.estimateStoreUpdated)}},{key:"componentWillUnmount",value:function(){this.unsubscribeEstimateStore()}},{key:"render",value:function(){var e=this.props,t=e.visible,n=e.onCancel,a=e.onAccept,o=e.top,i=e.title,r=e.withFilter,l=e.type,c=e.onDoubleClickDrive,u=this.state,d=u.estimates,p=u.activeEstimate,g=u.isAdding,h=u.idUpdating;return s.a.createElement(ne,{visible:t,onCancel:n,onAccept:a,top:o,title:i,withFilter:r,type:l,estimates:d,activeEstimate:p,isAdding:g,idUpdating:h,addEstimate:this.addEstimate,onDeleteEstimate:this.onDeleteEstimate,onRenameEstimate:this.onRenameEstimate,onCopyEstimate:this.onCopyEstimate,onLockEstimate:this.onLockEstimate,onDoubleClickDrive:c})}}]),n}(s.a.Component),se=Object(oe.a)()(re),le=n(30),ce=function(e){var t=e.item,n=e.onBlur,a=e.object,i=e.objectName,l=e.onPressEnter,c=e.treeInput,u=Object(r.useState)(t[a]),p=Object(o.a)(u,2),g=p[0],h=p[1];return s.a.createElement(d.a,{placeholder:i,autoFocus:!0,onBlur:n,value:g,onChange:function(e){return h(e.target.value)},onPressEnter:function(){l(t.id,g,!1,a),n()},className:"".concat(c&&"Tree_Input")})},ue=(n(838),function(e){var t=e.treeData,n=e.type,a=e.onUpdateFolder,i=e.isAddingFolder,c=e.onAddFolder,u=e.onDeleteFolder,d=e.selectedNodeId,p=e.onChangeSelectedNodeId,g=Object(l.a)().t,m=Object(r.useState)(),f=Object(o.a)(m,2),A=f[0],E=f[1],S=Object(r.useState)(),b=Object(o.a)(S,2),I=b[0],y=b[1],v=function(e){return s.a.createElement(q.a,{className:"Calculate_Rows_ContextMenu"},s.a.createElement(q.a.Item,{key:"delete",onClick:function(){return u(e.id)},danger:!0},s.a.createElement(T.a,{icon:["fal","trash"]}),g("Delete")))},N=function(e,t){E(e),y(t)},O=function(){E(),y()};return s.a.createElement(s.a.Fragment,null,s.a.createElement(h.a,{type:"text",icon:s.a.createElement(T.a,{icon:["fal","plus-circle"]}),className:"Action_Button",disabled:i,loading:i,onClick:function(){return c(d,g("New Folder"))}},g("Add folder")),s.a.createElement(Q.a,{treeData:t,titleRender:"drive"===n?function(e){return s.a.createElement(G.a,{overlay:function(){return v(e)},trigger:["contextMenu"]},A!==e.id?s.a.createElement("div",{className:"Item_Container"},s.a.createElement("label",{onDoubleClick:function(){return N(e.id,"name")}},e.name?e.name:s.a.createElement("span",{className:"Empty_Item"},"Name"))):s.a.createElement("div",{className:"Item_Container"},s.a.createElement(ce,{item:e,object:"name",objectName:"Name",treeInput:!0,onBlur:O,onPressEnter:a})))}:function(e){return s.a.createElement(G.a,{overlay:function(){return v(e)},trigger:["contextMenu"]},A!==e.id?s.a.createElement("div",{className:"Item_Container"},s.a.createElement("label",{onDoubleClick:function(){return N(e.id,"tag")}},e.tag?e.tag:s.a.createElement("span",{className:"Empty_Item"},"Nr/Tag")),s.a.createElement("label",{onDoubleClick:function(){return N(e.id,"name")}},e.name?e.name:s.a.createElement("span",{className:"Empty_Item"},"Name"))):"tag"===I?s.a.createElement("div",{className:"Item_Container"},s.a.createElement(ce,{item:e,object:"tag",objectName:"Nr/Tag",treeInput:!0,onBlur:O,onPressEnter:a}),s.a.createElement("label",{onDoubleClick:function(){return N(e.id,"name")}},e.name?e.name:s.a.createElement("span",{className:"Empty_Item"},"Name"))):s.a.createElement("div",{className:"Item_Container"},s.a.createElement("label",{onDoubleClick:function(){return N(e.id,"tag")}},e.tag?e.tag:s.a.createElement("span",{className:"Empty_Item"},"Nr/Tag")),s.a.createElement(ce,{item:e,object:"name",objectName:"Name",treeInput:!0,onBlur:O,onPressEnter:a})))},defaultExpandAll:!0,autoExpandParent:!0,showLine:{showLeafIcon:!1},showIcon:!0,className:"Templates_Tree",selectedKeys:[d],onSelect:function(e){return p(e[0])},draggable:!0,onDrop:function(e){var t=e.dragNode,n=e.node,o=e.dropPosition;a(t.id,!1,-1===o?null:n.id,!1)}}))}),de=(n(839),function(e){var t=e.visible,n=e.onCancel,a=e.onAccept,i=e.isAdding,d=e.isAddingFolder,p=e.idUpdating,g=e.templates,m=e.activeTemplate,f=e.selectedNodeId,A=e.type,E=e.onChangeActiveTemplate,S=e.onAddTemplate,b=e.onDeleteTemplate,I=e.onDuplicateTemplate,y=e.onUpdateTemplate,v=e.onAddFolder,N=e.onUpdateFolder,P=e.onDeleteFolder,R=e.onChangeSelectedNodeId,L=Object(l.a)().t,C=Object(r.useState)(""),_=Object(o.a)(C,2),k=_[0],D=_[1],x=s.a.createElement(X.a,{spin:!0}),F=g.length>0&&s.a.createElement(J.a.Group,{value:m.id},g.map((function(e,t){return s.a.createElement(J.a,{key:t,value:e.id,onClick:function(){return E(e)}},e.id===k?s.a.createElement(ce,{item:e,object:"name",onBlur:function(){return D("")},onPressEnter:y}):s.a.createElement("div",{className:"Template_Estimate_Name"},L(e.name)),p===e.id?s.a.createElement(z.a,{indicator:x}):s.a.createElement(G.a,{overlay:s.a.createElement(q.a,{className:"Calculate_Rows_ContextMenu"},s.a.createElement(q.a.Item,{key:"rename",onClick:function(){return D(e.id)}},s.a.createElement(T.a,{icon:["fal","edit"]}),L("Rename")),s.a.createElement(q.a.Item,{key:"duplicate",onClick:function(){return I(e.id)}},s.a.createElement(T.a,{icon:["fal","copy"]}),L("Duplicate")),s.a.createElement(O.a,null),s.a.createElement(q.a.Item,{key:"delete",danger:!0,onClick:function(){return b(e.id)},disabled:p===e.id},s.a.createElement(T.a,{icon:["fal","trash"]}),L("Delete"))),trigger:["click"]},s.a.createElement(h.a,{type:"text",icon:s.a.createElement(T.a,{icon:["fal","ellipsis-h-alt"]}),disabled:i||d})))})));return s.a.createElement(w,{title:s.a.createElement(c.a,{justify:"space-between",align:"middle",className:"Modal_Title"},s.a.createElement(u.a,null,L("Folder Templates"))),visible:t,onOk:a,onCancel:n,closable:!0,maskClosable:!1,footer:null,className:"Modal_Container"},s.a.createElement("div",{className:"Template_Container"},s.a.createElement("div",{className:"Template_Section"},s.a.createElement(h.a,{type:"text",icon:s.a.createElement(T.a,{icon:["fal","plus-circle"]}),className:"Action_Button",disabled:i||d,loading:i,onClick:S},L("Add template")),F),s.a.createElement("div",{className:"Divider_Section"},s.a.createElement(O.a,{type:"vertical"})),s.a.createElement("div",{className:"Folder_Section"},g.length>0&&s.a.createElement(ue,{treeData:M.p.buildTreeStructure(m.folders),type:A,selectedNodeId:f,onUpdateFolder:N,isAddingFolder:d,onAddFolder:v,onDeleteFolder:P,onChangeSelectedNodeId:R}))))}),pe=function(e){Object(B.a)(n,e);var t=Object(H.a)(n);function n(){var e;Object(U.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={isAdding:!1,isAddingFolder:!1,idUpdating:"",templates:[],activeTemplate:{},selectedNodeId:void 0,companyId:""},e.templatesStoreUpdated=function(t){switch(t){case"updateCalcTemplates":e.setState({templates:M.p.getCalcTemplates(),activeTemplate:M.p.getActiveCalcTemplate(),isAdding:!1,isAddingFolder:!1,idUpdating:""});break;case"updateDriveTemplates":e.setState({templates:M.p.getDriveTemplates(),activeTemplate:M.p.getActiveDriveTemplate(),isAdding:!1,isAddingFolder:!1,idUpdating:""});break;case"updateActiveCalcTemplate":e.setState({activeTemplate:M.p.getActiveCalcTemplate()});break;case"updateActiveDriveTemplate":e.setState({activeTemplate:M.p.getActiveDriveTemplate()});break;case"onDeleteTemplateFolder":e.setState({selectedNodeId:void 0})}},e.onChangeActiveTemplate=function(t){t.id!==e.state.activeTemplate.id&&("drive"===t.type?(M.p.setActiveDriveTemplate(t),e.setState({selectedNodeId:void 0})):(M.p.setActiveCalcTemplate(t),e.setState({selectedNodeId:void 0})))},e.onAddTemplate=function(){e.setState({isAdding:!0}),ae.g.sendUpdate({action:"add_template",companyId:e.state.companyId,name:e.props.t("New template"),type:e.props.type})},e.onDeleteTemplate=function(t,n){e.setState({idUpdating:t}),ae.g.sendUpdate({action:"delete_template",id:t,type:e.props.type,companyId:n})},e.onDuplicateTemplate=function(t,n){e.setState({idUpdating:t}),ae.g.sendUpdate({action:"duplicate_template",id:t,type:e.props.type,companyId:n})},e.onUpdateTemplate=function(t,n,a){e.setState({idUpdating:t}),ae.g.sendUpdate({action:"update_template",id:t,name:n,type:e.props.type,companyId:a})},e.onAddFolder=function(t,n,a){e.setState({idUpdating:e.state.activeTemplate.id,isAddingFolder:!0}),t?ae.g.sendUpdate({action:"add_template_folder",templateId:e.state.activeTemplate.id,parentId:t,name:n,type:e.props.type,companyId:a}):ae.g.sendUpdate({action:"add_template_folder",templateId:e.state.activeTemplate.id,name:n,type:e.props.type,companyId:a})},e.onUpdateFolder=function(t,n,a,o,i){var r;(e.setState({idUpdating:e.state.activeTemplate.id}),o&&n)?ae.g.sendUpdate((r={action:"update_template_folder",id:t},Object(le.a)(r,o,n),Object(le.a)(r,"type",e.props.type),Object(le.a)(r,"companyId",i),r)):o||n||ae.g.sendUpdate({action:"update_template_folder",id:t,parentId:a,type:e.props.type,companyId:i})},e.onDeleteFolder=function(t,n){e.setState({idUpdating:e.state.activeTemplate.id,selectedNodeId:void 0}),ae.g.sendUpdate({action:"delete_template_folder",id:t,templateId:e.state.activeTemplate.id,type:e.props.type,companyId:n})},e.onChangeSelectedNodeId=function(t){e.setState({selectedNodeId:t})},e}return Object(W.a)(n,[{key:"componentDidMount",value:function(){"drive"===this.props.type?this.setState({companyId:M.m.getActiveProject().toJS().department.company.id,templates:M.p.getDriveTemplates(),activeTemplate:M.p.getActiveDriveTemplate()}):this.setState({companyId:M.m.getActiveProject().toJS().department.company.id,templates:M.p.getCalcTemplates(),activeTemplate:M.p.getActiveCalcTemplate()}),this.unsubscribeEstimateStore=M.p.listen(this.templatesStoreUpdated)}},{key:"componentWillUnmount",value:function(){this.unsubscribeEstimateStore()}},{key:"render",value:function(){var e=this,t=this.props,n=t.visible,a=t.onCancel,o=t.onAccept,i=t.type,r=this.state,l=r.isAdding,c=r.isAddingFolder,u=r.idUpdating,d=r.templates,p=r.selectedNodeId,g=r.companyId,h=r.activeTemplate;return s.a.createElement(de,{visible:n,onCancel:a,onAccept:o,isAdding:l,isAddingFolder:c,idUpdating:u,selectedNodeId:p,companyId:g,templates:d,type:i,activeTemplate:h,onChangeActiveTemplate:this.onChangeActiveTemplate,onAddTemplate:this.onAddTemplate,onDeleteTemplate:function(t){return e.onDeleteTemplate(t,g)},onDuplicateTemplate:function(t){return e.onDuplicateTemplate(t,g)},onUpdateTemplate:function(t,n){return e.onUpdateTemplate(t,n,g)},onAddFolder:function(t,n){return e.onAddFolder(t,n,g)},onUpdateFolder:function(t,n,a,o){return e.onUpdateFolder(t,n,a,o,g)},onDeleteFolder:function(t){return e.onDeleteFolder(t,g)},onChangeSelectedNodeId:this.onChangeSelectedNodeId})}}]),n}(s.a.Component),ge=Object(oe.a)()(pe),he=n(508),me=n(48),fe=n.n(me),Ae=n(2617),Ee=(n(846),n(568)),Te=n.n(Ee),Se=[{languageKey:"en",nativeName:"English"},{languageKey:"sv",nativeName:"Svenska"},{languageKey:"no",nativeName:"Norsk"},{languageKey:"da",nativeName:"Danska"},{languageKey:"nl",nativeName:"Nederlands"},{languageKey:"es",nativeName:"Espa\xf1ol"}],be=function(e){Object(B.a)(n,e);var t=Object(H.a)(n);function n(){var e;Object(U.a)(this,n);for(var a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))).state={selectedLanguage:e.initialLanguage(),email:"",password:"",loginFilled:!1},e.authenticationStoreUpdated=function(t){switch(t){case"setLanguage":e.onLanguageSelect(M.b.getLanguage())}},e.onLanguageSelect=function(t){var n=e.props.i18n,a=Object(p.get)(Object(p.find)(Se,(function(e){return e.languageKey===t})),"nativeName");n.changeLanguage(a),e.setState({selectedLanguage:a}),localStorage.setItem("language",t),e.shouldReloadAfterChangingLocalization(a,e.state.selectedLanguage)&&setTimeout((function(){return window.location.reload()}),500)},e.capitalizeFirstLetter=function(e){return e[0].toUpperCase()+e.substr(1)},e.renderOption=function(t){return s.a.createElement(s.a.Fragment,null,e.capitalizeFirstLetter(t))},e}return Object(W.a)(n,[{key:"componentDidMount",value:function(){this.props.i18n.changeLanguage(this.initialLanguage()),this.unsubscribeAuthenticationStore=M.b.listen(this.authenticationStoreUpdated)}},{key:"componentWillUnmount",value:function(){this.unsubscribeAuthenticationStore()}},{key:"initialLanguage",value:function(){return localStorage.getItem("language")||"en"}},{key:"shouldReloadAfterChangingLocalization",value:function(e,t){var n=["en","da","nl"];return n.includes(t)!==n.includes(e)||!n.includes(t)&&!n.includes(e)}},{key:"render",value:function(){var e=this,t=this.props.t;return s.a.createElement("div",{className:"LoginWrapper_Wrapper"},s.a.createElement(Ae.a,{className:"LoginWrapper_Card ".concat(this.props.horizontalTitle&&"LoginWrapper_Card_Horizontal")},this.props.horizontalTitle?s.a.createElement("div",{className:"LoginWrapper_Card_Title_Container_Horizontal"},s.a.createElement("img",{src:"/logo.png",className:"LoginWrapper_Card_GeometraLogo_Horizontal",alt:"Geometra-Logo"}),s.a.createElement("label",{className:"LoginWrapper_Card_Title_Horizontal"},t(this.props.cardTitle))):s.a.createElement("div",{className:"LoginWrapper_Card_Title_Container"},s.a.createElement("img",{src:"/logo.png",className:"LoginWrapper_Card_GeometraLogo",alt:"Geometra-Logo"}),s.a.createElement("label",{className:"LoginWrapper_Card_Title"},t(this.props.cardTitle))),this.props.children),s.a.createElement("div",null,s.a.createElement("img",{src:Te.a,className:"LoginWrapper_RukkorLogo"})),s.a.createElement("div",{className:"LoginWrapper_LanguageSelect_Wrapper"},s.a.createElement(A.a,{dropdownMatchSelectWidth:!1,menuItemSelectedIcon:s.a.createElement(T.a,{className:"LoginWrapper_LanguageSelect_Option_Icon--selected",icon:["fal","check-circle"]}),className:"LoginWrapper_LanguageSelect",suffixIcon:s.a.createElement(T.a,{className:"LoginWrapper_LanguageSelect_Icon",icon:["fal","caret-right"]}),defaultValue:this.state.selectedLanguage,onChange:this.onLanguageSelect},Se.map((function(t){return s.a.createElement(A.a.Option,{value:t.languageKey,key:t.languageKey},e.renderOption(t.nativeName))})))))}}]),n}(fe.a.PureComponent),Ie=Object(oe.a)()(Object(Z.i)(be)),ye=function(e){var t=e.error,n=e.resetErrorBoundary;return s.a.createElement("div",{role:"alert"},s.a.createElement("p",null,"Something went wrong:"),s.a.createElement("pre",null,t.message),s.a.createElement("button",{onClick:n},"Try again"))},ve=(n(847),function(e){var t=e.notStarted,n=e.progress,a=e.review,o=e.complete;return s.a.createElement("div",{className:"Status"},n&&s.a.createElement("div",{className:"Status_Part Status_Part_left-top"}),a&&s.a.createElement("div",{className:"Status_Part Status_Part_right-top"}),t&&s.a.createElement("div",{className:"Status_Part Status_Part_left-bottom"}),o&&s.a.createElement("div",{className:"Status_Part Status_Part_right-bottom"}),s.a.createElement("div",{id:"Cross"}))})},240:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(5),o=function(e){var t=e.keyCode,n=e.ctrlKey,o=e.altKey,i=e.shiftKey;switch(t){case 70:o&&n&&(a.j.showFeedbackDialog(),e.preventDefault(),e.stopPropagation());break;case 32:i&&(a.j.onFocusSearchInput(),e.preventDefault(),e.stopPropagation())}}},241:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));var a=n(5),o=function(e){var t=a.b.getRole();return("INPUT"===e.target.tagName.toUpperCase()&&"CHECKBOX"!==e.target.type.toUpperCase()||"TEXTAREA"===e.target.tagName.toUpperCase())&&"Reply..."!==e.target.placeholder||!t}},2444:function(e,t,n){},252:function(e,t,n){"use strict";var a=n(25),o=n(29),i=n(43),r=n(44),s=n(19),l=n(10),c=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"getAnnotationsToUpdate",value:function(e){var t=new l.a.List;return e.forEach((function(e){if("group"===e.get("type")){var n=s.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return"group"!==e.get("type")}));t=t.concat(n)}else t=t.push(e)})),t}},{key:"getAnnotationsFioldersToUpdate",value:function(e){var t=new l.a.List;return e.forEach((function(e){if(t=t.push(e),"group"===e.get("type")){var n=s.a.getAllAnnotationsFromParent(e.get("id"));t=t.concat(n)}})),t}}]),e}(),u=n(110),d=n(102),p=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"deleteAnnotations",value:function(e){var t=new l.a.List,n=new l.a.List;if(e.forEach((function(e){"x-scale"===e.get("type")||"y-scale"===e.get("type")?n=n.push(e):t=t.push(e)})),n&&n.size>0){var a=e.toJS()[0];(Object(d.a)(s.a.getActivePageId())&&"x-scale"!==a.type||!Object(d.a)(s.a.getActivePageId()))&&s.a.onRequestScaleDelete(n)}t&&t.size>0&&(t.forEach((function(e){if("Reduction"===e.get("type")){var t=s.a.getAnnotationByAnnotationId(e.get("parentId"));t&&s.a.getReductionByParentAnnotationId(t.get("annotationId")).sort((function(e,t){return e.get("id")<t.get("id")?-1:e.get("id")>t.get("id")?1:0})).forEach((function(n,a){return n.get("id")!==e.get("id")||(u.a.requestDeleteReductionFromRow("R"+(a+1),t),!1)}))}})),s.a.onRequestAnnotationDelete(t))}}]),n}(c);t.a=p},2551:function(e,t,n){},2552:function(e,t,n){},2553:function(e,t,n){},2558:function(e,t,n){},2559:function(e,t,n){},2560:function(e,t,n){},2561:function(e,t,n){},2562:function(e,t,n){},2563:function(e,t,n){},257:function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"a",(function(){return s}));var a=n(0),o=n.n(a),i=n(422),r=(n(832),function(e){var t=e.message,n=e.shortcut,a=Object(i.a)().t;return o.a.createElement("div",{className:"Message"},o.a.createElement("label",null,a(t)),n&&o.a.createElement("label",{className:"Message_Shortcut"},a(n)))}),s=function(e){var t=e.description,n=Object(i.a)().t;return o.a.createElement("div",null,o.a.createElement("label",null,n(t)))}},2571:function(e,t,n){},2572:function(e,t,n){},2573:function(e,t,n){},2574:function(e,t,n){},2575:function(e,t,n){},2576:function(e,t,n){},2577:function(e,t,n){},2578:function(e,t,n){},2579:function(e,t,n){},2580:function(e,t,n){},2581:function(e,t,n){},2582:function(e,t,n){},2583:function(e,t,n){},2584:function(e,t,n){},2585:function(e,t,n){},2587:function(e,t,n){},2588:function(e,t,n){},2589:function(e,t,n){},2590:function(e,t,n){},2591:function(e,t,n){},2592:function(e,t,n){},2593:function(e,t,n){},2594:function(e,t,n){},2595:function(e,t,n){e.exports=n.p+"static/media/Terms_Of_Service.af3c6fea.md"},2596:function(e,t,n){},2598:function(e,t,n){},274:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["initSocket","sendMessage","closeSocket"]);t.a=o},288:function(e,t,n){"use strict";n.d(t,"c",(function(){return p})),n.d(t,"a",(function(){return g})),n.d(t,"d",(function(){return f})),n.d(t,"b",(function(){return T}));var a=n(34),o=n(109),i=n(33),r=n(0),s=n.n(r),l=n(85),c=n(16),u=n(83),d=n(101),p=(n(840),function(e){var t=e.onChangeQuickSwitch,n=e.projectDetails,p=e.treeData,g=e.selectedNode,h=e.onNodeBack,m=Object(r.useState)(null),f=Object(i.a)(m,2),A=f[0],E=f[1],T=Object(r.useRef)(g),S=Object(r.useRef)(),b=Object(r.useRef)({shortPath:null,actualComponentsWidth:null});Object(r.useEffect)((function(){return window.addEventListener("resize",I),function(){return window.removeEventListener("resize",I)}}),[]),Object(r.useEffect)((function(){T.current=g,y()}),[g,p,n]);var I=function(){var e=window.innerWidth-b.current.actualComponentsWidth;e<=60&&!1===b.current.shortPath&&y(),e>=60&&!0===b.current.shortPath&&y()},y=function(){!function e(t,n){var a=t.find((function(e){return e.key===n}));if(a)S.current=a.path;else{var i,r=Object(o.a)(t);try{for(r.s();!(i=r.n()).done;){e(i.value.children,n)}}catch(s){r.e(s)}finally{r.f()}}}(Object(d.f)(p),T.current.key);var e=[].concat(Object(a.a)(n),[S.current]).join(" > ");b.current.actualComponentsWidth=6*e.length+320;var t=window.innerWidth-b.current.actualComponentsWidth<60;b.current.shortPath=!!t,E(t?[].concat(Object(a.a)(n.slice(1)),["...",T.current.title]).join(" > "):e)};return s.a.createElement("div",{className:"Header_Path"},s.a.createElement(l.a,{onClick:h,disabled:null===g.parentId},s.a.createElement(c.a,{icon:u.b})),A,s.a.createElement(l.a,{onClick:t},s.a.createElement(c.a,{icon:u.c})))}),g=(n(841),function(e){var t=e.onChangeQuickSwitch,n=e.projectDetails,o=e.activeFile,d=e.activeFilePath,p=Object(r.useState)(""),g=Object(i.a)(p,2),h=g[0],m=g[1],f=Object(r.useRef)({shortPath:null,actualComponentsWidth:null});Object(r.useEffect)((function(){return window.addEventListener("resize",A),function(){return window.removeEventListener("resize",A)}}),[]),Object(r.useEffect)((function(){E()}),[n]);var A=function(){var e=window.innerWidth-f.current.actualComponentsWidth;e<=150&&!1===f.current.shortPath&&E(),e>=150&&!0===f.current.shortPath&&E()},E=function(){var e=[].concat(Object(a.a)(n),Object(a.a)(d),[o]).join(" > ");f.current.actualComponentsWidth=6*e.length+320;var t=window.innerWidth-f.current.actualComponentsWidth<150;f.current.shortPath=!!t,m(t?[].concat(Object(a.a)(n.slice(1)),["...",o]).join(" > "):e)};return s.a.createElement("div",{className:"Header_Path","data-cy":"calculate_header"},h,s.a.createElement(l.a,{onClick:t},s.a.createElement(c.a,{icon:u.c})))}),h=n(422),m=n(24),f=function(e){var t=e.visible,n=e.onCancel,a=Object(h.a)().t;return s.a.createElement(m.j,{title:a("Submit Feedback"),visible:t,onCancel:n,closable:!0,width:600,footer:null},s.a.createElement("iframe",{src:"https://app.startinfinity.com/form/39d11feb-115e-47bc-9f40-d7f5f7c62435",id:"Feedback_Iframe",title:"Feedback",height:"715",className:"Feedback_Iframe"}))},A=n(2623),E=n(2615),T=function(e){var t=e.visible,a=e.onCancel,o=Object(r.useState)(""),l=Object(i.a)(o,2),c=l[0],u=l[1];return Object(r.useEffect)((function(){var e=n(842);fetch(e).then((function(e){return e.text()})).then((function(e){return u(e)}))}),[]),s.a.createElement(A.a,{className:"Modal ChangelogDialog",closable:!0,visible:t,onCancel:a,footer:null,title:"Changelog"},s.a.createElement("div",{className:"TermsOfService_Card_File_Container"},s.a.createElement("article",{className:"TermsOfService_Card_Article"},s.a.createElement(E.a,{children:c,linkTarget:"_blank"}))))}},307:function(e,t,n){"use strict";var a=n(48);t.a=Object(a.createActions)(["messageReceived"])},308:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["error","socketError","errorReceived"]);t.a=o},309:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));n(153),n(651);var a=function(e){switch(e){case"pdf":return"pdf";case"doc":case"docx":case"vnd.openxmlformats-officedocument.wordprocessingml.document":return"docx";case"xls":case"xlsx":case"vnd.openxmlformats-officedocument.spreadsheetml.sheet":return"xlsx";case"jpeg":case"jpg":return"jpeg";case"png":return"png";case"gif":return"gif";case"drawing":return"drawing";case"ifc":return"ifc";case"txt":return"txt";case"zip":return"zip";case"ppt":return"ppt";case"":return"none";default:return"object"}}},317:function(e,t,n){"use strict";n.d(t,"a",(function(){return o}));n(28);var a=n(366);Object.filter=function(e,t){return Object.keys(e).filter((function(n){return t(e[n])})).reduce((function(t,n){return t[n]=e[n],t}),{})};var o=function(e){var t=e.split(".").pop(),n=Object.filter(a,(function(e){return e.fileExtensions.includes(t)})),o=a[t],i=n[Object.keys(n)[0]];return i||{fileExtensions:[t],humanName:"".concat(t," File"),icon:o}}},318:function(e,t,n){"use strict";var a=n(25),o=n(29),i=n(43),r=n(44),s=function(e){Object(i.a)(n,e);var t=Object(r.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"init",value:function(){var e=this;try{this.calculator.setWindow(this.webviewer),this.initAnnotation.init(this.webviewer),this.initPointAnnotation.init(this.webviewer,this.calculator),this.initPolygonAnnotation.init(this,this.webviewer,this.calculator),this.initEllipseAnnotation.init(this.webviewer,this.calculator),this.initFreeHandAnnotation.init(this,this.webviewer,this.calculator),this.initPolylineAnnotation.init(this,this.webviewer,this.calculator),this.initFreeTextAnnotation.init(this.webviewer),this.initStampAnnotation.init(this.webviewer),this.arrowAnnotationCustomizer.init(this.webviewer);var t=this.webviewer.annotManager,n=this.initPointAnnotation.getPointAnnotation();t.registerAnnotationType("point",n),this.webviewer.Tools.AnnotationSelectTool.prototype.mouseMove=function(){},t.on("annotationChanged",(function(t,n){for(var a=0;a<t.length;a++)if("x-scale"===t[a].Subject||"y-scale"===t[a].Subject)switch(n){case"add":case"modify":e.calculator.setScale(t[a].getPageNumber(),t[a]);break;case"delete":e.calculator.deleteScale(t[a].getPageNumber(),t[a])}}))}catch(a){console.log("error in ViewerWebViewerInit: "+a.stack)}}}]),n}(n(350).a);t.a=s},347:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(34),o=n(12),i=n.n(o),r=function(e){if(0==e.length)return e;var t=i.a.cloneDeep(e);return s(t[0]),t},s=function e(t){var n=[];if(t.children.length>0){var i=Object(o.filter)(t.children,(function(e){return"folder"===e.type})),r=Object(o.filter)(t.children,(function(e){return"folder"!==e.type}));n=[].concat(Object(a.a)(Object(o.sortBy)(i,(function(e){return e.title}))),Object(a.a)(Object(o.sortBy)(r,(function(e){return e.title}))))}t.children=n,t.children.forEach((function(t){"folder"===t.type&&e(t)}))}},35:function(e,t,n){"use strict";n.d(t,"a",(function(){return a.a})),n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return i.a})),n.d(t,"d",(function(){return s.a})),n.d(t,"f",(function(){return l.a})),n.d(t,"g",(function(){return c.a})),n.d(t,"h",(function(){return u.a})),n.d(t,"i",(function(){return d.a})),n.d(t,"e",(function(){return p})),n.d(t,"j",(function(){return g}));var a=n(144),o=(n(178),n(155)),i=n(110),r=n(48),s=(Object(r.createActions)(["initializeClient","initializeClientContacts","initializeGeoProjectClientContacts","initializeGeoProjectExternalUserAccess"]),n(230),n(307),n(308)),l=n(156),c=n(238),u=n(89),d=n(274),p=Object(r.createActions)(["setEstimates","setAnnotations","addEstimate","deleteEstimate","editEstimate","copyEstimate","lockEstimate"]),g=Object(r.createActions)(["addTemplate","deleteTemplate","duplicateTemplate","getCalculateTemplates","updateTemplate","addTemplateFolder","deleteTemplateFolder","updateTemplateFolder"])},350:function(e,t,n){"use strict";var a=n(25),o=n(29),i=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.Annotations.Annotation.prototype.serialize;e.Annotations.Annotation.prototype.serialize=function(e,t){var a=n.call(this,e,t);switch(this.Subject){case"Polyline":case"x-scale":case"y-scale":a.setAttribute("geometraLineStart",this.geometraLineStart),a.setAttribute("geometraLineEnd",this.geometraLineEnd);break;case"Polygon":case"Reduction":case"Ellipse":case"annotation.freeHand":case"Free hand":case"Free Hand":a.setAttribute("annotationName",this.annotationName),a.setAttribute("annotationNumber",this.annotationNumber),a.setAttribute("annotationHeight",JSON.stringify(this.annotationHeight));break;case"Point":a.setAttribute("annotationName",this.annotationName),a.setAttribute("annotationNumber",this.annotationNumber);break;default:a.setAttribute("strokeColor",this.strokeColor)}return a.setAttribute("geometraOpacity",this.geometraOpacity||1),a.setAttribute("rotationControlEnabled",this.rotationControlEnabled),a.setAttribute("geometraBorderOpacity",this.geometraBorderOpacity),a.setAttribute("style",this.style),a.setAttribute("status",this.status),a.setAttribute("readOnly",this.ReadOnly),this["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"]&&(a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",this["ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",this["ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",this["ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",this["ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",this["ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH"])),this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"]&&(a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"])),this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"]&&(a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"]),a.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH"])),"Polygon"!==this.Subject&&"Reduction"!==this.Subject&&"Ellipse"!==this.Subject&&"Free Hand"!==this.Subject||(this.Bk.A=this.geometraBorderOpacity),a};var a=e.Annotations.Annotation.prototype.deserialize;e.Annotations.Annotation.prototype.deserialize=function(e,t){switch(a.call(this,e,t),"true"===e.getAttribute("rotationControlEnabled")?this.setRotationControlEnabled(!0):this.setRotationControlEnabled(!1),this.Subject){case"Polyline":this.geometraLineStart=e.getAttribute("geometraLineStart"),this.geometraLineEnd=e.getAttribute("geometraLineEnd"),this.annotationName=e.getAttribute("annotationName"),this.annotationNumber=e.getAttribute("annotationNumber"),this.annotationHeight=e.getAttribute("annotationHeight")&&"undefined"!=e.getAttribute("annotationHeight")&&"null"!=e.getAttribute("annotationHeight")?JSON.parse(e.getAttribute("annotationHeight")):void 0;break;case"x-scale":case"y-scale":this.geometraLineStart=e.getAttribute("geometraLineStart"),this.geometraLineEnd=e.getAttribute("geometraLineEnd");break;case"Polygon":case"Reduction":case"Ellipse":case"annotation.freeHand":case"Free hand":case"Free Hand":this.annotationName=e.getAttribute("annotationName"),this.annotationNumber=e.getAttribute("annotationNumber"),this.annotationHeight=e.getAttribute("annotationHeight")&&"undefined"!=e.getAttribute("annotationHeight")&&"null"!=e.getAttribute("annotationHeight")?JSON.parse(e.getAttribute("annotationHeight")):void 0;break;case"Point":this.annotationName=e.getAttribute("annotationName"),this.annotationNumber=e.getAttribute("annotationNumber");break;default:this.strokeColor=e.getAttribute("strokeColor")}this.status=e.getAttribute("status"),this.rotationControlEnabled="true"===e.getAttribute("rotationControlEnabled"),this.ReadOnly="true"===e.getAttribute("readOnly");var n=parseFloat(e.getAttribute("geometraOpacity")),o=parseFloat(e.getAttribute("geometraBorderOpacity"));Number.isNaN(n)?this.geometraOpacity=.5:this.geometraOpacity=n,Number.isNaN(o)?this.geometraBorderOpacity=.5:this.geometraBorderOpacity=o,this.Hidden=!1,e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&(this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")):void 0),this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")):void 0,this["ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH"]=e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")?Number.parseFloat(e.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")):void 0},t?(e.Annotations.ControlHandle.prototype.draw=function(e,t,n,a){var o=this.getDimensions(t,n,a);e.save(),e.beginPath(),e.strokeStyle="rgba(90,177,74,1.0)",e.lineWidth=.15;var i=o.x1+o.getWidth()/2,r=o.y1+o.getHeight()/2;e.moveTo(i-o.getWidth(),r),e.lineTo(i+o.getWidth(),r),e.moveTo(i,r-o.getHeight()),e.lineTo(i,r+o.getHeight()),e.stroke(),e.restore(),e.save(),e.fillStyle="rgba(255,255,255,0.6)",e.fillRect(o.x1,o.y1,o.getWidth(),o.getHeight()),e.strokeStyle="rgba(90,177,74,1.0)",e.lineWidth=.15,e.strokeRect(o.x1,o.y1,o.getWidth(),o.getHeight()),e.restore()},e.Annotations.SelectionAlgorithm.canvasVisibilityPadding=0,e.Annotations.SelectionModel.prototype.testSelection=function(t,n,a,o){return e.Annotations.SelectionAlgorithm.canvasVisibilityTest(t,n,a,o)}):e.Annotations.ControlHandle.prototype.draw=function(e,t,n,a){},e.Annotations.SelectionModel.prototype.drawSelectionOutline=function(e,t,n){if("Free text"===t.Subject){e.save();var a=t.getRect();e.beginPath(),e.moveTo(a.x1,a.y1),e.lineTo(a.x2,a.y1),e.lineTo(a.x2,a.y2),e.lineTo(a.x1,a.y2),e.lineTo(a.x1,a.y1),e.setLineDash([3]),e.strokeStyle="rgba(90,177,74,0.7)",e.lineWidth="0.5",e.stroke(),e.restore()}};var o=e.Annotations.LineAnnotation.prototype.draw;e.Annotations.LineAnnotation.prototype.draw=function(e,t){if("SnapOnHelper"===this.Subject){var n=this.getStartPoint(),a=this.getEndPoint();e.save(),e.setLineDash([.2]),e.lineWidth=.45,e.strokeStyle="rgba(90,177,74,0.9)",e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(a.x,a.y),e.stroke(),e.restore(),e.save(),e.strokeStyle="rgba(90,177,74,1.0)",e.lineWidth=.25,e.beginPath(),e.moveTo(n.x,n.y),e.moveTo(n.x-1.5,n.y-1.5),e.lineTo(n.x+1.5,n.y-1.5),e.lineTo(n.x+1.5,n.y+1.5),e.lineTo(n.x-1.5,n.y+1.5),e.lineTo(n.x-1.5,n.y-1.5),e.stroke(),e.restore()}else o.apply(this,arguments)}}}]),e}(),r=n(19),s=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t){var n=!1,a=e.Tools.AnnotationEditTool.prototype.mouseLeftDown;e.Tools.AnnotationEditTool.prototype.mouseLeftDown=function(e){e.altKey?(n=!0,this.mouseLeftUp(e),n=!1):a.call(this,e)};var o=e.Tools.AnnotationEditTool.prototype.mouseLeftUp;e.Tools.AnnotationEditTool.prototype.mouseLeftUp=function(a){if(!a.altKey||n){if(a.shiftKey||a.altKey){r.a.lockAnnotationManagerModify();var i=e.annotManager,s=i.getSelectedAnnotations();if(1===s.length&&("Polyline"===s[0].Subject||"Polygon"===s[0].Subject||"Reduction"===s[0].Subject))if(a.shiftKey&&a.altKey){var l=t.getClosestPointIndex(this.pageCoordinates[1],s[0]);if(l>=0){var c=s[0].getPath();switch(s[0].Subject){case"Polygon":case"Reduction":c.length>4&&r.a.removePointFromAnnotationFromConfig(s[0],l);break;case"Polyline":c.length>2&&r.a.removePointFromAnnotationFromConfig(s[0],l)}}}else if(a.altKey){var u=t.getPathIndex(this.pageCoordinates[1],s[0]);if(u>=0){i.redrawAnnotation(s[0]);var d=e.docViewer.getCurrentPage(),p=e.docViewer.getDocument().getPDFCoordinates(d,this.pageCoordinates[1].x,this.pageCoordinates[1].y);r.a.addPointToAnnotationFromConfig(s[0],p,u)}}}o.apply(this,arguments),r.a.unlockAnnotationManagerModify()}}}}]),e}(),l=n(81),c=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t){e.Annotations.LineSelectionModel.prototype.drawSelectionOutline=function(){};var n=e.Annotations.LineAnnotation.prototype.serialize;e.Annotations.LineAnnotation.prototype.serialize=function(e,t){var a=n.call(this,e,t);return a.setAttribute("Hidden",this.Hidden),a};var a=e.Annotations.LineAnnotation.prototype.deserialize;e.Annotations.LineAnnotation.prototype.deserialize=function(e,t){a.call(this,e,t),this.Hidden="true"===e.getAttribute("Hidden")};var o=e.Annotations.LineAnnotation.prototype.draw;e.Annotations.LineAnnotation.prototype.draw=function(e){switch(e.save(),this.Style){case"dashed":e.setLineDash(l.a);break;case"dotted":e.setLineDash(l.b);break;case"dot-dash-dot":e.setLineDash(l.c)}o.apply(this,arguments),e.restore(),e.save()}}}]),e}(),u=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e){var t=e.Tools.ArrowCreateTool,n=t.prototype.mouseLeftUp;t.prototype.mouseLeftUp=function(){this.annotation&&(this.annotation.Subject="Arrow",n.apply(this,arguments))}}}]),e}(),d=n(43),p=n(44),g=n(99),h=n(10),m=(n(15),n(49)),f=function(){function e(){Object(a.a)(this,e),this.GEOMETRA_TEXT_NO_FONT="undefined",this.GEOMETRA_TEXT_FONT="8px Arial",this.GEOMETRA_TEXT_FILL_STYLE="#CC0000",this.GEOMETRA_DASHED_LINE_STYLE="#00cf83",this.GEOMETRA_FONT_SIZE_INT="undefined",this.GEOMETRA_FONT_TYPE="px Arial",this.window=void 0,this.xScaleMap=new h.a.Map,this.yScaleMap=new h.a.Map}return Object(o.a)(e,[{key:"getVerticesFromXfdf",value:function(e){var t=void 0,n=(new DOMParser).parseFromString(e,"text/xml"),a=n.getElementsByTagName("vertices")[0];return a||(a=n.getElementsByTagName("gesture")[0]),a&&(t=a.childNodes[0].nodeValue)&&(t=t.split(";").map((function(e){var t=e.split(",");return[parseFloat(t[0]),parseFloat(t[1])]}))),t}},{key:"getValueToDisplay",value:function(e,t){if(e)switch(t){case"m":return r.a.showUsUnits()?r.a.toUs(e):e.toLocaleString(m.a.getIntlLang())+" m";case"m2":return r.a.showUsUnits()?r.a.toUsSquared(e):e.toLocaleString(m.a.getIntlLang())+" m\xb2";case"m3":return r.a.showUsUnits()?r.a.toUsVolume(e):e.toLocaleString(m.a.getIntlLang())+" m\xb3"}}},{key:"svgString2Image",value:function(e,t,n,a,o){a=a||"png";var i=document.createElement("canvas"),r=i.getContext("2d");i.width=t,i.height=n;var s=new Image;return s.src=e,r.clearRect(0,0,t,n),r.drawImage(s,0,0,t,n),r.alpha=o,i.toDataURL("image/"+a)}},{key:"setScale",value:function(e,t){"x-scale"===t.Subject?(t.converted&&(this.yScaleMap=this.yScaleMap.set(e,void 0)),this.xScaleMap=this.xScaleMap.set(e,t)):"y-scale"===t.Subject&&(this.yScaleMap=this.yScaleMap.set(e,t))}},{key:"deleteScale",value:function(e,t){"x-scale"===t.Subject?this.xScaleMap=this.xScaleMap.set(e,void 0):"y-scale"===t.Subject&&(this.yScaleMap=this.yScaleMap.set(e,void 0))}},{key:"getDistanceFromPageCoordToPathPoint",value:function(e,t){var n=t.x-e.x,a=t.y-e.y;return Math.sqrt(Math.pow(n,2)+Math.pow(a,2))}},{key:"getClosestPointIndex",value:function(e,t){for(var n=-1,a=3,o=t.getPath(),i=0;i<o.length;i++){var r=this.getDistanceFromPageCoordToPathPoint(o[i],e);r<a&&(a=r,n=i)}return n}},{key:"getFontSize",value:function(e){var t=3,n=void 0;if(e)switch(e.Subject){case"Polygon":for(var a=e.getPath().length,o=0;o<a-1;o++){var i=e.getPathPoint(o),r=e.getPathPoint(o+1),s=i.x-r.x,l=i.y-r.y,c=Math.sqrt(Math.pow(s,2)+Math.pow(l,2));n?c<n&&(n=c):n=c}(t=n/20)>6?t=6:t<3&&(t=3);break;case"Reduction":for(var u=e.getPath().length,d=0;d<u-1;d++){var p=e.getPathPoint(d),g=e.getPathPoint(d+1),h=p.x-g.x,m=p.y-g.y,f=Math.sqrt(Math.pow(h,2)+Math.pow(m,2));n?f<n&&(n=f):n=f}(t=n/20)>6?t=6:t<3&&(t=3);break;case"Polyline":for(var A=e.getPath().length,E=0;E<A-1;E++){var T=e.getPathPoint(E),S=e.getPathPoint(E+1),b=T.x-S.x,I=T.y-S.y,y=Math.sqrt(Math.pow(b,2)+Math.pow(I,2));n?y<n&&(n=y):n=y}(t=n/20)>6?t=6:t<3&&(t=3);break;case"Point":(t=e.Width/5)>6?t=6:t<3&&(t=3);break;case"Ellipse":(t=Math.min(e.Width,e.Height)/20)>6?t=6:t<3&&(t=3);break;case"annotation.freeHand":case"Free hand":case"Free Hand":t=Math.min(e.Width,e.Height)/20}return t}},{key:"getScale",value:function(e){return this.xScaleMap.get(e)}},{key:"getScaleValue",value:function(e){var t={xScaleValue:1,yScaleValue:1},n=this.xScaleMap.get(e),a=this.yScaleMap.get(e);if(n){var o=n.getPathPoint(1).x-n.getPathPoint(0).x,i=n.getPathPoint(1).y-n.getPathPoint(0).y,r=Math.sqrt(Math.pow(o,2)+Math.pow(i,2));if(t.xScaleValue=parseFloat(n.length)/r,a){var s=a.getPathPoint(1).x-a.getPathPoint(0).x,l=a.getPathPoint(1).y-a.getPathPoint(0).y,c=Math.sqrt(Math.pow(s,2)+Math.pow(l,2));t.yScaleValue=a.length/c}else t.yScaleValue=t.xScaleValue}return t}},{key:"getRotatedPoint",value:function(e,t,n){n=n/180*Math.PI;var a=t.x-e.x,o=t.y-e.y,i=Math.atan2(o,a),r=a*Math.cos(-i-n)-o*Math.sin(-i-n),s=o*Math.cos(-i-n)+a*Math.sin(-i-n);return new this.window.Annotations.Point(r+e.x,s+e.y)}},{key:"setWindow",value:function(e){this.window=e}},{key:"getDisplayAnnotation",value:function(e,t,n,a,o,i,r){var s=void 0,l=new this.window.Annotations.FreeTextAnnotation;l.X=t,l.Y=n;var c=new this.window.Annotations.Color;c.R=204,c.G=0,c.B=0,c.A=1,l.TextColor=c,l.Width=a,l.Height=o;var u="",d=8;e.length>0&&(s=9.6*(e.length+.5));var p=document.createElement("canvas").getContext("2d");p.save(),p.TextAlign="center",p.font=this.GEOMETRA_TEXT_FONT,p.font="Arial";for(var g=0;g<e.length;g++)u+=""+e[g].trim(),g!==e.length-1&&(u+="\n"),p.measureText(e[g]).width>d&&(d=p.measureText(e[g]).width);return p.restore(),0!==i&&i/90%2!==0?(l.Height=d-d/6,l.Width=s-s/3):(l.Width=d-d/6,l.Height=s-s/3),l.X=l.X-l.Width/2,l.Y=l.Y-l.Height/2,l.StrokeThickness=0,l.Opacity=1,l.setContents(u),l.NoRotate=!1,l.Font="Arial",l.FontSize="5",l.TextAlign="center",l.EXPORT_CALCULATED_FONT_SIZE=!0,l.Rotation=i,l.setPadding(new this.window.Annotations.Rect(0,0,0,0)),l.setPageNumber(r),l.StrokeColor=c,l}}]),e}(),A=n(55),E=function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"buildOrDrawEllipseData",value:function(e,t,n){var a=[],o=e.showNumber,i=e.showName,r=e.showArea,s=e.showNetArea,l=e.showVolume,c=e.showNetVolume,u=e.showTotalWall,d=e.showTotalNetWall,p=e.showVariables,h=e.showLength,m=e.showNetLength,f=e.newAnnotation;if(o||i||p||r||l||c||h||f||s||m||u||d){var A=e.getRect(),E=e.Y+A.getHeight()/2,T=e.X+A.getWidth()/2,S=[];if(o&&S.push("["+e.annotationNumber+"]"),i&&S.push(e.annotationName),p){if(r&&this.getScale(e.PageNumber)?S.push("A: "+this.getValueToDisplay(this.calculateEllipseArea(e.getRect(),e.getPageNumber()),"m2")):S.push("A"),s&&this.getScale(e.PageNumber)){var b=this.calculateEllipseNetArea(e,e.PageNumber);S.push("NA: "+this.getValueToDisplay(b,"m2"))}else S.push("NA");l&&this.getScale(e.PageNumber)?S.push("(VO:"+this.getValueToDisplay(this.calculateEllipseArea(e.getRect(),e.getPageNumber())*e.annotationHeight,"m3")+")"):S.push("(VO)"),c&&this.getScale(e.PageNumber)?S.push("(NVO:"+this.getValueToDisplay(this.calculateEllipseNetVolume(e,e.getPageNumber()),"m3")+")"):S.push("(NVO)"),h&&this.getScale(e.PageNumber)?S.push("L: "+this.getValueToDisplay(this.calculateEllipseCircumference(e.getRect(),e.getPageNumber()),"m")):S.push("L"),m&&this.getScale(e.PageNumber)?S.push("NL: "+this.getValueToDisplay(this.calculateEllipseNetCircumfernece(e,e.getPageNumber()),"m")):S.push("NL"),u&&this.getScale(e.PageNumber)?S.push("(V:"+this.getValueToDisplay(this.calculateEllipseCircumference(e.getRect(),e.getPageNumber())*e.annotationHeight,"m2")+")"):S.push("(V)"),d&&this.getScale(e.PageNumber)?S.push("(NV:"+this.getValueToDisplay(this.calculateEllipseNetWall(e,e.getPageNumber()),"m2")+")"):S.push("(NV)")}else if(this.getScale(e.PageNumber)){if((r||f)&&S.push(""+this.getValueToDisplay(this.calculateEllipseArea(e.getRect(),e.getPageNumber()),"m2")),s){var I=this.calculateEllipseNetArea(e,e.PageNumber);S.push(this.getValueToDisplay(I,"m2"))}l&&S.push("("+this.getValueToDisplay(this.calculateEllipseArea(e.getRect(),e.getPageNumber())*e.annotationHeight,"m3")+")"),c&&S.push("("+this.getValueToDisplay(this.calculateEllipseNetVolume(e,e.getPageNumber()),"m3")+")"),h&&S.push(this.getValueToDisplay(this.calculateEllipseCircumference(e.getRect(),e.getPageNumber()),"m")),m&&S.push(this.getValueToDisplay(this.calculateEllipseNetCircumfernece(e,e.getPageNumber()),"m")),u&&S.push("("+this.getValueToDisplay(this.calculateEllipseCircumference(e.getRect(),e.getPageNumber())*e.annotationHeight,"m2")+")"),d&&S.push("("+this.getValueToDisplay(this.calculateEllipseNetWall(e,e.getPageNumber()),"m2")+")")}if(t){var y=g.a.getInstance().getDisplayValueAnnotations(e.Id);if(y&&y.getCenterAnnotationPdf()){for(var v="",N=0;N<S.length;N++)N===S.length-1?v+=S[N]:v+=S[N]+"\n";y.getCenterAnnotationPdf().setContents(v)}}else a.push(this.getDisplayAnnotation(S,T,E,A.getWidth(),A.getHeight(),n,e.getPageNumber(),e))}return a}},{key:"compensateCircle",value:function(e){e.Width>e.Height?e.Height=e.Width:e.Width<e.Height&&(e.Width=e.Height)}},{key:"calculateEllipseArea",value:function(e,t){if(e&&e.getWidth()>0&&e.getHeight()>0){var n=this.getScaleValue(t),a=.5*e.getWidth()*n.xScaleValue,o=.5*e.getHeight()*n.yScaleValue;return Math.PI*a*o}return-1}},{key:"calculateEllipseCircumference",value:function(e,t){if(e&&e.getWidth()>0&&e.getHeight()>0){var n=this.getScaleValue(t),a=.5*e.getWidth()*n.xScaleValue,o=.5*e.getHeight()*n.yScaleValue;return 4*(a+o)*Math.pow(Math.PI/4,4*a*o/Math.pow(a+o,2))}return-1}},{key:"calculateEllipseNetCircumfernece",value:function(e,t){return e.formulaNL?r.a.parseFormulaFromConfig(e,e.formulaNL,"ESTIMATE.ANNOTATION_VALUES.LENGTH"):this.calculateEllipseCircumference(e.getRect(),t)}},{key:"calculateEllipseNetArea",value:function(e,t){return e.formulaNA?r.a.parseFormulaFromConfig(e,e.formulaNA,"ESTIMATE.ANNOTATION_VALUES.AREA"):this.calculateEllipseArea(e.getRect(),t)}},{key:"calculateEllipseNetWall",value:function(e,t){return e.formulaNV?r.a.parseFormulaFromConfig(e,e.formulaNV,"ESTIMATE.ANNOTATION_VALUES.WALL"):this.calculateEllipseCircumference(e.getRect(),e.PageNumber)*e.annotationHeight}},{key:"calculateEllipseNetVolume",value:function(e,t){return e.formulaNVO?r.a.parseFormulaFromConfig(e,e.formulaNVO,"ESTIMATE.ANNOTATION_VALUES.VOLUME"):this.calculateEllipseArea(e.getRect(),t)*e.annotationHeight}}]),n}(function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){return Object(a.a)(this,n),t.apply(this,arguments)}return Object(o.a)(n,[{key:"calculatePolygonNetArea",value:function(e){var t=this;switch(e.Subject){case"Polygon":case"Reduction":case"Free hand":case"Free Hand":case"annotation.freeHand":var n=void 0;if(e.formulaNA)return n=r.a.parseFormulaFromConfig(e,e.formulaNA,"ESTIMATE.ANNOTATION_VALUES.NET_AREA");if(n="annotation.freeHand"===e.Subject||"Free Hand"===e.Subject||"Free hand"===e.Subject?this.calculatePolygonArea(e.getPath(0),e.PageNumber):this.calculatePolygonArea(e.getPath(),e.PageNumber),"Polygon"===e.Subject)r.a.getReductionByParentAnnotationId(e.Id).forEach((function(e){n-=t.calculatePolygonAreaReduction(t.getVerticesFromXfdf(e.get("xfdf")),e.get("pageNumber"))*e.get("quantity")}));return n}}},{key:"calculatePolygonNetVolume",value:function(e){var t=this;switch(e.Subject){case"Polygon":case"Reduction":case"Free hand":case"Free Hand":case"annotation.freeHand":var n=void 0;if(e.formulaNVO)return n=r.a.parseFormulaFromConfig(e,e.formulaNVO,"ESTIMATE.ANNOTATION_VALUES.VOLUME");if(n="annotation.freeHand"===e.Subject||"Free Hand"===e.Subject||"Free hand"===e.Subject?this.calculatePolygonArea(e.getPath(0),e.PageNumber)*e.annotationHeight:this.calculatePolygonArea(e.getPath(),e.PageNumber)*e.annotationHeight,"Polygon"===e.Subject)r.a.getReductionByParentAnnotationId(e.Id).forEach((function(e){n-=t.calculatePolygonAreaReduction(t.getVerticesFromXfdf(e.get("xfdf")),e.get("pageNumber"))*e.get("height")*e.get("quantity")}));return n}}},{key:"crossProduct2d",value:function(e,t){return e.x*t.y-e.y*t.x}},{key:"calculatePolygonArea",value:function(e,t){var n=0;try{if(e&&e.length<3)return-1;for(var a=0;a<e.length-1;a++)n+=this.crossProduct2d(e[a],e[(a+1)%(e.length-1)])}catch(i){console.log("Error in calculate polygon area: "+i)}var o=this.getScaleValue(t);return Math.abs(.5*n)*o.xScaleValue*o.yScaleValue}},{key:"crossProduct2dReduction",value:function(e,t){return e[0]*t[1]-e[1]*t[0]}},{key:"calculatePolygonAreaReduction",value:function(e,t){var n=0;try{if(e&&e.length<3)return-1;for(var a=0;a<e.length-1;a++)n+=this.crossProduct2dReduction(e[a],e[(a+1)%(e.length-1)])}catch(i){console.log("Error in calculate polygon area: "+i)}var o=this.getScaleValue(t);return Math.abs(.5*n)*o.xScaleValue*o.yScaleValue}},{key:"buildOrDrawPolygonData",value:function(e,t,n,a){var o=[],i=e.showNumber,s=e.showName,l=e.showArea,c=e.showNetArea,u=e.showLengths,d=e.showLength,p=e.showNetLength,h=e.showVolume,m=e.showNetVolume,f=e.showWall,A=e.showTotalWall,E=e.showTotalNetWall,T=e.showVariables,S=e.showReduction,b=e.newAnnotation,I=void 0;if(("annotation.freeHand"===e.Subject||"Free Hand"===e.Subject||"Free hand"===e.Subject)&&e.getPath(0)?I=e.getPath(0):e.getPath()&&(I=e.getPath()),I&&b&&this.getScale(e.PageNumber))I&&this.drawNewAnnotationLength(I,t,n,e.getPageNumber(),!0);else if(I&&(T||u||f)&&(o=o.concat(this.buildOrDrawPolylineData(e,t,n))),I&&(T||A||E||i||d||p||s||l||h||m||c||S||e.annotationReductionName)){var y=e.Y+e.Height/2,v=e.X+e.Width/2,N=[];if(i&&N.push("["+e.annotationNumber+"]"),s&&N.push(e.annotationName),S){var O=this.window.docViewer.getAnnotationManager();r.a.getReductionByParentAnnotationId(e.Id).sort((function(e,t){return e.get("id")<t.get("id")?-1:e.get("id")>t.get("id")?1:0})).forEach((function(e,t){var n=O.getAnnotationById(e.get("annotationId"));n&&(n.annotationReductionName="R"+(t+1))}))}if(e.annotationReductionName&&N.push(e.annotationReductionName),T){if(l&&this.getScale(e.PageNumber)?N.push("A: "+this.getValueToDisplay(this.calculatePolygonArea(I,e.getPageNumber()),"m2")):N.push("A"),c&&this.getScale(e.PageNumber)){var w=this.calculatePolygonNetArea(e);N.push("NA: "+this.getValueToDisplay(w,"m2"))}else N.push("NA");if(h&&this.getScale(e.PageNumber)?N.push("(VO: "+this.getValueToDisplay(this.calculatePolygonArea(I,e.getPageNumber())*e.annotationHeight,"m3")+")"):N.push("(VO)"),m&&this.getScale(e.PageNumber)){var P=this.calculatePolygonNetVolume(e);N.push("(NVO: "+this.getValueToDisplay(P,"m3")+")")}else N.push("(NVO)");if(d&&this.getScale(e.PageNumber)){var R=this.calculatePolylineLineLength(e,e.PageNumber);N.push("L: "+this.getValueToDisplay(R,"m"))}else N.push("L");if(p&&this.getScale(e.PageNumber)){var L=this.calculatePolylineNetLineLength(e,e.PageNumber);N.push("NL: "+this.getValueToDisplay(L,"m"))}else N.push("NL");if(A&&this.getScale(e.PageNumber)){var C=this.calculatePolylineLineLength(e,e.PageNumber)*e.annotationHeight;N.push("V: "+this.getValueToDisplay(C,"m2"))}else N.push("V");if(E&&this.getScale(e.PageNumber)){var _=this.calculatePolylineNetWall(e,e.PageNumber);N.push("NV: "+this.getValueToDisplay(_,"m2"))}else N.push("NV")}else if(this.getScale(e.PageNumber)){if(l&&N.push(""+this.getValueToDisplay(this.calculatePolygonArea(I,e.getPageNumber()),"m2")),c){var M=this.calculatePolygonNetArea(e);N.push(""+this.getValueToDisplay(M,"m2"))}if(h&&N.push("("+this.getValueToDisplay(this.calculatePolygonArea(I,e.PageNumber)*e.annotationHeight,"m3")+")"),m){var k=this.calculatePolygonNetVolume(e);N.push("("+this.getValueToDisplay(k,"m3")+")")}if(d){var D=this.calculatePolylineLineLength(e,e.PageNumber);N.push(this.getValueToDisplay(D,"m"))}if(p){var x=this.calculatePolylineNetLineLength(e,e.PageNumber);N.push(this.getValueToDisplay(x,"m"))}if(A){var F=this.calculatePolylineLineLength(e,e.PageNumber)*e.annotationHeight;N.push(this.getValueToDisplay(F,"m2"))}if(E){var j=this.calculatePolylineNetWall(e,e.PageNumber);N.push(this.getValueToDisplay(j,"m2"))}}if(t){var V=g.a.getInstance().getDisplayValueAnnotations(e.Id);if(V&&V.getCenterAnnotationPdf()){for(var U="",W=0;W<N.length;W++)W===N.length-1?U+=N[W]:U+=N[W]+"\n";V.getCenterAnnotationPdf().setContents(U)}}else o.push(this.getDisplayAnnotation(N,v,y,100,100,n,e.getPageNumber(),e))}return o}},{key:"compensateSqaure",value:function(e){var t=e.getPathPoint(0),n=e.getPathPoint(1),a=t.x-n.x,o=t.y-n.y;a<0&&o>0?Math.abs(a)>Math.abs(o)?n.y=t.y-Math.abs(a):n.x=t.x+Math.abs(o):a>0&&o>0?Math.abs(a)>Math.abs(o)?n.y=t.y-Math.abs(a):n.x=t.x-Math.abs(o):a>0&&o<0?Math.abs(a)>Math.abs(o)?n.y=t.y+Math.abs(a):n.x=t.x-Math.abs(o):a<0&&o<0&&(Math.abs(a)>Math.abs(o)?n.y=t.y+Math.abs(a):n.x=t.x+Math.abs(o))}}]),n}(function(e){Object(d.a)(n,e);var t=Object(p.a)(n);function n(){var e;return Object(a.a)(this,n),(e=t.call(this)).arrowFunctions={">|":e.drawGTPipe,"|<":e.drawPipeLT,"->|":e.drawDashGTPipe,"|<-":e.drawPipeLTDash,"-":e.drawDash,">":e.drawGT,"<":e.drawLT,"|":e.drawPipe,"o-":e.drawCircle,"o|-":e.drawDashCircle},e}return Object(o.a)(n,[{key:"buildOrDrawPolylineData",value:function(e,t,n){var a=[];try{var o=e.showNumber,i=e.showName,r=e.showLengths,s=e.showWall,l=e.showVariables,c=e.newAnnotation,u="annotation.freeHand"===e.Subject||"Free hand"===e.Subject||"Free Hand"===e.Subject,d=void 0;if(u&&e.getPath(0)?d=e.getPath(0):e.getPath()&&(d=e.getPath()),d&&c&&this.getScale(e.PageNumber))this.drawNewAnnotationLength(d,t,n,e.getPageNumber());else if(d&&(o||i||r||s||l))for(var p=0;p<d.length-1;p++){var h=-1;if("x-scale"===e.Subject||"y-scale"===e.Subject)h=e.length;else{var m=e.getPathPoint(p+1).x-e.getPathPoint(p).x,f=e.getPathPoint(p+1).y-e.getPathPoint(p).y,A=this.getScaleValue(e.PageNumber);h=Math.sqrt(Math.pow(m*A.xScaleValue,2)+Math.pow(f*A.yScaleValue,2))}var E=(e.getPathPoint(p).x+e.getPathPoint(p+1).x)/2,T=(e.getPathPoint(p).y+e.getPathPoint(p+1).y)/2,S=[];o&&"Polyline"===e.Subject&&S.push("["+e.annotationNumber+"]"),i&&"Polyline"===e.Subject&&S.push(e.annotationName),!u&&l?(r&&this.getScale(e.PageNumber)?S.push("L"+(p+1)+": "+this.getValueToDisplay(h,"m")):S.push("L"+(p+1)),s&&this.getScale(e.PageNumber)?S.push("(V"+(p+1)+": "+this.getValueToDisplay(h*e.annotationHeight,"m2")+")"):S.push("(V"+(p+1)+")")):this.getScale(e.PageNumber)&&(r&&S.push(""+this.getValueToDisplay(h,"m")),s&&S.push("("+this.getValueToDisplay(h*e.annotationHeight,"m2")+")"));if(t){var b=g.a.getInstance().getDisplayValueAnnotations(e.Id);if(b&&b.getCenterAnnotationPdf()&&("x-scale"===e.Subject||"y-scale"===e.Subject)&&b.getCenterAnnotationPdf().setContents(S[0]),b&&b.getPeripheralAnnotationsPdf()){for(var I="",y=0;y<S.length;y++)y===S.length-1?I+=S[y]:I+=S[y]+"\n";b.getPeripheralAnnotationsPdf().get(p)&&b.getPeripheralAnnotationsPdf().get(p).setContents(I)}}else a.push(this.getDisplayAnnotation(S,E,T,100,100,n,e.getPageNumber(),e))}}catch(v){console.log("Error building polyline data: "+v.stack)}return a}},{key:"drawPipeLT",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.lineWidth=t.StrokeThickness,e.strokeStyle=t.StrokeColor.toString(),e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s),e.beginPath(),e.moveTo(0,0),e.lineTo(-10,-10),e.moveTo(0,0),e.lineTo(-10,10),e.moveTo(0,0),e.lineTo(0,10),e.moveTo(0,0),e.lineTo(0,-10),e.stroke(),e.restore()}},{key:"drawGTPipe",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s+Math.PI),e.beginPath(),e.moveTo(0,0),e.lineTo(-10,-10),e.moveTo(0,0),e.lineTo(-10,10),e.moveTo(0,0),e.lineTo(0,10),e.moveTo(0,0),e.lineTo(0,-10),e.stroke(),e.restore()}},{key:"drawGT",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s+Math.PI),e.beginPath(),e.moveTo(0,0),e.lineTo(-10,-10),e.moveTo(0,0),e.lineTo(-10,10),e.stroke(),e.restore()}},{key:"drawLT",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s),e.beginPath(),e.moveTo(0,0),e.lineTo(-10,-10),e.moveTo(0,0),e.lineTo(-10,10),e.stroke(),e.restore()}},{key:"drawDashGTPipe",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s+Math.PI),e.beginPath(),e.moveTo(0,0),e.lineTo(-10,-10),e.moveTo(0,0),e.lineTo(-10,10),e.moveTo(0,0),e.lineTo(0,10),e.moveTo(0,0),e.lineTo(0,-10),e.moveTo(-10,0),e.lineTo(0,0),e.stroke(),e.restore()}},{key:"drawPipeLTDash",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s),e.beginPath(),e.moveTo(0,0),e.lineTo(-10,-10),e.moveTo(0,0),e.lineTo(-10,10),e.moveTo(0,0),e.lineTo(0,10),e.moveTo(0,0),e.lineTo(0,-10),e.stroke(),e.restore()}},{key:"drawDash",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s),e.beginPath(),e.stroke(),e.restore()}},{key:"drawPipe",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s),e.beginPath(),e.moveTo(0,0),e.lineTo(0,10),e.moveTo(0,0),e.lineTo(0,-10),e.stroke(),e.restore()}},{key:"drawCircle",value:function(e,t,n){var a=t.getPathPoint(0).x-t.getPathPoint(1).x,o=t.getPathPoint(0).y-t.getPathPoint(1).y,i=Math.atan2(o,a);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(i),e.beginPath(),e.arc(0,0,7,0,2*Math.PI),e.stroke(),e.restore()}},{key:"drawDashCircle",value:function(e,t,n){var a=0===n?0:n,o=0===n?1:n-1,i=t.getPathPoint(a).x-t.getPathPoint(o).x,r=t.getPathPoint(a).y-t.getPathPoint(o).y,s=Math.atan2(r,i);e.save(),e.strokeStyle=t.StrokeColor.toString(),e.lineWidth=t.StrokeThickness,e.translate(t.getPathPoint(n).x,t.getPathPoint(n).y),e.rotate(s),e.beginPath(),e.moveTo(0,0),e.lineTo(0,12),e.moveTo(0,0),e.lineTo(0,-12),e.moveTo(0,0),e.arc(0,0,7,0,2*Math.PI),e.stroke(),e.restore()}},{key:"drawArrows",value:function(e,t){var n=t.newAnnotation,a=t.newScale,o=t.Subject===A.e||t.Subject===A.f;if(!n&&!a&&t.getPath()){var i=t.getPath().length-1;!t.geometraLineStart&&o?this.arrowFunctions["|<-"]&&this.arrowFunctions["|<-"](e,t,0):this.arrowFunctions[t.geometraLineStart]&&this.arrowFunctions[t.geometraLineStart](e,t,0),!t.geometraLineEnd&&o?this.arrowFunctions["|<-"]&&this.arrowFunctions["|<-"](e,t,1):this.arrowFunctions[t.geometraLineEnd]&&this.arrowFunctions[t.geometraLineEnd](e,t,i)}}},{key:"pointBetweenTwoPonts",value:function(e,t,n){var a={};a.x=t.x-e.x,a.y=t.y-e.y;var o=Math.sqrt(Math.pow(a.x,2)+Math.pow(a.y,2)),i={};i.x=a.x/o,i.y=a.y/o;var r={};r.x=n.x-e.x,r.y=n.y-e.y;var s=i.x*r.x+i.y*r.y;return s>0&&s<o}},{key:"getDistanceFromPointToLine",value:function(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2))}},{key:"getPathIndex",value:function(e,t){for(var n=-1,a=1,o=t.getPath(),i=0;i<o.length-1;i++){var r=this.getDistanceFromPointToLine(o[i],o[i+1],e);r<a&&this.pointBetweenTwoPonts(o[i],o[i+1],e)&&(a=r,n=i+1)}return n}},{key:"drawNewAnnotationLength",value:function(e,t,n,a){var o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(2===e.length){var i=e[0].x-e[1].x,r=e[0].y-e[1].y,s=Math.abs(i),l=Math.abs(r),c=(e[0].x+e[e.length-1].x)/2,u=(e[0].y+e[e.length-1].y)/2,d=c-i/2,p=u,g=c,h=u-r/2,m=0,f=this.getScaleValue(a);m=o?s*l*f.xScaleValue*f.yScaleValue:Math.sqrt(Math.pow(i*f.xScaleValue,2)+Math.pow(r*f.yScaleValue,2)),t.save(),t.textAlign="center",t.translate(c,u),t.rotate(n),o?t.fillText(this.getValueToDisplay(m,"m2"),0,0):t.fillText(this.getValueToDisplay(m,"m"),0,0),t.restore(),o&&s>0&&l>0&&(t.save(),t.textAlign="center",t.translate(d,p),t.rotate(n),t.fillText(this.getValueToDisplay(l*f.yScaleValue,"m"),0,0),t.restore(),t.save(),t.textAlign="center",t.translate(g,h),t.rotate(n),t.fillText(this.getValueToDisplay(s*f.xScaleValue,"m"),0,0),t.restore())}else if(e.length>2){var A=this.getScaleValue(a),E=e[e.length-1].x-e[e.length-2].x,T=e[e.length-1].y-e[e.length-2].y,S=(e[e.length-1].x+e[e.length-2].x)/2,b=(e[e.length-1].y+e[e.length-2].y)/2,I=Math.sqrt(Math.pow(E*A.xScaleValue,2)+Math.pow(T*A.yScaleValue,2));t.save(),t.textAlign="center",t.translate(S,b),t.rotate(n),t.fillText(this.getValueToDisplay(I,"m"),0,0),t.restore()}}},{key:"getDegreStepRotation",value:function(e){return e>=0&&e<7.5?0:e>=7.5&&e<22.5?15:e>=22.5&&e<37.5?30:e>=37.5&&e<52.5?45:e>=52.5&&e<67.5?60:e>=67.5&&e<82.5?75:e>=82.5&&e<97.5?90:e>=97.5&&e<112.5?105:e>=112.5&&e<127.5?120:e>=127.5&&e<142.5?135:e>=142.5&&e<157.5?150:e>=157.5&&e<172.5?165:e>=172.5&&e<187.5?180:e>=187.5&&e<202.5?195:e>=202.5&&e<217.5?210:e>=217.5&&e<232.5?225:e>=232.5&&e<247.5?240:e>=247.5&&e<262.5?255:e>=262.5&&e<277.5?270:e>=277.5&&e<292.5?285:e>=292.5&&e<307.5?300:e>=307.5&&e<322.5?315:e>=322.5&&e<337.5?330:e>=337.5&&e<352.5?345:e>=352&&e<=360?0:void 0}},{key:"calculatePolylineLineLength",value:function(e,t){var n=void 0;n="annotation.freeHand"===e.Subject||"Free Hand"===e.Subject||"Free hand"===e.Subject?e.getPath(0):e.getPath();var a=0,o=this.getScaleValue(t);if(n){for(var i=0;i<n.length-1;i++){var r=(n[i].x-n[i+1].x)*o.xScaleValue,s=(n[i].y-n[i+1].y)*o.yScaleValue;a+=Math.sqrt(Math.pow(r,2)+Math.pow(s,2))}return a}}},{key:"calculatePolylineLineLengthStoreReduction",value:function(e,t){var n=0,a=this.getScaleValue(t);if(e){for(var o=0;o<e.length-1;o++){var i=(e[o][0]-e[o+1][0])*a.xScaleValue,r=(e[o][1]-e[o+1][1])*a.yScaleValue;n+=Math.sqrt(Math.pow(i,2)+Math.pow(r,2))}return n}}},{key:"calculatePolylineNetLineLength",value:function(e,t){var n=this,a=void 0;if(e.formulaNL)return a=r.a.parseFormulaFromConfig(e,e.formulaNL,"ESTIMATE.ANNOTATION_VALUES.LENGTH");(a=this.calculatePolylineLineLength(e,e.PageNumber),"Polygon"===e.Subject)&&r.a.getReductionByParentAnnotationId(e.Id).forEach((function(e){a-=n.calculatePolylineLineLengthStoreReduction(n.getVerticesFromXfdf(e.get("xfdf")),e.get("pageNumber"))*e.get("quantity")}));return a}},{key:"calculatePolylineNetWall",value:function(e,t){var n=this,a=void 0;if(e.formulaNV)return a=r.a.parseFormulaFromConfig(e,e.formulaNV,"ESTIMATE.ANNOTATION_VALUES.WALL");(a=this.calculatePolylineLineLength(e,t)*e.annotationHeight,"Polygon"===e.Subject)&&r.a.getReductionByParentAnnotationId(e.Id).forEach((function(e){a-=n.calculatePolylineLineLengthStoreReduction(n.getVerticesFromXfdf(e.get("xfdf")),e.get("pageNumber"))*e.get("height")*e.get("quantity")}));return a}}]),n}(f))),T=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t){var n=e.Annotations.EllipseAnnotation.prototype.serialize;e.Annotations.EllipseAnnotation.prototype.serialize=function(e,t){var a=n.call(this,e,t);return a.setAttribute("showNumber",this.showNumber),a.setAttribute("showName",this.showName),a.setAttribute("showArea",this.showArea),a.setAttribute("showNetArea",this.showNetArea),a.setAttribute("showLength",this.showLength),a.setAttribute("showNetLength",this.showNetLength),a.setAttribute("showVolume",this.showVolume),a.setAttribute("showNetVolume",this.showNetVolume),a.setAttribute("showTotalWall",this.showTotalWall),a.setAttribute("showTotalNetWall",this.showTotalNetWall),a.setAttribute("showVariables",this.showVariables),a.setAttribute("turnOffFill",this.turnOffFill),a.setAttribute("Hidden",this.Hidden),a.setAttribute("formulaNA",this.formulaNA),a.setAttribute("formulaNL",this.formulaNL),a.setAttribute("formulaNVO",this.formulaNVO),a.setAttribute("formulaNV",this.formulaNV),a.setAttribute("maintainAspectRatio",this.MaintainAspectRatio),a.setAttribute("readOnly",this.ReadOnly),a};var a=e.Annotations.EllipseAnnotation.prototype.deserialize;e.Annotations.EllipseAnnotation.prototype.deserialize=function(e,n){a.call(this,e,n),this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showArea="true"===e.getAttribute("showArea"),this.showNetArea="true"===e.getAttribute("showNetArea"),this.showLength="true"===e.getAttribute("showLength"),this.showNetLength="true"===e.getAttribute("showNetLength"),this.showVolume="true"===e.getAttribute("showVolume"),this.showNetVolume="true"===e.getAttribute("showNetVolume"),this.showTotalWall="true"===e.getAttribute("showTotalWall"),this.showTotalNetWall="true"===e.getAttribute("showTotalNetWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.turnOffFill="true"===e.getAttribute("turnOffFill"),this.Hidden="true"===e.getAttribute("Hidden"),this.currentFontSize=t.getFontSize(this),this.formulaNA=e.hasAttribute("formulaNA")?e.getAttribute("formulaNA"):"",this.formulaNL=e.hasAttribute("formulaNL")?e.getAttribute("formulaNL"):"",this.formulaNVO=e.hasAttribute("formulaNVO")?e.getAttribute("formulaNVO"):"",this.formulaNV=e.hasAttribute("formulaNV")?e.getAttribute("formulaNV"):"",this.MaintainAspectRatio="true"===e.getAttribute("maintainAspectRatio"),this.ReadOnly="true"===e.getAttribute("readOnly")};var o=e.Annotations.EllipseAnnotation.prototype.draw;e.Annotations.EllipseAnnotation.prototype.draw=function(n){switch(n.save(),this.Style){case"dashed":n.setLineDash(l.a);break;case"dotted":n.setLineDash(l.b);break;case"dot-dash-dot":n.setLineDash(l.c)}o.apply(this,arguments),n.restore();var a=e.docViewer.getCompleteRotation(e.docViewer.getCurrentPage());a=-90*a*Math.PI/180,n.save(),this.newAnnotation?(this.currentFontSize=t.getFontSize(this),n.font=this.currentFontSize+t.GEOMETRA_FONT_TYPE):this.currentFontSize&&(n.font=this.currentFontSize+t.GEOMETRA_FONT_TYPE),n.fillStyle=t.GEOMETRA_TEXT_FILL_STYLE,t.buildOrDrawEllipseData(this,n,a),n.restore()}}}]),e}(),S=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t,n){t.Tools.EllipseCreateTool.prototype.on("annotationAdded",(function(){e.setIsDrawing(!1)})),t.Tools.EllipseCreateTool.prototype.on("annotationCreated",(function(t){e.setIsDrawing(!0),t.showNumber=!1,t.showName=!1,t.showArea=!1,t.showNetArea=!1,t.showLengths=!1,t.showVolume=!1,t.showTotalWall=!1,t.showTotalNetWall=!1,t.showVariables=!1,t.turnOffFill=!1,t.newAnnotation=!0,t.formulaNA="",t.formulaNL="",t.formulaNVO="",t.formulaNV="",t.style="solid"}))}}]),e}(),b=n(234),I=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t,n){var a=t.Annotations.FreeHandAnnotation.prototype.draw;t.Annotations.FreeHandAnnotation.prototype.draw=function(o){switch(o.save(),this.Style){case"dashed":o.setLineDash(l.a);break;case"dotted":o.setLineDash(l.b);break;case"dot-dash-dot":o.setLineDash(l.c)}a.apply(this,arguments),o.restore();var i=t.docViewer.getCompleteRotation(t.docViewer.getCurrentPage());i=-90*i*Math.PI/180,o.save(),o.fillStyle=this.FillColor.toString(),o.fill(),o.restore(),o.save(),this.currentFontSize&&(o.font=this.currentFontSize+n.GEOMETRA_FONT_TYPE),o.fillStyle=n.GEOMETRA_TEXT_FILL_STYLE,n.buildOrDrawPolygonData(this,o,i),o.restore(),e.isSnaponEnabled()&&this.snapGuidePoint&&this.snapPoint&&(o.save(),o.setLineDash([.3]),o.lineWidth="0.45",o.strokeStyle="rgba(90,177,74,0.8)",o.beginPath(),o.moveTo(this.snapGuidePoint.x,this.snapGuidePoint.y),o.lineTo(this.snapPoint.x,this.snapPoint.y),o.stroke(),o.restore())};var o=t.Annotations.FreeHandAnnotation.prototype.deserialize;t.Annotations.FreeHandAnnotation.prototype.deserialize=function(e,a){if(o.call(this,e,a),!this.FillColor){var i=Object(b.a)(e.getAttribute("interior-color"));this.FillColor=new t.Annotations.Color,this.FillColor.R=i.r,this.FillColor.G=i.g,this.FillColor.B=i.b,this.FillColor.A=1}this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showArea="true"===e.getAttribute("showArea"),this.showNetArea="true"===e.getAttribute("showNetArea"),this.showLength="true"===e.getAttribute("showLength"),this.showNetLength="true"===e.getAttribute("showNetLength"),this.showVolume="true"===e.getAttribute("showVolume"),this.showNetVolume="true"===e.getAttribute("showNetVolume"),this.showTotalWall="true"===e.getAttribute("showTotalWall"),this.showTotalNetWall="true"===e.getAttribute("showTotalNetWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.turnOffFill="true"===e.getAttribute("turnOffFill"),this.Hidden="true"===e.getAttribute("Hidden"),this.currentFontSize=n.getFontSize(this),this.formulaNA=e.hasAttribute("formulaNA")?e.getAttribute("formulaNA"):"",this.formulaNL=e.hasAttribute("formulaNL")?e.getAttribute("formulaNL"):"",this.formulaNVO=e.hasAttribute("formulaNVO")?e.getAttribute("formulaNVO"):"",this.formulaNV=e.hasAttribute("formulaNV")?e.getAttribute("formulaNV"):"",this.MaintainAspectRatio="true"===e.getAttribute("maintainAspectRatio"),this.ReadOnly="true"===e.getAttribute("readOnly")};var i=t.Annotations.FreeHandAnnotation.prototype.serialize;t.Annotations.FreeHandAnnotation.prototype.serialize=function(e,t){var n=i.call(this,e,t);return n.setAttribute("showNumber",this.showNumber),n.setAttribute("showName",this.showName),n.setAttribute("showArea",this.showArea),n.setAttribute("showNetArea",this.showNetArea),n.setAttribute("showLength",this.showLength),n.setAttribute("showNetLength",this.showNetLength),n.setAttribute("showVolume",this.showVolume),n.setAttribute("showNetVolume",this.showNetVolume),n.setAttribute("showTotalWall",this.showTotalWall),n.setAttribute("showTotalNetWall",this.showTotalNetWall),n.setAttribute("showVariables",this.showVariables),n.setAttribute("turnOffFill",this.turnOffFill),n.setAttribute("Hidden",this.Hidden),n.setAttribute("formulaNA",this.formulaNA),n.setAttribute("formulaNL",this.formulaNL),n.setAttribute("formulaNVO",this.formulaNVO),n.setAttribute("formulaNV",this.formulaNV),n.setAttribute("maintainAspectRatio",this.MaintainAspectRatio),n.setAttribute("readOnly",this.ReadOnly),n}}}]),e}(),y=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t){var n=t.annotManager;t.Tools.FreeHandCreateTool.prototype.on("annotationAdded",(function(){e.setIsDrawing(!1)}));var a=t.Tools.FreeHandCreateTool.prototype.mouseLeftDown;t.Tools.FreeHandCreateTool.prototype.mouseLeftDown=function(t){a.apply(this,arguments),e.isSnaponEnabled()&&(this.checkSnappy(t),this.lineAnnot?(this.annotation.addPathPoint(this.lineAnnot.getStartPoint().x,this.lineAnnot.getStartPoint().y),n.redrawAnnotation(this.annotation)):this.annotation&&this.annotation.snapPoint&&(this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y,0),n.redrawAnnotation(this.annotation)))},t.Tools.FreeHandCreateTool.prototype.on("annotationCreated",(function(n){e.setIsDrawing(!0),n.FillColor=new t.Annotations.Color,n.FillColor.R=n.StrokeColor.R,n.FillColor.G=n.StrokeColor.G,n.FillColor.B=n.StrokeColor.B,n.FillColor.A=.8,n.showNumber=!1,n.showName=!1,n.showArea=!1,n.showNetArea=!1,n.showVolume=!1,n.showVariables=!1,n.turnOffFill=!1,n.visible=!0,n.annotationName="",n.annotationNumber="",n.annotationHeight=void 0,n.formulaNA="",n.formulaNL="",n.formulaNVO="",n.formulaNV="",n.style="solid"}));var o=t.Tools.FreeHandCreateTool.prototype.mouseMove;t.Tools.FreeHandCreateTool.prototype.mouseMove=function(t){this.annotation&&this.annotation.getPath(0)&&3===this.annotation.getPath(0).length&&(this.annotation.StrokeColor.A=.01),e.isSnaponEnabled()?(this.checkSnappy(t),e.isSnaponEnabled()&&this.annotation&&(this.annotation.snapPoint||this.lineAnnot)&&(this.lineAnnot?(this.annotation.addPathPoint(this.lineAnnot.getStartPoint().x,this.lineAnnot.getStartPoint().y,0),n.redrawAnnotation(this.annotation)):(this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y,0),n.redrawAnnotation(this.annotation)))):o.apply(this,arguments)},t.Tools.FreeHandCreateTool.prototype.mouseLeftUp=function(){if(this.annotation&&this.annotation.getPath(0)&&this.annotation.getPath(0).length>3){var e=this.annotation.getPathPoint(0,0);this.annotation.addPathPoint(e.x,e.y,0),this.docViewer.getAnnotationManager().addAnnotation(this.annotation,!1),this.annotation=void 0}},t.Tools.FreeHandCreateTool.prototype.mouseDoubleClick=function(){};var i=t.Tools.FreeHandCreateTool.prototype.switchOut;t.Tools.FreeHandCreateTool.prototype.switchOut=function(){if(this.lineAnnot)try{t.annotManager.deleteAnnotation(this.lineAnnot,!0,!0),this.lineAnnot=void 0}catch(e){console.log("Error |  SnapOn (Polyline): "+e)}else this.annotation&&(this.annotation.snapPoint=void 0,this.annotation.snapGuidePoint=void 0);i.apply(this,arguments)}}}]),e}(),v=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e){var t=e.Annotations.FreeTextAnnotation.prototype.draw;e.Annotations.FreeTextAnnotation.prototype.draw=function(e){e.save();var n=this.StrokeThickness;switch(this.StrokeThickness="Free Text"===this.Subject?-3:0,t.apply(this,arguments),this.StrokeThickness=n,e.restore(),e.save(),this.Style){case"dashed":e.setLineDash(l.a);break;case"dotted":e.setLineDash(l.b);break;case"dot-dash-dot":e.setLineDash(l.c)}if(this.strokeColor){var a=Object(b.a)(this.strokeColor);this.Color.R=a.r,this.Color.G=a.g,this.Color.B=a.b}this.Color.A="Free Text"===this.Subject?this.geometraBorderOpacity:0,e.strokeStyle=this.Color,e.lineWidth=n;var o=this.getPathPoint(0),i=this.getPathPoint(1);e.beginPath(),e.moveTo(o.x,o.y),e.lineTo(i.x,o.y),e.lineTo(i.x,i.y),e.lineTo(o.x,i.y),e.closePath(),e.stroke(),e.restore()};var n=e.Annotations.FreeTextAnnotation.prototype.serialize;e.Annotations.FreeTextAnnotation.prototype.serialize=function(e,t){var a=n.call(this,e,t);return a.setAttribute("Hidden",this.Hidden),a};var a=e.Annotations.FreeTextAnnotation.prototype.deserialize;e.Annotations.FreeTextAnnotation.prototype.deserialize=function(e,t){if(a.call(this,e,t),this.Hidden="true"===e.getAttribute("Hidden"),"CenterValue"===this.Subject||"PeripheralValue"===this.Subject){var n=r.a.getDisplayValueAnnotationByAnnotationId(this.Id);if(n){var o=n.get("parentId");this.parentId=o,g.a.getInstance().addDisplayAnnotations(o,this)}}}}}]),e}(),N=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t){var n=t.Tools.FreeTextCreateTool.prototype.mouseLeftDown;t.Tools.FreeTextCreateTool.prototype.mouseLeftDown=function(){e.isDrawing()||t.annotManager.deselectAllAnnotations(),n.apply(this,arguments)},t.Tools.FreeTextCreateTool.prototype.on("annotationAdded",(function(){e.setIsDrawing(!1)})),t.Tools.FreeTextCreateTool.prototype.on("annotationCreated",(function(t){t.style="solid",e.setIsDrawing(!0)}))}}]),e}(),O=n(232),w=function(){function e(){Object(a.a)(this,e),this.calculator=void 0,this.PointAnnotation=void 0}return Object(o.a)(e,[{key:"init",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=function(t,n){e.Annotations.SelectionModel.call(this,t,n)};a.prototype=new e.Annotations.SelectionModel,a.prototype.drawSelectionOutline=function(){return!1},a.prototype.getControlHandlers=function(){},a.prototype.testSelection=function(t,a,o,i){return!!n&&e.Annotations.SelectionAlgorithm.canvasVisibilityTest(t,a,o,i)},this.PointAnnotation=function(){e.Annotations.StampAnnotation.call(this),this.Subject="Point"},this.PointAnnotation.prototype=new e.Annotations.StampAnnotation,this.PointAnnotation.prototype.elementName="point",this.PointAnnotation.prototype.draw=function(n){if(n.save(),this.iconType&&"none"!=this.iconType){var a=new e.Annotations.Color(this.FillColor.R,this.FillColor.G,this.FillColor.B);a.A=.01,n.fillStyle=a.toString()}else n.fillStyle=this.FillColor.toString();var o=e.docViewer.getCompleteRotation(e.docViewer.getCurrentPage());o=-90*o*Math.PI/180,n.fillRect(this.X,this.Y,this.Width,this.Height),n.restore();var i=[];this.showNumber&&i.push("["+this.annotationNumber+"]"),this.showName&&i.push(this.annotationName),n.save(),n.font=this.currentFontSize+t.GEOMETRA_FONT_TYPE,n.textAlign="center",n.fillStyle=t.GEOMETRA_TEXT_FILL_STYLE,n.translate(this.X+this.Width/2,this.Y+this.Height/2),n.rotate(o);var r=g.a.getInstance().getDisplayValueAnnotations(this.Id);if(r&&r.getCenterAnnotationPdf()){for(var s="",l=0;l<i.length;l++)l===i.length-1?s+=i[l]:s+=i[l]+"\n";r.getCenterAnnotationPdf().setContents(s)}n.restore();try{if(this.iconType&&"none"!=this.iconType){var c=/fill-opacity="(\d+\.\d+)/,u=O.a.getIcon(this.iconType),d=u.replace('"green"','"'+this.FillColor+'"'),p=d.match(c),h=d.replace(p[1],1);this.ImageData="data:image/svg+xml;charset=utf-8,"+h,e.Annotations.StampAnnotation.prototype.draw.apply(this,arguments)}}catch(m){console.log("error checking src "+m.stack)}},this.PointAnnotation.prototype.selectionModel=a,this.PointAnnotation.prototype.serialize=function(t,n){var a=e.Annotations.StampAnnotation.prototype.serialize.call(this,t,n);return a.setAttribute("pointSize",this.Width),a.setAttribute("showNumber",this.showNumber),a.setAttribute("showName",this.showName),a.setAttribute("iconType",this.iconType),a.setAttribute("rotation",this.Rotation),a.setAttribute("geometraOpacity",this.geometraOpacity),a.setAttribute("readOnly",this.ReadOnly),a.setAttribute("Hidden",this.Hidden),a},this.PointAnnotation.prototype.deserialize=function(n,a){e.Annotations.StampAnnotation.prototype.deserialize.call(this,n,a),this.Width=n.getAttribute("pointSize"),this.Height=n.getAttribute("pointSize"),this.showNumber="true"===n.getAttribute("showNumber"),this.showName="true"===n.getAttribute("showName"),this.iconType=n.getAttribute("iconType"),this.currentFontSize=t.getFontSize(this),this.geometraOpacity=n.getAttribute("geometraOpacity"),this.Rotation=n.getAttribute("rotation")?n.getAttribute("rotation"):0,"undefined"==this.Rotation&&(this.Rotation=0),this.iconColor=n.getAttribute("color"),this.ReadOnly="true"===n.getAttribute("readOnly"),this.Hidden="true"===n.getAttribute("Hidden")}}},{key:"getPointAnnotation",value:function(){return this.PointAnnotation}}]),e}(),P=function(){function e(){Object(a.a)(this,e),this.PointCreateTool=void 0}return Object(o.a)(e,[{key:"init",value:function(e,t){var n=e.getPointAnnotation();this.PointCreateTool=function(e){t.Tools.GenericAnnotationCreateTool.call(this,e,n),this.overrideSelection=!0},this.PointCreateTool.prototype=new t.Tools.GenericAnnotationCreateTool,this.PointCreateTool.prototype.mouseLeftUp=function(){this.annotation&&(this.annotation.Width=r.a.getPointValueInheritance().getPointSize(),this.annotation.Height=r.a.getPointValueInheritance().getPointSize(),this.annotation.iconType=r.a.getPointValueInheritance().getIconType(),e.isSnaponEnabled()&&this.lineAnnot?(this.annotation.X=this.lineAnnot.getStartPoint().x-this.annotation.Width/2,this.annotation.Y=this.lineAnnot.getStartPoint().y-this.annotation.Height/2):(this.annotation.X-=this.annotation.Width/2,this.annotation.Y-=this.annotation.Height/2),this.docViewer.getAnnotationManager().addAnnotation(this.annotation,!1),this.annotation=void 0)},this.PointCreateTool.prototype.mouseMove=function(t){e.isSnaponEnabled()&&this.checkSnappy(t)},this.PointCreateTool.prototype.on("annotationCreated",(function(e){e.NoResize=!0,e.NoMove=!1,e.showNumber=!1,e.showName=!1,e.FillColor=new t.Annotations.Color(35,145,35,.8),e.StrokeColor=new t.Annotations.Color(35,145,35,.8),e.iconType="none"}));var a=this.PointCreateTool.prototype.switchOut;this.PointCreateTool.prototype.switchOut=function(){if(this.lineAnnot)try{t.annotManager.deleteAnnotation(this.lineAnnot,!0,!0),this.lineAnnot=void 0}catch(e){console.log("Error |  SnapOn (Point): "+e)}else this.annotation&&(this.annotation.snapPoint=void 0,this.annotation.snapGuidePoint=void 0);a.apply(this,arguments)}}},{key:"getPointCreateTool",value:function(){return this.PointCreateTool}}]),e}(),R=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t,n){var a=t.Annotations.PolygonAnnotation.prototype.serialize;t.Annotations.PolygonAnnotation.prototype.serialize=function(e,t){var n=a.call(this,e,t);return n.setAttribute("showNumber",this.showNumber),n.setAttribute("showName",this.showName),n.setAttribute("showArea",this.showArea),n.setAttribute("showNetArea",this.showNetArea),n.setAttribute("showLength",this.showLength),n.setAttribute("showLengths",this.showLengths),n.setAttribute("showNetLength",this.showNetLength),n.setAttribute("showVolume",this.showVolume),n.setAttribute("showNetVolume",this.showNetVolume),n.setAttribute("showWall",this.showWall),n.setAttribute("showTotalWall",this.showTotalWall),n.setAttribute("showTotalNetWall",this.showTotalNetWall),n.setAttribute("showVariables",this.showVariables),n.setAttribute("turnOffFill",this.turnOffFill),n.setAttribute("showReduction",this.showReduction),n.setAttribute("Hidden",this.Hidden),n.setAttribute("formulaNA",this.formulaNA),n.setAttribute("formulaNL",this.formulaNL),n.setAttribute("formulaNVO",this.formulaNVO),n.setAttribute("formulaNV",this.formulaNV),n.setAttribute("readOnly",this.ReadOnly),n};var o=t.Annotations.PolygonAnnotation.prototype.deserialize;t.Annotations.PolygonAnnotation.prototype.deserialize=function(e,t){o.call(this,e,t),this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showArea="true"===e.getAttribute("showArea"),this.showNetArea="true"===e.getAttribute("showNetArea"),this.showLength="true"===e.getAttribute("showLength"),this.showLengths="true"===e.getAttribute("showLengths"),this.showNetLength="true"===e.getAttribute("showNetLength"),this.showVolume="true"===e.getAttribute("showVolume"),this.showNetVolume="true"===e.getAttribute("showNetVolume"),this.showWall="true"===e.getAttribute("showWall"),this.showTotalWall="true"===e.getAttribute("showTotalWall"),this.showTotalNetWall="true"===e.getAttribute("showTotalNetWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.turnOffFill="true"===e.getAttribute("turnOffFill"),this.showReduction="true"===e.getAttribute("showReduction"),this.Hidden="true"===e.getAttribute("Hidden"),this.currentFontSize=n.getFontSize(this),this.formulaNA=e.hasAttribute("formulaNA")?e.getAttribute("formulaNA"):"",this.formulaNL=e.hasAttribute("formulaNL")?e.getAttribute("formulaNL"):"",this.formulaNVO=e.hasAttribute("formulaNVO")?e.getAttribute("formulaNVO"):"",this.formulaNV=e.hasAttribute("formulaNV")?e.getAttribute("formulaNV"):"",this.ReadOnly="true"===e.getAttribute("readOnly")};var i=t.Annotations.PolygonAnnotation.prototype.draw;t.Annotations.PolygonAnnotation.prototype.draw=function(a){switch(a.save(),a.lineCap="butt",this.Style){case"dashed":a.setLineDash(l.a);break;case"dotted":a.setLineDash(l.b);break;case"dot-dash-dot":a.setLineDash(l.c)}i.apply(this,arguments),a.restore();var o=t.docViewer.getCompleteRotation(t.docViewer.getCurrentPage());if(o=-90*o*Math.PI/180,a.save(),this.newAnnotation?(this.currentFontSize=n.getFontSize(this)+n.GEOMETRA_FONT_TYPE,a.font=this.currentFontSize):this.currentFontSize&&(a.font=this.currentFontSize+n.GEOMETRA_FONT_TYPE),a.fillStyle=n.GEOMETRA_TEXT_FILL_STYLE,n.buildOrDrawPolygonData(this,a,o,void 0),a.restore(),2===this.getPath().length&&this.newAnnotation){a.save(),a.setLineDash([.45]),a.strokeStyle="rgba(90,177,74,0.7)",a.lineWidth=.35;var r=this.getPathPoint(0),s=this.getPathPoint(1);a.beginPath(),a.moveTo(r.x,r.y),a.lineTo(s.x,r.y),a.lineTo(s.x,s.y),a.lineTo(r.x,s.y),a.closePath(),a.stroke(),a.restore()}if(e.isSnaponEnabled()&&this.snapGuidePoint&&this.snapPoint){var c=this.snapPoint,u=this.snapGuidePoint;a.save(),a.setLineDash([.2]),a.lineWidth=.45,a.strokeStyle="rgba(90,177,74,0.9)",a.beginPath(),a.moveTo(c.x,c.y),a.lineTo(u.x,u.y),a.stroke(),a.restore(),a.save(),a.strokeStyle="rgba(90,177,74,1.0)",a.lineWidth=.25,a.beginPath(),a.moveTo(c.x,c.y),a.moveTo(c.x-1.5,c.y-1.5),a.lineTo(c.x+1.5,c.y-1.5),a.lineTo(c.x+1.5,c.y+1.5),a.lineTo(c.x-1.5,c.y+1.5),a.lineTo(c.x-1.5,c.y-1.5),a.stroke(),a.restore()}}}}]),e}(),L=function(){function e(){Object(a.a)(this,e),this.ReductionCreateTool=void 0}return Object(o.a)(e,[{key:"init",value:function(e,t,n){var a=t.Tools.PolygonCreateTool.prototype.mouseLeftDown;t.Tools.PolygonCreateTool.prototype.mouseLeftDown=function(n){a.apply(this,arguments),e.isSnaponEnabled()&&this.annotation&&(this.annotation.snapPoint||this.lineAnnot)&&(this.lineAnnot?(this.annotation.popPath(),this.annotation.addPathPoint(this.lineAnnot.getStartPoint().x,this.lineAnnot.getStartPoint().y),t.annotManager.redrawAnnotation(this.annotation)):(this.annotation.popPath(),this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y),t.annotManager.redrawAnnotation(this.annotation)))};var o=t.Tools.PolygonCreateTool.prototype.mouseMove;t.Tools.PolygonCreateTool.prototype.mouseMove=function(t){this.annotation&&this.annotation.getPath()&&3===this.annotation.getPath().length&&(this.annotation.StrokeColor.A=.01),o.apply(this,arguments),e.isSnaponEnabled()&&this.checkSnappy(t)};var i=t.Tools.PolygonCreateTool.prototype.mouseDoubleClick;t.Tools.PolygonCreateTool.prototype.mouseDoubleClick=function(){if(2===this.annotation.getPath().length){e.isSnaponEnabled()&&this.annotation&&this.annotation.snapPoint&&(this.annotation.popPath(),this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y));var t=this.annotation.getPathPoint(0),n=this.annotation.getPathPoint(1);this.annotation.getPath().pop(),this.annotation.getPath().pop(),this.annotation.addPathPoint(t.x,t.y),this.annotation.addPathPoint(n.x,t.y),this.annotation.addPathPoint(n.x,n.y),this.annotation.addPathPoint(t.x,n.y),this.annotation.addPathPoint(t.x,t.y),i.apply(this,arguments)}else this.annotation.getPath().length>2&&(e.isSnaponEnabled()&&this.annotation&&this.annotation.snapPoint?(this.annotation.popPath(),this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y),i.apply(this,arguments)):i.apply(this,arguments))},t.Tools.PolygonCreateTool.prototype.on("annotationCreated",(function(n){e.setIsDrawing(!0),"AnnotationCreatePolygon"===t.docViewer.getToolMode().name?(n.newAnnotation=!0,n.StrokeThickness=.45):"AnnotationCreateReduction"===t.docViewer.getToolMode().name&&(n.Subject="Reduction",n.newAnnotation=!0,n.StrokeThickness=.45),n.showNumber=!1,n.showName=!1,n.showArea=!1,n.showNetArea=!1,n.showLengths=!1,n.showLength=!1,n.showNetLength=!1,n.showVolume=!1,n.showNetVolume=!1,n.showWall=!1,n.showVariables=!1,n.turnOffFill=!1,n.showReduction=!1,n.annotationName="",n.annotationNumber="",n.annotationHeight=void 0,n.pattern="none",n.formulaNA="",n.formulaNL="",n.formulaNVO="",n.formulaNV="",n.snapGuidePoint=void 0,n.snapPoint=void 0,n.style="solid"})),t.Tools.PolygonCreateTool.prototype.on("annotationAdded",(function(){e.setIsDrawing(!1)}));var r=t.Tools.PolygonCreateTool.prototype.switchOut;t.Tools.PolygonCreateTool.prototype.switchOut=function(){if(this.lineAnnot)try{t.annotManager.deleteAnnotation(this.lineAnnot,!0,!0),this.lineAnnot=void 0}catch(e){console.log("Error | SnapOn (Polygon): "+e)}else this.annotation&&(this.annotation.snapPoint=void 0,this.annotation.snapGuidePoint=void 0);r.apply(this,arguments)},this.ReductionCreateTool=function(e){t.Tools.PolygonCreateTool.call(this,e,t.Annotations.PolygonAnnotation)},this.ReductionCreateTool.prototype=new t.Tools.PolygonCreateTool,this.ReductionCreateTool.prototype.mouseLeftUp=function(e){t.Tools.PolygonCreateTool.prototype.mouseLeftUp.call(this,e)}}},{key:"getReductionCreateTool",value:function(){return this.ReductionCreateTool}}]),e}(),C=function(){function e(){Object(a.a)(this,e),this.calculator=void 0}return Object(o.a)(e,[{key:"init",value:function(e,t,n){var a=t.Annotations.PolylineAnnotation.prototype.serialize;t.Annotations.PolylineAnnotation.prototype.serialize=function(e,t){var n=a.call(this,e,t);return"x-scale"===this.Subject||"y-scale"===this.Subject?(n.setAttribute("showLengths",this.showLengths),n.setAttribute("width",this.width)):(n.setAttribute("showNumber",this.showNumber),n.setAttribute("showName",this.showName),n.setAttribute("showLengths",this.showLengths),n.setAttribute("showWall",this.showWall),n.setAttribute("showVariables",this.showVariables),n.setAttribute("Hidden",this.Hidden),n.setAttribute("formulaNL",this.formulaNL),n.setAttribute("formulaNV",this.formulaNV)),n.setAttribute("geometraOpacity",this.geometraOpacity||1),n.setAttribute("readOnly",this.ReadOnly),n.setAttribute("style",this.style||"solid"),n};var o=t.Annotations.PolylineAnnotation.prototype.deserialize;t.Annotations.PolylineAnnotation.prototype.deserialize=function(e,t){this.newScale&&(this.newScale=!1),o.call(this,e,t),"x-scale"===this.Subject||"y-scale"===this.Subject?(this.showLengths="true"===e.getAttribute("showLengths"),this.width=e.getAttribute("width")?e.getAttribute("width"):e.getAttribute("strokeSize")?e.getAttribute("strokeSize"):1):(this.showNumber="true"===e.getAttribute("showNumber"),this.showName="true"===e.getAttribute("showName"),this.showLengths="true"===e.getAttribute("showLengths"),this.showWall="true"===e.getAttribute("showWall"),this.showVariables="true"===e.getAttribute("showVariables"),this.Hidden="true"===e.getAttribute("Hidden"),this.formulaNL=e.hasAttribute("formulaNL")?e.getAttribute("formulaNL"):"",this.formulaNV=e.hasAttribute("formulaNV")?e.getAttribute("formulaNV"):""),this.currentFontSize=n.getFontSize(this),this.ReadOnly="true"===e.getAttribute("readOnly"),this.style=e.getAttribute("style")?e.getAttribute("style"):"";var a=parseFloat(e.getAttribute("geometraBorderOpacity")&&"undefined"!==e.getAttribute("geometraBorderOpacity")?e.getAttribute("geometraBorderOpacity"):e.getAttribute("geometraOpacity"));Number.isNaN(a)?this.geometraBorderOpacity=1:this.geometraBorderOpacity=a};var i=t.Annotations.PolylineAnnotation.prototype.draw;t.Annotations.PolylineAnnotation.prototype.draw=function(a){switch(a.save(),a.lineCap="butt",a.strokeStyle="rgba(0, 0, 255, 1)",this.Style){case"dashed":a.setLineDash(l.a);break;case"dotted":a.setLineDash(l.b);break;case"dot-dash-dot":a.setLineDash(l.c)}i.apply(this,arguments),a.restore();var o=t.docViewer.getCompleteRotation(t.docViewer.getCurrentPage());o=-90*o*Math.PI/180;var r=this.newScale;if(a.save(),this.newAnnotation?(this.currentFontSize=n.getFontSize(this)+n.GEOMETRA_FONT_TYPE,a.font=this.currentFontSize):this.currentFontSize&&(a.font=this.currentFontSize+n.GEOMETRA_FONT_TYPE),a.fillStyle=n.GEOMETRA_TEXT_FILL_STYLE,n.buildOrDrawPolylineData(this,a,o),a.restore(),r||n.drawArrows(a,this),e.isSnaponEnabled()&&this.snapGuidePoint&&this.snapPoint){var s=this.snapPoint,c=this.snapGuidePoint;a.save(),a.setLineDash([.2]),a.lineWidth=.45,a.strokeStyle="rgba(90,177,74,0.9)",a.beginPath(),a.moveTo(s.x,s.y),a.lineTo(c.x,c.y),a.stroke(),a.restore(),a.save(),a.strokeStyle="rgba(90,177,74,1.0)",a.lineWidth=.25,a.beginPath(),a.moveTo(s.x,s.y),a.moveTo(s.x-1.5,s.y-1.5),a.lineTo(s.x+1.5,s.y-1.5),a.lineTo(s.x+1.5,s.y+1.5),a.lineTo(s.x-1.5,s.y+1.5),a.lineTo(s.x-1.5,s.y-1.5),a.stroke(),a.restore()}}}}]),e}(),_=function(){function e(){Object(a.a)(this,e),this.ScaleCreateTool=void 0}return Object(o.a)(e,[{key:"init",value:function(e,t,n){t.Tools.PolylineCreateTool.prototype.setEnableImmediateActionOnAnnotationSelection.call(this,!0);var a=t.Tools.PolylineCreateTool.prototype.mouseMove,o=t.Tools.PolylineCreateTool.prototype.mouseLeftDown,i=t.Tools.PolylineCreateTool.prototype.mouseDoubleClick,s=t.Tools.PolylineCreateTool.prototype.switchOut;t.Tools.PolylineCreateTool.prototype.mouseMove=function(t){a.apply(this,arguments),e.isSnaponEnabled()&&this.checkSnappy(t)},t.Tools.PolylineCreateTool.prototype.mouseLeftDown=function(){e.isDrawing()||t.annotManager.deselectAllAnnotations(),o.apply(this,arguments),e.isSnaponEnabled()&&this.annotation&&(this.annotation.snapPoint||this.lineAnnot)&&(this.lineAnnot?(this.annotation.popPath(),this.annotation.addPathPoint(this.lineAnnot.getStartPoint().x,this.lineAnnot.getStartPoint().y),t.annotManager.redrawAnnotation(this.annotation)):(this.annotation.popPath(),this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y),t.annotManager.redrawAnnotation(this.annotation)))},t.Tools.PolylineCreateTool.prototype.mouseDoubleClick=function(t){e.isSnaponEnabled()&&this.annotation&&this.annotation.snapPoint?(this.annotation.popPath(),this.annotation.addPathPoint(this.annotation.snapPoint.x,this.annotation.snapPoint.y),i.apply(this,arguments)):i.apply(this,arguments)},t.Tools.PolylineCreateTool.prototype.on("annotationAdded",(function(){e.setIsDrawing(!1)})),t.Tools.PolylineCreateTool.prototype.on("annotationCreated",(function(n){e.setIsDrawing(!0),"AnnotationCreatePolyline"===t.docViewer.getToolMode().name?(n.newAnnotation=!0,n.StrokeThickness=.45,n.showNumber=!1,n.showName=!1,n.showLengths=!1,n.showWall=!1,n.showVariables=!1,n.formulaNL="",n.formulaNV="",n.snapGuidePoint=void 0,n.snapPoint=void 0):"AnnotationCreateScale"===t.docViewer.getToolMode().name&&(n.Subject="x-scale",n.newScale=!0,n.showLengths=!1),n.style="solid"})),t.Tools.PolylineCreateTool.prototype.switchOut=function(){if(this.lineAnnot)try{t.annotManager.deleteAnnotation(this.lineAnnot,!0,!0),this.lineAnnot=void 0}catch(e){console.log("Error |  SnapOn (Polyline): "+e)}else this.annotation&&(this.annotation.snapPoint=void 0,this.annotation.snapGuidePoint=void 0);s.apply(this,arguments)},this.ScaleCreateTool=function(e){t.Tools.PolylineCreateTool.call(this,e,t.Annotations.PolylineAnnotation)},this.ScaleCreateTool.prototype=new t.Tools.PolylineCreateTool,this.ScaleCreateTool.prototype.mouseLeftDown=function(a){e.isDrawing()||t.annotManager.deselectAllAnnotations(),t.Tools.PolylineCreateTool.prototype.mouseLeftDown.apply(this,arguments),this.annotation&&this.annotation.getPath()&&2===this.annotation.getPath().length&&((a.altKey||r.a.useYScaleOnly)&&(n.getScale(t.docViewer.getCurrentPage())||r.a.getCreateYScale())?(this.annotation.Subject="y-scale",this.annotation.length=1,this.annotation.StrokeColor=new t.Annotations.Color(0,0,204),this.annotation.strokeSize=1,r.a.setCreateYScale(!1)):(this.annotation.Subject="x-scale",this.annotation.length=1,this.annotation.strokeSize=1),e.setIsDrawing(!1),t.annotManager.addAnnotation(this.annotation,!1),this.annotation=void 0)},this.ScaleCreateTool.prototype.mouseDoubleClick=function(a){(a.altKey||r.a.useYScaleOnly)&&(n.getScale(t.docViewer.getCurrentPage())||r.a.getCreateYScale())?(this.annotation.Subject="y-scale",this.annotation.length=1,this.annotation.StrokeColor=new t.Annotations.Color(0,0,204),this.annotation.strokeSize=1):(this.annotation.Subject="x-scale",this.annotation.length=1,this.annotation.strokeSize=1),e.isSnaponEnabled()&&this.annotation&&this.annotation.snapPoint,i.apply(this,arguments)}}},{key:"getScaleCreateTool",value:function(){return this.ScaleCreateTool}}]),e}(),M=n(26),k=n.n(M),D=n(47),x=function(){function e(){Object(a.a)(this,e),this.window=void 0}return Object(o.a)(e,[{key:"init",value:function(e,t){this.window=e,this.calculator=t}},{key:"getDisplayValuesAnnotations",value:function(){var e=Object(D.a)(k.a.mark((function e(t){var n,a,o,i,r,s,l,c,u,d,p,g,h,m,f,A,E,T,S,b,I,y,v,N,O,w;return k.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],e.prev=1,a=t.getSelectedAnnotations(),o=0;case 4:if(!(o<a.length)){e.next=88;break}i=90*this.window.docViewer.getCompleteRotation(a[o].PageNumber),e.t0=a[o].Subject,e.next="Point"===e.t0?9:"Polyline"===e.t0||"y-scale"===e.t0||"x-scale"===e.t0?69:"Polygon"===e.t0||"Reduction"===e.t0?71:"Ellipse"===e.t0?75:"Free Hand"===e.t0||"Free hand"===e.t0?79:"FreeText"===e.t0||"Freetext"===e.t0||"Stamp"===e.t0||"Free text"===e.t0?81:84;break;case 9:if("none"!=a[o].iconType){e.next=35;break}for(r=new this.window.Annotations.PolygonAnnotation,s=new this.window.Annotations.Point(a[o].X,a[o].Y),l=a[o].Width,c=a[o].Height,s.y=a[o].Y+l/2,s.x=a[o].X+c/2,r.PageNumber=a[o].PageNumber,r.FillColor=a[o].FillColor,r.FillColor.A=.8,r.StrokeColor=a[o].FillColor,r.Opacity=a[o].geometraOpacity;r.getPath().length>0;)r.popPath();r.addPathPoint(s.x-l/2,s.y-c/2),r.addPathPoint(s.x+l/2,s.y-c/2),r.addPathPoint(s.x+l/2,s.y+c/2),r.addPathPoint(s.x-l/2,s.y+c/2),r.addPathPoint(s.x-l/2,s.y-c/2),r.showName=a[o].showName,r.showNumber=a[o].showNumber,r.annotationName=a[o].annotationName,r.annotationNumber=a[o].annotationNumber,n.push(r),n=n.concat(this.calculator.buildOrDrawPolygonData(r,void 0,i)),e.next=68;break;case 35:if("none"==a[o].iconType){e.next=67;break}return(u=new this.window.Annotations.StampAnnotation).PageNumber=a[o].PageNumber,u.X=a[o].X,u.Y=a[o].Y,u.Width=a[o].Width,u.Height=a[o].Height,u.Opacity=a[o].geometraOpacity,u.Rotation=a[o].Rotation,u.ImageData=this.calculator.svgString2Image(a[o].ImageData,20*a[o].Width,20*a[o].Height,void 0,a[o].geometraOpacity),e.next=47,u.resourcesLoaded();case 47:for(d=new this.window.Annotations.PolygonAnnotation,p=new this.window.Annotations.Point(a[o].X,a[o].Y),g=a[o].Width,h=a[o].Height,p.y=a[o].Y+g/2,p.x=a[o].X+h/2;d.getPath().length>0;)d.popPath();d.addPathPoint(p.x-g/2,p.y-h/2),d.addPathPoint(p.x+g/2,p.y-h/2),d.addPathPoint(p.x+g/2,p.y+h/2),d.addPathPoint(p.x-g/2,p.y+h/2),d.addPathPoint(p.x-g/2,p.y-h/2),d.showName=a[o].showName,d.showNumber=a[o].showNumber,d.annotationName=a[o].annotationName,d.annotationNumber=a[o].annotationNumber,n.push(u),n=n.concat(this.calculator.buildOrDrawPolygonData(d,void 0,i)),e.next=68;break;case 67:console.log("Error printing Point Annotation");case 68:return e.abrupt("break",85);case 69:return"x-scale"===a[o].Subject||"y-scale"===a[o].Subject?(n.push(a[o]),m=a[o].getPathPoint(0),f=a[o].getPathPoint(1),A=a[o].getPathPoint(0).x-a[o].getPathPoint(1).x,E=a[o].getPathPoint(0).y-a[o].getPathPoint(1).y,T=Math.atan2(E,A),(S=new this.window.Annotations.LineAnnotation).StrokeColor=a[o].StrokeColor,(b=new this.window.Annotations.LineAnnotation).StrokeColor=a[o].StrokeColor,S.setStartPoint(m.x+10*Math.cos(T+Math.PI/2),m.y+10*Math.sin(T+Math.PI/2)),S.setEndPoint(m.x+10*Math.cos(T-Math.PI/2),m.y+10*Math.sin(T-Math.PI/2)),b.setStartPoint(f.x+10*Math.cos(T+Math.PI/2),f.y+10*Math.sin(T+Math.PI/2)),b.setEndPoint(f.x+10*Math.cos(T-Math.PI/2),f.y+10*Math.sin(T-Math.PI/2)),(I=new this.window.Annotations.LineAnnotation).StrokeColor=a[o].StrokeColor,I.StrokeColor=a[o].StrokeColor,I.setStartPoint(m.x,m.y),I.setEndPoint(m.x+15*Math.cos(Math.PI+T+Math.PI/4),m.y+15*Math.sin(Math.PI+T+Math.PI/4)),(y=new this.window.Annotations.LineAnnotation).StrokeColor=a[o].StrokeColor,y.setStartPoint(m.x,m.y),y.setEndPoint(m.x+15*Math.cos(Math.PI+T-Math.PI/4),m.y+15*Math.sin(Math.PI+T-Math.PI/4)),(v=new this.window.Annotations.LineAnnotation).StrokeColor=a[o].StrokeColor,v.setStartPoint(f.x,f.y),v.setEndPoint(f.x+15*Math.cos(T+Math.PI/4),f.y+15*Math.sin(T+Math.PI/4)),(N=new this.window.Annotations.LineAnnotation).StrokeColor=a[o].StrokeColor,N.setStartPoint(f.x,f.y),N.setEndPoint(f.x+15*Math.cos(T-Math.PI/4),f.y+15*Math.sin(T-Math.PI/4)),a[o].Printable=!0,n.push(S),n.push(b),n.push(I),n.push(y),n.push(v),n.push(N)):(a[o].Opacity=a[o].geometraOpacity,a[o].Printable=!0,n=n.concat(this.calculator.buildOrDrawPolylineData(a[o],void 0,i))),e.abrupt("break",85);case 71:return a[o].Opacity=a[o].geometraOpacity,a[o].Printable=!0,n=n.concat(this.calculator.buildOrDrawPolygonData(a[o],void 0,i)),e.abrupt("break",85);case 75:return a[o].Opacity=a[o].geometraOpacity,a[o].Printable=!0,n=n.concat(this.calculator.buildOrDrawEllipseData(a[o],void 0,i)),e.abrupt("break",85);case 79:try{for((O=new this.window.Annotations.PolygonAnnotation).FillColor=new this.window.Annotations.Color,O.StrokeColor=new this.window.Annotations.Color,O.FillColor.R=a[o].FillColor.R,O.FillColor.G=a[o].FillColor.G,O.FillColor.B=a[o].FillColor.B,O.FillColor.A=.3,O.StrokeColor.R=a[o].FillColor.R,O.StrokeColor.G=a[o].FillColor.G,O.StrokeColor.B=a[o].FillColor.B,O.StrokeColor.A=.01,O.Opacity=a[o].geometraOpacity,w=0;w<a[o].getPath(0).length;w++)O.addPathPoint(a[o].getPathPoint(w,0).x,a[o].getPathPoint(w,0).y);n.push(O),n=n.concat(this.calculator.buildOrDrawPolygonData(a[o],void 0,i))}catch(P){console.log("error: "+P.stack)}return e.abrupt("break",85);case 81:return a[o].Opacity=a[o].geometraOpacity,a[o].Printable=!0,e.abrupt("break",85);case 84:return e.abrupt("break",85);case 85:o++,e.next=4;break;case 88:e.next=93;break;case 90:e.prev=90,e.t1=e.catch(1),console.log("DisplayValuesLibrary error adding text annotation: "+e.t1.stack);case 93:return e.abrupt("return",n);case 94:case"end":return e.stop()}}),e,this,[[1,90]])})));return function(t){return e.apply(this,arguments)}}()}]),e}(),F=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e){var t=e.Annotations.StampAnnotation.prototype.serialize;e.Annotations.StampAnnotation.prototype.serialize=function(e,n){var a=t.call(this,e,n);return a.setAttribute("rotation",this.Rotation),a.setAttribute("maintainAspectRatio",this.MaintainAspectRatio),a.setAttribute("readOnly",this.ReadOnly),a.setAttribute("Hidden",this.Hidden),a.setAttribute("style",this.Style),a};var n=e.Annotations.StampAnnotation.prototype.deserialize;e.Annotations.StampAnnotation.prototype.deserialize=function(e,t){n.call(this,e,t),this.Rotation=e.getAttribute("rotation"),this.Opacity=this.geometraOpacity,this.MaintainAspectRatio="true"===e.getAttribute("maintainAspectRatio"),this.ReadOnly="true"===e.getAttribute("readOnly"),this.Hidden="true"===e.getAttribute("Hidden")};var a=e.Annotations.StampAnnotation.prototype.draw;e.Annotations.StampAnnotation.prototype.draw=function(e){switch(e.save(),this.Style){case"dashed":e.setLineDash(l.a);break;case"dotted":e.setLineDash(l.b);break;case"dot-dash-dot":e.setLineDash(l.c)}this.Color&&(this.Color.A=this.geometraBorderOpacity),e.strokeStyle=this.Color,e.lineWidth=this.StrokeThickness;var t=25,n={x:this.getX()-2*t,y:this.getY()-2*t},o={x:this.getWidth()+t,y:this.getHeight()+t};e.translate(n.x,n.y),e.moveTo(0,0),e.rect(2*t,2*t,o.x-t,o.y-t),e.stroke(),e.restore(),a.apply(this,arguments)}}}]),e}(),j=function(){function e(){Object(a.a)(this,e)}return Object(o.a)(e,[{key:"init",value:function(e,t){e.Tools.Tool.ENABLE_TEXT_SELECTION=!1;var n=e.Tools.Tool.prototype.mouseLeftDown;e.Tools.Tool.prototype.mouseLeftDown=function(){switch(e.docViewer.getToolMode().name){case"AnnotationCreatePoint":case"AnnotationCreatePolyline":case"AnnotationCreatePolygon":case"AnnotationCreateEllipse":case"AnnotationCreateReduction":case"AnnotationCreateFreeHand":case"AnnotationCreateScale":case"AnnotationCreateFreeText":case"AnnotationCreateArrow":this.annotation||e.annotManager.deselectAllAnnotations()}n.apply(this,arguments)},e.Tools.Tool.prototype.angleMouseMove=function(n){var a=e.annotManager,o=this.getMouseLocation(n),i=e.docViewer.getDisplayModeManager().getDisplayMode(),r=e.docViewer.getCurrentPage();if(o=i.windowToPage(o,r),this.previousLoc){var s=o.x-this.previousLoc.x,l=o.y-this.previousLoc.y,c=180*Math.atan2(l,s)/Math.PI,u=void 0;c<=0?u=Math.abs(c):c>0&&(u=360-c),this.previousRotation||(this.previousRotation=c,this.rotation=t.getDegreStepRotation(u)),Math.abs(c-this.previousRotation)>3.75&&(this.previousRotation=c,this.rotation=t.getDegreStepRotation(u));var d=this.annotation.getPathPoint(this.annotation.getPath().length-2),p=this.annotation.getPathPoint(this.annotation.getPath().length-1);this.rotatedPoint=t.getRotatedPoint(d,p,this.rotation),this.annotation.popPath(),this.annotation.addPathPoint(this.rotatedPoint.x,this.rotatedPoint.y),a.redrawAnnotation(this.annotation)}},e.Tools.Tool.prototype.angleMouseLeftDown=function(n,a){if(this.annotation?this.previousLoc=this.annotation.getPathPoint(this.annotation.getPath().length-1):this.previousLoc=void 0,void 0===this.rotation&&(this.rotation=0),n.ctrlKey&&this.annotation&&this.annotation.getPath().length>a){var o=this.annotation.getPathPoint(this.annotation.getPath().length-2),i=this.annotation.getPathPoint(this.annotation.getPath().length-1);this.rotatedPoint=t.getRotatedPoint(o,i,this.rotation),this.annotation.popPath(),this.annotation.addPathPoint(this.rotatedPoint.x,this.rotatedPoint.y);var r=e.annotManager;this.rotationForDoubleClick=this.rotation,this.previousRotation=void 0,r.redrawAnnotation(this.annotation)}},e.Tools.Tool.prototype.angleMouseDoubleClick=function(){var n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=this.annotation.getPathPoint(this.annotation.getPath().length-2),o=this.annotation.getPathPoint(this.annotation.getPath().length-1);this.rotatedPoint=t.getRotatedPoint(a,o,this.rotation),this.annotation.popPath(),this.annotation.addPathPoint(this.rotatedPoint.x,this.rotatedPoint.y),n&&this.annotation.addPathPoint(this.annotation.getPathPoint(0).x,this.annotation.getPathPoint(0).y);var i=e.annotManager;i.addAnnotation(this.annotation,!1),this.annotation=void 0,this.rotation=void 0},e.Tools.Tool.prototype.checkSnappy=function(){var t=Object(D.a)(k.a.mark((function t(n){var a,o,i,s,l;return k.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=this.getMouseLocation(n),o=e.docViewer.getDisplayModeManager().getDisplayMode(),i=e.docViewer.getCurrentPage(),s=o.windowToPage(a,i),this.annotation||this.lineAnnot?this.annotation&&this.lineAnnot&&(e.annotManager.deleteAnnotation(this.lineAnnot,!0,!0),this.lineAnnot=void 0):(this.lineAnnot=new e.Annotations.LineAnnotation,this.lineAnnot.setStartPoint(s.x,s.x),this.lineAnnot.setEndPoint(s.x,s.x),this.lineAnnot.Subject="SnapOnHelper",this.lineAnnot.setRotationControlEnabled(!1),e.annotManager.addAnnotation(this.lineAnnot,!0)),this.lineAnnot?(this.lineAnnot.PageNumber!==i&&(this.lineAnnot.PageNumber=i),this.lineAnnot.setEndPoint(s.x,s.y),e.annotManager.redrawAnnotation(this.lineAnnot)):this.annotation&&(this.annotation.snapGuidePoint=s,e.annotManager.redrawAnnotation(this.annotation)),t.next=8,e.docViewer.snapToNearest(i,s.x,s.y,r.a.getSnapMode(!0));case 8:if(l=t.sent)try{this.lineAnnot?(this.lineAnnot.setStartPoint(l.x,l.y),e.annotManager.redrawAnnotation(this.lineAnnot)):this.annotation&&(this.annotation.snapPoint=l,e.annotManager.redrawAnnotation(this.annotation))}catch(c){console.log("SnapOn Error: "+c)}case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()}}]),e}(),V=function(){function e(t){Object(a.a)(this,e),this.webviewer=t,this.initAnnotation=new i,this.initPointAnnotation=new w,this.initPolygonAnnotation=new R,this.initEllipseAnnotation=new T,this.initFreeHandAnnotation=new I,this.initPolylineAnnotation=new C,this.initFreeTextAnnotation=new v,this.initStampAnnotation=new F,this.calculator=new E,this.initAnnotationEdit=new s,this.initEllipseTool=new S,this.initFreeHandTool=new y,this.initPointTool=new P,this.initPolygonTool=new L,this.initPolylineTool=new _,this.initTool=new j,this.drawing=!1,this.printHelper=new x,this.freeTextToolCustomizer=new N,this.initArrowTool=new u,this.arrowAnnotationCustomizer=new c}return Object(o.a)(e,[{key:"isSnaponEnabled",value:function(){return r.a.isSnaponEnabled()}},{key:"isDrawing",value:function(){return this.drawing}},{key:"setIsDrawing",value:function(e){this.drawing=e}},{key:"getPointAnnotation",value:function(){return this.initPointAnnotation.getPointAnnotation()}},{key:"getPrintHelper",value:function(){return this.printHelper}},{key:"cleanup",value:function(){this.webviewer=void 0,this.initAnnotation=void 0,this.initPointAnnotation=void 0,this.initPolygonAnnotation=void 0,this.initEllipseAnnotation=void 0,this.initFreeHandAnnotation=void 0,this.initPolylineAnnotation=void 0,this.initFreeTextAnnotation=void 0,this.initStampAnnotation=void 0,this.calculator=void 0,this.initAnnotationEdit=void 0,this.initEllipseTool=void 0,this.initFreeHandTool=void 0,this.initPointTool=void 0,this.initPolygonTool=void 0,this.initPolylineTool=void 0,this.initTool=void 0,this.drawing=!1,this.printHelper=void 0}}]),e}();t.a=V},366:function(e){e.exports=JSON.parse('{"folder":{"types":["folder"],"fileExtensions":[],"humanName":"Folder","icon":"folder"},"json":{"types":["application/json"],"fileExtensions":["json"],"humanName":"JSON File"},"txt":{"types":["text/plain"],"fileExtensions":["txt"],"humanName":"Text File","icon":"file-text"},"pdf":{"types":["application/pdf"],"fileExtensions":["pdf"],"humanName":"PDF File","icon":"file-pdf"},"ifc":{"types":["application/ifc"],"fileExtensions":["ifc"],"humanName":"IFC File","icon":"file-ifc"},"gif":{"types":["image/gif"],"fileExtensions":["gif"],"humanName":"GIF File","icon":"file-gif","image":true},"png":{"types":["image/png"],"fileExtensions":["png"],"humanName":"PNG File","icon":"file-image","image":true},"jpeg":{"types":["image/jpeg"],"fileExtensions":["jpg","jpeg"],"humanName":"JPG File","icon":"file-jpg","image":true},"bmp":{"types":["image/bmp"],"fileExtensions":["bmp"],"humanName":"BMP File","icon":"file-image","image":true},"tiff":{"types":["image/tiff"],"fileExtensions":["tiff"],"humanName":"TIFF File","icon":"file-image","image":true},"webp":{"types":["image/webp"],"fileExtensions":["webp"],"humanName":"WebP File","icon":"file-image","image":true},"pptx":{"types":["application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.oasis.opendocument.presentation"],"fileExtensions":["ppt","pptx","odp"],"humanName":"Powerpoint File","icon":"file-ppt"},"excel":{"types":["application/vnd.ms-excel","application/vnd.oasis.opendocument.spreadsheet"],"fileExtensions":["xls","ods"],"humanName":"Excel File","icon":"file-excel"},"word":{"types":["application/msword","application/vnd.oasis.opendocument.text"],"fileExtensions":["doc","odt"],"humanName":"Word File","icon":"file-word"},"docx":{"types":["application/vnd.openxmlformats-officedocument.wordprocessingml.document"],"fileExtensions":["docx"],"humanName":"Word File","icon":"file-docx"},"xlsx":{"types":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],"fileExtensions":["xlsx"],"humanName":"Excel File","icon":"file-xlsx"}}')},37:function(e,t,n){"use strict";n.d(t,"i",(function(){return a})),n.d(t,"f",(function(){return o})),n.d(t,"a",(function(){return i})),n.d(t,"h",(function(){return r})),n.d(t,"b",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"c",(function(){return u})),n.d(t,"e",(function(){return d}));var a={CONNECT:"connect",RECONNECT:"reconnect",RECONNECT_ERR:"reconnect_error",DISCONNECT:"disconnect",ERROR:"error",BUNDLE_REFRESH:"bundleRefresh"},o={GEO_ANNOTATION:"geoAnnotation",GEO_FILE:"geoFile",GEO_PROJECT:"geoProject",GEO_ANNOTATION_ROW:"geoAnnotationRow",GEO_ESTIMATE:"geoEstimate",GEO_SCALE:"geoScale",AUTH:"auth"},i={CREATE:"create",UPDATE:"update",DELETE:"delete",DUPLICATE:"duplicate"},r={CREATE:"create",DELETE:"delete",UPDATE:"update"},s={CREATE:"create",DELETE:"delete",UPDATE:"update"},l={OPEN:"open",LEAVE:"leave",CREATE:"create",DELETE:"delete",UPDATE:"update"},c={DUPLICATE:"duplicate"},u={LICENSE_ACTIVATED_FROM_ELSEWHERE:"licenseActivatedFromElsewhere",SESSION_EXPIRED:"sessionExpired"},d={CREATE_GROUP:"createGroup"}},38:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"i",(function(){return o})),n.d(t,"x",(function(){return i})),n.d(t,"w",(function(){return r})),n.d(t,"f",(function(){return s})),n.d(t,"z",(function(){return l})),n.d(t,"u",(function(){return c})),n.d(t,"j",(function(){return u})),n.d(t,"D",(function(){return d})),n.d(t,"r",(function(){return p})),n.d(t,"t",(function(){return g})),n.d(t,"d",(function(){return h})),n.d(t,"o",(function(){return m})),n.d(t,"s",(function(){return f})),n.d(t,"e",(function(){return A})),n.d(t,"b",(function(){return E})),n.d(t,"c",(function(){return T})),n.d(t,"n",(function(){return S})),n.d(t,"k",(function(){return b})),n.d(t,"m",(function(){return I})),n.d(t,"l",(function(){return y})),n.d(t,"v",(function(){return v})),n.d(t,"F",(function(){return N})),n.d(t,"A",(function(){return O})),n.d(t,"B",(function(){return w})),n.d(t,"E",(function(){return P})),n.d(t,"I",(function(){return R})),n.d(t,"G",(function(){return L})),n.d(t,"H",(function(){return C})),n.d(t,"g",(function(){return _})),n.d(t,"h",(function(){return M})),n.d(t,"q",(function(){return k})),n.d(t,"C",(function(){return D})),n.d(t,"y",(function(){return x})),n.d(t,"p",(function(){return F})),n.d(t,"J",(function(){return j}));var a="Arrow",o="Free hand",i="Polyline",r="Polygon",s="Ellipse",l="Reduction",c="Point",u="Free text",d="Stamp",p="3DModel",g="PeripheralValue",h="CenterValue",m="group",f="interiorColor",A="color",E="border",T="Style",S="geometraOpacity",b="geometraBorderOpacity",I="geometraLineStart",y="geometraLineEnd",v="pointSize",N="strokeSize",O="richTextColor",w="richTextStyle",P="strokeColor",R="textContents",L="TextAlign",C="text-align",_="font",M="fontSize",k="iconType",D="rotation",x="quantity",F="height",j="width"},4:function(e,t,n){"use strict";n.d(t,"b",(function(){return o.a})),n.d(t,"m",(function(){return o.i})),n.d(t,"B",(function(){return o.x})),n.d(t,"A",(function(){return o.w})),n.d(t,"j",(function(){return o.f})),n.d(t,"D",(function(){return o.z})),n.d(t,"y",(function(){return o.u})),n.d(t,"n",(function(){return o.j})),n.d(t,"I",(function(){return o.D})),n.d(t,"v",(function(){return o.r})),n.d(t,"x",(function(){return o.t})),n.d(t,"g",(function(){return o.d})),n.d(t,"s",(function(){return o.o})),n.d(t,"w",(function(){return o.s})),n.d(t,"h",(function(){return o.e})),n.d(t,"e",(function(){return o.b})),n.d(t,"f",(function(){return o.c})),n.d(t,"r",(function(){return o.n})),n.d(t,"o",(function(){return o.k})),n.d(t,"q",(function(){return o.m})),n.d(t,"p",(function(){return o.l})),n.d(t,"z",(function(){return o.v})),n.d(t,"K",(function(){return o.F})),n.d(t,"E",(function(){return o.A})),n.d(t,"F",(function(){return o.B})),n.d(t,"J",(function(){return o.E})),n.d(t,"M",(function(){return o.I})),n.d(t,"L",(function(){return o.H})),n.d(t,"k",(function(){return o.g})),n.d(t,"l",(function(){return o.h})),n.d(t,"G",(function(){return o.C})),n.d(t,"C",(function(){return o.y})),n.d(t,"u",(function(){return o.p})),n.d(t,"N",(function(){return o.J})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return s})),n.d(t,"t",(function(){return l})),n.d(t,"a",(function(){return c})),n.d(t,"H",(function(){return u})),n.d(t,"i",(function(){return d.a})),n.d(t,"P",(function(){return p.f})),n.d(t,"O",(function(){return p.e}));var a,o=n(38),i=n(30),r={Annotation_Nothing:"ESTIMATE.EXPORT.NOTHING_TO_EXPORT",Annotation_Full:"ESTIMATE.EXPORT.ANNOTATION_FULL",Annotation_Net_Only:"ESTIMATE.EXPORT.ANNOTATION_NET",Annotation_Net_Only_No_Path:"ESTIMATE.EXPORT.ANNOTATION_NET_NO_PATH",Annotation_Folder_Full:"ESTIMATE.EXPORT.ANNOTATION_FOLDER_FULL"},s={Annotation_Rows_Nothing:"ESTIMATE.EXPORT.NOTHING_TO_EXPORT",Annotation_Rows_Full:"ESTIMATE.EXPORT.ANNOTATION_ROWS_FULL",Annotation_Rows_Sum_Folder:"ESTIMATE.EXPORT.ANNOTATION_ROWS_SUM_PER_FOLDER",Annotation_Rows_Sum:"ESTIMATE.EXPORT.ANNOTATION_ROWS_SUM",Annotation_Rows_Bidcon:"ESTIMATE.EXPORT.BIDCON"},l=(a={"ESTIMATE.EXPORT.NOTHING_TO_EXPORT":"Nothing to Export","ESTIMATE.EXPORT.ANNOTATION_FULL":"Annotation Full","ESTIMATE.EXPORT.ANNOTATION_NET":"Annotation Net","ESTIMATE.EXPORT.ANNOTATION_NET_NO_PATH":"Annotation Net No Path","ESTIMATE.EXPORT.ANNOTATION_FOLDER_FULL":"Annotation Folder Full"},Object(i.a)(a,"ESTIMATE.EXPORT.NOTHING_TO_EXPORT","Nothing to Export"),Object(i.a)(a,"ESTIMATE.EXPORT.ANNOTATION_ROWS_FULL","Annotation Rows Full"),Object(i.a)(a,"ESTIMATE.EXPORT.ANNOTATION_ROWS_SUM_PER_FOLDER","Annotation Rows Sum per Folder"),Object(i.a)(a,"ESTIMATE.EXPORT.ANNOTATION_ROWS_SUM","Annotation Rows Sum"),Object(i.a)(a,"ESTIMATE.EXPORT.BIDCON","BIDCON"),a),c={ID:"ID",GROUP_FOLDER:"Group Folder",NUMBER:"Number",NAME:"Name",HEIGHT:"Height",FILE_NAME:"File Name",TYPE:"Type",AREA:"Area",LENGTH:"Length",VOLUME:"Volume",WALL:"Wall",NET_AREA:"Net: Area",NET_LENGTH:"Net: Length",NET_VOLUME:"Net: Volume",NET_WALL:"Net: Wall",RED_AREA:"Red: Area",RED_LENGTH:"Red: Length",RED_VOLUME:"Red: Volume",RED_WALL:"Red: Wall",AVERAGE_AREA:"Average: Area",AVERAGE_LENGTH:"Average: Length",AVERAGE_VOLUME:"Average: Volume",AVERAGE_WALL:"Average: Wall",COUNT:"Count",AREA_TILES:"Area Tiles",AREA_JOINT_LENGTH:"Area Joint Length",AREA_JOINT_VOLUME:"Area Joint Volume",WALL_TILES:"Wall Tiles",WALL_JOINT_LENGTH:"Wall Joint Length",WALL_JOINT_VOLUME:"Wall Joint Volume",POINTS:"Points",TEXT_CONTENTS:"Text Contents",REDUCTION_OF:"Reduction of",OUTER_DIM_X:"Outer DIM X",OUTER_DIM_Y:"Outer DIM Y",RADIUS_X:"Radius X",RADIUS_Y:"Radius Y",DIAMETER_X:"Diameter X",DIAMETER_Y:"Diameter Y"},u={ID:"ID",STATUS:"Status",PROFESSION:"Profession",PHASE:"Phase",SEGMENT:"Segment",ACTION:"Action",MATERIAL:"Material",AMOUNT:"Amount",UNIT:"Unit",UNIT_PRICE:"Unit Price",UNIT_TIME:"Unit Time",TOTAL_PRICE:"Total Price",TOTAL_TIME:"Total Time",CURRENCY:"Currency",OBJECTS:"Affected Objects",FORMULA:"Formula"},d=n(18),p=(n(309),n(77),n(81),n(55))},429:function(e){e.exports=JSON.parse('{"countries":[{"name":"Afghanistan","cca2":"af","code":93},{"name":"Albania","cca2":"al","code":355},{"name":"Algeria","cca2":"dz","code":213},{"name":"American Samoa","cca2":"as","code":1684},{"name":"Andorra","cca2":"ad","code":376},{"name":"Angola","cca2":"ao","code":244},{"name":"Anguilla","cca2":"ai","code":1264},{"name":"Antigua and Barbuda","cca2":"ag","code":1268},{"name":"Argentina","cca2":"ar","code":54},{"name":"Armenia","cca2":"am","code":374},{"name":"Aruba","cca2":"aw","code":297},{"name":"Australia","cca2":"au","code":61},{"name":"Austria","cca2":"at","code":43},{"name":"Azerbaijan","cca2":"az","code":994},{"name":"Bahamas","cca2":"bs","code":1242},{"name":"Bahrain","cca2":"bh","code":973},{"name":"Bangladesh","cca2":"bd","code":880},{"name":"Barbados","cca2":"bb","code":1246},{"name":"Belarus","cca2":"by","code":375},{"name":"Belgium","cca2":"be","code":32},{"name":"Belize","cca2":"bz","code":501},{"name":"Benin","cca2":"bj","code":229},{"name":"Bermuda","cca2":"bm","code":1441},{"name":"Bhutan","cca2":"bt","code":975},{"name":"Bolivia","cca2":"bo","code":591},{"name":"Bosnia and Herzegovina","cca2":"ba","code":387},{"name":"Botswana","cca2":"bw","code":267},{"name":"Brazil","cca2":"br","code":55},{"name":"Brunei Darussalam","cca2":"bn","code":673},{"name":"Bulgaria","cca2":"bg","code":359},{"name":"Burkina Faso","cca2":"bf","code":226},{"name":"Burundi","cca2":"bi","code":257},{"name":"Cambodia","cca2":"kh","code":855},{"name":"Cameroon","cca2":"cm","code":237},{"name":"Canada","cca2":"ca","code":1},{"name":"Cape Verde","cca2":"cv","code":238},{"name":"Cayman Islands","cca2":"ky","code":1345},{"name":"Central African Republic","cca2":"cf","code":236},{"name":"Chad","cca2":"td","code":235},{"name":"Chile","cca2":"cl","code":56},{"name":"China","cca2":"cn","code":86},{"name":"Colombia","cca2":"co","code":57},{"name":"Comoros","cca2":"km","code":269},{"name":"Congo (DRC)","cca2":"cd","code":243},{"name":"Congo (Republic)","cca2":"cg","code":242},{"name":"Cook Islands","cca2":"ck","code":682},{"name":"Costa Rica","cca2":"cr","code":506},{"name":"Ivory Coast","cca2":"ci","code":225},{"name":"Croatia","cca2":"hr","code":385},{"name":"Cuba","cca2":"cu","code":53},{"name":"Cyprus","cca2":"cy","code":357},{"name":"Czech Republic","cca2":"cz","code":420},{"name":"Denmark","cca2":"dk","code":45},{"name":"Djibouti","cca2":"dj","code":253},{"name":"Dominica","cca2":"dm","code":1767},{"name":"Dominican Republic","cca2":"do","code":1809},{"name":"Ecuador","cca2":"ec","code":593},{"name":"Egypt","cca2":"eg","code":20},{"name":"El Salvador","cca2":"sv","code":503},{"name":"Equatorial Guinea","cca2":"gq","code":240},{"name":"Eritrea","cca2":"er","code":291},{"name":"Estonia","cca2":"ee","code":372},{"name":"Ethiopia","cca2":"et","code":251},{"name":"Faroe Islands","cca2":"fo","code":298},{"name":"Fiji","cca2":"fj","code":679},{"name":"Finland","cca2":"fi","code":358},{"name":"France","cca2":"fr","code":33},{"name":"French Polynesia","cca2":"pf","code":689},{"name":"Gabon","cca2":"ga","code":241},{"name":"Gambia","cca2":"gm","code":220},{"name":"Georgia","cca2":"ge","code":995},{"name":"Germany","cca2":"de","code":49},{"name":"Ghana","cca2":"gh","code":233},{"name":"Gibraltar","cca2":"gi","code":350},{"name":"Greece","cca2":"gr","code":30},{"name":"Greenland","cca2":"gl","code":299},{"name":"Grenada","cca2":"gd","code":1473},{"name":"Guadeloupe","cca2":"gp","code":590},{"name":"Guam","cca2":"gu","code":1671},{"name":"Guatemala","cca2":"gt","code":502},{"name":"Guernsey","cca2":"gg","code":44},{"name":"Guinea","cca2":"gn","code":224},{"name":"Guinea-Bissau","cca2":"gw","code":245},{"name":"Guyana","cca2":"gy","code":592},{"name":"Haiti","cca2":"ht","code":509},{"name":"Honduras","cca2":"hn","code":504},{"name":"Hong Kong","cca2":"hk","code":852},{"name":"Hungary","cca2":"hu","code":36},{"name":"Iceland","cca2":"is","code":354},{"name":"India","cca2":"in","code":91},{"name":"Indonesia","cca2":"id","code":62},{"name":"Iran","cca2":"ir","code":98},{"name":"Iraq","cca2":"iq","code":964},{"name":"Ireland","cca2":"ie","code":353},{"name":"Isle of Man","cca2":"im","code":44},{"name":"Israel","cca2":"il","code":972},{"name":"Italy","cca2":"it","code":39},{"name":"Jamaica","cca2":"jm","code":1876},{"name":"Japan","cca2":"jp","code":81},{"name":"Jersey","cca2":"je","code":44},{"name":"Jordan","cca2":"jo","code":962},{"name":"Kazakhstan","cca2":"kz","code":7},{"name":"Kenya","cca2":"ke","code":254},{"name":"Kiribati","cca2":"ki","code":686},{"name":"Kuwait","cca2":"kw","code":965},{"name":"Kyrgyzstan","cca2":"kg","code":996},{"name":"Laos","cca2":"la","code":856},{"name":"Latvia","cca2":"lv","code":371},{"name":"Lebanon","cca2":"lb","code":961},{"name":"Lesotho","cca2":"ls","code":266},{"name":"Liberia","cca2":"lr","code":231},{"name":"Libya","cca2":"ly","code":218},{"name":"Liechtenstein","cca2":"li","code":423},{"name":"Lithuania","cca2":"lt","code":370},{"name":"Luxembourg","cca2":"lu","code":352},{"name":"Macao","cca2":"mo","code":853},{"name":"Macedonia","cca2":"mk","code":389},{"name":"Madagascar","cca2":"mg","code":261},{"name":"Malawi","cca2":"mw","code":265},{"name":"Malaysia","cca2":"my","code":60},{"name":"Maldives","cca2":"mv","code":960},{"name":"Mali","cca2":"ml","code":223},{"name":"Malta","cca2":"mt","code":356},{"name":"Marshall Islands","cca2":"mh","code":692},{"name":"Martinique","cca2":"mq","code":596},{"name":"Mauritania","cca2":"mr","code":222},{"name":"Mauritius","cca2":"mu","code":230},{"name":"Mexico","cca2":"mx","code":52},{"name":"Micronesia","cca2":"fm","code":691},{"name":"Moldova","cca2":"md","code":373},{"name":"Monaco","cca2":"mc","code":377},{"name":"Mongolia","cca2":"mn","code":976},{"name":"Montenegro","cca2":"me","code":382},{"name":"Montserrat","cca2":"ms","code":1664},{"name":"Morocco","cca2":"ma","code":212},{"name":"Mozambique","cca2":"mz","code":258},{"name":"Myanmar (Burma)","cca2":"mm","code":95},{"name":"Namibia","cca2":"na","code":264},{"name":"Nauru","cca2":"nr","code":674},{"name":"Nepal","cca2":"np","code":977},{"name":"Netherlands","cca2":"nl","code":31},{"name":"New Caledonia","cca2":"nc","code":687},{"name":"New Zealand","cca2":"nz","code":64},{"name":"Nicaragua","cca2":"ni","code":505},{"name":"Niger","cca2":"ne","code":227},{"name":"Nigeria","cca2":"ng","code":234},{"name":"North Korea","cca2":"kp","code":850},{"name":"Norway","cca2":"no","code":47},{"name":"Oman","cca2":"om","code":968},{"name":"Pakistan","cca2":"pk","code":92},{"name":"Palau","cca2":"pw","code":680},{"name":"Palestinian Territory","cca2":"ps","code":970},{"name":"Panama","cca2":"pa","code":507},{"name":"Papua New Guinea","cca2":"pg","code":675},{"name":"Paraguay","cca2":"py","code":595},{"name":"Peru","cca2":"pe","code":51},{"name":"Philippines","cca2":"ph","code":63},{"name":"Poland","cca2":"pl","code":48},{"name":"Portugal","cca2":"pt","code":351},{"name":"Puerto Rico","cca2":"pr","code":1787},{"name":"Qatar","cca2":"qa","code":974},{"name":"Reunion","cca2":"re","code":262},{"name":"Romania","cca2":"ro","code":40},{"name":"Russian Federation","cca2":"ru","code":7},{"name":"Rwanda","cca2":"rw","code":250},{"name":"Saint Kitts and Nevis","cca2":"kn","code":1869},{"name":"Saint Lucia","cca2":"lc","code":1758},{"name":"Saint Vincent and the Grenadines","cca2":"vc","code":1784},{"name":"Samoa","cca2":"ws","code":685},{"name":"San Marino","cca2":"sm","code":378},{"name":"Sao Tome and Principe","cca2":"st","code":239},{"name":"Saudi Arabia","cca2":"sa","code":966},{"name":"Senegal","cca2":"sn","code":221},{"name":"Serbia","cca2":"rs","code":381},{"name":"Seychelles","cca2":"sc","code":248},{"name":"Sierra Leone","cca2":"sl","code":232},{"name":"Singapore","cca2":"sg","code":65},{"name":"Slovakia","cca2":"sk","code":421},{"name":"Slovenia","cca2":"si","code":386},{"name":"Solomon Islands","cca2":"sb","code":677},{"name":"Somalia","cca2":"so","code":252},{"name":"South Africa","cca2":"za","code":27},{"name":"South Korea","cca2":"kr","code":82},{"name":"Spain","cca2":"es","code":34},{"name":"Sri Lanka","cca2":"lk","code":94},{"name":"Sudan","cca2":"sd","code":249},{"name":"Suriname","cca2":"sr","code":597},{"name":"Swaziland","cca2":"sz","code":268},{"name":"Sweden","cca2":"se","code":46},{"name":"Switzerland","cca2":"ch","code":41},{"name":"Syrian Arab Republic","cca2":"sy","code":963},{"name":"Taiwan, Province of China","cca2":"tw","code":886},{"name":"Tajikistan","cca2":"tj","code":992},{"name":"Tanzania","cca2":"tz","code":255},{"name":"Thailand","cca2":"th","code":66},{"name":"Timor-Leste","cca2":"tl","code":670},{"name":"Togo","cca2":"tg","code":228},{"name":"Tonga","cca2":"to","code":676},{"name":"Trinidad and Tobago","cca2":"tt","code":1868},{"name":"Tunisia","cca2":"tn","code":216},{"name":"Turkey","cca2":"tr","code":90},{"name":"Turkmenistan","cca2":"tm","code":993},{"name":"Turks and Caicos Islands","cca2":"tc","code":1649},{"name":"Tuvalu","cca2":"tv","code":688},{"name":"Uganda","cca2":"ug","code":256},{"name":"Ukraine","cca2":"ua","code":380},{"name":"United Arab Emirates","cca2":"ae","code":971},{"name":"United Kingdom","cca2":"gb","code":44},{"name":"United States","cca2":"us","code":1},{"name":"Uruguay","cca2":"uy","code":598},{"name":"Uzbekistan","cca2":"uz","code":998},{"name":"Vanuatu","cca2":"vu","code":678},{"name":"Vatican City","cca2":"va","code":379},{"name":"Venezuela","cca2":"ve","code":58},{"name":"Viet Nam","cca2":"vn","code":84},{"name":"Virgin Islands (British)","cca2":"vg","code":1284},{"name":"Virgin Islands (U.S.)","cca2":"vi","code":1340},{"name":"Western Sahara","cca2":"eh","code":212},{"name":"Yemen","cca2":"ye","code":967},{"name":"Zambia","cca2":"zm","code":260},{"name":"Zimbabwe","cca2":"zw","code":263}]}')},45:function(e,t,n){"use strict";var a=n(76),o=n(28),i=n(26),r=n.n(i),s=n(47),l=n(12),c=n(60),u=n(92),d=n(105),p=n(170),g=n(10),h=n(192),m=n(89),f=n(48),A=n(5),E=n(37),T=n(35),S=n(87),b=n.n(S),I=n(153),y=n.n(I),v=n(19),N=n(182);t.a=Object(f.createStore)({listenables:[m.a],init:function(){h.a.d("ProjectsStore: init"),this.projects=new g.a.List,this.activeProjectId=void 0,this.departmentList=new g.a.List,this.projectLoaderData={wanted:0,loaded:0,isLoading:!0}},setActiveProjectId:function(e){this.activeProjectId!==e&&(this.activeProjectId=e,e&&A.l.onSetActiveProjectId(e))},onCreateNewProject:function(){this.trigger("createNewProject")},onOpenProjects:function(){this.trigger("openProjects")},onDeleteProjects:function(){this.trigger("deleteProjects")},getActiveProjectId:function(){return this.activeProjectId},getActiveProject:function(){if(this.getActiveProjectId())return this.getProjectById(this.getActiveProjectId())},getProjects:function(){return this.projects.sort((function(e,t){return e.get("id")>t.get("id")?-1:1}))},getProjectCurrency:function(e){return this.getProjectById(e)?this.getProjectById(e).get("currency"):"EUR"},getProjectUnitsByID:function(){var e=this.getProjectById(this.getActiveProjectId());if(e)return e.get("units")},getProjectById:function(e){return h.a.d("getProjectById"+e),this.projects.find((function(t){return t.get("id")===e<<0}))},getDepartmentList:function(){return this.departmentList},getNextProjectNumber:function(){var e=new d.a,t="";return this.projects.forEach((function(e){var n=e.get("projectNumber");n&&n.localeCompare(t,void 0,{numeric:!0})>0&&(t=n)})),t?e.getNextNumberString(t):e.getNextNumberString("000")},getProjectRows:function(){var e=this.getProjects();return this.getReactDataGridRows(e)},getReactDataGridRows:function(e){var t=this,n=[],a=p.a.getAppSearch();return e.forEach((function(e){try{var a=e.toJS();if(a.key=a.id,e.getIn(["department","name"]))a.department=e.getIn(["department","name"]);else{var o=t.departmentList.find((function(t){return t.department.id===e.getIn(["department","id"])}));a.department=o?o.department.name:""}a.projectLeader=e.get("projectLeaderName"),a.createdAt=y()(a.createdAt).format("YYYY-MM-DD HH:mm"),n.push(a)}catch(i){console.log("Error | getReactDataGridRows: "+i)}})),a&&(a=a.toLowerCase(),n=n.filter((function(e){var t,n,o=-1!==(""+e.id).indexOf(a)||-1!==(null===(t=e.projectNumber)||void 0===t?void 0:t.toLowerCase().indexOf(a))||-1!==(null===(n=e.name)||void 0===n?void 0:n.toLowerCase().indexOf(a));return o||(o="string"===typeof e.projectLeader&&-1!==e.projectLeader.toLowerCase().indexOf(a)),o||(o="string"===typeof e.department&&-1!==e.department.toLowerCase().indexOf(a)),o}))),Object(l.uniqBy)(n,"id")},closeDialogAfterDeletion:function(){this.trigger("closeDialogAfterDeletion")},closeNewProjectDialog:function(){this.trigger("closeNewProjectDialog")},updateDepartmentList:function(){this.departmentList=u.a.getAccessibleDeparments()},onRequestProject:function(e){var t=this;v.a.setFetchingDataLoader(!0),b.a.get("".concat("https://api.geometra.rukkor.io","/estimates"),{headers:{Authorization:c.a.getJwt()},params:{projectId:e}}).then((function(e){t.onRequestEstimateHandler(e)})).catch((function(e){v.a.setFetchingDataLoader(!1),console.log(e)}))},onRequestEstimateHandler:function(e){var t=e.data.map((function(e){var t=e.annotations,n=e.estimate,a=e.rows;return{theGeoEstimate:n,theGeoAnnotationList:t,theGeoScaleList:e.scales,rows:a}}));T.f.incrementLoader(25,t.length),N.a.onSetEstimates(t.map((function(e){return e.theGeoEstimate}))),v.a.onInitializeEstimates(t)},onGeoProjectMessageHandler:function(e){var t=e.action;if(200!==e.statusCode)return console.log(e.payload.message);switch(t){case E.g.CREATE:var n=e.payload,a=n.projects,o=n.userId;this.onCreateProject(a[0],o);break;case E.g.UPDATE:this.onUpdateProject(e);break;case E.g.DELETE:this.onDeleteProject(e);break;default:return}},onProjectsFetch:function(e){this.projects=e,this.projectLoaderData.isLoading=!1,this.trigger("projectAdded")},fetchProjects:function(e){var t=this;return Object(s.a)(r.a.mark((function n(){return r.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,b.a.get("".concat("https://api.geometra.rukkor.io","/projects"),{headers:{Authorization:e}}).then((function(e){t.onProjectsFetch(g.a.fromJS(e.data))}));case 2:case"end":return n.stop()}}),n)})))()},onRequestInsertNewProject:function(e,t,n,a,o,i){var r={name:e,projectNumber:t,country:n,departmentId:a,projectLeaderId:c.a.getUserId(),currency:o,units:i};A.l.onSendMessage(E.f.GEO_PROJECT,{action:E.g.CREATE,projects:[r]})},onCreateProject:function(e,t){var n=e.id,a=e.country,i=e.currency,r=e.name,s=e.projectLeaderId,l=e.projectNumber,d=e.units,p=e.departmentId,h=e.deleted,m=e.createdAt,f=u.a.departmentUserAccess.find((function(e){return e.department.id===p})),A=g.a.fromJS({country:a,createdAt:Date.parse(m),currency:i,deleted:h,department:Object(o.a)({id:p},f.department),id:n,name:r,projectLeaderId:s,projectNumber:l,units:d});this.projects=this.projects.push(A),this.trigger("projectAdded"),t===c.a.getUserId()&&this.trigger("goToDrive",A.get("id"))},onUpdateProject:function(e){var t,n=e.payload;(null===(t=n.project)||void 0===t?void 0:t.deleted)||(this.projects=this.projects.map((function(e){var t;if(e.get("id")===(null===(t=n.project)||void 0===t?void 0:t.id)){var i=e.toJS(),r=n.project,s=(r.departmentId,Object(a.a)(r,["departmentId"])),l=Object(o.a)(Object(o.a)({},i),s);return A.i.changeRootFolderName(n.project.name),g.a.fromJS(l)}return e})),this.trigger("projectUpdated"))},onDeleteProject:function(e){var t=e.payload.ids;this.projects=this.projects.filter((function(e){return t.every((function(t){return t!==e.get("id")}))})),this.trigger("projectUpdated")},onRequestDeleteProject:function(e){A.l.onSendMessage(E.f.GEO_PROJECT,{action:E.g.DELETE,ids:e})},onRequestOpenProject:function(e){this.setActiveProjectId(e)},onRequestCloseProject:function(e){this.setActiveProjectId(void 0)},onRequestUpdateProject:function(e){var t=g.a.fromJS(e),n=this.getProjectById(t.get("id"));if(n){(n=n.merge(t)).has("departmentName")&&(n=n.delete("departmentName"));var a={id:n.get("id")<<0,projectNumber:n.get("projectNumber"),name:n.get("name"),address1:n.get("address1"),address2:n.get("address2"),postCode:n.get("postCode"),city:n.get("city"),country:n.get("country"),projectLeaderId:n.get("projectLeaderId"),currency:n.get("currency"),units:n.get("units")};n.getIn(["department","id"])&&n.getIn(["department","id"])<<0&&(a.departmentId=n.getIn(["department","id"])),A.l.onSendMessage(E.f.GEO_PROJECT,Object(o.a)({action:E.g.UPDATE},a))}},clearProjects:function(){this.projects=new g.a.List}})},49:function(e,t,n){"use strict";var a=n(26),o=n.n(a),i=n(28),r=n(30),s=n(594),l=n(593),c=n(19),u=n(110),d=n(10),p=n(45),g=n(12),h=n(48),m=n(15),f=n(187),A=n.n(f),E=Object(s.a)(l.a,{epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null});var T=n(117),S=n(35),b=n(18),I=n(132),y=n(37),v=n(5),N=n(87),O=n.n(N),w=Object(s.a)(l.a,{});t.a=Object(h.createStore)({listenables:[u.a],init:function(){this.professionAutoCompleteMap=new d.a.Map,this.professionAutoCompleteList=new d.a.List,this.professionAutoCompleteUpdated=!1,this.phaseAutoCompleteMap=new d.a.Map,this.phaseAutoCompleteList=new d.a.List,this.phaseAutoCompleteUpdated=!1,this.segmentAutoCompleteMap=new d.a.Map,this.segmentAutoCompleteList=new d.a.List,this.segmentAutoCompleteUpdated=!1,this.actionAutoCompleteMap=new d.a.Map,this.actionAutoCompleteList=new d.a.List,this.actionAutoCompleteUpdated=!1,this.materialAutoCompleteMap=new d.a.Map,this.materialAutoCompleteList=new d.a.List,this.materialAutoCompleteUpdated=!1,this.amountAutoCompleteMap=new d.a.Map,this.amountAutoCompleteList=new d.a.List,this.amountAutoCompleteUpdated=!1,w.import(function(){var e={},t="deg";return["sin","cos","tan","sec","cot","csc","asin","acos","atan","atan2","acot","acsc","asec"].forEach((function(n){var a=E[n],o=function(e){var o=a(e);switch(t){case"deg":return["asin","acos","atan","atan2","acot","acsc","asec"].includes(n)?o/2/Math.PI*360:a(e/360*2*Math.PI);case"grad":return["asin","acos","atan","atan2","acot","acsc","asec"].includes(n)?o/2/Math.PI*400:a(e/400*2*Math.PI);default:return o}};e[n]=E.typed(n,{number:o,"Array | Matrix":function(e){return E.map(e,o)}})})),e}(),{override:!0}),this.AnnotationRows=new d.a.List,this.SelectedAnnotationRows=new d.a.List,this.newRowAutoCompleteMap=new d.a.Map,this.newRowAutoCompleteList=new d.a.List,this.newRowAutoCompleteUpdated=!1,this.pricePerUnitAutoCompleteMap=new d.a.Map,this.pricePerUnitAutoCompleteList=new d.a.List,this.pricePerUnitAutoCompleteUpdated=!1,this.amountAutoCompleteMap=new d.a.Map,this.amountAutoCompleteList=new d.a.List,this.amountAutoCompleteUpdated=!1,this.EmptyCalculationRow={action:"",segment:"",quantity:0,amount:0,pricePerUnit:0,totalPrice:0,annotationCollection:new d.a.List},this.currentRowUnits=new d.a.Map,this.currentAnnotationRowToParse=void 0,this.nrSelectedAnnots=0,this.bundledRowsForGui=void 0,this.rowTemplates=[],this.annotationsWithRows=[],this.rowsActionsModalInfo={updatingRows:!1,rowsToUpdate:0,rowsUpdated:0,rowsUpdatedList:[],userId:null}},getRowsActionsModalInfo:function(){return this.rowsActionsModalInfo},resetRowsActionsModalInfo:function(){this.rowsActionsModalInfo.updatingRows=!1,this.rowsActionsModalInfo.rowsToUpdate=0,this.rowsActionsModalInfo.rowsUpdated=0,this.rowsActionsModalInfo.rowsUpdatedList=[],this.rowsActionsModalInfo.userId=null},initNumeral:function(){A.a.locale(m.a.language)},calculateValues:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=this.onGetAnnotationRowsForGuiConsumptionWithBundling(e),n=t.next();!n.done;)n=t.next()},onUpdateRowTemplate:function(e){this.rowTemplates=e,this.trigger("updateRows")},getIntlLang:function(){var e;switch(m.a.language||window.localStorage.language){case"en":e="en-GB";break;case"sv":e="sv-SE";break;case"no":e="no-NO";break;case"da":e="da-DK";break;case"nl":e="nl-NL";break;case"es":e="es-ES";break;default:e="en-US"}return e},formatNumberValue:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return isNaN(e)?m.a.t("Error in formula"):new Intl.NumberFormat(this.getIntlLang(),{maximumFractionDigits:2,useGrouping:t}).format(e)},formatAmountValue:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return isNaN(e)?m.a.t("Error in formula"):new Intl.NumberFormat(this.getIntlLang(),{maximumFractionDigits:3,minimumFractionDigits:3,useGrouping:t}).format(e)},formatCurrencyValue:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return isNaN(e)?"NaN"===e?e:m.a.t("Error in formula"):t?new Intl.NumberFormat(this.getIntlLang(),{style:"currency",currency:p.a.getProjectCurrency(p.a.getActiveProjectId()),maximumFractionDigits:2,minimumFractionDigits:2}).format(e):new Intl.NumberFormat(this.getIntlLang(),{maximumFractionDigits:2,minimumFractionDigits:2,useGrouping:!1}).format(e)},getRowTemplates:function(){return this.rowTemplates},saveRowTemplate:function(e){var t=this,n=e.toJS().map((function(e){var n,a,o,i,r,s,l,c,u,d=t.getRowById(e.id);return{status:(null===(n=e.annotationRow.status)||void 0===n?void 0:n.toString())||"notStarted",profession:(null===(a=e.annotationRow.profession)||void 0===a?void 0:a.toString())||"",phase:(null===(o=e.annotationRow.phase)||void 0===o?void 0:o.toString())||"",segment:(null===(i=e.annotationRow.segment)||void 0===i?void 0:i.toString())||"",material:(null===(r=e.annotationRow.material)||void 0===r?void 0:r.toString())||"",amount:d.getIn(["annotationRow","amount"])||"",unit:(null===(s=e.annotationRow.unit)||void 0===s?void 0:s.toString())||"",pricePerUnit:(null===(l=e.annotationRow.pricePerUnit)||void 0===l?void 0:l.toString())||"",timePerUnit:(null===(c=e.annotationRow.unitTime)||void 0===c?void 0:c.toString())||"00:00",rowAction:(null===(u=e.annotationRow.action)||void 0===u?void 0:u.toString())||""}}));S.g.sendUpdate({action:"add_row_template",rows:n})},getNewRowTemplate:function(e){var t=e.split("|");return t.length>1?{status:t[0]?this.transformStatusValue(t[0].trim()):"notStarted",profession:t[1]?t[1].trim():"",phase:t[2]?t[2].trim():"",segment:t[3]?t[3].trim():"",rowAction:t[4]?t[4].trim():"",material:t[5]?t[5].trim():"",amount:t[6]?t[6].trim():"",unit:t[7]?t[7].trim():"",pricePerUnit:t[8]?t[8].trim():"",timePerUnit:this.transformTimePerUnitValue(t[9])}:{status:"notStarted",profession:"",phase:"",segment:t[0]?t[0].trim():"",rowAction:"",material:"",amount:"",unit:"",pricePerUnit:"",timePerUnit:"00:00"}},addNewRowTemplate:function(e){S.g.sendUpdate({action:"add_row_template",rows:e})},requestUpdateRowTemplate:function(e,t,n){S.g.sendUpdate(Object(r.a)({action:"update_row_template",id:e},t,n))},getBundledRowsForGui:function(){return this.bundledRowsForGui?this.bundledRowsForGui:new d.a.List},resetBundledRowsForGui:function(e){e&&(this.bundledRowsForGui=e)},getRowById:function(e){return this.AnnotationRows.find((function(t){return t.get("id")===e}))},getAllRows:function(){return this.AnnotationRows},getAllRowsForAnnotation:function(e){return this.AnnotationRows.filter((function(t){return t.getIn(["geoAnnotation","id"])===e.get("id")}))},getSelectedRows:function(){var e=this;return this.SelectedAnnotationRows.map((function(t){return e.getRowById(t)}))},hasRows:function(e){return this.AnnotationRows.find((function(t){return t.getIn(["geoAnnotation","id"])===e}))},hasNegativeRowsValue:function(e,t){var n=this,a="3DModel"===t.get("type")?t:null,o=c.a.calculateValuesForAnnotation(t).get("annotationData"),i=this.AnnotationRows.toJS().filter((function(t){return t.geoAnnotation.id===e})).find((function(e){var i=e.annotationRow,r=i.amount,s=i.pricePerUnit,l=Number(r)?Number(r):n.parseExpressionToValues(r,o,a,t),c=Number(s)?Number(s):n.parseExpressionToValues(s,o,a);return l<0||c<0||isNaN(Number(l))||isNaN(Number(c))}));return!Object(g.isEmpty)(i)},getRowsForSelectedAnnotations:function(e){return this.AnnotationRows.isEmpty()?new d.a.List:this.AnnotationRows.filter((function(t){return e.includes(t.getIn(["geoAnnotation","id"]))}))},getRowsForSelectedAnnotationsV2:function(e){var t=Object(g.filter)(this.annotationsWithRows,(function(t){return e.toJS().includes(null===t||void 0===t?void 0:t.annotationId)})),n=Object(g.flatten)(t),a=[];return Object(g.forEach)(n,(function(e){a.push(Object(g.map)(e.rows,(function(t){return{id:t.id,geoAnnotation:{id:e.annotationId},annotationRow:t}})))})),Object(g.flatten)(a)},getRowsForSelectedAnnotationsExport:function(e){return this.AnnotationRows.isEmpty()?new d.a.List:this.AnnotationRows.filter((function(t){return void 0!==e.find((function(e){return e.get("id")===t.getIn(["geoAnnotation","id"])}))}))},getStatusValue:function(e){return"notStarted"===e||"progress"===e||"review"===e||"complete"===e?e:"2"===e?"progress":"3"===e?"review":"4"===e?"complete":"notStarted"},getVisibleStatusValue:function(e){return"progress"===e||"2"===e?m.a.t("In Progress"):"review"===e||"3"===e?m.a.t("Review"):"complete"===e||"4"===e?m.a.t("Complete"):m.a.t("Not started")},getNumberStatusValue:function(e){switch(e){case"progress":return"2";case"review":return"3";case"complete":return"4";default:return"1"}},transformStatusValue:function(e){return"2"===e||"progress"===e.toLowerCase()||"in progress"===e.toLowerCase()?"progress":"3"===e||"review"===e.toLowerCase()?"review":"4"===e||"complete"===e.toLowerCase()?"complete":"notStarted"},transformTimePerUnitValue:function(e){if(!e)return"00:00";return/^[0-9][0-9]:[0-9][0-9]$/.test(e.trim())?e.trim():"00:00"},getNewRow:function(e,t){if(e&&t){var n=e.split("|");return n.length>1?d.a.fromJS({geoAnnotation:{id:t},annotationRow:{rowNumber:this.AnnotationRows.size+1,status:n[0]?this.transformStatusValue(n[0].trim()):"notStarted",profession:n[1]?n[1].trim():"",phase:n[2]?n[2].trim():"",segment:n[3]?n[3].trim():"",action:n[4]?n[4].trim():"",material:n[5]?n[5].trim():"",amount:n[6]?n[6].trim():"",unit:n[7]?n[7].trim():"",pricePerUnit:n[8]?n[8].trim():"",unitTime:this.transformTimePerUnitValue(n[9]),totalPrice:0,totalTime:"0:00"}}):d.a.fromJS({geoAnnotation:{id:t},annotationRow:{rowNumber:this.AnnotationRows.size+1,status:"notStarted",profession:"",phase:"",segment:n[0]?n[0].trim():"",action:"",material:"",amount:"",unit:"",pricePerUnit:"",unitTime:"00:00",totalPrice:0,totalTime:"0:00"}})}},getRelevantSelectedAnnotations:function(){var e=c.a.getSelectedAnnotationIds().filter((function(e){return!["group","x-scale"].includes(e.get("type"))})).map((function(e){return e.get("id")}));return this.nrSelectedAnnots=e.size,e},getUnitFor:function(e){var t="";return e&&e>0&&((t=this.currentRowUnits.get(e))||(t="")),t},setRows:function(e){this.AnnotationRows=e},setNewAnnotationRows:function(e){var t=this;Object(g.forEach)(e,(function(e){var n=Object(g.findIndex)(t.annotationsWithRows,(function(t){return t.annotationId===e.geoAnnotationId})),a=JSON.parse(e.annotationRow),o=Object(i.a)(Object(i.a)({},a),{},{amount:a.amount?t.convertToFloat(a.amount):0,pricePerUnit:a.pricePerUnit?t.convertToFloat(a.pricePerUnit):0});-1!==n?t.annotationsWithRows[n].rows.push(Object(i.a)(Object(i.a)({},o),{},{id:e.id})):t.annotationsWithRows.push({annotationId:e.geoAnnotationId,rows:[Object(i.a)(Object(i.a)({},o),{},{id:e.id})]})}))},setUnitForRow:function(e){var t=Number.MAX_SAFE_INTEGER,n=void 0;if(e&&e.getIn(["annotationRow","amount"])){var a=void 0,o=e.getIn(["annotationRow","amount"]).toLowerCase(),i=new RegExp(/(l|sl|v)[0-9]+/),r=new RegExp(/(s)[0-9]+/);if(o.split(" ").length>1){n=o.split(" ")[1],this.currentRowUnits=this.currentRowUnits.set(e.get("id"),n),e=e.setIn(["annotationRow","amount"],o.split(" ")[0]);var s=o.split(" ");if(s.length>1)return n=s[1],this.currentRowUnits=this.currentRowUnits.set(e.get("id"),n),e=e.setIn(["annotationRow","amount"],s[0])}(a=o.indexOf("a"))>=0&&a<t&&(t=a,n="m2"),(a=o.indexOf("na"))>=0&&a<t&&(t=a,n="m2"),(a=o.indexOf("l"))>=0&&a<t&&(t=a,n="m"),(a=o.indexOf("nl"))>=0&&a<t&&(t=a,n="m"),(a=o.indexOf("vo"))>=0&&a<t&&(t=a,n="m3"),(a=o.indexOf("nvo"))>=0&&a<t&&(t=a,n="m3"),(a=o.indexOf("v"))>=0&&a<t&&(t=a,n="m2"),(a=o.indexOf("rl"))>=0&&a<t&&(t=a,n="m"),(a=o.indexOf("r"))>=0&&a<t&&(t=a,n="m2"),(a=o.indexOf("p"))>=0&&a<t&&(t=a,n="st"),(a=o.indexOf("h"))>=0&&a<t&&(t=a,n="m"),(a=o.indexOf("q"))>=0&&a<t&&(t=a,n="st"),(a=o.indexOf("dx"))>=0&&a<t&&(t=a,n="m"),(a=o.indexOf("dy"))>=0&&a<t&&(t=a,n="m"),(a=o.indexOf("t"))>=0&&a<t&&(t=a,n="st"),(a=o.indexOf("svo"))>=0&&a<t&&(t=a,n="m3"),(a=o.indexOf("sl"))>=0&&a<t&&(t=a,n="m"),"3DModel"===c.a.getType()&&r.test(o)&&(n="m2"),"3DModel"===c.a.getType()&&i.test(o)&&(n="m"),this.currentRowUnits=this.currentRowUnits.set(e.get("id"),n)}},setSelectedRow:function(e){var t=this;this.deSelectAllRows(),e.forEach((function(e){e.has("ids")?e.get("ids").forEach((function(e){-1===t.SelectedAnnotationRows.findIndex((function(t){return t===e}))&&(t.SelectedAnnotationRows=t.SelectedAnnotationRows.push(e))})):t.SelectedAnnotationRows=t.SelectedAnnotationRows.push(e.get("id"))})),this.trigger("rowSelected")},selectAllRows:function(){var e=this.getRelevantSelectedAnnotations();this.SelectedAnnotationRows=this.getRowsForSelectedAnnotations(e).map((function(e){return e.get("id")})),this.trigger("rowSelected")},deSelectAllRows:function(){this.SelectedAnnotationRows=this.SelectedAnnotationRows.clear(),this.trigger("rowDeSelected")},isSelected:function(e){var t=this;return e.get("ids")&&!e.get("ids").isEmpty()?e.get("ids").every((function(e){return t.SelectedAnnotationRows.includes(e)})):this.SelectedAnnotationRows.includes(e.get("id"))},isAllSelected:function(){var e=this.getRelevantSelectedAnnotations();return this.getRowsForSelectedAnnotations(e).size===this.SelectedAnnotationRows.size},sortAutoComplete:function(){this.professionAutoCompleteUpdated&&(this.professionAutoCompleteUpdated=!1,this.professionAutoCompleteList=this.professionAutoCompleteList.sort((function(e,t){return e.get("label")&&e.get("label").localeCompare(t.get("label"))}))),this.phaseAutoCompleteUpdated&&(this.phaseAutoCompleteUpdated=!1,this.phaseAutoCompleteList=this.phaseAutoCompleteList.sort((function(e,t){return e.get("label")&&e.get("label").localeCompare(t.get("label"))}))),this.segmentAutoCompleteUpdated&&(this.segmentAutoCompleteUpdated=!1,this.segmentAutoCompleteList=this.segmentAutoCompleteList.sort((function(e,t){return e.get("label")&&e.get("label").localeCompare(t.get("label"))}))),this.actionAutoCompleteUpdated&&(this.actionAutoCompleteUpdated=!1,this.actionAutoCompleteList=this.actionAutoCompleteList.sort((function(e,t){return e.get("label")&&e.get("label").localeCompare(t.get("label"))}))),this.meterialAutoCompleteUpdated&&(this.meterialAutoCompleteUpdated=!1,this.materialAutoCompleteList=this.materialAutoCompleteList.sort((function(e,t){return e.get("label")&&e.get("label").localeCompare(t.get("label"))}))),this.amountAutoCompleteUpdated&&(this.amountAutoCompleteUpdated=!1,this.amountAutoCompleteList=this.amountAutoCompleteList.sort((function(e,t){return e.get("label")&&e.get("label").localeCompare(t.get("label"))}))),this.newRowAutoCompleteUpdated&&(this.newRowAutoCompleteUpdated=!1,this.newRowAutoCompleteList=this.newRowAutoCompleteList.sort((function(e,t){var n=e.get("status")&&e.get("status").localeCompare(t.get("status"));return 0!==n||0!==(n=e.get("profession")&&e.get("profession").localeCompare(t.get("profession")))?n:e.get("phase")&&e.get("phase").localeCompare(t.get("phase"))})))},performTimeChainAdd:function(e,t){var n;try{e||(e="00:00"),t||(t="00:00");var a=e.split(":"),o=Number.parseInt(a[0]),i=Number.parseInt(a[1]),r=t.split(":"),s=Number.parseInt(r[0]),l=Number.parseInt(r[1]),c=i+60*o,u=l+60*s,d=this.performChainAdd(c,u);n=Math.trunc(d/60)+":"+Math.trunc(d%60).toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1})}catch(p){n="performTimeChainAdd"}return n},formatNumber:function(e){return e<10?"0"+e.toString():e.toString()},performTimeChainMultiply:function(e,t){var n;try{e||(e="0:0"),t||(t="0");var a=e.split(":"),o=Number.parseInt(a[0]),i=Number.parseInt(a[1]),r=i+60*o;r=this.performChainMultiply(r,t),o=Math.trunc(r/60),i=Math.abs(Math.trunc(r%60)),n="".concat(r<0&&0===o?"-":"").concat(o,":").concat(this.formatNumber(i))}catch(s){n="performTimeChainMultiply"}return n},performChainAdd:function(e,t){var n=void 0;try{e||(e=0),t||(t=0),n=w.chain(e).add(t).done()}catch(a){n=m.a.t("Error in formula")}return n},performChainMultiply:function(e,t){var n=void 0;try{e||(e=0),t||(t=0),n=w.chain(e).multiply(t).done()}catch(a){n=m.a.t("Error in formula")}return n},parseExpressionToValues:function(e,t,n,a){function o(e){return!isNaN(parseFloat(e))&&isFinite(e)}function i(e,t){if(!e||"imperial"!==p.a.getProjectUnitsByID(p.a.getActiveProjectId()))return e;switch(t){case"m":return w.unit(e,t).to("ft").toNumeric();case"m2":return w.unit(e,t).to("sqft").toNumeric();case"m3":return w.unit(e,t).to("cuft").toNumeric();case"st":return e}}if(o(e))return e;if((null===t||void 0===t?void 0:t.get(b.a.EDGES))||(null===t||void 0===t?void 0:t.get(b.a.SIDES))||(null===t||void 0===t?void 0:t.get(b.a.SIDE_LENGTHS))){var r=t.toJS(),s=e;try{if(s){s=s.toLowerCase();var l={a:i(t.get(b.a.AREA),"m2"),na:i(t.get(b.a.NET_AREA),"m2"),vo:i(t.get(b.a.VOLUME),"m3"),nvo:i(t.get(b.a.NET_VOLUME),"m3")};r[b.a.EDGES]&&r[b.a.EDGES].forEach((function(e,t){return l["l".concat(t+1)]=i(e,"m")})),r[b.a.SIDES]&&r[b.a.SIDES].forEach((function(e,t){return l["s".concat(t+1)]=i(e,"m2")})),r[b.a.SIDE_LENGTHS]&&r[b.a.SIDE_LENGTHS].forEach((function(e,t){return l["sl".concat(t+1)]=i(e,"m")})),"imperial"===p.a.getProjectUnitsByID(p.a.getActiveProjectId())&&(s=(s=s.replace(new RegExp('[0-9]+"',"g"),(function(e){return w.unit(Object(T.a)(e),"m").to("ft").toNumeric()}))).replace(new RegExp("[0-9]+'","g"),(function(e){return w.unit(Object(T.a)(e),"m").to("ft").toNumeric()}))),o(s=w.evaluate(s,l))||(s=m.a.t("Error in formula"))}}catch(g){s=m.a.t("Error in formula")}return""===s&&(s=0),s}if(e&&!t&&"3DModel"!==c.a.getType())return m.a.t("Error in formula");var u=e;try{if(u){u=u.toLowerCase();var d={a:i(t.get(b.a.AREA),"m2"),l:i(t.get(b.a.LENGTH),"m"),vo:i(t.get(b.a.VOLUME),"m3"),v:i(t.get(b.a.TOTAL_WALL),"m2"),na:i(t.get(b.a.NET_AREA),"m2"),nl:i(t.get(b.a.NET_LENGTH),"m"),nvo:i(t.get(b.a.NET_VOLUME),"m3"),nv:i(t.get(b.a.TOTAL_NET_WALL),"m2"),r:i(t.get(b.a.RED_AREA),"m2"),ra:i(t.get(b.a.RED_AREA),"m2"),rl:i(t.get(b.a.RED_LENGTH),"m"),rvo:i(t.get(b.a.RED_VOLUME),"m3"),rv:i(t.get(b.a.TOTAL_RED_WALL),"m2"),p:i(t.get(b.a.POINTS),"st"),q:i(t.get(b.a.COUNT),"st"),h:i(t.get(b.a.HEIGHT),"m"),dx:i(t.get(b.a.OUTER_DIM_X)||t.get(b.a.DIAMETER_X),"m"),dy:i(t.get(b.a.OUTER_DIM_Y)||t.get(b.a.DIAMETER_Y),"m"),t:i(t.get(b.a.AREA_TILES),"st"),jl:i(t.get(b.a.AREA_JOINT_LENGTH),"m"),jvo:i(t.get(b.a.AREA_JOINT_VOLUME),"m3"),vt:i(t.get(b.a.WALL_TILES),"st"),vjl:i(t.get(b.a.WALL_JOINT_LENGTH),"m"),vjvo:i(t.get(b.a.WALL_JOINT_VOLUME),"m3"),rx:i(t.get(b.a.RADIUS_X),"m"),ry:i(t.get(b.a.RADIUS_Y),"m")};t.has(b.a.LENGTHS)&&!t.get(b.a.LENGTHS).isEmpty()&&t.get(b.a.LENGTHS).forEach((function(e,t){d["l"+(t+1)]=i(e,"m")})),t.has(b.a.WALLS)&&!t.get(b.a.WALLS).isEmpty()&&t.get(b.a.WALLS).forEach((function(e,t){d["v"+(t+1)]=i(e,"m2")})),t.has(b.a.REDUCTIONS)&&!t.get(b.a.REDUCTIONS).isEmpty()&&t.get(b.a.REDUCTIONS).forEach((function(e,t){d["r"+(t+1)]=i(e,"m2")})),"imperial"===p.a.getProjectUnitsByID(p.a.getActiveProjectId())&&(u=(u=u.replace(new RegExp('[0-9]+"',"g"),(function(e){return w.unit(Object(T.a)(e),"m").to("ft").toNumeric()}))).replace(new RegExp("[0-9]+'","g"),(function(e){return w.unit(Object(T.a)(e),"m").to("ft").toNumeric()}))),o(u=w.evaluate(u,d))||(u=m.a.t("Error in formula"))}}catch(g){u=m.a.t("Error in formula")}return""===u&&(u=0),u},convertToFloat:function(e){return""===e?0:"".concat(e).toString().replaceAll(",",".")},onRequestCreateRow:function(e){var t=e.annotationRows,n=e.annotationIds,a=e.newRows;if(t){var o=Object(g.map)(t.toJS(),(function(e){return{geoAnnotationId:e.geoAnnotation.id,annotationRow:e.annotationRow}}));return I.a.onSendMessage(y.f.GEO_ANNOTATION_ROW,{action:y.b.CREATE,annotationRows:o}),!0}if(!(null===n||void 0===n?void 0:n.length)||!a)return!1;I.a.onSendMessage(y.f.GEO_ANNOTATION_ROW,{action:y.b.CREATE,annotationRows:a,annotationIds:n})},onRequestPasteRows:function(e,t){I.a.onSendMessage(y.f.GEO_ANNOTATION_ROW,{action:y.b.CREATE,annotationIds:e,rowIds:t})},onRequestUpdateRow:function(e,t,n){if(!e)return!1;I.a.onSendMessage(y.f.GEO_ANNOTATION_ROW,{action:y.b.UPDATE,ids:e.toJS().ids||[e.toJS().id],key:t,value:n})},onRequestDeleteRowsForAnnotations:function(e){var t=this;if(e){var n={ids:[]};e.forEach((function(e){var a=t.getAllRowsForAnnotation(e);if(!a.isEmpty()){var o=a.map((function(e){return e.get("id")}));n.ids=n.ids.concat(o.toJS())}})),I.a.onSendMessage(y.f.GEO_ANNOTATION_ROW,{action:y.b.DELETE,ids:n.ids})}},onRequestDeleteSelectedRows:function(){if(this.SelectedAnnotationRows.isEmpty())return!1;c.a.getActiveEstimate().getIn(["geoProject","id"]);var e=this.getSelectedRows().map((function(e){return e.get("id")}));return!(!e||e.isEmpty())&&(I.a.onSendMessage(y.f.GEO_ANNOTATION_ROW,{action:y.b.DELETE,ids:e.toJS()}),!0)},onRequestDeleteReductionFromRow:function(e,t){var n=this;try{var a=c.a.calculateValuesForAnnotation(t).get("annotationData");this.getAllRowsForAnnotation(t).forEach((function(t){var o=t.getIn(["annotationRow","amount"]);if(o){for(o=o.toUpperCase();-1!==o.indexOf(e);)o=o.replace(e,"#");a.get("reductions").forEach((function(t,n){if(n<<0>(e.substring(1)<<0)-1)for(;-1!=o.indexOf("R"+(n+1));)o=o.replace("R"+(n+1),"R"+n)}));var i=t.setIn(["annotationRow","amount"],o);n.onRequestUpdateRow(i.get("annotationRow").set("id",i.get("id")))}}))}catch(o){console.log("Error | Update Row: "+o)}},getProfessionAutoCompleteList:function(){return this.professionAutoCompleteList},getPhaseAutoCompleteList:function(){return this.phaseAutoCompleteList},getSegmentAutoCompleteList:function(){return this.segmentAutoCompleteList},getActionAutoCompleteList:function(){return this.actionAutoCompleteList},getMateriaLAutoCompleteList:function(){return this.materialAutoCompleteList},getAmountAutoCompleteList:function(){return this.amountAutoCompleteList},getNewRowAutoCompleteList:function(){return this.newRowAutoCompleteList},getPricePerUnitAutoCompleteList:function(){return this.pricePerUnitAutoCompleteList},updateAutoComplete:function(e){e.get("profession")&&!this.professionAutoCompleteMap.get(e.get("profession"))&&(this.professionAutoCompleteUpdated=!0,this.professionAutoCompleteMap=this.professionAutoCompleteMap.set(e.get("profession"),e.get("profession")),this.professionAutoCompleteList=this.professionAutoCompleteList.push(d.a.fromJS({id:e.get("profession"),label:e.get("profession"),value:e.get("profession")}))),e.get("phase")&&!this.phaseAutoCompleteMap.get(e.get("phase"))&&(this.phaseAutoCompleteUpdated=!0,this.phaseAutoCompleteMap=this.phaseAutoCompleteMap.set(e.get("phase"),e.get("phase")),this.phaseAutoCompleteList=this.phaseAutoCompleteList.push(d.a.fromJS({id:e.get("phase"),label:e.get("phase"),value:e.get("phase")}))),e.get("segment")&&!this.segmentAutoCompleteMap.get(e.get("segment"))&&(this.segmentAutoCompleteUpdated=!0,this.segmentAutoCompleteMap=this.segmentAutoCompleteMap.set(e.get("segment"),e.get("segment")),this.segmentAutoCompleteList=this.segmentAutoCompleteList.push(d.a.fromJS({id:e.get("segment"),label:e.get("segment"),value:e.get("segment")}))),e.get("action")&&!this.actionAutoCompleteMap.get(e.get("action"))&&(this.actionAutoCompleteUpdated=!0,this.actionAutoCompleteMap=this.actionAutoCompleteMap.set(e.get("action"),e.get("action")),this.actionAutoCompleteList=this.actionAutoCompleteList.push(d.a.fromJS({id:e.get("action"),label:e.get("action"),value:e.get("action")}))),e.get("material")&&!this.materialAutoCompleteMap.get(e.get("material"))&&(this.materialAutoCompleteUpdated=!0,this.materialAutoCompleteMap=this.materialAutoCompleteMap.set(e.get("material"),e.get("material")),this.materialAutoCompleteList=this.materialAutoCompleteList.push(d.a.fromJS({id:e.get("material"),label:e.get("material"),value:e.get("material")}))),e.get("amount")&&!this.amountAutoCompleteMap.get(e.get("amount"))&&(this.amountAutoCompleteUpdated=!0,this.amountAutoCompleteMap=this.amountAutoCompleteMap.set(e.get("amount"),e.get("amount")),this.amountAutoCompleteList=this.amountAutoCompleteList.push(d.a.fromJS({id:e.get("amount"),label:e.get("amount"),value:e.get("amount")})));var t=e.get("pricePerUnit");t&&!this.pricePerUnitAutoCompleteMap.get(t)&&(this.pricePerUnitAutoCompleteUpdated=!0,this.pricePerUnitAutoCompleteMap=this.pricePerUnitAutoCompleteMap.set(t,t),this.pricePerUnitAutoCompleteList=this.pricePerUnitAutoCompleteList.push(d.a.fromJS({id:e.get("pricePerUnit"),label:e.get("pricePerUnit"),value:e.get("pricePerUnit")})));var n="".concat(this.getVisibleStatusValue(e.get("status"))," | ").concat(e.get("profession")||""," | ").concat(e.get("phase")||""," | ").concat(e.get("segment")||""," | ").concat(e.get("action")||""," | ").concat(e.get("material")||""," | ").concat(e.get("amount")||""," | ").concat(e.get("unit")||""," | ").concat(e.get("pricePerUnit")||""," | ").concat(e.get("unitTime")||""," | ");this.newRowAutoCompleteMap.get(n)||(this.newRowAutoCompleteUpdated=!0,this.newRowAutoCompleteMap=this.newRowAutoCompleteMap.set(n,n),this.newRowAutoCompleteList=this.newRowAutoCompleteList.push(d.a.fromJS({id:n,label:n,value:n,status:e.get("status"),profession:e.get("profession"),phase:e.get("phase"),segment:e.get("segment"),action:e.get("action"),material:e.get("material"),amount:e.get("amount"),unit:e.get("unit"),pricePerUnit:e.get("pricePerUnit"),unittime:e.get("unitTime")})))},clearAutoComplete:function(){this.professionAutoCompleteMap=this.professionAutoCompleteMap.clear(),this.professionAutoCompleteList=this.professionAutoCompleteList.clear(),this.phaseAutoCompleteMap=this.phaseAutoCompleteMap.clear(),this.phaseAutoCompleteList=this.phaseAutoCompleteList.clear(),this.segmentAutoCompleteMap=this.segmentAutoCompleteMap.clear(),this.segmentAutoCompleteList=this.segmentAutoCompleteList.clear(),this.actionAutoCompleteMap=this.actionAutoCompleteMap.clear(),this.actionAutoCompleteList=this.actionAutoCompleteList.clear(),this.materialAutoCompleteMap=this.materialAutoCompleteMap.clear(),this.materialAutoCompleteList=this.materialAutoCompleteList.clear(),this.amountAutoCompleteMap=this.amountAutoCompleteMap.clear(),this.amountAutoCompleteList=this.amountAutoCompleteList.clear(),this.newRowAutoCompleteMap=this.newRowAutoCompleteMap.clear(),this.newRowAutoCompleteList=this.newRowAutoCompleteList.clear(),this.pricePerUnitAutoCompleteMap=this.pricePerUnitAutoCompleteMap.clear(),this.pricePerUnitAutoCompleteList=this.pricePerUnitAutoCompleteList.clear()},onInitializeCalculationRows:function(e){var t=this;this.clearAutoComplete();var n=new RegExp(/(l|sl|v|s)[0-9]+/),a=e.map((function(e){if(e.annotationRow=JSON.parse(e.annotationRow),e.annotationRow.amount&&isNaN(e.annotationRow.amount)&&!n.test(e.annotationRow.amount.toLowerCase())){var a=e.annotationRow.amount.split(" ");e.annotationRow.amount=t.convertToFloat(a[0])||0,e.annotationRow.unit=a[1]}return e.annotationRow.pricePerUnit&&(e.annotationRow.pricePerUnit=t.convertToFloat(e.annotationRow.pricePerUnit)||0),e.annotationRow.status||(e.annotationRow.status="notStarted"),e.annotationRow.phase||(e.annotationRow.phase=""),e.annotationRow.profession||(e.annotationRow.profession=""),e.annotationRow.unit||(e.annotationRow.unit=""),e.annotationRow.unitTime||(e.annotationRow.unitTime="00:00"),e.annotationRow.totalTime||(e.annotationRow.totalTime="0:00"),t.updateAutoComplete(d.a.fromJS(e.annotationRow)),e}));this.AnnotationRows=d.a.fromJS(a);var o=Object(g.map)(a,(function(e){return{annotationId:e.geoAnnotation.id,row:e.annotationRow,id:e.id,readOnly:e.readOnly}})),r=Object(g.map)(Object.values(Object(g.groupBy)(o,(function(e){return e.annotationId}))),(function(e){return{annotationId:e[0].annotationId,rows:Object(g.map)(e,(function(e){return Object(i.a)(Object(i.a)({},e.row),{},{id:e.id,readOnly:e.readOnly})}))}}));this.annotationsWithRows=r,this.sortAutoComplete(),this.trigger("CalculationRowsFetched")},onGeoAnnotationRowMessageHandler:function(e){var t=this,n=y.b.CREATE,a=y.b.DELETE,o=y.b.UPDATE,s=e.action,l=e.payload;switch(s){case n:var c=l.annotationRowsIdRange,u=c.startId,p=c.endId;O.a.get("".concat("https://api.geometra.rukkor.io","/annotationRows"),{headers:{Authorization:v.b.getJwt()},params:{startId:u,endId:p}}).then((function(e){t.onCalculateRowsCreate(e.data)})).catch((function(e){return console.log(e)}));break;case o:var h=l.rowIds,m=l.annotationIds,f=l.key,A=l.value;this.clearAutoComplete();var E=Object(g.map)(this.AnnotationRows.toJS(),(function(e){return h.includes(e.id)?Object(i.a)(Object(i.a)({},e),{},{annotationRow:Object(i.a)(Object(i.a)({},e.annotationRow),{},Object(r.a)({},f,A))}):e}));this.AnnotationRows=d.a.fromJS(E),this.annotationsWithRows=Object(g.map)(this.annotationsWithRows,(function(e){if(m.includes(e.annotationId)){var n=Object(g.map)(e.rows,(function(e){if(h.includes(e.id)){var n=Object(i.a)(Object(i.a)({},e),{},Object(r.a)({},f,A));return t.updateAutoComplete(d.a.fromJS(n)),n}return t.updateAutoComplete(d.a.fromJS(e)),e}));return{annotationId:e.annotationId,rows:n}}return e})),this.calculateValues(),this.sortAutoComplete(),this.trigger("CalculationRowUpdated");break;case a:this.clearAutoComplete(),this.AnnotationRows=this.AnnotationRows.filter((function(e){var n=!l.ids.includes(e.get("id"));return n&&t.updateAutoComplete(e.get("annotationRow")),n})),this.annotationsWithRows=Object(g.map)(this.annotationsWithRows,(function(e){var t=Object(g.filter)(e.rows,(function(e){return!l.ids.includes(e.id)}));return Object(i.a)(Object(i.a)({},e),{},{rows:t})})),this.calculateValues(),this.sortAutoComplete(),this.trigger("CalculationRowDeleted")}},onCalculateRowsCreate:function(e){var t=this;try{Object(g.forEach)(e,(function(e){var n=JSON.parse(e.annotationRow),a={annotationRow:Object(i.a)(Object(i.a)({},n),{},{amount:n.amount?t.convertToFloat(n.amount):0,pricePerUnit:n.pricePerUnit?t.convertToFloat(n.pricePerUnit):0}),geoAnnotation:{id:e.geoAnnotationId},id:e.id},o=d.a.fromJS(a);t.updateAutoComplete(d.a.fromJS(a.annotationRow)),t.AnnotationRows=t.AnnotationRows.push(o);var r=e.geoAnnotationId,s=Object(g.findIndex)(t.annotationsWithRows,(function(e){return e.annotationId===r}));-1===s?t.annotationsWithRows.push({annotationId:e.geoAnnotationId,rows:[Object(i.a)(Object(i.a)({},a.annotationRow),{},{id:a.id})]}):t.annotationsWithRows[s].rows.push(Object(i.a)(Object(i.a)({},a.annotationRow),{},{id:a.id}))})),this.sortAutoComplete(),this.calculateValues(),this.trigger("CalculationRowInserted")}catch(n){console.log("Error | CalculationStore Insert Array: "+n.stack)}},parseRow:function(e){return e.annotationRow&&(e.annotationRow=JSON.parse(e.annotationRow)),d.a.fromJS(e)},onGetAnnotationRowsForGuiConsumptionWithBundling:function(){var e=o.a.mark(a),t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=this;function a(){var a,r,s,l,u;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=function(e){var t=e.toJS(),a=Object(g.some)(t,(function(e){return!0===e.annotationRow.readOnly})),o=Object(g.head)(t),r=Object(i.a)(Object(i.a)({},o),{},{ids:Object(g.map)(t,(function(e){return e.id}))}),s=n.parseRowForBundling(d.a.fromJS(r)),l=d.a.fromJS(Object(g.tail)(t)).reduce((function(e,t){return e.set("annotationRow",n.calcBundleRowWithAccumulatedBundleValues(e,t))}),s),c=Object(g.set)(l.toJS(),"annotationRow.readOnly",a);return d.a.fromJS(c)},a=function(e){var t=[],a=e.toJS();return Object(g.forEach)(a,(function(e){try{var a,o;if(!(null===(a=e)||void 0===a||null===(o=a.annotationRow)||void 0===o?void 0:o.unit)){var i,r=n.setUnitForRow(d.a.fromJS(e));r&&(e=r);var s=n.getUnitFor(null===(i=e)||void 0===i?void 0:i.id);e.annotationRow.unit=s}if(t.length){var l=!1;t=Object(g.map)(t,(function(t){var n,a,o,i,r,s,c,u,d,p,g,h,m,f,A,E,T,S,b,I,y,v,N,O,w,P,R,L=t[0];return L&&(null===(n=e)||void 0===n||null===(a=n.annotationRow)||void 0===a?void 0:a.action)===(null===L||void 0===L||null===(o=L.annotationRow)||void 0===o?void 0:o.action)&&(null===(i=e)||void 0===i||null===(r=i.annotationRow)||void 0===r?void 0:r.material)===(null===L||void 0===L||null===(s=L.annotationRow)||void 0===s?void 0:s.material)&&(null===(c=e)||void 0===c||null===(u=c.annotationRow)||void 0===u?void 0:u.phase)===(null===L||void 0===L||null===(d=L.annotationRow)||void 0===d?void 0:d.phase)&&(null===(p=e)||void 0===p||null===(g=p.annotationRow)||void 0===g?void 0:g.pricePerUnit)==(null===L||void 0===L||null===(h=L.annotationRow)||void 0===h?void 0:h.pricePerUnit)&&(null===(m=e)||void 0===m||null===(f=m.annotationRow)||void 0===f?void 0:f.profession)===(null===L||void 0===L||null===(A=L.annotationRow)||void 0===A?void 0:A.profession)&&(null===(E=e)||void 0===E||null===(T=E.annotationRow)||void 0===T?void 0:T.segment)===(null===L||void 0===L||null===(S=L.annotationRow)||void 0===S?void 0:S.segment)&&(null===(b=e)||void 0===b||null===(I=b.annotationRow)||void 0===I?void 0:I.status)===(null===L||void 0===L||null===(y=L.annotationRow)||void 0===y?void 0:y.status)&&(null===(v=e)||void 0===v||null===(N=v.annotationRow)||void 0===N?void 0:N.unit)===(null===L||void 0===L||null===(O=L.annotationRow)||void 0===O?void 0:O.unit)&&(null===(w=e)||void 0===w||null===(P=w.annotationRow)||void 0===P?void 0:P.unitTime)===(null===L||void 0===L||null===(R=L.annotationRow)||void 0===R?void 0:R.unitTime)&&(l=!0,t.push(e)),t})),l||t.push([e])}else t.push([e])}catch(c){console.log(c)}})),d.a.fromJS(t)},n.currentRowUnits=n.currentRowUnits.clear(),s=void 0,l=void 0,t?(s=t,l=n.getRowsForSelectedAnnotationsExport(s)):(s=n.getRelevantSelectedAnnotations(),l=d.a.fromJS(n.getRowsForSelectedAnnotationsV2(s))),!l||l.isEmpty()){e.next=21;break}if(!(s.size>1)){e.next=18;break}return u=a(l),c.a.setProgressBarCurrentValue(c.a.getProgressBarCurrentValue()+.5*n.AnnotationRows.size),void(e.next=12);case 12:return u&&!u.isEmpty()&&(n.bundledRowsForGui=u.map((function(e){return r(e)}))),c.a.setProgressBarCurrentValue(c.a.getProgressBarCurrentValue()+.5*n.AnnotationRows.size),void(e.next=16);case 16:e.next=19;break;case 18:n.bundledRowsForGui=l.map((function(e){if(!e.getIn(["annotationRow","unit"])){var t=n.setUnitForRow(e);t&&(e=t);var a=n.getUnitFor(e.get("id"));e=e.setIn(["annotationRow","unit"],a)}return n.parseRowForBundling(e)}));case 19:e.next=22;break;case 21:n.bundledRowsForGui=new d.a.List;case 22:case"end":return e.stop()}}),e)}return a()},updateReadOnlyRows:function(e){var t=e.annotationIds,n=e.value;Object(g.forEach)(this.annotationsWithRows,(function(e){if(t.includes(e.annotationId)){var a=Object(g.map)(e.rows,(function(e){return Object(i.a)(Object(i.a)({},e),{},{readOnly:n})}));e.rows=a}}))},parseRowForBundling:function(e){try{var t=e,n=e.get("annotationRow"),a=n.get("amount"),o=c.a.getAnnotationById(e.getIn(["geoAnnotation","id"]));o||(o=c.a.getReductionById(e.getIn(["geoAnnotation","id"])));var i=c.a.calculateValuesForAnnotation(o).get("annotationData");this.currentAnnotationRowToParse=t,t=t.setIn(["annotationRow","amount"],this.parseExpressionToValues(n.get("amount"),i));var r=this.performChainMultiply(n.get("pricePerUnit"),t.getIn(["annotationRow","amount"])),s=this.performTimeChainMultiply(n.get("unitTime"),t.getIn(["annotationRow","amount"]));return t.setIn(["annotationRow","totalPrice"],r).setIn(["annotationRow","totalTime"],s).setIn(["annotationRow","Formula"],a)}catch(l){console.log("ERROR",l.stack)}},calcBundleRowWithAccumulatedBundleValues:function(e,t){try{var n=this.parseRowForBundling(t);return n.setIn(["annotationRow","amount"],this.performChainAdd(n.getIn(["annotationRow","amount"]),e.getIn(["annotationRow","amount"]))).setIn(["annotationRow","totalPrice"],this.performChainAdd(n.getIn(["annotationRow","totalPrice"]),e.getIn(["annotationRow","totalPrice"]))).setIn(["annotationRow","totalTime"],this.performTimeChainAdd(n.getIn(["annotationRow","totalTime"]),e.getIn(["annotationRow","totalTime"]))).get("annotationRow")}catch(a){console.log("ERROR 2",a.stack)}},getSeparateBundledRows:function(e){var t=this;return this.getSelectedRows().map((function(n){return t.parseRowForBundling(n).setIn(["annotationRow","unit"],Object(g.find)(e,(function(e){var t;return!(e.id!==n.get("id")&&!(null===(t=e.ids)||void 0===t?void 0:t.some((function(e){return e===n.get("id")}))))})).annotationRow.unit).toJS()})).toJS()}})},496:function(e,t,n){e.exports=n.p+"static/media/redo.3769ac36.svg"},497:function(e,t,n){e.exports=n.p+"static/media/undo.e101cebc.svg"},498:function(e,t,n){e.exports=n.p+"static/media/sync.4b1eace4.svg"},5:function(e,t,n){"use strict";n.d(t,"a",(function(){return a.a})),n.d(t,"b",(function(){return o.a})),n.d(t,"c",(function(){return i.a})),n.d(t,"e",(function(){return h})),n.d(t,"g",(function(){return m.a})),n.d(t,"h",(function(){return W})),n.d(t,"i",(function(){return F.a})),n.d(t,"j",(function(){return B.a})),n.d(t,"m",(function(){return N.a})),n.d(t,"n",(function(){return ie.a})),n.d(t,"o",(function(){return re.a})),n.d(t,"q",(function(){return te.a})),n.d(t,"f",(function(){return se.a})),n.d(t,"p",(function(){return ce})),n.d(t,"k",(function(){return oe})),n.d(t,"l",(function(){return ue.a})),n.d(t,"d",(function(){return ge}));var a=n(19),o=n(60),i=n(49),r=n(92),s=n(77),l=n(307),c=n(10),u=n(48),d=(Object(u.createStore)({init:function(){this.driveTemplates=void 0,this.listenables=l.a},getTemplates:function(){return this.driveTemplates},getTemplateByTemplateId:function(e){return this.driveTemplates.find((function(t){return t.getIn(["template","templateId"])===e}))},onMessageReceived:function(e){switch(e.action){case s.a.selectArray:this.driveTemplates=c.a.fromJS(e.payload.driveTemplateList),this.driveTemplates=this.driveTemplates.map((function(e){var t=c.a.fromJS(JSON.parse(e.get("template")));return e=(e=e.set("template",t)).setIn(["template","templateId"],""+e.get("id"))})),this.trigger("selectAllDriveTemplates");break;case s.a.insert:var t=c.a.fromJS(e.payload.driveTemplate);t=(t=t.set("template",c.a.fromJS(JSON.parse(t.get("template"))))).setIn(["template","templateId"],""+t.get("id")),this.driveTemplates=this.driveTemplates.push(t),this.trigger("driveTemplateInserted");break;case s.a.update:var n=c.a.fromJS(e.payload.driveTemplate);n=n.set("template",c.a.fromJS(JSON.parse(n.get("template")))),this.driveTemplates=this.driveTemplates.map((function(e){return e.get("id")===n.get("id")?e.merge(n):e})),this.trigger("driveTemplateInserted");break;case s.a.delete:var a=e.payload.ids;this.driveTemplates=this.driveTemplates.filter((function(e){return!a.includes(e.get("id"))})),this.trigger("driveTemplateDeleted")}},triggerLoadTemplates:function(){this.trigger("loadTemplates")}}),n(155)),p=n(308),g=n(192),h=Object(u.createStore)({listenables:[p.a],init:function(){},onErrorReceived:function(e){if(e.payload&&e.payload.httpCode)switch(e.payload.httpCode){case s.b.UN_AUTHORIZED:this.trigger(s.b.UN_AUTHORIZED);break;case s.b.PAYMENT_REQUIRED:this.trigger(s.b.PAYMENT_REQUIRED);break;case s.b.TOO_MANY_REQUESTS:this.trigger(s.b.TOO_MANY_REQUESTS);break;default:g.a.d("Error | Store could not received message"+JSON.stringify(e))}(e.action="jwtParsing")&&(this.trigger(s.b.jwtParsing),d.a.logout())},onSocketError:function(e){switch(e.code){case 1005:g.a.d("ErrorStore.onSocketError error code: 1005"),g.a.d("ErrorStore.onSocketError error reason: "+e.reason);break;case 1001:case 1002:case 1003:case 1004:case 1006:case 1007:case 1008:case 1009:case 1010:case 1011:case 1015:d.a.logout();break;default:g.a.d("onSocketError default: "+e.reason),d.a.logout()}},onError:function(e){g.a.d("ErrorStore onError!!"),e&&e.reason&&console.log("ErrorStore onError reason: "+e.reason)}}),m=n(147),f=n(15),A=n(121),E=n.n(A),T=n(25),S=n(29),b=n(43),I=n(44),y=n(594),v=n(593),N=n(45),O=n(4),w=Object(y.a)(v.a,{epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null}),P=function(){function e(){Object(T.a)(this,e)}return Object(S.a)(e,[{key:"dispatch",value:function(e){throw new Error("Method not overriden yet!")}},{key:"initFolderData",value:function(e){return e.map((function(e){if(e.has(f.a.t("folder"))){var t=c.a.fromJS(e.get(f.a.t("folder")).split(">"));2===t.size&&""===t.get(0)&&""===t.get(1)&&(t=c.a.fromJS([""])),t.forEach((function(t,n){e=e.set(f.a.t(O.a.GROUP_FOLDER)+" "+(n+1),t+" >")}))}return e}))}},{key:"translateToLocale",value:function(e){return-1!==f.a.language.indexOf("sv")||-1!==f.a.language.indexOf("no")||-1!==f.a.language.indexOf("nn")||-1!==f.a.language.indexOf("nb")||-1!==f.a.language.indexOf("da")||-1!==f.a.language.indexOf("nl")?w.round(e,3).toString().replace(".",","):w.round(e,3)}},{key:"applyTranslation",value:function(e){return e.map((function(e){return e.mapKeys((function(e){var t=e;switch(e){case"name":t=O.a.NAME;break;case"number":t=O.a.NUMBER;break;case"type":t=O.a.TYPE}return f.a.t(t)})).toMap()}))}},{key:"getProjectExportHeadlineToClipboard",value:function(e){var t="",n="",a="",o=N.a.getProjectById(N.a.getActiveProjectId());if(o){var i=r.a.getDepartmentUserById(o.get("projectLeaderId"));i&&(n=i.get("firstName")+" "+i.get("lastName"));var s=new Date;a=new Intl.DateTimeFormat(f.a.language,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(s).toString(),t="Geometra "+f.a.t("Export")+" - ("+o.get("projectNumber")+") "+o.get("name")+" - "+se.a.getActiveEstimate().name+" - "+f.a.t(e)+" - ["+n+" - "+a+"]"}return(new c.a.Map).set("exportData",E()({fields:[{label:"",value:t,default:"",stringify:!1}],del:"\t"})).set("filename",t)}}]),e}(),R=function(){function e(){Object(T.a)(this,e),this.pathLength=-1}return Object(S.a)(e,[{key:"getPathLength",value:function(){return this.pathLength}},{key:"getFolderExport",value:function(e,t){var n=this,o=0;return t.map((function(e){var t=e.get("folder"),i=a.a.getAnnotaionsInFolderFirstLevel(e.getIn(["folder","id"])).filter((function(e){return"group"!==e.get("type")}));i=i.map((function(e){return a.a.calculateValuesForAnnotation(e,!0)}));var r=a.a.sumValuesForMultipleAnnotations(i,"group");r=(r=r.set(O.a.COUNT,i.size)).delete("ESTIMATE.ANNOTATION_PROPERTIES.COUNT"),i.size>0&&(r.has("ESTIMATE.ANNOTATION_VALUES.AREA")&&(r=(r=r.set(O.a.AREA,r.get("ESTIMATE.ANNOTATION_VALUES.AREA"))).delete("ESTIMATE.ANNOTATION_VALUES.AREA")),r.has("ESTIMATE.ANNOTATION_VALUES.LENGTH")&&(r=(r=r.set(O.a.LENGTH,r.get("ESTIMATE.ANNOTATION_VALUES.LENGTH"))).delete("ESTIMATE.ANNOTATION_VALUES.LENGTH")),r.has("ESTIMATE.ANNOTATION_VALUES.VOLUME")&&(r=(r=r.set(O.a.VOLUME,r.get("ESTIMATE.ANNOTATION_VALUES.VOLUME"))).delete("ESTIMATE.ANNOTATION_VALUES.VOLUME")),r.has("ESTIMATE.ANNOTATION_VALUES.WALL")&&(r=(r=r.set(O.a.WALL,r.get("ESTIMATE.ANNOTATION_VALUES.WALL"))).delete("ESTIMATE.ANNOTATION_VALUES.WALL"))),Object.keys(r.toJS()).forEach((function(e){if(e.includes("ESTIMATE.ANNOTATION_VALUES")||e.includes("ESTIMATE.ANNOTATION_PROPERTIES")){var t=e.split(".")[2];O.a[t]&&(r=(r=r.set(O.a[t],r.get(e))).delete(e))}})),t=(t=t.set("annotationData",r)).setIn(["annotationData","folder"],e.get("title"));var s=e.get("title").split(">").length;return 2===s&&""===e.get("title").split(">")[0]&&""===e.get("title").split(">")[1]&&(s=1),s>n.pathLength&&(n.pathLength=s),t.has("geoEstimate")&&(t=t.delete("geoEstimate")),(t=t.set(O.a.ID,++o)).flatten()}))}},{key:"getFlattenedAnnotationExportList",value:function(e,t){var n=this,a=1,o=this.getAnnotationExportList(e,t);return o=o.map((function(e){return e.has("geoEstimate")&&(e=e.delete("geoEstimate")),e=e.set(O.a.ID,a),e=n.initAnnotationForExport(e),a++,e.flatten()}))}},{key:"getAnnotationExportList",value:function(e,t){var n=this;this.pathLength=-1;var o=new c.a.List;try{var i=e,r=new c.a.List,s=new c.a.List;i.forEach((function(e){return"Reduction"===e.get("type")?r=r.push(a.a.calculateValuesForAnnotation(e,!0)):"group"!==e.get("type")&&(s=s.push(a.a.calculateValuesForAnnotation(e,!0))),e})),t.forEach((function(e){var t=new c.a.List;s.forEach((function(a){if(e.getIn(["folder","id"])==a.get("parentId")&&"PeripheralValue"!==a.get("type")&&"CenterValue"!==a.get("type")){a=a.setIn(["annotationData","folder"],e.get("title"));var o=e.get("title").split(">").length;2===o&&""===e.get("title").split(">")[0]&&""===e.get("title").split(">")[1]&&(o=1),o>n.pathLength&&(n.pathLength=o),t=t.push(a),"Polygon"===a.get("type")&&(r=r.filter((function(n){return n.get("parentId")!==a.get("annotationId")||(n=n.setIn(["annotationData","folder"],e.get("title")),t=t.push(n),!1)})))}})),r=r.filter((function(n){var o=a.a.getAnnotationByAnnotationId(n.get("parentId"));if(o)return o.get("parentId")!=e.getIn(["folder","id"])||(n=n.setIn(["annotationData","folder"],e.get("title")),t=t.push(n),!1)})),o=o.concat(t)}))}catch(l){console.log("Error | Export Factory: "+l)}return o}},{key:"initAnnotationForExport",value:function(e){var t=e.get("annotationData");switch(e.get("type")){case"Ellipse":t=t.set(O.a.TYPE,f.a.t("Circle"));break;case"annotation.freeHand":case"Free hand":case"Free Hand":t=t.set(O.a.TYPE,f.a.t("Free Hand"));break;case"Reduction":var n=a.a.getAnnotationByAnnotationId(e.get("parentId"));n&&(t=t.set("ESTIMATE.ANNOTATION_PROPERTIES.REDUCTION_OF","("+n.get("number")+") "+n.get("name"))),t=t.set(O.a.TYPE,f.a.t("Reduction"));break;case"Polygon":t=t.set(O.a.TYPE,f.a.t("Area"));break;case"Polyline":t=t.set(O.a.TYPE,f.a.t("Line"));break;case"Point":t=t.set(O.a.TYPE,f.a.t("Point")),e.has("height")&&(e=e.delete("height"))}return Object.keys(t.toJS()).forEach((function(e){if(e.includes("ESTIMATE.ANNOTATION_VALUES")||e.includes("ESTIMATE.ANNOTATION_PROPERTIES")){var n=e.split(".")[2];O.a[n]&&(t=(t=t.set(O.a[n],t.get(e))).delete(e))}})),e.set("annotationData",t)}}]),e}(),L=function(){function e(){Object(T.a)(this,e)}return Object(S.a)(e,[{key:"getFolderFullExportFields",value:function(e){var t,n=[f.a.t(O.a.ID)];for(t=1;t<=e;t++)n.push(f.a.t(O.a.GROUP_FOLDER)+" "+t);var a=[f.a.t(O.a.AREA),f.a.t(O.a.LENGTH),f.a.t(O.a.VOLUME),f.a.t(O.a.WALL),f.a.t(O.a.NET_AREA),f.a.t(O.a.NET_LENGTH),f.a.t(O.a.NET_VOLUME),f.a.t(O.a.NET_WALL),f.a.t(O.a.RED_AREA),f.a.t(O.a.RED_LENGTH),f.a.t(O.a.RED_VOLUME),f.a.t(O.a.RED_WALL),f.a.t(O.a.COUNT),f.a.t(O.a.AVERAGE_AREA),f.a.t(O.a.AVERAGE_LENGTH),f.a.t(O.a.AVERAGE_VOLUME),f.a.t(O.a.AVERAGE_WALL),f.a.t(O.a.AREA_TILES),f.a.t(O.a.AREA_JOINT_LENGTH),f.a.t(O.a.AREA_JOINT_VOLUME),f.a.t(O.a.WALL_TILES),f.a.t(O.a.WALL_JOINT_LENGTH),f.a.t(O.a.WALL_JOINT_VOLUME)];return n.concat(a)}},{key:"getAnnotationNetOnlyNoPathExportFields",value:function(){return[f.a.t(O.a.ID),f.a.t(O.a.NUMBER),f.a.t(O.a.NAME),f.a.t(O.a.HEIGHT),f.a.t(O.a.NET_AREA),f.a.t(O.a.NET_LENGTH),f.a.t(O.a.NET_VOLUME),f.a.t(O.a.NET_WALL),f.a.t(O.a.POINTS),f.a.t(O.a.COUNT),f.a.t(O.a.TYPE),f.a.t(O.a.AREA_TILES),f.a.t(O.a.AREA_JOINT_LENGTH),f.a.t(O.a.AREA_JOINT_VOLUME),f.a.t(O.a.WALL_TILES),f.a.t(O.a.WALL_JOINT_LENGTH),f.a.t(O.a.WALL_JOINT_VOLUME),f.a.t(O.a.TEXT_CONTENTS),f.a.t(O.a.FILE_NAME)]}},{key:"getAnnotationNetOnlyExportFields",value:function(e){var t,n=[f.a.t(O.a.ID)];for(t=1;t<=e;t++)n.push(f.a.t(O.a.GROUP_FOLDER)+" "+t);var a=[f.a.t(O.a.NUMBER),f.a.t(O.a.NAME),f.a.t(O.a.HEIGHT),f.a.t(O.a.NET_AREA),f.a.t(O.a.NET_LENGTH),f.a.t(O.a.NET_VOLUME),f.a.t(O.a.NET_WALL),f.a.t(O.a.POINTS),f.a.t(O.a.COUNT),f.a.t(O.a.TYPE),f.a.t(O.a.AREA_TILES),f.a.t(O.a.AREA_JOINT_LENGTH),f.a.t(O.a.AREA_JOINT_VOLUME),f.a.t(O.a.WALL_TILES),f.a.t(O.a.WALL_JOINT_LENGTH),f.a.t(O.a.WALL_JOINT_VOLUME),f.a.t(O.a.TEXT_CONTENTS),f.a.t(O.a.FILE_NAME)];return n.concat(a)}},{key:"getAnnotationFullExportFields",value:function(e){var t,n=[f.a.t(O.a.ID)];for(t=1;t<=e;t++)n.push(f.a.t(O.a.GROUP_FOLDER)+" "+t);var a=[f.a.t(O.a.NUMBER),f.a.t(O.a.NAME),f.a.t(O.a.HEIGHT),f.a.t(O.a.AREA),f.a.t(O.a.LENGTH),f.a.t(O.a.VOLUME),f.a.t(O.a.WALL),f.a.t(O.a.NET_AREA),f.a.t(O.a.NET_LENGTH),f.a.t(O.a.NET_VOLUME),f.a.t(O.a.NET_WALL),f.a.t(O.a.RED_AREA),f.a.t(O.a.RED_LENGTH),f.a.t(O.a.RED_VOLUME),f.a.t(O.a.RED_WALL),f.a.t(O.a.POINTS),f.a.t(O.a.AREA_TILES),f.a.t(O.a.AREA_JOINT_LENGTH),f.a.t(O.a.AREA_JOINT_VOLUME),f.a.t(O.a.WALL_TILES),f.a.t(O.a.WALL_JOINT_LENGTH),f.a.t(O.a.WALL_JOINT_VOLUME),f.a.t(O.a.COUNT),f.a.t(O.a.TYPE),f.a.t(O.a.REDUCTION_OF),f.a.t(O.a.OUTER_DIM_X),f.a.t(O.a.OUTER_DIM_Y),f.a.t(O.a.RADIUS_X),f.a.t(O.a.RADIUS_X),f.a.t(O.a.DIAMETER_X),f.a.t(O.a.DIAMETER_Y),f.a.t(O.a.TEXT_CONTENTS),f.a.t(O.a.FILE_NAME)];return n.concat(a)}}]),e}(),C=Object(y.a)(v.a,{epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null}),_=function(e){Object(b.a)(n,e);var t=Object(I.a)(n);function n(){return Object(T.a)(this,n),t.call(this)}return Object(S.a)(n,[{key:"dispatch",value:function(e){var t=new R,n=new L,o=void 0,r=new c.a.List,s=new c.a.List;switch(e){case O.c.Annotation_Full:r=t.getFlattenedAnnotationExportList(a.a.getSelectedAnnotations().map((function(e){return e.get("storeAnnotation")})),a.a.getSortedFolderPaths(!0)),o=this.getProjectExportHeadlineToClipboard(O.t[e]),s=n.getAnnotationFullExportFields(t.getPathLength());break;case O.c.Annotation_Net_Only:r=t.getFlattenedAnnotationExportList(a.a.getSelectedAnnotations().map((function(e){return e.get("storeAnnotation")})),a.a.getSortedFolderPaths(!0)),o=this.getProjectExportHeadlineToClipboard(O.t[e]),s=n.getAnnotationNetOnlyExportFields(t.getPathLength());break;case O.c.Annotation_Net_Only_No_Path:r=t.getFlattenedAnnotationExportList(a.a.getSelectedAnnotations().map((function(e){return e.get("storeAnnotation")})),a.a.getSortedFolderPaths(!0)),o=this.getProjectExportHeadlineToClipboard(O.t[e]),s=n.getAnnotationNetOnlyNoPathExportFields();break;case O.c.Annotation_Folder_Full:try{r=t.getFolderExport(a.a.getSelectedAnnotations().map((function(e){return e.get("storeAnnotation")})),a.a.getSortedFolderPaths(!0)),o=this.getProjectExportHeadlineToClipboard(O.t[e]),s=n.getFolderFullExportFields(t.getPathLength())}catch(u){console.log("Error | Folder Export: "+u)}break;default:console.log("Export did not handle case for annotation: "+e)}r=this.applyTranslation(r.map((function(e){return e.map((function(t,n){if("imperial"===N.a.getProjectUnitsByID(a.a.getProjectIdFromEstimateId(e.getIn(["geoEstimate","id"]))))switch(n){case"area":case"totalReduction":case"netArea":case"wall":return i.a.formatAmountValue(C.unit(t,"m2").to("sqft").toNumeric(),!1);case"volume":return i.a.formatAmountValue(C.unit(t,"m3").to("cuft").toNumeric(),!1);case"totalLength":case"radiusX":case"radiusY":case"diameterX":case"diameterY":case"circumference":case"height":return i.a.formatNumberValue(C.unit(t,"m").to("ft").toNumeric(),!1);default:return"number"===typeof t?i.a.formatAmountValue(t,!1):t}else switch(n){case"ID":case"id":case"pages":case"pageNumber":case"strokeSize":case"fontSize":case"geometraBorderOpacity":case"geometraOpacity":case"quantity":case"rotation":case"pointSize":case"ESTIMATE.ANNOTATION_VALUES.POINTS":case"ESTIMATE.ANNOTATION_PROPERTIES.COUNT":return t;case"height":case"ESTIMATE.ANNOTATION_PROPERTIES.HEIGHT":return i.a.formatNumberValue(t,!1);default:return"number"===typeof t?i.a.formatAmountValue(t,!1):t}}))}))),r=this.initFolderData(r);var l=new c.a.Map;return l=l.set("fields",s).set("data",r).set("headlineData",o)}}]),n}(P),M=function(){function e(){Object(T.a)(this,e)}return Object(S.a)(e,[{key:"getAnnotationRowsFullFields",value:function(e){var t,n=[f.a.t("ID")];for(t=1;t<=e;t++)n.push(f.a.t(O.a.GROUP_FOLDER)+" "+t);var a=[f.a.t(O.a.NUMBER),f.a.t(O.a.NAME),f.a.t(O.H.STATUS),f.a.t(O.H.PROFESSION),f.a.t(O.H.PHASE),f.a.t(O.H.SEGMENT),f.a.t(O.H.ACTION),f.a.t(O.H.MATERIAL),f.a.t(O.H.AMOUNT),f.a.t(O.H.UNIT),f.a.t(O.H.UNIT_PRICE),f.a.t(O.H.UNIT_TIME),f.a.t(O.H.TOTAL_PRICE),f.a.t(O.H.FORMULA),f.a.t(O.H.TOTAL_TIME),f.a.t(O.H.CURRENCY),f.a.t(O.a.FILE_NAME)];return n.concat(a)}},{key:"getAnnototationRowsSumFolderFields",value:function(e){var t,n=[f.a.t("ID")];for(t=1;t<=e;t++)n.push(f.a.t(O.a.GROUP_FOLDER)+" "+t);var a=[f.a.t(O.H.STATUS),f.a.t(O.H.PROFESSION),f.a.t(O.H.PHASE),f.a.t(O.H.SEGMENT),f.a.t(O.H.ACTION),f.a.t(O.H.MATERIAL),f.a.t(O.H.AMOUNT),f.a.t(O.H.UNIT),f.a.t(O.H.UNIT_PRICE),f.a.t(O.H.UNIT_TIME),f.a.t(O.H.TOTAL_PRICE),f.a.t(O.H.TOTAL_TIME),f.a.t(O.H.CURRENCY),f.a.t(O.H.OBJECTS)];return n.concat(a)}},{key:"getAnnotionTotalRowsSumFields",value:function(){return[f.a.t(O.H.ID),f.a.t(O.H.STATUS),f.a.t(O.H.PROFESSION),f.a.t(O.H.PHASE),f.a.t(O.H.SEGMENT),f.a.t(O.H.ACTION),f.a.t(O.H.MATERIAL),f.a.t(O.H.AMOUNT),f.a.t(O.H.UNIT),f.a.t(O.H.UNIT_PRICE),f.a.t(O.H.UNIT_TIME),f.a.t(O.H.TOTAL_PRICE),f.a.t(O.H.FORMULA),f.a.t(O.H.TOTAL_TIME),f.a.t(O.H.CURRENCY),f.a.t(O.H.OBJECTS)]}},{key:"getBidconExportFields",value:function(){return[f.a.t(O.a.NUMBER),f.a.t(O.a.NAME),f.a.t(O.H.STATUS),f.a.t(O.H.PROFESSION),f.a.t(O.H.PHASE),f.a.t(O.H.SEGMENT),f.a.t(O.H.ACTION),f.a.t(O.H.MATERIAL),f.a.t(O.H.AMOUNT),f.a.t(O.H.UNIT),f.a.t(O.H.UNIT_PRICE),f.a.t(O.H.UNIT_TIME),f.a.t(O.H.TOTAL_PRICE),f.a.t(O.H.TOTAL_TIME),f.a.t(O.H.CURRENCY),f.a.t(O.H.OBJECTS)]}}]),e}(),k=n(135),D=n(100),x=n(117),F=n(57),j=n(12),V=function(e){Object(b.a)(n,e);var t=Object(I.a)(n);function n(){return Object(T.a)(this,n),t.call(this)}return Object(S.a)(n,[{key:"getAnnotationRowsFullList",value:function(e,t){var a=this,o=i.a.getSelectedRows(),r=Object(k.a)(Object(D.a)(n.prototype),"getAnnotationExportList",this).call(this,e,t),s=new c.a.List,l=0,u=i.a.getBundledRowsForGui().toJS();return r.forEach((function(e){var t=o.filter((function(t){return t.getIn(["geoAnnotation","id"])==e.get("id")}));t=t.map((function(t){var n=u.find((function(e){return e.ids?e.ids.some((function(e){return e===t.get("id")})):e.id===t.get("id")})),o=t.get("annotationRow").get("amount");e.get("number")&&(t=t.set(O.a.NUMBER,e.get("number").replace(/-+/g,"\u2212"))),e.get("name")&&(t=t.set(O.a.NAME,e.get("name").replace(/-+/g,"\u2212"))),t=t.set(O.H.ID,++l),e.getIn(["annotationData","folder"])&&(t=t.set("folder",e.getIn(["annotationData","folder"]).replace(/-+/g,"\u2212"))),n.annotationRow.status&&(t=t.setIn(["annotationRow",O.H.STATUS],i.a.getVisibleStatusValue(n.annotationRow.status))),n.annotationRow.profession&&(t=t.setIn(["annotationRow",O.H.PROFESSION],n.annotationRow.profession)),n.annotationRow.phase&&(t=t.setIn(["annotationRow",O.H.PHASE],n.annotationRow.phase)),n.annotationRow.segment&&(t=t.setIn(["annotationRow",O.H.SEGMENT],n.annotationRow.segment)),n.annotationRow.action&&(t=t.setIn(["annotationRow",O.H.ACTION],n.annotationRow.action)),n.annotationRow.material&&(t=t.setIn(["annotationRow",O.H.MATERIAL],n.annotationRow.material)),n.annotationRow.unit&&(t=t.setIn(["annotationRow",O.H.UNIT],n.annotationRow.unit)),t.getIn(["annotationRow","unitTime"])&&(t=t.setIn(["annotationRow",O.H.UNIT_TIME],t.getIn(["annotationRow","unitTime"]))),o&&(t=t.setIn(["annotationRow","Formula"],o)),N.a.getProjectCurrency(N.a.getActiveProjectId())&&(t=t.setIn(["annotationRow",O.H.CURRENCY],N.a.getProjectCurrency(N.a.getActiveProjectId())));var r=e.get("geoFile"),s=void 0;if(r){var c=F.a.getFileById(r.get("id"));c&&(s=c.name,t=t.setIn(["annotationRow",O.a.FILE_NAME],s))}try{var d=i.a.parseExpressionToValues(t.getIn(["annotationRow","amount"]),e.get("annotationData"));t=t.setIn(["annotationRow",O.H.AMOUNT],a.translateValue(d,t.get("unit"),!0));var p=i.a.performChainMultiply(d,t.getIn(["annotationRow","pricePerUnit"]));t=(t=t.setIn(["annotationRow",O.H.TOTAL_PRICE],a.translateValue(p,t.get("unit")))).setIn(["annotationRow",O.H.UNIT_PRICE],a.translateValue(t.getIn(["annotationRow","pricePerUnit"]),t.get("unit")));var g=i.a.performTimeChainMultiply(t.getIn(["annotationRow","unitTime"]),d);t=t.setIn(["annotationRow",O.H.TOTAL_TIME],g)}catch(h){console.log("Error in formula "+h)}return t.flatten()})),s=s.concat(t)})),s}},{key:"getAnnototationRowsSumFolderList",value:function(e){var t=this,n=new c.a.List,o=i.a.getBundledRowsForGui();try{var r=0;e.forEach((function(e){var o=a.a.getAnnotaionsInFolderFirstLevel(e.getIn(["folder","id"])).filter((function(e){return"group"!==e.get("type")}));i.a.calculateValues(o);var s=i.a.getBundledRowsForGui(),l=e.get("title").split(">").length;2===l&&""===e.get("title").split(">")[0]&&""===e.get("title").split(">")[1]&&(l=1),l>t.pathLength&&(t.pathLength=l),s=s.map((function(n){return(n=(n=n.set(O.H.ID,++r)).set("folder",e.get("title"))).getIn(["annotationRow","status"])&&(n=n.setIn(["annotationRow",O.H.STATUS],i.a.getVisibleStatusValue(n.getIn(["annotationRow","status"])))),n.getIn(["annotationRow","profession"])&&(n=n.setIn(["annotationRow",O.H.PROFESSION],n.getIn(["annotationRow","profession"]))),n.getIn(["annotationRow","phase"])&&(n=n.setIn(["annotationRow",O.H.PHASE],n.getIn(["annotationRow","phase"]))),n.getIn(["annotationRow","segment"])&&(n=n.setIn(["annotationRow",O.H.SEGMENT],n.getIn(["annotationRow","segment"]))),n.getIn(["annotationRow","action"])&&(n=n.setIn(["annotationRow",O.H.ACTION],n.getIn(["annotationRow","action"]))),n.getIn(["annotationRow","material"])&&(n=n.setIn(["annotationRow",O.H.MATERIAL],n.getIn(["annotationRow","material"]))),n.getIn(["annotationRow","amount"])&&(n=n.setIn(["annotationRow",O.H.AMOUNT],i.a.formatAmountValue(n.getIn(["annotationRow","amount"]),!1))),n.getIn(["annotationRow","unit"])&&(n=n.setIn(["annotationRow",O.H.UNIT],n.getIn(["annotationRow","unit"]))),n.getIn(["annotationRow","pricePerUnit"])&&(n=n.setIn(["annotationRow",O.H.UNIT_PRICE],i.a.formatCurrencyValue(n.getIn(["annotationRow","pricePerUnit"]),!1))),n.getIn(["annotationRow","unitTime"])&&(n=n.setIn(["annotationRow",O.H.UNIT_TIME],n.getIn(["annotationRow","unitTime"]))),n.getIn(["annotationRow","totalPrice"])&&(n=n.setIn(["annotationRow",O.H.TOTAL_PRICE],i.a.formatCurrencyValue(n.getIn(["annotationRow","totalPrice"]),!1))),n.getIn(["annotationRow","totalTime"])&&(n=n.setIn(["annotationRow",O.H.TOTAL_TIME],n.getIn(["annotationRow","totalTime"]))),N.a.getProjectCurrency(N.a.getActiveProjectId())&&(n=n.setIn(["annotationRow",O.H.CURRENCY],N.a.getProjectCurrency(N.a.getActiveProjectId()))),(n=n.setIn(["annotationRow",O.H.OBJECTS],t.getAffectedObjects(n))).flatten()})),n=n.concat(s)}))}catch(s){console.log("Error | getFolderCalculationExportList: "+s)}return i.a.resetBundledRowsForGui(o),n}},{key:"getSelectionRowSum",value:function(){var e=this,t=0;i.a.calculateValues();var n=i.a.getSelectedRows(),a=new c.a.List;return i.a.getBundledRowsForGui().forEach((function(o){n.find((function(e){return e.get("id")===o.get("id")}))&&((o=o.set(O.H.ID,++t)).getIn(["annotationRow","status"])&&(o=o.setIn(["annotationRow",O.H.STATUS],i.a.getVisibleStatusValue(o.getIn(["annotationRow","status"])))),o.getIn(["annotationRow","profession"])&&(o=o.setIn(["annotationRow",O.H.PROFESSION],o.getIn(["annotationRow","profession"]))),o.getIn(["annotationRow","phase"])&&(o=o.setIn(["annotationRow",O.H.PHASE],o.getIn(["annotationRow","phase"]))),o.getIn(["annotationRow","segment"])&&(o=o.setIn(["annotationRow",O.H.SEGMENT],o.getIn(["annotationRow","segment"]))),o.getIn(["annotationRow","action"])&&(o=o.setIn(["annotationRow",O.H.ACTION],o.getIn(["annotationRow","action"]))),o.getIn(["annotationRow","material"])&&(o=o.setIn(["annotationRow",O.H.MATERIAL],o.getIn(["annotationRow","material"]))),o.getIn(["annotationRow","amount"])&&(o=o.setIn(["annotationRow",O.H.AMOUNT],i.a.formatAmountValue(o.getIn(["annotationRow","amount"]),!1))),o.getIn(["annotationRow","unit"])&&(o=o.setIn(["annotationRow",O.H.UNIT],o.getIn(["annotationRow","unit"]))),o.getIn(["annotationRow","pricePerUnit"])&&(o=o.setIn(["annotationRow",O.H.UNIT_PRICE],i.a.formatCurrencyValue(o.getIn(["annotationRow","pricePerUnit"]),!1))),o.getIn(["annotationRow","unitTime"])&&(o=o.setIn(["annotationRow",O.H.UNIT_TIME],o.getIn(["annotationRow","unitTime"]))),o.getIn(["annotationRow","totalPrice"])&&(o=o.setIn(["annotationRow",O.H.TOTAL_PRICE],i.a.formatCurrencyValue(o.getIn(["annotationRow","totalPrice"]),!1))),o.getIn(["annotationRow","totalTime"])&&(o=o.setIn(["annotationRow",O.H.TOTAL_TIME],o.getIn(["annotationRow","totalTime"]))),N.a.getProjectCurrency(N.a.getActiveProjectId())&&(o=o.setIn(["annotationRow",O.H.CURRENCY],N.a.getProjectCurrency(N.a.getActiveProjectId()))),o=o.setIn(["annotationRow",O.H.OBJECTS],e.getAffectedObjects(o)),a=a.push(o.flatten()))})),a}},{key:"getBidconExportList",value:function(e){var t=this,n=new c.a.List,o=i.a.getBundledRowsForGui();return e.forEach((function(e){var o=a.a.getAnnotaionsInFolderFirstLevel(e.getIn(["folder","id"])).filter((function(e){return"group"!==e.get("type")}));i.a.calculateValues(o);var r=i.a.getBundledRowsForGui();r=r.map((function(n){return(new c.a.Map).set(O.a.NUMBER,e.getIn(["folder","number"])).set(O.a.NAME,e.getIn(["folder","name"])).set(O.H.STATUS,i.a.getVisibleStatusValue(n.getIn(["annotationRow","status"]))).set(O.H.PROFESSION,n.getIn(["annotationRow","profession"])).set(O.H.PHASE,n.getIn(["annotationRow","phase"])).set(O.H.SEGMENT,n.getIn(["annotationRow","segment"])).set(O.H.ACTION,n.getIn(["annotationRow","action"])).set(O.H.MATERIAL,n.getIn(["annotationRow","material"])).set(O.H.AMOUNT,i.a.formatAmountValue(n.getIn(["annotationRow","amount"]),!1)).set(O.H.UNIT,n.getIn(["annotationRow","unit"])).set(O.H.UNIT_PRICE,i.a.formatCurrencyValue(n.getIn(["annotationRow","pricePerUnit"]),!1)).set(O.H.UNIT_TIME,n.getIn(["annotationRow","unitTime"])).set(O.H.TOTAL_PRICE,i.a.formatCurrencyValue(n.getIn(["annotationRow","totalPrice"]),!1)).set(O.H.TOTAL_TIME,n.getIn(["annotationRow","totalTime"])).set(O.H.CURRENCY,N.a.getProjectCurrency(N.a.getActiveProjectId())).set(O.H.OBJECTS,t.getAffectedObjects(n))})),n=n.concat(r)})),i.a.resetBundledRowsForGui(o),n}},{key:"getAffectedObjects",value:function(e){return e.get("ids")&&e.get("ids").size>1?Object(j.uniq)(e.get("ids").map((function(e){return i.a.getRowById(e).getIn(["geoAnnotation","id"])})).toJS()).length:1}},{key:"translateValue",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e,o=e;if("errorInFormula"===a)return f.a.t("translation:ESTIMATE.ANNOTATION_ROWS.ERROR_IN_FORMULA");var i=n?{maximumFractionDigits:3,minimumFractionDigits:3,useGrouping:!1}:{maximumFractionDigits:2,minimumFractionDigits:2,useGrouping:!1};if("number"===typeof a)switch(t){case"m":o="imperial"===N.a.getProjectUnitsByID(N.a.getActiveProjectId())?Object(x.b)(a,"ft"):a.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;case"m2":o="imperial"===N.a.getProjectUnitsByID(N.a.getActiveProjectId())?Object(x.c)(a,"sqft"):a.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;case"m3":o="imperial"===N.a.getProjectUnitsByID(N.a.getActiveProjectId())?Object(x.d)(a,"cuft"):a.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;case"st":o=a.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;default:o=a.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-")}else{var r=Number.parseFloat(o);if(!Number.isNaN(r))switch(t){case"m":o="imperial"===N.a.getProjectUnitsByID(N.a.getActiveProjectId())?Object(x.b)(r,"ft"):r.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;case"m2":o="imperial"===N.a.getProjectUnitsByID(N.a.getActiveProjectId())?Object(x.c)(r,"sqft"):r.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;case"m3":o="imperial"===N.a.getProjectUnitsByID(N.a.getActiveProjectId())?Object(x.d)(r,"cuft"):r.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;case"st":o=r.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-");break;default:o=r.toLocaleString(f.a.language,i).replace(/\s+/g,"").replace(/\u2212+/g,"-")}}return o}}]),n}(R),U=function(e){Object(b.a)(n,e);var t=Object(I.a)(n);function n(){return Object(T.a)(this,n),t.apply(this,arguments)}return Object(S.a)(n,[{key:"dispatch",value:function(e){var t=new M,n=new V,o=new c.a.List,i=new c.a.List,r=void 0;switch(e){case O.d.Annotation_Rows_Full:i=n.getAnnotationRowsFullList(a.a.getSelectedAnnotations().map((function(e){return e.get("storeAnnotation")})),a.a.getSortedFolderPaths(!0)),r=this.getProjectExportHeadlineToClipboard(O.t[e]),o=t.getAnnotationRowsFullFields(n.getPathLength());break;case O.d.Annotation_Rows_Sum_Folder:i=n.getAnnototationRowsSumFolderList(a.a.getSortedFolderPaths(!0)),r=this.getProjectExportHeadlineToClipboard(O.t[e]),o=t.getAnnototationRowsSumFolderFields(n.getPathLength());break;case O.d.Annotation_Rows_Sum:i=n.getSelectionRowSum(a.a.getSelectedAnnotations().map((function(e){return e.get("storeAnnotation")})),a.a.getSortedFolderPaths(!0)),r=this.getProjectExportHeadlineToClipboard(O.t[e]),o=t.getAnnotionTotalRowsSumFields(n.getPathLength());break;case O.d.Annotation_Rows_Bidcon:i=n.getBidconExportList(a.a.getSortedFolderPaths(!0)),r=this.getProjectExportHeadlineToClipboard(O.t[e]).set("exportData",void 0),o=t.getBidconExportFields();break;default:console.log("Export did not handle case for annotation row: "+e)}i=this.applyTranslation(i),i=this.initFolderData(i);var s=new c.a.Map;return s=(s=s.set("fields",o).set("data",i).set("headlineData",r)).set("data",i)}}]),n}(P),W=Object(u.createStore)({exportCalcRowsToClipboard:function(e){var t=(new U).dispatch(e);return t.getIn(["headlineData","exportData"])?t.setIn(["headlineData","exportData"],t.getIn(["headlineData","exportData"]).concat("\n"+E()({data:t.get("data").toJS(),fields:t.get("fields"),del:"\t"}))):t.setIn(["headlineData","exportData"],E()({data:t.get("data").toJS(),fields:t.get("fields"),del:"\t"}))},exportCalcRowsToCSV:function(e){var t=(new U).dispatch(e);return-1!==f.a.language.indexOf("sv")||-1!==f.a.language.indexOf("no")||-1!==f.a.language.indexOf("nn")||-1!==f.a.language.indexOf("nb")||-1!==f.a.language.indexOf("da")||-1!==f.a.language.indexOf("nl")?t.getIn(["headlineData","exportData"])?t.setIn(["headlineData","exportData"],t.getIn(["headlineData","exportData"]).concat("\n"+E()({data:t.get("data").toJS(),fields:t.get("fields"),del:";"}))):t.setIn(["headlineData","exportData"],E()({data:t.get("data").toJS(),fields:t.get("fields"),del:";"})):t.getIn(["headlineData","exportData"])?t.setIn(["headlineData","exportData"],t.getIn(["headlineData","exportData"]).concat("\n"+E()({data:t.get("data").toJS(),fields:t.get("fields")}))):t.setIn(["headlineData","exportData"],E()({data:t.get("data").toJS(),fields:t.get("fields")}))},exportAnnotationsToClipboard:function(e){var t=(new _).dispatch(e);return t.getIn(["headlineData","exportData"])?t.setIn(["headlineData","exportData"],t.getIn(["headlineData","exportData"]).concat("\n"+E()({data:t.get("data").toJS(),fields:t.get("fields"),del:"\t"}))):t.setIn(["headlineData","exportData"],E()({data:t.get("data").toJS(),fields:t.get("fields"),del:"\t"}))},exportAnnotationsToCsv:function(e){var t=(new _).dispatch(e);return-1!==f.a.language.indexOf("sv")||-1!==f.a.language.indexOf("no")||-1!==f.a.language.indexOf("nn")||-1!==f.a.language.indexOf("nb")||-1!==f.a.language.indexOf("da")||-1!==f.a.language.indexOf("nl")?t.getIn(["headlineData","exportData"])?t.setIn(["headlineData","exportData"],t.getIn(["headlineData","exportData"]).concat("\n"+E()({data:t.get("data").toJS(),fields:t.get("fields"),del:";"}))):t.setIn(["headlineData","exportData"],E()({data:t.get("data").toJS(),fields:t.get("fields"),del:";"})):t.getIn(["headlineData","exportData"])?t.setIn(["headlineData","exportData"],t.getIn(["headlineData","exportData"]).concat("\n"+E()({data:t.get("data").toJS(),fields:t.get("fields")}))):t.setIn(["headlineData","exportData"],E()({data:t.get("data").toJS(),fields:t.get("fields")}))}}),B=n(170),H=(n(232),n(87)),J=n.n(H),z=n(197),G=n(35),q=n(33),X=n(26),Y=n.n(X),K=n(28),Z=n(47),Q=n(0),$=n.n(Q),ee=n(16),te=n(61),ne=n(37),ae=n(105),oe=Object(u.createStore)({listenables:[],init:function(){this.selectedObject={},this.modelStructureData={},this.modelStructureTree={},this.selectedKeyFromTree=[],this.isLinkActive=!1,this.currentActions={},this.activeTool=0,this.ifcValueInheritance=void 0},initValueInheritance:function(){var e=JSON.parse(sessionStorage.getItem("inheritance"));this.ifcValueInheritance=(null===e||void 0===e?void 0:e["3DModel"])?e["3DModel"]:{number:"000",color:"#47ECD5"}},getActiveTool:function(){return this.activeTool},setActiveTool:function(e){return this.activeTool=e},onChangeActiveTool:function(){this.trigger("changeActiveTool")},onResetView:function(){this.trigger("resetView")},changeInheritance:function(e){this.ifcValueInheritance=Object.assign({},this.ifcValueInheritance,e),sessionStorage.setItem("inheritance",JSON.stringify(Object.assign({},JSON.parse(sessionStorage.getItem("inheritance")),{"3DModel":this.ifcValueInheritance})))},setActions:function(e){this.currentActions=e},getActions:function(){return this.currentActions},setSelectedObject:function(e){this.selectedObject=e},getSelectedUuid:function(){if(!Object(j.isEmpty)(this.selectedObject))return this.selectedObject.key},setSelectedObjectFromTree:function(e,t,n){n!==a.a.getActiveFileId()&&n?(this.selectedKeyFromTree=null,this.selectedObject=null):(this.selectedKeyFromTree=e,this.selectedObject=null===t||void 0===t?void 0:t.node),this.trigger("updateIfcTree")},getSelectedKeys:function(){return this.selectedKeyFromTree},setLinkState:function(e){this.isLinkActive=e},getLinkState:function(){return this.isLinkActive},getModelStructureTree:function(){return this.modelStructureTree},canLinkObejct:function(){var e=this;return!a.a.getAnnotations().toJS().find((function(t){return"group"!==t.type&&t.xfdf.uuid===e.selectedObject.key&&t.geoFile.id===a.a.getActiveFileId()}))},linkNormalisedObject:function(){var e=this;return Object(Z.a)(Y.a.mark((function t(){var n,a,o,i,r,s;return Y.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.getMeasureData(e.selectedObject.id);case 2:n=t.sent,a=e.getMeasureDataInMeters(n),o=n.volume>=1e7,i=e.getSum(n.sides),r=o?e.getValueInMeters(n.volume,1e9):n.volume,s=JSON.stringify(Object(K.a)(Object(K.a)({},a),{},{uuid:e.selectedObject.id,area:i,netArea:i,netVolume:r,status:"notStarted",readOnly:!1,color:e.ifcValueInheritance.color})),e.onCreateIfcAnnotationHandler(e.selectedObject,s),te.a.calculateTreeSelect([],{selectedNodes:[]});case 10:case"end":return t.stop()}}),t)})))()},linkObject:function(){var e=this;return Object(Z.a)(Y.a.mark((function t(){var n;return Y.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=JSON.stringify({uuid:e.selectedObject.id,status:"notStarted",color:e.ifcValueInheritance.color,readOnly:!1}),e.onCreateIfcAnnotationHandler(e.selectedObject,n),te.a.calculateTreeSelect([],{selectedNodes:[]});case 3:case"end":return t.stop()}}),t)})))()},onCreateIfcAnnotationHandler:function(e,t){try{var n=a.a.getActiveParentId(),o=this.getAnnotationTagNumber();a.a.updateAnnotationNumberByProjectId("3DModel",o),this.changeInheritance({number:o});var i={annotationId:a.a.generateUUID(),geoEstimateId:a.a.getActiveEstimate().get("id"),fileId:Number(a.a.getActiveFileId()),height:"2.5",layerId:null,parentId:-1===n?null:n.toString(),name:e.title,number:o,quantity:1,type:"3DModel",xfdf:t,indexPosition:null};ue.a.onSendMessage(ne.f.GEO_ANNOTATION,{action:ne.a.CREATE,annotations:[i]})}catch(r){console.log("Error: "+r)}},getMeasureData:function(e){var t=this;return Object(Z.a)(Y.a.mark((function n(){var a;return Y.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a={},n.next=3,t.getActions().calculateElementMeasures(e,(function(e){a=e}));case 3:return n.abrupt("return",a);case 4:case"end":return n.stop()}}),n)})))()},fetchIfcModelStructureData:function(e){var t=this;return Object(Z.a)(Y.a.mark((function n(){return Y.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,J.a.get(e).then((function(e){t.modelStructureData=e.data,t.buildModelStructureTree()})).catch((function(e){return console.log(e)}));case 2:case"end":return n.stop()}}),n)})))()},buildModelStructureTree:function(){var e=this,t=a.a.generateUUID(),n=[{title:this.modelStructureData.object.uuid,parentId:null,id:t,key:t,children:this.modelStructureData.object.userData.types.map((function(e){var n=a.a.generateUUID();return{title:e,parentId:t,id:n,key:n,children:[]}}))}];n[0].children.forEach((function(t){var n=e.modelStructureData.object.children.filter((function(e){return e.userData.type===t.title}));t.children=n.map((function(e){return{title:t.title,parentId:t.id,id:e.uuid,key:e.uuid,icon:$.a.createElement(ee.a,{icon:["fal","cube"]}),isLeaf:!0}}))})),this.modelStructureTree=n,this.trigger("modelStructureTreeBuilded")},addCreatedIfcAnnotation:function(e,t){var n=this.parseIfcAnnotation(e),i=a.a.getAnnotations();a.a.setAnnotations(i.push(n)),t===o.a.getUserId()&&(a.a.increaseAnnotationTypeMapSelection(e.type),a.a.setActiveAnnotation(n),te.a.calculateTreeCheck([e.id],{node:{data:n.toJS(),key:e.id},selectedNodes:[{data:n.toJS(),hasNegativeRow:!1,key:e.id,parent:e.parentId,title:e.name}]})),a.a.calculateValues(),this.trigger("ifcAnnotationInserted")},onUpdateIfcAnnotation:function(e){this.updateIfcAnnotationHandler([e])},onUpdateIfcAnnotations:function(e){var t=e.ids,n=e.key,a=e.projectId,o=e.value,i=t.map((function(e){return{id:e,projectId:a,key:n,value:o}}));this.updateIfcAnnotationHandler(i)},changeIfcStyles:function(e,t,n){var a=n.map((function(e){return e.get("id")}));ue.a.onSendMessage(ne.f.GEO_ANNOTATION,{action:ne.a.UPDATE,ids:a,parameter:e,value:t})},updateIfcAnnotationHandler:function(e){var t=a.a.getAnnotations().map((function(t){var n=e.find((function(e){return t.get("id")===e.id}));if(n){var o=n.key,i=n.value,r={};switch(o){case"parentId":r=t.setIn([o],""===i?void 0:i);break;case"name":r=t.setIn([o],i);break;case"number":a.a.updateAnnotationNumberByProjectId("3DModel",i),r=t.setIn([o],i);break;case"readOnly":case"netArea":case"status":case"netVolume":case"color":r=t.setIn(["xfdf",o],i);break;default:return t}a.a.exchangeSelectedIfSelected(r);var s=a.a.getActiveAnnotation();return s&&s.get("id")===r.get("id")&&(a.a.onSetActiveParentId(r.get("parentId")),a.a.setActiveAnnotation(r)),r}return t}));a.a.setAnnotations(t),a.a.calculateValues(),this.trigger("ifcAnnotationsUpdated")},getSum:function(e){return Object.entries(e).reduce((function(e,t){var n=Object(q.a)(t,2);n[0];return e+n[1].area}),0)},getMeasureDataInMeters:function(e){var t=this;return e.volume<=1e7||(e.volume=this.getValueInMeters(e.volume,1e9),Object.entries(e.edges).forEach((function(e){var n=Object(q.a)(e,2),a=(n[0],n[1]);a.length=t.getValueInMeters(a.length,1e3)})),Object.entries(e.sides).forEach((function(e){var n=Object(q.a)(e,2),a=(n[0],n[1]);a.area=t.getValueInMeters(a.area,1e6),a.circumference=t.getValueInMeters(a.circumference,1e3)}))),e},getValueInMeters:function(e,t){return e/t},getAnnotationTagNumber:function(){var e=JSON.parse(localStorage.getItem("annotationNumberByProject")),t=e&&e[N.a.getActiveProjectId()]&&e[N.a.getActiveProjectId()]["3DModel"]?e[N.a.getActiveProjectId()]["3DModel"]:"000";t&&(t=(new ae.a).getNextNumberString(t));return t},parseIfcAnnotation:function(e){var t=e.annotationId,n=e.geoEstimateId,a=e.fileId,o=e.height,i=e.id,r=e.name,s=e.number,l=e.parentId,u=e.quantity,d=e.type,p=e.xfdf,g={annotationId:t,geoEstimate:{id:n},geoFile:{id:a,pages:0},height:o,id:i,name:r,number:s,parentId:l||void 0,quantity:u,type:d,xfdf:JSON.parse(p)};return c.a.fromJS(g)}}),ie=(Object(u.createStore)({listenables:[G.g],init:function(){this.messageStack=new c.a.Stack,this.listenables=G.g},onSendUpdate:function(e){if(this.messageStack=this.messageStack.push(e),o.a.getJwt()&&null===z.a.socket&&z.a.onInitSocket(),z.a.socket)for(var t=0;this.messageStack.size>0;t++)G.i.sendMessage(this.messageStack.first()),this.messageStack=this.messageStack.pop()},onMessageReceived:function(e){var t=this;switch(e.action){case"add_estimate":G.e.addEstimate(e.payload);break;case"delete_estimate":G.e.deleteEstimate(e.payload);break;case"edit_estimate":G.e.editEstimate(e.payload);break;case"lock_estimate":G.e.lockEstimate(e.payload);break;case"file_uploaded":G.f.addNodeToTree(e.payload,!1,e.payload.name),F.a.getMultipleFilesDataLoader().wanted>0&&F.a.multipleFilesLoaderHandler();break;case"conversion_notification":J.a.get("".concat("https://api.geometra.rukkor.io","/files"),{params:{projectId:N.a.getActiveProjectId()},headers:{Authorization:o.a.getJwt()}}).then((function(e){G.f.buildTree(e.data)})).catch((function(e){console.log(e)}));break;case"file_deleted":a.a.getProjectIdFromEstimateId()===e.payload.geoProjectId&&a.a.onDeleteFileHandler(e.payload.id),G.f.addNodeToTree(e.payload,!0,e.payload.name);break;case"delete_files":e.projectId===N.a.getActiveProjectId()&&G.f.buildTree(e.payload);break;case"delete_folder":a.a.getProjectIdFromEstimateId()===e.projectId&&(a.a.onDeleteDriveFolderHandler(e.deletedFileIds),G.f.buildTree(e.payload));break;case"update_node":N.a.getActiveProjectId()===e.payload[0].geoProjectId&&G.f.updateTree(e.payload);break;case"update_node_position":case"update_nodes_position":N.a.getActiveProjectId()===e.projectId&&G.f.buildTree(e.payload);break;case"set_termsOfService":G.b.updateTermsOfService(e.payload.termsOfService);break;case"add_row_template":case"update_row_template":case"delete_row_template":case"get_row_templates":G.c.updateRowTemplate(e.payload);break;case"add_template":ce.onAddTemplate(e.payload,e.type);break;case"delete_template":ce.onDeleteTemplate(e.payload,e.type);break;case"duplicate_template":ce.onDuplicateTemplate(e.payload,e.type);break;case"get_calculate_templates":400===e.payload.statusCode?setTimeout((function(){var e;return t.onSendUpdate({action:"get_calculate_templates",companyId:null===(e=N.a.getActiveProject())||void 0===e?void 0:e.toJS().department.company.id})}),2e3):ce.onSetCalculateTemplates(e.payload,e.type);break;case"get_drive_templates":400===e.payload.statusCode?setTimeout((function(){var e;return t.onSendUpdate({action:"get_drive_templates",companyId:null===(e=N.a.getActiveProject())||void 0===e?void 0:e.toJS().department.company.id})}),2e3):ce.onSetDriveTemplates(e.payload,e.type);break;case"update_template":ce.onUpdateTemplate(e.payload,e.type);break;case"add_template_folder":ce.onAddTemplateFolder(e.payload,e.type);break;case"add_template_to_calculate_folder":ce.onAddCalcTemplateToFolder();break;case"add_template_to_drive_folder":ce.onAddDriveTemplateToFolder(e.payload,e.type);break;case"delete_template_folder":ce.onDeleteTemplateFolder(e.payload,e.type);break;case"update_template_folder":ce.onUpdateTemplateFolder({folder:e.payload,type:e.type});break;case"update_ifc_annotation":oe.onUpdateIfcAnnotation(e);break;case"update_ifc_annotations":oe.onUpdateIfcAnnotations(e);break;case"delete_annotations":a.a.getProjectIdFromEstimateId()===e.projectId&&a.a.onDeleteAnnotations(e);break;default:console.log("message hander lssr did not handle message: ",e)}}}),n(133)),re=n(113),se=n(182),le=n(34),ce=Object(u.createStore)({listenables:[G.j],init:function(){this.calcTemplates=[],this.activeCalcTemplate={},this.driveTemplates=[],this.activeDriveTemplate={}},onSetCalculateTemplates:function(e){this.calcTemplates=e,this.activeCalcTemplate=e[0],this.trigger("updateCalcTemplates")},onSetDriveTemplates:function(e){this.driveTemplates=e,this.activeDriveTemplate=e[0],this.trigger("updateDriveTemplates")},getCalcTemplates:function(){return this.calcTemplates},getDriveTemplates:function(){return this.driveTemplates},getTemplateIndex:function(e,t){return"drive"===t?this.driveTemplates.findIndex((function(t){return t.id==e})):this.calcTemplates.findIndex((function(t){return t.id==e}))},getActiveCalcTemplate:function(){return this.activeCalcTemplate},setActiveCalcTemplate:function(e){this.activeCalcTemplate=e,this.trigger("updateActiveCalcTemplate")},getActiveDriveTemplate:function(){return this.activeDriveTemplate},setActiveDriveTemplate:function(e){this.activeDriveTemplate=e,this.trigger("updateActiveDriveTemplate")},onAddTemplate:function(e){"drive"===e.type?(0===this.driveTemplates.length&&this.setActiveDriveTemplate(e),this.driveTemplates.push(e),this.trigger("updateDriveTemplates")):(0===this.calcTemplates.length&&this.setActiveCalcTemplate(e),this.calcTemplates.push(e),this.trigger("updateCalcTemplates"))},onDeleteTemplate:function(e){"drive"===e.type?(this.driveTemplates=this.driveTemplates.filter((function(t){return t.id!==e.id})),e.id===this.activeDriveTemplate.id&&(this.activeDriveTemplate=this.driveTemplates[0]),this.trigger("updateDriveTemplates")):(this.calcTemplates=this.calcTemplates.filter((function(t){return t.id!==e.id})),e.id===this.activeCalcTemplate.id&&(this.activeCalcTemplate=this.calcTemplates[0]),this.trigger("updateCalcTemplates"))},onDuplicateTemplate:function(e){"drive"===e.type?(this.driveTemplates.push(e),this.trigger("updateDriveTemplates")):(this.calcTemplates.push(e),this.trigger("updateCalcTemplates"))},onUpdateTemplate:function(e,t){"drive"===e.type?(this.driveTemplates[this.getTemplateIndex(e.id,t)].name=e.name,e.id===this.activeDriveTemplate.id&&(this.activeDriveTemplate.name=e.name),this.trigger("updateDriveTemplates")):(this.calcTemplates[this.getTemplateIndex(e.id,t)].name=e.name,e.id===this.activeCalcTemplate.id&&(this.activeCalcTemplate.name=e.name),this.trigger("updateCalcTemplates"))},onAddTemplateFolder:function(e,t){"drive"===t?(this.driveTemplates[this.getTemplateIndex(e.geoTemplateId,t)].folders.push(e),this.trigger("updateDriveTemplates")):(this.calcTemplates[this.getTemplateIndex(e.geoTemplateId,t)].folders.push(e),this.trigger("updateCalcTemplates"))},onAddCalcTemplateToFolder:function(){N.a.onRequestProject(N.a.getActiveProjectId())},onAddDriveTemplateToFolder:function(){J.a.get("".concat("https://api.geometra.rukkor.io","/files"),{params:{projectId:N.a.getActiveProjectId()},headers:{Authorization:o.a.getJwt()}}).then((function(e){F.a.onBuildTree(e.data),G.g.sendUpdate({action:"get_calculate_templates",companyId:N.a.getActiveProject().toJS().department.company.id}),G.g.sendUpdate({action:"get_drive_templates",companyId:N.a.getActiveProject().toJS().department.company.id})})).catch((function(e){console.log(e)}))},onUpdateTemplateFolder:function(e){var t=e.folder,n=e.type;if("drive"===n){var a=this.getTemplateIndex(t.geoTemplateId,n),o=this.driveTemplates[a].folders.findIndex((function(e){return e.id===t.id}));this.driveTemplates[a].folders[o]=t;var i=this.activeDriveTemplate.folders.findIndex((function(e){return e.id===t.id}));this.activeDriveTemplate.folders[i]=t,this.trigger("updateDriveTemplates")}else{var r=this.getTemplateIndex(t.geoTemplateId,n),s=this.calcTemplates[r].folders.findIndex((function(e){return e.id===t.id}));this.calcTemplates[r].folders[s]=t;var l=this.activeCalcTemplate.folders.findIndex((function(e){return e.id===t.id}));this.activeCalcTemplate.folders[l]=t,this.trigger("updateCalcTemplates")}},onDeleteTemplateFolder:function(e,t){"drive"===t?(this.activeDriveTemplate.folders=e,this.trigger("updateDriveTemplates"),this.trigger("onDeleteTemplateFolder")):(this.activeCalcTemplate.folders=e,this.trigger("updateCalcTemplates"),this.trigger("onDeleteTemplateFolder"))},buildTreeStructure:function(e){var t=[],n=Object(j.map)(Object(j.sortBy)(e,["tag","name"]),(function(e){return{parentId:e.parentId,id:e.id,title:e.name,key:e.id,children:[],name:e.name,templateId:e.geoTemplateId,tag:e.tag}})),a=n.reduce((function(e,t,n){return e[t.id]=n,e}),{});return Object(j.forEach)(n,(function(e){if(null!==e.parentId){var o=n[a[e.parentId]];o.children=[].concat(Object(le.a)(o.children||[]),[e])}else t.push(e)})),t}}),ue=n(132),de=n(38),pe=n(55),ge=Object(u.createStore)({init:function(){this.propertiesCopy=new c.a.Map,this.stylesCopy=new c.a.Map},getPropertiecCopy:function(){return this.propertiesCopy},getStylesCopy:function(){return this.stylesCopy},copyAnnotationProperties:function(){var e=a.a.getTheDisplayAnnot();this.propertiesCopy=this.propertiesCopy.clear(),e&&1===a.a.getNrSelectedAnnotations()&&(this.propertiesCopy=this.propertiesCopy.set(de.p,e.get(de.p)),this.propertiesCopy=this.propertiesCopy.set(de.y,e.get(de.y)),e.has("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")&&(this.propertiesCopy=this.propertiesCopy.set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")).set("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",e.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH"))),e.has("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")&&(this.propertiesCopy=this.propertiesCopy.set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")).set("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",e.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH"))))},pasteAnnotationProperties:function(e){var t=this;if(!this.propertiesCopy.isEmpty()){var n=new c.a.List;e.forEach((function(e){if("group"===e.get("type")){var t=a.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return"group"!==e.get("type")}));n=n.concat(t)}else n=n.push(e)})),(n=n.map((function(e){switch(e.get("type")){case de.w:case de.f:case de.i:case de.z:if(t.propertiesCopy.get(de.p)&&(e=e.set(de.p,t.propertiesCopy.get(de.p))),t.propertiesCopy.get(de.y)&&(e=e.set(de.y,t.propertiesCopy.get(de.y))),t.propertiesCopy.has("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")){var n=new DOMParser,a=new XMLSerializer,o=n.parseFromString(e.get("xfdf"),"text/xml"),i=o.querySelector("annots").firstElementChild;i.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")),i.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")),i.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")),i.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")),i.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH")),e=e.set("xfdf",a.serializeToString(o))}if(t.propertiesCopy.has("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")){var r=new DOMParser,s=new XMLSerializer,l=r.parseFromString(e.get("xfdf"),"text/xml"),c=l.querySelector("annots").firstElementChild;c.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X")),c.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y")),c.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X")),c.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y")),c.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",t.propertiesCopy.get("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")),e=e.set("xfdf",s.serializeToString(l))}break;case de.x:t.propertiesCopy.get(de.p)&&(e=e.set(de.p,t.propertiesCopy.get(de.p))),t.propertiesCopy.get(de.y)&&(e=e.set(de.y,t.propertiesCopy.get(de.y)));break;case de.u:case de.D:case de.j:t.propertiesCopy.get(de.y)&&(e=e.set(de.y,t.propertiesCopy.get(de.y)))}return e}))).size>0&&a.a.onRequestAnnotationUpdateArray(n)}},copyAnnotationStyles:function(){var e=a.a.getTheDisplayAnnot();if(this.stylesCopy=this.stylesCopy.clear(),e&&1===a.a.getNrSelectedAnnotations()){var t=e.get("type")===pe.e||e.get("type")===pe.f?te.a.getCurrentlySelectedNodes().first().toJS().xdf:te.a.getCurrentlySelectedNodes().first().toJS().xfdf,n=a.a.parseStyleFromXfdf(t),o=a.a.parseRichTextStyleFromXfdf(t),i=a.a.parseDefaultStyleFromXfdf(t),r=e.get("type")===de.r?e.getIn(["xfdf",de.e]):e.get(de.e),s=i.font,l=i[de.H];this.stylesCopy=this.stylesCopy.set(de.g,s),this.stylesCopy=this.stylesCopy.set(de.G,l),this.stylesCopy=this.stylesCopy.set(de.c,n),this.stylesCopy=this.stylesCopy.set(de.B,o),this.stylesCopy=this.stylesCopy.set(de.h,e.get(de.h)),this.stylesCopy=this.stylesCopy.set(de.v,e.get(de.v)),this.stylesCopy=this.stylesCopy.set(de.e,r),this.stylesCopy=this.stylesCopy.set(de.E,e.get(de.E)),this.stylesCopy=this.stylesCopy.set(de.s,e.get(de.s)),this.stylesCopy=this.stylesCopy.set(de.n,e.get(de.n)),this.stylesCopy=this.stylesCopy.set(de.k,e.get(de.k)),this.stylesCopy=this.stylesCopy.set(de.F,e.get(de.F)),this.stylesCopy=this.stylesCopy.set(de.m,e.get(de.m)),this.stylesCopy=this.stylesCopy.set(de.l,e.get(de.l)),this.stylesCopy=this.stylesCopy.set(de.q,e.get(de.q))}},pasteBorderStyles:function(e){var t=this.stylesCopy.get(de.c),n=this.stylesCopy.get(de.k),o=this.stylesCopy.get(de.F);if(t){var i=c.a.List.of(e);e=a.a.changeStyle(i,t,!0).first()}if(n||0===n){var r=c.a.List.of(e);e=a.a.changeGeometraBorderOpacity(r,n,!0).first()}if(o&&!Number.isNaN(o)){var s=c.a.List.of(e);e=a.a.changeStrokeThickness(s,o,!0).first()}return e},pasteDefaultStyles:function(e){if(this.stylesCopy.get(de.s)){var t=c.a.List.of(e);e=a.a.changeInteriorColor(t,this.stylesCopy.get(de.s),!0).first()}if(this.stylesCopy.get(de.e)){var n=c.a.List.of(e);e=a.a.changeColor(n,this.stylesCopy.get(de.e),!0).first()}if(this.stylesCopy.get(de.n)){var o=c.a.List.of(e);e=a.a.changeGeometraOpacity(o,this.stylesCopy.get(de.n),!0).first()}return e},pasteTextStyles:function(e){var t=this;return Object(Z.a)(Y.a.mark((function n(){var o,i,r,s,l,u,d,p,g,h;return Y.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!t.stylesCopy.get(de.B)){n.next=6;break}return o=c.a.List.of(e),n.next=4,a.a.setRichTextStyle(o,t.stylesCopy.get(de.B),!0);case 4:i=n.sent,e=i.first();case 6:if(!t.stylesCopy.get(de.E)){n.next=12;break}return r=c.a.List.of(e),n.next=10,a.a.changeStrokeColor(r,t.stylesCopy.get(de.E),!0);case 10:s=n.sent,e=s.first();case 12:return t.stylesCopy.get(de.G)&&(l=c.a.List.of(e),u=a.a.changeTextStyle(l,de.H,"".concat(t.stylesCopy.get(de.G)),!0),e=u.first()),t.stylesCopy.get(de.g)&&(d=c.a.List.of(e),p=a.a.changeTextStyle(d,de.g,"".concat(t.stylesCopy.get(de.g)),!0),e=p.first()),t.stylesCopy.get(de.h)&&(g=c.a.List.of(e),h=a.a.changeFontSize(g,t.stylesCopy.get(de.h),!0),e=h.first()),n.abrupt("return",e);case 16:case"end":return n.stop()}}),n)})))()},pasteLineStyles:function(e){if(this.stylesCopy.get(de.m)){var t=c.a.List.of(e);e=a.a.changeAnnotationAttribute(t,de.m,this.stylesCopy.get(de.m),!0).first()}if(this.stylesCopy.get(de.l)){var n=c.a.List.of(e);e=a.a.changeAnnotationAttribute(n,de.l,this.stylesCopy.get(de.l),!0).first()}return e},pastePointStyles:function(e){if(this.stylesCopy.get(de.v)&&!Number.isNaN(this.stylesCopy.get(de.v))){var t=c.a.List.of(e);e=a.a.changePointSize(t,this.stylesCopy.get(de.v),!0).first()}if(this.stylesCopy.get(de.q)){var n=c.a.List.of(e);e=a.a.changeIconType(n,this.stylesCopy.get(de.q),!0).first()}return e},pasteAnnotationStyles:function(e){var t=this;return Object(Z.a)(Y.a.mark((function n(){var o,i,r,s,l,u;return Y.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(t.stylesCopy.isEmpty()){n.next=12;break}return o=new c.a.List,e.forEach((function(e){if("group"===e.get("type")){var t=a.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return"group"!==e.get("type")}));o=o.concat(t)}else o=o.push(e)})),i=o.filter((function(e){return"3DModel"!==e.get("type")})),(r=o.filter((function(e){return"3DModel"===e.get("type")}))).size>0&&oe.changeIfcStyles(de.e,t.stylesCopy.get(de.e),r),s=i.map(function(){var e=Object(Z.a)(Y.a.mark((function e(n){return Y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.get("type"),e.next=e.t0===de.w||e.t0===de.f||e.t0===de.i||e.t0===de.z||e.t0===de.D?3:e.t0===de.j?6:e.t0===de.x||e.t0===pe.f||e.t0===pe.e||e.t0===de.a?12:e.t0===de.u?16:19;break;case 3:return n=t.pasteDefaultStyles(n),n=t.pasteBorderStyles(n),e.abrupt("break",20);case 6:return e.next=8,t.pasteTextStyles(n);case 8:return n=e.sent,n=t.pasteDefaultStyles(n),n=t.pasteBorderStyles(n),e.abrupt("break",20);case 12:return n=t.pasteDefaultStyles(n),n=t.pasteBorderStyles(n),n=t.pasteLineStyles(n),e.abrupt("break",20);case 16:return n=t.pasteDefaultStyles(n),n=t.pastePointStyles(n),e.abrupt("break",20);case 19:return e.abrupt("break",20);case 20:return e.abrupt("return",n);case 21:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),l=s.toJS(),n.next=10,Promise.all(l);case 10:(u=n.sent).length>0&&a.a.onRequestAnnotationUpdateArray(u);case 12:case"end":return n.stop()}}),n)})))()}})},508:function(e,t,n){"use strict";(function(e){var a=n(25),o=n(29),i=n(43),r=n(44),s=n(0),l=n.n(s),c=n(179),u=n(431),d=n(85),p=n(284),g=n(12),h=n(63),m=n(16),f=n(10),A=n(288),E=n(24),T=n(5),S=n(158),b=n(592),I=(n(845),n(104)),y=function(t){Object(i.a)(h,t);var n=Object(r.a)(h);function h(e){var t;return Object(a.a)(this,h),(t=n.call(this,e)).state={isQuickSwitchDialogOpened:!1,feedbackDialog:!1,changelogDialog:!1,appSearch:"",activeFileId:null,fileList:new f.a.List,activeFileFolderPath:[],activeProject:null,companyName:null,geoEstimateName:null,treeData:null,isCommentsEnable:"false"!==localStorage.getItem("showComments")},t.annotationStoreUpdated=function(e){"documentLoaded"===e&&(t.loadData(),t.getActiveFileFolderPath())},t.headerStoreUpdated=function(e){"appSearchUpdated"===e&&t.setState({appSearch:T.j.getAppSearch()}),"focusSearchInput"===e&&t.searchRef.current.focus(),"showFeedbackDialog"===e&&t.onChangeFeedbackDialog()},t.estimateStoreUpdated=function(e){"updateEstimates"===e&&t.loadData()},t.fileStoreUpdated=function(e){"treeDataUpdated"===e&&t.loadDataForIFCFile()},t.projectsStoreUpdated=function(e){"projectAdded"===e&&t.state.activeProject&&T.m.getProjectById(parseInt(t.props.match.params.projectId,10))&&t.loadData()},t.logOut=function(){T.m.clearProjects(),T.l.closeSocket(),localStorage.removeItem("credentials"),localStorage.removeItem("jwt"),sessionStorage.clear(),t.props.history.push("/")},t.handleChange=function(e){T.j.setAppSearch(e.target.value)},t.getActiveFileFolderPath=function(){var e=-1===T.a.getActiveFileId()?parseInt(t.props.match.params.fileId,10):T.a.getActiveFileId(),n=Object(S.a)(e);t.setState({activeFileFolderPath:n})},t.renderDriveFolderPath=function(){var e=t.state.activeFileFolderPath.join(" > ");return e.length>100&&(e=" ... > "+t.state.activeFileFolderPath[t.state.activeFileFolderPath.length-1]),e},t.getActiveFile=function(){var e=-1===t.state.activeFileId?parseInt(t.props.match.params.fileId,10):t.state.activeFileId;return t.state.fileList?Object(g.get)(Object(g.find)(t.state.fileList,(function(t){return t.key===e})),"filename"):null},t.renderTitle=function(){var e="/projects/:projectId/calculate/:fileId"===t.props.match.path,n="/projects/:projectId/drive"===t.props.match.path,a="/projects"===t.props.match.path,o="/projects/:projectId/overview"===t.props.match.path,i=t.state.activeProject&&t.state.activeProject.get("name"),r=t.state.activeProject&&t.state.activeProject.get("projectNumber"),s="(".concat(r,") ").concat(i),c=a||o?t.props.departList.toJS().find((function(e){return e.department.id===t.props.selectedDepartId})):void 0,u=null===c||void 0===c?void 0:c.department.company.name,d=t.state.activeProject&&0!==t.state.activeFileFolderPath.length&&t.state.activeFileId&&t.state.fileList&&t.state.companyName,p=t.state.companyName,h=u&&c,m=u&&t.state.activeProject;return e&&d?l.a.createElement(A.a,{projectDetails:[t.state.companyName,s,t.state.geoEstimateName],onChangeQuickSwitch:t.onChangeQuickSwitchDialog,activeFile:t.getActiveFile(),fileId:t.state.activeFileId,activeFilePath:t.state.activeFileFolderPath}):n&&p&&!Object(g.isEmpty)(t.props.selectedNode)?l.a.createElement(A.c,{projectDetails:[t.state.companyName,s,t.state.geoEstimateName],onChangeQuickSwitch:t.onChangeQuickSwitchDialog,selectedNode:t.props.selectedNode,treeData:t.state.treeData,onNodeBack:t.props.onNodeBack}):a&&h?l.a.createElement("div",null,u):o&&m?l.a.createElement("div",null,"".concat(u," > ").concat(s)):""},t.onChangeFolderDialog=function(){t.setState({isQuickSwitchDialogOpened:!1})},t.onChangeFeedbackDialog=function(){t.setState({feedbackDialog:!t.state.feedbackDialog})},t.onChangelogDialog=function(){t.setState({changelogDialog:!t.state.changelogDialog})},t.onChangeQuickSwitchDialog=function(){t.setState({isQuickSwitchDialogOpened:!t.state.isQuickSwitchDialogOpened})},t.onDoubleClickDriveHandler=function(e){t.onChangeFolderDialog(),t.props.onDoubleClickDrive(e)},t.loadDataForIFCFile=function(){var e=parseInt(t.props.match.params.fileId,10),n=T.i.getFileById(e),a=Object(g.get)(n,"type"),o="/projects/:projectId/calculate/:fileId"===t.props.match.path,i=T.i.getRootFolder();o&&i&&"ifc"===a&&(t.getActiveFileFolderPath(),t.loadData())},t.loadDataForOverviewPage=function(){"/projects/:projectId/overview"===t.props.match.path&&T.m.getActiveProject()&&t.loadData()},t.searchRef=Object(s.createRef)(),t}return Object(o.a)(h,[{key:"componentDidMount",value:function(){this.unsubscribeHeaderStore=T.j.listen(this.headerStoreUpdated),this.unsubscribeAnnotaiotnStore=T.a.listen(this.annotationStoreUpdated),this.unsubscribeEstimateStore=T.f.listen(this.estimateStoreUpdated),this.unsubscribeFileStore=T.i.listen(this.fileStoreUpdated),this.unsubscribeProjectsStore=T.m.listen(this.projectsStoreUpdated),this.loadDataForIFCFile(),this.loadDataForOverviewPage()}},{key:"componentDidUpdate",value:function(e){e.isLoading===this.props.isLoading&&e.selectedNode===this.props.selectedNode&&e.activeProject===this.props.activeProject||this.loadData()}},{key:"componentWillUnmount",value:function(){T.j.setAppSearch(""),this.unsubscribeHeaderStore(),this.unsubscribeAnnotaiotnStore(),this.unsubscribeEstimateStore(),this.unsubscribeFileStore(),this.unsubscribeProjectsStore()}},{key:"loadData",value:function(){var e,t,n=this,a=T.m.getProjectById(parseInt(this.props.match.params.projectId,10)),o=null===a||void 0===a?void 0:a.toJS(),i=null===o||void 0===o||null===(e=o.department)||void 0===e||null===(t=e.company)||void 0===t?void 0:t.name,r=T.f.getActiveEstimate(),s=T.i.getTreeData();this.setState({fileList:T.i.getAllSortedFilesList(),activeFileId:T.a.getActiveFileId(),activeProject:a,companyName:i,geoEstimateName:r.name,treeData:s},(function(){return n.renderTitle()}))}},{key:"switchCommentsStatus",value:function(){var e=this.state.isCommentsEnable;localStorage.setItem("showComments",!e),this.setState({isCommentsEnable:!e}),!1===!e?window.Tawk_API.hideWidget():window.Tawk_API.showWidget()}},{key:"render",value:function(){var t=this,n=this.props.t,a=this.state.isCommentsEnable,o=T.b.getUser(),i=l.a.createElement(c.a,{className:"Calculate_Rows_ContextMenu"},l.a.createElement(c.a.Item,{key:"2",onClick:function(){return t.props.history.push("/forgot-password/".concat(e.from(o).toString("base64"),"/changePassword"))}},l.a.createElement(m.a,{icon:["fal","user-shield"]}),n("Change password")),l.a.createElement(c.a.Item,{key:"1",onClick:this.logOut},l.a.createElement(m.a,{icon:["fal","sign-out"]}),n("Sign out")));return l.a.createElement(I.ErrorBoundary,{FallbackComponent:E.e},l.a.createElement("div",{className:"Header"},this.state.isQuickSwitchDialogOpened&&l.a.createElement(E.f,{visible:this.state.isQuickSwitchDialogOpened,onCancel:this.onChangeFolderDialog,top:!0,title:"QuickSwitch",withFilter:!0,type:"estimate",onDoubleClickDrive:this.onDoubleClickDriveHandler}),this.state.feedbackDialog&&l.a.createElement(A.d,{visible:this.state.feedbackDialog,onCancel:this.onChangeFeedbackDialog}),this.state.changelogDialog&&l.a.createElement(A.b,{visible:this.state.changelogDialog,onCancel:this.onChangelogDialog}),l.a.createElement("div",{className:"Header_Wrapper--left"},l.a.createElement("img",{src:"/logo.png",className:"Header_Logo",alt:"Logo"}),l.a.createElement(u.a,{ref:this.searchRef,value:this.state.appSearch,onChange:this.handleChange,type:"search",placeholder:n("Search"),prefix:l.a.createElement(m.a,{icon:["fal","search"]})})),l.a.createElement("div",{className:"Header_Title"},this.renderTitle()),l.a.createElement("div",{className:"Header_Buttons_Wrapper"},l.a.createElement(d.a,{icon:l.a.createElement(m.a,{icon:["fal","bullhorn"]}),onClick:this.onChangelogDialog}),l.a.createElement(d.a,{icon:l.a.createElement(m.a,{icon:["fal","comments"]}),className:"".concat(a&&"Toolbar_Button--active"),onClick:function(){return t.switchCommentsStatus()}}),l.a.createElement(d.a,{icon:l.a.createElement(m.a,{icon:["fal","paper-plane"]}),onClick:this.onChangeFeedbackDialog}),l.a.createElement(p.a,{overlay:i,trigger:["click"],className:"Dropdown_Container"},l.a.createElement(d.a,{icon:l.a.createElement(m.a,{icon:["fal","user"]})})))))}}]),h}(l.a.PureComponent);t.a=Object(b.a)()(Object(h.i)(y))}).call(this,n(98).Buffer)},538:function(e,t,n){e.exports=n.p+"static/media/iconBaselineNewReleases24px.c7bde415.svg"},539:function(e,t,n){e.exports=n.p+"static/media/baselineRemoveCircleOutline24px.53331efa.svg"},540:function(e,t,n){e.exports=n.p+"static/media/baselineRoom24px.5ac4d08e.svg"},541:function(e,t,n){e.exports=n.p+"static/media/baselineStarRate24px.6292b7a8.svg"},542:function(e,t,n){e.exports=n.p+"static/media/baselineToys24px.a01b5d45.svg"},543:function(e,t,n){e.exports=n.p+"static/media/circle-pipe.81f70a1a.svg"},544:function(e,t,n){e.exports=n.p+"static/media/circle.955b893c.svg"},545:function(e,t,n){e.exports=n.p+"static/media/gt-pipe-dash.f1f1a966.svg"},546:function(e,t,n){e.exports=n.p+"static/media/gt-pipe.52b0b687.svg"},547:function(e,t,n){e.exports=n.p+"static/media/lt-pipe-dash.5d218274.svg"},548:function(e,t,n){e.exports=n.p+"static/media/lt-pipe.db4d08e0.svg"},549:function(e,t,n){e.exports=n.p+"static/media/none.28602caf.svg"},55:function(e,t,n){"use strict";n.d(t,"f",(function(){return a})),n.d(t,"e",(function(){return o})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return l}));var a="y-scale",o="x-scale",i="length",r="lengthX",s="lengthY",l=1},550:function(e,t,n){e.exports=n.p+"static/media/pipe.4ff7fd83.svg"},551:function(e,t,n){"use strict";(function(e){var a=n(30),o=n(25),i=n(29),r=n(43),s=n(44),l=n(0),c=n.n(l),u=n(48),d=n.n(u),p=n(63),g=n(260),h=n(431),m=n(85),f=n(592),A=n(77),E=n(5),T=n(35),S=n(190),b=n(24),I=(n(2593),function(t){Object(r.a)(l,t);var n=Object(s.a)(l);function l(){var e;return Object(o.a)(this,l),(e=n.call(this)).errorStoreUpdated=function(t){switch(t){case A.b.UN_AUTHORIZED:e.setState({wrongPassword:!0}),e.formRef.current.validateFields();break;case A.b.PAYMENT_REQUIRED:e.setState({invalidLicense:!0}),e.formRef.current.validateFields();break;case A.b.TOO_MANY_REQUESTS:e.setState({tooManyLogins:!0})}},e.authenticationStoreUpdated=function(t){switch(t){case A.b.UN_AUTHORIZED:e.setState({wrongPassword:!0}),e.formRef.current.validateFields();break;case A.b.PAYMENT_REQUIRED:e.setState({invalidLicense:!0}),e.formRef.current.validateFields();break;case A.b.TOO_MANY_REQUESTS:e.setState({tooManyLogins:!0});break;case"setUserData":return E.b.getTermsOfSeriveData()?e.props.history.push("/projects"):e.props.history.push("/termsOfService")}},e.onLogin=function(){if(e.state.username&&e.state.password)try{T.b.login(e.state.username.toLowerCase(),e.state.password)}catch(t){console.error(t)}},e.onKeyDown=function(t){"Enter"===t.key&&e.state.loginFilled&&e.onLogin()},e.handleChange=function(t,n){e.setState(Object(a.a)({},n,t.target.value)),e.setState(Object(a.a)({},t.target.id,t.target.value),(function(){e.state.username.length>0&&e.state.password.length>0&&e.setState({loginFilled:!0})})),e.setState({wrongPassword:!1})},e.formRef=c.a.createRef(),e.state={wrongPassword:!1,invalidLicense:!1,tooManyLogins:!1,loginFilled:!1,username:"",password:"",switchCard:!0},e}return Object(i.a)(l,[{key:"componentDidMount",value:function(){this.stores=[E.b],this.unsubscribeAuthenticationStore=E.b.listen(this.authenticationStoreUpdated),this.unsubscribeErrorStore=E.e.listen(this.errorStoreUpdated)}},{key:"componentWillUnmount",value:function(){this.unsubscribeAuthenticationStore(),this.unsubscribeErrorStore()}},{key:"render",value:function(){var t=this,n=this.props.t;return c.a.createElement(c.a.Fragment,null,this.state.switchCard?c.a.createElement(b.i,{cardTitle:"Login"},c.a.createElement("div",{className:"Login_Container"},c.a.createElement("label",{htmlFor:"username",className:"Login_Container_Label"},n("Email")),c.a.createElement(g.a,{name:"login-form",onFinish:function(){return t.setState({switchCard:!1})}},c.a.createElement(g.a.Item,{name:"username",rules:[{pattern:S.a,message:n("Please enter a valid email.")}],validateTrigger:"onBlur"},c.a.createElement(h.a,{id:"username",name:"username",autoComplete:"username",className:"Input",value:this.state.username,onChange:function(e){return t.handleChange(e,"username")},onKeyDown:this.onKeyDown})),c.a.createElement(g.a.Item,null,c.a.createElement(m.a,{className:"LoginWrapper_Card_Button",type:"primary",htmlType:"submit",disabled:""===this.state.username,id:"login-form_login-button"},n("Log in")))),c.a.createElement(m.a,{className:"LoginWrapper_Card_Button LoginWrapper_Card_Button_Default",type:"link",onClick:function(){return t.props.history.push("/signup")}},n("Sign up")))):c.a.createElement(b.i,{cardTitle:"Password"},c.a.createElement("div",{className:"Login_Container"},c.a.createElement("label",{className:"Login_Container_Subtitle"},this.state.username),c.a.createElement("label",{htmlFor:"password",className:"Login_Container_Label"},n("Password")),c.a.createElement(g.a,{ref:this.formRef,onFinish:this.onLogin,name:"password-form"},c.a.createElement(g.a.Item,{name:"password",validateFirst:!0,rules:[{pattern:S.b,message:n("Please enter a valid password")},{validator:function(){return t.state.wrongPassword?Promise.reject(n("Incorrect Username and/or Password")):t.state.invalidLicense?Promise.reject(n("License Expired")):Promise.resolve()}}],validateTrigger:"onBlur"},c.a.createElement(h.a.Password,{className:"Input",value:this.state.password,onChange:function(e){return t.handleChange(e,"password")},onKeyDown:this.onKeyDown,name:"password"})),c.a.createElement(g.a.Item,null,c.a.createElement(m.a,{className:"LoginWrapper_Card_Button",type:"primary",htmlType:"submit",id:"login-form_login-button"},n("Log in")))),c.a.createElement(m.a,{className:"LoginWrapper_Card_Button LoginWrapper_Card_Button_Default",type:"link",onClick:function(){return t.props.history.push("/forgot-password/".concat(e.from(t.state.username).toString("base64"),"/forgotPassword"))}},n("Forgot Password")),c.a.createElement(m.a,{className:"LoginWrapper_Card_Button LoginWrapper_Card_Button_Default",type:"default",onClick:function(){return t.setState({switchCard:!0,username:"",wrongPassword:!1})}},n("Back")))))}}]),l}(d.a.PureComponent));t.a=Object(f.a)()(Object(p.i)(I))}).call(this,n(98).Buffer)},552:function(e,t,n){"use strict";(function(e){var a=n(0),o=n.n(a),i=n(87),r=n.n(i),s=n(85),l=n(422),c=n(24),u=n(63);n(2596);t.a=function(){var t=Object(l.a)().t,n=Object(u.g)().push,i=Object(u.h)(),d=i.eMail,p=i.action,g=e.from(d,"base64").toString("ascii").toLowerCase();Object(a.useEffect)((function(){"forgotPassword"!==p&&"changePassword"!==p||r.a.post("".concat("https://api.geometra.rukkor.io","/reset_password"),{eMail:g,url:window.location.origin})}),[]);return o.a.createElement(c.i,{cardTitle:function(){switch(p){case"forgotPassword":return"Forgot Password";case"changePassword":return"Change password";default:setTimeout((function(){return n("/login")}),250)}}()},o.a.createElement("div",{className:"Forgot_Password_Content"},t("We\u2019ve sent you an email with a link and instructions on how to reset your password. Please check your email and any spam folders just in case.")),o.a.createElement(s.a,{className:"LoginWrapper_Card_Button",type:"primary",onClick:function(){return n("/login")}},t("Back to Login")))}}).call(this,n(98).Buffer)},553:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));Boolean("localhost"===window.location.hostname||"[::1]"===window.location.hostname||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function a(){"serviceWorker"in navigator&&navigator.serviceWorker.ready.then((function(e){e.unregister()})).catch((function(e){console.error(e.message)}))}},568:function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAABECAYAAADjhPvVAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAr5SURBVHgB7Z0LtBVVHca/i4ShaEkPswzxVa5MSiMRhdRU6LFcWCttlbjMRz6WqGTQNcN0+UBDJR8LlEqNDGK16IUktSwxswxLSggolbpqPkoRLxpPcfw+Zs51zr7zOI+Zc2eO/99a35oze/bsc2bO/s/sx3/v3YEEPM/bnpvjqDHUSGoPagcYxhuXjdQT1D3U/R0dHXOSIndEBdKw+nFzBnUhfKMyDCOaLmo6NYPG9qp7sJeB0bhkUD+lDoJhGLWygjqeRrYqHFhlYDSuQ7hZSL0NhmHUy4vUSBrZPyoBPQZG49qTm/upd8MwjEZ5lhpNI3tMO9sMjMalhotl1N4xJ22h5lMrqaeoV1EO+sO/plHUaBhGa1hCjaWRdfcPAiYi3rhmUlMYeS1KDB8iw7j5AfUhGEa+jKDOoaZ2MOO9nR8eooZERDyfhnUj2oSg22Ee/K4Hw8iTF6i91RyvzBZlXNPaybgEr2cTNydRD8Mw8mUwNV4G9tmIgyoOXoI2hEb2MjdfgWHkz5EysBERB25nRtyI9uUB6lEYRr4cIwMbHHHgAbQxwcPjVzCMfNmpX8yBf6H9+Q8MI2fiDGwr2p+y9OUZJaYfDMPIDTMww8gRMzDDyBEzMMPIkUwMzPO8oV4+bKZWUQuoLwduXUbtyI90t5AuRTZMDaWp0RfXwYik6G+wN1H7UcdS36FW08iuCbz/jXRWsc/v2Yq4vxrZ8GQo3We4/xiMSMpWRNyZmkQt11sThlFwyloH24taTCN7LwyjwJS5kWMo9Usa2ZthGAWl7K2IB1BnwzAKSn9kACu6XXyT7Ibs0dvpg9QURHv9i05+9038Da/AMApGJgYmglaqPOiiFtKINPjz3Ijju1LjqJ/AMApGmYqI51N/jTn2SRhGASmNgfEN6XETN4XBITCMAlK2Ro7lMeE7wjAKSNkMbGBMeDtPb2CUmLIZ2KiY8P/CMApIZq2IeRO4Rk2OOfwgisPT1F3wp114MgiTQ6x8Kg+H74VSQV0LS/H66Op3OsfjeB7V/n9K+61ong3Un1E92ntf6j1ojm74U+WF09VvflfKeX+n7oU/b+cj8POrrvMj8B+2R6Cxl8Rm+GswaKbqf1PrKTmSa/JddQeNRFbEeLEXavZbzcpLPZLgdX9AnUkqzUletmygTqYGJXznwc45v3COH1jbV3njnfMmxMSb4MQbn5DmVuoDEb95cUTcs5w4ZyWk+xy1uxN/R2pFwjl/oj6G9P9wH+pWrz5mUINT0v2nlxGZvMGYjp4qpyN79Pv2hz85alzGfZAtjMvRt2hCU62q8beUeG4GXu/sb0DfcTV//8pwAP/XTvhviWa4kum6EwxdjN73osIM6gKesxkpBAssnMbfeR+330c6F/OcK5IiMK13IMMFULIqIsrArkHfMBl9z8QajEu8D8VExdTLwwHMaCrCXYrmWMD7cr2T7me46YyJP53xv4o64Tmzma4WMrk9IdqdacYVoCLxIGREaepgMdzAm3Yf+hZ5sNzmBvIPP5KbT8Nv+VQdRG+HcSgeeoseH55o1vPn8L8TvqtaozxHnRkOCIpm02PiP07d4AZ6vjO37uNR8McHqs40V+55TtTZ1BepY2LSvz4i7aHcnAy/7rspSPv9yJAyG9hs3uSJ6Ht+6xZn+Mfdys2pKAdX8Pe782DeTO2D5pgQdp8L3jA/gj8KIopZjP9EOMDz69ZaA9mtY1/OY1cx/pRKgBwRiPaPRu+VW/WAW+ykrXrsHciZMnrTa275a3lDv4RiUFX/8/xVQstiXIt5H68KB/D364l+CprjNqb7YyfsImpMwjl3OL9DC5LIKKIasJRvv8E4U51wFXVXRMRfGXgChbkMLaBsBqY/7SjerCLUuyo85ewfiOKiJU67AmmZ06oHQVBk+hbqJ5yumuMvctJV03fSghsrIhpCNM9H2lLGk5l2z7p2wYiKP0bEe9n5PWqS3xMtIKsioi7gh6gflfXVanMwVcs8G8t4E4vU5yW2OPtvQUHhvVPfz8KEKFqgcFfUn67WXJsXdYyZeWCQbpKxPB1xzrFIR/n38/An4akQ1aLszlSdWSNGGlmNB1PH50loEN5QVV5VkdVwlI8nRL2McZfz+xbAyBTeV7118lhmV2+itNZT1xNH/bDbozbcuuILKBCFKCLSYLZQP6fUUqQ+rzUxUfV7v83MsBPak1rny3frE1n8j48jHxpxY9tUR1y3BFGoNQcKVwejkcm74VA4xYYQciXqRHuwnbPfjdpw4w2s5SQ+mAZQgwJVncP7rta6+WgAJ90BzmH1PT2UksTuzr7qcetRG24LaJr7VUspZCMH/2z5nanFKe7pN9FLcEkqEVUZi9et632+hvOWOfu1dmCfQL0UqNvr7RJ3GvU/1M+poXTlGtVT3+I1bQ2+N6notkd4h+foLfQz1Ibb1D4KBaKwrYi8yWpu/WbMYY3/aodRzHsxM7qNItNTzpnj9heR4agf1XtnhgOY7jr4Swp7aBzNXTnXSVdvmfMSzhnC++DWpTT/ZReSmcK03ZLOfigQRW+m/y7ipwk4DuVHLXZjnTB5HMyJiS+vFdeB96PcDENjHMrzq6a9Zob9A+IfbLUyhum6zfIyuriWZhWVT3F+hzqp5Q2zNCK+ugUmMc6V4UB+p+rw+6NAFNrAgs7BWTGHjw68A8rOBWGna17zBkpeBioiT4Pv/SCjU7P1WB570Tn/XDTHGfx+d3jGtYjusK2HTi80+3LwX54D3x0pirMZ3y0qdlEamvIpSh3ieuBqbpbhDK96MPBc5eVpKBhlcJW6KyZc/mOq0D6DcqNOWM3teFM4kBnobm7uTjqRmepzaKJ7JEB12VlMazS/szv47o3cVxFc47F2RmPo7TyX6RxW8aJQEZT7KoKqM9htmNmFuoXHT2C8l8IHuL+Im0Up36e32UEoGIX35ODN1aDFuCbkXdAe3MiMVdebyPPHS30P2SB3pK+HA4L7fh6aQ2/GSU66GnUwMyb+J6hFvLa6/lfGl/fJ11BAyuIqFbd6RxG8JtzBewPQGDKyeVRiHUKuQZRWmtHbLe363ZbWpMmBVKT7QjhAw0Dge9W7uNeYNIDxEqY7zElXRndvTPzDqKU85/S0lmIeP4L6HXzjSsrL7nW3bHWebS7IEeEf5k14GG0ML1t/chZj2ORJvy60r0zR7Hz5S+A7uqrJ/P/wM7QGAapBQ54u9TwYw83+6qBP85BQJ384T+yA3hnSveZa0nW7HzSGMK2Ksha+gT8afFansu6vWhzlNb8vaid8XVHXlAtmYIaRI7aErGHkiBmYYeSIGZhh5EicgW2H9sceLkbuxGWyIWh/bPlZI3dkYOsiwvMYeFcYArea1IktDaNJ1iij/SbiwInueKE2Q52ZjTrIGkatLJGB3RNxQH5kLZl1p9UEw0NugWHkz/yOYNrr1Yh2d7mQHc6NzDJUSIK5P+RUeyYMI1+6qOH9guEP18VEupqZUh7Omc3V3VfwGrSYuvzWzLiMVnAzbWvNtvFUQbHp1/CHTkQhfzjV1bS0jUaQNjPitdVo/jt5dUfN+GoYeaCxdBqztrEnwwVDtn+Pgk0aYhglQ0OrDqdxbRti1dMPFiwFoyHaa2EYRiNoDN24inGJqo5mHtB0ymrCbna4uGG80VD1aYQ7CqWXJwcjrILfR6TRrF0wDCMJLUulaRtkXL2mr0it9LNudiJ8zw6tLzwUzQ8mbCWaXy91pUTDqANNiKp5O/8Cv2FwUTD3YySvAS1aQZJgnPltAAAAAElFTkSuQmCC"},57:function(e,t,n){"use strict";var a=n(109),o=n(316),i=n(30),r=n(34),s=n(28),l=n(26),c=n.n(l),u=n(47),d=n(0),p=n.n(d),g=n(48),h=n(12),m=n(212),f=n.n(m),A=n(87),E=n.n(A),T=n(309),S=n(161),b=n(19),I=n(60),y=n(156),v=n(238),N=n(196),O=n(35),w=n(45),P=n(317),R=n(182),L=n(318),C=n(162),_=n(37);t.a=Object(g.createStore)({listenables:[y.a],init:function(){this.currentFolder=void 0,this.previewReady=!1,this.lastViewedPageNr=1,this.fileLoaderData={wanted:10,loaded:0,isLoading:!0},this.fileLoaderDataDrive={wanted:100,loaded:0,isLoading:!0,annotsCount:0,estimateCount:-1},this.multipleFliesDataLoader={uploadingFiles:!1,filesName:[],wanted:0,loaded:0,uploadingPDFwithAnnots:!1},this.expandedKeys=[],this.selectedFileNodes=[],this.treeData=[],this.uploadedPdfFile={},this.detectedAnnotationsLength=null,this.files=[],this.treeList=[],this.pdfsArrGenerator=null,this.otherArrGenerator=null,this.activePage=-1,this.checkedItemsIds=[],this.element=void 0,this.currentToolMode="AnnotationEdit",this.previousToolMode=null,this.isHotkeyLongPress=!1},initWebViewer:function(e,t){var n=this;return Object(u.a)(c.a.mark((function a(){var o,i;return c.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,new f.a({type:"html5,html5Mobile",path:"/webviewer",showLocalFilePicker:!1,showToolbarControl:!1,showPageHistoryButtons:!1,hideAnnotationPanel:!0,l:"Rukkor AB(rukkor.com):OEM:Geometra::B+:AMS(20220604):BBA5883D0427060A7360B13AC982737860614F9BFF68AD1BBD72558495873E8E4AB431F5C7",annotationUser:I.a.getUserId(),enableAnnotations:!0,backgroundColor:"#333333",autoCreate:!0,fullAPI:!0,isAdminUser:!0,streaming:!1,enableOfflineMode:!1,annotationAdmin:!0,serverUrl:null,useDownloader:!1,isReadOnly:!0,disabledElements:["contextMenuPopup","annotationStylePopup","annotationDeleteButton","toolsOverlay","searchOverlay","toolbarGroup-Shapes","toolbarGroup-Edit","toolbarGroup-Insert","linkButton","menuOverlay","toolsHeader","pageNavOverlay"]},e);case 2:n.webViewer=a.sent,o=n.webViewer.annotManager,n.element=e,n.webviewerInit=new L.a(n.webViewer),n.webviewerInit.init(),n.reloadFileView(n.getSelectedFiles()),n.webViewer.docViewer.on("documentLoaded",Object(u.a)(c.a.mark((function e(){return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.loadAnnotations();case 2:n.trigger("documentLoaded");case 3:case"end":return e.stop()}}),e)})))),n.webViewer.docViewer.on("annotationsLoaded",Object(u.a)(c.a.mark((function e(){var a,i,r,s;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=13;break}if(!o.getAnnotationsList().length){e.next=12;break}return a=o.getAnnotationsList(),i=Object(h.map)(a,(function(e){return o.exportAnnotations({annotList:[e]})})),e.next=6,Promise.all(i);case 6:r=e.sent,s=Object(h.filter)(r,(function(e){var t,n=(new DOMParser).parseFromString(e,"text/xml");return null===(t=Object(h.get)(n.querySelector("annots"),"firstElementChild"))||void 0===t?void 0:t.tagName})),n.detectedAnnotationsLength=s.length,n.trigger("showWebViewerImportDialog"),e.next=13;break;case 12:Object(h.isEmpty)(n.uploadedPdfFile)||(n.multipleFliesDataLoader.uploadingFiles||n.initLoaderForSinglePDFUpload(),n.onUploadFile(n.uploadedPdfFile),n.uploadedPdfFile={});case 13:case"end":return e.stop()}}),e)})))),n.webViewer.docViewer.on("pageNumberUpdated",(function(){n.setActivePage(n.webViewer.getCurrentPageNumber())})),(i=n.element.querySelector("iframe").contentWindow.document).querySelector("body").addEventListener("keydown",C.a),i.querySelector("body").addEventListener("mousedown",C.b),i.querySelector("body").addEventListener("mouseup",C.c),n.webViewer.docViewer.on("keyDown",(function(e){Object(C.a)(e)}));case 16:case"end":return a.stop()}}),a)})))()},setCheckedItemsIds:function(e){this.checkedItemsIds=e},getCheckedItemsIds:function(){return this.checkedItemsIds},setActivePage:function(e){this.activePage=e,this.trigger("drivePageChanged")},showDeleteConfirmation:function(){this.trigger("showDeleteConfirmation")},onOpenFolderModal:function(){this.trigger("openFolderModal")},onOpenUploadModal:function(){this.trigger("openUploadModal")},onDownloadFile:function(){this.trigger("downloadFile")},onOpenInCalculate:function(){this.trigger("openInCalculate")},onExpandAll:function(){this.trigger("expandAll")},onCollapseAll:function(){this.trigger("collapseAll")},getActivePage:function(){return this.activePage},getTreeData:function(){return this.treeData},getTreeList:function(){return this.treeList},getUploadedPdfFile:function(){return this.uploadedPdfFile},getDetectedAnnotationsLength:function(){return this.detectedAnnotationsLength},getLastViewedPageNr:function(){return this.lastViewedPageNr},getSelectedFiles:function(){var e=this;return[Object(h.find)(this.treeList,(function(t){return t.id===Object(h.get)(e.selectedFileNodes[0],"key")}))]},onSetSelectedFileNodes:function(e){this.selectedFileNodes=e,this.trigger("filesUpdated")},getFileById:function(e){return Object(h.find)(this.treeList,(function(t){return t.id===e}))},getChildren:function(e){return this.treeList.filter((function(t){return t.parentId==e}))},getRootFolder:function(){return Object(h.find)(this.treeList,(function(e){return!e.parentId}))},getAllSortedFilesList:function(){var e=this,t=[];return function n(a,o){if(a){var i=e.getChildren(a.id).sort((function(e,t){return e.name.toLowerCase().localeCompare(t.name.toLowerCase())})),r=o.concat(a.name);(i=i.filter((function(e){return"folder"===e.type||(t.push({value:e.id,key:e.id,label:r+" > "+e.name,filename:e.name}),!1)}))).forEach((function(e){n(e,o+a.name+" > ")}))}}(this.getRootFolder(),""),t},getMultipleFilesDataLoader:function(){return this.multipleFliesDataLoader},getOthersArrGenerator:function(){return this.otherArrGenerator},getPdfsArrGenerator:function(){return this.pdfsArrGenerator},onIncrementLoader:function(e,t,n){this.fileLoaderDataDrive.loaded+=e,t&&(this.fileLoaderDataDrive.estimateCount=t),n&&(this.fileLoaderDataDrive.annotsCount+=1),Math.round(this.fileLoaderDataDrive.wanted)===Math.round(this.fileLoaderDataDrive.loaded)&&(this.fileLoaderDataDrive.isLoading=!1),this.trigger("treeDataUpdated")},clearDriveLoader:function(){this.fileLoaderDataDrive={wanted:100,loaded:0,isLoading:!0,annotsCount:0,estimateCount:-1}},clearFileStore:function(){this.treeData=[],this.files=[],this.treeList=[],this.clearDriveLoader(),b.a.setAnnotationActionDone(!1)},onRequestGetFiles:function(e){var t=this;return Object(u.a)(c.a.mark((function n(){return c.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,E.a.get("".concat("https://api.geometra.rukkor.io","/files"),{params:{projectId:e},headers:{Authorization:I.a.getJwt()}}).then((function(e){var n,a;t.onBuildTree(e.data),t.onIncrementLoader(25),v.a.sendUpdate({action:"get_calculate_templates",companyId:null===(n=w.a.getActiveProject())||void 0===n?void 0:n.toJS().department.company.id}),v.a.sendUpdate({action:"get_drive_templates",companyId:null===(a=w.a.getActiveProject())||void 0===a?void 0:a.toJS().department.company.id})})).catch((function(e){console.log(e)}));case 2:v.a.sendUpdate({action:"get_row_templates"});case 3:case"end":return n.stop()}}),n)})))()},onClearFileList:function(){this.fileLoaderData={wanted:10,loaded:0,isLoading:!0},this.expandedKeys=[],this.selectedFileNodes=[]},onSetExpandedKeys:function(e){this.expandedKeys=e},uploadSinglePdfFile:function(e){var t=e.file,n=e.parentId,a=e.notes,o=e.description,i=e.name;if(this.webViewer)try{this.uploadedPdfFile={file:t,parentId:n,notes:a,description:o,name:i},this.webViewer.loadDocument(t,{filename:i})}catch(r){console.log("fileload arror "+r)}},getStampXfdf:function(e,t){var n=new DOMParser,a=new XMLSerializer,o=n.parseFromString(e,"text/xml"),i=o.querySelector("annots").firstElementChild,r=t.getCustomData("style"),s=t.getCustomData("maintainAspectRatio"),l=t.getCustomData("rotationControlEnabled"),c=t.getCustomData("geometraOpacity"),u=t.getCustomData("geometraBorderOpacity"),d=t.getCustomData("status");return i.setAttribute("style",r),i.setAttribute("maintainAspectRatio",s),i.setAttribute("rotationControlEnabled",l),i.setAttribute("geometraOpacity",c),i.setAttribute("geometraBorderOpacity",u),i.setAttribute("status",d),a.serializeToString(o)},getAnnotationType:function(e){switch(e){case"circle":return"Ellipse";case"ink":return"Free hand";case"freetext":return"Free text";case"line":return"Arrow";default:return e.charAt(0).toUpperCase()+e.slice(1)}},uploadPdfFileWithAnnotations:function(){var e=arguments,t=this;return Object(u.a)(c.a.mark((function n(){var a,o,i,r,l,u,d,p,g,m,f;return c.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.length>0&&void 0!==e[0]&&e[0],o=t.webViewer.annotManager,i=o.getAnnotationsList(),n.next=5,o.exportAnnotations({annotList:[]});case 5:return r=n.sent,l={xfdfString:r},n.next=9,t.webViewer.docViewer.getDocument();case 9:return u=n.sent,n.next=12,u.getFileData(l);case 12:if(d=n.sent,p=new Blob([d],{type:"application/pdf"}),t.uploadedPdfFile.file=p,!a){n.next=27;break}return g=Object(h.map)(i,(function(e){return o.exportAnnotations({annotList:[e]})})),n.next=19,Promise.all(g);case 19:m=n.sent,f=Object(h.filter)(Object(h.map)(i,(function(e,n){var a=b.a.generateUUID(),o=m[n].replace(e.av,a),i=(new DOMParser).parseFromString(o,"text/xml"),r=Object(h.get)(i.querySelector("annots"),"firstElementChild");if(r){var s=r.tagName,l=t.getAnnotationType(s),c="Polygon"===l?t.parseAnnotVertices(o,i):o;return{estimateId:b.a.getActiveEstimate().get("id"),annotationId:a,name:e.annotationName||e.Subject,number:e.annotationNumber||"000",xfdf:"stamp"===s?t.getStampXfdf(o,e):c,type:l,height:e.height||"2.5",quantity:e.quantity||1,layerId:"-1"}}return null})),(function(e){return!!e})),t.multipleFliesDataLoader.uploadingFiles||t.initLoaderForSinglePDFUpload(!0),t.multipleFliesDataLoader.uploadingPDFwithAnnots||(t.multipleFliesDataLoader.uploadingPDFwithAnnots=!0),t.onUploadFile(Object(s.a)(Object(s.a)({},t.uploadedPdfFile),{},{annotations:f})),t.uploadedPdfFile={},n.next=29;break;case 27:t.multipleFliesDataLoader.uploadingFiles||t.initLoaderForSinglePDFUpload(!1);try{t.onUploadFile(t.uploadedPdfFile),t.uploadedPdfFile={}}catch(c){console.log("error: ",c.stack)}case 29:case"end":return n.stop()}}),n)})))()},initLoaderForSinglePDFUpload:function(e){this.multipleFliesDataLoader.wanted++,this.multipleFliesDataLoader.uploadingFiles=!0,this.multipleFliesDataLoader.filesName=[].concat(Object(r.a)(this.multipleFliesDataLoader.filesName),[this.uploadedPdfFile.name]),this.multipleFliesDataLoader.uploadingPDFwithAnnots=e,this.trigger("started_uploading_multiple_files")},countChildrenStatuses:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.reduce((function(e,t){return"folder"===t.type?Object(h.mergeWith)(e,t.statuses,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return e+t})):t.nodeStatus?Object(s.a)(Object(s.a)({},e),{},Object(i.a)({},t.nodeStatus,(e[t.nodeStatus]||0)+1)):e}),{notStarted:0,progress:0,review:0,complete:0});return t},onBuildTree:function(e){var t=this,n=null,a=Object(r.a)(new Map(e.map((function(e){return[e.id,e]}))).values()),o=Object(h.map)(a,(function(e){var t={parentId:e.parentId,id:e.id,description:e.description,key:e.id,shortDescription:e.shortDescription,title:e.name,type:e.type||"folder",children:[],size:e.size,added:e.added,name:e.name,status:e.status,nodeStatus:e.nodeStatus};return"folder"!==e.type&&e.type?Object(s.a)(Object(s.a)({},t),{},{icon:p.a.createElement(N.a,{type:Object(T.a)(e.type),status:e.status})}):t})),i=o.reduce((function(e,t,n){return e[t.id]=n,e}),{});Object(h.forEach)(o,(function(e){if(null!==e.parentId){var a=o[i[e.parentId]];a.children=[].concat(Object(r.a)(a.children||[]),[e]),a.statuses=t.countChildrenStatuses(a.children)}else n=e})),this.treeData=[n],this.treeList=o,this.trigger("treeListUpdated"),this.trigger("treeDataUpdated")},onUpdateTree:function(e){var t=this;Object(h.forEach)(e,(function(e){Object(h.forEach)(t.treeList,(function(t){if(t.id===e.id)return t.name=e.name,t.shortDescription=e.shortDescription,t.description=e.description,void(t.nodeStatus=e.nodeStatus)}))})),this.onBuildTree(this.treeList)},onAddNodeToTree:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?this.onBuildTree(Object(h.remove)(this.treeList,(function(t){return t.id!==e.id}))):this.onBuildTree([].concat(Object(r.a)(this.treeList),[e])),this.trigger("updateSelectedNode")},getSelectedNode:function(e){return Object(h.find)(this.treeList,(function(t){return t.id===e}))},onUploadFileChannelOpen:function(e,t){if(e.statusCode&&console.log("Error:",e),e.url){var n=e.url;E.a.put(n,this.files[0]),this.files.shift()}},onUploadFile:function(e){var t=this,n=e.file,a=e.parentId,i=e.notes,r=void 0===i?"":i,s=e.description,l=void 0===s?"":s,c=e.name,u=void 0===c?"":c,d=e.annotations,p=void 0===d?[]:d,g=new FileReader;g.onload=function(e){try{var i=u||n.name,s=null===i||void 0===i?void 0:i.split(/\.(?=[^\.]+$)/),c="";2===s.length?c=s[0]+"."+Object(h.lowerCase)(s[1]):(Object(o.a)("fileAndExtienstion"),s=i),E.a.post("".concat("https://rest-sls.api.geometra.rukkor.io/","start_file_upload"),{name:c,geoProjectId:w.a.getActiveProjectId(),type:Object(h.lowerCase)(Object(P.a)(i).fileExtensions[0]),description:r,shortDescription:l,parentId:a,size:n.size,added:new Date,annotations:p}).then((function(e){var n=t.getMultipleFilesDataLoader(),a=t.getPdfsArrGenerator(),o=t.getOthersArrGenerator();"pdf"!==e.data.type&&n.wanted>=1&&o.next(),"pdf"===e.data.type&&n.wanted>=1&&a.next(),y.a.uploadFileChannelOpen(e.data.payload,e.data.name),e.data.annotations.length>=1&&"pdf"===e.data.type&&R.a.onSetAnnotationsFromPDF(e.data.annotations)})).catch(console.log),t.files.push(n)}catch(d){console.log("error",d)}},g.readAsArrayBuffer(n)},multipleFilesLoaderHandler:function(){var e=this;this.multipleFliesDataLoader.loaded++,this.trigger("multiple_files_counter_updated"),this.multipleFliesDataLoader.loaded>=this.multipleFliesDataLoader.wanted&&(this.multipleFliesDataLoader.uploadingPDFwithAnnots&&w.a.onRequestProject(w.a.getActiveProjectId()),this.multipleFliesDataLoader.wanted=0,this.multipleFliesDataLoader.loaded=0,this.multipleFliesDataLoader.uploadingFiles=!1,this.multipleFliesDataLoader.filesName=[],this.pdfsArrGenerator=null,this.multipleFliesDataLoader.uploadingPDFwithAnnots=!1,setTimeout((function(){return e.trigger("ended_uploading_multiple_files")}),1500))},uploadMultipleFiles:function(e){var t=Object(h.filter)(e,(function(e){return"pdf"===e.file.type.split("/").pop()})),n=Object(h.filter)(e,(function(e){return"pdf"!==e.file.type.split("/").pop()}));if(e.length>0){var a=e.map((function(e){return e.name}));this.multipleFliesDataLoader.wanted=this.multipleFliesDataLoader.wanted+e.length,this.multipleFliesDataLoader.uploadingFiles=!0,this.multipleFliesDataLoader.filesName=[].concat(Object(r.a)(this.multipleFliesDataLoader.filesName),Object(r.a)(a)),this.trigger("started_uploading_multiple_files")}0===n.length&&t.length>0&&(this.pdfsArrGenerator=this.uploadMultiplePDFFiles(t),this.pdfsArrGenerator.next()),n.length>=1&&(this.otherArrGenerator=this.uploadMultipleOtherFiles(n,t),this.otherArrGenerator.next())},uploadMultipleOtherFiles:c.a.mark((function e(t,n){var o,i,r;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=Object(a.a)(t),e.prev=1,o.s();case 3:if((i=o.n()).done){e.next=9;break}return r=i.value,e.next=7,this.onUploadFile(r);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),o.e(e.t0);case 14:return e.prev=14,o.f(),e.finish(14);case 17:n.length>=1&&(this.pdfsArrGenerator=this.uploadMultiplePDFFiles(n),this.pdfsArrGenerator.next());case 18:case"end":return e.stop()}}),e,this,[[1,11,14,17]])})),uploadMultiplePDFFiles:c.a.mark((function e(t){var n,o,i;return c.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Object(a.a)(t),e.prev=1,n.s();case 3:if((o=n.n()).done){e.next=9;break}return i=o.value,e.next=7,this.uploadSinglePdfFile(i);case 7:e.next=3;break;case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),n.e(e.t0);case 14:return e.prev=14,n.f(),e.finish(14);case 17:case"end":return e.stop()}}),e,this,[[1,11,14,17]])})),onCancelUploadMultiplePdfFile:function(){this.multipleFliesDataLoader.wanted>0&&(this.multipleFliesDataLoader.wanted--,0===this.multipleFliesDataLoader.wanted?this.trigger("ended_uploading_multiple_files"):this.trigger("multiple_files_counter_updated"),this.pdfsArrGenerator.next())},onDeleteFile:function(e){O.i.sendMessage(Object(s.a)({action:"delete_file"},e))},deleteWithoutConfirmation:function(){var e=this.getSelectedFiles();if(0!==e.length&&e[0].parentId){var t="folder"===e[0].type?{action:"delete_folder",projectId:w.a.getActiveProjectId(),folderId:e[0].id}:{action:"delete_file",projectId:w.a.getActiveProjectId(),fileId:e[0].id};O.i.sendMessage(t)}},onDeleteFolder:function(e){O.i.sendMessage(Object(s.a)({action:"delete_folder"},e))},onUpdateCheckedNodesStatuses:function(e){var t={action:"update_node",projectId:w.a.getActiveProjectId(),ids:this.getCheckedItemsIds(),nodeStatus:e};O.i.sendMessage(t)},cleanup:function(){if(this.previewReady=!1,this.element&&this.element.querySelector("iframe").contentWindow){var e=this.element.querySelector("iframe").contentWindow.document;e.querySelector("body").removeEventListener("keydown",C.a),e.querySelector("body").removeEventListener("mousedown",C.b),e.querySelector("body").removeEventListener("mouseup",C.c)}this.webViewer&&this.webViewer.dispose(),this.webviewerInit&&(this.webviewerInit.cleanup(),this.webviewerInit=void 0),this.webViewer=void 0},reloadFileView:function(e){if(this.webViewer&&e&&e.length>0&&e[0]&&"folder"!==e[0].type){var t="".concat("https://geometra3.s3.eu-west-1.amazonaws.com/").concat(e[0].id);this.webViewer.loadDocument(t,{documentId:e[0].id,filename:e[0].name})}},initPdfAnnotationAsDeselected:function(e){if(e)switch(e.setRotationControlEnabled&&e.setRotationControlEnabled(!1),e.Subject){case"Point":case"Polygon":case"Ellipse":case"annotation.freeHand":case"Free Hand":case"Free hand":case"Reduction":e.FillColor&&(e.FillColor.A=e.geometraOpacity),e.StrokeColor&&(e.StrokeColor.A=e.geometraBorderOpacity),"Point"===e.Subject&&e.iconType&&"none"!==e.iconType&&this.webViewer.annotManager.redrawAnnotation(e);break;case"Polyline":case"x-scale":case"y-scale":e.StrokeColor.A=e.geometraOpacity;break;case"Free text":e.TextColor.A=e.geometraOpacity,e.Opacity=e.geometraOpacity;break;case"Stamp":e.Opacity=e.geometraOpacity}},loadAnnotations:function(){var e=this;return Object(u.a)(c.a.mark((function t(){var n,a,o,i,r,s,l,u,d,p,g,m,f,A,E;return c.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.getSelectedFiles(),!(e.webViewer&&n&&n.length>0&&n[0])){t.next=37;break}return a=e.webViewer.annotManager,t.next=5,a.exportAnnotCommand();case 5:for(a.deleteAnnotations(a.getAnnotationsList(),!0,!0),o=new S.a,(i=n[0])&&i.rotation&&(r=i.rotation,e.webViewer.docViewer.setPageRotations(r)),s=Object(h.get)(Object(h.find)(R.a.getActiveAnnotations(),(function(e){return e.fileId===Object(h.get)(i,"id")})),"annotations")||[],l=0;l<s.length;l++)(u=s[l]).xfdf&&"group"!==u.type&&o.addAddedCommand(u.xfdf);return t.next=13,e.webViewer.annotManager.importAnnotCommand(o.getAnnotCommand());case 13:for(d=t.sent,p=0;p<d.length;p++)"Stamp"!==d[p].Subject&&e.initPdfAnnotationAsDeselected(d[p]);g=b.a.getScalesForFile(i.id),m=0;case 17:if(!(m<g.size)){t.next=33;break}return f=g.get(m),t.next=21,a.importAnnotations(f.get("xdf"));case 21:A=t.sent,(E=A[0]).StrokeColor.A=.85,E.length=f.get("length"),E.Opacity=E.geometraOpacity,a.deleteAnnotation(E,!0,!0),"x-scale"===f.get("type")&&(E.Subject="x-scale"),E.setRotationControlEnabled(!1),a.addAnnotation(E,!0);case 30:m++,t.next=17;break;case 33:return t.next=35,a.drawAnnotationsFromList(a.getAnnotationsList());case 35:return t.next=37,a.exportAnnotCommand();case 37:case"end":return t.stop()}}),t)})))()},onSetMarqueeZoomTool:function(){this.trigger("setMarqueeZoomTool")},setToolMode:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.webViewer&&(t&&(this.previousToolMode=this.currentToolMode,this.isHotkeyLongPress=!0),this.currentToolMode=e,this.webViewer.setToolMode(e))},backToPreviousToolMode:function(){this.isHotkeyLongPress=!1,this.currentToolMode=this.previousToolMode,this.webViewer.setToolMode(this.previousToolMode)},setFitToScreen:function(){this.webViewer&&this.webViewer.setFitMode(this.webViewer.FitMode.FitPage)},parseAnnotVertices:function(e,t){var n=t.querySelector("vertices").innerHTML,a=n.split(";"),o=[].concat(Object(r.a)(a),[a[0]]).join(";");return a[0]===a[a.length-1]?e:e.replace(n,o)},setDefaultFileNode:function(){this.selectedFileNodes=this.getTreeList().filter((function(e){return!e.parentId&&"folder"===e.type}))},changeRootFolderName:function(e){this.treeList=this.treeList.map((function(t){return"folder"!==t.type||t.parentId?t:Object(s.a)(Object(s.a)({},t),{},{name:e})})),this.onBuildTree(this.treeList)},onGeoFileMessageHandler:function(e){var t=e.action;if(200!==e.statusCode)return console.log(e.payload.message);switch(t){case _.e.CREATE_GROUP:this.onAddNodeToTree(e.payload.group,!1,e.payload.name)}}})},576:function(e,t,n){e.exports=n.p+"static/media/dashed.e64115e5.svg"},577:function(e,t,n){e.exports=n.p+"static/media/solid.ec99e978.svg"},578:function(e,t,n){e.exports=n.p+"static/media/dotted.4b0cbf82.svg"},579:function(e,t,n){e.exports=n.p+"static/media/dot-dashed.0fbee184.svg"},585:function(e,t,n){"use strict";var a,o=n(25),i=n(29),r=n(43),s=n(44),l=n(0),c=n.n(l),u=n(273),d=n(63),p=n(34),g=n(345),h=n(85),m=n(284),f=n(592),A=n(12),E=n.n(A),T=n(10),S=n(204),b=n(187),I=n.n(b),y=n(16),v=n(83),N=n(144),O=n(252),w=n(28),P=n(2616),R=n(259),L=n(165),C=n(2609),_=n(35),M=n(5),k=n(24),D=n(33),x=n(76),F=n(431),j=n(110),V=function(e){var t=e.row,n=e.object,a=e.rightAlign,o=e.checkRowIsDisable,i=e.initialValue,r=e.readOnly,s=e.isLibrary,u=e.disable,d=Object(x.a)(e,["row","object","rightAlign","checkRowIsDisable","initialValue","readOnly","isLibrary","disable"]),p=Object(l.useState)(i),g=Object(D.a)(p,2),h=g[0],m=g[1],f=Object(l.useRef)(h),A=Object(l.useState)(i),E=Object(D.a)(A,2),S=E[0],b=E[1],I=Object(l.useRef)(S);Object(l.useEffect)((function(){m(i),f.current=i,b(i),I.current=i}),[t]),Object(l.useEffect)((function(){return function(){v()}}),[]);var y=function(){switch(n){case"amount":case"pricePerUnit":f.current=M.c.convertToFloat(h),m(M.c.convertToFloat(h))}v()},v=function(){I.current!==f.current&&(b(f.current),I.current=f.current,s?M.c.requestUpdateRowTemplate(t.id,n,f.current):j.a.requestUpdateRow(T.a.fromJS(t),n,f.current))};return c.a.createElement(F.a,Object.assign({value:h,readOnly:r,disabled:u||o,bordered:!1,onChange:function(e){m(e.target.value),f.current=e.target.value},onBlur:y,onPressEnter:y,className:"".concat(a&&"Right_Align")},d))},U=n(422),W=n(2611),B=n(2608),H=function(e,t,n){if("status"===e){var a=M.c.getNumberStatusValue(t.annotationRow.status),o=M.c.getNumberStatusValue(n.annotationRow.status);return a.localeCompare(o)}return"amount"===e||"pricePerUnit"===e||"totalPrice"===e?t.annotationRow[e]-n.annotationRow[e]:t.annotationRow[e].localeCompare(n.annotationRow[e],void 0,{numeric:!0})},J=function(e,t,n){if("status"===e){var a=M.c.getNumberStatusValue(t.status),o=M.c.getNumberStatusValue(n.status);return a.localeCompare(o)}return"pricePerUnit"===e?t[e]-n[e]:t[e].localeCompare(n[e],void 0,{numeric:!0})},z=(n(848),function(e){var t=e.row,n=e.object,a=e.checkRowIsDisable,o=e.initialValue,i=e.extendedValue,r=e.rightAlign,s=(e.addonAfter,e.extended),u=e.isLibrary,d=e.disable,p=e.areDifferentVariables,g=void 0!==p&&p,h=Object(x.a)(e,["row","object","checkRowIsDisable","initialValue","extendedValue","rightAlign","addonAfter","extended","isLibrary","disable","areDifferentVariables"]),m=Object(U.a)().t,f=Object(l.useState)(o),A=Object(D.a)(f,2),E=A[0],S=A[1],b=Object(l.useRef)(E),I=Object(l.useState)(o),y=Object(D.a)(I,2),v=y[0],N=y[1],O=Object(l.useRef)(v),w=Object(l.useState)(i),P=Object(D.a)(w,2),R=P[0],L=P[1],C=Object(l.useState)(!1),_=Object(D.a)(C,2),k=_[0],V=_[1],H=Object(l.useState)(s),J=Object(D.a)(H,2),z=J[0],G=J[1],q=Object(l.useState)(!1),X=Object(D.a)(q,2),Y=X[0],K=X[1],Z=Object(l.useState)(g),Q=Object(D.a)(Z,2),$=Q[0],ee=Q[1],te=function(){var e=[];switch(n){case"profession":e=M.c.getProfessionAutoCompleteList().toJS();break;case"phase":e=M.c.getPhaseAutoCompleteList().toJS();break;case"segment":e=M.c.getSegmentAutoCompleteList().toJS();break;case"rowAction":case"action":e=M.c.getActionAutoCompleteList().toJS();break;case"material":e=M.c.getMateriaLAutoCompleteList().toJS();break;case"amount":e=M.c.getAmountAutoCompleteList().toJS();break;case"pricePerUnit":e=M.c.getPricePerUnitAutoCompleteList().toJS();break;case"insertRow":e=M.c.getNewRowAutoCompleteList().toJS()}return e}();Object(l.useEffect)((function(){S(o),b.current=o,N(o),O.current=o,L(i),ee(g)}),[t]),Object(l.useEffect)((function(){return function(){"insertRow"===n||g||ae()}}),[]);var ne=function(){if("insertRow"!==n){switch($||(V(!1),s&&G(!0),Y&&K(!1)),n){case"amount":case"pricePerUnit":b.current=M.c.convertToFloat(E),S(M.c.convertToFloat(E));break;default:b.current=E,S(E)}ae()}},ae=function(){if(O.current!==b.current){if($)return K(!0),ee(!1),void V(!1);N(b.current),O.current=b.current,s&&L("amount"===n?M.c.formatAmountValue(function(e,t){var n=M.a.getAnnotationById(t)||M.a.getReductionById(t),a=M.a.calculateValuesForAnnotation(n).get("annotationData");return M.c.parseExpressionToValues(e,a)}(b.current,t.geoAnnotation.id)):"pricePerUnit"===n?M.c.formatCurrencyValue(b.current):b.current),u?M.c.requestUpdateRowTemplate(t.id,n,b.current):j.a.requestUpdateRow(T.a.fromJS(t),n,b.current)}};return z?c.a.createElement(F.a,{value:R,disabled:d||a,bordered:!1,onFocus:function(){G(!1)},className:r&&"Right_Align"}):c.a.createElement(W.a,{title:m("Editing this field will overwrite any formulas for these rows. Are you sure you wish to overwrite amount formulas? This can not be undone."),visible:Y,onConfirm:ne,onCancel:function(){b.current=O.current,S(O.current),K(!1),ee(!0),V(!1),s&&G(!0)},okText:m("Overwrite"),cancelText:m("Cancel"),overlayClassName:"AmountPopover"},c.a.createElement(B.a,Object.assign({value:E,open:k,disabled:d||a,bordered:!1,options:!u&&te,autoFocus:s,filterOption:function(e,t){return-1!==t.value.toString().toLowerCase().indexOf(e.toString().toLowerCase())},showAction:["click"],onChange:function(e){S(e),b.current=e},onSelect:function(e){S(e),b.current=e,ae(),V(!1)},onMouseDown:function(){setTimeout((function(){M.g.isContextMenuCalculateRowsOpen()&&V(!1)}),250)},onBlur:function(){Y||ne()},onKeyDown:function(e){13===e.keyCode&&ne()},onDropdownVisibleChange:function(){setTimeout((function(){k||M.g.isContextMenuCalculateRowsOpen()||V(!0)}),250)},className:"".concat(r&&"Right_Align"),dropdownClassName:"Calculate_Rows_Dropdown"},h)))}),G=n(191),q=n(147),X=G.a.Option,Y=function(e){var t=e.data,n=e.row,a=e.initialValue,o=e.object,i=e.checkRowIsDisable,r=e.isLibrary,s=e.disable,u=Object(x.a)(e,["data","row","initialValue","object","checkRowIsDisable","isLibrary","disable"]),d=Object(U.a)().t,p=Object(l.useState)(M.c.getStatusValue(a)),g=Object(D.a)(p,2),h=g[0],m=g[1],f=Object(l.useRef)(h),A=Object(l.useState)(h),E=Object(D.a)(A,2),S=E[0],b=E[1],I=Object(l.useRef)(S),y=Object(l.useState)(!1),v=Object(D.a)(y,2),N=v[0],O=v[1];Object(l.useEffect)((function(){m(a),f.current=a,b(a),I.current=a}),[n]),Object(l.useEffect)((function(){return function(){w()}}),[]);var w=function(){I.current!==f.current&&(b(f.current),I.current=f.current,r?M.c.requestUpdateRowTemplate(n.id,o,f.current):j.a.requestUpdateRow(T.a.fromJS(n),o,f.current))};return c.a.createElement(G.a,Object.assign({defaultValue:h,value:h,open:N,disabled:s||i,showArrow:!1,bordered:!1,showAction:["click"],onMouseDown:function(){setTimeout((function(){q.a.isContextMenuCalculateRowsOpen()&&O(!1)}),250)},onChange:function(e){m(e),f.current=e},onSelect:function(e){m(e),f.current=e,w(),O(!1)},onBlur:function(){O(!1),w()},onDropdownVisibleChange:function(){setTimeout((function(){N||q.a.isContextMenuCalculateRowsOpen()||O(!0)}),250)},dropdownClassName:"Calculate_Rows_Dropdown",defaultActiveFirstOption:!0},u),t.map((function(e,t){return c.a.createElement(X,{value:e.value,key:t},c.a.createElement(R.a,{wrap:!1,gutter:6},c.a.createElement(L.a,null,c.a.createElement(e.StatusIcon,null)),c.a.createElement(L.a,null,d(e.label))))})))},K=n(179),Z=n(49),Q=n(133),$=(n(849),function(e){var t=e.role,n=e.children,a=e.type,o=e.selectedRowsProp,i=e.selectedRowKeys,r=e.selectedAnnotationsProp,s=e.clearSelectedRows,u=e.onPasteRowsToMultipleObjects,d=Object(l.useState)(!1),p=Object(D.a)(d,2),g=p[0],f=p[1],E=Object(l.useState)(!1),T=Object(D.a)(E,2),S=T[0],b=T[1],I=Object(l.useState)(!1),v=Object(D.a)(I,2),N=v[0],O=v[1],P=Object(l.useState)(o),R=Object(D.a)(P,2),L=R[0],M=R[1],x=Object(l.useState)(r),F=Object(D.a)(x,2),j=F[0],V=F[1],W=Object(U.a)().t;Object(l.useEffect)((function(){M(o)}),[o]),Object(l.useEffect)((function(){V(r)}),[r]);var B,H=function(){return 0===j.size||0===Q.a.getCopyAnnotationRows().size},J=function(){"library"===a?(_.g.sendUpdate({action:"delete_row_template",ids:i}),s()):b(!0),f(!1),q.a.setContextMenuCalculateRowsOpen(!1)},z=function(){"library"===a?_.g.sendUpdate({action:"delete_row_template",ids:i}):Z.a.onRequestDeleteSelectedRows(),b(!1),s()},G="library"!==a?c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu"},c.a.createElement(K.a.Item,{key:"1",onClick:function(){var e=L.map((function(e){var t=Z.a.getRowById(e.get("id")).getIn(["annotationRow","amount"]);return e.setIn(["annotationRow","amount"],t)}));Q.a.copySelectedRows(e),f(!1),q.a.setContextMenuCalculateRowsOpen(!1)},disabled:!t||0===L.size},c.a.createElement(y.a,{icon:["fal","copy"]}),W("Copy")),c.a.createElement(K.a.Item,{key:"2",onClick:function(){j.size>0?u():Q.a.pasteAnnotationRows(j),f(!1),q.a.setContextMenuCalculateRowsOpen(!1)},disabled:!t||H()},c.a.createElement(y.a,{icon:["fal","paste"]}),W("Paste")),c.a.createElement(K.a.Item,{key:"3",onClick:function(){O(!0),f(!1),q.a.setContextMenuCalculateRowsOpen(!1)},disabled:!t||H()},c.a.createElement(y.a,{icon:["fal","sync"]}),W("Replace")),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"4",onClick:function(){Z.a.saveRowTemplate(L),f(!1),q.a.setContextMenuCalculateRowsOpen(!1)},disabled:!t||0===L.size},c.a.createElement(y.a,{icon:["fal","save"]}),W("Save")),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"5",onClick:J,disabled:!t||0===L.size,danger:!0},c.a.createElement(y.a,{icon:["fal","trash"]}),W("Delete"))):c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu"},c.a.createElement(K.a.Item,{key:"1",onClick:J,danger:!0,disabled:!t||0===L.length},c.a.createElement(y.a,{icon:["fal","trash"]}),W("Delete")));return c.a.createElement(c.a.Fragment,null,S&&c.a.createElement(k.j,{visible:S,title:W("library"===a?"Delete Stored Rows":"Delete Rows"),onOk:z,onCancel:function(){b(!1),s()},activeButtons:c.a.createElement(h.a,{onClick:z,type:"primary",danger:!0,autoFocus:!0},W("Delete")),className:"Calculate_Modal"},c.a.createElement(se,{data:"library"===a?(B=L.toJS(),Object(A.map)(B,(function(e){return{id:e.id,userId:e.userId,rowAction:e.rowAction,annotationRow:Object(w.a)({},e)}}))):L.toJS()})),N&&c.a.createElement(k.j,{visible:N,title:W("Replacing rows in current selection"),onOk:function(){Q.a.replaceSelectedRows(j),O(!1)},onCancel:function(){O(!1),s()},submitButtonTitle:W("Replace"),className:"Calculate_Modal"},c.a.createElement(k.k,{oldData:L.toJS(),newData:Q.a.getCopyAnnotationRows().toJS()})),c.a.createElement(m.a,{overlay:G,trigger:["contextMenu"],visible:t&&g,onVisibleChange:function(e){f(e),q.a.setContextMenuCalculateRowsOpen(e)},className:"Dropdown_Container"},n))}),ee=n(2617),te=(n(850),function(){var e=Object(U.a)().t,t=[{title:e("Status"),icon:"check-circle",description:e("Set a status for the row to track progress")},{title:e("Profession"),icon:"users",description:e("Select which profession to carry out the work")},{title:e("Phase"),icon:"share-alt",description:e("Set a phase for when this is carried out in the project")},{title:e("Segment"),icon:"cube",description:e("Choose a part, like roof or wall where this work should be done")},{title:e("Action"),icon:"hammer",description:e("Enter which type of work by profession to calculate on")},{title:e("Material"),icon:"warehouse",description:e("Select one or many materials for the work to be used")},{title:e("Amount & Unit"),icon:"function",description:e("Make the formulas and calculate how much/many")},{title:e("Price & Time"),icon:"clock",description:e("Enter price and time per unit to calculate cost and time")},{title:e("Insert Row"),icon:"indent",description:e("Insert the row to your current selection"),notShowArrowIcon:!0}];return c.a.createElement("div",{className:"RowHints"},t.map((function(e){return c.a.createElement("div",{className:"RowHints_Wrapper"},c.a.createElement(ee.a,{className:"RowHints_Card",title:c.a.createElement("div",{className:"RowHints_Title_Wrapper"},c.a.createElement(y.a,{className:"RowHints_Card_Icon",icon:["fal",e.icon]}),c.a.createElement("label",null,e.title)),bordered:!1},c.a.createElement("label",{className:"RowHints_Card_Description"},e.description)),!e.notShowArrowIcon&&c.a.createElement(y.a,{className:"RowHints_Arrow_Icon",icon:["fal","arrow-right"],key:e.index}))})))}),ne=n(283),ae=(n(851),function(e){var t=e.object,n=e.annotationRows,a=e.event,o=e.onChangeFilters,i=Object(U.a)().t,r=a.setSelectedKeys,s=a.selectedKeys,u=a.confirm,d=a.clearFilters,g=Object(l.useState)(I(t)),m=Object(D.a)(g,2),f=m[0],A=m[1],E=Object(l.useState)(""),T=Object(D.a)(E,2),S=T[0],b=T[1];function I(e){return n.reduce((function(n,a){return n.findIndex((function(t){return t.value===a.annotationRow[e]}))<=-1&&""!==a.annotationRow[e]&&("status"===t?n.push({label:Z.a.getVisibleStatusValue(a.annotationRow[e]),value:a.annotationRow[e]}):n.push({label:a.annotationRow[e],value:a.annotationRow[e]})),n}),[])}Object(l.useEffect)((function(){A(I(t))}),[JSON.stringify(n)]);return c.a.createElement("div",{className:"Filter_Dropdown_Rows"},c.a.createElement(F.a,{placeholder:"Search",prefix:c.a.createElement(y.a,{icon:["fal","search"]}),bordered:!1,value:S,onChange:function(e){var n=e.target.value,a=s.reduce((function(e,t){return e.push({label:t,value:t}),e}),[]),o=I(t).filter((function(e){return e.label.toLowerCase().includes(n.toLowerCase())})),i=a.concat(o),r=Object(p.a)(new Map(i.map((function(e){return[e.label,e]}))).values());b(n),A(r)}}),c.a.createElement(C.a,null),c.a.createElement(ne.a.Group,{options:f,onChange:function(e){r(e)},value:s}),c.a.createElement(C.a,null),c.a.createElement("div",{className:"Action_Section"},c.a.createElement(h.a,{type:"text",onClick:function(){b(""),d(),o([],t,!0)}},i("Reset")),c.a.createElement(h.a,{type:"primary",onClick:function(){u(),o(s,t)}},i("Filter"))))}),oe=(n(852),n(173)),ie=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).state={isDropdownOpen:!1,selectedRowKeys:[],selectedRows:[],savedRows:[]},e.unitData=[{value:"m",label:"m"},{value:"m2",label:"m2"},{value:"m3",label:"m3"},{value:"st",label:"st"}],e.calculationStoreUpdated=function(t){switch(t){case"updateRows":e.setState({savedRows:M.c.getRowTemplates(),isDropdownOpen:!1})}},e.onSelectChange=function(t,n){e.setState({selectedRowKeys:t,selectedRows:n}),e.props.setSelectedLibraryRows(n)},e.generateRowLibraryBody=function(e){return Object(A.map)(e,(function(e){return{id:e.id,userId:e.userId,rowAction:e.rowAction,annotationRow:Object(w.a)({},e)}}))},e.clearSelectedRows=function(){e.setState({selectedRowKeys:[],selectedRows:[]}),e.props.setSelectedLibraryRows([]),M.c.deSelectAllRows()},e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.unsubscribeCalculationStore=M.c.listen(this.calculationStoreUpdated),0===M.c.rowTemplates.length?_.g.sendUpdate({action:"get_row_templates"}):this.setState({savedRows:M.c.getRowTemplates()})}},{key:"componentWillUnmount",value:function(){this.unsubscribeCalculationStore()}},{key:"render",value:function(){var e=this,t=this.props.t,n=this.state,a=n.selectedRowKeys,o=n.selectedRows,i={selectedRowKeys:a,onChange:this.onSelectChange,getCheckboxProps:function(e){return{disabled:"Disabled User"===e.name,name:e.name}}},r=[{title:t("Status"),dataIndex:"status",key:"status",sorter:function(e,t){return J("status",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"status",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.status.indexOf(e)},render:function(e,t){return c.a.createElement(Y,{data:oe.a,row:t,object:"status",initialValue:t.status,isLibrary:!0})}},{title:t("Profession"),dataIndex:"profession",key:"profession",sorter:function(e,t){return J("profession",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"profession",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.profession.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"profession",initialValue:t.profession,isLibrary:!0})}},{title:t("Phase"),dataIndex:"phase",key:"phase",sorter:function(e,t){return J("phase",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"phase",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.phase.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"phase",initialValue:t.phase,isLibrary:!0})}},{title:t("Segment"),dataIndex:"segment",key:"segment",sorter:function(e,t){return J("segment",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"segment",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.segment.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"segment",initialValue:t.segment,isLibrary:!0})}},{title:t("Action"),dataIndex:"rowAction",key:"rowAction",sorter:function(e,t){return J("rowAction",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"rowAction",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.rowAction.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"rowAction",initialValue:t.rowAction,isLibrary:!0})}},{title:t("Material"),dataIndex:"material",key:"material",sorter:function(e,t){return J("material",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"material",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.material.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"material",initialValue:t.material,isLibrary:!0})}},{title:t("Amount"),dataIndex:"amount",key:"amount",sorter:function(e,t){return J("amount",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"amount",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.amount.toString().indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"amount",initialValue:t.amount,rightAlign:!0,isLibrary:!0})}},{title:t("Unit"),dataIndex:"unit",key:"unit",sorter:function(e,t){return J("unit",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"unit",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.unit.indexOf(e)},render:function(t,n){return c.a.createElement(z,{options:e.unitData,row:n,object:"unit",initialValue:n.unit,isLibrary:!0})}},{title:t("Unit Price"),dataIndex:"pricePerUnit",key:"pricePerUnit",sorter:function(e,t){return J("pricePerUnit",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"pricePerUnit",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.pricePerUnit.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"pricePerUnit",initialValue:t.pricePerUnit,rightAlign:!0,isLibrary:!0})}},{title:t("Unit Time"),dataIndex:"timePerUnit",key:"timePerUnit",sorter:function(e,t){return J("timePerUnit",e,t)},filterDropdown:function(t){return c.a.createElement(ae,{object:"timePerUnit",annotationRows:e.generateRowLibraryBody(e.state.savedRows),event:t})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.timePerUnit.indexOf(e)},render:function(e,t){return c.a.createElement(V,{row:t,object:"timePerUnit",type:"time",initialValue:t.timePerUnit||"00:00",rightAlign:!0,isLibrary:!0})}}],s=M.b.getRole();return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",{className:"Library_Container"},c.a.createElement($,{role:s,type:"library",selectedRowsProp:new T.a.List(o),selectedRowKeys:a,clearSelectedRows:this.clearSelectedRows},c.a.createElement("div",null,c.a.createElement("div",null,t("Stored Rows")),c.a.createElement(C.a,null),c.a.createElement(P.a,{dataSource:this.state.savedRows,columns:r,pagination:!1,rowSelection:i,bordered:!0,size:"small",rowKey:function(e){return"".concat(e.id)},className:"Library_Table"})))))}}]),n}(c.a.PureComponent),re=Object(f.a)()(ie),se=function(e){var t=e.data,n=Object(U.a)().t,a=Object(l.useState)([]),o=Object(D.a)(a,2),i=o[0],r=o[1];Object(l.useEffect)((function(){return r(Object(A.map)(M.c.getSeparateBundledRows(t),(function(e){var t,n;return Object(w.a)(Object(w.a)({},e),{},{geoAnnotation:(null===(t=M.a.getAnnotationById(e.geoAnnotation.id))||void 0===t?void 0:t.toJS())||(null===(n=M.a.getReductionById(e.geoAnnotation.id))||void 0===n?void 0:n.toJS())})}))),function(){return r([])}}),[]);var s=[{title:n("Name"),dataIndex:"name",key:"name-delete",render:function(e,t){return c.a.createElement("div",null,t.geoAnnotation.name)}},{title:n("Nr/Tag"),dataIndex:"number",key:"number-delete",render:function(e,t){return c.a.createElement("div",null,t.geoAnnotation.number)}},{title:n("Status"),dataIndex:"status",key:"status-delete",render:function(e,t){var a=oe.a.find((function(e){return e.value===t.annotationRow.status}));return c.a.createElement(R.a,{wrap:!1,gutter:6},c.a.createElement(L.a,null,c.a.createElement(a.StatusIcon,null)),c.a.createElement(L.a,null,n(a.label)))}},{title:n("Profession"),dataIndex:"profession",key:"profession-delete",render:function(e,t){return c.a.createElement("div",null,t.annotationRow.profession)}},{title:n("Phase"),dataIndex:"phase",key:"phase-delete",render:function(e,t){return c.a.createElement("div",null,t.annotationRow.phase)}},{title:n("Segment"),dataIndex:"segment",key:"segment-delete",render:function(e,t){return c.a.createElement("div",null,t.annotationRow.segment)}},{title:n("Action"),dataIndex:"action",key:"action-delete",render:function(e,t){return c.a.createElement("div",null,t.annotationRow.action)}},{title:n("Material"),dataIndex:"material",key:"material-delete",render:function(e,t){return c.a.createElement("div",null,t.annotationRow.material)}},{title:n("Amount"),dataIndex:"amount",key:"amount-delete",render:function(e,t){return c.a.createElement("div",{className:"Right_Align"},M.c.formatAmountValue(t.annotationRow.amount))}},{title:n("Unit"),dataIndex:"unit",key:"unit-delete",render:function(e,t){return c.a.createElement("div",null,t.annotationRow.unit)}},{title:n("Unit Price"),dataIndex:"pricePerUnit",key:"pricePerUnit-delete",render:function(e,t){return c.a.createElement("div",{className:"Right_Align"},M.c.formatCurrencyValue(t.annotationRow.pricePerUnit))}},{title:n("Unit Time"),dataIndex:"unitTime",key:"unitTime-delete",render:function(e,t){return c.a.createElement("div",{className:"Right_Align"},t.annotationRow.unitTime||"00:00")}}];return c.a.createElement(P.a,{dataSource:i,columns:s,pagination:!1,bordered:!0,size:"small",className:"Calculate_Rows_Table",scroll:{y:"250px"}})},le=(n(853),n(104)),ce=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).state={selectedRowKeys:[],selectedRows:new T.a.List,rowInput:{},toggleState:!1,annotationRows:new T.a.List,showConfirmDialog:!1,showHints:!1,showLibrary:!1,selectedLibraryRows:[],newRow:"",isNewRowOpen:!1,filterState:JSON.parse(window.localStorage.getItem("calculateRows::filter"))||[],pasteRowsAction:!1},e.unitData=[{value:"m",label:"m"},{value:"m2",label:"m2"},{value:"m3",label:"m3"},{value:"st",label:"st"}],e.projectsStoreUpdated=function(t){"projectUpdated"===t&&e.setState({currency:M.m.getProjectCurrency(e.props.projectId)})},e.calculationStoreUpdated=function(t){switch(t){case"CalculationRowInserted":case"CalculationRowDeleted":case"CalculationRowsFetched":e.setState({annotationRows:new T.a.List,toggleState:!e.state.toggleState},(function(){e.setState({annotationRows:M.c.getBundledRowsForGui()})}));break;case"CalculationRowUpdated":e.setState({annotationRows:M.c.getBundledRowsForGui()})}},e.annotationStoreUpdated=function(t){switch(t){case"annotationSelected":case"Not-PDF-Annotation-Selected":case"ALL-Annotations-and-folders-deselected":case"ALL-Annotations-and-folders-selected":case"AnnotationUpdated":case"annotationSelectedFromGui":case"annotationDeSelectedFromGui":case"allAnnotationSelected":e.setState({annotationRows:M.c.getBundledRowsForGui(),toggleState:!e.state.toggleState})}},e.ifcStoreUpdated=function(t){"ifcAnnotationsUpdated"===t&&e.setState({annotationRows:M.c.getBundledRowsForGui(),toggleState:!e.state.toggleState})},e.filterRows=function(e,t){return T.a.fromJS(t.reduce((function(e,t){var n=t.key,a=t.selectedValues;return e.filter((function(e){return a.some((function(t){return t===e.getIn(["annotationRow",n])}))}))}),e))},e.selectRow=function(t){e.setState({selectedRow:t})},e.addNewRow=function(){var t=M.c.getRelevantSelectedAnnotations();if(t.size>1)e.setState({showConfirmDialog:!0});else{if(e.state.showLibrary){var n=M.c.getNewRowTemplate(e.state.newRow);M.c.addNewRowTemplate([n])}else{var a=[];t.forEach((function(t){e.checkRowIsDisable(t)||a.push(t)}));var o=M.c.getNewRow(e.state.newRow,a[0]).toJS(),i=Object(w.a)(Object(w.a)({},o),{},{annotationRow:JSON.stringify(o.annotationRow)});e.setState({newRow:"",isNewRowOpen:!1}),_.c.requestCreateRow({annotationIds:a,newRows:[i]})}e.setState({newRow:"",isNewRowOpen:!1})}},e.insertRows=function(){var t=Object(A.map)(e.state.selectedLibraryRows,(function(e){return{annotationRow:JSON.stringify(e)}})),n=[];M.c.getRelevantSelectedAnnotations().forEach((function(t){e.checkRowIsDisable(t)||n.push(t)})),_.c.requestCreateRow({annotationIds:n,newRows:t}),e.setState({showLibrary:!1})},e.setSelectedLibraryRows=function(t){e.setState({selectedLibraryRows:t})},e.submitConfirmDialog=function(){if(e.state.pasteRowsAction)return M.n.pasteAnnotationRows(e.props.selectedAnnotations),void e.setState({showConfirmDialog:!1,pasteRowsAction:!1});var t=[];if(e.state.showLibrary)e.insertRows();else{var n=M.c.getRelevantSelectedAnnotations(),a=e.getReadOnlyAnnotation();n.forEach((function(e){a.some((function(t){return t===e}))||t.push(e)}));var o=M.c.getNewRow(e.state.newRow,t[0]).toJS();M.c.onRequestCreateRow({annotationIds:t,newRows:[{annotationRow:JSON.stringify(o.annotationRow)}]})}e.setState({showConfirmDialog:!1,newRow:""})},e.cancelConfirmDialog=function(){e.setState({showConfirmDialog:!1,newRow:""})},e.onSelectChange=function(t,n){var a=T.a.fromJS(n);e.setState({selectedRowKeys:t,selectedRows:a}),M.c.setSelectedRow(a)},e.clearSelectedRows=function(){e.setState({selectedRowKeys:[],selectedRows:new T.a.List,newRow:""}),M.c.deSelectAllRows()},e.isInsertButtonDisabled=function(){return 0===e.state.selectedLibraryRows.length||0===M.c.getRelevantSelectedAnnotations().size},e.onChangeFilterState=function(t,n,a){var o=e.state.filterState,i=[],r=o.some((function(e){return e.key===n}));i=a?o.filter((function(e){return e.key!==n})):r?o.map((function(e){return e.key===n?{key:n,selectedValues:t}:e})):[].concat(Object(p.a)(o),[{key:n,selectedValues:t}]),window.localStorage.setItem("calculateRows::filter",JSON.stringify(i)),e.setState({filterState:i})},e.onPasteRowsToMultipleObjectsHandler=function(){e.setState({showConfirmDialog:!0,pasteRowsAction:!0})},e}return Object(i.a)(n,[{key:"componentWillMount",value:function(){this.unsubscribeCalculationStore=M.c.listen(this.calculationStoreUpdated),this.unsubscribeAnnotationStore=M.a.listen(this.annotationStoreUpdated),this.unsubscribeProjectsStore=M.m.listen(this.projectsStoreUpdated),this.unsubscribeIfcStore=M.k.listen(this.ifcStoreUpdated),M.c.initNumeral()}},{key:"componentWillUnmount",value:function(){this.unsubscribeCalculationStore(),this.unsubscribeAnnotationStore(),this.unsubscribeProjectsStore(),this.unsubscribeIfcStore(),window.localStorage.removeItem("calculateRows::filter")}},{key:"componentDidUpdate",value:function(e){Object(A.isEqual)(e.selectedAnnotations,this.props.selectedAnnotations)||this.clearSelectedRows()}},{key:"calcTotalPrice",value:function(e,t){var n=t.length>0?this.filterRows(e,t):e,a=0;return n&&!n.isEmpty()&&n.forEach((function(e){var t=e.getIn(["annotationRow","totalPrice"])?1*e.getIn(["annotationRow","totalPrice"]):0;a+=t})),M.c.formatCurrencyValue(a.toString())}},{key:"calcTotalTime",value:function(e,t){var n=t.length>0?this.filterRows(e,t):e;if(n&&!n.isEmpty()){var a=0,o=0,i=0;return n.forEach((function(e){var t=e.getIn(["annotationRow","totalTime"])?e.getIn(["annotationRow","totalTime"]).split(":"):["00","00"],n=Math.abs(60*t[0])+1*t[1];"-"===t[0].charAt(0)?a-=n:a+=n})),o=a<0?Math.ceil(a/60):Math.floor(a/60),i=Math.abs(a%60),"".concat(a<0&&0===o?"-":"").concat(o,":").concat(i.toLocaleString("en-US",{minimumIntegerDigits:2,useGrouping:!1}))}return"0:00"}},{key:"getReadOnlyAnnotation",value:function(){var e=[];return this.props.selectedAnnotations.forEach((function(t){var n=new DOMParser;"group"===t.get("type")?M.a.getAllAnnotationsFromParent(t.get("id")).filter((function(e){return"group"!==e.get("type")})).forEach((function(t){"3DModel"===t.get("type")?t.get("xfdf").get("readOnly")&&e.push(t.get("id")):"true"===n.parseFromString(t.get("xfdf"),"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&e.push(t.get("id"))})):"3DModel"===t.get("type")?t.get("xfdf").get("readOnly")&&e.push(t.get("id")):"true"===n.parseFromString(t.get("xfdf"),"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&e.push(t.get("id"))})),e}},{key:"checkRowIsDisable",value:function(e){return this.getReadOnlyAnnotation().some((function(t){return t===e}))}},{key:"render",value:function(){var e,t,n,a,o,i,r,s,l,u,d,p,g=this,m=M.b.getRole(),f=this.props,A=f.t,T=f.selectedAnnotations,S=this.state,b=S.selectedRows,I=S.selectedRowKeys,v=S.showLibrary,N=S.annotationRows,O=S.showConfirmDialog,w=S.showHints,_=S.newRow,D=S.isNewRowOpen,x={selectedRowKeys:I,onChange:this.onSelectChange,getCheckboxProps:function(e){return{disabled:"Disabled User"===e.name,name:e.name}}},F=[{title:A("Status"),dataIndex:"status",key:"status",sorter:function(e,t){return H("status",e,t)},filteredValue:null===(e=E.a.find(this.state.filterState,{key:"status"}))||void 0===e?void 0:e.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"status",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState,filterState:g.state.filterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.status.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(Y,{data:oe.a,row:t,object:"status",initialValue:t.annotationRow.status||"notStarted",checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Profession"),dataIndex:"profession",key:"profession",sorter:function(e,t){return H("profession",e,t)},filteredValue:null===(t=E.a.find(this.state.filterState,{key:"profession"}))||void 0===t?void 0:t.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"profession",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState,filterState:g.state.filterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.profession.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{row:t,object:"profession",disable:!m,initialValue:t.annotationRow.profession,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Phase"),dataIndex:"phase",key:"phase",sorter:function(e,t){return H("phase",e,t)},filteredValue:null===(n=E.a.find(this.state.filterState,{key:"phase"}))||void 0===n?void 0:n.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"phase",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState,filterState:g.state.filterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.phase.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{row:t,object:"phase",disable:!m,initialValue:t.annotationRow.phase,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Segment"),dataIndex:"segment",key:"segment",sorter:function(e,t){return H("segment",e,t)},filteredValue:null===(a=E.a.find(this.state.filterState,{key:"segment"}))||void 0===a?void 0:a.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"segment",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState,filterState:g.state.filterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.segment.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{row:t,object:"segment",disable:!m,initialValue:t.annotationRow.segment,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Action"),dataIndex:"action",key:"action",sorter:function(e,t){return H("action",e,t)},filteredValue:null===(o=E.a.find(this.state.filterState,{key:"action"}))||void 0===o?void 0:o.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"action",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState,filterState:g.state.filterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.action.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{row:t,object:"action",disable:!m,initialValue:t.annotationRow.action,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Material"),dataIndex:"material",key:"material",sorter:function(e,t){return H("material",e,t)},filteredValue:null===(i=E.a.find(this.state.filterState,{key:"material"}))||void 0===i?void 0:i.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"material",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.material.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{row:t,object:"material",disable:!m,initialValue:t.annotationRow.material,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Amount"),dataIndex:"amount",key:"amount",sorter:function(e,t){return H("amount",e,t)},filteredValue:null===(r=E.a.find(this.state.filterState,{key:"amount"}))||void 0===r?void 0:r.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"amount",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.amount.toString().indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){var n,a=!1;if(t.ids){var o=t.ids.map((function(e){return M.c.getRowById(e).getIn(["annotationRow","amount"])}));o.every((function(e){return e===o[0]}))?n=o[0]:(n="",a=!0)}else n=M.c.getRowById(t.id).getIn(["annotationRow","amount"]);return c.a.createElement(z,{extended:!0,row:t,object:"amount",disable:!m,initialValue:n,extendedValue:M.c.formatAmountValue(t.annotationRow.amount),rightAlign:!0,checkRowIsDisable:t.annotationRow.readOnly,areDifferentVariables:a})}},{title:A("Unit"),dataIndex:"unit",key:"unit",sorter:function(e,t){return H("unit",e,t)},filteredValue:null===(s=E.a.find(this.state.filterState,{key:"unit"}))||void 0===s?void 0:s.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"unit",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.unit.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{options:g.unitData,row:t,object:"unit",disable:!m,initialValue:t.annotationRow.unit,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Unit Price"),dataIndex:"pricePerUnit",key:"pricePerUnit",sorter:function(e,t){return H("pricePerUnit",e,t)},filteredValue:null===(l=E.a.find(this.state.filterState,{key:"pricePerUnit"}))||void 0===l?void 0:l.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"pricePerUnit",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.pricePerUnit.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(z,{extended:!0,row:t,object:"pricePerUnit",disable:!m,initialValue:t.annotationRow.pricePerUnit,extendedValue:M.c.formatCurrencyValue(t.annotationRow.pricePerUnit),rightAlign:!0,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Unit Time"),dataIndex:"unitTime",key:"unitTime",sorter:function(e,t){return H("unitTime",e,t)},filteredValue:null===(u=E.a.find(this.state.filterState,{key:"unitTime"}))||void 0===u?void 0:u.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"unitTime",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.unitTime.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(V,{row:t,object:"unitTime",disable:!m,type:"time",initialValue:t.annotationRow.unitTime||"00:00",rightAlign:!0,checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Total Price"),dataIndex:"totalPrice",key:"totalPrice",sorter:function(e,t){return H("totalPrice",e,t)},filteredValue:null===(d=E.a.find(this.state.filterState,{key:"totalPrice"}))||void 0===d?void 0:d.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"totalPrice",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.totalPrice.toString().indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){return c.a.createElement(V,{row:t,readOnly:!0,object:"totalPrice",disable:!m,rightAlign:!0,initialValue:M.c.formatCurrencyValue(t.annotationRow.totalPrice),checkRowIsDisable:t.annotationRow.readOnly})}},{title:A("Total Time"),dataIndex:"totalTime",key:"totalTime",sorter:function(e,t){return H("totalTime",e,t)},filteredValue:null===(p=E.a.find(this.state.filterState,{key:"totalTime"}))||void 0===p?void 0:p.selectedValues,filterDropdown:function(e){return c.a.createElement(ae,{object:"totalTime",annotationRows:N.toJS(),event:e,onChangeFilters:g.onChangeFilterState})},filterIcon:function(){return c.a.createElement(y.a,{icon:["fal","filter"]})},onFilter:function(e,t){return 0===t.annotationRow.totalTime.indexOf(e)},shouldCellUpdate:function(e,t){return JSON.stringify(e.annotationRow)!==JSON.stringify(t.annotationRow)},render:function(e,t){var n=t.annotationRow.totalTime.split(":");return c.a.createElement(V,{row:t,readOnly:!0,object:"totalTime",disable:!m,rightAlign:!0,initialValue:isNaN(n[0])&&isNaN(n[1])?"0:00":"".concat(n[0],":").concat(n[1]),checkRowIsDisable:t.annotationRow.readOnly})}}];return c.a.createElement(c.a.Fragment,null,O&&c.a.createElement(k.j,{visible:O,title:A(v?"Insert stored rows to multiple objects":"Add rows to multiple objects"),submitButtonTitle:A(v?"Insert rows":"Add rows"),onOk:this.submitConfirmDialog,onPressEnter:this.submitConfirmDialog,onCancel:this.cancelConfirmDialog,width:284},c.a.createElement("p",null,A(v?"Do you wish to insert stored rows to all currently selected objects?":"Do you wish to add rows to all currently selected objects?"))),c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement("div",{className:"Calculate_Rows_Container"},w?c.a.createElement(te,null):v?c.a.createElement(re,{setSelectedLibraryRows:this.setSelectedLibraryRows}):c.a.createElement($,{role:m,selectedRowsProp:b,selectedAnnotationsProp:T,clearSelectedRows:this.clearSelectedRows,onPasteRowsToMultipleObjects:this.onPasteRowsToMultipleObjectsHandler},c.a.createElement("div",null,c.a.createElement(P.a,{showSorterTooltip:{title:A("Change sorting order")},dataSource:N.toJS(),columns:M.b.getRole()?F:F.filter((function(e){return"totalPrice"!==e.key&&"pricePerUnit"!==e.key})),pagination:!1,rowSelection:x,bordered:!0,size:"small",onRow:function(e){return{onClick:function(){return g.selectRow(e)}}},rowKey:function(e){return"".concat(e.id)},className:"Calculate_Rows_Table"}))),c.a.createElement(R.a,{wrap:!1,className:"Calculate_Rows_Add_Wrapper",gutter:4,align:"bottom"},c.a.createElement(L.a,null,c.a.createElement(h.a,{className:"Calculate_Rows_Button_Icon ".concat(v&&"Calculate_Rows_Button_Icon--active"),onClick:function(){return g.setState({showLibrary:!g.state.showLibrary,showHints:!1,newRow:""})},icon:c.a.createElement(y.a,{icon:["fal","book"]}),disabled:!M.b.getRole(),type:"text"})),c.a.createElement(L.a,null,c.a.createElement(h.a,{className:"Calculate_Rows_Button_Icon ".concat(w&&"Calculate_Rows_Button_Icon--active"),onClick:function(){return g.setState({showHints:!w,showLibrary:!1,newRow:""})},icon:c.a.createElement(y.a,{icon:["fal","hammer"]}),disabled:!M.b.getRole(),type:"text"})),c.a.createElement(L.a,{flex:"auto"},c.a.createElement(z,{value:_,open:D,object:"insertRow",showAction:["click"],disabled:!v&&0===M.c.getRelevantSelectedAnnotations().size||!M.b.getRole(),isLibrary:v,placeholder:A("Add new row, use | to separate columns..."),onInputKeyDown:function(e){"Enter"===e.key&&_&&g.addNewRow()},onDropdownVisibleChange:function(e){return g.setState({isNewRowOpen:e})},onChange:function(e){return g.setState({newRow:e})},onBlur:function(){return g.setState({isNewRowOpen:!1})},className:"Calculate_Rows_Add_Row"})),v?c.a.createElement(L.a,null,c.a.createElement(h.a,{className:"Calculate_Rows_Button_Icon Calculate_Rows_Insert_Button",type:"primary",disabled:this.isInsertButtonDisabled(),onClick:function(){return T.size>1?g.setState({showConfirmDialog:!0}):g.insertRows()}},A("Insert"))):c.a.createElement(c.a.Fragment,null,M.b.getRole()&&c.a.createElement(c.a.Fragment,null,c.a.createElement(L.a,null,c.a.createElement(V,{readOnly:!0,value:this.calcTotalPrice(N,this.state.filterState),className:"Calculate_Rows_Currency"})),c.a.createElement(C.a,{type:"vertical",style:{height:"100%"}})),c.a.createElement(L.a,null,c.a.createElement(V,{readOnly:!0,value:this.calcTotalTime(N,this.state.filterState),className:"Calculate_Rows_Currency"})))))))}}]),n}(c.a.PureComponent),ue=Object(f.a)()(ce),de=n(30),pe=n(26),ge=n.n(pe),he=n(47),me=n(114),fe=n(2622),Ae=n(569),Ee=n(19),Te=n(2612),Se=(n(854),function(e){var t=e.isActiveAnnotation,n=e.onVisibleChange,a=e.content,o=e.visible,i=e.clearFilters,r=Object(x.a)(e,["isActiveAnnotation","onVisibleChange","content","visible","clearFilters"]),s=Object(l.useState)(o),u=Object(D.a)(s,2),d=u[0],p=u[1],g=function(){i(),p(!1)};Object(l.useEffect)((function(){t||g()}),[t]);return c.a.createElement(Te.a,Object.assign({className:"Popover"},r,{visible:d,onVisibleChange:function(e){p(e),n(e)},content:t&&c.a.createElement("div",null,a,c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","times"]}),className:"Popover_Icon_Button",onClick:g}))}))}),be=n(61),Ie=(n(855),function(e){var t=e.annotation,n=e.checkedFilters,a=e.toggleCurrentFilters,o=t.data.type,i="3DModel"===o?t.data.xfdf.status:t.data.status,r=n.includes("notStarted"),s=n.includes("progress"),l=n.includes("review"),u=n.includes("complete"),d=function(e,a){return!a||("group"===o?0===t.statuses[e]||n.filter((function(e){return t.statuses[e]>0})).length>1:i!==e)};return t&&c.a.createElement("div",{className:"Content"},c.a.createElement("div",{className:"Title_Wrapper"},be.a.getFileIcon(o),c.a.createElement("label",{className:"Title"},t.title),t.hasNegativeRow&&c.a.createElement(y.a,{className:"Exclamation_Circle_Icon",icon:"group"===o?["fal","exclamation-circle"]:v.e})),c.a.createElement("div",{className:"Icons_Container"},c.a.createElement("div",{className:r?"Icons_Wrapper":"Icons_Wrapper Inactive"},c.a.createElement(h.a,{onClick:function(){return d("notStarted",r)&&a("notStarted")},icon:c.a.createElement("div",{className:"Status_Icon"},c.a.createElement(k.m,{notStarted:!0}))}),c.a.createElement("label",null,"group"===o?t.statuses.notStarted:"notStarted"===i?1:0),r&&c.a.createElement(y.a,{className:"Green_Icon",icon:["fal","check"]})),c.a.createElement("div",{className:"Line"}),c.a.createElement("div",{className:s?"Icons_Wrapper":"Icons_Wrapper Inactive"},c.a.createElement(h.a,{onClick:function(){return d("progress",s)&&a("progress")},icon:c.a.createElement("div",{className:"Status_Icon"},c.a.createElement(k.m,{progress:!0}))}),c.a.createElement("label",null,"group"===o?t.statuses.progress:"progress"===i?1:0),s&&c.a.createElement(y.a,{className:"Green_Icon",icon:["fal","check"]})),c.a.createElement("div",{className:"Line"}),c.a.createElement("div",{className:l?"Icons_Wrapper":"Icons_Wrapper Inactive"},c.a.createElement(h.a,{onClick:function(){return d("review",l)&&a("review")},icon:c.a.createElement("div",{className:"Status_Icon"},c.a.createElement(k.m,{review:!0}))}),c.a.createElement("label",null,"group"===o?t.statuses.review:"review"===i?1:0),l&&c.a.createElement(y.a,{className:"Green_Icon",icon:["fal","check"]})),c.a.createElement("div",{className:"Line"}),c.a.createElement("div",{className:u?"Icons_Wrapper":"Icons_Wrapper Inactive"},c.a.createElement(h.a,{onClick:function(){return d("complete",u)&&a("complete")},icon:c.a.createElement("div",{className:"Status_Icon"},c.a.createElement(k.m,{complete:!0}))}),c.a.createElement("label",null,"group"===o?t.statuses.complete:"complete"===i?1:0),u&&c.a.createElement(y.a,{className:"Green_Icon",icon:["fal","check"]}))))}),ye=(n(856),function(e){var t=e.selectedKeys,n=Object(U.a)().t;return c.a.createElement("div",{className:"SelectedTreeItems-wrapper"},c.a.createElement("span",null," ",n("{{count}} selected object",{count:t.length})))}),ve=n(113),Ne=n(60),Oe=(n(857),function(e){var t=e.key,n=e.selectedAnnotations,a=(e.projectId,e.onMovePreventEditingAnnots),o=e.onChange,i=void 0!==o&&o,r=n.toJS(),s=r.filter((function(e){return"group"===e.type})),l=r.filter((function(e){return"group"!==e.type})),c=Pe(l);if(c.length>0)a(T.a.fromJS(c));else{var u=we(s),d=[],g=[];l.forEach((function(e){s.some((function(t){return t.id.toString()===e.parentId}))?d.push(e):g.push(e)}));var h=g.filter((function(e){return"Reduction"!==e.type&&"CenterValue"!==e.type&&"PerifpheralValue"!==e.type}));"root"===t&&(t=null),(h.length>0||u.length>0)&&(i?i([].concat(Object(p.a)(h),Object(p.a)(u)),t,"parentId"):M.a.onRequestAnnotationUpdateArray(T.a.fromJS([].concat(Object(p.a)(h),Object(p.a)(u))),"parentId",t)),M.a.onSetActiveParentId(t,!0);var m=M.a.getAnnotationById(t);m&&M.a.setActiveAnnotation(m)}}),we=function(e){return e.filter((function(t){return e.every((function(e){return e.id===t.id||t.parentId!==e.id.toString()}))}))},Pe=function(e){var t=[];return e.forEach((function(e){"3DModel"!==e.type?"true"===(new DOMParser).parseFromString(e.xfdf||e.xdf,"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&t.push(e):e.xfdf.readOnly&&t.push(e)})),t},Re=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(o.a)(this,n),(e=t.call(this)).state={checkedFilters:["notStarted","progress","review","complete"],popoverVisible:!1,showReplaceConfirmation:!1,height:window.innerHeight-104,popoverPlacement:"bottomLeft",popoverOffset:0,showPasteRowsDialog:!1},e.updateHeight=function(){e.setState({height:window.innerHeight-104})},e.onFolderChanged=function(t){var n=t.key;e.props.toggleContextDropdown(!1),Oe({key:n,selectedAnnotations:e.props.selectedAnnotations,projectId:Number(e.props.match.params.projectId),onMovePreventEditingAnnots:e.props.onMovePreventEditingAnnots})},e.getFolderItems=function(t){return t.sort((function(e,t){if(e.get("title")&&t.get("title")){if(e.get("title")<t.get("title"))return-1;if(e.get("title")>t.get("title"))return 1}})).map((function(t){if(t.get("children")){var n="root"===t.get("key")&&M.f.getActiveEstimate().name?M.f.getActiveEstimate().name:t.get("title"),a="root"===t.get("key")?t.get("key"):t.get("id");return c.a.createElement(K.a.SubMenu,{onTitleClick:e.onFolderChanged,key:a,title:n},e.getFolderItems(t.get("children")))}return c.a.createElement(K.a.Item,{onClick:e.onFolderChanged,key:t.get("id")},t.get("title"))}))},e.onDoubleClick=function(t,n){localStorage.setItem("expandedKeys_".concat(e.props.projectId),JSON.stringify(be.a.getTreeExpansion())),n.data.annotationId&&(!Ee.a.isActiveIfcFile()&&"3DModel"!==n.data.type||Ee.a.getActiveFileId()===n.data.geoFile.id?Ee.a.jumpToAnnotation(n.data.annotationId,!1):(localStorage.setItem("selectedAnnotation",n.data.id),e.props.redirectToFile(n.data)))},e.onDrop=function(t){be.a.onDrop(e.props.selectedAnnotations.toJS(),t)},e.toggleFilters=function(t){var n=e.state.checkedFilters;n.includes(t)?e.setState({checkedFilters:n.filter((function(e){return e!==t}))}):e.setState({checkedFilters:[].concat(Object(p.a)(n),[t])})},e.clearFilters=function(){e.setState({checkedFilters:["notStarted","progress","review","complete"],popoverVisible:!1})},e.togglePopover=function(t){t?e.setState({popoverVisible:!0}):e.clearFilters()},e.getTreeTitleTagColor=function(e){return Object(Ae.a)(e,"#000")>6.5?"#000":"#fff"},e.isLocked=function(e){if("3DModel"===e.data.type){var t=e.data.xfdf;return null===t||void 0===t?void 0:t.readOnly}var n=(new DOMParser).parseFromString(e.data.xfdf,"text/xml").querySelector("annots").firstElementChild;return n&&"true"===n.getAttribute("readOnly")},e.checkIsFolderChild=function(e){return Ee.a.getSelectedChildren().some((function(t){return t.id===e.key}))},e.renderTreeItem=function(t){var n="Polyline"===t.data.type||"Arrow"===t.data.type?t.data.color:"3DModel"===t.data.type?t.data.xfdf.color:t.data.interiorColor,a=e.isActiveAnnotation(t),o="group"!==t.data.type&&e.isLocked(t),i="group"!==t.data.type&&"3DModel"===t.data.type?t.data.xfdf.status:t.data.status,r=e.checkIsFolderChild(t);return c.a.createElement("div",{className:"Tree_Title_Item","data-cy":"calculate-tree_".concat(t.title?t.title.toLowerCase().replaceAll(" ","-"):"","--item")},Z.a.hasRows(t.data.id)&&c.a.createElement(y.a,{className:"Tree_Title_Elipsis_Icon",icon:["fal","ellipsis-h"]}),o&&c.a.createElement(y.a,{className:"Tree_Title_Lock_Icon",icon:v.f}),c.a.createElement("label",{className:a?r?"Italic":"":"Inactive"},t.title),t.hasNegativeRow&&c.a.createElement(y.a,{className:"Tree_Title_Exclamation_Circle_Icon",icon:"group"===t.data.type?["fal","exclamation-circle"]:v.e}),t.data.number&&c.a.createElement("div",{className:"Tree_Title_Tag",style:{backgroundColor:"group"===t.data.type?"#c6cacd":n,color:e.getTreeTitleTagColor("group"===t.data.type?"#c6cacd":n||"#fff")}},c.a.createElement("label",{style:{color:e.getTreeTitleTagColor("group"===t.data.type?"#c6cacd":n||"#fff")}},t.data.number)),("group"===t.data.type||"Polygon"===t.data.type)&&Object.values(t.statuses).some((function(e){return e>0}))&&c.a.createElement(Se,{content:c.a.createElement(Ie,{annotation:t,checkedFilters:e.state.checkedFilters,toggleCurrentFilters:e.toggleFilters}),trigger:"click",placement:"right",onVisibleChange:e.togglePopover,isActiveAnnotation:e.props.selectedAnnotations.size>0,clearFilters:e.clearFilters},c.a.createElement("div",{className:"Tree_Title_Statuses"},c.a.createElement(k.m,{notStarted:t.statuses.notStarted>0,progress:t.statuses.progress>0,review:t.statuses.review>0,complete:t.statuses.complete>0}))),"group"!==t.data.type&&"Polygon"!==t.data.type&&c.a.createElement(Se,{content:c.a.createElement(Ie,{annotation:t,checkedFilters:e.state.checkedFilters,toggleCurrentFilters:e.toggleFilters}),trigger:"click",placement:"right",onVisibleChange:e.togglePopover,isActiveAnnotation:e.props.selectedAnnotations.size>0,clearFilters:e.clearFilters},c.a.createElement("div",{className:"Tree_Title_Statuses"},c.a.createElement(k.m,{notStarted:"notStarted"===i||!i,progress:"progress"===i,review:"review"===i,complete:"complete"===i}))))},e.handleCopyAnnotationClick=function(){Ee.a.copyAnnotations(),e.props.closeContextDropdown()},e.handlePasteAnnotationClick=function(){Ee.a.pasteAnnotations(),e.props.closeContextDropdown()},e.filterObjects=function(t){var n=e.state.checkedFilters;return t.reduce((function e(t,a){if(n.forEach((function(n){if("3DModel"===a.data.type&&a.data.xfdf.status===n)return t.push(a),t;if(a.data.status===n&&!a.folder)return t.push(a),t;if(a.data.status===n&&"Polygon"===a.data.type&&!a.children)return t.push(a),t;if(a.data.status===n&&"Polygon"===a.data.type&&a.children){var o=a.children.reduce(e,[]);return t.push(Object(w.a)(Object(w.a)({},a),{},{children:o})),t}})),Array.isArray(a.children)&&"Polygon"!==a.data.type){var o=a.children.reduce(e,[]);o.length&&t.push(Object(w.a)(Object(w.a)({},a),{},{children:o}))}return t}),[])},e.onExpand=function(t){localStorage.setItem("expandedKeys_".concat(e.props.projectId),JSON.stringify(t)),be.a.setTreeExpansion(t)},e.selectAnnotToRightClick=function(){var t=Object(he.a)(ge.a.mark((function t(n){return ge.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(e.props.selectedAnnotations.size>0)){t.next=7;break}if(e.props.selectedAnnotations.toJS().some((function(e){return e.id===n.node.key}))){t.next=5;break}return t.next=5,be.a.calculateTreeSelectOnRightClick([n.node.key],n);case 5:t.next=9;break;case 7:return t.next=9,be.a.calculateTreeSelectOnRightClick([n.node.key],n);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),e.onCalculateTreeSelect=function(){var t=Object(he.a)(ge.a.mark((function t(n,a,o){var i,r,s,l,c,u,d;return ge.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:i=o||a,a.node&&"group"===a.node.data.type&&Ee.a.onSetActiveParentId(a.node.data.id,!0),0===n.length&&Ee.a.onSetActiveParentId(void 0,!0),i.node&&Ee.a.isActiveIfcFile()&&"group"!==i.node.data.type&&(r=i.node.data.xfdf.uuid,s=i.node,l=s.icon,c=s.title,u={node:{icon:l,id:r,key:r,title:c}},d=i.node.data.geoFile.id,M.k.setSelectedObjectFromTree([r],u,d)),be.a.calculateTreeCheck(n,a),ve.a.selectScale(null),e.state.popoverVisible&&e.onExpand(e.props.expandedKeys.concat(n));case 7:case"end":return t.stop()}}),t)})));return function(e,n,a){return t.apply(this,arguments)}}(),e.isCopyHandlerButtonDisabled=function(){return 0===Q.a.getCopyAnnotationRows().size||0===e.props.selectedAnnotations.size},e.isPasteAnnotationButtonDisabled=function(){return 0===Ee.a.getCopiedAnnotation().length},e.isPastePropertiesButtonDisabled=function(){return 0===M.d.getPropertiecCopy().size||0===e.props.selectedAnnotations.size},e.isPasteStylesButtonDisabled=function(){return 0===M.d.getStylesCopy().size||0===e.props.selectedAnnotations.size},e.checkIfNodeIsReadOnly=function(e){if(Ee.a.isActiveIfcFile())return"false";if("group"===e.first().get("type"))return"false";var t=(new DOMParser).parseFromString(e.first().get("xfdf"),"text/xml").querySelector("annots").firstElementChild;return t.getAttribute("readOnly")?t.getAttribute("readOnly"):"false"},e.deleteNodesHandler=function(t){if(t.size>1)return e.props.onDeleteAnnotations(),void e.props.closeContextDropdown();0!==t.size&&-1!==t.toJS()[0].id?(("group"===t.first().getIn(["type"])||"false"===e.checkIfNodeIsReadOnly(t))&&e.deleteHandler.deleteAnnotations(t),e.props.closeContextDropdown()):e.props.closeContextDropdown()},e.isActiveAnnotation=function(e){return!!e&&("group"===e.data.type||Ee.a.getActiveFileId()===e.data.geoFile.id)},e.checkOnDrag=function(t){var n={selectedNodes:[t.node],node:t.node};if(e.props.selectedKeys.length>0)return e.props.selectedKeys.find((function(e){return t.node.key===e}))?void 0:void e.onCalculateTreeSelect([t.node.key],n,t);e.onCalculateTreeSelect([t.node.key],n,t)},e.onRightClick=function(t){"ant-tree-list"===t.target.className&&(be.a.setTreeSelection([]),be.a.currentlySelectedNodes=T.a.fromJS([]),Ee.a.deSelectAllAnnotationsFromGui());var n=window.innerHeight/2>t.pageY,a=n?window.innerHeight-t.pageY-545:t.pageY-545,o=a<0?"".concat(n?-a:a,"px"):"100%";e.setState({popoverPlacement:n?"bottomLeft":"topLeft",popoverOffset:o})},e.submitPasteRows=function(){Q.a.pasteAnnotationRows(e.props.selectedAnnotations),e.setState({showPasteRowsDialog:!1})},e.onDropHandler=function(t,n){var a=t.filter((function(e){return"group"!==e.type})),o=Pe(a);o.length>0?e.props.onMovePreventEditingAnnots(T.a.fromJS(o)):be.a.onDrop(t,n)},e.deleteHandler=new O.a,e.role=Ne.a.getRole(),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){window.addEventListener("resize",this.updateHeight)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.updateHeight)}},{key:"removeReadOnlyAnnotations",value:function(){var e=new T.a.List;return Ee.a.isActiveIfcFile()?this.props.selectedAnnotations:(this.props.selectedAnnotations.forEach((function(t){var n=(new DOMParser).parseFromString(t.get("xfdf"),"text/xml");"group"!==t.get("type")?"true"!==n.querySelector("annots").firstElementChild.getAttribute("readOnly")&&(e=e.push(t)):e=e.push(t)})),e)}},{key:"render",value:function(){var e,t=this,n=this.props.t,a=c.a.createElement(K.a,{style:"topLeft"===this.state.popoverPlacement?{position:"absolute",bottom:this.state.popoverOffset}:{bottom:this.state.popoverOffset}},c.a.createElement(K.a.ItemGroup,{key:"folder",title:n("Folder")},c.a.createElement(K.a.Item,{onClick:function(){N.a.requestAnnotationFolderCreate("Folder"),t.props.closeContextDropdown()}},n("Add Folder")),c.a.createElement(K.a.Divider,null)),c.a.createElement(K.a.ItemGroup,{key:"move",title:n("Move")},c.a.createElement(K.a.SubMenu,{title:n("Move"),disabled:0===this.props.selectedAnnotations.size||Ee.a.isActiveIfcFile()},this.getFolderItems(Ee.a.getMoveFolderTree()))),c.a.createElement(K.a.ItemGroup,{key:"annotation",title:n("Annotation")},c.a.createElement(K.a.Item,{onClick:this.handleCopyAnnotationClick,disabled:0===this.props.selectedAnnotations.size||Ee.a.isActiveIfcFile()},n("Copy")),c.a.createElement(K.a.Item,{onClick:this.handlePasteAnnotationClick,disabled:this.isPasteAnnotationButtonDisabled()||Ee.a.isActiveIfcFile()},n("Paste")),c.a.createElement(K.a.Divider,null),c.a.createElement(K.a.Item,{onClick:function(){M.d.copyAnnotationProperties(),t.props.closeContextDropdown()},disabled:1!==this.props.selectedAnnotations.size||Ee.a.isActiveIfcFile()},c.a.createElement(me.a,{placement:"right",title:n("Height, Quantity and Tiles")},n("Copy Properties"))),c.a.createElement(K.a.Item,{onClick:function(){M.d.pasteAnnotationProperties(t.props.selectedAnnotations),t.props.closeContextDropdown()},disabled:this.isPastePropertiesButtonDisabled()||Ee.a.isActiveIfcFile()},c.a.createElement(me.a,{placement:"right",title:n("Replaces all properties with copied properties")},n("Paste Properties"))),c.a.createElement(K.a.Divider,null),c.a.createElement(K.a.Item,{disabled:1!==this.props.selectedAnnotations.size,onClick:function(){M.d.copyAnnotationStyles(),t.props.closeContextDropdown()}},c.a.createElement(me.a,{placement:"right",title:n("Color, Opacity, Thickness and Icon")},n("Copy Styles"))),c.a.createElement(K.a.Item,{disabled:this.isPasteStylesButtonDisabled(),onClick:function(){M.d.pasteAnnotationStyles(t.props.selectedAnnotations),t.props.closeContextDropdown()}},c.a.createElement(me.a,{placement:"right",title:n("Replaces all styles with copied styles")},n("Paste Styles"))),c.a.createElement(K.a.Divider,null),c.a.createElement(K.a.Item,{onClick:function(){Q.a.copyAnnotationRows(t.props.selectedAnnotations),t.props.closeContextDropdown()},disabled:0===this.props.selectedAnnotations.size},c.a.createElement(me.a,{placement:"right",title:n("Copies all rows")},n("Copy Rows"))),c.a.createElement(K.a.Item,{onClick:function(){t.props.selectedAnnotations.size>1?t.setState({showPasteRowsDialog:!0}):Q.a.pasteAnnotationRows(t.props.selectedAnnotations),t.props.closeContextDropdown()},disabled:this.isCopyHandlerButtonDisabled()},c.a.createElement(me.a,{placement:"right",title:n("Adds copied rows")},n("Paste Rows"))),c.a.createElement(K.a.Item,{disabled:this.isCopyHandlerButtonDisabled(),onClick:this.props.onOpenReplaceRows},c.a.createElement(me.a,{placement:"right",title:n("Replaces all rows with copied rows")},n("Replace Rows")))),c.a.createElement(K.a.Divider,null),c.a.createElement(K.a.Item,{onClick:function(){t.props.onDeleteAnnotations(),t.props.closeContextDropdown()},disabled:0===this.props.selectedAnnotations.size,danger:!0},n("Delete")),c.a.createElement(K.a.Divider,null),c.a.createElement(K.a.Item,null,n("{{count}} selected object",{count:this.props.selectedKeys.length})));return c.a.createElement(c.a.Fragment,null,this.state.showPasteRowsDialog&&c.a.createElement(k.j,{visible:this.state.showPasteRowsDialog,title:n("Add rows to multiple objects"),submitButtonTitle:n("Add rows"),onOk:this.submitPasteRows,onPressEnter:this.submitPasteRows,onCancel:function(){return t.setState({showPasteRowsDialog:!1})},width:284},c.a.createElement("p",null,n("Do you wish to add rows to all currently selected objects?"))),c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement("div",{onContextMenu:this.onRightClick,style:{height:"100%"}},c.a.createElement(m.a,{trigger:this.role?["contextMenu"]:[],overlay:a,placement:this.state.popoverPlacement,visible:this.props.contextVisible,onVisibleChange:this.props.toggleContextDropdown,overlayStyle:{height:"100%"}},c.a.createElement(fe.a.DirectoryTree,(e={className:"Tree",treeData:this.state.popoverVisible?this.filterObjects(this.props.treeData):this.props.treeData,titleRender:this.renderTreeItem,defaultExpandAll:!0,onSelect:this.onCalculateTreeSelect,selectedKeys:this.props.selectedKeys||[],showLine:{showLeafIcon:!1},disabled:!0,multiple:!0,onRightClick:this.selectAnnotToRightClick,expandedKeys:this.props.expandedKeys,onExpand:this.onExpand,expandAction:"doubleClick",ref:this.props.forwardedRef,draggable:this.role,onDragStart:function(e){return t.checkOnDrag(e)},onDrop:function(e){return t.onDropHandler(t.props.selectedAnnotations.toJS(),e)}},Object(de.a)(e,"draggable",(function(e){return"Reduction"!==e.data.type&&t.role})),Object(de.a)(e,"onDoubleClick",this.onDoubleClick),Object(de.a)(e,"height",0===this.props.selectedKeys.length?this.state.height:this.state.height-30),e))))),this.props.selectedKeys.length>0&&c.a.createElement(ye,{selectedKeys:this.props.selectedKeys}))}}]),n}(c.a.PureComponent),Le=c.a.forwardRef((function(e,t){var n=Object(U.a)().t;return c.a.createElement(Re,Object.assign({},e,{forwardedRef:t,t:n}))})),Ce=(n(858),function(e){var t=e.treeData,n=e.openLinkingModal,a=e.selectedKeys,o=function(){var e=Object(he.a)(ge.a.mark((function e(t,a){var o,i,r,s;return ge.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=M.a.getAnnotations().toJS(),!(i=o.find((function(e){return"group"!==e.type&&e.xfdf.uuid===a.node.key&&e.geoFile.id===M.a.getActiveFileId()})))){e.next=7;break}return r={data:i,icon:i.icon,key:i.key,parent:i.parent,title:i.title},s={selectedNodes:[r]},e.next=7,M.q.calculateTreeSelect([i.id],s);case 7:M.k.setSelectedObjectFromTree(t,a),M.k.getLinkState()&&M.k.canLinkObejct()&&a.node.isLeaf?n():i||M.q.calculateTreeSelect([],{selectedNodes:[]}),0===t.length&&a.node.parentId&&M.k.setSelectedObjectFromTree([a.node.parentId]);case 10:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}();return c.a.createElement("div",{className:"Ifc_Tree"},c.a.createElement("label",{className:"Ifc_Tree_Title"},"Model structure"),!Object(A.isEmpty)(t)&&c.a.createElement(fe.a,{treeData:t,autoExpandParent:!0,showIcon:!0,onSelect:function(e,t){return o(e,t)},selectedKeys:a,expandedKeys:a,blockNode:!0}))}),_e=n(156),Me=(n(859),function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"render",value:function(){var e=this;return c.a.createElement("div",{className:"Sidebar"},c.a.createElement(h.a,{icon:c.a.createElement(y.a,{className:"Sidebar_Button_Icon",icon:["fal","home"]}),type:"link",onClick:function(){return e.props.history.push("/projects")},className:"Sidebar_Button ".concat("projects"===this.activeRoute&&"Sidebar_Button--active")}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{className:"Sidebar_Button_Icon",icon:["fal","info-circle"]}),type:"link",onClick:function(){return e.props.history.push("/projects/".concat(e.props.match.params.projectId,"/overview"))},className:"Sidebar_Button ".concat("overview"===this.activeRoute&&"Sidebar_Button--active"),disabled:"projects"===this.activeRoute}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{className:"Sidebar_Button_Icon",icon:["fal","folders"]}),type:"link",onClick:function(){M.a.resetAnnotationTypeMap(),e.props.history.push("/projects/".concat(e.props.match.params.projectId,"/drive"))},className:"Sidebar_Button ".concat("drive"===this.activeRoute&&"Sidebar_Button--active"),disabled:"projects"===this.activeRoute}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{className:"Sidebar_Button_Icon",icon:["fal","calculator"]}),type:"link",onClick:function(){return e.props.history.push("/projects/".concat(e.props.match.params.projectId,"/calculate/").concat(e.fileId))},className:"Sidebar_Button ".concat("/projects/:projectId/calculate/:fileId"===this.props.match.path&&"Sidebar_Button--active"),disabled:!this.fileId||"projects"===this.activeRoute||"folder"===this.props.type}))}},{key:"activeRoute",get:function(){return this.props.location.pathname.split("/").pop()}},{key:"fileId",get:function(){return this.props.fileId||this.props.match.params.fileId}}]),n}(c.a.PureComponent)),ke=Object(d.i)(Me),De=n(155),xe=function(e){return function(t){Object(r.a)(a,t);var n=Object(s.a)(a);function a(){var e;Object(o.a)(this,a);for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];return(e=n.call.apply(n,[this].concat(i))).state={hasLoggedIn:Ne.a.isLoggedIn(),acceptedTermsOfSerivce:Ne.a.getTermsOfSerive()},e}return Object(i.a)(a,[{key:"componentDidMount",value:function(){var e=this;this.unsubscribeMessageReceived=De.a.messageReceived.listen((function(t){200===t&&e.state.acceptedTermsOfSerivce&&(e.setState({hasLoggedIn:!0}),M.l.getSocketStatus()||M.l.onInitSocket())}))}},{key:"componentWillUnmount",value:function(){this.unsubscribeMessageReceived()}},{key:"render",value:function(){return this.state.hasLoggedIn?c.a.createElement(e,this.props):localStorage.getItem("credentials")&&this.state.acceptedTermsOfSerivce?(De.a.loginWithStoredCredentials(),null):void(window.location.href="/")}}]),a}(c.a.PureComponent)},Fe=n(15),je=n(55),Ve=n(102),Ue=n(89),We=(n(860),function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"componentDidMount",value:function(){M.a.initValueInheritance(this.props.projectId),M.k.initValueInheritance(),M.a.isAnnotationActionDone()||(Ue.a.requestOpenProject(this.props.projectId),Ue.a.requestProject(this.props.projectId)),M.a.createWebViewer(this.props.fileId,document.getElementById("webviewer"))}},{key:"componentWillUnmount",value:function(){M.a.cleanup()}},{key:"render",value:function(){return c.a.createElement("div",{className:"CalculatePdf_Wrapper"},c.a.createElement("div",{className:"WebViewer_Hide_Element",style:{visibility:this.props.isResize?"visible":"hidden"}}),c.a.createElement("div",{id:"webviewer",className:"CalculatePdf_WebViewer"},c.a.createElement(h.a,{className:"".concat(this.props.scaleAdded&&"CalculatePdf_Scale--hidden"," CalculatePdf_Scale"),disabled:!this.props.role,onClick:function(){M.a.setToolMode("AnnotationCreateScale")},icon:c.a.createElement(y.a,{icon:["fal","ruler"]})})))}}]),n}(c.a.PureComponent)),Be=function(e){return e?6*(e.toString().length+1)+10:20},He=(a={},Object(de.a)(a,je.e,je.c),Object(de.a)(a,je.f,je.d),a),Je=function(e){var t,n,a=e.activeScaleButton,o=e.onIconClick,i=e.scaleName,r=e.value,s=e.handleScaleChange,l=e.validateScale,u=e.length,d=e.icon,p=e.onScaleDelete,g=e.hideDeleteOption,h=void 0!==g&&g,f=e.activePage,E=Object(U.a)().t,T=c.a.createElement(K.a,null,!h&&c.a.createElement(K.a.Item,{key:"delete",onClick:p},E("Delete")));return c.a.createElement(m.a,{overlay:T,trigger:["contextMenu"]},c.a.createElement("div",{className:"".concat(a===i&&"AnnotationCreateScale"===Ee.a.currentToolMode&&"Calculate_Wrapper_Toolbar_Scale--active"," Calculate_Wrapper_Toolbar_Scale_Wrapper")},c.a.createElement(R.a,{justify:"center",align:"middle",className:"Calculate_Wrapper_Toolbar_Scale_Icon",onClick:o},c.a.createElement(y.a,{icon:d,style:{color:(t=i,n=f,Object(A.get)(ve.a.getScale(t,n),"color"))}})),c.a.createElement(F.a,{type:"number",disabled:Object(Ve.b)()!==i,value:r,suffix:"m",className:"Calculate_Wrapper_Toolbar_Scale_Input",onChange:s,onBlur:l,onPressEnter:l,style:{width:Be(u)}})))},ze=n(2626),Ge=(n(861),function(e){var t=function(e){switch(e.type){case"Polyline":case"Arrow":return e.color;default:return e.interiorColor}}(e);return c.a.createElement(ze.b.Item,{className:"List_Item"},c.a.createElement("div",{className:"List_Item_Icon_Wrapper"},M.q.getFileIcon(e.type)),"group"!==e.type&&c.a.createElement("div",{className:"List_Item_Status_Icon"},c.a.createElement(k.m,{notStarted:"notStarted"===e.status||"notStarted"===e.xfdf.status||!e.status&&!e.xfdf.status,progress:"progress"===e.status||"progress"===e.xfdf.status,review:"review"===e.status||"review"===e.xfdf.status,complete:"complete"===e.status||"complete"===e.xfdf.status})),"group"!==e.type&&"3DModel"!==e.type&&c.a.createElement("div",{className:"List_Item_Square",style:{backgroundColor:t}}),"group"!==e.type&&c.a.createElement("label",null,e.number),c.a.createElement("label",null,e.name))}),qe=function(e){var t=e.visible,n=e.onCancel,a=e.annotationLists,o=e.onAccept,i=Object(U.a)().t;return a.readOnlyList.size>0?c.a.createElement(k.j,{className:"Modal",title:i("Delete Objects"),visible:t,onCancel:n,activeButtons:c.a.createElement("div",null)},c.a.createElement("label",null,"".concat(i("You are unable to delete this selection because it contains locked objects. Please unlock them before deleting or move them to a different location"),".")),c.a.createElement(ze.b,{className:"List",dataSource:a.readOnlyList.toJS(),renderItem:function(e){return Ge(e)}})):c.a.createElement(k.j,{className:"Modal",title:i("Delete Objects"),visible:t,onOk:o,onCancel:n,submitButtonTitle:i("Delete")},c.a.createElement("label",null,"".concat(i("Please confirm deletion of the following objects"),":")),c.a.createElement(ze.b,{className:"List",dataSource:a.readWriteList.toJS(),renderItem:function(e){return Ge(e)}}))},Xe=n(355),Ye=n(427),Ke=[{key:"type-number-name",label:"Type > Nr/Tag > Name (Default)"},{key:"type-name-number",label:"Type > Name > Nr/Tag"},{key:"number-type-name",label:"Nr/Tag > Type > Name"},{key:"name-number-type",label:"Name > Nr/Tag > Type"},{key:"name-type-number",label:"Name > Type > Nr/Tag"},{key:"type-number",label:"Type > Nr/Tag"},{key:"type-name",label:"Type > Name"},{key:"number-type",label:"Nr/Tag > Type"},{key:"number-name",label:"Nr/Tag > Name"},{key:"name-type",label:"Name > Type"},{key:"name-number",label:"Name > Nr/Tag"},{key:"type",label:"Type"},{key:"number",label:"Nr/Tag"},{key:"name",label:"Name"}],Ze=function(e,t){var n=Object(U.a)().t;return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},c.a.createElement(Xe.a.Group,{onChange:e,value:t},Object(A.map)(Ke,(function(t){return c.a.createElement(Xe.a,{key:t.key,onChange:e,value:t.key,className:"InnerToolbar_SubmenuRadio"},n(t.label))}))))},Qe=function(e){localStorage.setItem("calculatePageLayout",e.target.value),M.a.setDisplayMode(e.target.value)},$e=function(e){localStorage.setItem("snapMode",e.target.value),M.a.setSnapMode(e.target.value)},et=function(e){var t=Object(U.a)().t;return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},c.a.createElement(Xe.a.Group,{onChange:Qe,value:e},c.a.createElement(Xe.a,{value:"single",className:"InnerToolbar_SubmenuRadio"},t("Single")),c.a.createElement(Xe.a,{value:"single-noscroll",className:"InnerToolbar_SubmenuRadio"},t("Single Locked")),c.a.createElement(Xe.a,{value:"multi",className:"InnerToolbar_SubmenuRadio"},t("Multi"))))},tt=function(e){var t=Object(U.a)().t;return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},c.a.createElement(Xe.a.Group,{onChange:$e,value:e},c.a.createElement(Xe.a,{value:"end-of-line",className:"InnerToolbar_SubmenuRadio"},t("End of Line")),c.a.createElement(Xe.a,{value:"points",className:"InnerToolbar_SubmenuRadio"},t("Points")),c.a.createElement(Xe.a,{value:"end-mid-line",className:"InnerToolbar_SubmenuRadio"},t("End and Mid Line"))))},nt=function(e,t){var n=Object(U.a)().t;return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},c.a.createElement(K.a.Item,{onClick:e},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"Calculate_Submenu_Icon"},c.a.createElement(y.a,{icon:["fal","edit"]})),c.a.createElement("span",{className:"Calculate_Submenu_Item_Label"},n("Templates")))),c.a.createElement(C.a,null),Object(A.map)(M.p.getCalcTemplates(),(function(e){return c.a.createElement(K.a.Item,{onClick:function(){_.g.sendUpdate({action:"add_template_to_calculate_folder",folderId:-1===M.a.getActiveParentId()?null:M.a.getActiveParentId(),templateId:e.id,estimateId:M.a.getActiveEstimate().get("id"),companyId:M.m.getActiveProject().toJS().department.company.id}),t(!1)}},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"Calculate_Submenu_Icon"},c.a.createElement(y.a,{icon:["fal","folder-open"]})),c.a.createElement("div",{className:"Calculate_Submenu_Item_WrapName"},e.name)))})))},at=function(e){var t=e.toggleRows,n=e.isToggleRows,a=e.toggleProperties,o=e.isToggleProperties,i=e.toggleDocument,r=e.isToggleDocument,s=e.allKeysSelected,l=e.collapseAll,u=e.expandAll,d=e.allKeysExpanded,p=e.treeSorting,g=e.displayMode,h=e.snapMode,m=e.changeTreeSorting,f=e.toggleTemplateDialog,A=e.switchShowSubmenu,E=M.b.getRole();return[{onClick:function(){return M.a.rotatePDF()},icon:c.a.createElement(y.a,{icon:["fal","redo"]}),display:!0,label:"Rotate",shortcut:"Alt + R"},{onClick:function(e){return M.a.undoDrawing(e,!0)},icon:c.a.createElement(Ye.UndoOutlined,null),disabled:!E,display:!0,label:"Undo",shortcut:"Ctrl + Z"},{onClick:function(){return M.a.zoomInPDF()},icon:c.a.createElement(y.a,{icon:["fal","search-plus"]}),display:!0,label:"Zoom In",shortcut:"Ctrl + +"},{onClick:function(){return M.a.zoomOutPDF()},icon:c.a.createElement(y.a,{icon:["fal","search-minus"]}),display:!0,label:"Zoom Out",shortcut:"Ctrl + -"},{icon:c.a.createElement(y.a,{icon:["fal","sign-in"]}),onDropdownOverlay:nt(f,A),dropdownTrigger:"click",display:E,label:"Import Template"},{divider:!0},{onClick:i,icon:c.a.createElement(y.a,{icon:["fal","copy"]}),className:r?"Calculate_Submenu_Icon--active":null,display:!0,label:"File"},{onClick:t,icon:c.a.createElement(y.a,{icon:["fal","tasks-alt"]}),className:n?"Calculate_Submenu_Icon--active":null,display:!0,label:"Rows"},{onClick:a,icon:c.a.createElement(y.a,{icon:["fal","info-circle"]}),className:o?"Calculate_Submenu_Icon--active":null,display:!0,label:"Properties"},{divider:!0},{onClick:function(){return M.a.selectAll()},icon:c.a.createElement(y.a,{icon:["fal","check-square"]}),display:!s,label:"Select All",shortcut:"Ctrl + A"},{onClick:function(){return M.q.calculateTreeSelect([],{selectedNodes:[]})},icon:c.a.createElement(y.a,{icon:["fal","square"]}),display:s,label:"Deselect All"},{onClick:function(){return u()},icon:c.a.createElement(y.a,{icon:["fal","plus-square"]}),disabled:d,display:!0,label:"Expand All",shortcut:"Ctrl + Shift + E"},{onClick:function(){return l()},icon:c.a.createElement(y.a,{icon:["fal","minus-square"]}),disabled:!d,display:!0,label:"Collapse All",shortcut:"Ctrl + Shift + W"},{icon:c.a.createElement(y.a,{icon:["fal","sort-circle"]}),onDropdownOverlay:Ze(m,p),dropdownTrigger:["click"],display:!0,label:"Sorting"},{divider:!0},{icon:c.a.createElement(Ye.SettingOutlined,null),onDropdownOverlay:et(g),dropdownTrigger:"click",display:!0,label:"Layout Mode"},{icon:c.a.createElement(y.a,{icon:["fal","magnet"]}),onDropdownOverlay:tt(h),dropdownTrigger:"click",display:!0,label:"SnapOn Mode"}]},ot=(n(2444),function(e){var t=e.toggleRows,n=e.isToggleRows,a=e.toggleProperties,o=e.isToggleProperties,i=e.toggleDocument,r=e.isToggleDocument,s=e.allKeysSelected,l=e.collapseAll,u=e.expandAll,d=e.renderPdfMenu,p=e.allKeysExpanded,g=e.treeSorting,h=e.displayMode,f=e.changeTreeSorting,E=e.snapMode,T=e.toggleTemplateDialog,S=e.switchShowSubmenu,b=Object(U.a)().t;return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},Object(A.map)(at({toggleRows:t,isToggleRows:n,toggleProperties:a,isToggleProperties:o,toggleDocument:i,isToggleDocument:r,allKeysSelected:s,collapseAll:l,expandAll:u,renderPdfMenu:d,allKeysExpanded:p,treeSorting:g,displayMode:h,changeTreeSorting:f,snapMode:E,toggleTemplateDialog:T,switchShowSubmenu:S}),(function(e){return e.display?e.onDropdownOverlay&&e.dropdownTrigger?c.a.createElement(K.a.Item,null,c.a.createElement(m.a,{overlay:e.onDropdownOverlay,placement:"bottomRight",overlayClassName:"Calculate_Submenu_Dropdown"},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"Calculate_Submenu_Icon"},e.icon),c.a.createElement("span",{className:"Calculate_Submenu_Item_Label"},b(e.label)),c.a.createElement("span",{className:"Calculate_Submenu_Shortcut"},c.a.createElement(y.a,{icon:["fal","chevron-right"]}))))):c.a.createElement(K.a.Item,{onClick:e.onClick,disabled:e.disabled},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"".concat(e.className," Calculate_Submenu_Icon")},e.icon),c.a.createElement("span",{className:"Calculate_Submenu_Item_Label"},b(e.label)),c.a.createElement("span",{className:"Calculate_Submenu_Shortcut"},b(e.shortcut)))):e.divider&&c.a.createElement(K.a.Divider,null)})))}),it=n(584),rt=["#A7ACB1","#000000","#333333","#666666","#999999","#CCCCCC","#DDDDDD","#E61C27","#FF0000","#CF2A27","#990000","#CC0000","#E06666","#EA9999","#FF6921","#FFA500","#FF9900","#B45F06","#E69138","#F6B26B","#F9CB9C","#F5B200","#FFFF00","#E8E800","#BF9000","#F1C232","#FFD966","#FFE599","#00CF83","#00FF00","#5AB14A","#38761D","#6AA84F","#93C47D","#B6D7A8","#47ECD5","#00FFFF","#00E8E8","#134F5C","#45818E","#76A5AF","#A2C4C9","#0AB1E1","#0000FF","#2B78E4","#085394","#597EAA","#6FA8DC","#9FC5F8","#9775FA","#A217FF","#8C00E8","#351C75","#674EA7","#8E7CC3","#B4A7D6","#FD449F","#FF00FF","#E800E8","#741B47","#A64D79","#C27BA0","#D5A6BD"],st=(n(2551),function(e){var t=e.visible,n=e.colorPickerRef,a=e.color,o=e.changeColor;return c.a.createElement("div",{className:"Color_Picker_Container"},t&&c.a.createElement("div",{ref:n,className:"Color_Picker_Wrapper"},c.a.createElement(it.a,{color:a,name:"color",onChangeComplete:o,colors:rt,className:"Twitter_Picker"})))}),lt=n(2624),ct=n(193),ut=(n(2552),function(e){var t=e.values,n=e.onChange,a=Object(U.a)().t;return c.a.createElement("div",{className:"Workflow"},c.a.createElement(R.a,null,c.a.createElement(L.a,{span:24},c.a.createElement("label",null,a("Status")),c.a.createElement(G.a,{placeholder:"Select status",onChange:n,value:t.status,className:"Workflow_Select",disabled:t.preventEditing},oe.a.map((function(e,t){return c.a.createElement(G.a.Option,{value:e.value,key:t},c.a.createElement(R.a,{wrap:!1},c.a.createElement(L.a,{className:"Workflow_Select_Icon_Wrapper"},c.a.createElement(R.a,{align:"middle",justify:"center",className:"Workflow_Select_Icon"},c.a.createElement(e.StatusIcon,null))),c.a.createElement(L.a,null,a(e.label))))}))))))}),dt=n(2620),pt=(n(2553),function(e){var t,n=e.nameInput,a=e.nrTagInput,o=e.onChange,i=e.values,r=e.onAccept,s=e.shouldDisplayInputs,l=e.role,u=Object(U.a)().t;return c.a.createElement(c.a.Fragment,null,c.a.createElement(R.a,{gutter:[0,8]},s&&c.a.createElement(c.a.Fragment,null,c.a.createElement(L.a,{span:24},u("Group"),c.a.createElement(dt.a,{treeData:i.groupData,treeDefaultExpandAll:!0,value:Ee.a.getPathForAnnotation(i.group),onChange:o.group,suffixIcon:c.a.createElement(y.a,{icon:v.c}),disabled:i.preventEditing||"Reduction"===i.type||!l})),c.a.createElement(L.a,{span:8},c.a.createElement("label",null,u("Nr / Tag"),c.a.createElement(F.a,{ref:a,name:"number",onPressEnter:r.number,onBlur:r.number,value:i.number,onChange:o.number,className:"Input-Edit Center",disabled:i.preventEditing||!l}))),c.a.createElement(L.a,{span:14,offset:2},c.a.createElement("label",null,u("Name"),c.a.createElement(F.a,(t={ref:n,className:"info-name",name:"name",onPressEnter:r.name,onBlur:r.name,value:i.name,onChange:o.name},Object(de.a)(t,"className","Input-Edit"),Object(de.a)(t,"disabled",i.preventEditing||!l),t))))),c.a.createElement(L.a,{span:24},c.a.createElement(k.o,{onChange:o.preventEditing,label:"Prevent editing",checked:i.preventEditing,disabled:!l})),"x-scale"!==i.type&&"y-scale"!==i.type&&"group"!==i.type&&c.a.createElement(L.a,{span:24},c.a.createElement(k.o,{onChange:o.lockAspectRatio,disabled:!i.annotationsWithAspectRatio||i.preventEditing||!l,label:"Lock aspect ratio",checked:i.lockAspectRatio}))))}),gt=function(e,t,n,a,o){return{key:e,variable:t,part:n,value:a.toLocaleString({minimumFractionDigits:3}),unit:o}},ht=function(e){return[{title:"",dataIndex:"variable",key:"variable",size:1},{title:"Part",dataIndex:"part",key:"part"},{title:"Value",dataIndex:"value",key:"value",align:"right",render:e}]},mt=n(586),ft=(n(2558),function(e){var t=e.role,n=e.displayAnnot,a=e.clickedRowKey,o=e.formulaValue,i=e.formulaVariable,r=e.resetState,s=e.handleChange,u=e.handleRowClick,d=e.values,g=e.splitPosRight,h=e.annotationsToUpdate,m=e.onChangeValues,f=Object(l.useState)([]),E=Object(D.a)(f,2),T=E[0],S=E[1],b=Object(U.a)().t,I=n?n.get("type"):"";Object(l.useEffect)((function(){"3DModel"===I&&y()}),[n]);var y=function(){if(!n)return[];var e=[],t=1,a=Ee.a.getCalculatedSum();if(a){if(a.get("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS")>1){var o=gt(t++,"","Objects",a.get("ESTIMATE.ANNOTATION_VALUES.ANNOTATIONS"));e.push(o)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.AREA"))){var i=gt(t++,"A",b("Area"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.AREA")),"m\xb2");e.push(i)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.LENGTH"))){var r=gt(t++,"L",b("Length"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.LENGTH")),"m");e.push(r)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.VOLUME"))){var s=gt(t++,"VO",b("Volume"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.VOLUME")),"m\xb3");e.push(s)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.WALL"))){var l=gt(t++,"V","Wall",M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.WALL")),"m\xb2");e.push(l)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.NET_AREA"))){var c=gt(t++,"NA",b("Net: Area"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.NET_AREA")),"m\xb2");e.push(c)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.NET_LENGTH"))){var u=gt(t++,"NL",b("Net: Length"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.NET_LENGTH")),"m");e.push(u)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.NET_VOLUME"))){var d=gt(t++,"NVO",b("Net: Volume"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.NET_VOLUME")),"m\xb3");e.push(d)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.NET_WALL"))){var g=gt(t++,"NV",b("Net: Wall"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.NET_WALL")),"m\xb2");e.push(g)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.POINTS"))){var h=gt(t++,"P",b("Points"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.POINTS")),b("pcs"));e.push(h)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.RADIUS_X"))){var m=gt(t++,"RX",b("Radius X"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.RADIUS_X")),"m");e.push(m)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y"))){var f=gt(t++,"RY",b("Radius Y"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.RADIUS_Y")),"m");e.push(f)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X"))){var E=gt(t++,"DX",b("Diameter X"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.DIAMETER_X")),"m");e.push(E)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y"))){var T=gt(t++,"DY",b("Diameter Y"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.DIAMETER_Y")),"m");e.push(T)}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.EDGES"))){var y=a.get("ESTIMATE.ANNOTATION_VALUES.EDGES").toJS().map((function(e,n){return gt(t++,"L".concat(n+1),b("Edge {{count}}",{count:n+1}),M.c.formatAmountValue(e),"m")}));e.push.apply(e,Object(p.a)(y))}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.SL"))){var N=a.get("ESTIMATE.ANNOTATION_VALUES.SL").toJS().map((function(e,n){return gt(t++,"SL".concat(n+1),b("Side Length {{count}}",{count:n+1}),M.c.formatAmountValue(e),"m")}));e.push.apply(e,Object(p.a)(N))}if(!Object(A.isNil)(a.get("ESTIMATE.ANNOTATION_VALUES.S"))){var O=a.get("ESTIMATE.ANNOTATION_VALUES.S").toJS().map((function(e,n){return gt(t++,"S".concat(n+1),b("Side {{count}}",{count:n+1}),M.c.formatAmountValue(e),"m\xb2")}));e.push.apply(e,Object(p.a)(O))}}var w=v();return"3DModel"===I&&S(e.concat(w)),e.concat(w)},v=function(){if(!n)return[];var e=[],t=100,a=Ee.a.getCalculatedSum();if(a){if(a.get("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X")){var o=gt(t++,"DX",b("Outer Dim. X"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_X")),"m");e.push(o)}if(a.get("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y")){var i=gt(t++,"DY",b("Outer Dim. Y"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.OUTER_DIM_Y")),"m");e.push(i)}if(a.get("ESTIMATE.ANNOTATION_VALUES.AREA_TILES")){var r=gt(t++,"T",b("NA: Tiles"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.AREA_TILES")),b("pcs"));e.push(r)}if(a.get("ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_LENGTH")){var s=gt(t++,"JL",b("NA: Joint length"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_LENGTH")),"m");e.push(s)}if(a.get("ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_VOLUME")){var l=gt(t++,"JVO",b("NA: Joint volume"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.AREA_JOINT_VOLUME")),"m\xb3");e.push(l)}if(a.get("ESTIMATE.ANNOTATION_VALUES.WALL_TILES")){var c=gt(t++,"VT",b("NV: Tiles"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.WALL_TILES")),b("pcs"));e.push(c)}if(a.get("ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_LENGTH")){var u=gt(t++,"VJL",b("NV: Joint length"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_LENGTH")),"m");e.push(u)}if(a.get("ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_VOLUME")){var d=gt(t++,"VJVO",b("NV: Joint volume"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.WALL_JOINT_VOLUME")),"m\xb3");e.push(d)}if(a.get("ESTIMATE.ANNOTATION_VALUES.RED_AREA")){var p=gt(t++,"RA",b("Red. Area"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.RED_AREA")),"m\xb2");e.push(p)}if(a.get("ESTIMATE.ANNOTATION_VALUES.RED_LENGTH")){var g=gt(t++,"RL",b("Red. Length"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.RED_LENGTH")),"m");e.push(g)}if(a.get("ESTIMATE.ANNOTATION_VALUES.RED_VOLUME")){var h=gt(t++,"RVO",b("Red. Volume"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.RED_VOLUME")),"m\xb3");e.push(h)}if(a.get("ESTIMATE.ANNOTATION_VALUES.RED_WALL")){var m=gt(t++,"RV",b("Red. Wall"),M.c.formatAmountValue(a.get("ESTIMATE.ANNOTATION_VALUES.RED_WALL")),b("pcs"));e.push(m)}if(a.get("ESTIMATE.ANNOTATION_VALUES.LENGTHS"))a.get("ESTIMATE.ANNOTATION_VALUES.LENGTHS").forEach((function(n,a){var o=gt(t++,"L"+(a+1),b("L{{count}}",{count:a+1}),M.c.formatAmountValue(n),"m");e.push(o)}));if(a.get("ESTIMATE.ANNOTATION_VALUES.WALLS"))a.get("ESTIMATE.ANNOTATION_VALUES.WALLS").forEach((function(n,a){var o=gt(t++,"V"+(a+1),b("V{{count}}",{count:a+1}),M.c.formatAmountValue(n),"m\xb2");e.push(o)}))}return e},N=function(e,t){var n,a=function(e){var t=Fe.a.language;return"en-GB"!==t&&"en-US"!==t?e.replace(new RegExp("\\,","g"),(function(e){return","==e?".":","})):e}(e.target.value);switch(t){case"NA":n="formulaNA";break;case"NL":n="formulaNL";break;case"NVO":n="formulaNVO";break;case"NV":n="formulaNV"}m(h,a,n),r()},O=function(e,t){if(t.variable.includes("NA")||t.variable.includes("NL")||t.variable.includes("NVO")||t.variable.includes("NV")){var r=t.variable.match(/^[A-Z]+$/);if(a&&a.key===t.key)return c.a.createElement(F.a,{name:"formulaValue",value:o,onChange:s,onPressEnter:function(e){return N(e,i)},disabled:d.preventEditing,autoFocus:!0});switch(r&&r[0]){case"NA":if(n&&n.get("formulaNA"))return c.a.createElement("div",{className:"Data_Table_Value_Editable_With_Formula"},e," ",t.unit);break;case"NL":if(n&&n.get("formulaNL"))return c.a.createElement("div",{className:"Data_Table_Value_Editable_With_Formula"},e," ",t.unit);break;case"NVO":if(n&&n.get("formulaNVO"))return c.a.createElement("div",{className:"Data_Table_Value_Editable_With_Formula"},e," ",t.unit);break;case"NV":if(n&&n.get("formulaNV"))return c.a.createElement("div",{className:"Data_Table_Value_Editable_With_Formula"},e," ",t.unit)}return c.a.createElement("div",{className:"Data_Table_Value_Editable"},e," ",t.unit)}return c.a.createElement("div",null,e," ",t.unit)};return c.a.createElement("div",{className:"Calculation_Table_Wrapper"},"3DModel"===I?c.a.createElement(mt.a,{width:+g-34,rowRenderer:function(e){var n=e.key,a=e.style,o=e.index;return c.a.createElement("div",{key:n,style:a,className:"rowList",onClick:function(){return t&&u(T[o])}},c.a.createElement("div",null,c.a.createElement("label",null,T[o].variable),c.a.createElement("label",null,T[o].part)),c.a.createElement("div",null,O(T[o].value,T[o])))},rowHeight:31,rowCount:T.length,height:(window.innerHeight-104)/2,overscanRowCount:10}):c.a.createElement(P.a,{dataSource:y(),columns:ht(O),pagination:!1,size:"middle",onRow:function(e){return{onClick:function(){return t&&u(e)}}}}))}),At=n(4),Et=n(99),Tt=function(e){var t=e.valuesForFeatureType,n=e.onChangeValues,a=e.annotationsToUpdate,o=e.values,i=e.scaleProperties,r=function(){var e=Object(he.a)(ge.a.mark((function e(o,r){var s,l,c,u,d,p;return ge.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=o===At.i.TURN_OFF_FILL?!r:r,l=Object(A.filter)(Object(A.map)(t,(function(e){return e.checked&&e.name})),(function(e){return!!e})),s?l.push(o):(c=l.indexOf(o),l.splice(c,1)),u=Et.a.getInstance(),d=M.a.annotationTypeMap.toJS(),p=d[At.O]||d[At.P],n(p?i:a,r,o),e.next=9,u.handleDisplayValueChange(T.a.fromJS(l),T.a.fromJS(a));case 9:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),s=function(e){return"Fill"!==e.label?e.checked:e.checked?void 0:At.i.TURN_OFF_FILL};return Object(A.map)(t,(function(e){return c.a.createElement(k.o,{label:e.label,checked:s(e),onChange:function(t){return r(e.values,t)},reverseValue:e.reverseValue,key:e.name,disabled:o.preventEditing})}))},St=n(538),bt=n.n(St),It=n(539),yt=n.n(It),vt=n(540),Nt=n.n(vt),Ot=n(541),wt=n.n(Ot),Pt=n(542),Rt=n.n(Pt),Lt=[{value:"none",name:"-",centered:!0},{value:"iconBaselineNewReleases24px",iconName:bt.a},{value:"baselineRemoveCircleOutline24px",iconName:yt.a},{value:"baselineRoom24px",iconName:Nt.a},{value:"baselineStarRate24px",iconName:wt.a},{value:"baselineToys24px",iconName:Rt.a}],Ct=function(e){var t=e.role,n=e.fillColourInput,a=e.values,o=e.onAccept,i=e.icon,r=e.showFillColorPicker,s=e.fillColor,l=e.changeFillColor,u=e.opacity,d=e.size,p=Object(U.a)().t;return c.a.createElement(R.a,{gutter:[16,16]},c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:p("Quantity"),addonBefore:"Q",type:"number",value:a.quantity,onAccept:o.quantity,disabled:!t})),c.a.createElement(L.a,{span:12},c.a.createElement(k.l,{label:p("Icon"),options:Lt,value:i,onChange:o.icon,disabled:!t})),c.a.createElement(L.a,{span:12},c.a.createElement(k.c,{propsRef:n,color:s,label:"Fill Colour",showColorPicker:r,changeColor:l,disabled:!t})),c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:p("Fill Opacity"),type:"number",value:""===u?null:100*u,onAccept:o.opacity,suffix:"%",min:0,max:100,disabled:!t})),c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:p("Size"),type:"number",value:d,onAccept:o.size,suffix:"pt",isPositive:!0,disabled:!t})))},_t=function(e){var t=e.role,n=e.showColorPicker,a=e.changeColor,o=e.values;return c.a.createElement(R.a,{gutter:[16,16]},c.a.createElement(L.a,{span:12},c.a.createElement(k.c,{color:o.color,label:"Colour",showColorPicker:n,changeColor:a,disabled:!t||o.preventEditing})))},Mt=n(576),kt=n.n(Mt),Dt=n(577),xt=n.n(Dt),Ft=n(578),jt=n.n(Ft),Vt=n(579),Ut=n.n(Vt),Wt=n(543),Bt=n.n(Wt),Ht=n(544),Jt=n.n(Ht),zt=n(545),Gt=n.n(zt),qt=n(546),Xt=n.n(qt),Yt=n(547),Kt=n.n(Yt),Zt=n(548),Qt=n.n(Zt),$t=n(549),en=n.n($t),tn=n(550),nn=n.n(tn),an=[{value:"dashed",iconName:kt.a},{value:"dotted",iconName:jt.a},{value:"dot-dash-dot",iconName:Ut.a},{value:"solid",iconName:xt.a}],on=[{value:"|<-",iconName:Gt.a},{value:"<",iconName:Xt.a},{value:"|",iconName:nn.a},{value:"->|",iconName:Kt.a},{value:">",iconName:Qt.a},{value:"o-",iconName:Jt.a},{value:"-",iconName:en.a},{value:"o|-",iconName:Bt.a}],rn=Object(A.map)(on,(function(e){return Object(w.a)({rotated:!0},e)})),sn=Object(A.map)(["Arial","Times New Roman","Helvetica","Times","Courier New","Verdana","Courier","Arial Narrow","Candara","Geneva","Calibri","Optima","Cambria","Garamond","Perpetua","Monaco","Didot","Brush Script MT","Lucida Bright","Copperplate"],(function(e){return{value:e,name:e,font:!0}})),ln=Object(A.map)(["0.5","1","1.5","2","2.5","3","3.5","4","4.5","5","5.5","6","6.5","7","7.5","8","8.5","9","9.5","10"],(function(e){return{value:e}})),cn=[{value:"bold",name:"Bold"},{value:"underline",name:"Underline"},{value:"italic",name:"Italic"},{value:"line-through",name:"Line-Through"}],un=(n(2559),function(e){var t,n=e.role,a=e.values,o=e.onAccept,i=e.showInteriorColorPicker,r=e.interiorColor,s=e.changeInteriorColor,l=e.borderColor,u=e.showBorderColorPicker,d=e.changeBorderColor,p=e.isText,g=e.isLine,m=e.isScale,f=e.changeText,E=e.onOpenAngles,T=e.onOpenTiles,S=e.textAreaInput,b=e.fillColourInput,I=e.borderColourInput,y=Object(U.a)().t,v="".concat(y(p?"Text Colour":"")).concat(y(p||m?"":"Fill Colour")).concat(y(m?"Scale Colour":"")),N="".concat(y(p?"Text Opacity":"")).concat(y(p||m?"":"Fill Opacity")).concat(y(m?"Scale Opacity":""));return c.a.createElement(R.a,{gutter:[16,16],className:"CalculatePane_wrapper"},o.font&&c.a.createElement(L.a,{span:24},c.a.createElement(k.l,{label:y("Font"),value:(t=a.font,Object(A.replace)(Object(A.replace)(t,/[0-9]/g,""),"pt","")),onChange:o.font,options:sn,disabled:a.preventEditing||!n})),o.fontSize&&c.a.createElement(c.a.Fragment,null,c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:y("Font Size"),suffix:"pt",type:"number",value:a.fontSize,onAccept:o.fontSize,disabled:a.preventEditing||!n})),c.a.createElement(L.a,{span:12},c.a.createElement(k.l,{label:y("Decoration"),value:a.decoration,onChange:o.decoration,options:cn,mode:"multiple",disabled:a.preventEditing||!n}))),o.quantity&&o.height&&c.a.createElement(c.a.Fragment,null,c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:y("Quantity"),addonBefore:"Q",type:"number",value:a.quantity,onAccept:o.quantity,disabled:a.preventEditing||!n,heightAndQuantityType:!0})),c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:y("Height"),addonBefore:"H",type:"number",value:a.height,onAccept:function(e){return o.height(e?String(Number(e)):"")},disabled:a.preventEditing||!n,heightAndQuantityType:!0}))),s&&c.a.createElement(L.a,{span:12},c.a.createElement(k.c,{propsRef:b,color:r,label:v,showColorPicker:i,changeColor:s,disabled:a.preventEditing||!n})),o.interiorOpacity&&c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:N,type:"number",value:""===a.interiorOpacity?null:100*a.interiorOpacity,onAccept:o.interiorOpacity,disabled:a.preventEditing||!n,suffix:"%",min:0,max:100})),d&&c.a.createElement(L.a,{span:12},c.a.createElement(k.c,{propsRef:I,color:l,label:y("Border Colour"),showColorPicker:u,changeColor:d,disabled:a.preventEditing||!n})),o.borderOpacity&&c.a.createElement(L.a,{span:12},c.a.createElement(k.h,{label:y("Border Opacity"),type:"number",value:""===a.borderOpacity?null:100*a.borderOpacity,onAccept:o.borderOpacity,disabled:a.preventEditing||!n,suffix:"%",min:0,max:100})),c.a.createElement(L.a,{span:12},c.a.createElement(k.l,{label:y(g?"Style":"Border Style"),options:an,value:a.borderStyle,onChange:o.borderStyle,disabled:a.preventEditing||!n})),c.a.createElement(L.a,{span:12},c.a.createElement(k.a,{label:y("Thickness"),options:ln,onSelect:o.borderSize,value:a.borderSize,disabled:a.preventEditing||!n,type:"number"})),o.lineStart&&o.lineEnd&&c.a.createElement(c.a.Fragment,null,c.a.createElement(L.a,{span:12},c.a.createElement(k.l,{label:y("Start"),options:on,value:a.lineStart,onChange:o.lineStart,disabled:a.preventEditing||!n})),c.a.createElement(L.a,{span:12},c.a.createElement(k.l,{label:y("End"),options:rn,value:a.lineEnd,onChange:o.lineEnd,disabled:a.preventEditing||!n}))),f&&c.a.createElement(L.a,{span:24},c.a.createElement(k.h,{propsRef:S,rows:4,value:a.contents,onBlur:f,onAccept:f,type:"textArea",disabled:a.preventEditing||!n})),E&&c.a.createElement(c.a.Fragment,null,c.a.createElement(L.a,{span:12},c.a.createElement(h.a,{onClick:T,disabled:a.preventEditing||!n},y("Tiles"))),c.a.createElement(L.a,{span:12},c.a.createElement(h.a,{onClick:E,disabled:a.preventEditing||!n},y("Angles")))))}),dn=function(e){var t=e.children,n=e.onOutsideClick,a=Object(l.useRef)();Object(l.useEffect)((function(){return window.addEventListener("mousedown",o),function(){return window.removeEventListener("mousedown",o)}}));var o=function(e){a.current&&!a.current.contains(e.target)&&n()};return c.a.createElement("div",{ref:a},t)},pn=function(e){var t=e.scaleLengthInput,n=e.scaleProperties,a=e.selectedAnnotations,o=e.role,i=e.preventEditing,r=Object(l.useState)(""),s=Object(D.a)(r,2),u=s[0],d=s[1],p=Object(U.a)().t,g=a[0]&&a[0].toJS().type,h=ve.a.getLength(g);Object(l.useEffect)((function(){d(h)}),[h]);var m=function(){null===ve.a.getSelection()&&ve.a.setSelection(g),u||0===parseFloat(u)?Object(Ve.d)(n,u):d(je.a,(function(){Object(Ve.d)(n,u)}))};return c.a.createElement("div",{className:"scale-properties"},c.a.createElement(R.a,null,c.a.createElement(L.a,{span:24},c.a.createElement("label",null,p("Scale length"),c.a.createElement(F.a,{ref:t,value:u||"",onBlur:m,onChange:function(e){return d(e.target.value)},onPressEnter:m,type:"number",disabled:!o||i})))))},gn=n(74),hn=(n(2560),[{name:"areaChecked",label:"Net: Area "},{name:"lengthChecked",label:"Net: Length "},{name:"volumeChecked",label:"Net: Volume "},{name:"wallChecked",label:"Net: Wall"}]),mn=(n(2561),function(e){var t=e.modalVisible,n=e.cancelModal,a=e.onSubmit,o=e.okButtonDisabled,i=e.onCheckboxChecked,r=e.inputLabel,s=e.checkboxStatuses,u=Object(U.a)().t,d=Object(l.useState)(""),p=Object(D.a)(d,2),g=p[0],h=p[1];return c.a.createElement(k.j,{visible:t,title:u("Set Angles"),submitButtonTitle:"Set angles",onCancel:n,onOk:function(){return a(g)},disabledOkButton:o||""===g,className:"Angles_Modal"},c.a.createElement(R.a,null,c.a.createElement(L.a,{span:11},hn.map((function(e){var t=e.name,n=e.label;return c.a.createElement(L.a,{span:24,offset:2,key:t},c.a.createElement(k.b,{name:t,label:u(n),onChange:i,checked:s[t]}))}))),c.a.createElement(L.a,{span:1,offset:1},c.a.createElement(k.d,{vertical:!0})),c.a.createElement(L.a,{span:11},c.a.createElement(L.a,{span:24,offset:2},u(r)),c.a.createElement(L.a,{span:24,offset:2},c.a.createElement(F.a,{type:"number",value:g,onChange:function(e){return h(e.target.value)}})))))}),fn=[{name:"areaChecked",label:"Net: Area ",selection:"netArea"},{name:"wallChecked",label:"Net: Wall",selection:"netWall"}],An=[{name:"areaTileX",label:"Tile Height",selection:"netArea"},{name:"areaTileY",label:"Tile Width",selection:"netArea"},{name:"wallTileX",label:"Tile Height",selection:"netWall"},{name:"wallTileY",label:"Tile Width",selection:"netWall"}],En=[{name:"areaJointX",label:"Joint Height",selection:"netArea"},{name:"areaJointY",label:"Joint Width",selection:"netArea"},{name:"areaJointDepth",label:"Joint Depth",selection:"netArea"},{name:"wallJointX",label:"Joint Height",selection:"netWall"},{name:"wallJointY",label:"Joint Width",selection:"netWall"},{name:"wallJointDepth",label:"Joint Depth",selection:"netWall"}],Tn=(n(2562),function(e){var t=e.modalVisible,n=e.cancelModal,a=e.onSubmit,o=e.netSelection,i=e.onSelectionChange,r=e.annotationsTiles,s=e.displayArea,u=void 0===s||s,d=Object(U.a)().t,p=Object(l.useState)(r),g=Object(D.a)(p,2),h=g[0],m=g[1],f=function(e,t){m(Object(w.a)(Object(w.a)({},h),{},Object(de.a)({},t,e.target.value)))},A=h&&("netWall"===o&&(!h.wallJointDepth||!h.wallJointX||!h.wallJointY||!h.wallTileX||!h.wallTileY)||"netArea"===o&&(!h.areaJointDepth||!h.areaJointX||!h.areaJointY||!h.areaTileX||!h.areaTileY));return h?c.a.createElement(k.j,{visible:t,title:d("Set Tiles"),submitButtonTitle:"Set Tiles",onCancel:function(){m(r),n()},onOk:function(){a(h)},disabledOkButton:A,className:"Tiles_Modal"},c.a.createElement(R.a,{justify:"space-around"},u?c.a.createElement(L.a,{span:6},fn.map((function(e){var t=e.name,n=e.label,a=e.selection;return c.a.createElement(L.a,{span:24,offset:2,key:t},c.a.createElement(k.b,{name:t,label:d(n),onChange:function(){return i(a)},checked:o===a}))}))):c.a.createElement(L.a,{span:6},c.a.createElement(L.a,{span:24,offset:2},c.a.createElement(k.b,{name:"wallChecked",label:d("Net: Wall"),onChange:function(){return i("netWall")},checked:!0}))),c.a.createElement(L.a,{span:1,offset:1},c.a.createElement(k.d,{vertical:!0})),c.a.createElement(L.a,{span:6},An.map((function(e){var t=e.name,n=e.label,a=e.selection;return o===a&&c.a.createElement(R.a,{key:"".concat(t).concat(a)},c.a.createElement(L.a,{span:24},d(n)),c.a.createElement(L.a,{span:24},c.a.createElement(F.a,{type:"number",value:h[t],min:0,onChange:function(e){return f(e,t)}})))}))),c.a.createElement(L.a,{span:1,offset:1},c.a.createElement(k.d,{vertical:!0})),c.a.createElement(L.a,{span:6},En.map((function(e){var t=e.name,n=e.label,a=e.selection;return o===a&&c.a.createElement(R.a,{key:"".concat(t).concat(a)},c.a.createElement(L.a,{span:24},d(n)),c.a.createElement(L.a,{span:24},c.a.createElement(F.a,{type:"number",value:h[t],min:0,onChange:function(e){return f(e,t)}})))}))))):null}),Sn=lt.a.Panel,bn=c.a.memo((function(e){var t=e.role,n=e.typeMap,a=e.showColorPicker,o=e.changeColor,i=e.selectedAnnotations,r=e.displayAnnot,s=e.openAnglesDialog,l=e.openTilesDialog,u=e.activePanelKeys,d=e.setActiveCollapseKeys,p=e.textAreaInput,g=e.fillColourInput,h=e.borderColourInput,m=e.removedReadOnlyAnnotations,f=e.annotationsToUpdate,T=e.onChangeValues,S=e.estimateId,b=e.activePage,I=Object(U.a)().t,v=(n[At.O]>0||n[At.P])&&n[At.O]?At.O:At.P,N=function(e,t){return Object(gn.e)({type:e,key:t,selectedAnnotations:i})},O=function(e,t){return Object(gn.h)({type:e,key:t,selectedAnnotations:i})},w=function(e){return""===e?0:Number("".concat(e).toString().replaceAll(",","."))},P=function(e,t,n){switch(t){case At.q:case At.p:return N(e,t)||"-";case At.K:return N(e,t)||1;case At.h:return N(e,t)||"#000000";default:return n?Object(gn.g)(e,t,b)||"solid":O(e,t)||"solid"}},R=function(e){return e===At.O||e===At.P?M.a.getScale({fileId:M.a.getActiveFileId(),estimateId:S,page:b,type:e}):m.filter((function(t){return t.get("type")===e}))},L=function(e){return e===At.O||e===At.P?M.a.getScale({fileId:M.a.getActiveFileId(),estimateId:S,page:b,type:e}):E.a.filter(f,(function(t){return t.type===e}))};return c.a.createElement(lt.a,{defaultActiveKey:u,onChange:function(e){return d(e)},expandIcon:function(e){var t=e.isActive;return c.a.createElement("span",null,c.a.createElement(y.a,{icon:["fal","caret-down"],className:"".concat(!t&&"fa-rotate-right-90")}))}},(n[At.O]>0||n[At.P]>0)&&c.a.createElement(Sn,{header:I("Scale"),key:"scale",id:"scale_pane"},c.a.createElement(un,{role:t,values:{interiorOpacity:Object(gn.g)(v,At.r,b),borderStyle:P(v,"style",!0),borderSize:Object(gn.g)(v,At.N,b),lineStart:Object(gn.g)(v,At.q,b),lineEnd:Object(gn.g)(v,At.p,b),preventEditing:Object(gn.c)(R(v))},onAccept:{interiorOpacity:function(e){return T(R(v),e/100,"geometraOpacity")},borderStyle:function(e){return T(R(v),e,"style")},borderSize:function(e){return T(R(v),e,"width")},lineStart:function(e){return T(R(v),e,At.q)},lineEnd:function(e){return T(R(v),e,At.p)}},isScale:!0,interiorColor:Object(gn.g)(v,At.h,b),showInteriorColorPicker:function(){return a(v,At.e)},changeInteriorColor:function(e){return o(e,v,At.e)},borderColourInput:h})),n[At.y]>0&&c.a.createElement(Sn,{header:I("Point"),key:"point",id:"point_pane"},c.a.createElement(Ct,{role:t,values:{quantity:N(At.y,At.C),preventEditing:Object(gn.c)(i)},onAccept:{quantity:function(e){return T(L(At.y),w(e),"quantity")},icon:function(e){return T(L(At.y),e,"iconType")},opacity:function(e){return T(L(At.y),e/100,"geometraOpacity")},size:function(e){return T(L(At.y),e,"pointSize")}},fillColor:r&&N(At.y,At.w),showFillColorPicker:function(){return a(At.y,At.w)},changeFillColor:function(e){return o(e,At.y,At.w)},icon:N(At.y,"iconType"),opacity:N(At.y,At.r),size:N(At.y,At.z),fillColourInput:g})),n[At.B]>0&&c.a.createElement(Sn,{header:I("Line"),key:"line",id:"line_pane"},c.a.createElement(un,{role:t,values:{quantity:N(At.B,At.C),height:N(At.B,At.u),interiorOpacity:N(At.B,At.r),borderStyle:P(At.B,At.f),borderSize:N(At.B,At.K),lineStart:P(At.B,At.q),lineEnd:P(At.B,At.p),preventEditing:Object(gn.c)(i)},onAccept:{quantity:function(e){return T(L(At.B),w(e),"quantity")},height:function(e){return T(L(At.B),e,"height")},interiorOpacity:function(e){return T(L(At.B),e/100,"geometraOpacity")},borderStyle:function(e){return T(L(At.B),e,"style")},borderSize:function(e){return T(L(At.B),e,"width")},lineStart:function(e){return T(L(At.B),e,At.q)},lineEnd:function(e){return T(L(At.B),e,At.p)}},interiorColor:r&&N(At.B,At.h),showInteriorColorPicker:function(){return a(At.B,At.e)},changeInteriorColor:function(e){return o(e,At.B,At.e)},isLine:!0,onOpenAngles:s,onOpenTiles:l,fillColourInput:g})),n[At.b]>0&&c.a.createElement(Sn,{header:I("Arrow"),key:"arrow",id:"arrow_pane"},c.a.createElement(un,{role:t,values:{borderOpacity:N(At.b,At.o),borderStyle:O(At.b,At.f),borderSize:N(At.b,At.K),preventEditing:Object(gn.c)(i)},onAccept:{borderOpacity:function(e){return T(L(At.b),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.b),e,"style")},borderSize:function(e){return T(L(At.b),e,"width")}},borderColor:r&&N(At.b,At.h),showBorderColorPicker:function(){return a(At.b,At.e)},changeBorderColor:function(e){return o(e,At.b,At.e)},isLine:!0,borderColourInput:h})),n[At.A]>0&&c.a.createElement(Sn,{header:I("Area"),key:"area",id:"area_pane"},c.a.createElement(un,{role:t,values:{quantity:N(At.A,At.C),height:N(At.A,At.u),interiorOpacity:N(At.A,At.r),borderOpacity:N(At.A,At.o),borderStyle:P(At.A,At.f),borderSize:N(At.A,At.K),preventEditing:Object(gn.c)(i)},onAccept:{quantity:function(e){return T(L(At.A),w(e),"quantity")},height:function(e){return T(L(At.A),e,"height")},interiorOpacity:function(e){return T(L(At.A),e/100,"geometraOpacity")},borderOpacity:function(e){return T(L(At.A),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.A),e,"style")},borderSize:function(e){return T(L(At.A),e,"width")}},changeInteriorColor:function(e){return o(e,At.A,At.w)},changeBorderColor:function(e){return o(e,At.A,At.e)},interiorColor:r&&N(At.A,At.w),showInteriorColorPicker:function(){return a(At.A,At.w)},borderColor:r&&N(At.A,At.h),showBorderColorPicker:function(){return a(At.A,At.e)},onOpenAngles:s,onOpenTiles:l,fillColourInput:g,borderColourInput:h})),n[At.D]>0&&c.a.createElement(Sn,{header:I("Reduction"),key:"reduction",id:"reduction_pane"},c.a.createElement(un,{role:t,values:{quantity:N(At.D,At.C),height:N(At.D,At.u),interiorOpacity:N(At.D,At.r),borderOpacity:N(At.D,At.o),borderStyle:P(At.D,At.f),borderSize:N(At.D,At.K),preventEditing:Object(gn.c)(i)},onAccept:{quantity:function(e){return T(L(At.D),w(e),"quantity")},height:function(e){return T(L(At.D),e,"height")},interiorOpacity:function(e){return T(L(At.D),e/100,"geometraOpacity")},borderOpacity:function(e){return T(L(At.D),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.D),e,"style")},borderSize:function(e){return T(L(At.D),e,"width")}},interiorColor:r&&N(At.D,At.w),showInteriorColorPicker:function(){return a(At.D,At.w)},changeInteriorColor:function(e){return o(e,At.D,At.w)},borderColor:r&&N(At.D,At.h),showBorderColorPicker:function(){return a(At.D,At.e)},changeBorderColor:function(e){return o(e,At.D,At.e)},onOpenAngles:s,onOpenTiles:l,fillColourInput:g,borderColourInput:h})),n[At.j]>0&&c.a.createElement(Sn,{header:I("Ellipse"),key:"ellipse",id:"elipse_pane"},c.a.createElement(un,{role:t,values:{quantity:N(At.j,At.C),height:N(At.j,At.u),interiorOpacity:N(At.j,At.r),borderOpacity:N(At.j,At.o),borderStyle:P(At.j,At.f),borderSize:N(At.j,At.K),preventEditing:Object(gn.c)(i)},onAccept:{quantity:function(e){return T(L(At.j),w(e),"quantity")},height:function(e){return T(L(At.j),e,"height")},interiorOpacity:function(e){T(L(At.j),e/100===0?0:e/100,"geometraOpacity")},borderOpacity:function(e){return T(L(At.j),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.j),e,"style")},borderSize:function(e){return T(L(At.j),e,"width")}},showInteriorColorPicker:function(){return a(At.j,At.w)},interiorColor:r&&N(At.j,At.w),changeInteriorColor:function(e){return o(e,At.j,At.w)},showBorderColorPicker:function(){return a(At.j,At.e)},borderColor:r&&N(At.j,At.h),changeBorderColor:function(e){return o(e,At.j,At.e)},onOpenAngles:s,onOpenTiles:l,fillColourInput:g,borderColourInput:h})),n[At.m]>0&&c.a.createElement(Sn,{header:I("Draw"),key:"draw",id:"draw_pane"},c.a.createElement(un,{role:t,values:{quantity:N(At.m,At.C),height:N(At.m,At.u),interiorOpacity:N(At.m,At.r),borderOpacity:N(At.m,At.o),borderStyle:P(At.m,At.f),borderSize:N(At.m,At.K),preventEditing:Object(gn.c)(i)},onAccept:{quantity:function(e){return T(L(At.m),w(e),"quantity")},height:function(e){return T(L(At.m),e,"height")},interiorOpacity:function(e){return T(L(At.m),e/100,"geometraOpacity")},borderOpacity:function(e){return T(L(At.m),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.m),e,"style")},borderSize:function(e){return T(L(At.m),e,"width")}},showInteriorColorPicker:function(){return a(At.m,At.w)},interiorColor:r&&N(At.m,At.w),changeInteriorColor:function(e){return o(e,At.m,At.w)},showBorderColorPicker:function(){return a(At.m,At.e)},borderColor:r&&N(At.m,At.h),changeBorderColor:function(e){return o(e,At.m,At.e)},onOpenAngles:s,onOpenTiles:l,fillColourInput:g,borderColourInput:h})),n[At.n]>0&&c.a.createElement(Sn,{header:I("Text"),key:"text",id:"text_pane"},c.a.createElement(un,{role:t,values:{font:O(At.n,At.k),fontSize:N(At.n,At.l),interiorOpacity:N(At.n,At.r),borderOpacity:N(At.n,At.o),borderStyle:P(At.n,At.f),borderSize:P(At.n,At.K),contents:N(At.n,At.M),decoration:function(){var e=[];return"bold"===O(At.n,At.F)["font-weight"]?e.push("bold"):e=Object(A.remove)(e,(function(e){return"bold"!==e})),(O(At.n,At.F)["text-decoration"]||"").includes("underline")?e.push("underline"):e=Object(A.remove)(e,(function(e){return"underline"!==e})),"italic"===O(At.n,At.F)["font-style"]?e.push("italic"):e=Object(A.remove)(e,(function(e){return"italic"!==e})),(O(At.n,At.F)["text-decoration"]||"").includes("line-through")?e.push("line-through"):e=Object(A.remove)(e,(function(e){return"line-through"!==e})),e}(),preventEditing:Object(gn.c)(i)},onAccept:{font:function(e){return T(L(At.n),e,"textFont")},fontSize:function(e){return T(L(At.n),e||0,"fontSize")},interiorOpacity:function(e){return T(L(At.n),e/100,"geometraOpacity")},borderOpacity:function(e){return T(L(At.n),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.n),e,"style")},borderSize:function(e){return T(L(At.n),e,"width")},decoration:function(e){return function(e){var t=O(At.n,At.F);t["font-weight"]=Object(A.find)(e,(function(e){return"bold"===e}))?"bold":"normal";var n="";Object(A.find)(e,(function(e){return"underline"===e}))&&(n="underline"),(e.includes("line-through")||e.includes("underline"))&&(n="".concat(e.includes("underline")?"underline ":"").concat(e.includes("line-through")?"line-through":"")),t["text-decoration"]=n,t["font-style"]=Object(A.find)(e,(function(e){return"italic"===e}))?"italic":"normal",(t["text-decoration"]||"").includes("underline")&&(n="underline"),T(L(At.n),JSON.stringify(t),"fontDecoration")}(e)}},changeText:function(e){return T(L(At.n),e.target.value,"textContent")},showInteriorColorPicker:function(){return a(At.n,At.E)},interiorColor:r&&r.toJS().color,changeInteriorColor:function(e){return o(e,At.n,At.E)},showBorderColorPicker:function(){return a(At.n,At.J)},borderColor:r&&N(At.n,At.J),changeBorderColor:function(e){return o(e,At.n,At.J)},isText:!0,textAreaInput:p,fillColourInput:g,borderColourInput:h})),n[At.I]>0&&c.a.createElement(Sn,{header:I("Image"),key:"image-styles",id:"image_pane"},c.a.createElement(un,{role:t,showBorderColorPicker:function(){return a(At.I,At.e)},changeBorderColor:function(e){return o(e,At.I,At.e)},values:{borderOpacity:N(At.I,At.o),borderStyle:P(At.I,At.f),borderSize:N(At.I,At.K),rotation:N(At.I,At.G),preventEditing:Object(gn.c)(i)},borderColor:r&&P(At.I,At.h),onAccept:{borderSize:function(e){return T(L(At.I),e,"width")},borderOpacity:function(e){return T(L(At.I),e/100,"geometraBorderOpacity")},borderStyle:function(e){return T(L(At.I),e,"style")}},borderColourInput:h})),n[At.v]>0&&c.a.createElement(Sn,{header:I("IFC Object"),key:"ifc-styles",id:"ifc_pane"},c.a.createElement(_t,{role:t,values:{color:N(At.v,At.h),preventEditing:Object(gn.c)(i)},showColorPicker:function(){return a(At.v,At.h)},changeColor:function(e){return o(e,At.v,At.h)}})))})),In=lt.a.Panel,yn=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;return Object(o.a)(this,n),(e=t.call(this)).state={number:void 0,name:void 0,height:void 0,quantity:void 0,clickedRowKey:void 0,formulaVariable:void 0,formulaValue:void 0,areaChecked:!1,lengthChecked:!1,volumeChecked:!1,wallChecked:!1,tilesSelection:"netArea",activePanelKeys:[],tilesDialog:!1,anglesDialog:!1,displayAnnot:null},e.annotationStoreUpdated=function(t){switch(t){case"showTiles":!e.state.anglesDialog&&e.shouldTilesAnglesDisplay()&&e.openTilesDialog();break;case"showAngles":!e.state.tilesDialog&&e.shouldTilesAnglesDisplay()&&e.openAnglesDialog();break;case"folderInserted":case"fileChanged":case"EstimateInitialized":case"AnnotationUpdated":case"AnnotationDeleted":case"annotationsInserted":case"AnnotationAdded":case"annotationSelectedFromGui":case"annotationSelected":case"annotationDeSelectedFromGui":e.setState({displayAnnot:M.a.getTheDisplayAnnot()})}},e.ifcStoreUpdated=function(t){switch(t){case"ifcAnnotationsUpdated":case"ifcAnnotationInserted":e.setState({displayAnnot:M.a.getTheDisplayAnnot()})}},e.resetState=function(){e.setState({number:void 0,name:void 0,height:void 0,quantity:void 0,clickedRowKey:void 0,formulaVariable:void 0,formulaValue:void 0})},e.setSelectedKeys=function(){var t="ifc"===e.props.fileType,n=localStorage.getItem("activeIfcPanelKeys"),a=localStorage.getItem("activePdfPanelKeys");return t&&null===n?(e.setState({activePanelKeys:gn.a}),void localStorage.setItem("activeIfcPanelKeys",JSON.stringify(gn.a))):t||null!==a?void(Object(A.isNil)(t)||e.setState({activePanelKeys:JSON.parse(localStorage.getItem(t?"activeIfcPanelKeys":"activePdfPanelKeys"))})):(e.setState({activePanelKeys:gn.b}),void localStorage.setItem("activePdfPanelKeys",JSON.stringify(gn.b)))},e.handleChange=function(t){e.setState(Object(de.a)({},t.target.name,t.target.value))},e.getStatePropsValue=function(t){return e.state.displayAnnot?void 0!==e.state[t]?e.state[t]:e.props.selectedFolderName&&"name"===t?e.props.selectedFolderName:e.props.selectedFolderNumber&&"number"===t?e.props.selectedFolderNumber:e.state.displayAnnot.get(t)?e.state.displayAnnot.get(t):"":""},e.handleRowClick=function(t){var n=t.variable.match(/^[A-Z]+$/);n?e.setState({clickedRowKey:t,formulaVariable:n[0],formulaValue:e.state.displayAnnot.get("formula"+n[0])}):e.setState({clickedRowKey:t,formulaVariable:t.variable,formulaValue:e.state.displayAnnot.get("formula"+t.variable[0])})},e.openTilesDialog=function(){e.setState({tilesDialog:!0}),e.onReset()},e.openAnglesDialog=function(){e.setState({anglesDialog:!0}),e.onReset()},e.closeTilesDialog=function(){e.setState({tilesDialog:!1}),e.onReset()},e.closeAnglesDialog=function(){e.setState({anglesDialog:!1}),e.cleanAnglesSelection()},e.anglesSelection=function(t){e.setState(Object(de.a)({},t.target.name,t.target.checked))},e.cleanAnglesSelection=function(){e.setState({areaChecked:!1,lengthChecked:!1,volumeChecked:!1,wallChecked:!1})},e.translateImperial=function(e){return Object(A.isNumber)(I()(Number(e)).value())?I()(Number(e)).value():null},e.changeTilesSelection=function(t){return e.setState({tilesSelection:t})},e.saveTiles=function(t){var n=e.translateImperial(t.areaTileX),a=e.translateImperial(t.areaTileY),o=e.translateImperial(t.areaJointX),i=e.translateImperial(t.areaJointY),r=e.translateImperial(t.areaJointDepth),s=e.translateImperial(t.wallTileX),l=e.translateImperial(t.wallTileY),c=e.translateImperial(t.wallJointX),u=e.translateImperial(t.wallJointY),d=e.translateImperial(t.wallJointDepth),p=new DOMParser,g=new XMLSerializer;if(!Object(A.isNil)(t.areaTileX)&&!Object(A.isNil)(t.areaTileY)&&!Object(A.isNil)(t.areaJointX)&&!Object(A.isNil)(t.areaJointY)&&!Object(A.isNil)(t.areaJointDepth)||!Object(A.isNil)(t.wallTileX)&&!Object(A.isNil)(t.wallTileY)&&!Object(A.isNil)(t.wallJointX)&&!Object(A.isNil)(t.wallJointY)&&!Object(A.isNil)(t.wallJointDepth)){var h=new T.a.List,m=new T.a.List;M.q.getCurrentlySelectedNodes().forEach((function(e){if("group"===e.get("type")){var t=M.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return"group"!==e.get("type")}));h=h.concat(t)}else h=h.push(e)})),h.forEach((function(e){switch(e.get("type")){case At.A:case At.m:case At.D:case At.B:case At.j:var t=p.parseFromString(e.get("xfdf"),"text/xml"),h=t.querySelector("annots").firstElementChild;h.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X")&&(h.removeAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"),h.removeAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y"),h.removeAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X"),h.removeAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y"),h.removeAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH")),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X",n),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y",a),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X",o),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y",i),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH",r),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X",s),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y",l),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X",c),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y",u),h.setAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH",d),e=e.set("xfdf",g.serializeToString(t)),m=m.push(e)}})),m.size>0&&(M.a.onRequestAnnotationUpdateArray(m),e.closeTilesDialog())}},e.validateAngles=function(){return!(e.translateImperial(e.state.angle)&&(e.state.angleNetArea||e.state.angleNetVolume||e.state.angleNetLength||e.state.angleNetWall))},e.saveAngles=function(t){if(e.validateAngles()){var n=new T.a.List,a="/cos("+e.translateImperial(t)+")",o=new T.a.List;e.state.areaChecked&&(o=o.push("NA")),e.state.volumeChecked&&(o=o.push("NVO")),e.state.lengthChecked&&(o=o.push("NL")),e.state.wallChecked&&(o=o.push("NV")),M.q.getCurrentlySelectedNodes().forEach((function(e){if("group"===e.get("type")){var t=M.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return"group"!==e.get("type")}));n=n.concat(t)}else n=n.push(e)})),n.size>0&&M.a.changeFormula(n,a,o),e.closeAnglesDialog()}},e.onReset=function(){e.setState({tilesX:"",tilesY:"",jointX:"",jointY:"",jointDepth:""})},e.setActiveCollapseKeys=function(t){var n="ifc"===e.props.fileType;localStorage.setItem(n?"activeIfcPanelKeys":"activePdfPanelKeys",JSON.stringify(t)),e.setState({activePanelKeys:t})},e.checkAnnotationsWithAspectRatio=function(){return e.props.selectedAnnotations.some((function(e){return"Ellipse"===e.get("type")||"Free hand"===e.get("type")||"Stamp"===e.get("type")}))},e.getTiles=function(){var t=new DOMParser,n=e.props.selectedAnnotations.size>0?e.props.selectedAnnotations.toJS():[],a=Object(A.uniqWith)(Object(A.map)(n,(function(e){if("group"!==e.type&&"3DModel"!==e.type){var n=t.parseFromString(Object(A.get)(e,"xfdf")||Object(A.get)(e,"xdf"),"text/xml").querySelector("annots").firstElementChild;if("true"!==n.getAttribute("readOnly"))return{areaTileX:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_X")||n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_X"),areaTileY:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_TILES_Y")||n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.TILES_Y"),areaJointX:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_X")||n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_X"),areaJointY:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_Y")||n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_Y"),areaJointDepth:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.AREA_JOINT_DEPTH")||n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.JOINT_DEPTH"),wallTileX:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_X"),wallTileY:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_TILES_Y"),wallJointX:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_X"),wallJointY:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_Y"),wallJointDepth:n.getAttribute("ESTIMATE.ANNOTATION_PROPERTIES.WALL_JOINT_DEPTH")}}})),A.isEqual);return 1===a.length?Object(A.first)(a):{}},e.shouldPaneAppear=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=e.props.selectedAnnotations.toJS(),o=t?[At.g,At.x,At.O,At.P]:[At.g,At.x],i=[At.b,At.I,At.n];return(!n||!a.every((function(e){return i.includes(e.type)})))&&!a.some((function(e){return o.includes(e.type)}))},e.onFolderChanged=function(t){Oe({key:t,selectedAnnotations:e.props.selectedAnnotations,projectId:Number(e.props.match.params.projectId),onMovePreventEditingAnnots:e.props.onMovePreventEditingAnnots,onChange:e.onChangeValues})},e.onChangeValues=function(t,n,a){"height"!==a&&"quantity"!==a||e.resetState(),e.props.onChangeValues(t,n,a)},I.a.locale(Fe.a.language),e.formulaVariableMapping={NA:"ESTIMATE.ANNOTATION_VALUES.NET_AREA",NL:"NetLength",NVO:"NetVolume",NV:"NetWall"},e.colorPickerRef=c.a.createRef(),e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.setSelectedKeys(),this.unsubscribeAnnotaiotnStore=M.a.listen(this.annotationStoreUpdated),this.unsubscribeIfcStore=M.k.listen(this.ifcStoreUpdated)}},{key:"componentDidUpdate",value:function(e,t){t.displayAnnot!==this.state.displayAnnot&&this.resetState(),e.fileType!==this.props.fileType&&this.setSelectedKeys()}},{key:"componentWillUnmount",value:function(){this.unsubscribeAnnotaiotnStore(),this.unsubscribeIfcStore()}},{key:"shouldTilesAnglesDisplay",value:function(){var e=this.props.selectedAnnotations.toJS(),t=[At.A,At.j,At.m,At.B,At.D];return 0!==e.length&&e.every((function(e){return t.includes(e.type)}))}},{key:"getValuesForFeatureType",value:function(e){return Object(gn.f)(M.a.getCurrentSelectionType()).map((function(t){var n,a=gn.i[t],o=Object(A.find)(e,(function(e){return e===t})),i=t===At.i.VISIBLE;switch(t){case At.i.VISIBLE:n="Hidden";break;case At.i.TURN_OFF_FILL:n="turnOffFill";break;case At.i.NUMBER:n="showNumber";break;case At.i.NAME:n="showName";break;case At.i.AREA:n="showArea";break;case At.i.NET_AREA:n="showNetArea";break;case At.i.LENGTHS:case At.i.SCALE_LENGTH:n="showLengths";break;case At.i.LENGTH:n="showLength";break;case At.i.NET_LENGTH:n="showNetLength";break;case At.i.VOLUME:n="showVolume";break;case At.i.NET_VOLUME:n="showNetVolume";break;case At.i.WALLS:n="showWall";break;case At.i.TOTAL_WALL:n="showTotalWall";break;case At.i.TOTAL_NET_WALL:n="showTotalNetWall";break;case At.i.VARIABLES:n="showVariables";break;case At.i.REDUCTION:n="showReduction";break;default:console.log("Couldn't update XFDF with DisplayValue key."+t)}return{name:t,label:a,checked:o,reverseValue:i,values:n}}))}},{key:"handleFieldKeyDown",value:function(e){if(M.a.getSelectedParentFolders().length>0)this.onChangeValues(this.removeReadOnlyAnnotations(!1).toJS(),this.getStatePropsValue(e.target.name),e.target.name);else if(this.props.selectedAnnotations){if(this.resetState(),0===e.target.value.length)return;this.onChangeValues(this.getAnnotationsToUpdate(),this.getStatePropsValue(e.target.name),e.target.name)}}},{key:"getAnnotationsToUpdate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Object(A.filter)(this.props.selectedAnnotations.toJS(),(function(n){var a;return e&&n.type===At.s?n:n.type!==At.v||(null===(a=n.xfdf)||void 0===a?void 0:a.readOnly)&&!t?n.type!==At.v&&n.type!==At.s&&("true"!==(new DOMParser).parseFromString(n.xfdf||n.xdf,"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")||t?n:void 0):n}))}},{key:"removeReadOnlyAnnotations",value:function(e){var t=new T.a.List,n=M.a.getSelectedParentFolders();return n.length>0?T.a.fromJS(n):(this.props.selectedAnnotations.forEach((function(n){if("3DModel"!==n.get("type")){var a=(new DOMParser).parseFromString(n.get("xfdf")||n.get("xdf"),"text/xml");if("group"!==n.get("type"))"true"!==a.querySelector("annots").firstElementChild.getAttribute("readOnly")&&(t=t.push(n));else t=t.push(n)}else{if(e)return;n.getIn(["xfdf","readOnly"])||(t=t.push(n))}})),t)}},{key:"removeFolders",value:function(e){return e.filter((function(e){return"group"!==e.get("type")}))}},{key:"removeReadOnlyIFCAnnotations",value:function(){var e=new T.a.List;return this.props.selectedAnnotations.forEach((function(t){"3DModel"===t.get("type")&&(t.getIn(["xfdf","readOnly"])||(e=e.push(t)))})),e}},{key:"render",value:function(){var e=this,t=M.b.getRole(),n=M.a.annotationTypeMap.toJS(),a=n[At.O]||n[At.P],o=n[At.O]?At.O:n[At.P]&&At.P,i=-1===M.a.getActiveEstimate()?null:M.a.getActiveEstimate().get("id"),r=M.a.getScale({fileId:M.a.getActiveFileId(),estimateId:i,page:this.props.activePage,type:o}),s=r?[T.a.fromJS(r)]:[],l=n.nrSelected&&!a,u=!this.state.areaChecked&&!this.state.lengthChecked&&!this.state.volumeChecked&&!this.state.wallChecked,d=!(n["x-scale"]>0||n["y-scale"]>0);return 0!==this.props.selectedAnnotations.size||a?c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement(lt.a,{defaultActiveKey:this.state.activePanelKeys,onChange:function(t){return e.setActiveCollapseKeys(t)},expandIcon:function(e){var t=e.isActive;return c.a.createElement("span",null,c.a.createElement(y.a,{icon:["fal","caret-down"],className:"".concat(!t&&"fa-rotate-right-90")}))}},(n["x-scale"]>0||n["y-scale"]>0)&&c.a.createElement(In,{header:this.props.t("Scale Length"),key:"length"},c.a.createElement(pn,{scaleProperties:r,scaleLengthInput:this.props.scaleLengthInput,selectedAnnotations:s,preventEditing:Object(gn.c)(r||this.props.selectedAnnotations),role:t})),this.shouldPaneAppear()&&c.a.createElement(In,{header:this.props.t("Edit"),key:"edit"},c.a.createElement(pt,{role:t,nameInput:this.props.nameInput,nrTagInput:this.props.nrTagInput,values:{number:this.getStatePropsValue("number"),group:this.state.displayAnnot&&this.state.displayAnnot.get("parentId")||"root",groupData:M.a.getMoveFolderTree().toJS(),name:this.getStatePropsValue("name"),type:r?r.type:this.getStatePropsValue("type"),lockAspectRatio:Object(gn.d)(this.props.selectedAnnotations),preventEditing:Object(gn.c)(r||this.props.selectedAnnotations),annotationsWithAspectRatio:this.checkAnnotationsWithAspectRatio(),displayAnnot:this.state.displayAnnot},onAccept:{number:function(t){return e.handleFieldKeyDown(t)},name:function(t){return e.handleFieldKeyDown(t)}},onChange:{group:function(t){"root"===t&&(t=null),e.onFolderChanged(t)},number:this.handleChange,name:this.handleChange,lockAspectRatio:function(t){return e.onChangeValues(e.getAnnotationsToUpdate(),t,"maintainAspectRatio")},preventEditing:function(t){return e.onChangeValues(r||e.getAnnotationsToUpdate(!1,!0),t,"readOnly")}},shouldDisplayInputs:d})),this.shouldPaneAppear(!0)&&l&&c.a.createElement(In,{header:this.props.t("Workflow"),key:"workflow"},c.a.createElement(ut,{values:{status:this.getStatePropsValue("status"),preventEditing:Object(gn.c)(this.props.selectedAnnotations)},onChange:function(t){return e.onChangeValues(e.getAnnotationsToUpdate(),t,"status")}})),c.a.createElement(bn,{role:t,typeMap:n,showColorPicker:this.props.showColorPicker,changeColor:this.props.changeColor,selectedAnnotations:this.props.selectedAnnotations,displayAnnot:this.state.displayAnnot,openAnglesDialog:this.openAnglesDialog,openTilesDialog:this.openTilesDialog,fileType:this.props.fileType,activePanelKeys:this.state.activePanelKeys,setActiveCollapseKeys:this.setActiveCollapseKeys,fillColourInput:this.props.fillColourInput,borderColourInput:this.props.borderColourInput,textAreaInput:this.props.textAreaInput,annotationsToUpdate:this.getAnnotationsToUpdate(),removedReadOnlyAnnotations:this.removeReadOnlyAnnotations(),resetState:this.resetState,onChangeValues:this.onChangeValues,estimateId:i,activePage:this.props.activePage}),this.shouldPaneAppear()&&this.getValuesForFeatureType(this.state.displayAnnot&&this.state.displayAnnot.toJS().displayValueList).length>0&&c.a.createElement(In,{header:this.props.t("Visuals"),key:"visuals"},c.a.createElement(Tt,{valuesForFeatureType:this.getValuesForFeatureType(r?r.displayValueList:this.state.displayAnnot&&this.state.displayAnnot.toJS().displayValueList),values:{preventEditing:Object(gn.c)(r||this.props.selectedAnnotations)},onChangeValues:this.onChangeValues,annotationsToUpdate:this.getAnnotationsToUpdate(),scaleProperties:r})),this.shouldPaneAppear(!0,!0)&&c.a.createElement(In,{header:this.props.t("Values"),key:"values"},c.a.createElement(dn,{onOutsideClick:function(){return e.setState({clickedRowKey:void 0})}},c.a.createElement(ft,{role:t,displayAnnot:this.state.displayAnnot,clickedRowKey:this.state.clickedRowKey,formulaValue:this.state.formulaValue,formulaVariable:this.state.formulaVariable,resetState:this.resetState,handleChange:this.handleChange,handleRowClick:this.handleRowClick,values:{preventEditing:Object(gn.c)(this.props.selectedAnnotations)},splitPosRight:this.props.splitPosRight,annotationsToUpdate:this.getAnnotationsToUpdate(),onChangeValues:this.onChangeValues})))),this.state.anglesDialog&&c.a.createElement(mn,{modalVisible:this.state.anglesDialog,cancelModal:this.closeAnglesDialog,inputLabel:"Angle",onCheckboxChecked:this.anglesSelection,onSubmit:this.saveAngles,okButtonDisabled:u,checkboxStatuses:{areaChecked:this.state.areaChecked,lengthChecked:this.state.lengthChecked,volumeChecked:this.state.volumeChecked,wallChecked:this.state.wallChecked}}),this.state.tilesDialog&&c.a.createElement(Tn,{modalVisible:this.state.tilesDialog,cancelModal:this.closeTilesDialog,onSubmit:this.saveTiles,netSelection:n.Polyline?"netWall":this.state.tilesSelection,onSelectionChange:this.changeTilesSelection,annotationsTiles:this.getTiles(),displayArea:!n.Polyline})):c.a.createElement(ct.a,{description:!1,style:{marginTop:"30vh"}})}}]),n}(c.a.Component),vn=Object(f.a)()(yn),Nn=(n(2563),function(e){var t=e.toogleActiveToolNode,n=e.activePage,a=e.pageCount,o=e.toolNode,i=e.pageBack,r=e.pageForward,s=e.selectPage,l=e.toggleShowFileExportModal,u=M.b.getRole();return c.a.createElement(c.a.Fragment,null,c.a.createElement("div",null),c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement("div",{className:"calculateToolbar"},c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("edit")},onMouseLeave:function(){return Object(k.p)()},onClick:function(){return t("AnnotationEdit")},className:"AnnotationEdit"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","mouse-pointer"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("pan")},onMouseLeave:function(){return Object(k.p)()},onClick:function(){return t("Pan")},className:"Pan"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","arrows"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("point")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreatePoint")},className:"AnnotationCreatePoint"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","location"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("line")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreatePolyline")},className:"AnnotationCreatePolyline"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","arrows-alt-h"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("polygon")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreatePolygon")},className:"AnnotationCreatePolygon"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","draw-polygon"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("ellipse")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreateEllipse")},className:"AnnotationCreateEllipse"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","circle"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("freehand")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreateFreeHand")},className:"AnnotationCreateFreeHand"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","tilde"]})}),c.a.createElement("div",{className:"Toolbar_Inactive_Button_Wrapper",onMouseEnter:function(){return Object(k.q)("reduction")},onMouseLeave:function(){return Object(k.p)()}},c.a.createElement(h.a,{disabled:!u||M.a.isReductionToolDisabled(),onClick:function(){return t("AnnotationCreateReduction")},className:"AnnotationCreateReduction"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","object-group"]})})),c.a.createElement(C.a,{type:"vertical"}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("text")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreateFreeText")},className:"AnnotationCreateFreeText"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","comment-alt-dots"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("stamp")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreateStamp")},className:"AnnotationCreateStamp"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","image"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("arrow")},onMouseLeave:function(){return Object(k.p)()},disabled:!u,onClick:function(){return t("AnnotationCreateArrow")},className:"AnnotationCreateArrow"===o?"Toolbar_Button--active":null,icon:c.a.createElement(y.a,{icon:["fal","long-arrow-alt-right"]})}),c.a.createElement(C.a,{type:"vertical"}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("zoom")},onMouseLeave:function(){return Object(k.p)()},onClick:function(){return t("MarqueeZoomTool")},icon:c.a.createElement(y.a,{icon:["fal","search"]})}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("fit")},onMouseLeave:function(){return Object(k.p)()},onClick:function(){return M.a.setFitToScreen()},icon:c.a.createElement(y.a,{icon:["fal","expand"]})}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","angle-left"]}),onClick:i,disabled:1===n}),c.a.createElement(F.a,{id:"pageInput",value:n||"",addonAfter:a?"/ "+a:"",onFocus:function(){return document.activeElement.select()},className:"PageInputGroup",onChange:s,onBlur:function(e){return s(e,!0)}}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","angle-right"]}),onClick:r,disabled:n===a}),c.a.createElement(C.a,{type:"vertical"}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("download")},onMouseLeave:function(){return Object(k.p)()},onClick:M.a.saveDocumentToPdf,icon:c.a.createElement(y.a,{icon:["fal","file-download"]})}),c.a.createElement(C.a,{type:"vertical"}),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("export")},onMouseLeave:function(){return Object(k.p)()},onClick:function(){return l(!0)},icon:c.a.createElement(y.a,{icon:["fal","file-export"]})}))))}),On=n(2627),wn=n(580),Pn=n.n(wn),Rn=n(158),Ln=function(e){var t=e.showFileExportModal,n=e.setShowFileExportModal,a=Object(l.useState)(!1),o=Object(D.a)(a,2),i=o[0],r=o[1],s=Object(l.useState)(At.c.Annotation_Nothing),u=Object(D.a)(s,2),d=u[0],p=u[1],g=Object(l.useState)(At.d.Annotation_Rows_Nothing),m=Object(D.a)(g,2),f=m[0],A=m[1],E=Object(U.a)().t;Object(l.useEffect)((function(){return function(){r(!1),p(At.c.Annotation_Nothing),A(At.d.Annotation_Rows_Nothing)}}),[]);var T=function(){r(!1),p(At.c.Annotation_Nothing),A(At.d.Annotation_Rows_Nothing),n(!1)},S=function(e,t){var a=document.createElement("a"),o="";if(e&&!t){var i=M.h.exportAnnotationsToCsv(d);o=i.getIn(["headlineData","filename"]),"Windows"===Object(Rn.c)()?a.setAttribute("href","data:data/csv;charset=utf-8,%EF%BB%BF"+encodeURIComponent(i.getIn(["headlineData","exportData"]))):a.setAttribute("href","data:data/csv,"+encodeURIComponent(i.getIn(["headlineData","exportData"])))}else if(!e&&t){var s=M.h.exportCalcRowsToCSV(f);o=s.getIn(["headlineData","filename"]),"Windows"===Object(Rn.c)()?a.setAttribute("href","data:data/csv;charset=utf-8,%EF%BB%BF"+encodeURIComponent(s.getIn(["headlineData","exportData"]))):a.setAttribute("href","data:data/csv,"+encodeURIComponent(s.getIn(["headlineData","exportData"])))}a.setAttribute("download",o+".csv"),a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),r(!1),p(At.c.Annotation_Nothing),A(At.d.Annotation_Rows_Nothing),n(!1)};return c.a.createElement(k.j,{visible:t,title:E("Export"),onCancel:T,width:428,activeButtons:c.a.createElement("div",null,c.a.createElement(h.a,{type:"secondary",onClick:function(){d!==At.c.Annotation_Nothing&&f!==At.d.Annotation_Rows_Nothing?(S(!0,!1),S(!1,!0)):d!==At.c.Annotation_Nothing&&f===At.d.Annotation_Rows_Nothing?S(!0,!1):d===At.c.Annotation_Nothing&&f!==At.d.Annotation_Rows_Nothing&&S(!1,!0)}},E("Export to CSV")),c.a.createElement(Pn.a,{"data-clipboard-text":function(){if(d!==At.c.Annotation_Nothing&&f===At.c.Annotation_Nothing)return M.h.exportAnnotationsToClipboard(d).getIn(["headlineData","exportData"]);if(d===At.c.Annotation_Nothing&&f!==At.c.Annotation_Nothing)return M.h.exportCalcRowsToClipboard(f).getIn(["headlineData","exportData"]);if(d!==At.c.Annotation_Nothing&&f!==At.c.Annotation_Nothing){var e=M.h.exportAnnotationsToClipboard(d).getIn(["headlineData","exportData"]),t=M.h.exportCalcRowsToClipboard(f).getIn(["headlineData","exportData"]);return e.concat("\n\n"+t)}return E("Export Error")}(),onSuccess:T,className:"clipboard-btn"},c.a.createElement(h.a,{type:"primary"},E("Copy to Clipboard"))))},c.a.createElement(Xe.a.Group,{onChange:function(e){var t=e.target.value;switch(t){case At.c.Annotation_Nothing:case At.c.Annotation_Full:case At.c.Annotation_Net_Only:case At.c.Annotation_Net_Only_No_Path:case At.c.Annotation_Folder_Full:r(t),p(t),A(At.d.Annotation_Rows_Nothing);break;case At.d.Annotation_Rows_Nothing:case At.d.Annotation_Rows_Full:case At.d.Annotation_Rows_Sum_Folder:case At.d.Annotation_Rows_Sum:case At.d.Annotation_Rows_Bidcon:r(t),A(t),p(At.c.Annotation_Nothing)}},value:i},c.a.createElement(On.b,{direction:"vertical"},c.a.createElement(Xe.a,{value:At.c.Annotation_Folder_Full},E("Folder Export [Everything]")),c.a.createElement(Xe.a,{value:At.c.Annotation_Full},E("Objects [Selection]")),c.a.createElement(Xe.a,{value:At.c.Annotation_Net_Only},E("Objects (Net) [Selection]")),c.a.createElement(Xe.a,{value:At.c.Annotation_Net_Only_No_Path},E("Objects, no folder structure (Net) [Selection]")),c.a.createElement(Xe.a,{value:At.d.Annotation_Rows_Full},E("Rows [Selection]")),c.a.createElement(Xe.a,{value:At.d.Annotation_Rows_Sum},E("Rows (Sum) [Selection]")),c.a.createElement(Xe.a,{value:At.d.Annotation_Rows_Sum_Folder},E("Rows (Sum per Folder) [Everything]")),c.a.createElement(Xe.a,{value:At.d.Annotation_Rows_Bidcon},E("BidCon Export [Everything]")))))},Cn=n(2623),_n=function(e){var t=e.close,n=e.visible,a=Object(U.a)().t;return c.a.createElement(Cn.a,{title:a("Link Object to Estimate"),visible:n,onCancel:function(){return t()},footer:[c.a.createElement(h.a,{onClick:function(){t()}},a("Cancel")),c.a.createElement(h.a,{type:"primary",onClick:function(){M.k.linkObject(),t()}},a("Link Object")),c.a.createElement(h.a,{type:"primary",onClick:function(){M.k.linkNormalisedObject(),t()}},a("Link Normalised Object"))]},c.a.createElement("div",null,c.a.createElement("label",null,a("Linking an object to an estimate allows you to add rows and perform calculations on it. Do you wish to link it as an Object or Normalised Object?"))))},Mn=n(2621),kn=(n(2571),function(e){var t=e.visible,n=e.toDuplicate,a=e.duplicated,o=e.updatingUI,i=e.userId===M.b.getUserId()?"Working on it":"Receiving large changes from another user",r=(a/n*100).toFixed(1);return c.a.createElement(Cn.a,{visible:t,footer:null,closable:!1,title:i},c.a.createElement("div",{className:"DuplicateModal"},c.a.createElement(Mn.a,{percent:r}),o&&c.a.createElement(c.a.Fragment,null,c.a.createElement(g.a,null),c.a.createElement("p",null,"Applying changes"))))}),Dn=function(e){var t=e.visible,n=e.onCancel,a=e.annotationLists,o=Object(U.a)().t;return c.a.createElement(k.j,{className:"Modal",title:o("Move Objects"),visible:t,onCancel:n,activeButtons:c.a.createElement("div",null)},c.a.createElement("label",null,"".concat(o("You are unable to move this selection because it contains locked objects. Please unlock them before moving or move them to a different location"),".")),c.a.createElement(ze.b,{className:"List",dataSource:a.toJS(),renderItem:function(e){return Ge(e)}}))},xn=function(e){var t=e.visible,n=e.toDuplicate,a=e.duplicated,o=e.updatingUI,i=e.userId===M.b.getUserId()?"Working on it":"Receiving large changes from another user",r=(a/n*100).toFixed(1);return c.a.createElement(Cn.a,{visible:t,footer:null,closable:!1,title:i},c.a.createElement("div",{className:"DuplicateModal"},c.a.createElement(Mn.a,{percent:r}),o&&c.a.createElement(c.a.Fragment,null,c.a.createElement(g.a,null),c.a.createElement("p",null,"Applying changes"))))},Fn=(n(2572),Object(l.forwardRef)((function(e,t){var n=e.modelUrl,a=e.loadingProgressCallback,o=void 0===a?function(){}:a,i=e.missingWebGlCallback,r=void 0===i?function(e){console.log("WebGL error: ",e)}:i,s=e.projectId,u=e.tree,d=e.openLinkingModal,p=e.isActiveCalculate,g=Object(l.useRef)(),h=Object(l.useState)(void 0),m=Object(D.a)(h,2),f=m[0],A=m[1];Object(l.useEffect)((function(){M.a.initValueInheritance(s),M.k.initValueInheritance(),M.a.isAnnotationActionDone()||(_.h.requestOpenProject(s),_.h.requestProject(s))}),[]);return Object(l.useEffect)((function(){var e=new BimerIfcViewer.measures.MeasuresExtension({rendererOptions:{enabledByDefault:!0,drawVerticesLabels:!0,complexElementThreshold:1e3,complexElementLabel:"Element is too complex to render labels"}});new BimerIfcViewer.lib.SceneContainer(g.current,"en",[e]).loadModel(n,(function(e){e.addEventListener("model-element-selected",(function(e){if(p){var t=(n=u,a=e.uuid,n.reduce((function e(t,n){if(n.key===a)return t.push(n),t;if(Array.isArray(n.children)){var o=n.children.reduce(e,[]);o.length&&t.push(Object(w.a)(Object(w.a)({},n),{},{children:o}))}return t}),[]))[0].children[0].children[0];M.k.setSelectedObject(t),M.k.getLinkState()&&M.k.canLinkObejct()&&d()}var n,a})),e.addEventListener("model-element-unselected",(function(){M.k.setSelectedObject({})})),A(e),M.k.setActions(e)}),o,r)}),[n,u,g]),Object(l.useImperativeHandle)(t,(function(){return{freeOrbit:function(){f&&f.freeOrbit()},pan:function(){f&&f.pan()},zoom:function(){f&&f.zoom()},firstPerson:function(){f&&f.firstPerson()},reset:function(){f&&f.reset()},toggleFullscreen:function(){f&&f.toggleFullscreen()},getAvailableFilterTypes:function(){return void 0!==f?f.getAvailableFilterTypes():[]},explode:function(e){f&&f.explode(e)},clip:function(e){f&&f.clip(e)},applyFilter:function(e,t){f&&f.applyFilter(e,t)},calculateElementMeasures:function(e,t){f&&f.calculateElementMeasures(e,t)}}}),[f]),c.a.createElement("div",{className:"Bimerifc_Container"},c.a.createElement("div",{className:"bimerifc-scene-container",ref:g}))}))),jn=n(2619),Vn=n(163);function Un(){return(Un=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e}).apply(this,arguments)}function Wn(e,t){if(null==e)return{};var n,a,o=function(e,t){if(null==e)return{};var n,a,o={},i=Object.keys(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)n=i[a],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var Bn=c.a.createElement("path",{d:"M6.5 9V15L1 11.6129V6L6.5 9Z",stroke:"black",strokeWidth:.8,strokeLinecap:"round",strokeLinejoin:"round"}),Hn=c.a.createElement("path",{d:"M9.5 9V15L15 11.6129V6L9.5 9Z",stroke:"black",strokeWidth:.8,strokeLinecap:"round",strokeLinejoin:"round"}),Jn=c.a.createElement("path",{d:"M8 6.87097L2 3.70968L8 1L13.8599 3.70968L8 6.87097Z",stroke:"black",strokeWidth:.8,strokeLinecap:"round",strokeLinejoin:"round"}),zn=function(e){var t=e.svgRef,n=e.title,a=Wn(e,["svgRef","title"]);return c.a.createElement("svg",Un({className:"svg-inline--fa fa-crop-alt fa-w-16 ",width:14,height:14,viewBox:"0 0 16 16",fill:"none",ref:t},a),n?c.a.createElement("title",null,n):null,Bn,Hn,Jn)},Gn=c.a.forwardRef((function(e,t){return c.a.createElement(zn,Un({svgRef:t},e))})),qn=(n.p,n(2573),n(86)),Xn=function(){return c.a.createElement("span",{className:"Bimer_Divider"})},Yn=Object(d.i)((function(e){var t=e.viewerRef,n=e.selectedNode,a=e.toggleShowFileExportModal,o=Object(x.a)(e,["viewerRef","selectedNode","toggleShowFileExportModal"]),i=Object(l.useState)(qn.a.FREE_ORBIT),r=Object(D.a)(i,2),s=r[0],u=r[1],d="/projects/:projectId/calculate/:fileId"===o.match.path,p=Object(l.useRef)(),g=M.b.getRole(),f=Object(l.useState)(0),A=Object(D.a)(f,2),E=A[0],T=A[1],S=Object(l.useState)(0),b=Object(D.a)(S,2),I=b[0],v=b[1];Object(l.useEffect)((function(){var e=M.k.listen(N);return function(){return e()}}),[]),Object(l.useEffect)((function(){if(t.current)switch(s){case qn.a.FREE_ORBIT:t.current.freeOrbit(),M.k.setLinkState(!1);break;case qn.a.PAN:t.current.pan(),M.k.setLinkState(!1);break;case qn.a.ZOOM:t.current.zoom(),M.k.setLinkState(!1);break;case qn.a.FIRST_PERSON:t.current.firstPerson(),M.k.setLinkState(!1);break;case qn.a.LINK:M.k.setLinkState(!0)}}),[t,s]),Object(l.useEffect)((function(){t.current&&t.current.clip(E)}),[t,E]),Object(l.useEffect)((function(){t.current&&t.current.explode(I)}),[t,I]);var N=function(e){switch(e){case"changeActiveTool":w(M.k.getActiveTool());break;case"resetView":O()}},O=function(){v(0),T(0),p.current&&p.current.reset(),t.current&&t.current.reset()},w=function(e){u(e),M.k.setActiveTool(e)};return c.a.createElement("div",{className:"Bimer_Container"},d&&c.a.createElement(c.a.Fragment,null,c.a.createElement(h.a,{className:s===qn.a.LINK?"Toolbar_Button--active":"",icon:c.a.createElement(y.a,{icon:Vn.e}),onClick:function(){w(qn.a.LINK)},disabled:!g}),c.a.createElement(Xn,null)),c.a.createElement(h.a,{className:s===qn.a.FREE_ORBIT?"Toolbar_Button--active":"",icon:c.a.createElement(y.a,{icon:Vn.c}),onClick:function(){w(qn.a.FREE_ORBIT)}}),c.a.createElement(h.a,{className:s===qn.a.PAN?"Toolbar_Button--active":"",icon:c.a.createElement(y.a,{icon:Vn.a}),onClick:function(){w(qn.a.PAN)}}),c.a.createElement(h.a,{className:s===qn.a.ZOOM?"Toolbar_Button--active":"",icon:c.a.createElement(y.a,{icon:Vn.g}),onClick:function(){w(qn.a.ZOOM)}}),c.a.createElement(h.a,{className:s===qn.a.FIRST_PERSON?"Toolbar_Button--active":"",icon:c.a.createElement(y.a,{icon:Vn.f}),onClick:function(){w(qn.a.FIRST_PERSON)}}),c.a.createElement(Xn,null),c.a.createElement(m.a,{overlay:c.a.createElement("div",{className:"Toolbar_Overlay"},c.a.createElement(jn.a,{value:I,onChange:v})),trigger:"click"},c.a.createElement(h.a,{icon:c.a.createElement(Gn,null)})),c.a.createElement(m.a,{overlay:c.a.createElement("div",{className:"Toolbar_Overlay"},c.a.createElement(jn.a,{value:E,onChange:function(e){T(e)}})),trigger:"click"},c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:Vn.b})})),c.a.createElement(Xn,null),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:Vn.h}),onClick:O}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:Vn.d}),onClick:function(){t.current&&t.current.toggleFullscreen()}}),d?c.a.createElement(c.a.Fragment,null,c.a.createElement(Xn,null),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("export")},onMouseLeave:function(){return Object(k.p)()},onClick:function(){return a(!0)},icon:c.a.createElement(y.a,{icon:["fal","file-export"]})})):c.a.createElement(h.a,{onClick:function(){var e=parseInt(o.match.params.projectId,10);o.history.push("/projects/".concat(e,"/calculate/").concat(n.key))},icon:c.a.createElement(y.a,{icon:["fal","external-link"]})}))})),Kn=(n(2574),n(125)),Zn=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(e){var a;Object(o.a)(this,n),(a=t.call(this,e)).fileStoreUpdated=function(e,t){switch(e){case"openFile":a.props.history.push("/projects/"+a.props.match.params.projectId+"/calculate/"+t);break;case"treeListUpdated":a.isIfcFileOpened(!0)&&M.k.fetchIfcModelStructureData(Object(Rn.b)(parseInt(a.props.match.params.fileId,10))),a.setState({treeListLoaded:!0})}},a.checkIfDataIsFetching=function(){var e=M.a.getFetchingDataLoader();a.setState({fetchingDataLoader:e})},a.toggleRows=function(){a.setState({toggleRows:!a.state.toggleRows}),localStorage.setItem("toggleRows",a.state.toggleRows)},a.toggleProperties=function(){a.setState({toggleProperties:!a.state.toggleProperties}),localStorage.setItem("toggleProperties",a.state.toggleProperties)},a.toggleDocument=function(){a.setState({toggleDocument:!a.state.toggleDocument}),localStorage.setItem("toggleDocument",a.state.toggleDocument)},a.toggleTreeFilter=function(){M.q.calculateTreeSelect([],{selectedNodes:[]}),M.q.toggleTreeFilter()},a.toggleSnapOn=function(){M.a.toggleSnapon1()},a.changeTreeSorting=function(e){localStorage.setItem("annotationTreeSorting",e.target.value);var t=M.q.buildTree();a.setState({treeSorting:e.target.value,treeData:t.get("treeData").toJS()})},a.setScalesValuesOnUpdate=function(){Object(Ve.b)()===je.f?a.setState({lengthY:M.o.getLength(je.f)}):Object(Ve.b)()===je.e&&a.setState({lengthX:M.o.getLength(je.e)})},a.setDefaultScalesValues=function(){a.state.lengthX||a.setState({lengthX:M.o.getLength(je.e)}),a.state.lengthY||a.setState({lengthY:M.o.getLength(je.f)})},a.annotationStoreUpdated=function(e){switch(e){case"showStampTooHeavyDialog":a.setState({showStampTooHeavyDialog:!0});break;case"documentLoaded":var t=M.a.getWebViewerFileInformation(),n=t.get("activePage");if(""!==window.location.hash&&(n=parseInt(window.location.hash.replace("#",""),10),N.a.setActivePageId(n,!0)),!a.isFileChanged.current){var o=M.q.buildTree(Object(p.a)(a.state.expandedKeys));a.setState({treeData:o.get("treeData").toJS()})}a.isFileChanged.current=!1,a.setState({activePage:n,pageCount:t.get("pageCount"),hasSetInitialPage:!0,fileList:M.i.getAllSortedFilesList(),activeFileId:M.a.getActiveFileId()}),a.setDefaultScalesValues(),M.a.setIsAltKeyEnabledForScale(!Object(Ve.a)(a.state.activePage));break;case"toggleDeleteModal":a.setState({deleteModalVisibile:!0});break;case"folderInserted":try{var i=M.a.getWebViewerFileInformation(),r=M.q.buildTree(Object(p.a)(a.state.expandedKeys));a.setState({treeData:r.get("treeData").toJS(),expandedKeys:new Set(r.get("expandedKeys").toJS()),selectedAnnotations:M.q.getCurrentlySelectedNodes(),activeFileId:M.a.getActiveFileId(),activePage:i.get("activePage"),pageCount:i.get("pageCount"),fileList:M.i.getAllSortedFilesList(),selectedKeys:M.q.getTreeSelection(),selectedFolderName:M.a.getMergedFolderData().name,selectedFolderNumber:M.a.getMergedFolderData().number},(function(){M.a.getAddedAnnotInfo()&&setTimeout((function(){a.treeRef.current.scrollTo({key:M.a.getAddedAnnotInfo().id,align:"top",offset:60}),M.a.setAddedAnnotInfo(null)}),100)})),a.nameInput.current&&(a.nameInput.current.focus(),a.nameInput.current.select())}catch(v){console.log("eror insert fl "+v.stack)}break;case"scaleInserted":a.scaleLengthInput.current&&(a.scaleLengthInput.current.focus(),a.scaleLengthInput.current.select());break;case"pageChanged":if(a.setState({activePage:M.a.getActivePageId()}),!a.isFileChanged.current){var s=M.q.buildTree();a.setState({treeData:s.get("treeData").toJS()})}a.setDefaultScalesValues();break;case"fileChanged":case"EstimateInitialized":case"AnnotationUpdated":case"AnnotationDeleted":case"annotationsInserted":case"AnnotationAdded":"fileChanged"!==e&&"EstimateInitialized"!==e&&M.f.updateAnnotationsInDrive(M.a.getAnnotations());var l=M.a.getWebViewerFileInformation();if(!a.isFileChanged.current||"EstimateInitialized"===e||a.isIfcFileOpened()){var c=M.q.buildTree(Object(p.a)(a.state.expandedKeys));a.setState({treeData:c.get("treeData").toJS(),expandedKeys:new Set(c.get("expandedKeys").toJS())})}"fileChanged"===e&&(a.isFileChanged.current=!0);var u=l.get("activePage");if("pageChanged"===e&&a.state.hasSetInitialPage?window.history.replaceState({},"unused argument","#".concat(l.get("activePage"))):a.state.hasSetInitialPage||(u=parseInt(window.location.hash.replace("#",""),10)),"annotationsInserted"===e)M.a.annotationTypeMap.toJS()[At.n]>0&&a.textAreaInput.current?a.textAreaInput.current.focus():a.nameInput.current&&(a.nameInput.current.focus(),a.nameInput.current.select());var d=M.q.getCurrentlySelectedNodes().toJS().filter((function(e){return"group"===e.type})),g=M.a.getSelectedParentFolders(),h=d.filter((function(e){return g.some((function(t){return e.id===t.id}))}));h.length>0&&M.a.setArrayOfParentFolders(h),a.setState({selectedAnnotations:M.q.getCurrentlySelectedNodes(),activeFileId:M.a.getActiveFileId(),activePage:u,pageCount:l.get("pageCount"),fileList:M.i.getAllSortedFilesList(),lengthX:M.o.getLength(je.e),lengthY:M.o.getLength(je.f),selectedFolderName:M.a.getMergedFolderData().name,selectedFolderNumber:M.a.getMergedFolderData().number},(function(){a.clearDuplicateStates(),"annotationsInserted"===e&&M.a.setIsReductionCreated(!1),M.a.getAddedAnnotInfo()&&"annotationsInserted"===e&&setTimeout((function(){var e;a.treeRef.current.scrollTo({key:null===(e=M.a.getAddedAnnotInfo())||void 0===e?void 0:e.id,align:"top",offset:60}),M.a.setAddedAnnotInfo(null)}),100)})),a.setScalesValuesOnUpdate(),M.a.setIsAltKeyEnabledForScale(!Object(Ve.a)(a.state.activePage));break;case"userInsertedAnnotations":var m=0,f=setInterval((function(){m>10?clearInterval(f):(document.querySelector(".info-name")&&(document.querySelector(".info-name").focus(),clearInterval(f)),m++)}),500);break;case"annotationSelectedFromGui":case"annotationSelected":case"annotationDeSelectedFromGui":a.setState({selectedAnnotations:M.q.getCurrentlySelectedNodes(),selectedKeys:M.q.getTreeSelection(),allKeysSelected:M.q.isSelectAll(),selectedFolderName:M.a.getMergedFolderData().name,selectedFolderNumber:M.a.getMergedFolderData().number});break;case"displayModeUpdated":a.setState({displayMode:M.a.getDisplayMode()});break;case"snapModeUpdated":a.setState({snapMode:M.a.getSnapMode()});break;case"toggleSnapon":localStorage.setItem("toggleSnapOn",M.a.getSnaponEnabled()),a.setState({toggleSnapOn:M.a.isSnaponEnabled()});break;case"allSelectedFromGui":break;case"UserAddedScale":a.setDefaultScalesValues();break;case"showWebViewerImportDialog":a.setState({showWebViewerImportDialog:!0});break;case"toolChange":a.setState({toolNode:M.a.getCurrentToolNode()});break;case"focusNameInput":a.nameInput.current&&(a.nameInput.current.focus(),a.nameInput.current.select());break;case"focusNrTagInput":a.nrTagInput.current&&(a.nrTagInput.current.focus(),a.nrTagInput.current.select());break;case"showFillColour":if(a.fillColourInput.current&&a.isEveryAnnotSameType()){var A=a.state.selectedAnnotations.toJS()[0].type;"Free text"===A?a.showColorPicker(A,At.E):a.showColorPicker(A,At.w),a.fillColourInput.current.focus(),a.fillColourInput.current.select()}break;case"showBorderColour":if(a.borderColourInput.current&&a.isEveryAnnotSameType()){var E=a.state.selectedAnnotations.toJS()[0].type;"Free text"===E?a.showColorPicker(E,At.J):a.showColorPicker(E,At.e),a.borderColourInput.current.focus(),a.borderColourInput.current.select()}break;case"showReplaceRowsConfirmation":M.n.getCopyAnnotationRows().size>0&&a.state.selectedAnnotations.size>0&&a.setState({showReplaceRowsConfirmation:!0});break;case"showFileExportModal":a.toggleShowFileExportModal(!0);break;case"toggleDocument":a.toggleDocument();break;case"toggleRows":a.toggleRows();break;case"toggleProperties":a.toggleProperties();break;case"duplicatingAnnotsInfoChanged":var T=M.a.getDuplicateAnnotsModalInfo(),S=T.duplicatingAnnots,b=T.annotsToDuplicate,I=T.annotsDuplicated,y=T.userId;a.setState({duplicateAnnotsModal:{duplicatingAnnots:S,annotsToDuplicate:b,annotsDuplicated:I,userId:y}});break;case"fetchingDataLoaderChanged":a.checkIfDataIsFetching();break;case"closeSubMenu":a.setState({showSubmenu:!1})}},a.headerStoreUpdated=function(e){if("appSearchUpdated"===e){var t=M.q.buildTree();a.setState({treeData:t.get("treeData").toJS()})}},a.treeStoreUpdated=function(e){switch(e){case"toggleTreeFilter":localStorage.setItem("toggleTreeFilter",M.q.getTreeFilter());var t=M.q.buildTree();a.setState({toggleTreeFilter:M.q.getTreeFilter(),treeData:t.get("treeData").toJS()});break;case"treeExpansionUpdated":a.setState({expandedKeys:new Set(M.q.getTreeExpansion())})}},a.calculationStoreUpdated=function(e){switch(e){case"CalculationRowInserted":case"CalculationRowUpdated":case"CalculationRowsFetched":case"CalculationRowDeleted":var t=M.q.buildTree();a.setState({treeData:t.get("treeData").toJS()},(function(){return a.clearRowsActionsModalInfo()}));break;case"rowsActionsInfoChanged":var n=M.c.getRowsActionsModalInfo(),o=n.updatingRows,i=n.rowsToUpdate,r=n.rowsUpdated,s=n.userId;a.setState({rowsActionsModal:{updatingRows:o,rowsToUpdate:i,rowsUpdated:r,userId:s}})}},a.ifcStoreUpdated=function(e){switch(e){case"modelStructureTreeBuilded":var t=M.k.getModelStructureTree();a.setState({modelStructureTree:t});break;case"updateIfcTree":a.setState({selectedIfcKeys:M.k.getSelectedKeys()});break;case"ifcAnnotationsUpdated":case"ifcAnnotationInserted":var n=M.a.getWebViewerFileInformation(),o=M.q.buildTree(),i=n.get("activePage");"pageChanged"===e&&a.state.hasSetInitialPage?window.history.replaceState({},"unused argument","#".concat(n.get("activePage"))):a.state.hasSetInitialPage||(i=parseInt(window.location.hash.replace("#",""),10)),a.setState({treeData:o.get("treeData").toJS(),selectedAnnotations:M.q.getCurrentlySelectedNodes(),selectedKeys:M.q.getTreeSelection(),activeFileId:M.a.getActiveFileId(),activePage:i,pageCount:n.get("pageCount"),fileList:M.i.getAllSortedFilesList(),selectedFolderName:M.a.getMergedFolderData().name,selectedFolderNumber:M.a.getMergedFolderData().number}),a.setScalesValuesOnUpdate(),M.a.setIsAltKeyEnabledForScale(!Object(Ve.a)(a.state.activePage))}},a.onCalculateTreeCheck=function(e,t){M.q.calculateTreeCheck(e.checked,t),M.o.selectScale(null)},a.isNumeral=function(e){return I.a.locale(Fe.a.language),!(!(e=I()(e))&&"number"!==typeof e.value()&&""!==e)},a.expandAll=function(){M.a.expandAll(),a.setState({allKeysExpanded:!0})},a.collapseAll=function(){M.q.setTreeExpansion([]),a.setState({allKeysExpanded:!1})},a.showColorPicker=function(e,t){return a.setState({colorPickerVisible:!0,colorPickerData:{annotationType:e,annotationProp:t}})},a.changeColorFromPicker=function(e){return a.changeColor(e,a.state.colorPickerData.annotationType,a.state.colorPickerData.annotationProp)},a.changeColor=function(e,t,n){var o=new T.a.List,i=t,r=n;if(e.hex){var s=new T.a.List;if(a.state.selectedAnnotations.forEach((function(e){var t="x-scale"===e.get("type")||"y-scale"===e.get("type"),n=new DOMParser;if("group"===e.get("type")){var a=M.a.getAllAnnotationsFromParent(e.get("id")).filter((function(e){return e.get("type")===i})),r=new T.a.List;a.forEach((function(e){"3DModel"!==e.get("type")&&("true"!==n.parseFromString(e.get("xfdf"),"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&(r=r.push(e)))})),s=s.concat(r)}else{if("3DModel"===e.get("type")&&!t)return void(e.getIn(["xfdf","readOnly"])||(o=o.push(e)));e.get("type")!==i||t||"true"!==n.parseFromString(e.get("xfdf"),"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&(s=s.push(e))}})),"interiorColor"===r||"fill"===r)a.onChangeValues(s.toJS(),e.hex,"interior-color");else if("border"===r){var l=M.o.getScale(i,a.state.activePage);Object(A.isEmpty)(l)?M.a.changeColor2(s.toJS(),e.hex):M.a.changeColor2(l,e.hex)}else"richTextColor"===r?s.forEach((function(t){var n=M.a.parseRichTextStyleFromXfdf(t.get("xfdf"));n.color=e.hex,M.a.setRichTextStyle((new T.a.List).push(t),n)})):"strokeColor"===r&&a.onChangeValues(s.toJS(),e.hex,"strokeColor");o.size>0&&M.k.changeIfcStyles("color",e.hex,o)}else a.setState({colorPickerVisible:!1})},a.handleClickOutside=function(e){a.state.colorPickerVisible&&a.colorPickerRef&&a.colorPickerRef.current&&!a.colorPickerRef.current.contains(e.target)&&"ant-btn showColorPicker"!==e.target.className&&a.setState({colorPickerVisible:!1,colorPickerData:{}})},a.getStatePropsValue=function(e){var t="border"===e||"richTextColor"===e?"color":e,n=M.a.getTheDisplayAnnot();return a.state[t]?a.state[t]:n&&n.get(t)?n.get(t):""},a.selectPage=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=""===Object(A.get)(e,"target.value")&&t?1:Number.parseInt(e.target.value,10)>a.state.pageCount?a.state.pageCount:Number.parseInt(e.target.value,10);a.setState({activePage:n}),Number.isInteger(n)&&n>=1&&n<=a.state.pageCount?N.a.setActivePageId(n,!0):N.a.setActivePageId(1,!0)},a.pageBack=function(){"number"===typeof a.state.activePage&&a.state.activePage>1&&(a.setState({activePage:a.state.activePage-1}),N.a.setActivePageId(a.state.activePage-1,!0))},a.pageForward=function(){"number"===typeof a.state.pageCount&&a.state.activePage<a.state.pageCount&&(a.setState({activePage:a.state.activePage+1}),N.a.setActivePageId(a.state.activePage+1,!0))},a.handleScaleChange=function(e,t){var n=e.target.value;(a.isNumeral(Number(n))||0===n.length)&&(t===je.f?a.setState({lengthY:n}):a.setState({lengthX:n}))},a.validateScale=function(e){var t=He[e]||null;if(a.state[t]&&0!==parseFloat(a.state[t])){var n=M.o.getScale(e,a.state.activePage);Object(Ve.d)(n,a.state[t])}},a.onScaleDelete=function(e){var t=T.a.fromJS([M.o.getScale(e,a.state.activePage)]);a.deleteHandler.deleteAnnotations(t)},a.isScaleAdded=function(){var e=Object(Ve.c)(a.state.activePage),t=e.xScale,n=e.yScale;return!(!t&&!n)},a.setScaleTool=function(e){a.setState({toolNode:""}),e===je.f?M.a.setUseYScaleOnly(!0):(M.a.setIsAltKeyEnabledForScale(!Object(Ve.a)(a.state.activePage)),M.a.setUseYScaleOnly(!1)),a.setState({activeScaleButton:e}),M.a.setToolMode("AnnotationCreateScale"),M.o.selectScale(e)},a.renderScale=function(){return Object(Ve.a)(a.state.activePage)?c.a.createElement(c.a.Fragment,null,c.a.createElement(Je,{activeScaleButton:a.state.activeScaleButton,handleScaleChange:function(e){return a.handleScaleChange(e,je.f)},length:a.state.lengthY,onIconClick:function(){return a.setScaleTool(je.f)},scaleName:je.f,validateScale:function(){return a.validateScale(je.f)},value:a.state.lengthY,icon:v.j,onScaleDelete:function(){return a.onScaleDelete(je.f)},activePage:a.state.activePage}),c.a.createElement(Je,{activeScaleButton:a.state.activeScaleButton,handleScaleChange:a.handleScaleChange,length:a.state.lengthX,onIconClick:function(){return a.setScaleTool(je.e)},scaleName:je.e,validateScale:function(){return a.validateScale(je.e)},value:a.state.lengthX,icon:v.i,onScaleDelete:function(){return a.onScaleDelete(je.e)},hideDeleteOption:!0,activePage:a.state.activePage})):""!==a.state.lengthX&&c.a.createElement("div",{className:"".concat(a.isScaleAdded()?"Show_Scale":"Hide_Scale")},c.a.createElement(Je,{activeScaleButton:a.state.activeScaleButton,handleScaleChange:a.handleScaleChange,length:a.state.lengthX,onIconClick:function(){return a.setScaleTool(je.e)},scaleName:je.e,validateScale:function(){return a.validateScale(je.e)},value:a.state.lengthX,icon:v.h,onScaleDelete:function(){return a.onScaleDelete(je.e)},activePage:a.state.activePage}))},a.toogleActiveToolNode=function(e){M.a.setToolMode(e),a.setState({toolNode:e})},a.toggleTemplateDialog=function(){a.setState({toggleTemplateDialog:!0,showSubmenu:!1})},a.switchShowSubmenu=function(e){a.setState({showSubmenu:e})},a.isIfcFileOpened=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=parseInt(a.props.match.params.fileId,10),n=M.i.getFileById(t),o="ifc"===Object(A.get)(n,"type");return M.a.setIfcIsActive(o),o&&e&&(a.isFileChanged.current=!1,M.a.onSetActiveFileId(t)),o},a.toggleIfcModal=function(e){a.setState({showLinkingModal:e})},a.redirectToFile=function(e){var t=M.a.getProjectIdFromEstimateId(e.geoEstimate.id);"folder"!==e.type&&(a.props.history.push("/projects/"+t+"/calculate/"+e.geoFile.id),window.location.reload())},a.deleteAnnotationHandler=function(){a.deleteHandler.deleteAnnotations(M.a.getAnnotationsLists().readWriteList),a.setState({deleteModalVisibile:!1}),M.q.clearSelectedAnnotations(),M.a.onSetActiveParentId(void 0,!0),M.a.deSelectAllAnnotationsFromGui()},a.onReplaceRows=function(){M.n.replaceAnnotationRows(a.state.selectedAnnotations),a.setState({showReplaceRowsConfirmation:!1}),a.closeContextDropdown()},a.onOpenReplaceRows=function(){a.setState({showReplaceRowsConfirmation:!0}),a.closeContextDropdown()},a.onCancelReplaceRows=function(){a.setState({showReplaceRowsConfirmation:!1}),a.closeContextDropdown()},a.toggleContextDropdown=function(e){a.setState({contextVisible:e})},a.closeContextDropdown=function(){a.setState({contextVisible:!1})},a.toggleShowFileExportModal=function(e){a.setState({showFileExportModal:e})},a.movePreventEditingAnnotsHandler=function(e){a.setState({showMoveModal:!0,preventEditingAnnotatationList:e})},a.closeMoveAnnotsModalHandler=function(){a.setState({showMoveModal:!1,preventEditingAnnotatationList:new T.a.List})},a.onChangeValues=function(e,t,n){if(e.type===je.e||e.type===je.f)M.a.onRequestScaleUpdate2({id:e.id,value:t,key:n});else{if("formulaNA"===n||"formulaNVO"===n)return void M.a.onRequestNAorNVOAnnotationUpdate(e,n,t);M.a.onRequestAnnotationUpdate({annots:e,key:n,value:t})}},a.viewerRef=c.a.createRef(),a.treeRef=c.a.createRef(),a.colorPickerRef=c.a.createRef(),a.nameInput=c.a.createRef(),a.nrTagInput=c.a.createRef(),a.fillColourInput=c.a.createRef(),a.borderColourInput=c.a.createRef(),a.scaleLengthInput=c.a.createRef(),a.textAreaInput=c.a.createRef(),a.isFileChanged=c.a.createRef();var i=parseInt(a.props.match.params.projectId,10);return a.state={toggleTemplateDialog:!1,toggleRows:!0^localStorage.getItem("toggleRows"),toggleProperties:!0^localStorage.getItem("toggleProperties"),toggleDocument:!0^localStorage.getItem("toggleDocument"),toggleTreeFilter:!!localStorage.getItem("toggleTreeFilter")&&JSON.parse(localStorage.getItem("toggleTreeFilter")),toggleSnapOn:void 0,treeSorting:localStorage.getItem("annotationTreeSorting")||"type-number-name",selectedNode:void 0,selectedAnnotations:new T.a.List,treeData:[],selectedKeys:localStorage.getItem("selectedAnnotation")?[Number(localStorage.getItem("selectedAnnotation"))]:[],activeFileId:void 0,fileList:new T.a.List,displayMode:void 0,snapMode:void 0,duplicateAnnotsModal:{duplicatingAnnots:!1,annotsToDuplicate:0,annotsDuplicated:0,showMoreDetails:!1,updatingUI:!1,userId:null},rowsActionsModal:{updatingRows:!1,rowsToUpdate:0,rowsUpdated:0,updatingUI:!1,userId:null},expandedKeys:localStorage.getItem("expandedKeys_".concat(i))?new Set(JSON.parse(localStorage.getItem("expandedKeys_".concat(i)))):new Set,colorPickerVisible:!1,colorPickerData:{},activePage:-1,pageCount:-1,hasSetInitialPage:!1,showWebViewerImportDialog:!1,activeScaleButton:null,toolNode:"AnnotationEdit",isResize:!1,deleteModalVisibile:!1,treeListLoaded:!1,showSubmenu:!1,modelStructureTree:{},showLinkingModal:!1,selectedIfcKeys:[],showReplaceRowsConfirmation:!1,contextVisible:!1,showFileExportModal:!1,selectedFolderName:void 0,selectedFolderNumber:void 0,showStampTooHeavyDialog:!1,showMoveModal:!1,preventEditingAnnotatationList:new T.a.List,fetchingDataLoader:!1},a.deleteHandler=new O.a,M.q.setTreeFilter(a.state.toggleTreeFilter),a.role=M.b.getRole(),a}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.isFileChanged.current=!1,this.checkIfDataIsFetching(),localStorage.getItem("selectedAnnotation")&&localStorage.removeItem("selectedAnnotation"),M.q.setTreeRef(this.treeRef),document.addEventListener("keydown",Kn.c),document.addEventListener("mousedown",this.handleClickOutside),this.unsubscribeAnnotaiotnStore=M.a.listen(this.annotationStoreUpdated),this.unsubscribeTreeStore=M.q.listen(this.treeStoreUpdated),this.unsubscribeHeaderStore=M.j.listen(this.headerStoreUpdated),this.unsubscribeCalculationStore=M.c.listen(this.calculationStoreUpdated),this.unsubscribeFileStore=M.i.listen(this.fileStoreUpdated),this.unsubscribeIfcStore=M.k.listen(this.ifcStoreUpdated);var e=parseInt(this.props.match.params.projectId,10);if(M.m.setActiveProjectId(e),0===M.i.treeList.length&&_e.a.requestGetFiles(e),0===M.m.getProjectRows().length){var t=M.b.getJwt();M.m.fetchProjects(t)}if(!M.i.selectedFileNodes[0]){var n=parseInt(this.props.match.params.fileId,10);_e.a.setSelectedFileNodes([n])}0!==M.i.getTreeList().length&&this.setState({treeListLoaded:!0}),this.isIfcFileOpened(!0)&&M.k.fetchIfcModelStructureData(Object(Rn.b)(parseInt(this.props.match.params.fileId,10)))}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.handleClickOutside),document.removeEventListener("keydown",Kn.c),this.unsubscribeAnnotaiotnStore(),this.unsubscribeTreeStore(),this.unsubscribeHeaderStore(),this.unsubscribeFileStore(),this.unsubscribeCalculationStore(),this.unsubscribeIfcStore(),M.q.setTreeRef(void 0),M.q.clearSelectedAnnotations(),Object(k.p)(),this.isFileChanged.current=!1}},{key:"componentDidUpdate",value:function(e,t){var n=this.state.colorPickerData.annotationType;M.a.setActiveAnnotationsWithVisuals(this.state.selectedAnnotations);var a="x-scale"===n||"y-scale"===n;this.state.selectedAnnotations.size<1&&!a&&this.setState({colorPickerVisible:!1});var o=this.state.duplicateAnnotsModal,i=o.duplicatingAnnots,r=o.annotsDuplicated,s=o.annotsToDuplicate,l=o.updatingUI,c=o.userId;r!==s||0===s||l||this.setState({duplicateAnnotsModal:{updatingUI:!0,annotsDuplicated:r,annotsToDuplicate:s,duplicatingAnnots:i,userId:c}});var u=this.state.rowsActionsModal,d=u.updatingRows,p=u.rowsUpdated,g=u.rowsToUpdate,h=u.updatingUI,m=u.userId;p!==g||0===g||h||this.setState({rowsActionsModal:{updatingUI:!0,rowsUpdated:p,rowsToUpdate:g,updatingRows:d,userId:m}}),t.activePage!==this.state.activePage&&(M.o.getScale(je.e,this.state.activePage),M.o.getScale(je.f,this.state.activePage),this.setState({lengthX:M.o.getLength(je.e),lengthY:M.o.getLength(je.f)}))}},{key:"isEveryAnnotSameType",value:function(){var e=this.state.selectedAnnotations.toJS();if(0===e.length)return!1;var t=e[0].type;return e.every((function(e){return e.type===t}))}},{key:"clearDuplicateStates",value:function(){M.a.resetDuplicateAnnotsModalInfo(),this.setState({duplicateAnnotsModal:{duplicatingAnnots:!1,annotsToDuplicate:0,annotsDuplicated:0,showMoreDetails:!1,updatingUI:!1,userId:null}})}},{key:"clearRowsActionsModalInfo",value:function(){M.c.resetRowsActionsModalInfo(),this.setState({rowsActionsModal:{updatingRows:!1,rowsToUpdate:0,rowsUpdated:0,updatingUI:!1,userId:null}})}},{key:"render",value:function(){var e=this,t=parseInt(this.props.match.params.projectId,10),n=parseInt(this.props.match.params.fileId,10),a=M.i.getFileById(n),o=Object(A.get)(a,"type"),i="ifc"===o?"calculateSplitPosLeftIFC":"calculateSplitPosLeft";return c.a.createElement("div",{className:"Calculate"},c.a.createElement(k.g,null),c.a.createElement("div",{className:"Calculate_Layout"},this.state.deleteModalVisibile&&c.a.createElement(qe,{visible:this.state.deleteModalVisibile,annotationLists:M.a.getAnnotationsLists(),onCancel:function(){return e.setState({deleteModalVisibile:!1})},onAccept:this.deleteAnnotationHandler}),this.state.showLinkingModal&&c.a.createElement(_n,{visible:this.state.showLinkingModal,close:function(){return e.toggleIfcModal(!1)}}),this.state.toggleTemplateDialog&&c.a.createElement(k.n,{visible:this.state.toggleTemplateDialog,onCancel:function(){return e.setState({toggleTemplateDialog:!1})},onAccept:function(){return e.setState({toggleTemplateDialog:!1})},title:this.props.t("Folder Templates"),type:"calculate"}),this.state.showFileExportModal&&c.a.createElement(Ln,{showFileExportModal:this.state.showFileExportModal,setShowFileExportModal:this.toggleShowFileExportModal}),this.state.showReplaceRowsConfirmation&&c.a.createElement(k.j,{visible:this.state.showReplaceRowsConfirmation,title:this.props.t("Replacing rows in current selection"),onOk:this.onReplaceRows,onCancel:this.onCancelReplaceRows,submitButtonTitle:this.props.t("Replace"),className:"Calculate_Modal"},c.a.createElement(k.k,{oldData:M.n.getAllAnnotationRows(this.state.selectedAnnotations),newData:M.n.getCopyAnnotationRows().toJS()})),this.state.showStampTooHeavyDialog&&c.a.createElement(k.j,{visible:this.state.showStampTooHeavyDialog,title:this.props.t("Image is too large"),submitButtonTitle:this.props.t("Close"),onOk:function(){return e.setState({showStampTooHeavyDialog:!1})},onPressEnter:function(){return e.setState({showStampTooHeavyDialog:!1})},width:284}),this.state.duplicateAnnotsModal.duplicatingAnnots&&c.a.createElement(kn,{visible:this.state.duplicateAnnotsModal.duplicatingAnnots,toDuplicate:this.state.duplicateAnnotsModal.annotsToDuplicate,duplicated:this.state.duplicateAnnotsModal.annotsDuplicated,updatingUI:this.state.duplicateAnnotsModal.updatingUI,userId:this.state.duplicateAnnotsModal.userId}),this.state.rowsActionsModal.updatingRows&&c.a.createElement(xn,{visible:this.state.rowsActionsModal.updatingRows,toDuplicate:this.state.rowsActionsModal.rowsToUpdate,duplicated:this.state.rowsActionsModal.rowsUpdated,updatingUI:this.state.rowsActionsModal.updatingUI,userId:this.state.rowsActionsModal.userId}),this.state.showMoveModal&&this.state.preventEditingAnnotatationList.size>0&&c.a.createElement(Dn,{visible:this.state.showMoveModal,onCancel:this.closeMoveAnnotsModalHandler,annotationLists:this.state.preventEditingAnnotatationList}),c.a.createElement(ke,null),c.a.createElement("div",{className:"Calculate_Wrapper"},this.state.fetchingDataLoader&&c.a.createElement("div",{className:"Calulate_Data_Loader"},c.a.createElement(g.a,{size:"large"})),c.a.createElement("div",{className:"Toolbar Calculate_Wrapper_Toolbar"},"ifc"===o?c.a.createElement(c.a.Fragment,null,this.state.treeListLoaded&&c.a.createElement(Yn,{viewerRef:this.viewerRef,toggleShowFileExportModal:this.toggleShowFileExportModal})):c.a.createElement(c.a.Fragment,null,this.state.treeListLoaded&&c.a.createElement(Nn,{toogleActiveToolNode:this.toogleActiveToolNode,toolNode:this.state.toolNode,activePage:this.state.activePage,pageCount:this.state.pageCount,pageBack:this.pageBack,selectPage:this.selectPage,pageForward:this.pageForward,toggleShowFileExportModal:this.toggleShowFileExportModal})),this.state.treeListLoaded&&c.a.createElement("div",{className:"Calculate_Wrapper_Toolbar--right"},"ifc"!==o&&this.role&&this.renderScale(),c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("filter")},onMouseLeave:function(){return Object(k.p)()},icon:c.a.createElement(y.a,{icon:["fal","eye"]}),onClick:this.toggleTreeFilter,className:this.state.toggleTreeFilter?"Toolbar_Button--active":null}),"ifc"!==o&&c.a.createElement(h.a,{onMouseEnter:function(){return Object(k.q)("snapOn")},onMouseLeave:function(){return Object(k.p)()},disabled:!this.role,icon:c.a.createElement(y.a,{icon:["fal","magnet"]}),className:this.state.toggleSnapOn?"Toolbar_Button--active":null,onClick:this.toggleSnapOn}),c.a.createElement(m.a,{overlay:c.a.createElement(ot,{toggleRows:this.toggleRows,isToggleRows:this.state.toggleRows,toggleProperties:this.toggleProperties,isToggleProperties:this.state.toggleProperties,toggleDocument:this.toggleDocument,isToggleDocument:this.state.toggleDocument,allKeysSelected:this.state.allKeysSelected,collapseAll:this.collapseAll,expandAll:this.expandAll,allKeysExpanded:this.state.allKeysExpanded,changeTreeSorting:this.changeTreeSorting,treeSorting:this.state.treeSorting,displayMode:this.state.displayMode,snapMode:this.state.snapMode,toggleTemplateDialog:this.toggleTemplateDialog,switchShowSubmenu:this.switchShowSubmenu}),trigger:["click"],visible:this.state.showSubmenu,onVisibleChange:function(t){return e.switchShowSubmenu(t)}},c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","ellipsis-v-alt"]})})))),c.a.createElement("div",{className:"Calculate_Wrapper_SplitPane--left"},c.a.createElement(S.a,{defaultSize:null===localStorage.getItem(i)?"300px":parseInt(localStorage.getItem(i),10),onChange:function(e){return localStorage.setItem(i,e)},pane1Style:{minWidth:"50px",minHeight:"50px"},pane2Style:{minWidth:"50px",minHeight:"50px",overflow:"auto"},onDragStarted:function(){return e.setState({isResize:!0})},onDragFinished:function(){return e.setState({isResize:!1})}},c.a.createElement(Le,Object.assign({treeData:this.state.treeData,onCalculateTreeCheck:this.onCalculateTreeCheck,selectedKeys:this.state.selectedKeys,expandedKeys:Object(p.a)(this.state.expandedKeys),ref:this.treeRef,selectedAnnotations:this.state.selectedAnnotations,onDeleteAnnotations:function(){return e.setState({deleteModalVisibile:!0})},redirectToFile:function(t){return e.redirectToFile(t)},projectId:t,contextVisible:this.state.contextVisible,toggleContextDropdown:this.toggleContextDropdown,closeContextDropdown:this.closeContextDropdown,onOpenReplaceRows:this.onOpenReplaceRows,onMovePreventEditingAnnots:this.movePreventEditingAnnotsHandler},this.props)),c.a.createElement("div",null,c.a.createElement(S.a,{primary:"second",defaultSize:null===localStorage.getItem("calculateSplitPosRight")?"250px":parseInt(localStorage.getItem("calculateSplitPosRight"),10),onChange:function(e){return localStorage.setItem("calculateSplitPosRight",e)},pane1Style:{minWidth:"50px",minHeight:"50px",overflow:"auto"},pane2Style:{minWidth:"50px",minHeight:"50px",overflow:"auto",display:this.state.toggleProperties?"block":"none"},onDragStarted:function(){return e.setState({isResize:!0})},onDragFinished:function(){return e.setState({isResize:!1})}},c.a.createElement("div",null,c.a.createElement(S.a,{primary:"second",split:"horizontal",defaultSize:null===localStorage.getItem("calculateSplitPosBottom")?"210px":parseInt(localStorage.getItem("calculateSplitPosBottom"),10),onChange:function(e){return localStorage.setItem("calculateSplitPosBottom",e)},pane1Style:{minWidth:"50px",minHeight:"50px",overflow:"auto",display:this.state.toggleDocument?"block":"none"},pane2Style:{minWidth:"50px",minHeight:"50px",overflow:"auto",display:this.state.toggleRows?"block":"none"},onDragStarted:function(){return e.setState({isResize:!0})},onDragFinished:function(){return e.setState({isResize:!1})}},c.a.createElement(c.a.Fragment,null,c.a.createElement(st,{visible:this.state.colorPickerVisible,changeColor:this.changeColorFromPicker,colorPickerRef:this.colorPickerRef,color:this.getStatePropsValue(this.state.colorPickerData.annotationProp)}),"ifc"===o?c.a.createElement(S.a,{split:"vertical",defaultSize:null===localStorage.getItem("calculateSplitModelStructureTreeLeft")?"200px":parseInt(localStorage.getItem("calculateSplitModelStructureTreeLeft"),10),onChange:function(e){return localStorage.setItem("calculateSplitModelStructureTreeLeft",e)},pane1Style:{overflow:"auto",minWidth:"50px",minHeight:"50px"}},c.a.createElement(Ce,{treeData:this.state.modelStructureTree,openLinkingModal:function(){return e.toggleIfcModal(!0)},selectedKeys:this.state.selectedIfcKeys}),c.a.createElement(Fn,{modelUrl:Object(Rn.b)(parseInt(this.props.match.params.fileId,10)),ref:this.viewerRef,projectId:t,fileId:n,tree:this.state.modelStructureTree,openLinkingModal:function(){return e.toggleIfcModal(!0)},isActiveCalculate:!0})):c.a.createElement(c.a.Fragment,null,this.state.treeListLoaded&&c.a.createElement(We,{scaleAdded:this.isScaleAdded(),projectId:parseInt(this.props.match.params.projectId,10),fileId:parseInt(this.props.match.params.fileId,10),role:this.role,isResize:this.state.isResize}))),c.a.createElement(ue,{selectedAnnotations:this.state.selectedAnnotations}))),c.a.createElement(vn,Object.assign({nameInput:this.nameInput,nrTagInput:this.nrTagInput,fillColourInput:this.fillColourInput,borderColourInput:this.borderColourInput,scaleLengthInput:this.scaleLengthInput,textAreaInput:this.textAreaInput,selectedAnnotations:this.state.selectedAnnotations,treeData:this.state.treeData,showColorPicker:this.showColorPicker,scaleLength:Object(Ve.b)()===je.e?this.state.lengthX:this.state.lengthY,changeColor:this.changeColor,fileType:o,splitPosRight:localStorage.getItem("calculateSplitPosRight")?localStorage.getItem("calculateSplitPosRight"):"250",selectedFolderName:this.state.selectedFolderName,selectedFolderNumber:this.state.selectedFolderNumber,onMovePreventEditingAnnots:this.movePreventEditingAnnotsHandler,onChangeValues:this.onChangeValues,activePage:this.state.activePage},this.props)))))))))}}]),n}(c.a.PureComponent),Qn=Object(f.a)()(xe(Object(d.i)(Zn))),$n=n(316),ea=n(112),ta=n(196),na=function(e){var t=e.close,n=e.isOpen,a=M.i.getUploadedPdfFile().name,o=M.i.getDetectedAnnotationsLength(),i=Object(U.a)().t;return c.a.createElement(Cn.a,{title:i("Annotations found in pdf, do you want to import along with the file?"),visible:n,closable:!1,footer:[c.a.createElement(h.a,{key:"cancel",onClick:function(){M.i.onCancelUploadMultiplePdfFile(),t()}},i("Cancel")),c.a.createElement(h.a,{key:"fileOnly",type:"primary",onClick:function(){M.i.uploadPdfFileWithAnnotations(!1),t()}},i("File only")),c.a.createElement(h.a,{key:"fileAndAnnotations",type:"primary",onClick:function(){M.i.uploadPdfFileWithAnnotations(!0),t()}},i("File and Annotations"))]},c.a.createElement("div",null,c.a.createElement("label",{key:"file"},"".concat(i("Filename:")," ").concat(a))),c.a.createElement("div",null,c.a.createElement("label",{key:"annotations"},"".concat(i("Annotations:")," ").concat(o," ").concat(i("annotations were found in the file")))))},aa=n(317),oa=n(57),ia=function(e,t){return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},c.a.createElement(K.a.Item,{onClick:e},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"Calculate_Submenu_Icon"},c.a.createElement(y.a,{icon:["fal","edit"]})),c.a.createElement("span",{className:"Calculate_Submenu_Item_Label"},"Templates"))),c.a.createElement(C.a,null),Object(A.map)(M.p.getDriveTemplates(),(function(e){return c.a.createElement(K.a.Item,{onClick:function(){t(),_.g.sendUpdate({action:"add_template_to_drive_folder",folderId:-1===M.a.getActiveFileId()?null:M.a.getActiveFileId(),templateId:e.id,projectId:M.m.getActiveProjectId(),companyId:M.m.getActiveProject().toJS().department.company.id})},disabled:-1===M.a.getActiveFileId()},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"Calculate_Submenu_Icon"},c.a.createElement(y.a,{icon:["fal","folder-open"]})),c.a.createElement("div",{className:"Calculate_Submenu_Item_WrapName"},e.name)))})))},ra=function(e){var t=e.templateModalVisible,n=e.switchShowSubmenu,a=e.allKeysExpanded,o=e.expandAll,i=e.collapseAll,r=Object(U.a)().t;return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu Calculate_Submenu"},Object(A.map)(function(e){var t=e.templateModalVisible,n=e.switchShowSubmenu,a=e.allKeysExpanded,o=e.expandAll,i=e.collapseAll;return[{onClick:function(){return o()},icon:c.a.createElement(y.a,{icon:["fal","plus-square"]}),display:!0,disabled:a,label:"Expand All",shortcut:"Ctrl + Alt + E"},{onClick:function(){return i()},icon:c.a.createElement(y.a,{icon:["fal","minus-square"]}),display:!0,disabled:!a,label:"Collapse All",shortcut:"Ctrl + Alt + W"},{icon:c.a.createElement(y.a,{icon:["fal","sign-in"]}),onDropdownOverlay:ia(t,n),dropdownTrigger:"click",disabled:!M.b.getRole(),display:M.b.getRole(),label:"Import Template"}]}({templateModalVisible:t,switchShowSubmenu:n,allKeysExpanded:a,expandAll:o,collapseAll:i}),(function(e){return e.display?e.onDropdownOverlay&&e.dropdownTrigger?c.a.createElement(K.a.Item,{disabled:e.disabled},c.a.createElement(m.a,{overlay:e.onDropdownOverlay,placement:"bottomRight",overlayClassName:"Calculate_Submenu_Dropdown"},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"Calculate_Submenu_Icon"},e.icon),c.a.createElement("span",{className:"Calculate_Submenu_Item_Label"},r(e.label)),c.a.createElement("span",{className:"Calculate_Submenu_Shortcut"},c.a.createElement(y.a,{icon:["fal","chevron-right"]}))))):c.a.createElement(K.a.Item,{onClick:e.onClick,disabled:e.disabled},c.a.createElement("div",{className:"Calculate_Submenu_Item"},c.a.createElement("span",{className:"".concat(e.className," Calculate_Submenu_Icon")},e.icon),c.a.createElement("span",{className:"Calculate_Submenu_Item_Label"},r(e.label)),c.a.createElement("span",{className:"Calculate_Submenu_Shortcut"},r(e.shortcut)))):e.divider&&c.a.createElement(K.a.Divider,null)})))},sa=function(e){var t=e.isOpen,n=e.onOk,a=e.onCancel,o=Object(l.useState)(""),i=Object(D.a)(o,2),r=i[0],s=i[1],u=Object(l.useState)(""),d=Object(D.a)(u,2),p=d[0],g=d[1],h=Object(l.useState)(""),m=Object(D.a)(h,2),f=m[0],A=m[1],E=Object(U.a)().t,T=function(){s(""),g(""),A("")},S=function(){n&&n({name:r,shortDescription:p,description:f}),T()};return c.a.createElement(k.j,{title:E("Create Folder"),visible:t,onOk:S,onCancel:function(){T(),a&&a()},disabledOkButton:""===r,destroyOnClose:!0},c.a.createElement("label",null,E("Folder name"),c.a.createElement(F.a,{value:r,onChange:function(e){return s(e.target.value)},onPressEnter:S,autoFocus:!0})),c.a.createElement("label",null,E("Description"),c.a.createElement(F.a,{value:p,onChange:function(e){return g(e.target.value)},onPressEnter:S})),c.a.createElement("label",null,E("Notes"),c.a.createElement(F.a,{value:f,onChange:function(e){return A(e.target.value)},onPressEnter:S})))},la=n(2613),ca=(n(2575),function(e){var t=e.isOpen,n=e.onCancel,a=e.parentId,o=Object(l.useState)(""),i=Object(D.a)(o,2),r=i[0],s=i[1],u=Object(l.useState)(""),d=Object(D.a)(u,2),p=d[0],g=d[1],h=Object(l.useState)(""),m=Object(D.a)(h,2),f=m[0],A=m[1],E=Object(l.useState)(null),T=Object(D.a)(E,2),S=T[0],b=T[1],I=Object(l.useRef)(null),y=Object(U.a)().t,v=function(){s(""),g(""),A(""),b(null),I.current&&I.current.setValue("")};return c.a.createElement(k.j,{title:y("Upload File"),visible:t,onOk:function(){M.i.uploadMultipleFiles([{file:S,parentId:a,notes:f,description:p,name:r}]),v(),n()},onCancel:function(){v(),n&&n()},disabledOkButton:""===r||null===S},c.a.createElement("label",null,y("File name"),c.a.createElement(F.a,{value:r,onChange:function(e){return s(e.target.value)},disabled:null===S||void 0===S})),c.a.createElement(F.a,{type:"file",onChange:function(e){var t=e.target.files[0];b(t),s(t?t.name:"")},ref:I,suffix:c.a.createElement(me.a,{title:"Eg. PDF, DOCX, PNG, XLSX"},c.a.createElement(la.a,{style:{color:"rgba(0,0,0,.45)"}})),className:"driveFileUploadSuffix"}),c.a.createElement("label",null,y("Description"),c.a.createElement(F.a,{value:p,onChange:function(e){return g(e.target.value)}})),c.a.createElement("label",null,y("Notes"),c.a.createElement(F.a,{value:f,onChange:function(e){return A(e.target.value)}})))}),ua=(n(2576),function(e){var t=e.role,n=e.selectedNode,a=e.onDelete,o=e.onDownloadFile,i=e.activePage,r=e.pageCount,s=e.onUpdatePage,u=e.onOpenInCalculate,d=e.checkedItems,p=e.selectedItem,g=e.viewerRef,f=e.templateModalVisible,E=e.showSubmenu,T=e.switchShowSubmenu,S=e.openFolderModal,b=e.openUploadModal,I=e.allKeysExpanded,v=e.expandAll,N=e.collapseAll,O=e.toolNode,w=e.onChangeTool,P=Object(l.useState)(!1),R=Object(D.a)(P,2),L=R[0],C=R[1],_=Object(l.useState)(!1),M=Object(D.a)(_,2),x=M[0],j=M[1],V=Object(l.useState)(!1),W=Object(D.a)(V,2),B=W[0],H=W[1],J=Object(A.get)(n,"type"),z=Object(U.a)().t;Object(l.useEffect)((function(){C("folder"===J),j("ifc"===J),H(J&&"folder"!==J&&"ifc"!==J)}),[n]);var G=function(e){var t=parseInt(e.target.value||"1",10);oa.a.webViewer.setCurrentPageNumber(t),s(oa.a.webViewer.getCurrentPageNumber(),oa.a.webViewer.getPageCount())};return c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement("div",{className:"Toolbar Drive_Toolbar"},x&&c.a.createElement(Yn,{viewerRef:g,selectedNode:n}),L&&c.a.createElement(c.a.Fragment,null,c.a.createElement(me.a,{placement:"bottom",title:z("Add folder")},c.a.createElement(h.a,{disabled:!t,onClick:S,icon:c.a.createElement(y.a,{icon:["fal","folder-plus"]})})),c.a.createElement(me.a,{placement:"bottom",title:z("Upload")},c.a.createElement(h.a,{disabled:!t,onClick:b,icon:c.a.createElement(y.a,{icon:["fal","cloud-upload"]})})),c.a.createElement(me.a,{placement:"bottom",title:z("Download")},c.a.createElement(h.a,{onClick:o,icon:c.a.createElement(y.a,{icon:["fal","cloud-download"]})})),c.a.createElement(me.a,{placement:"bottom",title:z("Delete")},c.a.createElement(h.a,{onClick:a,disabled:1!==d.length||1===d.length&&null===d[0].parentId||!t,icon:c.a.createElement(y.a,{icon:["fal","trash"]})}))),B&&c.a.createElement(c.a.Fragment,null,c.a.createElement(me.a,{placement:"bottom",title:z("Pointer")},c.a.createElement(h.a,{onClick:function(){return w("AnnotationEdit")},icon:c.a.createElement(y.a,{icon:["fal","mouse-pointer"]}),className:"AnnotationEdit"===O?"Toolbar_Button--active":null})),c.a.createElement(me.a,{placement:"bottom",title:z("Pan")},c.a.createElement(h.a,{onClick:function(){return w("Pan")},icon:c.a.createElement(y.a,{icon:["fal","arrows"]}),className:"Pan"===O?"Toolbar_Button--active":null})),c.a.createElement(me.a,{placement:"bottom",title:z("Zoom Selection")},c.a.createElement(h.a,{onClick:function(){return w("MarqueeZoomTool")},icon:c.a.createElement(y.a,{icon:["fal","search"]}),className:"MarqueeZoomTool"===O?"Toolbar_Button--active":null})),c.a.createElement(me.a,{placement:"bottom",title:z("Fit to Screen")},c.a.createElement(h.a,{onClick:function(){return oa.a.setFitToScreen()},icon:c.a.createElement(y.a,{icon:["fal","expand"]})})),c.a.createElement(me.a,{placement:"bottom",title:z("Previous Page"),disabled:i<=1},c.a.createElement(h.a,{onClick:function(){oa.a.webViewer.goToPrevPage(),s(oa.a.webViewer.getCurrentPageNumber(),oa.a.webViewer.getPageCount())},icon:c.a.createElement(y.a,{icon:["fal","angle-left"]})})),c.a.createElement(F.a,{id:"pageInput",value:i,addonAfter:r?"/ "+r:"",onFocus:function(){return document.activeElement.select()},className:"PageInputGroup",onChange:G,onBlur:function(e){return G(e)}}),c.a.createElement(me.a,{placement:"bottom",title:z("Next Page")},c.a.createElement(h.a,{onClick:function(){oa.a.webViewer.goToNextPage(),s(oa.a.webViewer.getCurrentPageNumber(),oa.a.webViewer.getPageCount())},icon:c.a.createElement(y.a,{icon:["fal","angle-right"]}),disabled:i>=r})),c.a.createElement(me.a,{placement:"bottom",title:z("Open")},c.a.createElement(h.a,{onClick:function(){return u(p)},icon:c.a.createElement(y.a,{icon:["fal","external-link-square"]})})),c.a.createElement(me.a,{placement:"bottom",title:z("Open in New Tab")},c.a.createElement(h.a,{onClick:function(){return u(p,!0)},icon:c.a.createElement(y.a,{icon:["fal","external-link"]})}))),c.a.createElement(m.a,{className:"Drive_MoreMenu",overlay:c.a.createElement(ra,{templateModalVisible:f,switchShowSubmenu:T,allKeysExpanded:I,expandAll:v,collapseAll:N}),trigger:["click"],visible:E,onVisibleChange:T},c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","ellipsis-v-alt"]})}))))}),da=(n(2577),function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).state={canConfirm:!1,typedValue:""},e.resetState=function(){e.setState({typedValue:"",canConfirm:!1})},e.onInput=function(t){e.setState({typedValue:t.target.value,canConfirm:t.target.value===e.props.t("DELETE")})},e.onCancel=function(){e.props.onCancel(),e.resetState()},e.onConfirm=function(){e.props.onConfirm(e.state.selectedVersion),e.resetState()},e}return Object(i.a)(n,[{key:"render",value:function(){var e=this.props.t;return c.a.createElement(k.j,{title:e("Are you sure?"),visible:this.props.visible,onCancel:this.onCancel,submitButtonTitle:e("Delete"),activeButtons:c.a.createElement(h.a,{key:"submit",type:"danger",onClick:this.onConfirm,disabled:!this.state.canConfirm,autoFocus:!0},e("Delete")),destroyOnClose:!0},c.a.createElement("label",{className:"Drive_Delete_Dialog"},e("You're about to permanently delete")," ",c.a.createElement("span",null,this.props.confirmValue)," ",e("This will also erase any objects created on the file in all estimates. Type 'DELETE' in the field below to confirm."),c.a.createElement(F.a,{className:"Delete_Input",placeholder:e("DELETE"),onChange:this.onInput,value:this.state.typedValue,autoFocus:!0})))}}]),n}(c.a.PureComponent)),pa=Object(f.a)()(da),ga=Object(d.i)((function(e){var t=e.viewerRef,n=e.selectedNode;Object(x.a)(e,["viewerRef","selectedNode"]);Object(l.useEffect)((function(){var e=oa.a.listen(o),t=Ee.a.listen(a);return Ee.a.onSetActiveFileId(n.key),function(){e(),t(),oa.a.cleanup()}}),[n.key]);var a=function(e){"EstimateInitialized"===e&&oa.a.loadAnnotations()},o=function(e){switch(e){case"filesUpdated":oa.a.reloadFileView(oa.a.getSelectedFiles())}};return"conversion_failed"===n.status?c.a.createElement(R.a,{justify:"center",align:"middle",className:"Empty_Container"},c.a.createElement(ct.a,{description:!1})):c.a.createElement("div",{style:{height:"100vh"}},c.a.createElement(Fn,{modelUrl:Object(Rn.b)(n.key),ref:t}))})),ha=(n(2578),function(e){var t=e.selectedNode,n=e.onDriveTreeSelect,a=e.selectionByClick,o=e.onBack,i=e.onOpenInCalculate,r=e.onDownloadFile,s=e.onOpenFolder,l=e.onDeleteFile,u=e.onDeleteFolder,d=e.checkedItems,p=e.setCheckedItems,g=e.treeData,h=e.onMoveFile,m=e.onUpdatePage,f=e.viewerRef,A=e.multipleFilesLoader,E=e.isResize;if(!t)return null;switch(t.type){case"folder":return c.a.createElement(Ma,{selectedNode:t,onDriveTreeSelect:n,selectionByClick:a,onBack:o,onOpenInCalculate:i,onDownloadFile:r,onOpenFolder:s,onDeleteFile:l,onDeleteFolder:u,checkedItems:d,setCheckedItems:p,treeData:g,onMoveFile:h,multipleFilesLoader:A});case"file-ppt":case"file-pdf":case"file-gif":case"file-image":case"file-jpg":case"file-docx":case"file-xlsx":case"doc":case"docx":case"xls":case"xlsx":case"ppt":case"pptx":case"jpg":case"png":case"svg":case"pdf":return c.a.createElement(xa,{selectedNode:t,onBack:o,onUpdatePage:m,isResize:E});case"file-ifc":case"ifc":return c.a.createElement(ga,{selectedNode:t,onBack:o,viewerRef:f});default:return c.a.createElement(R.a,{justify:"center",align:"middle",className:"Empty_Container"},c.a.createElement(ct.a,{description:!1}))}}),ma=n(101),fa=(n(2579),function(e){var t=e.onChangeDescription,n=e.onChangeShortDescription,a=e.onBlur,o=e.role,i=e.shortDescription,r=e.description,s=Object(U.a)().t;return c.a.createElement("div",{className:"DescriptionPane"},c.a.createElement("label",null,s("Description"),c.a.createElement(F.a,{disabled:!o,value:i,onChange:n,onBlur:function(){return a("shortDescription")}})),c.a.createElement("label",null,s("Notes"),c.a.createElement(F.a.TextArea,{disabled:!o,rows:10,value:r,onChange:t,onBlur:function(){return a("description")}})))}),Aa=n(109),Ea=(n(2580),function(e){var t=e.role,n=e.selectedNode,a=e.treeData,o=e.name,i=e.onChangeName,r=e.onChangeFolder,s=e.onBlur,u=Object(l.useState)(null),d=Object(D.a)(u,2),p=d[0],g=d[1],h=Object(l.useState)(null),m=Object(D.a)(h,2),f=m[0],A=m[1],E=Object(l.useState)(""),T=Object(D.a)(E,2),S=T[0],b=T[1],I=Object(U.a)().t;Object(l.useEffect)((function(){p&&f&&(r(f,p),A(null),g(null))}),[p,f]),Object(l.useEffect)((function(){n.key&&a[0].children&&O(Object(ma.f)(a),n.key)}),[n,a]);var N=function e(t,a){var o=t.find((function(e){return e.key===a}));if(o)a===n.key?A(o):g(o);else{var i,r=Object(Aa.a)(t);try{for(r.s();!(i=r.n()).done;){e(i.value.children,a)}}catch(s){r.e(s)}finally{r.f()}}},O=function e(t,n){if(0!==t.length){var a=t.find((function(e){return e.key===n}));if(a){var o=a.path.split(" > ");return o.splice(-1,1),b(Object(ma.a)(o,2," > "))}var i,r=Object(Aa.a)(t);try{for(r.s();!(i=r.n()).done;){var s=i.value;s.children&&e(s.children,n)}}catch(l){r.e(l)}finally{r.f()}}};return c.a.createElement("div",{className:"EditPane"},c.a.createElement("label",null,I("Folder"),c.a.createElement(dt.a,{treeData:Object(ma.e)(a),treeDefaultExpandAll:!0,value:S,onChange:function(e){"folder"===n.type?(N(Object(ma.e)(a),e),N(Object(ma.e)(a),n.key)):r(n,{key:e})},suffixIcon:c.a.createElement(y.a,{icon:v.c}),disabled:null===n.parentId||!t})),c.a.createElement("label",null,I("Name"),c.a.createElement(F.a,{value:Object(ma.c)(o,n),onChange:i,addonAfter:Object(ma.b)(n),onBlur:function(){return s("name")},onPressEnter:function(){return s("name")},disabled:null===n.parentId||!t})))}),Ta=[{value:"notStarted",StatusIcon:function(){return c.a.createElement(k.m,{notStarted:!0})},label:"Not started"},{value:"progress",StatusIcon:function(){return c.a.createElement(k.m,{progress:!0})},label:"In Progress"},{value:"review",StatusIcon:function(){return c.a.createElement(k.m,{review:!0})},label:"Review"},{value:"complete",StatusIcon:function(){return c.a.createElement(k.m,{complete:!0})},label:"Complete"}],Sa=(n(2581),function(e){var t=e.status,n=e.onChangeStatus,a=t||"notStarted",o=Object(U.a)().t;return c.a.createElement("div",{className:"Workflow"},c.a.createElement("label",null,o("Status"),c.a.createElement(G.a,{className:"Workflow_Select",value:a,onChange:n},Ta.map((function(e,t){return c.a.createElement(G.a.Option,{value:e.value,key:t},c.a.createElement(R.a,{wrap:!1},c.a.createElement(L.a,{className:"Workflow_Select_Icon_Wrapper"},c.a.createElement(R.a,{align:"middle",justify:"center",className:"Workflow_Select_Icon"},c.a.createElement(e.StatusIcon,null))),c.a.createElement(L.a,null,o(e.label))))})))))}),ba=n(581),Ia=n.n(ba),ya=n(153),va=n.n(ya),Na=(n(2582),function(e){var t=e.selectedNode,n=Object(U.a)().t;return c.a.createElement("div",{className:"DetailsPane"},c.a.createElement("label",null,n("Size"),c.a.createElement("span",null,Ia()(Object(A.get)(t,"size")||0))),c.a.createElement("label",null,n("Added"),c.a.createElement("span",null,t.added?va()(t.added).format("YYYY-MM-DD hh:mma"):"")))}),Oa=["description","edit","details","workflow"],wa=(n(2583),lt.a.Panel),Pa=function(e){var t=e.selectedNode,n=e.treeData,a=e.onUpdateFileProps,o=e.onUpdateFileLocation,i=e.onChangeStatus,r=Object(l.useState)({name:t.title,description:t.description,shortDescription:t.shortDescription,status:t.nodeStatus}),s=Object(D.a)(r,2),u=s[0],d=s[1],p=Object(l.useState)(JSON.parse(localStorage.getItem("activeDrivePanelKeys"))||Oa),g=Object(D.a)(p,2),h=g[0],m=g[1],f=Object(l.useRef)(),A=Object(U.a)().t,E=Ne.a.getRole(),T="conversion_failed"===t.status;Object(l.useEffect)((function(){f.current={name:t.title,description:t.description,shortDescription:t.shortDescription,status:t.nodeStatus},d({name:t.title,description:t.description,shortDescription:t.shortDescription,status:t.nodeStatus})}),[t]);var S=function(e){switch(e){case"name":u.name!==f.current.name&&(a(t.key,e,Object(ma.d)(u.name,t)),f.current.name=u.name);break;case"shortDescription":u.shortDescription!==f.current.shortDescription&&(a(t.key,e,u.shortDescription),f.current.shortDescription=u.shortDescription);break;case"description":u.description!==f.current.description&&(a(t.key,e,u.description),f.current.description=u.description);break;default:return}},b=function(e,t){return d((function(n){return Object(w.a)(Object(w.a)({},n),{},Object(de.a)({},t,e))}))};return T?c.a.createElement("div",{class:"IFC-error"},c.a.createElement(y.a,{icon:["fal","exclamation-circle"],className:"error-icon"}),c.a.createElement("label",null,"IFC file conversion failed")):c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement("div",{className:"DriveProperties"},c.a.createElement(lt.a,{defaultActiveKey:h,onChange:function(e){localStorage.setItem("activeDrivePanelKeys",JSON.stringify(e)),m(e)},expandIcon:function(e){var t=e.isActive;return c.a.createElement("span",null,c.a.createElement(y.a,{icon:["fal","caret-down"],className:"".concat(!t&&"fa-rotate-right-90")}))}},c.a.createElement(wa,{header:A("Edit"),key:"edit"},c.a.createElement(Ea,{role:E,selectedNode:t,treeData:n,name:u.name,onChangeName:function(e){return b(e.target.value,"name")},onChangeFolder:function(e,t){o(e,t)},onBlur:S})),"folder"!==t.type&&c.a.createElement(wa,{header:A("Workflow"),key:"workflow"},c.a.createElement(Sa,{status:u.status,onChangeStatus:i})),c.a.createElement(wa,{header:A("Description"),key:"description",className:"DescriptionPane"},c.a.createElement(fa,{role:E,description:u.description,shortDescription:u.shortDescription,onChangeDescription:function(e){return b(e.target.value,"description")},onChangeShortDescription:function(e){return b(e.target.value,"shortDescription")},onBlur:S})),"folder"!==t.type&&c.a.createElement(wa,{header:A("Details"),key:"details"},c.a.createElement(Na,{selectedNode:t})))))},Ra=(n(2584),n(347)),La=function(e){var t,n=e.role,a=e.treeData,o=e.onDriveTreeSelect,i=e.selectedKeys,r=e.forwardedRef,s=e.height,u=e.onExpand,d=e.expandedKeys,p=e.onDoubleClick,g=e.onMoveFile,h=e.onMoveFiles,f=e.draggable,A=e.checkedItems,E=e.setCheckedItems,T=e.onDeleteFile,S=e.onDeleteFolder,b=e.onOpenFolder,I=e.onOpenInCalculate,v=e.onDownloadFile,N=e.isUploadingFiles,O=Object(l.useState)(!1),w=Object(D.a)(O,2),P=w[0],R=w[1],L=Object(l.useState)(""),_=Object(D.a)(L,2),M=_[0],x=_[1],F=Object(l.useRef)({dragNodePos:null,nodePos:null}),j=Object(l.useRef)({key:null,pos:null}),V=Object(U.a)().t,W=1!==A.length||null===(null===(t=A[0])||void 0===t?void 0:t.parentId),B=function e(t,n,a){var o=t.find((function(e){return e.key===n}));if(o)a?F.current.dragNodePos=o.pos:F.current.nodePos=o.pos;else{var i,r=Object(Aa.a)(t);try{for(r.s();!(i=r.n()).done;){e(i.value.children,n,a)}}catch(s){r.e(s)}finally{r.f()}}},H=function(e){G(),J(Object(ma.e)(a),e,!0),A.forEach((function(e){"folder"===e.type&&J(Object(ma.e)(a),e,!1)})),null!==j.current.key&&null!==j.current.pos&&h(A,j.current),j.current.key=null,j.current.pos=null},J=function e(t,n,a){var o=t.find((function(e){return e.key==n.key}));if(o)a?(j.current.key=o.key,j.current.pos=o.pos):n.pos=o.pos;else{var i,r=Object(Aa.a)(t);try{for(r.s();!(i=r.n()).done;){e(i.value.children,n,a)}}catch(s){r.e(s)}finally{r.f()}}},z=function e(t){return t.map((function(t){if("folder"===t.type)return t.children.length>0?c.a.createElement(K.a.SubMenu,{onTitleClick:H,key:t.key,title:t.title,popupClassName:"ContextMenu_SubMenu",style:{display:P?"list-item":"none"}},e(t.children)):c.a.createElement(K.a.Item,{onClick:H,key:t.key,className:"ContextMenu_SubMenu",style:{display:P?"list-item":"none"}},t.title)}))},G=function(){return R(!1)},q=function(e){e?T(A):S(A),G()},X=function(e){I(A[0],e),G()},Y=function(){v(A[0],!0),G()},Z=function(){b(A[0]),G()};return c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement(m.a,{trigger:["contextMenu"],overlay:"folder"===M?function(){return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu"},c.a.createElement(K.a.SubMenu,{disabled:!n,key:"move",title:V("Move"),icon:c.a.createElement(y.a,{icon:["fal","stream"]}),popupClassName:"ContextMenu_SubMenu"},z(a)),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"open",onClick:Z,disabled:W},c.a.createElement(y.a,{icon:["fal","external-link-square"]}),V("Open")),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"delete",onClick:q,danger:!0,disabled:W||!n},c.a.createElement(y.a,{icon:["fal","trash"]}),V("Delete")))}:function(){return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu"},c.a.createElement(K.a.SubMenu,{disabled:!n,key:"move",title:V("Move"),icon:c.a.createElement(y.a,{icon:["fal","stream"]}),popupClassName:"ContextMenu_SubMenu"},z(a)),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"open",onClick:function(){return X(!1)},disabled:W},c.a.createElement(y.a,{icon:["fal","external-link-square"]}),V("Open")),c.a.createElement(K.a.Item,{key:"openInTab",onClick:function(){return X(!0)},disabled:W},c.a.createElement(y.a,{icon:["fal","external-link"]}),V("Open in New Tab")),c.a.createElement(K.a.Item,{key:"download",onClick:Y,disabled:W},c.a.createElement(y.a,{icon:["fal","cloud-download"]}),V("Download")),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"delete",onClick:function(){return q(!0)},danger:!0,disabled:W||!n},c.a.createElement(y.a,{icon:["fal","trash"]}),V("Delete")))},arrow:!0,placement:"bottomLeft",visible:P,onVisibleChange:function(e){return function(e){!1===e&&R(e)}(e)}},c.a.createElement(fe.a.DirectoryTree,{allowDrop:function(){return!0},checkStrictly:!0,treeData:Object(Ra.a)(a),titleRender:function(e){return c.a.createElement("div",{className:"Tree_Item_Wrapper"},c.a.createElement("label",null,e.title),c.a.createElement("div",{className:"Tree_Status"},e&&"folder"!==e.type&&c.a.createElement(k.m,{notStarted:"notStarted"===e.nodeStatus||!e.nodeStatus,progress:"progress"===e.nodeStatus,review:"review"===e.nodeStatus,complete:"complete"===e.nodeStatus}),"folder"===e.type&&e.statuses&&Object.values(e.statuses).some((function(e){return e>0}))&&c.a.createElement(k.m,{notStarted:e.statuses.notStarted>0,progress:e.statuses.progress>0,review:e.statuses.review>0,complete:e.statuses.complete>0})))},defaultExpandAll:!0,onSelect:function(e,t){return!N&&o(e,t)},selectedKeys:i,showLine:{showLeafIcon:!1},draggable:f,ref:r,onDrop:function(e){if(A.length>0){var t="folder"!==e.node.type?{pos:e.node.pos,key:e.node.parentId}:{pos:e.node.pos,key:e.node.key};h(A,t)}else"folder"===e.dragNode.type?(B(Object(ma.e)(a),e.node.id,!1),B(Object(ma.e)(a),e.dragNode.id,!0),null!==F.current.dragNodePos&&null!==F.current.nodePos&&(e.node.pos=F.current.nodePos,e.dragNode.pos=F.current.dragNodePos,g(e.dragNode,e.node),F.current.dragNodePos=null,F.current.nodePos=null)):g(e.dragNode,e.node)},expandAction:"doubleClick",onDragStart:function(e){return function(e){if(A.length>0)return A.find((function(t){return e.node.key===t.key}))?void 0:void E([e.node]);E([e.node])}(e)},height:s,onExpand:u,expandedKeys:d,onDoubleClick:p,onRightClick:function(e){return function(e){R(!0),x(e.type),o(e.id,{node:e})}(e.node)},className:"Drive_Tree"})))},Ca=c.a.forwardRef((function(e,t){return c.a.createElement(La,Object.assign({},e,{forwardedRef:t}))})),_a=n(2618),Ma=(n(2585),function(e){var t=e.selectedNode,n=e.onDeleteFile,a=e.onOpenInCalculate,o=e.onDeleteFolder,i=e.onOpenFolder,r=e.onDownloadFile,s=e.checkedItems,u=e.setCheckedItems,d=e.selectionByClick,g=e.treeData,h=e.onMoveFile,f=e.multipleFilesLoader,E=Object(l.useRef)({key:null,pos:null}),T=Object(U.a)().t;Object(l.useEffect)((function(){return Object(he.a)(ge.a.mark((function e(){return ge.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,M.i.initWebViewer(document.getElementById("fileTest"),!0);case 2:case"end":return e.stop()}}),e)})))(),function(){return M.i.cleanup()}}),[]);var S=function(e){b(Object(ma.e)(g),e,!0),s.forEach((function(e){"folder"===e.type&&b(Object(ma.e)(g),e,!1)})),null!==E.current.key&&null!==E.current.pos&&h(s,E.current),E.current.key=null,E.current.pos=null},b=function e(t,n,a){var o=t.find((function(e){return e.key==n.key}));if(o)a?(E.current.key=o.key,E.current.pos=o.pos):n.pos=o.pos;else{var i,r=Object(Aa.a)(t);try{for(r.s();!(i=r.n()).done;){e(i.value.children,n,a)}}catch(s){r.e(s)}finally{r.f()}}},I=function e(t){return t.map((function(t){if("folder"===t.type)return t.children.length>0?c.a.createElement(K.a.SubMenu,{onTitleClick:S,key:t.key,title:t.title,popupClassName:"ContextMenu_SubMenu"},e(t.children)):c.a.createElement(K.a.Item,{onClick:S,key:t.key,className:"ContextMenu_SubMenu"},t.title)}))},v=function(e){return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu"},c.a.createElement(K.a.SubMenu,{disabled:!M.b.getRole(),key:"move",title:T("Move"),icon:c.a.createElement(y.a,{icon:["fal","stream"]}),popupClassName:"ContextMenu_SubMenu"},I(g)),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"open",onClick:function(){return i(e)}},c.a.createElement(y.a,{icon:["fal","external-link-square"]}),T("Open")),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{disabled:!M.b.getRole(),key:"delete",onClick:function(){return o([e])},danger:!0},c.a.createElement(y.a,{icon:["fal","trash"]}),T("Delete")))},N=function(e){return c.a.createElement(K.a,{className:"Calculate_Rows_ContextMenu"},c.a.createElement(K.a.SubMenu,{disabled:!M.b.getRole(),key:"move",title:T("Move"),icon:c.a.createElement(y.a,{icon:["fal","stream"]}),popupClassName:"ContextMenu_SubMenu"},I(g)),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{key:"open",onClick:function(){return a(e)}},c.a.createElement(y.a,{icon:["fal","external-link-square"]}),T("Open")),c.a.createElement(K.a.Item,{key:"openInTab",onClick:function(){return a(e,!0)}},c.a.createElement(y.a,{icon:["fal","external-link"]}),T("Open in New Tab")),c.a.createElement(K.a.Item,{key:"download",onClick:function(){return r(e,!0)}},c.a.createElement(y.a,{icon:["fal","cloud-download"]}),T("Download")),c.a.createElement(C.a,null),c.a.createElement(K.a.Item,{disabled:!M.b.getRole(),key:"delete",onClick:function(){return n([e])},danger:!0},c.a.createElement(y.a,{icon:["fal","trash"]}),T("Delete")))};return c.a.createElement(le.ErrorBoundary,{FallbackComponent:k.e},c.a.createElement("div",{className:"Drive_Folder_Preview",style:{height:f.show?"calc(100% - 38px)":"100%"}},c.a.createElement(ze.b,{grid:{gutter:16,xs:1},className:"List_Container",dataSource:function(){var e=Object(A.filter)(t.children,(function(e){return"folder"===e.type})),n=Object(A.filter)(t.children,(function(e){return"folder"!==e.type}));return[].concat(Object(p.a)(Object(A.sortBy)(e,(function(e){return e.title}))),Object(p.a)(Object(A.sortBy)(n,(function(e){return e.title}))))}(),locale:{emptyText:c.a.createElement(ct.a,{description:!1,style:{height:"30vh"}})},renderItem:function(e){return c.a.createElement(ze.b.Item,null,c.a.createElement(me.a,{placement:"bottom",title:T(e.notes)},c.a.createElement(m.a,{overlay:"folder"===e.type?v(e):N(e),trigger:["contextMenu"],onVisibleChange:function(){return function(e){s.some((function(t){return t.key===e[0].key}))||u(e)}([e])}},c.a.createElement(ee.a,{className:"Card_Preview",extra:c.a.createElement("div",{className:"Card_Header"},"loader"===e.type?c.a.createElement("div",{className:"Card_Header_Loader"}):c.a.createElement(c.a.Fragment,null,e&&"folder"!==e.type&&c.a.createElement(k.m,{notStarted:"notStarted"===e.nodeStatus||!e.nodeStatus,progress:"progress"===e.nodeStatus,review:"review"===e.nodeStatus,complete:"complete"===e.nodeStatus}),"folder"===e.type&&e.statuses&&Object.values(e.statuses).some((function(e){return e>0}))&&c.a.createElement(k.m,{notStarted:e.statuses.notStarted>0,progress:e.statuses.progress>0,review:e.statuses.review>0,complete:e.statuses.complete>0})))},c.a.createElement("div",{onClick:function(t){return"loader"===e.type||"converted"!==e.status&&"conversion_failed"!==e.status&&"ifc"===e.type||f.show?null:d(t,e)},className:"Card_Body_Wrapper"},c.a.createElement("div",{className:"File_Icon"},c.a.createElement(ta.a,{type:e.type,status:e.status})),c.a.createElement("div",{className:"Card_Footer"},e.title?c.a.createElement(_a.a.Paragraph,{ellipsis:!0,className:"File_Title"},e.title):c.a.createElement("p",null,"\xa0")))))))}})),f.show&&c.a.createElement(Va,{loaded:f.loaded,wanted:f.wanted,filesName:f.filesName}))}),ka=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){return Object(o.a)(this,n),t.apply(this,arguments)}return Object(i.a)(n,[{key:"render",value:function(){var e=this.props.t;return c.a.createElement(ct.a,{description:e("We are sorry, but currently we cannot preview this file."),style:{marginTop:"30vh"}})}}]),n}(c.a.PureComponent),Da=(Object(f.a)()(ka),n(2587),function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).annotationStoreUpdated=function(e){switch(e){case"EstimateInitialized":case"AnnotationUpdated":case"AnnotationDeleted":case"annotationsInserted":case"AnnotationAdded":M.f.updateAnnotationsInDrive(Ee.a.getAnnotations());break;case"EstimateInitialized":oa.a.loadAnnotations()}},e.estimateStoreUpdated=function(e){"annotationsUpdated"===e&&oa.a.loadAnnotations()},e.fileStoreUpdated=function(t){switch(t){case"filesUpdated":oa.a.reloadFileView(oa.a.getSelectedFiles());break;case"documentLoaded":e.props.onUpdatePage(oa.a.webViewer.getCurrentPageNumber(),oa.a.webViewer.getPageCount())}},e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){this.unsubscribeFileStore=oa.a.listen(this.fileStoreUpdated),this.unsubscribeAnnotationStore=Ee.a.listen(this.annotationStoreUpdated),this.unsubscribeEstimateStore=M.f.listen(this.estimateStoreUpdated),oa.a.cleanup(),oa.a.initWebViewer(document.getElementById("previewViewer"),!1),oa.a.reloadFileView(oa.a.getSelectedFiles()),oa.a.loadAnnotations(),Ee.a.onSetActiveFileId(this.props.selectedNode.key)}},{key:"componentWillUnmount",value:function(){this.unsubscribeFileStore(),this.unsubscribeAnnotationStore(),this.unsubscribeEstimateStore(),oa.a.cleanup()}},{key:"render",value:function(){return c.a.createElement("div",{className:"PdfWiever_Container"},c.a.createElement("div",{className:"WebViewer_Hide_Element",style:{visibility:this.props.isResize?"visible":"hidden"}}),c.a.createElement("div",{className:"PdfWiever",id:"previewViewer"}))}}]),n}(c.a.PureComponent)),xa=Object(d.i)(Da),Fa=n(2614),ja=n(2610),Va=(n(2588),function(e){var t=e.loaded,n=e.wanted,a=e.filesName,o=t===n?c.a.createElement(Fa.a,null):c.a.createElement(ja.a,{spin:!0}),i=a.length>3?[].concat(Object(p.a)(a.slice(0,3)),["..."]):a;return c.a.createElement("div",{className:"UploadDialog-wrapper"},o," ",c.a.createElement("label",null,"Uploading ".concat(t,"/").concat(n," ").concat(i.join(", "))))}),Ua=function(e,t,n){var a={nodeToDelete:{key:n[0].key,pos:""},selectedNode:{key:t.key,pos:""}};return function(e,t){var n=Object(D.a)(e,1)[0],a={};if(n){try{a=JSON.parse(JSON.stringify(n))}catch(o){console.log(o)}!function e(t,n){var a=n.nodeToDelete,o=n.selectedNode,i=0;t.parentId||(t.pos="0"),t.children&&t.children.forEach((function(e){var n="".concat(t.pos,"-").concat(i);e.pos=n,e.key===a.key&&(a.pos=n),e.key===o.key&&(o.pos=n),i++})),a.pos.length>0&&o.pos.length>0||t.children.forEach((function(t){"folder"===t.type&&e(t,{nodeToDelete:a,selectedNode:o})}))}(a,t)}}(e,a),function(e){var t=e.nodeToDelete,n=e.selectedNode,a=t.pos.split("-"),o=n.pos.split("-");return a.length<o.length&&a.every((function(e,t){return e===o[t]}))}(a)},Wa=function e(t){return t.reduce((function(t,n){return t.push(n.key),n.children&&t.push.apply(t,Object(p.a)(e(n.children))),t}),[])},Ba=function(e,t){var n,a;return(n=e,a=t.key,[n].reduce((function e(t,n){if(n.key===a)return t.push(n),t;if(Array.isArray(n.children)){var o=n.children.reduce(e,[]);o.length&&t.push(Object(w.a)(Object(w.a)({},n),{},{children:o}))}return t}),[])).length<1},Ha=function(e){var t=function(e,t){return e.title.localeCompare(t.title)};return Array.isArray(e)&&e.map((function(e){return function e(n){n.children&&(n.children.map((function(t){return e(t)})),n.children.sort(t))}(e)})),e},Ja=(n(2589),n(2590),function(e){var t=e.loadedCount,n=e.wantedCount;return c.a.createElement(R.a,{justify:"center",align:"middle",className:"TreeLoader_Container"},c.a.createElement(Mn.a,{percent:Math.floor(t/n*100),type:"circle",status:"active"}))}),za=n(162),Ga=n(37),qa=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(e){var a;return Object(o.a)(this,n),(a=t.call(this,e)).role=M.b.getRole(),a.state={selectedNode:[],activeProject:null,treeData:[],driveLoader:{isLoading:M.i.fileLoaderDataDrive.isLoading,loadedCount:0,wantedCount:100},driveTreeHeight:0,expandedKeys:[],deleteModalVisibile:!1,folderModalVisibile:!1,uploadModalVisible:!1,templateModalVisible:!1,allKeysExpanded:!0,checkedItems:[],treeSearch:"",treeSearchTimeout:0,activePage:"",pageCount:"",multipleFilesLoader:{show:!1,filesName:[],wanted:0,loaded:0},showSubmenu:!1,isResize:!1,toolNode:"AnnotationEdit"},a.unlistenHistory=null,a.treeRef=c.a.createRef(),a.splitRef=c.a.createRef(),a.onResize=function(){a.setState({driveTreeHeight:a.splitRef.current.pane1.clientHeight-50})},a.onUpdatePage=function(e,t){a.setState({activePage:e,pageCount:t})},a.setSelectionHash=function(){var e=a.state.selectedNode.key;window.history.pushState({},"unused argument","#".concat(e))},a.setToolNode=function(e){a.setState({toolNode:e}),M.i.setToolMode(e)},a.mapFolder=function(e){var t=M.i.getChildren(e.id),n=Object(aa.a)(e.name).icon;"file-unknown"===n&&"folder"===e.type&&(n="folder");var o={title:e.name,key:e.id,type:n,icon:c.a.createElement(ta.a,{type:n}),notes:e.description,description:e.shortDescription};return"folder"===e.type&&(o.children=t.map((function(e){return a.mapFolder(e)}))),o},a.fileStoreUpdated=function(e,t,n){switch(e){case"treeDataUpdated":var o=M.i.getTreeData();a.setState({treeData:o,driveLoader:{wantedCount:M.i.fileLoaderDataDrive.wanted,loadedCount:M.i.fileLoaderDataDrive.loaded,isLoading:M.i.fileLoaderDataDrive.isLoading},expandedKeys:Wa(o)},(function(){a.updatePreviewState()}));break;case"showWebViewerImportDialog":a.setState({showWebViewerImportDialog:!0});break;case"updateSelectedNode":a.state.selectedNode&&(a.setState({selectedNode:M.i.getSelectedNode(a.state.selectedNode.id)}),M.i.reloadFileView([M.i.getSelectedNode(a.state.selectedNode.id)]));break;case"started_uploading_multiple_files":case"multiple_files_counter_updated":var i=M.i.getMultipleFilesDataLoader();a.setState({multipleFilesLoader:{show:!0,filesName:i.filesName,wanted:i.wanted,loaded:i.loaded}});break;case"ended_uploading_multiple_files":a.setState({multipleFilesLoader:{show:!1,filesName:[],wanted:0,loaded:0}});break;case"drivePageChanged":a.setState({activePage:M.i.getActivePage()});break;case"showDeleteConfirmation":1===a.state.checkedItems.length&&null!==a.state.checkedItems[0].parentId&&a.setState({deleteModalVisibile:!0});break;case"openFolderModal":"folder"===a.state.selectedNode.type&&a.openFolderModal();break;case"openUploadModal":"folder"===a.state.selectedNode.type&&a.openUploadModal();break;case"downloadFile":a.onDownloadFile();break;case"openInCalculate":a.onOpenInCalculate();break;case"expandAll":a.onExpandAll();break;case"collapseAll":a.onCollapseAll();break;case"setMarqueeZoomTool":a.setToolNode("MarqueeZoomTool")}},a.projectStoreUpdated=function(e){"projectAdded"===e&&a.setState({activeProject:M.m.getActiveProject()})},a.headerStoreUpdated=function(e){var t=Object(ea.a)(a);"appSearchUpdated"===e&&(a.state.treeSearchTimeout&&clearTimeout(a.state.treeSearchTimeout),a.setState({treeSearchTimeout:setTimeout((function(){t.setState({treeSearch:M.j.appSearch})}),300)}))},a.onDriveTreeDoubleClick=function(e,t){"folder"!==t.type&&a.props.history.push("/projects/"+a.props.match.params.projectId+"/calculate/"+t.key)},a.onExpandAll=function(){a.setState({expandedKeys:Wa(M.i.getTreeData()),allKeysExpanded:!0})},a.onCollapseAll=function(){a.setState({expandedKeys:[],allKeysExpanded:!1})},a.onDriveTreeSelect=function(e,t){a.setState({selectedNode:t.node},(function(){return a.setSelectionHash()}));var n=Object(p.a)(new Set([t.node]));a.setState({checkedItems:n}),_.f.setSelectedFileNodes([t.node]),M.i.setCheckedItemsIds([t.node.key]),_.a.setActiveFileId(t.node.key)},a.selectionByClick=function(e,t){var n=Object(p.a)(new Set([t]));a.setState({checkedItems:n});var o,i=Ha(a.state.selectedNode).children.findIndex((function(e){return e.key===t.key}));a.state.selectedNode.children&&(o="function"===typeof a.state.selectedNode.children.get?a.state.selectedNode.children.find((function(e){return e.get("key")===t.key})):a.state.selectedNode.children.find((function(e){return e.key===t.key}))),o.pos="".concat(a.state.selectedNode.pos,"-").concat(i),_.f.setSelectedFileNodes([o]),a.setState({selectedNode:o},(function(){return a.setSelectionHash()}))},a.onDrop=function(e){if(e.preventDefault(),"folder"!==a.state.selectedNode.type)return!1;var t=[];if(e.dataTransfer.items){for(var n=0;n<e.dataTransfer.items.length;n++)if("file"===e.dataTransfer.items[n].kind){var o=e.dataTransfer.items[n].getAsFile();t.push({file:o,parentId:a.state.selectedNode.key,notes:"",description:"",name:o.name})}}else Object($n.a)("files"),t=e.dataTransfer.files;M.i.uploadMultipleFiles(t)},a.updatePreviewState=function(){a.state.selectedNode.key&&a.setState({selectedNode:M.i.getSelectedNode(a.state.selectedNode.id)||M.i.getRootFolder()})},a.onPreviewBack=function(){var e,t=a.state.selectedNode.pos,n=t?t.split(/-/gm):"";if(n.shift(),n.pop(),(e=n.reduce((function(e,t){var n=parseInt(t,10),a=e[n];return e.children&&(a=e.children.get(n)),a}),a.state.treeData))&&a.treeRef.current){var o=a.treeRef.current.state.keyEntities;o[e.key]&&a.setState({selectedNode:Object(w.a)(Object(w.a)({},o[e.key]),o[e.key].node)},(function(){return a.setSelectionHash()}))}},a.onUpdateFileLocation=function(e,t){if("folder"!==e.type||Ba(e,t)){var n={action:"update_node",projectId:Number(a.props.match.params.projectId),ids:[e.key],parentId:Number(t.key)};_.i.sendMessage(n)}},a.onUpdateFilesLocation=function(e,t){var n=e.filter((function(e){return"folder"===e.type}));if(!!e.every((function(e){return"folder"!==e.type}))||function(e,t){if(e.some((function(e){return e.pos===t.pos})))return!1;var n=[];return e.map((function(e){return n.push(Ba(e,t))})),n.every(Boolean)}(n,t)){var o=[];e.map((function(e){return o.push(Number(e.key))}));var i={action:"update_nodes_position",projectId:Number(a.props.match.params.projectId),nodeIds:o,parentId:Number(t.key)};_.i.sendMessage(i)}},a.onUpdateFileProps=function(e,t,n){var o=Object(de.a)({action:"update_node",projectId:a.props.match.params.projectId,ids:[e]},t,n);_.i.sendMessage(o)},a.onUpdateNodeStatus=function(e){var t={action:"update_node",projectId:a.props.match.params.projectId,ids:[a.state.selectedNode.key],nodeStatus:e};_.i.sendMessage(t)},a.onExpandDriveTree=function(e){a.setState({expandedKeys:e})},a.onOpenInCalculate=function(e,t){var n=parseInt(a.props.match.params.projectId,10);if(e){if(t)return void window.open("/projects/".concat(n,"/calculate/").concat(e.key));a.props.history.push("/projects/".concat(n,"/calculate/").concat(e.key))}else 1===a.state.checkedItems.length?a.props.history.push("/projects/".concat(n,"/calculate/").concat(a.state.checkedItems[0].key)):a.state.checkedItems.length>1&&a.state.checkedItems.forEach((function(e){window.open("/projects/".concat(n,"/calculate/").concat(e.key))}))},a.onDownloadFile=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t){var n="".concat("https://geometra3.s3.eu-west-1.amazonaws.com/".replace(/\/$/,""),"/").concat(e.key);fetch(n,{mode:"cors"}).then((function(e){return e.blob()})).then((function(t){var n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e.title||"download",n.click(),n.remove()}))}else a.state.checkedItems.forEach((function(e){if("folder"!==e.type){var t="".concat("https://geometra3.s3.eu-west-1.amazonaws.com/".replace(/\/$/,""),"/").concat(e.key);fetch(t,{mode:"cors"}).then((function(e){return e.blob()})).then((function(t){var n=document.createElement("a");n.href=window.URL.createObjectURL(t),n.download=e.title||"download",n.click(),n.remove()}))}}))},a.onOpenFolder=function(e){a.onDriveTreeSelect(void 0,{node:e})},a.onDeleteItem=function(){a.setState({deleteModalVisibile:!0})},a.onCancelDeletion=function(){a.setState({deleteModalVisibile:!1})},a.onConfirmDeletion=function(){a.state.selectedNode.parentId&&Ua(a.state.treeData,a.state.selectedNode,a.state.checkedItems)&&a.setState({selectedNode:M.i.getSelectedNode(a.state.checkedItems[0].parentId)},(function(){M.i.reloadFileView([M.i.getSelectedNode(a.state.selectedNode.id)]),a.deleteFileHandler()})),a.deleteFileHandler()},a.deleteFileHandler=function(){var e=parseInt(a.props.match.params.projectId,10);a.state.checkedItems.forEach((function(t){t.key===a.state.selectedNode.key&&a.nodeBackHandler(),"folder"===t.type?_.f.deleteFolder({projectId:e,folderId:t.key}):_.f.deleteFile({projectId:e,fileId:t.key})})),a.setState({deleteModalVisibile:!1,checkedItems:[]})},a.filterTree=function(e){var t=function(e){return Object.assign({},e)},n=Object(ea.a)(a);return e.map(t).filter((function e(a){if("folder"===a.type&&a.title.toLowerCase().includes(n.state.treeSearch.toLowerCase())&&a.parentId)return!0;if(a.children){if("function"===typeof a.children.toJS&&a.children.size>0){var o=a.children.toJS().map(t).filter(e);return(a.children=o).length}if(a.children.length>0){var i=a.children.map(t).filter(e);return(a.children=i).length}}return!!a.title.toLowerCase().includes(n.state.treeSearch.toLowerCase())}))},a.closeModals=function(){a.setState({showWebViewerImportDialog:!1})},a.setCheckedItems=function(e){a.setState({checkedItems:e});var t=Object(A.filter)(Object(A.map)(e,(function(e){return e.parentId&&e.id})),(function(e){return!!e}));M.i.setCheckedItemsIds(t)},a.nodeBackHandler=function(){a.state.selectedNode&&a.setState({selectedNode:M.i.getSelectedNode(a.state.selectedNode.parentId)},(function(){return M.i.reloadFileView([M.i.getSelectedNode(a.state.selectedNode.id)])}))},a.templateModalVisible=function(){a.setState({templateModalVisible:!0,showSubmenu:!1})},a.switchShowSubmenu=function(e){a.setState({showSubmenu:e})},a.onCreateFolder=function(e){a.closeFolderModal();var t={action:Ga.e.CREATE_GROUP,geoProjectId:Number(M.m.getActiveProjectId()),parentId:a.state.selectedNode.key,name:e.name,shortDescription:e.shortDescription,description:e.description,added:new Date};M.l.onSendMessage(Ga.f.GEO_FILE,t)},a.openFolderModal=function(){return a.setState({folderModalVisibile:!0})},a.closeFolderModal=function(){return a.setState({folderModalVisibile:!1})},a.openUploadModal=function(){return a.setState({uploadModalVisible:!0})},a.closeUploadModal=function(){return a.setState({uploadModalVisible:!1})},a.viewerRef=c.a.createRef(),a}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=this,t=parseInt(this.props.match.params.projectId,10),n=M.m.getActiveProjectId();n&&n===t||(n&&_.h.requestCloseProject(n),_.h.requestOpenProject(t),_.h.requestProject(t)),M.m.setActiveProjectId(t);var a={};if(0===M.i.treeList.length)_.f.requestGetFiles(t);else{M.i.selectedFileNodes[0]||M.i.setDefaultFileNode();var o=M.i.selectedFileNodes[0],i=Ha(M.i.getTreeData());M.i.fileLoaderDataDrive.isLoading=!1,this.setState({driveLoader:{isLoading:!1}}),a={treeData:i,expandedKeys:Wa(i),selectedNode:o}}if(0===M.m.getProjectRows().length){var r=M.b.getJwt();M.m.fetchProjects(r)}this.unsubscribeProjectStore=M.m.listen(this.projectStoreUpdated),this.unsubscribeFileStore=M.i.listen(this.fileStoreUpdated),this.unsubscribeHeaderStore=M.j.listen(this.headerStoreUpdated),this.setState(Object(w.a)({driveTreeHeight:this.splitRef.current.pane1.clientHeight-50},a),(function(){if(M.i.selectedFileNodes[0]&&"number"===typeof M.i.selectedFileNodes[0]){var t=e.treeRef.current.state.keyEntities[M.i.selectedFileNodes[0]];_.f.setSelectedFileNodes([t.node]),_.a.setActiveFileId(t.node.key);var n=M.i.expandedKeys;if(M.i.expandedKeys.length<=0){var a=M.i.getTreeData();n=Wa(a),_.f.setExpandedKeys(n)}e.setState({selectedNode:t.node,expandedKeys:n},(function(){return e.setSelectionHash()}))}})),window.addEventListener("resize",this.onResize),document.addEventListener("keydown",za.a),window.onpopstate=function(){e.onPreviewBack()}}},{key:"componentDidUpdate",value:function(e,t){var n=this;if(t.driveLoader.isLoading!==this.state.driveLoader.isLoading){var a=this.treeRef.current.state.keyEntities[M.i.getRootFolder().id];_.f.setSelectedFileNodes([a]),_.a.setActiveFileId(a.key),this.setState({selectedNode:a.node,checkedItems:[a.node]},(function(){return n.setSelectionHash()}))}}},{key:"componentWillUnmount",value:function(){this.unsubscribeFileStore(),this.unsubscribeHeaderStore(),this.unsubscribeProjectStore(),window.removeEventListener("resize",this.onResize),document.removeEventListener("keydown",za.a),window.onpopstate=null,M.i.clearDriveLoader(),M.i.cleanup()}},{key:"render",value:function(){var e=this,t=this.state,n=t.selectedNode,a=t.checkedItems,o=t.driveLoader,i=t.expandedKeys,r=t.treeData,s=t.isResize,l=t.activePage,u=t.showSubmenu,d=t.driveTreeHeight,g=t.multipleFilesLoader,h=t.pageCount,m=t.showWebViewerImportDialog,f=t.folderModalVisibile,E=t.deleteModalVisibile,T=t.templateModalVisible,b=t.uploadModalVisible,I=t.allKeysExpanded,y=t.toolNode,v=this.viewerRef,N=this.splitRef,O=this.treeRef,w=this.role,P=this.onCreateFolder,R=this.openFolderModal,L=this.closeFolderModal,C=this.onCancelDeletion,_=this.onConfirmDeletion,M=this.nodeBackHandler,D=this.onDriveTreeSelect,x=this.closeModals,F=this.onDrop,j=this.openUploadModal,V=this.closeUploadModal,U=this.onExpandAll,W=this.onCollapseAll,B=this.setToolNode;return c.a.createElement("div",{className:"Drive",onDrop:F,onDragOver:function(e){return e.preventDefault()}},m&&c.a.createElement(na,{isOpen:m,close:x}),c.a.createElement(k.g,{isLoading:o.isLoading,selectedNode:n,onNodeBack:M,onDoubleClickDrive:function(e){return D(void 0,{node:e})}}),c.a.createElement("div",{className:"Drive_Layout"},c.a.createElement(ke,{fileId:n.key,type:n.type}),E&&c.a.createElement(pa,{visible:E,confirmValue:a[0].title,onCancel:C,onConfirm:_}),f&&c.a.createElement(sa,{isOpen:f,onOk:P,onCancel:L}),b&&c.a.createElement(ca,{isOpen:b,onCancel:V,parentId:n.key}),T&&c.a.createElement(k.n,{visible:T,onCancel:function(){return e.setState({templateModalVisible:!1})},onAccept:function(){return e.setState({templateModalVisible:!1})},title:"Folder Templates",type:"drive"}),c.a.createElement("div",{className:"Drive_Wrapper"},c.a.createElement(ua,{role:w,selectedNode:n,onDelete:this.onDeleteItem,onDownloadFile:this.onDownloadFile,activePage:l,pageCount:h,onUpdatePage:this.onUpdatePage,onOpenInCalculate:this.onOpenInCalculate,checkedItems:a,selectedItem:n,viewerRef:v,templateModalVisible:this.templateModalVisible,showSubmenu:u,switchShowSubmenu:function(t){return e.switchShowSubmenu(t)},openFolderModal:R,openUploadModal:j,allKeysExpanded:I,collapseAll:W,expandAll:U,toolNode:y,onChangeTool:B}),c.a.createElement("div",{className:"Drive_Body"},c.a.createElement(S.a,{defaultSize:null===localStorage.getItem("driveSplitPosLeft")?"350px":parseInt(localStorage.getItem("driveSplitPosLeft"),10),onChange:function(e){return localStorage.setItem("driveSplitPosLeft",e)},pane1Style:{minWidth:"50px",minHeight:"50px",overflow:"auto"},pane2Style:{minWidth:"50px",minHeight:"50px",overflow:"auto"},ref:N,onDragStarted:function(){return e.setState({isResize:!0})},onDragFinished:function(){return e.setState({isResize:!1})}},this.state.driveLoader.isLoading?c.a.createElement(Ja,{loadedCount:o.loadedCount,wantedCount:o.wantedCount}):c.a.createElement(Ca,{role:w,onDoubleClick:this.onDriveTreeDoubleClick,treeData:Ha(Object(p.a)(this.filterTree(r))),onDriveTreeSelect:this.onDriveTreeSelect,selectedKeys:a.map((function(e){return e.key})),checkedKeys:a.map((function(e){return e.key})),ref:O,onMoveFile:this.onUpdateFileLocation,onMoveFiles:this.onUpdateFilesLocation,height:d,expandedKeys:i,onExpand:this.onExpandDriveTree,draggable:w,checkedItems:a,setCheckedItems:this.setCheckedItems,onDeleteFile:this.onDeleteItem,onDeleteFolder:this.onDeleteItem,onOpenFolder:this.onOpenFolder,onOpenInCalculate:this.onOpenInCalculate,onDownloadFile:this.onDownloadFile,isUploadingFiles:g.show}),c.a.createElement("div",null,c.a.createElement(S.a,{primary:"second",defaultSize:null===localStorage.getItem("driveSplitPosRight")?"250px":parseInt(localStorage.getItem("driveSplitPosRight"),10),onChange:function(e){return localStorage.setItem("driveSplitPosRight",e)},pane1Style:{minWidth:"50px",minHeight:"50px"},pane2Style:{minWidth:"50px",minHeight:"50px"},onDragStarted:function(){return e.setState({isResize:!0})},onDragFinished:function(){return e.setState({isResize:!1})}},c.a.createElement(ha,{selectedNode:n,onDriveTreeSelect:this.onDriveTreeSelect,selectionByClick:this.selectionByClick,onBack:this.onPreviewBack,onOpenInCalculate:this.onOpenInCalculate,onDownloadFile:this.onDownloadFile,onOpenFolder:this.onOpenFolder,onDeleteFile:this.onDeleteItem,onDeleteFolder:this.onDeleteItem,checkedItems:a,setCheckedItems:this.setCheckedItems,treeData:Ha(Object(p.a)(this.filterTree(r))),onMoveFile:this.onUpdateFilesLocation,onUpdatePage:this.onUpdatePage,viewerRef:v,multipleFilesLoader:g,isResize:s}),!Object(A.isEmpty)(n)&&n.parentId?c.a.createElement(Pa,{selectedNode:n,treeData:Ha(Object(p.a)(r)),onUpdateFileProps:this.onUpdateFileProps,onUpdateFileLocation:this.onUpdateFileLocation,onChangeStatus:this.onUpdateNodeStatus}):c.a.createElement(c.a.Fragment,null," ")))))),c.a.createElement("div",{style:{width:"10px",height:"10px",background:"#333333"},id:"fileTest"})))}}]),n}(c.a.PureComponent),Xa=xe(Object(d.i)(qa)),Ya=n(429),Ka=G.a.Option,Za=function(e){var t=e.country,n=e.setCountry,a=e.disabled,o=Object(U.a)().t;return c.a.createElement(G.a,{suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]}),disabled:a,showSearch:!0,placeholder:" -- ".concat(o("Select a Country")," --"),value:t&&t,filterOption:function(e,t){return t.props.children.toLowerCase().indexOf(e.toLowerCase())>=0},onChange:function(e){return n(e)},allowClear:!1},Ya.countries&&Ya.countries.map((function(e){return c.a.createElement(Ka,{value:e.name,key:e.name},e.name)})))},Qa=n(92),$a=n(45),eo=(n(2591),function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).role=Ne.a.getRole(),e.state={departmentUsers:Qa.a.departmentUserList,departmentList:Qa.a.departmentUserAccess,selectedDepartment:Qa.a.getSelectedDepartmentId(),activeProject:null,hasSetDefaults:!1},e.departmentStoreUpdated=function(t){"departmentUserAccessRecieved"===t&&(e.setState({departmentList:Qa.a.departmentUserAccess,departmentUsers:Qa.a.departmentUserList}),e.state.selectedDepartment||e.setState({selectedDepartment:Qa.a.departmentUserAccess.first().department.id}))},e.setDefaults=function(){e.state.hasSetDefaults||e.state.activeProject&&e.setState({hasSetDefaults:!0,projectNumber:e.state.activeProject.get("projectNumber"),projectName:e.state.activeProject.get("name"),address1:e.state.activeProject.get("address1"),address2:e.state.activeProject.get("address2"),postCode:e.state.activeProject.get("postCode"),city:e.state.activeProject.get("city"),country:e.state.activeProject.get("country"),department:e.state.activeProject.get("department").get("id"),projectLeaderId:e.state.activeProject.get("projectLeaderId"),units:e.state.activeProject.get("units"),currency:e.state.activeProject.get("currency")})},e.projectsStoreUpdated=function(t){switch(t){case"projectAdded":case"projectUpdated":e.setState({activeProject:$a.a.getProjectById(parseInt(e.props.match.params.projectId),10)},e.setDefaults)}},e.defaultGet=function(e,t){return e&&e.get?e.get(t):null},e.setProjectCountry=function(t){e.setState({country:t}),Ue.a.requestUpdateProject({id:e.props.match.params.projectId,country:t})},e.selectDepartment=function(t){e.setState({department:t},(function(){e.departmentUsers.map((function(e){return e.id})).includes(e.state.projectLeaderId)?Ue.a.requestUpdateProject({id:e.props.match.params.projectId,department:{id:t}}):e.setState({projectLeaderDialog:!0})}))},e.selectUnits=function(t){e.setState({units:t}),Ue.a.requestUpdateProject({id:e.props.match.params.projectId,units:t})},e.selectCurrency=function(t){e.setState({currency:t}),Ue.a.requestUpdateProject({id:e.props.match.params.projectId,currency:t})},e.selectProjectLeader=function(t){e.setState({projectLeaderId:t,projectLeaderDialog:!1}),Ue.a.requestUpdateProject({id:e.props.match.params.projectId,projectLeaderId:t})},e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){if(this.unsubscribeProjectsStore=$a.a.listen(this.projectsStoreUpdated),this.unsubcribeDepartmentStore=Qa.a.listen(this.departmentStoreUpdated),this.setState({activeProject:$a.a.getProjectById(parseInt(this.props.match.params.projectId),10)},this.setDefaults),0===$a.a.getProjectRows().length){var e=Ne.a.getJwt();$a.a.fetchProjects(e)}var t=parseInt(this.props.match.params.projectId,10);0===M.i.treeList.length&&_.f.requestGetFiles(t),Ue.a.requestOpenProject(t),M.a.isAnnotationActionDone()||_.h.requestProject(t),$a.a.setActiveProjectId(t)}},{key:"componentWillUnmount",value:function(){this.unsubscribeProjectsStore(),this.unsubcribeDepartmentStore()}},{key:"render",value:function(){var e=this,t=this.props.t;return c.a.createElement("div",{className:"Overview"},c.a.createElement(k.g,{activeProject:this.state.activeProject,departList:this.state.departmentList,selectedDepartId:this.state.selectedDepartment}),c.a.createElement("div",{className:"Overview_Layout"},c.a.createElement(ke,null),c.a.createElement("div",{className:"Overview_Wrapper"},c.a.createElement(R.a,{gutter:[16,16]},c.a.createElement(L.a,{xs:24},c.a.createElement(ee.a,{className:"Overview_Card"},c.a.createElement(ee.a.Meta,{className:"Overview_Card_Title",title:t("Project Details")}),c.a.createElement(R.a,{gutter:[16,16]},c.a.createElement(L.a,{xs:24,sm:8},c.a.createElement("label",null,t("Project Number"),c.a.createElement(F.a,{className:"Input",disabled:!this.role,name:"projectNumber",value:this.state.projectNumber,onChange:function(t){return e.setState({projectNumber:t.target.value})},onBlur:function(){Ue.a.requestUpdateProject({id:e.props.match.params.projectId,projectNumber:e.state.projectNumber})}}))),c.a.createElement(L.a,{xs:24,sm:16},c.a.createElement("label",null,t("Project Name"),c.a.createElement(F.a,{className:"Input",disabled:!this.role,name:"projectName",value:this.state.projectName,onChange:function(t){return e.setState({projectName:t.target.value})},onBlur:function(){Ue.a.requestUpdateProject({id:e.props.match.params.projectId,name:e.state.projectName})}}))),c.a.createElement(L.a,{xs:24,sm:12},c.a.createElement("label",null,t("Address"),c.a.createElement(F.a,{className:"Input",disabled:!this.role,name:"address1",value:this.state.address1,onChange:function(t){return e.setState({address1:t.target.value})},onBlur:function(){Ue.a.requestUpdateProject({id:e.props.match.params.projectId,address1:e.state.address1})}}))),c.a.createElement(L.a,{xs:24,sm:12},c.a.createElement("label",null,t("c/o"),c.a.createElement(F.a,{className:"Input",disabled:!this.role,name:"address2",value:this.state.address2,onChange:function(t){return e.setState({address2:t.target.value})},onBlur:function(){Ue.a.requestUpdateProject({id:e.props.match.params.projectId,address2:e.state.address2})}}))),c.a.createElement(L.a,{xs:24,sm:8},c.a.createElement("label",null,t("Post Code"),c.a.createElement(F.a,{className:"Input",disabled:!this.role,name:"postCode",value:this.state.postCode,onChange:function(t){return e.setState({postCode:t.target.value})},onBlur:function(){Ue.a.requestUpdateProject({id:e.props.match.params.projectId,postCode:e.state.postCode})}}))),c.a.createElement(L.a,{xs:24,sm:8},c.a.createElement("label",null,t("City"),c.a.createElement(F.a,{className:"Input",disabled:!this.role,name:"city",value:this.state.city,onChange:function(t){return e.setState({city:t.target.value})},onBlur:function(){Ue.a.requestUpdateProject({id:e.props.match.params.projectId,city:e.state.city})}}))),c.a.createElement(L.a,{xs:24,sm:8},c.a.createElement("label",null,t("Country"),c.a.createElement(Za,{disabled:!this.role,country:this.state.country,setCountry:function(t){return e.setProjectCountry(t)}})))))),this.state.projectLeaderDialog&&c.a.createElement(Cn.a,{visible:this.state.projectLeaderDialog,maskClosable:!1,title:t("Current project leader is not available for this department, please choose another one."),footer:[]},c.a.createElement("label",null,t("Project Leader"),c.a.createElement(G.a,{suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]}),disabled:!this.role,value:t("Choose another project leader"),onSelect:function(t){return e.selectProjectLeader(t)}},this.departmentUsers.map((function(e){return c.a.createElement(G.a.Option,{value:e.id,key:e.id},e.firstName," ",e.lastName)}))))),c.a.createElement(L.a,{xs:24,sm:12},c.a.createElement(ee.a,{className:"Overview_Card"},c.a.createElement(ee.a.Meta,{className:"Overview_Card_Title",title:t("Managment")}),c.a.createElement(R.a,{gutter:[16,16]},c.a.createElement(L.a,{xs:24},c.a.createElement("label",null,t("Department"),c.a.createElement(G.a,{suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]}),disabled:!this.role,value:this.state.department,onSelect:function(t){return e.selectDepartment(t)}},this.state.departmentList.map((function(e){return c.a.createElement(G.a.Option,{value:e.department.id,key:e.department.id},e.department.name)}))))),c.a.createElement(L.a,{xs:24},c.a.createElement("label",null,t("Project Leader"),c.a.createElement(G.a,{suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]}),disabled:!this.role,value:this.state.projectLeaderId,onSelect:function(t){return e.selectProjectLeader(t)}},this.departmentUsers.map((function(e){return c.a.createElement(G.a.Option,{value:e.id,key:e.id},e.firstName," ",e.lastName)})))))))),c.a.createElement(L.a,{xs:24,sm:12},c.a.createElement(ee.a,{className:"Overview_Card"},c.a.createElement(ee.a.Meta,{className:"Overview_Card_Title",title:t("Settings")}),c.a.createElement(R.a,{gutter:[16,16]},c.a.createElement(L.a,{xs:24},c.a.createElement("label",null,t("Unit System"),c.a.createElement(G.a,{suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]}),disabled:!this.role,value:this.state.units,onSelect:function(t){return e.selectUnits(t)}},c.a.createElement(G.a.Option,{value:"metric"},t("Metric: m, dm, cm, mm")),c.a.createElement(G.a.Option,{value:"imperial"},t("Imperial: yard, feet, inch"))))),c.a.createElement(L.a,{xs:24},c.a.createElement("label",null,t("Currency"),c.a.createElement(G.a,{suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]}),disabled:!this.role,value:this.state.currency,onSelect:function(t){return e.selectCurrency(t)}},c.a.createElement(G.a.Option,{value:"SEK"},"SEK"),c.a.createElement(G.a.Option,{value:"NOK"},"NOK"),c.a.createElement(G.a.Option,{value:"DKK"},"DKK"),c.a.createElement(G.a.Option,{value:"EUR"},"EUR"),c.a.createElement(G.a.Option,{value:"GBP"},"GBP"),c.a.createElement(G.a.Option,{value:"USD"},"USD")))))))))))}},{key:"departmentUsers",get:function(){var e=this,t=this.state.departmentList.find((function(t){return t.department.id===e.state.department}));return t?t.departmentUsers:[]}}]),n}(c.a.PureComponent)),to=Object(f.a)()(xe(Object(d.i)(eo))),no=n(260),ao=n(170),oo=(n(2592),n(240)),io=n(241),ro=function(e){var t=M.b.getRole(),n=e.keyCode,a=e.ctrlKey,o=e.altKey;if(!Object(io.a)(e))switch(Object(oo.a)(e),n){case 78:o&&a&&t&&(M.m.onCreateNewProject(),e.preventDefault(),e.stopPropagation());break;case 79:a&&(M.m.onOpenProjects(),e.preventDefault(),e.stopPropagation());break;case 46:M.m.onDeleteProjects(),e.preventDefault(),e.stopPropagation()}},so=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).formRef=c.a.createRef(),e.role=Ne.a.getRole(),e.state={departmentList:Qa.a.getAccessibleDeparments(),country:"Sweden",selectedDepartment:Qa.a.getSelectedDepartmentId(),selectedCurrency:"SEK",selectedSystem:"metric",newProjectDialog:!1,selectedRowKeys:[],projectRows:[],projectLoader:{isLoading:$a.a.projectLoaderData.isLoading,loadedCount:0,wantedCount:0},projectDialogNumber:$a.a.getNextProjectNumber()},e.setInitialCountry=function(){var t=null;switch(localStorage.getItem("language")){case"en":t={country:"United Kingdom",selectedCurrency:"GBP"};break;case"da":t={country:"Denmark",selectedCurrency:"DKK"};break;case"no":t={country:"Norway",selectedCurrency:"NOK"};break;case"sv":t={country:"Sweden",selectedCurrency:"SEK"};break;case"nl":t={country:"Netherlands",selectedCurrency:"EUR"}}null!==t&&e.setState(t)},e.getDepartemntUsers=function(){var t=e.state.departmentList.toJS().find((function(t){return t.department.id===e.state.selectedDepartment}));return t&&t.departmentUsers||[]},e.generateFilters=function(t){return e.state.projectRows.reduce((function(e,n){return e.findIndex((function(e){return e.text===n[t]&&e.value===n[t]}))<=-1&&e.push({text:n[t],value:n[t]}),e}),[])},e.generateLeaderFilters=function(){return e.getDepartemntUsers().map((function(e){var t="".concat(e.firstName," ").concat(e.lastName);return{text:t,value:t}}))},e.getDefaultSort=function(e,t){return t.field!==e?null:t.order},e.projectsStoreUpdated=function(t,n){switch(t){case"goToDrive":e.openProjectWithId(n);break;case"projectAdded":case"projectUpdated":e.setState({projectRows:$a.a.getProjectRows(),projectLoader:Object(w.a)(Object(w.a)({},e.state.projectLoader),{},{wantedCount:$a.a.projectLoaderData.wanted,loadedCount:$a.a.projectLoaderData.loaded,isLoading:$a.a.projectLoaderData.isLoading}),projectDialogNumber:$a.a.getNextProjectNumber()});break;case"createNewProject":e.setState({newProjectDialog:!0});case"openProjects":1===e.state.selectedRowKeys.length?e.openProject():e.state.selectedRowKeys.length>1&&e.openProjectInNewTab();break;case"deleteProjects":e.state.selectedRowKeys.length>0&&e.setState({deleteProjectDialog:!0})}},e.headerStoreUpdated=function(t){"appSearchUpdated"===t&&e.setState({projectRows:$a.a.getProjectRows()})},e.departmentStoreUpdated=function(t){switch(t){case"departmentUserAccessRecieved":e.setState({departmentList:Qa.a.getAccessibleDeparments()}),e.state.selectedDepartment||e.setState({selectedDepartment:Qa.a.getSelectedDepartmentId()});break;case"departmentSelectionUpdated":e.setState({selectedDepartment:Qa.a.getSelectedDepartmentId()})}},e.openProject=function(){_e.a.clearFileList();var t=e.state.projectRows.find((function(t){return e.state.selectedRowKeys.indexOf(t.key)>-1}));e.props.history.push("/projects/".concat(t.id,"/drive"))},e.openProjectWithId=function(t){_e.a.clearFileList(),e.props.history.push("/projects/".concat(t,"/drive"))},e.openProjectInNewTab=function(){e.state.projectRows.filter((function(t){return e.state.selectedRowKeys.indexOf(t.key)>-1})).forEach((function(e){window.open("/projects/".concat(e.id,"/drive"))}))},e.openNewProjectDialog=function(){e.setState({newProjectDialog:!0})},e.createNewProject=function(t){e.setState({newProjectDialog:!1}),Ue.a.requestInsertNewProject(t.projectDesignation,t.projectNumber,e.state.country,e.state.selectedDepartment,e.state.selectedCurrency,e.state.selectedSystem)},e.cancelNewProjectDialog=function(){e.setState({newProjectDialog:!1})},e.openDeleteProjectDialog=function(){e.setState({deleteProjectDialog:!0})},e.deleteProject=function(){Ue.a.requestDeleteProject(e.filterSelectedRowKeys.map((function(e){return e.id}))),e.setState({deleteProjectDialog:!1,selectedRowKeys:[]})},e.cancelDeleteProjectDialog=function(){e.setState({deleteProjectDialog:!1})},e.onSelectChange=function(t){e.setState({selectedRowKeys:t})},e.setCountry=function(t){e.setState({country:t})},e.setDepartment=function(t){e.setState({department:t})},e.onChangeCreateProject=function(t){e.setState(Object(de.a)({},t.target.name,t.target.value))},e.selectDepartment=function(e){Qa.a.setSelectedDepartmentId(e)},e.selectCurrency=function(t){e.setState({selectedCurrency:t})},e.selectSystem=function(t){e.setState({selectedSystem:t})},e.onTableChange=function(e,t,n){localStorage.setItem("projectTable::pageSize",JSON.stringify(e.pageSize)),localStorage.setItem("projectTable::filter",JSON.stringify(t)),localStorage.setItem("projectTable::sorter",JSON.stringify(n))},e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){var e=Object(he.a)(ge.a.mark((function e(){var t;return ge.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.unsubscribeProjectsStore=$a.a.listen(this.projectsStoreUpdated),this.unsubscribeHeaderStore=ao.a.listen(this.headerStoreUpdated),this.unsubcribeDepartmentStore=Qa.a.listen(this.departmentStoreUpdated),document.addEventListener("keydown",ro),M.i.clearFileStore(),this.setInitialCountry(),0!==$a.a.getProjectRows().length){e.next=10;break}return t=Ne.a.getJwt(),e.next=10,$a.a.fetchProjects(t);case 10:this.setState({projectRows:$a.a.getProjectRows()}),$a.a.setActiveProjectId(null),M.l.onSendMessage(Ga.f.GEO_PROJECT,{action:Ga.g.LEAVE}),Ne.a.disconnectAnotherLogins&&(M.l.onSendMessage(Ga.f.AUTH,{action:Ga.c.LICENSE_ACTIVATED_FROM_ELSEWHERE}),Ne.a.disconnectAnotherLogins=!1);case 14:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"componentWillUnmount",value:function(){this.unsubscribeProjectsStore(),this.unsubscribeHeaderStore(),this.unsubcribeDepartmentStore(),document.removeEventListener("keydown",ro)}},{key:"render",value:function(){var e=this,t=this.props.t,n=this.state.selectedRowKeys;return c.a.createElement("div",{className:"Projects"},c.a.createElement(k.g,{departList:this.state.departmentList,selectedDepartId:this.state.selectedDepartment}),c.a.createElement("div",{className:"Projects_Layout"},c.a.createElement("div",{className:"Projects_Layout_Sidebar"},c.a.createElement(ke,null)),c.a.createElement("div",{className:"Toolbar"},c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","plus-circle"]}),onClick:this.openNewProjectDialog,disabled:!this.role}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","external-link-square-alt"]}),onClick:this.openProject,disabled:1!==this.state.selectedRowKeys.length}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","external-link-alt"]}),onClick:this.openProjectInNewTab,disabled:0===this.state.selectedRowKeys.length}),c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","trash"]}),onClick:this.openDeleteProjectDialog,disabled:!this.role||0===this.state.selectedRowKeys.length})),this.state.projectLoader.isLoading?c.a.createElement("div",{className:"Projects_ProgressWrapper"},c.a.createElement(g.a,{size:"large"})):c.a.createElement(P.a,{className:"Projects_Table",columns:this.projectTableColumns,dataSource:this.state.projectRows,pagination:{position:["topRight"],defaultPageSize:JSON.parse(localStorage.getItem("projectTable::pageSize"))||50},rowSelection:{type:"checkbox",selectedRowKeys:n,onChange:this.onSelectChange,hideSelectAll:!0},size:"middle",tableLayout:"fixed",onRow:function(t){return{onDoubleClick:function(){e.openProjectWithId(t.id)}}},onChange:this.onTableChange})),this.state.newProjectDialog&&c.a.createElement(Cn.a,{className:"Projects_Modal",title:t("Create New Project"),visible:this.state.newProjectDialog,closable:!1,okText:t("Create"),onCancel:this.cancelNewProjectDialog,okButtonProps:{form:"create-project",key:"submit",htmlType:"submit"},destroyOnClose:!0},c.a.createElement(no.a,{id:"create-project",layout:"vertical",onFinish:this.createNewProject,onFinishFailed:function(e){return console.log("Error info",e)},ref:this.formRef,autoComplete:"off"},c.a.createElement(no.a.Item,{initialValue:$a.a.getNextProjectNumber(),name:"projectNumber",label:t("Project Number"),rules:[{required:!0,message:t("Required field.")}],getValueProps:function(){}},c.a.createElement(F.a,{className:"Input",placeholder:t("Project Number"),value:this.state.projectDialogNumber,suffix:c.a.createElement(h.a,{icon:c.a.createElement(y.a,{icon:["fal","sync"]}),onClick:function(){var t=$a.a.getNextProjectNumber();e.setState({projectDialogNumber:t}),e.formRef.current.setFieldsValue({projectNumber:t})}}),onChange:function(t){e.setState({projectDialogNumber:t.target.value})}})),c.a.createElement(no.a.Item,{name:"projectDesignation",label:t("Project Name"),rules:[{required:!0,message:t("Required field.")}]},c.a.createElement(F.a,{className:"Input",placeholder:t("Project Name")})),c.a.createElement(no.a.Item,{name:"country",label:t("Country")},c.a.createElement(Za,{disabled:!this.role,country:this.state.country,setCountry:this.setCountry})),c.a.createElement(no.a.Item,{label:t("Department (Optional)")},c.a.createElement(G.a,{defaultValue:this.state.selectedDepartment,onChange:this.selectDepartment,suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]})},this.state.departmentList.map((function(e){return c.a.createElement(G.a.Option,{value:e.department.id,key:e.department.id},e.department.name)}))),c.a.createElement(R.a,{gutter:16},c.a.createElement(L.a,{span:12},c.a.createElement(no.a.Item,{label:t("Currency")},c.a.createElement(G.a,{defaultValue:this.state.selectedCurrency,onChange:this.selectCurrency,suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]})},c.a.createElement(G.a.Option,{value:"SEK"},"SEK"),c.a.createElement(G.a.Option,{value:"NOK"},"NOK"),c.a.createElement(G.a.Option,{value:"DKK"},"DKK"),c.a.createElement(G.a.Option,{value:"EUR"},"EUR"),c.a.createElement(G.a.Option,{value:"GBP"},"GBP"),c.a.createElement(G.a.Option,{value:"USD"},"USD")))),c.a.createElement(L.a,{span:12},c.a.createElement(no.a.Item,{label:t("System")},c.a.createElement(G.a,{defaultValue:this.state.selectedSystem,onChange:this.selectSystem,suffixIcon:c.a.createElement(y.a,{icon:["fal","caret-down"]})},c.a.createElement(G.a.Option,{value:"metric"},t("Metric: m, dm, cm, mm")),c.a.createElement(G.a.Option,{value:"imperial"},t("Imperial: yard, feet, inch"))))))))),this.state.deleteProjectDialog&&c.a.createElement(Cn.a,{title:t("Delete"),visible:this.state.deleteProjectDialog,onOk:this.deleteProject,onCancel:this.cancelDeleteProjectDialog,width:"100%"},c.a.createElement(P.a,{style:{overflow:"auto"},columns:this.projectTableColumnsForDelete,dataSource:this.filterSelectedRowKeys,pagination:!1,size:"middle",tableLayout:"fixed"})))}},{key:"projectTableColumns",get:function(){var e={},t={},n=this.props.t;return null!==localStorage.getItem("projectTable::sorter")&&(t=JSON.parse(localStorage.getItem("projectTable::sorter"))),null!==localStorage.getItem("projectTable::filter")&&(e=JSON.parse(localStorage.getItem("projectTable::filter"))),[{title:n("ID"),dataIndex:"id",key:"id",sorter:function(e,t){return parseInt(e.id,10)-parseInt(t.id,10)},width:100,align:"center",defaultSortOrder:this.getDefaultSort("id",t)},{title:n("Project Number"),dataIndex:"projectNumber",key:"projectNumber",sorter:function(e,t){return"".concat(e.projectNumber).localeCompare("".concat(t.projectNumber))},defaultSortOrder:this.getDefaultSort("projectNumber",t)},{title:n("Project Name"),dataIndex:"name",key:"name",sorter:function(e,t){return e.name.localeCompare(t.name)}},{title:n("Project Lead"),dataIndex:"projectLeader",key:"projectLeader",sorter:function(e,t){return"".concat(e.projectLeader).localeCompare("".concat(t.projectLeader))},filters:this.generateLeaderFilters(),filterIcon:function(){return c.a.createElement(y.a,{className:"Projects_Table_Icon--projectLead",icon:["fal","filter"],id:"projects-filter_lead"})},onFilter:function(e,t){return 0==="".concat(t.projectLeader).indexOf(e)},defaultFilteredValue:e.projectLeader,defaultSortOrder:this.getDefaultSort("projectLeader",t)},{title:n("Department"),dataIndex:"department",key:"department",sorter:function(e,t){return e.department.localeCompare(t.department)},filters:this.generateFilters("department"),filterIcon:function(){return c.a.createElement(y.a,{className:"Projects_Table_Icon--department",icon:["fal","filter"],id:"projects-filter_department"})},onFilter:function(e,t){return 0===t.department.indexOf(e)},defaultFilteredValue:e.department,defaultSortOrder:this.getDefaultSort("department",t)},{title:n("Created"),dataIndex:"createdAt",key:"createdAt",sorter:function(e,t){return new Date(e.createdAt)-new Date(t.createdAt)},defaultSortOrder:this.getDefaultSort("createdAt",t),render:function(e){return e?va()(e).format("YYYY-MM-DD HH:mm"):""}}]}},{key:"projectTableColumnsForDelete",get:function(){var e=this.props.t;return[{title:e("ID"),dataIndex:"id",key:"id",width:100,align:"center"},{title:e("Project Number"),dataIndex:"projectNumber",key:"projectNumber"},{title:e("Project Name"),dataIndex:"name",key:"name"},{title:e("Project Lead"),dataIndex:"projectLeader",key:"projectLeader"},{title:e("Department"),dataIndex:"department",key:"department"},{title:e("Created"),dataIndex:"createdAt",key:"createdAt"}]}},{key:"filterSelectedRowKeys",get:function(){var e=this;return this.state.projectRows.filter((function(t){return e.state.selectedRowKeys.includes(t.id)}))}}]),n}(c.a.PureComponent),lo=Object(f.a)()(xe(Object(d.i)(so))),co=n(551),uo=n(48),po=n.n(uo),go=n(583),ho=n.n(go),mo=(n(2594),function(e){Object(r.a)(a,e);var t=Object(s.a)(a);function a(){var e;Object(o.a)(this,a);for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).state={markdown:""},e.acceptTerms=function(){_.g.sendUpdate({action:"set_termsOfService"})},e.authenticationStoreUpdated=function(t){"updateTermsOfService"===t&&e.props.history.push("/projects")},e.declineTerms=function(){e.props.history.push("/"),M.b.onLogout()},e}return Object(i.a)(a,[{key:"componentDidMount",value:function(){var e=this,t=n(2595);fetch(t).then((function(e){return e.text()})).then((function(t){e.setState({markdown:ho()(t)})})),this.unsubscribeAuthenticationStore=M.b.listen(this.authenticationStoreUpdated)}},{key:"componentWillUnmount",value:function(){this.unsubscribeAuthenticationStore()}},{key:"render",value:function(){var e=this.props.t,t=this.state.markdown;return c.a.createElement(k.i,{cardTitle:"Terms Of Service",horizontalTitle:!0},c.a.createElement("div",{className:"TermsOfService_Card_File_Container"},c.a.createElement("article",{className:"TermsOfService_Card_Article",dangerouslySetInnerHTML:{__html:t}})),c.a.createElement("div",{className:"TermsOfService_Card_Button_Wrapper"},c.a.createElement(h.a,{className:"TermsOfService_Card_Button TermsOfService_Card_Button_Default",type:"default",onClick:this.declineTerms},e("Decline")),c.a.createElement(h.a,{className:"TermsOfService_Card_Button",type:"primary",onClick:this.acceptTerms},e("Accept"))))}}]),a}(po.a.PureComponent)),fo=Object(f.a)()(Object(d.i)(mo)),Ao=n(552),Eo=n(87),To=n.n(Eo),So=n(190),bo=function(){var e=Object(l.useState)(""),t=Object(D.a)(e,2),n=t[0],a=t[1],o=Object(l.useState)(""),i=Object(D.a)(o,2),r=i[0],s=i[1],u=Object(U.a)().t,p=Object(d.g)().push,g=Object(d.h)(),m=g.token,f=g.eMail;return c.a.createElement(k.i,{cardTitle:"New Password"},c.a.createElement(no.a,{onFinish:function(){To.a.post("".concat("https://api.geometra.rukkor.io","/set_password"),{token:m,eMail:f,newPassword:n,confirmedNewPassword:r}),setTimeout((function(){return p("/login")}),500)},name:"password-form"},c.a.createElement("label",{htmlFor:"password",className:"Login_Container_Label"},u("New Password")),c.a.createElement(no.a.Item,{name:"password",rules:[{pattern:So.b,message:u("Password must contain at least 8 characters, special, uppercase, lowercase characters, digit")},{required:!0,message:"Please enter your password"}],validateTrigger:"onBlur"},c.a.createElement(F.a.Password,{className:"Input",value:n,onChange:function(e){return a(e.target.value)},name:"password"})),c.a.createElement("label",{htmlFor:"password",className:"Login_Container_Label"},u("Confirm Password")),c.a.createElement(no.a.Item,{name:"confirmPassword",rules:[{pattern:So.b,message:u("Please enter a valid password")},{required:!0,message:"Password must contain at least 8 characters, special, uppercase, lowercase characters, digit"},function(e){var t=e.getFieldValue;return{validator:function(e,n){return n&&t("password")!==n?Promise.reject(new Error("The two passwords that you entered do not match!")):Promise.resolve()}}}],validateTrigger:"onBlur"},c.a.createElement(F.a.Password,{className:"Input",value:r,onChange:function(e){return s(e.target.value)},name:"confirmPassword"})),c.a.createElement(no.a.Item,null,c.a.createElement(h.a,{className:"LoginWrapper_Card_Button",type:"primary",htmlType:"submit"},u("Set New Password")))))},Io=n(590),yo=n(257),vo=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).state={email:"",password:"",company:"",userName:"",phone:"",requiredFieldFilled:!1},e.handleChange=function(t,n){e.setState(Object(de.a)({},n,t.target.value),(function(){e.state.email.length>0&&e.state.password.length>0?e.setState({requiredFieldFilled:!0}):e.setState({requiredFieldFilled:!1})}))},e.onTryRegister=function(t){To.a.post("".concat("https://api.geometra.rukkor.io","/signup"),{eMail:e.state.email.toLowerCase(),company:e.state.company,name:e.state.userName,password:e.state.password,phone:e.state.phone,language:M.c.getIntlLang()}).then((function(){return e.props.history.push("/login")})).catch((function(e){return Io.a.open({message:c.a.createElement(yo.b,{message:"Error"}),description:c.a.createElement(yo.a,{description:e.response.data}),placement:"bottomRight",className:"Tooltip"})}))},e.onKeyDown=function(){},e}return Object(i.a)(n,[{key:"render",value:function(){var e=this,t=this.props.t;return c.a.createElement(k.i,{cardTitle:"Sign up"},c.a.createElement(no.a,{onFinish:function(t){return e.onTryRegister(t)}},c.a.createElement("label",{htmlFor:"email",className:"Login_Container_Label"},t("Email (required)")),c.a.createElement(no.a.Item,{name:"email",rules:[{pattern:So.a,message:t("Please enter a valid email.")},{required:!0,message:"Please enter your email"}],validateTrigger:"onBlur"},c.a.createElement(F.a,{className:"Input",value:this.state.email,onKeyDown:this.onKeyDown,onChange:function(t){return e.handleChange(t,"email")}})),c.a.createElement("label",{htmlFor:"password",className:"Login_Container_Label"},t("Password (required)")),c.a.createElement(no.a.Item,{name:"password",rules:[{pattern:So.b,message:t("Password must contain at least 8 characters, special, uppercase, lowercase characters, digit")},{required:!0,message:"Please enter your password"}],validateTrigger:"onBlur"},c.a.createElement(F.a.Password,{className:"Input",value:this.state.password,onChange:function(t){return e.handleChange(t,"password")},onKeyDown:this.onKeyDown,name:"password"})),c.a.createElement("label",{htmlFor:"company",className:"Login_Container_Label"},t("Company")),c.a.createElement(no.a.Item,{name:"company"},c.a.createElement(F.a,{className:"Input",value:this.state.company,onKeyDown:this.onKeyDown,onChange:function(t){return e.handleChange(t,"company")}})),c.a.createElement("label",{className:"Login_Container_Label"},t("Name")),c.a.createElement(no.a.Item,{name:"fullName"},c.a.createElement(F.a,{className:"Input",value:this.state.userName,onKeyDown:this.onKeyDown,onChange:function(t){return e.handleChange(t,"userName")}})),c.a.createElement("label",{htmlFor:"phone",className:"Login_Container_Label"},t("Phone")),c.a.createElement(no.a.Item,{name:"phone"},c.a.createElement(F.a,{className:"Input",value:this.state.phone,onKeyDown:this.onKeyDown,onChange:function(t){return e.handleChange(t,"phone")}})),c.a.createElement(no.a.Item,null,c.a.createElement(h.a,{className:"LoginWrapper_Card_Button",type:"primary",htmlType:"submit",disabled:!this.state.requiredFieldFilled},t("Sign Up")))),c.a.createElement(h.a,{className:"LoginWrapper_Card_Button LoginWrapper_Card_Button_Default",type:"link",onClick:function(){return e.props.history.push("/login")}},t("Back to Login")))}}]),n}(po.a.PureComponent),No=Object(f.a)()(Object(d.i)(vo)),Oo=(n(2597),function(e){var t=e.label,n=e.name,a=e.className,o=e.onClick;return c.a.createElement(L.a,{span:8},c.a.createElement("div",{onClick:function(){return o(n)},className:"Card_Button"},c.a.createElement(ee.a,null,c.a.createElement("div",{className:"Flag_Icon_Wrapper"},c.a.createElement("span",{className:"flag-icon Flag_Icon ".concat(a)})),c.a.createElement("div",{className:"Flag_Icon_Name"},c.a.createElement("h5",null,t)))))}),wo=(n(2598),[{label:"English",className:"flag-icon-gb",name:"en"},{label:"Svenska",className:"flag-icon-se",name:"sv"},{label:"Norsk",className:"flag-icon-no",name:"no"},{label:"Danska",className:"flag-icon-dk",name:"da"},{label:"Nederlands",className:"flag-icon-nl",name:"nl"},{label:"Espa\xf1ol, Castellano",className:"flag-icon-es",name:"es"}]),Po=function(e){var t=e.isOpen,n=e.onClose,a=function(e){M.b.setLanguage(e),n()};return c.a.createElement(Cn.a,{visible:t,className:"Select_Language_Modal",width:800},c.a.createElement(R.a,{gutter:[24,24]},c.a.createElement(L.a,{span:24},c.a.createElement("h3",{className:"Select_Language_Title"},"Select language:")),Object(A.map)(wo,(function(e){return c.a.createElement(Oo,{className:e.className,label:e.label,onClick:a,name:e.name,key:e.name})}))))},Ro=function(e){Object(r.a)(n,e);var t=Object(s.a)(n);function n(){var e;Object(o.a)(this,n);for(var a=arguments.length,i=new Array(a),r=0;r<a;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))).state={isSelectLanguageDialogOpen:!1,isSetNewAppVersionDialogOpened:!1},e.authenticationStoreUpdated=function(t){switch(t){case"setNewAppVersion":e.setState({isSetNewAppVersionDialogOpened:!0})}},e.onLanguageModalClose=function(){return e.setState({isSelectLanguageDialogOpen:!1})},e.onNewAppVersionModalClose=function(){return e.setState({isSetNewAppVersionDialogOpened:!1})},e}return Object(i.a)(n,[{key:"componentDidMount",value:function(){if("http:"!==window.location.protocol||Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,REACT_APP_SOCKET_URL:"wss://app-server.geometrasoftware.com",REACT_APP_NODE_SOCKET_RECONNECTION_DELAY_MAX:"10000",REACT_APP_AUTH0_URL:"https://rest-sls.api.geometra.rukkor.io/",REACT_APP_LOCIZE_PROJECT_ID:"3e82a4db-f62c-451e-948f-8951b6bd86ff",REACT_APP_LOCIZE_API_KEY:"3e73a957-5bc9-4274-ac7c-26bd8d4e31aa",REACT_APP_VERSION:"2020-02-dev",REACT_APP_BUCKET_URL:"https://geometra3.s3.eu-west-1.amazonaws.com/",REACT_APP_NODE_SOCKET_RECONNECTION_DELAY:"2000",REACT_APP_FILE_V2_SOCKET_URL:"wss://ws-sls.api.geometra.rukkor.io",REACT_APP_NODE_URL:"https://api.geometra.rukkor.io",REACT_APP_IFC_CONVERSION_BUCKET_URL:"https://rukkor-bimerconverter-out-prod.s3.amazonaws.com/"}).REACT_APP_IS_LOCAL_ENVIROMENT)localStorage.getItem("language")||this.setState({isSelectLanguageDialogOpen:!0});else{var e=window.location.href.replace(/^http:\/\//i,"https://");window.location.href=e}this.unsubscribeAuthenticationStore=M.b.listen(this.authenticationStoreUpdated)}},{key:"componentWillUnmount",value:function(){this.unsubscribeAuthenticationStore()}},{key:"render",value:function(){return c.a.createElement(c.a.Fragment,null,c.a.createElement(Po,{isOpen:this.state.isSelectLanguageDialogOpen,onClose:this.onLanguageModalClose}),c.a.createElement(Cn.a,{visible:this.state.isSetNewAppVersionDialogOpened,title:"New version of app was deployed",onCancel:this.onNewAppVersionModalClose,onOk:function(){return window.location.reload()}},c.a.createElement("p",null,"Would you like to apply new changes?")),c.a.createElement(u.a,null,c.a.createElement(d.d,null,c.a.createElement(d.b,{exact:!0,path:"/login"},c.a.createElement(co.a,null)),c.a.createElement(d.b,{exact:!0,path:"/termsOfService"},c.a.createElement(fo,null)),c.a.createElement(d.b,{exact:!0,path:"/forgot-password/:eMail/:action"},c.a.createElement(Ao.a,null)),c.a.createElement(d.b,{exact:!0,path:"/set-password/:token/:eMail"},c.a.createElement(bo,null)),c.a.createElement(d.b,{exact:!0,path:"/signup"},c.a.createElement(No,null)),c.a.createElement(d.b,{exact:!0,path:"/projects"},c.a.createElement(lo,null)),c.a.createElement(d.b,{exact:!0,path:"/projects/:projectId/overview"},c.a.createElement(to,null)),c.a.createElement(d.b,{exact:!0,path:"/projects/:projectId/drive"},c.a.createElement(Xa,null)),c.a.createElement(d.b,{exact:!0,path:"/projects/:projectId/calculate/:fileId"},c.a.createElement(Qn,null)),c.a.createElement(d.a,{from:"*",to:"/login"}))))}}]),n}(c.a.PureComponent);t.a=Ro},597:function(e,t,n){e.exports=n(598)},598:function(e,t,n){"use strict";n.r(t),function(e){n(599);var t=n(553),a=n(585),o=n(0),i=n.n(o),r=n(75),s=n.n(r),l=n(218),c=n(163);l.b.add(c.i),s.a.render(i.a.createElement(i.a.StrictMode,null,i.a.createElement(a.a,null)),document.getElementById("root")),t.a(),window.process=e,window.process.env=Object({NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,REACT_APP_SOCKET_URL:"wss://app-server.geometrasoftware.com",REACT_APP_NODE_SOCKET_RECONNECTION_DELAY_MAX:"10000",REACT_APP_AUTH0_URL:"https://rest-sls.api.geometra.rukkor.io/",REACT_APP_LOCIZE_PROJECT_ID:"3e82a4db-f62c-451e-948f-8951b6bd86ff",REACT_APP_LOCIZE_API_KEY:"3e73a957-5bc9-4274-ac7c-26bd8d4e31aa",REACT_APP_VERSION:"2020-02-dev",REACT_APP_BUCKET_URL:"https://geometra3.s3.eu-west-1.amazonaws.com/",REACT_APP_NODE_SOCKET_RECONNECTION_DELAY:"2000",REACT_APP_FILE_V2_SOCKET_URL:"wss://ws-sls.api.geometra.rukkor.io",REACT_APP_NODE_URL:"https://api.geometra.rukkor.io",REACT_APP_IFC_CONVERSION_BUCKET_URL:"https://rukkor-bimerconverter-out-prod.s3.amazonaws.com/"})}.call(this,n(103))},599:function(e,t,n){},60:function(e,t,n){"use strict";var a=n(26),o=n.n(a),i=n(47),r=n(155),s=n(230),l=n(153),c=n.n(l),u=n(89),d=n(45),p=n(274),g=n(197),h=n(48),m=n(15),f=n(421),A=n.n(f),E=n(5),T=n(87),S=n.n(T),b=n(37);t.a=Object(h.createStore)({listenables:[r.a],init:function(){this.credentials={username:"",password:"",jwt:null,userId:-1,isLoggedIn:!1,role:""},this.nrReconnectTries=0,this.nrReconnectTriesV2=0,this.activeProjectAtReconnect=void 0,this.activeProjectAtReconnectV2=void 0,this.termsOfService=void 0,this.language=null,this.isNewAppVersion=!1,this.isLogin=!1,this.disconnectAnotherLogins=!1},setIsNewAppVersion:function(e){this.isNewAppVersion=e,this.trigger("setNewAppVersion")},getIsNewAppVersion:function(){return this.isNewAppVersion},setLanguage:function(e){this.language=e,this.trigger("setLanguage")},getLanguage:function(){return this.language},onAuthMessageHandler:function(e){var t=e.action,n=e.payload,a=b.c.LICENSE_ACTIVATED_FROM_ELSEWHERE,o=b.c.SESSION_EXPIRED;switch(t){case a:this.onLogout(),alert(m.a.t("Your license has been activated from elsewhere. You will be logged out.")),window.location.href="/";break;case o:n.expired&&(this.onLogout(),alert(m.a.t("Your session expired. You will be logged out.")),window.location.href="/")}},onSetUserData:function(e){this.termsOfService=e,localStorage.setItem("acceptedTermsOfSerivce",e),this.trigger("setUserData")},onUpdateTermsOfService:function(e){this.termsOfService=e,localStorage.setItem("acceptedTermsOfSerivce",e),this.trigger("updateTermsOfService")},getTermsOfSerive:function(){return"true"===localStorage.getItem("acceptedTermsOfSerivce")},getTermsOfSeriveData:function(){return this.termsOfService},isLoggedIn:function(){return this.credentials.isLoggedIn},getUser:function(){return this.credentials.username},getUserId:function(){return this.credentials.userId},getRole:function(){switch(this.credentials.role){case"creator":return!0;case"viewer":return!1;default:return!0}},getJwt:function(){return this.credentials.jwt||localStorage.getItem("jwt")},onLogin:function(e,t){var n=this;return Object(i.a)(o.a.mark((function a(){return o.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,n.postLogin({username:e,password:t});case 2:n.disconnectAnotherLogins=!0;case 3:case"end":return a.stop()}}),a)})))()},onLoginWithStoredCredentials:function(){var e=this;return Object(i.a)(o.a.mark((function t(){var n;return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=localStorage.getItem("credentials"))||e.isLogin){t.next=7;break}return e.isLogin=!0,e.credentials=A.a.decode(n,"geometra3").credentials,t.next=6,e.postLogin({username:e.credentials.username,token:localStorage.getItem("jwt")});case 6:e.disconnectAnotherLogins=!1;case 7:case"end":return t.stop()}}),t)})))()},postLogin:function(e){var t=this;return Object(i.a)(o.a.mark((function n(){var a,i,r;return o.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return a=e.username,i=e.password,r=e.token,n.next=3,S.a.post("".concat("https://api.geometra.rukkor.io","/login"),{username:a,jwt:r,password:i}).then((function(e){var n=e.data,a=n.role,o=n.userId,i=n.username,r=n.termsOfService;t.credentials.username=i,t.credentials.jwt=e.data.jwt,t.credentials.userId=o,t.credentials.role=a,localStorage.setItem("jwt",e.data.jwt),localStorage.setItem("credentials",A.a.encode({credentials:{username:i,userId:o,date:(new c.a).add(8,"h"),role:a}},"geometra3")),t.credentials.isLoggedIn=!0,t.onSetUserData(r),s.a.requestDepartmentUserAccess(),E.l.onInitSocket(),t.activeProjectAtReconnect&&(d.a.setActiveProjectId(t.activeProjectAtReconnect.get("id")),u.a.requestOpenProject(t.activeProjectAtReconnect.get("id")),t.activeProjectAtReconnect=void 0),t.trigger(e.httpCode)})).catch((function(e){var n;t.isLogin=!1,(null===(n=e.response)||void 0===n?void 0:n.status)&&(t.trigger(String(e.response.status)),401===e.response.status&&"/login"!==window.location.pathname&&(t.onLogout(),window.location.href="/"))}));case 3:case"end":return n.stop()}}),n)})))()},tryReconnectV2:function(){var e=this;this.activeProjectAtReconnectV2||(this.activeProjectAtReconnectV2=d.a.getActiveProject()),this.nrReconnectTriesV2<6&&1!==g.a.getSocketReadyState()?setTimeout((function(){e.nrReconnectTriesV2++,p.a.closeSocket(),p.a.initSocket()}),5e3):(this.resetNrConnectTriesV2(),this.onLogout(),alert(m.a.t("Connection to servers lost.")),window.location.reload(!0))},onLogout:function(){this.credentials={username:"",userId:-1,date:null,role:""},localStorage.removeItem("jwt"),localStorage.removeItem("credentials"),localStorage.removeItem("acceptedTermsOfSerivce"),sessionStorage.clear(),E.l.closeSocket()},resetNrConnectTriesV2:function(){this.nrReconnectTriesV2=0}})},61:function(e,t,n){"use strict";var a=n(34),o=n(30),i=n(28),r=n(0),s=n.n(r),l=n(83),c=n(319),u=n(19),d=n(12),p=n.n(d),g=n(49),h=n(170),m=n(10),f=n(16),A=n(45),E=n(48),T=n(15),S=n(132),b=n(37),I={"x-scale":-2,"y-scale":-1,group:0,Polygon:1,Ellipse:2,"annotation.freeHand":3,FreeHand:3,Freehand:3,freehand:3,freeHand:3,Polyline:4,Arrow:5,Point:6,FreeText:7,Freetext:7,"Free text":7,"Free Text":7,Stamp:8,Comment:9,"3DModel":10};t.a=Object(E.createStore)({listenables:[],init:function(){this.nrVisibleNodes=0,this.treeSelectionKeyList=[],this.currentlySelectedNodes=new m.a.List,this.treeFilter=void 0,this.treeExpansionKeyList=[],this.selectAll=!1,this.selectedFolder=[]},getFileIcon:function(e){switch(e){case"Point":return s.a.createElement(f.a,{icon:["fal","location"]});case"Polyline":return s.a.createElement(f.a,{icon:["fal","arrows-alt-h"]});case"Polygon":return s.a.createElement(f.a,{icon:["fal","draw-polygon"]});case"Ellipse":return s.a.createElement(f.a,{icon:["fal","circle"]});case"Free hand":case"Free Hand":return s.a.createElement(f.a,{icon:["fal","tilde"]});case"Free text":case"Free Text":return s.a.createElement(f.a,{icon:["fal","comment-alt-dots"]});case"Stamp":return s.a.createElement(f.a,{icon:["fal","image"]});case"Arrow":return s.a.createElement(f.a,{icon:["fal","long-arrow-alt-right"]});case"x-scale":return s.a.createElement(f.a,{icon:l.i});case"y-scale":return s.a.createElement(f.a,{icon:l.j});case"group":return s.a.createElement(f.a,{icon:c.b});case"Reduction":return s.a.createElement(f.a,{icon:["fal","object-group"]});case"3DModel":return s.a.createElement(f.a,{icon:["fal","cube"]});default:return s.a.createElement(f.a,{icon:["fal","question"]})}},setTreeFilter:function(e){u.a.setAnnotationTableFilter(e),this.treeFilter=e},toggleTreeFilter:function(){this.treeFilter=!this.treeFilter,u.a.setAnnotationTableFilter(this.treeFilter),this.trigger("toggleTreeFilter")},getNrVisibleNodes:function(){return this.nrVisibleNodes},getTreeFilter:function(){return this.treeFilter},getCurrentlySelectedNodes:function(){return this.currentlySelectedNodes},isSelectAll:function(){return this.selectAll},setTreeSelection:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.treeSelectionKeyList=e,this.selectAll=t},getTreeSelection:function(){return this.treeSelectionKeyList},setTreeExpansion:function(e){this.treeExpansionKeyList=e,this.trigger("treeExpansionUpdated")},setCurrentlySelectedNodes:function(e){u.a.setContextMenuPopupContent(e),this.currentlySelectedNodes=e},getTreeExpansion:function(){return this.treeExpansionKeyList},updateSelection:function(e){this.currentlySelectedNodes=this.currentlySelectedNodes.map((function(t){return e.get("id")===t.get("id")?e:t}))},clearNrVisibleNodes:function(){this.nrVisibleNodes=0},translateToImperialLength:function(e){return"imperial"===A.a.getProjectUnitsByID()?u.a.toUsValue(e):e.toLocaleString(T.a.language,{minimumFractionDigits:3})+" "+T.a.t("meters")},countChildrenStatuses:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.toJS();return t.reduce((function(e,t){return"group"===t.data.type||"Polygon"===t.data.type?p.a.mergeWith(e,t.statuses,(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1?arguments[1]:void 0;return e+t})):t.data.status?Object(i.a)(Object(i.a)({},e),{},Object(o.a)({},t.data.status,(e[t.data.status]||0)+1)):t.data.xfdf.status?Object(i.a)(Object(i.a)({},e),{},Object(o.a)({},t.data.xfdf.status,(e[t.data.xfdf.status]||0)+1)):e}),{notStarted:0,progress:0,review:0,complete:0})},checkNegativeRows:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.toJS();return t.reduce((function(e,t){return t.hasNegativeRow?Object(i.a)(Object(i.a)({},e),{},{hasNegativeRow:!0}):e}),{hasNegativeRow:!1})},buildTree:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=new m.a.List;this.clearNrVisibleNodes();var a=this.getTreeFilter(),o=this.getTreeSelection(),i=h.a.getAppSearch(),r=function n(r,s,l){var c=new m.a.List,d=s.filter((function(e){var t=!1;return a?"group"===e.get("type")?((t=e.get("parentId")==r)||(c=c.push(e)),t):((t=e.get("parentId")==r&&u.a.annotationIsOnFileCurrentPage(e))||(c=c.push(e)),t):((t=e.get("parentId")==r)||(c=c.push(e)),t)})),p=new m.a.List;return d.forEach((function(a){if("group"===a.get("type")){var r=m.a.fromJS({title:a.get("name"),key:a.get("id"),data:a,parent:l});if(t&&o.includes(r.get("key")))for(var s=r.get("parent");s;)t.push(s.get("key")),s=s.get("parent");var d=n(a.get("id"),c,r).sort(e.sortingFunction),h=e.checkNegativeRows(d);r=r.set("folder",!0).set("children",d).set("hasNegativeRow",h.hasNegativeRow).set("statuses",e.countChildrenStatuses(d)),p=p.push(r)}else{var f=!0;if(i&&(!a.get("name")||a.get("name")&&-1==a.get("name").toLowerCase().indexOf(i.toLowerCase()))&&(f=!1),f){var A=m.a.fromJS({title:a.get("name"),icon:e.getFileIcon(a.get("type")),key:a.get("id"),data:a,parent:l,hasNegativeRow:g.a.hasNegativeRowsValue(a.get("id"),a)});if(t&&o.includes(A.get("key")))for(var E=A.get("parent");E;)t.push(E.get("key")),E=E.get("parent");if("Polygon"===a.get("type")){var T=u.a.getReductionByParentAnnotationId(a.get("annotationId")),S={notStarted:0,progress:0,review:0,complete:0};if(S[a.get("status")]=1,T&&T.size>0){var b=T.map((function(t){return m.a.fromJS({title:t.get("name"),icon:e.getFileIcon(t.get("type")),key:t.get("id"),data:t})}));e.nrVisibleNodes+=b.size;var I=b.sort(e.sortingFunction),y=e.countChildrenStatuses(I);y[a.get("status")]=1,A=A.set("children",I).set("folder",!0).set("statuses",y)}else A=A.set("statuses",S).set("folder",!0)}p=p.push(A)}}})),e.nrVisibleNodes+=p.size,p};n=(n=n.concat(r(void 0,u.a.getAnnotations()))).sort(this.sortingFunction);var s=u.a.getAddedAnnotInfo();return"Reduction"===(null===s||void 0===s?void 0:s.type)&&t.push(s.id),m.a.fromJS({treeData:n,expandedKeys:t})},clearSelectedAnnotations:function(){this.calculateTreeSelect([],{selectedNodes:[]})},calculateTreeSelect:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.setTreeSelection(e,n);var a=t.selectedNodes.map((function(e){return e.data}));this.currentlySelectedNodes=m.a.fromJS(a),this.selectedFolder=t.selectedNodes.filter((function(e){return("group"===e.data.type||"3DModel"===e.data.type)&&e})),u.a.deSelectAllAnnotationsFromGui(t.selectedNodes)},calculateTreeSelectOnRightClick:function(e,t){if("group"!==t.node.data.type){this.setTreeSelection(e,!1);var n=[t.node.data];this.currentlySelectedNodes=m.a.fromJS(n),u.a.deSelectAllAnnotationsFromGui([t.node])}else this.calculateTreeCheck(e,Object(i.a)(Object(i.a)({},t),{},{selectedNodes:[t.node]}))},getSelectedFolder:function(){return this.selectedFolder[0]},calculateTreeCheck:function(e,t){var n,o,i,r=(null===t||void 0===t||null===(n=t.nativeEvent)||void 0===n?void 0:n.ctrlKey)||(null===t||void 0===t||null===(o=t.nativeEvent)||void 0===o?void 0:o.metaKey),s=t.selectedNodes.some((function(e){return e.key===t.node.key}));if(u.a.resetAnnotationTypeMap(),s)if(u.a.deSelectAllAnnotationsFromGui(),"group"!==t.node.data.type||(null===t||void 0===t||null===(i=t.nativeEvent)||void 0===i?void 0:i.shiftKey)){var l;e.length<=1&&(u.a.clearSelectedChildren(),u.a.clearSelectedParentFolders());var c=e.length<=1?[]:this.currentlySelectedNodes.toJS();if(this.setTreeSelection(e),null===t||void 0===t||null===(l=t.nativeEvent)||void 0===l?void 0:l.shiftKey){var d=p.a.uniqBy([].concat(Object(a.a)(c),Object(a.a)(p.a.map(t.selectedNodes,(function(e){return e.data})))),"annotationId");this.currentlySelectedNodes=m.a.fromJS(d)}else this.currentlySelectedNodes=m.a.fromJS([].concat(Object(a.a)(c),[t.node.data]));u.a.selectAllAnnotationsFromGui(t.selectedNodes),u.a.setContextMenuPopupContent(this.currentlySelectedNodes)}else{var g=this.currentlySelectedNodes.toJS(),h=g.filter((function(t){return e.some((function(e){return e===t.id}))}));h.length<=1&&u.a.clearSelectedParentFolders(),u.a.setSelectedParentFolders(t.node.data);var f=h.length<=1?[]:g;r&&1===h.length&&h[0].id!==t.node.data.id&&(f.push(h[0]),"group"===h[0].type&&u.a.setSelectedParentFolders(h[0]));var A=u.a.getAllAnnotationsFromParent(t.node.data.id).toJS().map((function(e){if(f.push(e),"Polygon"===e.type){var t=u.a.getReductionByParentAnnotationId(e.annotationId).toJS();return t.length>0?t.map((function(e){return f.push(e),e.id})).concat(e.id):e.id}return e.id})),E=Object(a.a)(new Set(A.concat(e).flat()));f.push(t.node.data);var T=f.filter((function(e){return"group"!==e.type}));u.a.setSelectFolderAnnotations(T),this.currentlySelectedNodes=m.a.fromJS(p.a.uniqBy(f,"id")),this.setTreeSelection(E),u.a.selectAllAnnotationsFromGui(t.selectedNodes),u.a.setContextMenuPopupContent(this.currentlySelectedNodes)}else if("group"===t.node.data.type){var S=u.a.getAllAnnotationsFromParent(t.node.data.id).toJS().map((function(e){if("Polygon"===e.type){var t=u.a.getReductionByParentAnnotationId(e.annotationId).toJS();return t.length>0?t.map((function(e){return e.id})).concat(e.id):e.id}return e.id})),b=e.filter((function(e){return-1==S.indexOf(e)})),I=t.selectedNodes.filter((function(e){return b.some((function(t){return t===e.key}))})),y=I.map((function(e){return e.data})),v=u.a.getSelectedChildren().filter((function(e){return b.some((function(t){return t===e.id}))}));u.a.setSelectFolderAnnotations(v),u.a.switchRotationControlEnabled(this.currentlySelectedNodes,!1),this.currentlySelectedNodes=m.a.fromJS(y),u.a.setContextMenuPopupContent(this.currentlySelectedNodes),this.setTreeSelection(b),0===b.length?(u.a.clearSelectedParentFolders(),u.a.deSelectAllAnnotationsFromGui()):(u.a.deSelectAllAnnotationsFromGui(),u.a.selectAllAnnotationsFromGui(I))}else if(this.setTreeSelection(e),u.a.switchRotationControlEnabled(this.currentlySelectedNodes,!1),this.currentlySelectedNodes=this.currentlySelectedNodes.filter((function(e){return e.get("id")!==t.node.data.id})),u.a.setContextMenuPopupContent(this.currentlySelectedNodes),r){var N=t.selectedNodes.filter((function(t){return e.some((function(e){return e===t.key}))}));u.a.deSelectAllAnnotationsFromGui(),u.a.selectAllAnnotationsFromGui(N)}else u.a.deSelectAnnotationFromGui(m.a.fromJS(t.node.data))},deselectAnnotationsFromList:function(e){var t=this;try{if(this.selectAll=!1,0===e.size)return u.a.switchRotationControlEnabled(this.currentlySelectedNodes,!1),this.currentlySelectedNodes=this.currentlySelectedNodes.clear(),u.a.setContextMenuPopupContent(this.currentlySelectedNodes),void(this.treeSelectionKeyList=[]);e.forEach((function(e){e&&(u.a.switchRotationControlEnabled(t.currentlySelectedNodes,!1),t.currentlySelectedNodes=t.currentlySelectedNodes.filter((function(n){var a;return(a=e.get("annotationId")?e.get("annotationId")!==n.get("annotationId"):e.get("id")!==n.get("id"))||(t.treeSelectionKeyList=t.treeSelectionKeyList.filter((function(e){return"x-scale"===n.get("type")||"y-scale"===n.get("type")?e!==n.get("type"):e!==n.get("id")}))),a})),u.a.setContextMenuPopupContent(t.currentlySelectedNodes))}))}catch(n){console.log("Error | Removing from selection: "+n)}},selectAnnotationsFromList:function(e,t,n){var o=this;this.currentlySelectedNodes=this.currentlySelectedNodes.concat(e),u.a.setContextMenuPopupContent(this.currentlySelectedNodes),this.treeSelectionKeyList=this.treeSelectionKeyList.concat(t.toJS());var i=!1;this.selectAll=!!n,e.forEach((function(e){var t=o.treeRef.current.state.keyEntities[e.get("id")];if(t&&o.treeSelectionKeyList.includes(e.get("id")))for(var n=t.parent;n;)o.treeExpansionKeyList.includes(n.key)||(i=!0,o.treeExpansionKeyList.push(n.key)),n=n.parent})),i&&(this.treeExpansionKeyList=Object(a.a)(this.treeExpansionKeyList))},setTreeRef:function(e){this.treeRef=e},isBranchParentSelected:function(e,t){if(-1===e.parent)return!1;for(;e.parent&&t;)if(e=e.parent,t.find((function(t){return t.data.id===e.data.id})))return!0;return!1},getAnnotationSortingMode:function(){return localStorage.getItem("annotationTreeSorting")||localStorage.setItem("annotationTreeSorting","type-number-name"),localStorage.getItem("annotationTreeSorting")},sortingFunction:function(e,t){var n=e.get("data"),a=t.get("data");if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;var o=I[n.get("type").replace(" ","")],i=I[a.get("type").replace(" ","")];if(i<=0||o<=0){if(i>o)return-1;if(i<o)return 1}switch(this.getAnnotationSortingMode()){case"type-number-name":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;var r=I[n.get("type").replace(" ","")],s=I[a.get("type").replace(" ","")];if(r>s)return 1;if(r<s)return-1;if(n.get("number")&&a.get("number")){var l=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(l&&0!==l)return l}if(n.get("name")&&a.get("name")){var c=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(c&&0!==c)return c}return 0;case"type-name-number":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;var u=I[n.get("type").replace(" ","")],d=I[a.get("type").replace(" ","")];if(u>d)return 1;if(u<d)return-1;if(n.get("name")&&a.get("name")){var p=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(p&&0!==p)return p}if(n.get("number")&&a.get("number")){var g=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(g&&0!==g)return g}return 0;case"number-name-type":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("number")&&a.get("number")){var h=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(h&&0!==h)return h}if(n.get("name")&&a.get("name")){var m=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(m&&0!==m)return m}var f=I[n.get("type").replace(" ","")],A=I[a.get("type").replace(" ","")];return f>A?1:f<A?-1:0;case"number-type-name":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("number")&&a.get("number")){var E=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(E&&0!==E)return E}var T=I[n.get("type").replace(" ","")],S=I[a.get("type").replace(" ","")];if(T>S)return 1;if(T<S)return-1;if(n.get("name")&&a.get("name")){var b=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(b&&0!==b)return b}return 0;case"name-number-type":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("name")&&a.get("name")){var y=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(y&&0!==y)return y}if(n.get("number")&&a.get("number")){var v=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(v&&0!==v)return v}var N=I[n.get("type").replace(" ","")],O=I[a.get("type").replace(" ","")];return N>O?1:N<O?-1:0;case"name-type-number":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("name")&&a.get("name")){var w=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(w&&0!==w)return w}var P=I[n.get("type").replace(" ","")],R=I[a.get("type").replace(" ","")];if(P>R)return 1;if(P<R)return-1;if(n.get("number")&&a.get("number")){var L=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(L&&0!==L)return L}return 0;case"type-number":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;var C=I[n.get("type").replace(" ","")],_=I[a.get("type").replace(" ","")];if(C>_)return 1;if(C<_)return-1;if(n.get("number")&&a.get("number")){var M=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(M&&0!==M)return M}return 0;case"type-name":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;var k=I[n.get("type").replace(" ","")],D=I[a.get("type").replace(" ","")];if(k>D)return 1;if(k<D)return-1;if(n.get("name")&&a.get("name")){var x=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(x&&0!==x)return x}return 0;case"number-type":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("number")&&a.get("number")){var F=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(F&&0!==F)return F}var j=I[n.get("type").replace(" ","")],V=I[a.get("type").replace(" ","")];return j>V?1:j<V?-1:0;case"number-name":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("number")&&a.get("number")){var U=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(U&&0!==U)return U}if(n.get("name")&&a.get("name")){var W=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(W&&0!==W)return W}return 0;case"name-type":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("name")&&a.get("name")){var B=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(B&&0!==B)return B}var H=I[n.get("type").replace(" ","")],J=I[a.get("type").replace(" ","")];return H>J?1:H<J?-1:0;case"name-number":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("name")&&a.get("name")){var z=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(z&&0!==z)return z}if(n.get("number")&&a.get("number")){var G=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(G&&0!==G)return G}return 0;case"type":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;var q=I[n.get("type").replace(" ","")],X=I[a.get("type").replace(" ","")];return q>X?1:q<X?-1:0;case"number":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("number")&&a.get("number")){var Y=n.get("number").localeCompare(a.get("number"),void 0,{numeric:!0});if(Y&&0!==Y)return Y}return 0;case"name":if(!n.isEmpty()&&a.isEmpty())return-1;if(n.isEmpty()&&!a.isEmpty())return 1;if(n.isEmpty()&&a.isEmpty())return 0;if(n.get("name")&&a.get("name")){var K=n.get("name").localeCompare(a.get("name"),void 0,{numeric:!0});if(K&&0!==K)return K}return 0}},onDrop:function(e,t){var n=t.node.data,o=new DOMParser,i=new m.a.List,r=new Set;if(e.length>0)e.map((function(e){if(e.id!==t.node.data.id){if("3DModel"===e.type)return void(i=i.push(m.a.fromJS(e)));if("group"===e.type){var n=u.a.getAllAnnotationsFromParent(e.id).map((function(e){return e.get("id")})).toJS();r=new Set([].concat(Object(a.a)(r),Object(a.a)(n))),i=i.push(m.a.fromJS(e))}else{if("Reduction"===e.type)return;"true"!==o.parseFromString(e.xfdf,"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&(i=i.push(m.a.fromJS(e)))}}}));else{var s=t.dragNode.data;if(s.id!==t.node.data.id)if("group"===s.type){var l=u.a.getAllAnnotationsFromParent(s.id).map((function(e){return e.get("id")})).toJS();r=new Set([].concat(Object(a.a)(r),Object(a.a)(l))),i=i.push(m.a.fromJS(s))}else if("3DModel"===s.type)s.xfdf.readOnly||(i=i.push(m.a.fromJS(s)));else{"true"!==o.parseFromString(s.xfdf,"text/xml").querySelector("annots").firstElementChild.getAttribute("readOnly")&&(i=i.push(m.a.fromJS(s)))}}var c=i.filter((function(e){return Object(a.a)(r).every((function(t){return t!==e.get("id")}))})).map((function(e){return e.get("id")})).toJS();if("group"===n.type){var d,p,g=-1===t.dropPosition?(null===n||void 0===n||null===(d=n.parentId)||void 0===d?void 0:d.toString())||null:(null===n||void 0===n||null===(p=n.id)||void 0===p?void 0:p.toString())||null;return S.a.onSendMessage(b.f.GEO_ANNOTATION,{action:b.a.UPDATE,ids:c,parameter:"parentId",value:g})}return t.node.parent?S.a.onSendMessage(b.f.GEO_ANNOTATION,{action:b.a.UPDATE,ids:c,parameter:"parentId",value:t.node.parent.data.id}):c.length>0?S.a.onSendMessage(b.f.GEO_ANNOTATION,{action:b.a.UPDATE,ids:c,parameter:"parentId",value:null}):void 0},onDeleteFilesHandler:function(e){this.currentlySelectedNodes=this.currentlySelectedNodes.filter((function(t){return e.every((function(e){return e!==t.getIn(["geoFile","id"])}))}))}})},622:function(e,t){},655:function(e,t){},657:function(e,t){},669:function(e,t){},671:function(e,t){},696:function(e,t){},698:function(e,t){},699:function(e,t){},705:function(e,t){},707:function(e,t){},725:function(e,t){},727:function(e,t){},739:function(e,t){},74:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return u})),n.d(t,"i",(function(){return d})),n.d(t,"f",(function(){return p})),n.d(t,"h",(function(){return g})),n.d(t,"e",(function(){return h})),n.d(t,"d",(function(){return m})),n.d(t,"g",(function(){return f})),n.d(t,"c",(function(){return A}));var a,o=n(30),i=n(12),r=n(5),s=n(4),l=n(105),c=["edit","workflow","ifc-styles","visuals","values"],u=["length","edit","visuals","workflow","area","reduction","ellipse","arrow","point","scale","draw","text","image-styles","line","draw","sizePlacement","values"],d=(a={},Object(o.a)(a,s.i.VISIBLE,"Visible"),Object(o.a)(a,s.i.NUMBER,"Nr/Tag"),Object(o.a)(a,s.i.NAME,"Name"),Object(o.a)(a,s.i.VARIABLES,"Variables"),Object(o.a)(a,s.i.REDUCTION,"Reduction"),Object(o.a)(a,s.i.AREA,"Area"),Object(o.a)(a,s.i.LENGTH,"Length"),Object(o.a)(a,s.i.LENGTHS,"Lengths"),Object(o.a)(a,s.i.SCALE_LENGTH,"Scale Length"),Object(o.a)(a,s.i.VOLUME,"Volume"),Object(o.a)(a,s.i.TOTAL_WALL,"Wall"),Object(o.a)(a,s.i.WALLS,"Walls"),Object(o.a)(a,s.i.TURN_OFF_FILL,"Fill"),Object(o.a)(a,s.i.NET_AREA,"Net: Area"),Object(o.a)(a,s.i.NET_LENGTH,"Net: Length"),Object(o.a)(a,s.i.NET_VOLUME,"Net: Volume"),Object(o.a)(a,s.i.TOTAL_NET_WALL,"Net: Wall"),a),p=function(e){var t=[];switch(e){case"annotation.freeHand":case"Free Hand":case"Free hand":t=[s.i.VISIBLE,s.i.NUMBER,s.i.NAME,s.i.VARIABLES,s.i.AREA,s.i.LENGTH,s.i.VOLUME,s.i.TOTAL_WALL,s.i.TURN_OFF_FILL,s.i.NET_AREA,s.i.NET_LENGTH,s.i.NET_VOLUME,s.i.TOTAL_NET_WALL];break;case"Polygon":t=[s.i.VISIBLE,s.i.NUMBER,s.i.NAME,s.i.VARIABLES,s.i.REDUCTION,s.i.AREA,s.i.LENGTH,s.i.LENGTHS,s.i.VOLUME,s.i.TOTAL_WALL,s.i.WALLS,s.i.TURN_OFF_FILL,s.i.NET_AREA,s.i.NET_LENGTH,s.i.NET_VOLUME,s.i.TOTAL_NET_WALL];break;case"Reduction":t=[s.i.VISIBLE,s.i.NUMBER,s.i.NAME,s.i.AREA,s.i.NET_AREA,s.i.LENGTH,s.i.NET_LENGTH,s.i.LENGTHS,s.i.VOLUME,s.i.NET_VOLUME,s.i.WALLS,s.i.TOTAL_WALL,s.i.TOTAL_NET_WALL,s.i.VARIABLES,s.i.TURN_OFF_FILL];break;case"Ellipse":t=[s.i.VISIBLE,s.i.NUMBER,s.i.NAME,s.i.VARIABLES,s.i.AREA,s.i.LENGTH,s.i.VOLUME,s.i.TOTAL_WALL,s.i.TURN_OFF_FILL,s.i.NET_AREA,s.i.NET_LENGTH,s.i.NET_VOLUME,s.i.TOTAL_NET_WALL];break;case"Polyline":t=[s.i.VISIBLE,s.i.NUMBER,s.i.NAME,s.i.VARIABLES,s.i.LENGTHS,s.i.WALLS];break;case"Free text":case"Stamp":case"Arrow":t=[s.i.VISIBLE];break;case"scale":case"x-scale":case"y-scale":t=[s.i.SCALE_LENGTH];break;case"Point":t=[s.i.VISIBLE,s.i.NUMBER,s.i.NAME]}return t},g=function(e){var t=e.type,n=e.key,a=e.selectedAnnotations;if("function"!==typeof a.toJS)return"";var o=a.toJS(),i=[];if((i="*"===t?o.filter((function(e){return"group"!==e.type})):o.filter((function(e){return e.type===t}))).length<=0)return"";"Free Text"!==t||"textContents"!==n&&"fontSize"!==n||i.forEach((function(e){var t=r.a.parseAnnotationTextContentsAndFontSizeFromXfdf(e.xfdf);e.fontSize=t.fontSize,e.textContents=t.textContents}));var c=new l.a,u=(i=i.map((function(e){var a=e.xfdf;switch(e.xdf&&(a=e.xdf),n){case"Style":return r.a.parseStyleFromXfdf(a);case"x":return c.getCenterPointFromXfdf(a)[0];case"y":return c.getCenterPointFromXfdf(a)[1];case"rectX2":return c.getRectFromXfdf(a)[2];case"rectY2":return c.getRectFromXfdf(a)[3];case"rectX1":return c.getRectFromXfdf(a)[0];case"rectY1":return c.getRectFromXfdf(a)[1];case"NoView":return r.a.parseAnnotationFlagsFromXfdf(a).indexOf("noview")>-1;case"font":return r.a.parseDefaultStyleFromXfdf(a).font;case"TextAlign":return r.a.parseDefaultStyleFromXfdf(a)[s.L];case"richTextStyle":return r.a.parseRichTextStyleFromXfdf(a);default:return console.log("NoValue",t,n,e),null}})))[0];return i.every((function(e){return e===u}))?u:""},h=function(e){var t=e.type,n=e.key,a=e.selectedAnnotations;if("function"!==typeof a.toJS)return"";var o=a.toJS(),i=[];if((i="*"===t?o.filter((function(e){return"group"!==e.type})):o.filter((function(e){return e.type===t}))).length<=0)return"";var l=(i=i.map((function(e){if(e[n])return e[n];var a=e.xfdf;return e.xdf&&(a=e.xdf),t===s.v?a[n]:r.a.parseValueFromXfdf(a,n)})))[0];return i.every((function(e){return e===l}))?l:""},m=function(e){var t=new DOMParser,n=Object(i.filter)(e.toJS(),(function(e){return"Ellipse"===e.type||"Free hand"===e.type||"Stamp"===e.type}));return!!n.length&&Object(i.every)(n,(function(e){var n=e.xfdf;return"true"===t.parseFromString(n,"text/xml").querySelector("annots").children[0].getAttribute("maintainAspectRatio")||!1}))},f=function(e,t,n){var a=r.o.getScale(e,n);return"style"===t&&a?(new DOMParser).parseFromString(a.xdf,"text/xml").querySelector("annots").children[0].getAttribute("style"):"width"===t&&a?a.width?Object(i.get)(a,t):a.strokeSize?Object(i.get)(a,"strokeSize"):void 0:Object(i.get)(a,t)},A=function(e){if(e){var t=new DOMParser;if(e.type===s.O||e.type===s.P){var n=e.xdf;return"true"===t.parseFromString(n,"text/xml").querySelector("annots").children[0].getAttribute("readOnly")||!1}var a=Object(i.filter)(e.toJS(),(function(e){return"group"!==e.type}));return!!a.length&&Object(i.every)(a,(function(e){if("3DModel"===e.type)return e.xfdf.readOnly;var n=e.xfdf||e.xdf;return"true"===t.parseFromString(n,"text/xml").querySelector("annots").children[0].getAttribute("readOnly")||!1}))}return!1}},742:function(e,t){},745:function(e,t,n){},755:function(e,t,n){},756:function(e,t,n){},757:function(e,t,n){},758:function(e,t,n){},759:function(e,t,n){},77:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o}));var a={insertArray:"insert_array",updateArray:"update_array",selectArray:"select_array",select:"select",update:"update",insert:"insert",delete:"delete",move:"move",login:"login",heartbeat:"heartbeat",openProject:"openProject",closeProject:"closeProject",requestNewPassword:"requestNewPassword",licenseTaken:"licenseTaken",importAnnotations:"importAnnotations"},o={OK:"200",UN_AUTHORIZED:"401",PAYMENT_REQUIRED:"402",TOO_MANY_REQUESTS:"429",jwtParsing:"492"}},81:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return o})),n.d(t,"c",(function(){return i}));var a=[10,10],o=[1,1],i=[1,10,1]},832:function(e,t,n){},833:function(e,t,n){},834:function(e,t,n){},836:function(e,t,n){},838:function(e,t,n){},839:function(e,t,n){},840:function(e,t,n){},841:function(e,t,n){},842:function(e,t,n){e.exports=n.p+"static/media/CHANGELOG.bebf837a.md"},845:function(e,t,n){},846:function(e,t,n){},847:function(e,t,n){},848:function(e,t,n){},849:function(e,t,n){},850:function(e,t,n){},851:function(e,t,n){},852:function(e,t,n){},853:function(e,t,n){},854:function(e,t,n){},855:function(e,t,n){},856:function(e,t,n){},857:function(e,t,n){},858:function(e,t,n){},859:function(e,t,n){},86:function(e,t,n){"use strict";n.d(t,"a",(function(){return a}));var a={FREE_ORBIT:0,PAN:1,ZOOM:2,FIRST_PERSON:3,LINK:4}},860:function(e,t,n){},861:function(e,t,n){},89:function(e,t,n){"use strict";var a=n(48),o=Object(a.createActions)(["requestProjects","requestProject","requestOpenProject","requestCloseProject","requestInsertNewProject","requestDeleteProject","messageReceived","requestUpdateProject"]);t.a=o},92:function(e,t,n){"use strict";var a=n(26),o=n.n(a),i=n(47),r=n(60),s=n(230),l=n(10),c=n(12),u=n.n(c),d=n(48),p=n(87),g=n.n(p);t.a=Object(d.createStore)({listenables:[s.a],init:function(){this.fileDepartmentUserAccess=new l.a.Map,this.departmentUserAccess=new l.a.List,this.departmentUserList=new l.a.List},getAccessibleDeparments:function(){return this.departmentUserAccess},getDepartmentUserById:function(e){return this.departmentUserList.find((function(t){return t.get("id")===e}))},getSelectedDepartmentId:function(){return this.selectedDepartmentId},setSelectedDepartmentId:function(e){this.selectedDepartmentId=e,this.trigger("departmentSelectionUpdated")},onRequestDepartmentUserAccess:function(){var e=this;return Object(i.a)(o.a.mark((function t(){return o.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,g.a.get("".concat("https://api.geometra.rukkor.io","/departments"),{headers:{Authorization:r.a.getJwt()}}).then((function(t){if(e.departmentUserAccess=l.a.List.of(t.data).flatMap((function(e){return e})),e.selectedDepartmentId=(e.departmentUserAccess.first()||{department:{}}).department.id,e.departmentUserList=l.a.fromJS(u.a.uniqBy(e.departmentUserAccess.flatMap((function(e){return u.a.clone(e.departmentUsers)})).toArray(),"id")),e.trigger("departmentUserAccessRecieved"),window.Tawk_API&&window.Tawk_API.onLoaded){var n=e.departmentUserList.find((function(e){return e.get("id")===r.a.credentials.userId}));window.Tawk_API.setAttributes({email:r.a.credentials.username,name:"".concat(n.get("firstName")," ").concat(n.get("lastName"))})}}));case 2:case"end":return t.stop()}}),t)})))()},onInitializeDepartmentUserAccess:function(e){this.fileDepartmentUserAccess=new l.a.Map(e)}})},99:function(e,t,n){"use strict";var a=n(26),o=n.n(a),i=n(47),r=n(25),s=n(29),l=n(19),c=n(60),u=function(){function e(t){Object(r.a)(this,e),this.parentId=t,this.centerAnnotation=void 0,this.centerAnnotationPdf=void 0,this.peripheralAnnotations=void 0,this.peripheralAnnotationsPdf=void 0}return Object(s.a)(e,[{key:"setCenterAnnotation",value:function(e){this.centerAnnotation=e}},{key:"getCenterAnnotation",value:function(){return this.centerAnnotation}},{key:"setCenterAnnotationPdf",value:function(e){this.centerAnnotationPdf=e}},{key:"getCenterAnnotationPdf",value:function(){return this.centerAnnotationPdf}},{key:"setPeripheralAnnotations",value:function(e){this.peripheralAnnotations=e}},{key:"getPeripheralAnnotations",value:function(){return this.peripheralAnnotations}},{key:"setPeripheralAnnotationsPdf",value:function(e){this.peripheralAnnotationsPdf=e}},{key:"getPeripheralAnnotationsPdf",value:function(){return this.peripheralAnnotationsPdf}},{key:"remove",value:function(e){return"CenterValue"===e.get("type")?(this.centerAnnotation=void 0,this.centerAnnotationPdf=void 0):"PeripheralValue"===e.get("type")&&(this.peripheralAnnotationsPdf=void 0,this.peripheralAnnotations=void 0),!this.centerAnnotation&&!this.centerAnnotationPdf&&!this.peripheralAnnotationsPdf&&!this.peripheralAnnotations}}]),e}(),d=n(105),p=n(10),g=n(18),h=function(){function e(){Object(r.a)(this,e)}return Object(s.a)(e,[{key:"getValueStateBygType",value:function(e){var t;switch(e){case"annotation.freeHand":case"Free Hand":case"Free hand":t=[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.VOLUME,g.a.NET_VOLUME,g.a.TOTAL_WALL,g.a.TOTAL_NET_WALL,g.a.VARIABLES,g.a.TURN_OFF_FILL];break;case"Polygon":t=[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.LENGTHS,g.a.VOLUME,g.a.NET_VOLUME,g.a.WALLS,g.a.TOTAL_WALL,g.a.TOTAL_NET_WALL,g.a.VARIABLES,g.a.REDUCTION,g.a.TURN_OFF_FILL];break;case"Reduction":t=[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.LENGTHS,g.a.VOLUME,g.a.NET_VOLUME,g.a.WALLS,g.a.TOTAL_WALL,g.a.TOTAL_NET_WALL,g.a.VARIABLES,g.a.TURN_OFF_FILL];break;case"Ellipse":t=[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.VOLUME,g.a.NET_VOLUME,g.a.WALL,g.a.NET_WALL,g.a.VARIABLES,g.a.TURN_OFF_FILL];break;case"Polyline":t=[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.LENGTHS,g.a.WALLS,g.a.VARIABLES];break;case"Stamp":case"Arrow":t=[];break;case"Point":t=[g.a.VISIBLE,g.a.NUMBER,g.a.NAME];break;case"Free text":t=[g.a.VISIBLE];break;case"x-scale":case"y-scale":t=[g.a.SCALE_LENGTH];break;default:t=[]}return t}},{key:"getDisplayValuesByTypeAndPlacement",value:function(e){var t={};return t.centerValues=this.getCenterValuesBygType(e),t.peripheralValues=this.getPeripheralValuesBygType(e),t}},{key:"getCenterValuesBygType",value:function(e){switch(e){case"Polygon":case"Reduction":return[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.VOLUME,g.a.NET_VOLUME,g.a.TOTAL_WALL,g.a.TOTAL_NET_WALL,g.a.VARIABLES,g.a.REDUCTION];case"Point":return[g.a.NUMBER,g.a.NAME];case"annotation.freeHand":case"Free Hand":case"Free hand":return[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.VOLUME,g.a.NET_VOLUME,g.a.TOTAL_WALL,g.a.TOTAL_NET_WALL,g.a.VARIABLES];case"Ellipse":return[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.AREA,g.a.NET_AREA,g.a.LENGTH,g.a.NET_LENGTH,g.a.VOLUME,g.a.NET_VOLUME,g.a.WALL,g.a.NET_WALL,g.a.VARIABLES];case"Polyline":return[];case"Free text":case"Stamp":case"Arrow":return[];case"x-scale":case"y-scale":return[g.a.SCALE_LENGTH];default:return[]}}},{key:"getPeripheralValuesBygType",value:function(e){switch(e){case"Polygon":case"Reduction":return[g.a.VISIBLE,g.a.LENGTHS,g.a.WALLS,g.a.VARIABLES];case"Point":return[];case"annotation.freeHand":case"Free Hand":case"Free hand":case"Ellipse":return[];case"Polyline":return[g.a.VISIBLE,g.a.NUMBER,g.a.NAME,g.a.LENGTHS,g.a.WALLS,g.a.VARIABLES];case"Free text":return[g.a.VISIBLE];case"Stamp":case"Arrow":return[];case"x-scale":case"y-scale":default:return[]}}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}(),m=n(212),f=function(){function e(){Object(r.a)(this,e),this.displayValueAnnotations={}}return Object(s.a)(e,[{key:"getDisplayValueAnnotations",value:function(e){return this.displayValueAnnotations[e]}},{key:"setDisplayValueAnnotations",value:function(e,t){this.displayValueAnnotations[e]=t}},{key:"addDisplayAnnotations",value:function(e,t){var n,a=!1;t.Id?(a=!0,n=t.Subject):n=t.get("type");var o=this.getDisplayValueAnnotations(e);if(o||(o=new u(e)),"CenterValue"===n)if(a)o.setCenterAnnotationPdf(t);else try{o.setCenterAnnotation(t),this.setDisplayValueAnnotations(e,o)}catch(s){console.log("error "+s.stack)}else if(a){var i=o.getPeripheralAnnotationsPdf();i||(i=new p.a.List),i=i.find((function(e){return e.Id===t.Id}))?i.map((function(e){return e.Id===t.Id?t:e})):i.push(t),o.setPeripheralAnnotationsPdf(i),this.setDisplayValueAnnotations(e,o)}else{var r=o.getPeripheralAnnotations();r||(r=new p.a.List),r=r.find((function(e){return e.get("id")===t.get("id")}))?r.map((function(e){return e.get("id")===t.get("id")?t:e})):r.push(t),o.setPeripheralAnnotations(r),this.setDisplayValueAnnotations(e,o)}}},{key:"removeDisplayAnnotations",value:function(e,t){var n=this.getDisplayValueAnnotations(e);n&&n.remove(t)&&this.setDisplayValueAnnotations(e,void 0)}},{key:"handleDisplayValueChange",value:function(){var e=Object(i.a)(o.a.mark((function e(t,n){var a;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.checkValueDisplayAnnotations(n,t);case 2:(a=e.sent).get("annotationsToUpdate").size>0&&(a.get("displayAnnotationsToInsert").size>0&&l.a.onRequestValuesCreate(a.get("displayAnnotationsToInsert").toJS()),a.get("displayAnnotationsToDelete").size>0&&l.a.onRequestAnnotationDelete(a.get("displayAnnotationsToDelete")));case 4:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"checkValueDisplayAnnotations",value:function(){var e=Object(i.a)(o.a.mark((function e(t,n){var a,i,r,s,l,c,u,d,h,m,f,A,E,T,S;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=p.a.fromJS({displayAnnotationsToDelete:new p.a.List,displayAnnotationsToInsert:new p.a.List,annotationsToUpdate:new p.a.List}),i=t.size,r=0;case 3:if(!(r<i)){e.next=43;break}if("group"===t.get(r)){e.next=40;break}if(s=t.get(r),!(l=this.updateAnnotation(s,n))){e.next=40;break}if(c=s.get("annotationId"),a=a.set("annotationsToUpdate",a.get("annotationsToUpdate").push(p.a.fromJS({id:c,data:l.data}))),u=this.getDisplayValueAnnotations(c),d=l.displayValueList,h=l.activeCenter,m=l.activePeripheral,!d.toJS().find((function(e){return e===g.a.VISIBLE}))){e.next=19;break}u&&u.getCenterAnnotation()&&(f=u.getCenterAnnotation(),a=a.set("displayAnnotationsToDelete",a.get("displayAnnotationsToDelete").push(f))),u&&u.getPeripheralAnnotations()&&u.getPeripheralAnnotations().forEach((function(e){a=a.set("displayAnnotationsToDelete",a.get("displayAnnotationsToDelete").push(e))})),e.next=40;break;case 19:if(!(d.size>0)){e.next=38;break}if(!h||u&&u.getCenterAnnotation()){e.next=27;break}return e.next=23,this.getDisplayAnnotationsByAnnotationType(s,"center");case 23:A=e.sent,a=a.set("displayAnnotationsToInsert",a.get("displayAnnotationsToInsert").push(A)),e.next=28;break;case 27:!h&&u&&u.getCenterAnnotation()&&(E=u.getCenterAnnotation(),a=a.set("displayAnnotationsToDelete",a.get("displayAnnotationsToDelete").push(E)));case 28:if(!m||u&&u.getPeripheralAnnotations()){e.next=35;break}return e.next=31,this.getDisplayAnnotationsByAnnotationType(s,"peripheral");case 31:T=e.sent,a=a.set("displayAnnotationsToInsert",a.get("displayAnnotationsToInsert").concat(T)),e.next=36;break;case 35:!m&&u&&u.getPeripheralAnnotations()&&u.getPeripheralAnnotations().forEach((function(e){a=a.set("displayAnnotationsToDelete",a.get("displayAnnotationsToDelete").push(e))}));case 36:e.next=40;break;case 38:u&&u.getCenterAnnotation()&&(S=u.getCenterAnnotation(),a=a.set("displayAnnotationsToDelete",a.get("displayAnnotationsToDelete").push(S))),u&&u.getPeripheralAnnotations()&&u.getPeripheralAnnotations().forEach((function(e){a=a.set("displayAnnotationsToDelete",a.get("displayAnnotationsToDelete").push(e))}));case 40:r++,e.next=3;break;case 43:return e.abrupt("return",a);case 44:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getDisplayAnnotationsByAnnotationType",value:function(){var e=Object(i.a)(o.a.mark((function e(t,n){return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.get("type"),e.next="Polygon"===e.t0||"Reduction"===e.t0?3:"Point"===e.t0?14:"annotation.freeHand"===e.t0||"Free Hand"===e.t0||"Free hand"===e.t0?17:"Ellipse"===e.t0?20:"Polyline"===e.t0?23:"x-scale"===e.t0||"y-scale"===e.t0?26:"Free text"===e.t0||"Stamp"===e.t0||"Arrow"===e.t0?29:30;break;case 3:if("center"!==n){e.next=9;break}return e.next=6,this.getCenterDisplayAnnotationXFDF(t);case 6:return e.abrupt("return",e.sent);case 9:if("peripheral"!==n){e.next=13;break}return e.next=12,this.getPeripheralDisplayAnnotationsXFDFS(t);case 12:return e.abrupt("return",e.sent);case 13:return e.abrupt("break",31);case 14:return e.next=16,this.getCenterDisplayAnnotationXFDF(t);case 16:return e.abrupt("return",e.sent);case 17:return e.next=19,this.getCenterDisplayAnnotationXFDF(t);case 19:return e.abrupt("return",e.sent);case 20:return e.next=22,this.getCenterDisplayAnnotationXFDF(t);case 22:return e.abrupt("return",e.sent);case 23:return e.next=25,this.getPeripheralDisplayAnnotationsXFDFS(t);case 25:return e.abrupt("return",e.sent);case 26:return e.next=28,this.getCenterDisplayAnnotationXFDF(t);case 28:return e.abrupt("return",e.sent);case 29:case 30:return e.abrupt("return",[]);case 31:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"updateAnnotation",value:function(e,t){var n=e.get("type"),a=h.getInstance().getValueStateBygType(n),o=t.filter((function(e){return a.includes(e)})),i=new DOMParser,r=new XMLSerializer,s=e.get("xfdf")||e.get("xdf");if(s){for(var l=h.getInstance().getDisplayValuesByTypeAndPlacement(n),c="",u=!1,d=!1,p=0;p<o.size;p++)!u&&l.centerValues.includes(o.get(p))&&(u=!0),!d&&l.peripheralValues.includes(o.get(p))&&(d=!0),p===o.length-1?c+=o.get(p):c+=o.get(p)+",";var g=i.parseFromString(s,"text/xml");return g.querySelector("annots").firstElementChild.setAttribute("gDisplayValues",c),{data:r.serializeToString(g),displayValueList:o,activeCenter:u,activePeripheral:d}}}},{key:"getCenterDisplayAnnotationXFDF",value:function(){var e=Object(i.a)(o.a.mark((function e(t){var n,a,i,r,s,u,g,h,f,A,E,T,S,b,I,y,v;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=Object(m.getInstance)(l.a.getElement()))){e.next=34;break}return a=new d.a,s=a.getCenterPoint(t),u=n.docViewer.getDocument().getViewerCoordinates(t.get("pageNumber")||t.get("page"),s[0],s[1]),i=u.x,r=u.y,g=n.Annotations,h=a.getVerticesFromXfdf(t.get("xfdf")||t.get("xdf")),f=a.calculateOuterDimX(h),A=a.calculateOuterDimY(h),E=A/2>200?200:A/2<60?60:A/2,T=f/2>200?200:f/2<60?60:f/2,(S=new g.FreeTextAnnotation).PageNumber=t.get("pageNumber")||t.get("page"),S.Subject="CenterValue",S.Width=E,S.Height=T,S.X=i,S.Y=r-T/2,S.setPadding(new g.Rect(0,0,0,0)),S.setContents("No values yet"),S.FillColor=new g.Color(0,0,0,0),S.FontSize="0",S.TextAlign="left",S.EXPORT_CALCULATED_FONT_SIZE=!0,S.Author=c.a.getUserId(),e.next=29,n.annotManager.exportAnnotations({annotList:[S]});case 29:return b=e.sent,I=new DOMParser,y=I.parseFromString(b,"text/xml"),v=y.querySelector("annots").firstElementChild,e.abrupt("return",p.a.fromJS({annotXfdf:b,type:v.getAttribute("subject"),fileId:l.a.getActiveFileId(),annotationId:v.getAttribute("name"),parentId:t.get("annotationId")}));case 34:return e.abrupt("return",void 0);case 35:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"getXY",value:function(e){var t=e.point2,n=e.dx,a=e.dy,o=e.width,i=e.height;switch(l.a.getPageRotation()){case 0:return{x:t[0]+n/2,y:t[1]+a/2};case 1:return{x:t[0]+n/2,y:t[1]+a/2-i};case 2:return{x:t[0]+n/2-o,y:t[1]+a/2-i};case 3:return{x:t[0]+n/2-o,y:t[1]+a/2};default:return{x:t[0]+n/2,y:t[1]+a/2}}}},{key:"getPeripheralDisplayAnnotationsXFDFS",value:function(){var e=Object(i.a)(o.a.mark((function e(t){var n,a,i,r,s,u,g,h,f,A,E,T,S,b,I,y,v,N,O,w,P,R,L,C,_,M;return o.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=new p.a.List,!(a=Object(m.getInstance)(l.a.getElement()))){e.next=44;break}i=new d.a,r=i.getVerticesFromXfdf(t.get("xfdf")),s=0;case 6:if(!(s<r.length-1)){e.next=44;break}return u=void 0,g=void 0,t.Id?(u=r[s],g=r[s+1]):(h=a.docViewer.getDocument().getViewerCoordinates(t.get("pageNumber"),r[s][0],r[s][1]),f=a.docViewer.getDocument().getViewerCoordinates(t.get("pageNumber"),r[s+1][0],r[s+1][1]),u=[h.x,h.y],g=[f.x,f.y]),A=a.Annotations,E=new A.FreeTextAnnotation,T=i.getVerticesFromXfdf(t.get("xfdf")),S=i.calculateOuterDimX(T)/4,b=i.calculateOuterDimY(T)/4,I=b>80?80:b<35?35:b,y=S>40?40:S<20?20:S,v=u[0]-g[0],N=u[1]-g[1],O=this.getXY({point2:g,dx:v,dy:N,width:I,height:y}),w=O.x,P=O.y,E.PageNumber=t.get("pageNumber"),E.Subject="PeripheralValue",E.Width=I,E.Height=y,E.X=w,E.Y=P,E.setPadding(new A.Rect(0,0,0,0)),E.setContents("No values yet"),E.FillColor=new A.Color(0,0,0,0),E.FontSize="0",E.EXPORT_CALCULATED_FONT_SIZE=!0,E.index=s,E.Author=c.a.getUserId(),e.next=35,a.annotManager.exportAnnotations({annotList:[E]});case 35:R=e.sent,L=new DOMParser,C=L.parseFromString(R,"text/xml"),_=C.querySelector("annots").firstElementChild,M=p.a.fromJS({annotXfdf:R,type:_.getAttribute("subject"),fileId:l.a.getActiveFileId(),annotationId:_.getAttribute("name"),parentId:t.get("annotationId")}),n=n.push(M);case 41:s++,e.next=6;break;case 44:return e.abrupt("return",n);case 45:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();t.a=f}},[[597,1,2]]]);