PageSourceSearch

https://softcollie.ai/chunk-XM7ZSZDI.js

js softcollie.ai collected 2026-10-05 15:03:02 UTC 12,493 bytes, 1 lines download raw bytes

1import{f as R}from"./chunk-UYODVI7O.js";import{a as X}from"./chunk-ZACTTJ4S.js";import{b as Z,c as K,e as W}from"./chunk-EKU7OH35.js";import{b as D,d as $}from"./chunk-V2PPMFND.js";import{$a as j,Da as E,Db as B,Eb as A,Fb as P,Ib as f,Jc as V,Lb as H,Mb as z,Nb as i,Ob as o,Pb as c,Tb as U,Vb as y,Wb as l,ba as T,db as a,fc as s,gc as _,hc as M,ic as G,kd as O,ma as v,na as h,oa as g,pa as b,pb as I,uc as m,vb as w,vc as u}from"./chunk-5SAOKRHL.js";import{a as F,g as L}from"./chunk-NZN5XTIE.js";var q=(t,d)=>d.file.name+t;function J(t,d){t&1&&(i(0,"div",8)(1,"div",11),g(),i(2,"svg",12),c(3,"path",13),o()(),b(),i(4,"h2",14),s(5),m(6,"translate"),o(),i(7,"p",15),s(8),m(9,"translate"),o()()),t&2&&(a(5),_(u(6,2,"evidence.expired_title")),a(3),_(u(9,4,"evidence.expired_desc")))}function N(t,d){t&1&&(i(0,"div",9)(1,"div",16),g(),i(2,"svg",12),c(3,"path",17),o()(),b(),i(4,"h2",18),s(5),m(6,"translate"),o(),i(7,"p",15),s(8),m(9,"translate"),o()()),t&2&&(a(5),_(u(6,2,"evidence.success_title")),a(3),_(u(9,4,"evidence.success_desc")))}function Q(t,d){if(t&1&&c(0,"img",36),t&2){let e=l().$implicit;B("src",e.preview,j)}}function Y(t,d){t&1&&(i(0,"div",37),g(),i(1,"svg",45),c(2,"path",46),o()())}function ee(t,d){if(t&1&&(i(0,"div",40),c(1,"div",47),o()),t&2){let e=l().$implicit;a(),A("width",e.progress,"%")}}function te(t,d){if(t&1&&(i(0,"p",41),s(1),o()),t&2){let e=l().$implicit;a(),_(e.errorMsg)}}function ie(t,d){t&1&&(g(),i(0,"svg",43),c(1,"path",17),o())}function ne(t,d){if(t&1){let e=U();i(0,"button",48),y("click",function(){v(e);let r=l().$index,p=l(3);return h(p.removeFile(r))}),g(),i(1,"svg",49),c(2,"path",50),o()()}}function oe(t,d){if(t&1&&(i(0,"div",34),w(1,Q,1,1,"img",36)(2,Y,3,0,"div",37),i(3,"div",38)(4,"p",39),s(5),o(),i(6,"p",32),s(7),o(),w(8,ee,2,2,"div",40)(9,te,2,1,"p",41),o(),i(10,"div",42),w(11,ie,2,0,":svg:svg",43)(12,ne,3,0,"button",44),o()()),t&2){let e=d.$implicit,n=l(3);a(),f(e.preview?1:2),a(4),_(e.file.name),a(2),_(n.formatBytes(e.file.size)),a(),f(e.status==="uploading"?8:-1),a(),f(e.status==="error"?9:-1),a(2),f(e.status==="done"?11:e.status==="pending"?12:-1)}}function re(t,d){t&1&&(g(),i(0,"svg",52),c(1,"circle",53)(2,"path",54),o())}function ae(t,d){if(t&1){let e=U();i(0,"button",51),y("click",function(){v(e);let r=l(3);return h(r.uploadAll())}),w(1,re,3,0,":svg:svg",52),s(2),m(3,"translate"),o()}if(t&2){let e=l(3);B("disabled",e.isUploading()),a(),f(e.isUploading()?1:-1),a(),G(" ",u(3,4,"evidence.upload_all")," (",e.pendingCount(),") ")}}function le(t,d){if(t&1&&(i(0,"div",33),H(1,oe,13,6,"div",34,q),o(),w(3,ae,4,6,"button",35)),t&2){let e=l(2);a(),z(e.files()),a(2),f(e.hasPending()?3:-1)}}function se(t,d){if(t&1){let e=U();i(0,"div",19),y("dragover",function(r){v(e);let p=l();return h(p.onDragOver(r))})("dragleave",function(r){v(e);let p=l();return h(p.onDragLeave(r))})("drop",function(r){v(e);let p=l();return h(p.onDrop(r))}
1),i(1,"div",20),g(),i(2,"svg",21),c(3,"path",22),o(),b(),i(4,"p",23),s(5),m(6,"translate"),o(),i(7,"div",24)(8,"label",25),g(),i(9,"svg",26),c(10,"path",5),o(),s(11),m(12,"translate"),b(),i(13,"input",27),y("change",function(r){v(e);let p=l();return h(p.onFilesSelected(r))}),o()(),i(14,"label",28),g(),i(15,"svg",26),c(16,"path",29)(17,"path",30),o(),s(18),m(19,"translate"),b(),i(20,"input",31),y("change",function(r){v(e);let p=l();return h(p.onFilesSelected(r))}),o()()(),i(21,"p",32),s(22),m(23,"translate"),o()()(),w(24,le,4,1)}if(t&2){let e=l();P("border-brand-400",e.isDragging())("bg-brand-50",e.isDragging())("border-gray-300",!e.isDragging()),a(5),_(u(6,11,"evidence.drop_hint")),a(6),M(" ",u(12,13,"evidence.select_files")," "),a(7),M(" ",u(19,15,"evidence.take_photo")," "),a(4),_(u(23,17,"evidence.max_size")),a(2),f(e.files().length>0?24:-1)}}var he=(()=>{class t{constructor(){this.route=T(R),this.http=T($),this.translate=T(Z),this.token=E(""),this.tokenExpired=E(!1),this.isDragging=E(!1),this.files=E([]),this.isUploading=E(!1),this.hasPending=V(()=>this.files().some(e=>e.status==="pending")),this.pendingCount=V(()=>this.files().filter(e=>e.status==="pending").length),this.allDone=V(()=>this.files().length>0&&this.files().every(e=>e.status==="done")),this.MAX_TOTAL_SIZE=100*1024*1024}ngOnInit(){let e=this.route.snapshot.paramMap.get("token")??"";this.token.set(e);let n=navigator.language?.substring(0,2)||"es";this.translate.use(["de","en","es","fr","ko","pl"].includes(n)?n:"es")}onDragOver(e){e.preventDefault(),e.stopPropagation(),this.isDragging.set(!0)}onDragLeave(e){e.preventDefault(),e.stopPropagation(),this.isDragging.set(!1)}onDrop(e){e.preventDefault(),e.stopPropagation(),this.isDragging.set(!1);let n=e.dataTransfer?.files;n&&this.addFiles(Array.from(n))}onFilesSelected(e){let n=e.target;n.files&&(this.addFiles(Array.from(n.files)),n.value="")}removeFile(e){let n=[...this.files()],r=n.splice(e,1)[0];r.preview&&URL.revokeObjectURL(r.preview),this.files.set(n)}uploadAll(){return L(this,null,function*(){this.isUploading.set(!0);let e=this.files();for(let n=0;n<e.length;n++)e[n].status==="pending"&&(yield this.uploadSingle(n));this.isUploading.set(!1)})}formatBytes(e){return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":(e/1048576).toFixed(1)+" MB"}addFiles(e){let n=this.files().reduce((x,k)=>x+k.file.size,0),r=e.reduce((x,k)=>x+k.size,0);if(n+r>this.MAX_TOTAL_SIZE)return;let p=e.map(x=>({file:x,preview:x.type.startsWith("image/")?URL.createObjectURL(x):null,progress:0,status:"pending"}));this.files.set([...this.files(),...p])}uploadSingle(e){return new Promise(n=>{let p=this.files()[e];this.updateFile(e,{status:"uploading",progress:0});let x=new FormData;x.append("file",p.file);let k=`${X.apiUrl}/api/public/ticket-evidence/${this.token()}/upload`;this.http.post(k,x,{reportProgress:!0,observe:"events"}).subscribe({next:C=>{if(C.type===D.UploadProgress&&C.total){let S=Math.round(100*C.loaded/C.total);this.updateFile(e,{progress:S})}else C.type===D.Response&&(this.updateFile(e,{status:"done",progress:100}),n())},error:C=>{let S=C?.status;(S===401||S===403)&&this.tokenExpired.set(!0),this.updateFile(e,{status:"error",errorMsg:S===401||S===403?this.translate.instant("evidence.error_expired"):this.translate.instant("evidence.error_upload")}),n()}})})}updateFile(e,n){let r=[...this.files()];r[e]=F(F({},r[e]),n),this.files.set(r)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=I({type:t,selectors:[["app-evidence-upload"]],decls:18,vars:10,consts:[[1,"sc-evidence-upload","min-h-screen","bg-gray-50","flex","flex-col","items-center","justify-start","p-4","pt-8","sm:pt-16"],[1,"w-full","max-w-lg"],[1,"text-center","mb-6"],[1,"w-16","h-16","mx-auto","rounded-full","bg-brand-100","text-brand-600","flex","items-center","justify-center","mb-4"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","2",1,"w-8","h-8"],["stroke-linecap","round","stroke-linejoin","round","d","M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"],[1,"text-xl","font-bold","text-gray-900"],[1,"text-sm","text-gray-500","mt-1"],[1,"bg-white","rounded-xl","border","border-red-200","p-8","text-center"],[1,"bg-white","rounded-xl","border","border-green-200","p-8","text-center"],[1,"text-xs","text-gray-400","mt-8","text-center"],[1,"w-12","h-12","mx-auto","rounded-full","bg-red-100","text-red-500","flex","items-center","justify-center","mb-3"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","2",1,"w-6","h-6"],["stroke-linecap","round","stroke-linejoin","round","d","M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"],[1,"text-lg","font-semibold","text-red-700"],[1,"text-sm","text-gray-500","mt-2"],[1,"w-12","h-12","mx-auto","rounded-full","bg-green-100","text-green-600","flex","items-center","justify-center","mb-3"],["stroke-linecap","round","stroke-linejoin","round","d","M5 13l4 4L19 7"],[1,"text-lg","font-semibold","text-green-700"],[1,"bg-white","rounded-xl","border-2","border-dashed","transition-colors","p-6",3,"dragover","dragleave","drop"],[1,"flex","flex-col","items-center","gap-3","py-4"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","1.5",1,"w-10","h-10","text-gray-400"],["stroke-linecap","round","stroke-linejoin","round","d","M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"],[1,"text-sm","text-gray-600","text-center"],[1,"flex","gap-2"],[1,"curs
1or-pointer","inline-flex","items-center","gap-2","px-4","py-2","rounded-lg","bg-brand-600","text-white","text-sm","font-medium","hover:bg-brand-700","transition-colors"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","2",1,"w-4","h-4"],["type","file","multiple","","accept","image/*,video/*,.pdf",1,"hidden",3,"change"],[1,"cursor-pointer","inline-flex","items-center","gap-2","px-4","py-2","rounded-lg","bg-white","border","border-gray-300","text-gray-700","text-sm","font-medium","hover:bg-gray-50","transition-colors"],["stroke-linecap","round","stroke-linejoin","round","d","M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z"],["stroke-linecap","round","stroke-linejoin","round","d","M15 13a3 3 0 11-6 0 3 3 0 016 0z"],["type","file","accept","image/*","capture","environment",1,"hidden",3,"change"],[1,"text-xs","text-gray-400"],[1,"mt-4","flex","flex-col","gap-2"],[1,"bg-white","rounded-lg","border","border-gray-200","p-3","flex","items-center","gap-3"],[1,"mt-4","w-full","py-3","rounded-lg","bg-brand-600","text-white","font-medium","text-sm","hover:bg-brand-700","transition-colors","disabled:opacity-50","disabled:cursor-not-allowed","flex","items-center","justify-center","gap-2",3,"disabled"],[1,"w-12","h-12","rounded","object-cover","flex-shrink-0",3,"src"],[1,"w-12","h-12","rounded","bg-gray-100","flex","items-center","justify-center","flex-shrink-0"],[1,"flex-1","min-w-0"],[1,"text-sm","text-gray-700","truncate"],[1,"w-full","h-1.5","bg-gray-200","rounded-full","mt-1","overflow-hidden"],[1,"text-xs","text-red-500","mt-0.5"],[1,"flex-shrink-0"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","2",1,"w-5","h-5","text-green-500"],[1,"text-gray-400","hover:text-red-500"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","2",1,"w-6","h-6","text-gray-400"],["stroke-linecap","round","stroke-linejoin","round","d","M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"],[1,"h-full","bg-brand-500","rounded-full","transition-all","duration-300"],[1,"text-gray-400","hover:text-red-500",3,"click"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke","currentColor","stroke-width","2",1,"w-5","h-5"],["stroke-linecap","round","stroke-linejoin","round","d","M6 18L18 6M6 6l12 12"],[1,"mt-4","w-full","py-3","rounded-lg","bg-brand-600","text-white","font-medium","text-sm","hover:bg-brand-700","transition-colors","disabled:opacity-50","disabled:cursor-not-allowed","flex","items-center","justify-center","gap-2",3,"click","disabled"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24",1,"animate-spin","w-4","h-4"],["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 12h4z",1,"opacity-75"]],template:function(n,r){n&1&&(i(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),g(),i(4,"svg",4),c(5,"path",5),o()(),b(),i(6,"h1",6),s(7),m(8,"translate"),o(),i(9,"p",7),s(10),m(11,"translate"),o()(),w(12,J,10,6,"div",8)(13,N,10,6,"div",9)(14,se,25,19),o(),i(15,"p",10),s(16),m(17,"translate"),o()()),n&2&&(a(7),_(u(8,4,"evidence.title")),a(3),_(u(11,6,"evidence.subtitle")),a(2),f(r.tokenExpired()?12:r.allDone()?13:14),a(4),M(" ",u(17,8,"evidence.footer")," "))},dependencies:[O,W,K],styles:["[_nghost-%COMP%]{display:block}.sc-evidence-upload[_ngcontent-%COMP%]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}"],changeDetection:0})}}return t})();export{he as EvidenceUploadComponent};

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.