PageSourceSearch

https://miturnodigital.com.ar/chunk-G345BXSN.js

js miturnodigital.com.ar collected 2026-10-02 01:16:15 UTC 9,414 bytes, 1 lines download raw bytes

1import{a as D}from"./chunk-J6EMRKBB.js";import{a as W}from"./chunk-TIDN37B7.js";import{A as B,b as j,c as F,f as G,j as A}from"./chunk-4IEPOCVR.js";import{$b as V,Ab as k,Db as f,Ec as L,Fb as u,Pb as l,Qb as h,Qc as N,Sa as n,Ub as w,Vb as M,Wb as O,Yb as I,Z as _,ca as z,ib as b,kb as v,na as S,oa as y,pa as p,pb as m,qa as C,sb as T,t as E,tb as P,ub as o,vb as a,wb as x}from"./chunk-BCKZJXQL.js";import"./chunk-CWTPBX7D.js";var J=(e,s)=>s.codigo||s.nombre,K=(e,s)=>({"border-violet-500 bg-violet-50 dark:bg-violet-900/30":e,"border-gray-200 dark:border-gray-700":s});function Q(e,s){e&1&&(o(0,"div",7),l(1,"Cargando..."),a())}function R(e,s){e&1&&(o(0,"span",23),l(1," Personalizada "),a())}function U(e,s){if(e&1){let t=k();o(0,"button",25),f("click",function(i){S(t);let c=u().$implicit;return u(2).eliminarPersonalizada(c),y(i.preventDefault())}),p(),o(1,"svg",26),x(2,"path",27),a()()}}function X(e,s){if(e&1){let t=k();o(0,"label",18)(1,"div",19)(2,"input",20),O("ngModelChange",function(i){let c=S(t).$implicit;return M(c.seleccionada,i)||(c.seleccionada=i),y(i)}),a()(),o(3,"div",21)(4,"span",22),l(5),a(),b(6,R,2,0,"span",23),a(),b(7,U,3,0,"button",24),a()}if(e&2){let t=s.$implicit;v("ngClass",V(5,K,t.seleccionada,!t.seleccionada)),n(2),w("ngModel",t.seleccionada),n(3),h(t.nombre),n(),m(6,t.esPersonalizada?6:-1),n(),m(7,t.esPersonalizada?7:-1)}}function Y(e,s){if(e&1&&(o(0,"div",8),T(1,X,8,8,"label",18,J),a()),e&2){let t=u();n(),P(t.obrasSocialesItems)}}function Z(e,s){e&1&&(p(),o(0,"svg",28),x(1,"circle",29)(2,"path",30),a(),l(3," Guardando... "))}function $(e,s){e&1&&l(0," Guardar Obras Sociales ")}function ee(e,s){if(e&1&&(o(0,"div",16)(1,"div",31),p(),o(2,"svg",32),x(3,"path",33),a()(),C(),o(4,"div",34),l(5),a()()),e&2){let t=u();n(5),h(t.successMsg)}}function te(e,s){if(e&1&&(o(0,"div",17)(1,"div",31),p(),o(2,"svg",35),x(3,"path",36),a()(),C(),o(4,"div",37),l(5),a()()),e&2){let t=u();n(5),h(t.errorMsg)}}var ge=(()=>{class e{constructor(){this.svc=_(W),this.osSvc=_(D),this.obrasSocialesItems=[],this.nuevaObraSocialNombre="",this.loading=!0,this.saving=!1,this.successMsg="",this.errorMsg=""}ngOnInit(){this.cargarObrasSociales()}cargarObrasSociales(){this.loading=!0,E({globales:this.osSvc.getObrasSocialesGlobales(),perfil:this.svc.getObrasSociales()}).subscribe({next:({globales:t,perfil:r})=>{let i=t.filter(d=>d.activa!==!1),c=i.map(d=>({codigo:d.codigo,nombre:d.nombre,seleccionada:r.some(q=>q.obraSocialCodigo===d.codigo),esPersonalizada:!1})),g=new Set(i.map(d=>d.codigo)),H=r.filter(d=>!g.has(d.obraSocialCodigo)).map(d=>({codigo:d.obraSocialCodigo,nombre:d.obraSocialCodigo,seleccionada:!0,esPersonalizada:!0}));this.obrasSocialesItems=[...c,...H],this.loading=!1},error:()=>{this.errorMsg="No se pudieron cargar las obras sociales.",this.loading=!1}})}agregarPersonalizada(){let t=this.nuevaObraSocialNombre.trim();if(!t)return;this.obrasSocialesItems.some(i=>i.nombre.toLowerCase()===t.toLowerCase())||this.obrasSocialesItems.push({codigo:t,nombre:t,seleccionada:!0,esPersonalizada:!0}),this.nuevaObraSocialNombre=""}eliminarPersonalizada(t){this.obrasSocialesItems=this.obrasSocialesItems.filter(r=>r!==t)}guardar(){this.saving=!0,this.successMsg="",this.errorMsg="";let t=this.obrasSocialesItems.filter(r=>r.seleccionada).map(r=>({obraSocialCodigo:r.codigo}));this.svc.actualizarObrasSociales(t).subscribe({next:()=>{this.saving=!1,this.successMsg="\xA1Obras sociales actualizadas con \xE9xito!",setTimeout(()=>this.successMsg="",3e3)},error:r=>{this.saving=!1,this.errorMsg=r.error?.error??"Hubo un error al guardar las obras sociales."}})}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275cmp=z({type:e,selectors:[["app-obras-sociales"]],standalone:!0,features:[I],decls:28,vars:8,consts:[[1,"container","mx-auto","p-4","sm:p-6","lg:p-8"],[1,"flex","items-center","justify-between","mb-8"],[1,"text-3xl","font-extrabold","text-gray-900","dark:text-white","tracking-tight"],[1,"bg-white","dark:bg-gray-800","rounded-2xl","shadow-sm","border","border-gray-100","dark:border-gray-700","overflow-hidden","mb-8"],[1,"p-6","sm:p-8"],[1,"text-xl","font-bold","text-gray-900","dark:text-white","mb-2"],[1,"text-sm","text-gray-500","dark:text-gray-400","mb-6"],[1,"text-gray-500","text-sm"],[1,"grid","grid-cols-1","md:grid-cols-2","lg:grid-cols-3","gap-4"],[1,"text-lg","font-bold","text-gray-900","dark:text-white","mb-2"],[1,"text-sm","text-gray-500","dark:text-gray-400","mb-4"],[1,"flex","gap-3"],["type","text","placeholder","Ej. IOMA Mar del Plata",1,"flex-1","rounded-xl","border-gray-300","dark:border-gray-600","shadow-sm","focus:border-violet-500","focus:ring-violet-500","sm:text-sm","py-3","px-4","bg-gray-50","dark:bg-gray-700","dark:text-white","placeholder-gray-400","dark:placeholder-gray-500",3,"ngModelChange","keyup.enter","ngModel"],[1,"inline-flex","justify-center","items-center","py-3","px-6","border","border-transparent","shadow-sm","text-sm","font-medium","rounded-xl","text-white","dark:text-gray-900","bg-gray-900","dark:bg-white","hover:bg-gray-800","dark:hover:bg-gray-100","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-gray-900","disabled:opacity-50","disabled:cursor-not-allowed","transition-colors",3,"click","disabled"],[1,"flex","justify-end","pt-4","border-t","border-gray-200","dark:border-gray-700"],[1,"inline-flex","justify-center","items-center","py-3","px-8","border","border-transparent","shadow-sm","text-sm","font-medium","rounded-xl","text-white","bg-violet-600","hover:bg-violet-700","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-violet-500","disabled:opacity-50","transition-colors",3,"click","disabled"],[1,"mt-6","rounded-xl","bg-green-50","p-4","border","border-green-200","flex","items-center","shadow-sm"],[1,"mt-6","rounded-xl","bg-red-50","p-4","border","border-red-200","flex","items-center","shadow-sm"],[1,"relative","flex","items-start","p-4","rounded-xl","border-2","cursor-pointer","hover:bg-gray-50","dark:hover:bg-gray-700/50","transition-colors",3,"ngClass"],[1,"flex","items-center","h-5"],["type","checkbox",1,"h-5","w-5","text-violet-600","focus:ring-violet-500","border-gray-300","dark:border-gray-600","dark:bg-gray-700","rounded",3,"ngModelChange","ngModel"],[1,"ml-3","flex-1"],[1,"block","text-sm","font-medium","text-gray-900","dark:text-white"],[1,"inline-flex","items-center","mt-1","px-2","py-0.5","rounded","text-xs","font-medium","bg-gray-100","dark:bg-gray-700","text-gray-800","dark:text-gray-300"],["title","Eliminar",1,"text-gray-400","dark:text-gray-500","hover:text-red-600","dark:hover:text-red-400","focus:outline-none"],["t
1itle","Eliminar",1,"text-gray-400","dark:text-gray-500","hover:text-red-600","dark:hover:text-red-400","focus:outline-none",3,"click"],["fill","none","viewBox","0 0 24 24","stroke","currentColor",1,"h-5","w-5"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M6 18L18 6M6 6l12 12"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24",1,"animate-spin","-ml-1","mr-2","h-4","w-4","text-white"],["cx","12","cy","12","r","10","stroke","currentColor","stroke-width","4",1,"opacity-25"],["fill","currentColor","d","M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",1,"opacity-75"],[1,"flex-shrink-0"],["viewBox","0 0 20 20","fill","currentColor",1,"h-5","w-5","text-green-400"],["fill-rule","evenodd","d","M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule","evenodd"],[1,"ml-3","text-sm","font-medium","text-green-800"],["viewBox","0 0 20 20","fill","currentColor",1,"h-5","w-5","text-red-400"],["fill-rule","evenodd","d","M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule","evenodd"],[1,"ml-3","text-sm","font-medium","text-red-800"]],template:function(r,i){r&1&&(o(0,"div",0)(1,"div",1)(2,"h1",2),l(3,"Obras Sociales y Prepagas"),a()(),o(4,"div",3)(5,"div",4)(6,"h2",5),l(7,"Selecciona con las que trabajas"),a(),o(8,"p",6),l(9,"Activa las obras sociales que aceptas en tu servicio. Si no encuentras una, puedes agregarla manualmente abajo."),a(),b(10,Q,2,0,"div",7)(11,Y,3,0,"div",8),a()(),o(12,"div",3)(13,"div",4)(14,"h2",9),l(15,"Agregar Obra Social Personalizada"),a(),o(16,"p",10),l(17,"Escribe el nombre de una obra social que no est\xE9 en la lista global."),a(),o(18,"div",11)(19,"input",12),O("ngModelChange",function(g){return M(i.nuevaObraSocialNombre,g)||(i.nuevaObraSocialNombre=g),g}),f("keyup.enter",function(){return i.agregarPersonalizada()}),a(),o(20,"button",13),f("click",function(){return i.agregarPersonalizada()}
1),l(21," Agregar "),a()()()(),o(22,"div",14)(23,"button",15),f("click",function(){return i.guardar()}),b(24,Z,4,0)(25,$,1,0),a()(),b(26,ee,6,1,"div",16)(27,te,6,1,"div",17),a()),r&2&&(n(10),m(10,i.loading?10:-1),n(),m(11,!i.loading&&i.obrasSocialesItems.length>0?11:-1),n(8),w("ngModel",i.nuevaObraSocialNombre),n(),v("disabled",!i.nuevaObraSocialNombre.trim()),n(3),v("disabled",i.saving),n(),m(24,i.saving?24:25),n(2),m(26,i.successMsg?26:-1),n(),m(27,i.errorMsg?27:-1))},dependencies:[N,L,B,F,j,G,A],encapsulation:2})}}return e})();export{ge as ObrasSocialesComponent};

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.