!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=4)}([function(e,t,n){"use strict";function o(){}function r(e){try{return e.then}catch(e){return _=e,b}}function s(e,t){try{return e(t)}catch(e){return _=e,b}}function i(e,t,n){try{e(t,n)}catch(e){return _=e,b}}function a(e){if("object"!==typeof this)throw new TypeError("Promises must be constructed via new");if("function"!==typeof e)throw new TypeError("Promise constructor's argument is not a function");this._75=0,this._83=0,this._18=null,this._38=null,e!==o&&m(e,this)}function l(e,t,n){return new e.constructor(function(r,s){var i=new a(o);i.then(r,s),c(e,new f(t,n,i))})}function c(e,t){for(;3===e._83;)e=e._18;if(a._47&&a._47(e),0===e._83)return 0===e._75?(e._75=1,void(e._38=t)):1===e._75?(e._75=2,void(e._38=[e._38,t])):void e._38.push(t);d(e,t)}function d(e,t){y(function(){var n=1===e._83?t.onFulfilled:t.onRejected;if(null===n)return void(1===e._83?u(t.promise,e._18):p(t.promise,e._18));var o=s(n,e._18);o===b?p(t.promise,_):u(t.promise,o)})}function u(e,t){if(t===e)return p(e,new TypeError("A promise cannot be resolved with itself."));if(t&&("object"===typeof t||"function"===typeof t)){var n=r(t);if(n===b)return p(e,_);if(n===e.then&&t instanceof a)return e._83=3,e._18=t,void h(e);if("function"===typeof n)return void m(n.bind(t),e)}e._83=1,e._18=t,h(e)}function p(e,t){e._83=2,e._18=t,a._71&&a._71(e,t),h(e)}function h(e){if(1===e._75&&(c(e,e._38),e._38=null),2===e._75){for(var t=0;tc){for(var t=0,n=i.length-l;t-1?t:e}function h(e,t){t=t||{};var n=t.body;if(e instanceof h){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||null==e._bodyInit||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=p(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),o=n.shift().replace(/\+/g," "),r=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(o),decodeURIComponent(r))}}),t}function m(e){var t=new r;return e.split(/\r?\n/).forEach(function(e){var n=e.split(":"),o=n.shift().trim();if(o){var r=n.join(":").trim();t.append(o,r)}}),t}function y(e,t){t||(t={}),this.type="default",this.status="status"in t?t.status:200,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){var _={searchParams:"URLSearchParams"in e,iterable:"Symbol"in e&&"iterator"in Symbol,blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e};if(_.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],g=function(e){return e&&DataView.prototype.isPrototypeOf(e)},w=ArrayBuffer.isView||function(e){return e&&b.indexOf(Object.prototype.toString.call(e))>-1};r.prototype.append=function(e,o){e=t(e),o=n(o);var r=this.map[e];this.map[e]=r?r+","+o:o},r.prototype.delete=function(e){delete this.map[t(e)]},r.prototype.get=function(e){return e=t(e),this.has(e)?this.map[e]:null},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,o){this.map[t(e)]=n(o)},r.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},r.prototype.keys=function(){var e=[];return this.forEach(function(t,n){e.push(n)}),o(e)},r.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),o(e)},r.prototype.entries=function(){var e=[];return this.forEach(function(t,n){e.push([n,t])}),o(e)},_.iterable&&(r.prototype[Symbol.iterator]=r.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];h.prototype.clone=function(){return new h(this,{body:this._bodyInit})},u.call(h.prototype),u.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var E=[301,302,303,307,308];y.redirect=function(e,t){if(-1===E.indexOf(t))throw new RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=h,e.Response=y,e.fetch=function(e,t){return new Promise(function(n,o){var r=new h(e,t),s=new XMLHttpRequest;s.onload=function(){var e={status:s.status,statusText:s.statusText,headers:m(s.getAllResponseHeaders()||"")};e.url="responseURL"in s?s.responseURL:e.headers.get("X-Request-URL");var t="response"in s?s.response:s.responseText;n(new y(t,e))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.open(r.method,r.url,!0),"include"===r.credentials&&(s.withCredentials=!0),"responseType"in s&&_.blob&&(s.responseType="blob"),r.headers.forEach(function(e,t){s.setRequestHeader(t,e)}),s.send("undefined"===typeof r._bodyInit?null:r._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!==typeof self?self:this)},function(e,t,n){"use strict";function o(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(e){o[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},o)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,l=o(e),c=1;c0?" modal-open":"modal-open")},this._unbindCloseModalKorespInfoActions=function(){if(!document.removeEventListener&&document.detachEvent?(document.detachEvent("onclick",e._closeModalKorespInfoIfClickedOutside),document.detachEvent("keydown",e._closeModalKorespInfoIfHitEscape)):(document.removeEventListener("click",e._closeModalKorespInfoIfClickedOutside),document.removeEventListener("keydown",e._closeModalKorespInfoIfHitEscape)),document.body.className&&-1!==document.body.className.indexOf("modal-open")){var t=new RegExp("(\\s|^)modal-open(\\s|$)");document.body.className=document.body.className.replace(t,"")}},o=[],this.props.projectPathsOrder&&this.props.projectPathsOrder.length&&this.props.projectPathsOrder.forEach(function(e){if(e){var t=e.split("-").pop();o[t]=!1}}),this.props.projectPathsOrder&&this.props.projectPathsOrder.length&&this.props.projectPathsOrder.forEach(function(e){if(e){var t=e.split("-");t.length>2&&(t.pop(),t.forEach(function(e){o[e]=!0}))}}),this.props.projectPathsOrder&&this.props.projectPathsOrder.length&&this.props.projectPathsOrder.forEach(function(e){if(e){var t=e.split("-");t.pop(),t.length<=n&&t.forEach(function(e){r[e]=!0})}}),this.setState({treeLevelLimit:n,treeHasChildren:o,treeExpanded:r})}function r(){this.props.dbg&&console.log("Budget::componentDidMount.")}function s(e,t){this.props.dbg&&console.log("Budget::showModalKorespInfo. idProject:",e,"month:",t),this.setState({modalKorespInfo__opened:!0,modalKorespInfo__idProject:e,modalKorespInfo__month:t},this._bindCloseModalKorespInfoActions)}function i(){this.props.dbg&&console.log("Budget::hideModalKorespInfo."),this.setState({modalKorespInfo__opened:!1},this._unbindCloseModalKorespInfoActions)}function a(e,t){var n=e.target,o=n.getBoundingClientRect();this.props.dbg&&console.log("Budget::showTooltipKorespInfoTitle. pos:",o),this.setState({tooltipKorespInfoTitle__opened:!0})}function l(e){this.props.dbg&&console.log("Budget::hideTooltipKorespInfoTitle."),this.setState({tooltipKorespInfoTitle__opened:!1})}function c(e){this.props.dbg&&console.log("Budget::toggleOnlySelected. e.target.checked",e.target.checked),this.setState({showOnlySelected:!this.state.showOnlySelected})}function d(e){var t=this.props.projectInfo[e].path,n=t.split("-"),o=this.state.treeLevelLimit,r=this.state.treeExpanded,s=!0;return!!t&&(n.pop(),n.length<=o||(s=!0,n.map(function(e){var t=this.props.projectInfo[e];return t&&t.hasAccess?t.filteredByGroups?null:void(e>0&&!r[e]&&(s=!1)):null}.bind(this)),s))}function u(e){var t=this.state.treeExpanded;t[e]=!t[e],this.setState({treeExpanded:t})}function p(e){var t=this.state.monthsPicker__hiddenMonths,n=t.indexOf(e);this.props.dbg&&console.log("Budget::toggleMonth. month",e,"monthsPicker__hiddenMonths(idx="+n+")",t),-1!==n?t.splice(n,1):t.push(e),this.setState({monthsPicker__hiddenMonths:t})}function h(e){this.setState({monthsPicker__hiddenMonths:[]})}function f(e,t,n){var o=this.state.selectedProjects,r=this.props.projectPathsMap,s=e.target.checked;this.props.dbg&&console.log("Budget::selectProject. idProj:",t,"path:",n,"e.target.checked:",e.target.checked),this.props.projectPathsOrder.forEach(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=r[e];if(e&&t&&(n===e||n+"-"===e.substr(0,n.length+1)))if(s)-1===o.indexOf(t)&&o.push(t);else{var i=void 0;-1!==(i=o.indexOf(t))&&o.splice(i,1)}}),this.setState({selectedProjects:o})}function m(e,t){if(!this.props.costs)return null;if(!this.props.costs[e])return null;if(!this.props.costs[e].costsByMonth)return null;if(!this.props.costs[e].costsByMonth[t])return null;var n=this.props.costs[e].costsByMonth[t];return n?(n.COST_CHILD=Object(j.a)(n.COST_CHILD),n.COST_SELF=Object(j.a)(n.COST_SELF),n.COST_TOTAL=Object(j.a)(n.COST_TOTAL),n.INCOME_CHILD=Object(j.a)(n.INCOME_CHILD),n.INCOME_SELF=Object(j.a)(n.INCOME_SELF),n.INCOME_TOTAL=Object(j.a)(n.INCOME_TOTAL),n):null}function y(e,t){if(!this.props.plan)return 0;if(!this.props.plan[e])return 0;if(!this.props.plan[e][t])return 0;var n=this.props.plan[e][t];return Object(j.a)(n)}function _(e,t){if(!this.props.costs)return null;if(!this.props.costs[e])return null;if(!this.props.costs[e].korespByMonth)return null;if(!this.props.costs[e].korespByMonth[t])return null;var n=this.props.costs[e].korespByMonth[t];return n&&n.length?n=n.map(function(e){return e.COST=Object(j.a)(e.COST),e}):null}function b(e,t){var n=this,o=this.state.modalKorespInfo__idProject,r=this.state.modalKorespInfo__month,s=null,i=this.state.modalKorespInfo__opened,a=["modal","fade",i?"in":""].join(" "),l={display:i?"block":"none"},c=null,d=0,u=0,p=0,h="",f=0,m=[],y=null,_=0;return this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails."),o&&r?(s="Koszty projektu nr "+this.state.modalKorespInfo__idProject,s+=" w miesi\u0105cu "+this.props.year+"-",s+=this.state.modalKorespInfo__month<10?"0":"",s+=this.state.modalKorespInfo__month,this.props.projectInfo[o]?(h=this.props.projectInfo[o].path,f=h.length,m=this.props.projectPathsOrder.filter(function(e){return h+"-"===(""+e).substr(0,f+1)}),this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails. idsProject(paths):",m),m=m.map(function(e){return this.props.projectPathsMap[e]}.bind(this)),m.unshift(o),this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails. idsProject:",m),y=m.map(function(e){var t=this.props.projectInfo[e].path,n=this.props.projectInfo[e].M_DIST_DESC,o=null,s=[];return(o=this.getMonthCostDetails(e,r))?(u+=1,p+=o.length,s.push(M.createElement("tr",{key:e},M.createElement("td",{style:{padding:"3px",fontSize:"1em",background:"#eee",whiteSpace:"nowrap"}},t),M.createElement("td",{colSpan:"3",style:{padding:"3px",fontSize:"1.1em",background:"#eee",maxWidth:"500px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:n},n))),o.forEach(function(e){var t={maxWidth:"400px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},n=e.TRANSFER_OPPOSITE_ID_PROJECT_TO||0,o=e.TRANSFER_OPPOSITE_ID_PROJECT_FROM||0,r=null;_+=e.COST,n&&(t.fontStyle="italic",t.color="#bbb"),r=o>0?M.createElement("td",{className:"p2 cell-transfer_opposite_id_project"},"Transfer z projektu nr ",o):n>0?M.createElement("td",{className:"p2 cell-transfer_opposite_id_project"},"Transfer do projektu nr ",n):M.createElement("td",{className:"p2 cell-transfer_opposite_id_project"}),s.push(M.createElement("tr",{key:e.ID},M.createElement("td",{className:"p2 l nr"},"nr: ",e.ID,", data: ",e.K_DATA_OTRZYMANEJ_KORESP,M.createElement("br",null),"obcy nr: ",e.K_NR_OTRZYM_KORESP),M.createElement("td",{className:"p2",style:t},M.createElement("span",{title:e.K_ZAWARTOS},e.K_ZAWARTOS),M.createElement("br",null),M.createElement("em",{title:e.K_OD_KOGO},e.K_OD_KOGO)),M.createElement("td",{className:"cell-cost cell-cost-only_child"},Object(I.a)(e.COST)),r))}),s):null}.bind(this)),y.push(M.createElement("tr",{key:"suma"},M.createElement("td",{colSpan:"2",className:"p2",style:{textAlign:"right"}},"Suma:"),M.createElement("td",{className:"cell-cost",style:{textAlign:"right"}},Object(I.a)(_)))),i&&(d+=60,d+=56,d+=65,d+=30,d+=25*u,d+=41*p,d+=20,this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails. modalBackdropHeight:",d," window.innerHeight:",window.innerHeight),d=Math.max(d,window.innerHeight),c=M.createElement("div",{className:"modal-backdrop fade in",style:{height:d+"px"}})),M.createElement("div",{className:a,style:l,tabIndex:"-1",role:"dialog","aria-labelledby":"projectCostDMonthetailsLabel"},c,M.createElement("div",{ref:"modalKorespInfo",className:"modal-dialog",role:"document",style:{minWidth:"900px"}},M.createElement("div",{className:"modal-content"},M.createElement("div",{className:"modal-header"},M.createElement("button",{onClick:function(){return n.hideModalKorespInfo()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},M.createElement("span",{"aria-hidden":"true"},"\xd7")),M.createElement("h4",{className:"modal-title",id:"projectCostDMonthetailsLabel"},s)),M.createElement("div",{className:"modal-body"},M.createElement("table",{className:"zestawienie-kosztow-tbl",style:{width:"100%"}},M.createElement("tbody",null,y))),M.createElement("div",{className:"modal-footer"},M.createElement("button",{onClick:function(){return n.hideModalKorespInfo()},type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close")))))):null):null}function g(e){var t=this.state.monthsPicker__hiddenMonths;return e.map(function(e){var n=this,o="c col_month_"+e+" thead_col_month",r=""+(e<10?"0"+e:e);return-1!==t.indexOf(e)?null:M.createElement("th",{className:o,colSpan:"3",key:e},r,M.createElement("i",{className:"pull-right glyphicon glyphicon-remove col_month_remove",onClick:function(){return n.toggleMonth(e)},style:{padding:"2px",cursor:"pointer",color:"red"}}))}.bind(this))}function w(e){var t=this.state.monthsPicker__hiddenMonths;return e.map(function(e){var n=[],o="c col_month_"+e;return-1!==t.indexOf(e)?null:(n.push(M.createElement("th",{className:o,title:"Koszty wprowadzone do korespondencji"},"Koszty")),n.push(M.createElement("th",{className:o,title:"Plan bud\u017cetu"},"Plan")),n.push(M.createElement("th",{className:o,title:"Procent przekroczenia planu"},"%")),n)})}function v(e){var t=0,n=this.state.monthsPicker__hiddenMonths,o=this.state.treeHasChildren,r=this.state.treeExpanded;return this.props.projectPathsOrder&&this.props.projectPathsOrder.length?this.props.projectPathsOrder.map(function(s,i){var a=this,l=this.props.projectPathsMap[s],c=this.props.projectInfo[l],d=c.M_DIST_DESC,u=-1!==this.state.selectedProjects.indexOf(l),p=[u?"row-selected":""].join(" "),h=null,f=[],m=null,y=0,_=0;if(!c.hasAccess)return null;if(c.filteredByGroups)return null;if(!this.treeIsVisible(l))return null;if(o[l]){var b="glyphicon";b+=r[l]?" glyphicon-minus":" glyphicon-plus";var g=r[l]?"zwi\u0144":"rozwi\u0144";m=M.createElement("i",{className:b,style:{cursor:"pointer"},title:g,onClick:function(){return a.toggleTreeNode(l)}})}return h=e.map(function(e){var t=this,o=[],r="cell-cost col_month_"+e,s="cell-plan col_month_"+e,i="cell-procent col_month_"+e,a="",c=this.getCost(l,e),d=this.getPlan(l,e),u="",p="",h="";if(-1!==n.indexOf(e))return null;if(c&&(y+=c.COST_TOTAL),d&&(_+=d),c){u=Object(I.a)(c.COST_TOTAL),c.COST_CHILD>0?c.COST_SELF>0?r+=" cell-cost-self_and_child":r+=" cell-cost-only_child":r+=" cell-cost-only_self";a="Koszt projektu "+Object(I.a)(c.COST_SELF)+" / koszt podprojekt\xf3w "+Object(I.a)(c.COST_CHILD)}return o.push(M.createElement("td",{className:r},M.createElement("span",{style:{cursor:"pointer"},title:a,onClick:function(){return t.showModalKorespInfo(l,e)}},u))),p=Object(I.a)(d),o.push(M.createElement("td",{className:s,title:"Plan bud\u017cetu"},p)),d>0&&c&&c.COST_TOTAL>0&&(h=Math.round(100*c.COST_TOTAL/d),i=h>150?"cell-procent-over150":h>100?"cell-procent-over100":100===h?"cell-procent-100":"cell-procent-below100"),o.push(M.createElement("td",{className:i,title:"Procent przekroczenia planu"},h)),o}.bind(this)),f.push(M.createElement("td",{key:"totalCost",className:"row__summary__cost r"},Object(I.a)(y))),f.push(M.createElement("td",{key:"totalPlan",className:"row__summary__plan r"},Object(I.a)(_))),t++,M.createElement("tr",{className:p,key:i,"data-lp":t},M.createElement("td",{className:"p2 r nr"},M.createElement("input",{type:"checkbox",onChange:function(e){return a.selectProject(e,l,s)},value:l,checked:u})),M.createElement("td",{className:"p2 l nr",style:{whiteSpace:"nowrap"}},s," ",m),M.createElement("td",{className:"p2",style:{maxWidth:"300px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:d},d),h,f)}.bind(this)):null}function E(e){var t=this.state.monthsPicker__hiddenMonths,n=0,o=0,r=[],s=[],i={},a={};e.forEach(function(e){i[e]=0,a[e]=0}),this.props.projectPathsOrder&&this.props.projectPathsOrder.length&&this.props.projectPathsOrder.forEach(function(n,o){var r=this.props.projectPathsMap[n],s=this.props.projectInfo[r],l=-1!==this.state.selectedProjects.indexOf(r);return this.state.showOnlySelected&&this.state.selectedProjects.length>0&&!l?null:s.hasAccess?s.filteredByGroups?null:void e.map(function(e){var n=this.getCost(r,e),o=this.getPlan(r,e);if(-1!==t.indexOf(e))return null;n&&(i[e]+=n.COST_SELF),o&&(a[e]+=o)}.bind(this)):null}.bind(this)),this.props.projectPathsOrder&&this.props.projectPathsOrder.length&&this.props.projectPathsOrder.forEach(function(e,t){var r=this.props.projectPathsMap[e],s=this.props.projectInfo[r];return n+=1,s.hasAccess?s.filteredByGroups?null:void(o+=1):null}.bind(this));var l=e.map(function(e){var n=[],o=Object(I.a)(i[e]),r=Object(I.a)(a[e]);return-1!==t.indexOf(e)?null:(n.push(M.createElement("td",{className:"cell-cost row__summary__cost"},o)),n.push(M.createElement("td",{className:"cell-plan row__summary__plan",title:"Plan bud\u017cetu - Suma"},r)),n.push(M.createElement("td",{className:"row__summary__cost"})),n)});return s.push(M.createElement("td",{key:"totalCost",className:"row__summary__cost r"})),s.push(M.createElement("td",{key:"totalPlan",className:"row__summary__plan r"})),r.push(M.createElement("tr",{className:"row__summary__cost",key:"sum"},M.createElement("td",{colSpan:"3",className:"p2",style:{textAlign:"right"}},"Suma:"),l,s)),r.push(M.createElement("tr",{key:"total"},M.createElement("td",{colSpan:41},n," projekt\xf3w (dost\u0119p do ",o,")"))),r}function O(){var e=this,t=[1,2,3,4,5,6,7,8,9,10,11,12],n=null,o=null,r=null,s=null,i=null,a=null,l=[this.state.showOnlySelected?"showOnlySelected":""].join(" "),c=this.props.dbg;return this.props.dbg&&console.log("Budget::render."),n=this.renderTheadMonthCols(t),o=this.renderTheadMonthSubCols(t),this.props.dbg&&console.log("Budget::render. BudgetMonthPicker: hiddenMonths",this.state.monthsPicker__hiddenMonths),r=M.createElement(k.a,{months:t,hiddenMonths:this.state.monthsPicker__hiddenMonths,dbg:c,onToggleMonth:function(t){return e.toggleMonth(t)},onShowAllMonths:function(){return e.showAllMonths()}}),s=this.renderTbodyRows(t),i=this.renderTfootRows(t),this.state.modalKorespInfo__opened&&(a=this.renderProjectMonthCostDetails()),M.createElement("div",null,M.createElement("div",{className:"container"},M.createElement("div",{style:{float:"right",color:"#aaa"}},this.props.today),M.createElement("h1",null,"Zestawienie koszt\xf3w projekt\xf3w na rok ",this.props.year)),M.createElement("table",{cellSpacing:"0",cellPadding:"0",border:"0",id:"zestawienie-kosztow-projektow",className:"table-striped zestawienie-kosztow-tbl"},M.createElement("thead",null,M.createElement("tr",null,M.createElement("td",{colSpan:"3",className:"p2"},M.createElement("span",{className:"pull-right"},r)),n,M.createElement("th",{colSpan:"2",className:"thead__cols_summary c"},"Suma")),M.createElement("tr",null,M.createElement("td",{colSpan:"3",className:"p2"},M.createElement("span",{className:"pull-left",style:{whiteSpace:"nowrap"}},M.createElement("input",{type:"checkbox",onClick:function(t){return e.toggleOnlySelected(t)}})," poka\u017c tylko zaznaczone")),o,M.createElement("th",{className:"thead__cols_summary c"},"Koszty"),M.createElement("th",{className:"thead__cols_summary c"},"Plan"))),M.createElement("tbody",{className:l},s),M.createElement("tfoot",null,i)),a)}Object.defineProperty(t,"__esModule",{value:!0});var j=n(13),I=n(14),P=n(3),k=n(15),T=n(2),C=(n.n(T),window.p5VendorJs.createReactClass),M=window.p5VendorJs.React,S=window.p5VendorJs.ReactDOM,N=function(){return{monthsPicker__hiddenMonths:[],showOnlySelected:!1,selectedProjects:[],modalKorespInfo__opened:!1,modalKorespInfo__idProject:0,modalKorespInfo__month:0,treeLevelLimit:1,treeExpanded:[],treeHasChildren:[],dbg:!1}},x=C({displayName:"Budget",getInitialState:N,componentWillMount:o,componentDidMount:r,toggleMonth:p,showAllMonths:h,toggleOnlySelected:c,selectProject:f,getCost:m,getPlan:y,showModalKorespInfo:s,hideModalKorespInfo:i,showTooltipKorespInfoTitle:a,hideTooltipKorespInfoTitle:l,toggleTreeNode:u,treeIsVisible:d,getMonthCostDetails:_,renderProjectMonthCostDetails:b,renderTheadMonthCols:g,renderTheadMonthSubCols:w,renderTbodyRows:v,renderTfootRows:E,render:O});t.default=x},function(e,t,n){"use strict";function o(e){if(!e)return 0;"string"===typeof e&&(e=e.replace(/,/g,"."),e=e.replace(/ /g,""));var t=parseFloat(e);return isNaN(t)?0:t}t.a=o},function(e,t,n){"use strict";function o(e,t){if(void 0===t&&(t=""),!e)return t;if("number"===typeof e);else if(e=parseFloat(e),isNaN(e))return t;var n=e.toFixed(2).split("."),o=n[0],r=n[1],s=[],i="";"-"===o.substr(0,1)&&(i="-",o=o.substr(1));for(var a=o.length,l=o;a>3;)s.unshift(l.substr(-3)),a-=3,l=l.substr(0,a);return a>0&&s.unshift(l),""+i+s.join(",")+"."+r}t.a=o},function(e,t,n){"use strict";function o(){var e=this;this.toggleDropdown=function(t){e.state.opened?e.setState({opened:!1},e._unbindCloseDropdownIfClickedOutside):e.setState({opened:!0},e._bindCloseDropdownIfClickedOutside)},this.handleShowAllMonths=function(){e.setState({opened:!1},e._unbindCloseDropdownIfClickedOutside),e.props.onShowAllMonths()},this.handleToggleMonth=function(t,n){e.props.dbg&&console.log("BudgetMonthPicker::toggleMonth. month",n),e.props.onToggleMonth(n)},this._closeDropdownIfClickedOutside=function(t){if(e.state.opened){var n=c.findDOMNode(e.refs.monthsPicker);Object(i.a)(n,t)&&e.setState({opened:!1},e._unbindCloseDropdownIfClickedOutside)}},this._bindCloseDropdownIfClickedOutside=function(){!document.addEventListener&&document.attachEvent?document.attachEvent("onclick",e._closeDropdownIfClickedOutside):document.addEventListener("click",e._closeDropdownIfClickedOutside)},this._unbindCloseDropdownIfClickedOutside=function(){!document.removeEventListener&&document.detachEvent?document.detachEvent("onclick",e._closeDropdownIfClickedOutside):document.removeEventListener("click",e._closeDropdownIfClickedOutside)}}function r(){this.props.dbg&&console.log("BudgetMonthPicker: Component mounted.")}function s(){var e=this,t=this.props.hiddenMonths,n=this.props.months,o=["btn-group","pull-right","dropdown","month_cols_picker",this.state.opened?"open":""].join(" ");this.props.dbg&&console.log("BudgetMonthPicker::render. opened("+this.state.opened+") hiddenMonths",this.props.hiddenMonths);var r=n.map(function(e){var n=this,o=-1===t.indexOf(e);return l.createElement("li",{className:"checkbox",style:{margin:"0 10px"},key:e},l.createElement("label",{style:{width:"100%"}},l.createElement("input",{onChange:function(t){return n.handleToggleMonth(t,e)},checked:o,type:"checkbox",title:e,value:e}),e))}.bind(this));return this.props.dbg&&console.log("BudgetMonthPicker::render. opened("+this.state.opened+") reactDropdownList",r),t.length&&r.push(l.createElement("li",{className:"checkbox",style:{margin:"0 10px"},key:999},l.createElement("button",{className:"btn btn-link",onClick:function(){return e.handleShowAllMonths()},style:{width:"100%"}},"poka\u017c\xa0wszystkie"))),l.createElement("div",null,l.createElement("b",null,"miesi\u0105c "),l.createElement("div",{className:o,ref:"monthsPicker"},l.createElement("button",{className:"btn btn-sm btn-link dropdown-toggle",onClick:function(t){return e.toggleDropdown(t)},style:{padding:"0px 10px"}},"wybierz ",l.createElement("span",{className:"caret"})),l.createElement("ul",{className:"dropdown-menu"},r)))}var i=n(3),a=window.p5VendorJs.createReactClass,l=window.p5VendorJs.React,c=window.p5VendorJs.ReactDOM,d=function(){return{opened:!1}},u=a({displayName:"BudgetMonthPicker",getInitialState:d,componentWillMount:o,componentDidMount:r,render:s});t.a=u}]);