PageSourceSearch

https://app.jettsender.com/assets/PublicShipmentFormPage-DioFFc6e.js

js jettsender.com collected 2026-10-02 00:52:59 UTC 27,755 bytes, 2 lines download raw bytes

1import{u as qe,r as n,g as ye,j as e,L as je,R as Ye,c as Je,K as Xe}from"./index-CgT74Ip7.js";import{u as We,t as Qe,o as et,b as Ne,a as tt,s as x,c as st,n as Ce,l as v,Z as ee}from"./types-QMykh8iO.js";import{R as ke}from"./react-country-flag.esm-DEvHH220.js";import{l as at}from"./googleMapsPlaces-CURJiCRN.js";import{e as Z}from"./env-Bfxoibsn.js";import{g as te,C as we,v as nt}from"./phone-validation-DysBaRuG.js";import{C as ot}from"./circle-check-C_2oV8Bt.js";import{C as rt}from"./chevron-down-DMjcuXXl.js";import{U as Se}from"./user-CFyrxBwm.js";import{N as it}from"./navigation-dYsGNU29.js";import{P as ct}from"./package-BasrC6N5.js";import{S as lt}from"./shield-check-DyviXu4C.js";import{L as ve}from"./loader-circle-B1vktZm7.js";import{A as dt}from"./arrow-right-C8xqnKBZ.js";import{M as mt}from"./map-pin-BO3eLsKe.js";import"./createLucideIcon-CmisCwW5.js";function Pe(a,b){return new Promise(u=>{var C,M;const h=window.google;if(!((M=(C=h==null?void 0:h.maps)==null?void 0:C.places)!=null&&M.AutocompleteService)){u([]);return}new h.maps.places.AutocompleteService().getPlacePredictions({input:a,componentRestrictions:{country:b},types:["geocode"]},(y,P)=>{var T,k,w;const D=((w=(k=(T=h==null?void 0:h.maps)==null?void 0:T.places)==null?void 0:k.PlacesServiceStatus)==null?void 0:w.OK)??"OK";if(P!==D||!Array.isArray(y)){u([]);return}u(y.map(j=>{var E,N;return{placeId:String(j.place_id||""),mainText:String(((E=j.structured_formatting)==null?void 0:E.main_text)||j.description||""),secondaryText:String(((N=j.structured_formatting)==null?void 0:N.secondary_text)||""),description:String(j.description||"")}}))})})}function De(a,b){var R;const u=window.google;if(!((R=u==null?void 0:u.maps)!=null&&R.Geocoder))return;new u.maps.Geocoder().geocode({placeId:a},(C,M)=>{var T,k,w,j;if(M!=="OK"||!(C!=null&&C[0]))return;const y=C[0],P=y.address_components||[],D=E=>{var N;return((N=P.find(L=>{var K;return(K=L.types)==null?void 0:K.includes(E)}))==null?void 0:N.long_name)||""};b({address:y.formatted_address||"",city:D("locality")||D("sublocality")||"",state:D("administrative_area_level_1"),zip:D("postal_code"),lat:((k=(T=y.geometry)==null?void 0:T.location)==null?void 0:k.lat())??null,lng:((j=(w=y.geometry)==null?void 0:w.location)==null?void 0:j.lng())??null})})}const ut=et({isInternational:Ne(),hondurasDropoffContactName:x().trim().max(255).optional().or(v("")),hondurasDropoffContactCountryCode:x().trim().length(2).optional().or(v("")),hondurasDropoffContactPhonePrefix:x().trim().regex(/^\+[0-9]{1,5}$/).optional().or(v("")),hondurasDropoffContactPhoneNumber:x().trim().max(20).optional().or(v("")),hondurasDropoffContactEmail:x().trim().email().max(255).optional().or(v("")),originAddress:x().trim().min(8,"Dirección de origen requerida").max(255),destinationContact:x().trim().min(2).max(255),destinationContactNumber:x().trim().regex(/^[+0-9()\-\s]{7,20}$/),destinationAddress:x().trim().min(8).max(255),destinationCity:x().trim().min(2).max(100).regex(/^[A-Za-zÀ-ÿ0-9\s.,-]+$/),destinationState:x().trim().min(2).max(100).regex(/^[A-Za-zÀ-ÿ0-9\s.,-]+$/),destinationZipCode:x().trim().max(30).optional(),destinationLatitude:Ce().optional(),destinationLongitude:Ce().optional(),weight:st.number().min(.1).max(150),name:x().trim().min(3).max(255),description:x().max(2e3).optional(),originInstructions:x().max(255).optional(),coverageFee:tt([v(0),v(5),v(10),v(15)]).default(0),isTechnologyPackage:Ne().default(!1)}).superRefine((a,b)=>{var u;if(a.isInternational){if((!a.hondurasDropoffContactName||a.hondurasDropoffContactName.trim().length<2)&&b.addIssue({code:ee.custom,message:"Nombre requerido",path:["hondurasDropoffContactName"]}),!a.hondurasDropoffContactPhoneNumber||a.hondurasDropoffContactPhoneNumber.trim().length<7)b.addIssue({code:ee.custom,message:"Teléfono requerido",path:["hondurasDropoffContactPhoneNumber"]});else if(a.hondurasDropoffContactCountryCode&&!nt(a.hondurasDropoffContactPhoneNumber,a.hondurasDropoffContactCountryCode)){const h=((u=te(a.hondurasDropoffContactCountryCode))==null?void 0:u.mask)||"";b.addIssue({code:ee.custom,message:h?`Formato inválido. Ejemplo: ${h}`:"Formato inválido",path:["hondurasDropoffContactPhoneNumber"]})}}}),Te={es:"ES",en:"US",fr:"FR"},A="#ffdb00",F="#ef3090",ht="#1e416c",se={boxShadow:`4px 6px 0 0 ${A}`},d="w-full rounded-xl border-2 border-black px-4 py-3 text-sm text-gray-900 bg-white placeholder:text-gray-400 focus:outline-none focus:ring-2 focus:ring-yellow-300 transition-all duration-150",m="block text-xs font-bold text-gray-700 mb-1.5 uppercase tracking-wider";function U({icon:a,title:b,headerBg:u,children:h}){return e.jsxs("div",{className:"rounded-2xl border-2 border-black bg-white overflow-hidden",style:se,children:[e.jsxs("div",{className:`flex items-center gap-3 px-5 py-3.5 border-b-2 border-black ${u}`,children:[e.jsx("div",{className:"flex-shrink-0",children:a}),e.jsx("p",{className:"text-xs font-black uppercase tracking-widest",children:b})]}),e.jsx("div",{className:"p-5",children:h})]})}function At(){const{t:a}=qe(),b=!0,[u,h]=n.useState(!1),[R,C]=n.useState(!1),[M,y]=n.useState(""),[P,D]=n.useState(ye()),[T,k]=n.useState(!1),w=n.useRef(null),[j,E]=n.useState([]),N=n.useRef(null),L=n.useRef(null);n.useEffect(()=>{fetch(`${Z.apiUrl}/public/shipment-requests/draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({flowType:"international"})}).then(t=>t.json()).then(t=>{t!=null&&t.draftToken&&(N.current=t.draftToken)}).catch(()=>{})},[]),n.useEffect(()=>{fetch(`${Z.apiUrl}/public/te-lo-llevo/pricing`).then(t=>t.json()).then(t=>{Array.isArray(t==null?void 0:t.prices)&&E(t.prices)}).catch(()=>{})},[]);const K=t=>{Je(t),D(t),k(!1)};n.useEffect(()=>{const t=s=>{w.current&&!w.current.contains(s.target)&&k(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[]);const[I,G]=n.useState(""),[ae,ne]=n.useState([]),[Ae,z]=n.useState(!1),[Me,_]=n.useState(!1),[Le,Ee]=n.useState(null),q=n.useRef(null),[oe,Y]=n.useState(""),[re,J]=n.useState(""),[$,H]=n.useState(""),[ie,ce]=n.useState([]),[Oe,X]=n.useState(!1),[Fe,V]=n.useState(!1),[Re,Ie]=n.useState(null),W=n.useRef(null),{register:l,handleSubmit:_e,reset:$e,setValue:c,watch:B,formState:{errors:i,isSubmitting:le}}=We({resolver:Qe(ut),defaultValues:{isInternational:!0,hondurasDropoffContactCountryCode:"HN",hondurasDropoffContactPhonePrefix:"+504",coverageFee:0,isTechnologyPackage:!1}}),Ve=B("hondurasDropoffContactCountryCode")??"HN",O=B("coverageFee"),Q=Number(B("weight"))||0,de=te(Ve)??we[0];n.useEffect(()=>{const t=B(s=>{N.current&&(L.current&&clearTimeout(L.current),L.current=setTimeout(()=>{var ue,he,pe,xe,fe,ge,be;let o="started";const p=(((ue=s.hondurasDropoffContactName)==null?void 0:ue.trim().length)??0)>=2&&(((he=s.hondurasDropoffContactPhoneNumber)==null?void 0:he.trim().length)??0)>=7,f=(((pe=s.originAddress)==null?void 0:pe.trim().length)??0)>=8,g=(((xe=s.destinationContact)==null?void 0:xe.trim().length)??0)>=2&&(((fe=s.destinationAddress)==null?void 0:fe.trim().length)??0)>=8&&(((ge=s.destinationCity)==null?void 0:ge.trim().length)??0)>=2,S=Number(s.weight)>=.1&&(((be=s.name)==null?void 0:be.trim().length)??0)>=2;p&&(o="sender"),p&&f&&(o="origin"),p&&f&&g&&(o="destination"),p&&f&&g&&S&&(o="package");const r={lastSection:o};s.hondurasDropoffContactName&&(r.senderName=s.hondurasDropoffContactName),s.hondurasDropoffContactPhonePrefix&&(r.senderPhonePrefix=s.hondurasDropoffContactPhonePrefix),s.hondurasDropoffContactPhoneNumber&&(r.senderPhone=s.hondurasDropoffContactPhoneNumber),s.hondurasDropoffContactEmail&&(r.senderEmail=s.hondurasDropoffContactEmail),s.originAddress&&(r.originAddress=s.originAddress),s.destinationContact&&(r.destinationContact=s.destinationContact),s.destinationContactNumber&&(r.destinationContactNumber=s.destinationContactNumber),s.destinationAddress&&(r.destinationAddress=s.destinationAddress),s.destinationCity&&(r.destinationCity=s.destinationCity),s.destinationState&&(r.destinationState=s.destinationState),s.destinationZipCode&&(r.destinationZipCode=s.destinationZipCode),s.destinationLatitude!=null&&(r.destinationLatitude=s.destinationLatitude),s.destinationLongitude!=null&&(r.destinationLongitude=s.destinationLongitude),Number(s.weight)>=.1&&(r.weight=Number(s.weight)),s.name&&(r.name=s.name),s.description&&(r.description=s.description),s.originInstructions&&(r.originInstructions=s.originInstructions),s.coverageFee!=null&&(r.coverageFee=s.coverageFee),s.isTechnologyPackage!=null&&(r.isTechnologyPackage=s.isTechnologyPackage),fetch(`${Z.apiUrl}/public/shipment-requests/draft/${N.current}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).catch(()=>{})},2e3))});return()=>{t.unsubscribe(),L.current&&clearTimeout(L.current)}},[B]),n.useEffect(()=>{var t,s,o;if((o=(s=(t=window.google)==null?void 0:t.maps)==null?void 0:s.places)!=null&&o.AutocompleteService){h(!0);return}at(Z.googleMapsApiKey,ye()).then(()=>h(!0)).catch(()=>{})},[]),n.useEffect(()=>{if(I.trim().length<3){ne([]),z(!1);return}if(z(!0),_(!0),q.current){const o=q.current.getBoundingClientRect();Ee({top:o.bottom+window.scrollY,left:o.left+window.scrollX,width:o.width})}const t=["us","hn"],s=setTimeout(async()=>{ne(await Pe(I,t)),z(!1)},350);return()=>clearTimeout(s)},[I,u,b]),n.useEffect(()=>{if($.trim().length<3){ce([]),X(!1);return}if(X(!0),V(!0),W.current){const s=W.current.getBoundingClientRect();Ie({top:s.bottom+window.scrollY,left:s.left+window.scrollX,width:s.width})}const t=setTimeout(async()=>{ce(await Pe($,["us"])),X(!1)},350);return()=>clearTimeout(t)},[$,u]);const Be=n.useCallback(t=>{_(!1),G(t.description),c("originAddress",t.description,{shouldValidate:!0,shouldDirty:!0}),De(t.placeId,({address:s,city:o,state:p,lat:f,lng:g})=>{const S=s||t.description;G(S),c("originAddress",S,{shouldValidate:!0,shouldDirty:!0}),Y(o||""),J(p||""),f!=null&&c("destinationLatitude",f),g!=null&&c("destinationLongitude",g)})},[c]),Ze=n.useCallback(t=>{V(!1),H(t.description),c("destinationAddress",t.description,{shouldValidate:!0,shouldDirty:!0}),De(t.placeId,({address:s,city:o,state:p,zip:f,lat:g,lng:S})=>{const r=s||t.description;H(r),c("destinationAddress",r,{shouldValidate:!0,shouldDirty:!0}),o&&c("destinationCity",o,{shouldValidate:!0}),p&&c("destinationState",p,{shouldValidate:!0}),f&&c("destinationZipCode",f),g!=null&&c("destinationLatitude",g),S!=null&&c("destinationLongitude",S)})},[c]),me=(t,s,o,p,f)=>!t||!s?null:Xe.createPortal(e.jsxs("div",{style:{position:"absolute",top:s.top+6,left:s.left,width:s.width,zIndex:9999},className:"bg-white border border-gray-200 rounded-2xl shadow-2xl max-h-52 overflow-y-auto",children:[o&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 text-sm text-gray-400",children:[e.jsx(ve,{className:"h-3.5 w-3.5 animate-spin"})," Buscando..."]}),!o&&p.length===0&&e.jsx("div",{className:"px-4 py-3 text-sm text-gray-400",children:"Sin resultados"}),p.map(g=>e.jsxs("button",{type:"button",onMouseDown:S=>{S.preventDefault(),f(g)},className:"flex items-start gap-3 w-full text-left px-4 py-2.5 hover:bg-gray-50 text-sm transition-colors",children:[e.jsx(mt,{className:"h-4 w-4 text-primary mt-0.5 flex-shrink-0"}),e.jsxs("span",{children:[e.jsx("span",{className:"font-medium text-gray-800",children:g.mainText}),g.secondaryText&&e.jsxs("span",{className:"text-gray-400",children:[", ",g.secondaryText]})]})]},g.placeId))]}),document.body),{ref:Ue,...Ke}=l("originAddress"),{ref:Ge,...He}=l("destinationAddress"),ze=async t=>{var s,o;y("");try{const p={flowType:t.isInternational?"international":"domestic",senderName:t.hondurasDropoffContactName||void 0,senderPhonePrefix:t.hondurasDropoffContactPhonePrefix||void 0,senderPhone:t.hondurasDropoffContactPhoneNumber||void 0,senderEmail:t.hondurasDropoffContactEmail||void 0,originAddress:t.originAddress,destinationContact:t.destinationContact,destinationContactNumber:t.destinationContactNumber,destinationAddress:t.destinationAddress,destinationCity:t.destinationCity,destinationState:t.destinationState,destinationZipCode:t.de
1stinationZipCode||void 0,destinationLatitude:t.destinationLatitude,destinationLongitude:t.destinationLongitude,weight:t.weight,name:t.name,description:((s=t.description)==null?void 0:s.trim())||void 0,originInstructions:((o=t.originInstructions)==null?void 0:o.trim())||void 0,coverageFee:t.coverageFee,isTechnologyPackage:t.coverageFee===15?!0:t.isTechnologyPackage??!1,draftToken:N.current??void 0};if(!(await fetch(`${Z.apiUrl}/public/shipment-requests`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(p)})).ok)throw new Error;C(!0),$e(),G(""),H(""),Y(""),J("")}catch{y(a("publicShipmentForm.error"))}};return R?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-6",style:{background:F},children:e.jsxs("div",{className:"bg-white rounded-2xl border-2 border-black p-10 max-w-sm w-full text-center",style:se,children:[e.jsx("div",{className:"mx-auto h-20 w-20 rounded-full flex items-center justify-center mb-6 border-2 border-black",style:{background:A},children:e.jsx(ot,{className:"h-10 w-10 text-black"})}),e.jsx("h2",{className:"text-2xl font-black text-gray-900 mb-3",children:a("publicShipmentForm.successTitle")}),e.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:a("publicShipmentForm.successMsg")})]})}):e.jsxs("div",{className:"min-h-screen",style:{background:"#f5f5f5"},children:[e.jsx("header",{className:"sticky top-0 z-40 border-b-2 border-black",style:{background:ht},children:e.jsxs("div",{className:"max-w-2xl mx-auto px-4 h-16 flex items-center justify-between",children:[e.jsx("img",{src:"/te_lo_llevo.webp",alt:"Te Lo Llevo",className:"h-11 w-auto object-contain"}),e.jsxs("div",{ref:w,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>k(t=>!t),className:"flex items-center gap-2 px-3 py-2 rounded-full border-2 border-white/30 text-xs font-bold text-white hover:border-white transition-all",children:[e.jsx(ke,{countryCode:Te[P],svg:!0,style:{width:"1em",height:"1em",borderRadius:"2px"}}),je[P].label,e.jsx(rt,{className:`h-3 w-3 transition-transform duration-200 ${T?"rotate-180":""}`})]}),T&&e.jsx("div",{className:"absolute right-0 mt-2 w-40 bg-white border-2 border-black rounded-xl z-50 overflow-hidden py-1",style:{boxShadow:"3px 3px 0 0 #000"},children:Object.entries(je).map(([t,{label:s}])=>e.jsxs("button",{type:"button",onClick:()=>K(t),className:["w-full flex items-center gap-3 px-4 py-2.5 text-sm font-semibold transition-colors",P===t?"text-black":"text-gray-600 hover:bg-gray-50"].join(" "),style:P===t?{background:A}:{},children:[e.jsx(ke,{countryCode:Te[t],svg:!0,style:{width:"1.1em",height:"1.1em",borderRadius:"2px"}}),s]},t))})]})]})}),e.jsxs("div",{className:"border-b-2 border-black pt-10 pb-16 px-4 text-center",style:{background:F},children:[e.jsx("div",{className:"inline-block mb-3 px-4 py-1 rounded-full border-2 border-black text-xs font-black uppercase tracking-widest text-black",style:{background:A},children:"Te Lo Llevo — Pa' los Estados"}),e.jsx("h1",{className:"text-3xl sm:text-4xl font-black text-white tracking-tight mb-2",style:{textShadow:"2px 2px 0 #000"},children:a("publicShipmentForm.title")}),e.jsx("p",{className:"text-sm text-white/80 max-w-sm mx-auto font-medium",children:a("publicShipmentForm.subtitle")})]}),e.jsx("div",{className:"max-w-2xl mx-auto px-4 -mt-6 pb-14",children:e.jsx("div",{className:"bg-white rounded-2xl border-2 border-black overflow-hidden",style:se,children:e.jsxs("form",{onSubmit:_e(ze),className:"p-5 space-y-4",children:[e.jsx("input",{type:"hidden",...l("isInternational"),value:"true"}),e.jsx(U,{icon:e.jsx("div",{className:"h-7 w-7 rounded-lg border-2 border-black flex items-center justify-center bg-gray-100",children:e.jsx(Se,{className:"h-4 w-4 text-gray-600"})}),title:a("b2b.packages.createModal.senderTitle","Sender (Persona que envía)"),headerBg:"bg-gray-100 text-gray-800",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"sm:col-span-2",children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.hondurasDropoffName")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("hondurasDropoffContactName"),className:d,placeholder:"Ej: María García"}),i.hondurasDropoffContactName&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.hondurasDropoffContactName.message})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.hondurasDropoffCountry")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("select",{className:d,value:de.code,onChange:t=>{const s=te(t.target.value);c("hondurasDropoffContactCountryCode",t.target.value,{shouldValidate:!0,shouldDirty:!0}),s&&c("hondurasDropoffContactPhonePrefix",s.prefix,{shouldValidate:!0,shouldDirty:!0})},children:we.map(t=>e.jsxs("option",{value:t.code,children:[t.name," (",t.prefix,")"]},t.code))}),e.jsx("input",{type:"hidden",...l("hondurasDropoffContactCountryCode")}),e.jsx("input",{type:"hidden",...l("hondurasDropoffContactPhonePrefix")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.hondurasDropoffPhone")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("hondurasDropoffContactPhoneNumber"),className:d,placeholder:de.mask}),i.hondurasDropoffContactPhoneNumber&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.hondurasDropoffContactPhoneNumber.message})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.hondurasDropoffEmail")," ",e.jsx("span",{className:"text-gray-400 font-medium normal-case",children:"(opcional)"})]}),e.jsx("input",{type:"email",...l("hondurasDropoffContactEmail"),className:d,placeholder:"[email protected]"}),i.hondurasDropoffContactEmail&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.hondurasDropoffContactEmail.message})]})]})}),e.jsx(U,{icon:e.jsx("div",{className:"h-7 w-7 rounded-lg border-2 border-black flex items-center justify-center",style:{background:"#c7f0ff"},children:e.jsx(it,{className:"h-4 w-4 text-black"})}),title:a("b2b.packages.createModal.originSection","Dirección de origen"),headerBg:"text-black",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.originAddress","Dirección")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:t=>{Ue(t),q.current=t},...Ke,value:I,onChange:t=>{G(t.target.value),c("originAddress",t.target.value,{shouldValidate:!1}),t.target.value.length<3&&_(!1)},onFocus:()=>{I.length>=3&&ae.length>0&&_(!0)},onBlur:()=>setTimeout(()=>_(!1),200),className:d,placeholder:a("b2b.packages.createModal.originAddressPlaceholder","Ej: 123 Main St, Miami"),autoComplete:"off"}),i.originAddress&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.originAddress.message})]}),(oe||re)&&e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:m,children:a("b2b.packages.createModal.originCity","Ciudad")}),e.jsx("input",{value:oe,onChange:t=>Y(t.target.value),className:d,placeholder:"Ej: Miami"})]}),e.jsxs("div",{children:[e.jsx("label",{className:m,children:a("b2b.packages.createModal.originState","Estado")}),e.jsx("input",{value:re,onChange:t=>J(t.target.value),className:d,placeholder:"Ej: Florida"})]})]})]})}),e.jsx(U,{icon:e.jsx("div",{className:"h-7 w-7 rounded-lg border-2 border-black flex items-center justify-center",style:{background:F},children:e.jsx(Se,{className:"h-4 w-4 text-white"})}),title:a("b2b.packages.createModal.recipientSection","Destinatario"),headerBg:"text-black",children:e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.destinationContact")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("destinationContact"),className:d,placeholder:a("b2b.packages.createModal.destinationContactPlaceholder","Ej: Juan Pérez")}),i.destinationContact&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.destinationContact.message})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.phone")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("destinationContactNumber"),className:d,placeholder:"+1 305 555 1234"}),i.destinationContactNumber&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.destinationContactNumber.message})]}),e.jsxs("div",{className:"sm:col-span-2",children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.destinationAddress")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{ref:t=>{Ge(t),W.current=t},...He,value:$,onChange:t=>{H(t.target.value),c("destinationAddress",t.target.value,{shouldValidate:!1}),t.target.value.length<3&&V(!1)},onFocus:()=>{$.length>=3&&ie.length>0&&V(!0)},onBlur:()=>setTimeout(()=>V(!1),200),className:d,placeholder:"Street, suite/apartment, reference",autoComplete:"off"}),i.destinationAddress&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.destinationAddress.message})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.destinationCity")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("destinationCity"),className:d,placeholder:"Ej: Miami"}),i.destinationCity&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.destinationCity.message})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.destinationState")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("destinationState"),className:d,placeholder:"Ej: Florida"}),i.destinationState&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.destinationState.message})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:["ZIP c
1ode ",e.jsx("span",{className:"text-gray-400 font-medium normal-case",children:"(opcional)"})]}),e.jsx("input",{...l("destinationZipCode"),className:d,placeholder:"Ej: 33101"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.weight")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"number",step:"0.1",min:"0.1",...l("weight"),className:d,placeholder:"Ej: 3.5"}),i.weight&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.weight.message}),Q>0&&(()=>{const t=j.find(({lb:s})=>s===Math.round(Q));return t?e.jsx("p",{className:"mt-2 text-sm font-black",style:{color:F},children:a("publicShipmentForm.estimatedPrice",{price:t.hnl.toLocaleString()})}):Q>10?e.jsx("p",{className:"mt-2 text-sm font-semibold text-gray-500",children:a("publicShipmentForm.priceConsult")}):null})()]})]})}),e.jsx(U,{icon:e.jsx("div",{className:"h-7 w-7 rounded-lg border-2 border-black flex items-center justify-center",style:{background:A},children:e.jsx(ct,{className:"h-4 w-4 text-black"})}),title:a("b2b.packages.createModal.packageInfoSection"),headerBg:"text-black",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.packageName")," ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{...l("name"),className:d,placeholder:a("b2b.packages.createModal.packageNamePlaceholder","Ej: Ropa, Electrónicos...")}),i.name&&e.jsx("p",{className:"text-xs text-red-500 mt-1.5",children:i.name.message})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.description")," ",e.jsx("span",{className:"text-gray-400 font-medium normal-case",children:"(opcional)"})]}),e.jsx("textarea",{...l("description"),rows:3,className:`${d} resize-y min-h-[4.5rem]`,placeholder:a("b2b.packages.createModal.descriptionPlaceholder","Descripción del contenido")})]}),e.jsxs("div",{children:[e.jsxs("label",{className:m,children:[a("b2b.packages.createModal.instructions")," ",e.jsx("span",{className:"text-gray-400 font-medium normal-case",children:"(opcional)"})]}),e.jsx("textarea",{...l("originInstructions"),rows:3,className:`${d} resize-y min-h-[4.5rem]`,placeholder:a("b2b.packages.createModal.instructionsPlaceholder","Instrucciones para el recogedor")})]})]})}),e.jsx(U,{icon:e.jsx("div",{className:"h-7 w-7 rounded-lg border-2 border-black flex items-center justify-center bg-white",children:e.jsx(lt,{className:"h-4 w-4 text-black"})}),title:a("b2b.packages.createModal.coverage.title"),headerBg:"text-black",children:e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-xs text-gray-600 font-medium",children:a("b2b.packages.createModal.coverage.subtitle")}),e.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:[{fee:0,max:100,labelKey:"coverage.tierNone",techOnly:!1},{fee:5,max:200,labelKey:"coverage.tierBasic",techOnly:!1},{fee:10,max:500,labelKey:"coverage.tierStandard",techOnly:!1},{fee:15,max:800,labelKey:"coverage.tierTech",techOnly:!0}].map(({fee:t,max:s,labelKey:o,techOnly:p})=>{const f=O===t;return e.jsxs("button",{type:"button",onClick:()=>{c("coverageFee",t,{shouldValidate:!0}),c("isTechnologyPackage",t===15)},className:"relative flex flex-col items-start rounded-xl border-2 border-black px-4 py-3 text-left transition-all duration-150",style:f?{background:A,boxShadow:"3px 3px 0 0 #000"}:{background:"#fff"},children:[p&&e.jsx("span",{className:"absolute top-2 right-2 text-[10px] font-black border border-black rounded-full px-1.5 py-0.5",style:{background:F,color:"#fff"},children:a("b2b.packages.createModal.coverage.techBadge")}),e.jsx("span",{className:"text-xs font-black text-black",children:a(`b2b.packages.createModal.${o}`)}),e.jsx("span",{className:"text-[11px] mt-0.5 text-gray-600 font-medium",children:a("b2b.packages.createModal.coverage.maxLabel",{amount:s})}),e.jsx("span",{className:"text-sm font-black mt-2 text-black",children:t===0?a("b2b.packages.createModal.coverage.free"):`+$${t}`})]},t)})}),O>0&&e.jsx("p",{className:"text-xs text-black font-medium rounded-xl px-4 py-2.5 border-2 border-black",style:{background:A},dangerouslySetInnerHTML:{__html:a("b2b.packages.createModal.coverage.selectedInfo",{max:O===5?200:O===10?500:800,fee:O})}}),O===0&&e.jsx("p",{className:"text-xs text-gray-500 bg-gray-50 rounded-xl px-4 py-2.5 border-2 border-gray-200 font-medium",dangerouslySetInnerHTML:{__html:a("b2b.packages.createModal.coverage.noCoverageInfo")}})]})}),M&&e.jsx("div",{className:"border-2 border-red-400 rounded-xl px-4 py-3 bg-red-50",children:e.jsx("p",{className:"text-sm text-red-600 font-semibold",children:M})}),e.jsx("button",{type:"submit",disabled:le,className:"w-full py-4 rounded-full border-2 border-black text-black text-sm font-black disabled:opacity-50 transition-all duration-150 flex items-center justify-center gap-2",style:{background:A,boxShadow:"4px 4px 0 0 #000"},children:le?e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"h-4 w-4 animate-spin"}),a("common.loading")]}):e.jsxs(e.Fragment,{children:[a("publicShipmentForm.submit"),e.jsx(dt,{className:"h-4 w-4"})]})}),e.jsxs("p",{className:"text-center text-xs text-gray-500 pb-2 font-medium",children:[a("publicShipmentForm.alreadyHaveAccount")," ",e.jsx("a",{href:Ye.AUTH.LOGIN,className:"font-black underline",style:{color:F},children:a("publicShipmentForm.loginLink")})]})]})})}),me(Me,Le,Ae,ae,Be),me(Fe,Re,Oe,ie,Ze)]})}export{At as default};
2//# sourceMappingURL=PublicShipmentFormPage-DioFFc6e.js.map

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.