PageSourceSearch

https://simplepizzadelivery.com.br/assets/index-KBECtDGu.js

js simplepizzadelivery.com.br collected 2026-09-29 01:29:35 UTC 16,506 bytes, 5 lines download raw bytes

1
2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8852f231-2530-5808-a575-834c944726d8")}catch(e){}}();
3import{u as F,R as r,j as a,G as q,S as X,I as K,d as Y,P as m,m as k,c as D,r as u,a as J,b as G,w as B,e as $,_ as Q,f as z,g as H,h as Z,i as ee,k as V,L as P,l as te,C as ae,n as se,o as ie,p as oe}from"./index-CVhO1mfm.js";import{O as ce}from"./index-C5Xw5HCy.js";import{u as j,g as ne}from"./apiEndpoints-BbCkNzPE.js";import{u as b,a as L}from"./useLogisticsPIN-DX0Kedau.js";import{u as _,L as w,a as A,P as x}from"./usePushNotificationStatus-DuNyDhUX.js";import{u as re}from"./useDeliveryManPedingOrders-DcYTU_r1.js";import"./whatsappLink-CCcWEDnq.js";import"./Products-Clk528Gk.js";function le(){return new Promise((i,e)=>{function s({coords:t}){t.latitude&&t.longitude&&i({latitude:t.latitude,longitude:t.longitude})}navigator.geolocation.getCurrentPosition(s,e,{enableHighAccuracy:!0,timeout:1e4,maximumAge:1e4})})}function de(i){const{data:e,error:s,isLoading:t,mutate:n}=F(i?"geolocation":null,le,{refreshWhenHidden:!0,refreshWhenOffline:!1,revalidateOnFocus:!0,dedupingInterval:1e4,refreshInterval:2e4,compare:(c,o)=>c===o});return{position:e,isLoading:t,isError:s,mutate:n}}function ue(){const i=b(c=>{var o;return(o=c.deliveryMan)==null?void 0:o.status}),e=_(c=>c.status),s=_(c=>c.setStatus),{position:t}=de(e===w.GRANTED&&i==="online");r.useEffect(()=>{(async()=>{try{if(!("geolocation"in navigator)){s(w.NO_SUPPORT);return}const o=await navigator.permissions.query({name:"geolocation"});o.state==="granted"?s(w.GRANTED):o.state==="prompt"?s(w.PENDING):s(w.DENIED)}catch{s(w.ERROR)}})()},[s]);const n=r.useCallback(async({latitude:c,longitude:o})=>{try{c&&o&&await j({last_latitude:c,last_longitude:o})}catch{}},[]);return r.useEffect(()=>{t&&t.latitude&&t.longitude&&n(t)},[t,n]),null}function U({notifications:i,setNotifications:e}){const[s,t]=r.useState(null),n=r.useRef(!1);r.useEffect(()=>{i.length>0&&!n.current&&(n.current=!0,navigator.vibrate&&navigator.vibrate(500),t(i[0]),e(o=>o.slice(1)))},[s,i,e]);const c=r.useCallback(()=>{n.current&&(t(null),n.current=!1),t(null)},[]);return s?a.jsx(q,{in:!!s,...s?{timeout:300}:{},children:a.jsx("div",{className:"fixed bottom-20 left-2 right-2 max-w-full rounded-xl border border-gray-200 bg-white shadow-xl",style:{zIndex:1500},children:a.jsxs("div",{className:"flex items-center space-x-6 p-4",children:[a.jsx("div",{children:a.jsx(X,{className:"h-10 w-10 animate-small-bounce fill-current text-primary"})}),a.jsxs("div",{className:"flex-1 space-y-1",children:[a.jsx("div",{className:"text-base font-semibold text-gray-700",children:s.title}),a.jsx("h3",{className:"text-sm text-gray-500",children:s.body})]}),a.jsx(K,{onClick:c,size:"small",color:"primary",children:a.jsx(Y,{})})]})})}):null}U.propTypes={notifications:m.arrayOf(m.shape({title:m.string,body:m.string})).isRequired,setNotifications:m.func.isRequired};function fe(){const[i,e]=r.useState([]),s=A(o=>o.status),t=A(o=>o.setStatus),n=b(o=>{var l;return(l=o.deliveryMan)==null?void 0:l.push_notification_token_chunk}),{mutate:c}=re();return r.useEffect(()=>{if(!("Notification"in window)){t(x.NO_SUPPORT);return}Notification.permission==="granted"?t(x.GRANTED):Notification.permission==="denied"?t(x.DENIED):t(x.PENDING)},[t]),r.useEffect(()=>{k&&k.onMessage(o=>{const l={title:o.notification.title,body:o.notification.body};e(f=>[...f,l]),c()})},[c]),r.useEffect(()=>{const o=async()=>{try{const l=await k.getToken({vapidKey:"BJ7h2_UULTVwYwFKNaO39vB2IKUGcN6a0ilqpLMS9dFlAQXMZ1rGR-T1hVHjwgg3xwSgRV0xpBCaFr4b277cHug"});l?(!n||!l.endsWith(n))&&await j({push_notification_token:l}):t(x.ERROR)}catch{t(x.ERROR)}};s===x.GRANTED&&k&&o()},[s,n,t]),a.jsx(U,{notifications:i,setNotifications:e})}const E=r.forwardRef(({children:i,onClick:e,Icon:s,active:t},n)=>a.jsxs("div",{ref:n,className:D("flex w-20 cursor-pointer select-none flex-col items-center justify-center space-y-1.5 rounded-md p-1 transition-colors",t?"text-primary":"bg-white text-gray-400 opacity-60"),onClick:e,children:[s&&a.jsx(s,{className:"h-5 w-5 fill-current"}),a.jsx("span",{className:"text-center text-xxs font-medium leading-3",children:i})]}));E.propTypes={children:m.node.isRequired,onClick:m.func,Icon:m.elementType,active:m.bool};E.defaultProps={onClick:void 0,Icon:void 0,active:!1};const he=i=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:16,width:14,viewBox:"0 0 448 512",...i},u.createElement("path",{d:"M160 80c0-26.5 21.5-48 48-48h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H208c-26.5 0-48-21.5-48-48V80zM0 272c0-26.5 21.5-48 48-48H80c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V272zM368 96h32c26.5 0 48 21.5 48 48V432c0 26.5-21.5 48-48 48H368c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48z"})),pe=i=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:16,width:16,viewBox:"0 0 512 512",...i},u.createElement("path",{d:"M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.
36 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"})),ge=i=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:16,width:16,viewBox:"0 0 512 512",...i},u.createElement("path",{d:"M512 96c0 50.2-59.1 125.1-84.6 155c-3.8 4.4-9.4 6.1-14.5 5H320c-17.7 0-32 14.3-32 32s14.3 32 32 32h96c53 0 96 43 96 96s-43 96-96 96H139.6c8.7-9.9 19.3-22.6 30-36.8c6.3-8.4 12.8-17.6 19-27.2H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320c-53 0-96-43-96-96s43-96 96-96h39.8c-21-31.5-39.8-67.7-39.8-96c0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8C59.8 473 0 402.5 0 352c0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9c-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"})),p={HOME:"home",HISTORIC:"historic",SETTINGS:"settings"};function me(){const i=J(),[e,s]=r.useState(p.HOME),t=G("/e/:deliveryManId/:page");r.useEffect(()=>{function o(){var l,f;((l=t==null?void 0:t.params)==null?void 0:l.page)==="historico"?s(p.HISTORIC):((f=t==null?void 0:t.params)==null?void 0:f.page)==="configuracoes"?s(p.SETTINGS):e!==p.HOME&&s(p.HOME)}o()},[t,e]);const n=r.useMemo(()=>{var o;return`/e/${(o=i.location.pathname)==null?void 0:o.split("/")[2]}`},[i.location.pathname]);return r.useMemo(()=>[{id:p.HOME,label:"Entregas",Icon:ge,active:e===p.HOME,onClick:()=>{e!==p.HOME&&i.push(n)}},{id:p.HISTORIC,label:"Histórico",Icon:he,active:e===p.HISTORIC,onClick:()=>{i.push(`${n}/historico`)}},{id:p.SETTINGS,label:"Configurações",Icon:pe,active:e===p.SETTINGS,onClick:()=>{i.push(`${n}/configuracoes`)}}],[e,n,i])}function xe(){const i=me();return a.jsx("div",{className:"fixed bottom-0 z-30 flex h-14 w-full flex-shrink-0 justify-center bg-white shadow-top-md",children:a.jsx("div",{className:"flex w-full max-w-md items-center justify-around",children:i.map(({id:e,label:s,Icon:t,active:n,onClick:c})=>a.jsx(E,{Icon:t,active:n,onClick:c,children:s},e))})})}const ye=r.memo(xe);var ve=function(e){return{root:{display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},edgeStart:{marginLeft:-8},edgeEnd:{marginRight:-8},switchBase:{position:"absolute",top:0,left:0,zIndex:1,color:e.palette.type==="light"?e.palette.grey[50]:e.palette.grey[400],transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),"&$checked":{transform:"translateX(20px)"},"&$disabled":{color:e.palette.type==="light"?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{opacity:.5},"&$disabled + $track":{opacity:e.palette.type==="light"?.12:.1}},colorPrimary:{"&$checked":{color:e.palette.primary.main,"&:hover":{backgroundColor:$(e.palette.primary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.type==="light"?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.primary.main},"&$disabled + $track":{backgroundColor:e.palette.type==="light"?e.palette.common.black:e.palette.common.white}},colorSecondary:{"&$checked":{color:e.palette.secondary.main,"&:hover":{backgroundColor:$(e.palette.secondary.main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},"&$disabled":{color:e.palette.type==="light"?e.palette.grey[400]:e.palette.grey[800]},"&$checked + $track":{backgroundColor:e.palette.secondary.main},"&$disabled + $track":{backgroundColor:e.palette.type==="light"?e.palette.common.black:e.palette.common.white}},sizeSmall:{width:40,height:24,padding:7,"& $thumb":{width:16,height:16},"& $switchBase":{padding:4,"&$checked":{transform:"translateX(16px)"}}},checked:{},disabled:{},input:{left:"-100%",width:"300%"},thumb:{boxShadow:e.shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}
3,track:{height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.palette.type==="light"?e.palette.common.black:e.palette.common.white,opacity:e.palette.type==="light"?.38:.3}}},we=u.forwardRef(function(e,s){var t=e.classes,n=e.className,c=e.color,o=c===void 0?"secondary":c,l=e.edge,f=l===void 0?!1:l,h=e.size,g=h===void 0?"medium":h,y=Q(e,["classes","className","color","edge","size"]),v=u.createElement("span",{className:t.thumb});return u.createElement("span",{className:z(t.root,n,{start:t.edgeStart,end:t.edgeEnd}[f],g==="small"&&t["size".concat(H(g))])},u.createElement(Z,ee({type:"checkbox",icon:v,checkedIcon:v,classes:{root:z(t.switchBase,t["color".concat(H(o))]),input:t.input,checked:t.checked,disabled:t.disabled},ref:s},y)),u.createElement("span",{className:t.track}))});const be=B(ve,{name:"MuiSwitch"})(we),Ne=B({root:{width:36,height:18,padding:0,display:"flex"},switchBase:{padding:3,color:"#fff","&$checked":{transform:"translateX(18px)",color:"#fff","& + $track":{opacity:1,backgroundColor:"#10b981",borderColor:"#10b981"}}},thumb:{width:12,height:12,boxShadow:"none"},track:{borderStyle:"solid",borderWidth:1,borderRadius:18/2,opacity:1,backgroundColor:"#d1d5db",borderColor:"#d1d5db"},checked:{}})(be);function ke(){var c,o;const i=V(),e=b(l=>l.deliveryMan),[s,t]=r.useState(!1);r.useEffect(()=>{t((e==null?void 0:e.status)==="online")},[e==null?void 0:e.status]);const n=async l=>{var f,h;t(l.target.checked);try{await j({status:l.target.checked?"online":"offline"})}catch(g){t((e==null?void 0:e.status)==="online"),i.error(((h=(f=g.response)==null?void 0:f.data)==null?void 0:h.message)||"Erro ao atualizar status")}};return e?a.jsx("div",{className:"z-50 flex h-16 w-full flex-shrink-0 items-center justify-center px-4 shadow-md sm:shadow",children:a.jsxs("div",{className:"flex w-full max-w-md items-center space-x-3",children:[a.jsx("div",{className:"h-10 w-10 overflow-hidden rounded-md",children:a.jsx("img",{src:(c=e==null?void 0:e.company)==null?void 0:c.logo,alt:"Logo da empresa",className:"h-full w-full object-cover object-center"})}),a.jsxs("div",{className:"flex flex-1 flex-col justify-center text-gray-700",children:[a.jsx("div",{className:"truncate text-base font-medium",children:e==null?void 0:e.name}),a.jsx("div",{className:"truncate text-sm font-light",children:(o=e==null?void 0:e.company)==null?void 0:o.name})]}),a.jsxs("div",{className:"flex flex-col items-center justify-center space-y-0.5",children:[a.jsx("span",{className:D("text-sm font-medium",s?"text-green-500":"text-gray-500"),children:s?"Online":"Offline"}),a.jsx(Ne,{checked:s,onChange:n})]})]})}):null}const Se=i=>u.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:16,width:16,viewBox:"0 0 581.4 581.4",...i},u.createElement("g",null,u.createElement("path",{d:"M289.425,376.125c-28.05,0-51,22.95-51,51V530.4c0,28.05,22.95,51,51,51s51-22.95,51-51V427.125 C340.425,399.075,317.476,376.125,289.425,376.125z"}),u.createElement("path",{d:"M474.3,63.75h-98.175C364.65,26.775,330.226,0,289.425,0s-75.225,26.775-86.7,63.75h-96.9 c-14.025,0-25.5,11.475-25.5,25.5s11.475,25.5,25.5,25.5H204l0,0c6.375,21.675,20.4,39.525,39.525,51 c-68.85,20.4-119.85,84.15-119.85,159.375V459c0,22.95,19.125,42.075,42.075,42.075h34.425V428.4 c0-49.726,40.8-90.525,90.525-90.525c49.725,0,90.525,40.8,90.525,90.525v72.675h34.425c22.95,0,42.075-19.125,42.075-42.075 V326.4c0-75.226-51-140.25-119.851-159.375c19.125-11.475,33.15-29.325,39.525-51l0,0h98.175c14.025,0,25.5-11.475,25.5-25.5 C499.8,75.225,488.325,63.75,474.3,63.75z M289.425,141.525c-28.05,0-51-22.95-51-51c0-28.05,22.95-51,51-51s51,22.95,51,51 C341.7,118.575,318.75,141.525,289.425,141.525z"}))),je={margin:"6px",width:"3rem",borderRadius:"0.5rem",fontSize:"1.25rem",height:"3rem",textAlign:"center",color:"rgba(55, 65, 81, 1)",border:"1px solid rgba(0,0,0,0.18)",outlineColor:"var(--primary)"},S=5;function Ee(){var I;const i=V(),e=L(d=>d.pinCode),s=L(d=>d.setPinCode),t=b(d=>d.deliveryMan),n=b(d=>d.setDeliveryMan),[c,o]=r.useState(""),[l,f]=r.useState(!1),h=G("/e/:deliveryManId"),g=r.useRef(null),y=r.useRef(null);r.useEffect(()=>{g.current!==null&&document.querySelectorAll("input").forEach(d=>d.setAttribute("placeholder","0"))},[]);const v=r.useCallback(()=>{o(""),g.current&&(g.current.textInput[0]&&g.current.textInput[0].focus(),[...Array(S).keys()].forEac
3h(d=>{g.current.state.input[d]=""}))},[]),C=r.useCallback(async d=>{var R,O,T,M;f(!0);try{const N=(R=h==null?void 0:h.params)==null?void 0:R.deliveryManId,W=await ne(N,d);y.current=d,v(),s(d),n(W)}catch(N){i.error(((T=(O=N.response)==null?void 0:O.data)==null?void 0:T.message)||"Código inválido"),[400,401].includes((M=N.response)==null?void 0:M.status)&&(s(null),n(null)),v()}f(!1)},[i,v,(I=h==null?void 0:h.params)==null?void 0:I.deliveryManId,n,s]);return r.useEffect(()=>{((c==null?void 0:c.length)===S||(e==null?void 0:e.length)===S)&&!t&&(!y.current||y.current!==c&&y.current!==e)&&C(c||e)},[c,C,t,e]),e&&!t?a.jsx("div",{className:"fixed inset-0 z-50",children:a.jsx(P,{color:"primary"})}):a.jsxs("div",{className:"relative flex h-full flex-col items-center justify-center p-10",children:[a.jsxs("div",{className:"flex max-w-sm flex-col items-center justify-center space-y-6",children:[a.jsx("div",{className:"text-primary",children:a.jsx(Se,{className:"h-24 w-24 fill-current"})}),a.jsx("div",{className:"text-xl font-bold text-gray-600",children:"Olá entregador!"}),a.jsx("div",{className:"text-center text-lg font-light text-gray-500",children:"Informe abaixo o código fornecido pelo estabelecimento para ter acesso às suas entregas"}),a.jsx(te,{type:"text",inputMode:"numeric",value:c,onChange:o,fields:S,inputStyle:je,ref:g,autoFocus:!0})]}),l&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-white bg-opacity-80",children:a.jsx(P,{color:"primary"})})]})}function He(){return b(e=>e.deliveryMan)?a.jsx(ae,{children:a.jsxs("div",{className:"flex h-full flex-col antialiased",children:[a.jsx(ke,{}),a.jsx("main",{className:"relative flex flex-1 flex-col items-center overflow-auto bg-background",children:a.jsx("div",{className:"flex w-full max-w-md flex-1 flex-col",children:a.jsx(se,{loadingProps:{color:"primary"},children:ie(oe)})})}),a.jsx(ye,{}),a.jsx(ce,{}),a.jsx(ue,{}),a.jsx(fe,{})]})}):a.jsx(Ee,{})}export{He as default};
4
5//# debugId=8852f231-2530-5808-a575-834c944726d8

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.