1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[644],{32258:function(e,t,n){"use strict";var r=n(59499),o=n(7350),i=n.n(o),c=n(85893);function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.Z=function(e){var t=e.title,n=e.info,r=e.element,o=e.color,a=void 0===o?"#4791f1":o,l=e.home,u=void 0!==l&&l,d=e.cardStyle,h=e.onClick,f=e.clickable,p=void 0!==f&&f;return(0,c.jsx)("div",{className:"".concat(u?i().cardhome:i().card," ").concat(p?i().cardHoverable:null),onClick:h,style:s({cursor:"pointer",borderLeft:u?"7px solid ".concat(a):"15px solid ".concat(a)},d),children:(0,c.jsxs)("div",{className:i().columnParent,children:[(0,c.jsxs)("div",{style:{width:"100%"},children:[(0,c.jsx)("h2",{className:i().cardTitle,children:t}),(0,c.jsxs)("div",{className:i().columnParent,children:[(0,c.jsx)("div",{children:n.map((function(e,t){return(0,c.jsxs)("h4",{className:i().cardInfo,children:[(0,c.jsx)("span",{className:i().bold,children:e.name}),(0,c.jsxs)("span",{style:{fontWeight:e.fontWeight||500,color:e.color||"black"},children:[" ",e.description]})]},e.name)}))}),(0,c.jsx)("div",{className:i().graphParent,children:r})]})]}),p?(0,c.jsx)("div",{className:i().arrowParent,children:(0,c.jsx)("p",{className:i().arrowCard,children:"\u203a"})}):null]})})}},18518:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return R}});var r=n(59499),o=n(27812),i=n(16835),c=n(76307),a=n.n(c),s=n(38672),l=n(81118),u=n(67294),d=n(59575),h=n(7026),f=n(2944),p=n(21608),v=n(31555),m=n(73807),j=n(53342),x=n(51436),b=n(842),_=n(32258),g=n(56670),y=n(23259),C=n(11163),w=n(4542),k=n(3298),N=n(67814),Z=n(85893),O=u.createContext(void 0);O.displayName="LanguageContext";var P=n(67421);function A(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function S(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(Object(n),!0).forEach((function(t){(0,r.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function I(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return D(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return D(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var G=["open","pending","merged","closed"],W=["request","incident","change","other","problem"],E=["low","medium","high","critical"],H=function(){var e=(0,P.$G)().t,t=(0,l._$)({fetchPolicy:"cache-and-network"}),n=(0,i.Z)(t,2),c=n[0],A=n[1],D=A.data,H=A.loading,R=(A.error,(0,u.useState)(!0)),q=R[0],B=R[1],T=(0,u.useState)(""),z=T[0],L=T[1],M=(0,u.useState)({states:[],types:[],priorities:[]}),$=M[0],K=M[1],U=(0,C.useRouter)(),X=(0,u.useState)(-1),J=X[0],Q=X[1],V=(0,u.useContext)(O);(0,u.useEffect)((function(){var e;U.isReady&&Q(U.query?parseInt(null===(e=U.query)||void 0===e?void 0:e.bolsaID):-1)}),[U.isReady,U.query]),(0,u.useEffect)((function(){c()}),[]),(0,u.useEffect)((function(){}),[$]),J&&D&&!D.blockHours.find((function(e){return e.contratoID===J}))&&U.push("/paquetesHoras");var Y,ee=function(e,t){K(S(S({},$),{},(0,r.Z)({},e,$[e].some((function(e){return e===t}))?$[e].filter((function(e){return t!==e})):[].concat((0,o.Z)($[e]),[t]))))},te=function(e,t){if(""===t)return!0;
1if(e.title.toLowerCase().includes(t))return!0;for(var n=0;n<e.info.length;n++)if(e.info[n].description.toLowerCase().includes(t))return!0;return!1};return(0,Z.jsx)(s.Z,{title:"Empatiza - ".concat(e("hours_packages")),children:(0,Z.jsxs)("div",{className:a().container,children:[(0,Z.jsxs)("h1",{className:a().titulo,children:[e("hours_packages"),D&&J?": Tickets":""]}),(0,Z.jsx)("div",{className:a().divfilterbutton,children:(0,Z.jsx)(j.Z,{text:e("back").toUpperCase(),width:118,background:"#f49d1c",onclick:function(){return U.push("/paquetesHoras")},icon:x.wzR})}),D&&J?function(t){var n=[];if(0===t.blockHours.length)n.push((0,Z.jsx)("p",{className:a().noResultados,children:e("result_without_being_fonded")}));else{var r=t.blockHours.filter((function(e){return"".concat(e.contratoID)==U.query.bolsaID}));(0,w.formatDataContracts)(r,!1,e).map((function(e,t){n.push((0,Z.jsx)(_.Z,{title:e.title,info:e.info,color:e.color,element:e.element,cardStyle:{margin:0}},"proj_"+t))}))}return n}(D):null,(0,Z.jsxs)(p.Z,{className:a().noMarginRight,children:[(0,Z.jsx)(v.Z,{lg:4,md:6,sm:8,xs:12,className:a().w100,children:(0,Z.jsxs)("div",{className:a().divfilter,children:[(0,Z.jsx)("p",{className:a().buscar,children:e("search")}),(0,Z.jsx)(m.Z,{onChange:function(e){L(e)}})]})}),(0,Z.jsx)("div",{className:a().divfilterbutton,children:(0,Z.jsx)(j.Z,{text:e("filter"),onclick:function(){B(!q)},icon:x.G_j})})]}),(0,Z.jsx)(p.Z,{children:(0,Z.jsx)(v.Z,{lg:12,md:12,sm:12,xs:12,className:a().w100,children:(Y=q,(0,Z.jsx)(h.Z,{show:Y,children:(0,Z.jsxs)("div",{className:"parent-cols",children:[(0,Z.jsx)("div",{className:"col-4-n",children:(0,Z.jsx)(f.Z,{title:e("status"),children:(0,Z.jsx)(Z.Fragment,{children:G.map((function(t,n){return(0,Z.jsx)(b.Z,{checkKey:"CBbh_s"+n,title:e(G[n]),onclick:function(){return ee("states",G[n])},toCheck:$.states.includes(G[n])},"CB_bh"+n)}))})})}),(0,Z.jsx)("div",{className:"col-4-n",children:(0,Z.jsx)(f.Z,{title:e("type"),children:(0,Z.jsx)(Z.Fragment,{children:W.map((function(t,n){return(0,Z.jsx)(b.Z,{checkKey:"CBbh_t"+n,title:e(W[n])||"",onclick:function(){return ee("types",W[n])},toCheck:$.types.includes(W[n])},"CB_bh"+n)}))})})}),(0,Z.jsx)("div",{className:"col-4-n",children:(0,Z.jsx)(f.Z,{title:e("priority"),children:(0,Z.jsx)(Z.Fragment,{children:E.map((function(t,n){return(0,Z.jsx)(b.Z,{checkKey:"CBprio_"+n,title:e(E[n])||"",onclick:function(){return ee("priorities",E[n])},toCheck:$.priorities.includes(E[n])},"CB_prio"+n)}))})})})]})},"filter_renovaciones"))})}),(0,Z.jsx)("div",{className:a().cardDeck,children:(0,Z.jsx)(p.Z,{children:E.map((function(t,n){return(0,Z.jsx)(v.Z,{children:(0,Z.jsxs)("p",{className:a().legendP,children:[(0,Z.jsx)("span",{className:a().legendPoint,style:{color:F(t)},children:"\u25cf"}),e(t)]})},"CF_"+n)}))})}),D?(0,Z.jsx)(y.Z,{elements:function(t){if(!t||!t.tickets)return[];var n=[];return 0===t.tickets.length?n.push((0,Z.jsx)("p",{className:a().noResultados,children:e("result_without_being_fonded")})):function(t,n){var r=(0,o.Z)(t);r.sort((function(e,t){return e.ticketID>t.ticketID?-1:1}));var i,c=[],a=I(r=r.filter((function(e){return(0===$.states.length||$.states.includes(e.estado))&&(0===$.types.length||$.types.includes(e.tipo))&&(0===$.priorities.length||$.priorities.includes(e.prioridad))})));try{for(a.s();!(i=a.n()).done;){var s=i.value,l=[],u="".concat((0,g.wd)(parseInt(s.fechaCreado))," - ").concat(s.fechaFin?(0,g.wd)(parseInt(s.fechaFin)):"");l.push({name:e("date_dots"),description:u});var d=(s.entradas||[]).reduce((function(e,t){return e+(t.fin-t.inicio)/6e4}),0);l.push({name:e("total_time_dots"),description:"".concat(Math.trunc(d/60),"h ").concat(Math.trunc(d%60),"m")||0}),l.push({name:e("priority_dots"),description:"".concat(null===V||void 0===V?void 0:V.getTraduction(s.prioridad))}),l.push({name:e("status_dots"),description:"".concat(null===V||void 0===V?void 0:V.getTraduction(s.estado))}),l.push({name:e("type_dots"),description:"".concat(null===V||void 0===V?void 0:V.getTraduction(s.tipo))}),l.push({name:"".concat(e("technician"),":"),description:"".concat(s.technician?"".concat(s.technician.name," ").concat(s.technician.surname):"-")}),c.push({pretitle:"#".concat(s.ticketID),title:s.titulo||e("hours_bag"),color:F(s.prioridad),info:l})}}catch(h){a.e(h)}finally{a.f()}return c}(t.tickets).map((function(e,t){(""===z||e&&te(e,z.toLowerCase()))&&n.push((0,Z.jsx)(k.Z,{iconBackgroun
1d:(0,Z.jsx)(N.G,{icon:x.mG2,className:a().backgroundIcon}),pretitle:e.pretitle,title:e.title,info:e.info,color:e.color},"tick_"+t))})),n}(D.blockHours.find((function(e){return e.contratoID===J})))}):null,H&&!D?(0,Z.jsx)("div",{className:a().spinner,children:(0,Z.jsx)(d.Z,{})}):null]})})},F=function(e){return"low"===e?"var(--greenblue-pie)":"medium"===e?"var(--yellow-pie)":"high"===e?"var(--orange-pie)":"var(--red-pie)"};H.requireAuth=!0;var R=H},4542:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return I},formatDataContracts:function(){return S}});var r=n(27812),o=n(16835),i=n(76307),c=n.n(i),a=n(38672),s=n(81118),l=n(67294),u=n(59575),d=n(7026),h=n(2944),f=n(21608),p=n(31555),v=n(73807),m=n(53342),j=n(51436),x=n(842),b=n(32258),_=n(56670),g=n(23259),y=n(85893),C=function(e){return e<90?"green":e<100?"orange":"red"},w=function(e){var t=e.percentage,n=e.subtitle,r=e.style,o={};return o["--p"]=t,o["--c"]=(null===r||void 0===r?void 0:r.color)||C(t),o["--b"]="".concat((null===r||void 0===r?void 0:r.border)||16,"px"),o["--w"]="".concat((null===r||void 0===r?void 0:r.width)||120,"px"),(0,y.jsxs)("div",{className:"pie animate no-round",style:o,children:[(0,y.jsxs)("span",{className:"percentage",style:{fontSize:(null===r||void 0===r?void 0:r.fontSizeNumber)||24},children:[t,"%"]}),(0,y.jsx)("span",{className:"division",style:{fontSize:(null===r||void 0===r?void 0:r.fontSizeSubtitle)||16},children:n})]})},k=n(11163),N=n(67421);function Z(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"===typeof e)return O(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return O(e,t)}(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return c=e.done,e},e:function(e){a=!0,i=e},f:function(){try{c||null==n.return||n.return()}finally{if(a)throw i}}}}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var P=["Activo","No activo"],A=function(){var e=(0,N.$G)().t,t=(0,s._$)({fetchPolicy:"cache-and-network"}),n=(0,o.Z)(t,2),i=n[0],_=n[1],C=_.data,w=_.loading,Z=(_.error,(0,l.useState)(!0)),O=Z[0],A=Z[1],I=(0,l.useState)(""),D=I[0],G=I[1],W=(0,l.useState)(["Activo"]),E=W[0],H=W[1],F=(0,l.useState)(-1),R=F[0],q=(F[1],(0,k.useRouter)());(0,l.useEffect)((function(){i()}),[]);var B,T=function(e,t){if(""===t)return!0;if(e.title.toLowerCase().includes(t))return!0;for(var n=0;n<e.info.length;n++)if(e.info[n].description.toLowerCase().includes(t))return!0;return!1};return(0,y.jsx)(a.Z,{title:"Empatiza - ".concat(e("hours_packages")),children:-1===R?(0,y.jsxs)("div",{className:c().container,children:[(0,y.jsx)("h1",{className:c().titulo,children:e("hours_packages")}),(0,y.jsxs)(f.Z,{className:c().noMarginRight,children:[(0,y.jsx)(p.Z,{lg:4,md:6,sm:8,xs:12,className:c().w100,children:(0,y.jsxs)("div",{className:c().divfilter,children:[(0,y.jsx)("p",{className:c().buscar,children:e("search")}),(0,y.jsx)(v.Z,{onChange:function(e){G(e)}})]})}),(0,y.jsx)("div",{className:c().divfilterbutton,children:(0,y.jsx)(m.Z,{text:e("filter").toUpperCase(),onclick:function(){A(!O)},icon:j.G_j})})]}),(0,y.jsx)(f.Z,{children:(0,y.jsx)(p.Z,{lg:12,md:12,sm:12,xs:12,className:c().w100,children:(B=O,(0,y.jsx)(d.Z,{show:B,children:(0,y.jsx)(h.Z,{title:e("status"),children:(0,y.jsx)(y.Fragment,{children:P.map((function(t,n){return(0,y.jsx)(x.Z,{checkKey:"CBbh_"+n,title:e(P[n].replace(/\s+/g,"")),onclick:function(){return t=e(P[n].replace(/\s+/g,"")),void H(E.some((function(e){return e===t}))?E.filter((function(e){return t!==e})):[].concat((0,r.Z)(E),[t]));var t},toCheck:E.includes(e(P[n].replace(/\s+/g,"")))},"CB_bh"+n)}))})})},"filter_renovaciones"))})}),C?(0,y.jsx)(g.Z,{elements:function(t){var n=[];if(0===t.blockHours.length)n.push((0,y.jsx)("p",{className:c().noResultados,children:e("result_without_being_fonded")}));else{var r=t.blockHours.filter((function(e){return 0===E.length||e.activo&&E.includes(P[0])||!e.activo&&E.includes(P[1])}));S(r,!1,e).map((function(e,t){""===D?n.push((0,y.jsx)(b.Z,{onClick:function(){return q.push("/paquetesHoras/".concat(e.ID))}
1,title:e.title,info:e.info,color:e.color,element:e.element,clickable:!0},"proj_"+t)):e&&T(e,D.toLowerCase())&&n.push((0,y.jsx)(b.Z,{title:e.title,info:e.info,color:e.color,element:e.element,clickable:!0},"proj_"+t))}))}return n}(C)}):null,w&&!C?(0,y.jsxs)("div",{className:c().spinner,children:[(0,y.jsx)("div",{style:{height:30}}),(0,y.jsx)(u.Z,{})]}):null]}):{}})},S=function(e,t,n){var o=(0,r.Z)(e);o.sort((function(e,t){var n=e.inicio||99999999999999,r=t.inicio||99999999999999;return n<r?-1:n>r?1:0}));var i,c=[],a=Z(o);try{for(a.s();!(i=a.n()).done;){var s,l,u,d,h,f,p,v,m,j=i.value,x=[];x.push({name:"".concat(n("code"),":"),description:j.businessCentralProjectID||j.numPedido||""}),x.push({name:"".concat(n("dates"),":"),description:"".concat((0,_.wd)(parseInt(j.inicio))," - ").concat(j.fin?(0,_.wd)(parseInt(j.fin)):"Sin asignar")}),x.push({name:"".concat(n("included_hours"),":"),description:"".concat(null===(s=j.recap)||void 0===s?void 0:s.horasContratadas)||"-"}),x.push({name:"".concat(n("hours_left"),":"),description:"".concat(null===(l=j.recap)||void 0===l||null===(u=l.horasRestantes)||void 0===u?void 0:u.toFixed(1))||"-",color:C(j.recap?100*(null===(d=j.recap)||void 0===d?void 0:d.horasConsumidas)/(null===(h=j.recap)||void 0===h?void 0:h.horasContratadas):0),fontWeight:800}),c.push({ID:j.contratoID,title:j.nombre||"Bolsa de horas",color:j.activo?"green":"red",info:x,element:(0,y.jsx)(w,{percentage:j.recap?parseFloat((100*(null===(f=j.recap)||void 0===f?void 0:f.horasConsumidas)/(null===(p=j.recap)||void 0===p?void 0:p.horasContratadas)).toFixed(1)):0,subtitle:"".concat(((null===(v=j.recap)||void 0===v?void 0:v.horasConsumidas)||0).toFixed(1),"/").concat(null===(m=j.recap)||void 0===m?void 0:m.horasContratadas),style:{border:4,width:106}})})}}catch(b){a.e(b)}finally{a.f()}return c};A.requireAuth=!0;var I=A},58443:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/paquetesHoras/[bolsaID]",function(){return n(18518)}])},7350:function(e){e.exports={subNav:"CardWithColorAndGraph_subNav__Iuxz1",titulo:"CardWithColorAndGraph_titulo__xoJvF",container:"CardWithColorAndGraph_container__30GxL",cardDeck:"CardWithColorAndGraph_cardDeck__o8Xp3",card:"CardWithColorAndGraph_card__kAQR_",cardhome:"CardWithColorAndGraph_cardhome__I7rFC",cardHoverable:"CardWithColorAndGraph_cardHoverable__HcbNV",cardTitle:"CardWithColorAndGraph_cardTitle__19Wch",cardInfo:"CardWithColorAndGraph_cardInfo__Sy4tw",bold:"CardWithColorAndGraph_bold__cIyBW",columnParent:"CardWithColorAndGraph_columnParent__iEeS_",arrowParent:"CardWithColorAndGraph_arrowParent__znXY4",arrowCard:"CardWithColorAndGraph_arrowCard__yNfAZ",graphParent:"CardWithColorAndGraph_graphParent__hv2RH"}}},function(e){e.O(0,[835,236,774,888,179],(function(){return t=58443,e(e.s=t);var t}));var t=e.O();_N_E=t}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.