1import{a as V}from"./chunk-JLO5TD5N.js";import{d as h}from"./chunk-JBQ3SQYQ.js";import{B as u,f as E,g as O}from"./chunk-IELZJEER.js";import{Gc as R,Lc as m,Pb as P,Sb as a,Sc as d,f as L,ja as s,n as M,qc as p}from"./chunk-G7JQUX5M.js";import{D as k,F as _,Fc as j,H as F,J as D,Kc as x,Mc as g,Pa as A,Qa as I,Rb as r,U as y,Xb as w,_ as f,bc as U,ha as C,ua as v,vc as l,wc as N,xa as T,xc as b}from"./chunk-GRSQHQHU.js";F();function J(S,i){if(S&1){let e=j();N(0,"app-document-view",1),x("redirect",function(){A(e);let o=g();return I(o.onRedirect())}),b()}if(S&2){let e=g();l("task",e.task)("document",e.document)}}var n,G=(n=class{constructor(i,e,t,o,c,q,B){this.redirectService=i,this.translateService=e,this.appointmentApiService=t,this.documentApiService=o,this.configService=c,this.router=q,this.apiLinkPipe=B}ngOnInit(){this.redirectService.activeTask().pipe(f(({actions:i})=>i&&i[0]?.type===R.SIGN_DOCUMENT),C(0),f(()=>this.router.url.includes("signature-data")),O(this)).subscribe(i=>{this.init(i)})}init(i){this.document=void 0,this.task=i,this.configService.setTitle(this.task?.todo?.category?.title??""),this.task?.todo?.source&&(this.task.todo.source.appointment_id?this.appointmentApiService.get(this.task.todo.source.appointment_id).subscribe(e=>{this.task.clinicUuid=e.clinicUuid,this.initDocument()}):this.task.todo.source.clinic_id&&(this.task.clinicUuid=this.task.todo.source.clinic_id,this.initDocument()))}initDocument(){this.documentApiService.getClinicDocumentTypes(this.task.clinicUuid,[P.SIGN_DOCUMENT]).pipe(T(i=>{this.task.documentType=i.find(e=>e.id===Number(this.task.todo.actions[0].value[0]))?.name}),v(()=>this.translateService.getCurrentLanguageProperties()),v(i=>{let e=i?.id,t=this.task.clinicUuid??"",o=this.task.documentType??"",c=this.documentApiService.getDocumentApiLink(t,o,e);return y([D(c),this.apiLinkPipe.transform(c),this.documentApiService.getDocument(t,o,e)])})).subscribe(([i,e,{fileName:t}])=>this.document={link:i,src:e,fileName:t})}onRedirect(){this.redirectService.navigate([this.redirectService.getBaseUrl()+"/signature-create"],{queryParams:{documentName:this.document?.fileName}})}},n.\u0275fac=function(e){return new(e||n)(r(h),r(a),r(d),r(m),r(u),r(s),r(p))},n.\u0275cmp=w({type:n,selectors:[["app-signature-data"]],decls:1,vars:1,consts:[[3,"task","document","redirect",4,"ngIf"],[3,"redirect","task","document"]],template:function(e,t){e&1&&U(0,J,1,2,"app-document-view",0),e&2&&l("ngIf",t.task&&t.document)},dependencies:[M,L,V],styles:["[_nghost-%COMP%]{height:100%}"]}),n);G=k([E(),_("design:paramtypes",[h,a,d,m,u,s,p])],G);export{G as SignatureDataComponent};
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.