PageSourceSearch

https://app.scriptsure.com/static/js/15606.d016b759.chunk.js

js scriptsure.com collected 2026-10-04 04:06:30 UTC 17,081 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkscriptsure_react=self.webpackChunkscriptsure_react||[]).push([[15606],{2129:(e,t,s)=>{s.d(t,{F:()=>i});var r=s(65043),a=s(70347);const i=(e,t)=>{const s=(0,r.useMemo)((()=>e()),null!==t&&void 0!==t?t:[]);return(0,a.v)(s),s}},15606:(e,t,s)=>{s.r(t),s.d(t,{default:()=>se});var r=s(65043),a=s(62656),i=s(68703),n=s(1684),l=s(75109),o=s(97459),c=s(24858),d=s(73569),m=s(98139),u=s.n(m);const p=(0,r.createContext)(null),h=p.Provider,g=()=>{const e=(0,r.useContext)(p);if(!e)throw new Error("useReportDocumentModel must be used in ReportDocumentModelContext");return e};var x=s(92350),v=s(49724),y=s(53536),f=s(11373),j=s(76903),D=s(22664),b=s(70579);const w=(0,i.PA)((()=>{var e,t,s,r;const a=g(),{formatMessage:i}=(0,n.U4)(),{control:l,watch:d,handleSubmit:m}=(0,c.xW)(),p=(0,v.N)(),h=a.doctorsPractice.map((e=>{var t,s,r;return{value:String(e.id),name:null!==(t=e.fullName)&&void 0!==t?t:`${null!==(s=e.firstName)&&void 0!==s?s:""} ${null!==(r=e.lastName)&&void 0!==r?r:""}`.trim()}}));return(0,b.jsxs)("form",{onSubmit:m((e=>a.send((0,o.lk)(e)))),className:u()("flex gap-5 flex-col md:flex-row md:items-end items-start","md:!flex-col 2xl:!flex-row md:!items-start 2xl:!items-end bg-gray-50 md:!bg-primary","m-2 md:m-0 md:w-full","dark:bg-gray-900 md:drk:bg-gray-800"),children:[(0,b.jsxs)("div",{className:"flex gap-5 flex-col md:flex-row md:items-end items-start",children:[(0,b.jsx)(D.A.Control,{control:l,name:"practiceId",classes:{root:"!min-w-[204px]",button:"!mb-0"},helperTextProps:{forced:!1},container:p,label:i({id:"reports.measures.practice"}),items:(0,y.map)(a.practices,(e=>({value:String(null===e||void 0===e?void 0:e.id),name:null===e||void 0===e?void 0:e.name}))),selected:null===(e=a.currentPractice)||void 0===e?void 0:e.name}),(0,b.jsx)(D.A.Control,{selected:null!==(t=null===(s=a.currentPractice)||void 0===s?void 0:s.name)&&void 0!==t?t:null===h||void 0===h||null===(r=h[0])||void 0===r?void 0:r.name,control:l,container:p,label:i({id:"reports.physician"}),items:h,name:"userId",classes:{root:"!min-w-[204px]",button:"!mb-0"},helperTextProps:{forced:!1}}),(0,b.jsx)(D.A.Control,{classes:{root:"!min-w-[204px]",button:"!mb-0"},helperTextProps:{forced:!1},control:l,container:p,label:i({id:"reports.measures.documentType"}),items:(0,y.map)(a.documentTypes,(e=>({value:Number(e.documentType),name:String(e.name)}))),selected:i("measures.all"),name:"documentType"})]}),(0,b.jsxs)("div",{className:"flex gap-5 flex-col md:flex-row md:items-end items-start",children:[(0,b.jsx)(f.Ay.Control,{control:l,rules:{required:!0},inputProps:{label:i({id:"reports.measures.startDate"}),helperTextProps:{forced:!1}},name:"startDate",container:p,maximumDate:d("endDate")}),(0,b.jsx)(f.Ay.Control,{control:l,rules:{required:!0},inputProps:{label:i({id:"measures.endDate"}),helperTextProps:{forced:!1}},name:"endDate",container:p,minimumDate:d("startDate")}),(0,b.jsx)(j.A,{className:"capitalize !-mb-1 self-end",color:"alpha",size:"md",shape:"round",type:"submit",children:i({id:"measures.search"})})]})]})}));w.displayName="ReportsDocumentFilter";const _=w,A=(0,i.PA)((()=>{const e=g(),t=(0,v.N)();return(0,b.jsx)(d.A,{open:e.isOpenPopper,onClose:e.closePopper,container:t,className:u()("!absolute !mt-[53px] !w-[320px] overflow-visible"),classes:{backdrop:"!mt-[53px] rounded-b-md border dark:border-gray-700",focusTrap:"h-full"},openChildModal:!0,id:"search_settings_offcanvas","aria-labelledby":"search_settings_label","aria-describedby":"search_settings_for_documents",placement:"left",children:(0,b.jsx)(d.A.Body,{className:"pr-2 dark:text-gray-200 bg-gray-50 dark:bg-gray-900 h-full !p-1 !overflow-visible",children:(0,b.jsx)(x.n1,{contain:!0,restoreFocus:!0,children:(0,b.jsx)(_,{})})})})}));A.displayName="ModalOffCanvas";const N=A,P=(0,i.PA)((()=>{const e=g(),{formatMessage:t}=(0,n.U4)();return(0,b.jsx)(a.A.Footer,{children:(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsx)(j.A,{className:"uppercase px-2",color:"gray",variant:"outlined",shape:"round",type:"button",onClick:()=>e.cancel(),children:t({id:"measures.close"})})})})}));P.displayName="ModalFooter";const S=P;var k=s(64266),T=s(6397),C=s(94581),I=s(36858),L=s(58125),O=s(89579),R=s(26762),E=s(39654);const F=(0,i.PA)((()=>{const e=g(),t=(0,l.G)(),{formatMessage:s,locale:i}=(0,n.U4)(),{getValues:d}=(0,c.xW)(),m=(0,r.useMemo)((()=>[{Header:s({id:"measures.created"}),sortDescFirst:!0,accessor:"createdAt",Cell:({row:{original:e}})=>(0,b.jsx)(O.XU,{date:null===e||void 0===e?void 0:e.createdAt,width:"full"}),classes:{header:"datagrid-table_header __name break-words",cell:"datagrid-table_cell __text break-words"},style:{minWidth:100,maxWidth:200}},{Header:s({id:"measures.title"}),accessor:"title",classes:{header:"datagrid-table_header __name break-words",cell:"datagrid-table_cell __text break-words"},style:{minWidth:100,maxWidth:200},sortType:E.p},{id:s({id:"measures.actions"}),disableSortBy:!0,classes:{header:"datagrid-table_header",cell:"datagrid-table_cell __action"},Header:()=>(0,b.jsx)("span",{className:"sr-only",children:s({id:"measures.actions"})}),Cell:({row:{original:t}})=>(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(R.Ay,{className:"!capitalize",content:s({id:"reports.download"}),children:(0,b.jsx)(j.A,{variant:"text",color:"gray",shape:"circle",className:"ml-3",onClick:()=>e.downloadDocument(t),children:(0,b.jsx)(k.A,{as:T.A,className:"w-5 h-5"})})}),(0,b.jsx)(R.Ay,{className:"!capitalize",content:s({id:"reports.delete.document"}),children:(0,b.jsx)(j.A,{variant:"text",color:"gray",shape:"circle",className:"ml-3",onClick:()=>{e.deleteDocument((0,o.lk)(d()),t)},children:(0,b.jsx)(k.A,{as:C.A,className:"w-5 h-5"})})})]}),style:{width:50}}]),[i]);(0,r.useEffect)((()=>{e.setSelectedDocuments([])}),[t.md]);const u=(0,b.jsx)(L.Ay,{classes:{root:"datagrid __border",container:"datagrid_container",table:"datagrid-table",thead:"datagrid-table_thead",row:"datagrid-table_row",column:"datagrid-table_column",columnSorted:"__sorted",pagination:"datagrid-pagination"},columns:m,data:e.searchResults,pagination:{pageIndex:0,pageSize:10},sortable:!0,selectable:!0,onSelect:e.setSelectedDocuments}),p=e.searchResults.slice().sort(((e,t)=>new Date(t.createdAt||0).valueOf()-new Date(e.createdAt||0).valueOf())).map((t=>(0,b.jsxs)("div",{className:"flex items-center justify-between py-2 px-4 even:bg-gray-100 dark:even:bg-gray-900",children:[(0,b.jsxs)("div",{className:"flex gap-2",children:[(0,b.jsx)("input",{type:"checkbox",className:"form-checkbox",onChange:()=>e.toggleSelectedDocument(t)}),(0,b.jsxs)("div",{className:"flex flex-col font-semibold items-start",children:[(0,b.jsx)("span",{children:t.title}),(0,b.jsx)("span",{className:"text-sm italic text-gray-600",children:(0,b.jsx)(O.Q0,{date:String(null===t||void 0===t?void 0:t.createdAt),timeWidth:"medium",dateWidth:"full"})})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-3",children:[(0,b.jsx)(j.A,{variant:"text",color:"gray",shape:"circle",className:"ml-3",onClick:()=>e.downloadDocument(t),children:(0,b.jsx)(k.A,{as:T.A,className:"w-5 h-5"})}),(0,b.jsx)(R.Ay,{className:"!capitalize",content:s({id:"reports.delete.document"}),children:(0,b.jsx)(j.A,{variant:"text",color:"gray",shape:"circle",className:"ml-3",onClick:()=>e.deleteDocument((0,o.lk)(d()),t),children:(0,b.jsx)(k.A,{as:C.A,className:"w-5 h-5"})})})]})]}))),h=t.md?u:(0,b.jsx)("div",{children:p});return(0,b.jsx)(a.A.Body,{className:"w-full",children:(0,b.jsx)("div",{children:(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[t.md&&(0,b.jsx)(_,{}),(0,b.jsxs)("div",{className:"m-4 xl:text-lg font-semibold flex justify-between items-center",children:[(0,b.jsx)("p",{children:s({id:"measures.results"})}),e.hasSelectedDocuments&&(0,b.jsx)(j.A,{variant:"outlined",color:"green",onClick:()=>e.deleteSelectedDocuments((0,o.lk)(d())),size:"sm",children:s({id:"reports.delete.document.all"})})]}),e.noResults?(0,b.jsxs)("div",{className:"flex items-center w-full lg:mt-5 lg:ml-5 opacity-20 drop-shadow-md",children:[(0,b.jsx)(k.A,{as:I.A,className:"h-10 w-10 mx-2 my-4"}),(0,b.jsx)("p",{className:"capitalize text-3xl",children:s({id:"measures.noResults"})})]}):h]})})})}));F.displayName="ModalContent";const Z=F;var z=s(22258);const M=(0,i.PA)((()=>{const e=g(),t=(0,l.G)(),{formatMessage:s}=(0,n.U4)();return(0,b.jsx)(a.A.Header,{showClose:!0,onClose:()=>e.cancel(),className:"text-xl rounded-t",children:(0,b.jsxs)(a.A.Title,{className:"flex items-center capitalize",children:[!t.md&&(0,b.jsx)(j.A,{color:"black",shape:"round",variant:"text",className:"mr-2",onClick:()=>e.toggleIsOpenPopper(),children:(0,b.jsx)(k.A,{as:z.A,className:"w-6 h-6 text-gray-700 dark:text-primary "})}),(0,b.jsx)("span",{children:s("reports.measures.documents")})]})})}));M.displayName="ModalHeader";const U=M;var W=s(23246),H=s(2129),B=s(68154),G=s(64812),$=s(86015),V=s(96646),X=s(59667),q=s(6164),K=s(67421),Q=s(83160),Y=s(36870),J=s(76859);class ee{get searchResults(){return this._searchResults}get noResults(){return!this.searchResults.length}get selectedDocuments(){return this._selectedDocuments}get hasSelectedDocuments(){return!!this._selectedDocuments.length}isSelected(e){return!!this._selectedDocuments.find((t=>t.documentId===e.documentId))}setSelectedDocuments(e){this._selectedDocuments=e}toggleSelectedDocument(e){this.isSelected(e)?(0,y.remove)(this._selectedDocuments,(t=>t.documentId===e.documentId)):this._selectedDocuments.push(e)}get isInitialized(){return this._isInitialized}get isLoading(){return this._isLoading}get documentTypes(){return[{documentType:0,name:"All"},...this._documentTypes]}get doctorsPractice(){return this._doctorsPractice}get isOpenPopper(){return this._isOpenPopper}toggleIsOpenPopper(){this._isOpenPopper=!this._isOpenPopper}closePopper(){this._isOpenPopper=!1}get errorService(){return X.I.instance()}get reportService(){return V.G.instance()}get currentEntityService(){return $.M.instance()}get currentPractice(){return this.currentEntityService.currentPractice}get currentUser(){return this.currentEntityService.currentUser}get practices(){return this.currentEntityService.currentUserPracticesOrNull}constructor({dialog:e}){this._searchResults=[],this._selectedDocuments=[],this._isInitialized=!1,this._isLoading=!1,this._documentTypes=[],this._doctorsPractice=[],this._isOpenPopper=!1,this.dialog=void 0,this.dialogs=new Q.l,this.dialog=e,(0,G.l_)(this,{},{autoBind:!0})}getInitialFormValues(){var e;return{practiceId:null===(e=this.currentPractice)||void 0===e?void 0:e.id,userId:this.currentUser.id,startDate:new Date,endD
1ate:new Date,lastDocumentId:0,documentType:void 0}}*init(){try{yield this.getDocumentsTypes(),yield this.setPracticalDoctors(this.currentPractice.id),this._isInitialized=!0}catch(e){this.errorService.handleError(e),this.cancel()}}*setPracticalDoctors(e){this._doctorsPractice=yield this.reportService.getDoctorsPractice(e)}*getDocumentsTypes(){this._isLoading=!0;try{this._documentTypes=yield this.reportService.getDocumentTypes()}catch(e){this.errorService.handleError(e)}finally{this._isLoading=!1}}*send(e){try{this._isLoading=!0,this.isOpenPopper&&this.toggleIsOpenPopper(),yield this.searchDocuments({...e,practiceId:Number(e.practiceId),documentType:Number(e.documentType)?e.documentType:void 0,endDate:(0,Y.D)(e.endDate),startDate:(0,J.o)(e.startDate)})}catch(t){this.errorService.handleError(t)}finally{this._isLoading=!1}}*deleteSelectedDocuments(e){if(!(yield this.dialogs.confirm.show({content:new K.Z("reports.delete.document.confirm"),title:new K.Z("reports.delete.document"),ok:new K.Z("delete")})))return;this._isLoading=!0;const t=this.selectedDocuments.map((e=>({documentType:e.documentType,key:e.key})));try{yield this.reportService.deleteDocuments(t),this._selectedDocuments=[],q.Ew.success({content:new K.Z("reports.delete.document.success")}),yield this.searchDocuments({...e})}catch(s){this.errorService.handleError(s)}finally{this._isLoading=!1}}*deleteDocument(e,t){if(!(yield this.dialogs.confirm.show({content:new K.Z("reports.delete.document.confirm"),title:new K.Z("reports.delete.document"),ok:new K.Z("delete")})))return;this._isLoading=!0;const s=[{documentType:t.documentType,key:t.key}];try{yield this.reportService.deleteDocuments(s),q.Ew.success({content:new K.Z("reports.delete.document.success")}),yield this.searchDocuments({...e})}catch(r){this.errorService.handleError(r)}finally{this._isLoading=!1}}*searchDocuments(e){this._searchResults=yield this.reportService.getDocuments(e)}*downloadDocument(e){this._isLoading=!0;try{yield this.reportService.downloadDocument(e)}catch(t){this.errorService.handleError(t)}finally{this._isLoading=!1}}cancel(){var e;null===(e=this.dialog)||void 0===e||e.close(null)}}W.h.preload(["confirm"]);const te=(0,i.PA)((({dialog:e})=>{const t=(0,H.F)((()=>new ee(e.config)),[e.config]),s=(0,l.G)(),[i,d]=(0,n.iJ)(null),[m]=(0,r.useState)((()=>(0,o.m6)(t.getInitialFormValues()))),u=(0,c.mN)({mode:"onChange",defaultValues:m});return(0,r.useEffect)((()=>{s.md&&t.isOpenPopper&&t.toggleIsOpenPopper()}),[s.md]),(0,b.jsxs)(a.A,{innerRef:d,isInitialized:t.isInitialized,open:e.isOpen,className:"relative !min-w-[370px] xs:!min-w-[420px] !min-h-[500px] sm:!min-w-[610px] md:!min-w-[760px] bg-primary",children:[(0,b.jsx)(v.t,{value:i,children:(0,b.jsx)(h,{value:t,children:(0,b.jsxs)(c.Op,{...u,children:[(0,b.jsx)(U,{}),(0,b.jsx)(Z,{}),(0,b.jsx)(S,{}),(0,b.jsx)(N,{})]})})}),(0,b.jsx)(a.A.Loader,{isLoading:t.isLoading}),(0,b.jsx)(B.X,{dialogCreator:t.dialogs})]})}));te.displayName="ReportDocumentModal";const se=te},15766:(e,t,s)=>{s.d(t,{A:()=>l});s(65043);var r=s(68703),a=s(88143),i=s(70579);const n=(0,r.PA)((({date:e,width:t,shortYear:s=!0})=>{if(!e)return null;const{formatDate:r}=a.e.instance();return(0,i.jsx)(i.Fragment,{children:r(e,t,s)})}));n.displayName="FormattedDate";const l=n},39654:(e,t,s)=>{s.d(t,{lc:()=>n,p:()=>i,s2:()=>a});var r=s(97459);const a=e=>e.filter((e=>!e.disabled)),i=(e,t,s,a)=>(0,r.jL)(e.values[s],t.values[s],a),n=(e,t,s)=>{var r,a;const i=Number(null!==(r=e.values[s])&&void 0!==r?r:-1);return Number(null!==(a=t.values[s])&&void 0!==a?a:-1)-i}},52066:(e,t,s)=>{s.d(t,{A:()=>o});s(65043);var r=s(68703),a=s(95788),i=s(70347),n=s(70579);const l=(0,r.PA)((({dialogCreator:e})=>((0,i.v)(e),(0,n.jsx)(n.Fragment,{children:e.activeDialogs.map((e=>(0,n.jsx)(a.A,{dialog:e},e.key)))}))));l.displayName="DialogCreatorRender";const o=l},68154:(e,t,s)=>{s.d(t,{X:()=>r.A,o:()=>a.A});var r=s(52066),a=s(95788)},89579:(e,t,s)=>{s.d(t,{XU:()=>r.A,Q0:()=>o,ib:()=>d});var r=s(15766),a=(s(65043),s(68703)),i=s(88143),n=s(70579);const l=(0,a.PA)((({date:e,dateWidth:t,timeWidth:s,shortYear:r})=>{if(!e)return null;const{formatDateTime:a}=i.e.instance();return(0,n.jsx)(n.Fragment,{children:a(e,t,s,r)})}));l.displayName="FormattedDateTime";const o=l,c=(0,a.PA)((({date:e,width:t})=>{if(!e)return null;const{formatTime:s}=i.e.instance();return(0,n.jsx)(n.Fragment,{children:s(e,t)})}));c.displayName="FormattedTime";const d=c},95788:(e,t,s)=>{s.d(t,{A:()=>c});var r=s(65043),a=s(68703),i=s(63632),n=s(40966),l=s(70579);const o=(0,a.PA)((({dialog:e})=>{const[t,s]=(0,r.useState)(null);return(0,r.useEffect)((()=>{let t=!0;return s(null),(0,n.pW)(e.componentLoader).then((({default:e})=>{t&&s((()=>e))})).catch((s=>{t&&e.error(s)})),()=>{t=!1}}),[e]),e.isActive&&null!==t?(0,l.jsx)(i.tH,{fallbackRender:()=>null,onError:t=>e.error(t),children:(0,l.jsx)(r.Suspense,{fallback:null,children:(0,l.jsx)(t,{dialog:e})})}):null}));o.displayName="DialogRender";const c=o},96646:(e,t,s)=>{s.d(t,{G:()=>d});var r=s(64812),a=s(92373),i=s(1345),n=s(72582),l=s(80957),o=s(15396),c=s(36892);class d{static instance(){return a.y.instance.get("reportService")}constructor(){(0,r.l_)(this,{},{autoBind:!0})}*getAuditLogTypes(){var e;return null!==(e=(yield(0,n.s)((0,i.D3)().pipe((0,l.Z)([])))).response)&&void 0!==e?e:[]}*searchAuditLogPaginated(e){return(yield(0,n.s)((0,i.K5)(e).pipe((0,l.Z)({})))).response}*getPhysicians(e){var t;return null!==(t=(yield(0,n.s)((0,o.Io)(e).pipe((0,l.Z)({})))).response)&&void 0!==t?t:[]}*getHospitals(e){var t;return null!==(t=(yield(0,n.s)((0,o.om)(e).pipe((0,l.Z)({})))).response)&&void 0!==t?t:[]}*getDoctorsPractice(e){var t;return null!==(t=(yield(0,n.s)((0,c.us)(e).pipe((0,l.Z)({})))).response)&&void 0!==t?t:[]}*getDocumentTypes(){var e;return null!==(e=(yield(0,n.s)((0,o.ph)().pipe((0,l.Z)([])))).response)&&void 0!==e?e:[]}*getDocuments(e){var t;return null!==(t=(yield(0,n.s)((0,o.HK)(e).pipe((0,l.Z)([])))).response)&&void 0!==t?t:[]}*deleteDocuments(e){var t;return null!==(t=(yield(0,n.s)((0,o.Ww)(e).pipe((0,l.Z)([])))).response)&&void 0!==t?t:[]}*downloadDocument(e){const t=yield(0,n.s)((0,o.El)(e).pipe((0,l.Z)([]))),s=new Blob([t.response],{type:"application/pdf"});let r=`doc-${+new Date}.pdf`;e.title&&e.createdAt&&(r=`${e.title.replace(/ /g,"-")}-${String(e.createdAt).slice(0,10)}.pdf`);const a=document.createElement("a");a.href=URL.createObjectURL(s),a.download=r,a.click()}}a.y.setSetupFn("reportService",(()=>new d))}}]);
2//# sourceMappingURL=15606.d016b759.chunk.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.