!function e(t,s,o){function n(i,l){if(!s[i]){if(!t[i]){var r="function"==typeof require&&require;if(!l&&r)return r(i,!0);if(a)return a(i,!0);var p=new Error("Cannot find module '"+i+"'");throw p.code="MODULE_NOT_FOUND",p}var c=s[i]={exports:{}};t[i][0].call(c.exports,function(e){var s=t[i][1][e];return n(s?s:e)},c,c.exports,e,t,s,o)}return s[i].exports}for(var a="function"==typeof require&&require,i=0;in.bottom||o.top-1)return!1;if(this.props.filterOption)return this.props.filterOption.call(this,e,s);var t=String(e[this.props.valueKey]),n=String(e[this.props.labelKey]);return this.props.ignoreCase&&(t=t.toLowerCase(),n=n.toLowerCase(),s=s.toLowerCase()),s&&"start"!==this.props.matchPos?"label"!==this.props.matchProp&&t.indexOf(s)>=0||"value"!==this.props.matchProp&&n.indexOf(s)>=0:"label"!==this.props.matchProp&&t.substr(0,s.length)===s||"value"!==this.props.matchProp&&n.substr(0,s.length)===s};return(e||[]).filter(n,this)},selectFocusedOption:function(){return this.props.allowCreate&&!this.state.focusedOption?this.selectValue(this.state.inputValue):this.state.focusedOption?this.selectValue(this.state.focusedOption):void 0},focusOption:function(e){this.setState({focusedOption:e})},focusNextOption:function(){this.focusAdjacentOption("next")},focusPreviousOption:function(){this.focusAdjacentOption("previous")},focusAdjacentOption:function(e){this._focusedOptionReveal=!0;var t=this.state.filteredOptions.filter(function(e){return!e.disabled});if(!this.state.isOpen)return void this.setState({isOpen:!0,inputValue:"",focusedOption:this.state.focusedOption||t["next"===e?0:t.length-1]},this._bindCloseMenuIfClickedOutside);if(t.length){for(var s=-1,o=0;o-1&&s0?t[s-1]:t[t.length-1]),this.setState({focusedOption:n})}},unfocusOption:function(e){this.state.focusedOption===e&&this.setState({focusedOption:null})},buildMenu:function(){var e=this,t=this.state.focusedOption?this.state.focusedOption[this.props.valueKey]:null,s=this.props.optionRenderer;s||(s=function(t){return t[e.props.labelKey]}),this.state.filteredOptions.length>0&&(t=null==t?this.state.filteredOptions[0]:t);var o=this.state.filteredOptions;if(this.props.allowCreate&&this.state.inputValue.trim()){var a=this.state.inputValue;o=o.slice();var i=this.props.newOptionCreator?this.props.newOptionCreator(a):{value:a,label:a,create:!0};o.unshift(i)}var r=Object.keys(o).map(function(e){var a=o[e],i=this.state.value===a[this.props.valueKey],r=t===a[this.props.valueKey],p=l({"Select-option":!0,"is-selected":i,"is-focused":r,"is-disabled":a.disabled}),c=r?"focused":null,u=this.focusOption.bind(this,a),d=this.unfocusOption.bind(this,a),h=this.selectValue.bind(this,a),f=n.createElement(this.props.optionComponent,{key:"option-"+a[this.props.valueKey],className:p,renderFunc:s,mouseEnter:u,mouseLeave:d,mouseDown:h,click:h,addLabelText:this.props.addLabelText,option:a,ref:c});return f},this);if(r.length)return r;var p,c;return this.isLoading()?(c="Select-searching",p=this.props.searchingText):this.state.inputValue||!this.props.asyncOptions?(c="Select-noresults",p=this.props.noResultsText):(c="Select-search-prompt",p=this.props.searchPromptText),n.createElement("div",{className:c},p)},handleOptionLabelClick:function(e,t){this.props.onOptionLabelClick&&this.props.onOptionLabelClick(e,t)},isLoading:function(){return this.props.isLoading||this.state.isLoading},render:function(){var e=l("Select",this.props.className,{"Select--multi":this.props.multi,"is-searchable":this.props.searchable,"is-open":this.state.isOpen,"is-focused":this.state.isFocused,"is-loading":this.isLoading(),"is-disabled":this.props.disabled,"has-value":this.state.value}),t=[];if(this.props.multi&&this.state.values.forEach(function(e){var s=this.handleOptionLabelClick.bind(this,e),o=this.removeValue.bind(this,e),a=n.createElement(this.props.valueComponent,{key:e.value,option:e,renderer:this.props.valueRenderer,optionLabelClick:!!this.props.onOptionLabelClick,onOptionLabelClick:s,onRemove:o,disabled:this.props.disabled});t.push(a)},this),!(this.state.inputValue||this.props.multi&&t.length)){var s=this.state.values[0]||null;if(this.props.valueRenderer&&this.state.values.length)t.push(n.createElement(r,{key:0,option:s,renderer:this.props.valueRenderer,disabled:this.props.disabled}));else{var a=n.createElement(this.props.singleValueComponent,{key:"placeholder",value:s,placeholder:this.state.placeholder});t.push(a)}}var p,c,u=this.isLoading()?n.createElement("span",{className:"Select-loading-zone","aria-hidden":"true"},n.createElement("span",{className:"Select-loading"})):null,d=this.props.clearable&&this.state.value&&!this.props.disabled&&!this.isLoading()?n.createElement("span",{className:"Select-clear-zone",title:this.props.multi?this.props.clearAllText:this.props.clearValueText,"aria-label":this.props.multi?this.props.clearAllText:this.props.clearValueText,onMouseDown:this.clearValue,onTouchEnd:this.clearValue,onClick:this.clearValue},n.createElement("span",{className:"Select-clear",dangerouslySetInnerHTML:{__html:"×"}})):null,h=n.createElement("span",{className:"Select-arrow-zone",onMouseDown:this.handleMouseDownOnArrow},n.createElement("span",{className:"Select-arrow",onMouseDown:this.handleMouseDownOnArrow}));this.state.isOpen&&(c={ref:"menu",className:"Select-menu",onMouseDown:this.handleMouseDownOnMenu},p=n.createElement("div",{ref:"selectMenuContainer",className:"Select-menu-outer"},n.createElement("div",c,this.buildMenu())));var f,m={ref:"input",className:"Select-input "+(this.props.inputProps.className||""),tabIndex:this.props.tabIndex||0,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};for(var g in this.props.inputProps)this.props.inputProps.hasOwnProperty(g)&&"className"!==g&&(m[g]=this.props.inputProps[g]);return this.props.disabled?this.props.multi&&this.state.values.length||(f=n.createElement("div",{className:"Select-input"}," ")):f=this.props.searchable?n.createElement(i,o({value:this.state.inputValue,onChange:this.handleInputChange,minWidth:"5"},m)):n.createElement("div",m," "),n.createElement("div",{ref:"wrapper",className:e},n.createElement("input",{type:"hidden",ref:"value",name:this.props.name,value:this.state.value,disabled:this.props.disabled}),n.createElement("div",{className:"Select-control",ref:"control",onKeyDown:this.handleKeyDown,onMouseDown:this.handleMouseDown,onTouchEnd:this.handleMouseDown},t,f,u,d,h),p)}});t.exports=d},{"./Option":1,"./SingleValue":3,"./Value":4,classnames:"classnames",react:"react","react-dom":"react-dom","react-input-autosize":5}],3:[function(e,t,s){var o=e("react"),n=e("classnames"),a=o.createClass({displayName:"SingleValue",propTypes:{placeholder:o.PropTypes.string,value:o.PropTypes.object},render:function(){var e=n("Select-placeholder",this.props.value&&this.props.value.className);return o.createElement("div",{className:e,style:this.props.value&&this.props.value.style,title:this.props.value&&this.props.value.title},this.props.placeholder)}});t.exports=a},{classnames:"classnames",react:"react"}],4:[function(e,t,s){var o=e("react"),n=e("classnames"),a=o.createClass({displayName:"Value",propTypes:{disabled:o.PropTypes.bool,onOptionLabelClick:o.PropTypes.func,onRemove:o.PropTypes.func,option:o.PropTypes.object.isRequired,optionLabelClick:o.PropTypes.bool,renderer:o.PropTypes.func},blockEvent:function(e){e.stopPropagation()},handleOnRemove:function(e){this.props.disabled||this.props.onRemove(e)},render:function(){var e=this.props.option.label;return this.props.renderer&&(e=this.props.renderer(this.props.option)),this.props.onRemove||this.props.optionLabelClick?(this.props.optionLabelClick&&(e=o.createElement("a",{className:n("Select-item-label__a",this.props.option.className),onMouseDown:this.blockEvent,onTouchEnd:this.props.onOptionLabelClick,onClick:this.props.onOptionLabelClick,style:this.props.option.style,title:this.props.option.title},e)),o.createElement("div",{className:n("Select-item",this.props.option.className),style:this.props.option.style,title:this.props.option.title},o.createElement("span",{className:"Select-item-icon",onMouseDown:this.blockEvent,onClick:this.handleOnRemove,onTouchEnd:this.handleOnRemove},"×"),o.createElement("span",{className:"Select-item-label"},e))):o.createElement("div",{className:n("Select-value",this.props.option.className),style:this.props.option.style,title:this.props.option.title},e)}});t.exports=a},{classnames:"classnames",react:"react"}],5:[function(e,t,s){var o=Object.assign||function(e){for(var t=1;t/g,">"),t=this.props.style||{};t.display||(t.display="inline-block");var s=o({},this.props.inputStyle);s.width=this.state.inputWidth,s.boxSizing="content-box";var i=this.props.placeholder?n.createElement("div",{ref:"placeholderSizer",style:a},this.props.placeholder):null;return n.createElement("div",{className:this.props.className,style:t},n.createElement("input",o({},this.props,{ref:"input",className:this.props.inputClassName,style:s})),n.createElement("div",{ref:"sizer",style:a,dangerouslySetInnerHTML:{__html:e}}),i)}});t.exports=i},{react:"react"}],6:[function(e,t,s){function o(e){return e&&e.__esModule?e:{"default":e}}function n(){var e=this,t=this.props.dbg||this.props.dbg,s=this.props.treeLevelLimit,o=[],n=[];this._closeMonthsPickerDropdownIfClickedOutside=function(t){if(e.state.monthsPicker__opened){var s=x["default"].findDOMNode(e.refs.monthsPicker),o=e.clickedOutsideElement(s,t);o&&e.setState({monthsPicker__opened:!1},e._unbindCloseMonthsPickerDropdownIfClickedOutside)}},this._bindCloseMonthsPickerDropdownIfClickedOutside=function(){!document.addEventListener&&document.attachEvent?document.attachEvent("onclick",e._closeMonthsPickerDropdownIfClickedOutside):document.addEventListener("click",e._closeMonthsPickerDropdownIfClickedOutside)},this._unbindCloseMonthsPickerDropdownIfClickedOutside=function(){!document.removeEventListener&&document.detachEvent?document.detachEvent("onclick",e._closeMonthsPickerDropdownIfClickedOutside):document.removeEventListener("click",e._closeMonthsPickerDropdownIfClickedOutside)},this._closeModalKorespInfoIfClickedOutside=function(t){if(e.state.modalKorespInfo__opened){var s=x["default"].findDOMNode(e.refs.modalKorespInfo),o=e.clickedOutsideElement(s,t);o&&e.setState({modalKorespInfo__opened:!1},e._unbindCloseModalKorespInfoActions)}},this._closeModalKorespInfoIfHitEscape=function(t){e.state.modalKorespInfo__opened&&27===t.keyCode&&e.setState({modalKorespInfo__opened:!1},e._unbindCloseModalKorespInfoActions)},this._bindCloseModalKorespInfoActions=function(){!document.addEventListener&&document.attachEvent?(document.attachEvent("onclick",e._closeModalKorespInfoIfClickedOutside),document.attachEvent("keydown",e._closeModalKorespInfoIfHitEscape)):(document.addEventListener("click",e._closeModalKorespInfoIfClickedOutside),document.addEventListener("keydown",e._closeModalKorespInfoIfHitEscape)),t&&console.log("Budget::_bindCloseModalKorespInfoActions. document.body.className",document.body.className),-1===document.body.className.indexOf("modal-open")&&(document.body.className+=document.body.className.length>0?" 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.map(function(e){if(e){var t=e.split("-").pop();o[t]=!1}}.bind(this)),this.props.projectPathsOrder.map(function(e){if(e){var t=e.split("-");t.length>2&&(t.pop(),t.map(function(e){o[e]=!0}))}}.bind(this)),this.props.projectPathsOrder.map(function(e){if(e){var t=e.split("-");t.pop();t.length<=s&&t.map(function(e){n[e]=!0})}}.bind(this)),this.setState({treeLevelLimit:s,treeHasChildren:o,treeExpanded:n})}function a(){this.props.dbg&&console.log("Budget::componentDidMount.")}function i(e,t){for(var s=t.target?t.target:t.srcElement;null!=s;){if(s===e)return!1;s=s.offsetParent}return!0}function l(e){this.state.monthsPicker__opened?this.setState({monthsPicker__opened:!1},this._unbindCloseMonthsPickerDropdownIfClickedOutside):this.setState({monthsPicker__opened:!0},this._bindCloseMonthsPickerDropdownIfClickedOutside)}function r(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 p(){this.props.dbg&&console.log("Budget::hideModalKorespInfo."),this.setState({modalKorespInfo__opened:!1},this._unbindCloseModalKorespInfoActions)}function c(e,t){var s=e.target,o=s.getBoundingClientRect();this.props.dbg&&console.log("Budget::showTooltipKorespInfoTitle. pos:",o),this.setState({tooltipKorespInfoTitle__opened:!0})}function u(e){this.props.dbg&&console.log("Budget::hideTooltipKorespInfoTitle."),this.setState({tooltipKorespInfoTitle__opened:!1})}function d(e){this.props.dbg&&console.log("Budget::toggleOnlySelected. e.target.checked",e.target.checked),this.setState({showOnlySelected:!this.state.showOnlySelected})}function h(e){var t=this.props.projectInfo[e].path,s=t.split("-"),o=this.state.treeLevelLimit,n=this.state.treeExpanded,a=!0;return t?(s.pop(),s.length<=o?!0:(a=!0,s.map(function(e){var t=this.props.projectInfo[e];return t&&t.hasAccess?t.filteredByGroups?null:void(e>0&&!n[e]&&(a=!1)):null}.bind(this)),a)):!1}function f(e){var t=this.state.treeExpanded;t[e]=!t[e],this.setState({treeExpanded:t})}function m(e){var t=this.state.monthsPicker__hiddenMonths,s=t.indexOf(e);this.props.dbg&&console.log("Budget::toggleMonth. month",e,"monthsPicker__hiddenMonths(idx="+s+")",t),-1!==s?t.splice(s,1):t.push(e),this.setState({monthsPicker__hiddenMonths:t})}function g(e){this.setState({monthsPicker__hiddenMonths:[],monthsPicker__opened:!1},this._unbindCloseMonthsPickerDropdownIfClickedOutside)}function y(e,t,s){var o=this.state.selectedProjects,n=this.props.projectPathsMap,a=e.target.checked;this.props.dbg&&console.log("Budget::selectProject. idProj:",t,"path:",s,"e.target.checked:",e.target.checked),this.props.projectPathsOrder.map(function(e){var e=e||"",t=n[e];e&&t&&(s===e||s+"-"===e.substr(0,s.length+1))&&(a?-1===o.indexOf(t)&&o.push(t):-1!==(idx=o.indexOf(t))&&o.splice(idx,1))}),this.setState({selectedProjects:o})}function v(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 s=this.props.costs[e].costsByMonth[t];return s?(s.COST_CHILD=(0,A["default"])(s.COST_CHILD),s.COST_SELF=(0,A["default"])(s.COST_SELF),s.COST_TOTAL=(0,A["default"])(s.COST_TOTAL),s.INCOME_CHILD=(0,A["default"])(s.INCOME_CHILD),s.INCOME_SELF=(0,A["default"])(s.INCOME_SELF),s.INCOME_TOTAL=(0,A["default"])(s.INCOME_TOTAL),s):null}function b(e,t){if(!this.props.plan)return 0;if(!this.props.plan[e])return 0;if(!this.props.plan[e][t])return 0;var s=this.props.plan[e][t];return(0,A["default"])(s)}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 s=this.props.costs[e].korespByMonth[t];return s&&s.length?s=s.map(function(e){return e.COST=(0,A["default"])(e.COST),e}):null}function O(e,t){var s=this,e=this.state.modalKorespInfo__idProject,t=this.state.modalKorespInfo__month,o=null,n=this.state.modalKorespInfo__opened,a=(0,R["default"])({modal:!0,fade:!0,"in":n}),i={display:n?"block":"none"},l=null,r=0,p=0,c=0,u="",d=0,h=[],f=null,m=0;return this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails."),e&&t?(o="Koszty projektu nr "+this.state.modalKorespInfo__idProject,o+=" w miesiącu "+this.props.year+"-",o+=this.state.modalKorespInfo__month<10?"0":"",o+=this.state.modalKorespInfo__month,this.props.projectInfo[e]?(u=this.props.projectInfo[e].path,d=u.length,h=this.props.projectPathsOrder.filter(function(e){return u+"-"===(""+e).substr(0,d+1)}.bind(this)),this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails. idsProject(paths):",h),h=h.map(function(e){return this.props.projectPathsMap[e]}.bind(this)),h.unshift(e),this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails. idsProject:",h),f=h.map(function(e){var s=this.props.projectInfo[e].path,o=this.props.projectInfo[e].M_DIST_DESC,n=null,a=[];return(n=this.getMonthCostDetails(e,t))?(p+=1,c+=n.length,a.push(N["default"].createElement("tr",{key:e},N["default"].createElement("td",{style:{padding:"3px",fontSize:"1em",background:"#eee",whiteSpace:"nowrap"}},s),N["default"].createElement("td",{colSpan:"3",style:{padding:"3px",fontSize:"1.1em",background:"#eee",maxWidth:"500px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:o},o))),n.map(function(e){var t={maxWidth:"400px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},s=e.TRANSFER_OPPOSITE_ID_PROJECT_TO||0,o=e.TRANSFER_OPPOSITE_ID_PROJECT_FROM||0,n=null;m+=e.COST,s&&(t.fontStyle="italic",t.color="#bbb"),n=o>0?N["default"].createElement("td",{className:"p2 cell-transfer_opposite_id_project"},"Transfer z projektu nr ",o):s>0?N["default"].createElement("td",{className:"p2 cell-transfer_opposite_id_project"},"Transfer do projektu nr ",s):N["default"].createElement("td",{className:"p2 cell-transfer_opposite_id_project"}),a.push(N["default"].createElement("tr",{key:e.ID},N["default"].createElement("td",{className:"p2 l nr"},"nr: ",e.ID,", data: ",e.K_DATA_OTRZYMANEJ_KORESP,N["default"].createElement("br",null),"obcy nr: ",e.K_NR_OTRZYM_KORESP),N["default"].createElement("td",{className:"p2",style:t},N["default"].createElement("span",{title:e.K_ZAWARTOS},e.K_ZAWARTOS),N["default"].createElement("br",null),N["default"].createElement("em",{title:e.K_OD_KOGO},e.K_OD_KOGO)),N["default"].createElement("td",{className:"cell-cost cell-cost-only_child"},(0,F["default"])(e.COST)),n))}.bind(this)),a):null}.bind(this)),f.push(N["default"].createElement("tr",{key:"suma"},N["default"].createElement("td",{ colSpan:"2",className:"p2",colSpan:"2",style:{textAlign:"right"}},"Suma:"),N["default"].createElement("td",{className:"cell-cost",style:{textAlign:"right"}},(0,F["default"])(m)))),n&&(r+=60,r+=56,r+=65,r+=30,r+=25*p,r+=41*c,r+=20,this.props.dbg&&console.log("Budget::renderProjectMonthCostDetails. modalBackdropHeight:",r," window.innerHeight:",window.innerHeight),r=Math.max(r,window.innerHeight),l=N["default"].createElement("div",{className:"modal-backdrop fade in",style:{height:r+"px"}})),N["default"].createElement("div",{className:a,style:i,tabIndex:"-1",role:"dialog","aria-labelledby":"projectCostDMonthetailsLabel"},l,N["default"].createElement("div",{ref:"modalKorespInfo",className:"modal-dialog",role:"document",style:{minWidth:"900px"}},N["default"].createElement("div",{className:"modal-content"},N["default"].createElement("div",{className:"modal-header"},N["default"].createElement("button",{onClick:function(){return s.hideModalKorespInfo()},type:"button",className:"close","data-dismiss":"modal","aria-label":"Close"},N["default"].createElement("span",{"aria-hidden":"true"},"×")),N["default"].createElement("h4",{className:"modal-title",id:"projectCostDMonthetailsLabel"},o)),N["default"].createElement("div",{className:"modal-body"},N["default"].createElement("table",{className:"zestawienie-kosztow-tbl",style:{width:"100%"}},N["default"].createElement("tbody",null,f))),N["default"].createElement("div",{className:"modal-footer"},N["default"].createElement("button",{onClick:function(){return s.hideModalKorespInfo()},type:"button",className:"btn btn-default","data-dismiss":"modal"},"Close")))))):null):null}function C(e){var t=this.state.monthsPicker__hiddenMonths;this.props.dbg;return e.map(function(e){var s=this,o="c col_month_"+e+" thead_col_month",n=""+(10>e?"0"+e:e);return-1!==t.indexOf(e)?null:N["default"].createElement("th",{className:o,colSpan:"3",key:e},n,N["default"].createElement("i",{className:"pull-right glyphicon glyphicon-remove col_month_remove",onClick:function(){return s.toggleMonth(e)},style:{padding:"2px",cursor:"pointer",color:"red"}}))}.bind(this))}function E(e){var t=this.state.monthsPicker__hiddenMonths;this.props.dbg;return e.map(function(e){var s=[],o="c col_month_"+e;return-1!==t.indexOf(e)?null:(s.push(N["default"].createElement("th",{className:o,title:"Koszty wprowadzone do korespondencji"},"Koszty")),s.push(N["default"].createElement("th",{className:o,title:"Plan budżetu"},"Plan")),s.push(N["default"].createElement("th",{className:o,title:"Procent przekroczenia planu"},"%")),s)})}function T(e){var t=this,s=this.state.monthsPicker__hiddenMonths;this.props.dbg;return reactMonthPickerDropdownList=e.map(function(e){var t=this,o=-1===s.indexOf(e);return N["default"].createElement("li",{className:"checkbox",style:{margin:"0 10px"},key:e},N["default"].createElement("label",{style:{width:"100%"}},N["default"].createElement("input",{onChange:function(){return t.toggleMonth(e)},checked:o,type:"checkbox",title:e,value:e}),e))}.bind(this)),s.length&&reactMonthPickerDropdownList.push(N["default"].createElement("li",{className:"checkbox",style:{margin:"0 10px"},key:999},N["default"].createElement("button",{className:"btn btn-link",onClick:function(){return t.showAllMonths()},style:{width:"100%"}},"pokaż wszystkie"))),reactMonthPickerDropdownList}function k(e){var t=0,s=this.state.monthsPicker__hiddenMonths,o=this.state.treeHasChildren,n=this.state.treeExpanded;this.props.dbg;return this.props.projectPathsOrder.map(function(a,i){var l=this,r=this.props.projectPathsMap[a],p=this.props.projectInfo[r],c=p.M_DIST_DESC,u=-1!==this.state.selectedProjects.indexOf(r),d=(0,R["default"])({"row-selected":u}),h=null,f=[],m=null,g=0,y=0;if(!p.hasAccess)return null;if(p.filteredByGroups)return null;if(!this.treeIsVisible(r))return null;if(o[r]){var v="glyphicon";v+=n[r]?" glyphicon-minus":" glyphicon-plus";var b=n[r]?"zwiń":"rozwiń";m=N["default"].createElement("i",{className:v,style:{cursor:"pointer"},title:b,onClick:function(){return l.toggleTreeNode(r)}})}return h=e.map(function(e){var t=this,o=[],n="cell-cost col_month_"+e,a="cell-plan col_month_"+e,i="cell-procent col_month_"+e,l="",p=this.getCost(r,e),c=this.getPlan(r,e),u="",d="",h="";return-1!==s.indexOf(e)?null:(p&&(g+=p.COST_TOTAL),c&&(y+=c),p&&(u=(0,F["default"])(p.COST_TOTAL),n+=p.COST_CHILD>0?p.COST_SELF>0?" cell-cost-self_and_child":" cell-cost-only_child":" cell-cost-only_self",vCostSelfOut=(0,F["default"])(p.COST_SELF),vCostChildOut=(0,F["default"])(p.COST_CHILD),l="Koszt projektu "+vCostSelfOut+" / koszt podprojektów "+vCostChildOut),o.push(N["default"].createElement("td",{className:n},N["default"].createElement("span",{style:{cursor:"pointer"},title:l,onClick:function(){return t.showModalKorespInfo(r,e)}},u))),d=(0,F["default"])(c),o.push(N["default"].createElement("td",{className:a,title:"Plan budżetu"},d)),c>0&&p&&p.COST_TOTAL>0&&(h=Math.round(100*p.COST_TOTAL/c),i=h>150?"cell-procent-over150":h>100?"cell-procent-over100":100==h?"cell-procent-100":"cell-procent-below100"),o.push(N["default"].createElement("td",{className:i,title:"Procent przekroczenia planu"},h)),o)}.bind(this)),f.push(N["default"].createElement("td",{key:"totalCost",className:"row__summary__cost r"},(0,F["default"])(g))),f.push(N["default"].createElement("td",{key:"totalPlan",className:"row__summary__plan r"},(0,F["default"])(y))),t++,N["default"].createElement("tr",{className:d,key:i,"data-lp":t},N["default"].createElement("td",{className:"p2 r nr"},N["default"].createElement("input",{type:"checkbox",onChange:function(e){return l.selectProject(e,r,a)},value:r,checked:u})),N["default"].createElement("td",{className:"p2 l nr",style:{whiteSpace:"nowrap"}},a," ",m),N["default"].createElement("td",{className:"p2",style:{maxWidth:"300px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:c},c),h,f)}.bind(this))}function M(e){var t=this.state.monthsPicker__hiddenMonths,s=(this.state.treeHasChildren,this.state.treeExpanded,41),o=0,n=0,a=[],i=[],l={},r={};this.props.dbg;return e.map(function(e){l[e]=0,r[e]=0}),this.props.projectPathsOrder.map(function(s,o){var n=this.props.projectPathsMap[s],a=this.props.projectInfo[n],i=-1!==this.state.selectedProjects.indexOf(n);return this.state.showOnlySelected&&this.state.selectedProjects.length>0&&!i?null:a.hasAccess?a.filteredByGroups?null:void e.map(function(e){var s=this.getCost(n,e),o=this.getPlan(n,e);return-1!==t.indexOf(e)?null:(s&&(l[e]+=s.COST_SELF),void(o&&(r[e]+=o)))}.bind(this)):null}.bind(this)),this.props.projectPathsOrder.map(function(e,t){var s=this.props.projectPathsMap[e],a=this.props.projectInfo[s];return o+=1,a.hasAccess?a.filteredByGroups?null:void(n+=1):null}.bind(this)),reactProjMonthCols=e.map(function(e){var s=[],o="cell-cost row__summary__cost",n="cell-plan row__summary__plan",a=(0,F["default"])(l[e]),i=(0,F["default"])(r[e]);return-1!==t.indexOf(e)?null:(s.push(N["default"].createElement("td",{className:o},a)),s.push(N["default"].createElement("td",{className:n,title:"Plan budżetu - Suma"},i)),s.push(N["default"].createElement("td",{className:"row__summary__cost"})),s)}.bind(this)),i.push(N["default"].createElement("td",{key:"totalCost",className:"row__summary__cost r"})),i.push(N["default"].createElement("td",{key:"totalPlan",className:"row__summary__plan r"})),a.push(N["default"].createElement("tr",{className:"row__summary__cost",key:"sum"},N["default"].createElement("td",{colSpan:"3",className:"p2",style:{textAlign:"right"}},"Suma:"),reactProjMonthCols,i)),a.push(N["default"].createElement("tr",{key:"total"},N["default"].createElement("td",{colSpan:s},o," projektów (dostęp do ",n,")"))),a}function P(){var e=this,t=[1,2,3,4,5,6,7,8,9,10,11,12];return reactTheadMonthCols=null,reactTheadMonthSubCols=null,reactMonthPickerDropdownList=null,reactTbodyRows=null,reactTfootRows=null,reactProjectMonthCostDetails=null,monthsPickerClassName=(0,R["default"])({"btn-group":!0,"pull-right":!0,dropdown:!0,month_cols_picker:!0,open:this.state.monthsPicker__opened}),monthsPicker__hiddenMonths=this.state.monthsPicker__hiddenMonths,tbodyClassNames=(0,R["default"])({showOnlySelected:this.state.showOnlySelected}),dbg=this.props.dbg,this.props.dbg&&console.log("Budget::render."),reactTheadMonthCols=this.renderTheadMonthCols(t),reactTheadMonthSubCols=this.renderTheadMonthSubCols(t),reactMonthPickerDropdownList=this.renderMonthPickerDropdownList(t),reactTbodyRows=this.renderTbodyRows(t),reactTfootRows=this.renderTfootRows(t),this.state.modalKorespInfo__opened&&(reactProjectMonthCostDetails=this.renderProjectMonthCostDetails()),N["default"].createElement("div",null,N["default"].createElement("div",{className:"container"},N["default"].createElement("div",{style:{"float":"right",color:"#aaa"}},this.props.today),N["default"].createElement("h1",null,"Zestawienie kosztów projektów na rok ",this.props.year)),N["default"].createElement("table",{cellSpacing:"0",cellPadding:"0",border:"0",id:"zestawienie-kosztow-projektow",className:"table-striped zestawienie-kosztow-tbl"},N["default"].createElement("thead",null,N["default"].createElement("tr",null,N["default"].createElement("td",{colSpan:"3",className:"p2"},N["default"].createElement("span",{className:"pull-right"},N["default"].createElement("b",null,"miesiąc "),N["default"].createElement("div",{className:monthsPickerClassName,ref:"monthsPicker"},N["default"].createElement("button",{className:"btn btn-sm btn-link dropdown-toggle",onClick:function(t){return e.toggleMonthsPicker(t)},style:{padding:"0px 10px"}},"wybierz ",N["default"].createElement("span",{className:"caret"})),N["default"].createElement("ul",{className:"dropdown-menu"},reactMonthPickerDropdownList)))),reactTheadMonthCols,N["default"].createElement("th",{colSpan:"2",className:"thead__cols_summary c"},"Suma")),N["default"].createElement("tr",null,N["default"].createElement("td",{colSpan:"3",className:"p2"},N["default"].createElement("span",{className:"pull-left",style:{whiteSpace:"nowrap"}},N["default"].createElement("input",{type:"checkbox",onClick:function(t){return e.toggleOnlySelected(t)}})," pokaż tylko zaznaczone")),reactTheadMonthSubCols,N["default"].createElement("th",{className:"thead__cols_summary c"},"Koszty"),N["default"].createElement("th",{className:"thead__cols_summary c"},"Plan"))),N["default"].createElement("tbody",{className:tbodyClassNames},reactTbodyRows),N["default"].createElement("tfoot",null,reactTfootRows)),reactProjectMonthCostDetails)}function w(e,t){return(0,D["default"])({},N["default"].Component.prototype,{props:e,context:t,state:W,componentWillMount:n,componentDidMount:a,clickedOutsideElement:i,toggleMonthsPicker:l,toggleMonth:m,showAllMonths:g,toggleOnlySelected:d,selectProject:y,getCost:v,getPlan:b,showModalKorespInfo:r,hideModalKorespInfo:p,showTooltipKorespInfoTitle:c,hideTooltipKorespInfoTitle:u,toggleTreeNode:f,treeIsVisible:h,getMonthCostDetails:_,renderProjectMonthCostDetails:O,renderTheadMonthCols:C,renderTheadMonthSubCols:E,renderMonthPickerDropdownList:T,renderTbodyRows:k,renderTfootRows:M,render:P})}Object.defineProperty(s,"__esModule",{value:!0});var S=e("react"),N=o(S),I=e("react-dom"),x=o(I),j=e("object-assign"),D=o(j),L=e("classnames"),R=o(L),K=e("./utils/parseFloatOrZero.js"),A=o(K),z=e("./utils/pricePrint.js"),F=o(z),V=e("./Msg.jsx"),B=(o(V),e("./MsgReply.jsx")),W=(o(B),{monthsPicker__opened:!1,monthsPicker__hiddenMonths:[],showOnlySelected:!1,selectedProjects:[],modalKorespInfo__opened:!1,modalKorespInfo__idProject:0,modalKorespInfo__month:0,treeLevelLimit:1,treeExpanded:[],treeHasChildren:[],dbg:!1});s["default"]=w,t.exports=s["default"]},{"./Msg.jsx":7,"./MsgReply.jsx":8,"./utils/parseFloatOrZero.js":10,"./utils/pricePrint.js":11,classnames:"classnames","object-assign":"object-assign",react:"react","react-dom":"react-dom"}],7:[function(e,t,s){function o(e){return e&&e.__esModule?e:{"default":e}}function n(){this.props.dbg&&console.log("Msg: Component mounted.")}function a(e){e.preventDefault(),this.props.dbg&&console.log("Msg: onClick. msg._read:",this.props.msg._read," msg._readByUser:",this.props.msg._readByUser),this.props.msg._readByUser||this.props.markAsRead(this.props.msg)}function i(e){e.preventDefault(),this.props.onClickReply(e,this.props.msg)}function l(){var e=this,t=this.props.msg,s=0,o="",n=null,a=null,i=null,l=[],r={borderTop:"1px solid #ddd",paddingTop:"10px"},p=(0,f["default"])({row:!0,message:!0,"message-read":!1});if(this.props.dbg&&console.log("Msg: render. msg:",t),"user"===t.toType?(o=" do ",n=c["default"].createElement("strong",null,t.to)):"group"===t.toType?(o=" do grupy ",n=c["default"].createElement("strong",null,t.to)):"everyone"===t.toType&&(o=" do ",n=c["default"].createElement("strong",null,"Wszystkich")),t._readByUser){var u=t.message.split("\n").map(function(e){return c["default"].createElement("div",{key:s++},e)});a=c["default"].createElement("div",{style:{marginBottom:"10px"}},u),i=c["default"].createElement("button",{className:"btn btn-xs btn-default",onClick:function(t){return e.handleClickReply(t)}},"odpisz")}else r.backgroundColor="#eee",a=c["default"].createElement("div",{style:{marginBottom:"10px",color:"#aaa",fontStyle:"italic",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},t.message),i=c["default"].createElement("button",{className:"btn btn-xs btn-default disabled",onClick:function(t){return e.handleClickReply(t)}},"odpisz");return t._readByUser?t._readDate?(l.push(c["default"].createElement("em",{key:"read_cofirmed",style:{display:"block"}},"przeczytana ",t._readDate)),t._readBy&&l.push(c["default"].createElement("em",{key:"read_by",style:{display:"block"}},"przez ",t._readBy))):t._read?l.push(c["default"].createElement("em",{key:"read_uncofirmed",style:{display:"block"}},"przeczytana")):l.push(c["default"].createElement("em",{key:"sent",style:{display:"block"}},"nieprzeczytana")):l.push(c["default"].createElement("em",{key:"unread",style:{display:"block"}},"nieprzeczytana")),c["default"].createElement("div",{className:p,"data-messageid":t.id,style:r,onClick:function(t){return e.handleClick(t)}},c["default"].createElement("div",{className:"col-md-1",style:{width:"60px"}},c["default"].createElement("a",{className:"user_avatar",href:"#",title:t.author},t.author.toUpperCase().substr(0,2))),c["default"].createElement("div",{className:"col-md-8"},c["default"].createElement("div",{style:{marginBottom:"10px"}},c["default"].createElement("strong",null,t.author),c["default"].createElement("span",{style:{margin:"0 4px"}},o),n,c["default"].createElement("span",{className:"pull-right"},c["default"].createElement("span",{style:{margin:"0 4px"}},t.created),i)),a),c["default"].createElement("div",{className:"col-md-3",style:{borderLeft:"1px dashed #ddd",textAlign:"right",color:"#ccc"}},l))}function r(e,t){return(0,d["default"])({},c["default"].Component.prototype,{props:e,context:t,state:m,componentDidMount:n,handleClick:a,handleClickReply:i,render:l})}Object.defineProperty(s,"__esModule",{value:!0});var p=e("react"),c=o(p),u=e("object-assign"),d=o(u),h=e("classnames"),f=o(h),m={someState:"Default state value."};s["default"]=r,t.exports=s["default"]},{classnames:"classnames","object-assign":"object-assign",react:"react"}],8:[function(e,t,s){function o(e){return e&&e.__esModule?e:{"default":e}}function n(){if(this.props.dbg&&console.log("MsgReply: Component mounted."),this.props.replyToMsg){var e=this.props.replyToMsg.id,t=document.getElementById("msgReplyTo"+e),s=t?t.offsetTop:0;s>0&&window.scroll(window.scrollX,s)}}function a(e,t){var s=this.state,o=this.props,n=!0;return s.to!=t.to&&(n=!1,this.props.dbg&&console.log("MsgReply: nextState",t,"state",this.state),Object.keys(s).forEach(function(e){"to"!=e&&s[e]!=t[e]&&(n=!0)}),Object.keys(o).forEach(function(t){o[t]!=e[t]&&(n=!0)})),n}function i(e){var t=this,s={isLoadingSaveResult:!1},o=this.props.dbg,n={message:this.state.message,to:this.state.to,toType:this.state.toType,idReplyTo:this.props.replyToMsg.id};e.preventDefault();var a=[];if(this.state.to||a.push("Proszę wybrać adresata wiadomości"),this.state.message?this.state.message.length<3&&a.push("Wiadomość jest za krótka"):a.push("Proszę wprowadzić treść wiadomości"),a.length>0)return void this.setState({errorMsgs:a});var i=function(e,n){if(e)throw e;var a={},i=t.state.errorMsgs;"success"===n.type?(a.successMsg=n.msg||"Wysłano wiadomość",n.record&&t.props.addMessage(n.record)):(i.push(n.msg||"Wystąpiły błędy"),a.errorMsgs=i);for(var l in s)s.hasOwnProperty(l)&&(a[l]=s[l]);o&&console.log("MsgReply: saveReplyResponseHandler setState",a),t.setState(a)};this.setState({isLoadingSaveResult:!0,errorMsgs:[]}),this.props.onSendReply(n,i)}function l(e){e.preventDefault(),this.props.onCancel(e)}function r(e){this.props.dbg&&console.log("MsgReply: TODO: handleChangeMsg",e.target.value),this.setState({message:e.target.value,errorMsgs:[]})}function p(e){this.props.dbg&&console.log("MsgReply: TODO: handleChangeToType",e.target.value),this.setState({toType:e.target.value,to:"",errorMsgs:[]})}function c(e){this.props.dbg&&console.log("MsgReply: TODO: handleChangeTo",e.target.value),this.setState({to:e.target.value,errorMsgs:[]})}function u(){var e=this,t=this.props.replyToMsg,s=this.props.dbg,o=this.props.usrLogin,n=this.state.toType,a=null,i=null,l=null,r=function(e,t){s&&console.log("MsgReply: this_handleChangeTo: val("+e+") objects("+t.length+"):",t),this.setState({to:e})}.bind(this),p=null,c=null;if(s&&console.log("MsgReply: render:1 ... {toType:"+n+"}"),this.state.errorMsgs.length>0){var u=0;p=this.state.errorMsgs.map(function(e){return f["default"].createElement("div",{key:"errorMsg"+u++,className:"alert alert-danger"},e)})}if(this.state.successMsg)return f["default"].createElement("div",{className:"row",style:{marginTop:"15px",paddingTop:"10px",borderTop:"1px solid #ddd"}},f["default"].createElement("div",{className:"col-md-8",style:{marginLeft:"60px"}},f["default"].createElement("div",{className:"alert alert-success"},this.state.successMsg)));if(c=this.state.isLoadingSaveResult?f["default"].createElement("button",{className:"btn btn-md btn-primary",onClick:function(t){return e.handleClickSend(t)}},"Wyślij ..."):f["default"].createElement("button",{className:"btn btn-md btn-primary",onClick:function(t){return e.handleClickSend(t)}},"Wyślij"),"everyone"==n)a=f["default"].createElement("input",{type:"text",className:"form-control",disabled:"disabled"});else if("user"==n){var d=function(e,t){var o=this.state._userTimerId;s&&console.log("MsgReply: getOptions("+e+"):1 (_userTimerId:"+o+") ..."),o&&(s&&console.log("MsgReply: getOptions("+e+"):2 (_userTimerId:"+o+") clear _userTimerId"),clearTimeout(o),this.state._userTimerId=!0);var n=this.props.fetchOptionsForUser;o=setTimeout(function(){n(e,t),o=null},400),this.state._userTimerId=o}.bind(this);s&&console.log("MsgReply: render:2 (_userTimerId) ..."),i=f["default"].createElement(v["default"],{name:"replyToUser",value:this.state.to,placeholder:"Użytkownik...",onChange:r,allowCreate:!1,multi:!1,autoload:!0,asyncOptions:d,cacheAsyncResults:!1})}else if("group"==n){var h=function(e,t){var o=this.state._groupTimerId;s&&console.log("MsgReply: getOptions("+e+"):1 (_groupTimerId:"+o+") ..."),o&&(s&&console.log("MsgReply: getOptions("+e+"):2 (_groupTimerId:"+o+") clear _groupTimerId"),clearTimeout(o),this.state._groupTimerId=null);var n=this.props.fetchOptionsForGroup;o=setTimeout(function(){n(e,t),o=null},400),this.state._groupTimerId=o}.bind(this);s&&console.log("MsgReply: render:2 (_groupTimerId) ..."),l=f["default"].createElement(v["default"],{name:"replyToGroup",value:this.state.to,placeholder:"Grupa...",onChange:r,allowCreate:!1,multi:!1,autoload:!0,asyncOptions:h,cacheAsyncResults:!1})}return f["default"].createElement("div",{className:"row",style:{overflow:"visible",borderTop:"1px solid #ddd",paddingTop:"10px"},id:"msgReplyTo"+t.id},f["default"].createElement("div",{className:"col-md-1"},f["default"].createElement("a",{className:"user_avatar",href:"#",title:o},o.toUpperCase().substr(0,2))),f["default"].createElement("div",{className:"col-md-8",style:{overflow:"visible"}},f["default"].createElement("div",{style:{minHeight:"40px"}},f["default"].createElement("div",{className:"row"},f["default"].createElement("label",{className:"col-sm-1 control-label",style:{lineHeight:"32px"}},"Do:"),f["default"].createElement("div",{className:"col-sm-3"},f["default"].createElement("select",{name:"to_type",className:"form-control",onChange:function(t){return e.handleChangeToType(t)},value:this.state.toType},f["default"].createElement("option",{value:"everyone"},"Wszyscy"),f["default"].createElement("option",{value:"user"},"Użytkownik"),f["default"].createElement("option",{value:"group"},"Grupa"))),f["default"].createElement("div",{className:"col-sm-8",style:{display:"everyone"==n?"block":"none"}},a),f["default"].createElement("div",{className:"col-sm-8",style:{display:"user"==n?"block":"none"}},i),f["default"].createElement("div",{className:"col-sm-8",style:{display:"group"==n?"block":"none"}},l))),f["default"].createElement("div",{className:"row"},f["default"].createElement("div",{className:"col-sm-12",style:{marginBottom:"5px"}},f["default"].createElement("textarea",{className:"form-control",onChange:function(t){return e.handleChangeMsg(t)},value:this.state.message}))),f["default"].createElement("div",{className:"row"},f["default"].createElement("div",{className:"col-sm-12",style:{marginBottom:"5px"}},p)),c,f["default"].createElement("button",{className:"pull-right btn btn-md btn-default",onClick:function(t){return e.handleClickCancel(t)}},"Anuluj")))}function d(e,t){return(0,g["default"])({},f["default"].Component.prototype,{props:e,context:t,state:b,componentDidMount:n,shouldComponentUpdate:a,handleClickSend:i,handleClickCancel:l,handleChangeMsg:r,handleChangeToType:p,handleChangeTo:c,render:u})}Object.defineProperty(s,"__esModule",{value:!0});var h=e("react"),f=o(h),m=e("object-assign"),g=o(m),y=e("react-select"),v=o(y),b={_groupTimerId:null,_userTimerId:null,message:"",to:"",toType:"user",errorMsgs:[],successMsg:"",isLoadingSaveResult:!1};s["default"]=d,t.exports=s["default"]},{"object-assign":"object-assign",react:"react","react-select":2}],9:[function(e,t,s){function o(e){return e&&e.__esModule?e:{"default":e}}var n=e("react"),a=o(n),i=e("react-dom"),l=o(i),r=e("./Budget"),p=o(r);!function(e){function t(){var t={},s={},o={},n={year:void 0,today:void 0,usrLogin:void 0,idThread:void 0,treeLevelLimit:1,projectPathsOrder:[],projectPathsMap:{},projectInfo:{},costs:{},plan:{},dbg:!1};return s.options={},s.init=function(){o.reactNode=l["default"].render(a["default"].createElement(p["default"],s.options),s.options.rootNode),s.options.dbg&&console.log("Budget_priv_init _state:",o),jQuery(".ttip").tooltip({container:"body"})},s.testMethod=function(e){var e=e||{};s.options.dbg&&console.log("Budget_priv_testMethod: args:",e)},t.run=function(e,t){if(s.options.dbg&&console.log('Budget_publ_run: typeof options === "'+typeof e+'"; options:',e),"string"==typeof e){var o=e;if(!s[o]||"function"!=typeof s[o])throw"Error method '"+o+"' not set!";s[o](t)}},t.init=function(o){return s.options.dbg&&console.log("Budget initialization...",o),e.extend(s.options,n,o),s.init(),t},t}if(!e||!e.fn)throw"Error: no jQuery!";e.fn.Budget=function(s,o){return s=s||{},o=o||{},this.each(function(){var n=e(this).data("Budget");n?n.run(s,o):(s.rootNode=this,e(this).data("Budget",(new t).init(s)))})}}(window.jQuery)},{"./Budget":6,react:"react","react-dom":"react-dom"}],10:[function(e,t,s){"use strict";function o(e){if(!e)return 0;var t=parseFloat(e);return isNaN(t)?0:t}Object.defineProperty(s,"__esModule",{value:!0}),s["default"]=o,t.exports=s["default"]},{}],11:[function(e,t,s){"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 s=e.toFixed(2).split("."),o=s[0],n=s[1],a=[],i="";"-"===o.substr(0,1)&&(i="-",o=o.substr(1));for(var l=o.length,r=o,p=0;l>3;)a.unshift(r.substr(-3)),l-=3,r=r.substr(0,l),p++;return l>0&&a.unshift(r),""+i+a.join(",")+"."+n}Object.defineProperty(s,"__esModule",{value:!0}),s["default"]=o,t.exports=s["default"]},{}]},{},[9]); //# sourceMappingURL=bundle.se_route_budget.js.map