PageSourceSearch

https://pharma.extendeal.com/_next/static/chunks/6328.ff3f7d80069e0300.js

js extendeal.com collected 2026-10-08 08:27:34 UTC 42,563 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6328],{95477:function(e,t,r){var n=r(87462),a=r(45987),o=r(67294),i=r(86010),l=r(1591),u=r(93871),s=o.forwardRef(function(e,t){var r=e.classes,l=e.className,s=e.color,d=void 0===s?"primary":s,c=e.disableShrink,v=void 0!==c&&c,h=e.size,f=void 0===h?40:h,C=e.style,S=e.thickness,p=void 0===S?3.6:S,m=e.value,g=void 0===m?0:m,y=e.variant,P=void 0===y?"indeterminate":y,x=(0,a.Z)(e,["classes","className","color","disableShrink","size","style","thickness","value","variant"]),_={},I={},R={};if("determinate"===P||"static"===P){var E,w,A=2*Math.PI*((44-p)/2);(_.strokeDasharray=A.toFixed(3),R["aria-valuenow"]=Math.round(g),"static"===P)?(_.strokeDashoffset="".concat(((100-g)/100*A).toFixed(3),"px"),I.transform="rotate(-90deg)"):(_.strokeDashoffset="".concat(((E=(100-g)/100)*E*A).toFixed(3),"px"),I.transform="rotate(".concat((270*(w=(w=(Math.min(Math.max(0,w=g/70),1)-0)/1-1)*w*w+1)).toFixed(3),"deg)"))}return o.createElement("div",(0,n.Z)({className:(0,i.Z)(r.root,l,"inherit"!==d&&r["color".concat((0,u.Z)(d))],{indeterminate:r.indeterminate,static:r.static}[P]),style:(0,n.Z)({width:f,height:f},I,C),ref:t,role:"progressbar"},R,x),o.createElement("svg",{className:r.svg,viewBox:"".concat(22," ").concat(22," ").concat(44," ").concat(44)},o.createElement("circle",{className:(0,i.Z)(r.circle,v&&r.circleDisableShrink,{indeterminate:r.circleIndeterminate,static:r.circleStatic}[P]),style:_,cx:44,cy:44,r:(44-p)/2,fill:"none",strokeWidth:p})))});t.Z=(0,l.Z)(function(e){return{root:{display:"inline-block"},static:{transition:e.transitions.create("transform")},indeterminate:{animation:"$circular-rotate 1.4s linear infinite"},colorPrimary:{color:e.palette.primary.main},colorSecondary:{color:e.palette.secondary.main},svg:{display:"block"},circle:{stroke:"currentColor"},circleStatic:{transition:e.transitions.create("stroke-dashoffset")},circleIndeterminate:{animation:"$circular-dash 1.4s ease-in-out infinite",strokeDasharray:"80px, 200px",strokeDashoffset:"0px"},"@keyframes circular-rotate":{"0%":{transformOrigin:"50% 50%"},"100%":{transform:"rotate(360deg)"}},"@keyframes circular-dash":{"0%":{strokeDasharray:"1px, 200px",strokeDashoffset:"0px"},"50%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-15px"},"100%":{strokeDasharray:"100px, 200px",strokeDashoffset:"-125px"}},circleDisableShrink:{animation:"none"}}},{name:"MuiCircularProgress",flip:!1})(s)},39630:function(e,t,r){r.d(t,{ZZ:function(){return postSendEmailVendors},_l:function(){return getStatusByHubspotClient},c0:function(){return disabledVendors}});var n=r(35160);let postSendEmailVendors=async(e,t)=>{try{return await n.Xl.post("/api/drug-manufacturers/".concat(e,"/request-authorization"),{...t})}catch(e){return{response:e.response.data}}},disabledVendors=async e=>await n.Xl.post("/api/api-credential/restore",{...e}),getStatusByHubspotClient=async e=>await n.Xl.get("/api/points-of-sale/".concat(e,"/status/client"))},64751:function(e,t,r){r.d(t,{bj:function(){return updateQueryString},sG:function(){return parseDate}});var n=r(35026),a=r(95866),o=r(69599),i=r(253);let updateQueryString=function(e,t,r,n,a,o){let l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,u={};""!==e&&(u["filters[search]"]=e),t&&t.from&&t.to&&""!==t.from&&""!==t.to&&(u["filters[from_date]"]=t.from,u["filters[to_date]"]=t.to),(!0===l||!1===l)&&(u[i.tR]=String(l));let s="",d="",c="",v="";n.length>0&&(d=n.map(e=>"filters[point_of_sale_ids][]=".concat(e)).join("&")),r.length>0&&(s=r.map(e=>"filters[drug_manufacturer_ids][]=".concat(e)).join("&")),Array.isArray(a)&&a.length>0&&(c=a.map(e=>"filters[status][]=".concat(e)).join("&")),Array.isArray(o)&&o.length>0&&(v=o.map(e=>"filters[purchase_type_ids][]=".concat(e)).join("&"));let h=[d,s,c,v].filter(e=>""!==e).join("&");return new URLSearchParams(u).toString()+(h?"&"+h:"")},parseDate=e=>{let t=(0,a.Z)(e,"America/Argentina/Buenos_Aires"),r=(0,o.Z)(t,"America/Argentina/Buenos_Aires");return(0,n.Z)(r,"yyyy-MM-dd")}},253:function(e,t,r){r.d(t,{Hh:function(){return parseDrugManufacturerFromQuery},KA:function(){return o},X$:function(){return parseSavedCommercialAgreementFilter},mi:function(){return parseCommercialAgreementFromQuery},tR:function(){return n}});let n="filters[with_commercial_agreement]",a={WITH_AGREEMENT:!0,WITHOUT_AGREEMENT:!1},o=[{label:"Con acuerdo comercial",value:a.WITH_AGREEMENT},{label:"Sin acuerdo comercial",value:a.WITHOUT_AGREEMENT}],parseSavedCommercialAgreementFilter=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null!==(t=null!==(e=r.with_commercial_agreement)&&void 0!==e?e:r.withCommercialAgreement)&&void 0!==t?t:r.commercialAgreementTerms;if(!0===n||!1===n)return n;if(Array.isArray(n)&&n.length>0){if(1===n[0]||!0===n[0])return!0;
1if(2===n[0]||!1===n[0])return!1}return null},parseQueryInt=e=>{if(void 0===e)return null;let t=Array.isArray(e)?e[0]:e,r=parseInt(t,10);return isNaN(r)?null:r},parseDrugManufacturerFromQuery=e=>{var t;return null!==(t=parseQueryInt(e.drug))&&void 0!==t?t:parseQueryInt(e["filters[drug_manufacturer_ids][]"])},parseCommercialAgreementFromQuery=e=>{if(void 0===e)return null;let t=Array.isArray(e)?e[0]:e;return"true"===t||"false"!==t&&null}},1523:function(e,t,r){r.d(t,{Z:function(){return useAlerts},x:function(){return AlertsProviders}});var n=r(85893),a=r(47384),o=r(67294);let i=(0,o.createContext)(null),AlertsProviders=e=>{let{children:t}=e,[r,l]=(0,o.useState)([]),[u,s]=(0,o.useState)(!1),[d,c]=(0,o.useState)({isOpen:!1,isEdit:!1,selectedAlert:null}),[v,h]=(0,o.useState)(!1),[f,C]=(0,o.useState)(null),[S,p]=(0,o.useState)([]),[m,g]=(0,o.useState)(null),[y,P]=(0,o.useState)(!1),handlerFetchAlerts=async()=>{try{let e=await (0,a.sM)();l(null==e?void 0:e.data)}catch(e){}};return(0,o.useEffect)(()=>{let e=setTimeout(()=>{(async()=>await handlerFetchAlerts())()},2e3);return()=>clearTimeout(e)},[]),(0,o.useEffect)(()=>{u&&(async()=>{await handlerFetchAlerts(),s(!1)})()},[u]),(0,n.jsx)(i.Provider,{value:{alerts:r,setAlerts:l,setFetch:s,fetch:u,openDrawer:d,setOpenDrawer:c,handlerFetchAlerts,openPaymentModal:v,setOpenPaymentModal:h,persistedFormData:f,setPersistedFormData:C,selectedPointsOfSale:S,setSelectedPointsOfSale:p,validateFileResponse:m,setValidateFileResponse:g,shouldOpenDrawer:y,setShouldOpenDrawer:P},children:t})},useAlerts=()=>(0,o.useContext)(i)},90294:function(e,t,r){r.d(t,{o:function(){return useCredentialErrors},t:function(){return CredentialErrorProvider}});var n=r(85893),a=r(67294),o=r(11163),i=r(55486),l=r(76470),u=r(45856);let s=(0,a.createContext)(null),CredentialErrorProvider=e=>{let{children:t}=e,{pathname:r,query:{orderId:d}}=(0,o.useRouter)(),[c,v]=(0,a.useState)(null),[h,f]=(0,a.useState)(!1),[C,S]=(0,a.useState)([]),[p,m]=(0,a.useState)(!1),g="/[clientId]/efficient-purchase/[posId]/confirmation"===r,y=new Set([l.Q.UNKNOWN_ERROR,l.Q.WRONG_USERNAME_PASSWORD,l.Q.OPERATION_FORBIDDEN,l.Q.CREDIT_LIMIT_REACHED,l.Q.REASON_PROVIDED,l.Q.EXPIRED_PASSWORD,l.Q.MISSING_ACCOUNT,l.Q.MISSING_DISPATCH_ADDRESS,l.Q.MISSING_FORMAT,l.Q.ERROR_SETTING_PROXY]);(0,a.useEffect)(()=>{let fetchDrugmanufacturersWithErrors=async()=>{try{let e=await (0,i.Os)(d,u.BY.WITH_ERRORS),t=e.map(e=>{var t;return(null==e?void 0:e.error_type)&&(null==e?void 0:null===(t=e.error_type)||void 0===t?void 0:t.id)===6?{...e,error_type:{id:2,name:"wrong_username_password"}}:e});v(t)}catch(e){}};d&&!g&&fetchDrugmanufacturersWithErrors()},[d,g]);let P=null==c?void 0:c.filter(e=>{let{error_type:t}=e;return t&&0!==t.length&&y.has(t.id)}).map(e=>({...e})),validation=e=>![l.Q.WRONG_USERNAME_PASSWORD,l.Q.CREDIT_LIMIT_REACHED,l.Q.MISSING_FORMAT,l.Q.ERROR_SETTING_PROXY].includes(e),validationTunnel=e=>[l.Q.ERROR_SETTING_PROXY].includes(e),x=null==c?void 0:c.filter(e=>{let{error_type:t}=e;return(null==t?void 0:t.length)!==0&&validation(null==t?void 0:t.id)}).map(e=>({...e})),_=null==c?void 0:c.filter(e=>{let{error_type:t}=e;return(null==t?void 0:t.length)!==0&&validationTunnel(null==t?void 0:t.id)}).map(e=>({...e})),I=null==P?void 0:P.filter(e=>{var t;return(null==e?void 0:null===(t=e.error_type)||void 0===t?void 0:t.id)===2}),R=null==P?void 0:P.filter(e=>{var t;return(null==e?void 0:null===(t=e.error_type)||void 0===t?void 0:t.id)===4}),E=null==P?void 0:P.filter(e=>{var t;return(null==e?void 0:null===(t=e.error_type)||void 0===t?void 0:t.id)===l.Q.MISSING_FORMAT}),w=null==I?void 0:I.length,A=null==R?void 0:R.length;return(0,n.jsx)(s.Provider,{value:{drugmanufacturersEnabled:c,extractedCredentialErrors:I,extractedUnknownError:x,quantityCredentialsWithErrors:w,extractedDataError:P,setIsFetchingUpdate:f,isFetchingUpdate:h,updatedCredentials:C,setUpdatedCredentials:S,closeDrawerAndReload:p,setCloseDrawerAndReload:m,quantityCreditWithErrors:A,mutateDrugManufacturers:()=>{},extractedMissingFormat:E,extractedTunnelError:_},children:t})},useCredentialErrors=()=>(0,a.useContext)(s)},74869:function(e,t,r){r.d(t,{D:function(){return DrawerProvider},y:function(){return useDrawer}});var n=r(85893),a=r(67294);let o=(0,a.createContext)(null),DrawerProvider=e=>{let{children:t}=e,[r,i]=(0,a.useState)(!1),[l,u]=(0,a.useState)(!1);return(0,n.jsx)(o.Provider,{value:{isDrawerOpen:r,openDrawer:()=>{i(!0)},closeDrawer:()=>{i(!1)}},children:t})},useDrawer=()=>(0,a.useContext)(o)},13057:function(e,t,r){r.d(t,{G:function(){return useHubspotStatus}
1,k:function(){return HubspotStatusProvider}});var n=r(85893),a=r(67294),o=r(39630),i=r(11163);let l=[1,2],u=(0,a.createContext)(void 0),HubspotStatusProvider=e=>{var t;let{children:r}=e,s=(0,i.useRouter)(),{query:d}=s,[c,v]=(0,a.useState)(null);(0,a.useEffect)(()=>{let fetchStatus=async()=>{try{var e;let t=await (0,o._l)(d.posId);v((null==t?void 0:null===(e=t.data)||void 0===e?void 0:e.data)||null)}catch(e){}};d.posId&&fetchStatus()},[d.posId]);let h=!((null==c?void 0:null===(t=c.hubspot_status_id)||void 0===t?void 0:t.id)&&l.includes(c.hubspot_status_id.id));return(0,n.jsx)(u.Provider,{value:{statusHubspot:c,disabledHubspotClient:h},children:r})},useHubspotStatus=()=>{let e=(0,a.useContext)(u);if(!e)throw Error("useHubspotStatus must be used within a HubspotStatusProvider");return e}},87663:function(e,t,r){r.d(t,{N:function(){return ListBoxDrugManufacturersProvider},S:function(){return useListBoxDrugManufacturersContext}});var n=r(85893),a=r(67294),o=r(68875),i=r(11163),l=r(39630),u=r(67597),s=r(56255),d=r(66761),c=r(54391);let v={data:[],currentIndex:0,animations:{},handleClickButton:e=>{},handleNext:()=>{},handlePrevious:()=>{},idsDeleted:[],loadState:e=>{},fetching:!1,setFetching:e=>{},requestVendor:(e,t)=>{},setIdsDeleted:e=>{},handleSetStatusInLocalStorage:e=>{}},h=(0,a.createContext)(v),ListBoxDrugManufacturersProvider=e=>{let{children:t}=e,{push:r,query:f}=(0,i.useRouter)(),{showToaster:C}=(0,o.p)(),[S,p]=(0,a.useState)(v.data),[m,g]=(0,a.useState)(v.currentIndex),[y,P]=(0,a.useState)(v.animations),[x,_]=(0,a.useState)(v.idsDeleted),[I,R]=(0,a.useState)(v.fetching),{mutateDrugManufacturers:E}=(0,u.F)(),{setOpenModalMissingDocs:w}=(0,c.W)(),{user:A}=(0,s.aF)({}),handleMovePagination=e=>{var t;if((null==e?void 0:null===(t=e.slice(m,m+3))||void 0===t?void 0:t.length)===0)return handlePrevious()},removeItemById=e=>{p(t=>{let r=t.filter(t=>t.id!==e);return handleMovePagination(r),r})},D=(0,a.useCallback)(e=>{P(t=>({...t,[e]:!0})),setTimeout(()=>{P(t=>({...t,[e]:!1})),removeItemById(e)},450)},[S]),requestVendor=async(e,t)=>{try{var r,n,a,o,i;let u=await (0,l.ZZ)(t,{point_of_sale_id:null==f?void 0:f.posId});if(u&&(null==u?void 0:null===(n=u.response)||void 0===n?void 0:null===(r=n.error)||void 0===r?void 0:r.code)===400&&[d.k.MISSING_DOCS,d.k.REJECTED_DOCS].includes(null==u?void 0:null===(i=u.response)||void 0===i?void 0:null===(o=i.data)||void 0===o?void 0:null===(a=o.validation)||void 0===a?void 0:a.point_of_sale_id[0]))w(!0);else if((null==u?void 0:u.status)===200)return _(e=>[...e,t]),D(t),C({type:"success",message:{title:"Enviamos tu solicitud a ".concat(e,"."),description:"Te avisaremos por mail cuando responda."}});return u}catch(e){}},handleClickButton=async e=>{if(e){if((null==e?void 0:e.type_id)===3)requestVendor(null==e?void 0:e.name,null==e?void 0:e.id);else if((null==e?void 0:e.type_id)===2||(null==e?void 0:e.type_id)===1){r({pathname:"/".concat(null==f?void 0:f.clientId,"/settings/POS/").concat(null==f?void 0:f.posId,"/posDetails"),query:{dId:null==e?void 0:e.id}});return}}},N=(0,a.useCallback)(e=>{p(e)},[]),handlePrevious=()=>{let e=m-3;e>=0&&g(e)};return(0,n.jsx)(h.Provider,{value:{data:S,currentIndex:m,animations:y,handleClickButton,handlePrevious,handleNext:()=>{let e=m+3;e<S.length&&g(e)},idsDeleted:x,loadState:N,fetching:I,setFetching:R,requestVendor,setIdsDeleted:_,handleSetStatusInLocalStorage:e=>{let t=JSON.parse(localStorage.getItem("requestedVendors"))||[];t.includes(e)||(t.push(e),localStorage.setItem("requestedVendors",JSON.stringify(t)))}},children:t})},useListBoxDrugManufacturersContext=()=>(0,a.useContext)(h)},76827:function(e,t,r){r.d(t,{Z:function(){return CartProvider},j:function(){return useCart}});var n=r(85893),a=r(68948),o=r(67294),i=r(22952),l=r(45965);let u=o.createContext(null);function CartProvider(e){let{children:t,...r}
1=e,[s,d]=o.useState([]),[c,v]=o.useState(!1),[h,f]=o.useState(!1),[C,S]=o.useState(!1),[p,m]=o.useState(!1),[g,y]=o.useState(!1),[P,x]=o.useState(!1),[_,I]=o.useState(!1),R=o.useCallback(()=>{I(!0),setTimeout(()=>{m(!p),y(!1),I(!1)},200)},[p]),E=o.useCallback(()=>y(!g),[g]);o.useEffect(()=>{c&&v(!1)},[c]);let loadProductsInCart=async e=>{d(e)},addProduct=async(e,t)=>{var r,n,o;let i={barcode:(0,l.O2)(null===(r=t._source)||void 0===r?void 0:r.ean[0])?" ":String(t._source.ean[0]),description:"".concat((0,l.O2)(null===(n=t._source)||void 0===n?void 0:n.description)?"":t._source.description," ").concat((0,l.O2)(null===(o=t._source)||void 0===o?void 0:o.laboratory)?" ":t._source.laboratory),quantity:1},u=await (0,a.aJ)(e,i),{cart_id:d}=u.data.data;if(!s.length||s[0].cart_id===d)return await getCart(e);S(!0),loadProductsInCart([u.data.data])},getCart=async e=>{let t=await (0,a.kd)(e);(null==t?void 0:t.items)&&t.items.length?loadProductsInCart(t.items):loadProductsInCart([])},emptyCart=async e=>{await (0,a.g6)(e),f(!0),loadProductsInCart([])},deleteProductById=async(e,t)=>{let r=await (0,a.Ig)(e,t),{data:n}=r.data;(null==n?void 0:n.error)&&"CART_IN_PROGRESS_NOT_FOUND"===n.error&&(S(!0),loadProductsInCart([]))},removeProductInState=async(e,t)=>{let r=s.filter(e=>e.id!==t);d([...r])},updateProduct=async(e,t,r)=>{let n={barcode:t.barcode,description:t.description,quantity:r},o=await (0,a.bd)(e,t.id,n),{data:i}=o.data;(null==i?void 0:i.error)&&"CART_IN_PROGRESS_NOT_FOUND"===i.error?(S(!0),loadProductsInCart([])):await getCart(e)},undoItem=async(e,t)=>{d(s)},getShowMessageAgain=()=>{let e=localStorage.getItem("show_message_again");return null!==e&&JSON.parse(e)};return(0,n.jsx)(u.Provider,{value:{productsList:s,emptyCart,getProductByBarcode:e=>{let t=(0,i.D6)(s,e);return t},existsProductInCart:e=>{let t=(0,i.OO)(s,e);return t},addProduct,updateProduct,loadProductsInCart,deleteProductById,quantityCart:()=>s.length,undoItem,setUndoTimeout:v,undoTimeout:c,removeProductInState,ongoingComparisonSnackBar:C,setOngoingComparisonSnackBar:S,emptyCartSnackbar:h,setEmptyCartSnackbar:f,getShowMessageAgain,setShowMessageAgain:e=>Promise.resolve().then(function(){localStorage.setItem("show_message_again",JSON.stringify(e)),getShowMessageAgain()}),getCart,visibility:p,toggle:R,isExpanded:g,expand:E,openModalDelete:P,setOpenModalDelete:x,animation:_,...r},children:t})}function useCart(){let e=o.useContext(u);if(void 0===e)throw Error("useCartContext must be used within a ConfirmationProvider");return e}},51396:function(e,t,r){r.r(t),r.d(t,{AppProviders:function(){return AppProviders}});var n=r(85893),a=r(82515),o=r(186),i=r(13457),l=r(15353),u=r(49284),s=r(73173),d=r(35160),c=r(3428),v=r(86472),h=r(32970),f=r(15902),C=r(21400),S=r(67294);let p=S.createContext(null),SkeletonLoaderModal=e=>{let{children:t}=e,[r,a]=S.useState(!1);return(0,n.jsx)(p.Provider,{value:{setLoadingSkeleton:a,loadingSkeleton:r},children:t})};var m=r(60948),g=r(76827),y=r(22952),P=r(51870);let x=S.createContext(null);function SearchProductProvider(e){let{children:t,...r}=e,{pointOfSale:a}=(0,f.g)(),[o,i]=S.useState([]),[l,u]=S.useState([]),[s,c]=S.useState([]),[v,h]=S.useState([]),[C,p]=S.useState(""),[m,g]=S.useState(!1),[_,I]=S.useState([]),[R,E]=S.useState(null),[w,A]=S.useState([]),[D,N]=S.useState(!1),fetchData=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:20,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];g(!0);try{let o=null==a?void 0:a.id,{data:i}=await d.Xl.post("/api/points-of-sale/".concat(o,"/search-products"),{search:e,size:r,from:t});I(i.data.hits),E(i.meta.pagination),n&&A(i.data.hits),N(!1),g(!1)}catch(e){[500,400,404].includes(e.response.status)&&(g(!1),I([]),E([]))}},updateLastSearchFromLocalStorage=()=>{let e=JSON.parse(localStorage.getItem("lastSearch"));e||localStorage.setItem("lastSearch",JSON.stringify([])),u(e)};return S.useEffect(()=>{updateLastSearchFromLocalStorage()},[]),S.useEffect(()=>{""!==C.trim()&&fetchData(C)},[C]),S.useEffect(()=>{let e=(0,P.e)(_,C);h(e)},[_]),(0,n.jsx)(x.Provider,{value:{productsInCart:o,currentSearch:C,setCurrentSearch:p,lastSearch:l,setLastSearch:u,fetchProducts:s,setFetchProducts:c,addProductInCart:e=>{i([...o,e])},updateProductQuantity:(e,t)=>{let r=(0,y.RO)(o,e,t);i(r)},existsProductInCart:e=>{let t=(0,y.OO)(o,e);return t},isLoading:m,setIsLoading:g,fetchData,searchDataLength:()=>null==_?void 0:_.length,cleanSearchData:()=>{I([]),h([])},listedProducts:v,pagination:R,searchData:_,results:w,setResults:A,isUpdateResult:D,setIsUpdateResult:N,...r},children:t})}var _=r(40780),I=r(48671),R=r(78524),E=r(28162),w=r(94828),A=r(42822),D=r(24888),N=r(62032),O=r(3041),L=r(74869),M=r(90294),T=r(19152),j=r(33933),b=r(1523),F=r(87663),H=r(40687),k=r(15633),B=r(67597),Z=r(88976),G=r(35508),U=r(13057),V=r(54391),Q=r(31339),W=r(23059);function AppProviders(e){let{children:t}=e;return(0,n.jsxs)(i.Z,{theme:u.Z,children:[(0,n.jsx)(l.Z,{}),(0,n.jsx)(o.f6,{theme:s.Z,children:(0,n.jsx)(a.J$,{value:{fetcher:d.Li},children:(0,n.jsx)(G.n,{children:(0,n.jsx)(U.k,{children:(0,n.jsx)(c.uZ,{children:(0,n.jsx)(H.n,{children:(0,n.jsx)(b.x,{children:(0,n.jsx)(T.D,{children:(0,n.jsx)(O.h,{children:(0,n.jsx)(_.W,{children:(0,n.jsx)(C.I,{children:(0,n.jsx)(v.Ho,{children:(0,n.jsx)(f.L,{children:(0,n.jsx)(B.o,{children:(0,n.jsx)(W.q,{children:(0,n.jsx)(M.t,{children:(0,n.jsx)(L.D,{children:(0,n.jsx)(N.L,{children:(0,n.jsx)(Q.J,{children:(0,n.jsx)(D.Q,{children:(0,n.jsx)(w.b,{children:(0,n.jsx)(A.A,{children:(0,n.jsx)(E.n,{children:(0,n.jsx)(g.Z,{children:(0,n.jsx)(R.U,{children:(0,n.jsx)(SearchProductProvider,{children:(0,n.jsx)(I.x,{children:(0,n.jsx)(j.i,{children:(0,n.jsx)(SkeletonLoaderModal,{children:(0,n.jsx)(m.P,{children:(0,n.jsx)(h.q,{children:(0,n.jsx)(k.T,{children:(0,n.jsx)(V.R,{children:(0,n.jsx)(F.N,{children:(0,n.jsx)(Z.W,{children:t})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})})]})}},88976:function(e,t,r){r.d(t,{W:function(){return LayoutFooterProvider},Y:function(){return useLayoutFooterContext}});var n=r(85893),a=r(67294);let o={showFooterContext:!0,setShowFooterContext:e=>{},footerExpanded:!1,setFooterExpanded:e=>{}},i=(0,a.createContext)(o),LayoutFooterProvider=e=>{let{children:t}=e,[r,l]=(0,a.useState)(o.showFooterContext),[u,s]=(0,a.useState)(o.footerExpanded);return(0,n.jsx)(i.Provider,{value:{showFooterContext:r,setShowFooterContext:l,footerExpanded:u,setFooterExpanded:s},children:t})},useLayoutFooterContext=()=>(0,a.useContext)(i)},19152:function(e,t,r){r.d(t,{D:function(){return ModalProvider},d:function(){return useModal}});var n=r(85893),a=r(67294);let o=(0,a.createContext)(null),ModalProvider=e=>{let{children:t}=e,[r,i]=(0,a.useState)(!1);return(0,n.jsx)(o.Provider,{value:{isModalOpen:r,openModal:()=>{i(!0)},closeModal:()=>{i(!1)}},children:t})},useModal=()=>(0,a.useContext)(o)},48671:function(e,t,r){r.d(t,{Q:function(){return useNewSearchProduct},x:function(){return NewSearchProductProvider}});var n=r(85893),a=r(67294),o=r(22952),i=r(76827),l=r(35160),u=r(51870),s=r(51745),d=r(56255),c=r(11163),v=r(68875),h=r(15902);let f=(0,a.createContext)(null);function NewSearchProductProvider(e){let{children:t,...r}=e,[C,S]=(0,a.useState)([]),[p,m]=(0,a.useState)([]),[g,y]=(0,a.useState)(""),[P,x]=(0,a.useState)(!1),[_,I
1]=(0,a.useState)([]),[R,E]=(0,a.useState)({}),[w,A]=(0,a.useState)([]),[D,N]=(0,a.useState)({}),[O,L]=(0,a.useState)({}),{productsList:M}=(0,i.j)(),[T,j]=(0,a.useState)(!1),[b,F]=(0,a.useState)([]),[H,k]=(0,a.useState)(!1),[B,Z]=(0,a.useState)({}),[G,U]=(0,a.useState)(!1),[V,Q]=(0,a.useState)(!1),{pathname:W,query:q}=(0,c.useRouter)(),X="/[clientId]/efficient-purchase/[posId]"===W,J=(null==q?void 0:q.concentration)||(null==q?void 0:q.searchByDrug),[Y,z]=(0,a.useState)(!1),[K,$]=(0,a.useState)(!1),ee=(0,v.p)(),{pointOfSale:et}=(0,h.g)(),handleOpen=e=>{j(e),z(!1)},{user:er}=(0,d.aF)({}),handleResetSearch=()=>{y(""),I([]),L({}),N({}),E({}),z(!1)},fetchData=async function(e){var t,r,n,a,o,i,u,d,c,v,h,f,C,S,p;let m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50,y=arguments.length>3&&void 0!==arguments[3]&&arguments[3],P=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};y&&!Y&&k(!0),x(!0);try{if(s.Rk){let s=X||Y?"/api/points-of-sale/44/search-products?only_preview":"/api/points-of-sale/44/search-products",{data:d}=await l.Xl.post(s,{search:J?null==e?void 0:e.replace(J,"").trim():e,size:g,from:m,...J&&!Y&&{concentration:"true"!==J?J:null},...P});z(!1),E(d.data.by_drug),d.data.by_drug||I((null===(t=d.data)||void 0===t?void 0:t.hits)||[]),x(!1),y&&k(!1),!Y&&(I((null===(r=d.data)||void 0===r?void 0:r.hits)||[]),A((null===(n=d.data)||void 0===n?void 0:n.aggregations)||[]),y?(F((null===(a=d.data)||void 0===a?void 0:a.hits)||[]),Z((null==d?void 0:null===(o=d.meta)||void 0===o?void 0:o.pagination)||[]),L((null==d?void 0:null===(i=d.meta)||void 0===i?void 0:i.pagination)||[])):L((null==d?void 0:null===(u=d.meta)||void 0===u?void 0:u.pagination)||[]),x(!1),y&&k(!1))}else{let t=null==et?void 0:et.id,r=X||Y?"/api/points-of-sale/".concat(t,"/search-products?only_preview"):"/api/points-of-sale/".concat(t,"/search-products"),{data:n}=await l.Xl.post(r,{search:J?null==e?void 0:e.replace(J,"").trim():e,size:g,from:m,...J&&!Y&&{concentration:"true"!==J?J:null},...P});z(!1),E(n.data.by_drug),n.data.by_drug||I((null===(d=n.data)||void 0===d?void 0:d.hits)||[]),x(!1),y&&k(!1),!Y&&(I((null===(c=n.data)||void 0===c?void 0:c.hits)||[]),A((null===(v=n.data)||void 0===v?void 0:v.aggregations)||[]),y?(F((null===(h=n.data)||void 0===h?void 0:h.hits)||[]),Z((null==n?void 0:null===(f=n.meta)||void 0===f?void 0:f.pagination)||[]),L((null==n?void 0:null===(C=n.meta)||void 0===C?void 0:C.pagination)||[])):L((null==n?void 0:null===(S=n.meta)||void 0===S?void 0:S.pagination)||[]),x(!1),y&&k(!1))}return}catch(e){[500,400,404].includes(null==e?void 0:null===(p=e.response)||void 0===p?void 0:p.status)&&(x(!1),y&&k(!1),I([]),L([]),E({}))}},updateLastSearchFromLocalStorage=()=>{let e=JSON.parse(localStorage.getItem("lastSearch"));e||localStorage.setItem("lastSearch",JSON.stringify([])),S(e)};(0,a.useEffect)(()=>{updateLastSearchFromLocalStorage()},[]);let en=[g,J,null==q?void 0:q.search];(0,a.useEffect)(()=>{K||""===g.trim()||fetchData(g,1,50,!0)},en),(0,a.useEffect)(()=>{let e=(0,u.e)(_,g);m(e)},[_]);let processEAN=async e=>{try{var t,r,n;let a=null==et?void 0:et.id;if(!a)throw Error("No hay PDV seleccionado");let{data:o}=await l.Xl.post("/api/points-of-sale/".concat(a,"/search-products?only_preview"),{search:e,size:50,from:1});if((null==o?void 0:null===(r=o.data)||void 0===r?void 0:null===(t=r.hits)||void 0===t?void 0:t.length)===0)return[];return null==o?void 0:null===(n=o.data)||void 0===n?void 0:n.hits}catch(t){ee.showToaster({message:{title:"Error al buscar el EAN ".concat(e)},duration:5e3,type:"error"})}};return(0,n.jsx)(f.Provider,{value:{productsList:M,currentSearch:g,setCurrentSearch:y,lastSearch:C,setLastSearch:S,updateProductQuantity:(e,t)=>(0,o.RO)(M,e,t),existsProductInCart:e=>{let t=(0,o.OO)(M,e);return t},isLoading:P,setIsLoading:x,fetchData,searchDataLength:()=>null==_?void 0:_.length,cleanSearchData:()=>{I([]),m([]),E({})},listedProducts:p,pagination:O,searchData:_,isOpen:T,handleOpen,resultsList:b,isLoadingByResults:H,paginationByResults:B,setSearchData:I,handleResetSearch,searchAggregations:w,setAggregationsTypes:N,aggregationsTypes:D,updateLastSearch:e=>{if((null==C?void 0:C.length)===0||(null==C?void 0:C.indexOf(e))===-1){null==C||C.unshift(e);let t=C.slice(0,6);S(t),localStorage.setItem("lastSearch",JSON.stringify(t))}},activeShakeAnimation:G,isClickButtonByCode:V,handleClickButtonByCode:()=>{y(""),handleOpen(!1),handleResetSearch(),U(!0),Q(!0),setTimeout(()=>{U(!1),Q(!1)},1e3)},instantPreviewData:R,searchByInstantPreview:Y,setSearchByInstantPreview:z,checked:K,setChecked:$,processEAN,...r},children:t})}function useNewSearchProduct(){let e=(0,a.useContext)(f);if(void 0===e)throw Error("useSearchProductContext must be used within a ConfirmationProvider");return e}},40780:function(e,t,r){r.d(t,{P:function(){return useFiltersContext},W:function(){return FiltersProvider}});var n=r(85893),a=r(67294),o=r(7069),i=r(64751),l=r(51745);let u=(0,a.createContext)(null),FiltersProvider=e=>{let{children:t}=e,r={from:(0,i.sG)((0,o.Z)(new Date,6)),to:(0,i.sG)(new Date)},[s,d]=(0,a.useState)([]),[c,v]=(0,a.useState)([]),[h,f]=(0,a.useState)(""),[C,S]=(0,a.useState)(r),[p,m]=(0,a.useState)([]),[g,y]=(0,a.useState)([]),[P,x]=(0,a.useState)(null);return(0,n.jsx)(u.Provider,{value:{listTagTerms:s,setListTagTerms:d,listDrugTerms:c,setListDrugTerms:v,searchTerms:h,setSearchTerms:f,dateTerms:C,setDateTerms:S,...l.vR?{invoiceStatusTerms:p,setInvoiceStatusTerms:m,purchaseTypeTerms:g,setPurchaseTypeTerms:y,withCommercialAgreement:P,setWithCommercialAgreement:x}:{}},children:t})},useFiltersContext=()=>(0,a.useContext)(u)},15633:function(e,t,r){r.d(t,{T:function(){return ProgressBarPriceProvider},h:function(){return useProgressBarPriceContext}});var n=r(85893),a=r(67294),o=r(36609),i=r(11163),l=r(51745),u=r(15902),s=r(56255),d=r(94595),c=r(78524);let v={currentStep:1,currentHeaderStep:1,steps:[{icon:e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,n.jsx)("path",{d:"M5.02497 21C4.47497 21 4.00413 20.8042 3.61247 20.4125C3.2208 20.0208 3.02497 19.55 3.02497 19V11.05C2.64163 10.7 2.3458 10.25 2.13747 9.7C1.92913 9.15 1.92497 8.55 2.12497 7.9L3.17497 4.5C3.3083 4.06667 3.5458 3.70833 3.88747 3.425C4.22913 3.14167 4.62497 3 5.07497 3H18.975C19.425 3 19.8166 3.1375 20.15 3.4125C20.4833 3.6875 20.725 4.05 20.875 4.5L21.925 7.9C22.125 8.55 22.1208 9.14167 21.9125 9.675C21.7041 10.2083 21.4083 10.6667 21.025 11.05V19C21.025 19.55 20.8291 20.0208 20.4375 20.4125C20.0458 20.8042 19.575 21 19.025 21H5.02497ZM14.225 10C14.675 10 15.0166 9.84583 15.25 9.5375C15.4833 9.22917 15.575 8.88333 15.525 8.5L14.975 5H13.025V8.7C13.025 9.05 13.1416 9.35417 13.375 9.6125C13.6083 9.87083 13.8916 10 14.225 10ZM9.72497 10C10.1083 10 10.4208 9.87083 10.6625 9.6125C10.9041 9.35417 11.025 9.05 11.025 8.7V5H9.07497L8.52497 8.5C8.4583 8.9 8.5458 9.25 8.78747 9.55C9.02913 9.85 9.34163 10 9.72497 10ZM5.27497 10C5.57497 10 5.83747 9.89167 6.06247 9.675C6.28747 9.45833 6.42497 9.18333 6.47497 8.85L7.02497 5H5.07497L4.07497 8.35C3.97497 8.68333 4.029
113 9.04167 4.23747 9.425C4.4458 9.80833 4.79163 10 5.27497 10ZM18.775 10C19.2583 10 19.6083 9.80833 19.825 9.425C20.0416 9.04167 20.0916 8.68333 19.975 8.35L18.925 5H17.025L17.575 8.85C17.625 9.18333 17.7625 9.45833 17.9875 9.675C18.2125 9.89167 18.475 10 18.775 10ZM5.02497 19H19.025V11.95C18.9416 11.9833 18.8875 12 18.8625 12H18.775C18.325 12 17.9291 11.925 17.5875 11.775C17.2458 11.625 16.9083 11.3833 16.575 11.05C16.275 11.35 15.9333 11.5833 15.55 11.75C15.1666 11.9167 14.7583 12 14.325 12C13.875 12 13.4541 11.9167 13.0625 11.75C12.6708 11.5833 12.325 11.35 12.025 11.05C11.7416 11.35 11.4125 11.5833 11.0375 11.75C10.6625 11.9167 10.2583 12 9.82497 12C9.34163 12 8.90413 11.9167 8.51247 11.75C8.1208 11.5833 7.77497 11.35 7.47497 11.05C7.12497 11.4 6.77913 11.6458 6.43747 11.7875C6.0958 11.9292 5.7083 12 5.27497 12H5.16247C5.1208 12 5.07497 11.9833 5.02497 11.95V19Z",fill:e})})},{icon:e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,n.jsx)("path",{d:"M14.25 21.4C13.8667 21.7833 13.3917 21.975 12.825 21.975C12.2583 21.975 11.7833 21.7833 11.4 21.4L2.6 12.6C2.41667 12.4167 2.27083 12.2 2.1625 11.95C2.05417 11.7 2 11.4333 2 11.15V4C2 3.45 2.19583 2.97917 2.5875 2.5875C2.97917 2.19583 3.45 2 4 2H11.15C11.4333 2 11.7 2.05417 11.95 2.1625C12.2 2.27083 12.4167 2.41667 12.6 2.6L21.4 11.425C21.7833 11.8083 21.975 12.2792 21.975 12.8375C21.975 13.3958 21.7833 13.8667 21.4 14.25L14.25 21.4ZM12.825 20L19.975 12.85L11.15 4H4V11.15L12.825 20ZM6.5 8C6.91667 8 7.27083 7.85417 7.5625 7.5625C7.85417 7.27083 8 6.91667 8 6.5C8 6.08333 7.85417 5.72917 7.5625 5.4375C7.27083 5.14583 6.91667 5 6.5 5C6.08333 5 5.72917 5.14583 5.4375 5.4375C5.14583 5.72917 5 6.08333 5 6.5C5 6.91667 5.14583 7.27083 5.4375 7.5625C5.72917 7.85417 6.08333 8 6.5 8Z",fill:e})})},{icon:e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,n.jsx)("path",{d:"M16 11C16.2833 11 16.5208 10.9042 16.7125 10.7125C16.9042 10.5208 17 10.2833 17 10C17 9.71667 16.9042 9.47917 16.7125 9.2875C16.5208 9.09583 16.2833 9 16 9C15.7167 9 15.4792 9.09583 15.2875 9.2875C15.0958 9.47917 15 9.71667 15 10C15 10.2833 15.0958 10.5208 15.2875 10.7125C15.4792 10.9042 15.7167 11 16 11ZM9 9H12C12.2833 9 12.5208 8.90417 12.7125 8.7125C12.9042 8.52083 13 8.28333 13 8C13 7.71667 12.9042 7.47917 12.7125 7.2875C12.5208 7.09583 12.2833 7 12 7H9C8.71667 7 8.47917 7.09583 8.2875 7.2875C8.09583 7.47917 8 7.71667 8 8C8 8.28333 8.09583 8.52083 8.2875 8.7125C8.47917 8.90417 8.71667 9 9 9ZM5.925 21C5.54167 21 5.17083 20.8667 4.8125 20.6C4.45417 20.3333 4.21667 20.0083 4.1 19.625C3.68333 18.225 3.34167 17.0125 3.075 15.9875C2.80833 14.9625 2.59583 14.0625 2.4375 13.2875C2.27917 12.5125 2.16667 11.825 2.1 11.225C2.03333 10.625 2 10.05 2 9.5C2 7.96667 2.53333 6.66667 3.6 5.6C4.66667 4.53333 5.96667 4 7.5 4H12.5C12.95 3.4 13.5208 2.91667 14.2125 2.55C14.9042 2.18333 15.6667 2 16.5 2C16.9167 2 17.2708 2.14583 17.5625 2.4375C17.8542 2.72917 18 3.08333 18 3.5C18 3.6 17.9875 3.7 17.9625 3.8C17.9375 3.9 17.9083 3.99167 17.875 4.075C17.8083 4.25833 17.7458 4.44167 17.6875 4.625C17.6292 4.80833 17.5833 5.00833 17.55 5.225L19.825 7.5H21C21.2833 7.5 21.5208 7.59583 21.7125 7.7875C21.9042 7.97917 22 8.21667 22 8.5V13.75C22 13.9667 21.9375 14.1583 21.8125 14.325C21.6875 14.4917 21.5167 14.6167 21.3 14.7L19.175 15.4L17.925 19.575C17.7917 20.0083 17.55 20.3542 17.2 20.6125C16.85 20.8708 16.45 21 16 21H14C13.45 21 12.9792 20.8042 12.5875 20.4125C12.1958 20.0208 12 19.55 12 19H10C10 19.55 9.80417 20.0208 9.4125 20.4125C9.02083 20.8042 8.55 21 8 21H5.925ZM6 19H8V17H14V19H16L17.55 13.85L20 13.025V9.5H19L15.5 6C15.5 5.66667 15.5208 5.34167 15.5625 5.025C15.6042 4.70833 15.6667 4.4 15.75 4.1C15.2667 4.23333 14.8417 4.4625 14.475 4.7875C14.1083 5.1125 13.8417 5.51667 13.675 6H7.5C6.53333 6 5.70833 6.34167 5.025 7.025C4.34167 7.70833 4 8.53333 4 9.5C4 10.1833 4.175 11.3542 4.525 13.0125C4.875 14.6708 5.36667 16.6667 6 19Z",fill:e})}),confirmIcon:e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,n.jsx)("path",{d:"M9.54999 15.15L18.025 6.675C18.225 6.475 18.4625 6.375 18.7375 6.375C19.0125 6.375 19.25 6.475 19.45 6.675C19.65 6.875 19.75 7.1125 19.75 7.3875C19.75 7.6625 19.65 7.9 19.45 8.1L10.25 17.3C10.05 17.5 9.81666 17.6 9.54999 17.6C9.28333 17.6 9.04999 17.5 8.84999 17.3L4.54999 13C4.34999 12.8 4.25416 12.5625 4.26249 12.2875C4.27083 12.0125 4.37499 11.775 4.57499 11.5
175C4.77499 11.375 5.01249 11.275 5.28749 11.275C5.56249 11.275 5.79999 11.375 5.99999 11.575L9.54999 15.15Z",fill:e})}),errorIcon:e=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",children:(0,n.jsx)("path",{d:"M20 22.3334L11.8333 30.5001C11.5277 30.8056 11.1388 30.9584 10.6666 30.9584C10.1944 30.9584 9.80551 30.8056 9.49996 30.5001C9.1944 30.1945 9.04163 29.8056 9.04163 29.3334C9.04163 28.8612 9.1944 28.4723 9.49996 28.1667L17.6666 20.0001L9.49996 11.8334C9.1944 11.5279 9.04163 11.139 9.04163 10.6667C9.04163 10.1945 9.1944 9.80564 9.49996 9.50008C9.80551 9.19453 10.1944 9.04175 10.6666 9.04175C11.1388 9.04175 11.5277 9.19453 11.8333 9.50008L20 17.6667L28.1666 9.50008C28.4722 9.19453 28.8611 9.04175 29.3333 9.04175C29.8055 9.04175 30.1944 9.19453 30.5 9.50008C30.8055 9.80564 30.9583 10.1945 30.9583 10.6667C30.9583 11.139 30.8055 11.5279 30.5 11.8334L22.3333 20.0001L30.5 28.1667C30.8055 28.4723 30.9583 28.8612 30.9583 29.3334C30.9583 29.8056 30.8055 30.1945 30.5 30.5001C30.1944 30.8056 29.8055 30.9584 29.3333 30.9584C28.8611 30.9584 28.4722 30.8056 28.1666 30.5001L20 22.3334Z",fill:e})})}],headerSteps:[{headerTitle:e=>(0,o.t)("progressBarPrice.title1",{value:e}),headerSubTitle:()=>(0,o.t)("progressBarPrice.title2")},{headerTitle:e=>(0,o.t)("progressBarPrice.body1"),headerSubTitle:e=>(0,o.t)("progressBarPrice.body2")},{headerTitle:e=>(0,o.t)("progressBarPrice.body3"),ErrorHeaderTitle:e=>(0,o.t)("progressBarPrice.body5"),ErrorHeaderSubTitle:e=>(0,o.t)("progressBarPrice.body6")}],timeLeft:0,quantityRequestedProducts:0,handleTimeLeft:e=>{},handleQuantityRequestedProducts:e=>{},handleCurrentStep:e=>{},handleCurrentHeaderStep:e=>{},handleProgress:e=>{},progress:3,orderId:null,remainingAttempts:null,drugManufacturerStatusList:[],handleOrderId:e=>{},handleRemainingAttempts:e=>{},handleDrugManufacturerStatusList:e=>{},redirectToComparative:()=>{},failed:!1,handleFailed:()=>{},completed:!1,handleCompleted:()=>{},hasErrors:!1,handleErrors:()=>{},resetStates:()=>{},displayComparison:!0,handleDisplayComparison:e=>{},estimatedSavings:0,handleEstimatedSavings:e=>{}},h=(0,a.createContext)(v),ProgressBarPriceProvider=e=>{let{children:t}=e,{push:r,query:o}=(0,i.useRouter)(),{handleResetVisibility:f}=(0,c.o)(),{pointOfSale:C}=(0,u.g)(),{formatCurrency:S}=(0,d.Z)(),[p,m]=(0,a.useState)(v.orderId),[g,y]=(0,a.useState)(v.remainingAttempts),[P,x]=(0,a.useState)(v.drugManufacturerStatusList),{user:_}=(0,s.aF)({}),[I,R]=(0,a.useState)(v.currentStep),[E,w]=(0,a.useState)(v.currentHeaderStep),[A,D]=(0,a.useState)(v.progress),[N,O]=(0,a.useState)(v.timeLeft),[L,M]=(0,a.useState)(v.quantityRequestedProducts),[T,j]=(0,a.useState)(v.hasErrors),[b,F]=(0,a.useState)(v.displayComparison),[H,k]=(0,a.useState)(v.estimatedSavings),B=v.steps,Z=v.headerSteps,[G,U]=(0,a.useState)(v.failed),[V,Q]=(0,a.useState)(!1),{originalValue:W}=S({value:H});return(0,n.jsx)(h.Provider,{value:{currentStep:I,currentHeaderStep:E,steps:B,headerSteps:Z,timeLeft:N,quantityRequestedProducts:L,handleTimeLeft:e=>{O(e)},handleQuantityRequestedProducts:e=>{M(e)},handleCurrentStep:e=>{R(e)},handleCurrentHeaderStep:e=>{w(e)},progress:A,handleProgress:e=>{D(e)},orderId:p,remainingAttempts:g,drugManufacturerStatusList:P,handleOrderId:e=>{m(e)},handleRemainingAttempts:e=>{y(e)},handleDrugManufacturerStatusList:e=>{x(e)},redirectToComparative:()=>{localStorage.setItem("drugManufacturerStatusList",JSON.stringify(P)),b?r({pathname:"/".concat(null==o?void 0:o.clientId,"/efficient-purchase/").concat(null==C?void 0:C.id,"/product-comparison"),query:{orderId:p,...!!(null==_?void 0:_.free_trial_first_get_price)&&{utm_campaign:l.tN,utm_source:l.ll,utm_medium:l.ql,utm_term:l.gu,utm_content:l.dI}}}):(f(),r({pathname:"/".concat(null==o?void 0:o.clientId,"/efficient-purchase/").concat(null==C?void 0:C.id,"/confirmation"),query:{orderId:p,estimatedSavings:W}}))},failed:G,handleFailed:()=>{U(!0)},completed:V,handleCompleted:()=>{Q(!0)},hasErrors:T,handleErrors:()=>{j(!0)},resetStates:()=>{R(v.currentStep),w(v.currentHeaderStep),O(v.timeLeft),M(v.quantityRequestedProducts),D(v.progress),m(v.orderId),y(v.remainingAttempts),x(v.drugManufacturerStatusList),U(v.failed),Q(v.completed),j(v.hasErrors),F(v.displayComparison)},displayComparison:b,handleDisplayComparison:e=>{F(e)},estimatedSavings:H,handleEstimatedSavings:e=>{k(t=>e)}},children:t})},useProgressBarPriceContext=()=>(0,a.useContext)(h)},33933:function(e,t,r){r.d(t,{i:function(){return RecommendedProductsProvider},K:function(){return useRecommendedProducts}});var n=r(85893),a=r(67294),o=r(11163),i=r(15902),l=r(82515);let useFetchRecommendedProducts=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{data:r,mutate:n,isValidating:a}=(0,l.ZP)(null!=e?"api/recommended-products/".concat(e,"?page=").concat(t):null,{revalidateOnFocus:!1,dedupingInterval:3e5,shouldRetryOnError:!1});return{data:r,mutate:n,isValidating:a}};var u=r(95322);let s=(0,a.createContext)(null);function RecommendedProductsProvider(e){let{children:t,...r}=e,{pathname:a,query:{posId:l}}=(0,o.useRouter)(),{pointOfSale:d}=(0,i.g)(),c=(0,u.dE)(d),v=(0,u.HR)(d),h="[posId]"!==a.split("/").at(-1)||!l||c||v?null:Number(l),{data:f,isValidating:C}=useFetchRecommendedProducts(h,1);return(0,n.jsx)(s.Provider,{value:{recommendedProducts:null==f?void 0:f.data,fetching:C,...r},children:t})}function useRecommendedProducts(){let e=(0,a.useContext)(s);if(void 0===e)throw Error("useRecommendedProducts must be used within a ConfirmationProvider");return e}},60948:function(e,t,r){r.d(t,{N:function(){return useReloadProducts},P:function(){return ReloadProducts}});var n=r(85893),a=r(67294);let o=a.createContext(null),ReloadProducts=e=>{let{children:t}
1=e,[r,i]=a.useState(!1),[l,u]=a.useState(!1),[s,d]=a.useState(1);return(0,n.jsx)(o.Provider,{value:{reload:r,setReload:i,change:l,setChange:u,arrayGroups:[],num:s,setNumber:d},children:t})};function useReloadProducts(){let e=a.useContext(o);if(void 0===e)throw Error("usePos must be used within a PosProvider");return e}},32970:function(e,t,r){r.d(t,{D:function(){return useSnackbar},q:function(){return SnackProvider}});var n=r(85893),a=r(67294),o=r(68875);let i=(0,a.createContext)(null);function SnackProvider(e){let{children:t}=e,{showToaster:r,clearToaster:a,toaster:l}=(0,o.p)();return(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(i.Provider,{value:{show:e=>{let{message:t,title:n,error:a,actionButton:o,success:i,withCircularProgress:l,onClose:u=()=>{}}=e;r({message:{...null!=n&&n.length>0?{title:n}:{},description:t},type:a?"error":i?"success":"info",duration:5e3,actionButton:o,withCircularProgress:l,onClose:u})},hide:()=>{a()},toaster:l},children:t})})}function useSnackbar(){let e=(0,a.useContext)(i);if(void 0===e)throw Error("useSnackbar must be used within a SnackbarProvider");return e}},3041:function(e,t,r){r.d(t,{R:function(){return useUrlContext},h:function(){return UrlProvider}});var n=r(85893),a=r(67294);let o=(0,a.createContext)(null),UrlProvider=e=>{let{children:t}=e,[r,i]=(0,a.useState)("");return(0,n.jsx)(o.Provider,{value:{urlPrev:r,savePrevUrl:e=>{i(e)}},children:t})},useUrlContext=()=>(0,a.useContext)(o)},76470:function(e,t,r){var n,a;r.d(t,{Q:function(){return n}}),(a=n||(n={}))[a.UNKNOWN_ERROR=1]="UNKNOWN_ERROR",a[a.WRONG_USERNAME_PASSWORD=2]="WRONG_USERNAME_PASSWORD",a[a.OPERATION_FORBIDDEN=3]="OPERATION_FORBIDDEN",a[a.CREDIT_LIMIT_REACHED=4]="CREDIT_LIMIT_REACHED",a[a.REASON_PROVIDED=5]="REASON_PROVIDED",a[a.EXPIRED_PASSWORD=6]="EXPIRED_PASSWORD",a[a.MISSING_ACCOUNT=7]="MISSING_ACCOUNT",a[a.MISSING_DISPATCH_ADDRESS=8]="MISSING_DISPATCH_ADDRESS",a[a.INVALID_FILE=9]="INVALID_FILE",a[a.MISSING_FORMAT=10]="MISSING_FORMAT",a[a.ERROR_SETTING_PROXY=11]="ERROR_SETTING_PROXY",a[a.BELOW_MINIMUN_PURCHASE=12]="BELOW_MINIMUN_PURCHASE",a[a.TEMPORARILY_UNAVAILABLE_DRUGMANUFACTURER=13]="TEMPORARILY_UNAVAILABLE_DRUGMANUFACTURER"},70627:function(e,t,r){var n,a,o,i;r.d(t,{h:function(){return n}}),(o=n||(n={}))[o.offline=1]="offline",o[o.online=2]="online",o[o.vendor=3]="vendor",(i=a||(a={}))[i.invalid_format=1]="invalid_format",i[i.credential_error=2]="credential_error"},51870:function(e,t,r){r.d(t,{e:function(){return filterSearch}});let filterSearch=(e,t)=>{let r;let n=t.replace(/-/g,"");return/^[a-zA-Z0-9ñÑ]+$/.test(n)||/[áéíóúÁÉÍÓÚ]/g.test(n)||/\s/g.test(n)?e.filter(e=>{let t=null==e?void 0:e._source;if(t){var r;return(t.description||"").toLowerCase().includes(n.toLowerCase())||String((null===(r=t.ean)||void 0===r?void 0:r[0])||"").includes(n.toLowerCase())||(t.troquel||"").toLowerCase().includes(n.toLowerCase())||(t.drug||"").toLowerCase().includes(n.toLowerCase())||(t.laboratory||"").toLowerCase().includes(n.toLowerCase())}}):r}},94595:function(e,t,r){var n=r(36609),a=r(51745),o=r(7738);t.Z=()=>{let includesDecimal=e=>null==e?void 0:e.includes(".");return{formatCurrency:e=>{let{value:t,isoCode:r,digitsValidation:i}=e,l="currency.country"===(0,n.t)("currency.country")?"es-AR":(0,n.t)("currency.country"),u="currency.isoCode"===(0,n.t)("currency.isoCode")?"ARS":(0,n.t)("currency.isoCode"),s=a.u_?(0,o.h)():null,d=(null==s?void 0:s.locale)||l,c=(null==s?void 0:s.isoCode)||u,v=2;if(i){let e=null==t?void 0:t.toString(),r=!!i&&includesDecimal(e),n=r?null==e?void 0:e.split(".")[0]:e;(null==n?void 0:n.length)>i&&(v=0)}let h={style:"currency",currency:r||c,useGrouping:!0,...i&&{maximumFractionDigits:v,roundingMode:"floor"}},f=new Intl.NumberFormat(d,h),C=null==f?void 0:f.format(+t),S=null==f?void 0:f.formatToParts(+t),p="",m="",g="",y="";for(let e of S)(null==e?void 0:e.type)==="integer"||(null==e?void 0:e.type)==="group"?p+=null==e?void 0:e.value:(null==e?void 0:e.type)==="decimal"?m=null==e?void 0:e.value:(null==e?void 0:e.type)==="fraction"?g=null==e?void 0:e.value:(null==e?void 0:e.type)==="currency"&&(y=null==e?void 0:e.value);let P={mainInteger:p,decimalSeparator:m,cents:g,currencySymbol:y},x={fullValue:C,taxLabel:"currency.taxLabel"===(0,n.t)("currency.labelTax")?"+ IVA"
1:(0,n.t)("currency.labelTax"),detailedValues:P,currencyParts:S,originalValue:t};return x}}}},75597:function(e,t,r){r.d(t,{default:function(){return a}});var n=r(21177),a={Model:n.G4,Types:{StringType:n.uW,NumberType:n.sw,ArrayType:n.ts,DateType:n.Uv,ObjectType:n.LP,BooleanType:n.wy,MixedType:n.vx}}}}]);

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.