1(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[1951],{ 2 3/***/ 2963: 4/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 5 6"use strict"; 7 8// EXPORTS 9__webpack_require__.d(__webpack_exports__, { 10 "Z": function() { return /* binding */ Breadcrumbs_Breadcrumbs; } 11}); 12 13// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js 14var esm_extends = __webpack_require__(7462); 15// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js 16var objectWithoutPropertiesLoose = __webpack_require__(3366); 17// EXTERNAL MODULE: ./node_modules/react/index.js 18var react = __webpack_require__(7294); 19// EXTERNAL MODULE: ./node_modules/react-is/index.js 20var react_is = __webpack_require__(9864); 21// EXTERNAL MODULE: ./node_modules/clsx/dist/clsx.mjs 22var clsx = __webpack_require__(512); 23// EXTERNAL MODULE: ./node_modules/@mui/material/node_modules/@mui/utils/esm/composeClasses/composeClasses.js 24var composeClasses = __webpack_require__(5463); 25// EXTERNAL MODULE: ./node_modules/@mui/material/node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js 26var useSlotProps = __webpack_require__(2208); 27// EXTERNAL MODULE: ./node_modules/@mui/material/styles/styled.js 28var styled = __webpack_require__(948); 29// EXTERNAL MODULE: ./node_modules/@mui/material/DefaultPropsProvider/DefaultPropsProvider.js 30var DefaultPropsProvider = __webpack_require__(8628); 31// EXTERNAL MODULE: ./node_modules/@mui/material/Typography/Typography.js + 1 modules 32var Typography = __webpack_require__(5861); 33// EXTERNAL MODULE: ./node_modules/@mui/system/colorManipulator.js 34var colorManipulator = __webpack_require__(2101); 35// EXTERNAL MODULE: ./node_modules/@mui/material/utils/createSvgIcon.js 36var createSvgIcon = __webpack_require__(2066); 37// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 38var jsx_runtime = __webpack_require__(5893); 39;// CONCATENATED MODULE: ./node_modules/@mui/material/internal/svg-icons/MoreHoriz.js 40'use client'; 41 42 43 44 45/** 46 * @ignore - internal component. 47 */ 48 49/* harmony default export */ var MoreHoriz = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/(0,jsx_runtime.jsx)("path", { 50 d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" 51}), 'MoreHoriz')); 52// EXTERNAL MODULE: ./node_modules/@mui/material/ButtonBase/ButtonBase.js + 7 modules 53var ButtonBase = __webpack_require__(7739); 54;// CONCATENATED MODULE: ./node_modules/@mui/material/Breadcrumbs/BreadcrumbCollapsed.js 55'use client'; 56 57 58 59const _excluded = ["slots", "slotProps"]; 60 61 62 63 64 65 66 67const BreadcrumbCollapsedButton = (0,styled/* default */.ZP)(ButtonBase/* default */.Z)(({ 68 theme 69}) => (0,esm_extends/* default */.Z)({ 70 display: 'flex', 71 marginLeft: `calc(${theme.spacing(1)} * 0.5)`, 72 marginRight: `calc(${theme.spacing(1)} * 0.5)` 73}, theme.palette.mode === 'light' ? { 74 backgroundColor: theme.palette.grey[100], 75 color: theme.palette.grey[700] 76} : { 77 backgroundColor: theme.palette.grey[700], 78 color: theme.palette.grey[100] 79}, { 80 borderRadius: 2, 81 '&:hover, &:focus': (0,esm_extends/* default */.Z)({}, theme.palette.mode === 'light' ? { 82 backgroundColor: theme.palette.grey[200] 83 } : { 84 backgroundColor: theme.palette.grey[600] 85 }), 86 '&:active': (0,esm_extends/* default */.Z)({ 87 boxShadow: theme.shadows[0] 88 }, theme.palette.mode === 'light' ? { 89 backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.grey[200], 0.12) 90 } : { 91 backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.grey[600], 0.12) 92 }) 93})); 94const BreadcrumbCollapsedIcon = (0,styled/* default */.ZP)(MoreHoriz)({ 95 width: 24, 96 height: 16 97}); 98 99/** 100 * @ignore - internal component. 101 */ 102function BreadcrumbCollapsed(props) { 103 const { 104 slots = {}, 105 slotProps = {} 106 } = props, 107 otherProps = (0,objectWithoutPropertiesLoose/* default */.Z)(props, _excluded); 108 const ownerState = props; 109 return /*#__PURE__*/(0,jsx_runtime.jsx)("li", { 110 children: /*#__PURE__*/(0,jsx_runtime.jsx)(BreadcrumbCollapsedButton, (0,esm_extends/* default */.Z)({ 111 focusRipple: true 112 }, otherProps, { 113 ownerState: ownerState, 114 children: /*#__PURE__*/(0,jsx_runtime.jsx)(BreadcrumbCollapsedIcon, (0,esm_extends/* default */.Z)({ 115 as: slots.CollapsedIcon, 116 ownerState: ownerState 117 }, slotProps.collapsedIcon)) 118 })) 119 }); 120} 121 false ? 0 : void 0; 122/* harmony default export */ var Breadcrumbs_BreadcrumbCollapsed = (BreadcrumbCollapsed); 123// EXTERNAL MODULE: ./node_modules/@mui/material/node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js 124var generateUtilityClasses = __webpack_require__(5154); 125// EXTERNAL MODULE: ./node_modules/@mui/material/node_modules/@mui/utils/esm/generateUtilityClass/generateUtilityClass.js 126var generateUtilityClass = __webpack_require__(2104); 127;// CONCATENATED MODULE: ./node_modules/@mui/material/Breadcrumbs/breadcrumbsClasses.js 128 129 130function getBreadcrumbsUtilityClass(slot) { 131 return (0,generateUtilityClass/* default */.ZP)('MuiBreadcrumbs', slot); 132} 133const breadcrumbsClasses = (0,generateUtilityClasses/* default */.Z)('MuiBreadcrumbs', ['root', 'ol', 'li', 'separator']); 134/* harmony default export */ var Breadcrumbs_breadcrumbsClasses = (breadcrumbsClasses); 135;// CONCATENATED MODULE: ./node_modules/@mui/material/Breadcrumbs/Breadcrumbs.js 136'use client'; 137 138 139 140const Breadcrumbs_excluded = ["children", "className", "component", "slots", "slotProps", "expandText", "itemsAfterCollapse", "itemsBeforeCollapse", "maxItems", "separator"]; 141 142 143 144 145 146 147 148 149 150 151 152 153 154const useUtilityClasses = ownerState => { 155 const { 156 classes 157 } = ownerState; 158 const slots = { 159 root: ['root'], 160 li: ['li'], 161 ol: ['ol'], 162 separator: ['separator'] 163 }; 164 return (0,composeClasses/* default */.Z)(slots, getBreadcrumbsUtilityClass, classes); 165}; 166const BreadcrumbsRoot = (0,styled/* default */.ZP)(Typography/* default */.Z, { 167 name: 'MuiBreadcrumbs', 168 slot: 'Root', 169 overridesResolver: (props, styles) => { 170 return [{ 171 [`& .${Breadcrumbs_breadcrumbsClasses.li}`]: styles.li 172 }, styles.root]; 173 } 174})({}); 175const BreadcrumbsOl = (0,styled/* default */.ZP)('ol', { 176 name: 'MuiBreadcrumbs', 177 slot: 'Ol', 178 overridesResolver: (props, styles) => styles.ol 179})({ 180 display: 'flex', 181 flexWrap: 'wrap', 182 alignItems: 'center', 183 padding: 0, 184 margin: 0, 185 listStyle: 'none' 186}); 187const BreadcrumbsSeparator = (0,styled/* default */.ZP)('li', { 188 name: 'MuiBreadcrumbs', 189 slot: 'Separator', 190 overridesResolver: (props, styles) => styles.separator 191})({ 192 display: 'flex', 193 userSelect: 'none', 194 marginLeft: 8, 195 marginRight: 8 196}); 197function insertSeparators(items, className, separator, ownerState) { 198 return items.reduce((acc, current, index) => { 199 if (index < items.length - 1) { 200 acc = acc.concat(current, /*#__PURE__*/(0,jsx_runtime.jsx)(BreadcrumbsSeparator, { 201 "aria-hidden": true, 202 className: className, 203 ownerState: ownerState, 204 children: separator 205 }, `separator-${index}`)); 206 } else { 207 acc.push(current); 208 } 209 return acc; 210 }, []); 211} 212const Breadcrumbs = /*#__PURE__*/react.forwardRef(function Breadcrumbs(inProps, ref) { 213 const props = (0,DefaultPropsProvider/* useDefaultProps */.i)({ 214 props: inProps, 215 name: 'MuiBreadcrumbs' 216 }); 217 const { 218 children, 219 className, 220 component = 'nav', 221 slots = {}, 222 slotProps = {}, 223 expandText = 'Show path', 224 itemsAfterCollapse = 1, 225 itemsBeforeCollapse = 1, 226 maxItems = 8, 227 separator = '/' 228 } = props, 229 other = (0,objectWithoutPropertiesLoose/* default */.Z)(props, Breadcrumbs_excluded); 230 const [expanded, setExpanded] = react.useState(false); 231 const ownerState = (0,esm_extends/* default */.Z)({}, props, { 232 component, 233 expanded, 234 expandText, 235 itemsAfterCollapse, 236 itemsBeforeCollapse, 237 maxItems, 238 separator 239 }); 240 const classes = useUtilityClasses(ownerState); 241 const collapsedIconSlotProps = (0,useSlotProps/* default */.Z)({ 242 elementType: slots.CollapsedIcon, 243 externalSlotProps: slotProps.collapsedIcon, 244 ownerState 245 }); 246 const listRef = react.useRef(null); 247 const renderItemsBeforeAndAfter = allItems => { 248 const handleClickExpand = () => { 249 setExpanded(true); 250 251 // The clicked element received the focus but gets removed from the DOM.
252 // Let's keep the focus in the component after expanding. 253 // Moving it to the <ol> or <nav> does not cause any announcement in NVDA. 254 // By moving it to some link/button at least we have some announcement. 255 const focusable = listRef.current.querySelector('a[href],button,[tabindex]'); 256 if (focusable) { 257 focusable.focus(); 258 } 259 }; 260 261 // This defends against someone passing weird input, to ensure that if all 262 // items would be shown anyway, we just show all items without the EllipsisItem 263 if (itemsBeforeCollapse + itemsAfterCollapse >= allItems.length) { 264 if (false) {} 265 return allItems; 266 } 267 return [...allItems.slice(0, itemsBeforeCollapse), /*#__PURE__*/(0,jsx_runtime.jsx)(Breadcrumbs_BreadcrumbCollapsed, { 268 "aria-label": expandText, 269 slots: { 270 CollapsedIcon: slots.CollapsedIcon 271 }, 272 slotProps: { 273 collapsedIcon: collapsedIconSlotProps 274 }, 275 onClick: handleClickExpand 276 }, "ellipsis"), ...allItems.slice(allItems.length - itemsAfterCollapse, allItems.length)]; 277 }; 278 const allItems = react.Children.toArray(children).filter(child => { 279 if (false) {} 280 return /*#__PURE__*/react.isValidElement(child); 281 }).map((child, index) => /*#__PURE__*/(0,jsx_runtime.jsx)("li", { 282 className: classes.li, 283 children: child 284 }, `child-${index}`)); 285 return /*#__PURE__*/(0,jsx_runtime.jsx)(BreadcrumbsRoot, (0,esm_extends/* default */.Z)({ 286 ref: ref, 287 component: component, 288 color: "text.secondary", 289 className: (0,clsx/* default */.Z)(classes.root, className), 290 ownerState: ownerState 291 }, other, { 292 children: /*#__PURE__*/(0,jsx_runtime.jsx)(BreadcrumbsOl, { 293 className: classes.ol, 294 ref: listRef, 295 ownerState: ownerState, 296 children: insertSeparators(expanded || maxItems && allItems.length <= maxItems ? allItems : renderItemsBeforeAndAfter(allItems), classes.separator, separator, ownerState) 297 }) 298 })); 299}); 300 false ? 0 : void 0; 301/* harmony default export */ var Breadcrumbs_Breadcrumbs = (Breadcrumbs); 302 303/***/ }), 304 305/***/ 2043: 306/***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { 307 308 309 (window.__NEXT_P = window.__NEXT_P || []).push([ 310 "/Main/Life", 311 function () { 312 return __webpack_require__(544); 313 } 314 ]); 315 if(false) {} 316 317 318/***/ }), 319 320/***/ 3159: 321/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 322 323"use strict"; 324/* harmony export */ __webpack_require__.d(__webpack_exports__, { 325/* harmony export */ "c": function() { return /* binding */ useLifeExchange; } 326/* harmony export */ }); 327/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 328 329const useLifeExchange = (consumer_entity_id)=>{ 330 const [isLoading, setIsLoading] = react__WEBPACK_IMPORTED_MODULE_0__.useState(true); 331 const [error, setError] = react__WEBPACK_IMPORTED_MODULE_0__.useState(); 332 const [data, setData] = react__WEBPACK_IMPORTED_MODULE_0__.useState(); 333 const [lifes, setLifes] = react__WEBPACK_IMPORTED_MODULE_0__.useState(); 334 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(()=>{ 335 const fetchData = async ()=>{ 336 const lifeExchange = await fetch("/api/getExchangeAndTypes", { 337 method: "POST", 338 body: JSON.stringify({ 339 consumer_entity_id: consumer_entity_id 340 }) 341 }); 342 const lifeExchangeJson = await lifeExchange.json(); 343 lifeExchangeJson.error ? setError(lifeExchangeJson) : setData(lifeE
343xchangeJson); 344 }; 345 const fetchLife = async ()=>{ 346 const lifes = await fetch("/api/getLifes", { 347 method: "POST", 348 body: JSON.stringify({ 349 consumer_entity_id: consumer_entity_id 350 }) 351 }); 352 const lifesJson = await lifes.json(); 353 lifesJson.error ? setError(lifesJson) : setLifes(lifesJson); 354 }; 355 if (consumer_entity_id) { 356 setIsLoading(true); 357 fetchData(); 358 fetchLife().finally(()=>setIsLoading(false)); 359 } 360 }, [ 361 consumer_entity_id 362 ]); 363 return { 364 isLoading, 365 error, 366 data, 367 lifes 368 }; 369}; 370 371 372/***/ }), 373 374/***/ 7254: 375/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 376 377"use strict"; 378/* harmony export */ __webpack_require__.d(__webpack_exports__, { 379/* harmony export */ "P": function() { return /* binding */ useUserInfo; } 380/* harmony export */ }); 381/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7294); 382/* harmony import */ var _context_HomeContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7056); 383 384 385const useUserInfo = (response)=>{ 386 const { saveServiceAndPos , contextUserData , position } = react__WEBPACK_IMPORTED_MODULE_0__.useContext(_context_HomeContext__WEBPACK_IMPORTED_MODULE_1__/* .HomeContext */ .Q); 387 const contextAArray = []; 388 react__WEBPACK_IMPORTED_MODULE_0__.useEffect(()=>{ 389 response === null || response === void 0 ? void 0 : response.customer_info.map((element, position)=>{ 390 const x = { 391 userData: element, 392 pos: position 393 }; 394 contextAArray.push(x); 395 }); 396 saveServiceAndPos(contextAArray); 397 // eslint-disable-next-line react-hooks/exhaustive-deps 398 }, [ 399 response 400 ]); 401 return { 402 contextUserData, 403 position 404 }; 405}; 406 407 408/***/ }), 409 410/***/ 8989: 411/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 412 413"use strict"; 414/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5893); 415/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7294); 416/* harmony import */ var _mui_material_Box__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(822); 417/* harmony import */ var _mui_material_Modal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3206); 418/* harmony import */ var _ModalGeneric_styleModalGeneric_module_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8641); 419/* harmony import */ var _ModalGeneric_styleModalGeneric_module_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_ModalGeneric_styleModalGeneric_module_css__WEBPACK_IMPORTED_MODULE_4__); 420 421 422 423 424 425function ModalGeneric(props) { 426 return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { 427 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Modal__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, { 428 open: props.open, 429 onClose: props.handleClose, 430 "aria-labelledby": "modal-modal-title", 431 "aria-describedby": "modal-modal-description", 432 children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_mui_material_Box__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { 433 className: (_ModalGeneric_styleModalGeneric_module_css__WEBPACK_IMPORTED_MODULE_4___default().contModal), 434 children: props.children 435 }) 436 }) 437 }); 438} 439/* harmony default export */ __webpack_exports__["Z"] = (ModalGeneric); 440 441 442/***/ }), 443 444/***/ 544: 445/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { 446 447"use strict";
448// ESM COMPAT FLAG 449__webpack_require__.r(__webpack_exports__); 450 451// EXPORTS 452__webpack_require__.d(__webpack_exports__, { 453 "__N_SSP": function() { return /* binding */ __N_SSP; }, 454 "default": function() { return /* binding */ Main_Life; } 455}); 456 457// EXTERNAL MODULE: ./node_modules/react/jsx-runtime.js 458var jsx_runtime = __webpack_require__(5893); 459// EXTERNAL MODULE: ./node_modules/react/index.js 460var react = __webpack_require__(7294); 461// EXTERNAL MODULE: ./components/Main/global/NavBar.tsx 462var NavBar = __webpack_require__(4122); 463// EXTERNAL MODULE: ./styles/styleGeneric.module.css 464var styleGeneric_module = __webpack_require__(5689); 465var styleGeneric_module_default = /*#__PURE__*/__webpack_require__.n(styleGeneric_module); 466// EXTERNAL MODULE: ./components/Main/global/GlobalButton/GlobalButton.tsx 467var GlobalButton = __webpack_require__(1665); 468// EXTERNAL MODULE: ./node_modules/react-icons/bs/index.mjs 469var bs = __webpack_require__(8633); 470// EXTERNAL MODULE: ./node_modules/react-icons/fa/index.mjs 471var fa = __webpack_require__(2091); 472// EXTERNAL MODULE: ./node_modules/next/router.js 473var next_router = __webpack_require__(1163); 474// EXTERNAL MODULE: ./utils/utils.utils.js 475var utils_utils = __webpack_require__(5109); 476// EXTERNAL MODULE: ./components/Main/Hooks/useLifeExchange.tsx 477var useLifeExchange = __webpack_require__(3159); 478// EXTERNAL MODULE: ./components/Main/global/ModalGeneric/ModalGeneric.component.tsx 479var ModalGeneric_component = __webpack_require__(8989); 480// EXTERNAL MODULE: ./node_modules/react-icons/bi/index.mjs 481var bi = __webpack_require__(1121); 482// EXTERNAL MODULE: ./node_modules/react-icons/io5/index.mjs 483var io5 = __webpack_require__(8318); 484;// CONCATENATED MODULE: ./components/Main/Hooks/useTickets.tsx 485 486const useTickets = (param)=>{ 487 let { consumerID } = param; 488 const [tickets, setTickets] = react.useState(); 489 const [error, setError] = react.useState(); 490 const [isLoading, setIsLoading] = react.useState(); 491 react.useEffect(()=>{ 492 if (consumerID) { 493 setIsLoading(true); 494 fetch("/api/getElectronicTickets", { 495 method: "POST", 496 body: JSON.stringify({ 497 consumer_entity_id: consumerID 498 }) 499 }).then((res)=>res.json()).then((r)=>{ 500 if (!r.error) { 501 setTickets(r.tickets); 502 return; 503 } 504 setError(true); 505 }).finally(()=>{ 506 setIsLoading(false); 507 }); 508 } 509 }, [ 510 consumerID 511 ]); 512 return { 513 tickets, 514 error, 515 isLoading 516 }; 517}; 518 519;// CONCATENATED MODULE: ./components/Main/Hooks/useTransferLifes.tsx 520 521const useTransferLifes = (param)=>{ 522 let { amount , document , pcsDestination , pcsOrigin } = param; 523 const [success, setSuccess] = react.useState(); 524 const [isLoading, setIsLoading] = react.useState(); 525 const [isReady, setIsReady] = react.useState(); 526 const setTrueIsReady = ()=>setIsReady(true); 527 react.useEffect(()=>{ 528 if (amount && document && pcsDestination && pcsOrigin && isReady) { 529 fetch("/api/transferLifes", { 530 method: "POST", 531 body: JSON.stringify({ 532 amount, 533 document, 534 pcsDestination, 535 pcsOrigin 536 }) 537 }).then((res)=>res.json()).then((r)=>{ 538 setSuccess(!r.error); 539 }).finally(()=>{ 540 setIsLoading(false); 541 }); 542 } 543 }, [ 544 amount, 545 document, 546 pcsDestination, 547 pcsOrigin, 548 isReady 549 ]); 550 return { 551 success, 552 isLoading, 553 setTrueIsReady 554 }; 555}; 556 557// EXTERNAL MODULE: ./node_modules/@mui/material/CircularProgress/CircularProgress.js + 1 modules 558var CircularProgress = __webpack_require__(8456); 559// EXTERNAL MODULE: ./components/Main/Payment/Payment.tsx + 3 modules 560var Payment = __webpack_require__(2617); 561;// CONCATENATED MODULE: ./components/Main/LifeComponent/LifeComponent.tsx 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578const LifeTransf = (param)=>{ 579 let { document , pcsOrigin } = param; 580 const [number, setNumber] = react.useState(""); 581 const [counter, setCounter] = react.useState(); 582 const [amount, setAmount] = react.useState(0); 583 const [auxiliarAmount, setAuxiliarAmount] = react.useState(); 584 const REGEX = /^[0-9]*$/g; 585 const router = (0,next_router.useRouter)(); 586 const { isLoading , success , setTrueIsReady } = useTransferLifes({ 587 amount, 588 document, 589 pcsDestination: number.replaceAll("-", ""), 590 pcsOrigin 591 }); 592 const handleChange = (e)=>{ 593 if (counter === 2 || counter === 5) { 594 setNumber(e + "-"); 595 } else { 596 setNumber(e); 597 } 598 setCounter(e.replaceAll("-", "").length); 599 }; 600 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 601 children: [ 602 /*#__PURE__*/ (0,jsx_runtime.jsxs)(ModalGeneric_component/* default */.Z, { 603 open: isLoading !== undefined && !isLoading, 604 children: [ 605 /*#__PURE__*/ (0,jsx_runtime.jsx)(Payment/* AnswerComponent */.pI, { 606 transactionSuccess: success 607 }), 608 /*#__PURE__*/ (0,jsx_runtime.jsx)(GlobalButton/* default */.Z, { 609 iconText: "", 610 onClick: ()=>router.back(), 611 shouldBeActive: false, 612 textButton: "Atr\xe1s" 613 }) 614 ] 615 }), 616 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 617 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 618 className: (styleGeneric_module_default()).title, 619 children: "Transferir Vidas" 620 }) 621 }), 622 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 623 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 624 className: (styleGeneric_module_default()).contInfoModalLifeTransf, 625 children: [ 626 /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 627 children: "\xa1Recuerda que solo puedes transferir vidas entre tus cuentas!" 628 }), 629 /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { 630 type: "number", 631 placeholder: "Vida a transferir", 632 className: (styleGeneric_module_default()).input, 633 style: { 634 marginBottom: "10px" 635 },
636 spellCheck: false, 637 value: auxiliarAmount, 638 onChange: (e)=>{ 639 setAuxiliarAmount(+e.target.value); 640 if (auxiliarAmount === 0) { 641 setAuxiliarAmount(undefined); 642 } 643 setAmount(+e.target.value); 644 }, 645 onKeyDown: (evt)=>[ 646 "e", 647 "E", 648 "+", 649 "-" 650 ].includes(evt.key) && evt.preventDefault() 651 }), 652 /*#__PURE__*/ (0,jsx_runtime.jsx)("input", { 653 type: "text", 654 placeholder: "S\xf3lo n\xfameros VIVA", 655 className: (styleGeneric_module_default()).input, 656 spellCheck: false, 657 value: number, 658 onChange: (e)=>e.target.value.replaceAll("-", "").match(REGEX) !== null && e.target.value.replaceAll("-", "").length <= 10 && handleChange(e.target.value) 659 }), 660 isLoading ? /*#__PURE__*/ (0,jsx_runtime.jsx)(CircularProgress/* default */.Z, { 661 size: 50, 662 sx: { 663 color: "#93D500", 664 marginTop: "15px" 665 } 666 }) : /*#__PURE__*/ (0,jsx_runtime.jsx)(GlobalButton/* default */.Z, { 667 iconText: /*#__PURE__*/ (0,jsx_runtime.jsx)(bi/* BiTransfer */.HZ8, {}), 668 textButton: "Transferir", 669 shouldBeActive: number.replaceAll("-", "").length !== 10 || amount < 5 || amount > 500, 670 onClick: ()=>setTrueIsReady() 671 }) 672 ] 673 }) 674 }) 675 ] 676 }); 677}; 678const TicketIND = (param)=>{ 679 let { ticketsCount , descriptionHead , descriptionBody } = param; 680 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 681 className: (styleGeneric_module_default()).contTicketInfo, 682 children: [ 683 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 684 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(io5/* IoTicket */.Tx$, {}) 685 }), 686 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 687 children: [ 688 /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { 689 children: [ 690 descriptionHead, 691 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 692 children: descriptionBody 693 }) 694 ] 695 }), 696 /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { 697 children: [ 698 "Boletos generados: ", 699 /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { 700 children: ticketsCount 701 }) 702 ] 703 }) 704 ] 705 }) 706 ] 707 }); 708}; 709const TicketsAvailable = (param)=>{ 710 let { tickets } = param; 711 var _tickets_data; 712 return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { 713 children: [ 714 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 715 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 716 className: (styleGeneric_module_default()).titleModal, 717 children: "Boletos promocionales" 718 }) 719 }), 720 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 721 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 722 className: (styleGeneric_module_default()).contInfoModalTicketsAvailable,
723 children: tickets === null || tickets === void 0 ? void 0 : (_tickets_data = tickets.data) === null || _tickets_data === void 0 ? void 0 : _tickets_data.map((ticket, index)=>{ 724 let descriptionSplit = ticket.description.split("("); 725 return /*#__PURE__*/ (0,jsx_runtime.jsx)(TicketIND, { 726 ticketsCount: ticket.tickets, 727 descriptionHead: (0,utils_utils/* formatToLowerCaseText */.gr)(descriptionSplit[0]).join(" "), 728 descriptionBody: (0,utils_utils/* formatToLowerCaseText */.gr)(descriptionSplit[1]).join(" ").replaceAll(")", "") 729 }, index); 730 }) 731 }) 732 }) 733 ] 734 }); 735}; 736function LifeComponent(param) { 737 let { contextUserData , position } = param; 738 var _contextUserData_position, _contextUserData_position_userData, _contextUserData_position1, _contextUserData_position_userData1, _contextUserData_position2, _contextUserData_position_userData2, _contextUserData_position3, _contextUserData_position_userData3, _contextUserData_position4, _contextUserData_position_userData4, _contextUserData_position5, _contextUserData_position_userData5; 739 const { lifes } = (0,useLifeExchange/* useLifeExchange */.c)((_contextUserData_position = contextUserData[position]) === null || _contextUserData_position === void 0 ? void 0 : (_contextUserData_position_userData = _contextUserData_position.userData) === null || _contextUserData_position_userData === void 0 ? void 0 : _contextUserData_position_userData.consumer_entity_id); 740 const { tickets } = useTickets({ 741 consumerID: (_contextUserData_position1 = contextUserData[position]) === null || _contextUserData_position1 === void 0 ? void 0 : (_contextUserData_position_userData1 = _contextUserData_position1.userData) === null || _contextUserData_position_userData1 === void 0 ? void 0 : _contextUserData_position_userData1.consumer_entity_id 742 }); 743 const divideBy100 = (n)=>{ 744 if (n === undefined) { 745 return null; 746 } 747 if ((n / 100).toString() === "0.0".concat(n)) { 748 return "00".concat(n); 749 } else if ((n / 100).toString() === "0.".concat(n.toString()[0])) { 750 return "0".concat(n); 751 } else { 752 return n.toString(); 753 } 754 }; 755 const router = (0,next_router.useRouter)(); 756 const [isPopLifeTransf, setIsPopLifeTransf] = react.useState(false); 757 const handleCloseLifeTransf = ()=>setIsPopLifeTransf(false); 758 const [isPopTicketsAvailable, setIsPopTicketsAvailable] = react.useState(false); 759 const handleCloseTicketsAvailable = ()=>setIsPopTicketsAvailable(false); 760 const isLifeTransf = ()=>{ 761 setIsPopLifeTransf(true); 762 }; 763 const isTicketsAvailable = ()=>{ 764 setIsPopTicketsAvailable(true); 765 }; 766 return /*#__PURE__*/ (0,jsx_runtime.jsx)(jsx_runtime.Fragment, { 767 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 768 className: (styleGeneric_module_default()).container, 769 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 770 className: (styleGeneric_module_default()).contCardGlobal, 771 children: [ 772 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 773 className: "".concat((styleGeneric_module_default()).contHead, " ").concat((styleGeneric_module_default()).titleMgBott), 774 children: [ 775 /*#__PURE__*/ (0,jsx_runtime.jsx)(fa/* FaMobileAlt */.XEH, {}), 776 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 777 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { 778 children: [ 779 (0,utils_utils/* formatToLowerCaseText */.gr)((_contextUserData_position2 = contextUserData[position]) === null || _contextUserData_position2 === void 0 ? void 0 : (_contextUserData_position_userData2 = _contextUserData_position2.userData) === null || _contextUserData_position_userData2 === void 0 ? void 0 : _contextUserData_position_userData2.plan_descripcion).join(" "), 780 " ", 781 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 782 children: (0,utils_utils/* formatNumber */.uf)((_contextUserData_position3 = contextUserData[position]) === null || _contextUserData_position3 === void 0 ? void 0 : (_contextUserData_position_userData3 = _contextUserData_position3.userData) === null || _contextUserData_position_userData3 === void 0 ? void 0 : _contextUserData_position_userData3.msisdn) 783 }) 784 ] 785 }) 786 }) 787 ] 788 }), 789 /*#__PURE__*/ (0,jsx_runtime.jsxs)("h3", { 790 className: "".concat((styleGeneric_module_default()).title, " ").concat((styleGeneric_module_default()).titleBsFill, " ").concat((styleGeneric_module_default()).titleMgBott), 791 children: [ 792 /*#__PURE__*/ (0,jsx_runtime.jsx)(bs/* BsFillHeartFill */.xTs, {}), 793 /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { 794 children: divideBy100(lifes === null || lifes === void 0 ? void 0 : lifes.lifes.data.data.points) 795 }), 796 " Vidas acumuladas" 797 ] 798 }), 799 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 800 className: (styleGeneric_module_default()).contImgBtn, 801 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 802 className: (styleGeneric_module_default()).contBtn, 803 children: [ 804 /*#__PURE__*/ (0,jsx_runtime.jsx)(GlobalButton/* default */.Z, { 805 iconText: "", 806 textButton: "Canjear Vidas", 807 shouldBeActive: false, 808 onClick: ()=>router.push({ 809 pathname: "RedeemLife", 810 query: { 811 selected: position 812 } 813 }) 814 }), 815 /*#__PURE__*/ (0,jsx_runtime.jsx)(GlobalButton/* default */.Z, { 816 iconText: "", 817 textButton: "Transferir Vidas", 818 shouldBeActive: false, 819 onClick: ()=>isTicketsAvailable() 820 }), 821 /*#__PURE__*/ (0,jsx_runtime.jsx)(GlobalButton/* default */.Z, { 822 iconText: "", 823 textButton: "Boletos disponibles", 824 shouldBeActive: false, 825 onClick: ()=>isLifeTransf() 826 }), 827 /*#__PURE__*/ (0,jsx_runtime.jsx)(ModalGeneric_component/* default */.Z, { 828 open: isPopLifeTransf, 829 handleClose: handleCloseLifeTransf, 830 children: (tickets === null || tickets === void 0 ? void 0 : tickets.data) ? /*#__PURE__*/ (0,jsx_runtime.jsx)(TicketsAvailable, { 831 tickets: tickets 832 }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 833 className: (styleGeneric_module_default()).contInfoModalLifeTransf, 834 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { 835 children: "Usted no ha generado boletos" 836 }) 837 }) 838 }), 839 /*#__PURE__*/ (0,jsx_runtime.jsx)(ModalGeneric_component/* default */.Z, { 840 open: isPopTicketsAvailable, 841 handleClose: handleCloseTicketsAvailable, 842 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(LifeTransf, { 843 document: (_contextUserData_position4 = contextUserData[position]) === null || _contextUserData_position4 === void 0 ? void 0 : (_contextUserData_position_userData4 = _contextUserData_position4.userData) === null || _contextUserData_position_userData4 === void 0 ? void 0 : _contextUserData_position_userData4.document_number, 844 pcsOrigin: (_contextUserData_position5 = contextUserData[position]) === null || _contextUserData_position5 === void 0 ? void 0 : (_contextUserData_position_userData5 = _contextUserData_position5.userData) === null || _contextUserData_position_userData5 === void 0 ? void 0 : _contextUserData_position_userData5.msisdn 845 }) 846 }) 847 ] 848 }) 849 }) 850 ] 851 }) 852 }) 853 }); 854} 855/* harmony default export */ var LifeComponent_LifeComponent = (LifeComponent); 856 857// EXTERNAL MODULE: ./components/Main/global/NavResponsive/NavResponsive.jsx 858var NavResponsive = __webpack_require__(9651); 859// EXTERNAL MODULE: ./pages/Main/styleMainServiceDetailed.module.css 860var styleMainServiceDetailed_module = __webpack_require__(947); 861var styleMainServiceDetailed_module_default = /*#__PURE__*/__webpack_require__.n(styleMainServiceDetailed_module); 862// EXTERNAL MODULE: ./components/Main/global/BreadcrumbsComponent/BreadcrumbsComponent.tsx 863var BreadcrumbsComponent = __webpack_require__(9151); 864// EXTERNAL MODULE: ./components/Main/global/BreadcrumbsComponent/styleBreadCrumbs.module.css 865var styleBreadCrumbs_module = __webpack_require__(4094); 866var styleBreadCrumbs_module_default = /*#__PURE__*/__webpack_require__.n(styleBreadCrumbs_module); 867// EXTERNAL MODULE: ./components/Main/Hooks/useBreadCrumbs.tsx 868var useBreadCrumbs = __webpack_require__(7325); 869// EXTERNAL MODULE: ./components/Main/Hooks/useUserInfo.tsx 870var useUserInfo = __webpack_require__(7254); 871// EXTERNAL MODULE: ./node_modules/next/head.js 872var head = __webpack_require__(9008); 873var head_default = /*#__PURE__*/__webpack_require__.n(head); 874;// CONCATENATED MODULE: ./pages/Main/Life.tsx 875 876 877 878 879 880 881 882 883 884 885 886const Life = (param)=>{ 887 let { responseJson } = param; 888 (0,useBreadCrumbs/* useBreadCrumbs */.Z)();
889 const { position , contextUserData } = (0,useUserInfo/* useUserInfo */.P)(responseJson); 890 return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 891 children: [ 892 /*#__PURE__*/ (0,jsx_runtime.jsx)((head_default()), { 893 children: /*#__PURE__*/ (0,jsx_runtime.jsx)("title", { 894 children: "Web Channel - Mis Vidas" 895 }) 896 }), 897 /*#__PURE__*/ (0,jsx_runtime.jsx)(NavResponsive/* default */.Z, {}), 898 /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 899 className: (styleMainServiceDetailed_module_default()).contGlobals, 900 children: [ 901 /*#__PURE__*/ (0,jsx_runtime.jsx)(NavBar/* default */.Z, {}), 902 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 903 className: (styleMainServiceDetailed_module_default()).contServiceDitailed, 904 children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { 905 className: (styleMainServiceDetailed_module_default()).continfoGlobal, 906 children: [ 907 /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { 908 className: "".concat((styleBreadCrumbs_module_default()).contBreadCrumbs, " ").concat((styleMainServiceDetailed_module_default()).contBreadCrumbs), 909 children: /*#__PURE__*/ (0,jsx_runtime.jsx)(BreadcrumbsComponent/* default */.Z, {}) 910 }), 911 /*#__PURE__*/ (0,jsx_runtime.jsx)(LifeComponent_LifeComponent, { 912 contextUserData: contextUserData, 913 position: position 914 }) 915 ] 916 }) 917 }) 918 ] 919 }) 920 ] 921 }); 922}; 923var __N_SSP = true; 924/* harmony default export */ var Main_Life = (Life); 925 926 927/***/ }), 928 929/***/ 8641: 930/***/ (function(module) { 931 932// extracted by mini-css-extract-plugin 933module.exports = {"contModal":"styleModalGeneric_contModal__rJN_J","title":"styleModalGeneric_title__C6faV","contInfoModal":"styleModalGeneric_contInfoModal__NyPxu"}; 934 935/***/ }), 936 937/***/ 947: 938/***/ (function(module) { 939 940// extracted by mini-css-extract-plugin 941module.exports = {"styContHomeyNav":"styleMainServiceDetailed_styContHomeyNav__I6QwA","logoVivaBlanco":"styleMainServiceDetailed_logoVivaBlanco___JG8Z","contGlobal":"styleMainServiceDetailed_contGlobal__5ImMW","contServiceDitailed":"styleMainServiceDetailed_contServiceDitailed___YN6i","contInfoGlobal":"styleMainServiceDetailed_contInfoGlobal__jhpno","contBacground":"styleMainServiceDetailed_contBacground__xBqCa","contBreadCrumbs":"styleMainServiceDetailed_contBreadCrumbs__6elH7","css-12i7wg6-MuiPaper-root-MuiDrawer-paper":"styleMainServiceDetailed_css-12i7wg6-MuiPaper-root-MuiDrawer-paper__tIbEi","contNavResponsive":"styleMainServiceDetailed_contNavResponsive__Xk7Y0"}; 942 943/***/ }) 944 945}, 946/******/ function(__webpack_require__) { // webpackRuntimeModules 947/******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); } 948/******/ __webpack_require__.O(0, [3365,4976,2510,594,9317,4817,4738,6660,908,5221,9378,1664,287,8625,5124,3700,6954,2617,9774,2888,179], function() { return __webpack_exec__(2043); }); 949/******/ var __webpack_exports__ = __webpack_require__.O(); 950/******/ _N_E = __webpack_exports__; 951/******/ } 952]);
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.