1import{u as re}from"./CFJAIz1O.js";import{u as ne,a as ie,b as se,c as ce}from"./NUZVr9ds.js";import{C as O,U as j,b as G}from"./DhtGWptd.js";import{d as $,g as le,i as P,V,Q as de,e as ue,I as fe,K as L,ae as Ae,M as q,u as pe,L as be,z as J,f as me}from"./DFp-2ogX.js";import{u as ge}from"./CkKvUDht.js";import{u as Oe}from"./CA7EW43j.js";import{u as Ee}from"./CEmLzKc_.js";var v=(u=>(u.PUBLICADA="PUBLICADA",u.DESACTIVADA="DESACTIVADA",u.EXPIRADA="EXPIRADA",u.ELIMINADA="ELIMINADA",u))(v||{}),b=(u=>(u.NO_EXPIRADA="NO_EXPIRADA",u.EXPIRADA="EXPIRADA",u.EXPIRADA_HACE_UN_ANIO="EXPIRADA_HACE_UN_ANIO",u))(b||{});const he=()=>{const u=$(),E=le(),{diasDiferencia:h,fechaSinHoraAFormatoDate:I}=P(),w=async l=>{l=C(l);const{data:A}=await de("/api/searchjob",{params:JSON.parse(JSON.stringify(l))},"$KuDyReaj6y");return A},C=l=>{var m,D,t;(m=u.obtenerLogin)!=null&&m.id&&(l.idPersona=(D=u.obtenerLogin)==null?void 0:D.id);const A=V("geolocalizacion");if(A.value&&l.ubicacion===void 0&&l.region===void 0&&l.comuna===void 0)l.relevanciaGeolocalizacion=A.value;else if((t=u.obtenerLogin)!=null&&t.id){const n=V("region-candidato");n.value?l.relevanciaIdRegion=n.value:E.obtenerIdRegion&&(l.relevanciaIdRegion=E.obtenerIdRegion)}return l.relevanciaIdRegion=="null"&&(l.relevanciaIdRegion=void 0),l};return{buscarOfertasBETA:w,otrosParametrosBETA:C,obtenerEstadoFechaOfertaBETA:l=>{let A=0,m=b.EXPIRADA;return l&&(A=h(I(l),new Date)),A>=0?m=b.NO_EXPIRADA:A<=-365&&(m=b.EXPIRADA_HACE_UN_ANIO),m}}},Ie=()=>{const{diasDiferencia:u,fechaSinHoraAFormatoDate:E}=P(),{otrosParametrosBETA:h}=he();return{buscarOfertas:async t=>(t=h(t),await $fetch("/api/searchjob",{params:JSON.parse(JSON.stringify(t))})),obtenerEstadoFechaOferta:t=>{let n=0,o=b.EXPIRADA;return t&&(n=u(E(t),new Date)),n>=0?o=b.NO_EXPIRADA:n<=-365&&(o=b.EXPIRADA_HACE_UN_ANIO),o},datosAgrupadosExperienciaMinima:t=>{let n="";const o=[];return t.aniosExperiencia>0&&t.nombreOperadorExperiencia!=null?n="Experiencia "+t.nombreOperadorExperiencia.toLowerCase()+" "+t.aniosExperiencia+" años":n="Sin experiencia",o.push({id:"",tipo:"EXPERIENCIA",nombre:n}),o},datosAgrupadosEstudiosMinimos:t=>{const n=[];return t&&t!==""&&n.push({id:"",tipo:"ESTUDIOS_MINIMOS",nombre:"Estudios mÃnimos: "+t}),n},datosAgrupadosSituacionAcademica:t=>{const n=[];return t&&t!==""&&n.push({id:"",tipo:"SITUACION_ACADEMICA",nombre:t}),n},datosAgrupadosCarreras:t=>{const n=[];return(t==null?void 0:t.length)>0&&t.forEach(o=>{n.push({id:"",tipo:"CARRERA",nombre:o.nombreCarrera})}),n},datosAgrupadosHabilidades:t=>{const n=[];let o="";return(t==null?void 0:t.length)>0&&t.forEach(g=>{o="",g.nombreNivel!==""&&g.nombreNivel&&(o=" (nivel "+g.nombreNivel+")"),n.push({id:"",tipo:"HABILIDAD",nombre:g.nombreHabilidad+o})}),n},datosAgrupadosIdiomas:t=>{let n="";const o=[];return(t==null?void 0:t.length)>0&&t.forEach(g=>{n="",g.nombreHablado!==""&&g.nombreHablado&&(n=" (nivel "+g.nombreHablado+")"),o.push({id:"",tipo:"IDIOMA",nombre:g.nombreIdioma+n})}),o}}},Pe=()=>{const{obtenerOfertaGuardada:u,controladorGuardarOferta:E}=ne(),{obtenerPostulacion:h,controladorPostulacion:I,cargarPreguntas:w}=ie(),{obtenerCandidato:C,obtenerCandidatoDatosMinimos:S}=ue(),{obtenerEstadoFechaOferta:l}=Ie(),{textoAUrl:A,esMovil:m,getItemExp:D,acortadorUrl:t}=P(),{isMobile:n}=Oe(),o=re(),g=se(),M=ce(),T=$(),Q=ge(),k=Ee(),p=fe(),F=async a=>{let e=null,r;if(a>0)if(r=X(a),o.componenteActivo=O.DETALLE_ESQUELETO,r)e=r;else{try{e=await L("/api/ofertas/"+a,{headers:{referer:k.href}})}catch{}e&&o.cargarOferta(e)}return H(),N(e,!0),K(),e},H=()=>{var r;const a=o.obtenerOfertaStore;let e=[];p.name==="ofertas-guardadas"||p.name==="ofertas-guardadas-trabajo-oferta"?e.ofertas=g.obtenerListadoOfertasGuardadas.ofertasGuardadas:e=o.obtenerResultadoBusqueda,(r=e.ofertas)==null||r.forEach((c,d)=>{c.idOferta===a.idOferta?e.ofertas[d].activo=!0:e.ofertas[d].activo=!1}),o.cargarResultadoBusqueda(e)},Y=async a=>{if(n){const e=document.getElementById("listadoOfertas");e&&sessionStorage.setItem("posicionScroll",String(e.scrollTop)),o.limpiarOferta(),o.actualizarComponenteActivo(O.DETALLE_ESQUELETO);const r=y(a,!1);await be({path:r}),o.actualizarComponenteActivo(O.DETALLE_OFERTA)}else y(a,!0),F(a.idOferta).then(e=>{l(e==null?void 0:e.fechaExpiracion)!==b.EXPIRADA_HACE_UN_ANIO&&(e==null?void 0:e.estadoOferta)!==v.ELIMINADA&&U()})},N=async(a,e)=>{const r=o.obtenerOfertaStore,c=l(r.fechaExpiracion);if(T.estaLogueado&&c!==b.EXPIRADA&&r.idOferta>0){const d=T.obtenerLogin;M.$reset();const i={idOferta:r.idOferta},f=await C(d.id);h().then(()=>{_(a,e),localStorage.removeItem("callbackCV")}
1).catch(()=>{x("postular"),w(),u(i).then(()=>{_(a,e),localStorage.removeItem("callbackCV")}).catch(()=>{_(a,e),x("guardarOferta")})}),M.actualizarDocsRequeridos(r.documentosRequeridos),Q.guardarCurriculum(f),S(f)}else _(a,e)},K=()=>{if(typeof document<"u"){const a=document.getElementById("detalleOferta");a!==null&&a.scrollTo({top:0,left:0,behavior:"smooth"})}},y=(a,e)=>{const r=pe(),c="/trabajo/",d=r.currentRoute.value.path;let i="",f="";typeof a.nombreCargo<"u"?f=A(a.nombreCargo):f=A(a.tituloOferta),i=a.idOferta+"-"+f;let s="";switch(p.name){case"trabajo-landing":s=d+c+i;break;case"trabajo-landing-trabajo-oferta":s="/trabajo-"+p.params.landing+c+i;break;case"empleo-landing":s=d+c+i;break;case"empleo-landing-trabajo-oferta":s="/empleo-"+p.params.landing+c+i;break;case"trabajo-empleo-chile":s=c+i;break;case"trabajo-oferta":s="/trabajo/"+i;break;case"trabajo-empleo-cargo":s=d+c+a.idOferta+"-"+f;break;case"trabajo-empleo-cargo-trabajo-oferta":s=a.idOferta+"-"+f;break;case"trabajos-empresa":s=d+c+i;break;case"trabajos-empresa-trabajo-oferta":s=i;break;case"recomendadas":s=d+c+i;break;case"recomendadas-trabajo-oferta":s=i;break;case"ofertas-guardadas":s=d+c+i;break;case"ofertas-guardadas-trabajo-oferta":s="/ofertas-guardadas/"+c+i;break;case"canal-idCanal":s=d+c+i;break;case"canal-canalPath-trabajo-oferta":s="/canal/"+p.params.canalPath+c+i;break}return n&&(s="/trabajo/"+i),typeof s=="string"&&(s=s.replace(/\/+/gi,"/")),e&&history.pushState({},null,s),s},U=()=>{var z;const a=J(),e=o.obtenerOfertaStore,{textoSinTagsHtml:r}=P(),c=a.public.contextNeo,d="https://staticcdn.trabajando.cl/assets/image-og/oferta/"+e.idOferta+".jpg",i=e.idOferta+"-"+A(e.nombreCargo);let f="";p.name==="trabajo-landing"||p.name==="trabajo-landing-trabajo-oferta"?f=c+"/trabajo-"+p.params.landing:p.name==="empleo-landing"||p.name==="empleo-landing-trabajo-oferta"?f=c+"/empleo-"+p.params.landing:typeof window>"u"?f="https://www.trabajando.cl/trabajo/"+i:f=window.location.origin+"/trabajo/"+i;const s=r((z=e.descripcionOferta)==null?void 0:z.slice(0,135)),B=e.nombreCargo+" - Oferta de Trabajo en www.trabajando.cl";q({title:e.nombreCargo+" - Trabajando.com",meta:[{name:"description",content:s},{itemprop:"image",content:d},{name:"twitter:title",content:B},{name:"twitter:description",content:s},{name:"twitter:image",content:d},{name:"twitter:card",content:"summary_large_image"},{property:"og:title",content:B},{property:"og:description",content:s},{property:"og:image",content:d},{property:"og:image:secure_url",content:d},{property:"og:image:type",content:"image/jpeg"},{property:"og:url",content:f}],link:[{rel:"canonical",href:f}]})},R=()=>{q({meta:[{name:"robots",content:"noindex"}]})},X=a=>{const e=o.obtenerOfertaStore,r=Number(a);return e.idOferta===r?e:!1},W=a=>{const e=a.split(/\D+/);return new Date(e[2],e[1]-1,e[0])},x=a=>{const e=D("callbackCV"),{$bootstrap:r}=me(),c=o.obtenerOfertaStore;T.estaLogueado&&(a==="postular"&&e&&e.postular&&(e.saltarModalPostularConArchivo&&c.tipoCurriculumAceptado===G.ARCHIVO?I(G.NORMAL_ARCHIVO):I(c.tipoCurriculumAceptado)),a==="guardarOferta"&&e&&e.guardarOferta&&E(),localStorage.removeItem("callbackCV"))},Z=(a,e,r)=>{const c=a+"-"+A(e),d=window.location.origin+"/trabajo/"+c,i=J();switch(r){case"whatsapp":t(d+j.whatsappUTM).then(f=>{window.open(i.public.whatsappShare+e+" "+f,"_blank")});break;case"linkedin":window.open(i.public.linkedinShare+d+encodeURIComponent(j.linkedinUTM),"sharer","toolbar=0,status=0,width=580,height=500");break;case"facebook":window.open(i.public.facebookShare+d+encodeURIComponent(j.facebookUTM),"sharer","toolbar=0,status=0,width=580,height=500");break;case"twitter":window.open(i.public.twitterShare+d+encodeURIComponent(j.twitterUTM),"sharer","toolbar=0,status=0,width=580,height=500");break}},_=(a,e)=>{e&&(a?l(a.fechaExpiracion)===b.EXPIRADA_HACE_UN_ANIO||a.estadoOferta===v.ELIMINADA?o.actualizarComponenteActivo(O.DETALLE_EXPIRADO):o.actualizarComponenteActivo(O.DETALLE_OFERTA):(o.componenteActivo=O.DETALLE_EXPIRADO,o.limpiarOferta()))},ee=a=>{if(Ae(),a!=null&&a.value){const e=l(a.value.fechaExpiracion);o.cargarOferta(a.value),e===b.EXPIRADA_HACE_UN_ANIO||a.value.estadoOferta===v.ELIMINADA?(R(),m(
1)&&o.actualizarComponenteActivo(O.DETALLE_EXPIRADO)):e===b.EXPIRADA||a.value.estadoOferta===v.DESACTIVADA?(R(),m()&&o.actualizarComponenteActivo(O.DETALLE_OFERTA)):(U(),m()&&N(a.value,!0))}else o.actualizarOfertasRelacionadas({}),o.limpiarOferta(),R(),o.actualizarComponenteActivo(O.DETALLE_EXPIRADO)},ae=async a=>{let e=null;try{e=await L("/api/ofertas/"+a,{headers:{referer:k.href}})}catch{}return e},te=async a=>{let e=null;try{e=await L("/api/ofertas/info-modal?oferta="+a,{headers:{referer:k.href}})}catch{}return e},oe=async(a,e)=>await L("/api/ofertas/documento-adjunto",{method:"POST",body:JSON.stringify({idOferta:e,ruta:a})});return{obtenerOferta:F,definirOfertaActiva:H,cargarOfertaSeleccionada:Y,generarUrlOferta:y,updateMetaOferta:U,cabeceraNoIndexar:R,obtenerInformacionCandidato:N,obtenerEstadoFechaOferta:l,getOfertaStore:X,fechaSinHoraAFormatoDate:W,socialShare:Z,logicaOfertaServerSide:ee,obtenerDatosOferta:ae,obtenerDatosOfertaModal:te,abrirArchivoConFirmaOArchivoSinFirma:async(a,e)=>{if(a.includes("showFile.php"))window.open(a,"_blank");else{const r=await oe(a,e);r&&(r!=null&&r.urlArchivo)&&(r==null?void 0:r.urlArchivo)!==""&&window.open(r.urlArchivo,"_blank")}}}};export{b as E,Ie as a,v as b,he as c,Pe as u};
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.